(self.webpackChunkweb_toolbox=self.webpackChunkweb_toolbox||[]).push([[751],{32376:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var o=n(9950),a=n(69935),r=n(10226),i=n(67243),s=n.n(i),l=n(77671);const c=e=>{let{data:t,isDisabled:n,hoverMessage:i,feedbackMessage:c,Icon:u=a.A,...d}=e;const{setToasterState:p}=(0,l.dq)();return o.createElement(r.A,Object.assign({disabled:!t||n,title:null!==i&&void 0!==i?i:"Copy to clipboard",variant:"contained","data-testid":"copy-to-clipboard",color:"primary"},d,{onClick:()=>{if(!t)return;const e=null!==c&&void 0!==c?c:"Content copied into clipboard: ".concat(t.substring(0,25)," \u2026");s()(t,{format:"text/plain"}),p({open:!0,message:e,type:"success",autoHideDuration:2e3})}}),o.createElement(u,null))}},50057:(e,t,n)=>{"use strict";n.d(t,{n:()=>l});var o=n(9950),a=n(25131),r=n(72772),i=n(73931);const s=(0,a.A)((e=>({root:{margin:e.spacing(1)}}))),l=e=>{let{title:t,iconType:n,children:a}=e;const l=s();return o.createElement(o.Fragment,null,o.createElement(r.m,{titleTemplate:"Web Toolbox - %s",defaultTitle:"Web Toolbox",title:t}),o.createElement("div",{className:l.root},o.createElement(i.A,{iconType:n,title:t}),a))}},73931:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var o=n(9950),a=n(82053);const r=(0,n(25131).A)((e=>({title:{wordBreak:"break-word"},titleWithIcon:{display:"flex",justifyContent:"center",alignItems:"center",marginBottom:e.spacing(1)},icon:{height:"40px",width:"40px",marginRight:e.spacing(1)}}))),i=e=>{let{title:t,iconType:n}=e;const i=r();return o.createElement("div",{className:i.titleWithIcon},o.createElement(n,{className:i.icon}),o.createElement(a.A,{variant:"h5",className:i.title},t))}},28751:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>H,mapDispatchToProps:()=>L,mapStateToProps:()=>C});var o={};n.r(o),n.d(o,{isMinified:()=>j,minifyJson:()=>k,prettifyJson:()=>x});var a=n(9950),r=n(42834),i=n(77134),s=n(92098),l=n(90988),c=n(83239),u=n(16491),d=n(10226),p=n(8145),f=n(25131),m=n(10300),v=n(58042),b=n(33602),h=n(32376),g=n(50057),w=n(73649),y=n(62160),A=n(1810);const E=(e,t)=>t instanceof Object&&!(t instanceof Array)?Object.keys(t).sort().reduce(((e,n)=>(e[n]=t[n],e)),{}):t;function x(e){return T(4,e)}function T(e,t){if(!t)return"";try{const n=JSON.parse(t);return JSON.stringify(n,E,e)}catch(n){return t}}function k(e){return T(0,e)}const j=e=>e===k(e),{isMinified:S,prettifyJson:M,minifyJson:R}=o,O=(0,f.A)((e=>({formatted:{borderColor:e.palette.text.disabled,borderStyle:"solid",borderWidth:1,borderRadius:e.shape.borderRadius,maxHeight:"500px",width:"100%",overflow:"auto"},toolbar:{margin:0,padding:0}})));function C(e){return{inputText:e.textInputs.lastJSONFormatterValue}}function L(e){return{storeInputText:(t,n)=>e((0,b.s)(t,n))}}const H=(0,m.Ng)(C,L)((e=>{let{inputText:t,storeInputText:n}=e;const o=O(),f=(0,A.Pb)("md"),m=(0,w.c)(),[b,E]=a.useState(""),x=S(b);a.useEffect((()=>{E(M(t))}),[t]);return a.createElement(g.n,{iconType:l.A,title:"JSON Formatter"},a.createElement("form",{noValidate:!0,autoComplete:"off"},a.createElement("div",null,a.createElement(p.A,{autoFocus:f,label:"JSON Content",placeholder:"Paste or type the json content here",multiline:!0,minRows:10,maxRows:f?20:10,variant:"outlined",margin:"normal",fullWidth:!0,value:t,inputProps:{spellCheck:!1},onChange:e=>n("lastJSONFormatterValue",e.target.value)}))),a.createElement(c.A,{className:o.toolbar},a.createElement(u.A,{component:"div",flexGrow:1}),a.createElement(d.A,{endIcon:x?a.createElement(i.A,null):a.createElement(r.A,null),variant:"contained",color:"primary",sx:{mr:1},onClick:e=>{e.preventDefault(),E((e=>S(e)?M(e):R(e)))}},x?"Format":"Minify"),a.createElement(h.A,{data:b,sx:{mr:1}}),a.createElement(d.A,{endIcon:a.createElement(s.A,null,"Save As\u2026"),disabled:!b,variant:"contained",color:"primary",onClick:e=>{e.preventDefault(),y.Q(b)}},"Save As\u2026")),a.createElement(v.A,{style:m,language:"json",className:o.formatted},b))}))},73649:(e,t,n)=>{"use strict";n.d(t,{c:()=>i});var o=n(32284),a=n(71830),r=n(90038);const i=()=>{const{isDark:e}=(0,r.CX)();return e?o.A:a.A}},62160:(e,t,n)=>{"use strict";n.d(t,{Q:()=>a});var o=n(34691);function a(e){if(window.require){window.require("electron").ipcRenderer.send("saveJsonAs",e)}else{const t=new Blob([e],{type:"application/json"});(0,o.saveAs)(t,"data.json")}}},42834:(e,t,n)=>{"use strict";var o=n(24994);t.A=void 0;var a=o(n(79526)),r=n(44414);t.A=(0,a.default)((0,r.jsx)("path",{d:"M22 3.41 16.71 8.7 20 12h-8V4l3.29 3.29L20.59 2zM3.41 22l5.29-5.29L12 20v-8H4l3.29 3.29L2 20.59z"}),"CloseFullscreen")},77134:(e,t,n)=>{"use strict";var o=n(24994);t.A=void 0;var a=o(n(79526)),r=n(44414);t.A=(0,a.default)((0,r.jsx)("path",{d:"M3 21h18v-2H3zM3 8v8l4-4zm8 9h10v-2H11zM3 3v2h18V3zm8 6h10V7H11zm0 4h10v-2H11z"}),"FormatIndentIncrease")},92098:(e,t,n)=>{"use strict";var o=n(24994);t.A=void 0;var a=o(n(79526)),r=n(44414);t.A=(0,a.default)((0,r.jsx)("path",{d:"M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3m3-10H5V5h10z"}),"Save")},34691:function(e,t,n){var o,a,r;a=[],void 0===(r="function"===typeof(o=function(){"use strict";function t(e,t){return"undefined"==typeof t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}function o(e,t,n){var o=new XMLHttpRequest;o.open("GET",e),o.responseType="blob",o.onload=function(){l(o.response,t,n)},o.onerror=function(){console.error("could not download file")},o.send()}function a(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function r(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(o){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var i="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n.g&&n.g.global===n.g?n.g:void 0,s=i.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=i.saveAs||("object"!=typeof window||window!==i?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(e,t,n){var s=i.URL||i.webkitURL,l=document.createElement("a");t=t||e.name||"download",l.download=t,l.rel="noopener","string"==typeof e?(l.href=e,l.origin===location.origin?r(l):a(l.href)?o(e,t,n):r(l,l.target="_blank")):(l.href=s.createObjectURL(e),setTimeout((function(){s.revokeObjectURL(l.href)}),4e4),setTimeout((function(){r(l)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,n,i){if(n=n||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(t(e,i),n);else if(a(e))o(e,n,i);else{var s=document.createElement("a");s.href=e,s.target="_blank",setTimeout((function(){r(s)}))}}:function(e,t,n,a){if((a=a||open("","_blank"))&&(a.document.title=a.document.body.innerText="downloading..."),"string"==typeof e)return o(e,t,n);var r="application/octet-stream"===e.type,l=/constructor/i.test(i.HTMLElement)||i.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||r&&l||s)&&"undefined"!=typeof FileReader){var u=new FileReader;u.onloadend=function(){var e=u.result;e=c?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),a?a.location.href=e:location=e,a=null},u.readAsDataURL(e)}else{var d=i.URL||i.webkitURL,p=d.createObjectURL(e);a?a.location=p:location.href=p,a=null,setTimeout((function(){d.revokeObjectURL(p)}),4e4)}});i.saveAs=l.saveAs=l,e.exports=l})?o.apply(t,a):o)||(e.exports=r)}}]);