1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4705],{99127:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/portal/pages/create",function(){return r(73084)}])},42302:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(85893);function o(e){let{content:t}=e;return(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:t},className:"prose prose-sm max-w-none"})}},79404:function(e,t,r){"use strict";r.d(t,{PK:function(){return a},bF:function(){return o},i0:function(){return s}});var n=r(22920);function o(e){return n.Am.success(e,{position:"top-right",autoClose:5e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light"})}function a(e){return n.Am.error(e,{position:"top-right",autoClose:5e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light"})}function s(e){return n.Am.warn(e,{position:"top-right",autoClose:5e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light"})}},73084:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return N}});var n=r(85893),o=r(12416),a=r(55066),s=r(11163),i=r(67294),c=r(1604),l=r(73656),u=r(67914),d=r(42302),m=r(79404),f=r(52819),h=r(80983),p=r(46477),x=r(70385),g=r(41664),E=r.n(g);function N(){let[e,t]=(0,i.useState)(),[r,c]=(0,i.useState)(x.ScreenType.CUSTOM),[g,N]=(0,i.useState)(x.ScreenEditor.LEXICAL),[b,T]=(0,i.useState)("editor"),[S,j]=(0,i.useState)(),[w,O]=(0,i.useState)(""),_=(0,s.useRouter)(),{query:{categoryId:C,pageId:A}}=_,R=h.h.pagesQueriesRouters.getCategoryById.useQuery({id:C},{enabled:!!C}),L=h.h.pagesQueriesRouters.getScreenById.useQuery({id:A},{enabled:!!A}),I=h.h.pagesMutationsRouters.createScreen.useMutation(),U=h.h.pagesMutationsRouters.updateScreen.useMutation();async function M(e){try{await I.mutateAsync({categoryId:C,content:w,name:e.name,type:r}),(0,m.bF)("Nova tela criada!"),_.push("/portal/pages/".concat(C))}catch(e){console.log(e),(0,m.PK)("N\xe3o foi poss\xedvel criar a nova tela.")}}async function D(e){try{await U.mutateAsync({name:e.name,content:w,categoryId:C,pageId:A,type:r}),(0,m.bF)("Tela atualizada!"),_.push("/portal/pages/".concat(C))}catch(e){console.log(e),(0,m.PK)("N\xe3o foi poss\xedvel atualizar a tela.")}}return((0,i.useEffect)(()=>{R.data&&t(R.data)},[R.data]),(0,i.useEffect)(()=>{L.data&&j(L.data)},[L.data]),e)?(0,n.jsx)(f.Z,{children:(0,n.jsxs)("div",{className:"w-full rounded-lg bg-white",children:[(0,n.jsxs)("div",{className:"flex w-full justify-between",children:[(0,n.jsx)("h3",{className:"px-4 py-4 text-lg font-semibold text-gray-900",children:e.name}),(0,n.jsx)(y,{typeOfView:b,setTypeOfView:T,screenType:r})]}),(0,n.jsx)("div",{className:"h-[2px] w-full bg-gray-900"}),(0,n.jsx)("div",{className:"h-auto w-full ".concat("editor"==b?"block":"hidden"," "),children:(0,n.jsx)(a.J9,{className:"h-auto w-full ",initialValues:{name:S?S.name:""},onSubmit:(e,t)=>{A?D(e):M(e)},validationSchema:(0,l.toFormikValidationSchema)(v),children:(0,n.jsx)(a.l0,{children:(0,n.jsxs)("div",{className:"flex flex-col gap-4 px-4 py-4 ",children:[(0,n.jsxs)("div",{className:"my-4 flex h-14 w-full flex-col ",children:[(0,n.jsxs)(o.__,{htmlFor:"name",className:"text-md font-semibold",children:[" ","Nome da P\xe1gina"]}),(0,n.jsx)(a.gN,{id:"name",name:"name",placeholder:"Nome",className:"mt-1 h-10 w-full rounded-md border-gray-200 bg-gray-50 text-sm text-gray-700 shadow-sm"}),(0,n.jsx)(a.Bc,{name:"name",component:"div",className:"ml-2 text-red-500"})]}),(0,n.jsxs)("div",{className:"flex w-full flex-col justify-between ",children:[(0,n.jsx)("label",{className:"font-semibold",htmlFor:"screenType",children:"Tipo de Tela"}),(0,n.jsx)(a.gN,{as:"select",id:"screenType",name:"screenType",className:"mt-1 h-10 w-fit cursor-pointer overflow-y-hidden rounded-md border-gray-200 bg-gray-50 text-sm text-gray-700 shadow-sm ",onChange:e=>{let t=e.target.value;t==x.ScreenType.INTERNAL?O("/course"):O(""),N(x.ScreenEditor.LEXICAL),c(t)},children:Object.entries(p.TW).map((e,t)=>(0,n.jsx)("option",{value:e[0],children:e[1]},t))}),(0,n.jsx)(a.Bc,{name:"gender",component:"div",className:"ml-2 text-red-500"})]}
1),r===x.ScreenType.EXTERNAL&&(0,n.jsxs)("div",{className:"my-4 flex h-14 w-full flex-col ",children:[(0,n.jsx)(o.__,{htmlFor:"externalURL",className:"text-md font-semibold",children:"URL da P\xe1gina"}),(0,n.jsx)("input",{id:"externalURL",name:"externalURL",placeholder:"URL da P\xe1gina",className:"mt-1 h-10 w-full rounded-md border-gray-200 bg-gray-50 text-sm text-gray-700 shadow-sm",onChange:e=>O(e.target.value)}),(0,n.jsx)(a.Bc,{name:"externalURL",component:"div",className:"ml-2 text-red-500"})]}),r===x.ScreenType.INTERNAL&&(0,n.jsxs)("div",{className:"flex w-full flex-col justify-between ",children:[(0,n.jsx)("label",{className:"font-semibold",htmlFor:"screen",children:"Tela"}),(0,n.jsx)(a.gN,{as:"select",id:"screen",name:"screen",className:"mt-1 h-10 w-fit cursor-pointer overflow-y-hidden rounded-md border-gray-200 bg-gray-50 text-sm text-gray-700 shadow-sm ",onChange:e=>{O(e.target.value)},children:(0,n.jsx)("option",{value:"/course",children:"Listagem de Cursos"})}),(0,n.jsx)(a.Bc,{name:"gender",component:"div",className:"ml-2 text-red-500"})]}),r===x.ScreenType.CUSTOM&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex w-full flex-col justify-between ",children:[(0,n.jsx)("label",{className:"font-semibold",htmlFor:"screenEditor",children:"Tipo do Editor"}),(0,n.jsx)(a.gN,{as:"select",id:"screenEditor",name:"screenEditor",className:"mt-1 h-10 w-fit cursor-pointer overflow-y-hidden rounded-md border-gray-200 bg-gray-50 text-sm text-gray-700 shadow-sm ",onChange:e=>{N(e.target.value)},children:Object.entries(p.GR).map((e,t)=>(0,n.jsx)("option",{value:e[0],children:e[1]},t))})]}),g===x.ScreenEditor.LEXICAL&&(0,n.jsxs)("div",{className:"mt-4",children:[(0,n.jsx)("label",{className:"font-semibold",htmlFor:"gender",children:"Conte\xfado"}),(0,n.jsx)("div",{className:"mt-2",children:(0,n.jsx)(u.Z,{onChange:(e,t,r)=>{O(r)},previousContent:(null==S?void 0:S.editor)===x.ScreenEditor.LEXICAL?null==S?void 0:S.content:void 0})})]})]}),r===x.ScreenType.CUSTOM&&g===x.ScreenEditor.PUCK?(0,n.jsx)(o.zx,{as:E(),href:"/portal/pages/create/puck?categoryId=".concat(C).concat(A?"&pageId=".concat(A):""),color:"blue",className:"mt-4 w-fit px-4 font-semibold",children:"Editar Tela"}):(0,n.jsx)(o.zx,{type:"submit",color:"blue",className:"w-1/6 font-semibold",children:"Salvar Altera\xe7\xf5es"})]})})})}),(0,n.jsx)("div",{className:"px-4 py-4 ".concat("preview"==b?"block":"hidden"),children:(0,n.jsx)(d.Z,{content:w})})]})}):(0,n.jsxs)(f.Z,{children:[(0,n.jsx)(o.$j,{})," "]})}function y(e){let{setTypeOfView:t,typeOfView:r,screenType:o}=e,a="text-gray-900 bg-white border-r-2 border-l-2 border-gray-200";return o==x.ScreenType.CUSTOM?(0,n.jsxs)("ul",{className:"flex flex-wrap border-b border-gray-200 text-center text-sm font-medium text-gray-900 ",children:[(0,n.jsx)("li",{onClick:()=>{t("editor")},children:(0,n.jsx)("a",{"aria-current":"page",className:"active inline-block bg-gray-50 p-4 px-8 hover:text-gray-600 ".concat("editor"==r&&a),children:"Edi\xe7\xe3o"})}),(0,n.jsx)("li",{onClick:()=>{t("preview")},children:(0,n.jsx)("a",{className:"inline-block bg-gray-50 p-4 hover:text-gray-600 ".concat("preview"==r&&a),children:"Pr\xe9-Visualiza\xe7\xe3o"})})]}):(0,n.jsx)(n.Fragment,{})}let v=c.z.object({name:c.z.string({required_error:"Informe o nome da p\xe1gina."})})},46477:function(e,t,r){"use strict";r.d(t,{FW:function(){return n},GR:function(){return m},QZ:function(){return a},Sx:function(){return i},TW:function(){return d},ZD:function(){return l},aq:function(){return o},k:function(){return u},oG:function(){return s},zB:function(){return c}});let n={USER:"Usu\xe1rio",ADMIN:"Administrador",TEACHER:"Professor",COORDINATOR:"Coordenador",STUDENT:"Estudante",SECRETARY:"Secret\xe1rio",FINANCIAL:"Financeiro"},o={NOT_VISIBLE:"N\xe3o est\xe1 vis\xedvel",OTHER:"Outro",INCORRET:"Documento incorreto",ILLEGIBLE:"Documento ileg\xedvel",INVALID:"Documento inv\xe1lido"},a={EAD:"EAD (Educa\xe7\xe3o a dist\xe2ncia)",INPERSON:"Presencial"},s={FULLTIME:"Integral",MORNING:"Matutino",AFTERNOON:"Vespertino",NIGHT:"Noturno",ASYNCHRONOUS:"Ass\xedncrono"}
1,i={MONTHLY:"Mensal",QUARTERLY:"Trimestral ",SEMIANNUAL:"Semestral",ANNUAL:"Anual"},c={MALE:"Homem",FEMALE:"Mulher",OTHER:"Outro",NOT_SPECIFIED:"N\xe3o Informado"},l={COMPLETED:"Aprovado",EQUIVALENT:"Equivalente",NOT_COMPLETED:"Matriculado",PENDING:"Pendente"},u={STUDENT_NAME:"Nome do aluno",STUDENT_DOCUMENT:"Documento do aluno",STUDENT_BIRTH_DATE:"Data de nascimento do aluno",COURSE_NAME:"Nome do curso",COURSE_MODALITY:"Modalidade do curso",COURSE_FREQUENCY:"Frequ\xeancia do curso",COURSE_EDUCATION_LEVEL:"N\xedvel de educa\xe7\xe3o do curso",COURSE_DEGREE:"Grau do curso",COURSE_SCHEDULE:"Turno do curso",COURSE_COORDINATOR_NAME:"Nome do coordenador do curso",SEMESTER_NAME:"Nome do per\xedodo",SEMESTER_START_DATE:"Data de in\xedcio do per\xedodo",SEMESTER_END_DATE:"Data de fim do per\xedodo"},d={CUSTOM:"Customizada",INTERNAL:"Fixa",EXTERNAL:"Externa"},m={LEXICAL:"Editor de Texto",PUCK:"Editor Visual"}},11163:function(e,t,r){e.exports=r(9090)},73656:function(e,t){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,a){function s(e){try{c(n.next(e))}catch(e){a(e)}}function i(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,i)}c((n=n.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var r,n,o,a,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(a){return function(i){return function(a){if(r)throw TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,i])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.toFormikValidate=t.toFormikValidationSchema=t.ValidationError=void 0;var s=function(e){function t(t){var r=e.call(this,t)||this;return r.name="ValidationError",r.inner=[],r}return n(t,e),t}(Error);t.ValidationError=s,t.toFormikValidationSchema=function(e,t){return{validate:function(r){return o(this,void 0,void 0,function(){return a(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,e.parseAsync(r,t)];case 1:return n.sent(),[3,3];case 2:var o,a;throw(a=new s((o=n.sent()).message)).inner=o.errors.map(function(e){return{message:e.message,path:e.path.join(".")}}),a;case 3:return[2]}})})}}},t.toFormikValidate=function(e,t){var r=this;return function(n){return o(r,void 0,void 0,function(){var r;return a(this,function(o){switch(o.label){case 0:return[4,e.safeParseAsync(n,t)];case 1:if(!(r=o.sent()).success)return[2,function(e){for(var t={},r=0,n=e.errors;r<n.length;r++){var o=n[r];t[o.path.filter(Boolean).join(".")]=o.message}return t}(r.error)];return[2]}})})}}}},function(e){e.O(0,[9260,1664,385,9332,5066,2718,1813,2819,7914,2888,9774,179],function(){return e(e.s=99127)}),_N_E=e.O()}]);
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.