PageSourceSearch

https://spmweb.unimedcampinas.com.br/_next/static/chunks/pages/fin…/registrar-5e047825481ee191.js

js unimedcampinas.com.br collected 2026-09-24 10:39:56 UTC 9,350 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3974],{74995:function(e,n,t){"use strict";t.d(n,{g:function(){return c}});var r=t(67294),i=t(83234),a=t(83961),o=t(54520),l=(...e)=>e.filter(Boolean).join(" "),s=["h","minH","height","minHeight"],c=(0,a.Gp)((e,n)=>{let t=(0,a.mq)("Textarea",e),{className:c,rows:u,...d}=(0,o.Lr)(e),f=(0,i.Yp)(d),m=u?function(e,n=[]){let t=Object.assign({},e);for(let r of n)r in t&&delete t[r];return t}(t,s):t;return r.createElement(a.m$.textarea,{ref:n,rows:u,...f,className:l("chakra-textarea",c),__css:m})});c.displayName="Textarea"},41289:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/financeiro/outras-solicitacoes-financeiras/registrar",function(){return t(67381)}])},67381:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return E}});var r=t(85893),i=t(2962),a=t(45798),o=t(17751),l=t(10019),s=t(97),c=t(74995),u=t(82580),d=t(3784),f=t(1874),m=t(68296),p=t(67294),x=t(88767),h=t(11163),g=t.n(h),v=t(14177),j=t(37098),b=t(21194),y=t(94454),Z=async e=>{let{obs:n,protocol_ans:t,files:r}=e;try{let i=r.map(e=>({nome_arquivo:e.name,arquivo_base64:e.rawContent})),a=await (0,y.F)({callId:"sendDocumentToAvailableDocuments",url:"".concat(y.QH,"/wspm0120/registrar-outra-solicitacao-financeira"),method:"POST",needToken:!0,params:{observacao:n,protocolo_ans:t,arquivos:i}});return{error:null,request:a.request.data.msg}}catch(o){return{error:"server",request:null}}};let w=(0,p.createContext)({}),_=e=>{let{children:n}=e,{successMessage:t,errorMessage:i}=(0,j.Z)(),a=(0,x.useMutation)(Z,{onSuccess:e=>e.error?i(e.errorMessage):(g().push(b.Z.financial().otherFinancialRequests),t(e.request))}),o=(0,p.useCallback)(async e=>{let{files:n,obs:t}=e;if(!n||0===n.length)return i("O arquivo \xe9 obrigat\xf3rio!");let r=[];for(let o of n){let l=await (0,v.Z)(o);r.push(l)}return r?""===t?i("Observa\xe7\xe3o n\xe3o informada!"):void a.mutate({obs:t,protocol_ans:"",files:r}):i("Ocorreu um arro ao processar o arquivo!")},[i,a]),l=(0,p.useMemo)(()=>({isLoadingDocuments:!0,handleAttachDocument:o,isAttachingDocument:a.isLoading}),[o,a.isLoading]);return(0,r.jsxs)(w.Provider,{value:l,children:[" ",n," "]})},P=()=>{let e=(0,p.useContext)(w);if(!e)throw Error("useController must be used within an UseControllerProvider");return e};var C=t(7297),q=t(186);function N(){let e=(0,C.Z)(["\n  footer {\n    button {\n      margin-bottom: 1rem;\n    }\n  }\n"]);return N=function(){return e},e}let k=q.ZP.form(N()),F=()=>{let{isAttachingDocument:e,handleAttachDocument:n}=P();return(0,r.jsx)(u.J9,{initialValues:{files:[],fileName:"",obs:""},onSubmit:n,children(n){let{setFieldValue:t,handleSubmit:i,values:a,errors:o,touched:l,isSubmitting:s}=n;return(0,r.jsxs)(k,{onSubmit:i,children:[(0,r.jsx)(m.X,{columns:"1fr 1fr",children:(0,r.jsx)(c.g,{id:"obs",placeholder:"Observa\xe7\xe3o",value:a.obs,onChange:e=>t("obs",e.target.value)})}),(0,r.jsx)(f.Z,{id:"file",name:"file",emptyLabel:"Selecionar Arquivo",selectedLabel:"Arquivo",handleFileChange(e){t("files",[...a.files,e]),t("fileName",e.name)},error:l.fileName&&o.fileName&&o.fileName||void 0,allowedFileTypes:["PDF"]}),(0,r.jsx)("ul",{children:a.files.map((e,n)=>(0,r.jsxs)("li",{children:[e.name,(0,r.jsx)("button",{type:"button",onClick(){let e=a.files.filter((e,t)=>t!==n);t("files",e)},style:{marginLeft:"8px",color:"red",background:"none",border:"none",cursor:"pointer"},children:"Remover"})]},n))}),(0,r.jsx)("br",{}),(0,r.jsx)("footer",{children:(0,r.jsx)(d.Z,{theme:"mainGreen",isLoading:s||e,type:"submit",text:"Enviar"})})]})}})},L=()=>(0,r.jsxs)(l._,{children:[(0,r.jsx)(s.V,{children:"Registrar Outras Solicita\xe7\xf5es Financeiras"}),(0,r.jsx)(_,{children:(0,r.jsx)(F,{})})]});var O=t(85944);let T=()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.PB,{title:"".concat(O.Z.title," - Registrar outras solicita\xe7\xf5es")}),(0,r.jsx)(a.Z,{children:(0,r.jsx)(L,{})})]});var E=(0,o.Z)(T)},1874:function(e,n,t){"use strict";t.d(n,{Z:function(){return g}});var r=t(85893),i=t(67294),a=t(73582),o=t(99603),l=t(37098),s=t(4787),c=[{id:"PDF",accept:["application/pdf","image/pdf"]},{id:"JPG",accept:["image/jpeg","image/jpg"]},{id:"PNG",accept:["image/png"]},{id:"DOC",accept:["application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"]},{id:"XLS",accept:["application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]},{id:"CSV",accept:["text/csv"]},{id:"TXT",accept:["text/plain"]},{id:"ZIP",accept:["text/txt"]},{id:"GIF",accept:["image/gif"]}],u=t(7297),d=t(186);function f(){let e=(0,u.Z)(["\n  input[type='file'] {\n    display: none;\n  }\n\n  label {\n    display: inline-block;\n    cursor: pointer;\n\n    font-size: 1rem;\n    font-family: ",";\n    color: ",";\n\n    margin-bottom: 0.5rem;\n\n    span {\n      font-family: inherit;\n      font-size: inherit;\n\n      display: flex;\n      flex-direction: row;\n      align-items: center;\n      gap: 0.5rem;\n\n      .required {\n        color: ",";\n      }\n\n      svg {\n        width: 1rem;\n        height: 1rem;\n\n        margin-top: 0.2rem;\n      }\n    }\n  }\n"]);return f=function(){return e},e}function m(){let e=(0,u.Z)(["\n  font-family: ",";\n\n  span {\n    font-family: ",";\n  }\n\n  > span {\n    display: inline-flex;\n    flex-direction: row;\n    flex-wrap: wrap;\n    gap: 0.3rem;\n\n    margin-left: 0.4rem;\n\n    > span {\n      &:after {\n        content: ', ';\n        display: inline-block;\n      }\n    }\n\n    > span:nth-last-of-type(2) {\n      &:after {\n        content: 'e';\n        padding-left: 0.3rem;\n        display: inline-block;\n      }\n    }\n    > span:nth-last-of-type(1) {\n      &:after {\n        content: '.';\n        display: inline-block;\n      }\n    }\n  }\n"]);return m=function(){return e},e}let p=d.ZP.div(f(),e=>{let{theme:n}=e;return n.font.bold},e=>{let{theme:n}=e;return n.colors.mainGreen.regular.color},e=>{let{theme:n}=e;return n.colors.danger.color}),x=d.ZP.p(m(),e=>{let{theme:n}=e;return n.font.regularItalic},e=>{let{theme:n}=e;return n.font.regularItalic}),h=(0,i.forwardRef)((e,n)=>{let{emptyLabel:t,selectedLabel:u,lastFileName:d,id:f,name:m,defaultFileName:h,error:g,handleFileChange:v,allowedFileTypes:j=["PDF"],isRequired:b=!1}=e,{errorMessage:y}=(0,l.Z)(),[Z,w]=(0,i.useState)(void 0),_=(0,i.useRef)(null);(0,i.useImperativeHandle)(n,()=>({clear(){w(void 0),_.current.value=""}})),(0,i.useEffect)(()=>{w(h)},[h]);let P=(0,i.useMemo)(()=>Z||d||null,[d,Z]),C=(0,i.useMemo)(()=>
1{if(j&&j.length>0){let e=[];return j.forEach(n=>{let t=c.find(e=>e.id===n);t&&e.push(...t.accept)}),e}return["image/*"]},[j]),q=(0,i.useCallback)(e=>{if(!e)return;let n=e[0];if(n){if(!C.includes(n.type.toLocaleLowerCase()))return y("Formato de arquivo n\xe3o permitido.");w(n.name),v(n)}},[C,y,v]);return(0,r.jsxs)(p,{children:[(0,r.jsx)("input",{ref:_,type:"file",onChange:e=>q(e.target.files),id:f||"",name:m,accept:C.join(",")}),(0,r.jsx)("label",{htmlFor:m,children:P?(0,r.jsxs)("span",{children:["".concat(u,": ").concat(P),(0,r.jsx)(o.G,{icon:a.T80}),b&&(0,r.jsx)("span",{className:"required",children:"*"})]}):(0,r.jsx)(r.Fragment,{children:"+ ".concat(t)})}),(0,r.jsxs)(x,{children:["Arquivos permitidos:",(0,r.jsx)("span",{children:j.map((e,n)=>(0,r.jsx)("span",{children:".".concat(e.toLocaleLowerCase())},n))})]}),g&&(0,r.jsx)(s.jj,{children:g})]})});var g=h},10019:function(e,n,t){"use strict";t.d(n,{_:function(){return o}});var r=t(7297),i=t(186);function a(){let e=(0,r.Z)(["\n  display: flex;\n  flex-direction: column;\n\n  width: 100%;\n  height: 100%;\n\n  padding-top: 3rem;\n\n  @media (max-width: 991px) {\n    padding-top: 2rem;\n  }\n"]);return a=function(){return e},e}let o=i.ZP.div(a())},97:function(e,n,t){"use strict";t.d(n,{V:function(){return o}});var r=t(7297),i=t(186);function a(){let e=(0,r.Z)(["\n  font-size: 1rem;\n  line-height: 1.1rem;\n  text-transform: uppercase;\n  color: ",";\n"]);return a=function(){return e},e}let o=i.ZP.h1(a(),e=>{let{theme:n}=e;return n.colors.title})},45798:function(e,n,t){"use strict";var r=t(85893),i=t(5413),a=t(94050),o=t(68296),l=t(18061),s=t(29246),c=t(99188),u=t(59716),d=t(99890);let f=e=>{let{children:n}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(d.W2,{className:"template-default",children:[(0,r.jsx)(d.xN,{children:(0,r.jsx)(c.Z,{})}),(0,r.jsxs)(d.VY,{children:[(0,r.jsx)(l.Z,{}),(0,r.jsx)(o.i,{children:(0,r.jsx)(i.Z,{children:n})}),(0,r.jsx)(d.$_,{children:(0,r.jsx)(a.Z,{})})]})]}),(0,r.jsx)(u.Z,{}),(0,r.jsx)(s.Z,{})]})};n.Z=f},14177:function(e,n,t){"use strict";var r=t(22920);n.Z=async(e,n)=>new Promise(t=>{try{let i=new FileReader;i.readAsDataURL(e),i.onloadend=()=>{let r=String(i.result);if(r){let[a,o]=r.split(";base64,"),l=e.name.includes(e.type)?e.name:"".concat(e.name,".").concat(e.type),s={mimeType:a,content:r,rawContent:o,extension:e.type,name:e.name,documentType:n,filename:l};return t(s)}return t(null)}}catch(a){console.log(a),r.Am.error("Ocorreu um erro desconhecido ao processar o seu arquivo. Por favor, selecione novamente o arquivo e tente de novo.",{position:"bottom-right",autoClose:5e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0})}})}},function(e){e.O(0,[3512,8051,2247,5726,3662,7691,9870,2679,1978,2425,4398,9805,757,8278,9774,2888,179],function(){return e(e.s=41289)}),_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.