(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{6714:function(e,t,n){Promise.resolve().then(n.bind(n,8212))},281:function(e,t,n){"use strict";n.d(t,{F:function(){return r},o:function(){return i}}),n(4590);var s=n(8064),r=(0,s.$)("61eb92a506b575bed935e6da2eddfcb0fc91c330"),i=(0,s.$)("2867845a32bbf94db1b0e2a4cc705ba8e94379b1")},8212:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return j}});var s=n(7437),r=n(2265),i=n(7075),l=n(3719),a=n(7597),c=n(1665),o=n(66),u=n(4738),d=n(8433),h=n(8027),x=n(9464),f=n(1052),m=n(498),p=n(6648),g=n(1877),y=n(281);function j(){let[e,t]=(0,r.useState)(7),[n,j]=(0,r.useState)(!1),[b,Z]=(0,r.useState)(""),[v,C]=(0,r.useState)(""),[E,w]=(0,r.useState)(""),k="https://encrypted.link";async function I(e,t){if(e.length>15e3){alert("Message is too long");return}if(e.length<3){alert("Message is too short");return}if(t<1||t>30){alert("Expiration must be between 1 and 30");return}(0,r.startTransition)(async()=>{let n=await (0,y.o)(e,t);w(n),console.log(n)})}return(0,r.useEffect)(()=>{E&&("422"==E?alert("Input error."):"500"==E?alert("Server error."):36==E.length?(Z(E),console.log(E)):alert("Internal error."))},[E]),(0,r.useEffect)(()=>{""!=b&&""!=v&&j(!0)},[b,v]),(0,r.useEffect)(()=>{var e=document.getElementById("outputUrl");n&&e&&(e.value=k+"/"+b+"#"+v)},[n,b,v,k]),(0,s.jsx)(i.Z,{maxWidth:"lg",children:(0,s.jsxs)(a.Z,{sx:{my:4,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[(0,s.jsx)(c.Z,{href:"/",children:(0,s.jsx)(p.default,{src:"/images/logo.png",alt:"Logo",width:300,height:188,style:{width:"300px",height:"auto"}})}),!n&&(0,s.jsx)(d.ZP,{container:!0,spacing:2,children:(0,s.jsx)(d.ZP,{item:!0,xs:12,sm:12,spacing:2,children:(0,s.jsx)(h.Z,{elevation:6,sx:{m:3,p:4},children:(0,s.jsxs)(d.ZP,{container:!0,spacing:2,children:[(0,s.jsx)(d.ZP,{item:!0,xs:12,sm:8,spacing:2,children:(0,s.jsx)(x.Z,{fullWidth:!0,multiline:!0,rows:6,label:"Enter Text to Encrypt",id:"userMessage"})}),(0,s.jsx)(d.ZP,{item:!0,xs:12,sm:4,spacing:2,sx:{alignItems:"center",justifyContent:"center"},children:(0,s.jsxs)(a.Z,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[(0,s.jsx)(l.Z,{variant:"body2",component:"p",children:"Expire in"}),(0,s.jsx)(f.ZP,{"aria-label":"Custom marks",defaultValue:7,value:e,step:1,valueLabelDisplay:"auto",marks:[{value:1,label:"1 day"},{value:7,label:"7 days"},{value:14,label:"14 days"},{value:30,label:"30 days"}],min:1,max:30,sx:{width:"80%",alignItems:"center",justifyContent:"center"},id:"daysExpire",onChange:(e,n)=>{t(n)}}),(0,s.jsx)(m.Z,{variant:"contained",fullWidth:!0,sx:{m:2},onClick:async()=>{let t=function(e){let t="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~()!*:@,;?/$&+=",s=n.length,r=0;for(;r<32;)t+=n.charAt(Math.floor(Math.random()*s)),r+=1;return t}(0);C(t);let n=document.getElementById("userMessage"),s=document.getElementById("daysExpire");if(n){let i=n.value;var r=CryptoJS.AES.encrypt(i,t).toString();console.log(r),console.log(s.value),await I(r,e)}},children:"Generate Encrypted Link"}),(0,s.jsxs)(l.Z,{variant:"body2",component:"p",children:["By use of this system you agree to the ",(0,s.jsx)(c.Z,{href:"/about",children:"terms and conditions"}),"."]})]})})]})})})}),n&&(0,s.jsxs)(d.ZP,{container:!0,spacing:2,children:[(0,s.jsx)(d.ZP,{item:!0,xs:12,sm:12,spacing:2,children:(0,s.jsx)(h.Z,{elevation:6,sx:{m:3,p:4},children:(0,s.jsxs)(d.ZP,{container:!0,spacing:2,children:[(0,s.jsx)(d.ZP,{item:!0,xs:12,sm:8,spacing:2,children:(0,s.jsx)(x.Z,{fullWidth:!0,multiline:!0,rows:2,label:"encrypted.link URL",InputLabelProps:{shrink:!0},id:"outputUrl"})}),(0,s.jsx)(d.ZP,{item:!0,xs:12,sm:4,spacing:2,sx:{alignItems:"center",justifyContent:"center"},children:(0,s.jsxs)(a.Z,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[(0,s.jsx)(m.Z,{variant:"contained",fullWidth:!0,sx:{m:2},id:"copyButton","data-clipboard-target":"#outputUrl",children:"Copy Link to Clipboard"}),(0,s.jsxs)(l.Z,{variant:"body2",component:"p",children:["By use of this system you agree to the ",(0,s.jsx)(c.Z,{href:"/about",children:"terms and conditions"}),"."]})]})})]})})}),(0,s.jsx)(g.default,{id:"clipboard-script",children:'\n                var copyButton = document.getElementById("copyButton");\n                new ClipboardJS(copyButton);\n              '})]}),(0,s.jsx)(o.Z,{}),(0,s.jsx)(u.Z,{})]})})}},4738:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var s=n(7437);n(2265);var r=n(3719);function i(){return(0,s.jsxs)(r.Z,{variant:"body2",color:"text.secondary",align:"center",children:["Copyright \xa9 ",new Date().getFullYear()," - All rights reserved."]})}},66:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var s=n(7437);n(2265);var r=n(1665),i=n(320),l=n(3719);function a(e){return(0,s.jsx)(i.Z,{...e,children:(0,s.jsx)("path",{d:"M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9v1zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3-5.74 0-3.86-3.14-7-7-7zm2.85 11.1l-.85.6V16h-4v-2.3l-.85-.6C7.8 12.16 7 10.63 7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 1.63-.8 3.16-2.15 4.1z"})})}function c(){return(0,s.jsxs)(l.Z,{sx:{mt:6,mb:3,color:"text.secondary"},children:[(0,s.jsx)(a,{sx:{mr:1,verticalAlign:"middle"}}),"Learn more ",(0,s.jsx)(r.Z,{href:"/about",children:"about"})," how this works."]})}}},function(e){e.O(0,[16,120,383,561,52,971,23,744],function(){return e(e.s=6714)}),_N_E=e.O()}]);