1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6682],{44012:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/code-editor123",function(){return n(49387)}])},48604:function(e,t,n){"use strict";n.d(t,{Z:function(){return I}});var r=n(85893),o=n(59417),i=n(67814),c=n(26847),s=n(29061),u=n(67294),l=n(53637),a=n(45697),f=n.n(a),p=n(67955),d=n(22040);function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},y.apply(this,arguments)}function m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function v(e,t){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},v(e,t)}function j(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return w(this,n)}}function w(e,t){if(t&&("object"===h(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return x(e)}function x(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function O(e){return O=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},O(e)}var Z=["defaultOpen"],P=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&v(e,t)}(i,e);var t,n,r,o=j(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,e)).state={isOpen:e.defaultOpen||!1},t.toggle=t.toggle.bind(x(t)),t}return t=i,(n=[{key:"toggle",value:function(e){var t=this;this.setState((function(e){return{isOpen:!e.isOpen}}),(function(){t.props.onToggle&&t.props.onToggle(e,t.state.isOpen)}))}},{key:"render",value:function(){return u.createElement(p.Z,y({isOpen:this.state.isOpen,toggle:this.toggle},(0,d.CE)(this.props,Z)))}}])&&m(t.prototype,n),r&&m(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(u.Component);P.propTypes=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach((function(t){g(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({defaultOpen:f().bool,onToggle:f().func},p.Z.propTypes);var _=n(98842),N=n(28055),E=n(38824),k=n(84082),R=n(35773),S=n(95305),T=n(89163),C=n(3126),M=n(87261),L=n(96076),q=n(95541),F=n(19201),z=n(89885),A=n(93520);function I(e){var t=e.isMobileView,n=(0,u.useContext)(z.Z),a=n.appConfig,f=n.toggleAuthModal,p=n.currentUser,d=n.setIsLogin,h=(0,u.useState)(),b=h[0],g=h[1],y=(0,u.useState)(),m=y[0],v=y[1],j=(0,u.useState)(),w=j[0],x=j[1],O=(0,u.useState)(!1),Z=O[0],I=O[1],G=(0,u.useState)(L.pw[0]),U=G[0],D=G[1],V=(0,u.useState)(!1),B=V[0],X=V[1],Y=(0,u.useRef)(null),Q=(0,u.useMemo)((function(){return(0,A.hb)(null===a||void 0===a?void 0:a.web_hideGenerateCode)}),[]),H=function(){var e=(Y.current.value||"").trim();if(!t&&!p)return d(!0),void f();var n={input:e,script:b,language:U.apiLanguage,versionIndex:U.version};x(!0),s.Z.post("".concat(window.location.origin,"/api/compile-code"),n).then((function(e){v(e.data.output)})).finally((function(){x(!1)})).catch((function(e){F.A.error("Error while compiling the code")}))};return(0,r.jsxs)(l.Z,{id:"codeEditor",className:"code-editor bg-dark pt-3",fluid:!0,children:[(0,r.jsxs)("div",{className:"mb-3 d-flex align-items-center flex-wrap",children:[(0,r.jsxs)(P,{className:"me-auto",children:[(0,r.jsx)(_.Z,{caret:!0,children:U.title}),(0,r.jsx)(N.Z,{children:L.pw.map((function(e){return(0,r.jsx)(E.Z,{onClick:function(){return D(e)},children:e.title},e.apiLanguage)}))})]}),t?(0,r.jsx)(k.Z,{disabled:w,color:"link",className:"px-2 py-0 me-1",onClick:H,children:(0,r.jsx)(i.G,{color:"white",icon:w?o.LM3:o.zc,spin:w,size:"2x"})}):(0,r.jsxs)(k.Z,{disabled:w,color:"success",className:" font-semi-bold",onClick:H,children:[(0,r.jsx)(i.G,{icon:w?o.LM3:o.zc,spin:w,className:"me-2"}),"Execute"]}),!t&&(0,r.jsx)(k.Z,{color:"link",className:"pe-2",children:(0,r.jsx)(i.G,{size:"lg",color:"white",icon:Z?o.Qj4:o.TL5,onClick:function(){var e=document.getElementById("codeEditor");e&&("function"===typeof e.requestFullscreen?e.requestFullscreen():"function"===typeof e.mozRequestFullscreen?e.mozRequestFullscreen():"function"===typeof e.webkitRequestFullscreen?e.webkitRequestFullscreen():"function"===typeof e.msRequestFullscreen?e.msRequestFullscreen():console.error("fullscreen is not available"),I(!0),document.fullscreenElement&&(document.exitFullscreen(),I(!1)))}})})]}),(0,r.jsxs)(R.Z,{children:[(0,r.jsx)(S.Z,{md:"8",className:"mb-3",children:(0,r.jsx)(c.Z,{height:"80vh",theme:"vs-dark",language:U.editorLanguage,value:b,onChange:function(e){return g(e)}})}),(0,r.jsxs)(S.Z,{md:"4",className:"text-white",children:[!Q&&(0,r.jsx)(q.Z,{isMobileView:t,isOpen:B,toggle:function(){return X(!B)},setOutput:function(e){return g(e)},language:U.editorLanguage}),(0,r.jsxs)(T.Z,{children:[(0,r.jsx)(C.Z,{className:"text-white",children:"INPUT"}),(0,r.jsx)(M.Z,{innerRef:Y,type:"textarea",rows:"5",className:"bg-secondary border-0 text-white",placeholder:"Your input goes here.."})]}),(0,r.jsxs)(T.Z,{className:"text-white",children:[(0,r.jsx)(C.Z,{children:"OUTPUT"}),(0,r.jsx)(M.Z,{type:"textarea",rows:"5",placeholder:"Your output will be displayed here..",className:"bg-secondary h-100 border-0",value:m,disabled:!0})]})]})]})]})}},95541:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});
1var r=n(85893),o=n(59417),i=n(67814),c=n(29061),s=n(67294),u=n(19201),l=n(89163),a=n(3126),f=n(84082),p=n(87261),d=n(89885);function h(e){var t=e.isMobileView,n=e.language,h=e.setOutput,b=(0,s.useContext)(d.Z),g=b.toggleAuthModal,y=b.currentUser,m=b.setIsLogin,v=(0,s.useState)(),j=v[0],w=v[1],x=(0,s.useRef)(null);return(0,r.jsxs)(l.Z,{children:[(0,r.jsxs)("div",{className:"d-flex justify-content-between align-items-end mb-2",children:[(0,r.jsx)(a.Z,{className:"mb-0 text-white",children:"AI PROMPT:"}),(0,r.jsxs)(f.Z,{size:"sm",color:"secondary",onClick:function(){var e=x.current.value;if(!t&&!y)return m(!0),void g();e.trim()?(w(!0),c.Z.post("".concat(window.location.origin,"/api/generate-code"),{language:n,instruction:e}).then((function(e){h(e.data.code)})).catch((function(e){var t,n,r;console.error(e),u.A.error(null!==(r=null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.message)&&void 0!==r?r:e.message)})).finally((function(){w(!1)}))):u.A.error("Please provide instructions to generate code.")},disabled:j,children:[(0,r.jsx)(i.G,{icon:j?o.LM3:o.VE0,spin:j,className:"me-2"}),"Generate"]})]}),(0,r.jsx)(p.Z,{innerRef:x,rows:"5",type:"textarea",name:"instructions",placeholder:"Provide instructions to generate code..",className:"bg-secondary border-0 text-white"})]})}},26847:function(e,t,n){"use strict";var r=n(63764);r._m.config({paths:{vs:"https://cdn.jsdelivr.net/npm/[email protected]/min/vs"}}),t.Z=r.ZP},49387:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return u}});var r=n(47568),o=n(97582),i=n(85893),c=n(48604),s=n(73716);function u(){return(0,i.jsx)(c.Z,{isMobileView:!0})}u.layoutTagmango=function(e){var t=e.children;return(0,i.jsx)("div",{children:t})},u.layout=function(e){var t=e.children;return(0,i.jsx)("div",{children:t})},u.getInitialProps=function(){var e=(0,r.Z)((function(e){var t;return(0,o.__generator)(this,(function(n){return t=e.req.headers["user-agent"],[2,{isMobileUserAgent:(0,s.f_)(t)}]}))}));return function(t){return e.apply(this,arguments)}}()}},function(e){e.O(0,[614,6661,3764,3967,9774,2888,179],(function(){return t=44012,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.