@sysvale/citizen-components 1.6.0 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -11,4 +11,4 @@
|
|
|
11
11
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(a){return a instanceof this?a:new this(a)}static concat(a,...r){const n=new this(a);return r.forEach(i=>n.set(i)),n}static accessor(a){const n=(this[ga]=this[ga]={accessors:{}}).accessors,i=this.prototype;function t(o){const l=oe(o);n[l]||(os(i,o),n[l]=!0)}return d.isArray(a)?a.forEach(t):t(a),this}};N.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);d.reduceDescriptors(N.prototype,({value:e},a)=>{let r=a[0].toUpperCase()+a.slice(1);return{get:()=>e,set(n){this[r]=n}}});d.freezeMethods(N);function Ne(e,a){const r=this||he,n=a||r,i=N.from(n.headers);let t=n.data;return d.forEach(e,function(l){t=l.call(r,t,i.normalize(),a?a.status:void 0)}),i.normalize(),t}function cr(e){return!!(e&&e.__CANCEL__)}function ne(e,a,r){B.call(this,e??"canceled",B.ERR_CANCELED,a,r),this.name="CanceledError"}d.inherits(ne,B,{__CANCEL__:!0});function dr(e,a,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):a(new B("Request failed with status code "+r.status,[B.ERR_BAD_REQUEST,B.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function us(e){const a=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return a&&a[1]||""}function ls(e,a){e=e||10;const r=new Array(e),n=new Array(e);let i=0,t=0,o;return a=a!==void 0?a:1e3,function(c){const s=Date.now(),F=n[t];o||(o=s),r[i]=c,n[i]=s;let p=t,f=0;for(;p!==i;)f+=r[p++],p=p%e;if(i=(i+1)%e,i===t&&(t=(t+1)%e),s-o<a)return;const b=F&&s-F;return b?Math.round(f*1e3/b):void 0}}function ss(e,a){let r=0,n=1e3/a,i,t;const o=(s,F=Date.now())=>{r=F,i=null,t&&(clearTimeout(t),t=null),e(...s)};return[(...s)=>{const F=Date.now(),p=F-r;p>=n?o(s,F):(i=s,t||(t=setTimeout(()=>{t=null,o(i)},n-p)))},()=>i&&o(i)]}const Se=(e,a,r=3)=>{let n=0;const i=ls(50,250);return ss(t=>{const o=t.loaded,l=t.lengthComputable?t.total:void 0,c=o-n,s=i(c),F=o<=l;n=o;const p={loaded:o,total:l,progress:l?o/l:void 0,bytes:c,rate:s||void 0,estimated:s&&l&&F?(l-o)/s:void 0,event:t,lengthComputable:l!=null,[a?"download":"upload"]:!0};e(p)},r)},fa=(e,a)=>{const r=e!=null;return[n=>a[0]({lengthComputable:r,total:e,loaded:n}),a[1]]},ba=e=>(...a)=>d.asap(()=>e(...a)),cs=L.hasStandardBrowserEnv?((e,a)=>r=>(r=new URL(r,L.origin),e.protocol===r.protocol&&e.host===r.host&&(a||e.port===r.port)))(new URL(L.origin),L.navigator&&/(msie|trident)/i.test(L.navigator.userAgent)):()=>!0,ds=L.hasStandardBrowserEnv?{write(e,a,r,n,i,t){const o=[e+"="+encodeURIComponent(a)];d.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),d.isString(n)&&o.push("path="+n),d.isString(i)&&o.push("domain="+i),t===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const a=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return a?decodeURIComponent(a[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function hs(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Fs(e,a){return a?e.replace(/\/?\/$/,"")+"/"+a.replace(/^\/+/,""):e}function hr(e,a,r){let n=!hs(a);return e&&(n||r==!1)?Fs(e,a):a}const Ca=e=>e instanceof N?{...e}:e;function q(e,a){a=a||{};const r={};function n(s,F,p,f){return d.isPlainObject(s)&&d.isPlainObject(F)?d.merge.call({caseless:f},s,F):d.isPlainObject(F)?d.merge({},F):d.isArray(F)?F.slice():F}function i(s,F,p,f){if(d.isUndefined(F)){if(!d.isUndefined(s))return n(void 0,s,p,f)}else return n(s,F,p,f)}function t(s,F){if(!d.isUndefined(F))return n(void 0,F)}function o(s,F){if(d.isUndefined(F)){if(!d.isUndefined(s))return n(void 0,s)}else return n(void 0,F)}function l(s,F,p){if(p in a)return n(s,F);if(p in e)return n(void 0,s)}const c={url:t,method:t,data:t,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:l,headers:(s,F,p)=>i(Ca(s),Ca(F),p,!0)};return d.forEach(Object.keys({...e,...a}),function(F){const p=c[F]||i,f=p(e[F],a[F],F);d.isUndefined(f)&&p!==l||(r[F]=f)}),r}const Fr=e=>{const a=q({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:t,headers:o,auth:l}=a;if(a.headers=o=N.from(o),a.url=ur(hr(a.baseURL,a.url,a.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&o.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),d.isFormData(r)){if(L.hasStandardBrowserEnv||L.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(d.isFunction(r.getHeaders)){const c=r.getHeaders(),s=["content-type","content-length"];Object.entries(c).forEach(([F,p])=>{s.includes(F.toLowerCase())&&o.set(F,p)})}}if(L.hasStandardBrowserEnv&&(n&&d.isFunction(n)&&(n=n(a)),n||n!==!1&&cs(a.url))){const c=i&&t&&ds.read(t);c&&o.set(i,c)}return a},ms=typeof XMLHttpRequest<"u",ps=ms&&function(e){return new Promise(function(r,n){const i=Fr(e);let t=i.data;const o=N.from(i.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:s}=i,F,p,f,b,h;function y(){b&&b(),h&&h(),i.cancelToken&&i.cancelToken.unsubscribe(F),i.signal&&i.signal.removeEventListener("abort",F)}let m=new XMLHttpRequest;m.open(i.method.toUpperCase(),i.url,!0),m.timeout=i.timeout;function g(){if(!m)return;const D=N.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),k={data:!l||l==="text"||l==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:D,config:e,request:m};dr(function(v){r(v),y()},function(v){n(v),y()},k),m=null}"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.indexOf("file:")===0)||setTimeout(g)},m.onabort=function(){m&&(n(new B("Request aborted",B.ECONNABORTED,e,m)),m=null)},m.onerror=function(w){const k=w&&w.message?w.message:"Network Error",S=new B(k,B.ERR_NETWORK,e,m);S.event=w||null,n(S),m=null},m.ontimeout=function(){let w=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const k=i.transitional||lr;i.timeoutErrorMessage&&(w=i.timeoutErrorMessage),n(new B(w,k.clarifyTimeoutError?B.ETIMEDOUT:B.ECONNABORTED,e,m)),m=null},t===void 0&&o.setContentType(null),"setRequestHeader"in m&&d.forEach(o.toJSON(),function(w,k){m.setRequestHeader(k,w)}),d.isUndefined(i.withCredentials)||(m.withCredentials=!!i.withCredentials),l&&l!=="json"&&(m.responseType=i.responseType),s&&([f,h]=Se(s,!0),m.addEventListener("progress",f)),c&&m.upload&&([p,b]=Se(c),m.upload.addEventListener("progress",p),m.upload.addEventListener("loadend",b)),(i.cancelToken||i.signal)&&(F=D=>{m&&(n(!D||D.type?new ne(null,e,m):D),m.abort(),m=null)},i.cancelToken&&i.cancelToken.subscribe(F),i.signal&&(i.signal.aborted?F():i.signal.addEventListener("abort",F)));const C=us(i.url);if(C&&L.protocols.indexOf(C)===-1){n(new B("Unsupported protocol "+C+":",B.ERR_BAD_REQUEST,e));return}m.send(t||null)})},ys=(e,a)=>{const{length:r}=e=e?e.filter(Boolean):[];if(a||r){let n=new AbortController,i;const t=function(s){if(!i){i=!0,l();const F=s instanceof Error?s:this.reason;n.abort(F instanceof B?F:new ne(F instanceof Error?F.message:F))}};let o=a&&setTimeout(()=>{o=null,t(new B(`timeout ${a} of ms exceeded`,B.ETIMEDOUT))},a);const l=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(s=>{s.unsubscribe?s.unsubscribe(t):s.removeEventListener("abort",t)}),e=null)};e.forEach(s=>s.addEventListener("abort",t));const{signal:c}=n;return c.unsubscribe=()=>d.asap(l),c}},gs=function*(e,a){let r=e.byteLength;if(r<a){yield e;return}let n=0,i;for(;n<r;)i=n+a,yield e.slice(n,i),n=i},fs=async function*(e,a){for await(const r of bs(e))yield*gs(r,a)},bs=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const a=e.getReader();try{for(;;){const{done:r,value:n}=await a.read();if(r)break;yield n}}finally{await a.cancel()}},ka=(e,a,r,n)=>{const i=fs(e,a);let t=0,o,l=c=>{o||(o=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:s,value:F}=await i.next();if(s){l(),c.close();return}let p=F.byteLength;if(r){let f=t+=p;r(f)}c.enqueue(new Uint8Array(F))}catch(s){throw l(s),s}},cancel(c){return l(c),i.return()}},{highWaterMark:2})},Aa=64*1024,{isFunction:fe}=d,Cs=(({Request:e,Response:a})=>({Request:e,Response:a}))(d.global),{ReadableStream:Sa,TextEncoder:Da}=d.global,Ea=(e,...a)=>{try{return!!e(...a)}catch{return!1}},ks=e=>{e=d.merge.call({skipUndefined:!0},Cs,e);const{fetch:a,Request:r,Response:n}=e,i=a?fe(a):typeof fetch=="function",t=fe(r),o=fe(n);if(!i)return!1;const l=i&&fe(Sa),c=i&&(typeof Da=="function"?(h=>y=>h.encode(y))(new Da):async h=>new Uint8Array(await new r(h).arrayBuffer())),s=t&&l&&Ea(()=>{let h=!1;const y=new r(L.origin,{body:new Sa,method:"POST",get duplex(){return h=!0,"half"}}).headers.has("Content-Type");return h&&!y}),F=o&&l&&Ea(()=>d.isReadableStream(new n("").body)),p={stream:F&&(h=>h.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(h=>{!p[h]&&(p[h]=(y,m)=>{let g=y&&y[h];if(g)return g.call(y);throw new B(`Response type '${h}' is not supported`,B.ERR_NOT_SUPPORT,m)})});const f=async h=>{if(h==null)return 0;if(d.isBlob(h))return h.size;if(d.isSpecCompliantForm(h))return(await new r(L.origin,{method:"POST",body:h}).arrayBuffer()).byteLength;if(d.isArrayBufferView(h)||d.isArrayBuffer(h))return h.byteLength;if(d.isURLSearchParams(h)&&(h=h+""),d.isString(h))return(await c(h)).byteLength},b=async(h,y)=>{const m=d.toFiniteNumber(h.getContentLength());return m??f(y)};return async h=>{let{url:y,method:m,data:g,signal:C,cancelToken:D,timeout:w,onDownloadProgress:k,onUploadProgress:S,responseType:v,headers:P,withCredentials:Fe="same-origin",fetchOptions:qe}=Fr(h),Ze=a||fetch;v=v?(v+"").toLowerCase():"text";let me=ys([C,D&&D.toAbortSignal()],w),ie=null;const Y=me&&me.unsubscribe&&(()=>{me.unsubscribe()});let Xe;try{if(S&&s&&m!=="get"&&m!=="head"&&(Xe=await b(P,g))!==0){let z=new r(y,{method:"POST",body:g,duplex:"half"}),X;if(d.isFormData(g)&&(X=z.headers.get("content-type"))&&P.setContentType(X),z.body){const[Te,pe]=fa(Xe,Se(ba(S)));g=ka(z.body,Aa,Te,pe)}}d.isString(Fe)||(Fe=Fe?"include":"omit");const W=t&&"credentials"in r.prototype,Qe={...qe,signal:me,method:m.toUpperCase(),headers:P.normalize().toJSON(),body:g,duplex:"half",credentials:W?Fe:void 0};ie=t&&new r(y,Qe);let J=await(t?Ze(ie,qe):Ze(y,Qe));const ea=F&&(v==="stream"||v==="response");if(F&&(k||ea&&Y)){const z={};["status","statusText","headers"].forEach(aa=>{z[aa]=J[aa]});const X=d.toFiniteNumber(J.headers.get("content-length")),[Te,pe]=k&&fa(X,Se(ba(k),!0))||[];J=new n(ka(J.body,Aa,Te,()=>{pe&&pe(),Y&&Y()}),z)}v=v||"text";let Cr=await p[d.findKey(p,v)||"text"](J,h);return!ea&&Y&&Y(),await new Promise((z,X)=>{dr(z,X,{data:Cr,headers:N.from(J.headers),status:J.status,statusText:J.statusText,config:h,request:ie})})}catch(W){throw Y&&Y(),W&&W.name==="TypeError"&&/Load failed|fetch/i.test(W.message)?Object.assign(new B("Network Error",B.ERR_NETWORK,h,ie),{cause:W.cause||W}):B.from(W,W&&W.code,h,ie)}}},As=new Map,mr=e=>{let a=e?e.env:{};const{fetch:r,Request:n,Response:i}=a,t=[n,i,r];let o=t.length,l=o,c,s,F=As;for(;l--;)c=t[l],s=F.get(c),s===void 0&&F.set(c,s=l?new Map:ks(a)),F=s;return s};mr();const Ve={http:Il,xhr:ps,fetch:{get:mr}};d.forEach(Ve,(e,a)=>{if(e){try{Object.defineProperty(e,"name",{value:a})}catch{}Object.defineProperty(e,"adapterName",{value:a})}});const Ba=e=>`- ${e}`,Ss=e=>d.isFunction(e)||e===null||e===!1,pr={getAdapter:(e,a)=>{e=d.isArray(e)?e:[e];const{length:r}=e;let n,i;const t={};for(let o=0;o<r;o++){n=e[o];let l;if(i=n,!Ss(n)&&(i=Ve[(l=String(n)).toLowerCase()],i===void 0))throw new B(`Unknown adapter '${l}'`);if(i&&(d.isFunction(i)||(i=i.get(a))))break;t[l||"#"+o]=i}if(!i){const o=Object.entries(t).map(([c,s])=>`adapter ${c} `+(s===!1?"is not supported by the environment":"is not available in the build"));let l=r?o.length>1?`since :
|
|
12
12
|
`+o.map(Ba).join(`
|
|
13
13
|
`):" "+Ba(o[0]):"as no adapter specified";throw new B("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return i},adapters:Ve};function xe(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ne(null,e)}function va(e){return xe(e),e.headers=N.from(e.headers),e.data=Ne.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),pr.getAdapter(e.adapter||he.adapter,e)(e).then(function(n){return xe(e),n.data=Ne.call(e,e.transformResponse,n),n.headers=N.from(n.headers),n},function(n){return cr(n)||(xe(e),n&&n.response&&(n.response.data=Ne.call(e,e.transformResponse,n.response),n.response.headers=N.from(n.response.headers))),Promise.reject(n)})}const yr="1.12.2",we={};["object","boolean","number","function","string","symbol"].forEach((e,a)=>{we[e]=function(n){return typeof n===e||"a"+(a<1?"n ":" ")+e}});const wa={};we.transitional=function(a,r,n){function i(t,o){return"[Axios v"+yr+"] Transitional option '"+t+"'"+o+(n?". "+n:"")}return(t,o,l)=>{if(a===!1)throw new B(i(o," has been removed"+(r?" in "+r:"")),B.ERR_DEPRECATED);return r&&!wa[o]&&(wa[o]=!0,console.warn(i(o," has been deprecated since v"+r+" and will be removed in the near future"))),a?a(t,o,l):!0}};we.spelling=function(a){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${a}`),!0)};function Ds(e,a,r){if(typeof e!="object")throw new B("options must be an object",B.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const t=n[i],o=a[t];if(o){const l=e[t],c=l===void 0||o(l,t,e);if(c!==!0)throw new B("option "+t+" must be "+c,B.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new B("Unknown option "+t,B.ERR_BAD_OPTION)}}const ke={assertOptions:Ds,validators:we},I=ke.validators;let _=class{constructor(a){this.defaults=a||{},this.interceptors={request:new ya,response:new ya}}async request(a,r){try{return await this._request(a,r)}catch(n){if(n instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const t=i.stack?i.stack.replace(/^.+\n/,""):"";try{n.stack?t&&!String(n.stack).endsWith(t.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|
14
|
-
`+t):n.stack=t}catch{}}throw n}}_request(a,r){typeof a=="string"?(r=r||{},r.url=a):r=a||{},r=q(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:t}=r;n!==void 0&&ke.assertOptions(n,{silentJSONParsing:I.transitional(I.boolean),forcedJSONParsing:I.transitional(I.boolean),clarifyTimeoutError:I.transitional(I.boolean)},!1),i!=null&&(d.isFunction(i)?r.paramsSerializer={serialize:i}:ke.assertOptions(i,{encode:I.function,serialize:I.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),ke.assertOptions(r,{baseUrl:I.spelling("baseURL"),withXsrfToken:I.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=t&&d.merge(t.common,t[r.method]);t&&d.forEach(["delete","get","head","post","put","patch","common"],h=>{delete t[h]}),r.headers=N.concat(o,t);const l=[];let c=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(r)===!1||(c=c&&y.synchronous,l.unshift(y.fulfilled,y.rejected))});const s=[];this.interceptors.response.forEach(function(y){s.push(y.fulfilled,y.rejected)});let F,p=0,f;if(!c){const h=[va.bind(this),void 0];for(h.unshift(...l),h.push(...s),f=h.length,F=Promise.resolve(r);p<f;)F=F.then(h[p++],h[p++]);return F}f=l.length;let b=r;for(;p<f;){const h=l[p++],y=l[p++];try{b=h(b)}catch(m){y.call(this,m);break}}try{F=va.call(this,b)}catch(h){return Promise.reject(h)}for(p=0,f=s.length;p<f;)F=F.then(s[p++],s[p++]);return F}getUri(a){a=q(this.defaults,a);const r=hr(a.baseURL,a.url,a.allowAbsoluteUrls);return ur(r,a.params,a.paramsSerializer)}};d.forEach(["delete","get","head","options"],function(a){_.prototype[a]=function(r,n){return this.request(q(n||{},{method:a,url:r,data:(n||{}).data}))}});d.forEach(["post","put","patch"],function(a){function r(n){return function(t,o,l){return this.request(q(l||{},{method:a,headers:n?{"Content-Type":"multipart/form-data"}:{},url:t,data:o}))}}_.prototype[a]=r(),_.prototype[a+"Form"]=r(!0)});let Es=class gr{constructor(a){if(typeof a!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(t){r=t});const n=this;this.promise.then(i=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](i);n._listeners=null}),this.promise.then=i=>{let t;const o=new Promise(l=>{n.subscribe(l),t=l}).then(i);return o.cancel=function(){n.unsubscribe(t)},o},a(function(t,o,l){n.reason||(n.reason=new ne(t,o,l),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(a){if(this.reason){a(this.reason);return}this._listeners?this._listeners.push(a):this._listeners=[a]}unsubscribe(a){if(!this._listeners)return;const r=this._listeners.indexOf(a);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const a=new AbortController,r=n=>{a.abort(n)};return this.subscribe(r),a.signal.unsubscribe=()=>this.unsubscribe(r),a.signal}static source(){let a;return{token:new gr(function(i){a=i}),cancel:a}}};function Bs(e){return function(r){return e.apply(null,r)}}function vs(e){return d.isObject(e)&&e.isAxiosError===!0}const je={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(je).forEach(([e,a])=>{je[a]=e});function fr(e){const a=new _(e),r=_a(_.prototype.request,a);return d.extend(r,_.prototype,a,{allOwnKeys:!0}),d.extend(r,a,null,{allOwnKeys:!0}),r.create=function(i){return fr(q(e,i))},r}const M=fr(he);M.Axios=_;M.CanceledError=ne;M.CancelToken=Es;M.isCancel=cr;M.VERSION=yr;M.toFormData=ve;M.AxiosError=B;M.Cancel=M.CanceledError;M.all=function(a){return Promise.all(a)};M.spread=Bs;M.isAxiosError=vs;M.mergeConfig=q;M.AxiosHeaders=N;M.formToJSON=e=>sr(d.isHTMLForm(e)?new FormData(e):e);M.getAdapter=pr.getAdapter;M.HttpStatusCode=je;M.default=M;const{Axios:Zs,AxiosError:Xs,CanceledError:Qs,isCancel:ec,CancelToken:ac,VERSION:rc,all:nc,Cancel:ic,isAxiosError:tc,spread:oc,toFormData:uc,AxiosHeaders:lc,HttpStatusCode:sc,formToJSON:cc,getAdapter:dc,mergeConfig:hc}=M;class _e{constructor(){E(this,"config");this.config=Xu()}async index(a){if(!this.isCustomEndpointSet("index"))return await this.delay(1e3),this.indexMock(a);try{return await this.apiCall("index",{params:a})}catch(r){throw this.handleErrors(r)}}async create(a){if(!this.isCustomEndpointSet("create"))return await this.delay(1e3),this.citizenCreationMock(a);try{return await this.apiCall("create",{data:a,method:"post"})}catch(r){throw this.handleErrors(r)}}async apiCall(a,r){const n=this.config.endpoints[a],t={url:`${this.config.apiBaseUrl}${n}`,method:(r==null?void 0:r.method)??"get",headers:{"Content-Type":"application/json"},...(r==null?void 0:r.params)&&{params:r.params},...(r==null?void 0:r.data)&&{data:r.data}};return(await M.request(t)).data}isCustomEndpointSet(a){return this.config.apiBaseUrl&&this.config.endpoints&&this.config.endpoints[a]}handleErrors(a){const r=a instanceof Error?a.message:"Unknown error";throw new Error(`Erro: ${r}`)}async indexMock(a){let r=ha(150);a.searchString&&(r=this.citizensFilter(r,a.searchString));let n=r.slice((a.page-1)*(a.perPage??1),a.page*(a.perPage??1));return a.fields&&a.fields.length&&(n=n.map(t=>Object.fromEntries(Object.entries(t).filter(([o])=>{var l;return((l=a.fields)==null?void 0:l.includes(o))||this.isKeyADefaultField(o)})))),{data:n,meta:{current_page:a.page,per_page:a.perPage??1,total:r.length,last_page:Math.ceil(r.length/(a.perPage??1))}}}async citizenCreationMock(a){return{data:{citizen:{...ha(1)[0],...a}}}}citizensFilter(a,r){return a.filter(n=>n.name.toLowerCase().includes(r.toLowerCase())||this.matchesMaskedField(r,n.cpf,j.removeCpfMask)||this.matchesMaskedField(r,n.cns,j.removeCnsMask))}delay(a){return new Promise(r=>setTimeout(r,a))}matchesMaskedField(a,r,n){return n(a).length&&n(r).includes(n(a))}isKeyADefaultField(a){return a==="name"||a==="cpf"||a==="cns"}}const ws={ref:"dropdown-select",class:"select"},Ts={class:"select__container"},Ms={ref:"select-options",class:"select__options"},Rs={key:0,class:"option__container"},Ls=["onMouseover"],Ps={key:1,class:"option__container"},Hs=u.defineComponent({__name:"SelectDropdown",props:u.mergeModels({options:{},fluid:{type:Boolean,default:!1},optionsField:{},returnValue:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){u.useCssVars(h=>({fe28de54:l.value}));const a=u.useModel(e,"modelValue"),r=e,n=u.ref(0),i=u.ref([]),t=u.ref(),o=u.ref([]),l=u.computed(()=>r.fluid?"100%":"fit-content");u.watch(()=>r.options,h=>{o.value=[],i.value=h},{immediate:!0,flush:"pre"}),u.watch(a,h=>{if(!h){t.value=void 0;return}h instanceof Object?t.value=h:t.value={id:crypto.randomUUID(),[r.optionsField]:h}},{immediate:!0}),u.watch(t,h=>{if(!h){a.value=null;return}i.value.some(m=>m.id===h.id)&&(r.returnValue?a.value=h[r.optionsField]:a.value=h)},{deep:!0});function c(h,y){h&&h instanceof HTMLLIElement&&(o.value[y]=h)}function s(){t.value=Sr.cloneDeep(i.value[n.value])}function F(h){return o.value?o.value[h]:null}function p(h){n.value=h;const y=F(n.value);y==null||y.classList.add("highlight")}function f(){const h=F(n.value);h==null||h.classList.remove("highlight")}function b(h){return h[r.optionsField]}return(h,y)=>{var m;return u.openBlock(),u.createElementBlock("div",ws,[u.createElementVNode("div",Ts,[u.createElementVNode("div",Ms,[((m=i.value)==null?void 0:m.length)>0?(u.openBlock(),u.createElementBlock("ul",Rs,[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(i.value,(g,C)=>(u.openBlock(),u.createElementBlock("li",{key:g.id,ref_for:!0,ref:D=>c(D,C),class:"option__text",onMousedown:u.withModifiers(s,["left"]),onMouseover:D=>p(C),onMouseout:y[0]||(y[0]=D=>f())},[u.renderSlot(h.$slots,"option",{index:C,option:g,value:b(g)},()=>[u.createTextVNode(u.toDisplayString(b(g)),1)],!0)],40,Ls))),128))])):(u.openBlock(),u.createElementBlock("ul",Ps,[...y[1]||(y[1]=[u.createElementVNode("li",{class:"option__text--muted"}," Nenhuma opção encontrada ",-1)])]))],512)])],512)}}}),Ns=(e,a)=>{const r=e.__vccOpts||e;for(const[n,i]of a)r[n]=i;return r},xs=Ns(Hs,[["__scopeId","data-v-16cd9e6c"]]),Gs=u.defineComponent({inheritAttrs:!1,__name:"CitizenSelect",props:u.mergeModels({showButton:{type:Boolean},fluid:{type:Boolean,default:!1},variant:{default:"green"},optionsField:{default:"name"},disabled:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const a=u.inject("useToast"),r=u.useModel(e,"modelValue"),n=e,i=new _e,t=u.ref([]),o=u.ref(!1),l=u.ref(!1),c=u.ref(""),s=u.ref(""),F=u.useTemplateRef("selectContainer"),p=u.computed(()=>n.disabled||o.value||c.value.length<2),f=u.computed(()=>l.value&&s.value!==c.value&&t.value.length?"Buscar*":"Buscar"),b=u.computed(()=>o.value?"Carregando...":c.value.length<2?"Digite 2 ou mais caracteres.":""),h=u.computed(()=>({searchString:c.value,page:1,perPage:1e3}));u.watch(r,()=>{if(!r.value)c.value="";else if(typeof r.value=="string")c.value=r.value;else{const g=r.value[n.optionsField];c.value=typeof g=="string"?g:""}l.value=!1}),Rr(F,()=>{l.value=!1});async function y(){if(!p.value){o.value=!0,s.value=c.value;try{const g=await i.index(h.value);t.value=g.data,l.value=!0}catch(g){l.value=!1;const C=g instanceof Error?g.message:"Unknown error";a().fire({title:"Houve um problema ao buscar as informações as informações do cidadão.",description:C,dismissible:!0,dismissAfter:6e3,autoDismissible:!0,variant:"danger",light:!1})}finally{o.value=!1}}}function m(g){const[C,D,w]=g.split("-").map(Number);return new Date(C,D-1,w).toLocaleDateString("pt-BR")}return(g,C)=>{const D=u.resolveComponent("CdsTextInput"),w=u.resolveComponent("CdsText"),k=u.resolveComponent("CdsFlexbox"),S=u.resolveComponent("CdsButton");return u.openBlock(),u.createBlock(k,{gap:"2",wrap:"no-wrap",fluid:e.fluid},{default:u.withCtx(()=>[u.createVNode(k,{ref_key:"selectContainer",ref:F,direction:"column",fluid:e.fluid},{default:u.withCtx(()=>[u.createVNode(D,u.mergeProps(g.$attrs,{modelValue:c.value,"onUpdate:modelValue":C[0]||(C[0]=v=>c.value=v),modelModifiers:{trim:!0},state:"default",fluid:e.fluid,disabled:o.value||e.disabled,onKeydown:u.withKeys(y,["enter"]),onBlur:C[1]||(C[1]=v=>l.value=!1)}),null,16,["modelValue","fluid","disabled"]),l.value?(u.openBlock(),u.createBlock(xs,{key:0,modelValue:r.value,"onUpdate:modelValue":C[2]||(C[2]=v=>r.value=v),options:t.value,fluid:e.fluid,"options-field":e.optionsField},{option:u.withCtx(({option:v})=>[u.createVNode(w,{as:"subheading-3","no-margin":""},{default:u.withCtx(()=>[u.createVNode(w,{"font-weight":"semibold"},{default:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(v.name),1)]),_:2},1024)]),_:2},1024),u.createVNode(w,{as:"body-2"},{default:u.withCtx(()=>[C[3]||(C[3]=u.createElementVNode("br",null,null,-1)),u.createTextVNode(" CPF: "+u.toDisplayString(u.unref(j.maskCpf)(v.cpf)),1)]),_:2},1024),u.createVNode(w,{as:"body-2"},{default:u.withCtx(()=>[C[4]||(C[4]=u.createElementVNode("br",null,null,-1)),u.createTextVNode(" CNS: "+u.toDisplayString(u.unref(j.maskCns)(v.cns)),1)]),_:2},1024),u.createVNode(w,{as:"body-2"},{default:u.withCtx(()=>[C[5]||(C[5]=u.createElementVNode("br",null,null,-1)),u.createTextVNode(" Data de nascimento: "+u.toDisplayString(m(v.birth_date)),1)]),_:2},1024)]),_:1},8,["modelValue","options","fluid","options-field"])):u.createCommentVNode("",!0)]),_:1},8,["fluid"]),e.showButton?(u.openBlock(),u.createBlock(S,{key:0,class:"mt-6",type:"button",text:f.value,variant:e.variant,"tooltip-text":b.value,disabled:p.value,onButtonClick:y},null,8,["text","variant","tooltip-text","disabled"])):u.createCommentVNode("",!0)]),_:1},8,["fluid"])}}});function Ws(e){const[a,r,n]=e.split("-").map(Number);return!a||!r||!n?"--":new Date(a,r-1,n).toLocaleDateString("pt-BR")}const Is={class:"mt-1"},Os=u.defineComponent({__name:"TableCellRenderer",props:{data:{},field:{},rowIndex:{},colIndex:{},hideEditIcon:{type:Boolean},hideDetailsIcon:{type:Boolean}},emits:["edit","details"],setup(e,{emit:a}){const r=a;function n(l){return l==="F"?"Feminino":"Masculino"}function i(l){switch(l){case"white":return"Branca";case"black":return"Preta";case"brown":return"Parda";case"indigenous":return"Indígena";case"yellow":return"Amarela";default:return"--"}}function t(l){return l?j.maskCpf(l):"--"}function o(l){return l?j.maskCns(l):"--"}return(l,c)=>{const s=u.resolveComponent("CdsText"),F=u.resolveComponent("CdsFlexbox"),p=u.resolveComponent("CdsIconButton");return u.openBlock(),u.createElementBlock("div",null,[e.field==="name"?(u.openBlock(),u.createBlock(F,{key:0,direction:"column",gap:"1"},{default:u.withCtx(()=>[u.createVNode(s,{"no-margin":"",as:"subheading-3","font-weight":"semibold"},{default:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(e.data.name),1)]),_:1}),u.createElementVNode("div",Is,[u.createVNode(s,{"font-weight":"semibold",as:"caption"},{default:u.withCtx(()=>[...c[2]||(c[2]=[u.createTextVNode(" CPF: ",-1)])]),_:1}),u.createVNode(s,{as:"caption"},{default:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(t(e.data.cpf)),1)]),_:1})]),u.createElementVNode("div",null,[u.createVNode(s,{"font-weight":"semibold",as:"caption"},{default:u.withCtx(()=>[...c[3]||(c[3]=[u.createTextVNode(" CNS: ",-1)])]),_:1}),u.createVNode(s,{as:"caption"},{default:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(o(e.data.cns)),1)]),_:1})])]),_:1})):e.field==="address"?(u.openBlock(),u.createBlock(F,{key:1,direction:"column",gap:"1"},{default:u.withCtx(()=>[Object.keys(e.data.address||{}).length?(u.openBlock(),u.createElementBlock(u.Fragment,{key:0},[e.data.address.street?(u.openBlock(),u.createBlock(s,{key:0,as:"caption"},{default:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(e.data.address.street)+", Nº "+u.toDisplayString(e.data.address.number??"--"),1)]),_:1})):u.createCommentVNode("",!0),e.data.address.neighborhood?(u.openBlock(),u.createBlock(s,{key:1,as:"caption"},{default:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(e.data.address.neighborhood),1)]),_:1})):u.createCommentVNode("",!0),e.data.address.city&&e.data.address.uf?(u.openBlock(),u.createBlock(s,{key:2,as:"caption"},{default:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(e.data.address.city)+" / "+u.toDisplayString(e.data.address.uf),1)]),_:1})):u.createCommentVNode("",!0)],64)):(u.openBlock(),u.createBlock(s,{key:1,as:"caption"},{default:u.withCtx(()=>[...c[4]||(c[4]=[u.createTextVNode(" -- ",-1)])]),_:1}))]),_:1})):e.field==="gender"?(u.openBlock(),u.createElementBlock(u.Fragment,{key:2},[u.createTextVNode(u.toDisplayString(n(e.data[e.field])),1)],64)):e.field==="race"?(u.openBlock(),u.createElementBlock(u.Fragment,{key:3},[u.createTextVNode(u.toDisplayString(i(e.data[e.field])),1)],64)):e.field==="birth_date"?(u.openBlock(),u.createElementBlock(u.Fragment,{key:4},[u.createTextVNode(u.toDisplayString(u.unref(Ws)(e.data[e.field])),1)],64)):e.field==="actions"?(u.openBlock(),u.createBlock(F,{key:5,gap:"2",justify:"end"},{default:u.withCtx(()=>[u.renderSlot(l.$slots,"prepend-action"),e.hideDetailsIcon?u.createCommentVNode("",!0):(u.openBlock(),u.createBlock(p,{key:0,size:"sm",icon:"document-text-outline","tooltip-text":"Ver detalhes",onCdsClick:c[0]||(c[0]=f=>r("details"))})),e.hideEditIcon?u.createCommentVNode("",!0):(u.openBlock(),u.createBlock(p,{key:1,size:"sm",icon:"edit-outline","tooltip-text":"Editar",onCdsClick:c[1]||(c[1]=f=>r("edit"))})),u.renderSlot(l.$slots,"append-action")]),_:3})):(u.openBlock(),u.createElementBlock(u.Fragment,{key:6},[u.createTextVNode(" -- ")],64))])}}}),Ks=()=>[{key:"birth_date",label:"Data de nascimento",visible:!1},{key:"address",label:"Endereço",visible:!1},{key:"gender",label:"Sexo",visible:!1},{key:"identification_document",label:"RG",visible:!1},{key:"phone",label:"Telefone",visible:!1},{key:"cellphone",label:"Celular",visible:!1},{key:"race",label:"Raça",visible:!1},{key:"mother_name",label:"Nome da mãe",visible:!1},{key:"cpf_responsible",label:"CPF do responsável",visible:!1},{key:"email",label:"Email",visible:!1}],Js=()=>[{key:"name",label:"Nome"},{key:"birth_date",label:"Data de nascimento"},{key:"address",label:"Endereço"},{key:"actions",label:""}],zs=u.defineComponent({__name:"CitizenTable",props:u.mergeModels({hideEditIcon:{type:Boolean,default:!1},hideDetailsIcon:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{}}),emits:u.mergeModels(["edit","details"],["update:modelValue"]),setup(e,{emit:a}){const r=u.useModel(e,"modelValue"),n=a,i=new _e,t=u.ref(),o=u.ref([]),l=u.ref(!1),c=u.ref(Js()),s=u.ref(Ks()),F=u.ref({currentPage:1,perPage:15,total:45,lastPage:3}),p=u.computed(()=>({page:F.value.currentPage,per_page:F.value.perPage,fields:f.value})),f=u.computed(()=>[...c.value.filter(m=>m.key!=="actions").map(m=>m.key),"cpf","cns"]);u.watch(t,m=>r.value=m),u.onMounted(async()=>{b(),h()});function b(){const m=new Set(c.value.map(g=>g.key));s.value.forEach(g=>{m.has(g.key)&&(g.visible=!0)})}async function h(){l.value=!0;try{const m=await i.index(p.value);o.value=m.data,F.value={currentPage:m.meta.current_page,perPage:m.meta.per_page,total:m.meta.total,lastPage:m.meta.last_page}}catch(m){console.error("Error fetching citizens:",m)}finally{l.value=!1}}function y(m){c.value=m.filter(g=>g.visible),c.value=[{key:"name",label:"Nome"},...c.value,{key:"actions",label:""}],h()}return(m,g)=>{const C=u.resolveComponent("CdsDataTable"),D=u.resolveComponent("CdsPagination");return u.openBlock(),u.createElementBlock("div",null,[u.createVNode(C,u.mergeProps({...m.$attrs},{modelValue:t.value,"onUpdate:modelValue":g[2]||(g[2]=w=>t.value=w),fields:c.value,items:o.value,"custom-fields-list":s.value,"hide-customize-button":!0,loading:l.value,"total-items":F.value.total,"custom-fields-searchable":"","custom-fields-track-by":"key",onUpdateFieldsList:y}),{"table-item":u.withCtx(({data:w,field:k,colIndex:S,rowIndex:v})=>[u.createVNode(Os,{data:w,field:k,"row-index":v,"col-index":S,"hide-details-icon":e.hideDetailsIcon,"hide-edit-icon":e.hideEditIcon,onEdit:g[0]||(g[0]=P=>n("edit")),onDetails:g[1]||(g[1]=P=>n("details"))},{"prepend-action":u.withCtx(()=>[u.renderSlot(m.$slots,"prepend-action",{data:w,field:k,rowIndex:v,colIndex:S})]),"append-action":u.withCtx(()=>[u.renderSlot(m.$slots,"append-action",{data:w,field:k,rowIndex:v,colIndex:S})]),_:2},1032,["data","field","row-index","col-index","hide-details-icon","hide-edit-icon"])]),_:3},16,["modelValue","fields","items","custom-fields-list","loading","total-items"]),F.value.lastPage>1?(u.openBlock(),u.createBlock(D,{key:0,modelValue:F.value.currentPage,"onUpdate:modelValue":[g[3]||(g[3]=w=>F.value.currentPage=w),h],class:"mt-8","per-page":F.value.perPage,total:F.value.total,variant:m.$attrs.variant??"green",fluid:""},null,8,["modelValue","per-page","total","variant"])):u.createCommentVNode("",!0)])}}}),ue=({validated:e,valid:a})=>e&&!a?"invalid":"default",Vs=[{name:"Feminino",value:"F"},{name:"Masculino",value:"M"}],js=()=>Vs;class Ys{constructor(a){E(this,"cpf");E(this,"cns");E(this,"name");E(this,"gender");E(this,"birth_date");E(this,"asRequestPayload",()=>({cpf:j.removeCpfMask(this.cpf),cns:j.removeCnsMask(this.cns),name:this.name,gender:this.gender.value,birth_date:this.birth_date}));this.cpf=a.cpf,this.cns=a.cns,this.name=a.name,this.gender=a.gender,this.birth_date=a.birth_date}}const Us=u.defineComponent({__name:"CreateCitizenSidesheet",props:u.mergeModels({toastSuccessDescription:{default:"Cidadão cadastrado com sucesso."},toastErrorDescription:{default:"Houve um erro ao cadastrar o cidadão."}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:u.mergeModels(["success"],["update:modelValue"]),setup(e,{emit:a}){const r=u.inject("useToast"),n=e,i=a,t=u.useModel(e,"modelValue"),o=u.ref(null),l=u.ref(!1),c=u.computed(()=>new Date().toISOString().split("T")[0]),s=new _e;async function F(){let f;if(o.value){try{f=await o.value.validate()}catch(b){console.error(b),r().fire({title:"Erro ao validar o formulário",description:"Houve um erro ao validar o formulário. Se o problema persistir, contate o suporte.",dismissible:!0,dismissAfter:6e3,autoDismissible:!0,variant:"danger",light:!1})}if(f!=null&&f.valid)try{l.value=!0;const b=await s.create(new Ys(o.value.values).asRequestPayload());o.value.resetForm(),t.value=!1,r().fire({title:"Sucesso",description:n.toastSuccessDescription,dismissible:!0,dismissAfter:6e3,autoDismissible:!0,variant:"success",light:!1}),i("success",b)}catch(b){let h;console.error("Error:",b),b instanceof Error&&(h=b.message===""?n.toastErrorDescription:b.message),r().fire({title:"Erro",description:h,dismissible:!0,dismissAfter:6e3,autoDismissible:!0,variant:"danger",light:!1})}finally{l.value=!1}}}function p(){var f;(f=o.value)==null||f.resetForm()}return(f,b)=>{const h=u.resolveComponent("CdsTextInput"),y=u.resolveComponent("CdsGridItem"),m=u.resolveComponent("CdsDateInput"),g=u.resolveComponent("CdsSelect"),C=u.resolveComponent("CdsToast"),D=u.resolveComponent("CdsGrid"),w=u.resolveComponent("CdsSideSheet");return u.openBlock(),u.createBlock(w,u.mergeProps(f.$attrs,{modelValue:t.value,"onUpdate:modelValue":b[0]||(b[0]=k=>t.value=k),title:"Cadastrar usuário SUS","no-close-ok-button":"","disable-ok-button":l.value||f.$attrs["disable-ok-button"],"disable-cancel-button":l.value||f.$attrs["disable-cancel-button"],"block-ok-button":!0,onOk:F,onCancel:p}),{default:u.withCtx(()=>[u.createVNode(u.unref(Q.Form),{ref_key:"formRef",ref:o},{default:u.withCtx(()=>[u.createVNode(D,{cols:2,gap:"20px"},{default:u.withCtx(()=>[u.createVNode(y,{"col-span":2},{default:u.withCtx(()=>[u.createVNode(u.unref(Q.Field),{name:"name",label:"nome",rules:"required|minLength:5"},{default:u.withCtx(({field:k,errors:S,meta:v})=>[u.createVNode(h,u.mergeProps(k,{modelValue:k.value,"onUpdate:modelValue":P=>k.value=P,label:"Nome",placeholder:"Nome do usuário",required:"",fluid:"",disabled:l.value,state:u.unref(ue)(v),"error-message":S[0]}),null,16,["modelValue","onUpdate:modelValue","disabled","state","error-message"])]),_:1})]),_:1}),u.createVNode(y,null,{default:u.withCtx(()=>[u.createVNode(u.unref(Q.Field),{name:"cns",label:"CNS",rules:"required|cns"},{default:u.withCtx(({field:k,errors:S,meta:v})=>[u.createVNode(h,u.mergeProps(k,{modelValue:k.value,"onUpdate:modelValue":P=>k.value=P,label:"CNS",placeholder:"000 0000 0000 0000",mask:"### #### #### ####",required:"",fluid:"",disabled:l.value,state:u.unref(ue)(v),"error-message":S[0]}),null,16,["modelValue","onUpdate:modelValue","disabled","state","error-message"])]),_:1})]),_:1}),u.createVNode(y,null,{default:u.withCtx(()=>[u.createVNode(u.unref(Q.Field),{name:"cpf",label:"CPF",rules:"required|cpf"},{default:u.withCtx(({field:k,errors:S,meta:v})=>[u.createVNode(h,u.mergeProps(k,{modelValue:k.value,"onUpdate:modelValue":P=>k.value=P,label:"CPF",placeholder:"000.000.000-00",required:"",fluid:"",disabled:l.value,mask:"###.###.###-##",state:u.unref(ue)(v),"error-message":S[0]}),null,16,["modelValue","onUpdate:modelValue","disabled","state","error-message"])]),_:1})]),_:1}),u.createVNode(y,null,{default:u.withCtx(()=>[u.createVNode(u.unref(Q.Field),{name:"birth_date",label:"data de nascimento",rules:"required"},{default:u.withCtx(({field:k,errors:S,meta:v})=>[u.createVNode(m,u.mergeProps(k,{modelValue:k.value,"onUpdate:modelValue":P=>k.value=P,label:"Data de nascimento",fluid:"",variant:f.$attrs["action-button-variant"],disabled:l.value,"max-date":c.value,state:u.unref(ue)(v),"error-message":S[0]}),null,16,["modelValue","onUpdate:modelValue","variant","disabled","max-date","state","error-message"])]),_:1})]),_:1}),u.createVNode(y,null,{default:u.withCtx(()=>[u.createVNode(u.unref(Q.Field),{name:"gender",label:"sexo",rules:"required"},{default:u.withCtx(({field:k,errors:S,meta:v})=>[u.createVNode(g,u.mergeProps(k,{modelValue:k.value,"onUpdate:modelValue":P=>k.value=P,"options-field":"name",options:u.unref(js)(),fluid:"",disabled:l.value,label:"Sexo",placeholder:"Selecione o sexo",required:"",state:u.unref(ue)(v),"error-message":S[0]}),null,16,["modelValue","onUpdate:modelValue","options","disabled","state","error-message"])]),_:1})]),_:1}),u.createVNode(C,{variant:"green",size:"md",text:"Lorem Ipsum"})]),_:1})]),_:1},512)]),_:1},16,["modelValue","disable-ok-button","disable-cancel-button"])}}}),br={install(e,a={}){Qu(a),Promise.resolve().then(()=>require("./citizenFormRules-CLFR0T1X.cjs"));const r=Dr.utils;e.provide("useToast",r.useToast)}};exports.CitizenComponentsPlugin=br;exports.CitizenSelect=Gs;exports.CitizenTable=zs;exports.CreateCitizenSidesheet=Us;exports.default=br;
|
|
14
|
+
`+t):n.stack=t}catch{}}throw n}}_request(a,r){typeof a=="string"?(r=r||{},r.url=a):r=a||{},r=q(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:t}=r;n!==void 0&&ke.assertOptions(n,{silentJSONParsing:I.transitional(I.boolean),forcedJSONParsing:I.transitional(I.boolean),clarifyTimeoutError:I.transitional(I.boolean)},!1),i!=null&&(d.isFunction(i)?r.paramsSerializer={serialize:i}:ke.assertOptions(i,{encode:I.function,serialize:I.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),ke.assertOptions(r,{baseUrl:I.spelling("baseURL"),withXsrfToken:I.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=t&&d.merge(t.common,t[r.method]);t&&d.forEach(["delete","get","head","post","put","patch","common"],h=>{delete t[h]}),r.headers=N.concat(o,t);const l=[];let c=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(r)===!1||(c=c&&y.synchronous,l.unshift(y.fulfilled,y.rejected))});const s=[];this.interceptors.response.forEach(function(y){s.push(y.fulfilled,y.rejected)});let F,p=0,f;if(!c){const h=[va.bind(this),void 0];for(h.unshift(...l),h.push(...s),f=h.length,F=Promise.resolve(r);p<f;)F=F.then(h[p++],h[p++]);return F}f=l.length;let b=r;for(;p<f;){const h=l[p++],y=l[p++];try{b=h(b)}catch(m){y.call(this,m);break}}try{F=va.call(this,b)}catch(h){return Promise.reject(h)}for(p=0,f=s.length;p<f;)F=F.then(s[p++],s[p++]);return F}getUri(a){a=q(this.defaults,a);const r=hr(a.baseURL,a.url,a.allowAbsoluteUrls);return ur(r,a.params,a.paramsSerializer)}};d.forEach(["delete","get","head","options"],function(a){_.prototype[a]=function(r,n){return this.request(q(n||{},{method:a,url:r,data:(n||{}).data}))}});d.forEach(["post","put","patch"],function(a){function r(n){return function(t,o,l){return this.request(q(l||{},{method:a,headers:n?{"Content-Type":"multipart/form-data"}:{},url:t,data:o}))}}_.prototype[a]=r(),_.prototype[a+"Form"]=r(!0)});let Es=class gr{constructor(a){if(typeof a!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(t){r=t});const n=this;this.promise.then(i=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](i);n._listeners=null}),this.promise.then=i=>{let t;const o=new Promise(l=>{n.subscribe(l),t=l}).then(i);return o.cancel=function(){n.unsubscribe(t)},o},a(function(t,o,l){n.reason||(n.reason=new ne(t,o,l),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(a){if(this.reason){a(this.reason);return}this._listeners?this._listeners.push(a):this._listeners=[a]}unsubscribe(a){if(!this._listeners)return;const r=this._listeners.indexOf(a);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const a=new AbortController,r=n=>{a.abort(n)};return this.subscribe(r),a.signal.unsubscribe=()=>this.unsubscribe(r),a.signal}static source(){let a;return{token:new gr(function(i){a=i}),cancel:a}}};function Bs(e){return function(r){return e.apply(null,r)}}function vs(e){return d.isObject(e)&&e.isAxiosError===!0}const je={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(je).forEach(([e,a])=>{je[a]=e});function fr(e){const a=new _(e),r=_a(_.prototype.request,a);return d.extend(r,_.prototype,a,{allOwnKeys:!0}),d.extend(r,a,null,{allOwnKeys:!0}),r.create=function(i){return fr(q(e,i))},r}const M=fr(he);M.Axios=_;M.CanceledError=ne;M.CancelToken=Es;M.isCancel=cr;M.VERSION=yr;M.toFormData=ve;M.AxiosError=B;M.Cancel=M.CanceledError;M.all=function(a){return Promise.all(a)};M.spread=Bs;M.isAxiosError=vs;M.mergeConfig=q;M.AxiosHeaders=N;M.formToJSON=e=>sr(d.isHTMLForm(e)?new FormData(e):e);M.getAdapter=pr.getAdapter;M.HttpStatusCode=je;M.default=M;const{Axios:Zs,AxiosError:Xs,CanceledError:Qs,isCancel:ec,CancelToken:ac,VERSION:rc,all:nc,Cancel:ic,isAxiosError:tc,spread:oc,toFormData:uc,AxiosHeaders:lc,HttpStatusCode:sc,formToJSON:cc,getAdapter:dc,mergeConfig:hc}=M;class _e{constructor(){E(this,"config");this.config=Xu()}async index(a){if(!this.isCustomEndpointSet("index"))return await this.delay(1e3),this.indexMock(a);try{return await this.apiCall("index",{params:a})}catch(r){throw this.handleErrors(r)}}async create(a){if(!this.isCustomEndpointSet("create"))return await this.delay(1e3),this.citizenCreationMock(a);try{return await this.apiCall("create",{data:a,method:"post"})}catch(r){throw this.handleErrors(r)}}async apiCall(a,r){const n=this.config.endpoints[a],t={url:`${this.config.apiBaseUrl}${n}`,method:(r==null?void 0:r.method)??"get",headers:{"Content-Type":"application/json"},...(r==null?void 0:r.params)&&{params:r.params},...(r==null?void 0:r.data)&&{data:r.data}};return(await M.request(t)).data}isCustomEndpointSet(a){return this.config.apiBaseUrl&&this.config.endpoints&&this.config.endpoints[a]}handleErrors(a){const r=a instanceof Error?a.message:"Unknown error";throw new Error(`Erro: ${r}`)}async indexMock(a){let r=ha(150);a.search_string&&(r=this.citizensFilter(r,a.search_string));let n=r.slice((a.page-1)*(a.per_page??1),a.page*(a.per_page??1));return a.fields&&a.fields.length&&(n=n.map(t=>Object.fromEntries(Object.entries(t).filter(([o])=>{var l;return((l=a.fields)==null?void 0:l.includes(o))||this.isKeyADefaultField(o)})))),{data:n,meta:{current_page:a.page,per_page:a.per_page??1,total:r.length,last_page:Math.ceil(r.length/(a.per_page??1))}}}async citizenCreationMock(a){return{data:{citizen:{...ha(1)[0],...a}}}}citizensFilter(a,r){return a.filter(n=>n.name.toLowerCase().includes(r.toLowerCase())||this.matchesMaskedField(r,n.cpf,j.removeCpfMask)||this.matchesMaskedField(r,n.cns,j.removeCnsMask))}delay(a){return new Promise(r=>setTimeout(r,a))}matchesMaskedField(a,r,n){return n(a).length&&n(r).includes(n(a))}isKeyADefaultField(a){return a==="name"||a==="cpf"||a==="cns"}}const ws={ref:"dropdown-select",class:"select"},Ts={class:"select__container"},Ms={ref:"select-options",class:"select__options"},Rs={key:0,class:"option__container"},Ls=["onMouseover"],Ps={key:1,class:"option__container"},Hs=u.defineComponent({__name:"SelectDropdown",props:u.mergeModels({options:{},fluid:{type:Boolean,default:!1},optionsField:{},returnValue:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){u.useCssVars(h=>({fe28de54:l.value}));const a=u.useModel(e,"modelValue"),r=e,n=u.ref(0),i=u.ref([]),t=u.ref(),o=u.ref([]),l=u.computed(()=>r.fluid?"100%":"fit-content");u.watch(()=>r.options,h=>{o.value=[],i.value=h},{immediate:!0,flush:"pre"}),u.watch(a,h=>{if(!h){t.value=void 0;return}h instanceof Object?t.value=h:t.value={id:crypto.randomUUID(),[r.optionsField]:h}},{immediate:!0}),u.watch(t,h=>{if(!h){a.value=null;return}i.value.some(m=>m.id===h.id)&&(r.returnValue?a.value=h[r.optionsField]:a.value=h)},{deep:!0});function c(h,y){h&&h instanceof HTMLLIElement&&(o.value[y]=h)}function s(){t.value=Sr.cloneDeep(i.value[n.value])}function F(h){return o.value?o.value[h]:null}function p(h){n.value=h;const y=F(n.value);y==null||y.classList.add("highlight")}function f(){const h=F(n.value);h==null||h.classList.remove("highlight")}function b(h){return h[r.optionsField]}return(h,y)=>{var m;return u.openBlock(),u.createElementBlock("div",ws,[u.createElementVNode("div",Ts,[u.createElementVNode("div",Ms,[((m=i.value)==null?void 0:m.length)>0?(u.openBlock(),u.createElementBlock("ul",Rs,[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(i.value,(g,C)=>(u.openBlock(),u.createElementBlock("li",{key:g.id,ref_for:!0,ref:D=>c(D,C),class:"option__text",onMousedown:u.withModifiers(s,["left"]),onMouseover:D=>p(C),onMouseout:y[0]||(y[0]=D=>f())},[u.renderSlot(h.$slots,"option",{index:C,option:g,value:b(g)},()=>[u.createTextVNode(u.toDisplayString(b(g)),1)],!0)],40,Ls))),128))])):(u.openBlock(),u.createElementBlock("ul",Ps,[...y[1]||(y[1]=[u.createElementVNode("li",{class:"option__text--muted"}," Nenhuma opção encontrada ",-1)])]))],512)])],512)}}}),Ns=(e,a)=>{const r=e.__vccOpts||e;for(const[n,i]of a)r[n]=i;return r},xs=Ns(Hs,[["__scopeId","data-v-16cd9e6c"]]),Gs=u.defineComponent({inheritAttrs:!1,__name:"CitizenSelect",props:u.mergeModels({showButton:{type:Boolean},fluid:{type:Boolean,default:!1},variant:{default:"green"},optionsField:{default:"name"},disabled:{type:Boolean,default:!1},label:{default:"Usuário SUS"},placeholder:{default:"Selecione um usuário"},state:{default:"default"},errorMessage:{default:""}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const a=u.inject("useToast"),r=u.useModel(e,"modelValue"),n=e,i=new _e,t=u.ref([]),o=u.ref(!1),l=u.ref(!1),c=u.ref(""),s=u.ref(""),F=u.useTemplateRef("selectContainer"),p=u.computed(()=>n.disabled||o.value||c.value.length<2),f=u.computed(()=>l.value&&s.value!==c.value&&t.value.length?"Buscar*":"Buscar"),b=u.computed(()=>o.value?"Carregando...":c.value.length<2?"Digite 2 ou mais caracteres.":""),h=u.computed(()=>({search_string:c.value,page:1,per_page:1e3}));u.watch(r,()=>{if(!r.value)c.value="";else if(typeof r.value=="string")c.value=r.value;else{const g=r.value[n.optionsField];c.value=typeof g=="string"?g:""}l.value=!1}),Rr(F,()=>{l.value=!1});async function y(){if(!p.value){o.value=!0,s.value=c.value;try{const g=await i.index(h.value);t.value=g.data,l.value=!0}catch(g){l.value=!1;const C=g instanceof Error?g.message:"Unknown error";a().fire({title:"Houve um problema ao buscar as informações as informações do cidadão.",description:C,dismissible:!0,dismissAfter:6e3,autoDismissible:!0,variant:"danger",light:!1})}finally{o.value=!1}}}function m(g){const[C,D,w]=g.split("-").map(Number);return new Date(C,D-1,w).toLocaleDateString("pt-BR")}return(g,C)=>{const D=u.resolveComponent("CdsTextInput"),w=u.resolveComponent("CdsText"),k=u.resolveComponent("CdsFlexbox"),S=u.resolveComponent("CdsButton");return u.openBlock(),u.createBlock(k,{gap:"2",wrap:"no-wrap",fluid:e.fluid},{default:u.withCtx(()=>[u.createVNode(k,{ref_key:"selectContainer",ref:F,direction:"column",fluid:e.fluid},{default:u.withCtx(()=>[u.createVNode(D,{modelValue:c.value,"onUpdate:modelValue":C[0]||(C[0]=v=>c.value=v),modelModifiers:{trim:!0},fluid:e.fluid,label:e.label,placeholder:e.placeholder,state:e.state,"error-message":e.errorMessage,disabled:o.value||e.disabled,onKeydown:u.withKeys(y,["enter"]),onBlur:C[1]||(C[1]=v=>l.value=!1)},null,8,["modelValue","fluid","label","placeholder","state","error-message","disabled"]),l.value?(u.openBlock(),u.createBlock(xs,{key:0,modelValue:r.value,"onUpdate:modelValue":C[2]||(C[2]=v=>r.value=v),options:t.value,fluid:e.fluid,"options-field":e.optionsField},{option:u.withCtx(({option:v})=>[u.createVNode(w,{as:"subheading-3","no-margin":""},{default:u.withCtx(()=>[u.createVNode(w,{"font-weight":"semibold"},{default:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(v.name),1)]),_:2},1024)]),_:2},1024),u.createVNode(w,{as:"body-2"},{default:u.withCtx(()=>[C[3]||(C[3]=u.createElementVNode("br",null,null,-1)),u.createTextVNode(" CPF: "+u.toDisplayString(v.cpf?u.unref(j.maskCpf)(v.cpf):"--"),1)]),_:2},1024),u.createVNode(w,{as:"body-2"},{default:u.withCtx(()=>[C[4]||(C[4]=u.createElementVNode("br",null,null,-1)),u.createTextVNode(" CNS: "+u.toDisplayString(v.cns?u.unref(j.maskCns)(v.cns):"--"),1)]),_:2},1024),u.createVNode(w,{as:"body-2"},{default:u.withCtx(()=>[C[5]||(C[5]=u.createElementVNode("br",null,null,-1)),u.createTextVNode(" Data de nascimento: "+u.toDisplayString(m(v.birth_date)),1)]),_:2},1024)]),_:1},8,["modelValue","options","fluid","options-field"])):u.createCommentVNode("",!0)]),_:1},8,["fluid"]),e.showButton?(u.openBlock(),u.createBlock(S,{key:0,class:"mt-6",type:"button",text:f.value,variant:e.variant,"tooltip-text":b.value,disabled:p.value,onButtonClick:y},null,8,["text","variant","tooltip-text","disabled"])):u.createCommentVNode("",!0)]),_:1},8,["fluid"])}}});function Ws(e){const[a,r,n]=e.split("-").map(Number);return!a||!r||!n?"--":new Date(a,r-1,n).toLocaleDateString("pt-BR")}const Is={class:"mt-1"},Os=u.defineComponent({__name:"TableCellRenderer",props:{data:{},field:{},rowIndex:{},colIndex:{},hideEditIcon:{type:Boolean},hideDetailsIcon:{type:Boolean}},emits:["edit","details"],setup(e,{emit:a}){const r=a;function n(l){return l==="F"?"Feminino":"Masculino"}function i(l){switch(l){case"white":return"Branca";case"black":return"Preta";case"brown":return"Parda";case"indigenous":return"Indígena";case"yellow":return"Amarela";default:return"--"}}function t(l){return l?j.maskCpf(l):"--"}function o(l){return l?j.maskCns(l):"--"}return(l,c)=>{const s=u.resolveComponent("CdsText"),F=u.resolveComponent("CdsFlexbox"),p=u.resolveComponent("CdsIconButton");return u.openBlock(),u.createElementBlock("div",null,[e.field==="name"?(u.openBlock(),u.createBlock(F,{key:0,direction:"column",gap:"1"},{default:u.withCtx(()=>[u.createVNode(s,{"no-margin":"",as:"subheading-3","font-weight":"semibold"},{default:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(e.data.name),1)]),_:1}),u.createElementVNode("div",Is,[u.createVNode(s,{"font-weight":"semibold",as:"caption"},{default:u.withCtx(()=>[...c[2]||(c[2]=[u.createTextVNode(" CPF: ",-1)])]),_:1}),u.createVNode(s,{as:"caption"},{default:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(t(e.data.cpf)),1)]),_:1})]),u.createElementVNode("div",null,[u.createVNode(s,{"font-weight":"semibold",as:"caption"},{default:u.withCtx(()=>[...c[3]||(c[3]=[u.createTextVNode(" CNS: ",-1)])]),_:1}),u.createVNode(s,{as:"caption"},{default:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(o(e.data.cns)),1)]),_:1})])]),_:1})):e.field==="address"?(u.openBlock(),u.createBlock(F,{key:1,direction:"column",gap:"1"},{default:u.withCtx(()=>[Object.keys(e.data.address||{}).length?(u.openBlock(),u.createElementBlock(u.Fragment,{key:0},[e.data.address.street?(u.openBlock(),u.createBlock(s,{key:0,as:"caption"},{default:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(e.data.address.street)+", Nº "+u.toDisplayString(e.data.address.number??"--"),1)]),_:1})):u.createCommentVNode("",!0),e.data.address.neighborhood?(u.openBlock(),u.createBlock(s,{key:1,as:"caption"},{default:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(e.data.address.neighborhood),1)]),_:1})):u.createCommentVNode("",!0),e.data.address.city&&e.data.address.uf?(u.openBlock(),u.createBlock(s,{key:2,as:"caption"},{default:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(e.data.address.city)+" / "+u.toDisplayString(e.data.address.uf),1)]),_:1})):u.createCommentVNode("",!0)],64)):(u.openBlock(),u.createBlock(s,{key:1,as:"caption"},{default:u.withCtx(()=>[...c[4]||(c[4]=[u.createTextVNode(" -- ",-1)])]),_:1}))]),_:1})):e.field==="gender"?(u.openBlock(),u.createElementBlock(u.Fragment,{key:2},[u.createTextVNode(u.toDisplayString(n(e.data[e.field])),1)],64)):e.field==="race"?(u.openBlock(),u.createElementBlock(u.Fragment,{key:3},[u.createTextVNode(u.toDisplayString(i(e.data[e.field])),1)],64)):e.field==="birth_date"?(u.openBlock(),u.createElementBlock(u.Fragment,{key:4},[u.createTextVNode(u.toDisplayString(u.unref(Ws)(e.data[e.field])),1)],64)):e.field==="actions"?(u.openBlock(),u.createBlock(F,{key:5,gap:"2",justify:"end"},{default:u.withCtx(()=>[u.renderSlot(l.$slots,"prepend-action"),e.hideDetailsIcon?u.createCommentVNode("",!0):(u.openBlock(),u.createBlock(p,{key:0,size:"sm",icon:"document-text-outline","tooltip-text":"Ver detalhes",onCdsClick:c[0]||(c[0]=f=>r("details"))})),e.hideEditIcon?u.createCommentVNode("",!0):(u.openBlock(),u.createBlock(p,{key:1,size:"sm",icon:"edit-outline","tooltip-text":"Editar",onCdsClick:c[1]||(c[1]=f=>r("edit"))})),u.renderSlot(l.$slots,"append-action")]),_:3})):(u.openBlock(),u.createElementBlock(u.Fragment,{key:6},[u.createTextVNode(" -- ")],64))])}}}),Ks=()=>[{key:"birth_date",label:"Data de nascimento",visible:!1},{key:"address",label:"Endereço",visible:!1},{key:"gender",label:"Sexo",visible:!1},{key:"identification_document",label:"RG",visible:!1},{key:"phone",label:"Telefone",visible:!1},{key:"cellphone",label:"Celular",visible:!1},{key:"race",label:"Raça",visible:!1},{key:"mother_name",label:"Nome da mãe",visible:!1},{key:"cpf_responsible",label:"CPF do responsável",visible:!1},{key:"email",label:"Email",visible:!1}],Js=()=>[{key:"name",label:"Nome"},{key:"birth_date",label:"Data de nascimento"},{key:"address",label:"Endereço"},{key:"actions",label:""}],zs=u.defineComponent({__name:"CitizenTable",props:u.mergeModels({hideEditIcon:{type:Boolean,default:!1},hideDetailsIcon:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{}}),emits:u.mergeModels(["edit","details"],["update:modelValue"]),setup(e,{emit:a}){const r=u.useModel(e,"modelValue"),n=a,i=new _e,t=u.ref(),o=u.ref([]),l=u.ref(!1),c=u.ref(Js()),s=u.ref(Ks()),F=u.ref({currentPage:1,perPage:15,total:45,lastPage:3}),p=u.computed(()=>({page:F.value.currentPage,per_page:F.value.perPage,fields:f.value})),f=u.computed(()=>[...c.value.filter(m=>m.key!=="actions").map(m=>m.key),"cpf","cns"]);u.watch(t,m=>r.value=m),u.onMounted(async()=>{b(),h()});function b(){const m=new Set(c.value.map(g=>g.key));s.value.forEach(g=>{m.has(g.key)&&(g.visible=!0)})}async function h(){l.value=!0;try{const m=await i.index(p.value);o.value=m.data,F.value={currentPage:m.meta.current_page,perPage:m.meta.per_page,total:m.meta.total,lastPage:m.meta.last_page}}catch(m){console.error("Error fetching citizens:",m)}finally{l.value=!1}}function y(m){c.value=m.filter(g=>g.visible),c.value=[{key:"name",label:"Nome"},...c.value,{key:"actions",label:""}],h()}return(m,g)=>{const C=u.resolveComponent("CdsDataTable"),D=u.resolveComponent("CdsPagination");return u.openBlock(),u.createElementBlock("div",null,[u.createVNode(C,u.mergeProps({...m.$attrs},{modelValue:t.value,"onUpdate:modelValue":g[2]||(g[2]=w=>t.value=w),fields:c.value,items:o.value,"custom-fields-list":s.value,"hide-customize-button":!0,loading:l.value,"total-items":F.value.total,"custom-fields-searchable":"","custom-fields-track-by":"key",onUpdateFieldsList:y}),{"table-item":u.withCtx(({data:w,field:k,colIndex:S,rowIndex:v})=>[u.createVNode(Os,{data:w,field:k,"row-index":v,"col-index":S,"hide-details-icon":e.hideDetailsIcon,"hide-edit-icon":e.hideEditIcon,onEdit:g[0]||(g[0]=P=>n("edit")),onDetails:g[1]||(g[1]=P=>n("details"))},{"prepend-action":u.withCtx(()=>[u.renderSlot(m.$slots,"prepend-action",{data:w,field:k,rowIndex:v,colIndex:S})]),"append-action":u.withCtx(()=>[u.renderSlot(m.$slots,"append-action",{data:w,field:k,rowIndex:v,colIndex:S})]),_:2},1032,["data","field","row-index","col-index","hide-details-icon","hide-edit-icon"])]),_:3},16,["modelValue","fields","items","custom-fields-list","loading","total-items"]),F.value.lastPage>1?(u.openBlock(),u.createBlock(D,{key:0,modelValue:F.value.currentPage,"onUpdate:modelValue":[g[3]||(g[3]=w=>F.value.currentPage=w),h],class:"mt-8","per-page":F.value.perPage,total:F.value.total,variant:m.$attrs.variant??"green",fluid:""},null,8,["modelValue","per-page","total","variant"])):u.createCommentVNode("",!0)])}}}),ue=({validated:e,valid:a})=>e&&!a?"invalid":"default",Vs=[{name:"Feminino",value:"F"},{name:"Masculino",value:"M"}],js=()=>Vs;class Ys{constructor(a){E(this,"cpf");E(this,"cns");E(this,"name");E(this,"gender");E(this,"birth_date");E(this,"asRequestPayload",()=>({cpf:j.removeCpfMask(this.cpf),cns:j.removeCnsMask(this.cns),name:this.name,gender:this.gender.value,birth_date:this.birth_date}));this.cpf=a.cpf,this.cns=a.cns,this.name=a.name,this.gender=a.gender,this.birth_date=a.birth_date}}const Us=u.defineComponent({__name:"CreateCitizenSidesheet",props:u.mergeModels({toastSuccessDescription:{default:"Cidadão cadastrado com sucesso."},toastErrorDescription:{default:"Houve um erro ao cadastrar o cidadão."}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:u.mergeModels(["success"],["update:modelValue"]),setup(e,{emit:a}){const r=u.inject("useToast"),n=e,i=a,t=u.useModel(e,"modelValue"),o=u.ref(null),l=u.ref(!1),c=u.computed(()=>new Date().toISOString().split("T")[0]),s=new _e;async function F(){let f;if(o.value){try{f=await o.value.validate()}catch(b){console.error(b),r().fire({title:"Erro ao validar o formulário",description:"Houve um erro ao validar o formulário. Se o problema persistir, contate o suporte.",dismissible:!0,dismissAfter:6e3,autoDismissible:!0,variant:"danger",light:!1})}if(f!=null&&f.valid)try{l.value=!0;const b=await s.create(new Ys(o.value.values).asRequestPayload());o.value.resetForm(),t.value=!1,r().fire({title:"Sucesso",description:n.toastSuccessDescription,dismissible:!0,dismissAfter:6e3,autoDismissible:!0,variant:"success",light:!1}),i("success",b)}catch(b){let h;console.error("Error:",b),b instanceof Error&&(h=b.message===""?n.toastErrorDescription:b.message),r().fire({title:"Erro",description:h,dismissible:!0,dismissAfter:6e3,autoDismissible:!0,variant:"danger",light:!1})}finally{l.value=!1}}}function p(){var f;(f=o.value)==null||f.resetForm()}return(f,b)=>{const h=u.resolveComponent("CdsTextInput"),y=u.resolveComponent("CdsGridItem"),m=u.resolveComponent("CdsDateInput"),g=u.resolveComponent("CdsSelect"),C=u.resolveComponent("CdsToast"),D=u.resolveComponent("CdsGrid"),w=u.resolveComponent("CdsSideSheet");return u.openBlock(),u.createBlock(w,u.mergeProps(f.$attrs,{modelValue:t.value,"onUpdate:modelValue":b[0]||(b[0]=k=>t.value=k),title:"Cadastrar usuário SUS","no-close-ok-button":"","disable-ok-button":l.value||f.$attrs["disable-ok-button"],"disable-cancel-button":l.value||f.$attrs["disable-cancel-button"],"block-ok-button":!0,onOk:F,onCancel:p}),{default:u.withCtx(()=>[u.createVNode(u.unref(Q.Form),{ref_key:"formRef",ref:o},{default:u.withCtx(()=>[u.createVNode(D,{cols:2,gap:"20px"},{default:u.withCtx(()=>[u.createVNode(y,{"col-span":2},{default:u.withCtx(()=>[u.createVNode(u.unref(Q.Field),{name:"name",label:"nome",rules:"required|minLength:5"},{default:u.withCtx(({field:k,errors:S,meta:v})=>[u.createVNode(h,u.mergeProps(k,{modelValue:k.value,"onUpdate:modelValue":P=>k.value=P,label:"Nome",placeholder:"Nome do usuário",required:"",fluid:"",disabled:l.value,state:u.unref(ue)(v),"error-message":S[0]}),null,16,["modelValue","onUpdate:modelValue","disabled","state","error-message"])]),_:1})]),_:1}),u.createVNode(y,null,{default:u.withCtx(()=>[u.createVNode(u.unref(Q.Field),{name:"cns",label:"CNS",rules:"required|cns"},{default:u.withCtx(({field:k,errors:S,meta:v})=>[u.createVNode(h,u.mergeProps(k,{modelValue:k.value,"onUpdate:modelValue":P=>k.value=P,label:"CNS",placeholder:"000 0000 0000 0000",mask:"### #### #### ####",required:"",fluid:"",disabled:l.value,state:u.unref(ue)(v),"error-message":S[0]}),null,16,["modelValue","onUpdate:modelValue","disabled","state","error-message"])]),_:1})]),_:1}),u.createVNode(y,null,{default:u.withCtx(()=>[u.createVNode(u.unref(Q.Field),{name:"cpf",label:"CPF",rules:"required|cpf"},{default:u.withCtx(({field:k,errors:S,meta:v})=>[u.createVNode(h,u.mergeProps(k,{modelValue:k.value,"onUpdate:modelValue":P=>k.value=P,label:"CPF",placeholder:"000.000.000-00",required:"",fluid:"",disabled:l.value,mask:"###.###.###-##",state:u.unref(ue)(v),"error-message":S[0]}),null,16,["modelValue","onUpdate:modelValue","disabled","state","error-message"])]),_:1})]),_:1}),u.createVNode(y,null,{default:u.withCtx(()=>[u.createVNode(u.unref(Q.Field),{name:"birth_date",label:"data de nascimento",rules:"required"},{default:u.withCtx(({field:k,errors:S,meta:v})=>[u.createVNode(m,u.mergeProps(k,{modelValue:k.value,"onUpdate:modelValue":P=>k.value=P,label:"Data de nascimento",fluid:"",variant:f.$attrs["action-button-variant"],disabled:l.value,"max-date":c.value,state:u.unref(ue)(v),"error-message":S[0]}),null,16,["modelValue","onUpdate:modelValue","variant","disabled","max-date","state","error-message"])]),_:1})]),_:1}),u.createVNode(y,null,{default:u.withCtx(()=>[u.createVNode(u.unref(Q.Field),{name:"gender",label:"sexo",rules:"required"},{default:u.withCtx(({field:k,errors:S,meta:v})=>[u.createVNode(g,u.mergeProps(k,{modelValue:k.value,"onUpdate:modelValue":P=>k.value=P,"options-field":"name",options:u.unref(js)(),fluid:"",disabled:l.value,label:"Sexo",placeholder:"Selecione o sexo",required:"",state:u.unref(ue)(v),"error-message":S[0]}),null,16,["modelValue","onUpdate:modelValue","options","disabled","state","error-message"])]),_:1})]),_:1}),u.createVNode(C,{variant:"green",size:"md",text:"Lorem Ipsum"})]),_:1})]),_:1},512)]),_:1},16,["modelValue","disable-ok-button","disable-cancel-button"])}}}),br={install(e,a={}){Qu(a),Promise.resolve().then(()=>require("./citizenFormRules-CLFR0T1X.cjs"));const r=Dr.utils;e.provide("useToast",r.useToast)}};exports.CitizenComponentsPlugin=br;exports.CitizenSelect=Gs;exports.CitizenTable=zs;exports.CreateCitizenSidesheet=Us;exports.default=br;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Vr = Object.defineProperty;
|
|
2
2
|
var jr = (e, a, r) => a in e ? Vr(e, a, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[a] = r;
|
|
3
3
|
var S = (e, a, r) => jr(e, typeof a != "symbol" ? a + "" : a, r);
|
|
4
|
-
import { watch as me, getCurrentScope as Yr, onScopeDispose as Ur, computed as Z, toValue as ue, unref as G, defineComponent as ve, mergeModels as pe, useCssVars as $r, useModel as Je, ref as N, createElementBlock as j, openBlock as M, createElementVNode as
|
|
4
|
+
import { watch as me, getCurrentScope as Yr, onScopeDispose as Ur, computed as Z, toValue as ue, unref as G, defineComponent as ve, mergeModels as pe, useCssVars as $r, useModel as Je, ref as N, createElementBlock as j, openBlock as M, createElementVNode as re, Fragment as Fe, renderList as _r, withModifiers as qr, renderSlot as Ee, createTextVNode as H, toDisplayString as x, inject as $a, useTemplateRef as Zr, resolveComponent as W, createBlock as K, withCtx as w, createVNode as T, createCommentVNode as ae, withKeys as Xr, onMounted as Qr, mergeProps as te } from "vue";
|
|
5
5
|
import { removeCpfMask as _a, removeCnsMask as qa, maskCpf as Za, maskCns as Xa } from "@sysvale/foundry";
|
|
6
6
|
import { cloneDeep as en } from "lodash";
|
|
7
7
|
import { Form as an, Field as Ce } from "vee-validate";
|
|
@@ -230,7 +230,7 @@ function Jo(e, a = "rgb", r = "sRGB") {
|
|
|
230
230
|
return `rgb(${e[0]}, ${e[1]}, ${e[2]})`;
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
function
|
|
233
|
+
function ie(e, a, r = "rgb", n = "sRGB") {
|
|
234
234
|
switch (a) {
|
|
235
235
|
case "css":
|
|
236
236
|
return Jo(e, r, n);
|
|
@@ -255,35 +255,35 @@ var zo = class extends P {
|
|
|
255
255
|
}
|
|
256
256
|
rgb(e = {}) {
|
|
257
257
|
let { format: a = "hex", includeAlpha: r = !1, prefix: n = "#", casing: i = "lower" } = e, t, o = "rgb";
|
|
258
|
-
return a === "hex" ? (t = this.faker.string.hexadecimal({ length: r ? 8 : 6, prefix: "" }), t = Ko(t, { prefix: n, casing: i }), t) : (t = Array.from({ length: 3 }, () => this.faker.number.int(255)), r && (t.push(this.faker.number.float({ multipleOf: 0.01 })), o = "rgba"),
|
|
258
|
+
return a === "hex" ? (t = this.faker.string.hexadecimal({ length: r ? 8 : 6, prefix: "" }), t = Ko(t, { prefix: n, casing: i }), t) : (t = Array.from({ length: 3 }, () => this.faker.number.int(255)), r && (t.push(this.faker.number.float({ multipleOf: 0.01 })), o = "rgba"), ie(t, a, o));
|
|
259
259
|
}
|
|
260
260
|
cmyk(e = {}) {
|
|
261
261
|
let { format: a = "decimal" } = e, r = Array.from({ length: 4 }, () => this.faker.number.float({ multipleOf: 0.01 }));
|
|
262
|
-
return
|
|
262
|
+
return ie(r, a, "cmyk");
|
|
263
263
|
}
|
|
264
264
|
hsl(e = {}) {
|
|
265
265
|
let { format: a = "decimal", includeAlpha: r = !1 } = e, n = [this.faker.number.int(360)];
|
|
266
266
|
for (let i = 0; i < (e != null && e.includeAlpha ? 3 : 2); i++) n.push(this.faker.number.float({ multipleOf: 0.01 }));
|
|
267
|
-
return
|
|
267
|
+
return ie(n, a, r ? "hsla" : "hsl");
|
|
268
268
|
}
|
|
269
269
|
hwb(e = {}) {
|
|
270
270
|
let { format: a = "decimal" } = e, r = [this.faker.number.int(360)];
|
|
271
271
|
for (let n = 0; n < 2; n++) r.push(this.faker.number.float({ multipleOf: 0.01 }));
|
|
272
|
-
return
|
|
272
|
+
return ie(r, a, "hwb");
|
|
273
273
|
}
|
|
274
274
|
lab(e = {}) {
|
|
275
275
|
let { format: a = "decimal" } = e, r = [this.faker.number.float({ multipleOf: 1e-6 })];
|
|
276
276
|
for (let n = 0; n < 2; n++) r.push(this.faker.number.float({ min: -100, max: 100, multipleOf: 1e-4 }));
|
|
277
|
-
return
|
|
277
|
+
return ie(r, a, "lab");
|
|
278
278
|
}
|
|
279
279
|
lch(e = {}) {
|
|
280
280
|
let { format: a = "decimal" } = e, r = [this.faker.number.float({ multipleOf: 1e-6 })];
|
|
281
281
|
for (let n = 0; n < 2; n++) r.push(this.faker.number.float({ max: 230, multipleOf: 0.1 }));
|
|
282
|
-
return
|
|
282
|
+
return ie(r, a, "lch");
|
|
283
283
|
}
|
|
284
284
|
colorByCSSColorSpace(e = {}) {
|
|
285
285
|
let { format: a = "decimal", space: r = "sRGB" } = e, n = Array.from({ length: 3 }, () => this.faker.number.float({ multipleOf: 1e-4 }));
|
|
286
|
-
return
|
|
286
|
+
return ie(n, a, "color", r);
|
|
287
287
|
}
|
|
288
288
|
}, tr = ((e) => (e.Legacy = "legacy", e.Segwit = "segwit", e.Bech32 = "bech32", e.Taproot = "taproot", e))(tr || {}), Vo = ((e) => (e.Mainnet = "mainnet", e.Testnet = "testnet", e))(Vo || {}), jo = { legacy: { prefix: { mainnet: "1", testnet: "m" }, length: { min: 26, max: 34 }, casing: "mixed", exclude: "0OIl" }, segwit: { prefix: { mainnet: "3", testnet: "2" }, length: { min: 26, max: 34 }, casing: "mixed", exclude: "0OIl" }, bech32: { prefix: { mainnet: "bc1", testnet: "tb1" }, length: { min: 42, max: 42 }, casing: "lower", exclude: "1bBiIoO" }, taproot: { prefix: { mainnet: "bc1p", testnet: "tb1p" }, length: { min: 62, max: 62 }, casing: "lower", exclude: "1bBiIoO" } }, or = typeof Buffer > "u" || !ur("base64") ? (e) => {
|
|
289
289
|
let a = new TextEncoder().encode(e), r = Array.from(a, (n) => String.fromCodePoint(n)).join("");
|
|
@@ -3142,7 +3142,7 @@ const xr = (e) => {
|
|
|
3142
3142
|
} = xr(d), ya = a || fetch;
|
|
3143
3143
|
v = v ? (v + "").toLowerCase() : "text";
|
|
3144
3144
|
let Le = $s([b, D && D.toAbortSignal()], B), be = null;
|
|
3145
|
-
const
|
|
3145
|
+
const ne = Le && Le.unsubscribe && (() => {
|
|
3146
3146
|
Le.unsubscribe();
|
|
3147
3147
|
});
|
|
3148
3148
|
let ga;
|
|
@@ -3174,7 +3174,7 @@ const xr = (e) => {
|
|
|
3174
3174
|
be = t && new r(p, fa);
|
|
3175
3175
|
let X = await (t ? ya(be, pa) : ya(p, fa));
|
|
3176
3176
|
const ba = h && (v === "stream" || v === "response");
|
|
3177
|
-
if (h && (C || ba &&
|
|
3177
|
+
if (h && (C || ba && ne)) {
|
|
3178
3178
|
const Q = {};
|
|
3179
3179
|
["status", "statusText", "headers"].forEach((Ca) => {
|
|
3180
3180
|
Q[Ca] = X[Ca];
|
|
@@ -3185,14 +3185,14 @@ const xr = (e) => {
|
|
|
3185
3185
|
) || [];
|
|
3186
3186
|
X = new n(
|
|
3187
3187
|
Oa(X.body, Ka, $e, () => {
|
|
3188
|
-
Pe && Pe(),
|
|
3188
|
+
Pe && Pe(), ne && ne();
|
|
3189
3189
|
}),
|
|
3190
3190
|
Q
|
|
3191
3191
|
);
|
|
3192
3192
|
}
|
|
3193
3193
|
v = v || "text";
|
|
3194
3194
|
let zr = await m[c.findKey(m, v) || "text"](X, d);
|
|
3195
|
-
return !ba &&
|
|
3195
|
+
return !ba && ne && ne(), await new Promise((Q, de) => {
|
|
3196
3196
|
Nr(Q, de, {
|
|
3197
3197
|
data: zr,
|
|
3198
3198
|
headers: z.from(X.headers),
|
|
@@ -3203,7 +3203,7 @@ const xr = (e) => {
|
|
|
3203
3203
|
});
|
|
3204
3204
|
});
|
|
3205
3205
|
} catch (U) {
|
|
3206
|
-
throw
|
|
3206
|
+
throw ne && ne(), U && U.name === "TypeError" && /Load failed|fetch/i.test(U.message) ? Object.assign(
|
|
3207
3207
|
new E("Network Error", E.ERR_NETWORK, d, be),
|
|
3208
3208
|
{
|
|
3209
3209
|
cause: U.cause || U
|
|
@@ -3708,10 +3708,10 @@ class ma {
|
|
|
3708
3708
|
}
|
|
3709
3709
|
async indexMock(a) {
|
|
3710
3710
|
let r = Ra(150);
|
|
3711
|
-
a.
|
|
3711
|
+
a.search_string && (r = this.citizensFilter(r, a.search_string));
|
|
3712
3712
|
let n = r.slice(
|
|
3713
|
-
(a.page - 1) * (a.
|
|
3714
|
-
a.page * (a.
|
|
3713
|
+
(a.page - 1) * (a.per_page ?? 1),
|
|
3714
|
+
a.page * (a.per_page ?? 1)
|
|
3715
3715
|
);
|
|
3716
3716
|
return a.fields && a.fields.length && (n = n.map((t) => Object.fromEntries(
|
|
3717
3717
|
Object.entries(t).filter(
|
|
@@ -3724,9 +3724,9 @@ class ma {
|
|
|
3724
3724
|
data: n,
|
|
3725
3725
|
meta: {
|
|
3726
3726
|
current_page: a.page,
|
|
3727
|
-
per_page: a.
|
|
3727
|
+
per_page: a.per_page ?? 1,
|
|
3728
3728
|
total: r.length,
|
|
3729
|
-
last_page: Math.ceil(r.length / (a.
|
|
3729
|
+
last_page: Math.ceil(r.length / (a.per_page ?? 1))
|
|
3730
3730
|
}
|
|
3731
3731
|
};
|
|
3732
3732
|
}
|
|
@@ -3840,8 +3840,8 @@ const oc = {
|
|
|
3840
3840
|
return (d, p) => {
|
|
3841
3841
|
var F;
|
|
3842
3842
|
return M(), j("div", oc, [
|
|
3843
|
-
|
|
3844
|
-
|
|
3843
|
+
re("div", uc, [
|
|
3844
|
+
re("div", lc, [
|
|
3845
3845
|
((F = i.value) == null ? void 0 : F.length) > 0 ? (M(), j("ul", sc, [
|
|
3846
3846
|
(M(!0), j(Fe, null, _r(i.value, (y, b) => (M(), j("li", {
|
|
3847
3847
|
key: y.id,
|
|
@@ -3861,7 +3861,7 @@ const oc = {
|
|
|
3861
3861
|
], !0)
|
|
3862
3862
|
], 40, cc))), 128))
|
|
3863
3863
|
])) : (M(), j("ul", dc, [...p[1] || (p[1] = [
|
|
3864
|
-
|
|
3864
|
+
re("li", { class: "option__text--muted" }, " Nenhuma opção encontrada ", -1)
|
|
3865
3865
|
])]))
|
|
3866
3866
|
], 512)
|
|
3867
3867
|
])
|
|
@@ -3881,7 +3881,11 @@ const oc = {
|
|
|
3881
3881
|
fluid: { type: Boolean, default: !1 },
|
|
3882
3882
|
variant: { default: "green" },
|
|
3883
3883
|
optionsField: { default: "name" },
|
|
3884
|
-
disabled: { type: Boolean, default: !1 }
|
|
3884
|
+
disabled: { type: Boolean, default: !1 },
|
|
3885
|
+
label: { default: "Usuário SUS" },
|
|
3886
|
+
placeholder: { default: "Selecione um usuário" },
|
|
3887
|
+
state: { default: "default" },
|
|
3888
|
+
errorMessage: { default: "" }
|
|
3885
3889
|
}, {
|
|
3886
3890
|
modelValue: {},
|
|
3887
3891
|
modelModifiers: {}
|
|
@@ -3891,9 +3895,9 @@ const oc = {
|
|
|
3891
3895
|
const a = $a("useToast"), r = Je(e, "modelValue"), n = e, i = new ma(), t = N([]), o = N(!1), u = N(!1), s = N(""), l = N(""), h = Zr("selectContainer"), m = Z(() => n.disabled || o.value || s.value.length < 2), g = Z(
|
|
3892
3896
|
() => u.value && l.value !== s.value && t.value.length ? "Buscar*" : "Buscar"
|
|
3893
3897
|
), f = Z(() => o.value ? "Carregando..." : s.value.length < 2 ? "Digite 2 ou mais caracteres." : ""), d = Z(() => ({
|
|
3894
|
-
|
|
3898
|
+
search_string: s.value,
|
|
3895
3899
|
page: 1,
|
|
3896
|
-
|
|
3900
|
+
per_page: 1e3
|
|
3897
3901
|
}));
|
|
3898
3902
|
me(r, () => {
|
|
3899
3903
|
if (!r.value)
|
|
@@ -3950,16 +3954,19 @@ const oc = {
|
|
|
3950
3954
|
fluid: e.fluid
|
|
3951
3955
|
}, {
|
|
3952
3956
|
default: w(() => [
|
|
3953
|
-
T(D,
|
|
3957
|
+
T(D, {
|
|
3954
3958
|
modelValue: s.value,
|
|
3955
3959
|
"onUpdate:modelValue": b[0] || (b[0] = (v) => s.value = v),
|
|
3956
3960
|
modelModifiers: { trim: !0 },
|
|
3957
|
-
state: "default",
|
|
3958
3961
|
fluid: e.fluid,
|
|
3962
|
+
label: e.label,
|
|
3963
|
+
placeholder: e.placeholder,
|
|
3964
|
+
state: e.state,
|
|
3965
|
+
"error-message": e.errorMessage,
|
|
3959
3966
|
disabled: o.value || e.disabled,
|
|
3960
3967
|
onKeydown: Xr(p, ["enter"]),
|
|
3961
3968
|
onBlur: b[1] || (b[1] = (v) => u.value = !1)
|
|
3962
|
-
}
|
|
3969
|
+
}, null, 8, ["modelValue", "fluid", "label", "placeholder", "state", "error-message", "disabled"]),
|
|
3963
3970
|
u.value ? (M(), K(mc, {
|
|
3964
3971
|
key: 0,
|
|
3965
3972
|
modelValue: r.value,
|
|
@@ -3985,28 +3992,28 @@ const oc = {
|
|
|
3985
3992
|
}, 1024),
|
|
3986
3993
|
T(B, { as: "body-2" }, {
|
|
3987
3994
|
default: w(() => [
|
|
3988
|
-
b[3] || (b[3] =
|
|
3989
|
-
H(" CPF: " + x(G(Za)(v.cpf)), 1)
|
|
3995
|
+
b[3] || (b[3] = re("br", null, null, -1)),
|
|
3996
|
+
H(" CPF: " + x(v.cpf ? G(Za)(v.cpf) : "--"), 1)
|
|
3990
3997
|
]),
|
|
3991
3998
|
_: 2
|
|
3992
3999
|
}, 1024),
|
|
3993
4000
|
T(B, { as: "body-2" }, {
|
|
3994
4001
|
default: w(() => [
|
|
3995
|
-
b[4] || (b[4] =
|
|
3996
|
-
H(" CNS: " + x(G(Xa)(v.cns)), 1)
|
|
4002
|
+
b[4] || (b[4] = re("br", null, null, -1)),
|
|
4003
|
+
H(" CNS: " + x(v.cns ? G(Xa)(v.cns) : "--"), 1)
|
|
3997
4004
|
]),
|
|
3998
4005
|
_: 2
|
|
3999
4006
|
}, 1024),
|
|
4000
4007
|
T(B, { as: "body-2" }, {
|
|
4001
4008
|
default: w(() => [
|
|
4002
|
-
b[5] || (b[5] =
|
|
4009
|
+
b[5] || (b[5] = re("br", null, null, -1)),
|
|
4003
4010
|
H(" Data de nascimento: " + x(F(v.birth_date)), 1)
|
|
4004
4011
|
]),
|
|
4005
4012
|
_: 2
|
|
4006
4013
|
}, 1024)
|
|
4007
4014
|
]),
|
|
4008
4015
|
_: 1
|
|
4009
|
-
}, 8, ["modelValue", "options", "fluid", "options-field"])) :
|
|
4016
|
+
}, 8, ["modelValue", "options", "fluid", "options-field"])) : ae("", !0)
|
|
4010
4017
|
]),
|
|
4011
4018
|
_: 1
|
|
4012
4019
|
}, 8, ["fluid"]),
|
|
@@ -4019,7 +4026,7 @@ const oc = {
|
|
|
4019
4026
|
"tooltip-text": f.value,
|
|
4020
4027
|
disabled: m.value,
|
|
4021
4028
|
onButtonClick: p
|
|
4022
|
-
}, null, 8, ["text", "variant", "tooltip-text", "disabled"])) :
|
|
4029
|
+
}, null, 8, ["text", "variant", "tooltip-text", "disabled"])) : ae("", !0)
|
|
4023
4030
|
]),
|
|
4024
4031
|
_: 1
|
|
4025
4032
|
}, 8, ["fluid"]);
|
|
@@ -4087,7 +4094,7 @@ const yc = { class: "mt-1" }, gc = /* @__PURE__ */ ve({
|
|
|
4087
4094
|
]),
|
|
4088
4095
|
_: 1
|
|
4089
4096
|
}),
|
|
4090
|
-
|
|
4097
|
+
re("div", yc, [
|
|
4091
4098
|
T(l, {
|
|
4092
4099
|
"font-weight": "semibold",
|
|
4093
4100
|
as: "caption"
|
|
@@ -4104,7 +4111,7 @@ const yc = { class: "mt-1" }, gc = /* @__PURE__ */ ve({
|
|
|
4104
4111
|
_: 1
|
|
4105
4112
|
})
|
|
4106
4113
|
]),
|
|
4107
|
-
|
|
4114
|
+
re("div", null, [
|
|
4108
4115
|
T(l, {
|
|
4109
4116
|
"font-weight": "semibold",
|
|
4110
4117
|
as: "caption"
|
|
@@ -4138,7 +4145,7 @@ const yc = { class: "mt-1" }, gc = /* @__PURE__ */ ve({
|
|
|
4138
4145
|
H(x(e.data.address.street) + ", Nº " + x(e.data.address.number ?? "--"), 1)
|
|
4139
4146
|
]),
|
|
4140
4147
|
_: 1
|
|
4141
|
-
})) :
|
|
4148
|
+
})) : ae("", !0),
|
|
4142
4149
|
e.data.address.neighborhood ? (M(), K(l, {
|
|
4143
4150
|
key: 1,
|
|
4144
4151
|
as: "caption"
|
|
@@ -4147,7 +4154,7 @@ const yc = { class: "mt-1" }, gc = /* @__PURE__ */ ve({
|
|
|
4147
4154
|
H(x(e.data.address.neighborhood), 1)
|
|
4148
4155
|
]),
|
|
4149
4156
|
_: 1
|
|
4150
|
-
})) :
|
|
4157
|
+
})) : ae("", !0),
|
|
4151
4158
|
e.data.address.city && e.data.address.uf ? (M(), K(l, {
|
|
4152
4159
|
key: 2,
|
|
4153
4160
|
as: "caption"
|
|
@@ -4156,7 +4163,7 @@ const yc = { class: "mt-1" }, gc = /* @__PURE__ */ ve({
|
|
|
4156
4163
|
H(x(e.data.address.city) + " / " + x(e.data.address.uf), 1)
|
|
4157
4164
|
]),
|
|
4158
4165
|
_: 1
|
|
4159
|
-
})) :
|
|
4166
|
+
})) : ae("", !0)
|
|
4160
4167
|
], 64)) : (M(), K(l, {
|
|
4161
4168
|
key: 1,
|
|
4162
4169
|
as: "caption"
|
|
@@ -4181,14 +4188,14 @@ const yc = { class: "mt-1" }, gc = /* @__PURE__ */ ve({
|
|
|
4181
4188
|
}, {
|
|
4182
4189
|
default: w(() => [
|
|
4183
4190
|
Ee(u.$slots, "prepend-action"),
|
|
4184
|
-
e.hideDetailsIcon ?
|
|
4191
|
+
e.hideDetailsIcon ? ae("", !0) : (M(), K(m, {
|
|
4185
4192
|
key: 0,
|
|
4186
4193
|
size: "sm",
|
|
4187
4194
|
icon: "document-text-outline",
|
|
4188
4195
|
"tooltip-text": "Ver detalhes",
|
|
4189
4196
|
onCdsClick: s[0] || (s[0] = (g) => r("details"))
|
|
4190
4197
|
})),
|
|
4191
|
-
e.hideEditIcon ?
|
|
4198
|
+
e.hideEditIcon ? ae("", !0) : (M(), K(m, {
|
|
4192
4199
|
key: 1,
|
|
4193
4200
|
size: "sm",
|
|
4194
4201
|
icon: "edit-outline",
|
|
@@ -4338,7 +4345,7 @@ const yc = { class: "mt-1" }, gc = /* @__PURE__ */ ve({
|
|
|
4338
4345
|
return (F, y) => {
|
|
4339
4346
|
const b = W("CdsDataTable"), D = W("CdsPagination");
|
|
4340
4347
|
return M(), j("div", null, [
|
|
4341
|
-
T(b,
|
|
4348
|
+
T(b, te({ ...F.$attrs }, {
|
|
4342
4349
|
modelValue: t.value,
|
|
4343
4350
|
"onUpdate:modelValue": y[2] || (y[2] = (B) => t.value = B),
|
|
4344
4351
|
fields: s.value,
|
|
@@ -4395,7 +4402,7 @@ const yc = { class: "mt-1" }, gc = /* @__PURE__ */ ve({
|
|
|
4395
4402
|
total: h.value.total,
|
|
4396
4403
|
variant: F.$attrs.variant ?? "green",
|
|
4397
4404
|
fluid: ""
|
|
4398
|
-
}, null, 8, ["modelValue", "per-page", "total", "variant"])) :
|
|
4405
|
+
}, null, 8, ["modelValue", "per-page", "total", "variant"])) : ae("", !0)
|
|
4399
4406
|
]);
|
|
4400
4407
|
};
|
|
4401
4408
|
}
|
|
@@ -4491,7 +4498,7 @@ const _c = /* @__PURE__ */ ve({
|
|
|
4491
4498
|
}
|
|
4492
4499
|
return (g, f) => {
|
|
4493
4500
|
const d = W("CdsTextInput"), p = W("CdsGridItem"), F = W("CdsDateInput"), y = W("CdsSelect"), b = W("CdsToast"), D = W("CdsGrid"), B = W("CdsSideSheet");
|
|
4494
|
-
return M(), K(B,
|
|
4501
|
+
return M(), K(B, te(g.$attrs, {
|
|
4495
4502
|
modelValue: t.value,
|
|
4496
4503
|
"onUpdate:modelValue": f[0] || (f[0] = (C) => t.value = C),
|
|
4497
4504
|
title: "Cadastrar usuário SUS",
|
|
@@ -4521,7 +4528,7 @@ const _c = /* @__PURE__ */ ve({
|
|
|
4521
4528
|
rules: "required|minLength:5"
|
|
4522
4529
|
}, {
|
|
4523
4530
|
default: w(({ field: C, errors: A, meta: v }) => [
|
|
4524
|
-
T(d,
|
|
4531
|
+
T(d, te(C, {
|
|
4525
4532
|
modelValue: C.value,
|
|
4526
4533
|
"onUpdate:modelValue": (O) => C.value = O,
|
|
4527
4534
|
label: "Nome",
|
|
@@ -4546,7 +4553,7 @@ const _c = /* @__PURE__ */ ve({
|
|
|
4546
4553
|
rules: "required|cns"
|
|
4547
4554
|
}, {
|
|
4548
4555
|
default: w(({ field: C, errors: A, meta: v }) => [
|
|
4549
|
-
T(d,
|
|
4556
|
+
T(d, te(C, {
|
|
4550
4557
|
modelValue: C.value,
|
|
4551
4558
|
"onUpdate:modelValue": (O) => C.value = O,
|
|
4552
4559
|
label: "CNS",
|
|
@@ -4572,7 +4579,7 @@ const _c = /* @__PURE__ */ ve({
|
|
|
4572
4579
|
rules: "required|cpf"
|
|
4573
4580
|
}, {
|
|
4574
4581
|
default: w(({ field: C, errors: A, meta: v }) => [
|
|
4575
|
-
T(d,
|
|
4582
|
+
T(d, te(C, {
|
|
4576
4583
|
modelValue: C.value,
|
|
4577
4584
|
"onUpdate:modelValue": (O) => C.value = O,
|
|
4578
4585
|
label: "CPF",
|
|
@@ -4598,7 +4605,7 @@ const _c = /* @__PURE__ */ ve({
|
|
|
4598
4605
|
rules: "required"
|
|
4599
4606
|
}, {
|
|
4600
4607
|
default: w(({ field: C, errors: A, meta: v }) => [
|
|
4601
|
-
T(F,
|
|
4608
|
+
T(F, te(C, {
|
|
4602
4609
|
modelValue: C.value,
|
|
4603
4610
|
"onUpdate:modelValue": (O) => C.value = O,
|
|
4604
4611
|
label: "Data de nascimento",
|
|
@@ -4623,7 +4630,7 @@ const _c = /* @__PURE__ */ ve({
|
|
|
4623
4630
|
rules: "required"
|
|
4624
4631
|
}, {
|
|
4625
4632
|
default: w(({ field: C, errors: A, meta: v }) => [
|
|
4626
|
-
T(y,
|
|
4633
|
+
T(y, te(C, {
|
|
4627
4634
|
modelValue: C.value,
|
|
4628
4635
|
"onUpdate:modelValue": (O) => C.value = O,
|
|
4629
4636
|
"options-field": "name",
|