| 3 | `).length,g})]})}function Kr(t){const e=k.c(8),{flow:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("h4",{children:"WebSocket"}),e[0]=i):i=e[0];let r;e[1]!==s?(r=o.jsx(ks,{flow:s,messages_meta:s.websocket.messages_meta}),e[1]=s,e[2]=r):r=e[2];let n;e[3]!==s.websocket?(n=o.jsx(sd,{websocket:s.websocket}),e[3]=s.websocket,e[4]=n):n=e[4];let l;return e[5]!==r||e[6]!==n?(l=o.jsxs("section",{className:"websocket",children:[i,r,n]}),e[5]=r,e[6]=n,e[7]=l):l=e[7],l}Kr.displayName="WebSocket";function sd(t){const e=k.c(10),{websocket:s}=t;if(!s.timestamp_end)return null;const i=s.close_reason?`(${s.close_reason})`:"";let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("i",{className:"fa fa-fw fa-window-close text-muted"}),e[0]=r):r=e[0];const n=s.closed_by_client?"client":"server",l=s.close_code;let a;e[1]!==s.timestamp_end?(a=at(s.timestamp_end),e[1]=s.timestamp_end,e[2]=a):a=e[2];let d;e[3]!==a?(d=o.jsx("small",{className:"pull-right",children:a}),e[3]=a,e[4]=d):d=e[4];let f;return e[5]!==i||e[6]!==n||e[7]!==d||e[8]!==s.close_code?(f=o.jsxs("div",{children:[r," Closed by ",n," ","with code ",l," ",i,".",d]}),e[5]=i,e[6]=n,e[7]=d,e[8]=s.close_code,e[9]=f):f=e[9],f}function zr(t){const e=k.c(7),{flow:s}=t,i=G();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("h4",{children:"Comment"}),e[0]=r):r=e[0];let n;e[1]!==i||e[2]!==s?(n=a=>{i(Le(s,{comment:a}))},e[1]=i,e[2]=s,e[3]=n):n=e[3];let l;return e[4]!==s.comment||e[5]!==n?(l=o.jsxs("section",{className:"timing",children:[r,o.jsx(ce,{className:"kv-value",content:s.comment,onEditDone:n,placeholder:"empty",selectAllOnClick:!0})]}),e[4]=s.comment,e[5]=n,e[6]=l):l=e[6],l}zr.displayName="Comment";function Gr(t){const e=k.c(2),{flow:s}=t;let i;return e[0]!==s?(i=o.jsx("section",{className:"tcp",children:o.jsx(ks,{flow:s,messages_meta:s.messages_meta})}),e[0]=s,e[1]=i):i=e[1],i}Gr.displayName="Stream Data";function Yr(t){const e=k.c(2),{flow:s}=t;let i;return e[0]!==s?(i=o.jsx("section",{className:"udp",children:o.jsx(ks,{flow:s,messages_meta:s.messages_meta})}),e[0]=s,e[1]=i):i=e[1],i}Yr.displayName="Datagrams";const ii={request:Or,response:Mr,error:Br,connection:Ur,timing:Wr,websocket:Kr,tcpmessages:Gr,udpmessages:Yr,dnsrequest:Hr,dnsresponse:Vr,comment:zr};function vs(t){let e;switch(t.type){case"http":e=["request","response","websocket"].filter(s=>t[s]);break;case"tcp":e=["tcpmessages"];break;case"udp":e=["udpmessages"];break;case"dns":e=["request","response"].filter(s=>t[s]).map(s=>"dns"+s);break}return t.error&&e.push("error"),e.push("connection"),e.push("timing"),e.push("comment"),e}function nd(){const t=k.c(15),e=G(),s=D(rd);let i=D(id);if(s==null){let y;return t[0]===Symbol.for("react.memo_cache_sentinel")?(y=o.jsx(o.Fragment,{}),t[0]=y):y=t[0],y}const r=vs(s);r.indexOf(i)<0&&(i==="response"&&s.error?i="error":i==="error"&&"response"in s?i="response":i=r[0]);const n=ii[i],l="flow-detail",a="nav-tabs nav-tabs-sm";let d;t[1]!==e?(d=()=>e(Ve([])),t[1]=e,t[2]=d):d=t[2];let f;t[3]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx("i",{className:"fa fa-times-circle"}),t[3]=f):f=t[3];let p;t[4]!==d?(p=o.jsx("button",{"data-testid":"close-button-id",className:"close-button",onClick:d,children:f}),t[4]=d,t[5]=p):p=t[5];const h=r.map(y=>o.jsx("a",{href:"#",className:je({active:i===y}),onClick:w=>{w.preventDefault(),e(Ut(y))},children:ii[y].displayName},y));let g;t[6]!==p||t[7]!==h?(g=o.jsxs("nav",{className:a,children:[p,h]}),t[6]=p,t[7]=h,t[8]=g):g=t[8];let _;t[9]!==n||t[10]!==s?(_=o.jsx(n,{flow:s}),t[9]=n,t[10]=s,t[11]=_):_=t[11];let j;return t[12]!==g||t[13]!==_?(j=o.jsxs("div",{className:l,children:[g,_]}),t[12]=g,t[13]=_,t[14]=j):j=t[14],j}function id(t){return t.ui.flow.tab}function rd(t){return t.flows.selected[0]}function od(t){if(t.ctrlKey||t.metaKey)return()=>{};const e=t.key;return t.preventDefault(),(s,i)=>{const{flows:r}=i(),n=r.selected,l=n[0];switch(e){case"k":case"ArrowUp":s(ht(r,-1));break;case"j":case"ArrowDown":s(ht(r,1));break;case" ":case"PageDown":s(ht(r,10));break;case"PageUp":s(ht(r,-10));break;case"End":s(ht(r,1e10));break;case"Home":s(ht(r,-1e10));break;case"Escape":i().ui.modal.activeModal?s(Wi()):s(Ve([]));break;case"ArrowLeft":{if(!l)break;const a=vs(l),d=i().ui.flow.tab,f=a[(Math.max(0,a.indexOf(d))-1+a.length)%a.length];s(Ut(f));break}case"Tab":case"ArrowRight":{if(!l)break;const a=vs(l),d=i().ui.flow.tab,f=a[(Math.max(0,a.indexOf(d))+1)%a.length];s(Ut(f));break}case"Delete":case"d":{s(Ii(n));break}case"n":{Bt("view.flows.create","get","https://example.com/");break}case"D":{s(Li(n));break}case"a":{s(ys(n));break}case"A":{s(Di());break}case"r":{s(ws(n));break}case"v":{s(Pi(n));break}case"x":{s(Fi(n));break}case"X":{s(Zl());break}case"z":{s(Oi());break}default:return}}}class ld extends I.Component{static defaultProps={axis:"x"};node=Te.createRef();constructor(e,s){super(e,s),this.state={applied:!1,startPos:0,dragPointer:.1},this.onLostPointerCapture=this.onLostPointerCapture.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this)}onPointerDown(e){this.state.dragPointer===.1&&(e.target.setPointerCapture(e.pointerId),this.setState({startPos:this.props.axis==="x"?e.pageX:e.pageY,dragPointer:e.pointerId}))}onLostPointerCapture(e){if(this.state.dragPointer!==e.pointerId)return;const s=this.node.current,i=s.previousElementSibling,r=s.nextElementSibling;s.style.transform="",i.style.flex=`0 0 ${Math.max(0,(this.props.axis==="x"?i.offsetWidth+e.pageX:i.offsetHeight+e.pageY)-this.state.startPos)}px`,r.style.flex="1 1 auto",this.setState({applied:!0,dragPointer:.1}),this.onResize()}onPointerMove(e){this.state.dragPointer===e.pointerId&&(this.node.current.style.transform=this.props.axis==="x"?`translateX(${e.pageX-this.state.startPos}px)`:`translateY(${e.pageY-this.state.startPos}px)`)}onResize(){window.setTimeout(()=>window.dispatchEvent(new CustomEvent("resize")),1)}reset(e){this.state.applied&&(this.node.current?.previousElementSibling instanceof HTMLElement&&(this.node.current.previousElementSibling.style.flex=""),this.node.current?.nextElementSibling instanceof HTMLElement&&(this.node.current.nextElementSibling.style.flex=""),e||this.setState({applied:!1}),this.onResize())}componentWillUnmount(){this.reset(!0)}render(){return o.jsx("div",{ref:this.node,className:je("splitter",this.props.axis==="x"?"splitter-x":"splitter-y"),children:o.jsx("div",{onLostPointerCapture:this.onLostPointerCapture,onPointerDown:this.onPointerDown,onPointerMove:this.onPointerMove})})}}const Es=t=>{const e=t.current;return e===null||e.scrollTop===0?!1:Math.ceil(e.scrollTop)+e.clientHeight>=e.scrollHeight},Jr=t=>{t.current&&!Es(t)&&(t.current.scrollTop=t.current.scrollHeight)};function kt(t=void 0){if(!t)return{start:0,end:0,paddingTop:0,paddingBottom:0};const{itemCount:e,rowHeight:s,viewportTop:i,viewportHeight:r,itemHeights:n}=t,l=i+r;let a=0,d=0,f=0,p=0;if(n){let h=0;for(let g=0;g<e;g++){const _=n[g]||s;h<=i&&g%2===0&&(f=h,a=g),h<=l?d=g+1:p+=_,h+=_}if(i>0&&h<i+r)return kt({itemCount:e,rowHeight:s,viewportTop:h-r,viewportHeight:r,itemHeights:n})}else{const h=Math.min(i,Math.max(0,e*s-r));a=Math.max(0,Math.floor(h/s)-1)&-2,d=Math.min(e,a+Math.ceil(r/s)+2),f=a*s,p=(e-d)*s}return{start:a,end:d,paddingTop:f,paddingBottom:p}}const Ts=({flow:t})=>o.jsx("td",{className:je("col-tls",t.client_conn.tls_established?"col-tls-https":"col-tls-http")});Ts.headerName="";const Rs=({rowNumber:t})=>o.jsx("td",{className:"col-index",children:t+1});Rs.headerName="#";const As=({flow:t})=>o.jsx("td",{className:"col-icon",children:o.jsx("div",{className:je("resource-icon",Si(t))})});As.headerName="";const Ds=({flow:t})=>{let e;return t.error&&(t.error.msg==="Connection killed."?e=o.jsx("i",{className:"fa fa-fw fa-times pull-right"}):e=o.jsx("i",{className:"fa fa-fw fa-exclamation pull-right"})),o.jsxs("td",{className:"col-path",children:[t.is_replay==="request"&&o.jsx("i",{className:"fa fa-fw fa-repeat pull-right"}),t.intercepted&&o.jsx("i",{className:"fa fa-fw fa-pause pull-right"}),e,o.jsx("span",{className:"marker pull-right",children:t.marked}),$i(t)]})};Ds.headerName="Path";const Fs=({flow:t})=>o.jsx("td",{className:"col-method",children:Ni(t)});Fs.headerName="Method";const Is=({flow:t})=>o.jsx("td",{className:"col-http-version",children:ki(t)});Is.headerName="Version";const Ls=({flow:t})=>{let e="darkred";return t.type!=="http"&&t.type!="dns"||!t.response?o.jsx("td",{className:"col-status"}):(100<=t.response.status_code&&t.response.status_code<200?e="green":200<=t.response.status_code&&t.response.status_code<300?e="darkgreen":300<=t.response.status_code&&t.response.status_code<400?e="lightblue":(400<=t.response.status_code&&t.response.status_code<500||500<=t.response.status_code&&t.response.status_code<600)&&(e="red"),o.jsx("td",{className:"col-status",style:{color:e},children:Ci(t)}))};Ls.headerName="Status";const Ps=({flow:t})=>o.jsx("td",{className:"col-size",children:hi(wi(t))});Ps.headerName="Size";const Os=({flow:t})=>{const e=Wt(t),s=yi(t);return o.jsx("td",{className:"col-time",children:e&&s?mi(1e3*(s-e)):"..."})};Os.headerName="Time";const Ms=({flow:t})=>{const e=Wt(t);return o.jsx("td",{className:"col-timestamp",children:e?at(e):"..."})};Ms.headerName="Start time";const Qt=({flow:t})=>{const e=G();let s=null;return t.intercepted?s=o.jsx("a",{href:"#",className:"quickaction",onClick:()=>e(ys([t])),children:o.jsx("i",{className:"fa fa-fw fa-play text-success"})}):xs(t)&&(s=o.jsx("a",{href:"#",className:"quickaction",onClick:()=>e(ws([t])),children:o.jsx("i",{className:"fa fa-fw fa-repeat text-primary"})})),o.jsx("td",{className:"col-quickactions",children:s?o.jsx("div",{children:s}):o.jsx(o.Fragment,{})})};Qt.headerName="";const qs=({flow:t})=>{const e=t.comment;return o.jsx("td",{className:"col-comment",children:e})};qs.headerName="Comment";const Qr={icon:As,index:Rs,method:Fs,version:Is,path:Ds,quickactions:Qt,size:Ps,status:Ls,time:Os,timestamp:Ms,tls:Ts,comment:qs},cd=Object.freeze(Object.defineProperty({__proto__:null,comment:qs,default:Qr,icon:As,index:Rs,method:Fs,path:Ds,quickactions:Qt,size:Ps,status:Ls,time:Os,timestamp:Ms,tls:Ts,version:Is},Symbol.toStringTag,{value:"Module"})),ad=I.memo(function(){const e=k.c(13),s=G(),i=D(dd),r=D(ud),n=D(fd),l=i?"sort-desc":"sort-asc";let a;if(e[0]!==s||e[1]!==n||e[2]!==r||e[3]!==i||e[4]!==l){const f=n.filter(zl).concat("quickactions");let p;e[6]!==s||e[7]!==r||e[8]!==i||e[9]!==l?(p=h=>o.jsx("th",{className:je(`col-${h}`,r===h&&l),onClick:()=>s(Ui({column:h===r&&i?void 0:h,desc:h!==r?!1:!i})),children:Qr[h].headerName},h),e[6]=s,e[7]=r,e[8]=i,e[9]=l,e[10]=p):p=e[10],a=f.map(p),e[0]=s,e[1]=n,e[2]=r,e[3]=i,e[4]=l,e[5]=a}else a=e[5];let d;return e[11]!==a?(d=o.jsx("tr",{children:a}),e[11]=a,e[12]=d):d=e[12],d});function dd(t){return t.flows.sort.desc}function ud(t){return t.flows.sort.column}function fd(t){return t.options.web_columns}const pd=Te.memo(function({flow:e,selected:s,highlighted:i,displayColumnNames:r,rowNumber:n}){const l=G(),a=je({selected:s,highlighted:i,intercepted:e.intercepted,"has-request":e.type==="http"&&e.request,"has-response":e.type==="http"&&e.response}),d=I.useCallback(p=>{let h=p.target;for(;h.parentNode;){if(h.classList.contains("col-quickactions"))return;h=h.parentNode}p.metaKey||p.ctrlKey?l(ic(e)):p.shiftKey?(window.getSelection()?.empty(),l(rc(e))):l(Ve([e]))},[e]),f=r.map(p=>cd[p]).filter(p=>p).concat(Qt);return o.jsx("tr",{className:a,onClick:d,children:f.map(p=>o.jsx(p,{flow:e,rowNumber:n},p.name))})});class hd extends I.Component{static defaultProps={rowHeight:32};viewport=I.createRef();head=I.createRef();constructor(e,s){super(e,s),this.state={vScroll:kt(),viewportTop:0},this.onViewportUpdate=this.onViewportUpdate.bind(this)}componentDidMount(){window.addEventListener("resize",this.onViewportUpdate),this.onViewportUpdate()}componentWillUnmount(){window.removeEventListener("resize",this.onViewportUpdate)}getSnapshotBeforeUpdate(){return Es(this.viewport)}componentDidUpdate(e,s,i){i&&Jr(this.viewport),this.onViewportUpdate();const{onlySelectedId:r}=this.props;if(r&&r!==e.onlySelectedId){const{rowHeight:l,firstSelectedIndex:a}=this.props,d=this.viewport.current,f=this.head.current,p=f?f.offsetHeight:0,h=a*l+p,g=h+l,_=d.scrollTop,j=d.offsetHeight;h-p<_?d.scrollTop=h-p:g>_+j&&(d.scrollTop=g-j),this.onViewportUpdate()}}onViewportUpdate(){const e=this.viewport.current,s=e.scrollTop||0,i=kt({viewportTop:s,viewportHeight:e.offsetHeight||0,itemCount:this.props.flowView.length,rowHeight:this.props.rowHeight});if(this.state.viewportTop!==s||!Kt(this.state.vScroll,i)){const r=Math.min(s,i.end*this.props.rowHeight);this.setState({vScroll:i,viewportTop:r})}}render(){const{vScroll:e,viewportTop:s}=this.state,{flowView:i,selectedIds:r,highlightedIds:n,displayColumnNames:l,listIndex:a}=this.props;return o.jsx("div",{className:"flow-table",onScroll:this.onViewportUpdate,ref:this.viewport,children:o.jsxs("table",{children:[o.jsx("thead",{ref:this.head,style:{transform:`translateY(${s}px)`},children:o.jsx(ad,{})}),o.jsxs("tbody",{children:[o.jsx("tr",{style:{height:e.paddingTop}}),i.slice(e.start,e.end).map(d=>o.jsx(pd,{flow:d,selected:r.has(d.id),highlighted:n.has(d.id),displayColumnNames:l,rowNumber:a.get(d.id)},d.id)),o.jsx("tr",{style:{height:e.paddingBottom}})]})]})})}}const md=zt(t=>({flowView:t.flows.view,highlightedIds:t.flows.highlightedIds,selectedIds:t.flows.selectedIds,onlySelectedId:t.flows.selected.length===1&&t.flows.selected[0].id,firstSelectedIndex:t.flows._viewIndex.get(t.flows.selected[0]?.id),displayColumnNames:t.options.web_columns,listIndex:t.flows._listIndex}))(hd);function gd(){const t=k.c(3);let e,s;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={padding:"1em 2em"},s=o.jsx("h3",{children:"mitmproxy is running."}),t[0]=e,t[1]=s):(e=t[0],s=t[1]);let i;return t[2]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsxs("div",{style:e,children:[s,o.jsxs("p",{children:["No flows have been recorded yet.",o.jsx("br",{}),"To start capturing traffic, please configure your settings in the Capture tab."]})]}),t[2]=i):i=t[2],i}function vd(t){const e=k.c(20);let{description:s,listen_addrs:i,is_running:r,wireguard_conf:n,type:l}=t;const a=I.useRef(null);let d,f;e[0]!==n?(d=()=>{n&&a.current&&Ll.toCanvas(a.current,n,{margin:0,scale:3})},f=[n],e[0]=n,e[1]=d,e[2]=f):(d=e[1],f=e[2]),I.useEffect(d,f);let p;const h=i.length===1||i.length===2&&i[0][1]===i[1][1],g=i.every(xd);if(h&&g){let y;e[3]!==i[0][1]?(y=Hn(["*",i[0][1]]),e[3]=i[0][1],e[4]=y):y=e[4],p=y}else{let y;e[5]!==i?(y=i.map(Hn).join(" and "),e[5]=i,e[6]=y):y=e[6],p=y}s=s[0].toUpperCase()+s.substr(1);let _;if(r){let y;e[9]!==s||e[10]!==p||e[11]!==l?(y=l==="local"?o.jsxs("div",{className:"text-success",children:[s," is active."]}):o.jsxs("div",{className:"text-success",children:[s," listening at ",p,"."]}),e[9]=s,e[10]=p,e[11]=l,e[12]=y):y=e[12];let w;e[13]!==n?(w=n&&o.jsxs("div",{className:"wireguard-config",children:[o.jsx("pre",{children:n}),o.jsx("canvas",{ref:a})]}),e[13]=n,e[14]=w):w=e[14];let $;e[15]!==y||e[16]!==w?($=o.jsxs(o.Fragment,{children:[y,w]}),e[15]=y,e[16]=w,e[17]=$):$=e[17],_=$}else{let y;e[7]!==s?(y=o.jsx(o.Fragment,{children:o.jsxs("div",{className:"text-warning",children:[s," starting..."]})}),e[7]=s,e[8]=y):y=e[8],_=y}let j;return e[18]!==_?(j=o.jsx("div",{children:_}),e[18]=_,e[19]=j):j=e[19],j}function xd(t){return["::","0.0.0.0"].includes(t[0])}function et(t){const e=k.c(5),{error:s,backendState:i}=t;let r;e[0]!==i||e[1]!==s?(r=s?o.jsx("div",{className:"text-danger",children:s}):i&&o.jsx(vd,{...i}),e[0]=i,e[1]=s,e[2]=r):r=e[2];let n;return e[3]!==r?(n=o.jsx("div",{className:"mode-status",children:r}),e[3]=r,e[4]=n):n=e[4],n}function tt(t){const e=k.c(13),{value:s,onChange:i,children:r,label:n}=t,l=I.useId(),a=`mode-checkbox-${l}`,d=`mode-checkbox-${l}`;let f;e[0]!==i||e[1]!==a||e[2]!==d||e[3]!==s?(f=o.jsx("input",{type:"checkbox",name:a,id:d,checked:s,onChange:i}),e[0]=i,e[1]=a,e[2]=d,e[3]=s,e[4]=f):f=e[4];const p=`mode-checkbox-${l}`;let h;e[5]===Symbol.for("react.memo_cache_sentinel")?(h={marginBottom:0,fontWeight:"normal"},e[5]=h):h=e[5];let g;e[6]!==n||e[7]!==p?(g=o.jsx("label",{htmlFor:p,style:h,children:n}),e[6]=n,e[7]=p,e[8]=g):g=e[8];let _;return e[9]!==r||e[10]!==f||e[11]!==g?(_=o.jsxs("div",{className:"mode-entry",children:[f,g,r]}),e[9]=r,e[10]=f,e[11]=g,e[12]=_):_=e[12],_}function st(t){const e=k.c(22),{children:s,iconClass:i,classname:r,isVisible:n}=t,l=I.useId();let a;e[0]!==l?(a=[...l].map(_d),e[0]=l,e[1]=a):a=e[1];const d="--"+a.join(""),f=I.useRef(null),p=I.useRef(null);let h;e[2]!==d?(h=()=>{f.current.style.anchorName=d,p.current.style.positionAnchor=d},e[2]=d,e[3]=h):h=e[3];let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[4]=g):g=e[4],I.useEffect(h,g);let _;e[5]!==l||e[6]!==n?(_=()=>{n===!0&&document.getElementById(l)?.showPopover()},e[5]=l,e[6]=n,e[7]=_):_=e[7];let j;e[8]!==n?(j=[n],e[8]=n,e[9]=j):j=e[9],I.useEffect(_,j);const y=r?`mode-popover ${r}`:"mode-popover";let w;e[10]!==i?(w=o.jsx("i",{className:i,"aria-hidden":"true"}),e[10]=i,e[11]=w):w=e[11];let $;e[12]!==l||e[13]!==w?($=o.jsx("button",{popoverTarget:l,ref:f,children:w}),e[12]=l,e[13]=w,e[14]=$):$=e[14];let N;e[15]!==s||e[16]!==l?(N=o.jsx("div",{id:l,popover:"auto",ref:p,children:s}),e[15]=s,e[16]=l,e[17]=N):N=e[17];let E;return e[18]!==y||e[19]!==$||e[20]!==N?(E=o.jsxs("div",{className:y,children:[$,N]}),e[18]=y,e[19]=$,e[20]=N,e[21]=E):E=e[21],E}function _d(t){return t.charCodeAt(0).toString(16)}function jd(t){const e=k.c(44),{server:s}=t,{currentProcesses:i,isLoading:r}=D(bd),{selectedProcesses:n}=D(wd);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=[],e[0]=l):l=e[0];const[a,d]=I.useState(l),[f,p]=I.useState(""),h=G(),{platform:g}=D(yd);let _;e[1]===Symbol.for("react.memo_cache_sentinel")?(_=B=>{p(B.target.value)},e[1]=_):_=e[1];const j=_;let y;e[2]!==g?(y=B=>{const oe=g.startsWith("win32")?"\\":"/";return ps(B.executable,oe)[1]},e[2]=g,e[3]=y):y=e[3];const w=y;let $;e[4]!==h||e[5]!==w||e[6]!==n||e[7]!==s?($=B=>{const oe=typeof B=="string"?B:w(B),q=n?`${n}, ${oe}`:oe;h(St({server:s,value:q}))},e[4]=h,e[5]=w,e[6]=n,e[7]=s,e[8]=$):$=e[8];const N=$;let E;e[9]!==h||e[10]!==w||e[11]!==n||e[12]!==s?(E=B=>{const oe=n?.split(/,\s*/).filter(q=>q!==w(B)).join(", ");h(St({server:s,value:oe}))},e[9]=h,e[10]=w,e[11]=n,e[12]=s,e[13]=E):E=e[13];const T=E,P=B=>{L(B)&&n?T(B):N(B)},L=B=>{const oe=w(B);return n?.includes(oe)};let O;e[14]!==i||e[15]!==h?(O=()=>{i.length===0&&h($t())},e[14]=i,e[15]=h,e[16]=O):O=e[16];let M;e[17]===Symbol.for("react.memo_cache_sentinel")?(M=[],e[17]=M):M=e[17],I.useEffect(O,M);let U;e[18]!==i||e[19]!==f||e[20]!==w||e[21]!==a?(U=()=>{if(f){const B=i.filter(oe=>w(oe).toLowerCase().includes(f.toLowerCase()));d(B)}else a!==i&&d(i)},e[18]=i,e[19]=f,e[20]=w,e[21]=a,e[22]=U):U=e[22];let V;e[23]!==i||e[24]!==f?(V=[f,i],e[23]=i,e[24]=f,e[25]=V):V=e[25],I.useEffect(U,V);let W;e[26]!==N||e[27]!==f?(W=B=>{B.stopPropagation(),B.key==="Enter"&&(N(f),p(""))},e[26]=N,e[27]=f,e[28]=W):W=e[28];const J=W,[z,te]=I.useState(!1),Y="local-dropdown",Q="dropdown-header",X=n&&n?.length>0?"Add more":"all applications";let Z,ae;e[29]===Symbol.for("react.memo_cache_sentinel")?(Z=()=>te(!0),ae=()=>te(!1),e[29]=Z,e[30]=ae):(Z=e[29],ae=e[30]);let le;e[31]!==f||e[32]!==J||e[33]!==X?(le=o.jsx("input",{type:"text",className:"autocomplete-input",placeholder:X,value:f,onChange:j,onKeyDown:J,onClick:Z,onBlur:ae}),e[31]=f,e[32]=J,e[33]=X,e[34]=le):le=e[34];const de=st,ye="fa fa-chevron-down",Pe="local-popover";let Se;e[35]===Symbol.for("react.memo_cache_sentinel")?(Se=o.jsx("h4",{children:"Current Applications running on machine"}),e[35]=Se):Se=e[35];const Ee=r?o.jsx("i",{className:"fa fa-spinner","aria-hidden":"true"}):a.length>0?o.jsxs("ul",{className:"dropdown-list",children:[o.jsxs("li",{className:`dropdown-item ${n===""?"selected":""}`,onClick:()=>{h(St({server:s,value:""}))},role:"menuitem",children:[o.jsxs("div",{className:"process-details",children:[o.jsx("div",{className:"process-icon"}),o.jsx("span",{className:"process-name",children:"All applications"})]}),n===""&&o.jsx("i",{className:"fa fa-check","aria-hidden":"true"})]}),o.jsx("hr",{className:"process-separator"}),a.map((B,oe)=>o.jsxs("li",{className:`dropdown-item ${L(B)?"selected":""}`,onClick:()=>P(B),role:"menuitem",children:[o.jsxs("div",{className:"process-details",children:[o.jsx("img",{className:"process-icon",src:`./executable-icon?path=${B.executable}`,loading:"lazy"}),o.jsx("span",{className:"process-name",children:w(B)})]}),L(B)&&o.jsx("i",{className:"fa fa-check","aria-hidden":"true"})]},oe))]}):o.jsxs("span",{children:["Press ",o.jsx("strong",{children:"Enter"})," to capture traffic for programs matching: ",o.jsx("strong",{children:f})]});let C;e[36]!==de||e[37]!==z||e[38]!==Se||e[39]!==Ee?(C=o.jsxs(de,{iconClass:ye,classname:Pe,isVisible:z,children:[Se,Ee]}),e[36]=de,e[37]=z,e[38]=Se,e[39]=Ee,e[40]=C):C=e[40];let he;return e[41]!==le||e[42]!==C?(he=o.jsx("div",{className:Y,children:o.jsxs("div",{className:Q,children:[le,C]})}),e[41]=le,e[42]=C,e[43]=he):he=e[43],he}function yd(t){return t.backendState}function wd(t){return t.modes.local[0]}function bd(t){return t.processes}function Sd(){const t=k.c(9),e=D(Cd),s=D($d);let i;if(t[0]!==s||t[1]!==e){let d;t[3]!==s?(d=f=>o.jsx(Nd,{server:f,backendState:s[Zi(f)]},f.ui_id),t[3]=s,t[4]=d):d=t[4],i=e.map(d),t[0]=s,t[1]=e,t[2]=i}else i=t[2];const r=i;let n,l;t[5]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("h4",{className:"mode-title",children:"Local Applications"}),l=o.jsx("p",{className:"mode-description",children:"Transparently Intercept local application(s)."}),t[5]=n,t[6]=l):(n=t[5],l=t[6]);let a;return t[7]!==r?(a=o.jsxs("div",{children:[n,l,r]}),t[7]=r,t[8]=a):a=t[8],a}function $d(t){return t.backendState.servers}function Cd(t){return t.modes.local}function Nd(t){const e=k.c(31),{server:s,backendState:i}=t,r=G(),n=D(Ed),l=s.error||i?.last_exception||n||void 0;let a;e[0]!==r||e[1]!==s?(a=E=>{const T=s.selectedProcesses?.split(/,\s*/).filter(P=>P!==E).join(", ");r(St({server:s,value:T}))},e[0]=r,e[1]=s,e[2]=a):a=e[2];const d=a;let f;e[3]!==r||e[4]!==s?(f=()=>r(cr({server:s,value:!s.active})),e[3]=r,e[4]=s,e[5]=f):f=e[5];let p;e[6]!==d||e[7]!==s.selectedProcesses?(p=s.selectedProcesses?.split(/,\s*/).filter(kd).map(E=>o.jsxs("div",{className:"selected-process",children:[E,o.jsx("i",{className:"fa fa-times","aria-hidden":"true",onClick:()=>d(E)})]},E)),e[6]=d,e[7]=s.selectedProcesses,e[8]=p):p=e[8];let h;e[9]!==p?(h=o.jsx("div",{className:"selected-processes",children:p}),e[9]=p,e[10]=h):h=e[10];let g;e[11]!==s?(g=o.jsx(jd,{server:s}),e[11]=s,e[12]=g):g=e[12];let _;e[13]!==r?(_=o.jsx("i",{className:"fa fa-refresh","aria-hidden":"true",onClick:()=>r($t())}),e[13]=r,e[14]=_):_=e[14];let j;e[15]!==g||e[16]!==_?(j=o.jsxs("div",{className:"dropdown-container",children:[g,_]}),e[15]=g,e[16]=_,e[17]=j):j=e[17];let y;e[18]!==h||e[19]!==j?(y=o.jsxs("div",{className:"processes-container",children:[h,j]}),e[18]=h,e[19]=j,e[20]=y):y=e[20];let w;e[21]!==s.active||e[22]!==f||e[23]!==y?(w=o.jsx(tt,{value:s.active,label:"Intercept traffic for",onChange:f,children:y}),e[21]=s.active,e[22]=f,e[23]=y,e[24]=w):w=e[24];let $;e[25]!==i||e[26]!==l?($=o.jsx(et,{error:l,backendState:i}),e[25]=i,e[26]=l,e[27]=$):$=e[27];let N;return e[28]!==$||e[29]!==w?(N=o.jsxs("div",{className:"mode-local",children:[w,$]}),e[28]=$,e[29]=w,e[30]=N):N=e[30],N}function kd(t){return t.trim()!==""}function Ed(t){return t.processes.error}function Td(){const t=k.c(9),e=D(Ad),s=D(Rd);let i;if(t[0]!==s||t[1]!==e){let d;t[3]!==s?(d=f=>o.jsx(Dd,{server:f,backendState:s[Xi(f)]},f.ui_id),t[3]=s,t[4]=d):d=t[4],i=e.map(d),t[0]=s,t[1]=e,t[2]=i}else i=t[2];const r=i;let n,l;t[5]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("h4",{className:"mode-title",children:"Explicit HTTP(S) Proxy"}),l=o.jsx("p",{className:"mode-description",children:"You manually configure your client application or device to use an HTTP(S) proxy."}),t[5]=n,t[6]=l):(n=t[5],l=t[6]);let a;return t[7]!==r?(a=o.jsxs("div",{children:[n,l,r]}),t[7]=r,t[8]=a):a=t[8],a}function Rd(t){return t.backendState.servers}function Ad(t){return t.modes.regular}function Dd(t){const e=k.c(33),{server:s,backendState:i}=t,r=G(),n=s.error||i?.last_exception||void 0;let l;e[0]!==r||e[1]!==s?(l=()=>r(rr({server:s,value:!s.active})),e[0]=r,e[1]=s,e[2]=l):l=e[2];let a,d;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx("h4",{children:"Advanced Configuration"}),d=o.jsx("p",{children:"Listen Host"}),e[3]=a,e[4]=d):(a=e[3],d=e[4]);const f=s.listen_host||"";let p;e[5]!==r||e[6]!==s?(p=T=>r(or({server:s,value:T})),e[5]=r,e[6]=s,e[7]=p):p=e[7];let h;e[8]!==f||e[9]!==p?(h=o.jsx(ce,{className:"mode-input",content:f,onEditDone:p}),e[8]=f,e[9]=p,e[10]=h):h=e[10];let g;e[11]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx("p",{children:"Listen Port"}),e[11]=g):g=e[11];let _;e[12]!==s.listen_port?(_=s.listen_port?s.listen_port.toString():"",e[12]=s.listen_port,e[13]=_):_=e[13];let j;e[14]!==r||e[15]!==s?(j=T=>r(lr({server:s,value:parseInt(T)})),e[14]=r,e[15]=s,e[16]=j):j=e[16];let y;e[17]!==_||e[18]!==j?(y=o.jsx(ce,{className:"mode-input",content:_,placeholder:"8080",onEditDone:j}),e[17]=_,e[18]=j,e[19]=y):y=e[19];let w;e[20]!==y||e[21]!==h?(w=o.jsxs(st,{iconClass:"fa fa-cog",children:[a,d,h,g,y]}),e[20]=y,e[21]=h,e[22]=w):w=e[22];let $;e[23]!==s.active||e[24]!==l||e[25]!==w?($=o.jsx(tt,{value:s.active,label:"Run HTTP/S Proxy",onChange:l,children:w}),e[23]=s.active,e[24]=l,e[25]=w,e[26]=$):$=e[26];let N;e[27]!==i||e[28]!==n?(N=o.jsx(et,{error:n,backendState:i}),e[27]=i,e[28]=n,e[29]=N):N=e[29];let E;return e[30]!==$||e[31]!==N?(E=o.jsxs("div",{children:[$,N]}),e[30]=$,e[31]=N,e[32]=E):E=e[32],E}function Fd(){const t=k.c(9),e=D(Ld),s=D(Id);let i;if(t[0]!==s||t[1]!==e){let d;t[3]!==s?(d=f=>o.jsx(Pd,{server:f,backendState:s[er(f)]},f.ui_id),t[3]=s,t[4]=d):d=t[4],i=e.map(d),t[0]=s,t[1]=e,t[2]=i}else i=t[2];const r=i;let n,l;t[5]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("h4",{className:"mode-title",children:"WireGuard Server"}),l=o.jsx("p",{className:"mode-description",children:"Start a WireGuard™ server and connect an external device for transparent proxying."}),t[5]=n,t[6]=l):(n=t[5],l=t[6]);let a;return t[7]!==r?(a=o.jsxs("div",{children:[n,l,r]}),t[7]=r,t[8]=a):a=t[8],a}function Id(t){return t.backendState.servers}function Ld(t){return t.modes.wireguard}function Pd(t){const e=k.c(41),{server:s,backendState:i}=t,r=G(),n=s.error||i?.last_exception||void 0;let l;e[0]!==r||e[1]!==s?(l=()=>r(ar({server:s,value:!s.active})),e[0]=r,e[1]=s,e[2]=l):l=e[2];let a,d;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx("h4",{children:"Advanced Configuration"}),d=o.jsx("p",{children:"Listen Host"}),e[3]=a,e[4]=d):(a=e[3],d=e[4]);const f=s.listen_host||"";let p;e[5]!==r||e[6]!==s?(p=M=>r(dr({server:s,value:M})),e[5]=r,e[6]=s,e[7]=p):p=e[7];let h;e[8]!==f||e[9]!==p?(h=o.jsx(ce,{className:"mode-input",content:f,placeholder:"(all interfaces)",onEditDone:p}),e[8]=f,e[9]=p,e[10]=h):h=e[10];let g;e[11]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx("p",{children:"Listen Port"}),e[11]=g):g=e[11];let _;e[12]!==s.listen_port?(_=s.listen_port?s.listen_port.toString():"",e[12]=s.listen_port,e[13]=_):_=e[13];let j;e[14]!==r||e[15]!==s?(j=M=>r(ur({server:s,value:parseInt(M)})),e[14]=r,e[15]=s,e[16]=j):j=e[16];let y;e[17]!==_||e[18]!==j?(y=o.jsx(ce,{className:"mode-input",content:_,placeholder:"51820",onEditDone:j}),e[17]=_,e[18]=j,e[19]=y):y=e[19];let w;e[20]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx("p",{children:"Configuration File"}),e[20]=w):w=e[20];const $=s.file_path||"";let N;e[21]!==r||e[22]!==s?(N=M=>r(fr({server:s,value:M})),e[21]=r,e[22]=s,e[23]=N):N=e[23];let E;e[24]!==$||e[25]!==N?(E=o.jsx(ce,{className:"mode-input",content:$,placeholder:"~/.mitmproxy/wireguard.conf",onEditDone:N}),e[24]=$,e[25]=N,e[26]=E):E=e[26];let T;e[27]!==y||e[28]!==E||e[29]!==h?(T=o.jsxs(st,{iconClass:"fa fa-cog",children:[a,d,h,g,y,w,E]}),e[27]=y,e[28]=E,e[29]=h,e[30]=T):T=e[30];let P;e[31]!==s.active||e[32]!==l||e[33]!==T?(P=o.jsx(tt,{value:s.active,label:"Run WireGuard Server",onChange:l,children:T}),e[31]=s.active,e[32]=l,e[33]=T,e[34]=P):P=e[34];let L;e[35]!==i||e[36]!==n?(L=o.jsx(et,{error:n,backendState:i}),e[35]=i,e[36]=n,e[37]=L):L=e[37];let O;return e[38]!==P||e[39]!==L?(O=o.jsxs("div",{children:[P,L]}),e[38]=P,e[39]=L,e[40]=O):O=e[40],O}function Od(){const t=k.c(15),e=G(),s=D(qd),i=D(Md);let r,n;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("h4",{className:"mode-title",children:"Reverse Proxy"}),n=o.jsx("p",{className:"mode-description",children:"Requests are forwarded to a preconfigured destination."}),t[0]=r,t[1]=n):(r=t[0],n=t[1]);let l;if(t[2]!==i||t[3]!==s){let h;t[5]!==i?(h=(g,_)=>o.jsx(Hd,{removable:_>0,server:g,backendState:i[Ns(g)]},g.ui_id),t[5]=i,t[6]=h):h=t[6],l=s.map(h),t[2]=i,t[3]=s,t[4]=l}else l=t[4];let a;t[7]!==e?(a=()=>e(na()),t[7]=e,t[8]=a):a=t[8];let d;t[9]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx("i",{className:"fa fa-plus-square-o","aria-hidden":"true"}),t[9]=d):d=t[9];let f;t[10]!==a?(f=o.jsxs("div",{className:"mode-reverse-add-server",onClick:a,children:[d,"Add additional server"]}),t[10]=a,t[11]=f):f=t[11];let p;return t[12]!==l||t[13]!==f?(p=o.jsxs("div",{children:[r,n,o.jsxs("div",{className:"mode-reverse-servers",children:[l,f]})]}),t[12]=l,t[13]=f,t[14]=p):p=t[14],p}function Md(t){return t.backendState.servers}function qd(t){return t.modes.reverse}function Hd(t){const e=k.c(56),{removable:s,server:i,backendState:r}=t,n=G();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=Object.values(Jt),e[0]=l):l=e[0];const a=l;let d;e[1]!==n||e[2]!==i?(d=async()=>{i.active&&await n(ms({server:i,value:!1})).unwrap(),await n(ia(i))},e[1]=n,e[2]=i,e[3]=d):d=e[3];const f=d,p=i.error||r?.last_exception||void 0,h=i.active;let g;e[4]!==n||e[5]!==i?(g=()=>{n(ms({server:i,value:!i.active}))},e[4]=n,e[5]=i,e[6]=g):g=e[6];const _=i.protocol;let j;e[7]!==n||e[8]!==i?(j=Z=>{n(mr({server:i,value:Z.target.value}))},e[7]=n,e[8]=i,e[9]=j):j=e[9];let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=a.map(Vd),e[10]=y):y=e[10];let w;e[11]!==i.protocol||e[12]!==j?(w=o.jsx("select",{name:"protocols",className:"mode-reverse-dropdown",value:_,onChange:j,children:y}),e[11]=i.protocol,e[12]=j,e[13]=w):w=e[13];let $;e[14]!==i.destination?($=i.destination?.toString()||"",e[14]=i.destination,e[15]=$):$=e[15];let N;e[16]!==n||e[17]!==i?(N=Z=>n(gr({server:i,value:Z})),e[16]=n,e[17]=i,e[18]=N):N=e[18];let E;e[19]!==N||e[20]!==$?(E=o.jsx(ce,{className:"mode-reverse-input",content:$,onEditDone:N,placeholder:"example.com"}),e[19]=N,e[20]=$,e[21]=E):E=e[21];let T,P;e[22]===Symbol.for("react.memo_cache_sentinel")?(T=o.jsx("h4",{children:"Advanced Configuration"}),P=o.jsx("p",{children:"Listen Host"}),e[22]=T,e[23]=P):(T=e[22],P=e[23]);const L=i.listen_host||"";let O;e[24]!==n||e[25]!==i?(O=Z=>n(pr({server:i,value:Z})),e[24]=n,e[25]=i,e[26]=O):O=e[26];let M;e[27]!==L||e[28]!==O?(M=o.jsx(ce,{className:"mode-input",content:L,onEditDone:O,placeholder:"*"}),e[27]=L,e[28]=O,e[29]=M):M=e[29];let U;e[30]===Symbol.for("react.memo_cache_sentinel")?(U=o.jsx("p",{children:"Listen Port"}),e[30]=U):U=e[30];const V=String(i.listen_port||"");let W;e[31]!==n||e[32]!==i?(W=Z=>n(hr({server:i,value:Z})),e[31]=n,e[32]=i,e[33]=W):W=e[33];let J;e[34]!==V||e[35]!==W?(J=o.jsx(ce,{className:"mode-input",content:V,onEditDone:W,placeholder:"8080"}),e[34]=V,e[35]=W,e[36]=J):J=e[36];let z;e[37]!==M||e[38]!==J?(z=o.jsxs(st,{iconClass:"fa fa-cog",children:[T,P,M,U,J]}),e[37]=M,e[38]=J,e[39]=z):z=e[39];let te;e[40]!==f||e[41]!==s?(te=s&&o.jsx("i",{className:"fa fa-fw fa-trash fa-lg","aria-hidden":"true",onClick:f}),e[40]=f,e[41]=s,e[42]=te):te=e[42];let Y;e[43]!==i.active||e[44]!==E||e[45]!==z||e[46]!==te||e[47]!==g||e[48]!==w?(Y=o.jsxs(tt,{value:h,label:"Forward",onChange:g,children:[w,"traffic to",E,z,te]}),e[43]=i.active,e[44]=E,e[45]=z,e[46]=te,e[47]=g,e[48]=w,e[49]=Y):Y=e[49];let Q;e[50]!==r||e[51]!==p?(Q=o.jsx(et,{error:p,backendState:r}),e[50]=r,e[51]=p,e[52]=Q):Q=e[52];let X;return e[53]!==Y||e[54]!==Q?(X=o.jsxs("div",{children:[Y,Q]}),e[53]=Y,e[54]=Q,e[55]=X):X=e[55],X}function Vd(t){return o.jsx("option",{value:t,children:t},t)}function Ud(){const t=k.c(9),e=D(Wd),s=D(Bd);let i;if(t[0]!==s||t[1]!==e){let d;t[3]!==s?(d=f=>o.jsx(Kd,{server:f,backendState:s[tr(f)]},f.ui_id),t[3]=s,t[4]=d):d=t[4],i=e.map(d),t[0]=s,t[1]=e,t[2]=i}else i=t[2];const r=i;let n;t[5]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("h4",{className:"mode-title",children:"Transparent Proxy"}),t[5]=n):n=t[5];let l;t[6]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsxs("p",{className:"mode-description",children:["You"," ",o.jsx("a",{href:"https://docs.mitmproxy.org/stable/howto-transparent/",style:{textDecoration:"underline",color:"inherit"},children:"configure your routing table"})," ","to send traffic through mitmproxy."]}),t[6]=l):l=t[6];let a;return t[7]!==r?(a=o.jsxs("div",{children:[n,l,r]}),t[7]=r,t[8]=a):a=t[8],a}function Bd(t){return t.backendState.servers}function Wd(t){return t.modes.transparent}function Kd(t){const e=k.c(33),{server:s,backendState:i}=t,r=G(),n=s.error||i?.last_exception||void 0;let l;e[0]!==r||e[1]!==s?(l=()=>r(xr({server:s,value:!s.active})),e[0]=r,e[1]=s,e[2]=l):l=e[2];let a,d;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx("h4",{children:"Advanced Configuration"}),d=o.jsx("p",{children:"Listen Host"}),e[3]=a,e[4]=d):(a=e[3],d=e[4]);const f=s.listen_host||"";let p;e[5]!==r||e[6]!==s?(p=T=>r(_r({server:s,value:T})),e[5]=r,e[6]=s,e[7]=p):p=e[7];let h;e[8]!==f||e[9]!==p?(h=o.jsx(ce,{className:"mode-input",content:f,onEditDone:p}),e[8]=f,e[9]=p,e[10]=h):h=e[10];let g;e[11]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx("p",{children:"Listen Port"}),e[11]=g):g=e[11];let _;e[12]!==s.listen_port?(_=s.listen_port?s.listen_port.toString():"",e[12]=s.listen_port,e[13]=_):_=e[13];let j;e[14]!==r||e[15]!==s?(j=T=>r(jr({server:s,value:parseInt(T)})),e[14]=r,e[15]=s,e[16]=j):j=e[16];let y;e[17]!==_||e[18]!==j?(y=o.jsx(ce,{className:"mode-input",content:_,placeholder:"8080",onEditDone:j}),e[17]=_,e[18]=j,e[19]=y):y=e[19];let w;e[20]!==y||e[21]!==h?(w=o.jsxs(st,{iconClass:"fa fa-cog",children:[a,d,h,g,y]}),e[20]=y,e[21]=h,e[22]=w):w=e[22];let $;e[23]!==s.active||e[24]!==l||e[25]!==w?($=o.jsx(tt,{value:s.active,label:"Run Transparent Proxy",onChange:l,children:w}),e[23]=s.active,e[24]=l,e[25]=w,e[26]=$):$=e[26];let N;e[27]!==i||e[28]!==n?(N=o.jsx(et,{error:n,backendState:i}),e[27]=i,e[28]=n,e[29]=N):N=e[29];let E;return e[30]!==$||e[31]!==N?(E=o.jsxs("div",{children:[$,N]}),e[30]=$,e[31]=N,e[32]=E):E=e[32],E}function zd(){const t=k.c(9),e=D(Yd),s=D(Gd);let i;if(t[0]!==s||t[1]!==e){let d;t[3]!==s?(d=f=>o.jsx(Jd,{server:f,backendState:s[sr(f)]},f.ui_id),t[3]=s,t[4]=d):d=t[4],i=e.map(d),t[0]=s,t[1]=e,t[2]=i}else i=t[2];const r=i;let n,l;t[5]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("h4",{className:"mode-title",children:"SOCKS Proxy"}),l=o.jsx("p",{className:"mode-description",children:"You manually configure your client application or device to use a SOCKS5 proxy."}),t[5]=n,t[6]=l):(n=t[5],l=t[6]);let a;return t[7]!==r?(a=o.jsxs("div",{children:[n,l,r]}),t[7]=r,t[8]=a):a=t[8],a}function Gd(t){return t.backendState.servers}function Yd(t){return t.modes.socks}function Jd(t){const e=k.c(33),{server:s,backendState:i}=t,r=G(),n=s.error||i?.last_exception||void 0;let l;e[0]!==r||e[1]!==s?(l=()=>r(yr({server:s,value:!s.active})),e[0]=r,e[1]=s,e[2]=l):l=e[2];let a,d;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx("h4",{children:"Advanced Configuration"}),d=o.jsx("p",{children:"Listen Host"}),e[3]=a,e[4]=d):(a=e[3],d=e[4]);const f=s.listen_host||"";let p;e[5]!==r||e[6]!==s?(p=T=>r(wr({server:s,value:T})),e[5]=r,e[6]=s,e[7]=p):p=e[7];let h;e[8]!==f||e[9]!==p?(h=o.jsx(ce,{className:"mode-input",content:f,onEditDone:p}),e[8]=f,e[9]=p,e[10]=h):h=e[10];let g;e[11]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx("p",{children:"Listen Port"}),e[11]=g):g=e[11];let _;e[12]!==s.listen_port?(_=s.listen_port?s.listen_port.toString():"",e[12]=s.listen_port,e[13]=_):_=e[13];let j;e[14]!==r||e[15]!==s?(j=T=>r(br({server:s,value:parseInt(T)})),e[14]=r,e[15]=s,e[16]=j):j=e[16];let y;e[17]!==_||e[18]!==j?(y=o.jsx(ce,{className:"mode-input",content:_,placeholder:"8080",onEditDone:j}),e[17]=_,e[18]=j,e[19]=y):y=e[19];let w;e[20]!==y||e[21]!==h?(w=o.jsxs(st,{iconClass:"fa fa-cog",children:[a,d,h,g,y]}),e[20]=y,e[21]=h,e[22]=w):w=e[22];let $;e[23]!==s.active||e[24]!==l||e[25]!==w?($=o.jsx(tt,{value:s.active,label:"Run SOCKS Proxy",onChange:l,children:w}),e[23]=s.active,e[24]=l,e[25]=w,e[26]=$):$=e[26];let N;e[27]!==i||e[28]!==n?(N=o.jsx(et,{error:n,backendState:i}),e[27]=i,e[28]=n,e[29]=N):N=e[29];let E;return e[30]!==$||e[31]!==N?(E=o.jsxs("div",{children:[$,N]}),e[30]=$,e[31]=N,e[32]=E):E=e[32],E}function Qd(){const t=k.c(9),e=D(Zd),s=D(Xd);let i;if(t[0]!==s||t[1]!==e){let d;t[3]!==s?(d=f=>o.jsx(eu,{server:f,backendState:s[nr(f)]},f.ui_id),t[3]=s,t[4]=d):d=t[4],i=e.map(d),t[0]=s,t[1]=e,t[2]=i}else i=t[2];const r=i;let n,l;t[5]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("h4",{className:"mode-title",children:"Explicit HTTP(S) Proxy (With Upstream Proxy)"}),l=o.jsx("p",{className:"mode-description",children:"All requests are forwarded to a second HTTP(S) proxy server."}),t[5]=n,t[6]=l):(n=t[5],l=t[6]);let a;return t[7]!==r?(a=o.jsxs("div",{children:[n,l,r]}),t[7]=r,t[8]=a):a=t[8],a}function Xd(t){return t.backendState.servers}function Zd(t){return t.modes.upstream}function eu(t){const e=k.c(42),{server:s,backendState:i}=t,r=G(),n=s.error||i?.last_exception||void 0;let l;e[0]!==r||e[1]!==s?(l=()=>{r(Sr({server:s,value:!s.active}))},e[0]=r,e[1]=s,e[2]=l):l=e[2];let a;e[3]!==s.destination?(a=s.destination?.toString()||"",e[3]=s.destination,e[4]=a):a=e[4];let d;e[5]!==r||e[6]!==s?(d=O=>r(Nr({server:s,value:O})),e[5]=r,e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a||e[9]!==d?(f=o.jsx(ce,{className:"mode-upstream-input",content:a,onEditDone:d,placeholder:"http://example.com:8080"}),e[8]=a,e[9]=d,e[10]=f):f=e[10];let p,h;e[11]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx("h4",{children:"Advanced Configuration"}),h=o.jsx("p",{children:"Listen Host"}),e[11]=p,e[12]=h):(p=e[11],h=e[12]);const g=s.listen_host||"";let _;e[13]!==r||e[14]!==s?(_=O=>r($r({server:s,value:O})),e[13]=r,e[14]=s,e[15]=_):_=e[15];let j;e[16]!==g||e[17]!==_?(j=o.jsx(ce,{className:"mode-input",content:g,onEditDone:_}),e[16]=g,e[17]=_,e[18]=j):j=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=o.jsx("p",{children:"Listen Port"}),e[19]=y):y=e[19];let w;e[20]!==s.listen_port?(w=s.listen_port?s.listen_port.toString():"",e[20]=s.listen_port,e[21]=w):w=e[21];let $;e[22]!==r||e[23]!==s?($=O=>r(Cr({server:s,value:parseInt(O)})),e[22]=r,e[23]=s,e[24]=$):$=e[24];let N;e[25]!==w||e[26]!==$?(N=o.jsx(ce,{className:"mode-input",content:w,placeholder:"8080",onEditDone:$}),e[25]=w,e[26]=$,e[27]=N):N=e[27];let E;e[28]!==N||e[29]!==j?(E=o.jsxs(st,{iconClass:"fa fa-cog",children:[p,h,j,y,N]}),e[28]=N,e[29]=j,e[30]=E):E=e[30];let T;e[31]!==s.active||e[32]!==l||e[33]!==E||e[34]!==f?(T=o.jsxs(tt,{value:s.active,label:"Run HTTP/S Proxy and forward requests to",onChange:l,children:[f,E]}),e[31]=s.active,e[32]=l,e[33]=E,e[34]=f,e[35]=T):T=e[35];let P;e[36]!==i||e[37]!==n?(P=o.jsx(et,{error:n,backendState:i}),e[36]=i,e[37]=n,e[38]=P):P=e[38];let L;return e[39]!==T||e[40]!==P?(L=o.jsxs("div",{children:[T,P]}),e[39]=T,e[40]=P,e[41]=L):L=e[41],L}function tu(){const t=k.c(9),e=D(nu),s=D(su);let i;if(t[0]!==s||t[1]!==e){let d;t[3]!==s?(d=f=>o.jsx(iu,{server:f,backendState:s[ir(f)]},f.ui_id),t[3]=s,t[4]=d):d=t[4],i=e.map(d),t[0]=s,t[1]=e,t[2]=i}else i=t[2];const r=i;let n,l;t[5]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("h4",{className:"mode-title",children:"DNS Server"}),l=o.jsx("p",{className:"mode-description",children:"A recursive DNS resolver using the host's DNS configuration."}),t[5]=n,t[6]=l):(n=t[5],l=t[6]);let a;return t[7]!==r?(a=o.jsxs("div",{children:[n,l,r]}),t[7]=r,t[8]=a):a=t[8],a}function su(t){return t.backendState.servers}function nu(t){return t.modes.dns}function iu(t){const e=k.c(33),{server:s,backendState:i}=t,r=G(),n=s.error||i?.last_exception||void 0;let l;e[0]!==r||e[1]!==s?(l=()=>r(kr({server:s,value:!s.active})),e[0]=r,e[1]=s,e[2]=l):l=e[2];let a,d;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx("h4",{children:"Advanced Configuration"}),d=o.jsx("p",{children:"Listen Host"}),e[3]=a,e[4]=d):(a=e[3],d=e[4]);const f=s.listen_host||"";let p;e[5]!==r||e[6]!==s?(p=T=>r(Er({server:s,value:T})),e[5]=r,e[6]=s,e[7]=p):p=e[7];let h;e[8]!==f||e[9]!==p?(h=o.jsx(ce,{className:"mode-input",content:f,onEditDone:p}),e[8]=f,e[9]=p,e[10]=h):h=e[10];let g;e[11]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx("p",{children:"Listen Port"}),e[11]=g):g=e[11];let _;e[12]!==s.listen_port?(_=s.listen_port?s.listen_port.toString():"",e[12]=s.listen_port,e[13]=_):_=e[13];let j;e[14]!==r||e[15]!==s?(j=T=>r(Tr({server:s,value:parseInt(T)})),e[14]=r,e[15]=s,e[16]=j):j=e[16];let y;e[17]!==_||e[18]!==j?(y=o.jsx(ce,{className:"mode-input",content:_,placeholder:"8080",onEditDone:j}),e[17]=_,e[18]=j,e[19]=y):y=e[19];let w;e[20]!==y||e[21]!==h?(w=o.jsxs(st,{iconClass:"fa fa-cog",children:[a,d,h,g,y]}),e[20]=y,e[21]=h,e[22]=w):w=e[22];let $;e[23]!==s.active||e[24]!==l||e[25]!==w?($=o.jsx(tt,{value:s.active,label:"Run DNS Server",onChange:l,children:w}),e[23]=s.active,e[24]=l,e[25]=w,e[26]=$):$=e[26];let N;e[27]!==i||e[28]!==n?(N=o.jsx(et,{error:n,backendState:i}),e[27]=i,e[28]=n,e[29]=N):N=e[29];let E;return e[30]!==$||e[31]!==N?(E=o.jsxs("div",{children:[$,N]}),e[30]=$,e[31]=N,e[32]=E):E=e[32],E}function ri(t){const e=k.c(10),{title:s,description:i}=t;let r;e[0]!==s?(r=o.jsx("h4",{className:"mode-title",children:s}),e[0]=s,e[1]=r):r=e[1];let n;e[2]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("i",{className:"fa fa-exclamation-triangle","aria-hidden":"true"}),e[2]=n):n=e[2];let l;e[3]!==r?(l=o.jsxs("div",{className:"title-icon-container",children:[r,n]}),e[3]=r,e[4]=l):l=e[4];let a;e[5]!==i?(a=o.jsx("p",{className:"mode-description",children:i}),e[5]=i,e[6]=a):a=e[6];let d;return e[7]!==l||e[8]!==a?(d=o.jsxs("div",{className:"missing-mode-container",children:[l,a]}),e[7]=l,e[8]=a,e[9]=d):d=e[9],d}function ru(){const t=k.c(19),{platform:e,localModeUnavailable:s}=D(ou);let i,r;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("h2",{children:"Intercept Traffic"}),r=o.jsx("p",{children:"Configure how you want to intercept traffic with mitmproxy."}),t[0]=i,t[1]=r):(i=t[0],r=t[1]);let n;t[2]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("h3",{children:"Recommended"}),t[2]=n):n=t[2];let l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(Td,{}),t[3]=l):l=t[3];let a;t[4]!==s?(a=s!==null?o.jsx(ri,{title:"Local Redirect Mode",description:s}):o.jsx(Sd,{}),t[4]=s,t[5]=a):a=t[5];let d,f;t[6]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(Fd,{}),f=o.jsx(Od,{}),t[6]=d,t[7]=f):(d=t[6],f=t[7]);let p;t[8]!==a?(p=o.jsxs("div",{className:"modes-category green-left-border",children:[n,o.jsxs("div",{className:"modes-container",children:[l,a,d,f]})]}),t[8]=a,t[9]=p):p=t[9];let h;t[10]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx("h3",{children:"Advanced"}),t[10]=h):h=t[10];let g,_,j;t[11]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(zd,{}),g=o.jsx(Qd,{}),_=o.jsx(tu,{}),t[11]=g,t[12]=_,t[13]=j):(g=t[11],_=t[12],j=t[13]);let y;t[14]!==e?(y=o.jsxs("div",{className:"modes-category gray-left-border",children:[h,o.jsxs("div",{className:"modes-container",children:[j,g,_,e.startsWith("win32")?o.jsx(ri,{title:"Transparent Proxy",description:"This mode is only supported on Linux and MacOS."}):o.jsx(Ud,{})]})]}),t[14]=e,t[15]=y):y=t[15];let w;return t[16]!==y||t[17]!==p?(w=o.jsxs("div",{className:"modes",children:[i,r,p,y]}),t[16]=y,t[17]=p,t[18]=w):w=t[18],w}function ou(t){return t.backendState}function lu(){const t=k.c(4),e=D(du),s=D(au),i=D(cu);let r;return t[0]!==i||t[1]!==s||t[2]!==e?(r=o.jsx("div",{className:"main-view",children:i===xe.Capture?o.jsx(ru,{}):o.jsxs(o.Fragment,{children:[s?o.jsx(md,{}):o.jsx(gd,{}),e&&o.jsxs(o.Fragment,{children:[o.jsx(ld,{},"splitter"),o.jsx(nd,{},"flowDetails")]})]})}),t[0]=i,t[1]=s,t[2]=e,t[3]=r):r=t[3],r}function cu(t){return t.ui.tabs.current}function au(t){return t.flows.list.length>0}function du(t){return t.flows.selected.length===1}function gt(t){const e=k.c(2),{children:s}=t;let i;return e[0]!==s?(i=window.MITMWEB_STATIC?null:o.jsx(o.Fragment,{children:s}),e[0]=s,e[1]=i):i=e[1],i}const uu=I.memo(function(){const e=k.c(20),s=G(),i=D(fu);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={placement:"bottom-start"},e[0]=r):r=e[0];let n;e[1]!==s?(n=o.jsx("li",{children:o.jsx(Fr,{icon:"fa-folder-open",text:" Open...",onClick:pu,onOpenFile:w=>{s(tc(w)),document.body.click()}})}),e[1]=s,e[2]=n):n=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsxs(ke,{onClick:hu,children:[o.jsx("i",{className:"fa fa-fw fa-floppy-o"})," Save"]}),e[3]=l):l=e[3];let a;e[4]!==i?(a=()=>location.replace("/flows/dump?filter="+i),e[4]=i,e[5]=a):a=e[5];let d;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx("i",{className:"fa fa-fw fa-floppy-o"}),e[6]=d):d=e[6];let f;e[7]!==a?(f=o.jsxs(ke,{onClick:a,children:[d," Save filtered"]}),e[7]=a,e[8]=f):f=e[8];let p;e[9]!==s?(p=()=>confirm("Delete all flows?")&&s(Oi()),e[9]=s,e[10]=p):p=e[10];let h;e[11]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx("i",{className:"fa fa-fw fa-trash"}),e[11]=h):h=e[11];let g;e[12]!==p?(g=o.jsxs(ke,{onClick:p,children:[h," Clear All"]}),e[12]=p,e[13]=g):g=e[13];let _;e[14]===Symbol.for("react.memo_cache_sentinel")?(_=o.jsx(ka,{}),e[14]=_):_=e[14];let j;e[15]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsxs(gt,{children:[_,o.jsx("li",{children:o.jsxs("a",{href:"http://mitm.it/",target:"_blank",rel:"noreferrer",children:[o.jsx("i",{className:"fa fa-fw fa-external-link"})," Install Certificates..."]})})]}),e[15]=j):j=e[15];let y;return e[16]!==n||e[17]!==f||e[18]!==g?(y=o.jsxs(Et,{className:"pull-left special",text:"File",options:r,children:[n,l,f,g,j]}),e[16]=n,e[17]=f,e[18]=g,e[19]=y):y=e[19],y});function fu(t){return t.ui.filter[ve.Search]}function pu(t){return t.stopPropagation()}function hu(){return location.replace("/flows/dump")}const mu=I.memo(function(){const e=k.c(5),s=D(gu),i=D(vu);switch(s){case wt.INIT:{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("span",{className:"connection-indicator init",children:"connecting…"}),e[0]=r):r=e[0],r}case wt.FETCHING:{let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("span",{className:"connection-indicator fetching",children:"fetching data…"}),e[1]=r):r=e[1],r}case wt.ESTABLISHED:{let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("span",{className:"connection-indicator established",children:"connected"}),e[2]=r):r=e[2],r}case wt.ERROR:{let r;return e[3]!==i?(r=o.jsx("span",{className:"connection-indicator error",title:i,children:"connection lost"}),e[3]=i,e[4]=r):r=e[4],r}default:Ct(s)}});function gu(t){return t.connection.state}function vu(t){return t.connection.message}Xr.title="Capture";function Xr(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(o.Fragment,{}),t[0]=e):e=t[0],e}const oi=function(){function t(i,r){function n(){this.constructor=i}n.prototype=r.prototype,i.prototype=new n}function e(i,r,n,l){this.message=i,this.expected=r,this.found=n,this.location=l,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,e)}t(e,Error);function s(i){var r=arguments.length>1?arguments[1]:{},n={},l={start:_n},a=_n,d={type:"other",description:"filter expression"},f=function(c){return c},p={type:"other",description:"whitespace"},h=/^[ \t\n\r]/,g={type:"class",value:"[ \\t\\n\\r]",description:"[ \\t\\n\\r]"},_={type:"other",description:"control character"},j=/^[|&!()~"]/,y={type:"class",value:'[|&!()~"]',description:'[|&!()~"]'},w={type:"other",description:"optional whitespace"},$="|",N={type:"literal",value:"|",description:'"|"'},E=function(c,u){return il(c,u)},T="&",P={type:"literal",value:"&",description:'"&"'},L=function(c,u){return rl(c,u)},O="!",M={type:"literal",value:"!",description:'"!"'},U=function(c){return ol(c)},V="(",W={type:"literal",value:"(",description:'"("'},J=")",z={type:"literal",value:")",description:'")"'},te=function(c){return ll(c)},Y="~all",Q={type:"literal",value:"~all",description:'"~all"'},X=function(){return Sn},Z="~a",ae={type:"literal",value:"~a",description:'"~a"'},le=function(){return Cn},de="~b",ye={type:"literal",value:"~b",description:'"~b"'},Pe=function(c){return cl(c)},Se="~bq",Ee={type:"literal",value:"~bq",description:'"~bq"'},C=function(c){return al(c)},he="~bs",B={type:"literal",value:"~bs",description:'"~bs"'},oe=function(c){return dl(c)},q="~c",$e={type:"literal",value:"~c",description:'"~c"'},We=function(c){return ul(c)},Oe="~comment",ee={type:"literal",value:"~comment",description:'"~comment"'},Me=function(c){return fl(c)},Re="~d",re={type:"literal",value:"~d",description:'"~d"'},ue=function(c){return pl(c)},ge="~dns",Ae={type:"literal",value:"~dns",description:'"~dns"'},nt=function(){return Nn},Je="~dst",Zt={type:"literal",value:"~dst",description:'"~dst"'},b=function(c){return hl(c)},S="~e",A={type:"literal",value:"~e",description:'"~e"'},H=function(){return kn},Tt="~h",es={type:"literal",value:"~h",description:'"~h"'},Ce=function(c){return ml(c)},De="~hq",ut={type:"literal",value:"~hq",description:'"~hq"'},Ke=function(c){return gl(c)},vt="~hs",Rt={type:"literal",value:"~hs",description:'"~hs"'},it=function(c){return vl(c)},At="~http",ft={type:"literal",value:"~http",description:'"~http"'},Fe=function(){return En},Us="~marked",no={type:"literal",value:"~marked",description:'"~marked"'},io=function(){return Tn},Bs="~marker",ro={type:"literal",value:"~marker",description:'"~marker"'},oo=function(c){return xl(c)},Ws="~m",lo={type:"literal",value:"~m",description:'"~m"'},co=function(c){return _l(c)},Ks="~q",ao={type:"literal",value:"~q",description:'"~q"'},uo=function(){return Rn},zs="~replayq",fo={type:"literal",value:"~replayq",description:'"~replayq"'},po=function(){return An},Gs="~replays",ho={type:"literal",value:"~replays",description:'"~replays"'},mo=function(){return Dn},Ys="~replay",go={type:"literal",value:"~replay",description:'"~replay"'},vo=function(){return Fn},Js="~src",xo={type:"literal",value:"~src",description:'"~src"'},_o=function(c){return jl(c)},Qs="~s",jo={type:"literal",value:"~s",description:'"~s"'},yo=function(){return In},Xs="~tcp",wo={type:"literal",value:"~tcp",description:'"~tcp"'},bo=function(){return Ln},Zs="~udp",So={type:"literal",value:"~udp",description:'"~udp"'},$o=function(){return Pn},en="~tq",Co={type:"literal",value:"~tq",description:'"~tq"'},No=function(c){return yl(c)},tn="~ts",ko={type:"literal",value:"~ts",description:'"~ts"'},Eo=function(c){return wl(c)},sn="~t",To={type:"literal",value:"~t",description:'"~t"'},Ro=function(c){return bl(c)},nn="~u",Ao={type:"literal",value:"~u",description:'"~u"'},rn=function(c){return Sl(c)},on="~websocket",Do={type:"literal",value:"~websocket",description:'"~websocket"'},Fo=function(){return On},Io={type:"other",description:"integer"},ln=/^['"]/,cn={type:"class",value:`['"]`,description:`['"]`},an=/^[0-9]/,dn={type:"class",value:"[0-9]",description:"[0-9]"},Lo=function(c){return parseInt(c.join(""),10)},Po={type:"other",description:"string"},un='"',fn={type:"literal",value:'"',description:'"\\""'},ts=function(c){return c.join("")},pn="'",hn={type:"literal",value:"'",description:`"'"`},Oo=/^["\\]/,Mo={type:"class",value:'["\\\\]',description:'["\\\\]'},ss={type:"any",description:"any character"},xt=function(c){return c},mn="\\",gn={type:"literal",value:"\\",description:'"\\\\"'},qo=/^['\\]/,Ho={type:"class",value:"['\\\\]",description:"['\\\\]"},Vo=/^['"\\]/,Uo={type:"class",value:`['"\\\\]`,description:`['"\\\\]`},Bo="n",Wo={type:"literal",value:"n",description:'"n"'},Ko=function(){return` |
| 4 | `},zo="r",Go={type:"literal",value:"r",description:'"r"'},Yo=function(){return"\r"},Jo="t",Qo={type:"literal",value:"t",description:'"t"'},Xo=function(){return" "},m=0,Dt=[{line:1,column:1,seenCR:!1}],qe=0,ns=[],R=0,Ft;if("startRule"in r){if(!(r.startRule in l))throw new Error(`Can't start parsing from rule "`+r.startRule+'".');a=l[r.startRule]}function vn(c){var u=Dt[c],v,x;if(u)return u;for(v=c-1;!Dt[v];)v--;for(u=Dt[v],u={line:u.line,column:u.column,seenCR:u.seenCR};v<c;)x=i.charAt(v),x===` |
| 5 | `?(u.seenCR||u.line++,u.column=1,u.seenCR=!1):x==="\r"||x==="\u2028"||x==="\u2029"?(u.line++,u.column=1,u.seenCR=!0):(u.column++,u.seenCR=!1),v++;return Dt[c]=u,u}function xn(c,u){var v=vn(c),x=vn(u);return{start:{offset:c,line:v.line,column:v.column},end:{offset:u,line:x.line,column:x.column}}}function F(c){m<qe||(m>qe&&(qe=m,ns=[]),ns.push(c))}function Zo(c,u,v,x){function He(Ie){var Qe=1;for(Ie.sort(function(Pt,rt){return Pt.description<rt.description?-1:Pt.description>rt.description?1:0});Qe<Ie.length;)Ie[Qe-1]===Ie[Qe]?Ie.splice(Qe,1):Qe++}function Ne(Ie,Qe){function Pt($l){function Ot(Ge){return Ge.charCodeAt(0).toString(16).toUpperCase()}return $l.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(Ge){return"\\x0"+Ot(Ge)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(Ge){return"\\x"+Ot(Ge)}).replace(/[\u0100-\u0FFF]/g,function(Ge){return"\\u0"+Ot(Ge)}).replace(/[\u1000-\uFFFF]/g,function(Ge){return"\\u"+Ot(Ge)})}var rt=new Array(Ie.length),Mn,qn,_t;for(_t=0;_t<Ie.length;_t++)rt[_t]=Ie[_t].description;return Mn=Ie.length>1?rt.slice(0,-1).join(", ")+" or "+rt[Ie.length-1]:rt[0],qn=Qe?'"'+Pt(Qe)+'"':"end of input","Expected "+Mn+" but "+qn+" found."}return u!==null&&He(u),new e(Ne(u,v),u,v,x)}function _n(){var c,u,v,x;return R++,c=m,u=ze(),u!==n?(v=is(),v!==n?(x=ze(),x!==n?(u=f(v),c=u):(m=c,c=n)):(m=c,c=n)):(m=c,c=n),R--,c===n&&(u=n,R===0&&F(d)),c}function K(){var c;return R++,h.test(i.charAt(m))?(c=i.charAt(m),m++):(c=n,R===0&&F(g)),R--,c===n&&R===0&&F(p),c}function el(){var c;return R++,j.test(i.charAt(m))?(c=i.charAt(m),m++):(c=n,R===0&&F(y)),R--,c===n&&R===0&&F(_),c}function ze(){var c,u;for(R++,c=[],u=K();u!==n;)c.push(u),u=K();return R--,c===n&&(u=n,R===0&&F(w)),c}function is(){var c,u,v,x,He,Ne;return c=m,u=It(),u!==n?(v=ze(),v!==n?(i.charCodeAt(m)===124?(x=$,m++):(x=n,R===0&&F(N)),x!==n?(He=ze(),He!==n?(Ne=is(),Ne!==n?(u=E(u,Ne),c=u):(m=c,c=n)):(m=c,c=n)):(m=c,c=n)):(m=c,c=n)):(m=c,c=n),c===n&&(c=It()),c}function It(){var c,u,v,x,He,Ne;if(c=m,u=Lt(),u!==n?(v=ze(),v!==n?(i.charCodeAt(m)===38?(x=T,m++):(x=n,R===0&&F(P)),x!==n?(He=ze(),He!==n?(Ne=It(),Ne!==n?(u=L(u,Ne),c=u):(m=c,c=n)):(m=c,c=n)):(m=c,c=n)):(m=c,c=n)):(m=c,c=n),c===n){if(c=m,u=Lt(),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=It(),x!==n?(u=L(u,x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;c===n&&(c=Lt())}return c}function Lt(){var c,u,v,x;return c=m,i.charCodeAt(m)===33?(u=O,m++):(u=n,R===0&&F(M)),u!==n?(v=ze(),v!==n?(x=Lt(),x!==n?(u=U(x),c=u):(m=c,c=n)):(m=c,c=n)):(m=c,c=n),c===n&&(c=tl()),c}function tl(){var c,u,v,x,He,Ne;return c=m,i.charCodeAt(m)===40?(u=V,m++):(u=n,R===0&&F(W)),u!==n?(v=ze(),v!==n?(x=is(),x!==n?(He=ze(),He!==n?(i.charCodeAt(m)===41?(Ne=J,m++):(Ne=n,R===0&&F(z)),Ne!==n?(u=te(x),c=u):(m=c,c=n)):(m=c,c=n)):(m=c,c=n)):(m=c,c=n)):(m=c,c=n),c===n&&(c=sl()),c}function sl(){var c,u,v,x;if(c=m,i.substr(m,4)===Y?(u=Y,m+=4):(u=n,R===0&&F(Q)),u!==n&&(u=X()),c=u,c===n&&(c=m,i.substr(m,2)===Z?(u=Z,m+=2):(u=n,R===0&&F(ae)),u!==n&&(u=le()),c=u,c===n)){if(c=m,i.substr(m,2)===de?(u=de,m+=2):(u=n,R===0&&F(ye)),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=me(),x!==n?(u=Pe(x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n){if(c=m,i.substr(m,3)===Se?(u=Se,m+=3):(u=n,R===0&&F(Ee)),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=me(),x!==n?(u=C(x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n){if(c=m,i.substr(m,3)===he?(u=he,m+=3):(u=n,R===0&&F(B)),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=me(),x!==n?(u=oe(x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n){if(c=m,i.substr(m,2)===q?(u=q,m+=2):(u=n,R===0&&F($e)),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=nl(),x!==n?(u=We(x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n){if(c=m,i.substr(m,8)===Oe?(u=Oe,m+=8):(u=n,R===0&&F(ee)),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=me(),x!==n?(u=Me(x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n){if(c=m,i.substr(m,2)===Re?(u=Re,m+=2):(u=n,R===0&&F(re)),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=me(),x!==n?(u=ue(x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n&&(c=m,i.substr(m,4)===ge?(u=ge,m+=4):(u=n,R===0&&F(Ae)),u!==n&&(u=nt()),c=u,c===n)){if(c=m,i.substr(m,4)===Je?(u=Je,m+=4):(u=n,R===0&&F(Zt)),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=me(),x!==n?(u=b(x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n&&(c=m,i.substr(m,2)===S?(u=S,m+=2):(u=n,R===0&&F(A)),u!==n&&(u=H()),c=u,c===n)){if(c=m,i.substr(m,2)===Tt?(u=Tt,m+=2):(u=n,R===0&&F(es)),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=me(),x!==n?(u=Ce(x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n){if(c=m,i.substr(m,3)===De?(u=De,m+=3):(u=n,R===0&&F(ut)),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=me(),x!==n?(u=Ke(x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n){if(c=m,i.substr(m,3)===vt?(u=vt,m+=3):(u=n,R===0&&F(Rt)),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=me(),x!==n?(u=it(x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n&&(c=m,i.substr(m,5)===At?(u=At,m+=5):(u=n,R===0&&F(ft)),u!==n&&(u=Fe()),c=u,c===n&&(c=m,i.substr(m,7)===Us?(u=Us,m+=7):(u=n,R===0&&F(no)),u!==n&&(u=io()),c=u,c===n))){if(c=m,i.substr(m,7)===Bs?(u=Bs,m+=7):(u=n,R===0&&F(ro)),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=me(),x!==n?(u=oo(x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n){if(c=m,i.substr(m,2)===Ws?(u=Ws,m+=2):(u=n,R===0&&F(lo)),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=me(),x!==n?(u=co(x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n&&(c=m,i.substr(m,2)===Ks?(u=Ks,m+=2):(u=n,R===0&&F(ao)),u!==n&&(u=uo()),c=u,c===n&&(c=m,i.substr(m,8)===zs?(u=zs,m+=8):(u=n,R===0&&F(fo)),u!==n&&(u=po()),c=u,c===n&&(c=m,i.substr(m,8)===Gs?(u=Gs,m+=8):(u=n,R===0&&F(ho)),u!==n&&(u=mo()),c=u,c===n&&(c=m,i.substr(m,7)===Ys?(u=Ys,m+=7):(u=n,R===0&&F(go)),u!==n&&(u=vo()),c=u,c===n))))){if(c=m,i.substr(m,4)===Js?(u=Js,m+=4):(u=n,R===0&&F(xo)),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=me(),x!==n?(u=_o(x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n&&(c=m,i.substr(m,2)===Qs?(u=Qs,m+=2):(u=n,R===0&&F(jo)),u!==n&&(u=yo()),c=u,c===n&&(c=m,i.substr(m,4)===Xs?(u=Xs,m+=4):(u=n,R===0&&F(wo)),u!==n&&(u=bo()),c=u,c===n&&(c=m,i.substr(m,4)===Zs?(u=Zs,m+=4):(u=n,R===0&&F(So)),u!==n&&(u=$o()),c=u,c===n)))){if(c=m,i.substr(m,3)===en?(u=en,m+=3):(u=n,R===0&&F(Co)),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=me(),x!==n?(u=No(x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n){if(c=m,i.substr(m,3)===tn?(u=tn,m+=3):(u=n,R===0&&F(ko)),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=me(),x!==n?(u=Eo(x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n){if(c=m,i.substr(m,2)===sn?(u=sn,m+=2):(u=n,R===0&&F(To)),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=me(),x!==n?(u=Ro(x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n){if(c=m,i.substr(m,2)===nn?(u=nn,m+=2):(u=n,R===0&&F(Ao)),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=me(),x!==n?(u=rn(x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;c===n&&(c=m,i.substr(m,10)===on?(u=on,m+=10):(u=n,R===0&&F(Do)),u!==n&&(u=Fo()),c=u,c===n&&(c=m,u=me(),u!==n&&(u=rn(u)),c=u))}}}}}}}}}}}}}}}}}return c}function nl(){var c,u,v,x;if(R++,c=m,ln.test(i.charAt(m))?(u=i.charAt(m),m++):(u=n,R===0&&F(cn)),u===n&&(u=null),u!==n){if(v=[],an.test(i.charAt(m))?(x=i.charAt(m),m++):(x=n,R===0&&F(dn)),x!==n)for(;x!==n;)v.push(x),an.test(i.charAt(m))?(x=i.charAt(m),m++):(x=n,R===0&&F(dn));else v=n;v!==n?(ln.test(i.charAt(m))?(x=i.charAt(m),m++):(x=n,R===0&&F(cn)),x===n&&(x=null),x!==n?(u=Lo(v),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;return R--,c===n&&(u=n,R===0&&F(Io)),c}function me(){var c,u,v,x;if(R++,c=m,i.charCodeAt(m)===34?(u=un,m++):(u=n,R===0&&F(fn)),u!==n){for(v=[],x=jn();x!==n;)v.push(x),x=jn();v!==n?(i.charCodeAt(m)===34?(x=un,m++):(x=n,R===0&&F(fn)),x!==n?(u=ts(v),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n){if(c=m,i.charCodeAt(m)===39?(u=pn,m++):(u=n,R===0&&F(hn)),u!==n){for(v=[],x=yn();x!==n;)v.push(x),x=yn();v!==n?(i.charCodeAt(m)===39?(x=pn,m++):(x=n,R===0&&F(hn)),x!==n?(u=ts(v),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n)if(c=m,u=m,R++,v=el(),R--,v===n?u=void 0:(m=u,u=n),u!==n){if(v=[],x=wn(),x!==n)for(;x!==n;)v.push(x),x=wn();else v=n;v!==n?(u=ts(v),c=u):(m=c,c=n)}else m=c,c=n}return R--,c===n&&(u=n,R===0&&F(Po)),c}function jn(){var c,u,v;return c=m,u=m,R++,Oo.test(i.charAt(m))?(v=i.charAt(m),m++):(v=n,R===0&&F(Mo)),R--,v===n?u=void 0:(m=u,u=n),u!==n?(i.length>m?(v=i.charAt(m),m++):(v=n,R===0&&F(ss)),v!==n?(u=xt(v),c=u):(m=c,c=n)):(m=c,c=n),c===n&&(c=m,i.charCodeAt(m)===92?(u=mn,m++):(u=n,R===0&&F(gn)),u!==n?(v=bn(),v!==n?(u=xt(v),c=u):(m=c,c=n)):(m=c,c=n)),c}function yn(){var c,u,v;return c=m,u=m,R++,qo.test(i.charAt(m))?(v=i.charAt(m),m++):(v=n,R===0&&F(Ho)),R--,v===n?u=void 0:(m=u,u=n),u!==n?(i.length>m?(v=i.charAt(m),m++):(v=n,R===0&&F(ss)),v!==n?(u=xt(v),c=u):(m=c,c=n)):(m=c,c=n),c===n&&(c=m,i.charCodeAt(m)===92?(u=mn,m++):(u=n,R===0&&F(gn)),u!==n?(v=bn(),v!==n?(u=xt(v),c=u):(m=c,c=n)):(m=c,c=n)),c}function wn(){var c,u,v;return c=m,u=m,R++,v=K(),R--,v===n?u=void 0:(m=u,u=n),u!==n?(i.length>m?(v=i.charAt(m),m++):(v=n,R===0&&F(ss)),v!==n?(u=xt(v),c=u):(m=c,c=n)):(m=c,c=n),c}function bn(){var c,u;return Vo.test(i.charAt(m))?(c=i.charAt(m),m++):(c=n,R===0&&F(Uo)),c===n&&(c=m,i.charCodeAt(m)===110?(u=Bo,m++):(u=n,R===0&&F(Wo)),u!==n&&(u=Ko()),c=u,c===n&&(c=m,i.charCodeAt(m)===114?(u=zo,m++):(u=n,R===0&&F(Go)),u!==n&&(u=Yo()),c=u,c===n&&(c=m,i.charCodeAt(m)===116?(u=Jo,m++):(u=n,R===0&&F(Qo)),u!==n&&(u=Xo()),c=u))),c}function il(c,u){function v(){return c.apply(this,arguments)||u.apply(this,arguments)}return v.desc=c.desc+" or "+u.desc,v}function rl(c,u){function v(){return c.apply(this,arguments)&&u.apply(this,arguments)}return v.desc=c.desc+" and "+u.desc,v}function ol(c){function u(){return!c.apply(this,arguments)}return u.desc="not "+c.desc,u}function ll(c){function u(){return c.apply(this,arguments)}return u.desc="("+c.desc+")",u}function Sn(c){return!0}Sn.desc="all flows";var $n=[new RegExp("text/javascript"),new RegExp("application/x-javascript"),new RegExp("application/javascript"),new RegExp("text/css"),new RegExp("image/.*"),new RegExp("font/.*"),new RegExp("application/font.*")];function Cn(c){if(c.response){for(var u=mt.getContentType(c.response),v=$n.length;v--;)if($n[v].test(u))return!0}return!1}Cn.desc="is asset";function cl(c){c=new RegExp(c,"i");function u(v){return!0}return u.desc="body matches "+c,u}function al(c){c=new RegExp(c,"i");function u(v){return!0}return u.desc="body request matches "+c,u}function dl(c){c=new RegExp(c,"i");function u(v){return!0}return u.desc="body response matches "+c,u}function ul(c){function u(v){return v.response&&v.response.status_code===c}return u.desc="resp. code is "+c,u}function fl(c){c=new RegExp(c,"i");function u(v){return c.test(v.comment)}return u.desc="comment matches "+c,u}function pl(c){c=new RegExp(c,"i");function u(v){return v.request&&(c.test(v.request.host)||c.test(v.request.pretty_host))}return u.desc="domain matches "+c,u}function Nn(c){return c.type==="dns"}Nn.desc="is a DNS Flow";function hl(c){c=new RegExp(c,"i");function u(v){return!!v.server_conn.address&&c.test(v.server_conn.address[0]+":"+v.server_conn.address[1])}return u.desc="destination address matches "+c,u}function kn(c){return!!c.error}kn.desc="has error";function ml(c){c=new RegExp(c,"i");function u(v){return v.request&&ct.match_header(v.request,c)||v.response&&mt.match_header(v.response,c)}return u.desc="header matches "+c,u}function gl(c){c=new RegExp(c,"i");function u(v){return v.request&&ct.match_header(v.request,c)}return u.desc="req. header matches "+c,u}function vl(c){c=new RegExp(c,"i");function u(v){return v.response&&mt.match_header(v.response,c)}return u.desc="resp. header matches "+c,u}function En(c){return c.type==="http"}En.desc="is an HTTP Flow";function Tn(c){return c.marked}Tn.desc="is marked";function xl(c){c=new RegExp(c,"i");function u(v){return c.test(v.marked)}return u.desc="marker matches "+c,u}function _l(c){c=new RegExp(c,"i");function u(v){return v.request&&c.test(v.request.method)}return u.desc="method matches "+c,u}function Rn(c){return c.request&&!c.response}Rn.desc="has no response";function An(c){return c.is_replay==="request"}An.desc="request has been replayed";function Dn(c){return c.is_replay==="response"}Dn.desc="response has been replayed";function Fn(c){return!!c.is_replay}Fn.desc="flow has been replayed";function jl(c){c=new RegExp(c,"i");function u(v){return!!v.client_conn.peername&&c.test(v.client_conn.peername[0]+":"+v.client_conn.peername[1])}return u.desc="source address matches "+c,u}function In(c){return!!c.response}In.desc="has response";function Ln(c){return c.type==="tcp"}Ln.desc="is a TCP Flow";function Pn(c){return c.type==="udp"}Pn.desc="is a UDP Flow";function yl(c){c=new RegExp(c,"i");function u(v){return v.request&&c.test(ct.getContentType(v.request))}return u.desc="req. content type matches "+c,u}function wl(c){c=new RegExp(c,"i");function u(v){return v.response&&c.test(mt.getContentType(v.response))}return u.desc="resp. content type matches "+c,u}function bl(c){c=new RegExp(c,"i");function u(v){return v.request&&c.test(ct.getContentType(v.request))||v.response&&c.test(mt.getContentType(v.response))}return u.desc="content type matches "+c,u}function Sl(c){c=new RegExp(c,"i");function u(v){if(v.type==="dns"){const x=v.request?.questions[0];return x&&c.test(x.name)}return v.request&&c.test(ct.pretty_url(v.request))}return u.desc="url matches "+c,u}function On(c){return!!c.websocket}if(On.desc="is a Websocket Flow",Ft=a(),Ft!==n&&m===i.length)return Ft;throw Ft!==n&&m<i.length&&F({type:"end",description:"end of input"}),Zo(null,ns,qe<i.length?i.charAt(qe):null,qe<i.length?xn(qe,qe+1):xn(qe,qe))}return{SyntaxError:e,parse:s}}();class Ye extends I.Component{static xhr;static doc;constructor(e,s){super(e,s),this.state={doc:Ye.doc}}componentDidMount(){Ye.xhr||(Ye.xhr=ne("/filter-help").then(e=>e.json()),Ye.xhr.catch(()=>{Ye.xhr=null})),this.state.doc||Ye.xhr.then(e=>{Ye.doc=e,this.setState({doc:e})})}render(){const{doc:e}=this.state;return e?o.jsx("table",{className:"table table-condensed",children:o.jsxs("tbody",{children:[e.commands.map(s=>o.jsxs("tr",{onClick:()=>this.props.selectHandler(s[0].split(" ")[0]+" "),children:[o.jsx("td",{children:s[0].replace(" "," ")}),o.jsx("td",{children:s[1]})]},s[1])),o.jsx("tr",{children:o.jsx("td",{colSpan:2,children:o.jsxs("a",{href:"https://mitmproxy.org/docs/latest/concepts-filters/",target:"_blank",rel:"noreferrer",children:[o.jsx("i",{className:"fa fa-external-link"})," mitmproxy docs"]})})},"docs-link")]})}):o.jsx("i",{className:"fa fa-spinner fa-spin"})}}var Xt=(t=>(t.SEARCH="search",t.HIGHLIGHT="tag",t.INTERCEPT="pause",t))(Xt||{});class Hs extends I.Component{inputRef=Te.createRef();constructor(e,s){super(e,s),this.state={value:this.props.value,focus:!1,mousefocus:!1},this.onChange=this.onChange.bind(this),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onMouseEnter=this.onMouseEnter.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this),this.selectFilter=this.selectFilter.bind(this)}UNSAFE_componentWillReceiveProps(e){this.setState({value:e.value})}isValid(e){try{return e&&oi.parse(e),!0}catch{return!1}}getDesc(){if(!this.state.value)return o.jsx(Ye,{selectHandler:this.selectFilter});try{return oi.parse(this.state.value).desc}catch(e){return""+e}}onChange(e){const s=e.target.value;this.setState({value:s}),this.isValid(s)&&this.props.onChange(s)}onFocus(){this.setState({focus:!0})}onBlur(){this.setState({focus:!1})}onMouseEnter(){this.setState({mousefocus:!0})}onMouseLeave(){this.setState({mousefocus:!1})}onKeyDown(e){(e.key==="Escape"||e.key==="Enter")&&(this.blur(),this.setState({mousefocus:!1})),e.stopPropagation()}selectFilter(e){this.setState({value:e}),this.inputRef.current?.focus(),this.isValid(e)&&this.props.onChange(e)}blur(){this.inputRef.current?.blur()}select(){this.inputRef.current?.select()}render(){const{icon:e,color:s,placeholder:i}=this.props,{value:r,focus:n,mousefocus:l}=this.state;return o.jsxs("div",{className:je("filter-input input-group",{"has-error":!this.isValid(r)}),children:[o.jsx("span",{className:"input-group-addon",children:o.jsx("i",{className:"fa fa-fw fa-"+e,style:{color:s}})}),o.jsx("input",{type:"text",ref:this.inputRef,placeholder:i,className:"form-control",value:r,onChange:this.onChange,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown}),(n||l)&&o.jsxs("div",{className:"popover bottom",onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,children:[o.jsx("div",{className:"arrow"}),o.jsx("div",{className:"popover-content",children:this.getDesc()})]})]})}}Zr.title="Flow List";function Zr(){const t=k.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsxs("div",{className:"menu-group",children:[o.jsxs("div",{className:"menu-content",children:[o.jsx(ju,{}),o.jsx(wu,{})]}),o.jsx("div",{className:"menu-legend",children:"Find"})]}),t[0]=e):e=t[0];let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsxs("div",{className:"main-menu",children:[e,o.jsxs("div",{className:"menu-group",children:[o.jsxs("div",{className:"menu-content",children:[o.jsx(xu,{}),o.jsx(Su,{})]}),o.jsx("div",{className:"menu-legend",children:"Intercept"})]})]}),t[1]=s):s=t[1],s}function xu(){const t=k.c(5),e=G(),i=D(_u)||"";let r;t[0]!==e?(r=l=>e(Cs("intercept",l)),t[0]=e,t[1]=r):r=t[1];let n;return t[2]!==i||t[3]!==r?(n=o.jsx(Hs,{value:i,placeholder:"Intercept",icon:Xt.INTERCEPT,color:"hsl(208, 56%, 53%)",onChange:r}),t[2]=i,t[3]=r,t[4]=n):n=t[4],n}function _u(t){return t.options.intercept}function ju(){const t=k.c(5),e=G(),s=D(yu);let i;t[0]!==e?(i=n=>e(Ri(n)),t[0]=e,t[1]=i):i=t[1];let r;return t[2]!==i||t[3]!==s?(r=o.jsx(Hs,{value:s,placeholder:"Search",icon:Xt.SEARCH,color:"black",onChange:i}),t[2]=i,t[3]=s,t[4]=r):r=t[4],r}function yu(t){return t.ui.filter[ve.Search]}function wu(){const t=k.c(5),e=G(),s=D(bu);let i;t[0]!==e?(i=n=>e(Ai(n)),t[0]=e,t[1]=i):i=t[1];let r;return t[2]!==i||t[3]!==s?(r=o.jsx(Hs,{value:s,placeholder:"Highlight",icon:Xt.HIGHLIGHT,color:"hsl(48, 100%, 50%)",onChange:i}),t[2]=i,t[3]=s,t[4]=r):r=t[4],r}function bu(t){return t.ui.filter[ve.Highlight]}function Su(){const t=k.c(2),e=G();let s;return t[0]!==e?(s=o.jsx(pe,{className:"btn-sm",title:"[a]ccept all",icon:"fa-forward text-success",onClick:()=>e(Di()),children:"Resume All"}),t[0]=e,t[1]=s):s=t[1],s}function Vs(t){const e=k.c(6),{value:s,onChange:i,children:r}=t;let n;e[0]!==i||e[1]!==s?(n=o.jsx("input",{type:"checkbox",checked:s,onChange:i}),e[0]=i,e[1]=s,e[2]=n):n=e[2];let l;return e[3]!==r||e[4]!==n?(l=o.jsx("div",{className:"menu-entry",children:o.jsxs("label",{children:[n,r]})}),e[3]=r,e[4]=n,e[5]=l):l=e[5],l}function cs(t){const e=k.c(10),{name:s,children:i}=t,r=G();let n;e[0]!==s?(n=p=>p.options[s],e[0]=s,e[1]=n):n=e[1];const l=D(n),a=!!l;let d;e[2]!==r||e[3]!==s||e[4]!==l?(d=()=>r(Cs(s,!l)),e[2]=r,e[3]=s,e[4]=l,e[5]=d):d=e[5];let f;return e[6]!==i||e[7]!==a||e[8]!==d?(f=o.jsx(Vs,{value:a,onChange:d,children:i}),e[6]=i,e[7]=a,e[8]=d,e[9]=f):f=e[9],f}function $u(){const t=k.c(5),e=G(),s=D(Cu);let i;t[0]!==e?(i=()=>e(Gt()),t[0]=e,t[1]=i):i=t[1];let r;return t[2]!==i||t[3]!==s?(r=o.jsx(Vs,{value:s,onChange:i,children:"Display Event Log"}),t[2]=i,t[3]=s,t[4]=r):r=t[4],r}function Cu(t){return t.eventLog.visible}function Nu(){const t=k.c(5),e=G(),s=D(ku);let i;t[0]!==e?(i=()=>e(Ji()),t[0]=e,t[1]=i):i=t[1];let r;return t[2]!==i||t[3]!==s?(r=o.jsx(Vs,{value:s,onChange:i,children:"Display Command Bar"}),t[2]=i,t[3]=s,t[4]=r):r=t[4],r}function ku(t){return t.commandBar.visible}function as(t){const e=k.c(5),{children:s,resource:i}=t,r=`https://docs.mitmproxy.org/stable/${i}`;let n;e[0]!==s?(n=s||o.jsx("i",{className:"fa fa-question-circle"}),e[0]=s,e[1]=n):n=e[1];let l;return e[2]!==n||e[3]!==r?(l=o.jsx("a",{target:"_blank",href:r,rel:"noreferrer",children:n}),e[2]=n,e[3]=r,e[4]=l):l=e[4],l}eo.title="Options";function eo(){const t=k.c(16),e=G(),s=Eu;let i;t[0]!==e?(i=()=>e(s()),t[0]=e,t[1]=i):i=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("sup",{children:"alpha"}),t[2]=r):r=t[2];let n;t[3]!==i?(n=o.jsx("div",{className:"menu-content",children:o.jsxs(pe,{title:"Open Options",icon:"fa-cogs text-primary",onClick:i,children:["Edit Options ",r]})}),t[3]=i,t[4]=n):n=t[4];let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx("div",{className:"menu-legend",children:"Options Editor"}),t[5]=l):l=t[5];let a;t[6]!==n?(a=o.jsxs("div",{className:"menu-group",children:[n,l]}),t[6]=n,t[7]=a):a=t[7];let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsxs(cs,{name:"anticache",children:["Strip cache headers"," ",o.jsx(as,{resource:"overview/features/#anticache"})]}),t[8]=d):d=t[8];let f;t[9]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsxs(cs,{name:"showhost",children:["Use host header for display"," ",o.jsx(as,{resource:"concepts/options/#showhost"})]}),t[9]=f):f=t[9];let p;t[10]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsxs("div",{className:"menu-group",children:[o.jsxs("div",{className:"menu-content",children:[d,f,o.jsxs(cs,{name:"ssl_insecure",children:["Don't verify server certificates"," ",o.jsx(as,{resource:"concepts/options/#ssl_insecure"})]})]}),o.jsx("div",{className:"menu-legend",children:"Quick Options"})]}),t[10]=p):p=t[10];let h;t[11]!==a?(h=o.jsxs(gt,{children:[a,p]}),t[11]=a,t[12]=h):h=t[12];let g;t[13]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsxs("div",{className:"menu-group",children:[o.jsxs("div",{className:"menu-content",children:[o.jsx($u,{}),o.jsx(Nu,{})]}),o.jsx("div",{className:"menu-legend",children:"View Options"})]}),t[13]=g):g=t[13];let _;return t[14]!==h?(_=o.jsxs("div",{children:[h,g]}),t[14]=h,t[15]=_):_=t[15],_}function Eu(){return dc("OptionModal")}const yt=async(t,e)=>{const s=(async()=>{const i=await Bt("export",e,`@${t.id}`);if(i.value)return i.value;throw i.error?i.error:i})();try{await gi(s)}catch(i){alert(i)}};to.title="Flow";function to(){const t=k.c(63),e=G(),s=D(Tu),i=s[0];let r;t[0]!==s?(r=s.some(_s),t[0]=s,t[1]=r):r=t[1];const n=r;if(s.length===0){let X;return t[2]===Symbol.for("react.memo_cache_sentinel")?(X=o.jsx("div",{}),t[2]=X):X=t[2],X}let l;t[3]!==e||t[4]!==s?(l=()=>e(ws(s)),t[3]=e,t[4]=s,t[5]=l):l=t[5];let a;t[6]!==s?(a=s.some(xs),t[6]=s,t[7]=a):a=t[7];const d=!a;let f;t[8]!==l||t[9]!==d?(f=o.jsx(pe,{title:"[r]eplay flow",icon:"fa-repeat text-primary",onClick:l,disabled:d,children:"Replay"}),t[8]=l,t[9]=d,t[10]=f):f=t[10];let p;t[11]!==e||t[12]!==s?(p=o.jsx(pe,{title:"[D]uplicate flow",icon:"fa-copy text-info",onClick:()=>e(Li(s)),children:"Duplicate"}),t[11]=e,t[12]=s,t[13]=p):p=t[13];let h;t[14]!==s?(h=s.some(bi),t[14]=s,t[15]=h):h=t[15];const g=!h;let _;t[16]!==e||t[17]!==s?(_=()=>e(Pi(s)),t[16]=e,t[17]=s,t[18]=_):_=t[18];let j;t[19]!==g||t[20]!==_?(j=o.jsx(pe,{disabled:g,title:"revert changes to flow [V]",icon:"fa-history text-warning",onClick:_,children:"Revert"}),t[19]=g,t[20]=_,t[21]=j):j=t[21];let y;t[22]!==e||t[23]!==s?(y=o.jsx(pe,{title:"[d]elete flow",icon:"fa-trash text-danger",onClick:()=>{e(Ii(s))},children:"Delete"}),t[22]=e,t[23]=s,t[24]=y):y=t[24];let w;t[25]!==s?(w=o.jsx(Mu,{flows:s}),t[25]=s,t[26]=w):w=t[26];let $;t[27]!==y||t[28]!==w||t[29]!==f||t[30]!==p||t[31]!==j?($=o.jsxs("div",{className:"menu-content",children:[f,p,j,y,w]}),t[27]=y,t[28]=w,t[29]=f,t[30]=p,t[31]=j,t[32]=$):$=t[32];let N;t[33]===Symbol.for("react.memo_cache_sentinel")?(N=o.jsx("div",{className:"menu-legend",children:"Flow Modification"}),t[33]=N):N=t[33];let E;t[34]!==$?(E=o.jsx(gt,{children:o.jsxs("div",{className:"menu-group",children:[$,N]})}),t[34]=$,t[35]=E):E=t[35];let T;t[36]!==i?(T=o.jsxs("div",{className:"menu-content",children:[o.jsx(Ru,{flow:i}),o.jsx(Iu,{flow:i})]}),t[36]=i,t[37]=T):T=t[37];let P;t[38]===Symbol.for("react.memo_cache_sentinel")?(P=o.jsx("div",{className:"menu-legend",children:"Export"}),t[38]=P):P=t[38];let L;t[39]!==T?(L=o.jsxs("div",{className:"menu-group",children:[T,P]}),t[39]=T,t[40]=L):L=t[40];const O=!n;let M;t[41]!==e||t[42]!==s?(M=()=>e(ys(s)),t[41]=e,t[42]=s,t[43]=M):M=t[43];let U;t[44]!==O||t[45]!==M?(U=o.jsx(pe,{disabled:O,title:"[a]ccept intercepted flow",icon:"fa-play text-success",onClick:M,children:"Resume"}),t[44]=O,t[45]=M,t[46]=U):U=t[46];const V=!n;let W;t[47]!==e||t[48]!==s?(W=()=>e(Fi(s)),t[47]=e,t[48]=s,t[49]=W):W=t[49];let J;t[50]!==V||t[51]!==W?(J=o.jsx(pe,{disabled:V,title:"kill intercepted flow [x]",icon:"fa-times text-danger",onClick:W,children:"Abort"}),t[50]=V,t[51]=W,t[52]=J):J=t[52];let z;t[53]!==U||t[54]!==J?(z=o.jsxs("div",{className:"menu-content",children:[U,J]}),t[53]=U,t[54]=J,t[55]=z):z=t[55];let te;t[56]===Symbol.for("react.memo_cache_sentinel")?(te=o.jsx("div",{className:"menu-legend",children:"Interception"}),t[56]=te):te=t[56];let Y;t[57]!==z?(Y=o.jsx(gt,{children:o.jsxs("div",{className:"menu-group",children:[z,te]})}),t[57]=z,t[58]=Y):Y=t[58];let Q;return t[59]!==E||t[60]!==L||t[61]!==Y?(Q=o.jsxs("div",{className:"flow-menu",children:[E,L,Y]}),t[59]=E,t[60]=L,t[61]=Y,t[62]=Q):Q=t[62],Q}function Tu(t){return t.flows.selected}const qt=t=>{const e=window.open(t,"_blank","noopener,noreferrer");e&&(e.opener=null)};function Ru(t){const e=k.c(24),{flow:s}=t,i=D(Fu);if(s.type!=="http"){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(pe,{icon:"fa-download",onClick:Du,disabled:!0,children:"Download"}),e[0]=r):r=e[0],r}if(s.request.contentLength&&!s.response?.contentLength){let r;e[1]!==s?(r=()=>qt(we.getContentURL(s,s.request)),e[1]=s,e[2]=r):r=e[2];const n=!i;let l;return e[3]!==r||e[4]!==n?(l=o.jsx(pe,{icon:"fa-download",onClick:r,disabled:n,children:"Download"}),e[3]=r,e[4]=n,e[5]=l):l=e[5],l}if(s.response){const r=s.response;if(!s.request.contentLength&&s.response.contentLength){let n;e[6]!==s||e[7]!==r?(n=()=>qt(we.getContentURL(s,r)),e[6]=s,e[7]=r,e[8]=n):n=e[8];const l=!i;let a;return e[9]!==n||e[10]!==l?(a=o.jsx(pe,{icon:"fa-download",onClick:n,disabled:l,children:"Download"}),e[9]=n,e[10]=l,e[11]=a):a=e[11],a}if(s.request.contentLength&&s.response.contentLength){const n=!i;let l;e[12]!==n?(l=o.jsx(pe,{icon:"fa-download",onClick:Au,disabled:n,children:"Download▾"}),e[12]=n,e[13]=l):l=e[13];let a;e[14]===Symbol.for("react.memo_cache_sentinel")?(a={placement:"bottom-start"},e[14]=a):a=e[14];let d;e[15]!==s?(d=o.jsx(ke,{onClick:()=>qt(we.getContentURL(s,s.request)),children:"Download request"}),e[15]=s,e[16]=d):d=e[16];let f;e[17]!==s||e[18]!==r?(f=o.jsx(ke,{onClick:()=>qt(we.getContentURL(s,r)),children:"Download response"}),e[17]=s,e[18]=r,e[19]=f):f=e[19];let p;return e[20]!==l||e[21]!==d||e[22]!==f?(p=o.jsxs(Et,{text:l,options:a,children:[d,f]}),e[20]=l,e[21]=d,e[22]=f,e[23]=p):p=e[23],p}}return null}function Au(){return 1}function Du(){return 0}function Fu(t){return t.flows.selected.length===1}function Iu(t){const e=k.c(20),{flow:s}=t,i=D(Pu),r=s.type!=="http"||!i;let n;e[0]!==r?(n=o.jsx(pe,{title:"Export flow.",icon:"fa-clone",onClick:Lu,disabled:r,children:"Export▾"}),e[0]=r,e[1]=n):n=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l={placement:"bottom-start"},e[2]=l):l=e[2];let a;e[3]!==s?(a=o.jsx(ke,{onClick:()=>yt(s,"raw_request"),children:"Copy raw request"}),e[3]=s,e[4]=a):a=e[4];let d;e[5]!==s?(d=o.jsx(ke,{onClick:()=>yt(s,"raw_response"),children:"Copy raw response"}),e[5]=s,e[6]=d):d=e[6];let f;e[7]!==s?(f=o.jsx(ke,{onClick:()=>yt(s,"raw"),children:"Copy raw request and response"}),e[7]=s,e[8]=f):f=e[8];let p;e[9]!==s?(p=o.jsx(ke,{onClick:()=>yt(s,"curl"),children:"Copy as cURL"}),e[9]=s,e[10]=p):p=e[10];let h;e[11]!==s?(h=o.jsx(ke,{onClick:()=>yt(s,"httpie"),children:"Copy as HTTPie"}),e[11]=s,e[12]=h):h=e[12];let g;return e[13]!==n||e[14]!==a||e[15]!==d||e[16]!==f||e[17]!==p||e[18]!==h?(g=o.jsxs(Et,{className:"",text:n,options:l,children:[a,d,f,p,h]}),e[13]=n,e[14]=a,e[15]=d,e[16]=f,e[17]=p,e[18]=h,e[19]=g):g=e[19],g}function Lu(){return 1}function Pu(t){return t.flows.selected.length===1}const Ou={":red_circle:":"🔴",":orange_circle:":"🟠",":yellow_circle:":"🟡",":green_circle:":"🟢",":large_blue_circle:":"🔵",":purple_circle:":"🟣",":brown_circle:":"🟤"};function Mu(t){const e=k.c(5),{flows:s}=t,i=G();let r,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(pe,{title:"mark flow",icon:"fa-paint-brush text-success",onClick:qu,children:"Mark▾"}),n={placement:"bottom-start"},e[0]=r,e[1]=n):(r=e[0],n=e[1]);let l;return e[2]!==i||e[3]!==s?(l=o.jsxs(Et,{className:"",text:r,options:n,children:[o.jsx(ke,{onClick:()=>i(Kn(s,"")),children:"⚪ (no marker)"}),Object.entries(Ou).map(a=>{const[d,f]=a;return o.jsxs(ke,{onClick:()=>i(Kn(s,d)),children:[f," ",d.replace(/[:_]/g," ")]},d)})]}),e[2]=i,e[3]=s,e[4]=l):l=e[4],l}function qu(){return 1}const li={[xe.Capture]:Xr,[xe.FlowList]:Zr,[xe.Options]:eo,[xe.Flow]:to};function Hu(){const t=k.c(26),e=G(),s=D(Uu),i=D(Vu),[r,n]=I.useState(!1);let l;t[0]!==i.length?(l=[xe.Capture,xe.FlowList,xe.Options],i.length>0&&l.push(xe.Flow),t[0]=i.length,t[1]=l):l=t[1];let a;t[2]!==s||t[3]!==e||t[4]!==i.length||t[5]!==r?(a=()=>{i.length>0&&!r?(e(Vt(xe.Flow)),n(!0)):i.length===0&&(r&&n(!1),s===xe.Flow&&e(Vt(xe.FlowList)))},t[2]=s,t[3]=e,t[4]=i.length,t[5]=r,t[6]=a):a=t[6];let d;t[7]!==s||t[8]!==i||t[9]!==r?(d=[i,r,s],t[7]=s,t[8]=i,t[9]=r,t[10]=d):d=t[10],I.useEffect(a,d);let f;t[11]!==e?(f=function(E,T){T.preventDefault(),e(Vt(E))},t[11]=e,t[12]=f):f=t[12];const p=f,h=li[s];let g;t[13]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx(uu,{}),t[13]=g):g=t[13];let _;t[14]!==s||t[15]!==l||t[16]!==p?(_=l.map(N=>o.jsx("a",{href:"#",className:je({active:N===s}),onClick:E=>p(N,E),children:li[N].title},N)),t[14]=s,t[15]=l,t[16]=p,t[17]=_):_=t[17];let j;t[18]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(gt,{children:o.jsx(mu,{})}),t[18]=j):j=t[18];let y;t[19]!==_?(y=o.jsxs("nav",{className:"nav-tabs nav-tabs-lg",children:[g,_,j]}),t[19]=_,t[20]=y):y=t[20];let w;t[21]!==h?(w=o.jsx("div",{children:o.jsx(h,{})}),t[21]=h,t[22]=w):w=t[22];let $;return t[23]!==y||t[24]!==w?($=o.jsxs("header",{children:[y,w]}),t[23]=y,t[24]=w,t[25]=$):$=t[25],$}function Vu(t){return t.flows.selected}function Uu(t){return t.ui.tabs.current}const ds=function(){function t(i,r){function n(){this.constructor=i}n.prototype=r.prototype,i.prototype=new n}function e(i,r,n,l){this.message=i,this.expected=r,this.found=n,this.location=l,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,e)}t(e,Error);function s(i){var r=arguments.length>1?arguments[1]:{},n={},l={Expr:Re},a=Re,d=function(b,S){return[b,...S]},f=function(b){return[b]},p=function(){return""},h={type:"other",description:"string"},g='"',_={type:"literal",value:'"',description:'"\\""'},j=function(b){return b.join("")},y="'",w={type:"literal",value:"'",description:`"'"`},$=/^["\\]/,N={type:"class",value:'["\\\\]',description:'["\\\\]'},E={type:"any",description:"any character"},T=function(b){return b},P="\\",L={type:"literal",value:"\\",description:'"\\\\"'},O=/^['\\]/,M={type:"class",value:"['\\\\]",description:"['\\\\]"},U=/^['"\\]/,V={type:"class",value:`['"\\\\]`,description:`['"\\\\]`},W="n",J={type:"literal",value:"n",description:'"n"'},z=function(){return` |
| 6 | `},te="r",Y={type:"literal",value:"r",description:'"r"'},Q=function(){return"\r"},X="t",Z={type:"literal",value:"t",description:'"t"'},ae=function(){return" "},le={type:"other",description:"whitespace"},de=/^[ \t\n\r]/,ye={type:"class",value:"[ \\t\\n\\r]",description:"[ \\t\\n\\r]"},Pe={type:"other",description:"control character"},Se=/^[|&!()~"]/,Ee={type:"class",value:'[|&!()~"]',description:'[|&!()~"]'},C=0,he=[{line:1,column:1,seenCR:!1}],B=0,oe=[],q=0,$e;if("startRule"in r){if(!(r.startRule in l))throw new Error(`Can't start parsing from rule "`+r.startRule+'".');a=l[r.startRule]}function We(b){var S=he[b],A,H;if(S)return S;for(A=b-1;!he[A];)A--;for(S=he[A],S={line:S.line,column:S.column,seenCR:S.seenCR};A<b;)H=i.charAt(A),H===` |
| 7 | `?(S.seenCR||S.line++,S.column=1,S.seenCR=!1):H==="\r"||H==="\u2028"||H==="\u2029"?(S.line++,S.column=1,S.seenCR=!0):(S.column++,S.seenCR=!1),A++;return he[b]=S,S}function Oe(b,S){var A=We(b),H=We(S);return{start:{offset:b,line:A.line,column:A.column},end:{offset:S,line:H.line,column:H.column}}}function ee(b){C<B||(C>B&&(B=C,oe=[]),oe.push(b))}function Me(b,S,A,H){function Tt(Ce){var De=1;for(Ce.sort(function(ut,Ke){return ut.description<Ke.description?-1:ut.description>Ke.description?1:0});De<Ce.length;)Ce[De-1]===Ce[De]?Ce.splice(De,1):De++}function es(Ce,De){function ut(At){function ft(Fe){return Fe.charCodeAt(0).toString(16).toUpperCase()}return At.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(Fe){return"\\x0"+ft(Fe)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(Fe){return"\\x"+ft(Fe)}).replace(/[\u0100-\u0FFF]/g,function(Fe){return"\\u0"+ft(Fe)}).replace(/[\u1000-\uFFFF]/g,function(Fe){return"\\u"+ft(Fe)})}var Ke=new Array(Ce.length),vt,Rt,it;for(it=0;it<Ce.length;it++)Ke[it]=Ce[it].description;return vt=Ce.length>1?Ke.slice(0,-1).join(", ")+" or "+Ke[Ce.length-1]:Ke[0],Rt=De?'"'+ut(De)+'"':"end of input","Expected "+vt+" but "+Rt+" found."}return S!==null&&Tt(S),new e(es(S,A),S,A,H)}function Re(){var b,S,A,H;if(b=C,S=re(),S!==n){if(A=[],H=Je(),H!==n)for(;H!==n;)A.push(H),H=Je();else A=n;A!==n?(H=Re(),H!==n?(S=d(S,H),b=S):(C=b,b=n)):(C=b,b=n)}else C=b,b=n;if(b===n&&(b=C,S=re(),S!==n&&(S=f(S)),b=S,b===n)){for(b=C,S=[],A=Je();A!==n;)S.push(A),A=Je();S!==n&&(S=p()),b=S}return b}function re(){var b,S,A,H;if(q++,b=C,i.charCodeAt(C)===34?(S=g,C++):(S=n,q===0&&ee(_)),S!==n){for(A=[],H=ue();H!==n;)A.push(H),H=ue();A!==n?(i.charCodeAt(C)===34?(H=g,C++):(H=n,q===0&&ee(_)),H!==n?(S=j(A),b=S):(C=b,b=n)):(C=b,b=n)}else C=b,b=n;if(b===n){if(b=C,i.charCodeAt(C)===39?(S=y,C++):(S=n,q===0&&ee(w)),S!==n){for(A=[],H=ge();H!==n;)A.push(H),H=ge();A!==n?(i.charCodeAt(C)===39?(H=y,C++):(H=n,q===0&&ee(w)),H!==n?(S=j(A),b=S):(C=b,b=n)):(C=b,b=n)}else C=b,b=n;if(b===n){if(b=C,S=C,q++,A=Zt(),q--,A===n?S=void 0:(C=S,S=n),S!==n){if(A=[],H=Ae(),H!==n)for(;H!==n;)A.push(H),H=Ae();else A=n;A!==n?(S=j(A),b=S):(C=b,b=n)}else C=b,b=n;if(b===n){if(b=C,i.charCodeAt(C)===34?(S=g,C++):(S=n,q===0&&ee(_)),S!==n){for(A=[],H=ue();H!==n;)A.push(H),H=ue();A!==n?(S=j(A),b=S):(C=b,b=n)}else C=b,b=n;if(b===n)if(b=C,i.charCodeAt(C)===39?(S=y,C++):(S=n,q===0&&ee(w)),S!==n){for(A=[],H=ge();H!==n;)A.push(H),H=ge();A!==n?(S=j(A),b=S):(C=b,b=n)}else C=b,b=n}}}return q--,b===n&&(S=n,q===0&&ee(h)),b}function ue(){var b,S,A;return b=C,S=C,q++,$.test(i.charAt(C))?(A=i.charAt(C),C++):(A=n,q===0&&ee(N)),q--,A===n?S=void 0:(C=S,S=n),S!==n?(i.length>C?(A=i.charAt(C),C++):(A=n,q===0&&ee(E)),A!==n?(S=T(A),b=S):(C=b,b=n)):(C=b,b=n),b===n&&(b=C,i.charCodeAt(C)===92?(S=P,C++):(S=n,q===0&&ee(L)),S!==n?(A=nt(),A!==n?(S=T(A),b=S):(C=b,b=n)):(C=b,b=n)),b}function ge(){var b,S,A;return b=C,S=C,q++,O.test(i.charAt(C))?(A=i.charAt(C),C++):(A=n,q===0&&ee(M)),q--,A===n?S=void 0:(C=S,S=n),S!==n?(i.length>C?(A=i.charAt(C),C++):(A=n,q===0&&ee(E)),A!==n?(S=T(A),b=S):(C=b,b=n)):(C=b,b=n),b===n&&(b=C,i.charCodeAt(C)===92?(S=P,C++):(S=n,q===0&&ee(L)),S!==n?(A=nt(),A!==n?(S=T(A),b=S):(C=b,b=n)):(C=b,b=n)),b}function Ae(){var b,S,A;return b=C,S=C,q++,A=Je(),q--,A===n?S=void 0:(C=S,S=n),S!==n?(i.length>C?(A=i.charAt(C),C++):(A=n,q===0&&ee(E)),A!==n?(S=T(A),b=S):(C=b,b=n)):(C=b,b=n),b}function nt(){var b,S;return U.test(i.charAt(C))?(b=i.charAt(C),C++):(b=n,q===0&&ee(V)),b===n&&(b=C,i.charCodeAt(C)===110?(S=W,C++):(S=n,q===0&&ee(J)),S!==n&&(S=z()),b=S,b===n&&(b=C,i.charCodeAt(C)===114?(S=te,C++):(S=n,q===0&&ee(Y)),S!==n&&(S=Q()),b=S,b===n&&(b=C,i.charCodeAt(C)===116?(S=X,C++):(S=n,q===0&&ee(Z)),S!==n&&(S=ae()),b=S))),b}function Je(){var b;return q++,de.test(i.charAt(C))?(b=i.charAt(C),C++):(b=n,q===0&&ee(ye)),q--,b===n&&q===0&&ee(le),b}function Zt(){var b;return q++,Se.test(i.charAt(C))?(b=i.charAt(C),C++):(b=n,q===0&&ee(Ee)),q--,b===n&&q===0&&ee(Pe),b}if($e=a(),$e!==n&&C===i.length)return $e;throw $e!==n&&C<i.length&&ee({type:"end",description:"end of input"}),Me(null,oe,B<i.length?i.charAt(B):null,B<i.length?Oe(B,B+1):Oe(B,B))}return{SyntaxError:e,parse:s}}();function us(t,e=""){if(!t)return[];const s=[];for(const i of Object.keys(t))i.startsWith(e)&&s.push(i);return s}function Bu(t){const e=k.c(6),{results:s}=t,i=I.useRef(null);let r,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{i&&i.current.addEventListener("DOMNodeInserted",Ku)},n=[],e[0]=r,e[1]=n):(r=e[0],n=e[1]),I.useEffect(r,n);let l;e[2]!==s?(l=s.map(Wu),e[2]=s,e[3]=l):l=e[3];let a;return e[4]!==l?(a=o.jsx("div",{className:"command-result",ref:i,children:l}),e[4]=l,e[5]=a):a=e[5],a}function Wu(t,e){return o.jsxs("div",{children:[o.jsx("div",{children:o.jsxs("strong",{children:["$ ",t.command]})}),t.result]},e)}function Ku(t){const e=t.currentTarget;e.scroll({top:e.scrollHeight,behavior:"auto"})}function zu(t){const e=k.c(20),{nextArgs:s,currentArg:i,help:r,description:n,availableCommands:l}=t;let a;if(e[0]!==i||e[1]!==s){a=[];for(let w=0;w<s.length;w++){if(w==i){a.push(o.jsx("mark",{children:s[w]},w));continue}a.push(o.jsxs("span",{children:[s[w]," "]},w))}e[0]=i,e[1]=s,e[2]=a}else a=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx("div",{className:"arrow"}),e[3]=d):d=e[3];let f;e[4]!==a?(f=a.length>0&&o.jsxs("div",{children:[o.jsx("strong",{children:"Argument suggestion:"})," ",a]}),e[4]=a,e[5]=f):f=e[5];let p;e[6]!==r?(p=r?.includes("->")&&o.jsxs("div",{children:[o.jsx("strong",{children:"Signature help: "}),r]}),e[6]=r,e[7]=p):p=e[7];let h;e[8]!==n?(h=n&&o.jsxs("div",{children:["# ",n]}),e[8]=n,e[9]=h):h=e[9];let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx("strong",{children:"Available Commands: "}),e[10]=g):g=e[10];let _;e[11]!==l?(_=JSON.stringify(l),e[11]=l,e[12]=_):_=e[12];let j;e[13]!==_?(j=o.jsxs("div",{children:[g,o.jsx("p",{className:"available-commands",children:_})]}),e[13]=_,e[14]=j):j=e[14];let y;return e[15]!==f||e[16]!==p||e[17]!==h||e[18]!==j?(y=o.jsxs("div",{className:"argument-suggestion popover top",children:[d,o.jsxs("div",{className:"popover-content",children:[f,p,h,j]})]}),e[15]=f,e[16]=p,e[17]=h,e[18]=j,e[19]=y):y=e[19],y}function Gu(){const t=k.c(45),[e,s]=I.useState(""),[i,r]=I.useState(""),[n,l]=I.useState(0);let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=[],t[0]=a):a=t[0];const[d,f]=I.useState(a);let p;t[1]===Symbol.for("react.memo_cache_sentinel")?(p=[],t[1]=p):p=t[1];const[h,g]=I.useState(p);let _;t[2]===Symbol.for("react.memo_cache_sentinel")?(_={},t[2]=_):_=t[2];const[j,y]=I.useState(_);let w;t[3]===Symbol.for("react.memo_cache_sentinel")?(w=[],t[3]=w):w=t[3];const[$,N]=I.useState(w),[E,T]=I.useState(0),[P,L]=I.useState(""),[O,M]=I.useState("");let U;t[4]===Symbol.for("react.memo_cache_sentinel")?(U=[],t[4]=U):U=t[4];const[V,W]=I.useState(U);let J;t[5]===Symbol.for("react.memo_cache_sentinel")?(J=[],t[5]=J):J=t[5];const[z,te]=I.useState(J),[Y,Q]=I.useState(void 0);let X,Z;t[6]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{ne("/commands",{method:"GET"}).then(ef).then(re=>{y(re),f(us(re)),g(Object.keys(re))}).catch(Zu)},Z=[],t[6]=X,t[7]=Z):(X=t[6],Z=t[7]),I.useEffect(X,Z);let ae,le;t[8]===Symbol.for("react.memo_cache_sentinel")?(ae=()=>{Bt("commands.history.get").then(re=>{te(re.value)}).catch(Xu)},le=[],t[8]=ae,t[9]=le):(ae=t[8],le=t[9]),I.useEffect(ae,le);let de;t[10]!==j?(de=(re,ue)=>{const ge=ds.parse(ue),Ae=ds.parse(re);L(j[ge[0]]?.signature_help),M(j[ge[0]]?.help||""),f(us(j,Ae[0])),g(us(j,ge[0]));const nt=j[ge[0]]?.parameters.map(Qu);nt&&(N([ge[0],...nt]),T(ge.length-1))},t[10]=j,t[11]=de):de=t[11];const ye=de;let Pe;t[12]===Symbol.for("react.memo_cache_sentinel")?(Pe=re=>{s(re.target.value),r(re.target.value),l(0)},t[12]=Pe):Pe=t[12];const Se=Pe;let Ee;t[13]!==h||t[14]!==d||t[15]!==n||t[16]!==Y||t[17]!==z||t[18]!==e||t[19]!==V?(Ee=re=>{if(re.key==="Enter"){const[ue,...ge]=ds.parse(e);te([...z,e]),Bt("commands.history.add",e).catch(Ju),ne.post(`/commands/${ue}`,{arguments:ge}).then(Yu).then(Ae=>{Q(void 0),N([]),W([...V,{command:e,result:JSON.stringify(Ae.value||Ae.error)}])}).catch(Ae=>{Q(void 0),N([]),W([...V,{command:e,result:Ae.toString()}])}),L(""),M(""),s(""),r(""),l(0),f(h)}if(re.key==="ArrowUp"){let ue;Y===void 0?ue=z.length-1:ue=Math.max(0,Y-1),s(z[ue]),r(z[ue]),Q(ue)}if(re.key==="ArrowDown"){if(Y===void 0)return;if(Y==z.length-1)s(""),r(""),Q(void 0);else{const ue=Y+1;s(z[ue]),r(z[ue]),Q(ue)}}re.key==="Tab"&&(s(d[n]),l((n+1)%d.length),re.preventDefault()),re.stopPropagation()},t[13]=h,t[14]=d,t[15]=n,t[16]=Y,t[17]=z,t[18]=e,t[19]=V,t[20]=Ee):Ee=t[20];const C=Ee;let he;t[21]!==j||t[22]!==e||t[23]!==i||t[24]!==ye?(he=re=>{if(!e){g(Object.keys(j));return}ye(i,e),re.stopPropagation()},t[21]=j,t[22]=e,t[23]=i,t[24]=ye,t[25]=he):he=t[25];const B=he;let oe;t[26]===Symbol.for("react.memo_cache_sentinel")?(oe=o.jsx("div",{className:"command-title",children:"Command Result"}),t[26]=oe):oe=t[26];let q;t[27]!==V?(q=o.jsx(Bu,{results:V}),t[27]=V,t[28]=q):q=t[28];let $e;t[29]!==h||t[30]!==E||t[31]!==O||t[32]!==$||t[33]!==P?($e=o.jsx(zu,{nextArgs:$,currentArg:E,help:P,description:O,availableCommands:h}),t[29]=h,t[30]=E,t[31]=O,t[32]=$,t[33]=P,t[34]=$e):$e=t[34];let We;t[35]===Symbol.for("react.memo_cache_sentinel")?(We=je("command-input input-group"),t[35]=We):We=t[35];let Oe;t[36]===Symbol.for("react.memo_cache_sentinel")?(Oe=o.jsx("span",{className:"input-group-addon",children:o.jsx("i",{className:"fa fa-fw fa-terminal"})}),t[36]=Oe):Oe=t[36];const ee=e||"";let Me;t[37]!==C||t[38]!==B||t[39]!==ee?(Me=o.jsxs("div",{className:We,children:[Oe,o.jsx("input",{type:"text",placeholder:"Enter command",className:"form-control",value:ee,onChange:Se,onKeyDown:C,onKeyUp:B})]}),t[37]=C,t[38]=B,t[39]=ee,t[40]=Me):Me=t[40];let Re;return t[41]!==q||t[42]!==$e||t[43]!==Me?(Re=o.jsxs("div",{className:"command",children:[oe,q,$e,Me]}),t[41]=q,t[42]=$e,t[43]=Me,t[44]=Re):Re=t[44],Re}function Yu(t){return t.json()}function Ju(){return 0}function Qu(t){return t.name}function Xu(t){return console.error(t)}function Zu(t){return console.error(t)}function ef(t){return t.json()}function tf(t){const e=k.c(7),{checked:s,onToggle:i,text:r}=t,n="btn btn-toggle "+(s?"btn-primary":"btn-default"),l="fa fa-fw "+(s?"fa-check-square-o":"fa-square-o");let a;e[0]!==l?(a=o.jsx("i",{className:l}),e[0]=l,e[1]=a):a=e[1];let d;return e[2]!==i||e[3]!==n||e[4]!==a||e[5]!==r?(d=o.jsxs("div",{className:n,onClick:i,children:[a," ",r]}),e[2]=i,e[3]=n,e[4]=a,e[5]=r,e[6]=d):d=e[6],d}class sf extends I.Component{static defaultProps={rowHeight:18};heights;viewport=Te.createRef();constructor(e){super(e),this.heights={},this.state={vScroll:kt()},this.onViewportUpdate=this.onViewportUpdate.bind(this)}componentDidMount(){window.addEventListener("resize",this.onViewportUpdate),this.onViewportUpdate()}componentWillUnmount(){window.removeEventListener("resize",this.onViewportUpdate)}getSnapshotBeforeUpdate(){return Es(this.viewport)}componentDidUpdate(e,s,i){i&&Jr(this.viewport),this.onViewportUpdate()}onViewportUpdate(){const e=this.viewport.current,s=kt({itemCount:this.props.events.length,rowHeight:this.props.rowHeight,viewportTop:e.scrollTop,viewportHeight:e.offsetHeight,itemHeights:this.props.events.map(i=>this.heights[i.id])});Kt(this.state.vScroll,s)||this.setState({vScroll:s})}setHeight(e,s){if(s&&!this.heights[e]){const i=s.offsetHeight;this.heights[e]!==i&&(this.heights[e]=i,this.onViewportUpdate())}}render(){const{vScroll:e}=this.state,{events:s}=this.props;return o.jsxs("pre",{ref:this.viewport,onScroll:this.onViewportUpdate,children:[o.jsx("div",{style:{height:e.paddingTop}}),s.slice(e.start,e.end).map(i=>o.jsxs("div",{ref:r=>{this.setHeight(i.id,r)},children:[o.jsx(nf,{event:i}),i.message]},i.id)),o.jsx("div",{style:{height:e.paddingBottom}})]})}}function nf(t){const e=k.c(4),{event:s}=t;let i;e[0]!==s.level?(i={web:"html5",debug:"bug",warn:"exclamation-triangle",error:"ban"}[s.level]||"info",e[0]=s.level,e[1]=i):i=e[1];const n=`fa fa-fw fa-${i}`;let l;return e[2]!==n?(l=o.jsx("i",{className:n}),e[2]=n,e[3]=l):l=e[3],l}class rf extends I.Component{static defaultProps={defaultHeight:200};dragStart;constructor(e,s){super(e,s),this.state={height:this.props.defaultHeight},this.onDragStart=this.onDragStart.bind(this),this.onDragMove=this.onDragMove.bind(this),this.onDragStop=this.onDragStop.bind(this)}onDragStart(e){e.preventDefault(),this.dragStart=this.state.height+e.pageY,window.addEventListener("mousemove",this.onDragMove),window.addEventListener("mouseup",this.onDragStop),window.addEventListener("dragend",this.onDragStop)}onDragMove(e){e.preventDefault(),this.setState({height:this.dragStart-e.pageY})}onDragStop(e){e.preventDefault(),window.removeEventListener("mousemove",this.onDragMove)}render(){const{height:e}=this.state,{filters:s,events:i,toggleFilter:r,close:n}=this.props;return o.jsxs("div",{className:"eventlog",style:{height:e},children:[o.jsxs("div",{onMouseDown:this.onDragStart,children:["Eventlog",o.jsxs("div",{className:"pull-right",children:[Object.values(Gi).map(l=>o.jsx(tf,{text:l,checked:s[l],onToggle:()=>r(l)},l)),o.jsx("i",{onClick:n,className:"fa fa-close"})]})]}),o.jsx(sf,{events:i})]})}}const of=zt(t=>({filters:t.eventLog.filters,events:t.eventLog.view}),{close:Gt,toggleFilter:zi})(rf);function lf(){const t=k.c(56),e=D(uf),{mode:s,intercept:i,showhost:r,upstream_cert:n,rawtcp:l,http2:a,websocket:d,anticache:f,anticomp:p,stickyauth:h,stickycookie:g,stream_large_bodies:_,listen_host:j,listen_port:y,server:w,ssl_insecure:$}=D(df),N=D(af),E=D(cf);let T;t[0]!==s?(T=s&&(s.length!==1||s[0]!=="regular")&&o.jsx("span",{className:"label label-success",children:s.join(",")}),t[0]=s,t[1]=T):T=t[1];let P;t[2]!==i?(P=i&&o.jsxs("span",{className:"label label-success",children:["Intercept: ",i]}),t[2]=i,t[3]=P):P=t[3];let L;t[4]!==$?(L=$&&o.jsx("span",{className:"label label-danger",children:"ssl_insecure"}),t[4]=$,t[5]=L):L=t[5];let O;t[6]!==r?(O=r&&o.jsx("span",{className:"label label-success",children:"showhost"}),t[6]=r,t[7]=O):O=t[7];let M;t[8]!==n?(M=!n&&o.jsx("span",{className:"label label-success",children:"no-upstream-cert"}),t[8]=n,t[9]=M):M=t[9];let U;t[10]!==l?(U=!l&&o.jsx("span",{className:"label label-success",children:"no-raw-tcp"}),t[10]=l,t[11]=U):U=t[11];let V;t[12]!==a?(V=!a&&o.jsx("span",{className:"label label-success",children:"no-http2"}),t[12]=a,t[13]=V):V=t[13];let W;t[14]!==d?(W=!d&&o.jsx("span",{className:"label label-success",children:"no-websocket"}),t[14]=d,t[15]=W):W=t[15];let J;t[16]!==f?(J=f&&o.jsx("span",{className:"label label-success",children:"anticache"}),t[16]=f,t[17]=J):J=t[17];let z;t[18]!==p?(z=p&&o.jsx("span",{className:"label label-success",children:"anticomp"}),t[18]=p,t[19]=z):z=t[19];let te;t[20]!==h?(te=h&&o.jsxs("span",{className:"label label-success",children:["stickyauth: ",h]}),t[20]=h,t[21]=te):te=t[21];let Y;t[22]!==g?(Y=g&&o.jsxs("span",{className:"label label-success",children:["stickycookie: ",g]}),t[22]=g,t[23]=Y):Y=t[23];let Q;t[24]!==_?(Q=_&&o.jsxs("span",{className:"label label-success",children:["stream: ",hi(_)]}),t[24]=_,t[25]=Q):Q=t[25];let X;t[26]!==N||t[27]!==E?(X=E>0&&o.jsxs("span",{className:"label label-default",children:[N," of ",E," flows selected"]}),t[26]=N,t[27]=E,t[28]=X):X=t[28];let Z;t[29]!==j||t[30]!==y||t[31]!==w?(Z=w&&o.jsxs("span",{className:"label label-primary",title:"HTTP Proxy Server Address",children:[j||"*",":",y||8080]}),t[29]=j,t[30]=y,t[31]=w,t[32]=Z):Z=t[32];let ae;t[33]!==Z?(ae=o.jsx(gt,{children:Z}),t[33]=Z,t[34]=ae):ae=t[34];let le;t[35]!==e?(le=o.jsxs("span",{className:"label label-default",title:"Mitmproxy Version",children:["mitmproxy ",e]}),t[35]=e,t[36]=le):le=t[36];let de;t[37]!==ae||t[38]!==le?(de=o.jsxs("div",{className:"pull-right",children:[ae,le]}),t[37]=ae,t[38]=le,t[39]=de):de=t[39];let ye;return t[40]!==T||t[41]!==P||t[42]!==te||t[43]!==Y||t[44]!==Q||t[45]!==X||t[46]!==de||t[47]!==L||t[48]!==O||t[49]!==M||t[50]!==U||t[51]!==V||t[52]!==W||t[53]!==J||t[54]!==z?(ye=o.jsxs("footer",{children:[T,P,L,O,M,U,V,W,J,z,te,Y,Q,X,de]}),t[40]=T,t[41]=P,t[42]=te,t[43]=Y,t[44]=Q,t[45]=X,t[46]=de,t[47]=L,t[48]=O,t[49]=M,t[50]=U,t[51]=V,t[52]=W,t[53]=J,t[54]=z,t[55]=ye):ye=t[55],ye}function cf(t){return t.flows.list.length}function af(t){return t.flows.selected.length}function df(t){return t.options}function uf(t){return t.backendState.version}function ff(t){const e=k.c(3),{children:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("div",{className:"modal-backdrop fade in"}),e[0]=i):i=e[0];let r;return e[1]!==s?(r=o.jsxs("div",{children:[i,o.jsx("div",{className:"modal modal-visible",id:"optionsModal",tabIndex:-1,role:"dialog","aria-labelledby":"options",children:o.jsx("div",{className:"modal-dialog modal-lg",role:"document",children:o.jsx("div",{className:"modal-content",children:s})})})]}),e[1]=s,e[2]=r):r=e[2],r}const pf=t=>{t.key!=="Escape"&&t.stopPropagation()};function so(t){const e=k.c(10);let s,i,r;e[0]!==t?({value:r,onChange:s,...i}=t,e[0]=t,e[1]=s,e[2]=i,e[3]=r):(s=e[1],i=e[2],r=e[3]);let n;e[4]!==s?(n=a=>s(a.target.checked),e[4]=s,e[5]=n):n=e[5];let l;return e[6]!==i||e[7]!==n||e[8]!==r?(l=o.jsx("div",{className:"checkbox",children:o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:r,onChange:n,...i}),"Enable"]})}),e[6]=i,e[7]=n,e[8]=r,e[9]=l):l=e[9],l}function ci(t){const e=k.c(10);let s,i,r;e[0]!==t?({value:r,onChange:s,...i}=t,e[0]=t,e[1]=s,e[2]=i,e[3]=r):(s=e[1],i=e[2],r=e[3]);const n=r||"";let l;e[4]!==s?(l=d=>s(d.target.value),e[4]=s,e[5]=l):l=e[5];let a;return e[6]!==i||e[7]!==n||e[8]!==l?(a=o.jsx("input",{type:"text",value:n,onChange:l,...i}),e[6]=i,e[7]=n,e[8]=l,e[9]=a):a=e[9],a}function ai(t){return function({onChange:s,...i}){return o.jsx(t,{onChange:r=>s(r||null),...i})}}function di(t){const e=k.c(10);let s,i,r;e[0]!==t?({value:r,onChange:s,...i}=t,e[0]=t,e[1]=s,e[2]=i,e[3]=r):(s=e[1],i=e[2],r=e[3]);let n;e[4]!==s?(n=a=>s(parseInt(a.target.value)),e[4]=s,e[5]=n):n=e[5];let l;return e[6]!==i||e[7]!==n||e[8]!==r?(l=o.jsx("input",{type:"number",value:r,onChange:n,...i}),e[6]=i,e[7]=n,e[8]=r,e[9]=l):l=e[9],l}function hf(t){const e=k.c(12);let s,i,r,n;if(e[0]!==t){const{value:d,onChange:f,choices:p,...h}=t;n=d,s=p,i=h,r=g=>f(g.target.value),e[0]=t,e[1]=s,e[2]=i,e[3]=r,e[4]=n}else s=e[1],i=e[2],r=e[3],n=e[4];let l;e[5]!==s?(l=s.map(mf),e[5]=s,e[6]=l):l=e[6];let a;return e[7]!==i||e[8]!==r||e[9]!==l||e[10]!==n?(a=o.jsx("select",{onChange:r,value:n,...i,children:l}),e[7]=i,e[8]=r,e[9]=l,e[10]=n,e[11]=a):a=e[11],a}function mf(t){return o.jsx("option",{value:t,children:t},t)}function gf(t){const e=k.c(13);let s,i,r;e[0]!==t?({value:r,onChange:s,...i}=t,e[0]=t,e[1]=s,e[2]=i,e[3]=r):(s=e[1],i=e[2],r=e[3]);const n=Math.max(r.length,1);let l;e[4]!==r?(l=r.join(` |
| 8 | `),e[4]=r,e[5]=l):l=e[5];const[a,d]=Te.useState(l);let f;e[6]!==s?(f=g=>{const _=g.target.value;d(_),s(_.split(` |