PageSourceSearch

https://api.lhv.ai/chunk-YMCVAGZY.js

js lhv.ai collected 2026-10-05 12:09:59 UTC 3,133 bytes, 1 lines download raw bytes

1import{a as N}from"./chunk-NNMBHOYS.js";import{$ as R,A as o,B as g,C as y,D as A,E as h,Fa as F,Ia as M,J as c,Ja as V,K as v,L as k,S as s,T as l,a as u,ga as b,h as m,k as f,l as C,o as r,p as _,ta as T,u as w,ua as P,v as S,va as E,wa as O,xa as I,y as x,ya as B,z as a}from"./chunk-XR3FWTWK.js";import{f as d}from"./chunk-6H3I7D5M.js";function U(i,t){if(i&1){let e=y();a(0,"lhv-grid-item",6)(1,"lhv-grid",7)(2,"lhv-alert",8),c(3),s(4,"translate"),o(),a(5,"button",9),A("click",function(){f(e);let p=h();return C(p.startTokenFlow())}),c(6),s(7,"translate"),o()()()}if(i&2){let e=h();r(3),v(l(4,3,e.error)),r(2),x("block",!0),r(),k(" ",l(7,5,"apiAccess.start")," ")}}var z=class i{constructor(){this.route=m(R),this.configService=m(N),this.error=null}static{this.KNOWN_ERRORS=new Set(["access_denied","server_error","temporarily_unavailable"])}ngOnInit(){let t=this.route.snapshot.queryParamMap.get("error");if(t){let e=i.KNOWN_ERRORS.has(t)?`apiAccess.error.${t}`:"apiAccess.error.unknown";this.error=e}else this.startTokenFlow()}startTokenFlow(){return d(this,null,function*(){let t=this.generateRandomString(64),e=yield this.sha256(t),n=this.generateRandomString(32),{apiResource:p}=yield u(this.configService.getConfig());sessionStorage.setItem("pkce_verifier",t),sessionStorage.setItem("pkce_state",n);let D=new URLSearchParams({response_type:"code",client_id:"api-access",redirect_uri:`${window.location.origin}/api-access/callback`,scope:"accounts:read transactions:read",code_challenge:e,code_challenge_method:"S256",resource:p,state:n});window.location.href=`/oauth2/authorize?${D}`})}generateRandomString(t){let e=new Uint8Array(t);return crypto.getRandomValues(e),btoa(String.fromCharCode(...e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}sha256(t){return d(this,null,function*(){let e=new TextEncoder().encode(t),n=yield crypto.subtle.digest("SHA-256",e);return btoa(String.fromCharCode(...new Uint8Array(n))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")})}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275cmp=_({type:i,selectors:[["lhv-api-access"]],decls:14,vars:4,consts:[[1,"page-shell"],["justify","center"],["size","xlarge"],["contentPaddingTop","56","contentPaddingBottom","56"],["flow","column","gap","xlarge"],["is","h1","as","display-2","align","center"],["size","large","alignSelf","center"],["flow","column","gap","medium"],["variant","error","data-testid","error-msg"],["lhvButton","","variant","primary","data-testid","start-btn",3,"click","block"]],template:function(e,n){e&1&&(a(0,"div",0),g(1,"lhv-app-header"),a(2,"main")(3,"lhv-container")(4,"lhv-grid",1)(5,"lhv-grid-item",2)(6,"lhv-card",3)(7,"lhv-grid",4)(8,"lhv-grid-item")(9,"lhv-text",5),c(10),s(11,"translate"),o()(),w(12,U,8,7,"lhv-grid-item",6),o()()()()()(),g(13,"lhv-app-footer"),o()),e&2&&(r(10),v(l(11,2,"apiAccess.title")),r(2),S(n.error?12:-1))},dependencies:[O,E,T,I,B,F,P,M,V,b],styles:["main[_ngcontent-%COMP%]{flex:1}main[_ngcontent-%COMP%]   lhv-container[_ngcontent-%COMP%]{padding-top:var(--lhv-spacing-48);padding-bottom:var(--lhv-spacing-48)}"]})}};export{z as ApiAccessComponent};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.