const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-MpsxZlHl.js","assets/vendor-react-FyxEPqXS.js","assets/AnswerBlock-BPh9td_1.js","assets/vendor-i18n-DgYsu2P2.js","assets/AnswerBlock-7WA5goIU.css","assets/useSEOMetadata-S1YyLuXn.js","assets/Dashboard-B0D0HRxR.css","assets/Whitepaper-BPSTXyBY.js","assets/vendor-utils-BPQtUf6t.js","assets/vendor-observability-PbcLCb4f.js","assets/vendor-icons-qx5LJBIW.js","assets/Documentation-BWHwogfJ.js","assets/ApiSubscription-DNEDMBx-.js","assets/AboutUs-C5AnboXU.js","assets/Legal-tPJjfoYj.js","assets/Terms-CP15xVUx.js","assets/Privacy-ILadws_K.js","assets/Accessibility-QSytKUWB.js","assets/SLA-CLj5hICS.js","assets/DPA-DiqiDCXM.js","assets/AUP-D3xUjD67.js","assets/MSA-DLH0l2XW.js","assets/FAQ-Drbf5NRQ.js","assets/TzurWallet-T1X0d5vl.js","assets/index-D2dj3cjx.js","assets/index-BH8NLF0z.css","assets/LazyImage-2-cRlD9q.js","assets/Starfield-B2xBpo9n.js","assets/Starfield-e90VrjmE.css","assets/index-2uu3o9-Q.js","assets/index-Y-Juwx_f.css","assets/sentry-BCdfHZxG.js","assets/index-DFkh5veL.js","assets/resource-metrics-BcNETgYp.js","assets/index-sq6EvXAh.js","assets/index-BBXEktWJ.js"])))=>i.map(i=>d[i]); import{d as hr,e as mr,g as pr,c as u,L as We,r as Ms,u as fr,b as gr,a as Z,N as br,R as ze,B as yr}from"./vendor-react-FyxEPqXS.js";import{u as le,a as Hs,i as vr}from"./vendor-i18n-DgYsu2P2.js";import{p as vn}from"./vendor-utils-BPQtUf6t.js";import{c as kr}from"./vendor-observability-PbcLCb4f.js";import{R as Sr,g as wr,i as _r,p as Tr,L as Er,a as Cr,F as xr,b as Ar,h as Br,k as Rr,W as Ir,U as Pr,m as Lr,M as Dr,S as Nr}from"./vendor-icons-qx5LJBIW.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&a(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function a(s){if(s.ep)return;s.ep=!0;const i=t(s);fetch(s.href,i)}})();const Or="modulepreload",Mr=function(n){return"/"+n},Ea={},k=function(e,t,a){let s=Promise.resolve();if(t&&t.length>0){let m=function(h){return Promise.all(h.map(f=>Promise.resolve(f).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=o?.nonce||o?.getAttribute("nonce");s=m(t.map(h=>{if(h=Mr(h),h in Ea)return;Ea[h]=!0;const f=h.endsWith(".css"),y=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${y}`))return;const S=document.createElement("link");if(S.rel=f?"stylesheet":Or,f||(S.as="script"),S.crossOrigin="",S.href=h,l&&S.setAttribute("nonce",l),document.head.appendChild(S),f)return new Promise((v,E)=>{S.addEventListener("load",v),S.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${h}`)))})}))}function i(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return s.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return e().catch(i)})};var kn={exports:{}},At={};var Ca;function Hr(){if(Ca)return At;Ca=1;var n=hr(),e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,s=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function o(l,m,h){var f,y={},S=null,v=null;h!==void 0&&(S=""+h),m.key!==void 0&&(S=""+m.key),m.ref!==void 0&&(v=m.ref);for(f in m)a.call(m,f)&&!i.hasOwnProperty(f)&&(y[f]=m[f]);if(l&&l.defaultProps)for(f in m=l.defaultProps,m)y[f]===void 0&&(y[f]=m[f]);return{$$typeof:e,type:l,key:S,ref:v,props:y,_owner:s.current}}return At.Fragment=t,At.jsx=o,At.jsxs=o,At}var xa;function Fr(){return xa||(xa=1,kn.exports=Hr()),kn.exports}var d=Fr(),Gt={},Aa;function jr(){if(Aa)return Gt;Aa=1;var n=mr();return Gt.createRoot=n.createRoot,Gt.hydrateRoot=n.hydrateRoot,Gt}var Ur=jr();const Wr=pr(Ur),zr="_button_nzd27_31",Vr="_primary_nzd27_93",qr="_secondary_nzd27_127",$r="_ghost_nzd27_159",Gr="_danger_nzd27_189",Kr="_sm_nzd27_231",Zr="_md_nzd27_245",Yr="_lg_nzd27_259",Jr="_disabled_nzd27_281",Xr="_fullWidth_nzd27_301",Qr="_iconOnly_nzd27_319",eo="_iconWrapper_nzd27_353",to="_iconLeft_nzd27_373",no="_iconRight_nzd27_375",ao="_content_nzd27_389",Ae={button:zr,primary:Vr,secondary:qr,ghost:$r,danger:Gr,sm:Kr,md:Zr,lg:Yr,disabled:Jr,fullWidth:Xr,iconOnly:Qr,iconWrapper:eo,iconLeft:to,iconRight:no,content:ao},so=u.forwardRef(function({variant:e="primary",size:t="md",leftIcon:a,rightIcon:s,fullWidth:i=!1,iconOnly:o=!1,disabled:l,className:m,children:h,type:f="button",...y},S){const v=[Ae.button,Ae[e],Ae[t],l&&Ae.disabled,i&&Ae.fullWidth,o&&Ae.iconOnly,m].filter(Boolean).join(" ");return o?d.jsx("button",{ref:S,type:f,className:v,disabled:l,...y,children:d.jsx("span",{className:Ae.iconWrapper,children:a||s})}):d.jsxs("button",{ref:S,type:f,className:v,disabled:l,...y,children:[a&&d.jsx("span",{className:Ae.iconLeft,children:a}),h&&d.jsx("span",{className:Ae.content,children:h}),s&&d.jsx("span",{className:Ae.iconRight,children:s})]})});so.displayName="Button";const io="_ctaButton_smcig_15",ro="_ctaGradient_smcig_1",oo="_primary_smcig_58",co="_secondary_smcig_70",lo="_buttonText_smcig_75",uo="_sm_smcig_89",ho="_md_smcig_94",mo="_lg_smcig_99",po="_fullWidth_smcig_108",fo="_starsContainer_smcig_142",go="_stars_smcig_142",bo="_ctaStarScroll_smcig_1",yo="_ctaStarRotate_smcig_1",vo="_glow_smcig_191",ko="_glowCircle_smcig_198",So="_ctaGlowPulse_smcig_1",wo="_glowPink_smcig_206",_o="_glowPurple_smcig_210",To="_disabled_smcig_255",Eo="_loading_smcig_277",me={ctaButton:io,ctaGradient:ro,primary:oo,secondary:co,buttonText:lo,sm:uo,md:ho,lg:mo,fullWidth:po,starsContainer:fo,stars:go,ctaStarScroll:bo,ctaStarRotate:yo,glow:vo,glowCircle:ko,ctaGlowPulse:So,glowPink:wo,glowPurple:_o,disabled:To,loading:Eo},Co=u.forwardRef(function({variant:e="primary",size:t="md",fullWidth:a=!1,loading:s=!1,disabled:i,className:o,children:l,type:m="button",...h},f){const y=i||s,S=e==="primary",v=[me.ctaButton,me[e],me[t],a&&me.fullWidth,y&&me.disabled,s&&me.loading,o].filter(Boolean).join(" ");return d.jsxs("button",{ref:f,type:m,className:v,disabled:y,...h,children:[d.jsx("strong",{className:me.buttonText,children:l}),S&&d.jsx("div",{className:me.starsContainer,children:d.jsx("div",{className:me.stars})}),S&&d.jsxs("div",{className:me.glow,children:[d.jsx("div",{className:`${me.glowCircle} ${me.glowPink}`}),d.jsx("div",{className:`${me.glowCircle} ${me.glowPurple}`})]})]})});Co.displayName="CtaButton";const xo="_wrapper_ppy8b_39",Ao="_menu_ppy8b_57",Bo="_menuLeft_ppy8b_97",Ro="_menuRight_ppy8b_105",Io="_item_ppy8b_121",Po="_itemActive_ppy8b_225",Lo="_itemDanger_ppy8b_237",Do="_icon_ppy8b_263",No="_label_ppy8b_301",Oo="_separator_ppy8b_325",Be={wrapper:xo,menu:Ao,menuLeft:Bo,menuRight:Ro,item:Io,itemActive:Po,itemDanger:Lo,icon:Do,label:No,separator:Oo},Mo=({trigger:n,items:e,isOpen:t,onToggle:a,onClose:s,position:i="left",className:o="",menuClassName:l=""})=>{const{t:m}=le(),h=u.useRef(null);u.useEffect(()=>{const E=_=>{h.current&&!h.current.contains(_.target)&&s()};return t&&document.addEventListener("mousedown",E),()=>{document.removeEventListener("mousedown",E)}},[t,s]),u.useEffect(()=>{const E=_=>{_.key==="Escape"&&t&&s()};return document.addEventListener("keydown",E),()=>{document.removeEventListener("keydown",E)}},[t,s]);const f=u.useCallback(E=>{E.onClick&&E.onClick(),s()},[s]),y=E=>{const _=[Be.item,E.variant==="danger"&&Be.itemDanger,E.active&&Be.itemActive].filter(Boolean).join(" "),w=d.jsxs(d.Fragment,{children:[E.icon&&d.jsx("span",{className:Be.icon,children:E.icon}),d.jsx("span",{className:Be.label,children:m(E.labelKey)})]});return E.href?d.jsx(We,{to:E.href,className:_,onClick:s,children:w},E.key):d.jsx("button",{type:"button",className:_,onClick:()=>f(E),children:w},E.key)},S=[Be.menu,i==="left"?Be.menuLeft:Be.menuRight,l].filter(Boolean).join(" "),v=u.isValidElement(n)?u.cloneElement(n,{onClick:a}):n;return d.jsxs("div",{ref:h,className:`${Be.wrapper} ${o}`,children:[v,t&&d.jsx("div",{className:S,role:"menu",children:e.map((E,_)=>d.jsxs("div",{children:[y(E),E.separator&&_(n.LOW="LOW",n.MEDIUM="MEDIUM",n.HIGH="HIGH",n.CRITICAL="CRITICAL",n))(ft||{}),fe=(n=>(n.RENDER="RENDER",n.LIFECYCLE="LIFECYCLE",n.EVENT_HANDLER="EVENT_HANDLER",n.ASYNC_OPERATION="ASYNC_OPERATION",n.WEBGL_THREEJS="WEBGL_THREEJS",n.WEBSOCKET="WEBSOCKET",n.STATE_MANAGEMENT="STATE_MANAGEMENT",n.ROUTING="ROUTING",n.UNKNOWN="UNKNOWN",n))(fe||{});function Ge(n,e){return e.some(t=>n.includes(t))}function Ho(n,e){return Ge(n,["webgl","three","renderer","shader","buffer","texture","geometry","material"])||Ge(e,["webgl","three","renderer"])}function Fo(n){return Ge(n,["render","component","hook","state","effect"])}function jo(n){return Ge(n,["event","click","input","change"])}function Uo(n){return Ge(n,["fetch","api","network","timeout","promise"])}function Wo(n){return Ge(n,["websocket","socket","connection"])}function zo(n){return Ge(n,["context","reducer","store","state"])}function Vo(n){return Ge(n,["route","navigation","router"])}function qo(n){const e=(n?.message||"").toLowerCase(),t=n?.stack?.toLowerCase()||"";return Ho(e,t)?fe.WEBGL_THREEJS:Fo(e)?fe.LIFECYCLE:jo(e)?fe.EVENT_HANDLER:Uo(e)?fe.ASYNC_OPERATION:Wo(e)?fe.WEBSOCKET:zo(e)?fe.STATE_MANAGEMENT:Vo(e)?fe.ROUTING:fe.UNKNOWN}function $o(n,e){const t=(n.message||"").toLowerCase(),a=n.stack?.toLowerCase()||"";return t.includes("cannot read properties of undefined")||t.includes("cannot read properties of null")||t.includes("maximum update depth exceeded")||t.includes("webgl context lost")||t.includes("out of memory")||a.includes("maximum update depth exceeded")?ft.CRITICAL:e===fe.WEBGL_THREEJS||e===fe.STATE_MANAGEMENT||t.includes("render")||t.includes("component")?ft.HIGH:e===fe.ASYNC_OPERATION||e===fe.WEBSOCKET||t.includes("network")||t.includes("timeout")?ft.MEDIUM:ft.LOW}function Go(n){return n.severity!==ft.CRITICAL&&n.retryCount!==void 0&&n.retryCount<3}function Ko(n){return Math.min(1e3*2**n,1e4)}const Zo=/^[a-zA-Z_:][a-zA-Z0-9_:]*$/;class Zn{name;help;labels;values=new Map;constructor(e,t,a){if(!Zo.test(e))throw new Error(`Invalid metric name: ${e}. Must match Prometheus naming convention: [a-zA-Z_:][a-zA-Z0-9_:]*`);this.name=e,this.help=t,this.labels=a,this.values.set("",0)}getName(){return this.name}getHelp(){return this.help}getLabels(){return this.labels}get(e){const t=this.getLabelKey(e);return this.values.get(t)||0}inc(e){const t=this.getLabelKey(e),a=this.values.get(t)||0;this.values.set(t,a+1)}reset(e){const t=this.getLabelKey(e);this.values.set(t,0)}resetAll(){this.values.clear(),this.values.set("",0)}getLabelKey(e){if(!this.labels||!e)return"";for(const a of this.labels)if(!(a in e))throw new Error(`Missing label value for label: ${a}`);return[...this.labels].sort().map(a=>`${a}=${e[a]}`).join(",")}parseLabelKey(e){const t={};if(!e)return t;const a=e.split(",");for(const s of a){const[i,o]=s.split("=");i&&o&&(t[i]=o)}return t}}class Ot extends Zn{constructor(e,t,a,s){super(e,t,a)}add(e,t){if(e<0)throw new Error("Counter value cannot be negative");const a=this.getLabelKey(t),s=this.values.get(a)||0;this.values.set(a,s+e)}getAll(){const e=[];for(const[t,a]of this.values.entries())if(t==="")(!this.labels||this.labels.length===0)&&e.push({labels:{},value:a});else{const s=this.parseLabelKey(t);e.push({labels:s,value:a})}return e}}class Mt extends Zn{constructor(e,t,a,s){super(e,t,a)}set(e,t){const a=this.getLabelKey(t);this.values.set(a,e)}dec(e){const t=this.getLabelKey(e),a=this.values.get(t)||0;this.values.set(t,a-1)}add(e,t){const a=this.getLabelKey(t),s=this.values.get(a)||0;this.values.set(a,s+e)}sub(e,t){const a=this.getLabelKey(t),s=this.values.get(a)||0;this.values.set(a,s-e)}getAll(){const e=[];for(const[t,a]of this.values.entries())if(t==="")e.push({labels:{},value:a});else{const s=this.parseLabelKey(t);e.push({labels:s,value:a})}return e}}const Yo=[.005,.01,.025,.05,.1,.25,.5,1,2.5,5,10];class gt extends Zn{buckets;observations=new Map;sums=new Map;counts=new Map;constructor(e,t,a,s,i){super(e,t,s),this.validateBuckets(a),this.buckets=a||Yo,this.observations.set("",[]),this.sums.set("",0),this.counts.set("",0)}observe(e,t){if(e<0)throw new Error("Histogram value cannot be negative");const a=this.getLabelKey(t),s=this.observations.get(a)||[];s.push(e),this.observations.set(a,s);const i=this.sums.get(a)||0;this.sums.set(a,i+e);const o=this.counts.get(a)||0;this.counts.set(a,o+1)}getBuckets(e){const t=this.getLabelKey(e),a=this.observations.get(t)||[],s=[];for(const i of this.buckets){const o=a.filter(l=>l<=i).length;s.push({le:i,count:o})}return s.push({le:Number.POSITIVE_INFINITY,count:a.length}),s}getSum(e){const t=this.getLabelKey(e);return this.sums.get(t)||0}getCount(e){const t=this.getLabelKey(e);return this.counts.get(t)||0}getObservations(e){const t=this.getLabelKey(e);return[...this.observations.get(t)||[]]}reset(e){const t=this.getLabelKey(e);this.observations.set(t,[]),this.sums.set(t,0),this.counts.set(t,0)}resetAll(){this.observations.clear(),this.sums.clear(),this.counts.clear(),this.observations.set("",[]),this.sums.set("",0),this.counts.set("",0)}getAll(){const e=[],t=new Set([...this.observations.keys(),...this.sums.keys(),...this.counts.keys()]);for(const a of t){const s=a===""?{}:this.parseLabelKey(a),i=this.getBuckets(a===""?void 0:s),o=this.sums.get(a)||0,l=this.counts.get(a)||0;e.push({labels:s,buckets:i,sum:o,count:l})}return e}getBucketBoundaries(){return[...this.buckets]}validateBuckets(e){if(e){if(e.length===0)throw new Error("Buckets array cannot be empty");for(let t=0;t0&&e[t]<=e[t-1])throw new Error("Buckets must be sorted in ascending order")}}}}class bt{static instance;metrics=new Map;constructor(){}static getInstance(){return bt.instance||(bt.instance=new bt),bt.instance}register(e){const t=e.getName();if(this.metrics.has(t))throw new Error(`Metric ${t} is already registered`);this.metrics.set(t,e)}get(e){return this.metrics.get(e)}getCounter(e){const t=this.get(e);return t instanceof Ot?t:void 0}getGauge(e){const t=this.get(e);return t instanceof Mt?t:void 0}getHistogram(e){const t=this.get(e);return t instanceof gt?t:void 0}has(e){return this.metrics.has(e)}getAll(){return Array.from(this.metrics.values())}getAllCounters(){return this.getAll().filter(e=>e instanceof Ot)}getAllGauges(){return this.getAll().filter(e=>e instanceof Mt)}getAllHistograms(){return this.getAll().filter(e=>e instanceof gt)}clear(){this.metrics.clear()}size(){return this.metrics.size}getNames(){return Array.from(this.metrics.keys())}}class yt{static instance;registry;config;constructor(e={}){this.config={enabled:e.enabled??!0,maxMetrics:e.maxMetrics??1e3,debug:e.debug??!1},this.registry=bt.getInstance()}static getInstance(e){return yt.instance||(yt.instance=new yt(e)),yt.instance}counter(e,t,a){if(!this.config.enabled)return new Ot(e,t,a,this.registry);const s=this.registry.get(e);if(s&&s instanceof Ot)return s;if(s)throw new Error(`Metric ${e} already exists with different type`);const i=new Ot(e,t,a,this.registry);return this.registry.register(i),i}gauge(e,t,a){if(!this.config.enabled)return new Mt(e,t,a,this.registry);const s=this.registry.get(e);if(s&&s instanceof Mt)return s;if(s)throw new Error(`Metric ${e} already exists with different type`);const i=new Mt(e,t,a,this.registry);return this.registry.register(i),i}histogram(e,t,a,s){if(!this.config.enabled)return new gt(e,t,a,s,this.registry);const i=this.registry.get(e);if(i&&i instanceof gt)return i;if(i)throw new Error(`Metric ${e} already exists with different type`);const o=new gt(e,t,a,s,this.registry);return this.registry.register(o),o}getAllMetrics(){return this.registry.getAll()}getMetric(e){return this.registry.get(e)}getHistogram(e){const t=this.getMetric(e);return t instanceof gt?t:void 0}clear(){this.registry.clear()}updateConfig(e){this.config={...this.config,...e}}getConfig(){return{...this.config}}}const X=yt.getInstance(),Jo={},Yn={serviceName:"blocksight-frontend",serviceVersion:"1.0.0",otlpEndpoint:"/api/traces",samplingRate:.1,sampleErrors:!0,enabled:!0};let vt=null,tt=Yn;function Jn(){try{return typeof window<"u"&&"opentelemetry"in window}catch{return!1}}function Xo(n){if(!Jn())return Jo?.VITE_ENABLE_TRACING==="true"&&console.warn("[Tracing] OpenTelemetry packages not installed. Install with: npm install @opentelemetry/api @opentelemetry/sdk-trace-web @opentelemetry/exporter-trace-otlp-http @opentelemetry/resources @opentelemetry/semantic-conventions"),Dn();try{const{WebTracerProvider:e,BatchSpanProcessor:t}=require("@opentelemetry/sdk-trace-web"),{OTLPTraceExporter:a}=require("@opentelemetry/exporter-trace-otlp-http"),{Resource:s}=require("@opentelemetry/resources"),{SemanticResourceAttributes:i}=require("@opentelemetry/semantic-conventions"),{trace:o}=require("@opentelemetry/api"),l=new s({[i.SERVICE_NAME]:n.serviceName,[i.SERVICE_VERSION]:n.serviceVersion}),m=new a({url:n.otlpEndpoint}),h=new e({resource:l});return h.addSpanProcessor(new t(m)),h.register(),{tracer:o.getTracer(n.serviceName,n.serviceVersion),provider:h,exporter:m,config:n}}catch(e){return console.error("[Tracing] Failed to initialize OpenTelemetry:",e),Dn()}}function Dn(){const n={setAttribute:()=>{},setAttributes:()=>{},addEvent:()=>{},setStatus:()=>{},recordException:()=>{},updateName:()=>{},end:()=>{},isRecording:()=>!1,spanContext:()=>({traceId:"00000000000000000000000000000000",spanId:"0000000000000000",traceFlags:0})};return{tracer:{startSpan:()=>n},provider:null,exporter:null,config:tt}}function Qo(n){if(tt={...Yn,...n},!tt.enabled){vt=Dn();return}vt=Xo(tt)}function ec(){if(!vt&&(Qo(),!vt))throw new Error("Tracer failed to initialize");return vt}function Xn(){try{if(!Jn())return null;const{trace:n}=require("@opentelemetry/api");return n.getActiveSpan()||null}catch{return null}}function Fs(n,e,t){return ec().tracer.startSpan(n,{attributes:e,...t?{links:[{context:t}]}:{}})}function OS(){const n=Xn();if(n)try{const e=n.spanContext();return e.traceId!=="00000000000000000000000000000000"?e.traceId:void 0}catch{return}}function MS(){const n=Xn();if(n)try{const e=n.spanContext();return e.spanId!=="0000000000000000"?e.spanId:void 0}catch{return}}function HS(){const n=Xn();if(!n)return{};try{const e=n.spanContext();return e.traceId==="00000000000000000000000000000000"?{}:{traceparent:`00-${e.traceId}-${e.spanId}-0${e.traceFlags}`}}catch{return{}}}function FS(){return tt.enabled&&Jn()}function jS(){return{...tt}}function US(){vt=null,tt={...Yn}}var $=(n=>(n.DEBUG="debug",n.INFO="info",n.WARN="warn",n.ERROR="error",n))($||{}),g=(n=>(n.COMPONENT="COMPONENT",n.SERVICE="SERVICE",n.REPOSITORY="REPOSITORY",n.WEBSOCKET="WEBSOCKET",n.API="API",n.HOOK="HOOK",n.CONTEXT="CONTEXT",n.RENDER="RENDER",n.DATA_STORE="DATA_STORE",n.CACHE="CACHE",n.ANIMATION="ANIMATION",n.NAVIGATION="NAVIGATION",n.CONFIG="CONFIG",n.PERFORMANCE="PERFORMANCE",n.HEALTH="HEALTH",n.ERROR="ERROR",n.SECURITY="SECURITY",n.USER_ACTION="USER_ACTION",n.EVENT="EVENT",n.BRIDGE="BRIDGE",n.DEBUG="DEBUG",n))(g||{});class tc{config;transports=[];constructor(e={}){this.config={service:"blocksight-frontend",enableJsonOutput:!0,enablePrettyConsole:!1,hideStackTracesInProduction:!0,sanitizeSensitiveData:!0,...e}}sensitivePatterns=[/\bpassword\b/i,/\bapi[_-]?key\b/i,/\bsecret\b/i,/\btoken\b/i,/auth[_-]?token/i,/access[_-]?token/i,/refresh[_-]?token/i,/\bprivate[_-]?key\b/i,/\bcredit[_-]?card\b/i,/\bssn\b/i,/\bsocial[_-]?security\b/i,/\bpin\b/i];sanitizeData(e,t=new WeakSet){if(!this.config.sanitizeSensitiveData)return e;if(t.has(e))return{"[CIRCULAR_REFERENCE]":"[REDACTED]"};t.add(e);const a={};for(const[s,i]of Object.entries(e))this.sensitivePatterns.some(l=>l.test(s))?a[s]="[REDACTED]":Array.isArray(i)?a[s]=i.map(l=>typeof l=="object"&&l!==null?this.sanitizeData(l,t):l):typeof i=="object"&&i!==null?a[s]=this.sanitizeData(i,t):a[s]=i;return a}getIsProd(){try{if(typeof global<"u"){const e=global;if(e.import?.meta?.env?.PROD!==void 0)return e.import.meta.env.PROD??!1}return!0}catch{return!1}}sanitizeErrorMessage(e){if(!this.config.sanitizeSensitiveData||!this.getIsProd())return e;let t=e;return t=t.replace(/[a-zA-Z0-9]{32,}/g,"[REDACTED]"),t=t.replace(/Bearer\s+[a-zA-Z0-9._-]+/gi,"Bearer [REDACTED]"),t=t.replace(/token[=:]\s*[a-zA-Z0-9._-]+/gi,"token=[REDACTED]"),t=t.replace(/([a-zA-Z0-9._-]+)@([a-zA-Z0-9.-]+\.[a-zA-Z]{2,})/g,"[REDACTED]@$2"),t=t.replace(/https?:\/\/[^:]+:[^@]+@/g,"https://[REDACTED]:[REDACTED]@"),t}formatAsJson(e,t){const a=e.metadata&&this.config.sanitizeSensitiveData?this.sanitizeData(e.metadata):e.metadata,s=this.sanitizeErrorMessage(e.message),o=this.config.hideStackTracesInProduction&&this.getIsProd()?void 0:e.metadata?.stack,l={...e,message:s,metadata:a,data:a,stack:o,correlationId:t||this.config.correlationId,levelName:e.level.toUpperCase(),service:this.config.service};try{return JSON.stringify(l)}catch{return JSON.stringify({level:e.level,levelName:e.level.toUpperCase(),category:e.category,message:e.message,timestamp:e.timestamp,correlationId:t||this.config.correlationId,service:this.config.service,error:"Failed to serialize log entry"})}}formatForConsole(e,t){const a=this.formatAsJson(e,t);if(this.config.enablePrettyConsole)try{const s=JSON.parse(a);return JSON.stringify(s,null,2)}catch{return a}return a}outputToConsole(e,t){const a=this.formatForConsole(e,t);switch(e.level){case $.DEBUG:console.debug(a);break;case $.INFO:console.info(a);break;case $.WARN:console.warn(a);break;case $.ERROR:console.error(a);break}if(this.transports.length>0){const s={...e,correlationId:t||this.config.correlationId,levelName:e.level.toUpperCase(),service:this.config.service};this.shipToTransports(s)}}setCorrelationId(e){this.config.correlationId=e}getCorrelationId(){return this.config.correlationId}updateConfig(e){this.config={...this.config,...e}}addTransport(e){this.transports.push(e)}removeTransport(e){const t=this.transports.indexOf(e);t>-1&&this.transports.splice(t,1)}async shipToTransports(e){for(const t of this.transports)if(t.isReady())try{await t.ship([e])}catch(a){console.warn("[StructuredLogger] Transport ship failed:",a)}}hasActiveTransports(){return this.transports.some(e=>e.isReady())}forward(e){if(this.transports.length===0)return;const t={...e,correlationId:this.config.correlationId,levelName:e.level.toUpperCase(),service:this.config.service};this.shipToTransports(t)}async shutdownTransports(){for(const e of this.transports)try{await e.shutdown()}catch(t){console.warn("[StructuredLogger] Transport shutdown failed:",t)}}}const rn=new tc;function js(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,n=>{const e=Math.random()*16|0;return(n==="x"?e:e&3|8).toString(16)})}let Sn=null,rt=null;function Us(){return js()}function Ba(){return js()}function Ws(){return Sn||(Sn=Us()),Sn}function nc(){if(!rt)if(typeof sessionStorage<"u"){const n=sessionStorage.getItem("blocksight-session-id");n?rt=n:(rt=Ba(),sessionStorage.setItem("blocksight-session-id",rt))}else rt=Ba();return rt}var ac={};class sc{config;constructor(){const e=this.isTestEnvironment();this.config={minLevel:$.INFO,enableConsole:!e&&!(typeof import.meta<"u"),enableFile:!1,enableRemote:!1,prettyPrint:!1,includeStackTrace:!1}}isTestEnvironment(){return typeof process<"u"&&(ac.JEST_WORKER_ID!==void 0||typeof jest<"u")}levelPriority={[$.DEBUG]:0,[$.INFO]:1,[$.WARN]:2,[$.ERROR]:3};debug(e,t,a={}){this.log($.DEBUG,e,t,a)}info(e,t,a={}){this.log($.INFO,e,t,a)}warn(e,t,a={}){this.log($.WARN,e,t,a)}error(e,t,a={}){this.log($.ERROR,e,t,a)}log(e,t,a,s){if(this.levelPriority[e]{const s=e||Us();return b.info(g.SERVICE,"Correlation ID generated",{correlationId:s}),s});u.useEffect(()=>{ic(t)},[t]);const a=u.useMemo(()=>({correlationId:t}),[t]);return d.jsx(Qn.Provider,{value:a,children:n})}function pn(n,e={}){const{url:t,attributes:a={},messageSize:s,error:i}=e,o=`websocket.${n}`,l={"websocket.event":n,...a};t&&(l["websocket.url"]=t),s!==void 0&&(l["websocket.message.size"]=s);const m=Fs(o,l);return i?(m.recordException(i),m.setStatus({code:2,message:i.message})):m.setStatus({code:1}),m}function cc(n){return pn("connect",{url:n})}function Ra(n){const e=pn("disconnect",{url:n});return e.end(),e}function lc(n,e){const t=pn("message",{url:n,messageSize:e});return t.end(),t}function dc(n,e){const t=pn("error",{url:n,error:e});return t.end(),t}const uc="_errorDisplayContainer_igepb_39",hc="_errorCard_igepb_75",mc="_errorCardMini_igepb_153",pc="_errorTitle_igepb_177",fc="_errorDetails_igepb_195",gc="_errorCardSmall_igepb_203",bc="_errorCardLarge_igepb_223",yc="_errorCardWidget_igepb_245",vc="_errorHeader_igepb_281",kc="_errorDetailsText_igepb_351",we={errorDisplayContainer:uc,errorCard:hc,errorCardMini:mc,errorTitle:pc,errorDetails:fc,errorCardSmall:gc,errorCardLarge:bc,errorCardWidget:yc,errorHeader:vc,errorDetailsText:kc},Vs=({componentName:n,errorMessage:e,errorDetails:t,onRetry:a,onReload:s,showDetails:i=!1,severity:o="medium",icon:l,size:m="medium"})=>{const{t:h}=le(),f=()=>{switch(m){case"mini":return we.errorCardMini;case"small":return we.errorCardSmall;case"large":return we.errorCardLarge;case"widget":return we.errorCardWidget;default:return we.errorCard}},y=()=>m==="mini"?h("errors.widget.failedToLoad",{componentName:n}):e??h("errors.general");return d.jsx("div",{className:we.errorDisplayContainer,children:d.jsxs("div",{className:`${we.errorCard} ${f()}`,children:[d.jsx("div",{className:we.errorHeader,children:d.jsx("div",{className:we.errorTitle,children:y()})}),i&&t&&m!=="mini"&&d.jsx("div",{className:we.errorDetails,children:d.jsx("div",{className:we.errorDetailsText,children:t})})]})})};class Sc extends u.Component{getCorrelationId(){return this.context?.correlationId}constructor(e){super(e),this.state={hasError:!1,retryCount:0,isRecovering:!1,lastErrorTime:0}}static contextType=Qn;static getDerivedStateFromError(e){return{hasError:!0,error:e,lastErrorTime:Date.now()}}componentDidCatch(e,t){const{componentName:a,onError:s,customErrorHandler:i,type:o="general"}=this.props,l=this.getCorrelationId(),m=qo(e),h=$o(e,m),f=Fs("error.boundary",{"error.type":m,"error.component":a||"Unknown","error.severity":h,"error.boundary_type":o,"error.message":e.message});f.recordException(e),f.setStatus({code:2,message:e.message}),f.end(),X.counter("errors_total","Total number of errors",["error_type","component","severity"]).inc({error_type:m,component:a||"Unknown",severity:h}),b.error(g.COMPONENT,`Error in ${a||"Unknown"} component (${o})`,{error:e.message,componentStack:t.componentStack,retryCount:this.state.retryCount,category:m,severity:h,correlationId:l,errorBoundaryType:o,componentName:a||"Unknown"}),kr(e,{tags:{component:a||"Unknown",errorBoundaryType:o,category:m,severity:h},extra:{componentStack:t.componentStack,retryCount:this.state.retryCount,correlationId:l}}),i&&i(e,t),s&&s(e,t),this.setState({error:e,errorInfo:t,retryCount:this.state.retryCount+1}),this.props.enableAutoRecovery&&Go({errorInfo:{componentStack:t.componentStack||""},severity:h,retryCount:this.state.retryCount})&&this.scheduleAutoRecovery()}scheduleAutoRecovery(){const e=Ko(this.state.retryCount);this.setState({isRecovering:!0}),setTimeout(()=>{this.setState({isRecovering:!1}),this.resetError()},e)}handleRetry=()=>{const{maxRetries:e=3}=this.props,{retryCount:t}=this.state;t{this.setState({hasError:!1,error:void 0,errorInfo:void 0,isRecovering:!1})};render(){const{hasError:e,error:t,isRecovering:a}=this.state,{children:s,fallback:i,componentName:o,type:l="general"}=this.props;if(e){if(i){if(typeof i=="function"){const m=t??new Error("Unknown error occurred");return i({error:m,retry:this.handleRetry})}return i}return this.renderTypeSpecificFallback(t,o,l,a)}return s}renderTypeSpecificFallback(e,t,a,s){const i=()=>t?.toLowerCase().includes("header")||t?.toLowerCase().includes("footer")?"mini":t?.toLowerCase().includes("chip")?"small":"medium";return d.jsx(Vs,{componentName:t||"Unknown Component",errorMessage:s?"Recovering...":e?.message||"Something went wrong. Please try again.",errorDetails:e?.stack||"No additional details available",onRetry:this.handleRetry,onReload:()=>window.location.reload(),showDetails:!0,severity:"medium",size:i()})}}const qs=n=>d.jsx(Sc,{...n}),wc=n=>d.jsx(qs,{...n,type:"router"}),Y=n=>d.jsx(qs,{...n,type:"general"}),_c="_errorCard_ar49j_43",Tc="_errorCardFadeIn_ar49j_1",Ec="_warning_ar49j_117",Cc="_error_ar49j_43",xc="_critical_ar49j_149",Ac="_criticalPulse_ar49j_1",Bc="_iconContainer_ar49j_179",Rc="_iconWarning_ar49j_193",Ic="_iconError_ar49j_203",Pc="_iconCritical_ar49j_213",Lc="_iconPulse_ar49j_1",Dc="_title_ar49j_233",Nc="_message_ar49j_249",Oc="_errorCodeContainer_ar49j_273",Mc="_errorCodeLabel_ar49j_287",Hc="_errorCode_ar49j_273",Fc="_actions_ar49j_325",jc="_retryButton_ar49j_341",Uc="_refreshButton_ar49j_343",Wc="_helpLink_ar49j_433",ue={errorCard:_c,errorCardFadeIn:Tc,warning:Ec,error:Cc,critical:xc,criticalPulse:Ac,iconContainer:Bc,iconWarning:Rc,iconError:Ic,iconCritical:Pc,iconPulse:Lc,title:Dc,message:Nc,errorCodeContainer:Oc,errorCodeLabel:Mc,errorCode:Hc,actions:Fc,retryButton:jc,refreshButton:Uc,helpLink:Wc};function zc(n){const e={size:48,strokeWidth:1.5};switch(n){case"warning":return d.jsx(Tr,{...e,className:ue.iconWarning});case"critical":return d.jsx(_r,{...e,className:ue.iconCritical});default:return d.jsx(wr,{...e,className:ue.iconError})}}const Vc=({errorType:n,title:e,message:t,errorCode:a,onRetry:s,showHelpLink:i=!1,severity:o,className:l})=>{const{t:m}=le(),h=m(`errors.service.${n}.title`,qc(n)),f=m(`errors.service.${n}.message`,$c(n)),y=u.useCallback(()=>{s?.()},[s]),S=u.useCallback(()=>{window.location.reload()},[]);return d.jsxs("div",{className:`${ue.errorCard} ${ue[o]} ${l??""}`,role:"alert","aria-live":"assertive",children:[d.jsx("div",{className:ue.iconContainer,children:zc(o)}),d.jsx("h2",{className:ue.title,children:e??h}),d.jsx("p",{className:ue.message,children:t??f}),a&&d.jsxs("div",{className:ue.errorCodeContainer,children:[d.jsxs("span",{className:ue.errorCodeLabel,children:[m("errors.labels.errorCode","Error Code"),":"]}),d.jsx("code",{className:ue.errorCode,children:a})]}),d.jsxs("div",{className:ue.actions,children:[s&&d.jsxs("button",{type:"button",className:ue.retryButton,onClick:y,children:[d.jsx(Sr,{size:16}),d.jsx("span",{children:m("errors.actions.retry","Try Again")})]}),d.jsx("button",{type:"button",className:ue.refreshButton,onClick:S,children:m("errors.actions.refresh","Refresh Page")})]}),i&&d.jsx("a",{href:"/docs",className:ue.helpLink,onClick:v=>{v.preventDefault(),window.location.href="/docs"},children:m("errors.actions.help","Get Help")})]})};function qc(n){return{network:"Connection Issue",module:"Loading Error",websocket:"Real-Time Connection Lost",api:"Service Temporarily Unavailable",render:"Display Error",unknown:"Something Went Wrong"}[n]}function $c(n){return{network:"Unable to connect to BlockSight services. Please check your internet connection.",module:"The application failed to load completely. Try clearing your cache and refreshing.",websocket:"The connection for live data has been interrupted. Some features may be unavailable.",api:"BlockSight services are temporarily unavailable. Our team has been notified.",render:"An error occurred while displaying this page. Please try refreshing.",unknown:"An unexpected error occurred. Please try refreshing the page."}[n]}const Gc="_gradientFallback_9g3gd_21",Kc={gradientFallback:Gc},Zc=()=>d.jsx("div",{className:Kc.gradientFallback,"aria-hidden":"true","data-testid":"gradient-fallback"}),Yc="_fallbackContainer_p5quo_21",Jc="_overlay_p5quo_51",Xc="_content_p5quo_73",wn={fallbackContainer:Yc,overlay:Jc,content:Xc};function Qc(n){if(!n)return"unknown";const e=n.message.toLowerCase(),t=n.stack?.toLowerCase()??"",a=`${e} ${t}`;return a.includes("dynamically imported module")||a.includes("chunk")||a.includes("module not found")||a.includes("loading chunk")||a.includes("chunkloaderror")?"module":a.includes("websocket")||a.includes("socket")||a.includes("ws://")?"websocket":a.includes("fetch")||a.includes("network")||a.includes("failed to fetch")||a.includes("net::err")||a.includes("cors")?"network":a.includes("api")||a.includes("backend")||a.includes("500")||a.includes("503")||a.includes("502")||a.includes("504")||a.includes("internal server error")?"api":a.includes("render")||a.includes("component")||a.includes("cannot read")||a.includes("undefined")||a.includes("null")?"render":"unknown"}function el(n){switch(n){case"module":return"critical";case"api":case"network":return"error";case"websocket":return"warning";default:return"error"}}function tl(n){const e=n.substring(0,3).toUpperCase(),t=Date.now().toString(36).toUpperCase();return`ERR-${e}-${t}`}const nl=({error:n,errorInfo:e,onRetry:t})=>{const a=u.useMemo(()=>Qc(n),[n]),s=u.useMemo(()=>el(a),[a]),i=u.useMemo(()=>tl(a),[a]);u.useMemo(()=>{},[n,e,a,s,i]);const o=u.useCallback(()=>{t?t():window.location.reload()},[t]);return d.jsxs("div",{className:wn.fallbackContainer,children:[d.jsx("div",{className:wn.overlay}),d.jsx("div",{className:wn.content,children:d.jsx(Vc,{errorType:a,severity:s,errorCode:i,onRetry:o,showHelpLink:!1})})]})},al="_iconButton_1pvxj_31",sl="_iconWrapper_1pvxj_77",il="_jelloVertical_1pvxj_1",rl="_sm_1pvxj_171",ol="_md_1pvxj_191",cl="_lg_1pvxj_211",ll="_primary_1pvxj_241",dl="_ghost_1pvxj_275",ul="_gradient_1pvxj_309",Kt={iconButton:al,iconWrapper:sl,jelloVertical:il,sm:rl,md:ol,lg:cl,primary:ll,ghost:dl,gradient:ul},$s=u.forwardRef(function({icon:e,size:t="md",variant:a="ghost",className:s,type:i="button",...o},l){const m=[Kt.iconButton,Kt[t],Kt[a],s].filter(Boolean).join(" ");return d.jsx("button",{ref:l,type:i,className:m,...o,children:d.jsx("span",{className:Kt.iconWrapper,children:e})})});$s.displayName="IconButton";const pe={PAGE_VIEWS:"blocksight_frontend_page_views_total",MODE_CHANGES:"blocksight_frontend_infopanel_mode_changes_total",ANIMATION_DURATION:"blocksight_frontend_animation_duration_seconds",SEARCH_LATENCY:"blocksight_frontend_search_latency_seconds",DATA_FRESHNESS:"blocksight_frontend_data_freshness_seconds",WS_RECONNECTIONS:"blocksight_frontend_ws_reconnections_total",ERRORS:"blocksight_frontend_errors_total"};function hl(){X.counter(pe.PAGE_VIEWS,"Frontend page views",["page","referrer"]),X.counter(pe.MODE_CHANGES,"InfoPanel mode changes",["from","to"]),X.counter(pe.WS_RECONNECTIONS,"WebSocket reconnections",["reason"]),X.counter(pe.ERRORS,"Frontend errors",["type","component"]),X.histogram(pe.ANIMATION_DURATION,"Animation phase duration",[.05,.1,.2,.5,1,2],["animation_type","phase"]),X.histogram(pe.SEARCH_LATENCY,"Search latency",[.05,.1,.25,.5,1,2,5],["stage"]),X.gauge(pe.DATA_FRESHNESS,"Data freshness in seconds",["data_type"])}let Ia=!1;function ml(){Ia||(hl(),Ia=!0)}function pl(){ml();const n=u.useRef(null),e=u.useCallback((h,f)=>{X.counter(pe.PAGE_VIEWS,"Frontend page views",["page","referrer"]).inc({page:h,referrer:f||"direct"})},[]),t=u.useCallback((h,f)=>{if(h===f)return;X.counter(pe.MODE_CHANGES,"InfoPanel mode changes",["from","to"]).inc({from:h,to:f}),n.current=f},[]),a=u.useCallback((h,f,y)=>{X.histogram(pe.ANIMATION_DURATION,"Animation phase duration",[.05,.1,.2,.5,1,2],["animation_type","phase"]).observe(y,{animation_type:h,phase:f})},[]),s=u.useCallback((h,f)=>{X.histogram(pe.SEARCH_LATENCY,"Search latency",[.05,.1,.25,.5,1,2,5],["stage"]).observe(f,{stage:h})},[]),i=u.useCallback((h,f)=>{X.gauge(pe.DATA_FRESHNESS,"Data freshness in seconds",["data_type"]).set(f,{data_type:h})},[]),o=u.useCallback(h=>{X.counter(pe.WS_RECONNECTIONS,"WebSocket reconnections",["reason"]).inc({reason:h})},[]),l=u.useCallback((h,f)=>{X.counter(pe.ERRORS,"Frontend errors",["type","component"]).inc({type:h,component:f})},[]),m=u.useCallback(()=>{const h=performance.now();return()=>(performance.now()-h)/1e3},[]);return{trackPageView:e,trackModeChange:t,trackAnimationDuration:a,trackSearchLatency:s,trackDataFreshness:i,trackWsReconnection:o,trackError:l,startTimer:m}}const Pa={isOpen:!1,documentType:null,initialTab:null},Gs=u.createContext(null),fl=({children:n})=>{const[e,t]=u.useState(Pa),a=u.useCallback((o,l)=>{t({isOpen:!0,documentType:o,initialTab:l??null})},[]),s=u.useCallback(()=>{t(Pa)},[]),i={...e,openDocument:a,closeDocument:s};return d.jsx(Gs.Provider,{value:i,children:n})},gl=()=>{const n=u.useContext(Gs);if(!n)throw new Error("useDocument must be used within DocumentProvider");return n},Bt={entityType:"none",selectedBlock:null,selectedTransaction:null,selectedAddress:null,highlightedBlockHeight:null,highlightedMempoolTxid:null,mempoolSlotIndex:null,isDroppedFromMempool:!1,dropReason:null,replacementTxid:null},Ks=u.createContext(null),bl=({children:n,onMempoolSubscribe:e,onMempoolUnsubscribe:t})=>{const[a,s]=u.useState(Bt),i=u.useRef(e),o=u.useRef(t);u.useEffect(()=>{i.current=e,o.current=t},[e,t]);const l=u.useCallback(w=>{s(x=>(x.highlightedMempoolTxid&&o.current?.(x.highlightedMempoolTxid),{...Bt,entityType:"block",selectedBlock:w}))},[]),m=u.useCallback(w=>{const x=w.blockHeight===null;s(D=>(D.highlightedMempoolTxid&&D.highlightedMempoolTxid!==w.id.txid&&o.current?.(D.highlightedMempoolTxid),{...Bt,entityType:"transaction",selectedTransaction:w,highlightedBlockHeight:x?null:w.blockHeight,highlightedMempoolTxid:x?w.id.txid:null})),x&&i.current?.(w.id.txid)},[]),h=u.useCallback(w=>{s(x=>(x.highlightedMempoolTxid&&o.current?.(x.highlightedMempoolTxid),{...Bt,entityType:"address",selectedAddress:w}))},[]),f=u.useCallback(w=>{s(x=>({...x,highlightedBlockHeight:w}))},[]),y=u.useCallback(()=>{s(w=>({...w,highlightedBlockHeight:null}))},[]),S=u.useCallback(()=>{s(w=>(w.highlightedMempoolTxid&&o.current?.(w.highlightedMempoolTxid),Bt))},[]),v=u.useCallback(w=>{s(x=>x.highlightedMempoolTxid!==w.txid?x:{...x,mempoolSlotIndex:w.slotIndex,isDroppedFromMempool:!1,dropReason:null,replacementTxid:null})},[]),E=u.useCallback(w=>{s(x=>x.highlightedMempoolTxid!==w.txid?x:{...x,isDroppedFromMempool:!0,dropReason:w.reason,replacementTxid:w.replacementTxid??null})},[]),_=u.useMemo(()=>({...a,selectBlock:l,selectTransaction:m,selectAddress:h,highlightBlock:f,clearHighlight:y,clearSelection:S,setMempoolTxPosition:v,setMempoolTxDropped:E}),[a,l,m,h,f,y,S,v,E]);return d.jsx(Ks.Provider,{value:_,children:n})},ea=()=>{const n=u.useContext(Ks);if(!n)throw new Error("useEntitySelection must be used within EntitySelectionProvider");return n};function La(n,e=6){if(!n||n.length===0)return 0;const t=n.slice(0,e);return t.length===0?0:t.reduce((s,i)=>s+(i.avgfeerate||0),0)/t.length}function yl(n,e=10){if(!n||n.length<2)return 0;const t=n.slice(-e);if(t.length<2)return 0;const a=t.reduce((i,o)=>i+o,0)/t.length,s=t.reduce((i,o)=>i+(o-a)**2,0)/t.length;return Math.sqrt(s)}function vl(n){return!n||n<=0?0:n*2**32/600}function kl(n){if(!n||n<=0)return"0 H/s";const e=["H/s","KH/s","MH/s","GH/s","TH/s","PH/s","EH/s","ZH/s"];let t=0,a=n;for(;a>=1e3&&ta+(s.changePercent||0),0)/e.length;return t>1?"increasing":t<-1?"decreasing":"stable"}const nt=21e4,Ht=600;function wl(n,e=Ht,t=Date.now()){if(!n||n<=0)return{blocksRemaining:nt,estimatedDate:0};const i=(Math.floor(n/nt)+1)*nt-n,o=i*e;return{blocksRemaining:i,estimatedDate:t+o*1e3}}function _l(n){return!n||n<=0?0:Math.floor(n/nt)}const Tl=21e6,Zs=50;function Ys(n){if(!n||n<=0)return 0;let e=0,t=Zs,a=0;for(;a0&&l>0&&a.push(o-l)}if(a.length===0)return Ht;const s=a.reduce((i,o)=>i+o,0)/a.length;return Math.max(1,s)}function xl(n){return!n||n<=0?6:3600/n}function Al(n,e,t,a,s,i=Date.now()){const o=Cl(n),l=wl(s,o,i),m=vl(a);return{averageFee6Blocks:La(n,6),averageFee24h:La(n,144),feeVolatility:yl(e.map(h=>h.avgFee)),networkHashrate:m,hashrateFormatted:kl(m),difficultyTrend:Sl(t),averageBlockTime:o,blocksPerHour:xl(o),halvingBlocksRemaining:l.blocksRemaining,halvingEstimatedDate:l.estimatedDate,circulatingSupply:Ys(s),inflationRate:El(s),calculatedAt:i}}class Bl{cache=new Map;stats={size:0,hits:0,misses:0,evictions:0,memoryUsage:0};config={maxSize:100,defaultTTL:3e5,cleanupInterval:6e4};cleanupTimer=null;constructor(e){this.config={...this.config,...e},this.startCleanupTimer()}set(e,t,a=this.config.defaultTTL){try{this.cache.size>=this.config.maxSize&&this.evictOldestEntry();const s={data:t,timestamp:Date.now(),ttl:a,accessCount:0,lastAccessed:Date.now()};this.cache.set(e,s),this.updateStats()}catch(s){b.warn(g.CACHE,"Failed to set entry",{error:s instanceof Error?s:String(s)})}}get(e){try{const t=this.cache.get(e);return t?this.isExpired(t)?(this.cache.delete(e),this.stats.misses++,this.updateStats(),null):(t.accessCount++,t.lastAccessed=Date.now(),this.stats.hits++,t.data):(this.stats.misses++,null)}catch(t){return b.warn(g.CACHE,"Failed to get entry",{error:t instanceof Error?t:String(t)}),this.stats.misses++,null}}has(e){const t=this.cache.get(e);return t?this.isExpired(t)?(this.cache.delete(e),this.updateStats(),!1):!0:!1}delete(e){const t=this.cache.delete(e);return t&&this.updateStats(),t}clear(){this.cache.clear(),this.updateStats()}getStats(){return{...this.stats}}size(){return this.cache.size}isExpired(e,t=Date.now()){return t-e.timestamp>e.ttl}evictOldestEntry(){let e="",t=1/0;for(const[a,s]of this.cache.entries())s.lastAccessed{this.cleanup()},this.config.cleanupInterval)}cleanup(e=Date.now()){const t=[];for(const[a,s]of this.cache.entries())e-s.timestamp>s.ttl&&t.push(a);t.forEach(a=>{this.cache.delete(a),this.stats.evictions++}),t.length>0&&this.updateStats()}destroy(){this.cleanupTimer&&(clearInterval(this.cleanupTimer),this.cleanupTimer=null),this.clear()}}const Ze=new Bl,Ft=1500,Da=50,Rl={daily:864e5},Na=126080,Il={athPrice:Na,isAtAth:!1,athReachedAt:null,athExpiresAt:null,distanceFromAth:Na,currentPollInterval:Rl.daily,lastComparedAt:0};function Oa(){return{raw:Pl(),transformed:Ll(),system:Dl(),websocket:Nl(),transformation:Ol()}}function Pl(){return{coreRpc:{blockchainInfo:null,mempoolInfo:null,networkInfo:null,peerInfo:null,miningInfo:null,txOutSetInfo:null,chainTxStats:null,lastUpdate:0,source:"bitcoin-core-rpc",version:"1.0.0"},electrumServer:{blockHeaders:[],blockTransactions:[],mempoolTransactions:[],addressHistory:[],addressUtxos:[],transactionDetails:[],lastUpdate:0,source:"electrs-server",version:"1.0.0",windowCenter:null},external:{priceData:null,exchangeRates:null,marketData:null,newsData:null,lastUpdate:0,source:"external-apis",version:"1.0.0"},_meta:{coreRpc:{lastFetchedAt:0,sourceTimestamp:0,source:"cache",ttl:12e4,isStale:!0,isMock:!1,confidence:20},electrumServer:{lastFetchedAt:0,sourceTimestamp:0,source:"cache",ttl:12e4,isStale:!0,isMock:!1,confidence:20},external:{lastFetchedAt:0,sourceTimestamp:0,source:"cache",ttl:3e5,isStale:!0,isMock:!1,confidence:20}}}}function Ll(){return{blockchain:{summary:{height:0,lastBlock:null,mempool:{size:0,bytes:0,usage:0,transactions:[],sizeFormatted:"0 B",bytesFormatted:"0 B",usageFormatted:"0 B",averageFee:0,averageFeeRate:0,oldestTransaction:0,newestTransaction:0,minrelaytxfee:0},blocks:[],difficulty:0,hashrate:0,networkHashrate:0,difficultyFormatted:"0",hashrateFormatted:"0 H/s",networkHashrateFormatted:"0 H/s",averageBlockTime:600,estimatedNextBlock:0,totalTransactions:0,totalSupply:21e6,inflationRate:0},networkStats:{totalNodes:0,connectedNodes:0,averageLatency:0,bandwidth:0,totalNodesFormatted:"0",connectedNodesFormatted:"0",averageLatencyFormatted:"0 ms",bandwidthFormatted:"0 B/s",networkHealth:"excellent"},selectedBlockId:null,lastUpdate:0,source:"backend-transformation",version:"1.0.0"},market:{prices:{btc:{usd:0,eur:0,gbp:0,jpy:0,aud:0,cad:0,chf:0,cny:0,inr:0,brl:0,ars:0,ils:0,change24h:0,changePercent24h:0,lastUpdate:0}},exchangeRates:{usd:1,eur:0,gbp:0,jpy:0,aud:0,cad:0,chf:0,cny:0,inr:0,brl:0,ars:0,ils:0,pln:0,rub:0,try_:0,krw:0,twd:0,sar:0,irr:0,thb:0,vnd:0,idr:0,uah:0,myr:0,php:0,bdt:0,lastUpdate:0},marketCap:0,volume24h:0,dominance:0},analytics:{transactionFees:[],blockSizes:[],difficultyAdjustments:[],hashRateHistory:[],derived:{averageFee6Blocks:0,averageFee24h:0,feeVolatility:0,networkHashrate:0,hashrateFormatted:"0 H/s",difficultyTrend:"stable",averageBlockTime:600,blocksPerHour:6,halvingBlocksRemaining:0,halvingEstimatedDate:0,circulatingSupply:0,inflationRate:0,calculatedAt:0},feeGauge:{nextBlockFee:0,sixHourFee:0,timestamp:0}},ath:Il,blockFound:{isAnimating:!1,phase:"idle",currentEvent:null,lastBlockFoundAt:0},visualization:null}}function Dl(){return{health:{status:"healthy",lastCheck:0,services:{electrumServer:!1,coreRpc:!1,websocket:!1,redis:!1,postgresql:!1,externalAPI:!1},uptime:0,version:"1.0.0"},performance:{responseTime:0,memoryUsage:0,cpuUsage:0,cacheHitRate:0,errorRate:0,throughput:0,latency:{p50:0,p95:0,p99:0}},errors:[]}}function Nl(){return{connected:!1,lastUpdate:0,subscriptions:[],reconnectAttempts:0,lastError:null}}function Ol(){return{lastUpdate:0,processing:!1,errors:[]}}function Ml(n){return{summary:{height:n.blockchainInfo?.blocks||0,lastBlock:n.blockchainInfo?{hash:n.blockchainInfo.bestblockhash,height:n.blockchainInfo.blocks,timestamp:Date.now(),size:0,weight:0,txCount:0,previousHash:"",merkleRoot:"",nonce:0,difficulty:n.blockchainInfo.difficulty||0,version:0,bits:"",age:0,sizeFormatted:"0 B",weightFormatted:"0 B",difficultyFormatted:"0"}:null,mempool:{size:n.mempoolInfo?.size||0,bytes:n.mempoolInfo?.bytes||0,usage:n.mempoolInfo?.usage||0,transactions:[],sizeFormatted:"0 B",bytesFormatted:"0 B",usageFormatted:"0 B",averageFee:0,averageFeeRate:0,oldestTransaction:0,newestTransaction:0},blocks:[],difficulty:n.blockchainInfo?.difficulty||0,hashrate:0,networkHashrate:0,difficultyFormatted:"0",hashrateFormatted:"0 H/s",networkHashrateFormatted:"0 H/s",averageBlockTime:600,estimatedNextBlock:0,totalTransactions:0,totalSupply:21e6,inflationRate:0},networkStats:{totalNodes:0,connectedNodes:0,averageLatency:0,bandwidth:0,totalNodesFormatted:"0",connectedNodesFormatted:"0",averageLatencyFormatted:"0 ms",bandwidthFormatted:"0 B/s",networkHealth:"excellent"},lastUpdate:Date.now(),source:"backend-transformation",version:"1.0.0"}}function Hl(n){return{blockHeaders:n.blockHeaders,blockTransactions:n.blockTransactions,mempoolTransactions:n.mempoolTransactions,addressHistory:n.addressHistory,addressUtxos:n.addressUtxos,transactionDetails:n.transactionDetails}}function Fl(n){return!n.blockHeaders||n.blockHeaders.length===0?0:Math.max(...n.blockHeaders.map(e=>e.height))}function jl(n){const e=n.priceData;return{btc:{usd:e?.value||0,eur:0,gbp:0,jpy:0,aud:0,cad:0,chf:0,cny:0,inr:0,brl:0,ars:0,ils:0,change24h:e?.change24h||0,changePercent24h:e?.changePercent24h||0,lastUpdate:e?.asOfMs||0}}}function Ul(n){const e=n.exchangeRates?.rates,t=a=>a||0;return{usd:1,eur:t(e?.eur),gbp:t(e?.gbp),jpy:t(e?.jpy),aud:t(e?.aud),cad:t(e?.cad),chf:t(e?.chf),cny:t(e?.cny),inr:t(e?.inr),brl:t(e?.brl),ars:t(e?.ars),ils:t(e?.ils),pln:t(e?.pln),rub:t(e?.rub),try_:t(e?.try),krw:t(e?.krw),twd:t(e?.twd),sar:t(e?.sar),irr:t(e?.irr),thb:t(e?.thb),vnd:t(e?.vnd),idr:t(e?.idr),uah:t(e?.uah),myr:t(e?.myr),php:t(e?.php),bdt:t(e?.bdt),lastUpdate:n.exchangeRates?.date?new Date(n.exchangeRates.date).getTime():0}}function Wl(n){return{marketCap:n.marketData?.market_cap||0,volume24h:n.marketData?.volume_24h||0,dominance:n.marketData?.dominance||0}}function zl(n){return{prices:jl(n),exchangeRates:Ul(n),...Wl(n)}}function Vl(n,e,t,a,s){const i=Math.max(t,a),o={};s&&"mempoolBlocks"in s&&(o.mempoolBlocks=s.mempoolBlocks);const l={...n,summary:{...n.summary,blocks:e.blockHeaders||[],height:i,...o}};if(!l.summary.lastBlock&&e.blockHeaders&&e.blockHeaders.length>0){const h=[...e.blockHeaders].sort((f,y)=>y.height-f.height)[0];l.summary.lastBlock={hash:h.hash,height:h.height,timestamp:h.timestamp,size:h.size||0,weight:h.weight||0,txCount:h.tx_count||0,previousHash:h.previous_hash||"",merkleRoot:h.merkle_root||"",nonce:h.nonce||0,difficulty:h.difficulty||0,version:h.version||0,bits:h.bits||"",avgfeerate:h.avgfeerate??0,feerateP10:h.feerateP10,feerateP50:h.feerateP50,feerateP90:h.feerateP90,minerName:h.miner_name,age:0,sizeFormatted:"0 B",weightFormatted:"0 B",difficultyFormatted:"0"}}return l}const ql={now:()=>Date.now(),random:()=>Math.random(),perfNow:()=>performance.now()};class $l{state;subscribers=new Set;selectiveSubscribers=new Set;clock;pageHidden=!1;pendingNotification=!1;visibilityHandler=null;animationBuffering=!1;pendingAnimationFlush=!1;dataFreshnessGauge=X.gauge("blocksight_frontend_data_freshness_seconds","Data age in seconds since last update",["data_type"]);refreshLatencyHistogram=X.histogram("blocksight_frontend_refresh_latency_seconds","Refresh cycle latency",[.05,.1,.25,.5,1,2,5],["trigger"]);lastUpdateTimestamps=new Map;constructor(e=ql){this.clock=e,this.state=Oa(),this.setupVisibilityListener()}initialize(){}getState(){return{...this.state}}resetDataStore(){this.state=Oa(),this.notifySubscribers()}updateState(e){const t=this.state.transformed?.blockFound?.phase,a=this.state.transformed?.blockFound?.isAnimating??!1;this.state={...this.state,...e};const s=this.state.transformed?.blockFound?.phase,i=this.state.transformed?.blockFound?.isAnimating??!1,o=t!==s;if(this.trackDataFreshness(e),this.cacheUIState(),!a&&i&&(this.animationBuffering=!0),this.animationBuffering&&!i){this.animationBuffering=!1,this.pendingAnimationFlush=!1,this.pageHidden?this.pendingNotification=!0:this.notifySubscribers();return}if(this.pageHidden){this.pendingNotification=!0;return}if(this.animationBuffering&&!o){this.pendingAnimationFlush=!0;return}this.notifySubscribers()}flushAnimationBuffer(){this.animationBuffering=!1,this.pendingAnimationFlush&&(this.pendingAnimationFlush=!1,this.notifySubscribers())}trackDataFreshness(e){const t=this.clock.now();e.transformed?.blockchain&&(this.lastUpdateTimestamps.set("blockchain",t),this.dataFreshnessGauge.set(0,{data_type:"blockchain"})),e.transformed?.market&&(this.lastUpdateTimestamps.set("market",t),this.dataFreshnessGauge.set(0,{data_type:"market"})),e.websocket&&(this.lastUpdateTimestamps.set("websocket",t),this.dataFreshnessGauge.set(0,{data_type:"websocket"})),e.raw&&(this.lastUpdateTimestamps.set("raw",t),this.dataFreshnessGauge.set(0,{data_type:"raw"}))}recordRefreshLatency(e,t){const a=(this.clock.perfNow()-t)/1e3;this.refreshLatencyHistogram.observe(a,{trigger:e})}updateFreshnessMetrics(){const e=this.clock.now();for(const[t,a]of this.lastUpdateTimestamps){const s=(e-a)/1e3;this.dataFreshnessGauge.set(s,{data_type:t})}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}subscribeToSlice(e,t){const a={selector:e,callback:t,lastValue:e(this.state)};return this.selectiveSubscribers.add(a),()=>{this.selectiveSubscribers.delete(a)}}notifySubscribers(){this.subscribers.forEach(e=>{try{e(this.state)}catch(t){b.error(g.DATA_STORE,"Error in DataStore subscriber",{error:t instanceof Error?t:String(t)})}}),this.selectiveSubscribers.forEach(e=>{try{const t=e.selector(this.state);t!==e.lastValue&&(e.lastValue=t,e.callback(t))}catch(t){b.error(g.DATA_STORE,"Error in selective DataStore subscriber",{error:t instanceof Error?t:String(t)})}})}transformRawData(){try{this.updateState({transformation:{...this.state.transformation,processing:!0,lastUpdate:this.clock.now()}});const e=Ml(this.state.raw.coreRpc),t=Hl(this.state.raw.electrumServer),a=zl(this.state.raw.external),s=e.summary.height||0,i=Fl(this.state.raw.electrumServer),o=Vl(e,t,s,i,this.state.transformed?.blockchain?.summary);this.updateState({transformed:{...this.state.transformed,blockchain:o,market:a},transformation:{...this.state.transformation,processing:!1,lastUpdate:this.clock.now()}})}catch(e){this.handleError(e instanceof Error?e:new Error("Data transformation failed"),"DataTransformation")}}calculateDerivedData(){try{const{transformed:e}=this.state,{blockchain:t,analytics:a}=e,s=t.summary.blocks||[],i=t.summary.difficulty||0,o=t.summary.height||0,l=Al(s,a.transactionFees,a.difficultyAdjustments,i,o);this.updateState({transformed:{...this.state.transformed,analytics:{...this.state.transformed.analytics,derived:l}}})}catch(e){b.warn(g.DATA_STORE,"DataStore: Failed to calculate derived data",{error:e instanceof Error?e:String(e)})}}handleError(e,t="DataStore"){const a={id:`error_${this.clock.now()}_${this.clock.random().toString(36).substr(2,9)}`,message:e.message,context:t,timestamp:this.clock.now(),severity:"medium",stack:e.stack,code:e.code,recoverable:!0},s=[...this.state.system.errors,a],i=s.length>Da?s.slice(-Da):s;this.updateState({system:{...this.state.system,errors:i}})}clearErrors(){this.updateState({system:{...this.state.system,errors:[]}})}cacheUIState(){try{Ze.set("system-health",this.state.system.health,3e5),Ze.set("websocket-state",this.state.websocket,6e4),Ze.set("transformation-state",this.state.transformation,3e4)}catch(e){b.warn(g.DATA_STORE,"DataStore: Failed to cache UI state",{error:e instanceof Error?e:String(e)})}}getCachedUIState(){try{return{systemHealth:Ze.get("system-health"),websocketState:Ze.get("websocket-state"),transformationState:Ze.get("transformation-state")}}catch(e){return b.warn(g.DATA_STORE,"DataStore: Failed to get cached UI state",{error:e instanceof Error?e:String(e)}),null}}setupVisibilityListener(){typeof document>"u"||(this.visibilityHandler=()=>{document.hidden?this.pageHidden=!0:(this.pageHidden=!1,this.pendingNotification&&(this.pendingNotification=!1,this.notifySubscribers()))},document.addEventListener("visibilitychange",this.visibilityHandler))}destroy(){this.subscribers.clear(),this.selectiveSubscribers.clear(),Ze.clear(),this.visibilityHandler&&typeof document<"u"&&(document.removeEventListener("visibilitychange",this.visibilityHandler),this.visibilityHandler=null)}}const O=new $l,ta=u.createContext(null),Gl=({children:n})=>{const e=u.useMemo(()=>i=>({height:i.transformed.blockchain.summary.height,lastBlock:i.transformed.blockchain.summary.lastBlock,mempool:i.transformed.blockchain.summary.mempool,blocks:i.transformed.blockchain.summary.blocks,mempoolBlocks:i.transformed.blockchain.summary.mempoolBlocks||[],difficulty:i.transformed.blockchain.summary.difficulty,hashrate:i.transformed.blockchain.summary.hashrate,networkHashrate:i.transformed.blockchain.summary.networkHashrate}),[]),[t,a]=u.useState(e(O.getState())),s=u.useRef(null);return u.useEffect(()=>{const i=O.subscribeToSlice(l=>l.transformed.blockchain,l=>{const m={height:l.summary.height,lastBlock:l.summary.lastBlock,mempool:l.summary.mempool,blocks:l.summary.blocks,mempoolBlocks:l.summary.mempoolBlocks||[],difficulty:l.summary.difficulty,hashrate:l.summary.hashrate,networkHashrate:l.summary.networkHashrate},{isAnimating:h}=O.getState().transformed.blockFound;if(h){s.current=m;return}s.current=null,a(m)}),o=O.subscribeToSlice(l=>l.transformed.blockFound.isAnimating,l=>{!l&&s.current&&(a(s.current),s.current=null)});return()=>{i(),o()}},[]),d.jsx(ta.Provider,{value:t,children:n})},Kl=()=>{const n=u.useContext(ta);if(!n)throw new Error("useBlockchainData must be used within BlockchainDataProvider");return n},Zl=()=>u.useContext(ta),Yl=1e10;function fn(n){return n==null?0:n0?t.minfeerate:void 0,i=Ma(s,n.feerateP10,a),o=Ma(t.maxfeerate,n.feerateP90,a),l=typeof n.feerateP50=="number"?n.feerateP50:a,m=typeof n.feerateP10=="number"||typeof n.feerateP90=="number"||typeof n.avgfeerate=="number"&&n.avgfeerate>0,h=typeof t.tx_count=="number"?t.tx_count:typeof n.txCount=="number"?n.txCount:0,f=fn(n.timestamp);return{kind:"real",id:{hash:n.hash,height:n.height},minedAtMs:f||e,txCount:h,minFeeRate:i,maxFeeRate:o,medianFeeRate:l,isEnriched:m,totalFeesSatoshis:t.totalfee??n.totalFees??void 0,minerName:n.minerName??t.miner_name??void 0}}const Xs=1e3;function Qs(n,e){if(n.length===0)return n;const t=e??Math.max(...n.map(a=>a.height));return t<=0?n:n.filter(a=>t-a.height<=Xs)}function Xl(){const{selectedBlock:n,selectBlock:e}=ea(),a=Zl()?.blocks;u.useEffect(()=>{if(!a||!n?.id.hash.startsWith("memory-pool-"))return;const s=n.id.height,i=a.find(l=>l.height===s);if(!i)return;const o=Js(i);o&&e(o)},[n,a,e])}const Ha={stack:[]},Fa=50,ei=u.createContext(null),Ql=({children:n})=>{const[e,t]=u.useState(Ha),a=u.useCallback(m=>{t(h=>{const f=[...h.stack,m];return{stack:f.length>Fa?f.slice(f.length-Fa):f}})},[]),s=u.useCallback(()=>{const m=e.stack;if(m.length===0)return;const h=m[m.length-1];return t(f=>({stack:f.stack.slice(0,-1)})),h},[e.stack]),i=u.useCallback(()=>{t(Ha)},[]),o=u.useMemo(()=>e.stack.length>0,[e.stack.length]),l={...e,push:a,pop:s,clear:i,canGoBack:o};return d.jsx(ei.Provider,{value:l,children:n})},ed=()=>{const n=u.useContext(ei);if(!n)throw new Error("useNavigationHistory must be used within NavigationHistoryProvider");return n},ja={widgets:{bitcoinPrice:!0,feeGauge:!0,congestionGauge:!0,monicaMetrics:!0,toolbar:!0,halvingTool:!0,supplyTool:!0,calculatorTool:!0,generalMetricsTool:!0,monicaMetricsTool:!0},effects:{hoverAnimations:!0,loadingSpinners:!0,transitionAnimations:!0,demoBlockAnimation:!1,blockFoundSound:!0,animateLastBlock:!0,cascadeDataShift:!0,useHybridBlockHistory:!0,showBlockChainLinks:!0,athCelebration:!0,useNewBlockHistoryGrid:!1},dataSources:{useRealHealthData:!0,useRealPriceData:!0,useRealBlockchainData:!0,useRealSearchData:!0,useBackendSearch:!0,useElectrumForSearch:!1,useZmqRawblock:!1,useZmqRawtx:!1}};function Zt(n,e,t,a){return{...n,[e]:{...n[e],[t]:a}}}const ti=u.createContext(void 0),td=({children:n,initialFlags:e=ja})=>{const[t,a]=u.useState(()=>new URLSearchParams(window.location.search).get("cascade")==="true"?(b.debug(g.CONFIG,"Cascade enabled via URL param",{param:"?cascade=true"}),Zt(e,"effects","cascadeDataShift",!0)):e);u.useEffect(()=>{const l=()=>{const h=new URLSearchParams(window.location.search).get("cascade");h==="true"&&!t.effects.cascadeDataShift?(b.debug(g.CONFIG,"Cascade enabled via URL param",{param:"?cascade=true"}),a(f=>Zt(f,"effects","cascadeDataShift",!0))):h!=="true"&&t.effects.cascadeDataShift&&(b.debug(g.CONFIG,"Cascade disabled (URL param removed)"),a(f=>Zt(f,"effects","cascadeDataShift",!1)))};return window.addEventListener("popstate",l),()=>{window.removeEventListener("popstate",l)}},[t.effects.cascadeDataShift]);const s=u.useCallback((l,m,h)=>{a(f=>Zt(f,l,m,h))},[]),i=u.useCallback(()=>{a(ja)},[]),o=u.useMemo(()=>({flags:t,setFlag:s,resetFlags:i}),[t,s,i]);return d.jsx(ti.Provider,{value:o,children:n})},gn=()=>{const n=u.useContext(ti);if(!n)throw new Error("useFeatureFlags must be used within FeatureFlagProvider");return n},WS=n=>{const{flags:e}=gn();return e.widgets[n]},na=n=>{const{flags:e}=gn();return e.dataSources[n]},ni="/api/v1/telemetry/i18n-missing-key",nd=20,ad=3e4,Ua=5e3;let qe=[],_n=0,Wa=null;function Nn(n,e,t){qe.push({locale:n,namespace:e,key:t,ts:Date.now()}),qe.length>=nd&&ai()}async function ai(){if(qe.length===0)return;const n=Date.now();if(n-_n{ai()},n),typeof window<"u"&&window.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden"&&qe.length>0)try{navigator.sendBeacon(ni,new Blob([JSON.stringify({events:qe})],{type:"application/json"})),qe=[]}catch{}}))}const id=["ar","bn","cs","da","de","en","es","et","fa","fil","fr","he","hi","id","it","ja","ko","ms","nl","pl","pt","ro","ru","sv","th","tr","uk","ur","vi","zh-CN","zh-TW"],rd={ar:{code:"ar",name:"Arabic",nativeName:"العربية",rtl:!0,available:!0},bn:{code:"bn",name:"Bengali",nativeName:"বাংলা",rtl:!1,available:!0},cs:{code:"cs",name:"Czech",nativeName:"Čeština",rtl:!1,available:!0},da:{code:"da",name:"Danish",nativeName:"Dansk",rtl:!1,available:!0},de:{code:"de",name:"German",nativeName:"Deutsch",rtl:!1,available:!0},en:{code:"en",name:"English",nativeName:"English",rtl:!1,available:!0},es:{code:"es",name:"Spanish",nativeName:"Español",rtl:!1,available:!0},et:{code:"et",name:"Estonian",nativeName:"Eesti",rtl:!1,available:!0},fa:{code:"fa",name:"Persian",nativeName:"فارسی",rtl:!0,available:!0},fil:{code:"fil",name:"Filipino",nativeName:"Filipino",rtl:!1,available:!0},fr:{code:"fr",name:"French",nativeName:"Français",rtl:!1,available:!0},he:{code:"he",name:"Hebrew",nativeName:"עברית",rtl:!0,available:!0},hi:{code:"hi",name:"Hindi",nativeName:"हिन्दी",rtl:!1,available:!0},id:{code:"id",name:"Indonesian",nativeName:"Bahasa Indonesia",rtl:!1,available:!0},it:{code:"it",name:"Italian",nativeName:"Italiano",rtl:!1,available:!0},ja:{code:"ja",name:"Japanese",nativeName:"日本語",rtl:!1,available:!0},ko:{code:"ko",name:"Korean",nativeName:"한국어",rtl:!1,available:!0},ms:{code:"ms",name:"Malay",nativeName:"Bahasa Melayu",rtl:!1,available:!0},nl:{code:"nl",name:"Dutch",nativeName:"Nederlands",rtl:!1,available:!0},pl:{code:"pl",name:"Polish",nativeName:"Polski",rtl:!1,available:!0},pt:{code:"pt",name:"Portuguese",nativeName:"Português",rtl:!1,available:!0},ro:{code:"ro",name:"Romanian",nativeName:"Română",rtl:!1,available:!0},ru:{code:"ru",name:"Russian",nativeName:"Русский",rtl:!1,available:!0},sv:{code:"sv",name:"Swedish",nativeName:"Svenska",rtl:!1,available:!0},th:{code:"th",name:"Thai",nativeName:"ไทย",rtl:!1,available:!0},tr:{code:"tr",name:"Turkish",nativeName:"Türkçe",rtl:!1,available:!0},uk:{code:"uk",name:"Ukrainian",nativeName:"Українська",rtl:!1,available:!0},ur:{code:"ur",name:"Urdu",nativeName:"اردو",rtl:!0,available:!0},vi:{code:"vi",name:"Vietnamese",nativeName:"Tiếng Việt",rtl:!1,available:!0},"zh-CN":{code:"zh-CN",name:"Chinese Simplified",nativeName:"简体中文",rtl:!1,available:!0},"zh-TW":{code:"zh-TW",name:"Chinese Traditional",nativeName:"繁體中文",rtl:!1,available:!0}},od=["ar","fa","he","ur"],cd={ar:"ARA",bn:"BEN",cs:"CES",da:"DAN",de:"DEU",en:"ENG",es:"ESP",et:"EST",fa:"FAS",fil:"FIL",fr:"FRA",he:"HEB",hi:"HIN",id:"IND",it:"ITA",ja:"JPN",ko:"KOR",ms:"MAL",nl:"NLD",pl:"POL",pt:"POR",ro:"RON",ru:"RUS",sv:"SWE",th:"THA",tr:"TUR",uk:"UKR",ur:"URD",vi:"VIE","zh-CN":"CHS","zh-TW":"CHT"},zS=["ar","bn","cs","da","de","en","es","et","fa","fil","fr","he","hi","id","it","ja","ko","ms","nl","pl","pt","ro","ru","sv","th","tr","uk","ur","vi","zh-CN","zh-TW"],VS={ar:"ar_SA",bn:"bn_BD",cs:"cs_CZ",da:"da_DK",de:"de_DE",en:"en_US",es:"es_ES",et:"et_EE",fa:"fa_IR",fil:"fil_PH",fr:"fr_FR",he:"he_IL",hi:"hi_IN",id:"id_ID",it:"it_IT",ja:"ja_JP",ko:"ko_KR",ms:"ms_MY",nl:"nl_NL",pl:"pl_PL",pt:"pt_BR",ro:"ro_RO",ru:"ru_RU",sv:"sv_SE",th:"th_TH",tr:"tr_TR",uk:"uk_UA",ur:"ur_PK",vi:"vi_VN","zh-CN":"zh_CN","zh-TW":"zh_TW"},qS={ar:{currency:"SAR",symbol:"ر.س",label:"SAR"},bn:{currency:"BDT",symbol:"৳",label:"BDT"},cs:{currency:"",symbol:"",label:""},da:{currency:"",symbol:"",label:""},de:{currency:"EUR",symbol:"€",label:"EUR"},en:{currency:"",symbol:"",label:""},es:{currency:"ARS",symbol:"$",label:"ARS"},et:{currency:"",symbol:"",label:""},fa:{currency:"IRR",symbol:"﷼",label:"IRR"},fil:{currency:"PHP",symbol:"₱",label:"PHP"},fr:{currency:"EUR",symbol:"€",label:"EUR"},he:{currency:"ILS",symbol:"₪",label:"ILS"},hi:{currency:"INR",symbol:"₹",label:"INR"},id:{currency:"IDR",symbol:"Rp",label:"IDR"},it:{currency:"EUR",symbol:"€",label:"EUR"},ja:{currency:"JPY",symbol:"¥",label:"JPY"},ko:{currency:"KRW",symbol:"₩",label:"KRW"},ms:{currency:"MYR",symbol:"RM",label:"MYR"},nl:{currency:"EUR",symbol:"€",label:"EUR"},pl:{currency:"PLN",symbol:"zł",label:"PLN"},pt:{currency:"BRL",symbol:"R$",label:"BRL"},ro:{currency:"",symbol:"",label:""},ru:{currency:"RUB",symbol:"₽",label:"RUB"},sv:{currency:"",symbol:"",label:""},th:{currency:"THB",symbol:"฿",label:"THB"},tr:{currency:"TRY",symbol:"₺",label:"TRY"},uk:{currency:"UAH",symbol:"₴",label:"UAH"},ur:{currency:"",symbol:"",label:""},vi:{currency:"VND",symbol:"₫",label:"VND"},"zh-CN":{currency:"CNY",symbol:"¥",label:"CNY"},"zh-TW":{currency:"TWD",symbol:"NT$",label:"TWD"}},$S=["ar","bn","de","en","es","fil","fr","he","id","it","ja","ko","ms","nl","pl","pt","ru","th","tr","uk","vi","zh-CN","zh-TW"],ld={ar:()=>Promise.all([k(()=>import("./common-DFDocvph.js"),[]),k(()=>import("./documentation-DjMpiyUV.js"),[]),k(()=>import("./claude-install-BhpncxWu.js"),[])]),bn:()=>Promise.all([k(()=>import("./common-VNiGC7y7.js"),[]),k(()=>import("./documentation-CgNBrs0N.js"),[]),k(()=>import("./claude-install-DaYSKkfy.js"),[])]),cs:()=>Promise.all([k(()=>import("./common-DG6WfMwd.js"),[]),k(()=>import("./documentation-kWzVj7uc.js"),[]),k(()=>import("./claude-install-9RA9YVSF.js"),[])]),da:()=>Promise.all([k(()=>import("./common-DUH8Rk15.js"),[]),k(()=>import("./documentation-CHgM2EU8.js"),[]),k(()=>import("./claude-install-BelPjD-T.js"),[])]),de:()=>Promise.all([k(()=>import("./common-Cr2osoS4.js"),[]),k(()=>import("./documentation-BXMoeS4Z.js"),[]),k(()=>import("./claude-install-xjZ3DM2K.js"),[])]),es:()=>Promise.all([k(()=>import("./common-BEIssQ_m.js"),[]),k(()=>import("./documentation-Ck8NIQ3F.js"),[]),k(()=>import("./claude-install-CUPbsqQQ.js"),[])]),et:()=>Promise.all([k(()=>import("./common-Ctt0Nc-Q.js"),[]),k(()=>import("./documentation-BIeD_hyC.js"),[]),k(()=>import("./claude-install-ZWHUTA4A.js"),[])]),fa:()=>Promise.all([k(()=>import("./common-B5Sh1Zuw.js"),[]),k(()=>import("./documentation-B62mryfd.js"),[]),k(()=>import("./claude-install-CgO7rYnK.js"),[])]),fil:()=>Promise.all([k(()=>import("./common-vyJWKusT.js"),[]),k(()=>import("./documentation-CsZ8O4Fc.js"),[]),k(()=>import("./claude-install-DwEOVrCy.js"),[])]),fr:()=>Promise.all([k(()=>import("./common-DwcSNLeb.js"),[]),k(()=>import("./documentation-HurSXCvl.js"),[]),k(()=>import("./claude-install-ClLz0O0s.js"),[])]),he:()=>Promise.all([k(()=>import("./common-DldQohgk.js"),[]),k(()=>import("./documentation-CgEoiiY2.js"),[]),k(()=>import("./claude-install-BS_3Wm7z.js"),[])]),hi:()=>Promise.all([k(()=>import("./common-LYDqx2u4.js"),[]),k(()=>import("./documentation-BcwiqIW7.js"),[]),k(()=>import("./claude-install-DXTFM-2j.js"),[])]),id:()=>Promise.all([k(()=>import("./common-Bhukyv8R.js"),[]),k(()=>import("./documentation-CVuhMzIA.js"),[]),k(()=>import("./claude-install-ByXivqj6.js"),[])]),it:()=>Promise.all([k(()=>import("./common-BIPqPlK5.js"),[]),k(()=>import("./documentation-CuUCxuIr.js"),[]),k(()=>import("./claude-install-mzPDWDsu.js"),[])]),ja:()=>Promise.all([k(()=>import("./common-Drv6dJPA.js"),[]),k(()=>import("./documentation-CyZeINao.js"),[]),k(()=>import("./claude-install-CR9RyCme.js"),[])]),ko:()=>Promise.all([k(()=>import("./common-CPM0X9rF.js"),[]),k(()=>import("./documentation-zHSQV2HL.js"),[]),k(()=>import("./claude-install-el-rE9cs.js"),[])]),ms:()=>Promise.all([k(()=>import("./common-CQ_5PLFM.js"),[]),k(()=>import("./documentation-_iGbVqnw.js"),[]),k(()=>import("./claude-install-DpZgQA-4.js"),[])]),nl:()=>Promise.all([k(()=>import("./common-aI-IXCh_.js"),[]),k(()=>import("./documentation-Ujjygpcr.js"),[]),k(()=>import("./claude-install-B--qyPQy.js"),[])]),pl:()=>Promise.all([k(()=>import("./common-BJA0B2Xb.js"),[]),k(()=>import("./documentation-B1FO_8UR.js"),[]),k(()=>import("./claude-install-D0C62WWn.js"),[])]),pt:()=>Promise.all([k(()=>import("./common-BIIitxmr.js"),[]),k(()=>import("./documentation-BZtcAodW.js"),[]),k(()=>import("./claude-install-DDQEi_ru.js"),[])]),ro:()=>Promise.all([k(()=>import("./common-CuR4C-H5.js"),[]),k(()=>import("./documentation-D7JzPB_5.js"),[]),k(()=>import("./claude-install-CtIsEUdr.js"),[])]),ru:()=>Promise.all([k(()=>import("./common-BbXXwVJL.js"),[]),k(()=>import("./documentation-CBy77Tgf.js"),[]),k(()=>import("./claude-install-DLjlvv9i.js"),[])]),sv:()=>Promise.all([k(()=>import("./common-D9033Pec.js"),[]),k(()=>import("./documentation-CBiB3v88.js"),[]),k(()=>import("./claude-install-OCjOtLml.js"),[])]),th:()=>Promise.all([k(()=>import("./common-D4Cf4UvE.js"),[]),k(()=>import("./documentation-bgX8rYjI.js"),[]),k(()=>import("./claude-install-CakqP4VC.js"),[])]),tr:()=>Promise.all([k(()=>import("./common-B5j6UTgx.js"),[]),k(()=>import("./documentation-D098qpOV.js"),[]),k(()=>import("./claude-install-Cn7Jgqk7.js"),[])]),uk:()=>Promise.all([k(()=>import("./common-Cbhz-RNn.js"),[]),k(()=>import("./documentation-BEGLsbUk.js"),[]),k(()=>import("./claude-install-DZ3JVg2L.js"),[])]),ur:()=>Promise.all([k(()=>import("./common-DK_48Wes.js"),[]),k(()=>import("./documentation-T8PonP9u.js"),[]),k(()=>import("./claude-install-Demw9KeB.js"),[])]),vi:()=>Promise.all([k(()=>import("./common-CxVaWISk.js"),[]),k(()=>import("./documentation-Djo7bkxo.js"),[]),k(()=>import("./claude-install-CH12ge3m.js"),[])]),"zh-CN":()=>Promise.all([k(()=>import("./common-BcBpFiJZ.js"),[]),k(()=>import("./documentation-TUvO-0Wh.js"),[]),k(()=>import("./claude-install-E7-U7-yN.js"),[])]),"zh-TW":()=>Promise.all([k(()=>import("./common-BiKXgs8j.js"),[]),k(()=>import("./documentation-Bik7-RQW.js"),[]),k(()=>import("./claude-install-G19tO1wX.js"),[])])},dd={heading:"BlockSight for Claude",hook:"Read-only Bitcoin blockchain data inside Claude Desktop, Claude Code, and any MCP-compatible client — live blocks, transactions, addresses, fees, and network status, served from dedicated Bitcoin Core infrastructure.",capabilities:{heading:"What you can ask about",items:{blockHeight:"Current block height — the tip of the chain, live.",blockLookup:"Block details — txCount, size, weight, fees, miner, and timestamp for any block from genesis to tip.",transactionStatus:"Transactions — inputs, outputs, fee, confirmation depth, and block height for any TXID.",mempool:"Mempool state — current size, pending transaction count, and which fee tier is clearing now.",feeEstimates:"Recommended fees — sat/vB estimates for next-block and six-hour confirmation targets.",networkStatus:"Network status — difficulty, mempool size, hashrate, and live BTC/USD price.",congestion:"Congestion score — an at-a-glance read of how crowded the mempool is right now."}},desktop:{heading:"Install for Claude",intro:"BlockSight runs as a remote MCP server. Claude connects to it through the built-in Custom Connectors dialog. No file edits. No JSON.",step1Label:"Open Claude settings",step1Body:"In Claude (web or Desktop), click your profile icon and choose Settings, then select Connectors in the sidebar.",step2Label:"Add a custom connector",step2Body:"Scroll to the bottom of the Connectors page and click Add custom connector.",step3Label:"Fill in two fields",step3NameLabel:"Name",step3NameValue:"BlockSight.Live",step3UrlLabel:"URL",step3UrlValue:"https://mcp.blocksight.live/mcp",step3OAuthNote:"Leave the OAuth fields empty. BlockSight v1 is public and unauthenticated.",step4Label:"Click Add",step4Body:"The BlockSight tools become available in your next conversation."},code:{heading:"Install for Claude Code",intro:"Claude Code uses the same MCP server. Run this in any terminal:",addCommandCaption:"Add the server:",addCommandSnippet:"claude mcp add --transport http blocksight https://mcp.blocksight.live/mcp",verifyCaption:"Verify the server is registered:",verifyCommandSnippet:"claude mcp list",verifyResult:"The entry blocksight should appear with transport http. The BlockSight tools become available in new Claude Code sessions."},prompts:{heading:"Example prompts",intro:"Once installed, ask Claude:",items:{latestBlock:"What's the current Bitcoin block height?",blockByHeight:"Tell me about block 800000 — how many transactions, total fees, who mined it?",blockByHash:"Look up the block with hash 00000000000000000000562e541a6570ab53bbfdeeb4f64f3a0e37d34aa3f2db.",txStatus:"Is transaction 9e26861987608c136f54eea5059a0fd1fa60b5ec068d2f0973ba48f2bb2b4e86 confirmed yet?",txDetails:"Show me the inputs, outputs, and fee for that transaction.",mempoolSize:"How congested is the Bitcoin mempool right now?",feeRecommendation:"What are the recommended Bitcoin fees for the next block?",networkCongestion:"Give me the current network congestion score and what it means in practice.",blockBeforeTx:"Show me the last 10 blocks with their fee rates.",halvingCountdown:"How many blocks until the next Bitcoin halving?"}},readonly:{heading:"What's read-only",intro:"BlockSight is a read-only Bitcoin data source. It cannot and will not:",items:{noKeys:"No key storage — BlockSight never sees your private keys, seed phrase, or passphrase. Don't share them with anyone, including Claude.",noSigning:'No transaction signing — BlockSight cannot sign transactions. Ask it to "send Bitcoin" and it will politely decline.',noBroadcast:"No broadcasting — BlockSight does not accept or forward transactions to the Bitcoin network. It reads the chain; it does not write to it.",publicData:"No authentication required — v1 is public and rate-limited. You don't create an account, you don't log in, you don't paste an API key."}},troubleshooting:{heading:"Troubleshooting",items:{serverNotStarting:{question:"Tools not showing up in Claude",answer:"Check three things. (1) The URL in step 3 is exactly https://mcp.blocksight.live/mcp — the dialog rejects connectors silently if the URL has a typo, an extra trailing slash, or http instead of https. (2) The OAuth fields in step 3 are empty — BlockSight v1 is unauthenticated, and any value pasted into those fields causes the connector to fail. (3) Your Connectors page is freshly loaded; if you opened Settings before adding the connector, close and reopen Settings, then check Connectors again. Older Claude builds without Custom Connectors support do not show Add custom connector at all — update to the latest Claude version. For Claude Code, run claude mcp list and verify the entry blocksight appears with transport http."},staleData:{question:"Data looks stale or a block is missing",answer:"BlockSight follows the Bitcoin Core tip on dedicated infrastructure, typically within seconds of a new block. If a response looks stale, ask Claude to query again — the answer is cached briefly to respect rate limits. If the staleness persists across retries, email dev@blocksight.live with the block height or TXID you were querying."},rateLimit:{question:"Rate limit hit",answer:"BlockSight v1 shares a rate-limit pool with the public REST API (100 requests per 15 minutes per IP). If you hit it, wait a few minutes and try again. If you need higher throughput for a production workflow, email dev@blocksight.live and we will discuss a premium tier."}}},contact:{heading:"Contact",body:"Technical and API questions go to the address below. For privacy and legal questions use legal@blocksight.live. For partnerships, press, and business reach ceo@blocksight.live. BlockSight is built and operated by Blocksight OÜ, Tallinn, Estonia."}},ud={claudeInstall:dd},hd={ariaLabel:{block:"View block {{value}}",tx:"View transaction {{value}}",address:"View address {{value}}"}},md={inMinSec:"in {{minutes}}m {{seconds}}s",inMin_one:"in {{count}} min",inMin_other:"in {{count}} mins",inSec_one:"in {{count}} sec",inSec_other:"in {{count}} secs",anyMoment:"any moment",delayed_one:"delayed {{count}} min",delayed_other:"delayed {{count}} mins",delayedSec_one:"DELAYED {{count}} sec",delayedSec_other:"DELAYED {{count}} secs",delayedMinSec:"DELAYED {{minutes}}m {{seconds}}s",delayedHourMin:"DELAYED {{hours}}h {{minutes}}m",justFound:"just found",justNow:"JUST NOW",momentAgo:"moment ago",ago_one:"{{count}} min ago",ago_other:"{{count}} mins ago",hoursMinAgo:"{{hours}}h {{minutes}}m ago"},pd={title:"BlockSight.Live",tagline:"Real-time Bitcoin Blockchain Visualization",loading:"Loading BlockSight...",error:"Something went wrong",retry:"Retry",back:"Back",close:"Close",save:"Save",cancel:"Cancel",confirm:"Confirm",delete:"Delete",edit:"Edit",view:"View",search:"Search",filter:"Filter",sort:"Sort",refresh:"Refresh",settings:"Settings",help:"Help",about:"About",copy:"Copy"},fd={home:"Home",dashboard:"Dashboard",search:"Search",calculator:"Calculator",settings:"Settings",addressExplorer:"Address Explorer",blockExplorer:"Block Explorer",transactionExplorer:"Transaction Explorer",language:"Language",currency:"Currency",units:"Units",whitepaper:"Whitepaper",documentation:"Documentation",faq:"FAQ",apiSubscription:"API Subscription",tzurWallet:"TZUR Wallet",aboutUs:"About Us",legal:"Legal",privacyPolicy:"Privacy Policy",termsOfService:"Terms of Service",returnToHome:"Return to home view",homeIndicator:"Home indicator"},gd={logo:"BlockSight.Live",searchPlaceholder:"Search blocks, transactions, addresses...",searchButton:"Search",language:"Language",languageSelector:"Select Language",english:"English",spanish:"Español",hebrew:"עברית",portuguese:"Português",networkStatus:"Network Status",connected:"Connected",disconnected:"Disconnected",syncing:"Syncing",mobileMenu:"Menu",lightMode:"Light",darkMode:"Dark",navigation:"Navigation",home:"BlockSight.Live home",openSearch:"Open search"},bd={title:"Bitcoin Blockchain Dashboard",leftPanel:{title:"Search Results",noResults:"No search results found",placeholder:"Search for blocks, transactions, or addresses to see results here",searching:"Searching...",selectBlock:"Select a block to view details",selectTransaction:"Select a transaction to view details",selectAddress:"Select an address to view details"},centerPanel:{title:"3D Blockchain Visualizer",memoryPool:{title:"Memory Pool",upcomingBlocks:"Upcoming Blocks",estimatedTime:"Estimated Time",transactionCount:"Transaction Count",feeRange:"Fee Range"},currentBlocks:{title:"Current Blocks",nextBlock:"Next Block",lastBlock:"Last Block",mining:"Mining in Progress",confirmed:"Confirmed",confirmations:"Confirmations"},builtBlockchain:{title:"Built Blockchain",historicalBlocks:"Historical Blocks",blockHeight:"Block Height",timestamp:"Timestamp",difficulty:"Difficulty",size:"Size"}},rightPanel:{title:"Dashboard Widgets",placeholder:"Bitcoin price, fees, and network congestion widgets will appear here",bitcoinPrice:"Bitcoin Price",feeEstimates:"Fee Estimates",networkCongestion:"Network Congestion",unconfirmedTx:"Unconfirmed Transactions"}},yd={price:{title:"Bitcoin Price",currentPrice:"Current Price",priceChange:"Price Change",priceChange24h:"24h Change",priceChange7d:"7d Change",priceChange30d:"30d Change",high24h:"24h High",low24h:"24h Low",volume24h:"24h Volume",marketCap:"Market Cap",dominance:"Market Dominance",lastUpdated:"Last Updated",loading:"Loading price data...",dataSource:"Data Source",updated:"Updated",currency:{usd:"USD",eur:"EUR",gbp:"GBP",jpy:"JPY",cad:"CAD",aud:"AUD",chf:"CHF",cny:"CNY",inr:"INR",brl:"BRL",ils:"ILS"}},fees:{title:"Fee Estimates",loading:"Loading fee data...",nextBlock:"Next Block",sixHours:"6 Hours",twentyFourHours:"24 Hours",custom:"Custom",satPerByte:"sat/byte",satPerVByte:"sat/vbyte",dollars:"Dollars",confirmationTime:"Confirmation Time",fast:"Fast",medium:"Medium",slow:"Slow",verySlow:"Very Slow",mempoolSize:"Mempool Size",pendingTransactions:"Pending Transactions",gauge:{title:"Fee Gauge",nextBlock:"Next Block",nextBlockShort:"Next",withinSixHours:"Within 6 Hours",sixHoursShort:"Later",noPriority:`NO PRIORITY`,satsPerVByte:"sats v/B",dollars:"$",tooltip:{nextBlock:"Minimum fee likely to enter the next block",sixHours:"Average of the lowest fees in recent blocks"}}},network:{title:"Network Status",congestion:"Congestion",healthy:"Healthy",moderate:"Moderate",high:"High",extreme:"Extreme",hashRate:"Hash Rate",difficulty:"Difficulty",blockHeight:"Block Height",blockTime:"Block Time",averageBlockTime:"Average Block Time",blocksPerHour:"Blocks per Hour",blocksPerDay:"Blocks per Day",totalTransactions:"Total Transactions",transactionsPerSecond:"Transactions per Second",unconfirmedTransactions:"Unconfirmed Transactions",mempoolSize:"Mempool Size",lastBlock:"Last Block",nextBlock:"Next Block",gauge:{title:"Network Congestion Gauge",loading:"Loading network data...",belowAverage:"Low",average:"Average",congestion:"Congested",extremeCongestion:"Extreme",unconfirmed:"UNCONFIRMED TXs",systemStatus:"SYSTEM STATUS",unhealthy:"UNHEALTHY",healthy:"HEALTHY",degraded:"DEGRADED",demo:"(Demo)",tooltip:{"below-average":"Low activity level; the network is not congested",average:"Average activity level; transactions are confirmed in a reasonable time",congestion:"High activity level; delays in transaction confirmation may occur","extreme-congestion":"The network is heavily congested, with long confirmation times and higher fees"},centerTooltip:{description:"Current network congestion based on pending transactions and time since the last block",unconfirmed:"Unconfirmed"}}},calculator:{title:"Bitcoin Calculator",convert:"Convert",from:"From",to:"To",amount:"Amount",result:"Result",exchangeRate:"Exchange Rate",lastUpdated:"Last Updated",quickConversions:"Quick Conversions",quick1:"1 BTC = 100,000,000 sats",quick2:"1 sat = 0.00000001 BTC",units:{btc:"Bitcoin (BTC)",mbtc:"Millibitcoin (mBTC)",ubtc:"Microbitcoin (μBTC)",satoshi:"Satoshi (sat)",usd:"US Dollar (USD)",eur:"Euro (EUR)",gbp:"British Pound (GBP)",jpy:"Japanese Yen (JPY)",cad:"Canadian Dollar (CAD)",aud:"Australian Dollar (AUD)",chf:"Swiss Franc (CHF)",cny:"Chinese Yuan (CNY)",inr:"Indian Rupee (INR)",brl:"Brazilian Real (BRL)",ils:"Israeli Shekel (ILS)"},calculations:{fees:"Transaction Fees",confirmationTime:"Confirmation Time",blockReward:"Block Reward",halving:"Halving",difficulty:"Mining Difficulty",hashRate:"Hash Rate",energy:"Energy Consumption",carbonFootprint:"Carbon Footprint"}},search:{title:"Bitcoin Search",placeholder:"Search the Bitcoin Blockchain - Address, Transaction or Block Hash",searchButton:"Search",clearButton:"Clear",advancedSearch:"Advanced Search",searchTypes:{all:"All",blocks:"Blocks",transactions:"Transactions",addresses:"Addresses",scripts:"Scripts"},filters:{dateRange:"Date Range",blockHeight:"Block Height",transactionType:"Transaction Type",amount:"Amount",fee:"Fee"},results:{title:"Search Results",noResults:"No results found",searching:"Searching...",totalResults:"Total Results",showing:"Showing",of:"of",results:"results",loadMore:"Load More",export:"Export Results",match:"match",trySearchingFor:"Try searching for:",exampleBlockHeight:"Block height (e.g., 800000)",exampleTxId:"Transaction ID (e.g., 64-character hex)",exampleAddress:"Bitcoin address (e.g., 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa)"}}},vd={title:"Block",hash:"Block Hash",height:"Block Height",timestamp:"Timestamp",size:"Size",weight:"Weight",transactions:"Transactions",fees:"Fees",difficulty:"Difficulty",merkleRoot:"Merkle Root",previousBlock:"Previous Block",nextBlock:"Next Block",confirmations:"Confirmations",status:{confirmed:"Confirmed",unconfirmed:"Unconfirmed",orphaned:"Orphaned",stale:"Stale"},details:{title:"Block Details",header:"Block Header",transactions:"Transaction List",rawData:"Raw Data",statistics:"Statistics"}},kd={title:"Transaction",txid:"Transaction ID",hash:"Transaction Hash",block:"Block",confirmations:"Confirmations",timestamp:"Timestamp",size:"Size",weight:"Weight",fee:"Fee",inputs:"Inputs",outputs:"Outputs",amount:"Amount",status:{confirmed:"Confirmed",unconfirmed:"Unconfirmed",pending:"Pending",failed:"Failed"},details:{title:"Transaction Details",inputs:"Input Details",outputs:"Output Details",rawData:"Raw Data",script:"Script Analysis"}},Sd={title:"Address",address:"Address",balance:"Balance",totalReceived:"Total Received",totalSent:"Total Sent",transactionCount:"Transaction Count",firstSeen:"First Seen",lastSeen:"Last Seen",utxoCount:"UTXO Count",type:"Address Type",script:"Script Type",details:{title:"Address Details",transactions:"Transaction History",utxos:"UTXO List",statistics:"Statistics",rawData:"Raw Data"}},wd={title:"Settings",general:"General",appearance:"Appearance",language:"Language",currency:"Currency",units:"Bitcoin Units",dark:"Dark",light:"Light",auto:"Auto",notifications:"Notifications",priceAlerts:"Price Alerts",feeAlerts:"Fee Alerts",networkAlerts:"Network Alerts",blockAlerts:"Block Alerts",privacy:"Privacy",analytics:"Analytics",telemetry:"Telemetry",crashReports:"Crash Reports",usageData:"Usage Data",about:"About",version:"Version",license:"License",contributors:"Contributors",changelog:"Changelog"},_d={general:"Something went wrong",network:"Network error occurred",notFound:"Resource not found",unauthorized:"Unauthorized access",forbidden:"Access forbidden",serverError:"Server error occurred",timeout:"Request timed out",offline:"You are currently offline",retry:"Please try again",contactSupport:"Contact support if the problem persists",errorCodes:{400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout"},widget:{failedToLoad:"Failed to load {{componentName}}",retry:"Retry",retrying:"Retrying...",maxRetries:"Max retries reached. Please refresh the page.",price:"Price unavailable",congestion:"Congestion data unavailable",fee:"Fee data unavailable",timeout:"Connection timeout"},service:{network:{title:"Connection Issue",message:"Unable to connect to BlockSight services. Please check your internet connection and try again."},module:{title:"Loading Error",message:"The application failed to load completely. This may be due to a network issue or outdated cache. Try clearing your browser cache and refreshing."},websocket:{title:"Real-Time Connection Lost",message:"The connection for live data has been interrupted. Some features may be temporarily unavailable."},api:{title:"Service Temporarily Unavailable",message:"BlockSight services are temporarily unavailable. Our team has been notified and is working to restore service."},render:{title:"Display Error",message:"An error occurred while displaying this page. Please try refreshing."},unknown:{title:"Something Went Wrong",message:"An unexpected error occurred. Please try refreshing the page."}},actions:{retry:"Try Again",refresh:"Refresh Page",goHome:"Go to Homepage",help:"Get Help"},labels:{errorCode:"Error Code",supportReference:"Support Reference"}},Td={general:"Loading...",searching:"Searching...",fetching:"Fetching data...",processing:"Processing...",connecting:"Connecting...",syncing:"Synchronizing...",mining:"Mining in progress...",confirming:"Confirming transaction...",calculating:"Calculating...",updating:"Updating...",saving:"Saving...",deleting:"Deleting...",exporting:"Exporting...",importing:"Importing..."},Ed={yes:"Yes",no:"No",ok:"OK",cancel:"Cancel",close:"Close",back:"Back",next:"Next",previous:"Previous",search:"Search",filter:"Filter",sort:"Sort",refresh:"Refresh",reload:"Reload",play:"Play",pause:"Pause",reset:"Reset",clear:"Clear",online:"Online",offline:"Offline",minutesShort:"min",copy:"Copy",copied:"Copied!",connected:"Connected",disconnected:"Disconnected"},Cd={healthy:"Healthy",degraded:"Degraded"},xd={wsLatency:"WS latency"},Ad={home:"Home",data:"Data",search:"Search",settings:"Settings",openDrawer:"Open menu",closeDrawer:"Close menu",swipeToClose:"Swipe to close"},Bd={copyright:"© 2024 BlockSight.Live. All rights reserved.",poweredBy:"Powered by Bitcoin",network:"Network Status",statistics:"Statistics",feeEstimates:"Fee Estimates",externalLinks:"External Links",bitcoinOrg:"Bitcoin.org",bitcoinCore:"Bitcoin Core",electrum:"Electrum",github:"GitHub",documentation:"Documentation",api:"API",support:"Support",contact:"Contact"},Rd={visualization:{title:"Blockchain Visualization",unableToLoad:"Unable to load blockchain data"}},Id={ariaLabel:"Block {{height}} details",mempoolBlock:"Mempool Block",title:"Block",blockNumber:"Block {{height}}",hash:"Hash",copyHash:"Click to copy full hash",copyHashAriaLabel:"Copy block hash: {{hash}}",height:"Height",timestamp:"Timestamp",pending:"Pending",transactions:"Transactions",feeRates:"Fee Rates",minFee:"Min",medianFee:"Median",maxFee:"Max",miner:"Miner",predicted:"Predicted",unknown:"Unknown",tbd:"TBD",financials:"Block Reward",totalFees:"Total Fees",subsidy:"Subsidy",total:"Total",memoryPool:"Memory Pool",confirmed:"Confirmed",previousBlock:"Previous block",nextBlock:"Next block",genesisBlock:"(Genesis Block)"},Pd={ariaLabel:"Transaction details",title:"Transaction",hash:"TX Hash",status:"Status",block:"Block",firstSeen:"First Seen",confirmedAt:"Confirmed",fee:"Fee",sats:"Sats",fiatValue:"USD",feeRate:"sat/vB",feeUnknown:"Fee unavailable",feeUnknownTooltip:"This transaction has more inputs than we can resolve without additional Bitcoin Core calls. Fee is unknown but never negative.",dropped:{title:"Dropped from mempool",confirmed:"Included in block {{blockHash}}",replaced:"Replaced by {{replacementTxid}}",evicted:"Removed from mempool (low fee or expired)",viewReplacement:"View replacement"},from:"From",to:"To",amount:"Amount",pending:"Pending",confirmed:"Confirmed",unconfirmed:"UNCONFIRMED",oneConfirmation:"1 confirmation",confirmations:"{{count}} confirmations",justNow:"Just now",minuteAgo:"1 minute ago",minutesAgo:"{{count}} minutes ago",hourAgo:"1 hour ago",hoursAgo:"{{count}} hours ago",unknown:"Unknown",rbfHistory:"Fee Bump History",previousFee:"Previous",currentFee:"Current",bumpCount:"Bumps",viewBlock:"View block details",viewAddress:"View address details",estConfirmation:"Est. Confirmation",blockPosition:"Block {{position}}",minutes:"min",pattern:"Pattern",confidence:"Confidence",pattern_simple_payment:"Simple Payment",pattern_consolidation:"Consolidation",pattern_batch_payment:"Batch Payment",pattern_coinjoin:"CoinJoin",pattern_unknown:"Unknown Pattern",coinbase:"Coinbase",coinbaseFeeNote:"N/A — Block Reward",coinbaseBlockReward:"Coinbase (Block Reward)",coinbaseReward:"Coinbase reward",confirmedBadge:"Confirmed",blockReward:"Block Reward",estimatedPosition:"Est. Position",payment:"Payment",change:"Change",unknownType:"Unknown",heuristicTooltip:"Output classified by transaction analysis"},Ld={ariaLabel:"Address details",title:"Address",address:"Address",balance:"Balance",pending:"pending",transactions:"Transactions",confirmedUtxos:"Confirmed UTXOs",pendingUtxos:"Pending UTXOs",recentTransactions:"Recent Transactions",viewTransaction:"View transaction {{txid}}",pendingTx:"Pending",loadMore:"Load More",showQr:"Show QR Code",qrModal:"QR Code",addressType:{legacy:"Legacy",segwit:"SegWit",nativeSegwit:"Native SegWit",taproot:"Taproot"},unavailable:"N/A"},Dd={copy:{address:"Copy Address",block:"Copy Block Hash",transaction:"Copy Transaction Hash"},copied:"Copied!",copiedAriaLabel:"Copied to clipboard",ariaLabel:{address:"Copy address to clipboard",block:"Copy block hash to clipboard",transaction:"Copy transaction hash to clipboard"}},Nd={timer:{anyMoment:"any moment",minutesLeft:"{{count}} min left",minutesLeft_one:"{{count}} min left",minutesLeft_other:"{{count}} mins left",sinceLastBlock:"since last block"}},Od={errors:{emptyQuery:"Please enter a search query",invalidInput:"Invalid search input",invalidBlockHeight:"Invalid block height",blockOutOfRange:"Block height must be between 0 and {{maxHeight}}",blockHeightNegative:"Block height cannot be negative",blockHeightTooHigh:"Block height exceeds current tip",blockNotFound:"Block not found in current view",blockNotFoundByHash:"Block not found with this hash",mempoolHashSearch:"Mempool blocks cannot be searched by hash",hashNotFound:"No block or transaction found with this hash",transactionNotFound:"Transaction not found",addressNotFound:"Address not found",apiNotAvailable:"Search API not available",rateLimited:"Please wait before searching again",rateLimitedDescription:"Try again in {{seconds}} seconds",notImplemented:"Search type not yet supported",notImplementedDescription:"Only block, transaction, and address search is available"},tips:{title:"Search Tips",transaction:"Transaction Hash: 64-character hex string",block:"Block Height: Number (e.g., 882491)",address:"Address: Bitcoin address (starts with 1, 3, or bc1)"},placeholder:"Search block, transaction, or address",searching:"Searching...",loading:"Searching"},Md={ariaLabel:"System status: {{status}}",blockchain:"Blockchain",dataSources:"Data Sources",market:"Market",performance:"Performance",websocket:"WebSocket",uptime:"Uptime",slaTarget:"SLA Target",latency:"Latency (p95)",errorRate:"Error Rate",lastHeartbeat:"Last Heartbeat",statusLabel:"Status",status:{live:"Live",stale:"Stale",demo:"Demo",offline:"Offline"},heartbeat:{justNow:"Just now",minutesAgo:"{{count}} min ago",minutesAgo_one:"{{count}} min ago",minutesAgo_other:"{{count}} mins ago",hoursAgo:"{{count}} hr ago",hoursAgo_one:"{{count}} hr ago",hoursAgo_other:"{{count}} hrs ago"}},Hd={message:"BlockSight.Live is offline",reconnecting:"Reconnecting..."},Fd={home:{title:"BlockSight.Live | Explorer",description:"Monitor the Bitcoin blockchain in real-time with BlockSight.Live. View live blocks, transactions, mempool data, fee estimates, and network congestion. Free Bitcoin explorer with advanced visualization.",h1:"Real-Time Bitcoin Blockchain Explorer",answerBlock:"BlockSight.Live is a real-time Bitcoin blockchain explorer that visualizes the network as it happens. Users can monitor live blocks, pending transactions in the mempool, fee estimates, and network congestion. The platform offers both a free public dashboard and paid API access for developers. BlockSight.Live is designed for Bitcoin enthusiasts, traders, and developers who need instant visibility into blockchain activity."},about:{title:"About BlockSight.Live | Bitcoin Blockchain Explorer Team",description:"Learn about BlockSight.Live, the team behind the real-time Bitcoin blockchain explorer. Meet our founders and discover our mission to make Bitcoin data accessible.",h1:"About BlockSight.Live",answerBlock:"BlockSight.Live was created by a team of Bitcoin developers and data visualization experts. Our mission is to make Bitcoin blockchain data accessible, understandable, and actionable for everyone. We believe in Bitcoin-only principles and accept only Bitcoin payments for our services. The platform is operated by Blocksight OÜ, registered in Estonia, combining European regulatory standards with cutting-edge blockchain technology.",linksTitle:"Explore More"},api:{title:"Bitcoin API | BlockSight.Live Developer API",description:"Access real-time Bitcoin blockchain data through the BlockSight.Live API. REST and WebSocket endpoints for blocks, transactions, addresses, fees, and mempool data. Bitcoin-only payments.",h1:"BlockSight.Live API",answerBlock:"The BlockSight.Live API provides real-time Bitcoin blockchain data through REST and WebSocket endpoints. Developers can access blocks, transactions, addresses, fee estimates, and mempool data programmatically. Three subscription tiers are available: Basic for small projects, Advanced for growing applications, and Premium+ for enterprise needs. All payments are processed exclusively in Bitcoin, with subscriptions managed through on-chain transactions.",lastUpdated:"Last updated: 2025-12-16",linksTitle:"Learn More"},claude:{title:"BlockSight for Claude — Bitcoin blockchain data in Claude Desktop and Claude Code",description:"Install BlockSight as an MCP server for Claude Desktop and Claude Code. Read-only access to live Bitcoin blockchain data: blocks, transactions, mempool, fees, and network status. Free to install.",h1:"BlockSight for Claude",answerBlock:"BlockSight for Claude is an MCP (Model Context Protocol) server that connects Claude Desktop and Claude Code to live Bitcoin blockchain data. Users can ask Claude about block heights, transaction status, mempool activity, fee estimates, and network congestion — answered with real-time data from a dedicated Bitcoin Core + Electrum backend. The server is read-only (no private keys, no signing) and installs via a single config block."},documentation:{title:"Documentation | BlockSight.Live Bitcoin Explorer Guide",description:"Complete guide to using BlockSight.Live. Learn about blockchain visualization, fee gauges, congestion metrics, and all features of our Bitcoin explorer.",h1:"BlockSight.Live Documentation",answerBlock:"This documentation covers all features of BlockSight.Live, from basic navigation to advanced API integration. Learn how to interpret the real-time blockchain visualizer, understand fee gauges and congestion metrics, and use the search functionality. API subscribers will find endpoint references, authentication guides, and code examples. The documentation is regularly updated as new features are released.",lastUpdated:"Last updated: 2025-12-16",linksTitle:"Related Resources"},legal:{title:"Legal | Terms, Privacy & API Agreement | BlockSight.Live",description:"BlockSight.Live legal documents: Terms of Service, Privacy Policy, and API Terms & SLA Agreement. Operated by Blocksight OÜ, Estonia.",h1:"Legal",answerBlock:"This page contains BlockSight.Live's legal documents including Terms of Service, Privacy Policy, and API Terms & SLA Agreement. All services are provided by Blocksight OÜ, registered in Estonia. Review our policies to understand your rights and our obligations."},whitepaper:{title:"Whitepaper | BlockSight.Live Bitcoin Observation Layer",description:"BlockSight.Live Whitepaper: A Real-time Observation Layer for the Bitcoin Network. Read about our design principles, system structure, and observation model.",h1:"BlockSight.Live Whitepaper",answerBlock:"The BlockSight.Live Whitepaper introduces a real-time observation layer for the Bitcoin network. It describes a system architecture that processes blockchain data with minimal latency while maintaining data integrity. The paper covers design principles, the observation model, and how BlockSight.Live bridges raw blockchain data with human-readable insights. This technical document is intended for developers and researchers interested in Bitcoin infrastructure.",lastUpdated:"Last updated: 2025-12-16",linksTitle:"Continue Exploring"},faq:{title:"FAQ | BlockSight.Live Bitcoin Explorer",description:"Frequently asked questions about BlockSight.Live Bitcoin blockchain explorer. Learn about features, API access, pricing, and how to use the platform.",h1:"BlockSight FAQ",answerBlock:"Find answers to common questions about BlockSight.Live, the real-time Bitcoin blockchain explorer. Learn about our features, API subscription plans, Bitcoin-only payments, and how to get started with blockchain data."},tzur:{title:"TZUR Wallet | Bitcoin in Your Language | BlockSight.Live",description:"TZUR is a self-custody Bitcoin wallet for iOS with BIP-39 seed phrases in 31 languages. One-time purchase, no subscriptions. Built by the BlockSight team.",h1:"TZUR Wallet - Bitcoin in Your Language",answerBlock:"TZUR Wallet is a self-custody Bitcoin wallet built natively for iOS. It is the first Bitcoin wallet to generate BIP-39 seed phrases in 31 languages. TZUR is a one-time purchase of $59.99 with no subscriptions. Features include a built-in BlockSight.Live explorer, 75 fiat currencies, 7 visual themes, and hardware-backed security. Built by the same team behind BlockSight.Live.",linksTitle:"Explore More"},links:{readWhitepaper:"Read our Whitepaper",exploreApi:"Explore our API",viewDocs:"View Documentation",viewLegal:"View Legal",viewAbout:"View About Us",aboutUs:"About Us",readFaq:"Read FAQ",getApiAccess:"Get API Access",subscribeApi:"Subscribe to API"}},jd={crm:{title:"CRM Dashboard",subtitle:"Client Management, Transactions & Reports",tabs:{clients:"Clients",transactions:"Transactions",reports:"Reports",overview:"Overview",users:"Users",documents:"Documents",invoices:"Invoices",audit:"Audit Log"},actions:{exportCsv:"Export CSV",retry:"Retry",refresh:"Refresh",backToCrm:"← Back to CRM"},table:{headers:{name:"Name",email:"Email",status:"Status",tier:"Tier",revenue:"Revenue",createdAt:"Created",amount:"Amount",amountBtc:"BTC Amount",amountUsd:"USD Value",client:"Client",invoiceId:"Invoice ID",txHash:"TX Hash",type:"Type",title:"Title",size:"Size",uploadedAt:"Uploaded",role:"Role",action:"Action",actor:"Actor",resource:"Resource",timestamp:"Time",lastActivity:"Last Activity",paidAt:"Paid At"},empty:{clients:"No clients found",transactions:"No transactions found",documents:"No documents found",users:"No users found",audit:"No audit logs found"}},filters:{allStatuses:"All statuses",allTiers:"All tiers",searchClients:"Search by name or email...",searchTransactions:"Search by ID, email, or client...",startDate:"Start date",endDate:"End date",search:"Search...",clearSearch:"Clear search",to:"to"},tiers:{free:"Free",basic:"Basic",advanced:"Advanced",premiumPlus:"Premium+"},status:{active:"Active",inactive:"Inactive",suspended:"Suspended",pending:"Pending",confirmed:"Confirmed",failed:"Failed",expired:"Expired",success:"Success",failure:"Failure"},loading:{clients:"Loading clients...",transactions:"Loading transactions...",reports:"Loading reports...",profile:"Loading profile..."},summary:{totalAmount:"Total Amount",usdValue:"USD Value",transactions:"Transactions"},profile:{notFound:"Client not found",invoicesComingSoon:"Invoice management coming soon. View all transactions in the",sections:{businessDetails:"Business Details",billingInfo:"Billing Information",recentActivity:"Recent Activity",statistics:"Statistics"},fields:{legalName:"Legal Name",taxId:"Tax ID",billingEmail:"Billing Email",address:"Address",website:"Website",industry:"Industry",createdAt:"Created",totalRevenue:"Total Revenue",totalTransactions:"Transactions",documentsCount:"Documents",usersCount:"Users",lastInvoice:"Last Invoice",file:"File",uploadedBy:"By"}},reports:{title:"Reports",metrics:{totalRevenue:"Total Revenue",totalInvoices:"Total Invoices",paidInvoices:"Paid Invoices",unpaidInvoices:"Unpaid Invoices",activeClients:"Active Clients",churnedClients:"Churned Clients",totalReceived:"Total Received",invoiceTotal:"Invoice Total",overdue:"Overdue",totalClients:"Total Clients",newThisMonth:"New This Month",churnRate:"Churn Rate",percentOfTotal:"% of Total"},sections:{tierBreakdown:"Tier Breakdown",topClients:"Top Clients by Revenue",revenueSummary:"Revenue Summary",customerMetrics:"Customer Metrics"},period:"Period",generatedAt:"Generated at"},pagination:{showing:"Showing {{start}}-{{end}} of {{total}}",perPage:"per page"},noName:"No name"}},Ud={aria:{bitcoinTools:"Bitcoin Tools",openToolbar:"Open ToolBar",closeToolbar:"Close ToolBar"},halving:{ariaLabel:"Bitcoin Halving Countdown",title:"Halving Countdown",projectedDate:"Projected Date",halvingAtBlock:"Halving at Block",blocksRemaining:"Blocks Remaining",btcUntilHalving:"BTC Until Halving",currentEpoch:"Current Epoch %"},supply:{ariaLabel:"Bitcoin Supply Information",title:"Bitcoin Supply",circulatingSupply:"Circulating Supply",percentageIssued:"Percentage Issued",issuanceRemaining:"Issuance Remaining",dailyIssuance:"Issuance (24hrs)"},generalMetrics:{ariaLabel:"Core Network Metrics",title:"Core Network Metrics",waiting:"Waiting for data...",transactions24h:"Transactions 24h",avgTxPerHour:"Avg tx/hour",btcSent24h:"BTC sent 24h",btcSentPerHour:"BTC sent avg/hour",avgTxValue:"Avg tx value",medianTxValue:"Median tx value",avgTxFee:"Avg tx fee",medianTxFee:"Median tx fee"},monicaMetrics:{ariaLabelOpen:"Open Monica Metrics",ariaLabelClose:"Close Monica Metrics",ariaLabelModal:"Monica Metrics Panel",title:"Monica Metrics",error:"Unable to load Monica Metrics",errorDetails:"Monica Metrics component error",metrics:{bvp:{label:"BVP",tooltip:"Share of total Bitcoin supply that moved in the last 24 hours."},rur:{label:"RUR",tooltip:"Typical transaction size compared to the average, indicating whale skew."},fpi:{label:"FPI",tooltip:"Typical fee cost relative to what users are actually sending."},tts:{label:"TTS",tooltip:"Average value settled per Bitcoin transaction without intermediaries."},edi:{label:"EDI",tooltip:"Average dollar value settled by each Bitcoin block."}}},calculator:{ariaLabelOpen:"Open Currency Calculator",ariaLabelClose:"Close Currency Calculator",ariaLabelModal:"Currency Calculator",usdAmount:"USD amount",btcAmount:"BTC amount",satsAmount:"Satoshis amount",secondaryFiatAmount:"{{currency}} amount",copy:"Copy {{label}}",copied:"Copied!"}},Wd={title:"Subscription",currentPlan:"Current Plan",billingPeriod:"Billing Period:",renewalDate:"Renewal Date:",upgradePlan:"Upgrade Plan"},zd={loading:"Loading invoices...",empty:"No invoices found",invoice:"Invoice",date:"Date",amount:"Amount",paymentAddress:"Payment Address",transaction:"Transaction",status:"Status",previous:"Previous",next:"Next",pageInfo:"Page {{current}} of {{total}}"},Vd={recommended:"Recommended",priceUnit:"BTC/year",sats:"sats",requestsPerDay:"Requests/day",rateLimit:"Rate limit",perSecond:"/second",processing:"Processing...",selectPlan:"Select Plan"},qd={confirmed:"Payment Confirmed!",thankYou:"Thank you for subscribing to BlockSight API",summary:"Subscription Summary",plan:"Plan",amountPaid:"Amount Paid",dailyRequests:"Daily Requests",rateLimit:"Rate Limit",viewTransaction:"View Transaction",getApiKey:"Get Your API Key"},$d={number:"Invoice #{{number}}",paymentAddress:"Payment Address",expiresIn:"Invoice expires in",expired:"EXPIRED"},Gd={title:"API Key",active:"Active",inactive:"Inactive",secretWarning:"Keep this key secret. Do not share it publicly.",reveal:"Reveal",hide:"Hide",rotate:"Rotate",created:"Created:",lastUsed:"Last Used:",neverUsed:"Never used",confirmRotation:"Confirm Key Rotation",rotationWarning:"Are you sure you want to rotate your API key? Your current key will be invalidated immediately and cannot be recovered.",rotating:"Rotating..."},Kd={detailPanel:"Detail panel",closePanel:"Close panel",block:{title:"Block #{{height}}",hash:"Hash",time:"Time",transactions:"Transactions",miner:"Miner",feeMin:"MIN",feeMedian:"MEDIAN",feeMax:"MAX",feeUnit:"sat/vB"},transaction:{title:"Transaction",txid:"TXID",status:"Status",confirmed:"Confirmed ({{count}})",pending:"Pending",block:"Block",fee:"Fee",feeRate:"Fee Rate",from:"From",to:"To",inputs:"Inputs",outputs:"Outputs"},address:{title:"Address",address:"Address",type:"Type",totalBalance:"Total Balance",confirmed:"Confirmed",unconfirmed:"Unconfirmed",transactions:"Transactions",received:"Received",sent:"Sent"},search:{title:"Search Results",searching:"Searching for: {{query}}",enterQuery:"Enter a search query"}},Zd={skipToContent:"Skip to main content"},Yd={ariaLabel:"Bitcoin amount approximately {{amount}} BTC"},Jd={languageImmediate:"Language changes will take effect immediately.",localStorage:"Your preferences are automatically saved to your browser's local storage.",resetNetworkState:"Reset persisted network state"},Xd={api:{goToPortal:"Go to Customer Portal →",content:{modal:{paymentTitle:"Payment Invoice",creatingInvoice:"Creating invoice..."}}},legal:{sla:{title:"API Terms & SLA Agreement"}}},Qd={terms:"Terms",privacy:"Privacy",accessibility:"Accessibility",sla:"SLA",aup:"Acceptable Use",dpa:"DPA",msa:"MSA"},eu={copyableLink:hd,timer:md,app:pd,navigation:fd,header:gd,dashboard:bd,bitcoin:yd,blocks:vd,transactions:kd,addresses:Sd,settings:wd,errors:_d,loading:Td,common:Ed,status:Cd,network:xd,mobileNav:Ad,footer:Bd,blockchain:Rd,blockDetails:Id,transactionDetails:Pd,addressDetails:Ld,copyButton:Dd,blockCard:Nd,search:Od,healthChip:Md,backendOffline:Hd,seo:Fd,admin:jd,toolbar:Ud,subscription:Wd,invoices:zd,tiers:Vd,payment:qd,invoice:$d,apiKey:Gd,mobile:Kd,accessibility:Zd,btcAmountIcon:Yd,settingsPage:Jd,documentation:Xd,footerLinks:Qd},tu=JSON.parse(`{"aboutUs":{"title":"About Us","tagline":"A New Way of Seeing Bitcoin","intro":"BlockSight.Live is a real-time Bitcoin blockchain explorer built from the ground up. No altcoins. No tokens. No distractions. Just Bitcoin, live, clear, and in full detail.","whyBuilt":"We built BlockSight because the Bitcoin network is the most significant financial infrastructure ever created, and most people have never actually seen it work. Blocks are being mined right now. Transactions are being confirmed right now. Fees are shifting right now. BlockSight makes all of it visible, in real time, to anyone.","whatWeDo":{"title":"What We Do","intro":"BlockSight.Live provides real-time visibility into the Bitcoin blockchain:","blockVisualization":"Watch blocks as they're discovered, with live confirmation countdowns, fee ranges, and transaction counts.","blockVisualizationLabel":"Block Visualization.","networkDashboard":"Congestion gauge, fee estimates, BTC price, and Bitcoin calculator, all continuously updated.","networkDashboardLabel":"Network Dashboard.","monicaMetrics":"Five original indicators we created to make on-chain activity easier to understand at a glance: Bitcoin Velocity Pressure, Real Usage Ratio, Fee Pain Index, Trustless Throughput Score, and Economic Density Index.","monicaMetricsLabel":"Monica Bitcoin Metrics.","addressTxLookup":"Search any address or transaction on the Bitcoin blockchain.","addressTxLookupLabel":"Address & Transaction Lookup.","disclaimer":"We don't process transactions. We don't hold funds. We don't offer financial advice. BlockSight is a read-only window into the Bitcoin network. Nothing more, nothing less."},"whyBitcoinOnly":{"title":"Why Bitcoin Only","paragraph1":"Bitcoin is not \\"one of many.\\" It is the only truly decentralized, permissionless monetary network. It deserves tools built exclusively for it, not dashboards that treat it as one tab among a hundred altcoins.","paragraph2":"BlockSight.Live focuses on Bitcoin because focus produces better tools."},"mission":{"title":"Our Mission","paragraph1":"Make Bitcoin's network activity visible and understandable to everyone, regardless of technical background or language.","quote":"BlockSight.Live, a new way of seeing Bitcoin.","followUs":"Follow us on","twitter":"X (Twitter)","followUsOnTwitter":"Follow us on X"},"team":{"title":"The Team","ceo":{"name":"Dani ₿","role":"Co-Founder & CEO","bio1":"Dani has been a Bitcoin advocate since 2018, sharing insights and building conviction publicly on X. Before Bitcoin, he served 10 years as an officer in the Israeli Defense Forces, reaching the rank of Captain, with a background in both military and civilian aviation.","bio2":"After the IDF, he spent 3 years working in the Bitcoin ATM industry, helping people use Bitcoin and watching firsthand how people interact with it for the first time. That experience shaped everything BlockSight is today: the understanding that Bitcoin needs better tools, built for real people, not just developers.","quote":"Bitcoin is not just a digital currency. It is a technological, financial, and social revolution.","twitter":"@d_osem on X"},"cto":{"name":"Gabi","role":"Co-Founder & CTO","bio":"Gabi has been solving complex problems his entire life. A lifelong puzzle enthusiast, he served three years in the Israeli Navy as a Radar Systems Controller before studying Full Stack Programming at Universidad Provincial de Cordoba (UPC) in Argentina.","bio2":"His younger brother Dani introduced him to Bitcoin. Gabi went deep, not just the technology, but the architecture, the protocol, the possibilities. As CTO, he designs and builds BlockSight's systems with sharp analytical precision and a relentless focus on getting the details right."}},"company":{"title":"The Company","description":"BlockSight.Live is operated by Blocksight OÜ, registered in Estonia.","contact":"Contact:","supportEmail":"legal@blocksight.live","ceoEmail":"ceo@blocksight.live"}},"whitepaper":{"title":"Whitepaper","content":{"title":"BlockSight.Live: A Real-time Observation Layer for the Bitcoin Network","author":"Dani ₿","email":"ceo@blocksight.live","website":"www.blocksight.live","abstract":{"label":"Abstract.","text":"Bitcoin generates a continuous stream of publicly verifiable data, yet understanding its real-time behaviour often requires interacting with node software or multiple specialized tools. BlockSight.Live provides an external, structured interface for observing blocks, transactions, mempool conditions, and network indicators as they appear. The system does not participate in consensus or modify protocol behavior. Its purpose is to present a clear and accurate representation of the network's current state using information already broadcast by nodes."},"purpose":{"title":"1. Purpose","text":"BlockSight.Live is designed to simplify access to Bitcoin's observable activity. The platform collects and displays block formation, transaction flow, mempool changes, fee conditions, and congestion levels without performing analysis or interpretation. It presents only data that is already public on the network. The system does not submit transactions, alter confirmation times, or interact with user funds."},"observationModel":{"title":"2. Observation Model","text":"Bitcoin nodes validate and relay transactions independently. BlockSight.Live receives this publicly available information from standard node sources and indexes it in real time. The system holds no private keys and does not alter transactions. It does not influence miners or fee selection, and it does not replace node verification. BlockSight.Live functions solely as an observer. It describes the network as it appears, without predicting behavior or enforcing policy."},"systemStructure":{"title":"3. System Structure","text":"BlockSight.Live organizes publicly available network data into three complementary layers that together provide a coherent view of Bitcoin's observable activity. The Bitcoin Visualizer presents the chain as it progresses, showing confirmed blocks and pending blocks exactly as they are broadcast by nodes. The data dashboard offers a condensed view of network conditions, including pricing signals, congestion levels, and fee dynamics derived from information already present on the network. A search mechanism enables direct retrieval of blocks, transactions, and addresses from the same public data sources. These elements operate together as a consistent structure that an ordinary user can rely on, without altering or extending the underlying information produced by the network itself."},"designPrinciples":{"title":"4. Design Principles","text":"BlockSight.Live operates according to a minimal set of principles intended to remain aligned with Bitcoin's architecture while allowing limited interpretation of publicly available data where it is useful. The system may derive high-level indicators, such as network load, by aggregating and processing observable information, but these remain structured interpretations of data already present on the network rather than predictions or protocol-level claims. Derived metrics do not influence network behavior and have no effect on transaction propagation, miner policy, or consensus. All indicators originate solely from information that any Bitcoin node can obtain, without the use of external inputs, proprietary signals, or private data sources. The underlying data remains fully verifiable by any user."},"conclusion":{"title":"5. Conclusion","text":"BlockSight.Live offers a real-time perspective on Bitcoin's public activity without modifying or participating in the protocol. As Bitcoin continues to scale, tools that provide clear visibility into its operation can help users understand the system without running full infrastructure themselves. BlockSight.Live fulfills this role by presenting what the network already reveals, in a format designed for continuous observation."}}},"legal":{"title":"Legal","terms":{"title":"Terms of Service","lastUpdated":"Last updated: 2026-03-30","intro":"These Terms of Service (\\"Terms\\") govern your access to and use of BlockSight.Live (the \\"Website\\"), including any related services such as the BlockSight API and billing portal (collectively, the \\"Services\\"). By accessing or using the Services, you agree to these Terms.","sections":{"whoWeAre":{"title":"1) Who We Are","content":"The Services are operated by Blocksight OÜ (\\"BlockSight\\", \\"we\\", \\"us\\").","companyDetails":"Company details (for legal notices):","companyName":"Blocksight OÜ","registryCode":"Registry code: 17474529","registeredAddress":"Registered address: Vesivärava tn 50-301, Tallinn, 10152, Estonia","emtak":"EMTAK: 63101","registered":"Registered: 02.04.2026","contact":"Contact: legal@blocksight.live"},"otherPolicies":{"title":"2) Other Policies and Priority","intro":"Your use of the Services is also governed by:","privacyPolicy":"our Privacy Policy, and","apiAgreement":"for paid API use: the BlockSight.Live API Terms & SLA Agreement (\\"API Agreement\\").","priorityTitle":"Document Priority. If there is a conflict:","priority1":"The API Agreement controls for paid API access, billing, and SLA.","priority2":"The Privacy Policy controls for privacy and data handling.","priority3":"These Terms control for general Website/Services usage."},"independentService":{"title":"3) Independent Service","content":"BlockSight.Live is an independent service and is not affiliated with Bitcoin Core, miners, exchanges, wallets, or any third-party platform. We cannot provide support for third-party products or services."},"freeFeatures":{"title":"4) Free Website Features","content":"We may provide free access to certain Website functionality (e.g., blockchain search and viewing). Free features may be changed, limited, or discontinued at any time."},"paidApi":{"title":"5) Paid API Services","content":"Paid API access and billing are governed exclusively by the API Agreement. Please refer to the Billing Portal for current tiers and pricing."},"acceptableUse":{"title":"6) Acceptable Use","intro":"You agree to use the Services lawfully and responsibly. The full Acceptable Use Policy is published at /aup; the summary below is binding, and in case of conflict on acceptable-use matters /aup governs. You must not:","prohibited1":"attempt to bypass authentication, quotas, rate limits, or security controls;","prohibited2":"interfere with the stability, performance, or security of the Services (including abusive traffic or excessive connections);","prohibited3":"use the Services for unlawful activities or to facilitate harmful activity;","prohibited4":"scrape, crawl, or harvest the Services in a way that disrupts operations;","prohibited5":"introduce malware or harmful code; or","prohibited6":"misrepresent your identity or authorization.","enforcement":"We may suspend or terminate access if we reasonably believe you violate these Terms or create a security risk. Detailed enforcement procedures, including warning periods and cure timelines, are published in the Acceptable Use Policy at /aup."},"noWarranty":{"title":"7) No Warranty","content":"The Services are provided \\"as is\\" and \\"as available.\\" We do not make warranties of any kind (express or implied), including warranties of uninterrupted availability, error-free operation, merchantability, fitness for a particular purpose, or accuracy of information.","blockchainNote":"Blockchain data may be delayed, reorganized, incomplete, or otherwise change over time."},"limitationOfLiability":{"title":"8) Limitation of Liability","intro":"To the maximum extent permitted by law:","item1":"BlockSight is not liable for indirect, incidental, special, consequential, or punitive damages, or for loss of profits, revenue, data, or business interruption arising from or related to the Services.","item2":"BlockSight's total liability for any claim related to the Services will not exceed the amount paid by you to BlockSight for the Services in the three (3) months preceding the event giving rise to the claim."},"intellectualProperty":{"title":"9) Intellectual Property","content":"All rights, title, and interest in the Services, including software, documentation, designs, logos, trademarks, text, graphics, and other materials (\\"BlockSight Materials\\"), are owned by BlockSight or its licensors and are protected by applicable laws.","restrictions":"You may not copy, modify, distribute, sell, or create derivative works from BlockSight Materials without our prior written permission, except as permitted by law."},"changes":{"title":"10) Changes to the Services and Terms","content":"We may update the Services and these Terms from time to time. We will post the updated Terms on the Website and update the \\"Last updated\\" date. Your continued use after changes means you accept the updated Terms."},"termination":{"title":"11) Termination","content":"You may stop using the Services at any time. We may suspend or terminate access to the Services (or parts of them) if necessary for security, maintenance, or in response to misuse or violations."},"governingLaw":{"title":"12) Governing Law and Jurisdiction","content":"These Terms are governed by the laws of Estonia. The competent courts in Harju County (Tallinn), Estonia will have exclusive jurisdiction, unless mandatory law provides otherwise."},"contact":{"title":"13) Contact","content":"Questions about these Terms: legal@blocksight.live | ceo@blocksight.live"}}},"privacy":{"title":"Privacy Policy","lastUpdated":"Last updated: 2026-03-30","intro":"This Privacy Policy explains how Blocksight OÜ (\\"BlockSight\\", \\"we\\", \\"us\\") processes personal data when you access BlockSight.Live and use our API and billing portal (collectively, the \\"Services\\"). We provide data-only access via subscription and/or API and do not provide additional professional services, except basic technical support.","sections":{"controller":{"title":"1) Controller (Data Controller)","companyName":"Blocksight OÜ","registryCode":"Registry code: 17474529","registeredAddress":"Registered address: Vesivärava tn 50-301, Tallinn, 10152, Estonia","emtak":"EMTAK: 63101","registered":"Registered: 02.04.2026","contact":"Contact: privacy@blocksight.live | legal@blocksight.live"},"informationWeCollect":{"title":"2) Information We Collect","intro":"We collect only what is needed to operate the Services:","accountBilling":{"title":"Account & Billing Information (B2B)","item1":"Organization/company name, country, address","item2":"Business identifiers (e.g., company registration number, VAT ID / EIN) if provided","item3":"Billing contact name and email","item4":"Authorized user accounts (name/email)"},"apiSecurity":{"title":"API & Security Data","item1":"Authentication and security events","item2":"API usage logs (timestamps, endpoints, status codes, rate-limit events)","item3":"Technical data such as IP address and user agent (for security and abuse prevention)"},"bitcoinPayment":{"title":"Bitcoin (BTC) Payment Data (if used)","item1":"Invoice identifiers and amounts","item2":"On-chain transaction details needed for reconciliation (e.g., txid, amount received, timestamps, confirmations)","item3":"The unique destination address generated for the invoice","note":"Note: Bitcoin transactions are recorded on a public blockchain and may be publicly visible."},"supportCommunications":{"title":"Support Communications","item1":"Information you provide when contacting us (emails/support messages and attachments, if any)"}},"cookies":{"title":"Cookies and Local Storage","definition":"Cookies are small text files that a website stores in your browser. Local storage is a similar mechanism that keeps a small amount of data on your device. Both let a site remember preferences across visits without identifying you personally.","weSet":"Today the only cookie BlockSight sets is a language-preference cookie that remembers your selected interface language between visits. The customer portal additionally uses a session cookie after sign-in for authentication. No other cookies are set.","thirdParty":"We do not use third-party cookies. We do not use analytics, tracking, or advertising cookies, and no vendor pixels are loaded on our pages. We will not add analytics, tracking, advertising, or other third-party cookies without first publishing a 30-day prior update to this Privacy Policy and notifying customers with a billing contact on file.","userControl":"You can clear or block cookies from your browser settings. If the language-preference cookie is unavailable, the interface simply falls back to your browser's default language; no functionality is lost.","updates":"Changes to this Cookies subsection are announced through the same versioned-update mechanism described in the \\"Changes\\" section of this Privacy Policy."},"howWeUse":{"title":"3) How We Use Information","intro":"We use the information to:","item1":"Provide and operate the API and Services","item2":"Authenticate users, manage access, and secure accounts/API keys","item3":"Generate invoices and issue tax invoice/receipt documents (where applicable)","item4":"Detect abuse, enforce rate limits, and troubleshoot incidents","item5":"Communicate with you about support, security, billing, and service updates","item6":"Comply with legal and accounting obligations"},"legalBases":{"title":"4) Legal Bases (GDPR)","intro":"Where GDPR applies, we process personal data based on:","item1":"Contract performance (to provide the Services)","item2":"Legitimate interests (security, abuse prevention, service reliability)","item3":"Legal obligations (accounting/tax and other compliance duties)"},"sharing":{"title":"5) Sharing","noSell":"We do not sell your information.","intro":"We may share information only:","item1":"With service providers that help us operate the Services (e.g., hosting, monitoring, email/support tools), acting on our instructions","item2":"If required by law or valid legal process","item3":"In connection with a corporate transaction (e.g., merger, acquisition), subject to appropriate safeguards"},"internationalTransfers":{"title":"6) International Transfers","content":"If we transfer personal data outside the EEA, we will use appropriate safeguards as required by applicable law (e.g., standard contractual clauses), where applicable."},"dataRetention":{"title":"7) Data Retention","intro":"We retain information only as long as necessary for the purposes above:","item1":"Security/API logs: retained for a limited period for security, monitoring, and abuse prevention","item2":"Billing and accounting records: retained as required by applicable law","item3":"Support communications: retained as needed to handle requests and maintain service quality"},"security":{"title":"8) Security","content":"We use reasonable technical and organizational measures to protect information. You are responsible for protecting your credentials and API keys."},"yourRights":{"title":"9) Your Rights","content":"Depending on applicable law (including GDPR), you may request access, correction, deletion, restriction, objection, and data portability. Contact us at privacy@blocksight.live. You may also have the right to lodge a complaint with a supervisory authority (in Estonia: the Data Protection Inspectorate)."},"changes":{"title":"10) Changes","content":"We may update this Policy from time to time. The \\"Last updated\\" date will reflect the latest version. Continued use of the Services after changes means you accept the updated Policy."},"contact":{"title":"11) Contact","intro":"Privacy requests and questions:","email":"privacy@blocksight.live | legal@blocksight.live","companyName":"Blocksight OÜ","registeredAddress":"Vesivärava tn 50-301, Tallinn, 10152, Estonia","registryCode":"Registry code: 17474529"}}},"aup":{"title":"Acceptable Use Policy","lastUpdated":"Last updated: April 2026","intro":"This Acceptable Use Policy (AUP) governs how all users — including free, paid, and B2B Clients — may use BlockSight Services. It supplements the Terms of Service and the API Service Level Agreement; on acceptable-use matters this AUP governs. Violations may result in suspension or termination per Section 6.","sections":{"scope":{"title":"1) Scope","content":"This AUP applies to anyone accessing BlockSight Services, whether through the free public website, the paid API, or any partner integration. It supplements the Terms of Service and the API Service Level Agreement; in case of conflict on acceptable-use matters, this AUP governs."},"prohibitedActivities":{"title":"2) Prohibited Activities","intro":"You must not:","item1":"bypass or attempt to bypass authentication, quotas, rate limits, throttling, or security controls;","item2":"interfere with the stability, performance, or security of the Services (including abusive traffic, excessive connections, or denial-of-service patterns);","item3":"use the Services for unlawful activities or to facilitate harmful, fraudulent, or deceptive activity;","item4":"scrape, crawl, or harvest the Services in a way that disrupts operations or circumvents quota enforcement;","item5":"introduce malware, exploits, or harmful code through the API or website;","item6":"misrepresent your identity, authorization, or affiliation;","item7":"redistribute or resell API data or access as a standalone service without prior written permission;","item8":"reverse engineer the API or its security controls, except where prohibited by mandatory law."},"resourceAbuse":{"title":"3) Resource Abuse","content":"Resource abuse includes rate-limit gaming, automated quota inflation, scraping that bypasses tier-appropriate connection caps, and the operation of multiple accounts to circumvent a single Subscription Tier limit. Soft limits trigger throttling; hard limits trigger immediate enforcement per Section 6."},"security":{"title":"4) Security","content":"Probing, scanning, fuzzing, or penetration testing of the Services without prior written authorization from BlockSight is prohibited. Responsible disclosure of suspected vulnerabilities should be sent to legal@blocksight.live; we will acknowledge within five (5) business days and coordinate disclosure timelines in good faith."},"content":{"title":"5) Content Standards","content":"You must not use the Services to distribute illegal content, to facilitate illegal activity, or to enable harm to third parties. Compliance with the laws of the Client's jurisdiction is the Client's responsibility; BlockSight does not warrant that data retrieved through the Services is suitable for any particular regulatory regime."},"enforcement":{"title":"6) Enforcement","intro":"Enforcement follows a Warning → Suspension → Termination ladder, scaled to severity:","warning":"First warning: a seven (7) day notice describing the alleged violation and the corrective action required.","suspension":"Material violation: immediate suspension of access without prior notice, followed by written notice describing the violation.","termination":"Non-material violation uncured: thirty (30) day cure period after written notice; failure to cure may result in termination.","notice":"Notices are sent to the billing or account contact on file. Suspended access may be reinstated at BlockSight's discretion once the violation is cured."},"reportingViolations":{"title":"7) Reporting Violations","content":"To report a suspected violation, contact legal@blocksight.live with a description of the conduct, the affected resources, and any evidence available.","ackTimeline":"Acknowledgement: within five (5) business days of receipt.","investigationTimeline":"Investigation conclusion: within thirty (30) business days, subject to complexity and good-faith cooperation by the reporter."},"updatesAndNotification":{"title":"8) Updates and Notification","content":"Material changes to this AUP will be announced at least thirty (30) days in advance via the Privacy Policy update mechanism and, for B2B Clients with a billing contact on file, by email. Continued use of the Services after the effective date constitutes acceptance of the updated AUP."}},"crossLinks":{"toTerms":"See Terms of Service","toSla":"See SLA for service-credit and uptime details"}},"accessibility":{"title":"Accessibility Statement","lastUpdated":"Last updated: April 2026","sections":{"commitment":{"title":"Commitment to Accessibility","content":"BlockSight.Live is committed to ensuring digital accessibility for all users, including people with disabilities. We continuously work to improve the usability and accessibility of our website and services across all supported languages."},"compliance":{"title":"Compliance Standard","content":"Our goal is to follow recognized accessibility best practices and relevant international standards, including the Web Content Accessibility Guidelines (WCAG) 2.1 Level AA where applicable. This statement is also provided in alignment with the Israeli Equal Rights for Persons with Disabilities Regulations (Accessibility Adjustments for Services), 5773-2013, which adopts WCAG 2.1 Level AA, and with the spirit of the European Accessibility Act (Directive (EU) 2019/882) for our users in the European Union."},"features":{"title":"Accessibility Features Implemented","intro":"The BlockSight.Live website has been designed with the following accessibility principles in mind:","item1":"Clear semantic HTML structure and consistent navigation","item2":"Proper heading hierarchy across all pages","item3":"High contrast visual design for readability","item4":"Responsive layout compatible with mobile, tablet, and desktop devices","item5":"Support for keyboard navigation across interactive elements","item6":"Compatibility with modern screen readers","item7":"Visible focus indicators on interactive elements","item8":"Language-aware content structure across multiple supported languages","item9":"Avoidance of motion-heavy or flashing elements","item10":"Alternative text for meaningful images and icons"},"limitations":{"title":"Known Limitations","content":"While we strive to ensure accessibility across all parts of the website, some areas may still be undergoing improvement. We continue reviewing and updating the platform to enhance accessibility over time.","thirdParty":"Third-party embedded tools and interactive chart components are currently not used on this website. If they are introduced in the future, they will be reviewed for accessibility compatibility before release."},"feedback":{"title":"Feedback and Contact","content":"If you encounter any accessibility barriers while using BlockSight.Live, or if you need information in an alternative format, we encourage you to contact us:","email":"legal@blocksight.live","followUp":"Please include a description of the issue and the page where it occurred. We will make reasonable efforts to respond and provide assistance."},"scope":{"title":"Scope","content":"This accessibility statement applies to the BlockSight.Live website (blocksight.live). Any companion mobile applications or third-party integrations have their own accessibility considerations under their respective platforms."},"ongoing":{"title":"Ongoing Commitment","content":"Accessibility is an ongoing process. BlockSight.Live regularly reviews its interface and content structure to improve accessibility for users worldwide, including users in the European Union, Israel, and other regions where our services are available."}}},"dpa":{"title":"Data Processing Agreement","lastUpdated":"Last updated: April 2026","intro":"This Data Processing Agreement (DPA) forms part of the agreement between Blocksight OÜ (Vesivärava tn 50-301, Tallinn, 10152, Estonia) acting as data processor and the Customer acting as data controller. It implements the contractual safeguards required by Article 28(3) of Regulation (EU) 2016/679 (the General Data Protection Regulation, GDPR) when the Customer engages BlockSight.Live to process personal data on the Customer's behalf.","sections":{"parties":{"title":"1. Parties and Roles","controllerRole":"The Customer acts as the data controller and determines the purposes and means of processing of personal data submitted to or generated through the BlockSight.Live API and Services.","processorRole":"Blocksight OÜ acts as the data processor and processes personal data exclusively on documented instructions from the Customer, as set out in this DPA, the Master Services Agreement, the Service Level Agreement, and the BlockSight.Live API Terms.","effectiveDate":"This DPA takes effect on the date the Customer first activates a paid subscription tier (Basic, Advanced, or Premium) and remains in force for the duration of the underlying agreement plus any post-termination retention period required by law."},"subjectAndDuration":{"title":"2. Subject Matter and Duration","subjectMatter":"Subject matter: the processing of personal data necessary to operate the Customer's subscription, deliver Bitcoin blockchain analytics through the BlockSight.Live API and WebSocket interfaces, authenticate API requests, generate billing usage records, and respond to data-subject requests forwarded by the Customer.","duration":"Duration: the term of the underlying subscription. Upon termination, the deletion or return obligations in Section 13 apply within the timeframes specified."},"natureAndPurpose":{"title":"3. Nature and Purpose of Processing","nature":"Nature of processing: collection upon API authentication, storage in PostgreSQL and Redis tiers (encrypted at rest), use to authorise requests and to compute usage metrics, transmission over TLS to the Customer's authorised endpoints, and erasure or return at the end of the term.","purpose":"Purpose of processing: solely to (a) deliver the BlockSight.Live Services to the Customer, (b) maintain authentication, billing and audit-log records as required by the Master Services Agreement and SLA, and (c) comply with legal obligations applicable to BlockSight.Live as processor."},"categoriesOfData":{"title":"4. Categories of Personal Data and Data Subjects","dataCategoriesIntro":"The personal-data categories processed under this DPA are limited to what is strictly necessary to operate the Customer's subscription:","dataCategory1":"Authentication identifiers — API keys (subscription-bound), App Attest device identifiers, and JWT tokens.","dataCategory2":"Account contact data — Customer-provided business email address(es), administrator names, and billing contact details.","dataCategory3":"Usage and billing telemetry — request counts, endpoint hit rates, response sizes, and timestamps used to compute tier usage.","dataCategory4":"Technical metadata — IP addresses (in access logs), user-agent strings, and device fingerprints submitted with API requests.","dataCategory5":"Customer payment metadata — Bitcoin transaction hashes and zpub-derived receiving addresses used to verify subscription payments. BlockSight.Live does not custody Customer wallets or private keys.","dataCategory6":"Support communications — content of support tickets and emails opened by the Customer or its end users.","dataSubjectsIntro":"The categories of data subjects whose data is processed include:","dataSubject1":"Authorised employees and contractors of the Customer who hold accounts on the Customer's BlockSight.Live subscription.","dataSubject2":"End users of the Customer's downstream applications when those applications submit identifiers to the BlockSight.Live API on behalf of the Customer.","dataSubject3":"Billing contacts and administrators designated by the Customer.","dataSubject4":"Authorised representatives of the Customer who interact with BlockSight.Live support channels.","dataSubject5":"Any natural person whose data is included in API requests submitted by the Customer in their role as data controller."},"controllerInstructions":{"title":"5. Documented Instructions of the Controller (Art. 28(3)(a))","documentedInstructions":"Blocksight OÜ shall process personal data only on documented instructions from the Customer, including with regard to transfers to third countries. The Customer's documented instructions are the Master Services Agreement, this DPA, the SLA, the API Terms, and any further written instructions issued through the BlockSight.Live administrator portal or by the Customer's designated contact at legal@blocksight.live.","lawfulBasis":"If Blocksight OÜ is required by Union or Member State law to process personal data outside the scope of the Customer's instructions, Blocksight OÜ shall inform the Customer of that legal requirement before processing, unless the law prohibits such notification on important grounds of public interest."},"confidentiality":{"title":"6. Confidentiality of Personnel (Art. 28(3)(b))","personnelObligation":"Blocksight OÜ ensures that all personnel authorised to process personal data under this DPA are bound by appropriate written confidentiality undertakings or are under an equivalent statutory obligation of confidentiality. Access to personal data is restricted to personnel with a documented need-to-know.","nondisclosure":"Confidentiality obligations survive the termination of the personnel relationship and continue to bind former personnel for the duration permitted under Estonian law."},"securityMeasures":{"title":"7. Technical and Organisational Measures (Art. 28(3)(c) and Art. 32)","intro":"Blocksight OÜ implements appropriate technical and organisational measures (TOMs) to ensure a level of security appropriate to the risk, having regard to the state of the art, the costs of implementation, and the nature, scope, context and purposes of processing. The current TOMs include:","tom1":"Encryption at rest — PostgreSQL data directory encrypted on the Hetzner dedicated server using filesystem-level encryption; Redis persistence files protected by host-level access controls.","tom2":"Encryption in transit — TLS 1.2 minimum (TLS 1.3 preferred) on all public endpoints (api.blocksight.live, blocksight.live, portal.blocksight.live, observe.blocksight.live, admin.blocksight.live), enforced via Cloudflare and HSTS headers.","tom3":"Access control — role-based access to production systems, least-privilege SSH keys, multi-factor authentication on operator accounts, and bound-API-key model isolating each subscription's data.","tom4":"Audit logging — request, authentication, billing and administrative events written to immutable audit logs with retention sufficient to meet GDPR Art. 5(2) accountability obligations.","tom5":"Backup and resilience — periodic encrypted backups of PostgreSQL stored on a separate volume; documented disaster-recovery runbooks rehearsed during scheduled maintenance windows.","tom6":"Resilience and availability — circuit-breakers on upstream Bitcoin Core, Electrs, and cache layers; service-level objectives published in the SLA; uptime monitored continuously.","tom7":"Breach detection — Prometheus metrics, structured logging, and automated alerts on anomalous request patterns, authentication failures, and circuit-breaker state changes.","tom8":"Penetration testing and review — periodic internal security review and code review of authentication, billing, and data-handling pathways, plus annual third-party penetration testing of public endpoints when contractually required by an EU customer."},"subProcessors":{"title":"8. Sub-processors (Art. 28(2) and Art. 28(3)(d))","intro":"The Customer grants Blocksight OÜ a general written authorisation to engage the sub-processors listed below to assist in providing the Services. Blocksight OÜ remains fully liable to the Customer for the performance of any sub-processor's obligations under this DPA.","noticeIntro":"Blocksight OÜ shall provide the Customer with prior written notice of any intended changes to this list, including the addition or replacement of a sub-processor, and shall give the Customer the opportunity to object on reasonable grounds related to data protection.","noticeDays":"The notice period for sub-processor changes is at least 10 calendar days before the new sub-processor begins processing personal data, unless a shorter period is mutually agreed in writing.","current":{"intro":"The current authorised sub-processors are:","hetzner":"Hetzner Online GmbH — server hosting (Bitcoin Core, Electrs, production backend, PostgreSQL 16, Redis 7) on a single dedicated server in the European Union (Germany or Finland data centres).","cloudflare":"Cloudflare, Inc. — DNS, CDN, DDoS protection, and Cloudflare Tunnel for api.blocksight.live; processing occurs across Cloudflare's global edge network.","vercel":"Vercel Inc. — frontend static-site hosting for the four BlockSight.Live web applications (blocksight.live, portal, observe, admin); processing occurs across Vercel's global edge network.","apple":"Apple Inc. — App Attest service for B2B partner per-device attestation (used after V3.1 cutover for partner mobile applications); processing occurs across Apple's global infrastructure."},"objection":"If the Customer reasonably objects to the addition or replacement of a sub-processor on data-protection grounds within the notice period, the Customer and Blocksight OÜ shall work in good faith to identify a mutually acceptable resolution. If no resolution is reached, the Customer may terminate the affected Services with a pro-rata refund of unused subscription fees."},"dataSubjectRights":{"title":"9. Assistance with Data-Subject Requests (Art. 28(3)(e))","assistanceIntro":"Blocksight OÜ shall, taking into account the nature of the processing, assist the Customer by appropriate technical and organisational measures, insofar as this is possible, in fulfilling the Customer's obligation to respond to requests for exercising the data subject's rights under Chapter III of the GDPR, including:","accessAndPortability":"Right of access (Art. 15) and right to data portability (Art. 20) — Blocksight OÜ provides export tooling for personal data held in audit logs and account records, accessible via the administrator portal or upon written request to legal@blocksight.live.","rectification":"Right to rectification (Art. 16) — Customers and authorised users may correct profile and account data through the administrator portal; Blocksight OÜ assists with corrections to internal records that are not directly editable by the Customer.","erasure":"Right to erasure (Art. 17) — Blocksight OÜ erases personal data upon documented Customer instruction, subject to the legal-retention exceptions in Section 13.","restriction":"Right to restriction of processing (Art. 18) — Blocksight OÜ honours documented Customer instructions to restrict processing of identified records.","objection":"Right to object (Art. 21) — Blocksight OÜ ceases processing of identified records upon documented Customer instruction unless an applicable legal obligation requires continued processing.","automated":"Rights regarding automated decision-making (Art. 22) — Blocksight OÜ does not perform automated decision-making with legal or similarly significant effects on data subjects in the ordinary course of providing the Services."},"breachNotification":{"title":"10. Personal-Data Breach Notification (Art. 28(3)(f) and Art. 33)","slaHours":"Blocksight OÜ shall notify the Customer of any personal-data breach affecting the Customer's data without undue delay and, in any event, within 72 hours after becoming aware of the breach, to enable the Customer to meet its own notification obligations under Art. 33 GDPR.","processorNotification":"Notification is delivered to the Customer's designated security contact (or, if none is designated, the billing contact of record) by email and, where applicable, through the administrator portal incident channel. Notification is sent at the earliest practicable point after Blocksight OÜ becomes aware of the breach, even when investigation is incomplete.","controllerForwarding":"The Customer remains responsible for notifying the competent supervisory authority and, where required, affected data subjects. Blocksight OÜ assists the Customer in preparing such notifications by providing the information described in the next clause.","contentRequired":"Each notification includes, to the extent known at the time of notification: (a) the nature of the breach including categories and approximate numbers of data subjects and records concerned; (b) the contact point at Blocksight OÜ where more information can be obtained; (c) the likely consequences of the breach; and (d) the measures taken or proposed to address the breach, including measures to mitigate possible adverse effects."},"auditRights":{"title":"11. Audits and Inspections (Art. 28(3)(h))","intro":"Blocksight OÜ makes available to the Customer all information necessary to demonstrate compliance with the obligations laid down in Art. 28 GDPR and allows for and contributes to audits, including inspections, conducted by the Customer or another auditor mandated by the Customer.","auditFrequency":"The Customer may conduct one audit per calendar year, with at least 30 days' written notice, during normal business hours, in a manner that does not unreasonably interfere with Blocksight OÜ's operations or compromise the security of other customers' data.","auditScope":"Audit scope is limited to compliance with this DPA and applicable data-protection law. Where the Customer's audit interest can be reasonably satisfied by an existing third-party assessment report, attestation, or self-assessment questionnaire, Blocksight OÜ may provide such material in lieu of an on-site inspection.","auditCost":"Each party bears its own costs of audit. Where an audit identifies material non-compliance attributable to Blocksight OÜ, Blocksight OÜ shall remediate at its own cost; otherwise, additional audits requested in the same calendar year are at the Customer's expense at Blocksight OÜ's reasonable hourly rates."},"internationalTransfers":{"title":"12. International Data Transfers (Chapter V)","intro":"Blocksight OÜ processes personal data primarily within the European Union (Hetzner data centres in Germany or Finland). Certain sub-processors operate global edge networks (Cloudflare, Vercel, Apple) that may process data outside the European Economic Area (EEA).","sccsApplied":"Where personal data is transferred to a country outside the EEA that has not received an adequacy decision from the European Commission, the transfer is governed by the Standard Contractual Clauses Module Two (controller-to-processor) adopted by Commission Implementing Decision (EU) 2021/914, which are deemed incorporated into this DPA by reference and prevail over conflicting provisions.","transferDestinations":"The principal categories of destinations include: edge points-of-presence operated by Cloudflare and Vercel for content delivery and DDoS mitigation; Apple infrastructure for App Attest verification; and any successor sub-processors approved under Section 8.","safeguards":"Blocksight OÜ implements supplementary measures consistent with EDPB guidance, including encryption in transit (TLS), data minimisation in edge logs, and contractual restrictions on access by sub-processor personnel located in third countries."},"dataDeletionOnTermination":{"title":"13. Deletion or Return of Personal Data (Art. 28(3)(g))","defaultAction":"Upon termination or expiration of the underlying agreement, Blocksight OÜ shall, at the Customer's choice, delete or return all personal data processed on behalf of the Customer within 90 days of the effective termination date.","controllerChoice":"The Customer indicates its choice (deletion or return) in writing to legal@blocksight.live before the termination date. If the Customer does not communicate a choice, Blocksight OÜ defaults to secure deletion at the end of the 90-day window.","retentionExceptions":"Retention beyond the deletion window is permitted only where required by Union or Member State law (for example, accounting and tax-record retention obligations under Estonian law), in which case the personal data is segregated from active processing and retained solely for the duration mandated by law.","certification":"Upon written request, Blocksight OÜ provides the Customer with a written certification of deletion or return signed by an authorised representative."},"governingLaw":{"title":"14. Governing Law and Jurisdiction","governingLaw":"This DPA is governed by the laws of Estonia, without regard to its conflict-of-laws principles, and supplemented by directly applicable provisions of European Union law, including the GDPR.","jurisdiction":"The courts of Harju County, Tallinn, Estonia shall have exclusive jurisdiction to settle any dispute arising out of or in connection with this DPA, subject to any data-subject's statutory right to bring proceedings in the data-subject's country of habitual residence.","liability":"Each party's liability under this DPA is governed by the limitation-of-liability provisions of the Master Services Agreement and the Service Level Agreement, except for liability that cannot be limited by law (including liability for the rights of data subjects under the GDPR).","indemnity":"Each party shall indemnify the other against losses, damages, and reasonable expenses arising directly from the indemnifying party's material breach of this DPA, subject to the limitations and procedural requirements of the Master Services Agreement."}},"crossLinks":{"toMsa":"See Master Services Agreement","toSla":"See SLA for service-credit and uptime details"}}},"contact":{"title":"Contact Us","disclaimer":{"paragraph1":"BlockSight.Live provides information and insights about the Bitcoin network but does not assist with fund recovery, wallet-related issues, or similar matters. For any such concerns, please reach out directly to the service provider involved in your transaction, such as your wallet software or exchange platform.","paragraph2":"Please note that BlockSight.Live does not process Bitcoin transactions. Therefore, we cannot expedite, cancel, or replace pending transactions. If you have questions about a transaction, we recommend contacting the wallet or service provider used to initiate it."},"feedbackForm":{"title":"Feedback Form","content":"We welcome your feedback and suggestions. Please use the form below to share your thoughts, report issues, or ask questions about our services."},"form":{"subject":{"label":"Subject","general":"General Inquiry","api":"API Support","bug":"Report a Bug"},"name":{"label":"Name","placeholder":"Enter your name"},"email":{"label":"Email Address","placeholder":"Enter your email address"},"address":{"label":"Address","placeholder":"Enter your address"},"message":{"label":"Message","placeholder":"Enter your message here..."},"submit":"Submit"}},"api":{"title":"API Subscription","subtitle":"Access real-time Bitcoin blockchain data","placeholder":"API documentation and subscription options will be displayed here","nav":{"overview":"Overview","howItWorks":"How It Works","plans":"Subscription Plans","apiDocs":"API Docs","login":"Log In"},"content":{"hero":{"title":"BlockSight.Live API – Real-Time Bitcoin Data for Builders","subtitle":"Stable, fast, and secure Bitcoin API access for projects, apps, and organizations that need accurate, up-to-date on-chain data.","ctaGetStarted":"Get Started with API","ctaViewDocs":"View API Documentation"},"whyBlocksight":{"title":"Why BlockSight.Live API?","reasons":{"realTimeData":"Real-time Bitcoin network data (blocks, transactions, mempool, fees, congestion, price).","productionWorkloads":"Designed for production workloads and long-running services.","tieredPlans":"Tiered plans for different usage levels — from small projects to enterprise-scale platforms.","bitcoinPayments":"Bitcoin-only payments for maximum transparency and independence."}},"billingNote":"All plans are available with monthly or annual billing — payment in Bitcoin (BTC) only.","pricing":{"annual":"Annual","monthly":"Monthly","yearlyTotal":"yearly total"},"includedFeatures":"Included Features","includesBasicPlus":"Includes Everything in Basic, plus:","includesAllPlus":"Includes Everything in Basic & Advanced, plus:","apiLimits":"API Limits","limits":{"perSecond":"API Calls per Second","perDay":"API Calls per Day","burst":"Burst Capacity","upTo":"Up to","requests":"requests","customConfigurable":"Custom configurable"},"subscribe":"Subscribe","plans":{"basic":{"name":"Basic Plan","features":{"rateLimits":"Increased API rate limits compared to free/public alternatives","priorityHandling":"Priority request handling","smoothIntegration":"Smooth integration with BlockSight.Live","subdomain":"Optional co-branded subdomain: customer.blocksight.live","stablePerformance":"Stable, production-ready system performance"},"suggestedFor":"Suggested for: Small projects, prototypes, internal tools, and low-volume dashboards."},"advanced":{"name":"Advanced Plan","features":{"higherLimits":"Higher rate limits and expanded usage quotas","advancedEndpoints":"Access to advanced endpoints (blocks, dashboards, search, analytics)","customConfig":"Custom feature adjustments and configuration options","fasterPriority":"Faster request prioritization under load","whiteLabel":"White-label ready API domain branding: api.customer.com","enhancedReliability":"Enhanced reliability with priority routing and optimized performance"},"suggestedFor":"Suggested for: Production applications, customer-facing dashboards, and medium–high traffic platforms."},"premium":{"name":"Premium+ Plan","badge":"Recommended","features":{"fullCustomization":"Full customization layer (UI integration, endpoints, branding alignment)","dedicatedSupport":"Direct access to a dedicated support engineer for technical onboarding and optimization","advancedAnalytics":"Advanced analytics and anonymized behavioral insights","flexibleDomains":"Flexible domain options: Co-branded subdomain (customer.blocksight.live), fully custom domain (customer.com), API custom domain (api.customer.com)","highStability":"High-stability environment with premium traffic routing and proactive performance optimization"},"premiumRouting":"Premium routing for sustained high-volume workloads","suggestedFor":"Suggested for: Exchanges, large platforms, financial services, and mission-critical real-time systems."}},"bitcoinPolicy":{"title":"Bitcoin-Only Payment Policy","subtitle":"Bitcoin-Only Payments","intro":"All monthly and annual payments are made exclusively in Bitcoin (BTC). This ensures:","benefits":{"transparency":"Full transparency","secureTransfers":"Secure, censorship-resistant transfers without third-party payment processors","independence":"Independence from traditional banking and card limitations","nativeAlignment":"Native alignment with a decentralized financial ecosystem"}},"funnel":{"title":"How Subscription Works","steps":{"step1":"Sign up and create an Organization","step2":"Add billing details (company + billing email)","step3":"Choose a plan (Monthly/Yearly)","step4":"Generate a BTC invoice (unique address + exact amount)","step5":"Pay BTC — after 1 confirmation the subscription becomes active","step6":"Create an API Key and start using the API","step7":"Use the dashboard to monitor usage, manage keys, download documents","step8":"Upgrade anytime: pay upgrade invoice — upgrade applies immediately","step9":"Renew by paying the renewal invoice before the period ends"}},"apiDocs":{"title":"Full API Documentation","intro":"The BlockSight.Live API provides comprehensive access to Bitcoin blockchain data through REST and WebSocket interfaces.","authentication":{"title":"Authentication","content":"All authenticated requests must include your API key in the X-API-Key header.","example":"X-API-Key: your-api-key-here"},"rateLimits":{"title":"Rate Limits","intro":"Rate limits are enforced per API key and per IP address:","perKey":"Per-key counters: Track requests per second, minute, and day","perIp":"Per-IP limits: Additional protection against abuse","websocket":"WebSocket throttling: Message frequency limits per connection","burst":"Burst capacity: Short-term allowance above steady-state limits"},"rest":{"title":"REST API","baseUrl":"Base URL: https://blocksight.live/api/v1/","endpoints":{"title":"Available Endpoints","address":"GET /address/{address} — Address summary (balance, tx count)","addressTxs":"GET /address/{address}/transactions — Transaction history for address","block":"GET /block?height=... or /block?hash=... — Block data by height or hash","transaction":"GET /transaction?txid=... — Transaction details by ID","price":"GET /price — Current BTC price in multiple currencies","fees":"GET /recommended-fees — Fee estimates for next block and 6h target","congestion":"GET /congestion-load — Network congestion score (1-100)"}},"websocket":{"title":"WebSocket API","url":"WebSocket URL: wss://api.blocksight.live/api/v1/ws","streams":{"title":"Available Streams","blockVisualizer":"Block Visualizer Stream: Real-time block data for visualization","dashboard":"Dashboard Stream: Price, fees, congestion updates","addressTracking":"Address Tracking: Monitor specific addresses for activity","transactionTracking":"Transaction Tracking: Monitor specific transactions for confirmations"},"tracking":{"title":"Tracking Commands","trackAddress":"trackAddress: Monitor a single address (Advanced+)","trackAddresses":"trackAddresses: Monitor multiple addresses (Premium+ only)","trackTransaction":"trackTransaction: Monitor a single transaction (Advanced+)","trackTransactions":"trackTransactions: Monitor multiple transactions (Premium+ only)"}},"tiers":{"title":"Tier Capabilities","feature":"Feature","basic":"Basic","advanced":"Advanced","premium":"Premium+","rest":"REST API","restBasic":"Limited","restAdvanced":"Full","restPremium":"Unrestricted","websocketLabel":"WebSocket","websocketBasic":"Block visualizer only","websocketAdvanced":"+ Dashboard stream","websocketPremium":"All channels","tracking":"Tracking","trackingBasic":"None","trackingAdvanced":"Single address/tx","trackingPremium":"Multi-address/tx"},"errors":{"title":"Error Handling","content":"All API errors follow a standard format with an error code and human-readable message.","format":"Format: { \\"error\\": { \\"code\\": \\"ERROR_CODE\\", \\"message\\": \\"Description\\" } }"},"versioning":{"title":"API Versioning","content":"All endpoints are versioned (e.g., /api/v1/). Breaking changes will be introduced in new versions with a minimum 6-month deprecation notice for previous versions."}},"restApi":{"title":"REST API Reference","intro":"The BlockSight.Live REST API provides programmatic access to Bitcoin blockchain data. All endpoints are versioned under /api/v1/.","baseUrl":"Base URL","authDescription":"All requests must include your API key in the X-API-Key header:","endpoints":"Endpoints","parameters":"Parameters","paramName":"Name","paramLocation":"Location","paramType":"Type","paramRequired":"Required","paramDescription":"Description","curlExample":"cURL Example","response":"Response","errorDescription":"All API errors follow a standard format:","httpCodes":"HTTP Status Codes","rateLimitDescription":"Rate limits are enforced per API key and vary by subscription tier:","versioningDescription":"All endpoints are versioned (e.g., /api/v1/). Breaking changes will be introduced in new versions with a minimum 6-month deprecation notice."},"websocket":{"title":"WebSocket API","intro":"BlockSight.Live exposes a unified WebSocket endpoint for real-time delivery of Bitcoin network data, pricing, and tracking events.","connection":{"title":"Connection Endpoint","requirements":"All WebSocket connections require a valid API Key and an active subscription tier."},"envelope":{"title":"Message Envelope","description":"Every WebSocket message follows a unified envelope structure:","type":"Message category (e.g., block_added, dashboard.update, price_update)","version":"Schema version for the message payload","data":"Channel-specific payload"},"example":{"title":"JavaScript Example"},"streams":{"title":"Available Streams","blockVisualizer":{"title":"Block Visualizer Stream","description":"Real-time block activity stream for visualization.","cap1":"New blocks","cap2":"Mempool → next-block composition","cap3":"Block history updates","cap4":"Future block projections","cap5":"Block metadata changes"},"dashboard":{"title":"Dashboard Stream","description":"Live data for dashboard widgets.","del1":"BTC price","del2":"Congestion gauge","del3":"Fee gauge","del4":"Mempool-based calculator metrics"},"addressTracking":{"title":"Address Tracking","single":"Subscribe to updates for a single Bitcoin address.","multi":"Subscribe to multiple addresses simultaneously."},"transactionTracking":{"title":"Transaction Tracking","single":"Subscribe to updates for a single transaction (txid).","multi":"Subscribe to multiple transactions simultaneously."}},"capabilities":"Capabilities","delivers":"Delivers","exampleMessage":"Example Message","clientToServer":"Client → Server","serverToClient":"Server → Client","tierCapabilities":"Subscription Tier Capabilities","errors":{"title":"Error Responses","description":"When a rate limit is exceeded or an error occurs, the server responds with:"},"rateLimiting":{"title":"Rate Limiting & Abuse Protection","perKey":"Per-key counters","perIp":"Per-IP limits","frequency":"WebSocket message frequency throttling","caps":"Connection caps","abuse":"Automatic detection and temporary suppression of abusive clients"}},"sla":{"title":"API Terms & SLA Agreement","lastUpdated":"Last updated: 2026-03-30","intro":"This API Terms & SLA Agreement (\\"Agreement\\") governs access to and use of the paid BlockSight.Live API services (\\"API\\"). By creating an Organization account, generating an API Key, paying an invoice, or using the API, the customer (\\"Client\\" or \\"you\\") agrees to this Agreement.","sections":{"partiesAndService":{"title":"1) Parties & Service","content":"This Agreement is between Blocksight OÜ (\\"BlockSight\\", \\"we\\", \\"us\\") and the Client. The service is provided via BlockSight.Live.","b2bOnly":"B2B only. The API is offered exclusively to business entities. By accepting this Agreement, you represent that you are acting on behalf of a business and are authorized to bind the Client.","companyDetails":"Company details (for legal notices):","companyName":"Blocksight OÜ","registryCode":"Registry code: 17474529","registeredAddress":"Registered address: Vesivärava tn 50-301, Tallinn, 10152, Estonia","emtak":"EMTAK: 63101","registered":"Registered: 02.04.2026","contact":"Contact: legal@blocksight.live"},"documentPriority":{"title":"2) Document Priority","intro":"These documents work together:","apiAgreement":"This API Agreement governs paid API access, billing, and SLA.","privacyPolicy":"The Privacy Policy governs privacy and data handling.","termsOfService":"The Terms of Service govern general website/service usage.","conflict":"If there is a conflict, the higher-priority document controls for that topic."},"definitions":{"title":"3) Definitions","api":"API – The programmatic interface provided by BlockSight.Live, including REST endpoints and any streaming interfaces (e.g., WebSocket), documentation, and related software.","client":"Client – The business entity using the API.","organization":"Organization – The Client's business account within the Billing Portal.","user":"User – An individual authorized by the Client to access the Organization.","subscriptionTier":"Subscription Tier – A paid plan that defines quotas, rate limits, features, and (if applicable) support/SLA scope.","apiKey":"API Key – A token issued to an Organization used to authenticate API requests.","billingPortal":"Billing Portal – The self-serve interface used to manage subscriptions, invoices, payments, documents, users, and settings.","invoice":"Invoice – A payment request generated by the Billing Portal that includes a unique BTC address, an exact BTC amount, and an expiry time.","confirmations":"Confirmations – On-chain confirmations required before a payment is considered approved and final.","creditBalance":"Credit Balance – An internal credit recorded to an Organization (e.g., from overpayment or payment received after invoice expiry) that may be applied to future invoices under this Agreement.","sla":"SLA – The service level commitments described in Section 9."},"accountUsersAuthorization":{"title":"4) Account, Users, and Authorization","organizationAccount":"4.1 Organization account. API access requires an Organization account in the Billing Portal.","clientResponsibility":"4.2 Client responsibility. The Client is responsible for all activity under its Organization, including actions by its Users.","accurateInformation":"4.3 Accurate information. The Client must provide accurate business/billing information and keep it updated."},"accessAuthentication":{"title":"5) Access & Authentication","paidSubscription":"5.1 Paid subscription required. API access requires an active paid subscription.","apiKeys":"5.2 API Keys. Requests must be authenticated with a valid API Key.","keySecurity":"5.3 Key security. The Client must protect API Keys as confidential credentials and prevent unauthorized use.","keyActions":"5.4 Key actions. BlockSight may revoke, rotate, or require replacement of API Keys if we reasonably believe there is misuse, compromise, or security risk."},"acceptableUse":{"title":"6) Acceptable Use","intro":"The Client must comply with the Acceptable Use Policy at /aup. The summary below is binding for B2B Clients and supplements the standalone policy; the Client must not:","prohibited1":"bypass or attempt to bypass authentication, quotas, rate limits, throttling, or security controls;","prohibited2":"interfere with stability or security (abusive traffic, excessive connections, scanning, attacks);","prohibited3":"use the API for unlawful activities or to facilitate harmful activity;","prohibited4":"redistribute or resell API data or access as a standalone service without prior written permission;","prohibited5":"reverse engineer the API except where prohibited by law.","violation":"Violations may result in suspension or termination per the enforcement ladder published at /aup."},"tiersQuotasRateLimits":{"title":"7) Tiers, Quotas, Rate Limits","tierLimits":"7.1 Tier limits. Each Subscription Tier has defined quotas, rate limits, and connection caps.","enforcement":"7.2 Enforcement. We may enforce limits via throttling, temporary blocking, or connection caps.","billingPortalControls":"7.3 Billing Portal controls. The Billing Portal is the source of truth for current tiers, quotas, pricing, invoice status, and subscription status.","changes":"7.4 Changes. We may modify tiers, limits, and pricing with prior notice via the Billing Portal or email to the billing contact on file."},"billingPayments":{"title":"8) Billing & Payments (Bitcoin Only)","btcOnly":"8.1 BTC-only. Subscription fees are payable exclusively in Bitcoin (BTC) via the Billing Portal.","invoiceAddress":"8.2 Invoice and unique address. Each Invoice includes a unique BTC address and an exact BTC amount, and is valid only until its expiry time.","exactAmount":"8.3 Exact amount required. Underpayments do not activate, extend, or upgrade service until fully completed.","confirmationsRequired":"8.4 Confirmations required (1 confirmation). A payment is considered approved after at least one (1) on-chain confirmation. We may change the confirmations threshold for risk/security reasons with prior notice.","invoiceExpiry":"8.5 Invoice expiry. If an Invoice expires, the Client must generate a new Invoice to pay.","latePayment":"8.6 Late payment to expired invoice. Payments received to an address associated with an expired Invoice will not automatically activate, extend, or upgrade service. We may record such amounts as Credit Balance to be applied to a new Invoice.","overpayments":"8.7 Overpayments. Overpaid amounts may be recorded as Credit Balance.","noRefunds":"8.8 No refunds. All fees are non-refundable, including for unused time, early termination, downtime, or any downgrade (if offered).","taxesDocuments":"8.9 Taxes & documents. Fees may be subject to applicable taxes (including VAT where applicable). We may issue invoices/receipts and related billing documents via the Billing Portal and/or by email to the billing contact on file.","notices":"8.10 Notices. We may provide billing and policy notices via the Billing Portal or by email to the billing contact on file."},"slaSection":{"title":"9) SLA","availabilityTarget":"9.1 Availability target. We target 99.9% monthly uptime for the API under normal operating conditions.","maintenance":"9.2 Maintenance. Scheduled maintenance will be announced in advance when reasonably possible.","performance":"9.3 Performance. We aim to maintain low-latency responses under normal conditions.","exclusionsIntro":"9.4 Exclusions. The SLA does not apply to outages or degradation caused by:","exclusion1":"Bitcoin network disruptions, reorgs, or network-wide events;","exclusion2":"external services/infrastructure failures (ISPs, hosting providers, DNS, upstream dependencies);","exclusion3":"Client-side misuse, network issues, incorrect implementation, or unauthorized access;","exclusion4":"force majeure events.","serviceCredits":"9.5 Service credits. Unless explicitly agreed in writing, the SLA provides no service credits, refunds, or offsets."},"dataAccuracyLiability":{"title":"10) Data Accuracy, \\"As-Is\\" Service & Liability","asIs":"10.1 As-is. The API and any Bitcoin-related data are provided \\"as is\\" and \\"as available.\\" No guarantee of absolute accuracy, completeness, or timeliness.","noFinancialAdvice":"10.2 No financial advice. We do not provide investment, trading, tax, or legal advice.","limitationOfLiability":"10.3 Limitation of liability. To the maximum extent permitted by law, we are not liable for indirect, incidental, special, consequential, or punitive damages, or for loss of profits, revenue, data, or business interruption arising out of or related to the API.","liabilityCap":"10.4 Liability cap. To the maximum extent permitted by law, our total liability for all claims related to this Agreement will not exceed the fees paid by the Client in the three (3) months preceding the event giving rise to the claim."},"upgradesDowngrades":{"title":"11) Upgrades, Downgrades & Plan Changes","upgradesImmediate":"11.1 Upgrades are immediate. Upgrades take effect immediately after the upgrade Invoice is paid and approved (Confirmations).","noProration":"11.2 No proration, no refunds. No proration or refunds for unused time on the previous tier.","downgrades":"11.3 Downgrades (if offered). If downgrades are offered, timing and effect will be described in the Billing Portal. No refunds apply."},"termRenewalSuspensionTermination":{"title":"12) Term, Renewal, Suspension & Termination","term":"12.1 Term. Subscriptions are monthly or yearly, as selected in the Billing Portal, and run until the end of the paid period.","renewalByPayment":"12.2 Renewal by payment. Renewal occurs upon payment and approval of the renewal Invoice.","nonPayment":"12.3 Non-payment. If renewal payment is not received and approved by the end of the term, we may suspend API access until payment is completed and approved.","terminationByClient":"12.4 Termination by Client. The Client may terminate by ceasing to renew and/or by written notice.","terminationByBlockSight":"12.5 Termination by BlockSight. We may suspend or terminate immediately for security risk, abuse, or breach.","effectOfTermination":"12.6 Effect of termination. Upon termination, API access may be revoked and API Keys may be invalidated."},"intellectualProperty":{"title":"13) Intellectual Property","blockSightIP":"13.1 BlockSight IP. We retain all rights in the API, documentation, and service.","clientIP":"13.2 Client IP. The Client retains ownership of its own systems and data.","feedback":"13.3 Feedback. Feedback may be used by BlockSight without restriction or compensation."},"changesToAgreement":{"title":"14) Changes to This Agreement","content":"We may update this Agreement from time to time. We will post updates on BlockSight.Live and/or provide notice via the Billing Portal or email. Continued API use after changes constitutes acceptance."},"governingLawJurisdiction":{"title":"15) Governing Law & Jurisdiction","content":"This Agreement is governed by the laws of Estonia. The competent courts in Harju County (Tallinn), Estonia shall have exclusive jurisdiction, unless mandatory law provides otherwise."},"contact":{"title":"16) Contact","intro":"For support, legal inquiries, or SLA questions:","email":"legal@blocksight.live","companyName":"Blocksight OÜ","registryCode":"Registry code: 17474529","registeredAddress":"Registered address: Vesivärava tn 50-301, Tallinn, 10152, Estonia"}}},"modal":{"title":"API Terms & SLA Agreement","checkboxLabel":"I have read and agree to the API Terms & SLA Agreement","acceptButton":"Accept & Proceed","cancelButton":"Cancel"},"legal":{"text":"By subscribing to any API plan, you agree to the BlockSight.Live API Terms & SLA Agreement.","slaLink":"View SLA Agreement in Legal section"},"auth":{"intro":"Access your API dashboard to manage keys, view usage, and monitor your subscription.","email":"Email","emailPlaceholder":"you@example.com","password":"Password","rememberMe":"Remember me","forgotPassword":"Forgot password?","verificationCode":"Verification Code","totpHint":"Enter the 6-digit code from your authenticator app, or an 8-character backup code","signingIn":"Signing in...","verify":"Verify","signIn":"Sign In","backToLogin":"← Back to login","orContinueWith":"or continue with","noAccount":"Don't have an account?","subscribe":"Subscribe to a plan","oauth":{"github":"GitHub","google":"Google","apple":"Apple"},"errors":{"emailRequired":"Email is required","emailInvalid":"Invalid email format","passwordRequired":"Password is required","codeRequired":"Verification code is required","codeInvalid":"Enter a 6-digit code or 8-character backup code","networkError":"Network error. Please try again.","invalidCredentials":"Invalid email or password","invalidCode":"Invalid verification code"}}}},"faq":{"title":"FAQ","tagline":"Frequently Asked Questions","categories":{"bitcoinFundamentals":{"title":"Bitcoin Fundamentals","items":{"whatIsBitcoin":{"q":"What is Bitcoin?","a":"Bitcoin is a decentralized digital currency that operates without banks, governments, or intermediaries. It was created in 2009 by an anonymous person or group known as Satoshi Nakamoto. Bitcoin allows anyone, anywhere in the world, to send and receive value directly, without asking permission from any institution. There will only ever be 21 million bitcoin. No one can print more, change the rules, or shut it down."},"whatIsBlockchain":{"q":"What is a blockchain?","a":"A blockchain is a shared, append-only ledger that records transactions in a verifiable order. Instead of relying on a single central database, thousands of independent computers (nodes) around the world maintain the same history. Every transaction ever made on Bitcoin is recorded on this chain. No single entity controls it, and altering past records is practically impossible."},"whatIsBitcoinBlockchain":{"q":"What is the Bitcoin blockchain?","a":"The Bitcoin blockchain is the public ledger that stores every Bitcoin transaction ever made. New data is added in blocks, each cryptographically linked to the previous one, forming a continuous chain of verified records stretching back to January 3, 2009."},"whoControls":{"q":"Who controls Bitcoin?","a":"No one. That's the point. Bitcoin is maintained by a global network of nodes and miners running open-source software. There is no CEO, no company, no board of directors. Changes to the protocol require broad consensus among participants. This makes Bitcoin the only truly decentralized monetary network in existence."},"whatIsSatoshi":{"q":"What is a satoshi?","a":"A satoshi (sat) is the smallest unit of bitcoin. One bitcoin equals 100,000,000 satoshis. You don't need to buy a whole bitcoin. You can own and send fractions as small as 1 sat. Think of satoshis like cents to a dollar, except there are 100 million of them per bitcoin."},"isLegal":{"q":"Is Bitcoin legal?","a":"In most countries, yes. Bitcoin is legal to buy, hold, and use in the vast majority of jurisdictions worldwide. Regulations vary by country. Some countries have embraced Bitcoin (like El Salvador, which made it legal tender), while a small number have restricted or banned it. Always check your local laws."},"isAnonymous":{"q":"Is Bitcoin anonymous?","a":"Bitcoin is pseudonymous, not anonymous. Transactions are recorded on a public blockchain and can be viewed by anyone. Addresses are not directly linked to real-world identities, but with enough analysis, patterns can sometimes be traced. Privacy on Bitcoin requires deliberate effort and specific techniques."},"whatGivesValue":{"q":"What gives Bitcoin its value?","a":"Scarcity (only 21 million will ever exist), decentralization (no one can manipulate it), security (the most powerful computing network on earth protects it), and utility (it can be sent anywhere, anytime, without permission). Bitcoin's value comes from the same place any money's value comes from: people agreeing it has value. The difference is that Bitcoin's properties are enforced by mathematics, not by trust in institutions."}}},"howBitcoinWorks":{"title":"How Bitcoin Works","items":{"whatIsTransaction":{"q":"What is a Bitcoin transaction?","a":"A Bitcoin transaction is a transfer of value from one address to another, broadcast to the network and recorded on the blockchain. Every transaction specifies inputs (where the bitcoin is coming from) and outputs (where it's going). Once confirmed in a block, the transaction is permanent and irreversible."},"confirmedVsUnconfirmed":{"q":"What is the difference between confirmed and unconfirmed transactions?","a":"Unconfirmed transactions have been broadcast to the network but are not yet included in a block. They sit in the mempool, waiting for a miner to include them. Depending on network congestion and the fee rate paid, confirmation can take minutes or significantly longer. Confirmed transactions are included in a mined block. Additional confirmations accumulate as more blocks are built on top of that block. Generally, 1 confirmation is sufficient for small amounts, and 6 confirmations is considered highly secure."},"whatIsMempool":{"q":"What is the mempool?","a":"The mempool (memory pool) is a waiting area where unconfirmed transactions sit before being included in a block. Every Bitcoin node maintains its own mempool. When you send a transaction, it enters the mempool and waits for a miner to pick it up. Think of it as a queue. Higher-fee transactions generally get picked first."},"whatIsBlock":{"q":"What is a Bitcoin block?","a":"A block is a bundle of transactions that a miner has verified and added to the blockchain. Each block contains a set of transactions, a reference to the previous block, a timestamp, and a proof-of-work solution. A new block is found approximately every 10 minutes on average, though the actual time varies."},"whatIsAddress":{"q":"What is a Bitcoin address?","a":"A Bitcoin address is a string of characters that represents a destination for a Bitcoin payment. It's like a bank account number, except anyone can generate one without asking permission, and you can create as many as you want. Modern Bitcoin addresses start with 'bc1' (these are called native SegWit or bech32 addresses) and are the most efficient format."},"whatIsPrivateKey":{"q":"What is a private key?","a":"A private key is a secret number that proves ownership of the bitcoin associated with an address. Whoever holds the private key controls the funds. Private keys must never be shared with anyone. If someone else obtains your private key, they can take your bitcoin. If you lose your private key and have no backup, your bitcoin is gone permanently."},"whatIsSeedPhrase":{"q":"What is a seed phrase?","a":"A seed phrase (also called a recovery phrase or mnemonic) is a set of 12 or 24 words that represents your private keys. It is generated when you create a wallet and serves as the master backup for all your funds. Write it down on paper. Store it somewhere safe. Never type it into a website. Never share it with anyone. Your seed phrase IS your bitcoin."}}},"miningNetwork":{"title":"Bitcoin Mining & Network","items":{"whatIsMining":{"q":"What is Bitcoin mining?","a":"Mining is the process of selecting unconfirmed transactions from the mempool, packaging them into a block, and competing to add that block to the blockchain. Miners use specialized hardware to solve a cryptographic puzzle (proof-of-work). The first miner to find a valid solution wins the right to add the block. The winner earns the block subsidy (newly created bitcoin) plus all transaction fees included in that block."},"whatArePools":{"q":"What are mining pools?","a":"Mining pools are groups of miners who combine their computing power (hashpower) to reduce variance and receive steadier payouts. Solo mining is like playing the lottery alone. Pool mining is like joining a syndicate. When the pool finds a block, rewards are distributed to participants according to their contributed work."},"whatIsSubsidy":{"q":"What is the block subsidy?","a":"The block subsidy is the amount of new bitcoin created with each block. It started at 50 BTC per block in 2009. Every 210,000 blocks (approximately every 4 years), it cuts in half. This event is called the 'halving.' As of 2024, the subsidy is 3.125 BTC per block. This predictable, decreasing issuance schedule is how Bitcoin's 21 million supply cap is enforced."},"whatIsHalving":{"q":"What is the halving?","a":"The halving is a built-in event that cuts the block subsidy in half approximately every 4 years. It reduces the rate at which new bitcoin enters circulation. The most recent halving occurred in April 2024, reducing the subsidy from 6.25 to 3.125 BTC per block. Halvings will continue until approximately the year 2140, when all 21 million bitcoin will have been mined."},"emptyBlocks":{"q":"What are empty blocks and why do they occur?","a":"Empty blocks occur when a mining pool learns that a new block was found but has not yet received and validated the full transaction list. The pool knows the next block height and can start mining immediately, but cannot safely select transactions yet, so it mines on an empty template containing only the coinbase transaction. If a valid hash is found during this brief interval, an empty block is published."},"blockTimestamps":{"q":"Why don't block timestamps always increase in order?","a":"Bitcoin has no centralized time source. The protocol does not require a block's timestamp to be later than the previous block's. The only requirement is that the timestamp is not earlier than the median timestamp of the previous 11 blocks. In practice, block timestamps can vary by up to about an hour, which means blocks can occasionally appear out of chronological order."}}},"transactionsFees":{"title":"Bitcoin Transactions & Fees","items":{"whatAreFees":{"q":"What are transaction fees?","a":"Transaction fees are small amounts of bitcoin paid to miners as an incentive to include your transaction in a block. Fees are not fixed. They fluctuate based on network demand. When more people want to transact, fees rise. When the network is quiet, fees drop. Fees are measured in satoshis per virtual byte (sats/vB)."},"whatAreVirtualBytes":{"q":"What are virtual bytes (vB)?","a":"Virtual bytes (vB) are a unit of measurement used in Bitcoin to calculate the size of a transaction for fee purposes. Miners prioritize transactions based on their fee rate in sats/vB. A smaller transaction in virtual bytes requires a lower fee to get confirmed. This unit standardizes fee calculations and ensures fair pricing for block space."},"whyStuck":{"q":"Why is my transaction stuck?","a":"Most 'stuck' transactions are delayed because their fee rate is lower than other transactions competing for limited block space. When the mempool is congested, miners prioritize higher-fee transactions. Your transaction will eventually confirm when congestion drops, unless the mempool clears it (typically after 2 weeks). BlockSight.Live can show you network conditions and where your transaction sits relative to others, but it cannot modify or accelerate a transaction."},"howSpeedUp":{"q":"How can I speed up my Bitcoin transaction?","a":"Confirmation speed depends on fee rate and current congestion. Some wallets support Replace-By-Fee (RBF), which lets you rebroadcast the transaction with a higher fee. Other wallets support Child-Pays-For-Parent (CPFP), where a new transaction with a high fee incentivizes miners to confirm both. Check your wallet's documentation for these features."},"howAvoidSlow":{"q":"How can I avoid slow confirmations?","a":"Check current fee conditions before sending and choose a fee rate that matches your urgency. The BlockSight.Live dashboard shows recommended fee levels in real time. If your wallet supports fee-bumping (RBF), enable it before sending so you have the option to increase fees later if needed."},"canCancel":{"q":"Can I cancel a Bitcoin transaction?","a":"Once a Bitcoin transaction is confirmed in a block, it is permanent and irreversible. If a transaction is still unconfirmed and your wallet supports RBF, you may be able to replace it with a new transaction (effectively redirecting the funds back to yourself). There is no 'undo' button on the Bitcoin network."}}},"selfCustody":{"title":"Self-Custody & Security","items":{"whatIsSelfCustody":{"q":"What is self-custody?","a":"Self-custody means you hold your own private keys. When your bitcoin is on an exchange, the exchange controls the keys. 'Not your keys, not your coins' is a core principle of Bitcoin. Self-custody means no one can freeze your funds, deny your access, or lose your money through their own mismanagement. It also means you are fully responsible for security."},"whatIsWallet":{"q":"What is a Bitcoin wallet?","a":"A Bitcoin wallet is software (or hardware) that manages your private keys and lets you send and receive bitcoin. A wallet does not actually 'store' bitcoin. Bitcoin always lives on the blockchain. Your wallet stores the keys that prove you own it."},"hotVsCold":{"q":"What is the difference between a hot wallet and a cold wallet?","a":"A hot wallet is connected to the internet (like a mobile app). It's convenient for everyday use but more exposed to potential threats. A cold wallet (like a hardware device) stores keys offline and is considered more secure for long-term storage. Most people use a combination: hot wallet for spending, cold wallet for savings."},"howKeepSafe":{"q":"How do I keep my bitcoin safe?","a":"Write your seed phrase on paper and store it in a secure physical location. Never digitally. Never share your seed phrase or private keys with anyone, for any reason. Use a reputable self-custody wallet. Enable biometric authentication on your wallet if available. Be cautious of phishing. No legitimate service will ever ask for your seed phrase. Consider a hardware wallet for larger amounts."}}},"blocksightLive":{"title":"BlockSight.Live","items":{"whatIs":{"q":"What is BlockSight.Live?","a":"BlockSight.Live is a real-time Bitcoin blockchain explorer. It lets you watch the Bitcoin network as it operates: blocks being mined, transactions being confirmed, fees shifting, congestion rising and falling. It is a read-only window into the Bitcoin network, focused exclusively on Bitcoin."},"whatCanIDo":{"q":"What can I do on BlockSight.Live?","a":"Watch blocks arrive in real time with live confirmation countdowns. Monitor network congestion and fee conditions on the dashboard. Search any Bitcoin address or transaction. View recommended fee levels for sending transactions. Track Bitcoin price in USD and your local currency. Explore Monica Bitcoin Metrics, five original indicators that make on-chain data easier to understand."},"whatAreMonicaMetrics":{"q":"What are Monica Bitcoin Metrics?","a":"Monica Bitcoin Metrics are a set of five original indicators created by BlockSight.Live. They reframe existing blockchain information into signals that are easier to understand: Bitcoin Velocity Pressure (BVP), Real Usage Ratio (RUR), Fee Pain Index (FPI), Trustless Throughput Score (TTS), and Economic Density Index (EDI). Core Network Metrics show what is happening. Monica Metrics help explain what it means."},"whatIsCongestion":{"q":"What is the Congestion Gauge?","a":"The Congestion Gauge displays the real-time congestion level on the Bitcoin network. It is divided into four categories: Below Average (Green) for low activity, Average (Light Green) for normal activity, Congestion (Orange) for high activity with potential delays, and Extreme Congestion (Red) for heavily congested conditions with long confirmation times and higher fees."},"whatIsFeeGauge":{"q":"What is the Fee Gauge?","a":"The Fee Gauge shows recommended fee levels in sats/vB based on real-time analysis of unconfirmed transactions. Next block fee is the fee needed for a high chance of inclusion in the very next block. 6-hour fee is a lower fee based on recent block analysis, suitable for non-urgent transactions."},"doesProcessTx":{"q":"Does BlockSight.Live process transactions?","a":"No. BlockSight.Live is a read-only data tool. We do not process, send, receive, expedite, cancel, or modify Bitcoin transactions. We do not hold funds. We do not offer financial advice. For transaction-related help, contact the wallet or exchange you used."},"isAffiliated":{"q":"Is BlockSight.Live affiliated with Bitcoin Core or any exchange?","a":"No. BlockSight.Live is an independent service operated by Blocksight OÜ. We are not affiliated with Bitcoin Core, any mining pool, exchange, wallet provider, or third-party platform."},"languages":{"q":"What languages does BlockSight.Live support?","a":"BlockSight.Live displays Bitcoin price in both USD and the local fiat currency based on your selected language. The dashboard adapts to your language preference. We are continuously expanding language support."}}},"tzurWallet":{"title":"TZUR Wallet","items":{"whatIs":{"q":"What is TZUR?","a":"TZUR (pronounced 'tsoor', from the Hebrew word for 'rock') is a self-custody Bitcoin wallet built natively for iOS. It is designed for security, simplicity, and accessibility in your own language."},"whatMakesDifferent":{"q":"What makes TZUR different from other Bitcoin wallets?","a":"TZUR is built for the non-English-speaking world. Most Bitcoin wallets are designed in English and translated as an afterthought. TZUR is different. It supports Hebrew, Spanish, Portuguese, Russian, Traditional Chinese, and more languages are being added continuously. Each language is carefully localized, not just translated. TZUR is also Bitcoin-only. No altcoins. No tokens. No distractions."},"isSafe":{"q":"Is TZUR safe?","a":"TZUR is built with security as the first priority. Self-custody: you hold your own keys. We never have access to your funds. Seed phrases are stored in the iOS Secure Enclave, never in plaintext. Private keys exist in memory only during transaction signing and are cleared immediately after. All transaction signing happens locally on your device. Native SegWit (bech32) addresses for maximum efficiency and security. BIP-39, BIP-32, and BIP-84 compliant."},"whyIOS":{"q":"Why is TZUR iOS only?","a":"By design. iOS provides hardware-level security features (Secure Enclave) that TZUR relies on to protect your keys. Starting with one platform done right is a deliberate choice, not a limitation. Android support is planned for a future phase."},"canRestore":{"q":"Can I restore my TZUR wallet on another device?","a":"Yes. Your 12-word seed phrase is the master backup for your wallet. As long as you have your seed phrase, you can restore your wallet on any BIP-39/BIP-84 compatible wallet, not just TZUR. Your bitcoin is never locked to one app."},"lightning":{"q":"Does TZUR support Lightning Network?","a":"Not in the current version. TZUR focuses on on-chain Bitcoin transactions with full self-custody. Lightning support may be considered in a future release."},"isFree":{"q":"How much does TZUR cost?","a":"TZUR Wallet is a one-time purchase of $59.99 on the App Store. There are no subscriptions, no monthly fees, and no in-app purchases. You pay once and receive all future updates, security improvements, and new features at no extra cost. This pricing model reflects the product philosophy: TZUR is a tool you own, not a service you rent. Network fees for Bitcoin transactions are separate and go to Bitcoin miners, not to TZUR. The wallet does not take any cut or add any markup to transaction fees."},"connection":{"q":"What is the connection between TZUR and BlockSight.Live?","a":"Both are part of the BlockSight ecosystem, built by the same team at Blocksight OÜ. BlockSight.Live lets you see the Bitcoin network. TZUR lets you use it. They are complementary tools designed to make Bitcoin accessible."}}},"support":{"title":"Support","items":{"helpWithTx":{"q":"I need help with a transaction. Can BlockSight.Live help?","a":"BlockSight.Live can show you the status and details of any transaction on the Bitcoin network. However, we cannot modify, cancel, or speed up transactions. For transaction-related assistance, contact the wallet or exchange that created the transaction."},"howContact":{"q":"How do I contact the team?","a":"Email: legal@blocksight.live. X/Twitter: @BlockSight_Live. For TZUR wallet: visit tzur.live."}}}}},"docs":{"title":"Documentation","tagline":"BlockSight.Live – Your Guide to the Bitcoin Network","disclaimer":{"paragraph1":"BlockSight.Live provides information and insights about the Bitcoin network. It does not assist with fund recovery, wallet-related issues, or similar matters. For any such concerns, contact the service provider involved in your transaction, such as your wallet software or exchange platform.","paragraph2":"BlockSight.Live does not process Bitcoin transactions. We cannot expedite, cancel, or replace pending transactions. If you have questions about a transaction, contact the wallet or service provider used to initiate it."},"whatIsBlocksight":{"title":"What is BlockSight.Live?","content":"BlockSight.Live is a real-time Bitcoin blockchain explorer. It provides clear visibility into on-chain activity and network behavior as it happens. The platform transforms blockchain data into practical insights, with a dedicated focus on Bitcoin only."},"whatIsExplorer":{"title":"What is a Bitcoin explorer?","content":"A Bitcoin explorer is a tool that lets you search and view information on the Bitcoin blockchain: transaction history, wallet balances, block details, and network activity, all in real time. It is an essential resource for anyone who wants to track transactions, verify confirmations, or understand the current state of the Bitcoin network."},"visualization":{"title":"Block Visualization","subtitle":"Overview","overview":"BlockSight.Live provides an interactive, real-time visualization of the Bitcoin blockchain with continuous updates and an intuitive interface for exploring on-chain activity as it unfolds.","coreFeatures":{"title":"Block Metrics","blockMetrics":{"title":"Block Metrics","description":"Each block displays the following data:","blockNumber":"Block Number: Identifies the block within the chain.","feeRange":"Fee Range: The range of transaction fees included in the block.","timestamp":"Timestamp: Displayed as a precise date and time, or as a live-updating clock.","txCount":"Transaction Count: The total number of transactions included in the block."}},"colorCodes":{"title":"Color-Coded Status Indicators","orange":"Orange: Unconfirmed blocks in the mempool (queue).","red":"Red: The next block awaiting confirmation.","lightPurple":"Light Purple: The last confirmed block.","darkPurple":"Dark Purple: Previously confirmed blocks."},"unconfirmedBlocks":{"title":"Unconfirmed Blocks","content":"Each unconfirmed block includes an estimated time to confirmation, displayed dynamically in minutes or hours."},"nextBlock":{"title":"Next Block Confirmation Countdown","content":"A live countdown timer reflects the expected time to confirmation. Visual cues provide context and highlight any delays in block production."},"lastConfirmed":{"title":"Last Confirmed Block","content":"Displays the elapsed time since confirmation using a live clock. If delays occur, the interface adapts to flag potential issues."},"historical":{"title":"Historical Confirmation Data","content":"Confirmed blocks show elapsed confirmation time. If more than 24 hours have passed, the exact date and time of confirmation are displayed instead."},"alerts":{"title":"Block Discovery Alerts","content":"Real-time notifications trigger when a new block is found. This includes both audio and visual alerts showing the block number and key metrics."}},"dashboard":{"title":"Dashboard","intro":"The BlockSight.Live dashboard provides a consolidated view of real-time network and market indicators:","bulletPrice":"Bitcoin Price in USD, with a parallel value in the local fiat currency associated with the user's selected site language. For example, users browsing in Hebrew will see both USD and ILS values.","bulletCongestion":"Congestion Gauge reflecting current network load.","bulletFee":"Fee Gauge showing recommended fee levels in sats/vB for transactions targeting the next block or a broader confirmation window.","outro":"Together, these elements provide a continuously updated snapshot of market conditions and network activity."},"congestionGauge":{"title":"Bitcoin Congestion Gauge","content":"The Bitcoin Congestion Gauge displays the real-time congestion level on the Bitcoin network. It analyzes the number of pending transactions, estimated confirmation time, and other key parameters. The gauge is always visible on the main dashboard.","categories":{"title":"The gauge is divided into four categories:","belowAverage":"Below Average (Green): Low activity. The network is not congested.","average":"Average (Light Green): Normal activity. Transactions confirm in a reasonable time.","congestion":"Congestion (Orange): High activity. Delays in confirmation may occur.","extreme":"Extreme Congestion (Red): The network is heavily congested, with long confirmation times and higher fees."}},"virtualBytes":{"title":"Virtual Bytes (vB)","content":"Virtual bytes (vB) are a unit of measurement used in Bitcoin to calculate transaction size for fee purposes. Miners prioritize transactions based on their fee rate, measured in satoshis per vB (sats/vB). The smaller the transaction in virtual bytes, the lower the fee required to include it in a block. This unit standardizes fee calculations and ensures fair pricing for block space."},"feeGauge":{"title":"Fee Gauge","content":"Fees on the BlockSight.Live Fee Gauge are calculated using real-time data from the Bitcoin blockchain. The system analyzes the current state of unconfirmed transactions to provide fee recommendations in sats/vB. These recommendations target inclusion in the next block or within subsequent blocks, depending on network congestion.","display":{"title":"How fees are displayed","intro":"Fees are presented in two categories:","nextBlock":"Fee for confirmation in the next block: The fee required to significantly increase the likelihood of inclusion in the upcoming block.","sixHours":"Fee for confirmation within the next 6 hours: Based on an analysis of low fees in the last 10 blocks. A balanced option for non-urgent transactions."}},"calculator":{"title":"Bitcoin Calculator","content":"The Bitcoin calculator performs real-time conversions between Bitcoin and two fiat currencies (such as USD and ILS) using the latest exchange rates. Users can convert values into Bitcoin and sats. The calculator is integrated into the dashboard and accessible with a single click."},"emptyBlocks":{"title":"Bitcoin Empty Blocks","content":"Empty blocks occur when a mining pool learns that a new block was found but has not yet received and validated the full transaction list. The pool knows the next block height and can start mining immediately, but cannot safely select transactions yet, so it mines on an empty template containing only the coinbase transaction. If a valid hash is found during this brief interval, an empty block is published. Otherwise, the pool switches to a normal full template once the previous block is fully validated."},"blockTimestamps":{"title":"Block Timestamps","content":"Bitcoin has no centralized time source. The protocol does not require a block's timestamp to be later than the previous block's. The only requirement is that the timestamp is not earlier than the median timestamp of the previous 11 blocks. In practice, block timestamps can vary by up to about an hour, which can result in blocks appearing out of chronological order."},"metrics":{"title":"Metrics","intro":"BlockSight.Live displays two categories of metrics:","bulletCore":"Core Network Metrics are direct, unopinionated measurements of Bitcoin activity.","bulletMonica":"Monica Bitcoin Metrics are derived indicators designed to improve intuition and understanding.","allCalculated":"All metrics are calculated from live on-chain data.","coreMetrics":{"title":"Core Network Metrics","description":"Core Network Metrics present raw measurements of Bitcoin network activity without interpretation:","txLast24h":"Transactions (Last 24 Hours)","avgTxPerHour":"Average Transactions per Hour","btcSent24h":"Bitcoins Sent (Last 24 Hours)","btcSentAvgPerHour":"Bitcoins Sent (Average per Hour)","avgTxValue":"Average Transaction Value","medianTxValue":"Median Transaction Value","avgTxFee":"Average Transaction Fee","medianTxFee":"Median Transaction Fee"},"monicaMetrics":{"title":"Monica Bitcoin Metrics","description":"Monica Bitcoin Metrics are a set of original, derived indicators created by BlockSight.Live to make Bitcoin's on-chain activity easier to understand at a glance. They do not introduce new data. Instead, they reframe existing blockchain information into signals that reflect usage, friction, and economic weight.","bvp":{"title":"1. Bitcoin Velocity Pressure (BVP)","calculation":"How it's calculated: Bitcoin sent in the last 24 hours divided by total circulating Bitcoin supply.","significance":"Why it matters: This metric shows how much of Bitcoin's supply is actively moving. Lower values suggest accumulation or long-term holding, while higher values indicate redistribution or heightened activity."},"rur":{"title":"2. Real Usage Ratio (RUR)","calculation":"How it's calculated: Median transaction value divided by average transaction value.","significance":"Why it matters: This reveals whether transaction activity is driven by typical users or skewed by a small number of large transfers."},"fpi":{"title":"3. Fee Pain Index (FPI)","calculation":"How it's calculated: Median transaction fee divided by median transaction value.","significance":"Why it matters: By expressing fees relative to transaction size, this metric reflects how costly fees feel to a typical user on the network."},"tts":{"title":"4. Trustless Throughput Score (TTS)","calculation":"How it's calculated: Total USD value settled in the last 24 hours divided by the number of transactions.","significance":"Why it matters: This highlights Bitcoin's role as a trustless settlement network by showing how much value is moved per transaction."},"edi":{"title":"5. Economic Density Index (EDI)","calculation":"How it's calculated: Total USD value settled in the last 24 hours divided by the number of blocks mined in that same period.","significance":"Why it matters: Blocks are scarce settlement units. This metric shows how much economic weight each block carries."}},"usingMetrics":{"title":"Using These Metrics","content":"Core Network Metrics show what is happening on the Bitcoin network. Monica Bitcoin Metrics help explain what it means. Together, they allow BlockSight.Live users to observe Bitcoin activity with greater clarity and context, in real time."}},"faq":{"title":"Frequently Asked Questions","whatIsBlockchain":{"question":"What is a Blockchain?","answer":"A blockchain is a shared, append-only ledger that records transactions in a verifiable order. Instead of relying on a single central database, many independent nodes maintain the same history, making it extremely difficult to alter retroactively."},"whatIsBitcoinBlockchain":{"question":"What is the Bitcoin Blockchain?","answer":"The Bitcoin blockchain is the public ledger that stores Bitcoin's transaction history. New data is added in blocks, each cryptographically linked to the previous one, forming a continuous chain of verified records."},"confirmedVsUnconfirmed":{"question":"What is the difference between confirmed and unconfirmed transactions?","answer":"Unconfirmed transactions have been broadcast to the network but are not yet included in a block. Depending on network congestion and the fee rate paid, confirmation can take minutes or significantly longer. Confirmed transactions are included in a mined block. Additional confirmations accumulate as more blocks are built on top of that block."},"whyNotConfirming":{"question":"Why isn't my transaction confirming?","answer":"Most \\"stuck\\" transactions are delayed because their fee rate is lower than other transactions competing for limited block space. When the mempool is congested, miners generally prioritize higher-fee transactions. BlockSight.Live can show network conditions and where your transaction sits, but it can't modify or accelerate a transaction. For hands-on help, contact the wallet or service that created it (your wallet app or exchange)."},"speedUpTransaction":{"question":"How can I speed up my Bitcoin transaction confirmation?","answer":"Confirmation speed is driven mainly by fee rate and current congestion. Some wallets support fee-bumping features that can increase a transaction's effective fee rate after broadcast. For step-by-step guidance, use your wallet/exchange support, since BlockSight.Live is a read-only network data tool."},"reduceSlowConfirmations":{"question":"How can I reduce the risk of slow confirmations next time?","answer":"Check current fee conditions before sending and choose a fee rate that matches your urgency. If your wallet supports fee-bumping options, enabling them can provide flexibility if network conditions change after you broadcast. You can also reference the fee estimates shown on the BlockSight.Live dashboard before sending."},"whatIsMining":{"question":"What is Bitcoin mining?","answer":"Mining is the process of selecting unconfirmed transactions, packaging them into a block, and adding that block to the Bitcoin blockchain. Miners compete to produce the next valid block; the winner earns the block subsidy (newly issued bitcoin) plus the transaction fees included in that block."},"whatAreMiningPools":{"question":"What are mining pools?","answer":"Mining pools are groups of miners who combine their hashpower to reduce variance and receive steadier payouts. When the pool finds a block, rewards are distributed to participants according to their contributed work."}},"nav":{"whatIsBlocksight":"BlockSight.Live","whatIsExplorer":"Bitcoin Explorer","visualization":"Visualization","dashboard":"Dashboard","congestionGauge":"Congestion Gauge","virtualBytes":"Virtual Bytes","feeGauge":"Fee Gauge","calculator":"Calculator","emptyBlocks":"Empty Blocks","metrics":"Metrics","blockTimestamps":"Block Timestamps","faq":"FAQ"}},"tzur":{"title":"TZUR Wallet","hero":{"title":"Bitcoin in Your Language","subtitle":"The first Bitcoin wallet with native-language seed phrases, a built-in blockchain explorer, and a fully localized interface. Built by the BlockSight team.","appStore":"Download on the App Store","visitSite":"Visit tzur.live","screenshotAlt":"TZUR Wallet dashboard showing Bitcoin balance"},"whatIs":{"title":"What is TZUR?","paragraph1":"TZUR (Hebrew: צור, \\"rock/flint\\") is a self-custody Bitcoin wallet built natively for iOS. It is the first Bitcoin wallet to generate and display BIP-39 seed phrases in the user's native language.","paragraph2":"TZUR is built by the same team behind BlockSight.Live. One product lets you see the Bitcoin network. The other lets you interact with it. Together, they form a complete Bitcoin toolkit."},"whyExists":{"title":"Why TZUR Exists","paragraph1":"Six billion people don't speak English as a first language. Most Bitcoin wallets force users to write down a 12-word recovery phrase in English. If you don't understand the words, you can't verify them. If you can't verify them, you can't trust them.","paragraph2":"TZUR solves this. 31 languages. Same BIP-39 standard. Full compatibility with every other wallet that follows the protocol."},"pricing":{"title":"One Purchase. Yours Forever.","description":"TZUR Wallet is a one-time purchase of $59.99 on the App Store. There are no subscriptions, no monthly fees, and no in-app purchases. You pay once and receive all future updates, security improvements, and new features at no extra cost. This pricing model reflects the product philosophy: TZUR is a tool you own, not a service you rent. Network fees for Bitcoin transactions are separate and go to Bitcoin miners, not to TZUR. The wallet does not take any cut or add any markup to transaction fees."},"standards":{"title":"Built on Open Standards","headerStandard":"Standard","headerPurpose":"Purpose","bip39":"Mnemonic seed phrases (31 languages)","bip32":"Hierarchical deterministic key derivation","bip84":"Native SegWit address generation (bech32)","bip125":"Replace-by-fee (RBF) transaction replacement","bip21":"Bitcoin payment URI format","addressTypes":"TZUR sends to all Bitcoin address types: P2PKH (1...), P2SH (3...), P2WPKH (bc1q...), and P2TR (bc1p...)."},"selfCustody":{"title":"Self-Custody. No Exceptions.","keysOnDevice":"Private keys are generated on your device. No server ever sees them.","localSigning":"Transactions are signed locally. Nothing is shared with external services.","noAccounts":"No accounts. No registration. No personal data collected.","seedBackup":"Your seed phrase is your only backup. TZUR cannot recover it for you.","disclaimer":"This is not a custodial service. This is software that gives you direct access to the Bitcoin network."},"languages":{"title":"31 Languages","list":"English, Hebrew, Spanish, Portuguese, Russian, German, French, Turkish, Arabic, Japanese, Chinese (Simplified), Chinese (Traditional), Hindi, Indonesian, Vietnamese, Korean, Thai, Malay, Italian, Filipino, Dutch, Farsi, Bengali, Czech, Danish, Estonian, Polish, Romanian, Swedish, Ukrainian, Urdu.","scope":"Every screen, every label, every legal document. Not just the seed phrase."},"currencies":{"title":"75 Fiat Currencies","intro":"View your Bitcoin balance in any of 75 fiat currencies. Choose up to three at the same time.","americas":{"title":"Americas","list":"USD, CAD, MXN, BRL, ARS, CLP, COP, PEN, UYU, BOB, PYG, VES, CRC, DOP, GTQ, HNL, NIO, PAB, JMD, TTD, BBD, BZD, GYD, SRD, HTG"},"europe":{"title":"Europe","list":"EUR, GBP, CHF, SEK, NOK, DKK, PLN, CZK, HUF, RON, BGN, HRK, RSD, UAH, GEL, MDL, ALL, MKD, BAM, ISK"},"middleEastAfrica":{"title":"Middle East & Africa","list":"ILS, TRY, AED, SAR, QAR, KWD, BHD, OMR, JOD, EGP, MAD, TND, ZAR, NGN, KES, GHS, TZS, UGX, ETB, XOF"},"asiaPacific":{"title":"Asia-Pacific","list":"JPY, CNY, INR, KRW, TWD, HKD, SGD, THB, MYR, IDR, PHP, VND, PKR, BDT, LKR, NPR, MMK, KHR, LAK, AUD, NZD, FJD, PGK, MNT, KZT"},"source":"Live exchange rates from CoinGecko and Coinbase with offline fallbacks."},"blocksightInside":{"title":"BlockSight Inside","paragraph1":"TZUR includes a built-in BlockSight.Live explorer tab. Search any transaction, address, or block height without leaving the wallet. Tap any value in your transaction history to see it live on the blockchain.","paragraph2":"The same explorer. The same data. Inside your wallet.","screenshotAlt":"TZUR built-in BlockSight explorer tab"},"themes":{"title":"7 Visual Themes","headerTheme":"Theme","headerDescription":"Description","light":{"name":"Light","description":"Clean, bright interface"},"dark":{"name":"Dark","description":"Low-light optimized"},"bitcoinOrange":{"name":"Bitcoin Orange","description":"Classic Bitcoin palette"},"midnightBlue":{"name":"Midnight Blue","description":"Deep ocean tones"},"blocksight":{"name":"BlockSight.Live","description":"Galaxy explorer with animated starfield"},"satoshisRose":{"name":"Satoshi's Rose","description":"Elegant rose-tinted dark theme"},"myTzur":{"name":"My TZUR","description":"Fully customizable: your photo, your colors, your wallet"},"myTzurDetail":"My TZUR lets you set a custom background photo, accent color, atmosphere effects, and wallet card gradient. No other Bitcoin wallet offers this level of personalization."},"security":{"title":"Security Architecture","keychain":"iOS Keychain with hardware-backed encryption","faceId":"Face ID / PIN authentication","passphrase":"BIP-39 passphrase support (advanced users)","jailbreak":"Jailbreak detection with user warning","clipboard":"Clipboard auto-clear after copying sensitive data","autoLock":"Auto-lock with configurable timeout","tls":"TLS-only Electrum connections with certificate pinning","merkle":"Merkle proof verification for transaction integrity","iosOnly":"iOS-only is a deliberate security decision. Android support is planned for Phase 2."},"ecosystem":{"title":"The BlockSight Ecosystem","headerProduct":"Product","headerDescription":"What it does","blocksight":"Real-time Bitcoin blockchain explorer","tzur":"Self-custody Bitcoin wallet in 31 languages","company":"Both products are developed by Blocksight OÜ, registered in Estonia."},"download":{"appStore":"Download TZUR Wallet on the App Store","website":"TZUR Website","bip39":"BIP-39 Wordlists (Open Source)","contact":"Contact: contact@tzur.live"}}}`),nu={documentation:tu},au=["en","he","es","pt","ru","de","fr","tr","ja","id","ko","hi","ar","vi","th","ms","it","fil","nl","zh-CN","zh-TW","fa","pl","uk","et","bn","cs","ro","sv","da","ur"];function su(){return au.map(n=>rd[n])}const za=new Set(["en"]),Va="__load_failed__";async function iu(n){if(za.has(n))return;const e=ld[n];if(!e){Nn(n,Va,"no_loader_registered");return}let t;try{t=await e()}catch(s){const i=(s instanceof Error?s.message:String(s)).slice(0,60);Nn(n,Va,i);return}const a={};for(const s of t)Object.assign(a,s.default);Hs.addResourceBundle(n,"translation",a),za.add(n)}Hs.use(vr).init({resources:{en:{translation:{...eu,...nu,...ud}}},lng:typeof import.meta<"u"&&"en"||"en",fallbackLng:"en",interpolation:{escapeValue:!1},react:{useSuspense:!1},supportedLngs:[...id],saveMissing:!0,missingKeyHandler:(n,e,t)=>{Nn(n[0]??"unknown",e,t)}});function si(){const{i18n:n}=le(),e=n.language;return od.includes(e)}function ru(){return si()?"rtl":"ltr"}function ou(){return si()?"right":"left"}const cu="_root_jrf75_117",lu="_container_jrf75_141",du="_searchIcon_jrf75_163",uu="_icon_jrf75_183",hu="_input_jrf75_205",mu="_submitButton_jrf75_431",pu="_spinner_jrf75_517",Ye={root:cu,container:lu,searchIcon:du,icon:uu,input:hu,submitButton:mu,spinner:pu},qa=({query:n,onChange:e,onSubmit:t,autoFocus:a=!1,isLoading:s=!1})=>{const{t:i}=le(),o=ru(),l=m=>{m.key==="Enter"&&(m.preventDefault(),t(m))};return d.jsx("search",{className:Ye.root,onSubmit:t,children:d.jsxs("div",{className:Ye.container,children:[d.jsx("input",{type:"search",className:Ye.input,dir:o,placeholder:i("bitcoin.search.placeholder"),value:n,onChange:m=>e(m.target.value),onKeyDown:l,"aria-label":i("navigation.search"),"data-testid":"search-input",disabled:s,autoFocus:a}),d.jsx("div",{className:Ye.searchIcon,children:d.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:Ye.icon,"aria-label":"Search icon",children:[d.jsx("title",{children:"Search"}),d.jsx("path",{d:"M21 21L16.514 16.506L21 21ZM19 10.5C19 15.194 15.194 19 10.5 19C5.806 19 2 15.194 2 10.5C2 5.806 5.806 2 10.5 2C15.194 2 19 5.806 19 10.5Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),d.jsx("button",{type:"button",className:Ye.submitButton,onClick:t,"aria-label":i("navigation.search"),disabled:!n.trim()||s,"data-testid":"search-submit-button",children:s?d.jsx(Er,{size:16,className:Ye.spinner,"aria-label":i("search.loading","Searching")}):d.jsx(Cr,{size:16})})]})})},Tn=[{level:1,anchorBtc:.001,maxBtc:.002},{level:2,anchorBtc:.003,maxBtc:.004},{level:3,anchorBtc:.005,maxBtc:.007},{level:4,anchorBtc:.01,maxBtc:.015},{level:5,anchorBtc:.02,maxBtc:.03},{level:6,anchorBtc:.05,maxBtc:.075},{level:7,anchorBtc:.1,maxBtc:.175},{level:8,anchorBtc:.25,maxBtc:.375},{level:9,anchorBtc:.5,maxBtc:.75},{level:10,anchorBtc:1,maxBtc:1.5},{level:11,anchorBtc:2,maxBtc:2.5},{level:12,anchorBtc:3,maxBtc:4},{level:13,anchorBtc:5,maxBtc:6},{level:14,anchorBtc:7,maxBtc:8.5},{level:15,anchorBtc:10,maxBtc:12.5},{level:16,anchorBtc:15,maxBtc:17.5},{level:17,anchorBtc:20,maxBtc:35},{level:18,anchorBtc:50,maxBtc:60},{level:19,anchorBtc:75,maxBtc:85},{level:20,anchorBtc:100,maxBtc:Number.POSITIVE_INFINITY}],fu=1e8;function gu(n){return n/fu}function bu(n){if(n<=0)return null;for(const e of Tn)if(n{const{t:a}=le(),s=u.useMemo(()=>yu(n),[n]);if(!s)return null;const{level:i,anchorBtc:o}=s,l=Uu[i],m=a("btcAmountIcon.ariaLabel","Bitcoin amount approximately {{amount}} BTC",{amount:o}),h=[$a.container,t].filter(Boolean).join(" ");return d.jsx("span",{className:h,"aria-label":m,role:"img",children:d.jsx("img",{src:l,alt:"","aria-hidden":"true",className:$a.coinImage,style:{width:e,height:e},draggable:!1})})};Wu.displayName="BtcAmountIcon";function zu(n){return n.length<=16?n:`${n.slice(0,6)}....${n.slice(-6)}`}const Vu="_copyableEntityLink_heuwf_8",qu="_navLink_heuwf_14",$u="_plainText_heuwf_43",Gu="_labelOnly_heuwf_49",Rt={copyableEntityLink:Vu,navLink:qu,plainText:$u,labelOnly:Gu},Ku="_tooltipWrapper_12qb5_33",Zu="_tooltip_12qb5_33",Yu="_visible_12qb5_93",Ju="_top_12qb5_115",Xu="_bottom_12qb5_131",Qu="_left_12qb5_147",eh="_right_12qb5_163",th="_arrow_12qb5_185",nh="_slideTop_12qb5_263",ah="_slideBottom_12qb5_281",sh="_slideLeft_12qb5_299",ih="_slideRight_12qb5_317",ot={tooltipWrapper:Ku,tooltip:Zu,visible:Yu,top:Ju,bottom:Xu,left:Qu,right:eh,arrow:th,slideTop:nh,slideBottom:ah,slideLeft:sh,slideRight:ih};function aa({trigger:n,children:e,position:t="top",animation:a="slide",showDelay:s=0,hideDelay:i=100,className:o,contentClassName:l,toggleOnClick:m=!1}){const[h,f]=u.useState(!1),[y,S]=u.useState(!1),v=u.useRef(null),E=u.useRef(null),_=u.useRef(null),w=u.useCallback(()=>{v.current&&(clearTimeout(v.current),v.current=null),E.current&&(clearTimeout(E.current),E.current=null)},[]),x=u.useCallback(()=>{y||(w(),s>0?v.current=setTimeout(()=>f(!0),s):f(!0))},[w,s,y]),D=u.useCallback(()=>{y||(w(),i>0?E.current=setTimeout(()=>f(!1),i):f(!1))},[w,i,y]),W=u.useCallback(()=>{m&&(y?(S(!1),f(!1)):(w(),S(!0),f(!0)))},[m,y,w]);u.useEffect(()=>{if(!y)return;const ee=be=>{_.current&&!_.current.contains(be.target)&&(S(!1),f(!1))};return document.addEventListener("click",ee),()=>document.removeEventListener("click",ee)},[y]);const q=[ot.tooltipWrapper,o].filter(Boolean).join(" "),G=[ot.tooltip,ot[t],ot[`${a}${t.charAt(0).toUpperCase()}${t.slice(1)}`],h&&ot.visible,l].filter(Boolean).join(" ");return d.jsxs("div",{ref:_,role:"group",className:q,onMouseEnter:x,onMouseLeave:D,onFocus:x,onBlur:D,onClick:m?W:void 0,onKeyDown:m?ee=>{(ee.key==="Enter"||ee.key===" ")&&W()}:void 0,children:[n,d.jsxs("div",{className:G,role:"tooltip","aria-hidden":!h,children:[e,d.jsx("span",{className:ot.arrow,"aria-hidden":"true"})]})]})}aa.displayName="Tooltip";const rh="_copyButton_soyq9_22",oh="_clipboard_soyq9_69",ch="_checkmark_soyq9_130",lh="_tooltipContent_soyq9_155",dh="_tooltipText_soyq9_159",ct={copyButton:rh,clipboard:oh,checkmark:ch,tooltipContent:lh,tooltipText:dh},uh=2e3,ii=({value:n,type:e,position:t="top",className:a,onCopy:s})=>{const{t:i}=le(),[o,l]=u.useState(!1),m=o?i("copyButton.copied","Copied!"):i(`copyButton.copy.${e}`,`Copy ${e.charAt(0).toUpperCase()+e.slice(1)}`),h=o?i("copyButton.copiedAriaLabel","Copied to clipboard"):i(`copyButton.ariaLabel.${e}`,`Copy ${e} to clipboard`),f=u.useCallback(async()=>{try{await navigator.clipboard.writeText(n),l(!0),s?.(),setTimeout(()=>{l(!1)},uh)}catch(E){b.error(g.COMPONENT,"CopyButton: Failed to copy to clipboard",{error:E instanceof Error?E:String(E)})}},[n,s]),y=u.useCallback(E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),f())},[f]),S=[ct.copyButton,o&&ct.copied,a].filter(Boolean).join(" "),v=d.jsx("button",{type:"button",className:S,onClick:f,onKeyDown:y,"aria-label":h,tabIndex:0,"data-testid":"copy-button",children:d.jsx("span",{className:o?ct.checkmark:ct.clipboard,"aria-hidden":"true"})});return d.jsx(aa,{trigger:v,position:t,showDelay:0,hideDelay:100,contentClassName:ct.tooltipContent,children:d.jsx("span",{className:ct.tooltipText,children:m})})};ii.displayName="CopyButton";const hh=["Coinbase","Coinbase (Block Reward)","OP_RETURN","Unknown","Non-standard"],mh=/^memory-pool-\d+$/,ph=16;function fh(n){return!!(n==null||n===""||hh.includes(n)||mh.test(n))}function gh(n){return n==="tx"?"transaction":n}const bh=({value:n,type:e,onNavigate:t,truncate:a=!0,testId:s,className:i})=>{const{t:o}=le();if(fh(n)){const v=n==null||n===""?"—":n,E=[Rt.copyableEntityLink,Rt.labelOnly,i].filter(Boolean).join(" ");return d.jsx("span",{className:E,"data-testid":s,children:v})}const l=n,m=a&&l.length>ph?zu(l):l,h=[Rt.copyableEntityLink,i].filter(Boolean).join(" "),f=`copyableLink.ariaLabel.${e}`,y=e==="block"?`View block ${m}`:e==="tx"?`View transaction ${m}`:`View address ${m}`,S=o(f,y,{value:m});return d.jsxs("span",{className:h,children:[d.jsx(ii,{value:l,type:gh(e)}),t?d.jsx("button",{type:"button",className:Rt.navLink,onClick:t,"aria-label":S,"data-testid":s,children:m}):d.jsx("span",{className:Rt.plainText,"data-testid":s,children:m})]})};bh.displayName="CopyableEntityLink";const yh="_container_11luz_4",vh="_emphasis_11luz_7",kh="_middle_11luz_11",It={container:yh,emphasis:vh,middle:kh},Pt=6,Sh=({address:n,testId:e,className:t})=>{const a=[It.container,t].filter(Boolean).join(" ");if(n.length<=Pt*2)return d.jsx("span",{className:a,"data-testid":e,children:d.jsx("span",{className:It.middle,children:n})});const s=n.slice(0,Pt),i=n.slice(Pt,n.length-Pt),o=n.slice(n.length-Pt);return d.jsxs("span",{className:a,"data-testid":e,children:[d.jsx("span",{className:It.emphasis,"data-testid":"address-first6",children:s}),d.jsx("span",{className:It.middle,"data-testid":"address-middle",children:i}),d.jsx("span",{className:It.emphasis,"data-testid":"address-last6",children:o})]})};Sh.displayName="FullAddressWithEmphasis";const On={BLOCKCHAIN:12e4,PRICE:3e5};function wh(n,e,t=Date.now()){return!n||n===0?!0:t-n>e}function nn(n,e=Date.now()){return!n||n===0?-1:Math.floor((e-n)/1e3)}function _h(n){const{btc:e}=n.transformed.market.prices,t=n.raw._meta.external;return{price:e.usd,change24h:e.change24h,changePercent24h:e.changePercent24h,lastUpdate:t.lastFetchedAt,isStale:t.isStale||wh(t.lastFetchedAt,On.PRICE),isMock:t.isMock,ageSeconds:nn(t.lastFetchedAt)}}function Ga(n,e,t,a=Date.now()){if(t)return"mock";if(!n||n===0)return"error";const s=a-n;return s>e*2?"error":s>e?"stale":"live"}function Th(n){const{_meta:e}=n.raw,{websocket:t}=n,a={status:Ga(e.coreRpc.lastFetchedAt,On.BLOCKCHAIN,e.coreRpc.isMock),lastUpdate:e.coreRpc.lastFetchedAt,ageSeconds:nn(e.coreRpc.lastFetchedAt),isMock:e.coreRpc.isMock,confidence:e.coreRpc.confidence},s={status:Ga(e.external.lastFetchedAt,On.PRICE,e.external.isMock),lastUpdate:e.external.lastFetchedAt,ageSeconds:nn(e.external.lastFetchedAt),isMock:e.external.isMock,confidence:e.external.confidence},i={status:t.connected?"live":"error",lastUpdate:t.lastUpdate,ageSeconds:nn(t.lastUpdate),isMock:!1,confidence:t.connected?100:0},o=[a.status,s.status,i.status];let l;o.every(h=>h==="live")?l="fresh":o.some(h=>h==="error"||h==="mock")?l="offline":l="stale";let m;return l==="fresh"?m="All data sources active":i.status==="error"?m="WebSocket disconnected - using cached data":a.isMock&&s.isMock?m="Using demo data - backend offline":a.status==="stale"?m=`Blockchain data ${a.ageSeconds}s old`:m="Some data may be outdated",{overall:l,sources:{blockchain:a,market:s,network:i},message:m,showWarning:l!=="fresh"}}const ri=u.createContext(null),Eh=({children:n})=>{const[e,t]=u.useState(()=>{const a=O.getState();return{health:a.system.health,performance:a.system.performance,errors:a.system.errors,websocket:a.websocket}});return u.useEffect(()=>{const a=O.subscribeToSlice(s=>({system:s.system,websocket:s.websocket}),({system:s,websocket:i})=>{t({health:s.health,performance:s.performance,errors:s.errors,websocket:i})});return()=>{a()}},[]),d.jsx(ri.Provider,{value:e,children:n})},Ch=()=>{const n=u.useContext(ri);if(!n)throw new Error("useHealthData must be used within HealthDataProvider");return n},oi=u.createContext(null),xh=({children:n})=>{const[e,t]=u.useState(()=>{const a=O.getState();return{prices:a.transformed.market.prices,exchangeRates:a.transformed.market.exchangeRates,marketCap:a.transformed.market.marketCap,volume24h:a.transformed.market.volume24h,dominance:a.transformed.market.dominance}});return u.useEffect(()=>{const a=O.subscribeToSlice(s=>s.transformed.market,s=>{t({prices:s.prices,exchangeRates:s.exchangeRates,marketCap:s.marketCap,volume24h:s.volume24h,dominance:s.dominance})});return()=>{a()}},[]),d.jsx(oi.Provider,{value:e,children:n})},Ah=()=>{const n=u.useContext(oi);if(!n)throw new Error("usePriceData must be used within PriceDataProvider");return n},ci=u.createContext(null),Bh=({children:n})=>{const[e,t]=u.useState(O.getState());return u.useEffect(()=>{const a=O.subscribe(s=>{t(s)});return()=>{a()}},[]),d.jsx(ci.Provider,{value:e,children:n})},sa=()=>{const n=u.useContext(ci);if(!n)throw new Error("useDataStore must be used within DataStoreProvider");return n},Rh=()=>Kl(),GS=()=>Ah(),Ih=()=>Ch(),KS=()=>{const n=sa();return u.useMemo(()=>_h(n),[n])},Ph=()=>{const n=sa();return u.useMemo(()=>Th(n),[n])};let Lh=class ye{static instance=null;static MAX_LISTENERS_PER_EVENT=100;static CONNECTION_TIMEOUT_MS=1e4;isEnabledFlag=!0;isConnecting=!1;connection=null;reconnectAttempts=0;reconnectDelay=1e3;maxReconnectDelay=3e4;reconnectTimer=null;connectionTimeoutTimer=null;heartbeatTimer=null;static HEARTBEAT_INTERVAL_MS=3e4;lastErrorShown=0;hasLoggedOffline=!1;eventListeners=new Map;constructor(){this.initializeServiceControl()}static getInstance(){return ye.instance||(ye.instance=new ye),ye.instance}initializeServiceControl(){const e="true";this.isEnabledFlag=e!=="false"}isEnabled(){return this.isEnabledFlag}enable(){this.isEnabledFlag=!0}disable(){this.isEnabledFlag=!1,this.disconnect()}resetFailureState(){this.reconnectAttempts=0,this.lastErrorShown=0,this.hasLoggedOffline=!1,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}connect(e="ws://localhost:3001/api/v1/ws"){if(!this.isEnabled())return b.info(g.WEBSOCKET,"WebSocket service is disabled - skipping connection"),Promise.reject(new Error("WebSocket service is disabled"));if(this.isConnecting)return Promise.reject(new Error("Connection already in progress"));if(this.connection&&(this.connection.readyState===WebSocket.CONNECTING||this.connection.readyState===WebSocket.OPEN))return Promise.reject(new Error("Connection already in progress"));const t=X.gauge("websocket_connections_active","Number of active WebSocket connections"),a=X.counter("websocket_errors_total","Total number of WebSocket errors",["error_type"]);return this.isConnecting=!0,new Promise((s,i)=>{try{this.connection=new WebSocket(e),this.connectionTimeoutTimer=setTimeout(()=>{this.connectionTimeoutTimer=null,this.connection&&this.connection.readyState===WebSocket.CONNECTING&&(b.warn(g.WEBSOCKET,"Connection timeout",{url:e,timeoutMs:ye.CONNECTION_TIMEOUT_MS}),this.connection.close(),this.connection=null,this.isConnecting=!1,a.inc({error_type:"connection_timeout"}),i(new Error("WebSocket connection timeout")))},ye.CONNECTION_TIMEOUT_MS),this.connection.onopen=()=>{this.isConnecting=!1,this.connectionTimeoutTimer&&(clearTimeout(this.connectionTimeoutTimer),this.connectionTimeoutTimer=null),this.reconnectAttempts=0,this.hasLoggedOffline=!1,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.startHeartbeat(),cc(e),t.inc();const o=this.eventListeners.get("open");o&&o.forEach(l=>{try{l(new Event("open"))}catch(m){b.error(g.WEBSOCKET,"Error in open listener",{error:m instanceof Error?m:String(m)})}}),this.connection?s(this.connection):(b.error(g.WEBSOCKET,"Connection is null after onopen"),i(new Error("WebSocket connection is null")))},this.connection.onerror=o=>{this.isConnecting=!1,this.connectionTimeoutTimer&&(clearTimeout(this.connectionTimeoutTimer),this.connectionTimeoutTimer=null),dc(e,new Error(`WebSocket connection failed: ${o}`)),a.inc({error_type:"connection_error"});const l=Date.now();l-this.lastErrorShown>3e4&&(b.warn(g.WEBSOCKET,"WebSocket connection failed",{error:o instanceof Error?o:String(o)}),this.lastErrorShown=l);const m=this.eventListeners.get("error");m&&m.forEach(h=>{try{h(o)}catch(f){b.error(g.WEBSOCKET,"Error in error listener",{error:f instanceof Error?f:String(f)})}}),this.connection=null,i(new Error(`WebSocket connection failed: ${o}`))},this.connection.onclose=o=>{this.stopHeartbeat(),o.wasClean||b.warn(g.WEBSOCKET,"Connection lost unexpectedly",{code:o.code,reason:o.reason}),Ra(e),t.dec();const l=this.eventListeners.get("close");l&&l.forEach(m=>{try{m(o)}catch(h){b.error(g.WEBSOCKET,"Error in close listener",{error:h instanceof Error?h:String(h)})}}),this.connection=null,this.handleReconnect(e)},this.connection.onmessage=o=>{const l=o.data?typeof o.data=="string"?o.data.length:o.data.byteLength:0;lc(e,l);const m=this.eventListeners.get("message");m&&m.forEach(h=>{try{h(o)}catch(f){b.error(g.WEBSOCKET,"Error in message listener",{error:f instanceof Error?f:String(f)})}})}}catch(o){this.isConnecting=!1,this.connectionTimeoutTimer&&(clearTimeout(this.connectionTimeoutTimer),this.connectionTimeoutTimer=null),a.inc({error_type:"connection_failed"}),i(new Error(`Failed to create WebSocket connection: ${o}`))}})}clearAllListeners(){this.eventListeners.clear()}disconnect(){if(this.stopHeartbeat(),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.connectionTimeoutTimer&&(clearTimeout(this.connectionTimeoutTimer),this.connectionTimeoutTimer=null),this.isConnecting=!1,this.reconnectAttempts=0,this.clearAllListeners(),this.connection){const e=this.connection.url;Ra(e);try{X?.gauge?.("websocket_connections_active","Number of active WebSocket connections")?.dec?.()}catch{}this.connection.close(),this.connection=null}}getConnectionStatus(){return this.isEnabled()?this.connection&&this.connection.readyState===WebSocket.OPEN?"connected":this.reconnectTimer!==null||this.reconnectAttempts>0?"reconnecting":"disconnected":"disabled"}getReconnectAttempts(){return this.reconnectAttempts}handleReconnect(e){if(!this.isEnabled())return;this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.reconnectAttempts++;const t=this.reconnectDelay*2**(this.reconnectAttempts-1),a=Math.min(t,this.maxReconnectDelay),s=a*.2*(Math.random()*2-1),i=Math.max(0,Math.round(a+s));this.hasLoggedOffline||(this.hasLoggedOffline=!0,b.info(g.WEBSOCKET,"BlockSight.Live not available, try again later")),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect(e).catch(o=>{b.debug(g.WEBSOCKET,"Reconnect attempt failed",{error:o instanceof Error?o.message:String(o)})})},i)}startHeartbeat(){this.stopHeartbeat(),this.heartbeatTimer=setInterval(()=>{if(this.connection&&this.connection.readyState===WebSocket.OPEN)try{this.connection.send(JSON.stringify({type:"ping"}))}catch{}},ye.HEARTBEAT_INTERVAL_MS)}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}send(e){if(!this.isEnabled()||!this.connection||this.connection.readyState!==WebSocket.OPEN)throw new Error("WebSocket is not connected or disabled");this.connection.send(JSON.stringify(e))}addEventListener(e,t){if(!this.isEnabled())return;this.eventListeners.has(e)||this.eventListeners.set(e,new Set);const a=this.eventListeners.get(e);if(a){if(a.size>=ye.MAX_LISTENERS_PER_EVENT){b.warn(g.WEBSOCKET,"Max listeners per event reached, rejecting",{type:e,max:ye.MAX_LISTENERS_PER_EVENT});return}a.add(t)}}addEventListenerWithCleanup(e,t){if(!this.isEnabled())return()=>{};this.eventListeners.has(e)||this.eventListeners.set(e,new Set);const a=this.eventListeners.get(e);return a?a.size>=ye.MAX_LISTENERS_PER_EVENT?(b.warn(g.WEBSOCKET,"Max listeners per event reached, rejecting",{type:e,max:ye.MAX_LISTENERS_PER_EVENT}),()=>{}):(a.add(t),()=>{this.removeEventListener(e,t)}):()=>{}}removeEventListener(e,t){const a=this.eventListeners.get(e);a&&a.delete(t)}getConfig(){return{enabled:this.isEnabled(),connectionStatus:this.getConnectionStatus(),reconnectAttempts:this.reconnectAttempts,maxReconnectDelay:this.maxReconnectDelay}}};const an=Lh.getInstance(),Ka=500,En="blocksight:range-response",Dh=1e4,Nh=10,Oh=200;function Mh(n,e,t=null){if(e.length===0)return"far";if(e.includes(n))return"near";if(t!==null)return Math.abs(n-t)<=Ka?"medium":"far";const a=Math.max(...e),s=Math.min(...e);return Math.min(Math.abs(n-a),Math.abs(n-s))<=Ka?"medium":"far"}function Hh(){return new Promise(n=>{const e=()=>{window.removeEventListener(En,e),n(!0)};window.addEventListener(En,e),setTimeout(()=>{window.removeEventListener(En,e),n(!1)},Dh)})}function Fh(){return new Promise(n=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>n())})})}function jh(n,e=3e3){return new Promise(t=>{const a=Date.now()+e,s=()=>{if(O.getState().raw.electrumServer.blockHeaders.some(o=>o.height===n)){t(!0);return}if(Date.now()>=a){t(!1);return}setTimeout(s,50)};s()})}async function Uh(n,e){return!(!an.isEnabled()||an.getConnectionStatus()!=="connected"||(an.send({type:"request_blocks_range",payload:{centerHeight:n,radius:50}}),!await Hh()||e.current))}async function Wh(n,e,t,a){for(let s=0;ssetTimeout(o,Oh))}return!1}async function zh(n,e,t,a){return!await Uh(n,a)||!await jh(n)||a.current||(await Fh(),a.current)?!1:Wh(t,n,e,a)}function Vh(n){const e=u.useRef(!1),t=u.useCallback(()=>{e.current=!0},[]);return{scrollToBlock:u.useCallback(async s=>{e.current=!1;const i=O.getState(),l=i.raw.electrumServer.blockHeaders.map(y=>y.height),m=i.raw.electrumServer.windowCenter??null,h=Mh(s,l,m);return b.debug(g.HOOK,"Smart scroll classified",{height:s,strategy:h,loadedCount:l.length}),h==="near"?n()?.scrollToBlockHeight(s,"smooth")??!1:zh(s,h==="medium"?"smooth":"instant",n,e)},[n]),cancel:t}}const li=u.createContext(null),qh=({children:n})=>{const e=u.useRef(null),t=u.useRef(null),a=u.useMemo(()=>({get current(){return t.current?.current?.getContainer()??null},set current(G){}}),[]),[s,i]=u.useState(!1),[o,l]=u.useState(!1),m=u.useCallback(G=>{e.current=G},[]),h=u.useCallback(G=>{t.current=G},[]),f=u.useCallback(()=>e.current?.current??null,[]),y=u.useCallback(()=>t.current?.current??null,[]),S=u.useCallback(()=>{const G=f();G&&G.scrollToBottom("smooth")},[f]),v=u.useCallback(()=>{const G=y();G&&G.scrollToIndex(0,"smooth")},[y]),E=u.useCallback(()=>{S(),v()},[S,v]),_=Vh(y),w=u.useCallback(async(G,ee="smooth")=>f()?.scrollToBlockHeight(G,ee)?!0:_.scrollToBlock(G),[f,_]),x=u.useCallback(async G=>w(G,"smooth"),[w]),D=u.useCallback((G,ee)=>{i(!ee)},[]),W=u.useCallback((G,ee)=>{l(!ee)},[]),q=u.useMemo(()=>({setMempoolRef:m,setBuiltRef:h,builtContainerRef:a,isTopScrollMoved:s,isBottomScrollMoved:o,onTopScroll:D,onBottomScroll:W,resetTopScroll:S,resetBottomScroll:v,resetAllScrolls:E,scrollToBlock:w,centerBlockInView:x}),[m,h,a,s,o,D,W,S,v,E,w,x]);return d.jsx(li.Provider,{value:q,children:n})},bn=()=>{const n=u.useContext(li);if(!n)throw new Error("useScrollContext must be used within ScrollProvider");return n},$h=()=>{const{resetAllScrolls:n,resetTopScroll:e,resetBottomScroll:t}=bn();return{resetAllScrolls:n,resetTopScroll:e,resetBottomScroll:t}},di=()=>{const{scrollToBlock:n,centerBlockInView:e}=bn();return{scrollToBlock:n,centerBlockInView:e}},ZS=()=>{const{setMempoolRef:n,setBuiltRef:e}=bn();return{setMempoolRef:n,setBuiltRef:e}},Gh=()=>{const{isTopScrollMoved:n,isBottomScrollMoved:e,onTopScroll:t,onBottomScroll:a}=bn();return{isTopScrollMoved:n,isBottomScrollMoved:e,isAnyScrollMoved:n||e,onTopScroll:t,onBottomScroll:a}},Za=2,Kh=10;function Zh(n,e,t=Date.now()){return{kind:"real",id:{hash:`memory-pool-${n+1}`,height:e+n+2},minedAtMs:t+(n+2)*60*1e3,txCount:1500+Math.floor(Math.random()*500),minFeeRate:5+n*2,maxFeeRate:100+n*20,medianFeeRate:15+n*3}}function Yh(){const n=Rh(),{selectBlock:e}=jm(),{scrollToBlock:t}=di(),a=n.height??null,s=u.useMemo(()=>{const S=n.blocks;return S&&S.length>0?S.map(Js).filter(v=>v!==null):[]},[n.blocks]),i=u.useMemo(()=>{const S=n.height??(s.length>0?s[0].id.height:924457);return Array.from({length:Kh},(v,E)=>Zh(E,S)).reverse()},[s,n.height]),o=u.useMemo(()=>s.slice(0,Za),[s]),l=u.useMemo(()=>s.slice(Za),[s]),m=u.useMemo(()=>[...i,...o,...l],[i,o,l]),h=u.useCallback(S=>o.some(v=>v.id.height===S)?"center":i.some(v=>v.id.height===S)?"mempool":l.some(v=>v.id.height===S)?"built":"not-found",[o,i,l]),f=u.useCallback(S=>{const v=m.find(_=>_.id.height===S);if(!v)return{success:!1,error:`Block #${S.toLocaleString()} not found in current view`,errorKey:"search.errors.blockNotFound"};const E=h(S);return e(v),E!=="center"&&t(S,"smooth"),{success:!0,block:v,section:E}},[m,h,e,t]),y=u.useCallback(S=>{const v=S.toLowerCase();if(v.startsWith("memory-pool-"))return{success:!1,error:"Mempool blocks cannot be searched by hash",errorKey:"search.errors.mempoolHashSearch"};const _=[...o,...l].find(x=>x.id.hash.toLowerCase()===v);if(!_)return{success:!1,error:"Block not found with this hash",errorKey:"search.errors.blockNotFoundByHash"};const w=h(_.id.height);return e(_),w!=="center"&&t(_.id.height,"smooth"),{success:!0,block:_,section:w}},[o,l,h,e,t]);return{selectBlockByHeight:f,selectBlockByHash:y,getBlockSection:h,tipHeight:a,availableBlocks:m}}function ui(n){const e="0123456789abcdef";let t="0000000000000000000",a=n+12345;for(let s=0;s<45;s++){a=a+1831565813|0;let i=Math.imul(a^a>>>15,1|a);i=i+Math.imul(i^i>>>7,61|i)^i;const l=((i^i>>>14)>>>0)%16;t+=e[l]}return t}const Ct={};for(let n=926450;n<=926549;n++)Ct[n]=ui(n);function Jh(n){const e=n*17%100,t=n*31%100,a=n*47%100,s=n*61%100,i=1800+Math.floor(e/100*2400),o=1+t/100*11,l=50+Math.floor(a/100*300),m=5+Math.floor(s/100*40);return{txCount:i,minFeeRate:Math.round(o*10)/10,maxFeeRate:l,medianFeeRate:m}}const Xh=(n,e)=>{const t=Date.now(),a=ui(n),s=Jh(n);return{kind:"real",id:{hash:a,height:n},minedAtMs:t-e*60*1e3,...s}},Qh=926549;function em(n,e){const t=[];for(let a=0;a({height:n.id.height,avgfeerate:n.medianFeeRate,timestamp:n.minedAtMs}));const ve=Date.now(),ke=n=>n*60*1e3,st={block926549:{tx1:"a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456"},block926548:{tx1:"d4e5f6789012345678901234567890abcdef1234567890abcdef1234567890"},block926547:{tx1:"f6789012345678901234567890abcdef1234567890abcdef123456789012"},block926546:{tx1:"012345678901234567890abcdef1234567890abcdef1234567890123456"},block926545:{tx1:"2345678901234567890abcdef1234567890abcdef123456789012345678"},pending:{tx1:"pending123456789abcdef1234567890abcdef1234567890abcdef12345",tx2:"pending234567890abcdef1234567890abcdef1234567890abcdef12346"}},ce={nativeSegwit1:"bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq",nativeSegwit2:"bc1qc7slrfxkknqcq2jevvvkdgvrt8080852dfjewde450xdlk4ugp7szw5tk9",nativeSegwit3:"bc1q9vza2e8x573nczrlzms0wvx3gsqjx7vavgkx0l",taproot1:"bc1p5d7rjq7g6rdk2yhzks9smlaqtedr4dekq08ge8ztwac72sfr9rusxg3297",taproot2:"bc1pqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs3wf0qm",legacy1:"1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2",legacy2:"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",segwit1:"3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy"},Mn={id:{txid:st.block926549.tx1},status:"confirmed",confirmations:1,blockHeight:926549,blockHash:Ct[926549],firstSeenMs:ve-ke(5),confirmedAtMs:ve-ke(3),feeSatoshis:15800,feeRate:28.5,fiatFeeUsd:15.67,fiatFeeCurrency:15.67,isRbf:!1,senderAddress:ce.nativeSegwit1,receiverAddress:ce.nativeSegwit2,inputCount:2,outputCount:2,totalInputValue:185e5,totalOutputValue:18484200},Hn={id:{txid:st.block926548.tx1},status:"confirmed",confirmations:2,blockHeight:926548,blockHash:Ct[926548],firstSeenMs:ve-ke(15),confirmedAtMs:ve-ke(12),feeSatoshis:9200,feeRate:18.4,fiatFeeUsd:9.12,fiatFeeCurrency:9.12,isRbf:!1,senderAddress:ce.nativeSegwit3,receiverAddress:ce.legacy1,inputCount:1,outputCount:2,totalInputValue:75e5,totalOutputValue:7490800},on={id:{txid:st.block926547.tx1},status:"confirmed",confirmations:3,blockHeight:926547,blockHash:Ct[926547],firstSeenMs:ve-ke(25),confirmedAtMs:ve-ke(21),feeSatoshis:42500,feeRate:65.2,fiatFeeUsd:42.15,fiatFeeCurrency:42.15,isRbf:!1,senderAddress:ce.taproot1,receiverAddress:ce.nativeSegwit1,inputCount:5,outputCount:3,totalInputValue:125e6,totalOutputValue:124957500},hi={id:{txid:st.block926546.tx1},status:"confirmed",confirmations:4,blockHeight:926546,blockHash:Ct[926546],firstSeenMs:ve-ke(38),confirmedAtMs:ve-ke(34),feeSatoshis:12300,feeRate:22.1,fiatFeeUsd:12.19,fiatFeeCurrency:12.19,isRbf:!1,senderAddress:ce.legacy1,receiverAddress:ce.taproot2,inputCount:2,outputCount:2,totalInputValue:35e6,totalOutputValue:34987700},mi={id:{txid:st.block926545.tx1},status:"confirmed",confirmations:5,blockHeight:926545,blockHash:Ct[926545],firstSeenMs:ve-ke(48),confirmedAtMs:ve-ke(42),feeSatoshis:8700,feeRate:15.8,fiatFeeUsd:8.63,fiatFeeCurrency:8.63,isRbf:!1,senderAddress:ce.segwit1,receiverAddress:ce.nativeSegwit3,inputCount:1,outputCount:2,totalInputValue:22e6,totalOutputValue:21991300},nm={id:{txid:st.pending.tx1},status:"pending",confirmations:0,blockHeight:null,blockHash:null,estimatedBlockHeight:926550,firstSeenMs:ve-ke(8),confirmedAtMs:null,feeSatoshis:11500,feeRate:21.2,fiatFeeUsd:11.4,fiatFeeCurrency:11.4,isRbf:!0,rbfHistory:{previousFee:7500,currentFee:11500,bumpCount:1},senderAddress:ce.nativeSegwit2,receiverAddress:ce.taproot1,inputCount:1,outputCount:2,totalInputValue:8e6,totalOutputValue:7988500},am={id:{txid:st.pending.tx2},status:"pending",confirmations:0,blockHeight:null,blockHash:null,estimatedBlockHeight:926550,firstSeenMs:ve-ke(2),confirmedAtMs:null,feeSatoshis:85e3,feeRate:125.5,fiatFeeUsd:84.32,fiatFeeCurrency:84.32,isRbf:!1,senderAddress:ce.taproot2,receiverAddress:ce.legacy2,inputCount:3,outputCount:1,totalInputValue:25e7,totalOutputValue:249915e3},sm={address:ce.nativeSegwit1,addressType:"native-segwit",balanceSatoshis:285e6,balanceFiatUsd:282150,balanceFiatCurrency:282150,pendingBalanceSatoshis:8e6,totalReceivedSatoshis:65e7,totalSentSatoshis:365e6,txCountTotal:58,txCountReceived:38,txCountConfirmedHistory:38,txCountSent:20,confirmedUtxoCount:5,pendingUtxoCount:1,latestTransaction:Mn,transactions:[Mn,on,mi],hasMoreTransactions:!0},im={address:ce.taproot1,addressType:"taproot",balanceSatoshis:124957500,balanceFiatUsd:123832.93,balanceFiatCurrency:123832.93,pendingBalanceSatoshis:0,totalReceivedSatoshis:25e7,totalSentSatoshis:125042500,txCountTotal:15,txCountReceived:10,txCountConfirmedHistory:10,txCountSent:5,confirmedUtxoCount:4,pendingUtxoCount:0,latestTransaction:on,transactions:[on],hasMoreTransactions:!0},rm={address:ce.legacy1,addressType:"legacy",balanceSatoshis:425e5,balanceFiatUsd:42117.5,balanceFiatCurrency:42117.5,pendingBalanceSatoshis:0,totalReceivedSatoshis:85e6,totalSentSatoshis:425e5,txCountTotal:12,txCountReceived:8,txCountConfirmedHistory:8,txCountSent:4,confirmedUtxoCount:2,pendingUtxoCount:0,latestTransaction:Hn,transactions:[Hn,hi],hasMoreTransactions:!1},om={address:"bc1qemptyaddress000000000000000000000000000",addressType:"native-segwit",balanceSatoshis:0,balanceFiatUsd:0,balanceFiatCurrency:0,pendingBalanceSatoshis:0,totalReceivedSatoshis:0,totalSentSatoshis:0,txCountTotal:0,txCountReceived:0,txCountConfirmedHistory:0,txCountSent:0,confirmedUtxoCount:0,pendingUtxoCount:0,latestTransaction:null,transactions:[],hasMoreTransactions:!1},cm=[Mn,Hn,on,hi,mi,nm,am],lm=[sm,im,rm,om];function dm(n){return cm.find(e=>e.id.txid===n)||null}function um(n){return lm.find(e=>e.address===n)||null}function hm(n){const e=O.getState().transformed?.market?.prices?.btc?.usd??0,a=n.balance/1e8*e;return{address:n.address,addressType:n.addressType,balanceSatoshis:n.balance,balanceFiatUsd:a,balanceFiatCurrency:a,pendingBalanceSatoshis:n.pendingBalance,totalReceivedSatoshis:n.totalReceived,totalSentSatoshis:n.totalSent,txCountTotal:n.txCount,txCountReceived:n.txCountReceived,txCountConfirmedHistory:n.txCountConfirmedHistory,txCountSent:n.txCountSent,confirmedUtxoCount:n.confirmedUtxoCount,pendingUtxoCount:n.pendingUtxoCount,latestTransaction:null,transactions:n.transactions.map(s=>({id:{txid:s.txid},status:s.status,isCoinbase:!1,confirmations:s.confirmations,blockHeight:s.blockHeight,blockHash:null,firstSeenMs:s.timestamp?s.timestamp*1e3:Date.now(),confirmedAtMs:s.timestamp?s.timestamp*1e3:null,feeSatoshis:s.feeSatoshis??0,feeRate:0,fiatFeeUsd:0,fiatFeeCurrency:0,isRbf:!1,senderAddress:"",receiverAddress:"",inputCount:0,outputCount:0,totalInputValue:0,totalOutputValue:s.amountSatoshis??0})),hasMoreTransactions:n.hasMoreTransactions}}function mm(){const n=na("useRealSearchData"),{selectTransaction:e}=Wm(),{selectAddress:t}=Fm(),{searchService:a,isBackendSearchEnabled:s}=ia(),i=u.useCallback(l=>{const m=l.toLowerCase();if(!n){const h=dm(m);return h?(e(h),{success:!0,transaction:h}):{success:!1,error:"Transaction not found",errorKey:"search.errors.transactionNotFound"}}return{success:!1,error:"Transaction not in cache",errorKey:"search.errors.transactionNotFound"}},[n,e]),o=u.useCallback(async l=>{if(!l||l==="Unknown"||l.length<26)return{success:!1,error:"Invalid address",errorKey:"search.errors.invalidAddress"};if(!n){const m=um(l);return m?(t(m),{success:!0,address:m}):{success:!1,error:"Address not found",errorKey:"search.errors.addressNotFound"}}if(!s)return{success:!1,error:"Search service unavailable",errorKey:"search.errors.serviceDisabled"};try{const m=await a.directSearch({type:"address",query:l,limit:1});if(m.length>0&&m[0].type==="address"){const h=hm(m[0]);return t(h),{success:!0,address:h}}return{success:!1,error:"Address not found",errorKey:"search.errors.addressNotFound"}}catch{return{success:!1,error:"Address search failed",errorKey:"search.errors.searchFailed"}}},[n,t,s,a]);return{selectTransactionByTxid:i,selectAddressByAddress:o}}const Cn=10;function YS(n,e){if(n<=0||e.length===0)return null;for(let s=0;s=i.minFeeRate&&n<=i.maxFeeRate){const o=s+1;return{blockPosition:o,estimatedMinutes:o*Cn}}}const t=e[0];if(n>=t.maxFeeRate)return{blockPosition:1,estimatedMinutes:Cn};const a=e[e.length-1];if(n<=a.minFeeRate){const s=e.length;return{blockPosition:s,estimatedMinutes:s*Cn}}return null}function pm(n,e){if(n<=0||e.length===0)return null;for(const s of e)if(n>=s.minFeeRate&&n<=s.maxFeeRate)return s.id.height;const t=e[e.length-1];if(n<=t.minFeeRate)return t.id.height;const a=e[0];return n>=a.maxFeeRate?a.id.height:null}const pi=u.createContext(null),fm=({children:n})=>{const e=u.useRef(new Map([["mempool",new Set],["built",new Set],["center",new Set]])),[t,a]=u.useState(0),s=u.useCallback(y=>{for(const S of e.current.values())if(S.has(y))return!0;return!1},[t]),i=u.useCallback((y,S)=>e.current.get(S)?.has(y)??!1,[t]),o=u.useCallback(()=>{const y=new Set;for(const S of e.current.values())for(const v of S)y.add(v);return Array.from(y).sort((S,v)=>v-S)},[t]),l=u.useCallback(y=>{const S=e.current.get(y);return S?Array.from(S).sort((v,E)=>E-v):[]},[t]),m=u.useCallback((y,S)=>{const v=e.current.get(S);v&&!v.has(y)&&(v.add(y),a(E=>E+1))},[]),h=u.useCallback((y,S)=>{const v=e.current.get(S);v?.has(y)&&(v.delete(y),a(E=>E+1))},[]),f=u.useMemo(()=>({isBlockVisible:s,isBlockVisibleInSection:i,getVisibleBlockHeights:o,getVisibleBlockHeightsInSection:l,markBlockVisible:m,markBlockHidden:h}),[s,i,o,l,m,h]);return d.jsx(pi.Provider,{value:f,children:n})},fi=()=>{const n=u.useContext(pi);if(!n)throw new Error("useVisibility must be used within VisibilityProvider");return n},JS=()=>{const{isBlockVisible:n,isBlockVisibleInSection:e,getVisibleBlockHeights:t}=fi();return{isBlockVisible:n,isBlockVisibleInSection:e,getVisibleBlockHeights:t}},XS=()=>{const{markBlockVisible:n,markBlockHidden:e}=fi();return{markBlockVisible:n,markBlockHidden:e}},gm=1e4,bm=100;function ym(){const[n,e]=u.useState(null),[t,a]=u.useState(0),s=u.useRef(null),i=u.useCallback(()=>{e(Date.now())},[]),o=u.useCallback(()=>{e(null),a(0),s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return u.useEffect(()=>{if(s.current!==null&&(window.clearInterval(s.current),s.current=null),n===null){a(0);return}const m=()=>{const h=Date.now()-n,f=Math.max(0,gm-h),y=Math.ceil(f/1e3);a(y),f<=0&&s.current!==null&&(window.clearInterval(s.current),s.current=null)};return m(),s.current=window.setInterval(m,bm),()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)}},[n]),{canSearch:t===0,cooldownRemaining:t,recordSearch:i,reset:o}}const vm=8,km=9,gi=64,yn={numericOnly:/^\d+$/,hash64:/^[a-fA-F0-9]{64}$/,addressPrefix:/^(1|3|bc1)/i};function bi(n){return!n||n.length===0||n.length>km?!1:yn.numericOnly.test(n)}function Sm(n){return!n||n.length!==gi?!1:yn.hash64.test(n)}function QS(n){return!n||n.length!==gi?!1:yn.hash64.test(n)}function wm(n){return!n||n.length<26||n.length>62?!1:yn.addressPrefix.test(n)}function _m(n){if(!bi(n))return null;const e=parseInt(n,10);return Number.isNaN(e)||!Number.isFinite(e)||e<0?null:e}function yi(n){if(!n||n.trim().length===0)return"invalid";const e=n.trim();return bi(e)?"blockHeight":Sm(e)?"blockHash":/^[0-9a-fA-F]{8,63}$/.test(e)?"txid":wm(e)?"address":"invalid"}function vi(n,e){const t=n,a=n.trim();if(!a||a.length===0)return{type:"invalid",isValid:!1,value:"",rawInput:t,errorKey:"search.errors.emptyQuery"};const s=yi(a);if(s==="invalid")return{type:"invalid",isValid:!1,value:a,rawInput:t,errorKey:"search.errors.invalidBlockHeight"};if(s==="blockHeight"){const i=_m(a);if(i===null)return{type:"blockHeight",isValid:!1,value:a,rawInput:t,errorKey:"search.errors.invalidBlockHeight"};if(e!==void 0){const o=e+vm;if(i>o)return{type:"blockHeight",isValid:!1,value:i,rawInput:t,errorKey:"search.errors.blockOutOfRange",errorParams:{maxHeight:o}}}return{type:"blockHeight",isValid:!0,value:i,rawInput:t}}return s==="blockHash"?{type:"blockHash",isValid:!0,value:a.toLowerCase(),rawInput:t}:s==="txid"?{type:"txid",isValid:!0,value:a.toLowerCase(),rawInput:t}:s==="address"?{type:"address",isValid:!0,value:a,rawInput:t}:{type:"invalid",isValid:!1,value:a,rawInput:t,errorKey:"search.errors.invalidBlockHeight"}}function ew(n,e){return vi(n,e)}const Tm=5e3;async function Yt(n,e={}){const{timeout:t,...a}=e,s=t??Tm,i=Ws(),o=performance.now(),l=new AbortController,m=setTimeout(()=>l.abort(),s),h={...e.headers,"X-Correlation-ID":i};b.debug(g.API,`API Request: ${e.method||"GET"} ${n}`,{correlationId:i,url:n,method:e.method||"GET"});try{const f=await fetch(n,{...a,headers:h,signal:l.signal});clearTimeout(m);const y=performance.now()-o;if(!f.ok){f.status===404?b.debug(g.API,`API Not Found: ${f.status} ${f.statusText}`,{correlationId:i,url:n,status:f.status,duration:y}):b.error(g.API,`API Error: ${f.status} ${f.statusText}`,{correlationId:i,url:n,status:f.status,statusText:f.statusText,duration:y});const v=new Error(`API error: ${f.status} ${f.statusText}`);throw v.status=f.status,v}const S=await f.json();return b.info(g.API,`API Success: ${e.method||"GET"} ${n}`,{correlationId:i,url:n,status:f.status,duration:y}),S}catch(f){clearTimeout(m);const y=performance.now()-o;throw f instanceof Error&&"status"in f||b.error(g.API,`API Exception: ${n}`,{correlationId:i,url:n,error:f instanceof Error?f.message:String(f),duration:y}),f}}function Ya(n){return{type:"block",height:n.height,hash:n.hash,timestamp:n.timestamp,txCount:n.txCount,minFeeRate:n.minFee,medianFeeRate:n.medianFee,maxFeeRate:n.maxFee,totalFeesSatoshis:n.totalFeesSatoshis,subsidySatoshis:n.subsidySatoshis,miner:n.miner}}function Ja(n){const e=n.isCoinbase??!1,t=e?"Coinbase":Em(n.inputs),a=Cm(n.outputs,n.heuristics);return{type:"transaction",txid:n.txid,status:n.status,isCoinbase:e,blockHeight:n.blockHeight??null,blockHash:n.blockHash??null,confirmations:n.confirmations,value:n.totalOutputSatoshis,fee:n.feeSatoshis,feeRate:n.feeRate,timestamp:n.timestamp,size:n.size,vsize:n.vsize,isRbf:n.isRbf,senderAddress:t,receiverAddress:a,inputCount:n.inputs?.length??0,outputCount:n.outputs?.length??0,totalInputSatoshis:n.totalInputSatoshis,heuristics:n.heuristics?{pattern:n.heuristics.pattern,receiverType:xm(n.heuristics.outputs)?.type??"unknown",confidence:n.heuristics.overallConfidence}:void 0}}function Fn(n){return!n||n.length<20?!1:!!(/^[13][1-9A-HJ-NP-Za-km-z]{24,33}$/.test(n)||/^bc1[a-z0-9]{38,85}$/.test(n)||/^[mn2][1-9A-HJ-NP-Za-km-z]{24,33}$/.test(n)||/^tb1[a-z0-9]{38,85}$/.test(n))}function Em(n){if(!n||n.length===0||n[0].txid==="0000000000000000000000000000000000000000000000000000000000000000")return"Coinbase";const e=n[0].address;return e?Fn(e)?e:"Non-standard output":"Unknown"}function Cm(n,e){if(!n||n.length===0)return"Unknown";if(e?.outputs){const a=e.outputs.find(s=>s.type==="payment");if(a&&n[a.index]){const s=n[a.index].address;if(s&&Fn(s))return s}}return n.find(a=>Fn(a.address))?.address??"Unknown"}function xm(n){return n.find(e=>e.type==="payment")??n[0]}function Xa(n){const e=n.totalTransactionCount!=null&&n.totalTransactionCount>=0?n.totalTransactionCount:n.txCountReceived>=0?n.txCountReceived:-1;return{type:"address",address:n.address,addressType:n.addressType,balance:n.balanceSatoshis,pendingBalance:n.pendingBalanceSatoshis,txCount:e,txCountReceived:n.txCountReceived,txCountConfirmedHistory:n.txCountConfirmedHistory,txCountSent:n.txCountSent,confirmedUtxoCount:n.confirmedUtxoCount,pendingUtxoCount:n.pendingUtxoCount,totalReceived:n.totalReceivedSatoshis,totalSent:n.totalSentSatoshis,transactions:(n.transactions??[]).map(t=>({txid:t.txid,status:t.status,timestamp:t.timestamp,blockHeight:t.blockHeight??null,confirmations:t.confirmations,amountSatoshis:t.amountSatoshis,balanceChangeSatoshis:t.balanceChangeSatoshis,feeSatoshis:t.feeSatoshis,type:t.type})),hasMoreTransactions:n.hasMoreTransactions??!1}}class ki{BASE_PATH="/api/v1/explorer";async search(e){b.info(g.REPOSITORY,"Searching via Explorer API",{type:e.type,query:e.query,limit:e.limit});try{const t=await this.executeSearch(e);return t?(b.debug(g.REPOSITORY,"Search result received",{type:t.type,query:e.query}),[t]):[]}catch(t){return this.handleError(t,e)}}async executeSearch(e){switch(e.type){case"block":return this.searchBlock(e.query);case"transaction":return this.searchTransaction(e.query);case"address":return this.searchAddress(e.query);default:return this.searchUniversal(e.query)}}async searchUniversal(e){const t=await Yt(`${this.BASE_PATH}/search?q=${encodeURIComponent(e)}`,{method:"GET",timeout:15e3});if(!t.success||t.type==="unknown")return null;switch(t.type){case"block":return Ya(t.data);case"transaction":return Ja(t.data);case"address":return Xa(t.data);default:return null}}async searchBlock(e){const t=await Yt(`${this.BASE_PATH}/block/${encodeURIComponent(e)}`,{method:"GET",timeout:15e3});return!t.success||!t.data?null:Ya(t.data)}async searchTransaction(e){const t=await Yt(`${this.BASE_PATH}/transaction/${encodeURIComponent(e)}`,{method:"GET",timeout:15e3});return!t.success||!t.data?null:Ja(t.data)}async searchAddress(e){const t=await Yt(`${this.BASE_PATH}/address/${encodeURIComponent(e)}`,{method:"GET",timeout:15e3});return!t.success||!t.data?null:Xa(t.data)}handleError(e,t){const a=e;if(a.status===503||e instanceof Error&&e.message.includes("503")){const s=new Error("Explorer service is currently unavailable. Please try again later.");throw s.name="ServiceDisabled",b.warn(g.REPOSITORY,"Explorer service disabled",{type:t.type,query:t.query,reason:"Backend returned 503 Service Unavailable"}),s}return a.status===404||e instanceof Error&&e.message.includes("404")?(b.debug(g.REPOSITORY,"Search returned no results",{type:t.type,query:t.query}),[]):(b.error(g.REPOSITORY,"Search failed",{type:t.type,query:t.query,error:e instanceof Error?e.message:String(e)}),[])}}var ie=(n=>(n.CLOSED="CLOSED",n.OPEN="OPEN",n.HALF_OPEN="HALF_OPEN",n))(ie||{});const Am={timeout:5e3,errorThresholdPercentage:50,resetTimeout:3e4,rollingCountTimeout:1e4,volumeThreshold:5};class Bm extends Error{constructor(e="Circuit breaker is open"){super(e),this.name="CircuitOpenError"}}class Rm extends Error{constructor(e="Circuit breaker timeout"){super(e),this.name="CircuitTimeoutError"}}class Im{fn;config;_state=ie.CLOSED;_fallbackFn=null;_successes=0;_failures=0;_rejects=0;_timeouts=0;_lastFailureTime=0;_rollingWindow=[];_events=new Map;_resetTimerId=null;constructor(e,t){this.fn=e,this.config={...Am,...t}}async fire(...e){if(this.checkResetTimeout(),this._state===ie.OPEN){if(this._rejects++,this.emit("reject"),this._fallbackFn)return this._fallbackFn(...e);throw new Bm}try{const t=await this.executeWithTimeout(e);return this.recordSuccess(),this._state===ie.HALF_OPEN&&this.transitionTo(ie.CLOSED),t}catch(t){throw this.recordFailure(),this._state===ie.HALF_OPEN?this.transitionTo(ie.OPEN):this.checkShouldOpen(),t}}fallback(e){return this._fallbackFn=e,this}getState(){return this.checkResetTimeout(),this._state}getStats(){this.checkResetTimeout();const e=this._successes+this._failures;return{successes:this._successes,failures:this._failures,rejects:this._rejects,timeouts:this._timeouts,errorPercentage:e>0?this._failures/e*100:0,state:this._state}}on(e,t){return this._events.has(e)||this._events.set(e,new Set),this._events.get(e)?.add(t),this}off(e,t){return this._events.get(e)?.delete(t),this}open(){this.transitionTo(ie.OPEN)}close(){this.transitionTo(ie.CLOSED)}reset(){this._successes=0,this._failures=0,this._rejects=0,this._timeouts=0,this._rollingWindow=[],this._lastFailureTime=0,this.clearResetTimer(),this._state=ie.CLOSED}dispose(){this.clearResetTimer(),this._events.clear(),this.reset()}async executeWithTimeout(e){return new Promise((t,a)=>{const s=setTimeout(()=>{this._timeouts++,this.emit("timeout"),a(new Rm)},this.config.timeout);this.fn(...e).then(i=>{clearTimeout(s),t(i)}).catch(i=>{clearTimeout(s),a(i)})})}recordSuccess(){this._successes++,this._rollingWindow.push({time:Date.now(),success:!0}),this.pruneRollingWindow(),this.emit("success")}recordFailure(){this._failures++,this._lastFailureTime=Date.now(),this._rollingWindow.push({time:Date.now(),success:!1}),this.pruneRollingWindow(),this.emit("failure")}checkShouldOpen(){if(this._state!==ie.CLOSED||this._rollingWindow.length!a.success).length/this._rollingWindow.length*100>=this.config.errorThresholdPercentage&&this.transitionTo(ie.OPEN)}checkResetTimeout(){if(this._state!==ie.OPEN)return;Date.now()-this._lastFailureTime>=this.config.resetTimeout&&this.transitionTo(ie.HALF_OPEN)}transitionTo(e){const t=this._state;this._state=e,e===ie.OPEN?(this._lastFailureTime=Date.now(),this.emit("open")):e===ie.CLOSED&&t!==ie.CLOSED?this.emit("close"):e===ie.HALF_OPEN&&this.emit("halfOpen")}pruneRollingWindow(){const e=Date.now()-this.config.rollingCountTimeout;this._rollingWindow=this._rollingWindow.filter(t=>t.time>=e)}clearResetTimer(){this._resetTimerId!==null&&(clearTimeout(this._resetTimerId),this._resetTimerId=null)}emit(e){const t=this._events.get(e);if(t)for(const a of t)a()}}const Re=new Map,Pm={createBreaker(n,e,t){const a=Re.get(n);if(a)return a;const s=new Im(e,t);return Re.set(n,s),s},getBreaker(n){return Re.get(n)},hasBreaker(n){return Re.has(n)},disposeBreaker(n){const e=Re.get(n);e&&(e.dispose(),Re.delete(n))},disposeAll(){for(const n of Re.values())n.dispose();Re.clear()},getKeys(){return[...Re.keys()]},getStats(){const n={};for(const[e,t]of Re)n[e]=t.getStats();return n}},Jt="search-api",Lm=100,Dm={timeout:15e3,errorThresholdPercentage:50,resetTimeout:3e4,rollingCountTimeout:1e4,volumeThreshold:3};class Si{baseRepository;circuitBreaker;fallbackCache=new Map;constructor(e){this.baseRepository=e??new ki,this.circuitBreaker=Pm.createBreaker(Jt,async(...t)=>{const a=t[0];return this.baseRepository.search(a)},Dm),this.circuitBreaker.on("open",()=>{b.warn(g.SERVICE,"Search circuit breaker OPENED",{breakerKey:Jt})}),this.circuitBreaker.on("close",()=>{b.info(g.SERVICE,"Search circuit breaker CLOSED",{breakerKey:Jt})}),this.circuitBreaker.on("halfOpen",()=>{b.info(g.SERVICE,"Search circuit breaker HALF-OPEN",{breakerKey:Jt})}),b.info(g.SERVICE,"SearchRepositoryWithCircuitBreaker initialized")}async search(e){const t=`${e.type}:${e.query}`;try{const a=await this.circuitBreaker.fire(e);if(a.length>0){if(this.fallbackCache.size>=Lm){const s=this.fallbackCache.keys().next().value;s!==void 0&&this.fallbackCache.delete(s)}this.fallbackCache.set(t,a)}return a}catch(a){b.warn(g.SERVICE,"Search circuit breaker caught error",{query:e.query,error:a instanceof Error?a.message:String(a),isCircuitOpen:this.isCircuitOpen()});const s=this.fallbackCache.get(t);return s?(b.info(g.SERVICE,"Returning cached results due to circuit breaker"),s):[]}}isCircuitOpen(){return this.circuitBreaker.getState()===ie.OPEN}getCircuitState(){return this.circuitBreaker.getState()}getCircuitStats(){return this.circuitBreaker.getStats()}resetCircuit(){this.circuitBreaker.reset(),b.info(g.SERVICE,"Search circuit breaker manually reset")}}const Nm="blocksight_frontend_search_latency_seconds";class wi{constructor(e){this.searchRepository=e,b.info(g.SERVICE,"SearchService initialized")}cache=new Map;cacheTTL=3e5;maxCacheSize=100;debounceTimer=null;pendingQuery=null;pendingResolve=null;pendingReject=null;searchStartTime=null;debounceStartTime=null;searchLatencyHistogram=X.histogram(Nm,"Search latency by stage",[.05,.1,.25,.5,1,2,5],["stage"]);async debouncedSearch(e){this.searchStartTime=performance.now(),this.debounceStartTime=performance.now();const t=`${e.type}:${e.query}`,a=this.getCachedResults(t);if(a){b.debug(g.SERVICE,"Search cache hit",{query:e.query});const s=(performance.now()-this.searchStartTime)/1e3;return this.searchLatencyHistogram.observe(s,{stage:"total"}),a}return this.cancelPendingSearch(),new Promise((s,i)=>{this.pendingQuery=e,this.pendingResolve=s,this.pendingReject=i,this.debounceTimer=setTimeout(()=>{if(this.debounceStartTime){const o=(performance.now()-this.debounceStartTime)/1e3;this.searchLatencyHistogram.observe(o,{stage:"debounce"})}this.debounceTimer=null,this.executePendingSearch()},300)})}async directSearch(e){const t=performance.now(),a=`${e.type}:${e.query}`,s=this.getCachedResults(a);if(s){b.debug(g.SERVICE,"Direct search cache hit",{query:e.query});const f=(performance.now()-t)/1e3;return this.searchLatencyHistogram.observe(f,{stage:"total"}),s}const i=performance.now(),o=await this.searchRepository.search(e),l=(performance.now()-i)/1e3;this.searchLatencyHistogram.observe(l,{stage:"api"});const m=this.processResults(o);this.setCache(a,m);const h=(performance.now()-t)/1e3;return this.searchLatencyHistogram.observe(h,{stage:"total"}),m}cancelPendingSearch(){if(this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null,this.pendingReject)){const e=this.pendingReject;this.clearPendingState(),e(new Error("Search cancelled"))}}async executePendingSearch(){if(!this.pendingQuery){this.pendingReject&&this.pendingReject(new Error("No query pending")),this.clearPendingState();return}const e=this.pendingQuery,t=this.pendingResolve,a=this.pendingReject;try{const s=performance.now(),i=await this.searchRepository.search(e),o=(performance.now()-s)/1e3;this.searchLatencyHistogram.observe(o,{stage:"api"});const l=this.processResults(i);if(this.setCache(`${e.type}:${e.query}`,l),this.searchStartTime){const m=(performance.now()-this.searchStartTime)/1e3;this.searchLatencyHistogram.observe(m,{stage:"total"})}t&&t(l)}catch(s){b.error(g.SERVICE,"Debounced search failed",{query:e.query,error:s instanceof Error?s.message:String(s)}),a&&a(s instanceof Error?s:new Error(String(s)))}finally{this.searchStartTime=null,this.debounceStartTime=null,this.clearPendingState()}}clearPendingState(){this.pendingQuery=null,this.pendingResolve=null,this.pendingReject=null}getCachedResults(e){const t=this.cache.get(e);return t?Date.now()-t.timestamp>this.cacheTTL?(this.cache.delete(e),null):t.results:null}validateQuery(e){const t=e.trim();if(t.length===0)return{valid:!1,type:"all"};const a=yi(t),s={blockHeight:"all",blockHash:"block",txid:"transaction",address:"address"};return a==="invalid"?{valid:!1,type:"all"}:{valid:!0,type:s[a]??"all"}}processResults(e){return e.filter(a=>a.type==="block"?a.height>=0&&a.hash.length>0:a.type==="transaction"?a.txid.length>0&&(a.blockHeight===null||a.blockHeight>=0):a.type==="address"?a.address.length>0&&a.txCount>=0:!1).sort((a,s)=>a.type==="block"&&s.type==="block"?s.height-a.height:a.type==="transaction"&&s.type==="transaction"?s.value-a.value:a.type==="address"&&s.type==="address"?s.balance-a.balance:0)}clearCache(){b.info(g.SERVICE,"Clearing search cache",{entriesCleared:this.cache.size}),this.cache.clear()}setCache(e,t){if(this.cache.size>=this.maxCacheSize){const a=this.cache.keys().next().value;a!==void 0&&this.cache.delete(a)}this.cache.set(e,{results:t,timestamp:Date.now()}),b.debug(g.SERVICE,"Search results cached",{query:e,resultCount:t.length,cacheSize:this.cache.size})}}const Om=[/)<[^<]*)*<\/script>/gi,/<[^>]+>/g,/javascript:/gi,/on\w+=/gi,/</gi,/>/gi,/&#/gi];function Mm(n){let e=n.trim();for(const t of Om)e=e.replace(t,"");return e=e.replace(/\0/g,""),e}const Qa={isActive:!1,query:"",isLoading:!1,hasError:!1,resultsCount:0},_i=u.createContext(null),Hm=({children:n})=>{const[e,t]=u.useState(Qa),a=na("useBackendSearch"),s=u.useMemo(()=>{const f=new ki,y=new Si(f),S=new wi(y);return b.info(g.SERVICE,"SearchContext initialized",{backendSearchEnabled:a}),{searchRepository:y,searchService:S,isBackendSearchEnabled:a}},[a]),i=u.useCallback(f=>{const y=Mm(f);y.trim()&&t({isActive:!0,query:y,isLoading:!0,hasError:!1,resultsCount:0})},[]),o=u.useCallback(f=>{t(y=>({...y,isLoading:!1,resultsCount:f}))},[]),l=u.useCallback((f,y)=>{t(S=>({...S,isLoading:!1,hasError:f}))},[]),m=u.useCallback(()=>{t(Qa)},[]),h={...e,startSearch:i,setSearchResults:o,setSearchError:l,closeSearch:m,...s};return d.jsx(_i.Provider,{value:h,children:n})},ia=()=>{const n=u.useContext(_i);if(!n)throw new Error("useSearch must be used within SearchProvider");return n},Fm=()=>{const{selectAddress:n,clearSelection:e,mode:t,selectedAddress:a}=je();return{selectAddress:n,clearSelection:e,isAddressSelected:t==="address",selectedAddress:a}},jm=()=>{const{selectBlock:n,clearSelection:e,mode:t,selectedBlock:a}=je();return{selectBlock:n,clearSelection:e,isBlockSelected:t==="block",selectedBlock:a}},Um=()=>{const{openDocument:n,closePanel:e,mode:t,documentType:a}=je();return{openDocument:n,closePanel:e,isDocumentOpen:t==="document",currentDocument:a}},Wm=()=>{const{selectTransaction:n,clearSelection:e,mode:t,selectedTransaction:a}=je();return{selectTransaction:n,clearSelection:e,isTransactionSelected:t==="transaction",selectedTransaction:a}},ra=u.createContext(null),zm=({children:n})=>{const e=gl(),t=ea(),a=ia(),s=ed(),i=pl();Xl();const o=u.useRef("idle"),l=u.useMemo(()=>e.isOpen?"document":a.isActive?"search":t.entityType!=="none"?t.entityType:"idle",[e.isOpen,a.isActive,t.entityType]);u.useEffect(()=>{o.current!==l&&(i.trackModeChange(o.current,l),o.current=l)},[l,i]);const m=u.useCallback((w,x)=>{t.clearSelection(),a.closeSearch(),s.clear(),e.openDocument(w,x)},[e,t,a,s]),h=u.useCallback(w=>{xn(t,s),e.closeDocument(),a.closeSearch(),t.selectBlock(w)},[e,t,a,s]),f=u.useCallback(w=>{xn(t,s),e.closeDocument(),a.closeSearch(),t.selectTransaction(w)},[e,t,a,s]),y=u.useCallback(w=>{xn(t,s),e.closeDocument(),a.closeSearch(),t.selectAddress(w)},[e,t,a,s]),S=u.useCallback(w=>{e.closeDocument(),t.clearSelection(),s.clear(),a.startSearch(w)},[e,t,a,s]),v=u.useCallback(()=>{const w=s.pop();if(w)switch(w.type){case"block":Vm(t,w);break;case"transaction":qm(t,w);break;case"address":$m(t,w);break}},[s,t]),E=u.useCallback(()=>{e.closeDocument(),t.clearSelection(),a.closeSearch(),s.clear()},[e,t,a,s]),_=u.useMemo(()=>({mode:l,documentType:e.documentType,documentInitialTab:e.initialTab,selectedBlock:t.selectedBlock,selectedTransaction:t.selectedTransaction,selectedAddress:t.selectedAddress,highlightedBlockHeight:t.highlightedBlockHeight,highlightedMempoolTxid:t.highlightedMempoolTxid,mempoolSlotIndex:t.mempoolSlotIndex,isDroppedFromMempool:t.isDroppedFromMempool,dropReason:t.dropReason,replacementTxid:t.replacementTxid,searchQuery:a.query,isSearchLoading:a.isLoading,hasSearchError:a.hasError,searchResultsCount:a.resultsCount,navigationStack:s.stack,canGoBack:s.canGoBack,openDocument:m,selectBlock:h,selectTransaction:f,selectAddress:y,highlightBlock:t.highlightBlock,clearHighlight:t.clearHighlight,clearSelection:t.clearSelection,setMempoolTxPosition:t.setMempoolTxPosition,setMempoolTxDropped:t.setMempoolTxDropped,startSearch:S,setSearchResults:a.setSearchResults,setSearchError:a.setSearchError,goBack:v,closePanel:E,reset:E}),[l,e.documentType,e.initialTab,t.selectedBlock,t.selectedTransaction,t.selectedAddress,t.highlightedBlockHeight,t.highlightedMempoolTxid,t.mempoolSlotIndex,t.isDroppedFromMempool,t.dropReason,t.replacementTxid,a.query,a.isLoading,a.hasError,a.resultsCount,s.stack,s.canGoBack,m,h,f,y,t.highlightBlock,t.clearHighlight,t.clearSelection,t.setMempoolTxPosition,t.setMempoolTxDropped,S,a.setSearchResults,a.setSearchError,v,E]);return d.jsx(ra.Provider,{value:_,children:n})};function Vm(n,e){n.selectBlock(e.data),e.highlightedBlockHeight!==null&&n.highlightBlock(e.highlightedBlockHeight)}function qm(n,e){n.selectTransaction(e.data),e.highlightedBlockHeight!==null&&n.highlightBlock(e.highlightedBlockHeight),e.highlightedMempoolTxid!==null&&(n.setMempoolTxPosition({txid:e.highlightedMempoolTxid,slotIndex:e.mempoolSlotIndex,projectedHeight:null}),e.isDroppedFromMempool&&e.dropReason!==null&&n.setMempoolTxDropped({txid:e.highlightedMempoolTxid,reason:e.dropReason,replacementTxid:e.replacementTxid}))}function $m(n,e){n.selectAddress(e.data),e.highlightedBlockHeight!==null&&n.highlightBlock(e.highlightedBlockHeight)}function xn(n,e){n.entityType==="block"&&n.selectedBlock?e.push({type:"block",data:n.selectedBlock,highlightedBlockHeight:n.highlightedBlockHeight}):n.entityType==="transaction"&&n.selectedTransaction?e.push({type:"transaction",data:n.selectedTransaction,highlightedBlockHeight:n.highlightedBlockHeight,highlightedMempoolTxid:n.highlightedMempoolTxid,mempoolSlotIndex:n.mempoolSlotIndex,isDroppedFromMempool:n.isDroppedFromMempool,dropReason:n.dropReason,replacementTxid:n.replacementTxid}):n.entityType==="address"&&n.selectedAddress&&e.push({type:"address",data:n.selectedAddress,highlightedBlockHeight:n.highlightedBlockHeight})}const je=()=>{const n=u.useContext(ra);if(!n)throw new Error("useInfoPanel must be used within InfoPanelProvider");return n},tw=()=>u.useContext(ra),Gm="_cubes_rdcpv_26",Km="_loop_rdcpv_44",Zm="_item_rdcpv_61",An={cubes:Gm,loop:Km,item:Zm},Ym=["mempool-far","mempool-near","next-upper","next-center","last-block","historical"],Jm=n=>n<=3?"top":"bottom",Xm=n=>n<=2?"orange":n<=4?"red":"purple",J=({className:n,ariaLabel:e="Loading blockchain data"})=>d.jsx("output",{className:`${An.cubes} ${n||""}`.trim(),"aria-label":e,"aria-live":"polite","data-testid":"loading-blocks",children:d.jsx("div",{className:An.loop,children:Ym.map((t,a)=>{const s=a+1;return d.jsx("div",{className:An.item,"aria-hidden":"true","data-cube-number":s,"data-cube-position":Jm(s),"data-cube-color":Xm(s),title:`Cube ${s}`},t)})})}),Qm="_bottomNav_1srgy_33",ep="_tabList_1srgy_91",tp="_tab_1srgy_91",np="_tabActive_1srgy_219",ap="_tabIcon_1srgy_243",sp="_tabLabel_1srgy_261",lt={bottomNav:Qm,tabList:ep,tab:tp,tabActive:np,tabIcon:ap,tabLabel:sp};u.memo(function({activeTab:e,onTabChange:t,className:a}){const{t:s}=le(),i=[{id:"home",labelKey:"mobileNav.home",icon:"🏠"},{id:"data",labelKey:"mobileNav.data",icon:"📊"},{id:"search",labelKey:"mobileNav.search",icon:"🔍"},{id:"settings",labelKey:"mobileNav.settings",icon:"⚙️"}];return d.jsx("nav",{className:`${lt.bottomNav} ${a||""}`,"aria-label":s("header.navigation"),children:d.jsx("div",{className:lt.tabList,role:"tablist",children:i.map(o=>d.jsxs("button",{role:"tab",type:"button","aria-selected":e===o.id,"aria-controls":`panel-${o.id}`,className:`${lt.tab} ${e===o.id?lt.tabActive:""}`,onClick:()=>t(o.id),children:[d.jsx("span",{className:lt.tabIcon,"aria-hidden":"true",children:o.icon}),d.jsx("span",{className:lt.tabLabel,children:s(o.labelKey)})]},o.id))})})});const ip="_drawerContainer_5hbtn_31",rp="_backdrop_5hbtn_53",op="_drawer_5hbtn_31",cp="_positionLeft_5hbtn_103",lp="_positionRight_5hbtn_117",dp="_header_5hbtn_137",up="_title_5hbtn_155",hp="_closeButton_5hbtn_177",mp="_content_5hbtn_263",Oe={drawerContainer:ip,backdrop:rp,drawer:op,positionLeft:cp,positionRight:lp,header:dp,title:up,closeButton:hp,content:mp};u.memo(function({isOpen:e,onClose:t,children:a,title:s,className:i}){const{t:o}=le(),l=ou(),m=u.useRef(null),h=u.useCallback(y=>{y.key==="Escape"&&e&&t()},[e,t]);if(u.useEffect(()=>(e?(document.body.style.overflow="hidden",document.addEventListener("keydown",h)):document.body.style.overflow="",()=>{document.body.style.overflow="",document.removeEventListener("keydown",h)}),[e,h]),u.useEffect(()=>{e&&m.current&&m.current.focus()},[e]),!e)return null;const f=l==="right"?Oe.positionRight:Oe.positionLeft;return Ms.createPortal(d.jsxs("div",{className:Oe.drawerContainer,role:"presentation",children:[d.jsx("div",{className:Oe.backdrop,onClick:t,"aria-hidden":"true"}),d.jsxs("div",{ref:m,className:`${Oe.drawer} ${f} ${i||""}`,role:"dialog","aria-modal":"true","aria-label":s||o("mobileNav.openDrawer"),tabIndex:-1,children:[d.jsxs("div",{className:Oe.header,children:[s&&d.jsx("h2",{className:Oe.title,children:s}),d.jsx("button",{type:"button",className:Oe.closeButton,onClick:t,"aria-label":o("mobileNav.closeDrawer"),children:d.jsx("span",{"aria-hidden":"true",children:"×"})})]}),d.jsx("div",{className:Oe.content,children:a})]})]}),document.body)});const pp="_footer_aedv6_6",fp={footer:pp},Ti=()=>{const{mode:n}=je();return n!=="idle"?null:d.jsx("footer",{className:fp.footer,"data-testid":"footer-copyright",children:"© 2026 Blocksight OÜ. All rights reserved."})};Ti.displayName="FooterCopyright";const gp="/images/logo-complete-2x-CyZiMERj.png",bp="/images/logo-icon-only-CJFcFyzp.png",yp="_wrapper_7zjjx_3",vp="_grid_7zjjx_7",kp="_item_7zjjx_24",Sp="_itemActive_7zjjx_49",wp="_itemUnavailable_7zjjx_54",_p="_checkmark_7zjjx_59",Tp="_rtlText_7zjjx_66",Je={wrapper:yp,grid:vp,item:kp,itemActive:Sp,itemUnavailable:wp,checkmark:_p,rtlText:Tp},Ep=su();function Ei({isOpen:n,onToggle:e,onClose:t,trigger:a}){const{i18n:s}=le(),i=u.useRef(null);u.useEffect(()=>{if(!n)return;const l=h=>{h.key==="Escape"&&(t(),i.current?.querySelector('[data-testid="language-grid-trigger"]')?.focus())},m=h=>{i.current&&!i.current.contains(h.target)&&t()};return document.addEventListener("keydown",l),document.addEventListener("click",m),()=>{document.removeEventListener("keydown",l),document.removeEventListener("click",m)}},[n,t]);const o=u.useCallback((l,m)=>{m&&iu(l).then(()=>{s.changeLanguage(l),t()})},[s,t]);return d.jsxs("div",{ref:i,className:Je.wrapper,children:[d.jsx("div",{role:"button",tabIndex:0,onClick:e,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&e()},children:a}),n&&d.jsx("div",{className:Je.grid,role:"listbox","aria-label":"Select language",children:Ep.map(l=>{const m=s.language===l.code,h=[Je.item,m&&Je.itemActive,!l.available&&Je.itemUnavailable].filter(Boolean).join(" ");return d.jsxs("button",{type:"button",role:"option","aria-selected":m,className:h,onClick:()=>o(l.code,l.available),disabled:!l.available,"data-lang":l.code,children:[m&&d.jsx("span",{className:Je.checkmark,"aria-hidden":"true",children:"✓"}),d.jsx("span",{className:l.rtl?Je.rtlText:void 0,children:l.nativeName})]},l.code)})})]})}Ei.displayName="LanguageGrid";const Cp="/images/health-chip-green-XaVTYWNA.png",xp="/images/health-chip-red-BjDQqEwS.png",Ap="/images/health-chip-yellow-BJdyXVjp.png",Bp="_healthChip_1tpup_12",Rp="_indicatorImage_1tpup_54",Ip="_healthChipLive_1tpup_66",Pp="_healthChipStale_1tpup_73",Lp="_healthChipOffline_1tpup_79",Dp="_tooltipContainer_1tpup_120",Np="_tooltipContent_1tpup_142",Op="_tooltipRow_1tpup_149",Mp="_tooltipLabel_1tpup_157",Hp="_tooltipValue_1tpup_164",Fp="_online_1tpup_173",jp="_stale_1tpup_177",Up="_offline_1tpup_181",Wp="_qualityMessage_1tpup_186",zp="_tooltipDivider_1tpup_198",Vp="_tooltipSection_1tpup_204",qp="_tooltipSectionTitle_1tpup_208",N={healthChip:Bp,indicatorImage:Rp,healthChipLive:Ip,healthChipStale:Pp,healthChipOffline:Lp,tooltipContainer:Dp,tooltipContent:Np,tooltipRow:Op,tooltipLabel:Mp,tooltipValue:Hp,online:Fp,stale:jp,offline:Up,qualityMessage:Wp,tooltipDivider:zp,tooltipSection:Vp,tooltipSectionTitle:qp},es=n=>({status:"offline",isOnline:!1,isStale:!1,isMock:!0,uptime:0,slaTarget:99.9,latencyP95:0,errorRate:0,lastHeartbeat:n-1e3*60*15,dataQualityMessage:"Using demo data - backend offline",sources:{blockchain:{status:"mock",ageSeconds:-1},market:{status:"mock",ageSeconds:-1},network:{status:"error",connected:!1}}});function $p(n){switch(n){case"live":return Cp;case"stale":return Ap;case"offline":return xp}}function ts(n){return n<0?"N/A":n<60?`${n}s`:n<3600?`${Math.floor(n/60)}m`:`${Math.floor(n/3600)}h`}function Gp(n){return n?.websocket?.connected===!0}function Kp(n){return n?.health?.services?.coreRpc===!0}function Zp(n){const t=n?.health?.services?.coreRpc===!0,a=n?.websocket?.connected===!0;return t&&a}function Yp(n,e,t,a,s){return!n||a?"offline":e&&t&&!s?"live":"stale"}function Jp(n){return{blockchain:{status:n.sources.blockchain.status,ageSeconds:n.sources.blockchain.ageSeconds},market:{status:n.sources.market.status,ageSeconds:n.sources.market.ageSeconds},network:{status:n.sources.network.status,connected:n.sources.network.status==="live"}}}const Xp=({onClick:n})=>{const{t:e}=le(),t=Ih(),a=Ph(),s=na("useRealHealthData"),[i,o]=u.useState(()=>Date.now());u.useEffect(()=>{const w=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(w)},[]);const l=u.useMemo(()=>{if(!s||!t?.health)return es(i);try{const w=Gp(t),x=Kp(t),D=Zp(t),W=a.sources.blockchain.isMock||a.sources.market.isMock,q=a.overall==="stale";return{status:Yp(w,x,D,W,q),isOnline:w&&x,isStale:q,isMock:W,uptime:t.health.uptime??0,slaTarget:99.9,latencyP95:t.performance?.latency?.p95??0,errorRate:t.performance?.errorRate??0,lastHeartbeat:t.health.lastCheck??i,dataQualityMessage:a.message,sources:Jp(a)}}catch(w){return b.warn(g.COMPONENT,"HealthChip: Error calculating health metrics",{error:w instanceof Error?w:String(w)}),es(i)}},[t,a,s,i]),m=u.useMemo(()=>(Math.min(l.uptime/2592e3,1)*100).toFixed(2),[l.uptime]),h=u.useMemo(()=>{if(l.isOnline&&l.status==="live")return null;const w=i-l.lastHeartbeat,x=Math.floor(w/(1e3*60));if(x<1)return e("healthChip.heartbeat.justNow","Just now");if(x<60)return e("healthChip.heartbeat.minutesAgo","{{count}} min ago",{count:x});const D=Math.floor(x/60);return e("healthChip.heartbeat.hoursAgo","{{count}} hr ago",{count:D})},[l.isOnline,l.status,l.lastHeartbeat,i,e]),f=u.useMemo(()=>{switch(l.status){case"live":return e("healthChip.status.live","Live");case"stale":return e("healthChip.status.stale","Stale");case"offline":return l.isMock?e("healthChip.status.demo","Demo"):e("healthChip.status.offline","Offline")}},[l.status,l.isMock,e]),y=u.useMemo(()=>{switch(l.status){case"live":return N.online;case"stale":return N.stale;case"offline":return N.offline}},[l.status]),S=u.useMemo(()=>e("healthChip.ariaLabel","System status: {{status}}",{status:f}),[f,e]),v=d.jsxs("div",{className:N.tooltipContent,children:[d.jsxs("div",{className:N.tooltipRow,children:[d.jsx("span",{className:N.tooltipLabel,children:e("healthChip.statusLabel","Status")}),d.jsx("span",{className:`${N.tooltipValue} ${y}`,children:f})]}),l.dataQualityMessage&&d.jsx("div",{className:N.tooltipRow,children:d.jsx("span",{className:`${N.tooltipValue} ${N.qualityMessage}`,children:l.dataQualityMessage})}),d.jsx("div",{className:N.tooltipDivider}),d.jsx("div",{className:N.tooltipSection,children:d.jsx("span",{className:N.tooltipSectionTitle,children:e("healthChip.dataSources","Data Sources")})}),d.jsxs("div",{className:N.tooltipRow,children:[d.jsx("span",{className:N.tooltipLabel,children:e("healthChip.blockchain","Blockchain")}),d.jsx("span",{className:N.tooltipValue,children:l.sources.blockchain.status==="live"?`${ts(l.sources.blockchain.ageSeconds)} ago`:l.sources.blockchain.status})]}),d.jsxs("div",{className:N.tooltipRow,children:[d.jsx("span",{className:N.tooltipLabel,children:e("healthChip.market","Market")}),d.jsx("span",{className:N.tooltipValue,children:l.sources.market.status==="live"?`${ts(l.sources.market.ageSeconds)} ago`:l.sources.market.status})]}),d.jsxs("div",{className:N.tooltipRow,children:[d.jsx("span",{className:N.tooltipLabel,children:e("healthChip.websocket","WebSocket")}),d.jsx("span",{className:`${N.tooltipValue} ${l.sources.network.connected?N.online:N.offline}`,children:l.sources.network.connected?e("common.connected","Connected"):e("common.disconnected","Disconnected")})]}),d.jsx("div",{className:N.tooltipDivider}),d.jsx("div",{className:N.tooltipSection,children:d.jsx("span",{className:N.tooltipSectionTitle,children:e("healthChip.performance","Performance")})}),d.jsxs("div",{className:N.tooltipRow,children:[d.jsx("span",{className:N.tooltipLabel,children:e("healthChip.uptime","Uptime")}),d.jsxs("span",{className:N.tooltipValue,children:[m,"%"]})]}),d.jsxs("div",{className:N.tooltipRow,children:[d.jsx("span",{className:N.tooltipLabel,children:e("healthChip.slaTarget","SLA Target")}),d.jsxs("span",{className:N.tooltipValue,children:[l.slaTarget,"%"]})]}),d.jsxs("div",{className:N.tooltipRow,children:[d.jsx("span",{className:N.tooltipLabel,children:e("healthChip.latency","Latency (p95)")}),d.jsxs("span",{className:N.tooltipValue,children:[l.latencyP95,"ms"]})]}),d.jsxs("div",{className:N.tooltipRow,children:[d.jsx("span",{className:N.tooltipLabel,children:e("healthChip.errorRate","Error Rate")}),d.jsxs("span",{className:N.tooltipValue,children:[l.errorRate.toFixed(2),"%"]})]}),h&&d.jsxs("div",{className:N.tooltipRow,children:[d.jsx("span",{className:N.tooltipLabel,children:e("healthChip.lastHeartbeat","Last Heartbeat")}),d.jsx("span",{className:N.tooltipValue,children:h})]})]}),E=u.useMemo(()=>{switch(l.status){case"live":return N.healthChipLive;case"stale":return N.healthChipStale;case"offline":return N.healthChipOffline}},[l.status]),_=d.jsx("button",{type:"button",className:`${N.healthChip} ${E}`,"aria-label":S,"data-testid":"health-chip",tabIndex:0,onClick:n,children:d.jsx("img",{src:$p(l.status),alt:"","aria-hidden":"true",className:N.indicatorImage})});return n?_:d.jsx(aa,{trigger:_,position:"bottom",showDelay:100,hideDelay:150,contentClassName:N.tooltipContainer,toggleOnClick:!0,children:v})},Qp={block:"blockSelected",transaction:"transactionSelected",address:"addressSelected",document:"documentOpen",search:"searchActive"};function ef(n,e,t,a){const s=[];e!==null&&s.push("txLocation");const i=Qp[n];return i&&s.push(i),t&&s.push("topScrollMoved"),a&&s.push("bottomScrollMoved"),s}function tf(){const{isTopScrollMoved:n,isBottomScrollMoved:e}=Gh(),{mode:t,highlightedBlockHeight:a}=je();return u.useMemo(()=>{const i=ef(t,a,n,e),o=i.length>0;return{isActive:o,isDormant:!o,activationReason:i[0]??"none",activeConditions:i}},[t,a,n,e])}const nf="_logoBeacon_urlsc_31",af="_logoContent_urlsc_79",ns={logoBeacon:nf,logoContent:af},Ci=u.memo(({onClick:n,children:e,className:t=""})=>{const{t:a}=le(),{isActive:s}=tf(),i=u.useCallback(l=>{s&&(l.preventDefault(),n())},[s,n]),o=[ns.logoBeacon,t].filter(Boolean).join(" ");return d.jsx("button",{type:"button",className:o,onClick:i,"aria-label":s?a("navigation.returnToHome","Return to home view"):a("header.home","BlockSight.Live home"),"data-testid":"logo-beacon","data-state":s?"active":"dormant",children:d.jsx("span",{className:ns.logoContent,children:e})})});Ci.displayName="LogoBeacon";const sf="_header_trxq7_179",rf="_header__menu_trxq7_231",of="_header__brand_trxq7_251",cf="_header__logo_trxq7_275",lf="_header__aside_trxq7_359",_e={"skip-link":"_skip-link_trxq7_103",header:sf,header__menu:rf,header__brand:of,header__logo:cf,"header__logo-complete":"_header__logo-complete_trxq7_305","header__search-container":"_header__search-container_trxq7_327",header__aside:lf,"lang-pill":"_lang-pill_trxq7_443","header__search-icon-mobile":"_header__search-icon-mobile_trxq7_883","header__search-modal-overlay":"_header__search-modal-overlay_trxq7_1191"};function df(n){return cd[n]||"ENG"}const uf={whitepaper:"whitepaper",docs:"docs",faq:"faq",api:"api",tzur:"tzur",about:"about",legal:"legal"},hf=[{key:"whitepaper",labelKey:"navigation.whitepaper",IconComponent:xr},{key:"docs",labelKey:"navigation.documentation",IconComponent:Ar},{key:"faq",labelKey:"navigation.faq",IconComponent:Br},{key:"api",labelKey:"navigation.apiSubscription",IconComponent:Rr,separator:!0},{key:"tzur",labelKey:"navigation.tzurWallet",IconComponent:Ir},{key:"about",labelKey:"navigation.aboutUs",IconComponent:Pr},{key:"legal",labelKey:"navigation.legal",IconComponent:Lr}];function mf(n,e,t){return hf.map(a=>({key:a.key,labelKey:a.labelKey,icon:u.createElement(a.IconComponent,{size:18}),onClick:()=>n(a.key),active:e&&t===a.key,separator:a.separator}))}const pf="_toastContainer_8391k_37",ff="_topRight_8391k_59",gf="_topCenter_8391k_69",bf="_topLeft_8391k_81",yf="_bottomRight_8391k_91",vf="_bottomCenter_8391k_101",kf="_bottomLeft_8391k_113",Sf="_toast_8391k_37",wf="_slideInRight_8391k_1",_f="_exiting_8391k_167",Tf="_slideOutRight_8391k_1",Ef="_success_8391k_183",Cf="_iconWrapper_8391k_191",xf="_error_8391k_199",Af="_warning_8391k_215",Bf="_info_8391k_231",Rf="_loading_8391k_247",If="_icon_8391k_191",Pf="_iconLoading_8391k_295",Lf="_spin_8391k_1",Df="_content_8391k_311",Nf="_message_8391k_321",Of="_description_8391k_335",Mf="_actions_8391k_357",Hf="_actionButton_8391k_369",Ff="_dismissButton_8391k_421",jf="_slideInBottom_8391k_1",Uf="_slideOutBottom_8391k_1",re={toastContainer:pf,topRight:ff,topCenter:gf,topLeft:bf,bottomRight:yf,bottomCenter:vf,bottomLeft:kf,toast:Sf,slideInRight:wf,exiting:_f,slideOutRight:Tf,success:Ef,iconWrapper:Cf,error:xf,warning:Af,info:Bf,loading:Rf,icon:If,iconLoading:Pf,spin:Lf,content:Df,message:Nf,description:Of,actions:Mf,actionButton:Hf,dismissButton:Ff,slideInBottom:jf,slideOutBottom:Uf};function Wf(n){switch(n){case"success":return d.jsx("svg",{className:re.icon,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",fill:"currentColor"})});case"error":return d.jsx("svg",{className:re.icon,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",fill:"currentColor"})});case"warning":return d.jsx("svg",{className:re.icon,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",fill:"currentColor"})});case"info":return d.jsx("svg",{className:re.icon,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",fill:"currentColor"})});case"loading":return d.jsx("svg",{className:`${re.icon} ${re.iconLoading}`,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M10 3a7 7 0 00-7 7h2a5 5 0 015-5V3z",fill:"currentColor"})});default:return null}}function zf({toast:n,onDismiss:e,onPause:t,onResume:a}){const s=n.icon??Wf(n.type),i=()=>{n.action?.onClick(),e(n.id)};return d.jsxs("div",{className:`${re.toast} ${re[n.type]} ${n.visible?"":re.exiting}`,role:"alert","data-testid":`toast-${n.type}`,"aria-live":n.type==="error"?"assertive":"polite","aria-atomic":"true",onMouseEnter:()=>t(n.id),onMouseLeave:()=>a(n.id),children:[s&&d.jsx("div",{className:re.iconWrapper,children:s}),d.jsxs("div",{className:re.content,children:[d.jsx("div",{className:re.message,children:n.message}),n.description&&d.jsx("div",{className:re.description,children:n.description}),n.action&&d.jsx("div",{className:re.actions,children:d.jsx("button",{type:"button",className:re.actionButton,onClick:i,children:n.action.label})})]}),n.dismissible&&d.jsx("button",{type:"button",className:re.dismissButton,onClick:()=>e(n.id),"aria-label":"Dismiss notification",children:d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M12 4L4 12M4 4l8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]})}const Xt={success:4e3,error:6e3,warning:5e3,info:4e3,loading:0},Vf=3,as={exit:200},qf={mobile:"bottom-center",desktop:"top-right"},$f=768,oa=u.createContext(null);let Gf=0;const Kf=()=>`toast-${++Gf}-${Date.now()}`;function Zf({children:n}){const[e,t]=u.useState([]),a=u.useContext(Qn),s=u.useRef(new Map),i=u.useRef();u.useEffect(()=>{const _=s.current;return()=>{_.forEach(w=>{clearTimeout(w)})}},[]),u.useEffect(()=>{e.forEach(_=>{if(s.current.has(_.id)||_.duration===0||!_.visible||_.pausedAt)return;const w=setTimeout(()=>{i.current?.(_.id,"auto")},_.duration);s.current.set(_.id,w)}),s.current.forEach((_,w)=>{e.find(x=>x.id===w)||(clearTimeout(s.current.get(w)),s.current.delete(w))})},[e]);const o=u.useCallback(_=>{const w=_.id??Kf(),x={id:w,type:_.type,message:_.message,description:_.description,duration:_.duration??Xt[_.type],dismissible:_.dismissible??!0,action:_.action,icon:_.icon,onDismiss:_.onDismiss,correlationId:_.correlationId??a?.correlationId??"",createdAt:Date.now(),visible:!0};return b.info(g.COMPONENT,"Toast displayed",{toastId:w,type:x.type,message:x.message,correlationId:x.correlationId}),t(D=>{const W=D.filter(q=>q.visible);if(W.length>=Vf){const q=W[0].id,G=s.current.get(q);G&&(clearTimeout(G),s.current.delete(q));const ee=D.find(be=>be.id===q);return ee?.onDismiss&&ee.onDismiss(),setTimeout(()=>{t(be=>be.filter(se=>se.id!==q))},as.exit),[...D.map(be=>be.id===q?{...be,visible:!1}:be),x]}return[...D,x]}),w},[a?.correlationId]),l=u.useCallback((_,w="user")=>{s.current.has(_)&&(clearTimeout(s.current.get(_)),s.current.delete(_)),t(x=>x.map(D=>D.id===_&&D.visible?(D.onDismiss?.(),{...D,visible:!1}):D)),setTimeout(()=>{t(x=>x.filter(D=>D.id!==_))},as.exit),b.debug(g.COMPONENT,"Toast dismissed",{toastId:_,reason:w})},[]);u.useEffect(()=>{i.current=l},[l]);const m=u.useCallback(()=>{e.forEach(_=>{_.visible&&l(_.id,"user")})},[e,l]),h=u.useCallback(_=>{s.current.has(_)&&(clearTimeout(s.current.get(_)),s.current.delete(_))},[]),f=u.useCallback((_,w)=>{t(x=>x.map(D=>{if(D.id!==_)return D;const W={...D,...w};return w.type&&!w.duration&&(W.duration=Xt[w.type],h(_)),W}))},[h]),y=u.useCallback(_=>{s.current.has(_)&&(clearTimeout(s.current.get(_)),s.current.delete(_)),t(w=>w.map(x=>x.id===_?{...x,pausedAt:Date.now()}:x))},[]),S=u.useCallback(_=>{s.current.has(_)&&(clearTimeout(s.current.get(_)),s.current.delete(_));let w=-1;if(t(x=>x.map(D=>D.id===_&&D.pausedAt?(w=Math.max(D.duration-(Date.now()-D.createdAt),0),{...D,pausedAt:void 0}):D)),w>0){const x=setTimeout(()=>l(_,"auto"),w);s.current.set(_,x)}else w===0&&l(_,"auto")},[l]),v=u.useCallback(async(_,w)=>{const x=o({type:"loading",message:w.loading,duration:0});try{const D=await _,W=typeof w.success=="function"?w.success(D):w.success;return f(x,{type:"success",message:W,duration:Xt.success}),D}catch(D){const W=D instanceof Error?D:new Error(String(D)),q=typeof w.error=="function"?w.error(W):w.error;throw f(x,{type:"error",message:q,duration:Xt.error}),W}},[o,f]),E=u.useMemo(()=>({toasts:e.filter(_=>_.visible),showToast:o,dismissToast:_=>l(_,"user"),dismissAll:m,updateToast:f,promise:v,_pauseToast:y,_resumeToast:S}),[e,o,l,m,f,v,y,S]);return d.jsx(oa.Provider,{value:E,children:n})}function Yf(){const n=u.useContext(oa);if(!n)throw new Error("useToast must be used within a ToastProvider");return n}function Jf(){const n=u.useContext(oa);if(!n)throw new Error("useToastInternal must be used within a ToastProvider");return n}function Xf(){const{showToast:n}=Yf();return u.useCallback((e,t)=>n({type:"error",message:e,description:t}),[n])}function Qf(){const{toasts:n,dismissToast:e,dismissAll:t,_pauseToast:a,_resumeToast:s}=Jf(),[i,o]=u.useState("desktop"),[l]=u.useState(()=>typeof window<"u");if(u.useEffect(()=>{const h=()=>{o(window.innerWidth<$f?"mobile":"desktop")};return h(),window.addEventListener("resize",h),()=>window.removeEventListener("resize",h)},[]),u.useEffect(()=>{const h=f=>{f.key==="Escape"&&n.length>0&&t()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[n.length,t]),!l||n.length===0)return null;const m=qf[i]==="top-right"?re.topRight:re.bottomCenter;return Ms.createPortal(d.jsx("section",{className:`${re.toastContainer} ${m}`,"aria-label":"Notifications",children:n.map(h=>d.jsx(zf,{toast:h,onDismiss:e,onPause:a,onResume:s},h.id))}),document.body)}const Ee={mobile:768,tablet:1100,desktop:1536},Me={tiny:500,short:700,medium:800},eg=100;function tg(n,e){return n>=700&&n<=900&&e<=600||n<=300&&e>=600?"foldable":n<=Ee.mobile?"phone":n<=Ee.tablet?"tablet":n<=Ee.desktop?"laptop":"desktop"}function ng(n,e){let t=1;return n<=768?t*=.8:n<=1024?t*=.9:n>=2560&&(t*=1.1),e<=500?t*=.65:e<=600?t*=.75:e<=700?t*=.85:e<=800&&(t*=.9),Math.max(.5,Math.min(1.2,t))}function ag(){return typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:1920,height:1080}}function sg(n,e){return n==="phone"||e<=Ee.mobile?"single":e<=Ee.tablet?"double":"triple"}function ig(n,e){return n!=="phone"&&e==="triple"}function rg(n,e){return n<=Me.tiny?"minimal":n<=Me.short?"reduced":e==="landscape"&&n<=500?"minimal":"full"}function og(n,e,t){return e==="phone"?t==="minimal"?"mini":"compact":t==="minimal"?"mini":t==="reduced"||n<=Me.medium?"compact":"full"}function cg(n,e){return n==="phone"||e==="double"?"compact":"full"}const lg={width:1920,height:1080,isMobile:!1,isTablet:!1,isDesktop:!0,isWidescreen:!1,isTinyHeight:!1,isShortHeight:!1,isMediumHeight:!1,isTallHeight:!0,deviceType:"desktop",orientation:"landscape",scaleFactor:1,layoutMode:"triple",showLeftColumn:!0,contentMode:"full",blockCardVariant:"full",dashboardDataVariant:"full"},xi=u.createContext(lg),dg=({children:n})=>{const[e,t]=u.useState(ag),a=u.useCallback(()=>{t({width:window.innerWidth,height:window.innerHeight})},[]);u.useEffect(()=>{a();let i;const o=()=>{clearTimeout(i),i=setTimeout(a,eg)};return window.addEventListener("resize",o),()=>{clearTimeout(i),window.removeEventListener("resize",o)}},[a]);const s=u.useMemo(()=>{const{width:i,height:o}=e,l=tg(i,o),m=i>o?"landscape":"portrait",h=sg(l,i),f=ig(l,h),y=rg(o,m),S=og(o,l,y),v=cg(l,h);return{width:i,height:o,isMobile:i<=Ee.mobile,isTablet:i>Ee.mobile&&i<=Ee.tablet,isDesktop:i>Ee.tablet&&i<=Ee.desktop,isWidescreen:i>Ee.desktop,isTinyHeight:o<=Me.tiny,isShortHeight:o>Me.tiny&&o<=Me.short,isMediumHeight:o>Me.short&&o<=Me.medium,isTallHeight:o>Me.medium,deviceType:l,orientation:m,scaleFactor:ng(i,o),layoutMode:h,showLeftColumn:f,contentMode:y,blockCardVariant:S,dashboardDataVariant:v}},[e]);return d.jsx(xi.Provider,{value:s,children:n})},Ai=()=>u.useContext(xi),ug=()=>{const n=Ai();return{...n,isCompact:n.isMobile||n.isShortHeight||n.isTinyHeight,needsSimplifiedUI:n.scaleFactor<.8,shouldHideSecondaryInfo:n.scaleFactor<.7,isTouchDevice:n.deviceType==="phone"||n.deviceType==="tablet",isHeightConstrained:n.isTinyHeight||n.isShortHeight||n.isMediumHeight}},hg={html:n=>vn.sanitize(n),text:n=>vn.sanitize(n,{ALLOWED_TAGS:[]}),url:n=>{const e=vn.sanitize(n,{ALLOWED_TAGS:[]});try{const t=new URL(e);return["http:","https:"].includes(t.protocol)?e:""}catch{return""}},bitcoinId:n=>n.replace(/[^a-zA-Z0-9]/g,"")};function mg(n){if(n<=0)return null;const t=O.getState().transformed?.blockchain?.summary?.mempoolBlocks??[];return pm(n,t)}function pg(){const{t:n}=le(),e=Xf(),{selectBlock:t,selectTransaction:a,selectAddress:s,highlightBlock:i,closePanel:o}=je(),{selectBlockByHeight:l,selectBlockByHash:m}=Yh(),{selectTransactionByTxid:h,selectAddressByAddress:f}=mm(),{canSearch:y,cooldownRemaining:S,recordSearch:v}=ym(),{scrollToBlock:E}=di(),{isMobile:_}=Ai(),w=u.useCallback(T=>{_||E(T,"smooth")},[_,E]),{searchService:x,isBackendSearchEnabled:D}=ia(),[W,q]=u.useState(""),[G,ee]=u.useState(!1),be=u.useCallback(T=>{const L=hg.bitcoinId(T);q(L)},[]),se=u.useCallback((T,L,K)=>{let Ce;T?typeof L=="object"&&L?Ce=n(T,L):Ce=n(T,L??T):Ce=typeof L=="string"?L:n(K),e(Ce)},[e,n]),it=u.useCallback((T,L)=>{const K=T instanceof Error?T.message:String(T);if(T instanceof Error&&T.name==="ServiceDisabled"){b.warn(g.API,"Search service disabled",L),se("search.errors.serviceDisabled","Search service is currently unavailable. Bitcoin Core RPC may be disabled.","search.errors.serviceDisabled");return}b.error(g.API,"Backend search failed",{...L,error:K}),se("search.errors.backendFailed","Backend search failed. Please try again.","search.errors.backendFailed")},[se]),$t=u.useCallback(T=>({kind:"real",id:{hash:T.hash,height:T.height},minedAtMs:T.timestamp*1e3,txCount:T.txCount,minFeeRate:T.minFeeRate,medianFeeRate:T.medianFeeRate,maxFeeRate:T.maxFeeRate,totalFeesSatoshis:T.totalFeesSatoshis,subsidySatoshis:T.subsidySatoshis,minerName:T.miner,isEnriched:T.minFeeRate>0}),[]),fa=u.useCallback(T=>{const L=O.getState().transformed?.market?.prices?.btc?.usd??0,Ce=(T.fee??0)/1e8*L;return{id:{txid:T.txid},status:T.status,isCoinbase:T.isCoinbase,confirmations:T.confirmations,blockHeight:T.blockHeight,blockHash:T.blockHash,firstSeenMs:T.timestamp?T.timestamp*1e3:Date.now(),confirmedAtMs:T.status==="confirmed"&&T.timestamp?T.timestamp*1e3:null,feeSatoshis:T.fee,feeRate:T.feeRate,fiatFeeUsd:Ce,fiatFeeCurrency:Ce,isRbf:T.isRbf,senderAddress:T.senderAddress,receiverAddress:T.receiverAddress,inputCount:T.inputCount,outputCount:T.outputCount,totalInputValue:T.totalInputSatoshis,totalOutputValue:T.value,heuristics:T.heuristics?{pattern:T.heuristics.pattern,receiverType:T.heuristics.receiverType,confidence:T.heuristics.confidence}:void 0}},[]),ga=u.useCallback(T=>{const L=O.getState().transformed?.market?.prices?.btc?.usd??0,Ce=T.balance/1e8*L;return{address:T.address,addressType:T.addressType,balanceSatoshis:T.balance,balanceFiatUsd:Ce,balanceFiatCurrency:Ce,pendingBalanceSatoshis:T.pendingBalance,totalReceivedSatoshis:T.totalReceived,totalSentSatoshis:T.totalSent,txCountTotal:T.txCount,txCountReceived:T.txCountReceived,txCountConfirmedHistory:T.txCountConfirmedHistory,txCountSent:T.txCountSent,confirmedUtxoCount:T.confirmedUtxoCount,pendingUtxoCount:T.pendingUtxoCount,latestTransaction:null,transactions:T.transactions.map(xe=>({id:{txid:xe.txid},status:xe.status,isCoinbase:!1,confirmations:xe.confirmations,blockHeight:xe.blockHeight,blockHash:null,firstSeenMs:xe.timestamp?xe.timestamp*1e3:Date.now(),confirmedAtMs:xe.timestamp?xe.timestamp*1e3:null,feeSatoshis:xe.feeSatoshis??0,feeRate:0,fiatFeeUsd:0,fiatFeeCurrency:0,isRbf:!1,senderAddress:"",receiverAddress:"",inputCount:0,outputCount:0,totalInputValue:0,totalOutputValue:xe.amountSatoshis??0})),hasMoreTransactions:T.hasMoreTransactions}},[]),ba=u.useCallback(async T=>{ee(!0);try{const L=await x.debouncedSearch({type:"block",query:T.toString(),limit:1});if(L.length>0&&L[0].type==="block"){const K=$t(L[0]);return t(K),w(K.id.height),b.info(g.API,"Backend search successful",{height:T,hash:K.id.hash}),!0}return se("search.errors.blockNotFound",`Block #${T.toLocaleString()} not found`,"search.errors.blockNotFound"),!1}catch(L){return it(L,{height:T}),!1}finally{ee(!1)}},[x,$t,t,w,se,it]),ya=u.useCallback(T=>{if(T.type==="block"){const L=$t(T);return t(L),w(L.id.height),!0}if(T.type==="transaction"){const L=fa(T);if(a(L),L.blockHeight!==null)w(L.blockHeight);else if(L.feeRate!==null){const K=mg(L.feeRate);K!==null&&(i(K),w(K))}return!0}return!1},[$t,fa,t,a,i,w]),va=u.useCallback(async T=>{ee(!0);try{const L=await x.directSearch({type:"all",query:T,limit:1});return L.length===0?(se("search.errors.hashNotFound","No block or transaction found with this hash","search.errors.hashNotFound"),!1):ya(L[0])}catch(L){return it(L,{hash:T}),!1}finally{ee(!1)}},[x,ya,se,it]),ka=u.useCallback(async T=>{ee(!0);try{const L=await x.debouncedSearch({type:"address",query:T,limit:1});if(L.length>0&&L[0].type==="address"){const K=ga(L[0]);return s(K),b.info(g.API,"Backend address search successful",{address:`${T.slice(0,8)}...`}),!0}return se("search.errors.addressNotFound","Address not found","search.errors.addressNotFound"),!1}catch(L){return it(L,{address:T.slice(0,8)}),!1}finally{ee(!1)}},[x,ga,s,se,it]),Sa=u.useCallback(async T=>{v();const L=l(T);return L.success?!0:D?await ba(T):(se(L.errorKey,L.error,"search.errors.blockNotFound"),!1)},[v,l,D,se,ba]),wa=u.useCallback(async T=>(v(),m(T).success||h(T).success?!0:D?await va(T):(se("search.errors.hashNotFound","No block or transaction found with this hash","search.errors.hashNotFound"),!1)),[v,m,h,D,se,va]),_a=u.useCallback(async T=>{v();const L=await f(T);return L.success?!0:D?await ka(T):(se(L.errorKey,L.error,"search.errors.addressNotFound"),!1)},[v,f,D,se,ka]),Ta=u.useCallback(async T=>{const{type:L,value:K}=T;return L==="blockHeight"?await Sa(K):L==="blockHash"||L==="txid"?await wa(K):L==="address"?await _a(K):(e(n("search.errors.notImplemented","Search type not yet supported"),n("search.errors.notImplementedDescription","Only block, transaction, and address search is available")),!1)},[Sa,wa,_a,e,n]),ur=u.useCallback(async T=>{T.preventDefault();const L=W.trim();if(!L)return;if(!y){e(n("search.errors.rateLimited","Please wait before searching again"),n("search.errors.rateLimitedDescription","Try again in {{seconds}} seconds",{seconds:S}));return}const K=vi(L);if(!K.isValid){se(K.errorKey,K.errorParams,"search.errors.invalidInput");return}o(),await Ta(K)&&q("")},[W,y,S,e,n,o,Ta,se]);return{query:W,isSearching:G,canSearch:y,cooldownRemaining:S,handleSearchChange:be,onSubmitSearch:ur}}const fg=()=>{const{t:n,i18n:e}=le(),{closePanel:t}=je(),{openDocument:a,isDocumentOpen:s,currentDocument:i}=Um(),{resetAllScrolls:o}=$h(),{query:l,isSearching:m,handleSearchChange:h,onSubmitSearch:f}=pg(),y=df(e.language),[S,v]=u.useState(null),E=u.useCallback(W=>{v(q=>q===W?null:W)},[]),_=u.useCallback(()=>{v(null)},[]),w=u.useCallback(W=>{const q=uf[W];q&&(a(q),_())},[a,_]),x=u.useCallback(()=>{t(),o();const W=O.getState();W.raw.electrumServer.windowCenter!==null&&O.updateState({raw:{...W.raw,electrumServer:{...W.raw.electrumServer,windowCenter:null}}})},[t,o]);u.useEffect(()=>{if(S!=="search-modal")return;const W=q=>{q.key==="Escape"&&_()};return document.addEventListener("keydown",W),()=>{document.removeEventListener("keydown",W)}},[S,_]);const D=u.useMemo(()=>mf(w,s,i),[w,s,i]);return d.jsx(Y,{componentName:"Header",maxRetries:2,enableAutoRecovery:!0,fallback:({error:W,retry:q})=>d.jsx(Vs,{componentName:"Header",errorMessage:"Unable to load navigation and search",errorDetails:W?.message||"Header component error",onRetry:q,onReload:()=>window.location.reload(),severity:"high",size:"mini"}),children:d.jsxs("header",{className:_e.header,"data-testid":"header",children:[d.jsx("a",{href:"#main-content",className:_e["skip-link"],children:n("accessibility.skipToContent","Skip to main content")}),d.jsx("div",{className:_e.header__menu,children:d.jsx(Mo,{trigger:d.jsx($s,{icon:d.jsx(Dr,{size:24}),"aria-label":n("header.navigation"),variant:"ghost",size:"md"}),items:D,isOpen:S==="nav",onToggle:()=>E("nav"),onClose:_,position:"left"})}),d.jsx("div",{className:_e.header__brand,children:d.jsx(Ci,{onClick:x,className:_e.header__logo,children:d.jsxs("picture",{children:[d.jsx("source",{media:"(max-width: 768px)",srcSet:bp}),d.jsx("img",{src:gp,alt:"BlockSight.Live","data-testid":"header-logo",className:_e["header__logo-complete"]})]})})}),d.jsxs("div",{className:_e["header__search-container"],children:[d.jsx(qa,{query:l,onChange:h,onSubmit:f,isLoading:m}),d.jsx(Ei,{isOpen:S==="lang",onToggle:()=>E("lang"),onClose:_,trigger:d.jsx("button",{type:"button",className:_e["lang-pill"],"aria-label":"Select language","aria-haspopup":"listbox","aria-expanded":S==="lang",title:"Select language","data-testid":"language-grid-trigger",children:y})})]}),d.jsx("button",{className:_e["header__search-icon-mobile"],onClick:()=>v("search-modal"),"aria-label":n("header.openSearch","Open search"),type:"button","data-testid":"header-search-icon-mobile",children:d.jsx(Nr,{size:24})}),S==="search-modal"&&d.jsx("div",{className:_e["header__search-modal-overlay"],"data-testid":"header-search-modal-overlay",children:d.jsx(qa,{query:l,onChange:h,onSubmit:async W=>{await f(W),_()},autoFocus:!0,isLoading:m})}),d.jsx("aside",{className:_e.header__aside,children:d.jsx(Xp,{})})]})})},gg="_nav_1o4hi_7",bg="_link_1o4hi_23",Ue={nav:gg,link:bg},Bi=()=>{const{mode:n}=je(),{t:e}=le();return n!=="idle"?null:d.jsxs("nav",{className:Ue.nav,"data-testid":"legal-links-footer","aria-label":"Legal links",children:[d.jsx(We,{to:"/privacy",className:Ue.link,children:e("footerLinks.privacy")}),d.jsx(We,{to:"/terms",className:Ue.link,children:e("footerLinks.terms")}),d.jsx(We,{to:"/accessibility",className:Ue.link,children:e("footerLinks.accessibility")}),d.jsx(We,{to:"/sla",className:Ue.link,children:e("footerLinks.sla")}),d.jsx(We,{to:"/aup",className:Ue.link,children:e("footerLinks.aup")}),d.jsx(We,{to:"/dpa",className:Ue.link,children:e("footerLinks.dpa")}),d.jsx(We,{to:"/msa",className:Ue.link,children:e("footerLinks.msa")})]})};Bi.displayName="LegalLinksFooter";function yg(){const{i18n:n}=le();u.useEffect(()=>{const e=n.language;document.documentElement.dir="ltr",document.documentElement.lang=e},[n.language])}function vg(){const n=fr();u.useEffect(()=>{X.counter("page_views_total","Total number of page views",["path"]).inc({path:n.pathname})},[n.pathname])}const kg="/api/v1/analytics/visit";function Sg(n="explorer"){u.useEffect(()=>{if(typeof fetch>"u"||navigator.doNotTrack==="1")return;const e=window.location.pathname,t=document.referrer?new URL(document.referrer).hostname===window.location.hostname?"internal":"external":"direct";fetch(kg,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({page:e,referrerType:t,app:n})}).catch(()=>{})},[n])}const sn="chunk-reload-attempted";function ne(n){return u.lazy(()=>n().catch(e=>{if(!sessionStorage.getItem(sn))return sessionStorage.setItem(sn,"true"),window.location.reload(),new Promise(()=>{});throw sessionStorage.removeItem(sn),e}))}function wg(){sessionStorage.removeItem(sn)}const ss=ne(()=>k(()=>import("./Dashboard-MpsxZlHl.js").then(n=>n.D),__vite__mapDeps([0,1,2,3,4,5,6])).then(n=>({default:n.Dashboard}))),_g=ne(()=>k(()=>import("./Whitepaper-BPSTXyBY.js"),__vite__mapDeps([7,1,2,3,4,5,8,9,10])).then(n=>({default:n.Whitepaper}))),Tg=ne(()=>k(()=>import("./Documentation-BWHwogfJ.js"),__vite__mapDeps([11,1,2,3,4,5,8,9,10])).then(n=>({default:n.Documentation}))),Eg=ne(()=>k(()=>import("./ApiSubscription-DNEDMBx-.js"),__vite__mapDeps([12,1,2,3,4,5,8,9,10])).then(n=>({default:n.ApiSubscription}))),Cg=ne(()=>k(()=>import("./AboutUs-C5AnboXU.js"),__vite__mapDeps([13,1,2,3,4,5,8,9,10])).then(n=>({default:n.AboutUs}))),xg=ne(()=>k(()=>import("./Legal-tPJjfoYj.js"),__vite__mapDeps([14,1,2,3,4,5,8,9,10])).then(n=>({default:n.Legal}))),Ag=ne(()=>k(()=>import("./Terms-CP15xVUx.js"),__vite__mapDeps([15,1,2,3,4,5,8,9,10])).then(n=>({default:n.Terms}))),Bg=ne(()=>k(()=>import("./Privacy-ILadws_K.js"),__vite__mapDeps([16,1,2,3,4,5,8,9,10])).then(n=>({default:n.Privacy}))),is=ne(()=>k(()=>import("./Accessibility-QSytKUWB.js"),__vite__mapDeps([17,1,2,3,4,5,8,9,10])).then(n=>({default:n.Accessibility}))),rs=ne(()=>k(()=>import("./SLA-CLj5hICS.js"),__vite__mapDeps([18,1,2,3,4,5,8,9,10])).then(n=>({default:n.SLA}))),os=ne(()=>k(()=>import("./DPA-DiqiDCXM.js"),__vite__mapDeps([19,1,2,3,4,5,8,9,10])).then(n=>({default:n.DPA}))),cs=ne(()=>k(()=>import("./AUP-D3xUjD67.js"),__vite__mapDeps([20,1,2,3,4,5,8,9,10])).then(n=>({default:n.AUP}))),ls=ne(()=>k(()=>import("./MSA-DLH0l2XW.js"),__vite__mapDeps([21,1,5,3,8,9,10])).then(n=>({default:n.MSA}))),Rg=ne(()=>k(()=>import("./FAQ-Drbf5NRQ.js"),__vite__mapDeps([22,1,2,3,4,5,8,9,10]))),Ig=ne(()=>k(()=>import("./TzurWallet-T1X0d5vl.js"),__vite__mapDeps([23,1,2,3,4,5,8,9,10]))),Pg=ne(()=>k(()=>import("./index-D2dj3cjx.js"),__vite__mapDeps([24,1,5,3,8,9,10,25])).then(n=>({default:n.ClaudeInstall}))),Lg=()=>d.jsx(wc,{children:d.jsxs(gr,{children:[d.jsx(Z,{path:"/",element:d.jsx(Y,{componentName:"Dashboard",maxRetries:2,children:d.jsx(u.Suspense,{fallback:d.jsx(J,{}),children:d.jsx(ss,{})})})}),d.jsx(Z,{path:"/dashboard",element:d.jsx(Y,{componentName:"Dashboard",maxRetries:2,children:d.jsx(u.Suspense,{fallback:d.jsx(J,{}),children:d.jsx(ss,{})})})}),d.jsx(Z,{path:"/whitepaper",element:d.jsx(Y,{componentName:"Whitepaper",maxRetries:2,children:d.jsx(u.Suspense,{fallback:d.jsx(J,{}),children:d.jsx(_g,{})})})}),d.jsx(Z,{path:"/docs",element:d.jsx(Y,{componentName:"Documentation",maxRetries:2,children:d.jsx(u.Suspense,{fallback:d.jsx(J,{}),children:d.jsx(Tg,{})})})}),d.jsx(Z,{path:"/api",element:d.jsx(Y,{componentName:"ApiSubscription",maxRetries:2,children:d.jsx(u.Suspense,{fallback:d.jsx(J,{}),children:d.jsx(Eg,{})})})}),d.jsx(Z,{path:"/about",element:d.jsx(Y,{componentName:"AboutUs",maxRetries:2,children:d.jsx(u.Suspense,{fallback:d.jsx(J,{}),children:d.jsx(Cg,{})})})}),d.jsx(Z,{path:"/legal",element:d.jsx(Y,{componentName:"Legal",maxRetries:2,children:d.jsx(u.Suspense,{fallback:d.jsx(J,{}),children:d.jsx(xg,{})})})}),d.jsx(Z,{path:"/terms",element:d.jsx(Y,{componentName:"Terms",maxRetries:2,children:d.jsx(u.Suspense,{fallback:d.jsx(J,{}),children:d.jsx(Ag,{})})})}),d.jsx(Z,{path:"/privacy",element:d.jsx(Y,{componentName:"Privacy",maxRetries:2,children:d.jsx(u.Suspense,{fallback:d.jsx(J,{}),children:d.jsx(Bg,{})})})}),d.jsx(Z,{path:"/accessibility",element:d.jsx(Y,{componentName:"Accessibility",maxRetries:2,children:d.jsx(u.Suspense,{fallback:d.jsx(J,{}),children:d.jsx(is,{})})})}),d.jsx(Z,{path:"/legal/accessibility",element:d.jsx(Y,{componentName:"Accessibility",maxRetries:2,children:d.jsx(u.Suspense,{fallback:d.jsx(J,{}),children:d.jsx(is,{})})})}),d.jsx(Z,{path:"/faq",element:d.jsx(Y,{componentName:"FAQ",maxRetries:2,children:d.jsx(u.Suspense,{fallback:d.jsx(J,{}),children:d.jsx(Rg,{})})})}),d.jsx(Z,{path:"/tzur",element:d.jsx(Y,{componentName:"TzurWallet",maxRetries:2,children:d.jsx(u.Suspense,{fallback:d.jsx(J,{}),children:d.jsx(Ig,{})})})}),d.jsx(Z,{path:"/claude",element:d.jsx(Y,{componentName:"ClaudeInstall",maxRetries:2,children:d.jsx(u.Suspense,{fallback:d.jsx(J,{}),children:d.jsx(Pg,{})})})}),d.jsx(Z,{path:"/sla",element:d.jsx(Y,{componentName:"SLA",maxRetries:2,children:d.jsx(u.Suspense,{fallback:d.jsx(J,{}),children:d.jsx(rs,{})})})}),d.jsx(Z,{path:"/service-level-agreement",element:d.jsx(Y,{componentName:"SLA",maxRetries:2,children:d.jsx(u.Suspense,{fallback:d.jsx(J,{}),children:d.jsx(rs,{})})})}),d.jsx(Z,{path:"/dpa",element:d.jsx(Y,{componentName:"DPA",maxRetries:2,children:d.jsx(u.Suspense,{fallback:d.jsx(J,{}),children:d.jsx(os,{})})})}),d.jsx(Z,{path:"/data-processing-agreement",element:d.jsx(Y,{componentName:"DPA",maxRetries:2,children:d.jsx(u.Suspense,{fallback:d.jsx(J,{}),children:d.jsx(os,{})})})}),d.jsx(Z,{path:"/aup",element:d.jsx(Y,{componentName:"AUP",maxRetries:2,children:d.jsx(u.Suspense,{fallback:d.jsx(J,{}),children:d.jsx(cs,{})})})}),d.jsx(Z,{path:"/acceptable-use",element:d.jsx(Y,{componentName:"AUP",maxRetries:2,children:d.jsx(u.Suspense,{fallback:d.jsx(J,{}),children:d.jsx(cs,{})})})}),d.jsx(Z,{path:"/msa",element:d.jsx(Y,{componentName:"MSA",maxRetries:2,children:d.jsx(u.Suspense,{fallback:d.jsx(J,{}),children:d.jsx(ls,{})})})}),d.jsx(Z,{path:"/service-agreement",element:d.jsx(Y,{componentName:"MSA",maxRetries:2,children:d.jsx(u.Suspense,{fallback:d.jsx(J,{}),children:d.jsx(ls,{})})})}),d.jsx(Z,{path:"*",element:d.jsx(br,{to:"/",replace:!0})})]})}),Dg=()=>{yg(),vg(),Sg("explorer");const{layoutMode:n}=ug(),[e,t]=u.useState(!0),[a,s]=u.useState(!1),i=u.useCallback(()=>{s(!0)},[]),o=u.useCallback(()=>{t(!1)},[]);return u.useEffect(()=>{const l=setTimeout(i,2e3),m=setTimeout(o,4e3);return()=>{clearTimeout(l),clearTimeout(m)}},[i,o]),d.jsxs("div",{className:"app",children:[n!=="single"&&d.jsx(fg,{}),e&&d.jsx("div",{className:`splash-screen ${a?"fade-out":""}`,children:d.jsx(J,{})}),d.jsx("main",{className:`main-content ${a?"loaded":"loading"}`,"data-testid":"app-shell","data-loading":"false",children:d.jsx(Lg,{})}),d.jsx(Ti,{}),d.jsx(Bi,{})]})},Ng="_loading_1lmcz_97",Og="_loaded_1lmcz_105",ds={"image-background":"_image-background_1lmcz_23","lazy-image-container":"_lazy-image-container_1lmcz_63","lazy-image":"_lazy-image_1lmcz_63",loading:Ng,loaded:Og,"image-quality-high":"_image-quality-high_1lmcz_115","image-quality-medium":"_image-quality-medium_1lmcz_125","image-quality-low":"_image-quality-low_1lmcz_133"},Mg=u.lazy(()=>k(()=>import("./LazyImage-2-cRlD9q.js"),__vite__mapDeps([26,1,3,8,9,10]))),Hg=({quality:n="high",imageName:e="cosmic"})=>{const[t,a]=u.useState(!1),s=()=>{a(!0)};return t?null:d.jsx("div",{className:`${ds["image-background"]} ${ds[`image-quality-${n}`]}`,"data-testid":"cosmic-background",children:d.jsx(u.Suspense,{fallback:null,children:d.jsx(Mg,{imageName:e,quality:n,onError:s})})})},Ri=u.createContext(null),Bn=["idle","preparing","anticipation","descent","merge","complete"];function Fg(n){const e=Bn.indexOf(n);return e===-1||e>=Bn.length-1?"idle":Bn[e+1]}const jg=({children:n})=>{const t=sa().transformed.blockFound,a=u.useCallback(()=>{const l=O.getState(),m=l.transformed.blockFound.phase,h=Fg(m);if(h==="complete"){const y={transformed:{...l.transformed,blockFound:{...l.transformed.blockFound,phase:"complete"}}};O.updateState(y);return}if(m==="complete"||h==="idle"){const y={transformed:{...l.transformed,blockFound:{...l.transformed.blockFound,isAnimating:!1,phase:"idle",currentEvent:null}}};O.updateState(y);return}const f={transformed:{...l.transformed,blockFound:{...l.transformed.blockFound,phase:h}}};O.updateState(f)},[]),s=u.useCallback(()=>{const l=O.getState(),m={transformed:{...l.transformed,blockFound:{...l.transformed.blockFound,phase:"complete"}}};O.updateState(m),requestAnimationFrame(()=>{const h=O.getState(),f={transformed:{...h.transformed,blockFound:{isAnimating:!1,phase:"idle",currentEvent:null,lastBlockFoundAt:h.transformed.blockFound.lastBlockFoundAt}}};O.updateState(f)})},[]),i=u.useCallback(l=>{const h={transformed:{...O.getState().transformed,blockFound:{isAnimating:!0,phase:"preparing",currentEvent:l,lastBlockFoundAt:Date.now()}}};O.updateState(h)},[]),o=u.useMemo(()=>({state:t,isAnimating:t.isAnimating,phase:t.phase,currentEvent:t.currentEvent,advancePhase:a,completeAnimation:s,triggerAnimation:i}),[t,a,s,i]);return d.jsx(Ri.Provider,{value:o,children:n})},Ii=()=>{const n=u.useContext(Ri);if(!n)throw new Error("useBlockFound must be used within BlockFoundProvider");return n},Pi=()=>{const{advancePhase:n,completeAnimation:e,triggerAnimation:t}=Ii();return{advancePhase:n,completeAnimation:e,triggerAnimation:t}};class Ug{constructor(e,t){this.callback=e,this.intervalMs=t}interval=null;start(){this.interval||(this.interval=setInterval(this.callback,this.intervalMs))}stop(){this.interval&&(clearInterval(this.interval),this.interval=null)}get isRunning(){return this.interval!==null}}const Wg={batchSize:10,flushIntervalMs:5e3,maxRetries:3,enabled:!0,maxBufferSize:100};class zg{constructor(e,t={}){this.faroService=e,this.config={...Wg,initialRetryDelayMs:100,...t},this.flushTimer=new Ug(()=>{this.flush()},this.config.flushIntervalMs),this.config.enabled&&this.config.flushIntervalMs>0&&this.flushTimer.start()}config;buffer=[];flushTimer;isShutdown=!1;async ship(e){!this.isReady()||this.isShutdown||(this.buffer.push(...e),(this.buffer.length>=this.config.batchSize||this.buffer.length>=this.config.maxBufferSize)&&await this.flush())}async flush(){if(this.buffer.length===0||!this.config.enabled)return;const e=[...this.buffer];this.buffer=[];for(const t of e)await this.shipSingleLog(t)}async shipSingleLog(e,t=1){try{const a=this.mapLogLevel(e.level),s=this.buildContext(e);this.faroService.captureLog(a,e.message,s)}catch(a){if(tsetTimeout(t,e))}}const Li={},us={development:"http://localhost:3001/collect",staging:"https://faro-staging.grafana.net/collect",production:"https://faro.grafana.net/collect",test:""};function ca(){return typeof import.meta<"u"||typeof process<"u"?"production":"development"}function Vg(){if(typeof import.meta<"u"&&Li?.VITE_FARO_COLLECTOR_URL)return;const n=ca();return us[n]||us.development}function qg(){if(typeof import.meta<"u")return!1;const n=ca();return!(n==="test"||n==="development")}function $g(){if(!(typeof import.meta<"u"&&Li?.VITE_APP_VERSION))return"1.0.0"}function Gg(){return{name:"blocksight-frontend",version:$g(),environment:ca()}}function Kg(){return{url:Vg(),app:Gg(),enabled:qg()}}function Zg(n){const e=Kg();return{...e,...n,app:{...e.app,...n?.app}}}class Xe{static instance=null;faroInstance=null;config=null;initialized=!1;constructor(){}static getInstance(){return Xe.instance||(Xe.instance=new Xe),Xe.instance}static resetInstance(){Xe.instance=null}async initialize(e){if(!this.initialized&&(this.config=e,e.enabled!==!1))try{const{initializeFaro:t,getWebInstrumentations:a}=await k(async()=>{const{initializeFaro:s,getWebInstrumentations:i}=await import("./vendor-observability-PbcLCb4f.js").then(o=>o.a);return{initializeFaro:s,getWebInstrumentations:i}},__vite__mapDeps([9,1]));this.faroInstance=t({url:e.url,app:{name:e.app.name,version:e.app.version,environment:e.app.environment},instrumentations:[...a()],sessionTracking:{enabled:!0},beforeSend:s=>(e.correlationId&&s.meta&&(s.meta.correlation_id=e.correlationId),s)}),this.initialized=!0}catch(t){console.error("[FaroService] Failed to initialize Faro:",t)}}isInitialized(){return this.initialized}captureError(e,t){if(!this.initialized||!this.faroInstance){console.warn("[FaroService] captureError called before initialization");return}try{this.faroInstance.api.pushError(e,t)}catch(a){console.error("[FaroService] Failed to capture error:",a)}}captureLog(e,t,a){if(!this.initialized||!this.faroInstance){console.warn("[FaroService] captureLog called before initialization");return}try{const s=this.mapLogLevel(e);this.faroInstance.api.pushLog([t],{level:s,context:a})}catch(s){console.error("[FaroService] Failed to capture log:",s)}}setUser(e,t){if(!this.initialized||!this.faroInstance){console.warn("[FaroService] setUser called before initialization");return}try{this.faroInstance.api.setUser({id:e,attributes:t})}catch(a){console.error("[FaroService] Failed to set user:",a)}}getSession(){if(!this.initialized||!this.faroInstance)return null;try{const e=this.faroInstance.api.getSession();if(e)return{id:e.id,attributes:{}}}catch(e){console.error("[FaroService] Failed to get session:",e)}return null}getSessionId(){return this.getSession()?.id??null}getConfig(){return this.config}mapLogLevel(e){return{debug:"debug",info:"info",warn:"warn",error:"error"}[e]||"info"}}function Yg(n){n.isInitialized()||console.warn("[FaroTraceEnricher] Faro not initialized, enricher will return empty attributes")}const Jg=u.createContext(null);function Xg({children:n,config:e,correlationId:t}){const[a,s]=u.useState(!1),i=Xe.getInstance(),o=u.useRef(null);u.useEffect(()=>((async()=>{try{const h=Zg({...e,correlationId:t});await i.initialize(h);const f=i.isInitialized();s(f),f&&(o.current||(o.current=new zg(i),rn.addTransport(o.current)),Yg(i))}catch(h){b.error(g.CONTEXT,"Failed to initialize Faro",{error:h instanceof Error?h:String(h)})}})(),()=>{o.current&&(rn.removeTransport(o.current),o.current=null)}),[e,t,i]);const l={captureError:(m,h)=>{i.captureError(m,h)},captureLog:(m,h,f)=>{i.captureLog(m,h,f)},setUser:(m,h)=>{i.setUser(m,h)},getSession:()=>i.getSession(),getSessionId:()=>i.getSessionId(),isInitialized:a};return d.jsx(Jg.Provider,{value:l,children:n})}class Qg{connection=null;async connect(e){return b.info(g.REPOSITORY,"Connecting to WebSocket",{url:e}),new Promise((t,a)=>{try{this.connection=new WebSocket(e);const s=this.connection;s.onopen=()=>{b.info(g.REPOSITORY,"WebSocket connected",{url:e}),this.connection?t(this.connection):a(new Error("WebSocket connection was lost"))},s.onerror=i=>{b.error(g.REPOSITORY,"WebSocket connection error",{url:e,error:i instanceof Error?i.message:String(i)}),a(new Error(`WebSocket connection failed: ${i}`))},s.onclose=()=>{b.debug(g.REPOSITORY,"WebSocket closed",{url:e}),this.connection=null}}catch(s){b.error(g.REPOSITORY,"Failed to create WebSocket",{url:e,error:s instanceof Error?s.message:String(s)}),a(new Error(`Failed to create WebSocket: ${s}`))}})}disconnect(){this.connection&&(b.info(g.REPOSITORY,"Disconnecting WebSocket"),this.connection.close(),this.connection=null)}send(e){if(!this.connection||this.connection.readyState!==WebSocket.OPEN)throw new Error("WebSocket is not connected");const t=typeof e=="string"?e:JSON.stringify(e);this.connection.send(t)}isConnected(){return this.connection!==null&&this.connection.readyState===WebSocket.OPEN}addEventListener(e,t){this.connection&&this.connection.addEventListener(e,t)}removeEventListener(e,t){this.connection&&this.connection.removeEventListener(e,t)}}class Pe{constructor(e,t,a,s){this.status=e,this.lastConnected=t,this.reconnectAttempts=a,this.error=s,this.validate()}validate(){if(!Pe.isValidStatus(this.status))throw new Error("Invalid connection status");if(this.reconnectAttempts<0)throw new Error("Reconnect attempts must be non-negative")}static isValidStatus(e){return["connecting","connected","disconnected","error"].includes(e)}static create(e,t={}){return new Pe(e,t.lastConnected??null,t.reconnectAttempts??0,t.error??null)}isConnected(){return this.status==="connected"}canReconnect(e){return this.status==="disconnected"&&this.reconnectAttempts{this.subscribers.delete(e),b.debug(g.SERVICE,"Message subscriber removed",{subscriberCount:this.subscribers.size})}}getConnectionState(){return this.connectionState}setMaxReconnectAttempts(e){this.maxReconnectAttempts=e}getSubscriberCount(){return this.subscribers.size}getReconnectAttempts(){return this.connectionState.reconnectAttempts}setupMessageHandler(){this.messageHandler&&this.webSocketRepository.removeEventListener("message",this.messageHandler),this.messageHandler=t=>{const a=t;let s;try{s=JSON.parse(a.data)}catch{s=a.data}this.subscribers.forEach(i=>{try{i(s)}catch(o){b.error(g.SERVICE,"Error in message subscriber",{error:o instanceof Error?o.message:String(o)})}})},this.webSocketRepository.addEventListener("message",this.messageHandler);const e=()=>{this.connectionState=Pe.create("disconnected"),this.connectionState.canReconnect(this.maxReconnectAttempts)&&this.scheduleReconnect()};this.webSocketRepository.addEventListener("close",e)}scheduleReconnect(){if(this.reconnectTimer||!this.currentUrl)return;const e=this.connectionState.reconnectAttempts,t=Math.min(this.reconnectDelay*2**e,3e4),a=e===0?"connection_lost":"retry";this.reconnectionCounter.inc({reason:a}),b.info(g.SERVICE,"Scheduling WebSocket reconnection",{attempt:e+1,maxAttempts:this.maxReconnectAttempts,delay:t}),this.reconnectTimer=setTimeout(async()=>{this.reconnectTimer=null;const s=Pe.create("connecting",{reconnectAttempts:e+1});if(this.connectionState=s,!this.currentUrl){b.warn(g.SERVICE,"Cannot reconnect: no URL stored");return}try{await this.connect(this.currentUrl)}catch(i){b.warn(g.SERVICE,"WebSocket reconnection failed",{attempt:e+1,error:i instanceof Error?i.message:String(i)})}},t)}}var Qe=(n=>(n.SINGLETON="singleton",n.TRANSIENT="transient",n))(Qe||{});class nb{services=new Map;singletonInstances=new Map;resolutionStack=[];register(e){this.services.has(e.name)&&b.warn(g.SERVICE,`Service '${e.name}' already registered, overwriting`,{service:e.name}),this.services.set(e.name,e),b.debug(g.SERVICE,`Service registered: ${e.name}`,{service:e.name,lifecycle:e.lifecycle,dependencies:e.dependencies||[]})}resolve(e){const t=this.services.get(e);if(!t){const a=new Error(`Service '${e}' not registered`);throw b.error(g.SERVICE,`Service resolution failed: ${e}`,{service:e,error:a.message}),a}if(this.resolutionStack.includes(e)){const a=[...this.resolutionStack,e].join(" -> "),s=new Error(`Circular dependency detected: ${a}`);throw b.error(g.SERVICE,"Circular dependency detected",{service:e,cycle:a,error:s.message}),s}if(t.lifecycle===Qe.SINGLETON&&this.singletonInstances.has(e))return b.debug(g.SERVICE,`Returning cached singleton: ${e}`,{service:e}),this.singletonInstances.get(e);this.resolutionStack.push(e);try{b.debug(g.SERVICE,`Resolving service: ${e}`,{service:e,lifecycle:t.lifecycle});const a=t.factory(this);return t.lifecycle===Qe.SINGLETON&&this.singletonInstances.set(e,a),this.resolutionStack.pop(),b.debug(g.SERVICE,`Service resolved: ${e}`,{service:e}),a}catch(a){throw this.resolutionStack.pop(),b.error(g.SERVICE,`Service resolution error: ${e}`,{service:e,error:a instanceof Error?a.message:String(a)}),a}}has(e){return this.services.has(e)}clear(){b.info(g.SERVICE,"Clearing DI container",{servicesCount:this.services.size,singletonsCount:this.singletonInstances.size}),this.services.clear(),this.singletonInstances.clear(),this.resolutionStack=[]}getRegisteredServices(){return Array.from(this.services.keys())}getDefinition(e){return this.services.get(e)}isSingletonCached(e){return this.singletonInstances.has(e)}}const dt=new nb;function ab(){b.info(g.SERVICE,"Registering application services"),dt.register({name:"WebSocketRepository",factory:()=>new Qg,lifecycle:Qe.SINGLETON}),dt.register({name:"WebSocketService",factory:n=>new tb(n.resolve("WebSocketRepository")),lifecycle:Qe.SINGLETON,dependencies:["WebSocketRepository"]}),dt.register({name:"SearchRepository",factory:()=>new Si,lifecycle:Qe.SINGLETON}),dt.register({name:"SearchService",factory:n=>new wi(n.resolve("SearchRepository")),lifecycle:Qe.SINGLETON,dependencies:["SearchRepository"]}),b.info(g.SERVICE,"All services registered",{servicesCount:dt.getRegisteredServices().length,services:dt.getRegisteredServices()})}const sb={EASTER_EGGS_ENABLED:!0,HAL_FINNEY_EGG:!0,PIZZA_DAY_EGG:!0,EASTER_EGG_ANALYTICS:!0};function Di(){return{...sb}}function nw(n){const e=Di();if(!e.EASTER_EGGS_ENABLED)return!1;switch(n){case"hal-finney":return e.HAL_FINNEY_EGG;case"pizza-day":return e.PIZZA_DAY_EGG;case"block-found-demo":return!0;default:return!1}}function ib(n){if(Di().EASTER_EGG_ANALYTICS)try{const t="blocksight_easter_eggs",a=sessionStorage.getItem(t),s=a?JSON.parse(a):[];s.push(n);const i=s.slice(-100);sessionStorage.setItem(t,JSON.stringify(i))}catch{}}function aw(){try{const e=sessionStorage.getItem("blocksight_easter_eggs");return e?JSON.parse(e):[]}catch{return[]}}function sw(){try{sessionStorage.removeItem("blocksight_easter_eggs")}catch{}}function rb(n){const e="0000000000000000000",t=Math.floor(Math.random()*4294967295).toString(16).padStart(8,"0"),a=n.toString(16).padStart(8,"0"),s="abcdef1234567890".repeat(3).slice(0,64-e.length-t.length-a.length);return(e+t+a+s).slice(0,64)}function ob(n){const e=n%1e3;return{kind:"real",id:{hash:rb(n),height:n},minedAtMs:Date.now(),txCount:2500+e%1e3,minFeeRate:1,maxFeeRate:150+e%100,medianFeeRate:10+e%10}}function cb({onComplete:n}){const{triggerAnimation:e}=Pi(),t=u.useRef(!1);return u.useEffect(()=>{if(t.current)return;t.current=!0;const a=926e3+Math.floor(Math.random()*1e3),s={previousTipHeight:a,newTipHeight:a+1,foundAtMs:Date.now(),newBlock:ob(a+1)};e(s),n()},[e,n]),null}const Ni={activeEgg:null,activationCount:{},lastActivated:{}},Oi=u.createContext({state:Ni,activate:()=>{},deactivate:()=>{},isActive:()=>!1,hasActiveEgg:!1});function iw(){return u.useContext(Oi)}function lb({children:n}){const[e,t]=u.useState(Ni),a=u.useCallback(m=>{t(h=>{if(h.activeEgg!==null)return h;const f=(h.activationCount[m]||0)+1;return ib({eggId:m,timestamp:Date.now(),sessionCount:f}),{activeEgg:m,activationCount:{...h.activationCount,[m]:f},lastActivated:{...h.lastActivated,[m]:Date.now()}}})},[]),s=u.useCallback(()=>{t(m=>({...m,activeEgg:null}))},[]),i=u.useCallback(m=>e.activeEgg===m,[e.activeEgg]),o=e.activeEgg!==null,l=u.useMemo(()=>({state:e,activate:a,deactivate:s,isActive:i,hasActiveEgg:o}),[e,a,s,i,o]);return d.jsx(Oi.Provider,{value:l,children:n})}const hs="/images/halrunning-D8swcRJo.png",ms="/images/X-CjyehOJ3.png",db="_egg_1apgo_27",ub="_floatImg_1apgo_45",hb="_show_1apgo_69",mb="_tweetImage_1apgo_81",pb="_active_1apgo_141",fb="_runner_1apgo_195",gb="_reducedMotionContainer_1apgo_245",bb="_tweetStatic_1apgo_295",yb="_runnerStatic_1apgo_309",vb="_runnerSprite_1apgo_321",Te={egg:db,floatImg:ub,show:hb,tweetImage:mb,active:pb,runner:fb,reducedMotionContainer:gb,tweetStatic:bb,runnerStatic:yb,runnerSprite:vb},kb=12e3;function Sb({onComplete:n,reducedMotion:e}){const[t,a]=u.useState(!1),s=u.useRef(!1),[i]=u.useState(()=>Math.floor(8+Math.random()*73)),o=u.useCallback(()=>{s.current||(s.current=!0,n())},[n]),l=u.useCallback(m=>{m.animationName.includes("crossRTL")&&(a(!1),o())},[o]);return u.useEffect(()=>{const m=setTimeout(()=>{a(!0)},50),h=setTimeout(()=>{o()},kb+500);return()=>{clearTimeout(m),clearTimeout(h)}},[o]),e?d.jsxs("div",{className:Te.reducedMotionContainer,children:[d.jsx("div",{className:Te.tweetStatic,children:d.jsx("img",{src:ms,alt:"",className:Te.tweetImage})}),d.jsx("div",{className:Te.runnerStatic,style:{bottom:i},children:d.jsx("div",{className:Te.runnerSprite,style:{backgroundImage:`url(${hs})`}})})]}):d.jsxs(d.Fragment,{children:[d.jsx("div",{className:`${Te.floatImg} ${t?Te.show:""}`,children:d.jsx("img",{src:ms,alt:"",className:Te.tweetImage})}),d.jsx("div",{className:`${Te.egg} ${t?Te.active:""}`,style:{"--bottom":`${i}px`},onAnimationEnd:l,children:d.jsx("div",{className:Te.runner,style:{backgroundImage:`url(${hs})`}})})]})}const ps="data:image/x-icon;base64,AAACAAEAICAAAB0ADwADBAAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAgAAAAIAgGAAAAc3p69AAAA8pJREFUeJzll0tsW0UUhr9z7SR27MROmiqOQ94gQiqRpIkCtEUI1KiqxIICYgVqJMQmEqzYIVas2bYbduwQYscGqRKqKtQK1AdtgZBA3k9sx47fj3sPCz/ikEedUKdI/Jp7R3OlO/8/58yZc0YoQFUFsHE8MEVEj4nrYIiqioioqnYDZwAFpEp8xbl/EJE5VRVU1Q6gqhN6fJgocNrtZerSQK7w2KkOinOnix/KiaRsXC0BxblLLjaqSFQRjkeAKvn9txuP0dSab2qVhogghgGyf1AdXoBqocv3Ygh5l0q+ye6zLJuMYNTUYbM7KhWg2xFbtJwUXoXVSNmqLAUrlyWX3CSx9BAzHGT5qxuIFcLWn0AyK7SNvkvzuclKBcj2PpWSJDAVMxXHjMdJRqNktpYgM0cucI8ar4CZRNeWCd6fZurbdXxjXtqdvehqDId/ZE+mPQVocgsrGUBcXmLBALlUEjFM0jMLZOc3MWd/R2ceEo0t0/lRDy5XLdbmFsmsRSgGUcNP26utuNpjSHoL9+hFnD0vVC5g/udrpDbu4nG4MesEuyZxRgLULNwhdn+FzWUvpHN4RlqQdC2R5QjheBIz6ySzBPpHiuxGkKX5Bp65egV3xwD53KP8M/D2FNDYNczqyiqrs7M0tULv0/2Y0zdxdPbR+dwATUvrxDImmXiQmZ+mEE8DDT39NEotmZopcMdpcbrwXf4CV9vgTtdWYoFmXzcvXZoknUox9f1V4rkcnt7zbN3+BtvYEIlQmOhaiubX3sDl8NLY4Sc2dYfVa1/j6XZh8zfhefmTPLmVA8O2Jzm77FGEKqoWdQ4Hp8Y/JBxIEF6fJrQYJHT9FpF4AsfAGCZuDIedtV9+JOl00HBmnESugfqRy3gHzqOWCcaOk7cyCyCCIKhlYrPZqW8dZjMdJufxsXrrHrWDoyyEojz47gqNJ07QNfQi1uISLeZf+E6/w8nRCVQtxHh0fXPgQSSSN1BL1/ME/rxO3eAgc1PznPT4uXvzBpKFc29/TP/YOIu/3Sa28Sv+029xmJLi4JNQBFULl7uJenWyHlrE0dvPyuwDOp4d4tLk53h9HQD0DZ0Fzpb/WhEqS0YitI+9SWR9DQOLp069wnuffonX14FlmQCoZeV9vk/S2Q+PzAUiBqoWjW19tA2/TnBhjgsffIZht6OWhVHwsxhHS6wVJaP8XlBGLryPYRiIYaCqRyY9tICCDGylCk53JKN/gyMu4fEVzf+TkuwAlO8BZbssrxaKc5ditVxAXWFc7ZK8yAX8F65mTxolBU/qev43RMXs4V3hCpcAAAAASUVORK5CYII=",fs="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAADyklEQVR4nOWXS2xbRRSGv3PtJHbsxE6aKo5D3iBCKpGkiQK0RQjUqKrEggJiBWokxCYSrNghVqzZtht27BBixwapEqoq1ArUB22BkEDeT2zHjt+Pew8LP+KQR51Qp0j8mntHc6U7/z/nzJlzRihAVQWwcTwwRUSPietgiKqKiKiqdgNnAAWkSnzFuX8QkTlVFVTVDqCqE3p8mChw2u1l6tJArvDYqQ6Kc6eLH8qJpGxcLQHFuUsuNqpIVBGOR4Aq+f23G4/R1JpvapWGiCCGAbJ/UB1egGqhy/diCHmXSr7J7rMsm4xg1NRhszsqFaDbEVu0nBRehdVI2aosBSuXJZfcJLH0EDMcZPmrG4gVwtafQDIrtI2+S/O5yUoFyPY+lZIkMBUzFceMx0lGo2S2liAzRy5wjxqvgJlE15YJ3p9m6tt1fGNe2p296GoMh39kT6Y9BWhyCysZQFxeYsEAuVQSMUzSMwtk5zcxZ39HZx4SjS3T+VEPLlct1uYWyaxFKAZRw0/bq6242mNIegv36EWcPS9ULmD+52ukNu7icbgx6wS7JnFGAtQs3CF2f4XNZS+kc3hGWpB0LZHlCOF4EjPrJLME+keK7EaQpfkGnrl6BXfHAPnco/wz8PYU0Ng1zOrKKquzszS1Qu/T/ZjTN3F09tH53ABNS+vEMiaZeJCZn6YQTwMNPf00Si2Zmilwx2lxuvBd/gJX2+BO11ZigWZfNy9dmiSdSjH1/VXiuRye3vNs3f4G29gQiVCY6FqK5tfewOXw0tjhJzZ1h9VrX+PpdmHzN+F5+ZM8uZUDw7YnObvsUYQqqhZ1Dgenxj8kHEgQXp8mtBgkdP0WkXgCx8AYJm4Mh521X34k6XTQcGacRK6B+pHLeAfOo5YJxo6TtzILIIIgqGVis9mpbx1mMx0m5/GxeusetYOjLISiPPjuCo0nTtA19CLW4hIt5l/4Tr/DydEJVC3EeHR9c+BBJJI3UEvX8wT+vE7d4CBzU/Oc9Pi5e/MGkoVzb39M/9g4i7/dJrbxK/7Tb3GYkuLgk1AEVQuXu4l6dbIeWsTR28/K7AM6nh3i0uTneH0dAPQNnQXOlv9aESpLRiK0j71JZH0NA4unTr3Ce59+idfXgWWZAKhl5X2+T9LZD4/MBSIGqhaNbX20Db9OcGGOCx98hmG3o5aFUfCzGEdLrBUlo/xeUEYuvI9hGIhhoKpHJj20gIIMbKUKTncko3+DIy7h8RXN/5OS7ACU7wFluyyvFopzl2K1XEBdYVztkrzIBfwXrmZPGiUFT+p6/jdExezhXeEKlwAAAABJRU5ErkJggg==",Rn="pizza-day-cursor-style",Qt=29,en=15;function wb(){return u.useEffect(()=>{if(document.getElementById(Rn))return;const n=document.createElement("style");return n.id=Rn,n.textContent=` /* Pizza Day Cursor - Bitcoin Pizza Day (May 22) */ html, html * { cursor: url('${ps}') ${Qt} ${en}, url('${fs}') ${Qt} ${en}, auto !important; } /* Preserve text cursor in editable elements for UX */ input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="url"], input[type="tel"], input[type="number"], input:not([type]), textarea, [contenteditable="true"], [contenteditable=""] { cursor: text !important; } /* Preserve pointer cursor for interactive elements */ a, button, [role="button"], input[type="submit"], input[type="button"], input[type="reset"], select, label[for] { cursor: url('${ps}') ${Qt} ${en}, url('${fs}') ${Qt} ${en}, pointer !important; } `,document.head.appendChild(n),()=>{const e=document.getElementById(Rn);e&&e.remove()}},[]),null}const Le=new Map;Le.set("hal-finney",{id:"hal-finney",name:"Running Bitcoin",triggerType:"keyboard-sequence",triggerValue:"halfinney",duration:12e3,enabled:!0,component:Sb});Le.set("pizza-day",{id:"pizza-day",name:"Pizza Day Cursor",triggerType:"date-based",triggerValue:"05-22",duration:864e5,enabled:!0,component:wb});Le.set("block-found-demo",{id:"block-found-demo",name:"Block Found Demo",triggerType:"keyboard-sequence",triggerValue:"gabrielosem",duration:0,enabled:!0,component:cb});const rw={get(n){return Le.get(n)},has(n){return Le.has(n)},getAll(){return Array.from(Le.values())},getEnabled(){return Array.from(Le.values()).filter(n=>n.enabled)},register(n){Le.set(n.id,n)},unregister(n){return Le.delete(n)},get size(){return Le.size}},gs="/sounds/block-found.ogg",_b="/sounds/block-found.mp3",bs=.7,ys=.3;function Tb(){const n=new Audio;return n.canPlayType('audio/ogg; codecs="vorbis"')?gs:n.canPlayType("audio/mpeg")?_b:gs}function Eb(){const n=u.useRef(null),e=u.useRef(!1),{phase:t,isAnimating:a}=Ii(),{flags:s}=gn(),i=s.effects.blockFoundSound,[o,l]=u.useState(()=>typeof document<"u"&&document.visibilityState==="visible");u.useEffect(()=>{if(typeof document>"u")return;const m=()=>{l(document.visibilityState==="visible")};return document.addEventListener("visibilitychange",m),()=>document.removeEventListener("visibilitychange",m)},[]),u.useEffect(()=>{if(!i)return;const m=Tb(),h=new Audio(m);return h.preload="auto",h.volume=o?bs:ys,n.current=h,()=>{if(n.current){try{n.current.pause()}catch{}n.current.src="",n.current=null}}},[i,o]),u.useEffect(()=>{n.current&&(n.current.volume=o?bs:ys)},[o]),u.useEffect(()=>{a||(e.current=!1)},[a]),u.useEffect(()=>{!i||!n.current||t==="anticipation"&&!e.current&&(e.current=!0,n.current.currentTime=0,n.current.play().catch(m=>{console.debug("[BlockFoundSound] Audio playback failed:",m.message)}))},[t,i])}function Cb(){return Eb(),null}var oe=(n=>(n.HEALTHY="healthy",n.DEGRADED="degraded",n.UNHEALTHY="unhealthy",n))(oe||{});const xb=5e3,Ab={websocket:!0,localStorage:!0,fetch:!0,performance:!0,crypto:!1};class Bb{name="browser";critical=!1;requirements;constructor(e){this.requirements={...Ab,...e}}async check(){const e=Date.now(),t=[];if(this.requirements.websocket&&typeof WebSocket>"u"&&t.push("WebSocket"),this.requirements.localStorage)try{const s="__health_check__";localStorage.setItem(s,"test"),localStorage.removeItem(s)}catch{t.push("localStorage")}this.requirements.fetch&&typeof fetch>"u"&&t.push("fetch"),this.requirements.performance&&typeof performance>"u"&&t.push("Performance"),this.requirements.crypto&&typeof crypto>"u"&&t.push("Crypto");const a=Date.now()-e;return t.length===0?{status:oe.HEALTHY,message:"All required APIs available",duration:a}:{status:oe.UNHEALTHY,message:`Missing browser APIs: ${t.join(", ")}`,duration:a,details:{missing:t}}}}class Rb{name="datastore";critical=!1;maxDataAge;constructor(e=300*1e3){this.maxDataAge=e}async check(){const e=Date.now();try{const t=O.getState(),a=Date.now()-e,s=t.system?.health;if(!s)return{status:oe.DEGRADED,message:"No system health data available",duration:a,details:{hasData:!1}};const i=s.lastCheck||0,o=Date.now()-i,l=o>this.maxDataAge,m=s.services||{},h=Object.entries(m),f=h.filter(([,E])=>E).length,y=h.length,S=y>0?f/y*100:0,v=s.status||"unknown";return v==="unhealthy"||S<50?{status:oe.UNHEALTHY,message:`Backend unhealthy: ${f}/${y} services up`,duration:a,details:{backendStatus:v,services:m,dataAge:o,isDataStale:l,serviceHealthPercent:S}}:v==="degraded"||l||S<80?{status:oe.DEGRADED,message:l?`Data is ${Math.round(o/1e3)}s old (stale)`:`Some services degraded: ${f}/${y} up`,duration:a,details:{backendStatus:v,services:m,dataAge:o,isDataStale:l,serviceHealthPercent:S}}:{status:oe.HEALTHY,message:`All systems operational (${f}/${y} services)`,duration:a,details:{backendStatus:v,services:m,dataAge:o,serviceHealthPercent:S}}}catch(t){const a=Date.now()-e;return{status:oe.UNHEALTHY,message:t instanceof Error?t.message:"Unknown error checking DataStore",duration:a}}}}var V;(function(n){n.assertEqual=s=>{};function e(s){}n.assertIs=e;function t(s){throw new Error}n.assertNever=t,n.arrayToEnum=s=>{const i={};for(const o of s)i[o]=o;return i},n.getValidEnumValues=s=>{const i=n.objectKeys(s).filter(l=>typeof s[s[l]]!="number"),o={};for(const l of i)o[l]=s[l];return n.objectValues(o)},n.objectValues=s=>n.objectKeys(s).map(function(i){return s[i]}),n.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.push(o);return i},n.find=(s,i)=>{for(const o of s)if(i(o))return o},n.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function a(s,i=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}n.joinValues=a,n.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(V||(V={}));var vs;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(vs||(vs={}));const I=V.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ve=n=>{switch(typeof n){case"undefined":return I.undefined;case"string":return I.string;case"number":return Number.isNaN(n)?I.nan:I.number;case"boolean":return I.boolean;case"function":return I.function;case"bigint":return I.bigint;case"symbol":return I.symbol;case"object":return Array.isArray(n)?I.array:n===null?I.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?I.promise:typeof Map<"u"&&n instanceof Map?I.map:typeof Set<"u"&&n instanceof Set?I.set:typeof Date<"u"&&n instanceof Date?I.date:I.object;default:return I.unknown}},C=V.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"]);class Fe extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(i){return i.message},a={_errors:[]},s=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)a._errors.push(t(o));else{let l=a,m=0;for(;mt.message){const t={},a=[];for(const s of this.issues)if(s.path.length>0){const i=s.path[0];t[i]=t[i]||[],t[i].push(e(s))}else a.push(e(s));return{formErrors:a,fieldErrors:t}}get formErrors(){return this.flatten()}}Fe.create=n=>new Fe(n);const jn=(n,e)=>{let t;switch(n.code){case C.invalid_type:n.received===I.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case C.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,V.jsonStringifyReplacer)}`;break;case C.unrecognized_keys:t=`Unrecognized key(s) in object: ${V.joinValues(n.keys,", ")}`;break;case C.invalid_union:t="Invalid input";break;case C.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${V.joinValues(n.options)}`;break;case C.invalid_enum_value:t=`Invalid enum value. Expected ${V.joinValues(n.options)}, received '${n.received}'`;break;case C.invalid_arguments:t="Invalid function arguments";break;case C.invalid_return_type:t="Invalid function return type";break;case C.invalid_date:t="Invalid date";break;case C.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?t=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?t=`Invalid input: must end with "${n.validation.endsWith}"`:V.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case C.too_small:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="bigint"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:t="Invalid input";break;case C.too_big:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:t="Invalid input";break;case C.custom:t="Invalid input";break;case C.invalid_intersection_types:t="Intersection results could not be merged";break;case C.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case C.not_finite:t="Number must be finite";break;default:t=e.defaultError,V.assertNever(n)}return{message:t}};let Ib=jn;function Pb(){return Ib}const Lb=n=>{const{data:e,path:t,errorMaps:a,issueData:s}=n,i=[...t,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let l="";const m=a.filter(h=>!!h).slice().reverse();for(const h of m)l=h(o,{data:e,defaultError:l}).message;return{...s,path:i,message:l}};function A(n,e){const t=Pb(),a=Lb({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,t,t===jn?void 0:jn].filter(s=>!!s)});n.common.issues.push(a)}class he{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const a=[];for(const s of t){if(s.status==="aborted")return H;s.status==="dirty"&&e.dirty(),a.push(s.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,t){const a=[];for(const s of t){const i=await s.key,o=await s.value;a.push({key:i,value:o})}return he.mergeObjectSync(e,a)}static mergeObjectSync(e,t){const a={};for(const s of t){const{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return H;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(a[i.value]=o.value)}return{status:e.value,value:a}}}const H=Object.freeze({status:"aborted"}),Nt=n=>({status:"dirty",value:n}),Se=n=>({status:"valid",value:n}),ks=n=>n.status==="aborted",Ss=n=>n.status==="dirty",kt=n=>n.status==="valid",cn=n=>typeof Promise<"u"&&n instanceof Promise;var P;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e?.message})(P||(P={}));class Ne{constructor(e,t,a,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=a,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const ws=(n,e)=>{if(kt(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new Fe(n.common.issues);return this._error=t,this._error}}};function j(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:a,description:s}=n;if(e&&(t||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(o,l)=>{const{message:m}=n;return o.code==="invalid_enum_value"?{message:m??l.defaultError}:typeof l.data>"u"?{message:m??a??l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:m??t??l.defaultError}},description:s}}class z{get description(){return this._def.description}_getType(e){return Ve(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Ve(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new he,ctx:{common:e.parent.common,data:e.data,parsedType:Ve(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(cn(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const a=this.safeParse(e,t);if(a.success)return a.data;throw a.error}safeParse(e,t){const a={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ve(e)},s=this._parseSync({data:e,path:a.path,parent:a});return ws(a,s)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ve(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:t});return kt(a)?{value:a.value}:{issues:t.common.issues}}catch(a){a?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(a=>kt(a)?{value:a.value}:{issues:t.common.issues})}async parseAsync(e,t){const a=await this.safeParseAsync(e,t);if(a.success)return a.data;throw a.error}async safeParseAsync(e,t){const a={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ve(e)},s=this._parse({data:e,path:a.path,parent:a}),i=await(cn(s)?s:Promise.resolve(s));return ws(a,i)}refine(e,t){const a=s=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(s):t;return this._refinement((s,i)=>{const o=e(s),l=()=>i.addIssue({code:C.custom,...a(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(m=>m?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(e,t){return this._refinement((a,s)=>e(a)?!0:(s.addIssue(typeof t=="function"?t(a,s):t),!1))}_refinement(e){return new _t({schema:this,typeName:M.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}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),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return $e.create(this,this._def)}nullable(){return Tt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return De.create(this)}promise(){return mn.create(this,this._def)}or(e){return dn.create([this,e],this._def)}and(e){return un.create(this,e,this._def)}transform(e){return new _t({...j(this._def),schema:this,typeName:M.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new qn({...j(this._def),innerType:this,defaultValue:t,typeName:M.ZodDefault})}brand(){return new ny({typeName:M.ZodBranded,type:this,...j(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new $n({...j(this._def),innerType:this,catchValue:t,typeName:M.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return la.create(this,e)}readonly(){return Gn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Db=/^c[^\s-]{8,}$/i,Nb=/^[0-9a-z]+$/,Ob=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Mb=/^[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,Hb=/^[a-z0-9_-]{21}$/i,Fb=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,jb=/^[-+]?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)?)??$/,Ub=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Wb="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let In;const zb=/^(?:(?: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])$/,Vb=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,qb=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,$b=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Gb=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Kb=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Mi="((\\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])))",Zb=new RegExp(`^${Mi}$`);function Hi(n){let e="[0-5]\\d";n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`);const t=n.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function Yb(n){return new RegExp(`^${Hi(n)}$`)}function Jb(n){let e=`${Mi}T${Hi(n)}`;const t=[];return t.push(n.local?"Z?":"Z"),n.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Xb(n,e){return!!((e==="v4"||!e)&&zb.test(n)||(e==="v6"||!e)&&qb.test(n))}function Qb(n,e){if(!Fb.test(n))return!1;try{const[t]=n.split(".");if(!t)return!1;const a=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),s=JSON.parse(atob(a));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function ey(n,e){return!!((e==="v4"||!e)&&Vb.test(n)||(e==="v6"||!e)&&$b.test(n))}class He extends z{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==I.string){const i=this._getOrReturnCtx(e);return A(i,{code:C.invalid_type,expected:I.string,received:i.parsedType}),H}const a=new he;let s;for(const i of this._def.checks)if(i.kind==="min")e.data.lengthi.value&&(s=this._getOrReturnCtx(e,s),A(s,{code:C.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),a.dirty());else if(i.kind==="length"){const o=e.data.length>i.value,l=e.data.lengthe.test(s),{validation:t,code:C.invalid_string,...P.errToObj(a)})}_addCheck(e){return new He({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...P.errToObj(e)})}url(e){return this._addCheck({kind:"url",...P.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...P.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...P.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...P.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...P.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...P.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...P.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...P.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...P.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...P.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...P.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...P.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,...P.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,...P.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...P.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...P.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...P.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...P.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...P.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...P.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...P.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...P.errToObj(t)})}nonempty(e){return this.min(1,P.errToObj(e))}trim(){return new He({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new He({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new He({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get 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 isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew He({checks:[],typeName:M.ZodString,coerce:n?.coerce??!1,...j(n)});function ty(n,e){const t=(n.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,s=t>a?t:a,i=Number.parseInt(n.toFixed(s).replace(".","")),o=Number.parseInt(e.toFixed(s).replace(".",""));return i%o/10**s}class St extends z{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)!==I.number){const i=this._getOrReturnCtx(e);return A(i,{code:C.invalid_type,expected:I.number,received:i.parsedType}),H}let a;const s=new he;for(const i of this._def.checks)i.kind==="int"?V.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),A(a,{code:C.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.datai.value:e.data>=i.value)&&(a=this._getOrReturnCtx(e,a),A(a,{code:C.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?ty(e.data,i.value)!==0&&(a=this._getOrReturnCtx(e,a),A(a,{code:C.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),A(a,{code:C.not_finite,message:i.message}),s.dirty()):V.assertNever(i);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,P.toString(t))}gt(e,t){return this.setLimit("min",e,!1,P.toString(t))}lte(e,t){return this.setLimit("max",e,!0,P.toString(t))}lt(e,t){return this.setLimit("max",e,!1,P.toString(t))}setLimit(e,t,a,s){return new St({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:P.toString(s)}]})}_addCheck(e){return new St({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:P.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:P.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:P.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:P.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:P.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:P.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:P.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:P.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:P.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuee.kind==="int"||e.kind==="multipleOf"&&V.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(t===null||a.value>t)&&(t=a.value):a.kind==="max"&&(e===null||a.valuenew St({checks:[],typeName:M.ZodNumber,coerce:n?.coerce||!1,...j(n)});class jt extends z{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==I.bigint)return this._getInvalidInput(e);let a;const s=new he;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.datai.value:e.data>=i.value)&&(a=this._getOrReturnCtx(e,a),A(a,{code:C.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),A(a,{code:C.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):V.assertNever(i);return{status:s.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return A(t,{code:C.invalid_type,expected:I.bigint,received:t.parsedType}),H}gte(e,t){return this.setLimit("min",e,!0,P.toString(t))}gt(e,t){return this.setLimit("min",e,!1,P.toString(t))}lte(e,t){return this.setLimit("max",e,!0,P.toString(t))}lt(e,t){return this.setLimit("max",e,!1,P.toString(t))}setLimit(e,t,a,s){return new jt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:P.toString(s)}]})}_addCheck(e){return new jt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:P.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:P.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:P.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:P.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:P.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew jt({checks:[],typeName:M.ZodBigInt,coerce:n?.coerce??!1,...j(n)});class Un extends z{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==I.boolean){const a=this._getOrReturnCtx(e);return A(a,{code:C.invalid_type,expected:I.boolean,received:a.parsedType}),H}return Se(e.data)}}Un.create=n=>new Un({typeName:M.ZodBoolean,coerce:n?.coerce||!1,...j(n)});class ln extends z{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==I.date){const i=this._getOrReturnCtx(e);return A(i,{code:C.invalid_type,expected:I.date,received:i.parsedType}),H}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return A(i,{code:C.invalid_date}),H}const a=new he;let s;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()i.value&&(s=this._getOrReturnCtx(e,s),A(s,{code:C.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),a.dirty()):V.assertNever(i);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ln({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:P.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:P.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew ln({checks:[],coerce:n?.coerce||!1,typeName:M.ZodDate,...j(n)});class _s extends z{_parse(e){if(this._getType(e)!==I.symbol){const a=this._getOrReturnCtx(e);return A(a,{code:C.invalid_type,expected:I.symbol,received:a.parsedType}),H}return Se(e.data)}}_s.create=n=>new _s({typeName:M.ZodSymbol,...j(n)});class Ts extends z{_parse(e){if(this._getType(e)!==I.undefined){const a=this._getOrReturnCtx(e);return A(a,{code:C.invalid_type,expected:I.undefined,received:a.parsedType}),H}return Se(e.data)}}Ts.create=n=>new Ts({typeName:M.ZodUndefined,...j(n)});class Es extends z{_parse(e){if(this._getType(e)!==I.null){const a=this._getOrReturnCtx(e);return A(a,{code:C.invalid_type,expected:I.null,received:a.parsedType}),H}return Se(e.data)}}Es.create=n=>new Es({typeName:M.ZodNull,...j(n)});class Cs extends z{constructor(){super(...arguments),this._any=!0}_parse(e){return Se(e.data)}}Cs.create=n=>new Cs({typeName:M.ZodAny,...j(n)});class Wn extends z{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Se(e.data)}}Wn.create=n=>new Wn({typeName:M.ZodUnknown,...j(n)});class Ke extends z{_parse(e){const t=this._getOrReturnCtx(e);return A(t,{code:C.invalid_type,expected:I.never,received:t.parsedType}),H}}Ke.create=n=>new Ke({typeName:M.ZodNever,...j(n)});class xs extends z{_parse(e){if(this._getType(e)!==I.undefined){const a=this._getOrReturnCtx(e);return A(a,{code:C.invalid_type,expected:I.void,received:a.parsedType}),H}return Se(e.data)}}xs.create=n=>new xs({typeName:M.ZodVoid,...j(n)});class De extends z{_parse(e){const{ctx:t,status:a}=this._processInputParams(e),s=this._def;if(t.parsedType!==I.array)return A(t,{code:C.invalid_type,expected:I.array,received:t.parsedType}),H;if(s.exactLength!==null){const o=t.data.length>s.exactLength.value,l=t.data.lengths.maxLength.value&&(A(t,{code:C.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),a.dirty()),t.common.async)return Promise.all([...t.data].map((o,l)=>s.type._parseAsync(new Ne(t,o,t.path,l)))).then(o=>he.mergeArray(a,o));const i=[...t.data].map((o,l)=>s.type._parseSync(new Ne(t,o,t.path,l)));return he.mergeArray(a,i)}get element(){return this._def.type}min(e,t){return new De({...this._def,minLength:{value:e,message:P.toString(t)}})}max(e,t){return new De({...this._def,maxLength:{value:e,message:P.toString(t)}})}length(e,t){return new De({...this._def,exactLength:{value:e,message:P.toString(t)}})}nonempty(e){return this.min(1,e)}}De.create=(n,e)=>new De({type:n,minLength:null,maxLength:null,exactLength:null,typeName:M.ZodArray,...j(e)});function pt(n){if(n instanceof ae){const e={};for(const t in n.shape){const a=n.shape[t];e[t]=$e.create(pt(a))}return new ae({...n._def,shape:()=>e})}else return n instanceof De?new De({...n._def,type:pt(n.element)}):n instanceof $e?$e.create(pt(n.unwrap())):n instanceof Tt?Tt.create(pt(n.unwrap())):n instanceof at?at.create(n.items.map(e=>pt(e))):n}class ae extends z{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=V.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==I.object){const h=this._getOrReturnCtx(e);return A(h,{code:C.invalid_type,expected:I.object,received:h.parsedType}),H}const{status:a,ctx:s}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof Ke&&this._def.unknownKeys==="strip"))for(const h in s.data)o.includes(h)||l.push(h);const m=[];for(const h of o){const f=i[h],y=s.data[h];m.push({key:{status:"valid",value:h},value:f._parse(new Ne(s,y,s.path,h)),alwaysSet:h in s.data})}if(this._def.catchall instanceof Ke){const h=this._def.unknownKeys;if(h==="passthrough")for(const f of l)m.push({key:{status:"valid",value:f},value:{status:"valid",value:s.data[f]}});else if(h==="strict")l.length>0&&(A(s,{code:C.unrecognized_keys,keys:l}),a.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const h=this._def.catchall;for(const f of l){const y=s.data[f];m.push({key:{status:"valid",value:f},value:h._parse(new Ne(s,y,s.path,f)),alwaysSet:f in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const h=[];for(const f of m){const y=await f.key,S=await f.value;h.push({key:y,value:S,alwaysSet:f.alwaysSet})}return h}).then(h=>he.mergeObjectSync(a,h)):he.mergeObjectSync(a,m)}get shape(){return this._def.shape()}strict(e){return P.errToObj,new ae({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,a)=>{const s=this._def.errorMap?.(t,a).message??a.defaultError;return t.code==="unrecognized_keys"?{message:P.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new ae({...this._def,unknownKeys:"strip"})}passthrough(){return new ae({...this._def,unknownKeys:"passthrough"})}extend(e){return new ae({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ae({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:M.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ae({...this._def,catchall:e})}pick(e){const t={};for(const a of V.objectKeys(e))e[a]&&this.shape[a]&&(t[a]=this.shape[a]);return new ae({...this._def,shape:()=>t})}omit(e){const t={};for(const a of V.objectKeys(this.shape))e[a]||(t[a]=this.shape[a]);return new ae({...this._def,shape:()=>t})}deepPartial(){return pt(this)}partial(e){const t={};for(const a of V.objectKeys(this.shape)){const s=this.shape[a];e&&!e[a]?t[a]=s:t[a]=s.optional()}return new ae({...this._def,shape:()=>t})}required(e){const t={};for(const a of V.objectKeys(this.shape))if(e&&!e[a])t[a]=this.shape[a];else{let i=this.shape[a];for(;i instanceof $e;)i=i._def.innerType;t[a]=i}return new ae({...this._def,shape:()=>t})}keyof(){return Fi(V.objectKeys(this.shape))}}ae.create=(n,e)=>new ae({shape:()=>n,unknownKeys:"strip",catchall:Ke.create(),typeName:M.ZodObject,...j(e)});ae.strictCreate=(n,e)=>new ae({shape:()=>n,unknownKeys:"strict",catchall:Ke.create(),typeName:M.ZodObject,...j(e)});ae.lazycreate=(n,e)=>new ae({shape:n,unknownKeys:"strip",catchall:Ke.create(),typeName:M.ZodObject,...j(e)});class dn extends z{_parse(e){const{ctx:t}=this._processInputParams(e),a=this._def.options;function s(i){for(const l of i)if(l.result.status==="valid")return l.result;for(const l of i)if(l.result.status==="dirty")return t.common.issues.push(...l.ctx.common.issues),l.result;const o=i.map(l=>new Fe(l.ctx.common.issues));return A(t,{code:C.invalid_union,unionErrors:o}),H}if(t.common.async)return Promise.all(a.map(async i=>{const o={...t,common:{...t.common,issues:[]},parent:null};return{result:await i._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(s);{let i;const o=[];for(const m of a){const h={...t,common:{...t.common,issues:[]},parent:null},f=m._parseSync({data:t.data,path:t.path,parent:h});if(f.status==="valid")return f;f.status==="dirty"&&!i&&(i={result:f,ctx:h}),h.common.issues.length&&o.push(h.common.issues)}if(i)return t.common.issues.push(...i.ctx.common.issues),i.result;const l=o.map(m=>new Fe(m));return A(t,{code:C.invalid_union,unionErrors:l}),H}}get options(){return this._def.options}}dn.create=(n,e)=>new dn({options:n,typeName:M.ZodUnion,...j(e)});function zn(n,e){const t=Ve(n),a=Ve(e);if(n===e)return{valid:!0,data:n};if(t===I.object&&a===I.object){const s=V.objectKeys(e),i=V.objectKeys(n).filter(l=>s.indexOf(l)!==-1),o={...n,...e};for(const l of i){const m=zn(n[l],e[l]);if(!m.valid)return{valid:!1};o[l]=m.data}return{valid:!0,data:o}}else if(t===I.array&&a===I.array){if(n.length!==e.length)return{valid:!1};const s=[];for(let i=0;i{if(ks(i)||ks(o))return H;const l=zn(i.value,o.value);return l.valid?((Ss(i)||Ss(o))&&t.dirty(),{status:t.value,value:l.data}):(A(a,{code:C.invalid_intersection_types}),H)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([i,o])=>s(i,o)):s(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}un.create=(n,e,t)=>new un({left:n,right:e,typeName:M.ZodIntersection,...j(t)});class at extends z{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==I.array)return A(a,{code:C.invalid_type,expected:I.array,received:a.parsedType}),H;if(a.data.lengththis._def.items.length&&(A(a,{code:C.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const i=[...a.data].map((o,l)=>{const m=this._def.items[l]||this._def.rest;return m?m._parse(new Ne(a,o,a.path,l)):null}).filter(o=>!!o);return a.common.async?Promise.all(i).then(o=>he.mergeArray(t,o)):he.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new at({...this._def,rest:e})}}at.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new at({items:n,typeName:M.ZodTuple,rest:null,...j(e)})};class hn extends z{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==I.object)return A(a,{code:C.invalid_type,expected:I.object,received:a.parsedType}),H;const s=[],i=this._def.keyType,o=this._def.valueType;for(const l in a.data)s.push({key:i._parse(new Ne(a,l,a.path,l)),value:o._parse(new Ne(a,a.data[l],a.path,l)),alwaysSet:l in a.data});return a.common.async?he.mergeObjectAsync(t,s):he.mergeObjectSync(t,s)}get element(){return this._def.valueType}static create(e,t,a){return t instanceof z?new hn({keyType:e,valueType:t,typeName:M.ZodRecord,...j(a)}):new hn({keyType:He.create(),valueType:e,typeName:M.ZodRecord,...j(t)})}}class As extends z{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==I.map)return A(a,{code:C.invalid_type,expected:I.map,received:a.parsedType}),H;const s=this._def.keyType,i=this._def.valueType,o=[...a.data.entries()].map(([l,m],h)=>({key:s._parse(new Ne(a,l,a.path,[h,"key"])),value:i._parse(new Ne(a,m,a.path,[h,"value"]))}));if(a.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const m of o){const h=await m.key,f=await m.value;if(h.status==="aborted"||f.status==="aborted")return H;(h.status==="dirty"||f.status==="dirty")&&t.dirty(),l.set(h.value,f.value)}return{status:t.value,value:l}})}else{const l=new Map;for(const m of o){const h=m.key,f=m.value;if(h.status==="aborted"||f.status==="aborted")return H;(h.status==="dirty"||f.status==="dirty")&&t.dirty(),l.set(h.value,f.value)}return{status:t.value,value:l}}}}As.create=(n,e,t)=>new As({valueType:e,keyType:n,typeName:M.ZodMap,...j(t)});class Ut extends z{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==I.set)return A(a,{code:C.invalid_type,expected:I.set,received:a.parsedType}),H;const s=this._def;s.minSize!==null&&a.data.sizes.maxSize.value&&(A(a,{code:C.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());const i=this._def.valueType;function o(m){const h=new Set;for(const f of m){if(f.status==="aborted")return H;f.status==="dirty"&&t.dirty(),h.add(f.value)}return{status:t.value,value:h}}const l=[...a.data.values()].map((m,h)=>i._parse(new Ne(a,m,a.path,h)));return a.common.async?Promise.all(l).then(m=>o(m)):o(l)}min(e,t){return new Ut({...this._def,minSize:{value:e,message:P.toString(t)}})}max(e,t){return new Ut({...this._def,maxSize:{value:e,message:P.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Ut.create=(n,e)=>new Ut({valueType:n,minSize:null,maxSize:null,typeName:M.ZodSet,...j(e)});class Bs extends z{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Bs.create=(n,e)=>new Bs({getter:n,typeName:M.ZodLazy,...j(e)});class Vn extends z{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return A(t,{received:t.data,code:C.invalid_literal,expected:this._def.value}),H}return{status:"valid",value:e.data}}get value(){return this._def.value}}Vn.create=(n,e)=>new Vn({value:n,typeName:M.ZodLiteral,...j(e)});function Fi(n,e){return new wt({values:n,typeName:M.ZodEnum,...j(e)})}class wt extends z{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),a=this._def.values;return A(t,{expected:V.joinValues(a),received:t.parsedType,code:C.invalid_type}),H}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),a=this._def.values;return A(t,{received:t.data,code:C.invalid_enum_value,options:a}),H}return Se(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return wt.create(e,{...this._def,...t})}exclude(e,t=this._def){return wt.create(this.options.filter(a=>!e.includes(a)),{...this._def,...t})}}wt.create=Fi;class Rs extends z{_parse(e){const t=V.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==I.string&&a.parsedType!==I.number){const s=V.objectValues(t);return A(a,{expected:V.joinValues(s),received:a.parsedType,code:C.invalid_type}),H}if(this._cache||(this._cache=new Set(V.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=V.objectValues(t);return A(a,{received:a.data,code:C.invalid_enum_value,options:s}),H}return Se(e.data)}get enum(){return this._def.values}}Rs.create=(n,e)=>new Rs({values:n,typeName:M.ZodNativeEnum,...j(e)});class mn extends z{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==I.promise&&t.common.async===!1)return A(t,{code:C.invalid_type,expected:I.promise,received:t.parsedType}),H;const a=t.parsedType===I.promise?t.data:Promise.resolve(t.data);return Se(a.then(s=>this._def.type.parseAsync(s,{path:t.path,errorMap:t.common.contextualErrorMap})))}}mn.create=(n,e)=>new mn({type:n,typeName:M.ZodPromise,...j(e)});class _t extends z{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===M.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:a}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:o=>{A(a,o),o.fatal?t.abort():t.dirty()},get path(){return a.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const o=s.transform(a.data,i);if(a.common.async)return Promise.resolve(o).then(async l=>{if(t.value==="aborted")return H;const m=await this._def.schema._parseAsync({data:l,path:a.path,parent:a});return m.status==="aborted"?H:m.status==="dirty"||t.value==="dirty"?Nt(m.value):m});{if(t.value==="aborted")return H;const l=this._def.schema._parseSync({data:o,path:a.path,parent:a});return l.status==="aborted"?H:l.status==="dirty"||t.value==="dirty"?Nt(l.value):l}}if(s.type==="refinement"){const o=l=>{const m=s.refinement(l,i);if(a.common.async)return Promise.resolve(m);if(m instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(a.common.async===!1){const l=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return l.status==="aborted"?H:(l.status==="dirty"&&t.dirty(),o(l.value),{status:t.value,value:l.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(l=>l.status==="aborted"?H:(l.status==="dirty"&&t.dirty(),o(l.value).then(()=>({status:t.value,value:l.value}))))}if(s.type==="transform")if(a.common.async===!1){const o=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!kt(o))return H;const l=s.transform(o.value,i);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:l}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(o=>kt(o)?Promise.resolve(s.transform(o.value,i)).then(l=>({status:t.value,value:l})):H);V.assertNever(s)}}_t.create=(n,e,t)=>new _t({schema:n,typeName:M.ZodEffects,effect:e,...j(t)});_t.createWithPreprocess=(n,e,t)=>new _t({schema:e,effect:{type:"preprocess",transform:n},typeName:M.ZodEffects,...j(t)});class $e extends z{_parse(e){return this._getType(e)===I.undefined?Se(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}$e.create=(n,e)=>new $e({innerType:n,typeName:M.ZodOptional,...j(e)});class Tt extends z{_parse(e){return this._getType(e)===I.null?Se(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Tt.create=(n,e)=>new Tt({innerType:n,typeName:M.ZodNullable,...j(e)});class qn extends z{_parse(e){const{ctx:t}=this._processInputParams(e);let a=t.data;return t.parsedType===I.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}qn.create=(n,e)=>new qn({innerType:n,typeName:M.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...j(e)});class $n extends z{_parse(e){const{ctx:t}=this._processInputParams(e),a={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return cn(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Fe(a.common.issues)},input:a.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Fe(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}$n.create=(n,e)=>new $n({innerType:n,typeName:M.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...j(e)});class Is extends z{_parse(e){if(this._getType(e)!==I.nan){const a=this._getOrReturnCtx(e);return A(a,{code:C.invalid_type,expected:I.nan,received:a.parsedType}),H}return{status:"valid",value:e.data}}}Is.create=n=>new Is({typeName:M.ZodNaN,...j(n)});class ny extends z{_parse(e){const{ctx:t}=this._processInputParams(e),a=t.data;return this._def.type._parse({data:a,path:t.path,parent:t})}unwrap(){return this._def.type}}class la extends z{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return i.status==="aborted"?H:i.status==="dirty"?(t.dirty(),Nt(i.value)):this._def.out._parseAsync({data:i.value,path:a.path,parent:a})})();{const s=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return s.status==="aborted"?H:s.status==="dirty"?(t.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:a.path,parent:a})}}static create(e,t){return new la({in:e,out:t,typeName:M.ZodPipeline})}}class Gn extends z{_parse(e){const t=this._def.innerType._parse(e),a=s=>(kt(s)&&(s.value=Object.freeze(s.value)),s);return cn(t)?t.then(s=>a(s)):a(t)}unwrap(){return this._def.innerType}}Gn.create=(n,e)=>new Gn({innerType:n,typeName:M.ZodReadonly,...j(e)});var M;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(M||(M={}));const c=He.create,r=St.create,R=Un.create,de=Wn.create;Ke.create;const B=De.create,p=ae.create,ge=dn.create;un.create;at.create;const Q=hn.create,te=Vn.create,F=wt.create;mn.create;$e.create;Tt.create;p({page:r(),limit:r(),total:r(),totalPages:r()});const da=p({requestId:c().optional(),timestamp:ge([c(),r()]).optional()}).passthrough(),ay=p({success:te(!1),error:c(),code:r().optional(),meta:da.optional()}),sy=p({success:te(!1),error:p({code:c(),message:c()}),code:r().optional(),meta:da.optional()}),iy=p({success:te(!1),message:c(),code:ge([c(),r()]).optional(),meta:da.optional()});ge([ay,sy,iy]);const ji=p({source:c().optional(),sequence:r().optional()}).passthrough();function U(n,e){return p({type:te(n),data:e,timestamp:r(),meta:ji.optional()})}const ry=p({type:c(),data:de(),timestamp:r(),meta:ji.optional()});p({id:c(),type:c(),created:ge([c(),r()]),data:de()});const ua=F(["basic","advanced","premium_plus"]),Ui=F(["owner","admin","developer","billing","viewer"]),oy=p({perSecond:r(),perDay:r()}),Wi=p({id:c(),customerId:c(),url:c(),description:c().nullable(),events:B(c()),status:c(),totalDeliveries:r(),successfulDeliveries:r(),failedDeliveries:r(),lastDeliveryAt:c().nullable(),lastFailureAt:c().nullable(),consecutiveFailures:r(),createdAt:c(),updatedAt:c()}),zi=p({id:c(),endpointId:c(),eventId:c(),eventType:c(),status:c(),attempts:r(),maxAttempts:r(),lastAttemptAt:c().nullable(),nextAttemptAt:c().nullable(),completedAt:c().nullable(),responseCode:r().nullable(),responseTimeMs:r().nullable(),errorMessage:c().nullable(),createdAt:c(),updatedAt:c()}),ha=p({customerId:c(),organizationId:c(),userId:c(),email:c(),role:Ui,name:c().nullable().optional(),preferredLanguage:c().optional()}),Vi=ge([c(),p({code:c(),message:c()})]).optional();p({success:R(),data:ha.optional(),error:Vi});p({success:R(),data:ha.optional(),error:Vi});p({authenticated:R(),data:ha.optional()});const qi=F(["pending","detecting","confirming","paid","expired","cancelled","refunded"]);p({id:c(),invoiceNumber:c(),customerId:c(),subscriptionId:c().nullable(),paymentAddress:c(),amountBtc:c(),amountSats:r(),amountReceivedSats:r().nullable(),status:qi,paymentTxid:c().nullable(),confirmations:r(),paidAt:c().nullable(),confirmedAt:c().nullable(),expiresAt:c(),createdAt:c(),updatedAt:c(),description:c().nullable(),metadata:Q(de()).nullable()});p({invoiceId:c(),status:qi,paymentAddress:c(),amountBtc:c(),amountSats:r(),amountReceivedSats:r().nullable(),confirmations:r(),paymentTxid:c().nullable(),paidAt:c().nullable(),expiresAt:c()});p({id:c(),tier:F(["basic","advanced","premium_plus"]),tierName:c(),status:F(["pending","active","suspended","cancelled","expired"]),startDate:c().optional(),endDate:c().optional(),features:B(c())});p({invoiceId:c(),invoiceNumber:c(),paymentAddress:c(),amountBtc:ge([c(),r()]),amountSats:r(),expiresAt:c(),targetTier:c()});const cy=p({id:c(),entryType:c(),amountSats:r(),amountBtc:c(),source:c(),description:c().nullable(),balanceAfterSats:r(),createdAt:c()});p({balanceSats:r(),balanceBtc:c(),entries:B(cy)});const ly=Wi.extend({status:F(["active","paused","disabled"])});p({endpoint:ly,secret:c()});zi.extend({status:F(["pending","success","failed","retrying"])});p({name:c(),category:c(),description:c()});p({subscriptionId:c(),dailyCount:r(),dailyLimit:r(),hourlyCount:r(),secondCount:r(),secondLimit:r(),percentUsed:r(),isOverLimit:R()});const dy=p({date:c(),requests:r(),successful:r(),failed:r(),avgResponseTimeMs:r().nullable()});B(dy);const uy=p({restAccess:F(["limited","full","unrestricted"]),blockVisualizerStream:F(["limited","full"]),dashboardStream:R(),singleAddressTracking:R(),multiAddressTracking:R(),singleTransactionTracking:R(),multiTransactionTracking:R(),coBrandedSubdomain:R(),whiteLabelDomain:R(),dedicatedSupport:R(),advancedAnalytics:R()}).passthrough();p({tier:ua,tierName:c(),rateLimits:oy,features:uy});p({id:c(),customerId:c(),legalName:c().nullable(),billingEmail:c().nullable(),technicalContactEmail:c().nullable(),website:c().nullable(),status:F(["active","suspended","inactive"]),createdAt:c()});p({id:c(),email:c(),name:c().nullable(),role:F(["owner","admin","developer","billing","viewer"]),isActive:R(),createdAt:c(),lastLoginAt:c().nullable()});p({userId:c(),email:c(),role:c()});p({id:c(),keyPrefix:c(),name:c().optional(),status:F(["active","revoked","expired"]),lastUsedAt:c().optional(),usageCount:r(),createdAt:c(),expiresAt:c().optional()});const hy=p({key:c(),keyPrefix:c(),keyId:c(),createdAt:c()});p({revokedKeyId:c(),newKey:hy});p({success:te(!0),user:p({id:c(),email:c(),role:c(),name:c()})}).passthrough();p({success:te(!1),error:c()}).passthrough();p({success:R(),authenticated:R(),user:p({id:c(),email:c(),role:c(),name:c().nullable()}).optional()}).passthrough();p({success:R(),error:c().optional()}).passthrough();p({success:te(!0),data:p({invoiceId:c(),paymentAddress:c(),amountSats:r(),amountBtc:c(),tier:c(),expiresAt:c()})}).passthrough();const xt=ua,$i=F(["healthy","degraded","down"]),my=F(["scheduled","in_progress","completed","cancelled"]),py=F(["critical","major","minor","info"]),Gi=F(["investigating","identified","monitoring","resolved"]),Ki=p({daily:r().nullable().describe("Daily active users (DISTINCT customer_id over last 24h). NULL = honest-null contract per Gabriel directive 2026-04-22 (G_B-161 path withdrawn because {0,0,0} fail-safe collapsed `data unavailable` with `zero real users` and silently eroded CEO trust). Wiring to a usage-events DISTINCT query is gated on a separate observability layer that distinguishes the two states."),weekly:r().nullable().describe("Weekly active users (DISTINCT customer_id over last 7d). NULL = honest-null contract per Gabriel directive 2026-04-22 — same rationale as daily. Wiring to a usage-events DISTINCT query is gated on a separate observability layer that distinguishes `data unavailable` from `zero real users`."),monthly:r().nullable().describe("Monthly active users (DISTINCT customer_id over last 30d). NULL = honest-null contract per Gabriel directive 2026-04-22 — same rationale as daily/weekly. Use `subscriptionsActive` for the live subscription-count signal."),subscriptionsActive:r().describe("Count of active + pending subscriptions from CEODataService.getCustomerMetrics(). NOT a 30d-distinct-customer-id (use future activeUsers.monthly when wired). Source: subscriptions table WHERE status IN ('active', 'pending').")}).passthrough(),fy=p({total:r(),byTier:Q(xt,r())}).passthrough(),Kn=p({mrr:r(),arr:r(),growthPercent:r(),mrrUsd:r(),arrUsd:r()}).passthrough(),gy=p({name:c(),status:$i,latencyMs:r().optional(),error:c().optional()}).passthrough();p({activeUsers:Ki,payingCustomers:fy,apiCallsToday:r().describe("Total API requests received today (UTC midnight to now). Source: UsageStatsService.getGlobalUsageStats() → UsageRepository aggregates + getTodayGlobalStats fallback. Returns 0 on dataService unavailable OR aggregator-job not scheduled OR usage-event ingestion gap (last seen 2026-04-21 production: 0 — root cause SSH-bisect pending)."),systemUptime:r().nullable().describe("Backend Node process uptime in milliseconds (process.uptime() × 1000 rounded). NULL = upstream timeout via withTimeout wrapper (CEO_DASHBOARD_QUERY_TIMEOUT_MS). Resets to ~0 on backend restart. NOT host OS uptime — use systemctl --user show blocksight-production --property=ActiveEnterTimestamp for host uptime."),revenue:Kn,activeIncidents:r().nullable().describe("Active incidents count. NULL = incident-tracking domain not yet implemented (v1.1 feature). Subscribe to Grafana alertmanager for live incident count. Reference: O-251 V-D."),generatedAt:c()}).passthrough();const by=p({date:c(),revenueBtc:r(),revenueUsd:r(),newSubscriptions:r(),churns:r()}).passthrough(),yy=p({tier:xt,subscribers:r(),mrrBtc:r(),mrrUsd:r(),percentOfTotal:r()}).passthrough();p({current:Kn,previous:Kn.nullable(),dailyRevenue:B(by),byTier:B(yy),arpu:r(),ltv:r(),period:p({start:c(),end:c(),days:r()}).passthrough()}).passthrough();const vy=p({totalCalls:r(),byTier:Q(xt,r()),peakRps:r(),avgRps:r(),errorRate:r(),byStatus:p({success2xx:r(),clientError4xx:r(),serverError5xx:r()}).passthrough()}).passthrough(),ky=p({endpoint:c(),method:c(),calls:r(),avgLatencyMs:r(),errorRate:r()}).passthrough(),Sy=p({hour:r(),calls:r(),avgLatencyMs:r()}).passthrough();p({activeUsers:Ki,usage:vy,topEndpoints:B(ky).nullable(),hourlyPattern:B(Sy).nullable(),period:p({start:c(),end:c()}).passthrough()}).passthrough();const Ps=p({apiKeyPrefix:c(),email:c().optional(),tier:xt,totalCalls:r(),usagePercent:r(),lastActiveAt:c()}).passthrough(),wy=p({apiKeyPrefix:c(),email:c().optional(),tier:xt,reason:F(["usage_drop","approaching_limit","payment_failed","inactive"]),riskScore:r(),details:c()}).passthrough();p({totalCustomers:r(),newCustomers:r(),topCustomers:B(Ps),atRiskCustomers:B(wy),approachingLimits:p({count:r(),customers:B(Ps)}).passthrough()}).passthrough();const _y=p({name:c(),uptime:r(),downtimeMinutes:r(),incidentCount:r(),currentStatus:$i}).passthrough();p({overallUptime:r(),services:B(_y),currentStatus:B(gy),activeIncidents:r(),mttr:r()}).passthrough();const Ty=p({id:c(),title:c(),description:c(),scheduledStart:c(),scheduledEnd:c(),status:my,affectedServices:B(c()),createdBy:c(),createdAt:c()}).passthrough(),Ey=p({id:c(),message:c(),status:Gi,timestamp:c(),author:c()}).passthrough(),Ls=p({id:c(),title:c(),description:c(),severity:py,status:Gi,affectedServices:B(c()),startedAt:c(),resolvedAt:c().optional(),updates:B(Ey)}).passthrough(),Cy=p({id:c(),type:F(["warning","error","info"]),message:c(),service:c(),timestamp:c(),acknowledged:R()}).passthrough();p({scheduledMaintenance:B(Ty),activeIncidents:B(Ls),recentIncidents:B(Ls),alerts:B(Cy),stats:p({upcomingMaintenance:r(),activeIncidents:r(),unresolvedAlerts:r(),incidentsLast30Days:r()}).passthrough()}).passthrough();const xy=p({rate:r(),count:r(),revenueLostBtc:r(),reasons:B(p({reason:c(),count:r()}).passthrough()).optional()}).passthrough(),Ay=p({tier:xt,totalSubscribers:r(),newThisPeriod:r(),churnedThisPeriod:r(),netChange:r(),percentChange:r()}).passthrough();p({totalActive:r(),byTier:B(Ay),newSubscriptions:r(),churn:xy,netChange:r(),conversionRate:r()}).passthrough();p({l1HitRate:r(),l2HitRate:r(),evictionCount:r(),invalidationCount:r(),totalKeys:r(),memoryUsage:r(),timestamp:c()}).passthrough();const By=p({path:c(),count:r(),avgLatency:r()}).passthrough();p({requestsPerSecond:r(),errorRate:r(),p50Latency:r(),p95Latency:r(),p99Latency:r(),topEndpoints:B(By),timestamp:c()}).passthrough();p({environment:c(),redis:p({connected:R()}).passthrough(),cache:p({ttl:r(),maxSize:r()}).passthrough(),observability:p({prometheusEnabled:R(),lokiEnabled:R(),tempoEnabled:R()}).passthrough()}).passthrough();const Wt=p({id:c(),severity:F(["critical","warning","info"]),message:c(),timestamp:c()}).passthrough();p({active:B(Wt),recent:B(Wt),count:p({critical:r(),warning:r(),info:r()}).passthrough()}).passthrough();const Pn=p({avg:r(),min:r(),max:r(),sampleCount:r(),avgErrorAbs:r(),avgErrorPercent:r()}).passthrough(),Lt=p({last24h:Pn,last7d:Pn,last30d:Pn}).passthrough(),Ry=p({blockHeight:r(),predictionType:c(),accuracyPercent:r(),predictedValue:r().optional(),actualValue:r().optional(),errorAbs:r().optional(),errorPercent:r().optional(),predictedCount:r().optional(),actualCount:r().optional(),matched:r().optional(),missed:r().optional(),extra:r().optional()}).passthrough();p({mempool:Lt,feeRate:Lt,blockTime:Lt,sixHourFeeRate:Lt,congestionUtilisation:Lt,recentRecords:B(Ry),timestamp:c()}).passthrough();const Iy=p({enabled:R(),source:F(["redis","default"])}).passthrough();Q(c(),Iy);p({success:R(),message:c().optional(),error:c().optional()}).passthrough();p({success:R(),message:c().optional(),error:c().optional(),data:p({service:c(),enabled:R(),previousValue:R(),timestamp:c(),duration:r()}).passthrough().optional()}).passthrough();const Ds=p({name:c(),status:F(["healthy","degraded","unhealthy","unknown"]),priority:F(["critical","important","optional"]),details:p({available:R(),responsive:R(),metrics:Q(c(),de()).optional(),lastSuccess:r().optional(),consecutiveFailures:r().optional()}).passthrough(),timestamp:r(),responseTime:r().optional(),error:c().optional()}).passthrough();p({success:R(),message:c().optional(),error:c().optional(),data:ge([Ds,B(Ds)]).optional()}).passthrough();const Py=p({name:c(),status:c(),latency:r().optional(),details:Q(c(),de()).optional()}).passthrough();B(Py);p({coreTipHeight:r(),pgTipHeight:r(),pgEnrichedHeight:r(),pgTipLagBlocks:r(),enrichmentGapBlocks:r(),unenrichedCount:r(),enrichmentPercent:r(),lastEnrichedAt:c().nullable(),pipelineHealth:F(["normal","degraded","critical"]),timestamp:c()}).passthrough();p({name:c(),enabled:R()}).passthrough();p({success:te(!0),message:c(),timestamp:c(),duration:r()}).passthrough();const Ly=p({os:c(),nodeVersion:c(),environment:c(),uptime:r()}).passthrough(),Dy=p({host:c(),port:r(),password:c(),status:c()}).passthrough(),Ny=p({l1Ttl:r(),l2Ttl:r(),maxKeys:r()}).passthrough(),Oy=p({enabled:R(),emailTo:c(),webhookUrl:c(),smtpUser:c(),smtpPassword:c()}).passthrough();p({success:te(!0),data:p({system:Ly,redis:Dy,cache:Ny,alerts:Oy}).passthrough()}).passthrough();const My=p({state:F(["CLOSED","OPEN","HALF_OPEN"]),failureCount:r(),successCount:r(),lastFailure:r().optional(),nextAttempt:r().optional(),lastStateChange:r(),totalCalls:r(),totalFailures:r(),totalSuccesses:r()}).passthrough();p({success:te(!0),data:p({circuitBreakers:Q(c(),My),allClosed:R(),summary:c()}),timestamp:r()}).passthrough();ge([p({received:te(!0),metricsCount:r()}).passthrough(),p({received:te(!1),error:c()}).passthrough()]);const zt=ua,Zi=F(["active","suspended","inactive"]),Hy=F(["contract","invoice","receipt","report","kyc","legal","other"]),Yi=Ui,Fy=F(["pending","confirmed","failed","expired"]),jy=p({id:c(),legalName:c().nullable(),email:c(),status:Zi,tier:zt,userCount:r(),documentCount:r(),totalRevenueBtc:r(),lastActivityAt:c().nullable(),createdAt:c()}).passthrough();p({clients:B(jy),total:r(),page:r(),limit:r(),totalPages:r()}).passthrough();const Uy=p({street:c().nullable().optional(),city:c().nullable().optional(),state:c().nullable().optional(),postalCode:c().nullable().optional(),country:c().nullable().optional()}).passthrough(),Wy=p({id:c(),customerId:c(),legalName:c().nullable(),taxId:c().nullable(),billingEmail:c().nullable(),billingAddress:Uy,industry:c().nullable(),website:c().nullable(),logoUrl:c().nullable(),accountTier:zt.nullable(),primaryContactId:c().nullable(),status:Zi,metadata:Q(c(),de()),createdAt:c(),updatedAt:c()}).passthrough(),Ji=p({id:c(),action:c(),resourceType:c(),resourceId:c().nullable(),actorName:c().nullable(),actorEmail:c().nullable(),actorType:F(["admin","client"]).nullable(),status:F(["success","failure"]),createdAt:c()}).passthrough();p({organization:Wy,customer:p({id:c(),email:c(),tier:zt,status:c(),createdAt:c()}).passthrough(),stats:p({userCount:r(),activeUserCount:r(),documentCount:r(),totalRevenueBtc:r(),totalRevenueUsd:r(),lastInvoiceDate:c().nullable(),lastActivityAt:c().nullable()}).passthrough(),recentActivity:B(Ji)}).passthrough();const Xi=p({id:c(),email:c(),name:c().nullable(),role:Yi,isActive:R(),createdAt:c()}).passthrough();p({id:c(),organizationId:c(),email:c(),name:c().nullable(),role:Yi,isActive:R(),notes:c().nullable(),metadata:Q(c(),de()),createdAt:c(),updatedAt:c()}).passthrough();const Qi=p({id:c(),type:Hy,title:c(),fileName:c(),fileSize:r(),mimeType:c(),uploadedAt:c(),uploadedBy:c().nullable()}).passthrough(),zy=p({id:c(),invoiceId:c(),clientId:c(),clientName:c().nullable(),clientEmail:c(),amountBtc:r(),amountUsd:r(),status:Fy,txHash:c().nullable(),paidAt:c().nullable(),createdAt:c()}).passthrough();p({transactions:B(zy),total:r(),page:r(),limit:r(),totalPages:r(),summary:p({totalAmountBtc:r(),totalAmountUsd:r(),transactionCount:r()}).passthrough()}).passthrough();p({logs:B(Ji),total:r(),page:r(),limit:r(),totalPages:r()}).passthrough();const Vy=p({totalReceivedBtc:r(),totalReceivedUsd:r(),invoiceTotalBtc:r(),invoiceTotalUsd:r(),paidCount:r(),unpaidCount:r(),pendingCount:r(),overdueCount:r()}).passthrough(),qy=p({totalClients:r(),activeClients:r(),newClientsThisMonth:r(),churnedThisMonth:r(),churnRate:r()}).passthrough(),$y=p({id:c(),legalName:c().nullable(),email:c(),tier:zt,totalRevenueBtc:r(),totalRevenueUsd:r(),invoiceCount:r(),percentOfTotal:r()}).passthrough(),Gy=p({tier:zt,clientCount:r(),revenueBtc:r(),revenueUsd:r(),percentOfTotal:r()}).passthrough();p({revenue:Vy,customers:qy,topClients:B($y),tierBreakdown:B(Gy),period:p({start:c(),end:c()}).passthrough(),generatedAt:c()}).passthrough();p({documents:B(Qi)}).passthrough();p({document:Qi,message:c()}).passthrough();p({downloadUrl:c(),expiresAt:c(),fileName:c(),mimeType:c()}).passthrough();p({users:B(Xi)}).passthrough();p({user:Xi,message:c()}).passthrough();p({message:c()}).passthrough();const Ky=p({id:c(),name:c(),priceBtc:r(),priceUsd:r(),features:B(c()),rateLimits:p({perSecond:r(),perDay:r()})}).passthrough();p({tiers:B(Ky)}).passthrough();p({invoiceId:c(),tier:c(),amountBtc:r(),paymentAddress:c(),expiresAt:c(),qrCodeUrl:c(),status:te("pending")}).passthrough();p({invoiceId:c(),tier:c(),amountBtc:r(),paymentAddress:c(),status:F(["pending","detecting","confirming","paid","expired"]),confirmations:r(),requiredConfirmations:r(),expiresAt:c(),paidAt:c().optional(),apiKeyReady:R()}).passthrough();p({apiKey:c(),keyPrefix:c(),tier:c(),expiresAt:c(),rateLimits:p({perSecond:r(),perDay:r()}),note:c()}).passthrough();const er=Wi,Zy=zi;p({events:B(c())});er.extend({secret:c()});p({endpoints:B(er)});p({success:te(!0)});p({secret:c(),note:c()});p({deliveries:B(Zy)});p({error:p({code:c(),message:c(),details:de().optional()})});p({deletedCount:r(),olderThanDays:r()}).passthrough();p({error:c()}).passthrough();p({fromHeight:r(),toHeight:r(),enriched:r(),failed:r()}).passthrough();p({error:c()}).passthrough();const ut=p({status:F(["up","degraded","down"]),latencyMs:r(),lastCheck:r(),details:Q(c(),de()).optional()}).passthrough();p({status:F(["healthy","degraded","unhealthy"]),timestamp:r(),services:p({bitcoinCore:ut,zmq:ut,electrum:ut,redis:ut,postgres:ut,websocket:ut}).passthrough(),summary:p({healthy:r(),degraded:r(),unhealthy:r()}).passthrough()}).passthrough();function tr(n){return p({success:te(!0),data:n,generatedAt:c()})}p({success:te(!1),error:c(),message:c()}).passthrough();const Yy=p({name:c(),enabled:R(),envVar:c(),description:c(),defaultValue:R(),dependencies:B(c())}).passthrough();tr(B(Yy));const Jy=p({name:c(),enabled:R(),message:c()});tr(Jy);const Xy=p({requestId:c(),timestamp:r()});p({success:te(!1),error:p({code:c(),message:c()}),meta:Xy});const nr=p({isEnabled:R(),circuitBreakerEnabled:R(),rateLimitingEnabled:R(),lastError:c().optional(),lastSuccess:r().optional(),failureCount:r(),isCircuitOpen:R()}).passthrough();p({services:Q(c(),nr),timestamp:r()});p({service:c(),status:nr,timestamp:r()});const Qy=p({service:c(),isEnabled:R(),isOpen:R(),failureCount:r(),lastError:c().nullable(),lastSuccess:r().nullable()}).passthrough();p({circuitBreakers:B(Qy),timestamp:r()});const ev=p({service:c(),isEnabled:R(),isAvailable:R(),lastError:c().nullable(),lastSuccess:r().nullable()}).passthrough();p({rateLimits:B(ev),timestamp:r()});p({service:c(),enabled:R(),message:c()});p({service:c(),message:c()});p({endpoints:Q(c(),c()),services:Q(c(),c()),environmentVariables:Q(c(),c())});p({active:B(Wt),history:B(Wt)});B(Wt);Q(c(),de()).and(p({}));Q(c(),de()).and(p({}));Q(c(),de()).and(p({}));Q(c(),de()).and(p({}));p({minutes:r()}).passthrough();const tv=p({id:c(),endpoint:c(),method:c(),statusCode:r(),latencyMs:r(),ipAddress:c().nullable(),apiKeyPrefix:c(),createdAt:c()}).passthrough();p({success:te(!0),data:B(tv),pagination:p({page:r(),limit:r(),total:r(),totalPages:r()}).passthrough()});const nv=p({method:c(),timestamp:c(),duration_ms:r(),cached:R()});p({success:te(!1),error:p({code:c(),message:c()}),meta:nv});const av=p({branch:B(c()),header:c(),root:c()}).passthrough(),sv=ge([c(),av]);ge([p({count:r(),hex:c(),max:r()}).passthrough(),B(sv)]);const iv=c(),rv=p({txid:c(),hash:c(),version:r(),size:r(),vsize:r(),weight:r(),locktime:r()}).passthrough();ge([iv,rv]);p({block_height:r(),merkle:B(c()),pos:r()});p({address:c(),confirmed:r(),unconfirmed:r()}).passthrough();p({address:c(),history:B(p({tx_hash:c(),height:r()}))}).passthrough();p({address:c(),utxos:B(p({tx_hash:c(),tx_pos:r(),value:r(),height:r()}))}).passthrough();p({address:c(),mempool:B(p({tx_hash:c(),height:r(),fee:r().optional()}))}).passthrough();p({address:c()}).passthrough();p({address:c(),page:r(),pageSize:r(),direction:c().optional(),includeMempool:R().optional(),transactions:B(de()),total:r().optional()}).passthrough();p({targetBlocks:r(),feeRate:r()});p({size:r(),bytes:r(),usage:r(),maxmempool:r(),mempoolminfee:r(),minrelaytxfee:r()}).passthrough();p({version:p({serverSoftwareVersion:c(),negotiatedProtocolVersion:c()}).nullable(),features:p({genesis_hash:c(),hash_function:c(),server_version:c(),protocol_max:c(),protocol_min:c()}).passthrough().nullable()}).passthrough();p({usd:r(),change24h:r().optional(),changePercent24h:r().optional(),lastUpdated:r().optional(),source:F(["live","cache","fallback"]).optional()}).passthrough();p({nextBlockFee:r(),sixHourFee:r(),timestamp:r(),isReliable:R(),isFallback:R().optional()}).passthrough();p({congestionScore:r(),congestionLevel:F(["low","moderate","high","extreme"]),mempool:p({txCount:r(),vsizeBytes:r(),minFeeRate:r()}),fees:p({fastest:r(),halfHour:r(),hour:r(),economy:r()}),delayScore:r(),activityLoad:r(),delayLoad:r(),timestamp:r()}).passthrough();p({tipHeight:r(),tipHash:c(),timestamp:ge([c(),r()]),source:F(["postgresql","rpc-fallback"])});const ov=p({priceUsd:r(),congestionLoad:r(),feeRates:p({fastest:r(),halfHour:r(),hour:r(),economy:r()})}),cv=p({btcUsd:r(),timestamp:r(),source:c(),change24h:r().optional(),changePercent24h:r().optional()}),lv=p({currency:te("BTC"),fiat:te("USD"),value:r(),change24h:r(),changePercent24h:r(),asOfMs:r(),provider:c()}),dv=p({rates:Q(c(),r()),timestamp:r(),provider:c()}),uv=p({base:te("USD"),rates:Q(c(),r()),asOfMs:r(),provider:c()}),hv=p({rates:Q(c(),p({from:c(),to:c(),rate:r(),inverseRate:r(),lastUpdated:r(),provider:c()})),timestamp:r(),provider:c()}),mv=p({nextBlockFee:r(),sixHourFee:r(),timestamp:r()}),pv=p({congestionScore:r(),congestionLevel:F(["low","moderate","high","extreme"]),mempool:p({txCount:r(),vsizeBytes:r(),minFeeRate:r()}),fees:p({fastest:r(),halfHour:r(),hour:r(),economy:r()}),delayScore:r(),activityLoad:r(),delayLoad:r(),timestamp:r()}),fv=p({state:p({athPrice:r(),isAtAth:R(),athReachedAt:r().nullable(),athExpiresAt:r().nullable(),distanceFromAth:r(),currentPollInterval:r(),lastComparedAt:r()}),isNewAth:R(),previousAthPrice:r().optional()}),gv=p({supply:p({circulatingSupply:r(),percentageIssued:r(),issuanceRemaining:r(),issuance24h:r(),blockHeight:r(),timestamp:r()}),halving:p({halvingAtBlock:r(),currentEpoch:r(),blocksRemaining:r(),btcUntilHalving:r(),epochProgress:r(),projectedDate:r(),currentSubsidy:r()})}),bv=U("dashboard.update",ov),yv=U("price_update",cv),vv=U("price.current",lv),kv=U("exchange_rate_update",dv),Sv=U("fx.rates",uv),wv=U("exchange.rates",hv),_v=U("fee_update",mv),Tv=U("congestion_update",pv),Ev=U("ath_update",fv),Cv=U("supply_update",gv),ma=p({hash:c(),height:r(),timestamp:r(),txCount:r(),avgfeerate:r(),weight:r().optional(),size:r().optional(),feerateP10:r().optional(),feerateP50:r().optional(),feerateP90:r().optional(),medianfee:r().optional(),totalfee:r().optional(),minerName:c().optional(),minfeerate:r().optional(),maxfeerate:r().optional()}),xv=p({block:p({hash:c(),height:r(),timestamp:r(),tx_count:r(),previous_hash:c(),merkle_root:c(),version:r(),nonce:r(),bits:c(),difficulty:r(),size:r(),weight:r(),miner_name:c().optional()})}),Av=p({height:r(),lastBlockTime:r(),blockStats:p({transactionCount:r(),size:r(),weight:r(),difficulty:r()}).optional()}),ar=p({chain:c(),blocks:r(),headers:r(),bestblockhash:c(),difficulty:r(),mediantime:r(),verificationprogress:r(),chainwork:c(),pruned:R(),initialblockdownload:R(),size_on_disk:r(),warnings:c()}),Bv=p({version:r(),subversion:c(),protocolversion:r(),localservices:c(),localservicesnames:B(c()),localrelay:R(),timeoffset:r(),networkactive:R(),connections:r(),connections_in:r(),connections_out:r(),networks:B(p({name:c(),limited:R(),reachable:R(),proxy:c(),proxy_randomize_credentials:R()})),relayfee:r(),incrementalfee:r(),localaddresses:B(p({address:c(),port:r(),score:r()})),warnings:c()}),Rv=p({blocks:r(),currentblockweight:r().optional(),currentblocktx:r().optional(),difficulty:r(),networkhashps:r(),pooledtx:r(),chain:c(),warnings:c()}),Iv=p({blocks:B(ma),tipHeight:r(),lastUpdated:r()}),Pv=p({blocks:B(ma),startHeight:r(),limit:r(),totalHeight:r(),hasMore:R()}),Lv=p({blocks:B(ma),centerHeight:r(),radius:r(),totalHeight:r()}),Dv=p({estimatedSeconds:r(),confidence:r(),timeSinceLastBlockSeconds:r(),targetTime:r()}),Nv=p({depth:r(),lcaHeight:r().optional(),prevTip:p({height:r(),hash:c()}),newTip:p({height:r(),hash:c()})}),Ov=U("block_added",xv),Mv=U("tip.height",Av),Hv=U("blockchain_update",ar),Fv=U("blockchain.info",ar),jv=U("blockchain.network",Bv),Uv=U("blockchain.mining",Rv),Wv=U("blocks_history",Iv),zv=U("blocks_history_paginated",Pv),Vv=U("blocks_range_response",Lv),qv=U("block_time_estimate",Dv),$v=U("chain.reorg",Nv),Gv=p({mempool:p({loaded:R(),size:r(),bytes:r(),usage:r(),maxmempool:r(),mempoolminfee:r(),minrelaytxfee:r(),incrementalrelayfee:r(),unbroadcastcount:r(),fullrbf:R()})}),Kv=p({blocks:B(p({hash:c(),height:r(),txCount:r(),minFeeRate:r(),maxFeeRate:r(),medianFeeRate:r(),totalVsize:r(),totalWeight:r(),totalFees:r()})),tipHeight:r(),timestamp:r()}),Zv=p({txid:c().regex(/^[0-9a-f]{64}$/,"txid must be 64-char lowercase hex"),slotIndex:r().int().nonnegative().nullable(),projectedHeight:r().int().nonnegative().nullable(),asOf:r().int().nonnegative()}),Yv=p({txid:c().regex(/^[0-9a-f]{64}$/),reason:F(["confirmed","replaced","evicted"]),replacementTxid:c().regex(/^[0-9a-f]{64}$/).optional(),blockHash:c().regex(/^[0-9a-f]{64}$/).optional(),asOf:r().int().nonnegative()}).refine(n=>n.reason!=="replaced"||typeof n.replacementTxid=="string",{message:"reason='replaced' requires replacementTxid",path:["replacementTxid"]}).refine(n=>n.reason!=="confirmed"||typeof n.blockHash=="string",{message:"reason='confirmed' requires blockHash",path:["blockHash"]}).refine(n=>n.reason!=="evicted"||n.replacementTxid===void 0&&n.blockHash===void 0,{message:"reason='evicted' must not carry replacementTxid or blockHash",path:["reason"]}),Jv=p({txCount:r(),vsizeBytes:r(),fees:p({fastest:r(),halfHour:r(),hour:r(),economy:r(),minimum:r()})}),Xv=p({pendingTransactions:r(),vsize:r().optional()}),Qv=p({fast:r(),normal:r(),slow:r(),lastUpdated:r().optional()}),ek=p({estimatedSeconds:r(),confidence:r(),medianBlockTimeMs:r(),sampleSize:r(),timeSinceLastBlock:r(),lastBlockTime:r()}),tk=p({size:r(),vsize:r(),usage:r(),maxMempool:r(),mempoolMinFee:r(),minRelayFee:r(),feeEstimates:p({nextBlock:r(),halfHour:r(),hour:r(),economy:r(),minimum:r()}),lastUpdated:r()}),sr=p({congestionValue:r(),congestionLevel:F(["below-average","average","congestion","extreme-congestion"]),mempoolPressure:r(),blockThroughput:r(),feePressure:r(),lastUpdated:r(),dataQuality:F(["excellent","good","fair","poor"])}),ir=p({blocks:B(p({height:r(),avgfeerate:r(),txs:r(),total_size:r(),time:r()})),mempool:p({loaded:R(),size:r(),bytes:r(),usage:r(),maxmempool:r(),mempoolminfee:r(),minrelaytxfee:r()}),currentHeight:r(),windowSize:r(),timestamp:r()}),nk=p({metrics:sr,window:ir}),ak=U("mempool_update",Gv),sk=U("mempool_blocks",Kv),ik=U("mempool_tx_position",Zv),rk=U("mempool_tx_dropped",Yv),ok=U("mempool_fees_update",Jv),ck=U("network.mempool",Xv),lk=U("network.fees",Qv),dk=U("network.estimated-time",ek),uk=U("network.mempool-fees",tk),hk=U("congestiongauge.metrics",sr),mk=U("congestiongauge.window",ir),pk=U("congestiongauge.update",nk),fk=p({health:p({status:F(["healthy","degraded","unhealthy"]),services:Q(c(),F(["online","offline","degraded"])),uptime:r().optional(),lastCheck:r().optional()})}),gk=p({height:r(),hash:c(),previousHeight:r().optional(),previousHash:c().optional(),isReorg:R(),reorgDepth:r().optional(),timestamp:r()}),bk=p({previousHeight:r(),previousHash:c(),newHeight:r(),newHash:c(),depth:r(),timestamp:r()}),yk=p({c:p({score:r(),level:F(["low","medium","high","critical"]),mempoolSize:r(),pendingTxCount:r()}).nullable().optional(),f:p({economy:r(),normal:r(),priority:r(),timestamp:r()}).nullable().optional(),p:p({usd:r(),change24h:r(),volume24h:r(),marketCap:r()}).nullable().optional(),b:p({blockHeight:r(),difficulty:r(),hashrate:r(),blockTime:r()}).nullable().optional(),t:p({timestamps:B(r()),prices:B(r()),volumes:B(r())}).nullable().optional(),m:p({nextHalvingBlocks:r(),nextHalvingDays:r(),currentEra:r()}).nullable().optional(),_full:R().optional()}),vk=p({level:F(["debug","info","warn","error"]),message:c(),timestamp:r(),meta:Q(c(),de()).optional()}),kk=p({type:c(),data:de(),originalTimestamp:r()}),Sk=p({batchId:c(),events:B(kk),batchMeta:p({eventCount:r(),batchDurationMs:r(),cycleNumber:r()})}),Ln=p({blockHeight:r(),halvingNumber:r(),timestamp:r().optional(),daysUntil:r().optional()}),ht=p({activationBlockHeight:r(),activationDate:r(),name:c(),description:c().optional()}),tn=p({blockHeight:r(),timestamp:r(),description:c()}),Ns=p({blocksRemaining:r(),daysRemaining:r(),estimatedDate:r()}),wk=p({halvingEvents:p({currentHalving:Ln,previousHalving:Ln,nextHalving:Ln}),softForkDates:p({taproot:ht.optional(),segwit:ht.optional(),bip65:ht.optional(),bip66:ht.optional(),bip34:ht.optional(),csv:ht.optional()}),historicalFirsts:p({firstBlock:tn,firstTransaction:tn,firstThousandBlocks:tn.optional(),firstMillionTransactions:tn.optional()}),countdowns:p({nextHalving:Ns,previousHalving:Ns.optional()}),timestamp:ge([c(),r()])}),_k=U("health_update",fk),Tk=U("electrum.chain-tip",gk),Ek=U("electrum.reorg",bk),Ck=U("visualization:update",yk),xk=U("milestone:update",wk),Ak=U("logs:stream",vk),Bk=U("batch",Sk),rr={"dashboard.update":bv,price_update:yv,"price.current":vv,exchange_rate_update:kv,"fx.rates":Sv,"exchange.rates":wv,fee_update:_v,congestion_update:Tv,ath_update:Ev,supply_update:Cv,block_added:Ov,"tip.height":Mv,blockchain_update:Hv,"blockchain.info":Fv,"blockchain.network":jv,"blockchain.mining":Uv,blocks_history:Wv,blocks_history_paginated:zv,blocks_range_response:Vv,block_time_estimate:qv,"chain.reorg":$v,mempool_update:ak,mempool_blocks:sk,mempool_tx_position:ik,mempool_tx_dropped:rk,mempool_fees_update:ok,"network.mempool":ck,"network.fees":lk,"network.estimated-time":dk,"network.mempool-fees":uk,"congestiongauge.metrics":hk,"congestiongauge.window":mk,"congestiongauge.update":pk,health_update:_k,"electrum.chain-tip":Tk,"electrum.reorg":Ek,"visualization:update":Ck,"milestone:update":xk,"logs:stream":Ak,batch:Bk};function Rk(n){const e=ry.safeParse(n);if(!e.success)return{valid:!1,data:null,eventType:null,error:`Invalid WS envelope: ${e.error.issues.map(i=>i.message).join(", ")}`};const t=e.data.type,a=rr[t];if(!a)return{valid:!0,data:e.data,eventType:t,error:null};const s=a.safeParse(n);return s.success?{valid:!0,data:s.data,eventType:t,error:null}:{valid:!1,data:null,eventType:t,error:`${t}: ${s.error.issues.map(i=>`${i.path.join(".")}: ${i.message}`).join(", ")}`}}Object.keys(rr).length;const Ik=["dashboard.update","fee_update","congestion_update","mempool_blocks","price_update","block_added","electrum.chain-tip","electrum.reorg","health_update","ath_update","exchange_rate_update","blockchain_stats_update","blocks_history","blocks_history_paginated","blocks_range_response","block_headers_response","visualization:update","monica_metrics_update","address.activity","transaction.status","price.current","exchange.rates","system:status","logs:stream","supply_update","blockchain.network","ws:health","batch","mempool_tx_position","mempool_tx_dropped","payment.update"],Dt="https://api.blocksight.live",Pk={MAIN:`${Dt.replace("http","ws")}/api/v1/ws`,BLOCKS:`${Dt.replace("http","ws")}/api/v1/ws/blocks`,TRANSACTIONS:`${Dt.replace("http","ws")}/api/v1/ws/txs`,NETWORK:`${Dt.replace("http","ws")}/api/v1/ws/network`,FEES:`${Dt.replace("http","ws")}/api/v1/ws/fees`};function Vt(n,e){return(t,a)=>{try{e(t,a)}catch(s){const i=s instanceof Error?s:new Error(`${n} failed`);b.error(g.WEBSOCKET,`Error handling ${n}`,{error:i}),a.handleError(i,"WebSocketBridge")}}}const Lk=50,Dk=Vt("address activity",(n,e)=>{const t=n.data;if(!t||typeof t!="object"||!t.address||!t.txid){b.warn(g.WEBSOCKET,"[AddressActivity] Invalid payload: missing address or txid");return}const s=e.getState().addressTracking??{trackedAddresses:[],recentActivity:[],lastUpdate:0},i=[t,...s.recentActivity].slice(0,Lk),o={addressTracking:{...s,recentActivity:i,lastUpdate:Date.now()}};e.updateState(o)});function Nk(n){return n!==null&&typeof n=="object"&&"hash"in n&&"height"in n&&typeof n.hash=="string"&&typeof n.height=="number"}function Ok(n){return n!==null&&typeof n=="object"&&"value"in n&&"currency"in n&&typeof n.value=="number"&&typeof n.currency=="string"}function Mk(n){return n!==null&&typeof n=="object"&&"rates"in n&&"base"in n&&typeof n.rates=="object"&&typeof n.base=="string"}function Hk(n){if(n===null||typeof n!="object")return!1;const e=n;return"state"in e&&"isNewAth"in e&&typeof e.isNewAth=="boolean"&&e.state!==null&&typeof e.state=="object"&&"athPrice"in e.state&&"isAtAth"in e.state&&typeof e.state.athPrice=="number"&&typeof e.state.isAtAth=="boolean"}function pa(n){return n.map(e=>({hash:e.hash,height:e.height,timestamp:fn(e.timestamp),tx_count:e.txCount,avgfeerate:e.avgfeerate??0,version:0,previous_hash:"",merkle_root:"",nonce:0,bits:"0",difficulty:0,size:e.size??0,weight:e.weight??0,feerateP10:e.feerateP10,feerateP50:e.feerateP50,feerateP90:e.feerateP90,totalfee:e.totalfee,minfeerate:e.minfeerate,maxfeerate:e.maxfeerate,miner_name:e.minerName}))}function qt(n,e,t=Ft,a=null){const s=new Set(n.map(v=>v.height)),i=new Map(e.map(v=>[v.height,v])),o=[...n.map(v=>{const E=i.get(v.height);return E?{...v,tx_count:E.tx_count??v.tx_count,avgfeerate:E.avgfeerate??v.avgfeerate,weight:E.weight??v.weight,size:E.size??v.size,feerateP10:E.feerateP10??v.feerateP10,feerateP50:E.feerateP50??v.feerateP50,feerateP90:E.feerateP90??v.feerateP90,totalfee:E.totalfee??v.totalfee,minfeerate:E.minfeerate??v.minfeerate,maxfeerate:E.maxfeerate??v.maxfeerate,miner_name:E.miner_name??v.miner_name}:v}),...e.filter(v=>!s.has(v.height))].sort((v,E)=>E.height-v.height);if(a===null)return o.slice(0,t);const l=o.length>0?o[0].height:0,m=Math.floor(t/2),h=[],f=[];for(const v of o){const E=v.height>=l-1,_=Math.abs(v.height-a)<=m;E?h.push(v):_&&f.push(v)}const y=new Set,S=[];for(const v of[...h,...f])y.has(v.height)||(y.add(v.height),S.push(v));return S.sort((v,E)=>E.height-v.height).slice(0,t)}function Fk(n,e,t){const a=n.some(i=>i.height===e.height);let s;return a?s=n.map(i=>i.height===e.height?{...i,tx_count:e.tx_count??i.tx_count,miner_name:e.miner_name??i.miner_name,avgfeerate:e.avgfeerate??i.avgfeerate,weight:e.weight??i.weight,size:e.size??i.size,feerateP10:e.feerateP10??i.feerateP10,feerateP50:e.feerateP50??i.feerateP50,feerateP90:e.feerateP90??i.feerateP90,totalfee:e.totalfee??i.totalfee,minfeerate:e.minfeerate??i.minfeerate,maxfeerate:e.maxfeerate??i.maxfeerate}:i):s=[...n,e],s.length>Ft?s=qt(s,[],Ft,t):s=[...s].sort((i,o)=>o.height-i.height),Qs(s)}function jk(n,e,t,a){const s=Date.now(),i=a.getState(),o={previousTipHeight:n,newTipHeight:e,foundAtMs:s,newBlock:{kind:"real",id:{hash:t.hash,height:t.height},minedAtMs:fn(t.timestamp),txCount:t.tx_count,minFeeRate:0,maxFeeRate:0,medianFeeRate:0,isEnriched:!1,minerName:t.miner_name}},l={transformed:{...i.transformed,blockFound:{isAnimating:!0,phase:"preparing",currentEvent:o,lastBlockFoundAt:s}}};a.updateState(l)}function Uk(n,e){try{if(n.data.block===null||n.data.block===void 0||(e.markRealDataReceived(),!Nk(n.data.block)))return;const t=n.data.block,a=e.getState(),s=a.transformed.blockchain.summary.height,i=a.raw.electrumServer.windowCenter??null;if(s>0&&s-t.height>Xs){b.warn(g.WEBSOCKET,"block_added rejected — anomalous height",{blockHeight:t.height,currentTip:s,distance:s-t.height});return}const o=a.raw.electrumServer.blockHeaders,l=o.some(S=>S.height===t.height),m=Fk(o,t,i),h=Date.now(),f={raw:{...a.raw,electrumServer:{...a.raw.electrumServer,blockHeaders:m,lastUpdate:h},_meta:{...a.raw._meta,electrumServer:{...a.raw._meta?.electrumServer,lastFetchedAt:h,sourceTimestamp:h,source:"websocket",ttl:12e4,isStale:!1,isMock:!1,confidence:100},coreRpc:{...a.raw._meta?.coreRpc,lastFetchedAt:h,sourceTimestamp:h,source:"websocket",ttl:12e4,isStale:!1,isMock:!1,confidence:100}}}};e.updateState(f),e.transformRawData();const y=e.getState().transformed.blockchain.summary.height;b.debug(g.WEBSOCKET,"block_added processed",{height:t.height,hash:t.hash?.substring(0,12),timestamp:t.timestamp,minedAtMs:fn(t.timestamp),previousTipHeight:s,newTipHeight:y,duplicate:l}),y>s&&i===null&&jk(s,y,t,e)}catch(t){b.error(g.WEBSOCKET,"Error handling block added",{error:t instanceof Error?t:String(t)}),e.handleError(t instanceof Error?t:new Error("Block added handling failed"),"WebSocketBridge")}}function Wk(n,e,t,a){const s=Math.max(...n.map(l=>l.height)),i=n.filter(l=>l.height>=s-1);if(i.length===0)return;const o=qt(e.raw.electrumServer.blockHeaders,i,Ft,e.raw.electrumServer.windowCenter);t.updateState({raw:{...e.raw,electrumServer:{...e.raw.electrumServer,blockHeaders:o,lastUpdate:a}}}),t.transformRawData()}function zk(n,e){try{const t=n.data;if(!t.blocks||!Array.isArray(t.blocks)){b.warn(g.WEBSOCKET,"[BlocksHistory] Invalid payload: missing blocks array");return}e.markRealDataReceived();const a=e.getState(),s=Date.now(),i=pa(t.blocks);if(a.raw.electrumServer.windowCenter!==null){Wk(i,a,e,s);return}const o=n.meta?.dataSource,l=o?.source||"live",m=o?.staleness,f={live:"websocket",cache:"cache",fallback:"mock",mock:"mock"}[l]||"websocket",y=m?.isStale||!1,S=l==="fallback"||l==="mock",E={live:100,cache:80,fallback:40,mock:20}[l]||100,_=qt(a.raw.electrumServer.blockHeaders,i),w=Qs(_,t.tipHeight),x={raw:{...a.raw,electrumServer:{...a.raw.electrumServer,blockHeaders:w,lastUpdate:s},_meta:{...a.raw._meta,electrumServer:{...a.raw._meta?.electrumServer,lastFetchedAt:s,sourceTimestamp:s,source:f,ttl:m?.maxAgeMs||6e4,isStale:y,isMock:S,confidence:E}}}};e.updateState(x),e.transformRawData()}catch(t){b.error(g.WEBSOCKET,"Error handling blocks history",{error:t instanceof Error?t:String(t)}),e.handleError(t instanceof Error?t:new Error("Blocks history update failed"),"WebSocketBridge")}}function Vk(n,e){try{const t=n.data;if(!t.blocks||!Array.isArray(t.blocks)){b.warn(g.WEBSOCKET,"[BlocksHistoryPaginated] Invalid payload: missing blocks array");return}if(t.blocks.length===0){window.dispatchEvent(new CustomEvent("blocksight:pagination-exhausted")),window.dispatchEvent(new CustomEvent("blocksight:paginated-response"));return}const a=e.getState(),s=Date.now(),i=pa(t.blocks),o=qt(a.raw.electrumServer.blockHeaders,i),l={raw:{...a.raw,electrumServer:{...a.raw.electrumServer,blockHeaders:o,lastUpdate:s,paginationNextCursor:t.nextCursor??null}}};e.updateState(l),e.transformRawData(),window.dispatchEvent(new CustomEvent("blocksight:paginated-response"))}catch(t){b.error(g.WEBSOCKET,"Error handling blocks history paginated",{error:t instanceof Error?t:String(t)}),e.handleError(t instanceof Error?t:new Error("Blocks history paginated update failed"),"WebSocketBridge")}}function qk(n,e){try{const t=n.data;if(!t.blocks||!Array.isArray(t.blocks)){b.warn(g.WEBSOCKET,"[BlocksRangeResponse] Invalid payload: missing blocks array");return}const a=e.getState(),s=Date.now(),i=pa(t.blocks),o=t.centerHeight??null,l=qt(a.raw.electrumServer.blockHeaders,i,Ft,o),m={raw:{...a.raw,electrumServer:{...a.raw.electrumServer,blockHeaders:l,lastUpdate:s,windowCenter:o}}};e.updateState(m),e.transformRawData(),window.dispatchEvent(new CustomEvent("blocksight:range-response"))}catch(t){b.error(g.WEBSOCKET,"Error handling blocks range response",{error:t instanceof Error?t:String(t)}),e.handleError(t instanceof Error?t:new Error("Blocks range response update failed"),"WebSocketBridge")}}function $k(n,e){try{if(n.data.prices){if(!Ok(n.data.prices))return;const t=Date.now(),a=e.getState(),s=n.meta?.dataSource,i=s?.source||"live",o=s?.staleness,m={live:"websocket",cache:"cache",fallback:"mock",mock:"mock"}[i]||"websocket",h=o?.isStale||!1,f=i==="fallback"||i==="mock",S={live:100,cache:80,fallback:40,mock:20}[i]||100,v={raw:{...a.raw,external:{...a.raw.external,priceData:n.data.prices,lastUpdate:t},_meta:{...a.raw._meta,external:{...a.raw._meta?.external,lastFetchedAt:t,sourceTimestamp:t,source:m,ttl:o?.maxAgeMs||3e5,isStale:h,isMock:f,confidence:S}}}};e.updateState(v),e.transformRawData()}}catch(t){b.error(g.WEBSOCKET,"Error handling price update",{error:t instanceof Error?t:String(t)}),e.handleError(t instanceof Error?t:new Error("Price update failed"),"WebSocketBridge")}}function Gk(n,e){try{if(n.data.exchangeRates){if(!Mk(n.data.exchangeRates))return;const t={raw:{...e.getState().raw,external:{...e.getState().raw.external,exchangeRates:n.data.exchangeRates,lastUpdate:Date.now()}}};e.updateState(t),e.transformRawData()}}catch(t){b.error(g.WEBSOCKET,"Error handling exchange rate update",{error:t instanceof Error?t:String(t)}),e.handleError(t instanceof Error?t:new Error("Exchange rate update failed"),"WebSocketBridge")}}const Kk=5e9;function Zk(n,e){try{const t=n.data;if(!t?.blocks||!Array.isArray(t.blocks)){b.warn(g.WEBSOCKET,"[MempoolBlocks] Invalid payload: missing blocks array");return}if(t.blocks.length===0){b.debug(g.WEBSOCKET,"[MempoolBlocks] Empty blocks array received, preserving existing data");return}e.markRealDataReceived();const a=e.getState(),s=Date.now(),i=a.transformed.blockchain.summary.height,o=typeof i=="number"&&!Number.isNaN(i),l=t.blocks.map((h,f)=>({kind:"real",id:{hash:h.hash,height:o?i+f+1:h.height},minedAtMs:t.timestamp||s,txCount:h.txCount,minFeeRate:h.minFeeRate,maxFeeRate:h.maxFeeRate,medianFeeRate:h.medianFeeRate,totalVsize:h.totalVsize,totalWeight:h.totalWeight,totalFees:h.totalFees})),m={transformed:{...a.transformed,blockchain:{...a.transformed.blockchain,summary:{...a.transformed.blockchain.summary,mempoolBlocks:l,lastMempoolBlocksUpdate:s}}}};e.updateState(m)}catch(t){b.error(g.WEBSOCKET,"Error handling mempool blocks update",{error:t instanceof Error?t:String(t)}),e.handleError(t instanceof Error?t:new Error("Mempool blocks update failed"),"WebSocketBridge")}}function Yk(n){if(!n||typeof n!="object")return!1;const e=n;return!(typeof e.txid!="string"||e.slotIndex!==null&&typeof e.slotIndex!="number"||e.projectedHeight!==null&&typeof e.projectedHeight!="number")}function Jk(n,e){try{if(!Yk(n.data)){b.warn(g.WEBSOCKET,"[MempoolTxPosition] Invalid payload — missing txid/slotIndex/projectedHeight");return}const t=n.data;e.setMempoolTxPosition?.({txid:t.txid,slotIndex:t.slotIndex,projectedHeight:t.projectedHeight})}catch(t){b.error(g.WEBSOCKET,"Error handling mempool_tx_position",{error:t instanceof Error?t:String(t)}),e.handleError(t instanceof Error?t:new Error("mempool_tx_position dispatch failed"),"WebSocketBridge")}}function Xk(n){return n==="confirmed"||n==="replaced"||n==="evicted"}function Qk(n){if(!n||typeof n!="object")return!1;const e=n;return!(typeof e.txid!="string"||!Xk(e.reason))}function eS(n,e){try{if(!Qk(n.data)){b.warn(g.WEBSOCKET,"[MempoolTxDropped] Invalid payload — missing txid or invalid reason");return}const t=n.data;e.setMempoolTxDropped?.({txid:t.txid,reason:t.reason,replacementTxid:t.replacementTxid??null,blockHash:t.blockHash??null})}catch(t){b.error(g.WEBSOCKET,"Error handling mempool_tx_dropped",{error:t instanceof Error?t:String(t)}),e.handleError(t instanceof Error?t:new Error("mempool_tx_dropped dispatch failed"),"WebSocketBridge")}}function tS(n){if(!n||typeof n!="object")return!1;const e=n;return typeof e.congestionScore=="number"&&typeof e.congestionLevel=="string"&&["low","moderate","high","extreme"].includes(e.congestionLevel)&&typeof e.mempool=="object"&&e.mempool!==null&&typeof e.fees=="object"&&e.fees!==null&&typeof e.timestamp=="number"}function nS(n,e){try{if(!tS(n.data)){b.warn(g.WEBSOCKET,"[CongestionUpdate] Invalid payload received");return}e.markRealDataReceived();const t=n.data,a=e.getState(),s=Date.now(),i={raw:{...a.raw,coreRpc:{...a.raw.coreRpc,mempoolInfo:a.raw.coreRpc.mempoolInfo?{...a.raw.coreRpc.mempoolInfo,size:t.mempool.txCount,bytes:t.mempool.vsizeBytes,mempoolminfee:t.mempool.minFeeRate/1e5}:{loaded:!0,size:t.mempool.txCount,bytes:t.mempool.vsizeBytes,usage:t.mempool.vsizeBytes,maxmempool:Kk,mempoolminfee:t.mempool.minFeeRate/1e5,minrelaytxfee:t.fees.economy/1e5,incrementalrelayfee:1e-5,unbroadcastcount:0,fullrbf:!1},lastUpdate:s},_meta:{...a.raw._meta,coreRpc:{...a.raw._meta?.coreRpc,lastFetchedAt:s,sourceTimestamp:t.timestamp,source:"websocket",ttl:6e4,isStale:!1,isMock:!1,confidence:100}}},transformed:{...a.transformed,analytics:{...a.transformed.analytics,congestion:{score:t.congestionScore,level:t.congestionLevel,activityLoad:t.activityLoad,delayLoad:t.delayLoad,delayScore:t.delayScore,mempoolTxCount:t.mempool.txCount,timestamp:t.timestamp},derived:{...a.transformed.analytics.derived,feeRates:{fastest:t.fees.fastest,halfHour:t.fees.halfHour,hour:t.fees.hour,economy:t.fees.economy}}}}};e.updateState(i),e.transformRawData()}catch(t){b.error(g.WEBSOCKET,"Error handling congestion update",{error:t instanceof Error?t:String(t)}),e.handleError(t instanceof Error?t:new Error("Congestion update failed"),"WebSocketBridge")}}function aS(n){if(!n||typeof n!="object")return!1;const e=n;return typeof e.nextBlockFee=="number"&&typeof e.sixHourFee=="number"&&typeof e.timestamp=="number"}function sS(n,e){try{if(!aS(n.data)){b.warn(g.WEBSOCKET,"[FeeUpdate] Invalid payload received");return}e.markRealDataReceived();const t=n.data,a=e.getState(),s=t.nextBlockFee{if(n.data.health){const t={system:{...e.getState().system,health:{...e.getState().system.health,...n.data.health,lastCheck:Date.now()}}};e.updateState(t)}}),cS=Vt("ATH update",(n,e)=>{if(!Hk(n.data)){b.warn(g.WEBSOCKET,"Invalid ATH update payload received");return}const t=n.data,s={transformed:{...e.getState().transformed,ath:t.state}};e.updateState(s),t.isNewAth?b.info(g.DATA_STORE,"New All-Time High!",{athPrice:t.state.athPrice,previousAthPrice:t.previousAthPrice}):t.state.isAtAth&&b.debug(g.DATA_STORE,"Celebrating ATH",{athPrice:t.state.athPrice})}),lS=Vt("dashboard update",(n,e)=>{const t=n.data;if(!t.feeRates){b.warn(g.WEBSOCKET,"[DashboardUpdate] Invalid payload: missing feeRates");return}e.markRealDataReceived();const a=e.getState(),s=Date.now(),i=t.priceUsd!=null&&t.priceUsd>0?t.priceUsd:0,o={...i>0?{raw:{...a.raw,external:{...a.raw.external,priceData:a.raw.external.priceData?{...a.raw.external.priceData,value:i,asOfMs:s}:{currency:"BTC",fiat:"USD",value:i,change24h:0,changePercent24h:0,asOfMs:s,provider:"dashboard"}}}}:{},transformed:{...a.transformed,...i>0?{market:{...a.transformed.market,prices:{...a.transformed.market.prices,btc:{...a.transformed.market.prices.btc,usd:i}}}}:{},analytics:{...a.transformed.analytics,derived:{...a.transformed.analytics.derived,feeRates:t.feeRates,calculatedAt:s}}}};e.updateState(o)});function mt(n,e){return n!==void 0?n??null:e??null}const dS=Vt("visualization update",(n,e)=>{const t=n.data;if(!t||typeof t!="object"){b.warn(g.WEBSOCKET,"[VisualizationUpdate] Invalid payload: not an object");return}e.markRealDataReceived();const a=e.getState(),s=a.transformed.visualization,i={transformed:{...a.transformed,visualization:{congestion:mt(t.c,s?.congestion),fee:mt(t.f,s?.fee),price:mt(t.p,s?.price),blockchainStats:mt(t.b,s?.blockchainStats),timeSeries:mt(t.t,s?.timeSeries),milestone:mt(t.m,s?.milestone),lastUpdate:Date.now(),isFullUpdate:t._full===!0}}};e.updateState(i)});class Ie{static instance=null;isInitialized=!1;eventHandlers=new Map;subscriptionTimeout=null;webSocketService;mempoolTxDispatchers=null;constructor(e){this.webSocketService=e||an,this.setupEventHandlers()}static getInstance(){return Ie.instance||(Ie.instance=new Ie),Ie.instance}static createWithService(e){return new Ie(e)}static resetInstance(){Ie.instance&&(Ie.instance.destroy(),Ie.instance=null)}initialize(){if(!this.isInitialized)try{this.setupWebSocketListeners(),this.webSocketService.isEnabled()&&this.connectToWebSocket(),this.isInitialized=!0}catch(e){b.error(g.WEBSOCKET,"Failed to initialize WebSocket-DataStore bridge:",{error:e instanceof Error?e:String(e)}),O.handleError(e instanceof Error?e:new Error("Bridge initialization failed"),"WebSocketBridge")}}getHandlerDeps(){return{getState:()=>O.getState(),updateState:e=>O.updateState(e),transformRawData:()=>O.transformRawData(),handleError:(e,t)=>O.handleError(e,t),markRealDataReceived:()=>{},setMempoolTxPosition:this.mempoolTxDispatchers?.setMempoolTxPosition,setMempoolTxDropped:this.mempoolTxDispatchers?.setMempoolTxDropped}}setMempoolTxDispatchers(e){this.mempoolTxDispatchers=e}subscribeMempoolTx(e){try{this.webSocketService.send({action:"subscribe",topic:`mempool.tx.${e}`})}catch(t){b.debug(g.WEBSOCKET,"[WebSocketBridge] subscribeMempoolTx dropped",{txid:e,error:t instanceof Error?t.message:String(t)})}}unsubscribeMempoolTx(e){try{this.webSocketService.send({action:"unsubscribe",topic:`mempool.tx.${e}`})}catch(t){b.debug(g.WEBSOCKET,"[WebSocketBridge] unsubscribeMempoolTx dropped",{txid:e,error:t instanceof Error?t.message:String(t)})}}setupEventHandlers(){const e={"dashboard.update":t=>lS(t,this.getHandlerDeps()),fee_update:t=>sS(t,this.getHandlerDeps()),congestion_update:t=>nS(t,this.getHandlerDeps()),mempool_blocks:t=>Zk(t,this.getHandlerDeps()),price_update:t=>$k(t,this.getHandlerDeps()),block_added:t=>Uk(t,this.getHandlerDeps()),"electrum.chain-tip":()=>{},"electrum.reorg":()=>{},health_update:t=>{const a=Rk(t);a.valid||b.warn(g.WEBSOCKET,"health_update event failed Zod validation",{error:a.error??void 0,eventType:"health_update"}),oS(t,this.getHandlerDeps())},ath_update:t=>cS(t,this.getHandlerDeps()),exchange_rate_update:t=>Gk(t,this.getHandlerDeps()),blockchain_stats_update:()=>{},blocks_history:t=>zk(t,this.getHandlerDeps()),blocks_history_paginated:t=>Vk(t,this.getHandlerDeps()),blocks_range_response:t=>qk(t,this.getHandlerDeps()),"visualization:update":t=>dS(t,this.getHandlerDeps()),monica_metrics_update:t=>rS(t,this.getHandlerDeps()),"address.activity":t=>Dk(t,this.getHandlerDeps()),"price.current":()=>{},"exchange.rates":()=>{},"system:status":()=>{},"logs:stream":()=>{},supply_update:()=>{},"blockchain.network":()=>{},"ws:health":()=>{},batch:()=>{},"payment.update":()=>{},"transaction.status":()=>{},mempool_tx_position:t=>Jk(t,this.getHandlerDeps()),mempool_tx_dropped:t=>eS(t,this.getHandlerDeps())};for(const t of Ik){if(t==="block_headers_response")continue;const a=t;this.eventHandlers.set(t,e[a])}this.eventHandlers.set("pong",()=>{})}setupWebSocketListeners(){this.webSocketService.addEventListener("message",this.handleWebSocketMessage.bind(this)),this.webSocketService.addEventListener("open",this.handleWebSocketOpen.bind(this)),this.webSocketService.addEventListener("close",this.handleWebSocketClose.bind(this)),this.webSocketService.addEventListener("error",this.handleWebSocketError.bind(this))}async connectToWebSocket(){try{await this.webSocketService.connect(Pk.MAIN),this.webSocketService.resetFailureState()}catch(e){const t=e instanceof Error?e.message:"WebSocket connection failed";if(b.warn(g.WEBSOCKET,"[WebSocketBridge] WebSocket connect() failed:",{error:t}),t.includes("disabled"))return;O.handleError(e instanceof Error?e:new Error("WebSocket connection failed"),"WebSocketBridge")}}handleWebSocketMessage(e){try{const t=JSON.parse(e.data);this.processWebSocketEvent(t)}catch(t){b.error(g.WEBSOCKET,"Error parsing WebSocket message",{error:t instanceof Error?t:String(t)}),O.handleError(t instanceof Error?t:new Error("WebSocket message parsing failed"),"WebSocketBridge")}}handleWebSocketOpen(){const e=O.getState(),t=Date.now();O.updateState({websocket:{...e.websocket,connected:!0,reconnectAttempts:0,lastUpdate:t,lastError:null}}),this.subscribeToEvents()}subscribeToEvents(){try{const e=Array.from(this.eventHandlers.keys()).filter(s=>s!=="pong"),t=["block_added","blocks_history"],a=e.filter(s=>!t.includes(s));this.webSocketService.send({type:"subscribe",payload:{eventTypes:t}}),this.subscriptionTimeout=setTimeout(()=>{this.subscriptionTimeout=null,this.webSocketService.send({type:"subscribe",payload:{eventTypes:a}})},500)}catch(e){b.error(g.WEBSOCKET,"[WebSocketBridge] Failed to subscribe to events",{error:e instanceof Error?e:String(e)})}}handleWebSocketClose(){O.updateState({websocket:{...O.getState().websocket,connected:!1,reconnectAttempts:this.webSocketService.getReconnectAttempts(),lastUpdate:Date.now()}})}handleWebSocketError(e){b.error(g.WEBSOCKET,"WebSocket error in DataStore bridge",{event:e});const t="WebSocket connection error";O.updateState({websocket:{...O.getState().websocket,connected:!1,reconnectAttempts:this.webSocketService.getReconnectAttempts(),lastUpdate:Date.now(),lastError:t}}),O.handleError(new Error(t),"WebSocketBridge")}processWebSocketEvent(e){try{const t=this.eventHandlers.get(e.type);t?t(e):b.warn(g.WEBSOCKET,`[WebSocketBridge] Unhandled event type: "${e.type}"`,{registeredHandlers:Array.from(this.eventHandlers.keys())})}catch(t){b.error(g.WEBSOCKET,"Error processing WebSocket event",{error:t instanceof Error?t:String(t)}),O.handleError(t instanceof Error?t:new Error("Event processing failed"),"WebSocketBridge")}}sendMessage(e){try{this.webSocketService.send(e)}catch(t){b.error(g.WEBSOCKET,"Error sending WebSocket message",{error:t instanceof Error?t:String(t)}),O.handleError(t instanceof Error?t:new Error("Message send failed"),"WebSocketBridge")}}getStatus(){return{initialized:this.isInitialized,websocketConnected:this.webSocketService.getConnectionStatus()==="connected",eventHandlers:this.eventHandlers.size}}destroy(){try{this.subscriptionTimeout&&(clearTimeout(this.subscriptionTimeout),this.subscriptionTimeout=null),this.webSocketService?.removeEventListener&&(this.webSocketService.removeEventListener("message",this.handleWebSocketMessage.bind(this)),this.webSocketService.removeEventListener("open",this.handleWebSocketOpen.bind(this)),this.webSocketService.removeEventListener("close",this.handleWebSocketClose.bind(this)),this.webSocketService.removeEventListener("error",this.handleWebSocketError.bind(this))),this.eventHandlers?.clear(),this.webSocketService?.disconnect&&this.webSocketService.disconnect(),this.isInitialized=!1}catch(e){b.debug(g.WEBSOCKET,"[WebSocketBridge] destroy cleanup error:",{error:e instanceof Error?e.message:String(e)})}}}const Et=Ie.getInstance();class uS{name="websocket";critical=!0;async check(){const e=Date.now();try{const t=Et.getStatus(),a=Date.now()-e;return t.initialized?t.websocketConnected?{status:oe.HEALTHY,message:"WebSocket connected and operational",duration:a,details:{initialized:t.initialized,websocketConnected:!0,eventHandlers:t.eventHandlers}}:{status:oe.DEGRADED,message:"WebSocket disconnected - using cached data",duration:a,details:{initialized:t.initialized,websocketConnected:!1,eventHandlers:t.eventHandlers}}:{status:oe.DEGRADED,message:"WebSocket bridge not initialized",duration:a,details:{initialized:!1,websocketConnected:!1}}}catch(t){const a=Date.now()-e;return{status:oe.UNHEALTHY,message:t instanceof Error?t.message:"Unknown error checking WebSocket",duration:a}}}}const hS={version:"0.0.0",defaultTimeout:xb};class mS{checks;config;constructor(e,t){this.checks=e,this.config={...hS,...t}}processCheckResult(e,t){return t.status==="fulfilled"?{checkResult:t.value,isUnhealthy:t.value.status===oe.UNHEALTHY}:{checkResult:{status:oe.UNHEALTHY,message:t.reason?.message||"Check failed with error",duration:0},isUnhealthy:!0}}determineOverallStatus(e,t){return e?oe.UNHEALTHY:t?oe.DEGRADED:oe.HEALTHY}async checkHealth(){const e=Date.now(),t={},a=await Promise.allSettled(this.checks.map(o=>this.executeCheckWithTimeout(o)));let s=!1,i=!1;for(let o=0;o{const a=this.config.defaultTimeout;let s=!1;const i=setTimeout(()=>{s||(s=!0,t({status:oe.UNHEALTHY,message:`Check timeout after ${a}ms`,duration:a}))},a),o=Date.now();e.check().then(l=>{s||(s=!0,clearTimeout(i),t(l))}).catch(l=>{s||(s=!0,clearTimeout(i),t({status:oe.UNHEALTHY,message:l?.message||"Check failed",duration:Date.now()-o}))})})}}const or=120*1e3,pS=or;function fS(n){const e="0000000000000000000",t=Math.floor(Math.random()*4294967295).toString(16).padStart(8,"0"),a=n.toString(16).padStart(8,"0"),s="abcdef1234567890".repeat(3).slice(0,64-e.length-t.length-a.length);return(e+t+a+s).slice(0,64)}function gS(n,e=Date.now()){const t=n%1e3;return{kind:"real",id:{hash:fS(n),height:n},minedAtMs:e,txCount:2500+t%1e3,minFeeRate:1,maxFeeRate:150+t%100,medianFeeRate:10+t%10}}function bS(n,e=Date.now()){const t=n+1;return{previousTipHeight:n,newTipHeight:t,foundAtMs:e,newBlock:gS(t,e)}}function yS(){const{triggerAnimation:n}=Pi(),{flags:e}=gn(),t=e.effects.demoBlockAnimation,a=u.useRef(null),s=u.useRef(null),i=u.useRef(0),o=u.useRef(926549),l=u.useCallback(()=>{const f=o.current;i.current+=1;const y=bS(f);b.debug(g.ANIMATION,"Triggering block found demo",{demoBlock:i.current,previousHeight:f,newHeight:y.newTipHeight}),o.current=y.newTipHeight,n(y)},[n]),m=u.useCallback(()=>{a.current||(b.info(g.ANIMATION,"Starting block found demo mode",{initialDelay:"2 minutes",interval:"2 minutes"}),s.current=setTimeout(()=>{l(),a.current=setInterval(l,or)},pS))},[l]),h=u.useCallback(()=>{s.current&&(clearTimeout(s.current),s.current=null),a.current&&(clearInterval(a.current),a.current=null),b.info(g.ANIMATION,"Block found demo mode stopped")},[]);return u.useEffect(()=>(t?m():h(),()=>{h()}),[t,m,h]),{triggerNow:l,start:m,stop:h,isEnabled:t,demoBlockCount:i.current,currentTipHeight:o.current}}function vS(){return yS(),null}const cr=()=>{const{setMempoolTxPosition:n,setMempoolTxDropped:e}=ea();return u.useEffect(()=>(Et.setMempoolTxDispatchers({setMempoolTxPosition:n,setMempoolTxDropped:e}),()=>{Et.setMempoolTxDispatchers(null)}),[n,e]),null};cr.displayName="MempoolTxWsBridgeConnector";const kS={PROD:!0};class et{static instance;errorCount=0;maxErrors=10;errorTypes=new Set;constructor(){this.setupGlobalErrorHandlers()}static getInstance(){return et.instance||(et.instance=new et),et.instance}setupGlobalErrorHandlers(){window.addEventListener("error",e=>{this.handleError("JavaScript Error",e.error,{message:e.message,filename:e.filename,lineno:e.lineno,colno:e.colno,stack:e.error?.stack})}),window.addEventListener("unhandledrejection",e=>{this.handleError("Unhandled Promise Rejection",e.reason,{stack:e.reason?.stack})}),this.setupReactErrorBoundary()}setupReactErrorBoundary(){const e=console.error;console.error=(...t)=>{const a=t.join(" ");this.isProductionError(a)&&this.handleError("React Error",new Error(a),{args:t,stack:new Error().stack}),e.apply(console,t)}}isProductionError(e){return[/Cannot access .* before initialization/i,/ReferenceError/i,/TypeError.*undefined/i,/Cannot read propert.*of undefined/i,/Cannot read propert.*of null/i,/Module not found/i,/ChunkLoadError/i,/Loading chunk .* failed/i,/OrbitControls.*initialization/i,/three.*initialization/i,/WebGL.*error/i,/Canvas.*error/i].some(a=>a.test(e))}handleError(e,t,a){this.errorCount++,this.errorTypes.add(e),console.error(`[Production Error Detector] ${e}:`,{error:t,context:a,errorCount:this.errorCount,errorTypes:Array.from(this.errorTypes)}),this.errorCount>=this.maxErrors&&this.handleCriticalErrorThreshold(),this.isCriticalError(e,t)&&this.reportCriticalError(e,t,a)}isCriticalError(e,t){const a=[/Cannot access .* before initialization/i,/ReferenceError/i,/Module not found/i,/ChunkLoadError/i],s=t instanceof Error?t.message:String(t);return a.some(i=>i.test(s))}handleCriticalErrorThreshold(){console.error("[Production Error Detector] CRITICAL: Too many errors detected!"),this.showUserError(),this.reportToMonitoring()}reportCriticalError(e,t,a){console.error(`[Production Error Detector] CRITICAL ERROR: ${e}`,{error:t,context:a,timestamp:new Date().toISOString(),userAgent:navigator.userAgent,url:window.location.href}),this.showUserError()}showUserError(){const e=document.createElement("div");e.style.cssText=` position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.8); color: white; display: flex; align-items: center; justify-content: center; z-index: 9999; font-family: Arial, sans-serif; `,e.innerHTML=`

⚠️ Application Error Detected

We've detected a critical error in the application. Please refresh the page to continue.

`,document.body.appendChild(e)}reportToMonitoring(){b.debug(g.ERROR,"Reporting to monitoring service")}reportError(e,t,a){this.handleError(e,t,a||{})}getErrorStats(){return{count:this.errorCount,types:Array.from(this.errorTypes)}}reset(){this.errorCount=0,this.errorTypes.clear()}}class SS extends ze.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){const a=et.getInstance(),s=rc();b.error(g.COMPONENT,"Production error boundary caught error",{error:e.message,componentStack:t.componentStack,errorBoundary:"ProductionErrorBoundary",correlationId:s}),a.reportError("React Error Boundary",e,{componentStack:t.componentStack,errorBoundary:"ProductionErrorBoundary",correlationId:s}),this.setState({error:e,errorInfo:t})}render(){return this.state.hasError?this.props.fallback?typeof this.props.fallback=="function"?this.props.fallback({error:this.state.error,errorInfo:this.state.errorInfo}):ze.isValidElement(this.props.fallback)?ze.cloneElement(this.props.fallback,{error:this.state.error,errorInfo:this.state.errorInfo}):this.props.fallback:ze.createElement("div",{style:{padding:"20px",textAlign:"center",color:"#fff",backgroundColor:"rgba(220, 53, 69, 0.1)",borderRadius:"8px",border:"1px solid rgba(220, 53, 69, 0.3)",margin:"20px"}},[ze.createElement("h3",{key:"title"},"🚨 Application Error"),ze.createElement("p",{key:"message"},"Something went wrong. Please refresh the page."),ze.createElement("button",{key:"refresh",type:"button",onClick:()=>window.location.reload(),style:{padding:"8px 16px",backgroundColor:"#dc3545",color:"white",border:"none",borderRadius:"4px",cursor:"pointer"}},"Refresh Page")]):this.props.children}}const wS=()=>{(kS||globalThis.import?.meta?.env)?.PROD?(et.getInstance(),b.info(g.ERROR,"Production Error Detector initialized",{environment:"production"})):b.debug(g.ERROR,"Production Error Detector initialized",{environment:"development"})},_S=ne(()=>k(()=>import("./Starfield-B2xBpo9n.js"),__vite__mapDeps([27,1,3,8,9,10,28]))),TS=ne(()=>k(()=>import("./index-2uu3o9-Q.js"),__vite__mapDeps([29,1,3,8,9,10,30])).then(n=>({default:n.EasterEggOverlay}))),ES=ne(()=>k(()=>import("./index-2uu3o9-Q.js"),__vite__mapDeps([29,1,3,8,9,10,30])).then(n=>({default:n.HalFinneyTrigger}))),CS=ne(()=>k(()=>import("./index-2uu3o9-Q.js"),__vite__mapDeps([29,1,3,8,9,10,30])).then(n=>({default:n.PizzaDayTrigger}))),xS=ne(()=>k(()=>import("./index-2uu3o9-Q.js"),__vite__mapDeps([29,1,3,8,9,10,30])).then(n=>({default:n.BlockFoundDemoTrigger})));ab();wS();sd();O.initialize();Et.initialize();const AS=n=>{Et.subscribeMempoolTx(n)},BS=n=>{Et.unsubscribeMempoolTx(n)},lr=new mS([new Bb,new uS,new Rb],{version:"1.0.0"}),RS=6e4;setInterval(async()=>{try{const n=await lr.checkHealth();n.status!=="healthy"&&console.warn("[HealthCheck] System degraded:",n)}catch(n){console.error("[HealthCheck] Failed to run health check:",n)}},RS);lr.checkHealth().then(n=>{b.info(g.HEALTH,"Initial health status",{status:n.status})});const dr=document.getElementById("root");if(!dr)throw new Error("Root element not found");Wr.createRoot(dr).render(d.jsxs(ze.StrictMode,{children:[d.jsx(Zc,{}),d.jsx(Hg,{quality:"high",imageName:"cosmic"}),d.jsx(u.Suspense,{fallback:null,children:d.jsx(_S,{})}),d.jsx(SS,{fallback:d.jsx(nl,{}),children:d.jsx(yr,{children:d.jsx(oc,{children:d.jsx(Xg,{children:d.jsx(dg,{children:d.jsx(Bh,{children:d.jsx(Gl,{children:d.jsx(xh,{children:d.jsx(Eh,{children:d.jsx(jg,{children:d.jsx(td,{children:d.jsx(Hm,{children:d.jsxs(Zf,{children:[d.jsx(fl,{children:d.jsxs(bl,{onMempoolSubscribe:AS,onMempoolUnsubscribe:BS,children:[d.jsx(cr,{}),d.jsx(Ql,{children:d.jsx(zm,{children:d.jsx(qh,{children:d.jsx(fm,{children:d.jsxs(lb,{children:[d.jsx(vS,{}),d.jsx(Cb,{}),d.jsx(Dg,{}),d.jsxs(u.Suspense,{fallback:null,children:[d.jsx(ES,{}),d.jsx(CS,{}),d.jsx(xS,{}),d.jsx(TS,{})]})]})})})})})]})}),d.jsx(Qf,{})]})})})})})})})})})})})})})]}));wg();const Os=async()=>{const[{initializeSentry:n},{initializeTracer:e},{resourceMetricsManager:t},{metricsShipper:a},{initWebVitals:s}]=await Promise.all([k(()=>import("./sentry-BCdfHZxG.js"),__vite__mapDeps([31,9,1])),k(()=>import("./index-DFkh5veL.js"),__vite__mapDeps([32,1,3,8,9,10])),k(()=>import("./resource-metrics-BcNETgYp.js"),__vite__mapDeps([33,1,3,8,9,10])),k(()=>import("./index-sq6EvXAh.js"),__vite__mapDeps([34,1,3,8,9,10])),k(()=>import("./index-BBXEktWJ.js"),__vite__mapDeps([35,1,3,8,9,10]))]);n(),e({serviceName:"blocksight-frontend",serviceVersion:"1.0.0",otlpEndpoint:"/api/traces",samplingRate:.1,sampleErrors:!0,enabled:!0}),t.initialize(),s(),a.start(),window.addEventListener("beforeunload",()=>{a.shutdown()})};"requestIdleCallback"in window?requestIdleCallback(()=>void Os(),{timeout:3e3}):setTimeout(()=>void Os(),1);export{HS as $,$S as A,cb as B,ii as C,sb as D,lb as E,Sh as F,Y as G,gi as H,$s as I,fn as J,YS as K,qS as L,km as M,uf as N,VS as O,wb as P,pm as Q,zu as R,gm as S,aa as T,Us as U,aw as V,Xn as W,df as X,Di as Y,MS as Z,k as _,Wu as a,OS as a0,jS as a1,Qo as a2,wm as a3,Sm as a4,bi as a5,nw as a6,FS as a7,QS as a8,d as a9,tw as aA,GS as aB,Ah as aC,KS as aD,si as aE,ug as aF,bn as aG,Gh as aH,ZS as aI,$h as aJ,di as aK,ia as aL,ym as aM,mm as aN,Ai as aO,XS as aP,WS as aQ,ew as aR,vi as aS,an as aT,ne as aa,b as ab,X as ac,_m as ad,US as ae,Fs as af,ds as ag,cc as ah,Ra as ai,dc as aj,pn as ak,lc as al,ib as am,Js as an,Ii as ao,Yh as ap,JS as aq,Kl as ar,Rh as as,sa as at,iw as au,gn as av,tf as aw,je as ax,jm as ay,Um as az,so as b,bh as c,Co as d,ja as e,ci as f,Mo as g,Vs as h,Sb as i,Xp as j,Ei as k,J as l,g as m,vm as n,bt as o,zS as p,qa as q,ki as r,Si as s,wi as t,Yt as u,sw as v,mf as w,O as x,yi as y,rw as z}; //# sourceMappingURL=index-C1TetM93.js.map