(self.webpackChunkweb_toolbox=self.webpackChunkweb_toolbox||[]).push([[160],{32376:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var a=n(9950),l=n(69935),r=n(10226),o=n(67243),s=n.n(o),i=n(77671);const c=e=>{let{data:t,isDisabled:n,hoverMessage:o,feedbackMessage:c,Icon:u=l.A,...m}=e;const{setToasterState:d}=(0,i.dq)();return a.createElement(r.A,Object.assign({disabled:!t||n,title:null!==o&&void 0!==o?o:"Copy to clipboard",variant:"contained","data-testid":"copy-to-clipboard",color:"primary"},m,{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"}),d({open:!0,message:e,type:"success",autoHideDuration:2e3})}}),a.createElement(u,null))}},50057:(e,t,n)=>{"use strict";n.d(t,{n:()=>i});var a=n(9950),l=n(25131),r=n(72772),o=n(73931);const s=(0,l.A)((e=>({root:{margin:e.spacing(1)}}))),i=e=>{let{title:t,iconType:n,children:l}=e;const i=s();return a.createElement(a.Fragment,null,a.createElement(r.m,{titleTemplate:"Web Toolbox - %s",defaultTitle:"Web Toolbox",title:t}),a.createElement("div",{className:i.root},a.createElement(o.A,{iconType:n,title:t}),l))}},73931:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var a=n(9950),l=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)}}))),o=e=>{let{title:t,iconType:n}=e;const o=r();return a.createElement("div",{className:o.titleWithIcon},a.createElement(n,{className:o.icon}),a.createElement(l.A,{variant:"h5",className:o.title},t))}},11029:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var a=n(9950),l=n(8145);const r=(0,n(25131).A)((()=>({result:{fontFamily:"monospace",height:"auto"}}))),o=e=>{let{label:t,testID:n,result:o,rows:s=10,maxRows:i=15}=e;const c=r();return a.createElement(l.A,{multiline:!0,"data-testid":n,minRows:s,maxRows:i,label:t,variant:"outlined",margin:"normal",fullWidth:!0,value:o,InputProps:{classes:{input:c.result}}})}},61475:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>y,mapDispatchToProps:()=>v,mapStateToProps:()=>A});var a=n(9950),l=n(72256),r=n(83239),o=n(16491),s=n(8145),i=n(25131),c=n(70804),u=n(10300),m=n(33602),d=n(32376),p=n(50057),g=n(11029),b=n(1810),x=n(99054),h=n.n(x);function f(e,t){return console.debug("match: ".concat(e,", at position ").concat(t)),"<span>".concat(e,"</span>")}const E=(0,i.A)((e=>({matches:{padding:e.spacing(1),borderColor:e.palette.text.disabled,borderStyle:"solid",borderWidth:1,borderRadius:e.shape.borderRadius,"& span":{backgroundColor:"yellow",fontWeight:"bold",color:"black"}},toolbar:{margin:0,padding:0}})));function A(e){return{regularExpression:e.textInputs.lastRegEx,inputText:e.textInputs.lastRegExTextSample}}function v(e){return{storeInputText:(t,n)=>e((0,m.s)(t,n))}}const y=(0,u.Ng)(A,v)((e=>{let{regularExpression:t,inputText:n,storeInputText:i}=e;const u=E(),m=(0,b.Pb)("md"),x=(0,a.useDeferredValue)(t),A=(0,a.useDeferredValue)(n),[v,y]=a.useState(""),[w,T]=a.useState("");return a.useEffect((()=>{y(function(e,t){if(!e||!t)return"";const n=t.replaceAll("\n","<br />");try{const t=h()(e);return t.global?n.replaceAll(t,f):n.replace(t,f)}catch(a){return JSON.stringify(a)}}(x,A)),T(function(e,t){const n=[];if(!e||!t)return"";try{const a=h()(e);if(!a.global)return"";let l;for(;null!==(l=a.exec(t));)n.push(l[0]);const r=new Set(n);return console.log("Sorted set of unique ".concat(r.size," entries:"),[...r].sort().join(", ")),n.join(", ")}catch(a){return JSON.stringify(a)}}(x,A))}),[x,A]),a.createElement(p.n,{iconType:l.A,title:"Regular expressions tester"},a.createElement(s.A,{autoFocus:m,id:"regex",label:"Regular expression",placeholder:"Type the regular expression. Example: /example/g",variant:"outlined",margin:"normal",fullWidth:!0,value:t,onChange:e=>i("lastRegEx",e.target.value)}),a.createElement(r.A,{className:u.toolbar},a.createElement(o.A,{component:"div",flexGrow:1}),a.createElement(d.A,{data:t})),a.createElement(s.A,{id:"content",label:"Content to test the regular expression against",placeholder:"Paste or type the content here",multiline:!0,minRows:6,maxRows:m?20:6,variant:"outlined",margin:"normal",fullWidth:!0,value:n,onChange:e=>i("lastRegExTextSample",e.target.value)}),a.createElement("div",{className:u.matches},(0,c.Ay)(v)),a.createElement("p",null,"Collection of values. Could be usefull for Jira tickets numbers with expressions like:",a.createElement("br",null),a.createElement("strong",null,"issueKey in (FS-3456, WS-3213, FS-9988)")),a.createElement(g.A,{result:w}),a.createElement(r.A,{className:u.toolbar},a.createElement(o.A,{component:"div",flexGrow:1}),a.createElement(d.A,{data:w})))}))},95098:()=>{}}]);