(self.webpackChunkweb_toolbox=self.webpackChunkweb_toolbox||[]).push([[942],{32376:(t,e,a)=>{"use strict";a.d(e,{A:()=>c});var r=a(9950),n=a(69935),s=a(10226),i=a(67243),o=a.n(i),l=a(77671);const c=t=>{let{data:e,isDisabled:a,hoverMessage:i,feedbackMessage:c,Icon:m=n.A,...g}=t;const{setToasterState:h}=(0,l.dq)();return r.createElement(s.A,Object.assign({disabled:!e||a,title:null!==i&&void 0!==i?i:"Copy to clipboard",variant:"contained","data-testid":"copy-to-clipboard",color:"primary"},g,{onClick:()=>{if(!e)return;const t=null!==c&&void 0!==c?c:"Content copied into clipboard: ".concat(e.substring(0,25)," \u2026");o()(e,{format:"text/plain"}),h({open:!0,message:t,type:"success",autoHideDuration:2e3})}}),r.createElement(m,null))}},50057:(t,e,a)=>{"use strict";a.d(e,{n:()=>l});var r=a(9950),n=a(25131),s=a(72772),i=a(73931);const o=(0,n.A)((t=>({root:{margin:t.spacing(1)}}))),l=t=>{let{title:e,iconType:a,children:n}=t;const l=o();return r.createElement(r.Fragment,null,r.createElement(s.m,{titleTemplate:"Web Toolbox - %s",defaultTitle:"Web Toolbox",title:e}),r.createElement("div",{className:l.root},r.createElement(i.A,{iconType:a,title:e}),n))}},73931:(t,e,a)=>{"use strict";a.d(e,{A:()=>i});var r=a(9950),n=a(82053);const s=(0,a(25131).A)((t=>({title:{wordBreak:"break-word"},titleWithIcon:{display:"flex",justifyContent:"center",alignItems:"center",marginBottom:t.spacing(1)},icon:{height:"40px",width:"40px",marginRight:t.spacing(1)}}))),i=t=>{let{title:e,iconType:a}=t;const i=s();return r.createElement("div",{className:i.titleWithIcon},r.createElement(a,{className:i.icon}),r.createElement(n.A,{variant:"h5",className:i.title},e))}},37511:(t,e,a)=>{"use strict";a.a(t,(async(t,r)=>{try{a.r(e),a.d(e,{default:()=>L,mapDispatchToProps:()=>k,mapStateToProps:()=>R});var n=a(9950),s=a(7626),i=a(73289),o=a(8145),l=a(83239),c=a(25979),m=a(23266),g=a(16491),h=a(10226),u=a(25131),d=a(10300),p=a(58042),y=a(33602),f=a(32376),x=a(50057),v=a(73649),b=a(98927),A=a(1810),H=a(31065),C=t([H]);H=(C.then?(await C)():C)[0];const w=(0,u.A)((t=>({toolbar:{margin:0,padding:0},formControl:{margin:t.spacing(1)},encodedResult:{padding:t.spacing(1),borderColor:t.palette.text.disabled,borderStyle:"solid",borderWidth:1,borderRadius:t.shape.borderRadius,whiteSpace:"normal",wordBreak:"break-word"}}))),T=t=>{var e;let{inputText:a,lastCurlTargetLanguage:r,storeInputText:u}=t;const d=w(),y=(0,v.c)(),C=(0,A.Pb)("md"),[E,T]=n.useState("");return n.useEffect((()=>{(0,b.z3)(a)&&T("")}),[a]),n.createElement(x.n,{iconType:i.A,title:"cURL Converter"},n.createElement(o.A,{autoFocus:C,label:"cURL command",placeholder:"Paste or type the cURL command here",multiline:!0,minRows:4,maxRows:C?20:4,variant:"outlined",margin:"normal",fullWidth:!0,inputProps:{style:{fontFamily:"monospace"}},value:a,onChange:t=>u("lastCurlValue",t.target.value)}),n.createElement(l.A,{className:d.toolbar},n.createElement(c.A,{className:d.formControl},n.createElement(o.A,{select:!0,disabled:!a,name:"targetLanguage",label:"Target language",variant:"outlined",title:"Convert cURL command into a specific language",value:r,style:{width:160},inputProps:{style:{fontFamily:"monospace"}},onChange:t=>{const e=t.target.value;u("lastCurlTargetLanguage",e),T((0,H.pd)(a,e))}},H.Rc.map((t=>n.createElement(m.A,{key:t,value:t},t))))),n.createElement(g.A,{component:"div",flexGrow:1}),n.createElement(h.A,{variant:"contained",sx:{mr:1},title:"Convert cURL into target language",color:"primary",endIcon:n.createElement(s.A,null,"Convert"),disabled:!a,onClick:()=>T((0,H.pd)(a,r))},"Convert"),n.createElement(f.A,{data:E})),E&&n.createElement(p.A,{"data-testid":"parsed-result",style:y,language:null===(e=H.iM.get(r))||void 0===e?void 0:e.syntaxHighlither,className:d.encodedResult},E))};function R(t){return{inputText:t.textInputs.lastCurlValue,lastCurlTargetLanguage:t.textInputs.lastCurlTargetLanguage}}function k(t){return{storeInputText:(e,a)=>t((0,y.s)(e,a))}}const L=(0,d.Ng)(R,k)(T);r()}catch(E){r(E)}}))},31065:(t,e,a)=>{"use strict";a.a(t,(async(t,r)=>{try{a.d(e,{Rc:()=>l,iM:()=>o,pd:()=>c});var n=a(42602),s=t([n]);n=(s.then?(await s)():s)[0];const o=new Map([["Ansible",{syntaxHighlither:"ansible",transform:n.m_}],["Browser",{syntaxHighlither:"browser",transform:n.IR}],["CFML",{syntaxHighlither:"cfml",transform:n.sL}],["CSharp",{syntaxHighlither:"csharp",transform:n.D0}],["Dart",{syntaxHighlither:"dart",transform:n.F4}],["Elixir",{syntaxHighlither:"elixir",transform:n.js}],["Go",{syntaxHighlither:"go",transform:n.EK}],["Java",{syntaxHighlither:"java",transform:n.eO}],["Javascript",{syntaxHighlither:"javascript",transform:n.j6}],["JSON String",{syntaxHighlither:"json",transform:n.J7}],["MATLAB",{syntaxHighlither:"mathlab",transform:n.h0}],["Node",{syntaxHighlither:"javascript",transform:n.ye}],["Node Axios",{syntaxHighlither:"javascript",transform:n.qP}],["Node Fetch",{syntaxHighlither:"javascript",transform:n.mQ}],["Node Request",{syntaxHighlither:"javascript",transform:n.nX}],["PHP",{syntaxHighlither:"php",transform:n.yg}],["PHP Requests",{syntaxHighlither:"php",transform:n.gS}],["Python",{syntaxHighlither:"python",transform:n.Uw}],["R",{syntaxHighlither:"r",transform:n.Kl}],["Ruby",{syntaxHighlither:"ruby",transform:n.um}],["Rust",{syntaxHighlither:"rust",transform:n.WX}],["Swift",{syntaxHighlither:"strest",transform:n.XQ}],["Wget",{syntaxHighlither:"strest",transform:n.x$}]]),l=[...o.keys()];function c(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Javascript";if(!t)return"";const a=t.replaceAll(/(\r\n|\n|\r)/gm," "),r=o.get(e);return r?r.transform(a):'Warning: no converter found matching "'.concat(e,'"')}r()}catch(i){r(i)}}))},73649:(t,e,a)=>{"use strict";a.d(e,{c:()=>i});var r=a(32284),n=a(71830),s=a(90038);const i=()=>{const{isDark:t}=(0,s.CX)();return t?r.A:n.A}},28075:()=>{},97218:()=>{}}]);