-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.min.js
7 lines (6 loc) · 43.1 KB
/
index.min.js
1
2
3
4
5
6
7
var nt=Object.defineProperty;var ot=(t,n)=>{for(var r in n)nt(t,r,{get:n[r],enumerable:!0})};var ie=({init:t,routes:n,plugins:r,runtime:e})=>{let o=()=>{};t=typeof t=="function"?t:o,r=(r instanceof Array?r:[]).filter(c=>typeof c=="function");var i=o;let l=t()||{};var a=!0;let u=e(c=>{if(!a)return;let f=c.split("?"),p=f.shift(),d=p.split("/").map(decodeURIComponent),m=f.join("?"),{route:g,Params:b}=Object.keys(n).reduce((v,T)=>{let O=T.split("/");if(O.length==d.length){var N=1;let D=d.reduce((E,h,w)=>(E&&(O[w].substr(0,1)==":"?E[O[w].substr(1)]=h:O[w]!==h?E=null:N++),E),{});if(D&&N>v.weight)return{route:T,Params:D,weight:N}}return v},{route:"*",Params:{},weight:0}),y=n[g];typeof y=="function"&&(l.url=c,l.route=g,l.path=p,l.Params=b,l.query=m,r.forEach(v=>v(l)),i(l),i=y(l),i=typeof i!="function"?o:i)})||o;return()=>{a=!1,i(l),u(l)}};var ce=t=>{t.Query=t.query.split("&").map(n=>n.split("=")).map(n=>({key:decodeURIComponent(n.shift()),value:decodeURIComponent(n.join("="))})).filter(({key:n})=>n!="").reduce((n,{key:r,value:e})=>(r.substr(r.length-2)=="[]"?(r=r.substr(0,r.length-2),n[r]instanceof Array||(n[r]=[]),n[r].push(e)):n[r]=e,n),{})};var fe=({plugins:t,...n})=>ie({...n,plugins:[ce].concat(t),runtime:r=>{let e=()=>{r((window.location.hash||"#/").substr(1))};return window.addEventListener("hashchange",e),e(),()=>{window.removeEventListener("hashchange",e)}}});var le={};ot(le,{barcode:()=>qe,carousel:()=>ze,chart:()=>Xe,ctrl:()=>A,form:()=>Q,graph:()=>Qe,map:()=>et,modal:()=>Je,node:()=>S,render:()=>ee,sidebar:()=>Ge,spinner:()=>J,table:()=>Ke});var ue=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],z=["a","abbr","address","article","aside","audio","b","bdi","bdo","blockquote","body","button","canvas","caption","cite","code","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","html","i","iframe","ins","kbd","label","legend","li","main","map","mark","menu","meter","nav","noscript","object","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","small","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","u","ul","var","video"],lt=z.concat(ue);lt.sort();var me=t=>t.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),ge=t=>Object.keys(t||{}).reduce((n,r)=>{var e=t[r];let o=me(r);return o==="style"?e&&typeof e=="object"?e=Object.keys(e).reduce((i,l)=>{if(typeof e[l]=="number"||typeof e[l]=="string"){let a=String(e[l]).trim();a&&(i+=(i?"; ":"")+me(l)+": "+a)}return i},""):typeof e=="string"&&(e=e.split(";").map(i=>i.trim()).filter(i=>i&&i.indexOf(":")>0).join("; ")):o==="class"?e instanceof Array?e=e.filter(i=>typeof i=="string").map(i=>i.trim()).filter(i=>i).join(" "):typeof e=="string"&&(e=e.split(" ").map(i=>i.trim()).filter(i=>i).join(" ")):e===!0?e="":typeof e=="number"&&(e=String(e)),typeof e=="string"&&!e&&["class","style","id","lang"].indexOf(o)>=0&&(e=null),(typeof e=="function"||typeof e=="string")&&(n[o]=e),n},{}),he=(t,n)=>z.indexOf(t)<0?null:(n instanceof Array?n:[]).filter(r=>r),be=t=>z.concat(ue).reduce((n,r)=>({...n,[r]:(e,o)=>t(r,e,o)}),{});var at=(t,n,r)=>{let e=document.createElement(t),o=ge(n);Object.keys(o).forEach(l=>{typeof o[l]=="function"?l.substr(0,2)=="on"?e.addEventListener(l.substr(2),o[l]):e[l]=(...a)=>o[l](e,...a):e.setAttribute(l,o[l])});let i=he(t,r);return i instanceof Array&&i.forEach(l=>e.appendChild(l)),e},ye=be(at);ye.text=t=>document.createTextNode(typeof t=="string"?t:t===void 0?"":typeof t=="function"?t.toString():JSON.stringify(t,void 0,2));var S=t=>t(ye);var ve={loading:"Carregando...",noOption:"Escolha uma op\xE7\xE3o...",error:"Erro!",type:t=>"Deve ser do tipo espec\xEDficado.",minLength:t=>`Deve ter no m\xEDnimo ${t} caractere(s).`,maxLength:t=>`Deve ter no m\xE1ximo ${t} caractere(s).`,pattern:t=>"Deve possuir o padr\xE3o espec\xEDficado.",minimum:t=>`Deve ser no m\xEDnimo: ${t}`,maximum:t=>`Deve ser no m\xE1ximo: ${t}`,enum:t=>"Deve ser uma das op\xE7\xF5es poss\xEDveis.",maxItems:t=>`Deve ter no m\xE1ximo ${t} ite${t!=1?"ns":"m"}`,minItems:t=>`Deve ter no m\xEDnimo ${t} ite${t!=1?"ns":"m"}`,uniqueItems:t=>"Os items devem ser \xFAnicos.",boolFalse:"N\xE3o",boolTrue:"Sim"};var xe={loading:"Loading...",noOption:"Choose one option...",error:"Error!",type:t=>"Must be of the specified type.",minLength:t=>`Must be a minimum of ${t} character(s).`,maxLength:t=>`Must be a maximum of ${t} character(s).`,pattern:t=>"Must have the specified pattern.",minimum:t=>`Must be at least: ${t}`,maximum:t=>`Must be at most: ${t}`,enum:t=>"Must be one of the possible options.",maxItems:t=>`Must have at most ${t} item${t!=1?"s":""}`,minItems:t=>`Must have at least ${t} item${t!=1?"s":""}`,uniqueItems:t=>"Items must be unique.",boolFalse:"No",boolTrue:"Yes"};var I=t=>{let n=document.documentElement.lang||"en";return t=="lang"?n:(n.split("-")[0]=="pt"?ve:xe)[t]||t};var J=()=>S(({div:t,span:n,text:r})=>t({class:"d-flex justify-content-center p-5",title:I("loading")},[t({class:"spinner-border",style:{width:"5rem",height:"5rem"},role:"status"},[n({class:"visually-hidden"},[r(I("loading"))])])]));var Q=({css:t,update:n,submit:r,links:e,align:o,download:i,mime:l,...a})=>{var s=null,u=null,c=!1,f=null;let p=()=>typeof r!="function"||c?null:r(s,u);e=e instanceof Array?e:typeof r!="function"?[]:[{href:"submit"}],e=e.map(b=>(b.data=s,b.size=a.size,b.href==="submit"?(b.link=b.link==null?"primary":b.link,b.icon=b.icon==null?"check":b.icon,b.href=typeof r!="function"?null:p,b.download=i,b.mime=l,f=A(b),f):A(b)));let d=Object.keys(a.properties||{}).length,m=S(({div:b})=>e.length?o=="block"?b({class:"btn-group w-100"},e):b({class:"row g-1 align-items-center justify-content-"+(o||"start")},e.map(y=>b({class:"col-auto"},[y]))):null),g=A({type:"object",...a,update:(b,...y)=>{f&&(f.disabled=!!b,f.parentNode.title=b),s=y[0],u=y[1],typeof n=="function"&&n(b,...y)}});return S(({div:b,form:y,hr:v})=>y({class:t,novalidate:!0,onsubmit:T=>{T.preventDefault(),T.stopPropagation(),f?f.click():p()}},[g,!e.length||!g||g.nodeType!=1?null:v({class:"my-2"}),m]))};var ee=(t,n)=>{n=n||document.createElement("div");let r=e=>{n.innerHTML=typeof e=="string"?e:"",e&&typeof e=="object"&&n.appendChild(e)};return typeof t=="function"||t&&typeof t.then=="function"?(r(J()),Promise.resolve().then(()=>typeof t=="function"?t():t).then(e=>r(e)).catch(e=>{throw r(Q({title:I("error"),description:e.toString(),context:"danger",css:"d-flex justify-content-center my-5"})),e})):r(t),n};var we={bool:[{value:0,label:I("boolFalse")},{value:1,label:I("boolTrue")}],types:["string","number","integer","object","array","boolean","null"],context:["primary","secondary","success","danger","warning","info","light","dark"],ui:["","date","bool","text","info","hide","num.1","num.2","num.3","len:2","len:3","len:4","len:5","len:6","len:7","len:8","len:9","password","file","color","progress","context","icon","ui"]},je=t=>t instanceof Array?t.map(n=>typeof n=="object"?n:{value:n,label:n!=null&&String(n)?String(n):"_"}):null,Z=(t,n)=>n?we[t]:je(t)||je(we[t]);var Ae=({context:t,href:n,size:r,data:e,description:o,download:i,mime:l,links:a,bs:s,...u})=>{s=s||{};let c=Object.keys(s),f=a instanceof Array,p=f&&a.length,d=!n&&!p&&!c.length,m=n&&f,g=typeof n!="string"||f&&!m;t=Z("context",!0).indexOf(t)>=0?t:g?"primary":d?"link":"",r=!t||["lg","sm"].indexOf(r)<0?"":r;let b=typeof n=="function"?n:null,y=()=>typeof e=="function"?e():e;if(g)n=null;else if(!n)n="javascript:;";else{let x=y();n=n.replace(/{([^{}]*)}/g,(H,k)=>x&&(typeof x[k]=="string"||typeof x[k]=="number")?x[k]:H)}let v=x=>typeof x=="string"&&x.indexOf("://")>0?"_blank":null,T=(x,H)=>!x||!u.title||H?"":S(({sup:k,i:M,text:j})=>k({},[j(" "),M({class:["small","fa-solid fa-arrow-up-right-from-square"]})])),O=b?S(({span:x})=>x({class:"spinner-border spinner-border-sm",ariaHidden:"true"})):null,N=x=>{h.classList[x?"add":"remove"]("disabled"),x?B?B.replaceWith(O):h.prepend(O):B?O.replaceWith(B):h.removeChild(O)},D=b?()=>{Promise.resolve().then(()=>(N(!0),b(y()))).then(x=>{if(N(!1),w&&x){let H=w.getAttribute("href");w.setAttribute("href",H+encodeURIComponent(x)),w.click(),w.setAttribute("href",H)}}).catch(x=>{throw N(!1),x})}:null,E=v(n),h=S(({button:x,a:H,span:k})=>(g?x:H)({class:[t?"btn btn-"+t:"",r?"btn-"+r:"",d?"disabled":"",f&&!m?"dropdown-toggle":""],title:o||null,type:g?"button":null,onclick:D,href:n,target:E,dataBsToggle:f&&!m?"dropdown":null,ariaExpanded:f&&!m?"false":null,...c.reduce((M,j)=>({...M,["data-bs-"+j]:s[j]}),{})},[A(u),T(E,t),!i||!l?null:H({class:"d-none",href:`data:${l},`,download:i,onclick:M=>{M.stopPropagation()}})])),w=h.querySelector("a.d-none"),B=h.querySelector("i");return f?S(({div:x,ul:H,li:k,a:M,button:j})=>x({class:"btn-group"},[h,m?j({class:[t?"btn btn-"+t:"",r?"btn-"+r:"",p?"":"disabled","dropdown-toggle","dropdown-toggle-split"],type:"button",dataBsToggle:"dropdown",ariaExpanded:"false"}):null,H({class:"dropdown-menu"},a.map($=>({target:v($.href),...$})).map(({href:$,target:P,...Y})=>k({},[M({class:["dropdown-item",$?"":"disabled"],href:$&&typeof $=="string"?$:"javascript:;",target:P,onclick:typeof $!="function"?null:$,ariaDisabled:$?null:"true"},[A(Y),T(P)])])))])):h};var te={},U=t=>(te[t]=te[t]?te[t]+1:1,`app_${t}_${String(te[t]).padStart(6,"0")}`),re=t=>{t&&t.parentNode&&t.parentNode.removeChild(t)};var de=t=>t!=null&&typeof t!="boolean"&&t!==""&&!isNaN(t),V=({type:t,ui:n,maximum:r,minimum:e})=>{if(n=="password")return()=>"********";if(t=="boolean"||n=="bool")return o=>o?I("boolTrue"):I("boolFalse");if(n=="date")return o=>{if(typeof o=="number"&&o)o=(o<0?o+1:o)*1e3;else if(typeof o=="string"&&/^\d{4}-\d{2}-\d{2}/.test(o))o.length==10&&(o+="T12:00");else return"";let i=new Date(o);return isFinite(i)?i.toLocaleDateString(I("lang")):""};if(/^num\.[0-9]+$/.test(n)){let o=parseInt(n.substr(4)),i=10**o;return l=>de(l)?(t=="number"||typeof l=="string"&&l.indexOf(".")>=0?l=parseFloat(l):l=parseInt(Math.round(l))/i,l.toLocaleString(I("lang"),{minimumFractionDigits:o,maximumFractionDigits:o})):l??""}else if(/^len:[1-9][0-9]*$/.test(n)){let o=parseInt(n.substr(4));return i=>i==null?"":t=="number"||t=="integer"?String(i).padStart(o,"0"):String(i).padEnd(o," ").substr(0,o)}else return n=="color"?o=>typeof o=="string"?(/^[\dA-Fa-f]{6}$/.test(o)?"#":"")+o:o:n=="progress"?o=>{if(typeof o!="number")return o==null||!de(o)?0:o;let i=e??0,l=r??(t=="number"?1:100);return o=(o-i)/(l-i),o=o<0?0:o,100*o}:t=="integer"||t=="number"?o=>de(o)?t=="integer"?String(Math.round(o)):parseFloat(o).toLocaleString(I("lang")):o??"":t!="string"?o=>JSON.stringify(o,void 0,2):o=>o??""};var ne=t=>{let n=V(t)(t.default),r=typeof n=="number"&&n>100?100:n;return S(({a:e,div:o,span:i,text:l})=>t.href?A({...t,title:n,description:null,icon:null,default:null,type:null,ui:null}):t.ui=="progress"?o({style:{minWidth:"100px",backgroundColor:"lightgrey"},class:"rounded",title:n.toFixed(1)+"%"},[o({class:["rounded","text-white","overflow-visible","d-flex","flex-row","justify-content-center"],style:{width:r+"%",backgroundColor:`hsl(${[((100-r)/100*240).toFixed(1),"100%",(r/4+25).toFixed(1)+"%"].join(",")})`}},[l("\u2007\u2007\u2007\u2007"+n.toFixed(1)+"%")])]):t.ui=="color"?o({style:n?{backgroundColor:n}:null,title:n,class:"h-100 w-100"},[l("\uFEFF")]):t.ui=="icon"?A({icon:n,title:t.default}):t.ui=="context"?A({title:n,context:n,href:"javascript:;",size:"sm"}):t.ui=="text"||t.ui=="info"||t.ui!="bool"&&(t.type=="object"||t.type=="array")?i({style:{whiteSpace:"pre-wrap"}},[l(n)]):l(n))};var F=(t,n,r)=>S(({div:e,datalist:o,option:i,text:l})=>{let a=null,s=null,u=f=>{s=f.target.value,f.target.value=""},c=f=>{!f.target.value&&s!=null&&(f.target.value=s)};return e({class:"position-relative",validate:(f,p)=>{f.querySelectorAll(".invalid-feedback").forEach(d=>{d.textContent=""}),f.querySelectorAll(".is-valid, .is-invalid").forEach(d=>{d.classList.remove("is-valid","is-invalid")}),f.querySelectorAll(".validate").forEach(d=>{p?d.classList.add("is-invalid"):p===""&&d.classList.add("is-valid");let m=d.parentNode.querySelector(".invalid-feedback");m&&(m.textContent=p||"")})}},[].concat(S(t)).map((f,p)=>(p||(a=r?U("list"):null,a&&(f.setAttribute("list",a),f.addEventListener("focus",u),f.addEventListener("blur",c))),f)).concat(!r||!a?[]:o({id:a},r.map(f=>typeof f=="object"&&f.value!=null?i({value:f.value},[l(f.label)]):i({},[l(f)])))).concat(n?[]:[e({class:"invalid-feedback"})]))});var Oe=({title:t,description:n,readOnly:r,update:e,options:o,size:i,value:l})=>F(({input:a,label:s,text:u})=>o.map(c=>{let f=U("radio");return[a({type:"radio",name:t,title:n,class:"btn-check",id:f,autocomplete:"off",value:c.value,checked:c.value==l,disabled:r,onclick:p=>{e(p.target.value)}}),s({class:["btn","btn-"+c.value,i?"btn-"+i:"","me-2"],for:f},[u(c.label)])]}).reduce((c,f)=>c.concat(f),[]));var Le=({title:t,size:n})=>F(({input:r})=>r({class:["form-control",n?"form-control-"+n:"","text-center"],type:"text",name:t,value:"\u23F3",disabled:!0}),!0);var Se=({description:t,update:n,minimum:r,maximum:e,context:o,...i})=>{o=o||"primary",r=r??1,e=e??0,t=t||"";var l=i.default;let a=i.size,s=[];for(var u=r;u<=e;u++)s.push({value:u,label:`${t} (${u} / ${e})`.trim()});let c=!s.length,f=A({href:c?!1:()=>g(r),context:o,size:a,icon:"fast-backward"}),p=A({href:c?!1:()=>g(l-1),context:o,size:a,icon:"step-backward"}),d=A({href:c?!1:()=>g(l+1),context:o,size:a,icon:"step-forward"}),m=A({href:c?!1:()=>g(e),context:o,size:a,icon:"fast-forward"}),g=(y,v)=>{if(l=y<r?r:y>e?e:y,f.disabled=l<=r,p.disabled=l<=r,d.disabled=l>=e,m.disabled=l>=e,v)n(l);else{let T=A({...i,options:s,ui:"typeahead",default:l,update:(O,N)=>{O||g(N,!0)}});b?.replaceWith(T),b=T}};var b=null;return c?b=A({...i,ui:"pending"}):g(i.default),S(({div:y})=>y({class:"row gx-1 justify-content-center"},[f,p,b,d,m].map(v=>y({class:"col-auto"},[v]))))};var Ee=({title:t,description:n,readOnly:r,update:e,size:o,options:i,value:l,label:a})=>F(({input:s,div:u,button:c,text:f})=>{let p=h=>h.trim().toUpperCase(),d=i.length;var m=-1;let g=i.map((h,w)=>(m=m==-1&&h.value==l?w:m,{...h,search:p(h.label),hide:!1}));var b=m;let y=h=>{if(b<0){for(var w=h<0?d-1:0;w<d&&w>=0;w=w+h)if(!g[w].hide){b=w,E.children[w].classList.add("active");break}}else for(var w=b+d+h;!g[w%d].active;w=w+h){let x=w%d;if(!g[x].hide){E.children[b].classList.remove("active"),E.children[x].classList.add("active"),b=x;break}}},v=h=>{h==null&&(h=b),b!=h&&b>=0&&E.children[b].classList.remove("active"),h>=0&&(E.children[h].classList.add("active"),m=h,b=m,e(g[h].value,g[h].label),d==1&&(D.disabled=!0)),N()},T=h=>{h=p(h),g.forEach((w,B)=>{w.hide=h&&w.search.indexOf(h)<0,w.hide?E.children[B].classList.add("d-none"):E.children[B].classList.remove("d-none")})},O=()=>{D.value="",T(""),E.classList.remove("d-none")},N=()=>{D.value=m>=0?g[m].label:a,E.classList.add("d-none")},D=s({class:["validate","form-control",o?"form-control-"+o:""],type:"text",name:t,value:a,placeholder:n,autocomplete:"off",disabled:r||!i.length||i.length==1&&i[0].value==l,oninput:()=>{E.classList.remove("d-none");var h=D.value;setTimeout(()=>{h==D.value&&T(D.value)},500)},onfocus:()=>O(),onmousedown:()=>E.classList.contains("d-none")?O():N(),onblur:()=>setTimeout(N,300),onkeydown:h=>{let w=B=>B.indexOf(h.key)>=0;w(["Escape","Enter","Tab","ArrowDown","ArrowUp"])&&(E.classList.contains("d-none")?w(["Enter","ArrowDown","ArrowUp"])&&(O(),h.preventDefault()):w(["ArrowDown","ArrowUp"])?(y(w(["ArrowUp"])?-1:1),h.preventDefault()):w(["Enter"])?(v(),h.preventDefault()):w(["Tab"])?v():w(["Escape"])&&(N(),h.stopPropagation()))}}),E=u({class:["list-group","d-none","w-100","position-absolute","z-3",o=="sm"?"small":o=="lg"?"fs-5":""]},i.map((h,w)=>c({class:["py-1","list-group-item","list-group-item-action",w==b?"active":""],onclick:B=>{B.preventDefault(),v(w)}},[f(h.label)])));return[D,E]});var Ce=({type:t,title:n,description:r,readOnly:e,update:o,size:i,options:l,value:a})=>{var s=!0;return F(({select:u,option:c,text:f})=>u({class:["validate","form-control",i?"form-control-"+i:""],name:n,disabled:e||!l.length||l.length==1&&l[0].value==a,onchange:p=>{l.length==1&&(p.target.disabled=!0);var d=p.target.value;t=="integer"?d=parseInt(d):t=="number"&&(d=parseFloat(d));let m=l.filter(({value:g})=>d==g)[0];o(d,m?m.label:p.target.value)}},l.map(p=>(s=s&&a!=p.value,c({value:p.value,selected:a==p.value},[f(p.label)]))).concat(s?[c({value:a,disabled:!0,selected:!0},[f(r||a)])]:[])))};var Te=({type:t,title:n,description:r,readOnly:e,update:o,size:i,options:l,value:a})=>F(({div:s,input:u,label:c,text:f})=>{var p=!0;n=n||U("radio");var d=U("radio");return l.map(m=>{p=p&&a!=m.value;let g=U("radio");return s({class:"form-check"},[u({class:[m.value==a?"validate":"","form-check-input"],type:"radio",name:n,value:m.value,id:g,checked:m.value==a,onchange:b=>{b.target.closest("div.form-check").parentNode.querySelectorAll(`input[type="radio"][name="${n}"]`).forEach(T=>{T.classList.remove("validate")}),b.target.classList.add("validate");var y=b.target.value;t=="integer"?y=parseInt(y):t=="number"&&(y=parseFloat(y));let v=l.filter(({value:T})=>y==T)[0];o(y,v?v.label:b.target.value)}}),c({class:"form-check-label",for:g},[f(m.label)]),s({class:"invalid-feedback"})])}).concat(p?[s({class:"form-check"},[u({class:"validate form-check-input",type:"radio",name:n,value:a,id:d,checked:!0,disabled:!0}),c({class:"form-check-label",for:d},[f(r||a)]),s({class:"invalid-feedback"})])]:[])},!0);var $e=({type:t,ui:n,title:r,description:e,readOnly:o,update:i,size:l,options:a,value:s})=>F(({div:u,input:c,label:f,text:p})=>(s=s instanceof Array?s:[],a.map((d,m)=>{let g=U("checkbox");return u({class:["form-check",n=="switch"?"form-switch":""]},[c({class:[m?"":"validate","form-check-input"],type:"checkbox",name:r,value:d.value,id:g,checked:s.indexOf(d.value)>=0,onclick:b=>{b.target.closest("div.form-check").parentNode.querySelectorAll('input[type="checkbox"]').forEach(O=>{O.classList.remove("validate")}),b.target.classList.add("validate");var y=b.target.value;a.forEach(O=>{O.value==y&&(y=O.value)});let v=s.indexOf(y);v<0?s.push(y):s.splice(v,1);let T=a.filter(O=>s.indexOf(O.value)>=0);s=T.map(({value:O})=>O),i(s,T.map(({label:O})=>O).join(`
`))}}),f({class:"form-check-label",for:g},[p(d.label)]),u({class:"invalid-feedback"})])})),!0);var st=t=>{let n=(o,i)=>new Promise((l,a)=>{let s=new FileReader,u=c=>l({data:i&&c!=null?btoa(c):c,name:o.name,mime:o.type,is_base64:i?1:0});s.onloadend=()=>{s.error?i?u(null):n(o,!0):u(s.result)},i?s.readAsBinaryString(o):s.readAsText(o,"UTF-8")}),r=[];for(var e=0;e<t.length;e++)r.push(n(t[e],t[e].type.indexOf("text/")<0));return Promise.all(r)},Ne=({title:t,description:n,type:r,ui:e,readOnly:o,update:i,size:l})=>F(({input:a})=>a({class:["validate","form-control",l?"form-control-"+l:""],type:"file",name:t,placeholder:n,disabled:o,multiple:r=="array",oninput:s=>{e=="File"?i(r!="array"?s.target.files[0]:Array.from(s.target.files)):st(s.target.files).then(u=>{let c=u.map(({name:f})=>f);r=="array"?i(u,c.join(`
`)):r=="object"?i(u[0],c[0]):r=="string"&&i(u[0].data,c[0])})}}));var De=({items:t,minItems:n,maxItems:r,readOnly:e,writeOnly:o,showValid:i,update:l,size:a,value:s})=>{t=t||{},s=s instanceof Array?s:[],n=n??0;let u=[],c=[],f=[],p=()=>{u.reduce((y,v)=>!!(y||v),!1)||l(s,f.join(`
`)),m.disabled=s.length<=n,g.disabled=r!=null&&s.length>=r},d=(y,v)=>{v=v??s.length,c[v]=S(({div:T})=>T({class:a=="lg"?"my-3":a=="sm"?"my-1":"my-2"},[A({size:a,readOnly:e,writeOnly:o,showValid:i,...t,default:y,update:(O,N,D)=>{s[v]=N,f[v]=typeof D!="string"?String(N):D,u[v]=O,u.reduce((E,h)=>!!(E||h),!1)||l(s,f.join(`
`)),p()}})])),b.appendChild(c[v])},m=A({size:a,icon:"minus",context:"secondary",href:()=>{let y=s.length;y>n&&(s.pop(),f.pop(),c[y-1].parentNode.removeChild(c[y-1]),c.pop(),p())}}),g=A({size:a,icon:"plus",context:"secondary",href:()=>d(t.default)}),b=S(({div:y})=>y({},[y({class:"row g-1 align-items-center justify-content-start"},[m,g].map(v=>y({class:"col-auto"},[v])))]));return p(),s.forEach((y,v)=>d(y,v)),b};var Ie=({update:t,properties:n,title:r,description:e,context:o,icon:i,close:l,delay:a,showValid:s,size:u,col:c,readOnly:f,writeOnly:p,...d})=>{let m=n||{},g=Object.keys(m).filter(h=>m[h].ui!="hide"),b=o&&e,y=l||r||i,v={...d.default},T={};var O=g.reduce((h,w)=>({...h,[w]:"..."}),{}),N="";let D={},E=S(({div:h,fieldset:w,legend:B,button:x,hr:H,text:k})=>!y&&!g.length&&!b?k(""):w({},[y?B({class:"fw-bold clearfix "+(u=="lg"?"fs-4":u=="sm"?"fs-6":"fs-5")},[A({icon:i,title:r,description:e}),l?x({type:"button",class:"btn-close float-end",onclick:typeof l!="function"?null:l,dataBsDismiss:typeof l!="string"?null:l}):null]):null,!y||!b&&!g.length?null:H({class:"my-2"}),b?A({context:o,description:e}):null,g.length?h({class:"row"}):null]));return g.length&&(E.setProp=h=>{var w=!1;let B=Object.keys(h).filter(x=>h[x].ui!="hide");B.forEach((x,H)=>{if(w=B.length-1==H,h[x]==null){D[x]?.parentNode.removeChild(D[x]),delete v[x],delete T[x],delete O[x];return}h[x].default!==void 0&&h[x].readOnly&&delete v[x];let{title:k,description:M,...j}={delay:a,showValid:s,size:u,readOnly:f,writeOnly:p,...h[x],title:typeof h[x].title!="string"?x:h[x].title,default:v[x]==null?h[x].default:v[x],data:v},$=S(({div:P,label:Y,text:se,button:C})=>P({class:`col-${h[x].col||c||12} `+(u=="lg"?"my-3":u=="sm"?"my-1":"my-2")+(k?" row":"")+(u=="lg"?" fs-5":u=="sm"?" small":"")},[k?P({class:"col-sm-3"},[Y({class:["form-label","fw-bold",u=="lg"?" fs-5":u=="sm"?" small":""],title:M},[se(k+":")])]):null,A({...j,title:j.properties?null:x,description:!k||j.properties?M:null,css:k?"col-sm-9":null,update:(R,K,q)=>{q=typeof q!="string"?String(K):q,v[x]=K,T[x]=q,O[x]=R,N=Object.keys(O).reduce((rt,G)=>[...rt].concat(O[G]?`${h[G]&&h[G].title?h[G].title:G}: ${O[G]}`:[]),[]).join(`
`),typeof t=="function"&&w&&t(N,v,T,E)}})]));D[x]!=null?D[x].replaceWith($):E.querySelector(".row").appendChild($),D[x]=$})},E.setProp(m)),E};var Be=({title:t,description:n,readOnly:r,update:e,size:o,value:i})=>F(({textarea:l,text:a})=>l({class:["validate","form-control",o?"form-control-"+o:""],name:t,placeholder:n,disabled:r,rows:6,oninput:s=>{e(s.target.value)}},[a(i)]));var Me=({title:t,description:n,readOnly:r,update:e,size:o,value:i})=>F(({div:l,span:a,input:s})=>l({class:"input-group"},[a({class:"input-group-text"},[A({icon:i})]),s({class:["validate","form-control",o?"form-control-"+o:""],type:"text",name:t,placeholder:n,disabled:r,value:i,oninput:u=>{let c=u.target.closest(".input-group").querySelector(".input-group-text");c.innerHTML="",c.appendChild(A({icon:u.target.value})),e(u.target.value)}})]));var Fe=({type:t,title:n,description:r,minimum:e,maximum:o,readOnly:i,update:l,size:a,value:s})=>{let u=c=>(t=="integer"||t=="number")&&c?new Date(c<0?c+1:c*1e3).toISOString().substr(0,10):t=="string"&&c?c.substr(0,10):null;return F(({input:c})=>c({class:["validate","form-control",a?"form-control-"+a:""],type:"date",name:n,value:u(s),min:u(e),max:u(o),placeholder:r,disabled:i,oninput:f=>{var p=f.target.value;if(t=="integer"||t=="number")if(!p)p=0;else{var d=new Date(p+"T12:00").getTime()/1e3;d=d<=0?d-1:d,t=="integer"&&(d=Math.round(d)),p=d}l(p)}}))};var He=({title:t,description:n,readOnly:r,update:e,size:o,value:i})=>F(({input:l})=>l({class:["validate","form-check-input"],type:"checkbox",name:t,checked:!!i,disabled:r,onclick:a=>{e(a.target.checked)}}));var ke=({type:t,title:n,description:r,ui:e,minimum:o,maximum:i,readOnly:l,update:a,size:s,value:u,list:c})=>{var f=t=="integer"?1:null,p=0;/^num\.[1-9][0-9]*$/.test(e)&&(p=parseInt(e.substr(4)),f=t=="integer"||p?1/10**p:null);let d=g=>g!=null&&typeof g!="boolean"&&g!==""&&!isNaN(g),m=g=>(d(g)&&(g=parseFloat(t=="integer"?g*f:g),p&&(g=g.toFixed(p))),g);return F(({input:g})=>g({class:["validate","form-control",s?"form-control-"+s:""],type:"number",name:n,value:m(u),min:m(o),max:m(i),step:p&&f?f.toFixed(p):f,placeholder:r,disabled:l,oninput:b=>{var y=b.target.value;d(y)&&(y=t=="integer"?parseInt(Math.round(y/f)):parseFloat(y)),a(y)}}),!1,c)};var Pe=({title:t,description:n,ui:r,readOnly:e,update:o,size:i,value:l,list:a})=>F(({input:s})=>s({class:["validate","form-control",i?"form-control-"+i:""],type:r||"text",name:t,value:l,placeholder:n,disabled:e,oninput:u=>{o(u.target.value)}}),!1,a);var Re=({update:t,delay:n,...r})=>{let e={...r};if(e.readOnly=!!e.readOnly,e.writeOnly=!!e.writeOnly,e.default===void 0&&(e.type=="string"?e.default="":e.type=="boolean"?e.default=!1:e.type=="number"||e.type=="integer"?e.default=0:e.type=="array"?e.default=[]:e.type=="object"?e.default={}:e.default=null),e.value=e.default,e.options=e.options?e.options:e.enum instanceof Array?Z(e.enum):Z(e.ui),e.options instanceof Array&&e.type!="array"){e.options.forEach(s=>{s.label=s.label.split(/\s+/).map(u=>u.trim()).filter(u=>u).join(" ")}),e.enum=e.enum||e.options.map(({value:s})=>s);let a=e.options.filter(s=>s.value==e.value)[0];e.label=a?a.label:e.value}let o=a=>{let{type:s,minLength:u,maxLength:c,pattern:f,minimum:p,maximum:d,minItems:m,maxItems:g,uniqueItems:b}=e;var y="";return e.enum instanceof Array&&e.enum.indexOf(a)<0?y=I("enum")(e.enum):s=="null"&&a!==null||s=="boolean"&&a!==!1&&a!==!0||s=="object"&&(typeof a!="object"||a==null||a instanceof Array)||s=="array"&&!(a instanceof Array)||s=="string"&&typeof a!="string"||s=="number"&&typeof a!="number"||s=="integer"&&(typeof a!="number"||a%1!==0)?y=I("type")(s):typeof a=="string"||typeof a=="number"?(typeof a=="string"&&(u!=null&&a.length<u?y=I("minLength")(u):c!=null&&a.length>c?y=I("maxLength")(c):f!=null&&!new RegExp(f).test(a)&&(y=I("pattern")(f))),p!=null&&a<p?y=I("minimum")(V(e)(p)):d!=null&&a>d&&(y=I("maximum")(V(e)(d)))):a instanceof Array&&(m!=null&&a.length<m?y=I("error")(m):g!=null&&a.length>g?y=I("error")(g):b&&!a.reduce((v,T)=>v&&a.indexOf(T)<0,!0)&&(y=I("error")(b))),y};var i=null,l=null;return e.update=e.properties?t:(a,s)=>{if(n&&i!==a){i=a,setTimeout(()=>{i===a&&e.update(a,s)},n);return}let u=o(a);l&&typeof l.validate=="function"&&l.validate(u||(r.showValid?"":null)),typeof t=="function"&&t(u,a,s,l)},l=(e.ui!="file"&&e.ui!="File"&&(e.type=="object"||e.properties)?Ie:e.readOnly&&!e.writeOnly?ne:e.ui=="pending"?Le:e.ui=="pagination"?Se:e.ui=="context"?Oe:e.options instanceof Array?e.type=="array"?$e:e.ui=="radio"?Te:e.ui=="select"?Ce:Ee:e.ui=="file"||e.ui=="File"?Ne:e.type=="array"||e.items?De:e.ui=="text"||e.ui=="info"?Be:e.ui=="icon"?Me:e.ui=="date"?Fe:e.type=="boolean"||e.ui=="bool"?He:e.type=="number"||e.type=="integer"||/^num\.[1-9][0-9]*$/.test(e.ui)?ke:Pe)(e),typeof e.update=="function"&&!e.properties&&!e.items&&e.update(e.value,e.label),l};var it=t=>!t||typeof t!="string"?"":t.substr(0,1)=="@"?`fa-brands fa-${t.substr(1)}`:`fa-solid fa-${t}`,Ue=({title:t,description:n,icon:r,size:e,context:o})=>S(({div:i,span:l,i:a,text:s,p:u,...c})=>{e=["lg","sm"].indexOf(e)<0?"":e,o=Z("context",!0).indexOf(o)>=0?o:"";let f=e=="lg"?" fs-5":e=="sm"?" small":"",p=[r?a({class:it(r)}):null,!r||!t?null:s(" "),t?s(t):null].filter(m=>m!=null);var d=null;if(o&&(n?d=i({class:["alert","alert-"+o,"my-0",f],role:"alert"},[p.length?c[e=="lg"?"h3":e=="sm"?"h5":"h4"]({class:"alert-heading"},p):null,l({style:{whiteSpace:"pre-wrap"}},[s(n)])]):p.length&&(d=l({class:["badge","text-bg-"+o,f]},p))),d==null){let m=p.length;d=m?m==1&&(r||!n)?p[0]:l({title:n||null},p):s(""),p.length==1&&r&&n&&d.setAttribute("title",n)}return d});var A=({init:t,css:n,...r})=>{r.type==null&&r.default!=null&&(typeof r.default=="boolean"?r.type="boolean":typeof r.default=="string"?r.type="string":typeof r.default=="number"?r.type=Number.isInteger(r.default)?"integer":"number":r.default instanceof Array?r.type="array":typeof r.default=="object"&&(r.type="object")),r.size=["lg","sm"].indexOf(r.size)>=0?r.size:null;var e=r.type==null&&r.default==null&&r.ui==null&&r.href!=null||r.bs!=null?Ae(r):(r.type==null||r.type=="null")&&r.ui==null&&r.items==null&&r.properties==null?Ue(r):r.update==null&&["pending","pagination"].indexOf(r.ui)<0?ne(r):Re(r);return n&&(e.tagName!="DIV"?e=S(({div:o})=>o({class:n},[e])):e.setAttribute("class",((e.getAttribute("class")||"")+` ${n}`).trim())),typeof t=="function"&&t(e),e};var _=null,Je=({submit:t,...n})=>new Promise(r=>{var e=null;let o=S(({div:i})=>i({class:"modal fade",tabindex:"-1",dataBsFocus:"false"},[i({class:["modal-dialog",Object.keys(n.properties||{}).length?"modal-xl":"modal-sm"].join(" ")},[i({class:"modal-content"},[Q({align:"end",...n,css:"modal-body",ui:n.ui||"info",close:"modal",submit:typeof t!="function"?null:(l,a)=>Promise.resolve().then(()=>t(l,a)).then(s=>{_?(_.hide(),e=s):r(s)})})])])]));o.addEventListener("hidden.bs.modal",()=>{re(o),_=null,r(e)}),_&&_.hide(),document.body.appendChild(o),_=new bootstrap.Modal(o),_.show()});var ct=t=>JSON.parse(JSON.stringify(t)),We=(...t)=>n=>t.reduce((r,e)=>e(r),[...n]),Ze=t=>t,Ve=t=>{let n=t.filter(r=>r&&typeof r=="string").map(r=>{let e=r.substr(0,1)=="-"?-1:1;return{x:e,k:e==-1?r.substr(1):r}});return(r,e)=>n.reduce((o,{x:i,k:l})=>o||i*(r[l]>e[l]?1:r[l]<e[l]?-1:0),0)},_e=t=>n=>(n.sort(Ve(t)),n),ft=(t,n)=>r=>n?r.slice((t-1)*n,t*n):r,ut=t=>n=>t.reduce((r,e)=>r.filter(e),n),dt=(t,n)=>r=>{let e=o=>o!=null?String(o):"";return t&&(t=t.toLowerCase(),r=r.filter(o=>Object.keys(o).map(i=>{let l=(n[i]||e)(o[i]);return(typeof l=="string"?l:"").toLowerCase()}).reduce((i,l)=>i||l.indexOf(t)>=0,!1))),r},pt={count:t=>t.length,avg:t=>t.reduce((n,r)=>n+=r,0)/(t.length||1),sum:t=>t.reduce((n,r)=>n+=r,0)},mt=(t,n)=>r=>{let e=Ve(t),o=_e(t)(r),i=Object.keys(n).reduce((l,a)=>(l.indexOf(a)<0&&l.push(a),l),ct(t));return o.reduce((l,a)=>{let s=l[l.length-1];return s==null||e(a,s)?l.push(i.reduce((u,c)=>({...u,[c]:t.indexOf(c)<0?[a[c]]:a[c]}),{})):i.filter(u=>t.indexOf(u)<0).forEach(u=>{s[u].push(a[u])}),l},[]).map(l=>i.filter(a=>t.indexOf(a)<0).reduce((a,s)=>({...a,[s]:n[s](l[s])}),l))},Ye=({filters:t,search:n,page:r,limit:e,sort:o,group:i,checked:l,data:a,totals:s,format:u})=>{var c=null,f=null,p=1;if(a instanceof Array){s=Object.keys(s).reduce((m,g)=>(m[g]=pt[s[g]]||(()=>"_"),m),{}),c=We(ut(t),dt(n,u),i?mt(i,s):Ze,o?_e([o]):Ze)(a),p=Math.ceil(c.length/e)||1,r>p?r=p:r<1&&(r=1),f=We(ft(r,e))(c);let d=l.length?l:c;s=Object.keys(s).reduce((m,g)=>(m[g]=m[g](d.map(b=>b[g])),m),s)}else s=Object.keys(s).reduce((d,m)=>(d[m]="_",d),{});return{view:f,totals:s,pages:p,rows:c}};var Ke=({title:t,links:n,items:r,query:e,pagination:o,search:i,sort:l,check:a,css:s,update:u,init:c,...f})=>{r=r||{};let p=r.links||[],d=r.properties||{},m=Object.keys(d).filter(E=>d[E].ui!="hide"),g=m.reduce((E,h)=>({...E,[h]:V(d[h])}),{}),b=m.reduce((E,h)=>(d[h].totals&&(E[h]=d[h].totals),E),{}),y=Object.keys(b),v=y.length>0;e=e?{...e}:{};var T=null;let O={refresh:E=>{(E instanceof Array||E===null)&&(O.data=E),D()},data:f.default,rows:null,query:e,properties:d,format:g},N=S(({table:E,thead:h,tbody:w,tr:B,th:x,td:H,div:k,a:M,text:j,button:$,ul:P,span:Y,label:se})=>E({class:["table"].concat(s)},[h({},[t?B({},[x({class:"text-center",colspan:"100%"},[A({...f,title:t})])]):null,!n||!n.length?null:B({},[x({class:"text-center",colspan:"100%"},[k({class:"row gx-1 justify-content-center"},(n||[]).map(C=>k({class:"col-auto"},[A({...C,data:O})])))])]),o?B({},[H({class:"text-center",colspan:"100%"},[T=A({ui:"pagination"})])]):null,i?B({},[x({class:"text-center",colspan:"100%"},[A({type:"string",description:i,title:"search",default:e.search,delay:500,update:(C,R)=>{!C&&R!=e.search&&(e.search=R,D())}})])]):null,v?B({},[a?H({dataCtx:"groupHide"}):null].concat(p.map(()=>H({dataCtx:"groupHide"}))).concat(m.map(C=>H({class:"text-center align-middle",dataCtx:"totals:"+C})))):null,!a&&!p.length&&!m.length?null:B({},[a?x({class:"text-center align-middle",dataCtx:"groupHide"},[A({size:"sm",context:"success",icon:"check",href:()=>{(O.rows||[]).forEach(C=>{let R=e.checked.indexOf(C);R<0?e.checked.push(C):e.checked.splice(R,1)}),D(!0)}})]):null].concat(p.map(({icon:C,title:R})=>x({class:"text-center align-middle",dataCtx:"groupHide"},[A({icon:C,title:C?"":R})]))).concat(m.map(C=>x({class:"text-center align-middle"},[Y({title:d[C].description,dataCtx:"field:"+C},[j(d[C].title||C)]),l?j(" "):null,l?M({dataCtx:"sort:"+C,href:"javascript:;",onclick:()=>{e.sort=(e.sort==C?"-":"")+C,D(!0)}}):null]))))]),w()])),D=E=>{if(e.page=typeof e.page=="number"&&e.page>=1?parseInt(e.page):1,e.limit=o?typeof e.limit=="number"&&e.limit>=1?parseInt(e.limit):10:0,e.filters=(e.filters instanceof Array?e.filters:[]).filter(M=>typeof M=="function"),e.search=typeof e.search=="string"?e.search:"",e.sort=typeof e.sort=="string"?e.sort:"",e.group=e.group instanceof Array?e.group:null,e.checked=e.checked instanceof Array?e.checked:[],O.data instanceof Array){let M=e.checked;for(var h=M.length-1;h>=0;h--)O.data.indexOf(M[h])<0&&M.splice(h,1)}let w=N.querySelector("tbody");w.innerHTML="";let B=(u||Ye)({...e,data:O.data,totals:b,format:g})||{};O.rows=B.rows;let{view:x,totals:H,pages:k}=B;if(x){N.querySelectorAll('[data-ctx^="sort:"]').forEach(j=>{let $=j.getAttribute("data-ctx").substr(5),P=e.sort;j.innerHTML="",j.appendChild(A({icon:"sort"+(P==$?"-down":P=="-"+$?"-up":"")}))}),o&&(E||T.replaceWith(A({ui:"pagination",description:o,default:e.page,maximum:k,update:(j,$)=>{!j&&$&&$!=e.page&&(e.page=$,D(!0))},init:j=>T=j}))),N.querySelectorAll('[data-ctx="groupHide"]').forEach(j=>{j.classList[e.group?"add":"remove"]("d-none")});let M=m.filter(j=>e.group&&e.group.indexOf(j)<0&&y.indexOf(j)<0);m.forEach(j=>{let $=e.group&&e.group.indexOf(j)>=0;N.querySelectorAll('[data-ctx="field:'+j+'"], [data-ctx="totals:'+j+'"]').forEach(P=>{P.closest("th,td").classList[M.indexOf(j)<0?"remove":"add"]("d-none"),P.getAttribute("data-ctx")==`field:${j}`&&(P.classList.remove("text-uppercase","text-lowercase"),e.group&&P.classList.add("text-"+($?"lower":"upper")+"case"))})}),N.querySelectorAll('[data-ctx^="totals:"]').forEach(j=>{let $=j.getAttribute("data-ctx").substr(7);j.innerHTML="",H[$]!=null&&j.appendChild(A({...d[$],readOnly:!0,href:null,default:H[$]}))}),w.innerHTML="",x.forEach(j=>{w.appendChild(S(({tr:$,td:P,a:Y,text:se})=>$({title:typeof r.info=="function"?r.info(j):r.info,class:typeof r.css=="function"?r.css(j):r.css},[e.group||!a?null:P({class:"text-center align-middle"},[A({type:"boolean",default:e.checked.indexOf(j)>=0,update:(C,R)=>{if(!C){let K=e.checked.indexOf(j);K<0&&R?(e.checked.push(j),D(!0)):K>=0&&!R&&(e.checked.splice(K,1),D(!0))}}})])].concat(p.map(C=>e.group?null:P({class:"text-center align-middle"},[A({...C,size:"sm",title:C.icon?"":C.title,data:typeof C.href=="function"?{...O,row:j}:j})]))).concat(m.filter(C=>M.indexOf(C)<0).map(C=>P({class:"align-middle text-"+(d[C].ui=="text"?"left":"center"),style:d[C].ui=="color"&&j[C]&&typeof j[C]=="string"?"background-color:"+g[C](j[C]):null,title:d[C].ui=="color"?j[C]:null},[d[C].ui=="color"?null:A({...d[C],readOnly:!0,href:e.group?null:d[C].href,default:j[C],data:j,size:d[C].href&&!e.group&&d[C].context?"sm":null})]))))))})}else N.querySelectorAll('[data-ctx^="totals:"]').forEach(M=>{let j=M.getAttribute("data-ctx").substr(7),$=H[j];M.textContent=$??""}),w.innerHTML="",w.appendChild(S(({tr:M,td:j})=>M({},[j({colspan:"100%"},[J()])])))};return typeof c=="function"&&c(O.refresh),D(),N};var Ge=({links:t,title:n,description:r,icon:e})=>{re(document.getElementById("sidebar"));let o=t&&t instanceof Array;if(document.body.querySelectorAll('a[href="#sidebar"]').forEach(i=>{i.classList[o?"remove":"add"]("invisible")}),o){let i=({children:l})=>{let a="angle-down",s="angle-right";return S(({div:u,ul:c,li:f,a:p,text:d})=>c({class:"list-group"},(l||[]).map(({children:m,href:g,title:b,...y})=>f({class:"list-group-item border-0",dataPawPath:b},[A({init:v=>{if(v.setAttribute("class","text-decoration-none text-reset"),v.setAttribute("data-paw-active","fw-bold"),m){v.prepend(d(" "));let T=A({icon:s});T.setAttribute("data-paw-active","fa-"+a),T.setAttribute("data-paw-inactive","fa-"+s),v.prepend(T),v.addEventListener("click",()=>{let O=v.closest(".list-group-item").querySelector("div");O.classList.toggle("d-none"),v.querySelector("i").setAttribute("class","fa-solid fa-"+(O.classList.contains("d-none")?s:a))})}else typeof g=="function"&&v.addEventListener("click",g)},href:!m&&typeof g=="string"?g:"javascript:;",title:b,...y}),m?u({class:"mt-2",dataPawInactive:"d-none"},[i({children:m})]):null]))))};document.body.appendChild(S(({div:l,h5:a,small:s,a:u,text:c,button:f})=>l({id:"sidebar",class:"offcanvas offcanvas-start",tabindex:"-1",onclick:p=>{let d=p.target.closest("a[href]"),m=d?d.getAttribute("href"):"";m&&m.substr(0,11)!="javascript:"&&p.target.closest("div.offcanvas").querySelector("button.btn-close").click()}},[l({class:"offcanvas-header"},[a({class:"offcanvas-title"},[A({icon:e,title:n,description:r})]),f({type:"button",class:"btn-close",dataBsDismiss:"offcanvas",ariaLabel:"close"})]),l({class:"offcanvas-body"},[i({children:t})])])))}};var W={graph:"https://cdn.jsdelivr.net/npm/[email protected]/dist/cytoscape.esm.min.js",chart:"https://cdn.jsdelivr.net/npm/[email protected]/dist/chart.umd.min.js",barcode:"https://cdn.jsdelivr.net/npm/[email protected]/dist/JsBarcode.all.min.js",map:{js:{src:"https://unpkg.com/[email protected]/dist/leaflet.js",integrity:"sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=",crossorigin:""},css:{rel:"stylesheet",href:"https://unpkg.com/[email protected]/dist/leaflet.css",integrity:"sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=",crossorigin:""},tile:"https://tile.openstreetmap.org/{z}/{x}/{y}.png",copyright:"http://www.openstreetmap.org/copyright"},fontawesome:{rel:"stylesheet",href:"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css",integrity:"sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A==",crossorigin:"anonymous",referrerpolicy:"no-referrer"},bootstrap:{js:{src:"https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js",integrity:"sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz",crossorigin:"anonymous"},css:"https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css",theme:t=>`https://cdn.jsdelivr.net/npm/[email protected]/dist/${t}/bootstrap.min.css`},highlight:{js:"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js",css:{rel:"stylesheet",href:"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github.min.css"}}};var Qe=({data:t})=>{let n=S(({div:r,p:e,h5:o,i,text:l})=>r({class:"w-100 vh-100"},[r({class:"p-5 h-100"},[r({class:"card mb-3 h-100"},[r({class:"row no-gutters h-100"},[r({class:"col-lg-4 border-right"},[r({class:"card-body h-100 overflow-auto p5"},[o({class:"card-title"},[l(I("noOption"))]),e({class:"card-text"})])]),r({class:"col-lg-8 h-100"},[J()])])])])]));return import(W.graph).then(r=>{let e=t.filter(c=>c.source==null||c.target==null),o=t.filter(c=>c.source!=null&&c.target!=null&&e.map(f=>f.id).indexOf(c.source)!=-1&&e.map(f=>f.id).indexOf(c.target)!=-1),i=n.querySelector(".col-lg-8");i.innerHTML="";var l=r.default({container:i,elements:e.concat(o).map(c=>({data:c})),style:[{selector:"node",style:{shape:"ellipse",height:"50px",width:"70px","border-width":"1px","border-color":"data(color)","text-valign":"center","background-color":"white",color:"black",label:"data(label)"}},{selector:"edge",style:{"line-color":"data(color)","curve-style":"bezier","target-arrow-color":"data(color)","target-arrow-shape":"chevron"}}],layout:{name:"cose",animate:!1}});let a=n.querySelector("h5"),s=n.querySelector("p");var u=!1;l.on("tap",c=>{if(u)return;let f=c.target.data();if(a.textContent=f.label||I("noOption"),typeof f.info!="function"){s.textContent=f.info;return}u=!0,s.innerHTML="",s.appendChild(J()),Promise.resolve().then(f.info).then(p=>{s.innerHTML="",s.appendChild(A({type:"string",ui:"text",default:p,readOnly:!0})),u=!1})})}),n};var Xe=({title:t,labels:n,datasets:r})=>{let e=J(),o=S(({div:i,canvas:l})=>i({class:"w-100"},[i({class:"p-5 h-100"},[i({class:"card mb-3 h-100"},[e,l({class:"h-100 w-100 m-auto"})])])]));return Promise.resolve().then(()=>window.Chart!=null?null:import(W.chart)).then(()=>{e.parentNode.removeChild(e),new Chart(o.querySelector("canvas").getContext("2d"),{type:"line",data:{labels:n,datasets:r.map((i,l)=>({label:"data"+(l+1),data:n.map(()=>0),borderColor:"black",fill:!1,pointStyle:"circle",...i}))},options:{responsive:!0,plugins:{title:{display:!!t,text:t}}}})}),o};var X=null,qe=({height:t,barcode:n})=>{let r=document.createElement("img"),e=()=>{JsBarcode(r,n,{displayValue:!0}),r.height=t||100};return window.JsBarcode?e():(X||(X=document.createElement("script"),X.src=W.barcode,document.head.appendChild(X)),X.addEventListener("load",e)),r};var ze=({images:t,index:n,interval:r,inverted:e,noIndicators:o,noControls:i,noCaption:l,noTouch:a,fade:s})=>{t=(t||[]).map(c=>({interval:r,...c})),n=t[n]==null?0:n;let u=U("carousel");return S(({div:c,button:f,img:p,h5:d,text:m,p:g,span:b})=>c({id:u,class:["carousel","slide",s?"carousel-fade":""],dataBsRide:r?"carousel":null,dataBsPause:r?"false":null,dataBsTouch:a?"false":null,dataBsTheme:e?"dark":null},[o?null:c({class:"carousel-indicators"},t.map(({title:y},v)=>f({type:"button",dataBsTarget:"#"+u,dataBsSlideTo:v,class:v==n?"active":null,ariaCurrent:v==n?"true":null,ariaLabel:y}))),c({class:"carousel-inner"},t.map(({src:y,title:v,description:T,interval:O},N)=>c({class:["carousel-item",N==n?"active":""],dataBsInterval:O},[p({src:y,class:["d-block","w-100"],alt:v,title:l?T:null}),l||!v&&!T?null:c({class:["carousel-caption","d-none","d-md-block"]},[v?d({},[m(v)]):null,T?g({},[m(T)]):null])]))),i?null:f({class:"carousel-control-prev",type:"button",dataBsTarget:"#"+u,dataBsSlide:"prev"},[b({class:"carousel-control-prev-icon",ariaHidden:"true"})]),i?null:f({class:"carousel-control-next",type:"button",dataBsTarget:"#"+u,dataBsSlide:"next"},[b({class:"carousel-control-next-icon",ariaHidden:"true"})])]))};var oe=null,pe=null,et=({latitude:t,longitude:n,zoom:r,height:e,width:o,markers:i})=>{let l=S(({div:s})=>s({style:{height:(e||400)+"px",width:(o||600)+"px"}})),a=()=>{let s=L.map(l).setView([t||0,n||0],r||13);L.tileLayer(W.map.tile,{maxZoom:19,attribution:`© <a href="${W.map.copyright}">OpenStreetMap</a>`}).addTo(s),i?.forEach(({latitude:u,longitude:c,title:f,description:p})=>{L.marker([u||0,c||0],{alt:f,title:p}).addTo(s)})};return window.L?setTimeout(a,100):(pe||(pe=S(({link:s})=>s(W.map.css)),document.head.appendChild(pe)),oe||(oe=S(({script:s})=>s(W.map.js)),document.head.appendChild(oe)),oe.addEventListener("load",a)),l};var ae=(t,n,r)=>(t.getAttribute(`data-paw-${n}`)||"").split(" ").map(e=>e.trim()).filter(e=>e).forEach(e=>{t.classList[r](e)}),tt=({url:t})=>{let n="#"+t;document.body.querySelectorAll(["[data-paw-active]","[data-paw-inactive]"].join(", ")).forEach(a=>{let s=a.closest("[data-paw-path]");ae(a,"active","remove"),ae(a,"inactive","add")});let r=Array.from(document.body.querySelectorAll("[data-paw-path] > a[href]")).reduce((a,s)=>{let u=s.getAttribute("href"),c=u.length;return n.substr(0,c)==u&&c>a.length?u:a},""),e=document.body.querySelector('[data-paw-path] > a[href="'+r+'"]'),o=document.body.querySelectorAll('[data-paw-text="current"]'),i=" | ";if(r&&e){let a=c=>{ae(c,"active","add"),ae(c,"inactive","remove"),Array.from(c.children).forEach(f=>{f.getAttribute("data-paw-path")||a(f)})},s=[];for(var l=e;l=l.closest("[data-paw-path]");)s.push(l.getAttribute("data-paw-path")),a(l),l=l.parentNode;document.title=s.concat(document.title.split(i).pop()).filter(c=>c).join(i),s.reverse();let u=s.join(" / ");o.forEach(c=>{c.textContent=u})}else document.title=document.title.split(i).pop(),o.forEach(a=>{a.textContent=""})};var gt=({root:t,build:n,routes:r,plugins:e})=>{t=t||document.body,n=typeof n=="function"?n:()=>({}),r=r||{},e=[tt].concat(e||[]);var o=null;return Promise.resolve().then(()=>typeof n=="function"?n(le):null).then(i=>{o==null&&(o=fe({init:()=>({...i||{},...le,root:t,render:(l,a)=>ee(l,a||t)}),routes:r,plugins:e}))}),()=>{typeof o=="function"&&o()}};export{gt as default};