@redocly/replay 0.3.13 → 0.3.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/replay.cjs CHANGED
@@ -113,7 +113,7 @@ Example:
113
113
  Perhaps you're looking to import 'styled-components/native'?
114
114
  Read more about this at https://www.styled-components.com/docs/basics#react-native`),process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&typeof window<"u"&&(window["__styled-components-init__"]=window["__styled-components-init__"]||0,window["__styled-components-init__"]===1&&console.warn(`It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.
115
115
 
116
- See https://s-c.sh/2BAXzed for more info.`),window["__styled-components-init__"]+=1);const B=$p,{createElement:Ro,createContext:zI,createRef:$H,forwardRef:Aw,useCallback:Nn,useContext:Pw,useEffect:Rs,useImperativeHandle:Ew,useLayoutEffect:LI,useMemo:XI,useRef:rr,useState:Su}=H,rv=H["useId".toString()],jf=zI(null);jf.displayName="PanelGroupContext";const Ja=LI,GI=typeof rv=="function"?rv:()=>null;let YI=0;function H0(n=null){const e=GI(),t=rr(n||e||null);return t.current===null&&(t.current=""+YI++),n??t.current}function Tw({children:n,className:e="",collapsedSize:t,collapsible:r,defaultSize:i,forwardedRef:s,id:o,maxSize:a,minSize:l,onCollapse:c,onExpand:u,onResize:f,order:d,style:h,tagName:p="div",...m}){const g=Pw(jf);if(g===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:v,expandPanel:O,getPanelSize:x,getPanelStyle:S,groupId:y,isPanelCollapsed:w,reevaluatePanelConstraints:C,registerPanel:k,resizePanel:P,unregisterPanel:A}=g,E=H0(o),I=rr({callbacks:{onCollapse:c,onExpand:u,onResize:f},constraints:{collapsedSize:t,collapsible:r,defaultSize:i,maxSize:a,minSize:l},id:E,idIsFromProps:o!==void 0,order:d});rr({didLogMissingDefaultSizeWarning:!1}),Ja(()=>{const{callbacks:D,constraints:j}=I.current,F={...j};I.current.id=E,I.current.idIsFromProps=o!==void 0,I.current.order=d,D.onCollapse=c,D.onExpand=u,D.onResize=f,j.collapsedSize=t,j.collapsible=r,j.defaultSize=i,j.maxSize=a,j.minSize=l,(F.collapsedSize!==j.collapsedSize||F.collapsible!==j.collapsible||F.maxSize!==j.maxSize||F.minSize!==j.minSize)&&C(I.current,F)}),Ja(()=>{const D=I.current;return k(D),()=>{A(D)}},[d,E,k,A]),Ew(s,()=>({collapse:()=>{v(I.current)},expand:()=>{O(I.current)},getId(){return E},getSize(){return x(I.current)},isCollapsed(){return w(I.current)},isExpanded(){return!w(I.current)},resize:D=>{P(I.current,D)}}),[v,O,x,w,E,P]);const $=S(I.current,i);return Ro(p,{...m,children:n,className:e,style:{...$,...h},"data-panel":"","data-panel-id":E,"data-panel-group-id":y,"data-panel-collapsible":void 0,"data-panel-size":void 0})}const Rp=Aw((n,e)=>Ro(Tw,{...n,forwardedRef:e}));Tw.displayName="Panel";Rp.displayName="forwardRef(Panel)";function _e(n,e="Assertion failed!"){if(!n)throw console.error(e),Error(e)}const Iw=10;function Ka(n,e,t=Iw){n=parseFloat(n.toFixed(t)),e=parseFloat(e.toFixed(t));const r=n-e;return r===0?0:r>0?1:-1}function tr(n,e,t){return Ka(n,e,t)===0}function uo({panelConstraints:n,panelIndex:e,size:t}){const r=n[e];_e(r!=null);let{collapsedSize:i=0,collapsible:s,maxSize:o=100,minSize:a=0}=r;if(Ka(t,a)<0)if(s){const l=(i+a)/2;Ka(t,l)<0?t=i:t=a}else t=a;return t=Math.min(o,t),t=parseFloat(t.toFixed(Iw)),t}function Ia({delta:n,layout:e,panelConstraints:t,pivotIndices:r,trigger:i}){if(tr(n,0))return e;const s=[...e],[o,a]=r;_e(o!=null),_e(a!=null);let l=0;if(i==="keyboard"){{const u=n<0?a:o,f=t[u];if(_e(f),f.collapsible){const d=e[u];_e(d!=null);const h=t[u];_e(h);const{collapsedSize:p=0,minSize:m=0}=h;if(tr(d,p)){const g=m-d;Ka(g,Math.abs(n))>0&&(n=n<0?0-g:g)}}}{const u=n<0?o:a,f=t[u];_e(f);const{collapsible:d}=f;if(d){const h=e[u];_e(h!=null);const p=t[u];_e(p);const{collapsedSize:m=0,minSize:g=0}=p;if(tr(h,g)){const v=h-m;Ka(v,Math.abs(n))>0&&(n=n<0?0-v:v)}}}}{const u=n<0?1:-1;let f=n<0?a:o,d=0;for(;;){const p=e[f];_e(p!=null);const g=uo({panelConstraints:t,panelIndex:f,size:100})-p;if(d+=g,f+=u,f<0||f>=t.length)break}const h=Math.min(Math.abs(n),Math.abs(d));n=n<0?0-h:h}{let f=n<0?o:a;for(;f>=0&&f<t.length;){const d=Math.abs(n)-Math.abs(l),h=e[f];_e(h!=null);const p=h-d,m=uo({panelConstraints:t,panelIndex:f,size:p});if(!tr(h,m)&&(l+=h-m,s[f]=m,l.toPrecision(3).localeCompare(Math.abs(n).toPrecision(3),void 0,{numeric:!0})>=0))break;n<0?f--:f++}}if(tr(l,0))return e;{const u=n<0?a:o,f=e[u];_e(f!=null);const d=f+l,h=uo({panelConstraints:t,panelIndex:u,size:d});if(s[u]=h,!tr(h,d)){let p=d-h,g=n<0?a:o;for(;g>=0&&g<t.length;){const v=s[g];_e(v!=null);const O=v+p,x=uo({panelConstraints:t,panelIndex:g,size:O});if(tr(v,x)||(p-=x-v,s[g]=x),tr(p,0))break;n>0?g--:g++}}}const c=s.reduce((u,f)=>f+u,0);return tr(c,100)?s:e}function UI({layout:n,panelsArray:e,pivotIndices:t}){let r=0,i=100,s=0,o=0;const a=t[0];_e(a!=null),e.forEach((f,d)=>{const{constraints:h}=f,{maxSize:p=100,minSize:m=0}=h;d===a?(r=m,i=p):(s+=m,o+=p)});const l=Math.min(i,100-s),c=Math.max(r,100-o),u=n[a];return{valueMax:l,valueMin:c,valueNow:u}}function el(n,e=document){return Array.from(e.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${n}"]`))}function $w(n,e,t=document){const i=el(n,t).findIndex(s=>s.getAttribute("data-panel-resize-handle-id")===e);return i??null}function Rw(n,e,t){const r=$w(n,e,t);return r!=null?[r,r+1]:[-1,-1]}function jw(n,e=document){var t;if(e instanceof HTMLElement&&(e==null||(t=e.dataset)===null||t===void 0?void 0:t.panelGroupId)==n)return e;const r=e.querySelector(`[data-panel-group][data-panel-group-id="${n}"]`);return r||null}function Df(n,e=document){const t=e.querySelector(`[data-panel-resize-handle-id="${n}"]`);return t||null}function qI(n,e,t,r=document){var i,s,o,a;const l=Df(e,r),c=el(n,r),u=l?c.indexOf(l):-1,f=(i=(s=t[u])===null||s===void 0?void 0:s.id)!==null&&i!==void 0?i:null,d=(o=(a=t[u+1])===null||a===void 0?void 0:a.id)!==null&&o!==void 0?o:null;return[f,d]}function HI({committedValuesRef:n,eagerValuesRef:e,groupId:t,layout:r,panelDataArray:i,panelGroupElement:s,setLayout:o}){rr({didWarnAboutMissingResizeHandle:!1}),Ja(()=>{if(!s)return;const a=el(t,s);for(let l=0;l<i.length-1;l++){const{valueMax:c,valueMin:u,valueNow:f}=UI({layout:r,panelsArray:i,pivotIndices:[l,l+1]}),d=a[l];if(d!=null){const h=i[l];_e(h),d.setAttribute("aria-controls",h.id),d.setAttribute("aria-valuemax",""+Math.round(c)),d.setAttribute("aria-valuemin",""+Math.round(u)),d.setAttribute("aria-valuenow",f!=null?""+Math.round(f):"")}}return()=>{a.forEach((l,c)=>{l.removeAttribute("aria-controls"),l.removeAttribute("aria-valuemax"),l.removeAttribute("aria-valuemin"),l.removeAttribute("aria-valuenow")})}},[t,r,i,s]),Rs(()=>{if(!s)return;const a=e.current;_e(a);const{panelDataArray:l}=a,c=jw(t,s);_e(c!=null,`No group found for id "${t}"`);const u=el(t,s);_e(u);const f=u.map(d=>{const h=d.getAttribute("data-panel-resize-handle-id");_e(h);const[p,m]=qI(t,h,l,s);if(p==null||m==null)return()=>{};const g=v=>{if(!v.defaultPrevented)switch(v.key){case"Enter":{v.preventDefault();const O=l.findIndex(x=>x.id===p);if(O>=0){const x=l[O];_e(x);const S=r[O],{collapsedSize:y=0,collapsible:w,minSize:C=0}=x.constraints;if(S!=null&&w){const k=Ia({delta:tr(S,y)?C-y:y-S,layout:r,panelConstraints:l.map(P=>P.constraints),pivotIndices:Rw(t,h,s),trigger:"keyboard"});r!==k&&o(k)}}break}}};return d.addEventListener("keydown",g),()=>{d.removeEventListener("keydown",g)}});return()=>{f.forEach(d=>d())}},[s,n,e,t,r,i,o])}function iv(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function Dw(n){return n.type==="keydown"}function Qw(n){return n.type.startsWith("mouse")}function Bw(n){return n.type.startsWith("touch")}function _w(n,e){const t=n==="horizontal";if(Qw(e))return t?e.clientX:e.clientY;if(Bw(e)){const r=e.touches[0];return _e(r),t?r.screenX:r.screenY}else throw Error(`Unsupported event type "${e.type}"`)}function JI(n,e,t,r,i){const s=t==="horizontal",o=Df(e,i);_e(o);const a=o.getAttribute("data-panel-group-id");_e(a);let{initialCursorPosition:l}=r;const c=_w(t,n),u=jw(a,i);_e(u);const f=u.getBoundingClientRect(),d=s?f.width:f.height;return(c-l)/d*100}function KI(n,e,t,r,i,s){if(Dw(n)){const o=t==="horizontal";let a=0;n.shiftKey?a=100:i!=null?a=i:a=10;let l=0;switch(n.key){case"ArrowDown":l=o?0:a;break;case"ArrowLeft":l=o?-a:0;break;case"ArrowRight":l=o?a:0;break;case"ArrowUp":l=o?0:-a;break;case"End":l=100;break;case"Home":l=-100;break}return l}else return r==null?0:JI(n,e,t,r,s)}function e$({panelDataArray:n}){const e=Array(n.length),t=n.map(s=>s.constraints);let r=0,i=100;for(let s=0;s<n.length;s++){const o=t[s];_e(o);const{defaultSize:a}=o;a!=null&&(r++,e[s]=a,i-=a)}for(let s=0;s<n.length;s++){const o=t[s];_e(o);const{defaultSize:a}=o;if(a!=null)continue;const l=n.length-r,c=i/l;r++,e[s]=c,i-=c}return e}function Hs(n,e,t){e.forEach((r,i)=>{const s=n[i];_e(s);const{callbacks:o,constraints:a,id:l}=s,{collapsedSize:c=0,collapsible:u}=a,f=t[l];if(f==null||r!==f){t[l]=r;const{onCollapse:d,onExpand:h,onResize:p}=o;p&&p(r,f),u&&(d||h)&&(h&&(f==null||f===c)&&r!==c&&h(),d&&(f==null||f!==c)&&r===c&&d())}})}function oc(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t])return!1;return!0}function t$({defaultSize:n,dragState:e,layout:t,panelData:r,panelIndex:i,precision:s=3}){const o=t[i];let a;return o==null?a=n??"1":r.length===1?a="1":a=o.toPrecision(s),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}let jp=null,Ps=null;function Mw(n){switch(n){case"horizontal":return"ew-resize";case"horizontal-max":return"w-resize";case"horizontal-min":return"e-resize";case"vertical":return"ns-resize";case"vertical-max":return"n-resize";case"vertical-min":return"s-resize"}}function n$(){Ps!==null&&(document.head.removeChild(Ps),jp=null,Ps=null)}function jd(n){if(jp===n)return;jp=n;const e=Mw(n);Ps===null&&(Ps=document.createElement("style"),document.head.appendChild(Ps)),Ps.innerHTML=`*{cursor: ${e}!important;}`}function r$(n,e=10){let t=null;return(...i)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{n(...i)},e)}}function sv(n){try{if(typeof localStorage<"u")n.getItem=e=>localStorage.getItem(e),n.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),n.getItem=()=>null,n.setItem=()=>{}}}function Nw(n){return`react-resizable-panels:${n}`}function Fw(n){return n.map(e=>{const{constraints:t,id:r,idIsFromProps:i,order:s}=e;return i?r:s?`${s}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(",")}function Zw(n,e){try{const t=Nw(n),r=e.getItem(t);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function i$(n,e,t){var r,i;const s=(r=Zw(n,t))!==null&&r!==void 0?r:{},o=Fw(e);return(i=s[o])!==null&&i!==void 0?i:null}function s$(n,e,t,r,i){var s;const o=Nw(n),a=Fw(e),l=(s=Zw(n,i))!==null&&s!==void 0?s:{};l[a]={expandToSizes:Object.fromEntries(t.entries()),layout:r};try{i.setItem(o,JSON.stringify(l))}catch(c){console.error(c)}}function ov({layout:n,panelConstraints:e}){const t=[...n],r=t.reduce((s,o)=>s+o,0);if(t.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${t.map(s=>`${s}%`).join(", ")}`);if(!tr(r,100))for(let s=0;s<e.length;s++){const o=t[s];_e(o!=null);const a=100/r*o;t[s]=a}let i=0;for(let s=0;s<e.length;s++){const o=t[s];_e(o!=null);const a=uo({panelConstraints:e,panelIndex:s,size:o});o!=a&&(i+=o-a,t[s]=a)}if(!tr(i,0))for(let s=0;s<e.length;s++){const o=t[s];_e(o!=null);const a=o+i,l=uo({panelConstraints:e,panelIndex:s,size:a});if(o!==l&&(i-=l-o,t[s]=l,tr(i,0)))break}return t}const o$=100,$a={getItem:n=>(sv($a),$a.getItem(n)),setItem:(n,e)=>{sv($a),$a.setItem(n,e)}},av={};function Ww({autoSaveId:n=null,children:e,className:t="",direction:r,forwardedRef:i,id:s=null,onLayout:o=null,keyboardResizeBy:a=null,storage:l=$a,style:c,tagName:u="div",...f}){const d=H0(s),h=rr(null),[p,m]=Su(null),[g,v]=Su([]),O=rr({}),x=rr(new Map),S=rr(0),y=rr({autoSaveId:n,direction:r,dragState:p,id:d,keyboardResizeBy:a,onLayout:o,storage:l}),w=rr({layout:g,panelDataArray:[],panelDataArrayChanged:!1});rr({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),Ew(i,()=>({getId:()=>y.current.id,getLayout:()=>{const{layout:R}=w.current;return R},setLayout:R=>{const{onLayout:M}=y.current,{layout:_,panelDataArray:q}=w.current,N=ov({layout:R,panelConstraints:q.map(ee=>ee.constraints)});iv(_,N)||(v(N),w.current.layout=N,M&&M(N),Hs(q,N,O.current))}}),[]),Ja(()=>{y.current.autoSaveId=n,y.current.direction=r,y.current.dragState=p,y.current.id=d,y.current.onLayout=o,y.current.storage=l}),HI({committedValuesRef:y,eagerValuesRef:w,groupId:d,layout:g,panelDataArray:w.current.panelDataArray,setLayout:v,panelGroupElement:h.current}),Rs(()=>{const{panelDataArray:R}=w.current;if(n){if(g.length===0||g.length!==R.length)return;let M=av[n];M==null&&(M=r$(s$,o$),av[n]=M);const _=[...R],q=new Map(x.current);M(n,_,q,g,l)}},[n,g,l]),Rs(()=>{});const C=Nn(R=>{const{onLayout:M}=y.current,{layout:_,panelDataArray:q}=w.current;if(R.constraints.collapsible){const N=q.map(se=>se.constraints),{collapsedSize:ee=0,panelSize:z,pivotIndices:ae}=vs(q,R,_);if(_e(z!=null),z!==ee){x.current.set(R.id,z);const oe=ao(q,R)===q.length-1?z-ee:ee-z,K=Ia({delta:oe,layout:_,panelConstraints:N,pivotIndices:ae,trigger:"imperative-api"});oc(_,K)||(v(K),w.current.layout=K,M&&M(K),Hs(q,K,O.current))}}},[]),k=Nn(R=>{const{onLayout:M}=y.current,{layout:_,panelDataArray:q}=w.current;if(R.constraints.collapsible){const N=q.map(oe=>oe.constraints),{collapsedSize:ee=0,panelSize:z,minSize:ae=0,pivotIndices:se}=vs(q,R,_);if(z===ee){const oe=x.current.get(R.id),K=oe!=null&&oe>=ae?oe:ae,Y=ao(q,R)===q.length-1?z-K:K-z,te=Ia({delta:Y,layout:_,panelConstraints:N,pivotIndices:se,trigger:"imperative-api"});oc(_,te)||(v(te),w.current.layout=te,M&&M(te),Hs(q,te,O.current))}}},[]),P=Nn(R=>{const{layout:M,panelDataArray:_}=w.current,{panelSize:q}=vs(_,R,M);return _e(q!=null),q},[]),A=Nn((R,M)=>{const{panelDataArray:_}=w.current,q=ao(_,R);return t$({defaultSize:M,dragState:p,layout:g,panelData:_,panelIndex:q})},[p,g]),E=Nn(R=>{const{layout:M,panelDataArray:_}=w.current,{collapsedSize:q=0,collapsible:N,panelSize:ee}=vs(_,R,M);return N===!0&&ee===q},[]),I=Nn(R=>{const{layout:M,panelDataArray:_}=w.current,{collapsedSize:q=0,collapsible:N,panelSize:ee}=vs(_,R,M);return _e(ee!=null),!N||ee>q},[]),$=Nn(R=>{const{panelDataArray:M}=w.current;M.push(R),M.sort((_,q)=>{const N=_.order,ee=q.order;return N==null&&ee==null?0:N==null?-1:ee==null?1:N-ee}),w.current.panelDataArrayChanged=!0},[]);Ja(()=>{if(w.current.panelDataArrayChanged){w.current.panelDataArrayChanged=!1;const{autoSaveId:R,onLayout:M,storage:_}=y.current,{layout:q,panelDataArray:N}=w.current;let ee=null;if(R){const ae=i$(R,N,_);ae&&(x.current=new Map(Object.entries(ae.expandToSizes)),ee=ae.layout)}ee==null&&(ee=e$({panelDataArray:N}));const z=ov({layout:ee,panelConstraints:N.map(ae=>ae.constraints)});iv(q,z)||(v(z),w.current.layout=z,M&&M(z),Hs(N,z,O.current))}});const D=Nn(R=>function(_){_.preventDefault();const q=h.current;if(!q)return()=>null;const{direction:N,dragState:ee,id:z,keyboardResizeBy:ae,onLayout:se}=y.current,{layout:oe,panelDataArray:K}=w.current,{initialLayout:de}=ee??{},Y=Rw(z,R,q);let te=KI(_,R,N,ee,ae,q);if(te===0)return;const ge=N==="horizontal";document.dir==="rtl"&&ge&&(te=-te);const ve=K.map(Ae=>Ae.constraints),$e=Ia({delta:te,layout:de??oe,panelConstraints:ve,pivotIndices:Y,trigger:Dw(_)?"keyboard":"mouse-or-touch"}),xe=!oc(oe,$e);(Qw(_)||Bw(_))&&S.current!=te&&(S.current=te,jd(xe?ge?"horizontal":"vertical":ge?te<0?"horizontal-min":"horizontal-max":te<0?"vertical-min":"vertical-max")),xe&&(v($e),w.current.layout=$e,se&&se($e),Hs(K,$e,O.current))},[]),j=Nn((R,M)=>{const{onLayout:_}=y.current,{layout:q,panelDataArray:N}=w.current,ee=N.map(de=>de.constraints),{panelSize:z,pivotIndices:ae}=vs(N,R,q);_e(z!=null);const oe=ao(N,R)===N.length-1?z-M:M-z,K=Ia({delta:oe,layout:q,panelConstraints:ee,pivotIndices:ae,trigger:"imperative-api"});oc(q,K)||(v(K),w.current.layout=K,_&&_(K),Hs(N,K,O.current))},[]),F=Nn((R,M)=>{const{layout:_,panelDataArray:q}=w.current,{collapsedSize:N=0,collapsible:ee,defaultSize:z,maxSize:ae=100,minSize:se=0}=M,{collapsedSize:oe=0,collapsible:K,defaultSize:de,maxSize:Y=100,minSize:te=0}=R.constraints,{panelSize:ge}=vs(q,R,_);_e(ge!=null),ee&&K&&N!==oe&&ge===N?j(R,oe):ge<te?j(R,te):ge>Y&&j(R,Y)},[j]),X=Nn((R,M)=>{const{direction:_}=y.current,{layout:q}=w.current;if(!h.current)return;const N=Df(R,h.current);_e(N);const ee=_w(_,M);m({dragHandleId:R,dragHandleRect:N.getBoundingClientRect(),initialCursorPosition:ee,initialLayout:q})},[]),W=Nn(()=>{n$(),m(null)},[]),U=Nn(R=>{const{panelDataArray:M}=w.current,_=ao(M,R);_>=0&&(M.splice(_,1),delete O.current[R.id],w.current.panelDataArrayChanged=!0)},[]),G=XI(()=>({collapsePanel:C,direction:r,dragState:p,expandPanel:k,getPanelSize:P,getPanelStyle:A,groupId:d,isPanelCollapsed:E,isPanelExpanded:I,reevaluatePanelConstraints:F,registerPanel:$,registerResizeHandle:D,resizePanel:j,startDragging:X,stopDragging:W,unregisterPanel:U,panelGroupElement:h.current}),[C,p,r,k,P,A,d,E,I,F,$,D,j,X,W,U]),V={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return Ro(jf.Provider,{value:G},Ro(u,{...f,children:e,className:t,style:{...V,...c},ref:h,"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":d}))}const Vw=Aw((n,e)=>Ro(Ww,{...n,forwardedRef:e}));Ww.displayName="PanelGroup";Vw.displayName="forwardRef(PanelGroup)";function ao(n,e){return n.findIndex(t=>t===e||t.id===e.id)}function vs(n,e,t){const r=ao(n,e),s=r===n.length-1?[r-1,r]:[r,r+1],o=t[r];return{...e.constraints,panelSize:o,pivotIndices:s}}function a$({disabled:n,handleId:e,resizeHandler:t,panelGroupElement:r}){Rs(()=>{if(n||t==null||r==null)return;const i=Df(e,r);if(i==null)return;const s=o=>{if(!o.defaultPrevented)switch(o.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{o.preventDefault(),t(o);break}case"F6":{o.preventDefault();const a=i.getAttribute("data-panel-group-id");_e(a);const l=el(a,r),c=$w(a,e,r);_e(c!==null);const u=o.shiftKey?c>0?c-1:l.length-1:c+1<l.length?c+1:0;l[u].focus();break}}};return i.addEventListener("keydown",s),()=>{i.removeEventListener("keydown",s)}},[r,n,e,t])}function zw({children:n=null,className:e="",disabled:t=!1,id:r,onDragging:i,style:s={},tabIndex:o=0,tagName:a="div",...l}){const c=rr(null),u=rr({onDragging:i});Rs(()=>{u.current.onDragging=i});const f=Pw(jf);if(f===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:d,dragState:h,groupId:p,registerResizeHandle:m,startDragging:g,stopDragging:v,panelGroupElement:O}=f,x=H0(r),S=(h==null?void 0:h.dragHandleId)===x,[y,w]=Su(!1),[C,k]=Su(null),P=Nn(()=>{const E=c.current;_e(E),E.blur(),v();const{onDragging:I}=u.current;I&&I(!1)},[v]);Rs(()=>{if(t)k(null);else{const E=m(x);k(()=>E)}},[t,x,m]),Rs(()=>{if(t||C==null||!S)return;const E=j=>{C(j)},I=j=>{C(j)},$=c.current;_e($);const D=$.ownerDocument;return D.body.addEventListener("contextmenu",P),D.body.addEventListener("mousemove",E),D.body.addEventListener("touchmove",E),D.body.addEventListener("mouseleave",I),window.addEventListener("mouseup",P),window.addEventListener("touchend",P),()=>{D.body.removeEventListener("contextmenu",P),D.body.removeEventListener("mousemove",E),D.body.removeEventListener("touchmove",E),D.body.removeEventListener("mouseleave",I),window.removeEventListener("mouseup",P),window.removeEventListener("touchend",P)}},[d,t,S,C,P]),a$({disabled:t,handleId:x,resizeHandler:C,panelGroupElement:O});const A={cursor:Mw(d),touchAction:"none",userSelect:"none"};return Ro(a,{...l,children:n,className:e,onBlur:()=>w(!1),onFocus:()=>w(!0),onMouseDown:E=>{g(x,E.nativeEvent);const I=u.current;_e(I);const{onDragging:$}=I;$&&$(!0)},onMouseUp:P,onTouchCancel:P,onTouchEnd:P,onTouchStart:E=>{g(x,E.nativeEvent);const I=u.current;_e(I);const{onDragging:$}=I;$&&$(!0)},ref:c,role:"separator",style:{...A,...s},tabIndex:o,"data-panel-group-direction":d,"data-panel-group-id":p,"data-resize-handle":"","data-resize-handle-active":S?"pointer":y?"keyboard":void 0,"data-panel-resize-handle-enabled":!t,"data-panel-resize-handle-id":x})}zw.displayName="PanelResizeHandle";const Ne=B.div`
116
+ See https://s-c.sh/2BAXzed for more info.`),window["__styled-components-init__"]+=1);const B=$p,{createElement:Ro,createContext:zI,createRef:RH,forwardRef:Aw,useCallback:Nn,useContext:Pw,useEffect:Rs,useImperativeHandle:Ew,useLayoutEffect:LI,useMemo:XI,useRef:rr,useState:Su}=H,rv=H["useId".toString()],jf=zI(null);jf.displayName="PanelGroupContext";const Ja=LI,GI=typeof rv=="function"?rv:()=>null;let YI=0;function H0(n=null){const e=GI(),t=rr(n||e||null);return t.current===null&&(t.current=""+YI++),n??t.current}function Tw({children:n,className:e="",collapsedSize:t,collapsible:r,defaultSize:i,forwardedRef:s,id:o,maxSize:a,minSize:l,onCollapse:c,onExpand:u,onResize:f,order:d,style:h,tagName:p="div",...m}){const g=Pw(jf);if(g===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:v,expandPanel:O,getPanelSize:x,getPanelStyle:S,groupId:y,isPanelCollapsed:w,reevaluatePanelConstraints:C,registerPanel:k,resizePanel:P,unregisterPanel:A}=g,E=H0(o),I=rr({callbacks:{onCollapse:c,onExpand:u,onResize:f},constraints:{collapsedSize:t,collapsible:r,defaultSize:i,maxSize:a,minSize:l},id:E,idIsFromProps:o!==void 0,order:d});rr({didLogMissingDefaultSizeWarning:!1}),Ja(()=>{const{callbacks:D,constraints:j}=I.current,F={...j};I.current.id=E,I.current.idIsFromProps=o!==void 0,I.current.order=d,D.onCollapse=c,D.onExpand=u,D.onResize=f,j.collapsedSize=t,j.collapsible=r,j.defaultSize=i,j.maxSize=a,j.minSize=l,(F.collapsedSize!==j.collapsedSize||F.collapsible!==j.collapsible||F.maxSize!==j.maxSize||F.minSize!==j.minSize)&&C(I.current,F)}),Ja(()=>{const D=I.current;return k(D),()=>{A(D)}},[d,E,k,A]),Ew(s,()=>({collapse:()=>{v(I.current)},expand:()=>{O(I.current)},getId(){return E},getSize(){return x(I.current)},isCollapsed(){return w(I.current)},isExpanded(){return!w(I.current)},resize:D=>{P(I.current,D)}}),[v,O,x,w,E,P]);const $=S(I.current,i);return Ro(p,{...m,children:n,className:e,style:{...$,...h},"data-panel":"","data-panel-id":E,"data-panel-group-id":y,"data-panel-collapsible":void 0,"data-panel-size":void 0})}const Rp=Aw((n,e)=>Ro(Tw,{...n,forwardedRef:e}));Tw.displayName="Panel";Rp.displayName="forwardRef(Panel)";function _e(n,e="Assertion failed!"){if(!n)throw console.error(e),Error(e)}const Iw=10;function Ka(n,e,t=Iw){n=parseFloat(n.toFixed(t)),e=parseFloat(e.toFixed(t));const r=n-e;return r===0?0:r>0?1:-1}function tr(n,e,t){return Ka(n,e,t)===0}function uo({panelConstraints:n,panelIndex:e,size:t}){const r=n[e];_e(r!=null);let{collapsedSize:i=0,collapsible:s,maxSize:o=100,minSize:a=0}=r;if(Ka(t,a)<0)if(s){const l=(i+a)/2;Ka(t,l)<0?t=i:t=a}else t=a;return t=Math.min(o,t),t=parseFloat(t.toFixed(Iw)),t}function Ia({delta:n,layout:e,panelConstraints:t,pivotIndices:r,trigger:i}){if(tr(n,0))return e;const s=[...e],[o,a]=r;_e(o!=null),_e(a!=null);let l=0;if(i==="keyboard"){{const u=n<0?a:o,f=t[u];if(_e(f),f.collapsible){const d=e[u];_e(d!=null);const h=t[u];_e(h);const{collapsedSize:p=0,minSize:m=0}=h;if(tr(d,p)){const g=m-d;Ka(g,Math.abs(n))>0&&(n=n<0?0-g:g)}}}{const u=n<0?o:a,f=t[u];_e(f);const{collapsible:d}=f;if(d){const h=e[u];_e(h!=null);const p=t[u];_e(p);const{collapsedSize:m=0,minSize:g=0}=p;if(tr(h,g)){const v=h-m;Ka(v,Math.abs(n))>0&&(n=n<0?0-v:v)}}}}{const u=n<0?1:-1;let f=n<0?a:o,d=0;for(;;){const p=e[f];_e(p!=null);const g=uo({panelConstraints:t,panelIndex:f,size:100})-p;if(d+=g,f+=u,f<0||f>=t.length)break}const h=Math.min(Math.abs(n),Math.abs(d));n=n<0?0-h:h}{let f=n<0?o:a;for(;f>=0&&f<t.length;){const d=Math.abs(n)-Math.abs(l),h=e[f];_e(h!=null);const p=h-d,m=uo({panelConstraints:t,panelIndex:f,size:p});if(!tr(h,m)&&(l+=h-m,s[f]=m,l.toPrecision(3).localeCompare(Math.abs(n).toPrecision(3),void 0,{numeric:!0})>=0))break;n<0?f--:f++}}if(tr(l,0))return e;{const u=n<0?a:o,f=e[u];_e(f!=null);const d=f+l,h=uo({panelConstraints:t,panelIndex:u,size:d});if(s[u]=h,!tr(h,d)){let p=d-h,g=n<0?a:o;for(;g>=0&&g<t.length;){const v=s[g];_e(v!=null);const O=v+p,x=uo({panelConstraints:t,panelIndex:g,size:O});if(tr(v,x)||(p-=x-v,s[g]=x),tr(p,0))break;n>0?g--:g++}}}const c=s.reduce((u,f)=>f+u,0);return tr(c,100)?s:e}function UI({layout:n,panelsArray:e,pivotIndices:t}){let r=0,i=100,s=0,o=0;const a=t[0];_e(a!=null),e.forEach((f,d)=>{const{constraints:h}=f,{maxSize:p=100,minSize:m=0}=h;d===a?(r=m,i=p):(s+=m,o+=p)});const l=Math.min(i,100-s),c=Math.max(r,100-o),u=n[a];return{valueMax:l,valueMin:c,valueNow:u}}function el(n,e=document){return Array.from(e.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${n}"]`))}function $w(n,e,t=document){const i=el(n,t).findIndex(s=>s.getAttribute("data-panel-resize-handle-id")===e);return i??null}function Rw(n,e,t){const r=$w(n,e,t);return r!=null?[r,r+1]:[-1,-1]}function jw(n,e=document){var t;if(e instanceof HTMLElement&&(e==null||(t=e.dataset)===null||t===void 0?void 0:t.panelGroupId)==n)return e;const r=e.querySelector(`[data-panel-group][data-panel-group-id="${n}"]`);return r||null}function Df(n,e=document){const t=e.querySelector(`[data-panel-resize-handle-id="${n}"]`);return t||null}function qI(n,e,t,r=document){var i,s,o,a;const l=Df(e,r),c=el(n,r),u=l?c.indexOf(l):-1,f=(i=(s=t[u])===null||s===void 0?void 0:s.id)!==null&&i!==void 0?i:null,d=(o=(a=t[u+1])===null||a===void 0?void 0:a.id)!==null&&o!==void 0?o:null;return[f,d]}function HI({committedValuesRef:n,eagerValuesRef:e,groupId:t,layout:r,panelDataArray:i,panelGroupElement:s,setLayout:o}){rr({didWarnAboutMissingResizeHandle:!1}),Ja(()=>{if(!s)return;const a=el(t,s);for(let l=0;l<i.length-1;l++){const{valueMax:c,valueMin:u,valueNow:f}=UI({layout:r,panelsArray:i,pivotIndices:[l,l+1]}),d=a[l];if(d!=null){const h=i[l];_e(h),d.setAttribute("aria-controls",h.id),d.setAttribute("aria-valuemax",""+Math.round(c)),d.setAttribute("aria-valuemin",""+Math.round(u)),d.setAttribute("aria-valuenow",f!=null?""+Math.round(f):"")}}return()=>{a.forEach((l,c)=>{l.removeAttribute("aria-controls"),l.removeAttribute("aria-valuemax"),l.removeAttribute("aria-valuemin"),l.removeAttribute("aria-valuenow")})}},[t,r,i,s]),Rs(()=>{if(!s)return;const a=e.current;_e(a);const{panelDataArray:l}=a,c=jw(t,s);_e(c!=null,`No group found for id "${t}"`);const u=el(t,s);_e(u);const f=u.map(d=>{const h=d.getAttribute("data-panel-resize-handle-id");_e(h);const[p,m]=qI(t,h,l,s);if(p==null||m==null)return()=>{};const g=v=>{if(!v.defaultPrevented)switch(v.key){case"Enter":{v.preventDefault();const O=l.findIndex(x=>x.id===p);if(O>=0){const x=l[O];_e(x);const S=r[O],{collapsedSize:y=0,collapsible:w,minSize:C=0}=x.constraints;if(S!=null&&w){const k=Ia({delta:tr(S,y)?C-y:y-S,layout:r,panelConstraints:l.map(P=>P.constraints),pivotIndices:Rw(t,h,s),trigger:"keyboard"});r!==k&&o(k)}}break}}};return d.addEventListener("keydown",g),()=>{d.removeEventListener("keydown",g)}});return()=>{f.forEach(d=>d())}},[s,n,e,t,r,i,o])}function iv(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function Dw(n){return n.type==="keydown"}function Qw(n){return n.type.startsWith("mouse")}function Bw(n){return n.type.startsWith("touch")}function _w(n,e){const t=n==="horizontal";if(Qw(e))return t?e.clientX:e.clientY;if(Bw(e)){const r=e.touches[0];return _e(r),t?r.screenX:r.screenY}else throw Error(`Unsupported event type "${e.type}"`)}function JI(n,e,t,r,i){const s=t==="horizontal",o=Df(e,i);_e(o);const a=o.getAttribute("data-panel-group-id");_e(a);let{initialCursorPosition:l}=r;const c=_w(t,n),u=jw(a,i);_e(u);const f=u.getBoundingClientRect(),d=s?f.width:f.height;return(c-l)/d*100}function KI(n,e,t,r,i,s){if(Dw(n)){const o=t==="horizontal";let a=0;n.shiftKey?a=100:i!=null?a=i:a=10;let l=0;switch(n.key){case"ArrowDown":l=o?0:a;break;case"ArrowLeft":l=o?-a:0;break;case"ArrowRight":l=o?a:0;break;case"ArrowUp":l=o?0:-a;break;case"End":l=100;break;case"Home":l=-100;break}return l}else return r==null?0:JI(n,e,t,r,s)}function e$({panelDataArray:n}){const e=Array(n.length),t=n.map(s=>s.constraints);let r=0,i=100;for(let s=0;s<n.length;s++){const o=t[s];_e(o);const{defaultSize:a}=o;a!=null&&(r++,e[s]=a,i-=a)}for(let s=0;s<n.length;s++){const o=t[s];_e(o);const{defaultSize:a}=o;if(a!=null)continue;const l=n.length-r,c=i/l;r++,e[s]=c,i-=c}return e}function Hs(n,e,t){e.forEach((r,i)=>{const s=n[i];_e(s);const{callbacks:o,constraints:a,id:l}=s,{collapsedSize:c=0,collapsible:u}=a,f=t[l];if(f==null||r!==f){t[l]=r;const{onCollapse:d,onExpand:h,onResize:p}=o;p&&p(r,f),u&&(d||h)&&(h&&(f==null||f===c)&&r!==c&&h(),d&&(f==null||f!==c)&&r===c&&d())}})}function oc(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t])return!1;return!0}function t$({defaultSize:n,dragState:e,layout:t,panelData:r,panelIndex:i,precision:s=3}){const o=t[i];let a;return o==null?a=n??"1":r.length===1?a="1":a=o.toPrecision(s),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}let jp=null,Ps=null;function Mw(n){switch(n){case"horizontal":return"ew-resize";case"horizontal-max":return"w-resize";case"horizontal-min":return"e-resize";case"vertical":return"ns-resize";case"vertical-max":return"n-resize";case"vertical-min":return"s-resize"}}function n$(){Ps!==null&&(document.head.removeChild(Ps),jp=null,Ps=null)}function jd(n){if(jp===n)return;jp=n;const e=Mw(n);Ps===null&&(Ps=document.createElement("style"),document.head.appendChild(Ps)),Ps.innerHTML=`*{cursor: ${e}!important;}`}function r$(n,e=10){let t=null;return(...i)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{n(...i)},e)}}function sv(n){try{if(typeof localStorage<"u")n.getItem=e=>localStorage.getItem(e),n.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),n.getItem=()=>null,n.setItem=()=>{}}}function Nw(n){return`react-resizable-panels:${n}`}function Fw(n){return n.map(e=>{const{constraints:t,id:r,idIsFromProps:i,order:s}=e;return i?r:s?`${s}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(",")}function Zw(n,e){try{const t=Nw(n),r=e.getItem(t);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function i$(n,e,t){var r,i;const s=(r=Zw(n,t))!==null&&r!==void 0?r:{},o=Fw(e);return(i=s[o])!==null&&i!==void 0?i:null}function s$(n,e,t,r,i){var s;const o=Nw(n),a=Fw(e),l=(s=Zw(n,i))!==null&&s!==void 0?s:{};l[a]={expandToSizes:Object.fromEntries(t.entries()),layout:r};try{i.setItem(o,JSON.stringify(l))}catch(c){console.error(c)}}function ov({layout:n,panelConstraints:e}){const t=[...n],r=t.reduce((s,o)=>s+o,0);if(t.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${t.map(s=>`${s}%`).join(", ")}`);if(!tr(r,100))for(let s=0;s<e.length;s++){const o=t[s];_e(o!=null);const a=100/r*o;t[s]=a}let i=0;for(let s=0;s<e.length;s++){const o=t[s];_e(o!=null);const a=uo({panelConstraints:e,panelIndex:s,size:o});o!=a&&(i+=o-a,t[s]=a)}if(!tr(i,0))for(let s=0;s<e.length;s++){const o=t[s];_e(o!=null);const a=o+i,l=uo({panelConstraints:e,panelIndex:s,size:a});if(o!==l&&(i-=l-o,t[s]=l,tr(i,0)))break}return t}const o$=100,$a={getItem:n=>(sv($a),$a.getItem(n)),setItem:(n,e)=>{sv($a),$a.setItem(n,e)}},av={};function Ww({autoSaveId:n=null,children:e,className:t="",direction:r,forwardedRef:i,id:s=null,onLayout:o=null,keyboardResizeBy:a=null,storage:l=$a,style:c,tagName:u="div",...f}){const d=H0(s),h=rr(null),[p,m]=Su(null),[g,v]=Su([]),O=rr({}),x=rr(new Map),S=rr(0),y=rr({autoSaveId:n,direction:r,dragState:p,id:d,keyboardResizeBy:a,onLayout:o,storage:l}),w=rr({layout:g,panelDataArray:[],panelDataArrayChanged:!1});rr({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),Ew(i,()=>({getId:()=>y.current.id,getLayout:()=>{const{layout:R}=w.current;return R},setLayout:R=>{const{onLayout:M}=y.current,{layout:_,panelDataArray:q}=w.current,N=ov({layout:R,panelConstraints:q.map(ee=>ee.constraints)});iv(_,N)||(v(N),w.current.layout=N,M&&M(N),Hs(q,N,O.current))}}),[]),Ja(()=>{y.current.autoSaveId=n,y.current.direction=r,y.current.dragState=p,y.current.id=d,y.current.onLayout=o,y.current.storage=l}),HI({committedValuesRef:y,eagerValuesRef:w,groupId:d,layout:g,panelDataArray:w.current.panelDataArray,setLayout:v,panelGroupElement:h.current}),Rs(()=>{const{panelDataArray:R}=w.current;if(n){if(g.length===0||g.length!==R.length)return;let M=av[n];M==null&&(M=r$(s$,o$),av[n]=M);const _=[...R],q=new Map(x.current);M(n,_,q,g,l)}},[n,g,l]),Rs(()=>{});const C=Nn(R=>{const{onLayout:M}=y.current,{layout:_,panelDataArray:q}=w.current;if(R.constraints.collapsible){const N=q.map(se=>se.constraints),{collapsedSize:ee=0,panelSize:z,pivotIndices:ae}=vs(q,R,_);if(_e(z!=null),z!==ee){x.current.set(R.id,z);const oe=ao(q,R)===q.length-1?z-ee:ee-z,K=Ia({delta:oe,layout:_,panelConstraints:N,pivotIndices:ae,trigger:"imperative-api"});oc(_,K)||(v(K),w.current.layout=K,M&&M(K),Hs(q,K,O.current))}}},[]),k=Nn(R=>{const{onLayout:M}=y.current,{layout:_,panelDataArray:q}=w.current;if(R.constraints.collapsible){const N=q.map(oe=>oe.constraints),{collapsedSize:ee=0,panelSize:z,minSize:ae=0,pivotIndices:se}=vs(q,R,_);if(z===ee){const oe=x.current.get(R.id),K=oe!=null&&oe>=ae?oe:ae,Y=ao(q,R)===q.length-1?z-K:K-z,te=Ia({delta:Y,layout:_,panelConstraints:N,pivotIndices:se,trigger:"imperative-api"});oc(_,te)||(v(te),w.current.layout=te,M&&M(te),Hs(q,te,O.current))}}},[]),P=Nn(R=>{const{layout:M,panelDataArray:_}=w.current,{panelSize:q}=vs(_,R,M);return _e(q!=null),q},[]),A=Nn((R,M)=>{const{panelDataArray:_}=w.current,q=ao(_,R);return t$({defaultSize:M,dragState:p,layout:g,panelData:_,panelIndex:q})},[p,g]),E=Nn(R=>{const{layout:M,panelDataArray:_}=w.current,{collapsedSize:q=0,collapsible:N,panelSize:ee}=vs(_,R,M);return N===!0&&ee===q},[]),I=Nn(R=>{const{layout:M,panelDataArray:_}=w.current,{collapsedSize:q=0,collapsible:N,panelSize:ee}=vs(_,R,M);return _e(ee!=null),!N||ee>q},[]),$=Nn(R=>{const{panelDataArray:M}=w.current;M.push(R),M.sort((_,q)=>{const N=_.order,ee=q.order;return N==null&&ee==null?0:N==null?-1:ee==null?1:N-ee}),w.current.panelDataArrayChanged=!0},[]);Ja(()=>{if(w.current.panelDataArrayChanged){w.current.panelDataArrayChanged=!1;const{autoSaveId:R,onLayout:M,storage:_}=y.current,{layout:q,panelDataArray:N}=w.current;let ee=null;if(R){const ae=i$(R,N,_);ae&&(x.current=new Map(Object.entries(ae.expandToSizes)),ee=ae.layout)}ee==null&&(ee=e$({panelDataArray:N}));const z=ov({layout:ee,panelConstraints:N.map(ae=>ae.constraints)});iv(q,z)||(v(z),w.current.layout=z,M&&M(z),Hs(N,z,O.current))}});const D=Nn(R=>function(_){_.preventDefault();const q=h.current;if(!q)return()=>null;const{direction:N,dragState:ee,id:z,keyboardResizeBy:ae,onLayout:se}=y.current,{layout:oe,panelDataArray:K}=w.current,{initialLayout:de}=ee??{},Y=Rw(z,R,q);let te=KI(_,R,N,ee,ae,q);if(te===0)return;const ge=N==="horizontal";document.dir==="rtl"&&ge&&(te=-te);const ve=K.map(Ae=>Ae.constraints),$e=Ia({delta:te,layout:de??oe,panelConstraints:ve,pivotIndices:Y,trigger:Dw(_)?"keyboard":"mouse-or-touch"}),xe=!oc(oe,$e);(Qw(_)||Bw(_))&&S.current!=te&&(S.current=te,jd(xe?ge?"horizontal":"vertical":ge?te<0?"horizontal-min":"horizontal-max":te<0?"vertical-min":"vertical-max")),xe&&(v($e),w.current.layout=$e,se&&se($e),Hs(K,$e,O.current))},[]),j=Nn((R,M)=>{const{onLayout:_}=y.current,{layout:q,panelDataArray:N}=w.current,ee=N.map(de=>de.constraints),{panelSize:z,pivotIndices:ae}=vs(N,R,q);_e(z!=null);const oe=ao(N,R)===N.length-1?z-M:M-z,K=Ia({delta:oe,layout:q,panelConstraints:ee,pivotIndices:ae,trigger:"imperative-api"});oc(q,K)||(v(K),w.current.layout=K,_&&_(K),Hs(N,K,O.current))},[]),F=Nn((R,M)=>{const{layout:_,panelDataArray:q}=w.current,{collapsedSize:N=0,collapsible:ee,defaultSize:z,maxSize:ae=100,minSize:se=0}=M,{collapsedSize:oe=0,collapsible:K,defaultSize:de,maxSize:Y=100,minSize:te=0}=R.constraints,{panelSize:ge}=vs(q,R,_);_e(ge!=null),ee&&K&&N!==oe&&ge===N?j(R,oe):ge<te?j(R,te):ge>Y&&j(R,Y)},[j]),X=Nn((R,M)=>{const{direction:_}=y.current,{layout:q}=w.current;if(!h.current)return;const N=Df(R,h.current);_e(N);const ee=_w(_,M);m({dragHandleId:R,dragHandleRect:N.getBoundingClientRect(),initialCursorPosition:ee,initialLayout:q})},[]),W=Nn(()=>{n$(),m(null)},[]),U=Nn(R=>{const{panelDataArray:M}=w.current,_=ao(M,R);_>=0&&(M.splice(_,1),delete O.current[R.id],w.current.panelDataArrayChanged=!0)},[]),G=XI(()=>({collapsePanel:C,direction:r,dragState:p,expandPanel:k,getPanelSize:P,getPanelStyle:A,groupId:d,isPanelCollapsed:E,isPanelExpanded:I,reevaluatePanelConstraints:F,registerPanel:$,registerResizeHandle:D,resizePanel:j,startDragging:X,stopDragging:W,unregisterPanel:U,panelGroupElement:h.current}),[C,p,r,k,P,A,d,E,I,F,$,D,j,X,W,U]),V={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return Ro(jf.Provider,{value:G},Ro(u,{...f,children:e,className:t,style:{...V,...c},ref:h,"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":d}))}const Vw=Aw((n,e)=>Ro(Ww,{...n,forwardedRef:e}));Ww.displayName="PanelGroup";Vw.displayName="forwardRef(PanelGroup)";function ao(n,e){return n.findIndex(t=>t===e||t.id===e.id)}function vs(n,e,t){const r=ao(n,e),s=r===n.length-1?[r-1,r]:[r,r+1],o=t[r];return{...e.constraints,panelSize:o,pivotIndices:s}}function a$({disabled:n,handleId:e,resizeHandler:t,panelGroupElement:r}){Rs(()=>{if(n||t==null||r==null)return;const i=Df(e,r);if(i==null)return;const s=o=>{if(!o.defaultPrevented)switch(o.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{o.preventDefault(),t(o);break}case"F6":{o.preventDefault();const a=i.getAttribute("data-panel-group-id");_e(a);const l=el(a,r),c=$w(a,e,r);_e(c!==null);const u=o.shiftKey?c>0?c-1:l.length-1:c+1<l.length?c+1:0;l[u].focus();break}}};return i.addEventListener("keydown",s),()=>{i.removeEventListener("keydown",s)}},[r,n,e,t])}function zw({children:n=null,className:e="",disabled:t=!1,id:r,onDragging:i,style:s={},tabIndex:o=0,tagName:a="div",...l}){const c=rr(null),u=rr({onDragging:i});Rs(()=>{u.current.onDragging=i});const f=Pw(jf);if(f===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:d,dragState:h,groupId:p,registerResizeHandle:m,startDragging:g,stopDragging:v,panelGroupElement:O}=f,x=H0(r),S=(h==null?void 0:h.dragHandleId)===x,[y,w]=Su(!1),[C,k]=Su(null),P=Nn(()=>{const E=c.current;_e(E),E.blur(),v();const{onDragging:I}=u.current;I&&I(!1)},[v]);Rs(()=>{if(t)k(null);else{const E=m(x);k(()=>E)}},[t,x,m]),Rs(()=>{if(t||C==null||!S)return;const E=j=>{C(j)},I=j=>{C(j)},$=c.current;_e($);const D=$.ownerDocument;return D.body.addEventListener("contextmenu",P),D.body.addEventListener("mousemove",E),D.body.addEventListener("touchmove",E),D.body.addEventListener("mouseleave",I),window.addEventListener("mouseup",P),window.addEventListener("touchend",P),()=>{D.body.removeEventListener("contextmenu",P),D.body.removeEventListener("mousemove",E),D.body.removeEventListener("touchmove",E),D.body.removeEventListener("mouseleave",I),window.removeEventListener("mouseup",P),window.removeEventListener("touchend",P)}},[d,t,S,C,P]),a$({disabled:t,handleId:x,resizeHandler:C,panelGroupElement:O});const A={cursor:Mw(d),touchAction:"none",userSelect:"none"};return Ro(a,{...l,children:n,className:e,onBlur:()=>w(!1),onFocus:()=>w(!0),onMouseDown:E=>{g(x,E.nativeEvent);const I=u.current;_e(I);const{onDragging:$}=I;$&&$(!0)},onMouseUp:P,onTouchCancel:P,onTouchEnd:P,onTouchStart:E=>{g(x,E.nativeEvent);const I=u.current;_e(I);const{onDragging:$}=I;$&&$(!0)},ref:c,role:"separator",style:{...A,...s},tabIndex:o,"data-panel-group-direction":d,"data-panel-group-id":p,"data-resize-handle":"","data-resize-handle-active":S?"pointer":y?"keyboard":void 0,"data-panel-resize-handle-enabled":!t,"data-panel-resize-handle-id":x})}zw.displayName="PanelResizeHandle";const Ne=B.div`
117
117
  border-bottom: 1px solid var(--border-color-secondary);
118
118
  width: 100%;
119
119
  `;function l$({onDoubleClick:n,...e}){return b.jsx(zw,{...e,children:b.jsx(c$,{onDoubleClick:n,children:b.jsx(Ne,{})})})}const c$=B.div`
@@ -311,6 +311,7 @@ html body {
311
311
  flex-direction: row;
312
312
  align-self: flex-end;
313
313
  padding-top: var(--spacing-xxs);
314
+ gap: var(--spacing-xs);
314
315
  `,Vs=({children:n,className:e,...t})=>b.jsx(d3,{className:e,onFocus:r=>r.stopPropagation(),onKeyDown:r=>r.stopPropagation(),onSelect:r=>r.stopPropagation(),onPaste:r=>r.stopPropagation(),onCut:r=>r.stopPropagation(),onClick:r=>r.stopPropagation(),...t,children:n}),d3=B.div`
315
316
  border-radius: var(--border-radius);
316
317
  border: 2px solid var(--border-color-secondary);
@@ -724,9 +725,6 @@ html body {
724
725
  svg {
725
726
  cursor: pointer;
726
727
  }
727
- button {
728
- margin: 0;
729
- }
730
728
  `;function H_({state:n,security:e,securityType:t}){switch(n){case"loading":return{title:"Generating a token",description:"Almost there! Your token is currently being generated and will be ready in less than a minute.",buttonText:"Cancel generating",icon:b.jsx(L.CircleDashIcon,{size:"24px",color:"--color-primary-base"})};case"success":return{title:"Token generated successfully",description:b.jsx(G_,{security:e,securityType:t}),buttonText:"Proceed",icon:b.jsx(L.CheckmarkIcon,{size:"24px",color:"--color-success-base"})};case"error":return{title:"Generating a token failed",description:"An error occurred during token generation. Please check the accuracy of the entered data.",buttonText:"Ok",icon:b.jsx(L.CloseFilledIcon,{size:"24px",color:"--color-error-base"})}}}function J_({state:n,onClick:e,security:t,securityType:r}){const{title:i,description:s,buttonText:o,icon:a}=H_({state:n,security:t,securityType:r});return Q.useEffect(()=>{const l=c=>{c.key==="Escape"&&e()};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l)}},[e]),b.jsxs(t9,{children:[a,b.jsx(n9,{children:i}),L.isString(s)?b.jsx(r9,{children:s}):s,b.jsx(L.Button,{onClick:e,children:o})]})}const K_=Q.memo(J_),e9=VI`
731
729
  from {
732
730
  transform: rotate(0deg);
@@ -1678,6 +1676,7 @@ Please report this to https://github.com/markedjs/marked.`,e.silent)return"<p>An
1678
1676
  `,HU=B.div`
1679
1677
  display: flex;
1680
1678
  justify-content: flex-end;
1679
+ gap: var(--spacing-xs);
1681
1680
  `,JU=B(Dk)`
1682
1681
  left: -4px;
1683
1682
  `;function QO({onSearch:n,variant:e="focused",value:t}){const[r,i]=Q.useTransition(),s=o=>{i(()=>{n(o)})};return b.jsx(KU,{"data-testid":"search-input",children:b.jsx(eq,{icon:b.jsx(tq,{color:"--text-color-helper"}),iconPosition:"left",placeholder:"Search",variant:e,value:t,onChange:o=>s(o.target.value)})})}const KU=B.div`
@@ -1862,38 +1861,41 @@ Please report this to https://github.com/markedjs/marked.`,e.silent)return"<p>An
1862
1861
  `,kq=B($l)`
1863
1862
  padding-left: 39px;
1864
1863
  margin-left: -23px;
1865
- `;function Aq({defaultName:n,onChange:e,onApplyNewName:t,onCancelEditing:r,icon:i,placeholder:s="New Folder"}){const[o,a]=Q.useState(n),l=u=>{a(u.target.value),e==null||e(u)},c=o.trim();return b.jsx(Rl,{onClickOutside:r,children:b.jsxs(nq,{children:[i,b.jsx(sl,{"data-testid":"edit-item-header-input",type:"text",placeholder:s,value:o,onChange:l}),b.jsx(L.Button,{"data-testid":"edit-item-header-save-button",variant:"primary",onClick:()=>t(c),disabled:!c,children:b.jsx(L.CheckmarkIcon,{})}),b.jsx(L.Button,{variant:"text",onClick:r,icon:b.jsx(L.CloseIcon,{})})]})})}function Pq({environment:n,defaultExpanded:e}){const[t,r]=Q.useState(!1),{sendEvent:i}=Ct(),{state:s,canBeEdited:o,canBeRemoved:a,name:l}=n.get(),c=()=>{n.set(vt),i("environment_creation_cancelled",{})},u=()=>{n.state.set(hr.Normal),i("environment_editing_cancelled",{name:l})},f=()=>{n.state.set(hr.Edit),i("environment_editing_started",{name:l})},d=()=>{n.set(vt),i("environment_removed",{name:l})},h=v=>{s===hr.Draft?i("environment_creation_finished",{name:v}):i("environment_edited",{name:l,newName:v}),n.state.set(hr.Normal),v.length&&n.name.set(v)},p=()=>{r(!0),i("environment_variable_creation_started",{name:l})},m=v=>{n.variables.set(O=>[v,...O]),r(!1),i("environment_variable_creation_finished",{name:l,variable:v.name,isSecret:v.isSecret})},g=()=>{r(!1),i("environment_variable_creation_cancelled",{name:l})};return s===hr.Edit||s===hr.Draft?b.jsx(Aq,{placeholder:"New Environment",defaultName:l,onApplyNewName:h,onCancelEditing:s===hr.Draft?c:u,icon:s===hr.Edit?b.jsx(L.ChevronRightIcon,{size:"14px",color:"--text-color-secondary"}):b.jsx(L.AddIcon,{})}):b.jsx(b.Fragment,{children:b.jsxs(Gf,{dataTestId:`environment-${l}`,title:l,defaultExpanded:e,controls:b.jsxs(Eq,{children:[o&&b.jsx(bo,{size:"small",variant:"text",icon:b.jsx(L.EditIcon,{}),onClick:f,"data-testid":`edit-environment-${l}`}),a&&b.jsx(Rf,{description:mq.replace("{name}",l),onConfirm:d,children:b.jsx(yr,{variant:"text",icon:b.jsx(L.TrashCanIcon,{}),"data-testid":`remove-environment-${l}`})}),(!o||!a)&&b.jsx(ds,{content:hq,children:b.jsx(bo,{size:"small",variant:"text",icon:b.jsx(L.InformationIcon,{})})})]}),children:[t?b.jsx($q,{variable:Xu(),onSave:m,onCancel:g,isNew:!0}):b.jsx(Iq,{icon:b.jsx(L.AddIcon,{}),variant:"secondary",onClick:p,iconPosition:"left",size:"small",children:"New variable"}),n.variables.map(v=>b.jsx(Q.Fragment,{children:b.jsx(xq,{variable:v,environment:n})},v.get().id))]})})}const Eq=B.div`
1864
+ `;function Aq({defaultName:n,onChange:e,onApplyNewName:t,onCancelEditing:r,icon:i,placeholder:s="New Folder"}){const[o,a]=Q.useState(n),l=u=>{a(u.target.value),e==null||e(u)},c=o.trim();return b.jsx(Rl,{onClickOutside:r,children:b.jsxs(nq,{children:[i,b.jsx(sl,{"data-testid":"edit-item-header-input",type:"text",placeholder:s,value:o,onChange:l}),b.jsxs(Pq,{children:[b.jsx(L.Button,{"data-testid":"edit-item-header-save-button",variant:"primary",onClick:()=>t(c),disabled:!c,children:b.jsx(L.CheckmarkIcon,{})}),b.jsx(L.Button,{variant:"text",onClick:r,icon:b.jsx(L.CloseIcon,{})})]})]})})}const Pq=B.div`
1865
+ display: flex;
1866
+ gap: var(--spacing-xs);
1867
+ `;function Eq({environment:n,defaultExpanded:e}){const[t,r]=Q.useState(!1),{sendEvent:i}=Ct(),{state:s,canBeEdited:o,canBeRemoved:a,name:l}=n.get(),c=()=>{n.set(vt),i("environment_creation_cancelled",{})},u=()=>{n.state.set(hr.Normal),i("environment_editing_cancelled",{name:l})},f=()=>{n.state.set(hr.Edit),i("environment_editing_started",{name:l})},d=()=>{n.set(vt),i("environment_removed",{name:l})},h=v=>{s===hr.Draft?i("environment_creation_finished",{name:v}):i("environment_edited",{name:l,newName:v}),n.state.set(hr.Normal),v.length&&n.name.set(v)},p=()=>{r(!0),i("environment_variable_creation_started",{name:l})},m=v=>{n.variables.set(O=>[v,...O]),r(!1),i("environment_variable_creation_finished",{name:l,variable:v.name,isSecret:v.isSecret})},g=()=>{r(!1),i("environment_variable_creation_cancelled",{name:l})};return s===hr.Edit||s===hr.Draft?b.jsx(Aq,{placeholder:"New Environment",defaultName:l,onApplyNewName:h,onCancelEditing:s===hr.Draft?c:u,icon:s===hr.Edit?b.jsx(L.ChevronRightIcon,{size:"14px",color:"--text-color-secondary"}):b.jsx(L.AddIcon,{})}):b.jsx(b.Fragment,{children:b.jsxs(Gf,{dataTestId:`environment-${l}`,title:l,defaultExpanded:e,controls:b.jsxs(Tq,{children:[o&&b.jsx(bo,{size:"small",variant:"text",icon:b.jsx(L.EditIcon,{}),onClick:f,"data-testid":`edit-environment-${l}`}),a&&b.jsx(Rf,{description:mq.replace("{name}",l),onConfirm:d,children:b.jsx(yr,{variant:"text",icon:b.jsx(L.TrashCanIcon,{}),"data-testid":`remove-environment-${l}`})}),(!o||!a)&&b.jsx(ds,{content:hq,children:b.jsx(bo,{size:"small",variant:"text",icon:b.jsx(L.InformationIcon,{})})})]}),children:[t?b.jsx(Rq,{variable:Xu(),onSave:m,onCancel:g,isNew:!0}):b.jsx($q,{icon:b.jsx(L.AddIcon,{}),variant:"secondary",onClick:p,iconPosition:"left",size:"small",children:"New variable"}),n.variables.map(v=>b.jsx(Q.Fragment,{children:b.jsx(xq,{variable:v,environment:n})},v.get().id))]})})}const Tq=B.div`
1866
1868
  display: flex;
1867
1869
  flex-direction: row;
1868
1870
  gap: var(--spacing-xxs);
1869
1871
  align-items: center;
1870
- `,Tq=B(L.Button)`
1872
+ `,Iq=B(L.Button)`
1871
1873
  align-self: flex-start;
1872
1874
  margin: 0;
1873
- `,Iq=B(Tq)`
1875
+ `,$q=B(Iq)`
1874
1876
  margin: 8px 0 8px -7px;
1875
1877
  font-size: var(--font-size-base);
1876
1878
  font-weight: var(--font-weight-regular);
1877
1879
  line-height: var(--line-height-base);
1878
- `,$q=B($l)`
1880
+ `,Rq=B($l)`
1879
1881
  padding-left: 39px;
1880
1882
  margin-left: -23px;
1881
- `;function Rq(){const[n,e]=Q.useState(""),{environments:t,selectedEnvironmentId:r}=Le(),{sendEvent:i}=Ct(),s=Q.useMemo(()=>t.filter(l=>l.name.get().toLowerCase().includes(n.toLowerCase())),[n,t]),o=()=>{e(""),t.set(l=>[{id:crypto.randomUUID(),name:"",variables:[],state:hr.Draft,canBeRemoved:!0,canBeEdited:!0},...l]),i("environment_creation_started",{})},a=l=>{e(l)};return b.jsxs(jq,{children:[b.jsxs(BO,{children:[b.jsx(QO,{value:n,onSearch:a}),b.jsx(Be,{}),b.jsx(DT,{children:b.jsx(L.Button,{"data-testid":"add-environment-btn",variant:"text",disabled:!!t.find(({state:l})=>l.get()===hr.Draft),onClick:o,size:"small",icon:b.jsx(L.AddIcon,{})})})]}),b.jsx(_O,{children:s.map(l=>b.jsx(Pq,{environment:l,defaultExpanded:l.get().id===r.get()},l.id.get()))})]})}const jq=B.div`
1883
+ `;function jq(){const[n,e]=Q.useState(""),{environments:t,selectedEnvironmentId:r}=Le(),{sendEvent:i}=Ct(),s=Q.useMemo(()=>t.filter(l=>l.name.get().toLowerCase().includes(n.toLowerCase())),[n,t]),o=()=>{e(""),t.set(l=>[{id:crypto.randomUUID(),name:"",variables:[],state:hr.Draft,canBeRemoved:!0,canBeEdited:!0},...l]),i("environment_creation_started",{})},a=l=>{e(l)};return b.jsxs(Dq,{children:[b.jsxs(BO,{children:[b.jsx(QO,{value:n,onSearch:a}),b.jsx(Be,{}),b.jsx(DT,{children:b.jsx(L.Button,{"data-testid":"add-environment-btn",variant:"text",disabled:!!t.find(({state:l})=>l.get()===hr.Draft),onClick:o,size:"small",icon:b.jsx(L.AddIcon,{})})})]}),b.jsx(_O,{children:s.map(l=>b.jsx(Eq,{environment:l,defaultExpanded:l.get().id===r.get()},l.id.get()))})]})}const Dq=B.div`
1882
1884
  display: flex;
1883
1885
  flex-direction: column;
1884
1886
  width: 100%;
1885
- `;function dw({name:n,value:e}){const[t,r]=Q.useState(!1),{sendEvent:i}=Ct(),s=()=>{i("app_credential_visibility_toggled",{name:n,visible:!t}),r(!t)},o=()=>{i("app_credential_copied",{name:n})};return b.jsxs(Dq,{children:[b.jsxs(Qq,{children:[b.jsx(Bq,{children:n}),b.jsx(_q,{children:t?e:"••••••••••••••••••••••••••••••••••••"})]}),b.jsxs(Mq,{children:[b.jsx(L.Button,{variant:"text",size:"small",icon:t?b.jsx(L.ViewIcon,{}):b.jsx(L.ViewOffIcon,{}),onClick:s}),b.jsx(L.CopyButton,{toasterPlacement:"left",data:e,onCopyClick:o})]})]})}const Dq=B.div`
1887
+ `;function dw({name:n,value:e}){const[t,r]=Q.useState(!1),{sendEvent:i}=Ct(),s=()=>{i("app_credential_visibility_toggled",{name:n,visible:!t}),r(!t)},o=()=>{i("app_credential_copied",{name:n})};return b.jsxs(Qq,{children:[b.jsxs(Bq,{children:[b.jsx(_q,{children:n}),b.jsx(Mq,{children:t?e:"••••••••••••••••••••••••••••••••••••"})]}),b.jsxs(Nq,{children:[b.jsx(L.Button,{variant:"text",size:"small",icon:t?b.jsx(L.ViewIcon,{}):b.jsx(L.ViewOffIcon,{}),onClick:s}),b.jsx(L.CopyButton,{toasterPlacement:"left",data:e,onCopyClick:o})]})]})}const Qq=B.div`
1886
1888
  display: flex;
1887
1889
  padding: var(--spacing-xs) var(--spacing-xs);
1888
1890
  align-items: flex-start;
1889
1891
  gap: var(--spacing-xs);
1890
1892
  align-self: stretch;
1891
- `,Qq=B.div`
1893
+ `,Bq=B.div`
1892
1894
  display: flex;
1893
1895
  align-items: flex-start;
1894
1896
  gap: 10px;
1895
1897
  flex: 1 0 0;
1896
- `,Bq=B.div`
1898
+ `,_q=B.div`
1897
1899
  display: -webkit-box;
1898
1900
  width: var(--64-px-4-rem-spacing-11, 64px);
1899
1901
  -webkit-box-orient: vertical;
@@ -1906,19 +1908,19 @@ Please report this to https://github.com/markedjs/marked.`,e.silent)return"<p>An
1906
1908
  font-style: normal;
1907
1909
  font-weight: var(--font-weight-semibold);
1908
1910
  line-height: var(--line-height-sm);
1909
- `,_q=B.div`
1911
+ `,Mq=B.div`
1910
1912
  flex: 1 0 0;
1911
1913
  color: var(--text-color-primary);
1912
1914
  font-size: var(--font-size-sm);
1913
1915
  font-style: normal;
1914
1916
  font-weight: var(--font-weight-regular);
1915
1917
  line-height: var(--line-height-sm);
1916
- `,Mq=B.div`
1918
+ `,Nq=B.div`
1917
1919
  display: flex;
1918
1920
  justify-content: flex-end;
1919
1921
  align-items: center;
1920
1922
  gap: var(--spacing-xxs);
1921
- `;function Nq({credential:n,number:e}){const{requestActiveTabIdx:t,request:{security:{securities:r,selectedSecuritySchemeId:i}}}=Le(),s=Kt(),{clientId:o,clientSecret:a,valueToUseInHeader:l}=n,{sendEvent:c}=Ct(),u=()=>{t.set(IY);const d=ua(r,i.get())[0];if(!d.get())return;const{securityType:h,...p}=d,m=(g,v)=>{if(g.get()===le.AuthorizationCode){const{clientId:O,clientSecret:x}=v[le.AuthorizationCode];(o||a)&&cn(o||a||"",O,s),a&&cn(a,x,s)}if(g.get()===le.Implicit){const{clientId:O}=v[le.Implicit];(o||a)&&cn(o||a||"",O,s)}if(g.get()===le.ClientCredentials){const{clientId:O,clientSecret:x}=v[le.ClientCredentials];(o||a)&&cn(o||a||"",O,s),a&&cn(a,x,s)}if(g.get()===le.Password){const{clientId:O,clientSecret:x}=v[le.Password];(o||a)&&cn(o||a||"",O,s),a&&cn(a,x,s)}};if(h.get()===re.BasicAuth){const{username:g,password:v}=p[re.BasicAuth];(o||a)&&cn(o||a||"",g,s),a&&cn(a,v,s)}if(h.get()===re.DigestAuth){const{username:g,password:v}=p[re.DigestAuth];(o||a)&&cn(o||a||"",g,s),a&&cn(a,v,s)}if(h.get()===re.JWT){const{token:g}=p[re.JWT];(o||a)&&cn(o||a||"",g,s)}if(h.get()===re.APIKey){const{key:g}=p[re.APIKey];cn(n[l||"clientSecret"]||o||"",g,s)}if(h.get()===re.OAuth2){const g=p[re.OAuth2],v=g.grantType;m(v,g)}if(h.get()===re.OpenIDConnect){const g=p[re.OpenIDConnect],{grantType:v}=g;m(v,g)}c("apps_use_key_clicked",{number:e})};return b.jsxs(Fq,{children:[b.jsxs(Zq,{children:[b.jsx(Vq,{children:e.toString().padStart(2,"0")}),b.jsxs(Wq,{children:[n.stage&&b.jsx(L.Tag,{color:"gray",children:n.stage}),b.jsx(L.Tag,{color:"green",children:n.status})]})]}),o&&b.jsx(dw,{name:"API key",value:o}),a&&b.jsx(dw,{name:o?"Secret":"API key",value:a}),b.jsx(zq,{children:b.jsx(L.Button,{size:"small",variant:"secondary",onClick:u,children:"Use key"})})]})}const Fq=B.div`
1923
+ `;function Fq({credential:n,number:e}){const{requestActiveTabIdx:t,request:{security:{securities:r,selectedSecuritySchemeId:i}}}=Le(),s=Kt(),{clientId:o,clientSecret:a,valueToUseInHeader:l}=n,{sendEvent:c}=Ct(),u=()=>{t.set(IY);const d=ua(r,i.get())[0];if(!d.get())return;const{securityType:h,...p}=d,m=(g,v)=>{if(g.get()===le.AuthorizationCode){const{clientId:O,clientSecret:x}=v[le.AuthorizationCode];(o||a)&&cn(o||a||"",O,s),a&&cn(a,x,s)}if(g.get()===le.Implicit){const{clientId:O}=v[le.Implicit];(o||a)&&cn(o||a||"",O,s)}if(g.get()===le.ClientCredentials){const{clientId:O,clientSecret:x}=v[le.ClientCredentials];(o||a)&&cn(o||a||"",O,s),a&&cn(a,x,s)}if(g.get()===le.Password){const{clientId:O,clientSecret:x}=v[le.Password];(o||a)&&cn(o||a||"",O,s),a&&cn(a,x,s)}};if(h.get()===re.BasicAuth){const{username:g,password:v}=p[re.BasicAuth];(o||a)&&cn(o||a||"",g,s),a&&cn(a,v,s)}if(h.get()===re.DigestAuth){const{username:g,password:v}=p[re.DigestAuth];(o||a)&&cn(o||a||"",g,s),a&&cn(a,v,s)}if(h.get()===re.JWT){const{token:g}=p[re.JWT];(o||a)&&cn(o||a||"",g,s)}if(h.get()===re.APIKey){const{key:g}=p[re.APIKey];cn(n[l||"clientSecret"]||o||"",g,s)}if(h.get()===re.OAuth2){const g=p[re.OAuth2],v=g.grantType;m(v,g)}if(h.get()===re.OpenIDConnect){const g=p[re.OpenIDConnect],{grantType:v}=g;m(v,g)}c("apps_use_key_clicked",{number:e})};return b.jsxs(Zq,{children:[b.jsxs(Wq,{children:[b.jsx(zq,{children:e.toString().padStart(2,"0")}),b.jsxs(Vq,{children:[n.stage&&b.jsx(L.Tag,{color:"gray",children:n.stage}),b.jsx(L.Tag,{color:"green",children:n.status})]})]}),o&&b.jsx(dw,{name:"API key",value:o}),a&&b.jsx(dw,{name:o?"Secret":"API key",value:a}),b.jsx(Lq,{children:b.jsx(L.Button,{size:"small",variant:"secondary",onClick:u,children:"Use key"})})]})}const Zq=B.div`
1922
1924
  display: flex;
1923
1925
  flex-direction: column;
1924
1926
  align-self: stretch;
@@ -1932,7 +1934,7 @@ Please report this to https://github.com/markedjs/marked.`,e.silent)return"<p>An
1932
1934
  & > :not(:last-child) {
1933
1935
  border-bottom: 1px solid var(--border-color-secondary);
1934
1936
  }
1935
- `,Zq=B.div`
1937
+ `,Wq=B.div`
1936
1938
  display: flex;
1937
1939
  justify-content: space-between;
1938
1940
  padding: var(--spacing-xs) var(--spacing-xs);
@@ -1940,16 +1942,16 @@ Please report this to https://github.com/markedjs/marked.`,e.silent)return"<p>An
1940
1942
  align-items: center;
1941
1943
  align-self: stretch;
1942
1944
  background: var(--layer-color);
1943
- `,Wq=B.div`
1945
+ `,Vq=B.div`
1944
1946
  display: flex;
1945
1947
  gap: var(--spacing-xxs);
1946
- `,Vq=B.div`
1948
+ `,zq=B.div`
1947
1949
  color: var(--text-color-secondary, #3b3c45);
1948
1950
  font-size: var(--font-size-sm);
1949
1951
  font-style: normal;
1950
1952
  font-weight: var(--font-weight-regular);
1951
1953
  line-height: var(--line-height-sm);
1952
- `,zq=B.div`
1954
+ `,Lq=B.div`
1953
1955
  display: flex;
1954
1956
  padding: var(--spacing-xs) var(--spacing-xs);
1955
1957
  border-radius: 0 0 var(--border-radius-md) var(--border-radius-md);
@@ -1957,16 +1959,16 @@ Please report this to https://github.com/markedjs/marked.`,e.silent)return"<p>An
1957
1959
  align-items: center;
1958
1960
  align-self: stretch;
1959
1961
  background: var(--layer-color);
1960
- `;function Lq({app:n}){const[e,t]=Q.useState(!1),{title:r,credentials:i,id:s}=n,o=i.get()||[],a=l=>{l&&!i.get()&&(t(!0),fetch(`/api/api-keys/apps/${s.get()}`).then(c=>c.json().then(u=>{c.ok&&i.set(u.credentials)}).catch(()=>console.log("Something went wrong")).finally(()=>t(!1))))};return b.jsx(Gf,{dataTestId:`app-${name}`,title:r.get(),onToggle:a,children:b.jsx(Xq,{children:e?b.jsx(Gq,{children:b.jsx(L.SpinnerIcon,{size:"16px",color:"--icon-color-additional"})}):o.length?o.map((l,c)=>b.jsx(Nq,{credential:l,number:c+1},l.id)):b.jsx(Yq,{children:"There are no credentials yet."})})})}const Xq=B.div`
1962
+ `;function Xq({app:n}){const[e,t]=Q.useState(!1),{title:r,credentials:i,id:s}=n,o=i.get()||[],a=l=>{l&&!i.get()&&(t(!0),fetch(`/api/api-keys/apps/${s.get()}`).then(c=>c.json().then(u=>{c.ok&&i.set(u.credentials)}).catch(()=>console.log("Something went wrong")).finally(()=>t(!1))))};return b.jsx(Gf,{dataTestId:`app-${name}`,title:r.get(),onToggle:a,children:b.jsx(Gq,{children:e?b.jsx(Yq,{children:b.jsx(L.SpinnerIcon,{size:"16px",color:"--icon-color-additional"})}):o.length?o.map((l,c)=>b.jsx(Fq,{credential:l,number:c+1},l.id)):b.jsx(Uq,{children:"There are no credentials yet."})})})}const Gq=B.div`
1961
1963
  padding-bottom: var(--spacing-xxs);
1962
1964
  margin-left: -7px;
1963
1965
  padding-right: var(--spacing-base);
1964
- `,Gq=B.div`
1966
+ `,Yq=B.div`
1965
1967
  display: flex;
1966
1968
  height: 224px;
1967
1969
  justify-content: center;
1968
1970
  align-items: center;
1969
- `,Yq=B.div`
1971
+ `,Uq=B.div`
1970
1972
  display: flex;
1971
1973
  justify-content: center;
1972
1974
  align-items: center;
@@ -1974,17 +1976,17 @@ Please report this to https://github.com/markedjs/marked.`,e.silent)return"<p>An
1974
1976
  font-size: var(--font-size-base);
1975
1977
  line-height: var(--line-height-base);
1976
1978
  color: var(--text-color-secondary);
1977
- `;function Uq(){const[n,e]=Q.useState(""),{apps:t,apiId:r,appsLoadingState:i}=Le(),{sendEvent:s}=Ct(),o=()=>{window.open("/apps","_blank"),s("apps_request_access_clicked",{})};Q.useEffect(()=>((i.get()===Xr.Idle||i.get()===Xr.Error)&&(i.set(Xr.Loading),fetch(`/api/api-keys/api-products/${r.get()}/access?expand=0`).then(c=>c.json().then(u=>{c.ok?(t.set(u.apps||[]),i.set(Xr.Success)):i.set(Xr.Error)}).catch(()=>i.set(Xr.Error)))),()=>{t.set([]),i.set(Xr.Idle)}),[r]);const a=Q.useMemo(()=>t.filter(c=>c.title.get().toLowerCase().includes(n.toLowerCase())),[n,t]),l=c=>{e(c)};return i.get()===Xr.Loading?b.jsx(Hq,{children:b.jsx(L.SpinnerIcon,{size:"24px",color:"--icon-color-additional"})}):t.length?b.jsxs(qq,{children:[b.jsx(BO,{children:b.jsx(QO,{value:n,onSearch:l})}),b.jsx(_O,{children:a.map(c=>b.jsx(Lq,{app:c},c.get().id))})]}):b.jsxs(QT,{children:["You don't have any apps with access to this API",b.jsx(L.Button,{onClick:o,children:"Request access"})]})}const qq=B.div`
1979
+ `;function qq(){const[n,e]=Q.useState(""),{apps:t,apiId:r,appsLoadingState:i}=Le(),{sendEvent:s}=Ct(),o=()=>{window.open("/apps","_blank"),s("apps_request_access_clicked",{})};Q.useEffect(()=>((i.get()===Xr.Idle||i.get()===Xr.Error)&&(i.set(Xr.Loading),fetch(`/api/api-keys/api-products/${r.get()}/access?expand=0`).then(c=>c.json().then(u=>{c.ok?(t.set(u.apps||[]),i.set(Xr.Success)):i.set(Xr.Error)}).catch(()=>i.set(Xr.Error)))),()=>{t.set([]),i.set(Xr.Idle)}),[r]);const a=Q.useMemo(()=>t.filter(c=>c.title.get().toLowerCase().includes(n.toLowerCase())),[n,t]),l=c=>{e(c)};return i.get()===Xr.Loading?b.jsx(Jq,{children:b.jsx(L.SpinnerIcon,{size:"24px",color:"--icon-color-additional"})}):t.length?b.jsxs(Hq,{children:[b.jsx(BO,{children:b.jsx(QO,{value:n,onSearch:l})}),b.jsx(_O,{children:a.map(c=>b.jsx(Xq,{app:c},c.get().id))})]}):b.jsxs(QT,{children:["You don't have any apps with access to this API",b.jsx(L.Button,{onClick:o,children:"Request access"})]})}const Hq=B.div`
1978
1980
  display: flex;
1979
1981
  flex-direction: column;
1980
1982
  width: 100%;
1981
- `,Hq=B.div`
1983
+ `,Jq=B.div`
1982
1984
  display: flex;
1983
1985
  justify-content: center;
1984
1986
  align-items: center;
1985
1987
  width: 100%;
1986
1988
  height: calc(100vh - 50px);
1987
- }`,{Tab:Jq,TabContent:Kq,TabList:eH,Tabs:tH}=L.markdoc.components;function nH(){const{apiId:n}=Le(),{sendEvent:e}=Ct(),[t,r]=Q.useState(!0),i=Q.useCallback(a=>{e("side_panel_tab_changed",{name:a})},[e]),s=()=>{r(!t),e("side_panel_toggled",{expanded:!t})},o=Q.useMemo(()=>{const a=[b.jsx(Sp,{label:"History",onClick:()=>i("History"),children:b.jsx(rq,{})},"History"),b.jsx(Sp,{label:"Environments",onClick:()=>i("Environments"),children:b.jsx(Rq,{})},"Environments")];return n.get()&&a.push(b.jsx(Sp,{label:"Apps",onClick:()=>i("Apps"),children:b.jsx(Uq,{})})),a},[n,i]);return b.jsxs(rH,{$expanded:t,children:[t&&b.jsxs(iH,{children:[...o]}),b.jsx(sH,{variant:"text",onClick:s,children:t?b.jsx(L.SidePanelOpenIcon,{}):b.jsx(L.SidePanelCloseIcon,{})})]})}const rH=B.div`
1989
+ }`,{Tab:Kq,TabContent:eH,TabList:tH,Tabs:nH}=L.markdoc.components;function rH(){const{apiId:n}=Le(),{sendEvent:e}=Ct(),[t,r]=Q.useState(!0),i=Q.useCallback(a=>{e("side_panel_tab_changed",{name:a})},[e]),s=()=>{r(!t),e("side_panel_toggled",{expanded:!t})},o=Q.useMemo(()=>{const a=[b.jsx(Sp,{label:"History",onClick:()=>i("History"),children:b.jsx(rq,{})},"History"),b.jsx(Sp,{label:"Environments",onClick:()=>i("Environments"),children:b.jsx(jq,{})},"Environments")];return n.get()&&a.push(b.jsx(Sp,{label:"Apps",onClick:()=>i("Apps"),children:b.jsx(qq,{})})),a},[n,i]);return b.jsxs(iH,{$expanded:t,children:[t&&b.jsxs(sH,{children:[...o]}),b.jsx(oH,{variant:"text",onClick:s,children:t?b.jsx(L.SidePanelOpenIcon,{}):b.jsx(L.SidePanelCloseIcon,{})})]})}const iH=B.div`
1988
1990
  display: flex;
1989
1991
  flex-direction: row;
1990
1992
  border-left: 1px solid var(--border-color-secondary);
@@ -1996,13 +1998,13 @@ Please report this to https://github.com/markedjs/marked.`,e.silent)return"<p>An
1996
1998
  svg {
1997
1999
  fill: var(--text-color-primary);
1998
2000
  }
1999
- `,iH=B(tH)`
2001
+ `,sH=B(nH)`
2000
2002
  flex-grow: 1;
2001
2003
  margin-right: -48px;
2002
2004
  margin-top: 0;
2003
2005
  --md-tabs-content-padding: 0;
2004
2006
 
2005
- ${eH} {
2007
+ ${tH} {
2006
2008
  margin: 0;
2007
2009
  height: 49px;
2008
2010
  font-size: var(--font-size-lg);
@@ -2017,11 +2019,11 @@ Please report this to https://github.com/markedjs/marked.`,e.silent)return"<p>An
2017
2019
  --md-tabs-hover-tab-border-width: 0;
2018
2020
  }
2019
2021
 
2020
- ${Kq} {
2022
+ ${eH} {
2021
2023
  overflow: auto;
2022
2024
  }
2023
2025
 
2024
- ${Jq} {
2026
+ ${Kq} {
2025
2027
  font-size: var(--font-size-lg);
2026
2028
  font-weight: var(--font-weight-regular);
2027
2029
  line-height: var(--line-height-lg);
@@ -2043,56 +2045,56 @@ Please report this to https://github.com/markedjs/marked.`,e.silent)return"<p>An
2043
2045
  ol[class^='Tabs__TabList'] {
2044
2046
  padding: 0 0 0 var(--spacing-base);
2045
2047
  }
2046
- `,sH=B(L.Button)`
2048
+ `,oH=B(L.Button)`
2047
2049
  align-self: flex-start;
2048
2050
  margin: 12px;
2049
2051
  padding: 4px;
2050
- `,Sp=B.li``,oH=({error:n})=>b.jsxs(aH,{children:[b.jsx(lH,{children:"An Error Has Occurred"}),b.jsx(cH,{children:n==null?void 0:n.message}),b.jsx(uH,{children:n==null?void 0:n.stack})]}),aH=B.div`
2052
+ `,Sp=B.li``,aH=({error:n})=>b.jsxs(lH,{children:[b.jsx(cH,{children:"An Error Has Occurred"}),b.jsx(uH,{children:n==null?void 0:n.message}),b.jsx(fH,{children:n==null?void 0:n.stack})]}),lH=B.div`
2051
2053
  padding: var(--spacing-xs) var(--spacing-xl);
2052
- `,lH=B.h2`
2054
+ `,cH=B.h2`
2053
2055
  color: var(--color-error-base);
2054
- `,cH=B.h4`
2056
+ `,uH=B.h4`
2055
2057
  color: var(--text-color-secondary);
2056
- `,uH=B.pre`
2058
+ `,fH=B.pre`
2057
2059
  white-space: break-spaces;
2058
- `;function fH({className:n}){return b.jsx(dH,{className:n,children:b.jsxs(hH,{children:[b.jsx(L.CloseFilledIcon,{size:"24px",color:"--color-error-base"}),b.jsxs(pH,{children:[b.jsx(gH,{children:"Oops! Something went wrong."}),b.jsx(mH,{children:"We're sorry. There's been an unexpected error. Our team has been notified and will investigate the issue."})]})]})})}const dH=B.div`
2060
+ `;function dH({className:n}){return b.jsx(hH,{className:n,children:b.jsxs(pH,{children:[b.jsx(L.CloseFilledIcon,{size:"24px",color:"--color-error-base"}),b.jsxs(gH,{children:[b.jsx(mH,{children:"Oops! Something went wrong."}),b.jsx(OH,{children:"We're sorry. There's been an unexpected error. Our team has been notified and will investigate the issue."})]})]})})}const hH=B.div`
2059
2061
  display: flex;
2060
2062
  justify-content: center;
2061
2063
  align-items: center;
2062
2064
  width: 80vw;
2063
2065
  height: 100vh;
2064
2066
  background-color: var(--bg-color);
2065
- `,hH=B.div`
2067
+ `,pH=B.div`
2066
2068
  display: flex;
2067
2069
  flex-direction: column;
2068
2070
  align-items: center;
2069
2071
  gap: var(--spacing-base);
2070
- `,pH=B.div`
2072
+ `,gH=B.div`
2071
2073
  display: flex;
2072
2074
  flex-direction: column;
2073
2075
  align-items: center;
2074
2076
  gap: var(--spacing-xxs);
2075
2077
  width: 488px;
2076
- `,gH=B.div`
2078
+ `,mH=B.div`
2077
2079
  color: var(--text-color-primary);
2078
2080
  font-size: var(--font-size-xl);
2079
2081
  font-style: normal;
2080
2082
  font-weight: var(--font-weight-semibold);
2081
2083
  line-height: var(--line-height-xl);
2082
- `,mH=B.div`
2084
+ `,OH=B.div`
2083
2085
  color: var(--text-color-primary);
2084
2086
  font-size: var(--font-size-lg);
2085
2087
  font-style: normal;
2086
2088
  font-weight: var(--font-weight-regular);
2087
2089
  line-height: var(--line-height-lg);
2088
2090
  text-align: center;
2089
- `;class BT extends H.Component{constructor(e){super(e),this.state={error:void 0},this.onUnhandledError=this.onUnhandledError.bind(this),this.onUnhandledPromiseRejection=this.onUnhandledPromiseRejection.bind(this)}onUnhandledError({error:e}){var t,r;(r=(t=this.props).onError)==null||r.call(t,e)}onUnhandledPromiseRejection(e){var t,r;(r=(t=this.props).onError)==null||r.call(t,e.reason)}componentDidMount(){window.addEventListener("error",this.onUnhandledError),window.addEventListener("unhandledrejection",this.onUnhandledPromiseRejection)}componentWillUnmount(){window.removeEventListener("error",this.onUnhandledError),window.removeEventListener("unhandledrejection",this.onUnhandledPromiseRejection)}componentDidCatch(e,t){var i,s;const r={error:{message:e.message,stack:t.componentStack??void 0}};this.setState(r),(s=(i=this.props).onError)==null||s.call(i,r.error)}render(){return this.state.error?process.env.NODE_ENV==="production"?b.jsx(fH,{}):b.jsx(oH,{error:this.state.error}):this.props.children}}function OH({className:n}){const{operationUrl:e}=Le().get(),{sendEvent:t}=Ct();return b.jsxs(b.Fragment,{children:[b.jsx(L.GlobalStyle,{}),b.jsx(vH,{className:n,children:b.jsxs(BT,{onError:r=>t("unhandled_error",{...r,operationUrl:e}),children:[b.jsx(TT,{}),b.jsx(nH,{})]})})]})}const vH=B.div`
2091
+ `;class BT extends H.Component{constructor(e){super(e),this.state={error:void 0},this.onUnhandledError=this.onUnhandledError.bind(this),this.onUnhandledPromiseRejection=this.onUnhandledPromiseRejection.bind(this)}onUnhandledError({error:e}){var t,r;(r=(t=this.props).onError)==null||r.call(t,e)}onUnhandledPromiseRejection(e){var t,r;(r=(t=this.props).onError)==null||r.call(t,e.reason)}componentDidMount(){window.addEventListener("error",this.onUnhandledError),window.addEventListener("unhandledrejection",this.onUnhandledPromiseRejection)}componentWillUnmount(){window.removeEventListener("error",this.onUnhandledError),window.removeEventListener("unhandledrejection",this.onUnhandledPromiseRejection)}componentDidCatch(e,t){var i,s;const r={error:{message:e.message,stack:t.componentStack??void 0}};this.setState(r),(s=(i=this.props).onError)==null||s.call(i,r.error)}render(){return this.state.error?process.env.NODE_ENV==="production"?b.jsx(dH,{}):b.jsx(aH,{error:this.state.error}):this.props.children}}function vH({className:n}){const{operationUrl:e}=Le().get(),{sendEvent:t}=Ct();return b.jsxs(b.Fragment,{children:[b.jsx(L.GlobalStyle,{}),b.jsx(xH,{className:n,children:b.jsxs(BT,{onError:r=>t("unhandled_error",{...r,operationUrl:e}),children:[b.jsx(TT,{}),b.jsx(rH,{})]})})]})}const xH=B.div`
2090
2092
  display: flex;
2091
2093
  height: 100vh;
2092
2094
  background-color: var(--bg-color);
2093
- `;function xH(n,e){const t=YE(n),r=XE(n),i=nX(n),s=KL(n),o=n.request.get().body.activeExampleName,a=n.request.get().body.type,l=kO(n);return{requestValues:{cookie:i,header:t,query:s,body:r},activeExampleName:o,activeMimeName:a,environment:(l==null?void 0:l.name)||(l==null?void 0:l.url),activeSecuritySchemeIds:n.request.security.get().selectedSecuritySchemeId.split("_"),environments:Object.fromEntries(Object.entries(n.environments.get()).map(([,c])=>[c.name,{...Object.fromEntries(c.variables.map(({name:u,value:f})=>[u,f])),server:c.url||""}]))}}function bH(n,e){const{servers:t,parameters:r}=n,i=r.filter(o=>o.in==="path"),s=yH(n);return t.map(o=>{const a=o.url,l=o.description||a,c=o.variables||{},u=Object.entries(c).map(([m,g])=>{const v=Fa.getEnvironmentVariableByName(l,m,pr.Server);return{id:crypto.randomUUID(),name:m,value:(v==null?void 0:v.value)||g.default,type:pr.Server,canBeRemoved:!1,canBeEdited:!0,readonlyName:!0}}),f=i.map(({name:m})=>{const g=Fa.getEnvironmentVariableByName(l,m,pr.Path);return{id:crypto.randomUUID(),name:m,value:(g==null?void 0:g.value)||"",type:pr.Path,canBeRemoved:!1,canBeEdited:!0,readonlyName:!0}}),d=s.map(m=>{const g=Fa.getEnvironmentVariableByName(l,m.name,pr.Security);return{...m,value:(g==null?void 0:g.value)||m.value}}),h=Fa.getEnvironmentByName(l),p=(h==null?void 0:h.variables.filter(m=>m.type===pr.UserCreated))||[];return{id:crypto.randomUUID(),name:l,url:a,state:hr.Normal,canBeRemoved:!1,canBeEdited:!1,variables:SH([...p,{id:crypto.randomUUID(),name:"server",value:cd(a),type:pr.ServerUrl,canBeRemoved:!1,canBeEdited:!1},...u,...f,...d],e==null?void 0:e[l])}})}function yH(n){var i;const e=[],t=((i=n.security)==null?void 0:i.flat())||[],r=new Set;return t.forEach(s=>{const o=PO(s);if(r.has(o))return;const a=s.id;r.add(o),(o===re.BasicAuth||o===re.DigestAuth)&&(e.push(zr(a+L.SecurityVariablesEnvSuffix.Username,!1)),e.push(zr(a+L.SecurityVariablesEnvSuffix.Password))),o===re.JWT&&e.push(zr(a+L.SecurityVariablesEnvSuffix.JWTToken)),o===re.APIKey&&e.push(zr(a+L.SecurityVariablesEnvSuffix.APIKey)),o===re.OAuth2&&(e.push(zr(a+L.SecurityVariablesEnvSuffix.Token)),EO(s).forEach(c=>{e.push(zr(a+L.SecurityVariablesEnvSuffix.ClientId)),c!==le.Implicit&&e.push(zr(a+L.SecurityVariablesEnvSuffix.ClientSecret))})),o===re.OpenIDConnect&&(e.push(zr(a+L.SecurityVariablesEnvSuffix.Token)),e.push(zr(a+L.SecurityVariablesEnvSuffix.ClientId)),e.push(zr(a+L.SecurityVariablesEnvSuffix.ClientSecret)))}),e}function zr(n,e){return{id:crypto.randomUUID(),name:n,value:"",type:pr.Security,canBeRemoved:!1,canBeEdited:!0,isSecret:e===void 0?!0:e}}function SH(n,e){return e?n.map(t=>{const r=e[t.name];return r!==void 0?{...t,canBeRemoved:!1,value:t.type===pr.ServerUrl?cd(r):r}:t}):n}function _T({value:n,disableDraft:e,...t}){const r=Le(),{operation:i,request:s,response:o,corsProxyUrl:a,environments:l,operationUrl:c,mockServer:u,selectedEnvironmentId:f,apiId:d,oAuth2RedirectURI:h}=r;return Q.useEffect(()=>{const p=t.operationUrl&&!e?bT.getByKey(t.operationUrl):null,m=Dn(n),g=bH(m,t.predefinedEnvValues),v=g.find(({name:O,url:x})=>x===(t==null?void 0:t.environment)||O===(t==null?void 0:t.environment));i.set(m),l.set(g),a.set(t.corsProxyUrl??QL),o.set(null),c.set(t.operationUrl),u.set(t.mockServer),d.set(t.apiId),h.set(t.oAuth2RedirectURI),v&&f.set(v.id),p?s.set(p):s.set(AO(m)),zE(r)},[n]),r}function wH({onClose:n,onLoad:e,onRequestChange:t,...r}){const i=Q.useRef(null),{sendEvent:s}=Ct(),o=Le(),a=_T(r),l=Q.useCallback(()=>{if(t){const u=a.isLinked.get(),f=xH(a,r.value);t(u?f:{requestValues:{}})}s("replay_closed",{operationName:r.value.name}),n(),o.set(pd())},[n,t,a,r.value,s,o]);Q.useEffect(()=>{e==null||e(),s("replay_opened",{operationName:r.value.name})},[]),Q.useEffect(()=>{i.current&&i.current.focus()},[]);const c=u=>{u.key==="Enter"&&(u.preventDefault(),l())};return b.jsx(Q.StrictMode,{children:b.jsxs(Fk,{onClick:l,children:[b.jsx(kH,{onClick:l,role:"button",onKeyDown:c,tabIndex:0,ref:i,autoFocus:!0,children:b.jsx(AH,{})}),b.jsx(CH,{})]})})}const CH=B(OH)`
2095
+ `;function bH(n,e){const t=YE(n),r=XE(n),i=nX(n),s=KL(n),o=n.request.get().body.activeExampleName,a=n.request.get().body.type,l=kO(n);return{requestValues:{cookie:i,header:t,query:s,body:r},activeExampleName:o,activeMimeName:a,environment:(l==null?void 0:l.name)||(l==null?void 0:l.url),activeSecuritySchemeIds:n.request.security.get().selectedSecuritySchemeId.split("_"),environments:Object.fromEntries(Object.entries(n.environments.get()).map(([,c])=>[c.name,{...Object.fromEntries(c.variables.map(({name:u,value:f})=>[u,f])),server:c.url||""}]))}}function yH(n,e){const{servers:t,parameters:r}=n,i=r.filter(o=>o.in==="path"),s=SH(n);return t.map(o=>{const a=o.url,l=o.description||a,c=o.variables||{},u=Object.entries(c).map(([m,g])=>{const v=Fa.getEnvironmentVariableByName(l,m,pr.Server);return{id:crypto.randomUUID(),name:m,value:(v==null?void 0:v.value)||g.default,type:pr.Server,canBeRemoved:!1,canBeEdited:!0,readonlyName:!0}}),f=i.map(({name:m})=>{const g=Fa.getEnvironmentVariableByName(l,m,pr.Path);return{id:crypto.randomUUID(),name:m,value:(g==null?void 0:g.value)||"",type:pr.Path,canBeRemoved:!1,canBeEdited:!0,readonlyName:!0}}),d=s.map(m=>{const g=Fa.getEnvironmentVariableByName(l,m.name,pr.Security);return{...m,value:(g==null?void 0:g.value)||m.value}}),h=Fa.getEnvironmentByName(l),p=(h==null?void 0:h.variables.filter(m=>m.type===pr.UserCreated))||[];return{id:crypto.randomUUID(),name:l,url:a,state:hr.Normal,canBeRemoved:!1,canBeEdited:!1,variables:wH([...p,{id:crypto.randomUUID(),name:"server",value:cd(a),type:pr.ServerUrl,canBeRemoved:!1,canBeEdited:!1},...u,...f,...d],e==null?void 0:e[l])}})}function SH(n){var i;const e=[],t=((i=n.security)==null?void 0:i.flat())||[],r=new Set;return t.forEach(s=>{const o=PO(s);if(r.has(o))return;const a=s.id;r.add(o),(o===re.BasicAuth||o===re.DigestAuth)&&(e.push(zr(a+L.SecurityVariablesEnvSuffix.Username,!1)),e.push(zr(a+L.SecurityVariablesEnvSuffix.Password))),o===re.JWT&&e.push(zr(a+L.SecurityVariablesEnvSuffix.JWTToken)),o===re.APIKey&&e.push(zr(a+L.SecurityVariablesEnvSuffix.APIKey)),o===re.OAuth2&&(e.push(zr(a+L.SecurityVariablesEnvSuffix.Token)),EO(s).forEach(c=>{e.push(zr(a+L.SecurityVariablesEnvSuffix.ClientId)),c!==le.Implicit&&e.push(zr(a+L.SecurityVariablesEnvSuffix.ClientSecret))})),o===re.OpenIDConnect&&(e.push(zr(a+L.SecurityVariablesEnvSuffix.Token)),e.push(zr(a+L.SecurityVariablesEnvSuffix.ClientId)),e.push(zr(a+L.SecurityVariablesEnvSuffix.ClientSecret)))}),e}function zr(n,e){return{id:crypto.randomUUID(),name:n,value:"",type:pr.Security,canBeRemoved:!1,canBeEdited:!0,isSecret:e===void 0?!0:e}}function wH(n,e){return e?n.map(t=>{const r=e[t.name];return r!==void 0?{...t,canBeRemoved:!1,value:t.type===pr.ServerUrl?cd(r):r}:t}):n}function _T({value:n,disableDraft:e,...t}){const r=Le(),{operation:i,request:s,response:o,corsProxyUrl:a,environments:l,operationUrl:c,mockServer:u,selectedEnvironmentId:f,apiId:d,oAuth2RedirectURI:h}=r;return Q.useEffect(()=>{const p=t.operationUrl&&!e?bT.getByKey(t.operationUrl):null,m=Dn(n),g=yH(m,t.predefinedEnvValues),v=g.find(({name:O,url:x})=>x===(t==null?void 0:t.environment)||O===(t==null?void 0:t.environment));i.set(m),l.set(g),a.set(t.corsProxyUrl??QL),o.set(null),c.set(t.operationUrl),u.set(t.mockServer),d.set(t.apiId),h.set(t.oAuth2RedirectURI),v&&f.set(v.id),p?s.set(p):s.set(AO(m)),zE(r)},[n]),r}function CH({onClose:n,onLoad:e,onRequestChange:t,...r}){const i=Q.useRef(null),{sendEvent:s}=Ct(),o=Le(),a=_T(r),l=Q.useCallback(()=>{if(t){const u=a.isLinked.get(),f=bH(a,r.value);t(u?f:{requestValues:{}})}s("replay_closed",{operationName:r.value.name}),n(),o.set(pd())},[n,t,a,r.value,s,o]);Q.useEffect(()=>{e==null||e(),s("replay_opened",{operationName:r.value.name})},[]),Q.useEffect(()=>{i.current&&i.current.focus()},[]);const c=u=>{u.key==="Enter"&&(u.preventDefault(),l())};return b.jsx(Q.StrictMode,{children:b.jsxs(Fk,{onClick:l,children:[b.jsx(AH,{onClick:l,role:"button",onKeyDown:c,tabIndex:0,ref:i,autoFocus:!0,children:b.jsx(PH,{})}),b.jsx(kH,{})]})})}const kH=B(vH)`
2094
2096
  width: 80vw;
2095
- `,kH=B.div`
2097
+ `,AH=B.div`
2096
2098
  display: flex;
2097
2099
  justify-content: center;
2098
2100
  align-items: center;
@@ -2105,12 +2107,12 @@ Please report this to https://github.com/markedjs/marked.`,e.silent)return"<p>An
2105
2107
  width: 24px;
2106
2108
  height: 24px;
2107
2109
  cursor: pointer;
2108
- `,AH=B(L.CloseIcon)`
2110
+ `,PH=B(L.CloseIcon)`
2109
2111
  width: 14px;
2110
2112
  height: 14px;
2111
- `;function PH(n){const{sendEvent:e}=Ct(),t=Q.useMemo(()=>J0(pd()),[]);return b.jsx(jY,{value:t,children:b.jsx(BT,{onError:r=>e("unhandled_error",{...r,isEmbedded:!0}),children:b.jsx(EH,{...n})})})}function EH(n){return _T({...n,disableDraft:!0}),b.jsx(Q.StrictMode,{children:b.jsx(TH,{children:b.jsx(TT,{})})})}const TH=B.div`
2113
+ `;function EH(n){const{sendEvent:e}=Ct(),t=Q.useMemo(()=>J0(pd()),[]);return b.jsx(jY,{value:t,children:b.jsx(BT,{onError:r=>e("unhandled_error",{...r,isEmbedded:!0}),children:b.jsx(TH,{...n})})})}function TH(n){return _T({...n,disableDraft:!0}),b.jsx(Q.StrictMode,{children:b.jsx(IH,{children:b.jsx(TT,{})})})}const IH=B.div`
2112
2114
  display: flex;
2113
2115
  max-height: 80vh;
2114
2116
  height: 800px;
2115
2117
  width: 100%;
2116
- `;exports.EmbeddedReplay=PH;exports.ReplayOverlay=wH;
2118
+ `;exports.EmbeddedReplay=EH;exports.ReplayOverlay=CH;
package/dist/replay.js CHANGED
@@ -2157,7 +2157,7 @@ See https://s-c.sh/2BAXzed for more info.`), window["__styled-components-init__"
2157
2157
  const Q = eg, {
2158
2158
  createElement: Lo,
2159
2159
  createContext: oR,
2160
- createRef: YJ,
2160
+ createRef: UJ,
2161
2161
  forwardRef: hC,
2162
2162
  useCallback: Ln,
2163
2163
  useContext: pC,
@@ -16989,6 +16989,7 @@ const k_ = Q.div`
16989
16989
  flex-direction: row;
16990
16990
  align-self: flex-end;
16991
16991
  padding-top: var(--spacing-xxs);
16992
+ gap: var(--spacing-xs);
16992
16993
  `, to = ({
16993
16994
  children: n,
16994
16995
  className: e,
@@ -19297,9 +19298,6 @@ const uN = Q.div`
19297
19298
  svg {
19298
19299
  cursor: pointer;
19299
19300
  }
19300
- button {
19301
- margin: 0;
19302
- }
19303
19301
  `;
19304
19302
  function hN({
19305
19303
  state: n,
@@ -55300,6 +55298,7 @@ const dH = Q(to)`
55300
55298
  `, hH = Q.div`
55301
55299
  display: flex;
55302
55300
  justify-content: flex-end;
55301
+ gap: var(--spacing-xs);
55303
55302
  `, pH = Q(yA)`
55304
55303
  left: -4px;
55305
55304
  `;
@@ -55740,20 +55739,26 @@ function WH({
55740
55739
  onChange: l
55741
55740
  }
55742
55741
  ),
55743
- /* @__PURE__ */ b.jsx(
55744
- Ze,
55745
- {
55746
- "data-testid": "edit-item-header-save-button",
55747
- variant: "primary",
55748
- onClick: () => t(c),
55749
- disabled: !c,
55750
- children: /* @__PURE__ */ b.jsx(gm, {})
55751
- }
55752
- ),
55753
- /* @__PURE__ */ b.jsx(Ze, { variant: "text", onClick: r, icon: /* @__PURE__ */ b.jsx(Wo, {}) })
55742
+ /* @__PURE__ */ b.jsxs(VH, { children: [
55743
+ /* @__PURE__ */ b.jsx(
55744
+ Ze,
55745
+ {
55746
+ "data-testid": "edit-item-header-save-button",
55747
+ variant: "primary",
55748
+ onClick: () => t(c),
55749
+ disabled: !c,
55750
+ children: /* @__PURE__ */ b.jsx(gm, {})
55751
+ }
55752
+ ),
55753
+ /* @__PURE__ */ b.jsx(Ze, { variant: "text", onClick: r, icon: /* @__PURE__ */ b.jsx(Wo, {}) })
55754
+ ] })
55754
55755
  ] }) });
55755
55756
  }
55756
- function VH({ environment: n, defaultExpanded: e }) {
55757
+ const VH = Q.div`
55758
+ display: flex;
55759
+ gap: var(--spacing-xs);
55760
+ `;
55761
+ function zH({ environment: n, defaultExpanded: e }) {
55757
55762
  const [t, r] = we(!1), { sendEvent: i } = It(), { state: s, canBeEdited: o, canBeRemoved: a, name: l } = n.get(), c = () => {
55758
55763
  n.set(Ct), i("environment_creation_cancelled", {});
55759
55764
  }, u = () => {
@@ -55790,7 +55795,7 @@ function VH({ environment: n, defaultExpanded: e }) {
55790
55795
  dataTestId: `environment-${l}`,
55791
55796
  title: l,
55792
55797
  defaultExpanded: e,
55793
- controls: /* @__PURE__ */ b.jsxs(zH, { children: [
55798
+ controls: /* @__PURE__ */ b.jsxs(LH, { children: [
55794
55799
  o && /* @__PURE__ */ b.jsx(
55795
55800
  Ro,
55796
55801
  {
@@ -55820,7 +55825,7 @@ function VH({ environment: n, defaultExpanded: e }) {
55820
55825
  ] }),
55821
55826
  children: [
55822
55827
  t ? /* @__PURE__ */ b.jsx(
55823
- GH,
55828
+ YH,
55824
55829
  {
55825
55830
  variable: cf(),
55826
55831
  onSave: m,
@@ -55828,7 +55833,7 @@ function VH({ environment: n, defaultExpanded: e }) {
55828
55833
  isNew: !0
55829
55834
  }
55830
55835
  ) : /* @__PURE__ */ b.jsx(
55831
- XH,
55836
+ GH,
55832
55837
  {
55833
55838
  icon: /* @__PURE__ */ b.jsx(cl, {}),
55834
55839
  variant: "secondary",
@@ -55843,24 +55848,24 @@ function VH({ environment: n, defaultExpanded: e }) {
55843
55848
  }
55844
55849
  ) });
55845
55850
  }
55846
- const zH = Q.div`
55851
+ const LH = Q.div`
55847
55852
  display: flex;
55848
55853
  flex-direction: row;
55849
55854
  gap: var(--spacing-xxs);
55850
55855
  align-items: center;
55851
- `, LH = Q(Ze)`
55856
+ `, XH = Q(Ze)`
55852
55857
  align-self: flex-start;
55853
55858
  margin: 0;
55854
- `, XH = Q(LH)`
55859
+ `, GH = Q(XH)`
55855
55860
  margin: 8px 0 8px -7px;
55856
55861
  font-size: var(--font-size-base);
55857
55862
  font-weight: var(--font-weight-regular);
55858
55863
  line-height: var(--line-height-base);
55859
- `, GH = Q(Gl)`
55864
+ `, YH = Q(Gl)`
55860
55865
  padding-left: 39px;
55861
55866
  margin-left: -23px;
55862
55867
  `;
55863
- function YH() {
55868
+ function UH() {
55864
55869
  const [n, e] = we(""), { environments: t, selectedEnvironmentId: r } = Le(), { sendEvent: i } = It(), s = tt(
55865
55870
  () => t.filter((l) => l.name.get().toLowerCase().includes(n.toLowerCase())),
55866
55871
  [n, t]
@@ -55879,7 +55884,7 @@ function YH() {
55879
55884
  }, a = (l) => {
55880
55885
  e(l);
55881
55886
  };
55882
- return /* @__PURE__ */ b.jsxs(UH, { children: [
55887
+ return /* @__PURE__ */ b.jsxs(qH, { children: [
55883
55888
  /* @__PURE__ */ b.jsxs(cv, { children: [
55884
55889
  /* @__PURE__ */ b.jsx(lv, { value: n, onSearch: a }),
55885
55890
  /* @__PURE__ */ b.jsx(Qe, {}),
@@ -55896,7 +55901,7 @@ function YH() {
55896
55901
  ) })
55897
55902
  ] }),
55898
55903
  /* @__PURE__ */ b.jsx(uv, { children: s.map((l) => /* @__PURE__ */ b.jsx(
55899
- VH,
55904
+ zH,
55900
55905
  {
55901
55906
  environment: l,
55902
55907
  defaultExpanded: l.get().id === r.get()
@@ -55905,7 +55910,7 @@ function YH() {
55905
55910
  )) })
55906
55911
  ] });
55907
55912
  }
55908
- const UH = Q.div`
55913
+ const qH = Q.div`
55909
55914
  display: flex;
55910
55915
  flex-direction: column;
55911
55916
  width: 100%;
@@ -55916,12 +55921,12 @@ function Mw({ name: n, value: e }) {
55916
55921
  }, o = () => {
55917
55922
  i("app_credential_copied", { name: n });
55918
55923
  };
55919
- return /* @__PURE__ */ b.jsxs(qH, { children: [
55920
- /* @__PURE__ */ b.jsxs(HH, { children: [
55921
- /* @__PURE__ */ b.jsx(JH, { children: n }),
55922
- /* @__PURE__ */ b.jsx(KH, { children: t ? e : "••••••••••••••••••••••••••••••••••••" })
55924
+ return /* @__PURE__ */ b.jsxs(HH, { children: [
55925
+ /* @__PURE__ */ b.jsxs(JH, { children: [
55926
+ /* @__PURE__ */ b.jsx(KH, { children: n }),
55927
+ /* @__PURE__ */ b.jsx(eJ, { children: t ? e : "••••••••••••••••••••••••••••••••••••" })
55923
55928
  ] }),
55924
- /* @__PURE__ */ b.jsxs(eJ, { children: [
55929
+ /* @__PURE__ */ b.jsxs(tJ, { children: [
55925
55930
  /* @__PURE__ */ b.jsx(
55926
55931
  Ze,
55927
55932
  {
@@ -55935,18 +55940,18 @@ function Mw({ name: n, value: e }) {
55935
55940
  ] })
55936
55941
  ] });
55937
55942
  }
55938
- const qH = Q.div`
55943
+ const HH = Q.div`
55939
55944
  display: flex;
55940
55945
  padding: var(--spacing-xs) var(--spacing-xs);
55941
55946
  align-items: flex-start;
55942
55947
  gap: var(--spacing-xs);
55943
55948
  align-self: stretch;
55944
- `, HH = Q.div`
55949
+ `, JH = Q.div`
55945
55950
  display: flex;
55946
55951
  align-items: flex-start;
55947
55952
  gap: 10px;
55948
55953
  flex: 1 0 0;
55949
- `, JH = Q.div`
55954
+ `, KH = Q.div`
55950
55955
  display: -webkit-box;
55951
55956
  width: var(--64-px-4-rem-spacing-11, 64px);
55952
55957
  -webkit-box-orient: vertical;
@@ -55959,20 +55964,20 @@ const qH = Q.div`
55959
55964
  font-style: normal;
55960
55965
  font-weight: var(--font-weight-semibold);
55961
55966
  line-height: var(--line-height-sm);
55962
- `, KH = Q.div`
55967
+ `, eJ = Q.div`
55963
55968
  flex: 1 0 0;
55964
55969
  color: var(--text-color-primary);
55965
55970
  font-size: var(--font-size-sm);
55966
55971
  font-style: normal;
55967
55972
  font-weight: var(--font-weight-regular);
55968
55973
  line-height: var(--line-height-sm);
55969
- `, eJ = Q.div`
55974
+ `, tJ = Q.div`
55970
55975
  display: flex;
55971
55976
  justify-content: flex-end;
55972
55977
  align-items: center;
55973
55978
  gap: var(--spacing-xxs);
55974
55979
  `;
55975
- function tJ({ credential: n, number: e }) {
55980
+ function nJ({ credential: n, number: e }) {
55976
55981
  const {
55977
55982
  requestActiveTabIdx: t,
55978
55983
  request: {
@@ -56034,20 +56039,20 @@ function tJ({ credential: n, number: e }) {
56034
56039
  }
56035
56040
  c("apps_use_key_clicked", { number: e });
56036
56041
  };
56037
- return /* @__PURE__ */ b.jsxs(nJ, { children: [
56038
- /* @__PURE__ */ b.jsxs(rJ, { children: [
56039
- /* @__PURE__ */ b.jsx(sJ, { children: e.toString().padStart(2, "0") }),
56040
- /* @__PURE__ */ b.jsxs(iJ, { children: [
56042
+ return /* @__PURE__ */ b.jsxs(rJ, { children: [
56043
+ /* @__PURE__ */ b.jsxs(iJ, { children: [
56044
+ /* @__PURE__ */ b.jsx(oJ, { children: e.toString().padStart(2, "0") }),
56045
+ /* @__PURE__ */ b.jsxs(sJ, { children: [
56041
56046
  n.stage && /* @__PURE__ */ b.jsx(Lp, { color: "gray", children: n.stage }),
56042
56047
  /* @__PURE__ */ b.jsx(Lp, { color: "green", children: n.status })
56043
56048
  ] })
56044
56049
  ] }),
56045
56050
  o && /* @__PURE__ */ b.jsx(Mw, { name: "API key", value: o }),
56046
56051
  a && /* @__PURE__ */ b.jsx(Mw, { name: o ? "Secret" : "API key", value: a }),
56047
- /* @__PURE__ */ b.jsx(oJ, { children: /* @__PURE__ */ b.jsx(Ze, { size: "small", variant: "secondary", onClick: u, children: "Use key" }) })
56052
+ /* @__PURE__ */ b.jsx(aJ, { children: /* @__PURE__ */ b.jsx(Ze, { size: "small", variant: "secondary", onClick: u, children: "Use key" }) })
56048
56053
  ] });
56049
56054
  }
56050
- const nJ = Q.div`
56055
+ const rJ = Q.div`
56051
56056
  display: flex;
56052
56057
  flex-direction: column;
56053
56058
  align-self: stretch;
@@ -56061,7 +56066,7 @@ const nJ = Q.div`
56061
56066
  & > :not(:last-child) {
56062
56067
  border-bottom: 1px solid var(--border-color-secondary);
56063
56068
  }
56064
- `, rJ = Q.div`
56069
+ `, iJ = Q.div`
56065
56070
  display: flex;
56066
56071
  justify-content: space-between;
56067
56072
  padding: var(--spacing-xs) var(--spacing-xs);
@@ -56069,16 +56074,16 @@ const nJ = Q.div`
56069
56074
  align-items: center;
56070
56075
  align-self: stretch;
56071
56076
  background: var(--layer-color);
56072
- `, iJ = Q.div`
56077
+ `, sJ = Q.div`
56073
56078
  display: flex;
56074
56079
  gap: var(--spacing-xxs);
56075
- `, sJ = Q.div`
56080
+ `, oJ = Q.div`
56076
56081
  color: var(--text-color-secondary, #3b3c45);
56077
56082
  font-size: var(--font-size-sm);
56078
56083
  font-style: normal;
56079
56084
  font-weight: var(--font-weight-regular);
56080
56085
  line-height: var(--line-height-sm);
56081
- `, oJ = Q.div`
56086
+ `, aJ = Q.div`
56082
56087
  display: flex;
56083
56088
  padding: var(--spacing-xs) var(--spacing-xs);
56084
56089
  border-radius: 0 0 var(--border-radius-md) var(--border-radius-md);
@@ -56087,24 +56092,24 @@ const nJ = Q.div`
56087
56092
  align-self: stretch;
56088
56093
  background: var(--layer-color);
56089
56094
  `;
56090
- function aJ({ app: n }) {
56095
+ function lJ({ app: n }) {
56091
56096
  const [e, t] = we(!1), { title: r, credentials: i, id: s } = n, o = i.get() || [], a = (l) => {
56092
56097
  l && !i.get() && (t(!0), fetch(`/api/api-keys/apps/${s.get()}`).then((c) => c.json().then((u) => {
56093
56098
  c.ok && i.set(u.credentials);
56094
56099
  }).catch(() => console.log("Something went wrong")).finally(() => t(!1))));
56095
56100
  };
56096
- return /* @__PURE__ */ b.jsx(gd, { dataTestId: `app-${name}`, title: r.get(), onToggle: a, children: /* @__PURE__ */ b.jsx(lJ, { children: e ? /* @__PURE__ */ b.jsx(cJ, { children: /* @__PURE__ */ b.jsx(ed, { size: "16px", color: "--icon-color-additional" }) }) : o.length ? o.map((l, c) => /* @__PURE__ */ b.jsx(tJ, { credential: l, number: c + 1 }, l.id)) : /* @__PURE__ */ b.jsx(uJ, { children: "There are no credentials yet." }) }) });
56101
+ return /* @__PURE__ */ b.jsx(gd, { dataTestId: `app-${name}`, title: r.get(), onToggle: a, children: /* @__PURE__ */ b.jsx(cJ, { children: e ? /* @__PURE__ */ b.jsx(uJ, { children: /* @__PURE__ */ b.jsx(ed, { size: "16px", color: "--icon-color-additional" }) }) : o.length ? o.map((l, c) => /* @__PURE__ */ b.jsx(nJ, { credential: l, number: c + 1 }, l.id)) : /* @__PURE__ */ b.jsx(fJ, { children: "There are no credentials yet." }) }) });
56097
56102
  }
56098
- const lJ = Q.div`
56103
+ const cJ = Q.div`
56099
56104
  padding-bottom: var(--spacing-xxs);
56100
56105
  margin-left: -7px;
56101
56106
  padding-right: var(--spacing-base);
56102
- `, cJ = Q.div`
56107
+ `, uJ = Q.div`
56103
56108
  display: flex;
56104
56109
  height: 224px;
56105
56110
  justify-content: center;
56106
56111
  align-items: center;
56107
- `, uJ = Q.div`
56112
+ `, fJ = Q.div`
56108
56113
  display: flex;
56109
56114
  justify-content: center;
56110
56115
  align-items: center;
@@ -56113,7 +56118,7 @@ const lJ = Q.div`
56113
56118
  line-height: var(--line-height-base);
56114
56119
  color: var(--text-color-secondary);
56115
56120
  `;
56116
- function fJ() {
56121
+ function dJ() {
56117
56122
  const [n, e] = we(""), { apps: t, apiId: r, appsLoadingState: i } = Le(), { sendEvent: s } = It(), o = () => {
56118
56123
  window.open("/apps", "_blank"), s("apps_request_access_clicked", {});
56119
56124
  };
@@ -56128,26 +56133,26 @@ function fJ() {
56128
56133
  ), l = (c) => {
56129
56134
  e(c);
56130
56135
  };
56131
- return i.get() === ei.Loading ? /* @__PURE__ */ b.jsx(hJ, { children: /* @__PURE__ */ b.jsx(ed, { size: "24px", color: "--icon-color-additional" }) }) : t.length ? /* @__PURE__ */ b.jsxs(dJ, { children: [
56136
+ return i.get() === ei.Loading ? /* @__PURE__ */ b.jsx(pJ, { children: /* @__PURE__ */ b.jsx(ed, { size: "24px", color: "--icon-color-additional" }) }) : t.length ? /* @__PURE__ */ b.jsxs(hJ, { children: [
56132
56137
  /* @__PURE__ */ b.jsx(cv, { children: /* @__PURE__ */ b.jsx(lv, { value: n, onSearch: l }) }),
56133
- /* @__PURE__ */ b.jsx(uv, { children: a.map((c) => /* @__PURE__ */ b.jsx(aJ, { app: c }, c.get().id)) })
56138
+ /* @__PURE__ */ b.jsx(uv, { children: a.map((c) => /* @__PURE__ */ b.jsx(lJ, { app: c }, c.get().id)) })
56134
56139
  ] }) : /* @__PURE__ */ b.jsxs(SI, { children: [
56135
56140
  "You don't have any apps with access to this API",
56136
56141
  /* @__PURE__ */ b.jsx(Ze, { onClick: o, children: "Request access" })
56137
56142
  ] });
56138
56143
  }
56139
- const dJ = Q.div`
56144
+ const hJ = Q.div`
56140
56145
  display: flex;
56141
56146
  flex-direction: column;
56142
56147
  width: 100%;
56143
- `, hJ = Q.div`
56148
+ `, pJ = Q.div`
56144
56149
  display: flex;
56145
56150
  justify-content: center;
56146
56151
  align-items: center;
56147
56152
  width: 100%;
56148
56153
  height: calc(100vh - 50px);
56149
- }`, { Tab: pJ, TabContent: gJ, TabList: mJ, Tabs: OJ } = KI.components;
56150
- function vJ() {
56154
+ }`, { Tab: gJ, TabContent: mJ, TabList: OJ, Tabs: vJ } = KI.components;
56155
+ function xJ() {
56151
56156
  const { apiId: n } = Le(), { sendEvent: e } = It(), [t, r] = we(!0), i = et(
56152
56157
  (a) => {
56153
56158
  e("side_panel_tab_changed", { name: a });
@@ -56158,20 +56163,20 @@ function vJ() {
56158
56163
  }, o = tt(() => {
56159
56164
  const a = [
56160
56165
  /* @__PURE__ */ b.jsx(zp, { label: "History", onClick: () => i("History"), children: /* @__PURE__ */ b.jsx(xH, {}) }, "History"),
56161
- /* @__PURE__ */ b.jsx(zp, { label: "Environments", onClick: () => i("Environments"), children: /* @__PURE__ */ b.jsx(YH, {}) }, "Environments")
56166
+ /* @__PURE__ */ b.jsx(zp, { label: "Environments", onClick: () => i("Environments"), children: /* @__PURE__ */ b.jsx(UH, {}) }, "Environments")
56162
56167
  ];
56163
56168
  return n.get() && a.push(
56164
- /* @__PURE__ */ b.jsx(zp, { label: "Apps", onClick: () => i("Apps"), children: /* @__PURE__ */ b.jsx(fJ, {}) })
56169
+ /* @__PURE__ */ b.jsx(zp, { label: "Apps", onClick: () => i("Apps"), children: /* @__PURE__ */ b.jsx(dJ, {}) })
56165
56170
  ), a;
56166
56171
  }, [n, i]);
56167
- return /* @__PURE__ */ b.jsxs(xJ, { $expanded: t, children: [
56168
- t && /* @__PURE__ */ b.jsxs(bJ, { children: [
56172
+ return /* @__PURE__ */ b.jsxs(bJ, { $expanded: t, children: [
56173
+ t && /* @__PURE__ */ b.jsxs(yJ, { children: [
56169
56174
  ...o
56170
56175
  ] }),
56171
- /* @__PURE__ */ b.jsx(yJ, { variant: "text", onClick: s, children: t ? /* @__PURE__ */ b.jsx(e$, {}) : /* @__PURE__ */ b.jsx(t$, {}) })
56176
+ /* @__PURE__ */ b.jsx(SJ, { variant: "text", onClick: s, children: t ? /* @__PURE__ */ b.jsx(e$, {}) : /* @__PURE__ */ b.jsx(t$, {}) })
56172
56177
  ] });
56173
56178
  }
56174
- const xJ = Q.div`
56179
+ const bJ = Q.div`
56175
56180
  display: flex;
56176
56181
  flex-direction: row;
56177
56182
  border-left: 1px solid var(--border-color-secondary);
@@ -56183,13 +56188,13 @@ const xJ = Q.div`
56183
56188
  svg {
56184
56189
  fill: var(--text-color-primary);
56185
56190
  }
56186
- `, bJ = Q(OJ)`
56191
+ `, yJ = Q(vJ)`
56187
56192
  flex-grow: 1;
56188
56193
  margin-right: -48px;
56189
56194
  margin-top: 0;
56190
56195
  --md-tabs-content-padding: 0;
56191
56196
 
56192
- ${mJ} {
56197
+ ${OJ} {
56193
56198
  margin: 0;
56194
56199
  height: 49px;
56195
56200
  font-size: var(--font-size-lg);
@@ -56204,11 +56209,11 @@ const xJ = Q.div`
56204
56209
  --md-tabs-hover-tab-border-width: 0;
56205
56210
  }
56206
56211
 
56207
- ${gJ} {
56212
+ ${mJ} {
56208
56213
  overflow: auto;
56209
56214
  }
56210
56215
 
56211
- ${pJ} {
56216
+ ${gJ} {
56212
56217
  font-size: var(--font-size-lg);
56213
56218
  font-weight: var(--font-weight-regular);
56214
56219
  line-height: var(--line-height-lg);
@@ -56230,57 +56235,57 @@ const xJ = Q.div`
56230
56235
  ol[class^='Tabs__TabList'] {
56231
56236
  padding: 0 0 0 var(--spacing-base);
56232
56237
  }
56233
- `, yJ = Q(Ze)`
56238
+ `, SJ = Q(Ze)`
56234
56239
  align-self: flex-start;
56235
56240
  margin: 12px;
56236
56241
  padding: 4px;
56237
- `, zp = Q.li``, SJ = ({ error: n }) => /* @__PURE__ */ b.jsxs(wJ, { children: [
56238
- /* @__PURE__ */ b.jsx(CJ, { children: "An Error Has Occurred" }),
56239
- /* @__PURE__ */ b.jsx(kJ, { children: n == null ? void 0 : n.message }),
56240
- /* @__PURE__ */ b.jsx(AJ, { children: n == null ? void 0 : n.stack })
56241
- ] }), wJ = Q.div`
56242
+ `, zp = Q.li``, wJ = ({ error: n }) => /* @__PURE__ */ b.jsxs(CJ, { children: [
56243
+ /* @__PURE__ */ b.jsx(kJ, { children: "An Error Has Occurred" }),
56244
+ /* @__PURE__ */ b.jsx(AJ, { children: n == null ? void 0 : n.message }),
56245
+ /* @__PURE__ */ b.jsx(PJ, { children: n == null ? void 0 : n.stack })
56246
+ ] }), CJ = Q.div`
56242
56247
  padding: var(--spacing-xs) var(--spacing-xl);
56243
- `, CJ = Q.h2`
56248
+ `, kJ = Q.h2`
56244
56249
  color: var(--color-error-base);
56245
- `, kJ = Q.h4`
56250
+ `, AJ = Q.h4`
56246
56251
  color: var(--text-color-secondary);
56247
- `, AJ = Q.pre`
56252
+ `, PJ = Q.pre`
56248
56253
  white-space: break-spaces;
56249
56254
  `;
56250
- function PJ({ className: n }) {
56251
- return /* @__PURE__ */ b.jsx(EJ, { className: n, children: /* @__PURE__ */ b.jsxs(TJ, { children: [
56255
+ function EJ({ className: n }) {
56256
+ return /* @__PURE__ */ b.jsx(TJ, { className: n, children: /* @__PURE__ */ b.jsxs(IJ, { children: [
56252
56257
  /* @__PURE__ */ b.jsx(Yw, { size: "24px", color: "--color-error-base" }),
56253
- /* @__PURE__ */ b.jsxs(IJ, { children: [
56254
- /* @__PURE__ */ b.jsx($J, { children: "Oops! Something went wrong." }),
56255
- /* @__PURE__ */ b.jsx(RJ, { children: "We're sorry. There's been an unexpected error. Our team has been notified and will investigate the issue." })
56258
+ /* @__PURE__ */ b.jsxs($J, { children: [
56259
+ /* @__PURE__ */ b.jsx(RJ, { children: "Oops! Something went wrong." }),
56260
+ /* @__PURE__ */ b.jsx(jJ, { children: "We're sorry. There's been an unexpected error. Our team has been notified and will investigate the issue." })
56256
56261
  ] })
56257
56262
  ] }) });
56258
56263
  }
56259
- const EJ = Q.div`
56264
+ const TJ = Q.div`
56260
56265
  display: flex;
56261
56266
  justify-content: center;
56262
56267
  align-items: center;
56263
56268
  width: 80vw;
56264
56269
  height: 100vh;
56265
56270
  background-color: var(--bg-color);
56266
- `, TJ = Q.div`
56271
+ `, IJ = Q.div`
56267
56272
  display: flex;
56268
56273
  flex-direction: column;
56269
56274
  align-items: center;
56270
56275
  gap: var(--spacing-base);
56271
- `, IJ = Q.div`
56276
+ `, $J = Q.div`
56272
56277
  display: flex;
56273
56278
  flex-direction: column;
56274
56279
  align-items: center;
56275
56280
  gap: var(--spacing-xxs);
56276
56281
  width: 488px;
56277
- `, $J = Q.div`
56282
+ `, RJ = Q.div`
56278
56283
  color: var(--text-color-primary);
56279
56284
  font-size: var(--font-size-xl);
56280
56285
  font-style: normal;
56281
56286
  font-weight: var(--font-weight-semibold);
56282
56287
  line-height: var(--line-height-xl);
56283
- `, RJ = Q.div`
56288
+ `, jJ = Q.div`
56284
56289
  color: var(--text-color-primary);
56285
56290
  font-size: var(--font-size-lg);
56286
56291
  font-style: normal;
@@ -56317,31 +56322,31 @@ class wI extends U.Component {
56317
56322
  this.setState(r), (s = (i = this.props).onError) == null || s.call(i, r.error);
56318
56323
  }
56319
56324
  render() {
56320
- return this.state.error ? process.env.NODE_ENV === "production" ? /* @__PURE__ */ b.jsx(PJ, {}) : /* @__PURE__ */ b.jsx(SJ, { error: this.state.error }) : this.props.children;
56325
+ return this.state.error ? process.env.NODE_ENV === "production" ? /* @__PURE__ */ b.jsx(EJ, {}) : /* @__PURE__ */ b.jsx(wJ, { error: this.state.error }) : this.props.children;
56321
56326
  }
56322
56327
  }
56323
- function jJ({ className: n }) {
56328
+ function DJ({ className: n }) {
56324
56329
  const { operationUrl: e } = Le().get(), { sendEvent: t } = It();
56325
56330
  return /* @__PURE__ */ b.jsxs(b.Fragment, { children: [
56326
56331
  /* @__PURE__ */ b.jsx(n$, {}),
56327
- /* @__PURE__ */ b.jsx(DJ, { className: n, children: /* @__PURE__ */ b.jsxs(
56332
+ /* @__PURE__ */ b.jsx(QJ, { className: n, children: /* @__PURE__ */ b.jsxs(
56328
56333
  wI,
56329
56334
  {
56330
56335
  onError: (r) => t("unhandled_error", { ...r, operationUrl: e }),
56331
56336
  children: [
56332
56337
  /* @__PURE__ */ b.jsx(mI, {}),
56333
- /* @__PURE__ */ b.jsx(vJ, {})
56338
+ /* @__PURE__ */ b.jsx(xJ, {})
56334
56339
  ]
56335
56340
  }
56336
56341
  ) })
56337
56342
  ] });
56338
56343
  }
56339
- const DJ = Q.div`
56344
+ const QJ = Q.div`
56340
56345
  display: flex;
56341
56346
  height: 100vh;
56342
56347
  background-color: var(--bg-color);
56343
56348
  `;
56344
- function QJ(n, e) {
56349
+ function BJ(n, e) {
56345
56350
  const t = QT(n), r = jT(n), i = vG(n), s = gG(n), o = n.request.get().body.activeExampleName, a = n.request.get().body.type, l = JO(n);
56346
56351
  return {
56347
56352
  requestValues: {
@@ -56365,8 +56370,8 @@ function QJ(n, e) {
56365
56370
  )
56366
56371
  };
56367
56372
  }
56368
- function BJ(n, e) {
56369
- const { servers: t, parameters: r } = n, i = r.filter((o) => o.in === "path"), s = _J(n);
56373
+ function _J(n, e) {
56374
+ const { servers: t, parameters: r } = n, i = r.filter((o) => o.in === "path"), s = NJ(n);
56370
56375
  return t.map((o) => {
56371
56376
  const a = o.url, l = o.description || a, c = o.variables || {}, u = Object.entries(c).map(([m, g]) => {
56372
56377
  const v = Ka.getEnvironmentVariableByName(
@@ -56418,7 +56423,7 @@ function BJ(n, e) {
56418
56423
  state: xr.Normal,
56419
56424
  canBeRemoved: !1,
56420
56425
  canBeEdited: !1,
56421
- variables: NJ(
56426
+ variables: MJ(
56422
56427
  [
56423
56428
  ...p,
56424
56429
  {
@@ -56438,7 +56443,7 @@ function BJ(n, e) {
56438
56443
  };
56439
56444
  });
56440
56445
  }
56441
- function _J(n) {
56446
+ function NJ(n) {
56442
56447
  var i;
56443
56448
  const e = [], t = ((i = n.security) == null ? void 0 : i.flat()) || [], r = /* @__PURE__ */ new Set();
56444
56449
  return t.forEach((s) => {
@@ -56462,7 +56467,7 @@ function Jr(n, e) {
56462
56467
  isSecret: e === void 0 ? !0 : e
56463
56468
  };
56464
56469
  }
56465
- function NJ(n, e) {
56470
+ function MJ(n, e) {
56466
56471
  return e ? n.map((t) => {
56467
56472
  const r = e[t.name];
56468
56473
  return r !== void 0 ? {
@@ -56486,16 +56491,16 @@ function CI({ value: n, disableDraft: e, ...t }) {
56486
56491
  oAuth2RedirectURI: h
56487
56492
  } = r;
56488
56493
  return Ge(() => {
56489
- const p = t.operationUrl && !e ? aI.getByKey(t.operationUrl) : null, m = Fn(n), g = BJ(m, t.predefinedEnvValues), v = g.find(
56494
+ const p = t.operationUrl && !e ? aI.getByKey(t.operationUrl) : null, m = Fn(n), g = _J(m, t.predefinedEnvValues), v = g.find(
56490
56495
  ({ name: O, url: x }) => x === (t == null ? void 0 : t.environment) || O === (t == null ? void 0 : t.environment)
56491
56496
  );
56492
56497
  i.set(m), l.set(g), a.set(t.corsProxyUrl ?? HX), o.set(null), c.set(t.operationUrl), u.set(t.mockServer), d.set(t.apiId), h.set(t.oAuth2RedirectURI), v && f.set(v.id), p ? s.set(p) : s.set(KO(m)), $T(r);
56493
56498
  }, [n]), r;
56494
56499
  }
56495
- function iK({ onClose: n, onLoad: e, onRequestChange: t, ...r }) {
56500
+ function sK({ onClose: n, onLoad: e, onRequestChange: t, ...r }) {
56496
56501
  const i = ut(null), { sendEvent: s } = It(), o = Le(), a = CI(r), l = et(() => {
56497
56502
  if (t) {
56498
- const u = a.isLinked.get(), f = QJ(a, r.value);
56503
+ const u = a.isLinked.get(), f = BJ(a, r.value);
56499
56504
  t(u ? f : { requestValues: {} });
56500
56505
  }
56501
56506
  s("replay_closed", { operationName: r.value.name }), n(), o.set(Bd());
@@ -56510,7 +56515,7 @@ function iK({ onClose: n, onLoad: e, onRequestChange: t, ...r }) {
56510
56515
  };
56511
56516
  return /* @__PURE__ */ b.jsx(Ww, { children: /* @__PURE__ */ b.jsxs(PA, { onClick: l, children: [
56512
56517
  /* @__PURE__ */ b.jsx(
56513
- FJ,
56518
+ ZJ,
56514
56519
  {
56515
56520
  onClick: l,
56516
56521
  role: "button",
@@ -56518,15 +56523,15 @@ function iK({ onClose: n, onLoad: e, onRequestChange: t, ...r }) {
56518
56523
  tabIndex: 0,
56519
56524
  ref: i,
56520
56525
  autoFocus: !0,
56521
- children: /* @__PURE__ */ b.jsx(ZJ, {})
56526
+ children: /* @__PURE__ */ b.jsx(WJ, {})
56522
56527
  }
56523
56528
  ),
56524
- /* @__PURE__ */ b.jsx(MJ, {})
56529
+ /* @__PURE__ */ b.jsx(FJ, {})
56525
56530
  ] }) });
56526
56531
  }
56527
- const MJ = Q(jJ)`
56532
+ const FJ = Q(DJ)`
56528
56533
  width: 80vw;
56529
- `, FJ = Q.div`
56534
+ `, ZJ = Q.div`
56530
56535
  display: flex;
56531
56536
  justify-content: center;
56532
56537
  align-items: center;
@@ -56539,30 +56544,30 @@ const MJ = Q(jJ)`
56539
56544
  width: 24px;
56540
56545
  height: 24px;
56541
56546
  cursor: pointer;
56542
- `, ZJ = Q(Wo)`
56547
+ `, WJ = Q(Wo)`
56543
56548
  width: 14px;
56544
56549
  height: 14px;
56545
56550
  `;
56546
- function sK(n) {
56551
+ function oK(n) {
56547
56552
  const { sendEvent: e } = It(), t = tt(() => km(Bd()), []);
56548
56553
  return /* @__PURE__ */ b.jsx(UU, { value: t, children: /* @__PURE__ */ b.jsx(
56549
56554
  wI,
56550
56555
  {
56551
56556
  onError: (r) => e("unhandled_error", { ...r, isEmbedded: !0 }),
56552
- children: /* @__PURE__ */ b.jsx(WJ, { ...n })
56557
+ children: /* @__PURE__ */ b.jsx(VJ, { ...n })
56553
56558
  }
56554
56559
  ) });
56555
56560
  }
56556
- function WJ(n) {
56557
- return CI({ ...n, disableDraft: !0 }), /* @__PURE__ */ b.jsx(Ww, { children: /* @__PURE__ */ b.jsx(VJ, { children: /* @__PURE__ */ b.jsx(mI, {}) }) });
56561
+ function VJ(n) {
56562
+ return CI({ ...n, disableDraft: !0 }), /* @__PURE__ */ b.jsx(Ww, { children: /* @__PURE__ */ b.jsx(zJ, { children: /* @__PURE__ */ b.jsx(mI, {}) }) });
56558
56563
  }
56559
- const VJ = Q.div`
56564
+ const zJ = Q.div`
56560
56565
  display: flex;
56561
56566
  max-height: 80vh;
56562
56567
  height: 800px;
56563
56568
  width: 100%;
56564
56569
  `;
56565
56570
  export {
56566
- sK as EmbeddedReplay,
56567
- iK as ReplayOverlay
56571
+ oK as EmbeddedReplay,
56572
+ sK as ReplayOverlay
56568
56573
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/replay",
3
- "version": "0.3.13",
3
+ "version": "0.3.14",
4
4
  "type": "module",
5
5
  "main": "./dist/replay.cjs",
6
6
  "module": "./dist/replay.js",
@@ -19,7 +19,7 @@
19
19
  "react-dom": "^17.0.0 || ^18.0.0",
20
20
  "react-router-dom": "^6.21.1",
21
21
  "styled-components": "^5.3.11",
22
- "@redocly/theme": "0.38.8"
22
+ "@redocly/theme": "0.39.0"
23
23
  },
24
24
  "dependencies": {
25
25
  "@codemirror/autocomplete": "^6.15.0",