diff --git a/MyApp/Components/Identity/StatusMessage.razor b/MyApp/Components/Identity/StatusMessage.razor index cca9077..031f025 100644 --- a/MyApp/Components/Identity/StatusMessage.razor +++ b/MyApp/Components/Identity/StatusMessage.razor @@ -1,4 +1,4 @@ -@using MyApp.Identity +@using MyApp.Identity @{ var message = Message ?? MessageFromCookie; @@ -14,7 +14,7 @@
@if (message.StartsWith("Error")) { -
+
-

@message

+

@message

} else { -
+
-

@message

+

@message

-
}
- } @code { diff --git a/MyApp/Configure.Db.Migrations.cs b/MyApp/Configure.Db.Migrations.cs index 50db137..5981921 100644 --- a/MyApp/Configure.Db.Migrations.cs +++ b/MyApp/Configure.Db.Migrations.cs @@ -26,11 +26,11 @@ public void Configure(IWebHostBuilder builder) => builder using (var scope = scopeFactory.CreateScope()) { using var db = scope.ServiceProvider.GetRequiredService(); - var dbJustCreated = db.Database.EnsureCreated(); + db.Database.EnsureCreated(); db.Database.Migrate(); // Only seed users if DB was just created - if (dbJustCreated) + if (!db.Users.Any()) { log.LogInformation("Adding Seed Users..."); AddSeedUsers(scope.ServiceProvider).Wait(); diff --git a/MyApp/MyApp.csproj b/MyApp/MyApp.csproj index 9407d7b..c25d211 100644 --- a/MyApp/MyApp.csproj +++ b/MyApp/MyApp.csproj @@ -39,6 +39,12 @@ + + + + + + diff --git a/MyApp/Pages/Account/Login.razor b/MyApp/Pages/Account/Login.razor index 70fdb1b..06a9097 100644 --- a/MyApp/Pages/Account/Login.razor +++ b/MyApp/Pages/Account/Login.razor @@ -46,7 +46,7 @@
- +
diff --git a/MyApp/Pages/Account/LoginWith2fa.razor b/MyApp/Pages/Account/LoginWith2fa.razor index 0902cab..d7779af 100644 --- a/MyApp/Pages/Account/LoginWith2fa.razor +++ b/MyApp/Pages/Account/LoginWith2fa.razor @@ -36,7 +36,7 @@
-
diff --git a/MyApp/Pages/Account/Manage/SetPassword.razor b/MyApp/Pages/Account/Manage/SetPassword.razor index 12e9e4a..2c4a860 100644 --- a/MyApp/Pages/Account/Manage/SetPassword.razor +++ b/MyApp/Pages/Account/Manage/SetPassword.razor @@ -32,7 +32,7 @@
- +
diff --git a/MyApp/wwwroot/css/typography.css b/MyApp/wwwroot/css/typography.css index 8098da7..382af0d 100644 --- a/MyApp/wwwroot/css/typography.css +++ b/MyApp/wwwroot/css/typography.css @@ -24,7 +24,7 @@ border-left-style: solid; } -.dark :not(:where([class~="not-prose"] *)), .dark .prose :where(td):not(:where([class~="not-prose"] *)) { +.dark .prose :not(:where([class~="not-prose"] *)), .dark .prose :where(td):not(:where([class~="not-prose"] *)) { color: rgb(209 213 219); /*text-gray-300*/ } .dark .prose :where(h1,h2,h3,h4,h5,h6,th):not(:where([class~="not-prose"] *)) { diff --git a/MyApp/wwwroot/lib/mjs/servicestack-vue.min.mjs b/MyApp/wwwroot/lib/mjs/servicestack-vue.min.mjs index 1d7f53c..ff292dc 100644 --- a/MyApp/wwwroot/lib/mjs/servicestack-vue.min.mjs +++ b/MyApp/wwwroot/lib/mjs/servicestack-vue.min.mjs @@ -1,5 +1,5 @@ var lo=Object.defineProperty,no=(e,t,l)=>t in e?lo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,Ce=(e,t,l)=>(no(e,"symbol"!=typeof t?t+"":t,l),l);import{defineComponent as ce,computed as f,openBlock as a,createElementBlock as u,normalizeClass as w,unref as o,createElementVNode as s,createCommentVNode as k,renderSlot as Z,ref as A,toDisplayString as T,inject as Ne,nextTick as xt,isRef as Gn,mergeProps as Me,withModifiers as Ue,h as gt,resolveComponent as X,createBlock as se,withCtx as ke,useAttrs as so,createVNode as $e,createTextVNode as we,watchEffect as hl,normalizeStyle as Xl,Fragment as Te,renderList as Ie,withDirectives as kt,vModelCheckbox as Yl,withKeys as Wn,createStaticVNode as wl,vModelSelect as oo,useSlots as en,getCurrentInstance as Be,onMounted as tt,createSlots as tn,normalizeProps as jt,guardReactiveProps as gl,vModelDynamic as ao,onUnmounted as Rt,watch as Lt,vModelText as io,resolveDynamicComponent as Jn,provide as Xt,resolveDirective as ro}from"vue";import{errorResponseExcept as uo,dateFmt as Xn,toTime as co,omit as dt,enc as Hl,setQueryString as fo,appendQueryString as Kt,nameOf as mo,ApiResult as Je,lastRightPart as $t,leftPart as xl,map as qe,toDate as Vt,toDateTime as vo,toCamelCase as ho,mapGet as ye,chop as go,fromXsdDuration as Yn,isDate as kl,timeFmt12 as po,apiValue as yo,indexOfAny as bo,createBus as wo,toKebabCase as Nn,sanitize as xo,humanize as He,delaySet as es,rightPart as dl,queryString as zl,combinePaths as ko,toPascalCase as st,errorResponse as mt,trimEnd as $o,$1 as pl,lastLeftPart as Co,ResponseStatus as Bl,ResponseError as Un,HttpMethods as ln,omitEmpty as _o,uniqueKeys as Nl,humanify as ts,each as Lo}from"@servicestack/client";const Vo={class:"flex items-center"},So={key:0,class:"flex-shrink-0 mr-3"},Mo={key:0,class:"h-5 w-5 text-yellow-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Ao=s("path",{"fill-rule":"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"},null,-1),To=[Ao],Fo={key:1,class:"h-5 w-5 text-red-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Io=s("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z","clip-rule":"evenodd"},null,-1),Do=[Io],jo={key:2,class:"h-5 w-5 text-blue-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Oo=s("path",{"fill-rule":"evenodd",d:"M19 10.5a8.5 8.5 0 11-17 0 8.5 8.5 0 0117 0zM8.25 9.75A.75.75 0 019 9h.253a1.75 1.75 0 011.709 2.13l-.46 2.066a.25.25 0 00.245.304H11a.75.75 0 010 1.5h-.253a1.75 1.75 0 01-1.709-2.13l.46-2.066a.25.25 0 00-.245-.304H9a.75.75 0 01-.75-.75zM10 7a1 1 0 100-2 1 1 0 000 2z","clip-rule":"evenodd"},null,-1),Po=[Oo],Bo={key:3,class:"h-5 w-5 text-green-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Ro=s("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z","clip-rule":"evenodd"},null,-1),Eo=[Ro],Ho=ce({__name:"Alert",props:{type:{default:"warn"},hideIcon:{type:Boolean}},setup(l){const e=l,n=f(()=>"info"==e.type?"bg-blue-50 dark:bg-blue-200":"error"==e.type?"bg-red-50 dark:bg-red-200":"success"==e.type?"bg-green-50 dark:bg-green-200":"bg-yellow-50 dark:bg-yellow-200"),r=f(()=>"info"==e.type?"border-blue-400":"error"==e.type?"border-red-400":"success"==e.type?"border-green-400":"border-yellow-400"),i=f(()=>"info"==e.type?"text-blue-700":"error"==e.type?"text-red-700":"success"==e.type?"text-green-700":"text-yellow-700");return(e,t)=>(a(),u("div",{class:w([o(n),o(r),"border-l-4 p-4"])},[s("div",Vo,[l.hideIcon?k("",!0):(a(),u("div",So,["warn"==l.type?(a(),u("svg",Mo,To)):"error"==l.type?(a(),u("svg",Fo,Do)):"info"==l.type?(a(),u("svg",jo,Po)):"success"==l.type?(a(),u("svg",Bo,Eo)):k("",!0)])),s("div",null,[s("p",{class:w([o(i),"text-sm"])},[Z(e.$slots,"default")],2)])])],2))}}),zo={key:0,class:"rounded-md bg-green-50 dark:bg-green-200 p-4",role:"alert"},No={class:"flex"},Uo=s("div",{class:"flex-shrink-0"},[s("svg",{class:"h-5 w-5 text-green-400 dark:text-green-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})])],-1),qo={class:"ml-3"},Qo={class:"text-sm font-medium text-green-800"},Ko={key:0},Zo={class:"ml-auto pl-3"},Go={class:"-mx-1.5 -my-1.5"},Wo=s("span",{class:"sr-only"},"Dismiss",-1),Jo=s("svg",{class:"h-5 w-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[s("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})],-1),Xo=[Wo,Jo],Yo=ce({__name:"AlertSuccess",props:{message:null},setup(l){const n=A(!1);return(e,t)=>n.value?k("",!0):(a(),u("div",zo,[s("div",No,[Uo,s("div",qo,[s("h3",Qo,[l.message?(a(),u("span",Ko,T(l.message),1)):Z(e.$slots,"default",{key:1})])]),s("div",Zo,[s("div",Go,[s("button",{type:"button",class:"inline-flex rounded-md bg-green-50 dark:bg-green-200 p-1.5 text-green-500 dark:text-green-600 hover:bg-green-100 dark:hover:bg-green-700 dark:hover:text-white focus:outline-none focus:ring-2 focus:ring-green-600 focus:ring-offset-2 focus:ring-offset-green-50 dark:ring-offset-green-200",onClick:t[0]||(t[0]=e=>n.value=!0)},Xo)])])])]))}}),ea={class:"flex"},ta=s("div",{class:"flex-shrink-0"},[s("svg",{class:"h-5 w-5 text-red-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{fill:"currentColor",d:"M12 2c5.53 0 10 4.47 10 10s-4.47 10-10 10S2 17.53 2 12S6.47 2 12 2m3.59 5L12 10.59L8.41 7L7 8.41L10.59 12L7 15.59L8.41 17L12 13.41L15.59 17L17 15.59L13.41 12L17 8.41L15.59 7Z"})])],-1),la={class:"ml-3"},na={class:"text-sm text-red-700 dark:text-red-200"},sa=ce({__name:"ErrorSummary",props:{status:null,except:null,class:null},setup(e){const t=e;let l=Ne("ApiState",void 0);const n=f(()=>t.status||null!=l&&l.error.value?uo.call({responseStatus:t.status??(null==l?void 0:l.error.value)},t.except??[]):null);return(e,t)=>o(n)?(a(),u("div",{key:0,class:w("bg-red-50 dark:bg-red-900 border-l-4 border-red-400 p-4 "+e.$props.class)},[s("div",ea,[ta,s("div",la,[s("p",na,T(o(n)),1)])])],2)):k("",!0)}}),oa=["id","aria-describedby"],aa=ce({__name:"InputDescription",props:{id:null,description:null},setup(l){return(e,t)=>l.description?(a(),u("div",{key:"description",class:"mt-2 text-sm text-gray-500",id:l.id+"-description","aria-describedby":l.id+"-description"},[s("div",null,T(l.description),1)],8,oa)):k("",!0)}});function $l(e){return Xn(e).replace(/\//g,"-")}function ls(e){return null==e?"":co(e)}function ns(e,t){e.value=null,xt(()=>e.value=t)}function Tt(l){return Object.keys(l).forEach(e=>{var t=l[e];l[e]=Gn(t)?o(t):t}),l}function Ct(e,t,l){l?(t.value=e.entering.cls+" "+e.entering.from,setTimeout(()=>t.value=e.entering.cls+" "+e.entering.to,0)):(t.value=e.leaving.cls+" "+e.leaving.from,setTimeout(()=>t.value=e.leaving.cls+" "+e.leaving.to,0))}function cl(l){if(!("u"0":"<"+e+Ul(l)+`>${t||""}`}function Ul(l){return Object.keys(l).reduce((e,t)=>`${e} ${t}="${Hl(l[t])}"`,"")}function Cl(e){return Object.assign({target:"_blank",rel:"noopener",class:"text-blue-600"},e)}function Dt(e){return kn(e)}let ia=["string","number","boolean","null","undefined"];function _t(e){return 0<=ia.indexOf(typeof e)||e instanceof Date}function Zt(e){return!_t(e)}class ss{get length(){return"u"",";"].some(e=>t.includes(e)))throw new Error(`Unsafe script: '${t}'`);e=Object.assign(Object.keys(globalThis).reduce((e,t)=>(e[t]=void 0,e),{}),e);return new Function("with(this) { return ("+t+") }").call(e)}function ql(e){typeof navigator<"u"&&navigator.clipboard.writeText(e)}function on(e){e=ne.config.storage.getItem(e);return e?JSON.parse(e):null}function _l(e,t){return Kt("swr."+mo(e),t?Object.assign({},e,t):e)}function ra(e){e.request&&(e=_l(e.request,e.args),ne.config.storage.removeItem(e))}async function os(e,t,l,a,s){var n=_l(t,a),e=(l(new Je({response:on(n)})),await e.api(t,a,s));return e.succeeded&&e.response&&(e.response._date=(new Date).valueOf(),t=JSON.stringify(e.response),ne.config.storage.setItem(n,t),l(e)),e}function as(t,l){let a=null;return(...e)=>{a&&clearTimeout(a),a=setTimeout(()=>{t(...e)},l||100)}}function pt(e){return"string"==typeof e?e.split(","):e||[]}function wt(e,t){const l=pt(t);return e.reduce((e,t)=>(e[t]=!l.includes(t),e),{})}function is(){return{LocalStore:ss,dateInputFormat:$l,timeInputFormat:ls,setRef:ns,unRefs:Tt,transition:Ct,focusNextElement:cl,getTypeName:Et,htmlTag:rt,htmlAttrs:Ul,linkAttrs:Cl,toAppUrl:Dt,isPrimitive:_t,isComplexType:Zt,pushState:nn,scopedExpr:sn,copyText:ql,fromCache:on,swrCacheKey:_l,swrClear:ra,swrApi:os,asStrings:pt,asOptions:wt,createDebounce:as}}const rs="png,jpg,jpeg,jfif,gif,svg,webp".split(","),us={img:"png,jpg,jpeg,gif,svg,webp,png,jpg,jpeg,gif,bmp,tif,tiff,webp,ai,psd,ps".split(","),vid:"avi,m4v,mov,mp4,mpg,mpeg,wmv,webm".split(","),aud:"mp3,mpa,ogg,wav,wma,mid,webm".split(","),ppt:"key,odp,pps,ppt,pptx".split(","),xls:"xls,xlsm,xlsx,ods,csv,tsv".split(","),doc:"doc,docx,pdf,rtf,tex,txt,md,rst,xls,xlsm,xlsx,ods,key,odp,pps,ppt,pptx".split(","),zip:"zip,tar,gz,7z,rar,gzip,deflate,br,iso,dmg,z,lz,lz4,lzh,s7z,apl,arg,jar,war".split(","),exe:"exe,bat,sh,cmd,com,app,msi,run,vb,vbs,js,ws,wsh".split(","),att:"bin,oct,dat".split(",")},qn=Object.keys(us),ft=(e,t)=>``,fl={img:ft("4 4 16 16",""),vid:ft("0 0 24 24",""),aud:ft("0 0 24 24",""),ppt:ft("0 0 48 48",""),xls:ft("0 0 256 256",""),doc:ft("0 0 32 32",""),zip:ft("0 0 16 16",""),exe:ft("0 0 16 16",""),att:ft("0 0 24 24","")},ua=/[\r\n%#()<>?[\\\]^`{|}]/g,Qn=1024,da=["Bytes","KB","MB","GB","TB"],ca=(()=>{const t="application/",e=t+"vnd.openxmlformats-officedocument.",l="image/",a="text/",s="video/",n={jpg:l+"jpeg",tif:l+"tiff",svg:l+"svg+xml",ico:l+"x-icon",ts:a+"typescript",py:a+"x-python",sh:a+"x-sh",mp3:"audio/mpeg3",mpg:s+"mpeg",ogv:s+"ogg",xlsx:e+"spreadsheetml.sheet",xltx:e+"spreadsheetml.template",docx:e+"wordprocessingml.document",dotx:e+"wordprocessingml.template",pptx:e+"presentationml.presentation",potx:e+"presentationml.template",ppsx:e+"presentationml.slideshow",mdb:t+"vnd.ms-access"};function o(e,t){e.split(",").forEach(e=>n[e]=t)}function r(e,t){e.split(",").forEach(e=>n[e]=t(e))}return r("jpeg,gif,png,tiff,bmp,webp",e=>l+e),r("jsx,csv,css",e=>a+e),r("aac,ac3,aiff,m4a,m4b,m4p,mid,midi,wav",e=>"audio/"+e),r("3gpp,avi,dv,divx,ogg,mp4,webm",e=>s+e),r("rtf,pdf",e=>t+e),o("htm,html,shtm",a+"html"),o("js,mjs,cjs",a+"javascript"),o("yml,yaml",t+"yaml"),o("bat,cmd",t+"bat"),o("xml,csproj,fsproj,vbproj",a+"xml"),o("txt,ps1",a+"plain"),o("qt,mov",s+"quicktime"),o("doc,dot",t+"msword"),o("xls,xlt,xla",t+"excel"),o("ppt,oit,pps,ppa",t+"vnd.ms-powerpoint"),o("cer,crt,der",t+"x-x509-ca-cert"),o("gz,tgz,zip,rar,lzh,z",t+"x-compressed"),o("aaf,aca,asd,bin,cab,chm,class,cur,db,dat,deploy,dll,dsp,exe,fla,ics,inf,mix,msi,mso,obj,ocx,prm,prx,psd,psp,qxd,sea,snp,so,sqlite,toc,ttf,u32,xmp,xsn,xtp",t+"octet-stream"),n})();let Ql=[];function ds(e){return(e=(e=(e=e.replace(/"/g,"'")).replace(/>\s+<")).replace(/\s{2,}/g," ")).replace(ua,encodeURIComponent)}function an(e){return"data:image/svg+xml;utf8,"+ds(e)}function cs(e){e=URL.createObjectURL(e);return Ql.push(e),e}function fs(){Ql.forEach(e=>{try{URL.revokeObjectURL(e)}catch(e){console.error("URL.revokeObjectURL",e)}}),Ql=[]}function rn(e){return e?(e=xl(e,"?"),$t(e,"/")):null}function Yt(e){e=rn(e);return null==e||-1===e.indexOf(".")?null:$t(e,".").toLowerCase()}function un(e){var t=Yt(e.name);return t&&0<=rs.indexOf(t)?cs(e):yt(e.name)}function dn(e){return e&&(!(!e.startsWith("blob:")&&!e.startsWith("data:"))||(e=Yt(e))&&0<=rs.indexOf(e))||!1}function yt(e){var t;return e?null==(t=Yt(e))||dn(e)?e:Qt(t)||an(fl.doc):null}function Qt(e){e=ms(e);return e&&an(e)||null}function ms(t){if(fl[t])return fl[t];for(let e=0;e({fileName:e.name,contentLength:e.size,filePath:un(e)}))}function Ll(e,t){e.onerror=null,e.src=fn(e.src,t)||""}function fn(e,t){return Qt($t(e,".").toLowerCase())||(t?Qt(t)||t:null)||Qt("doc")}function Kl(e){if(e)return e=$t(e,".").toLowerCase(),ca[e]||"application/"+e;throw new Error("fileNameOrExt required")}function Ch(){return{extSvg:ms,extSrc:Qt,getExt:Yt,encodeSvg:ds,canPreview:dn,getFileName:rn,getMimeType:Kl,formatBytes:cn,filePathUri:yt,svgToDataUri:an,fileImageUri:un,objectUrl:cs,flush:fs,inputFiles:fa,iconOnError:Ll,iconFallbackSrc:fn}}class ma{constructor(e){Ce(this,"view"),Ce(this,"includeTypes"),Object.assign(this,e)}getTypeName(){return"MetadataApp"}getMethod(){return"GET"}createResponse(){return{}}}const Ot="/metadata/app.json",va={Boolean:"checkbox",DateTime:"date",DateOnly:"date",DateTimeOffset:"date",TimeSpan:"time",TimeOnly:"time",Byte:"number",Short:"number",Int64:"number",Int32:"number",UInt16:"number",UInt32:"number",UInt64:"number",Single:"number",Double:"number",Decimal:"number",String:"text",Guid:"text",Uri:"text"},ha={number:"Int32",checkbox:"Boolean",date:"DateTime","datetime-local":"DateTime",time:"TimeSpan"},Zl={Byte:"byte",Int16:"short",Int32:"int",Int64:"long",UInt16:"ushort",Unt32:"uint",UInt64:"ulong",Single:"float",Double:"double",Decimal:"decimal"},ga=([...Object.keys(Zl),...Object.values(Zl)],{String:"string",Boolean:"bool",...Zl});function rl(e){return ga[e]||e}function vs(e,t){return e?(t=t||[],"Nullable`1"===e?rl(t[0])+"?":e.endsWith("[]")?`List<${rl(e.substring(0,e.length-2))}>`:0===t.length?rl(e):xl(rl(e),"`")+"<"+t.join(",")+">"):""}function pa(e){return e&&vs(e.name,e.genericArgs)}class Pt{constructor(){Ce(this,"Query"),Ce(this,"QueryInto"),Ce(this,"Create"),Ce(this,"Update"),Ce(this,"Patch"),Ce(this,"Delete")}get AnyQuery(){return this.Query||this.QueryInto}get AnyUpdate(){return this.Patch||this.Update}toArray(){return[this.Query,this.QueryInto,this.Create,this.Update,this.Patch,this.Delete].filter(e=>!!e).map(e=>e)}get empty(){return!(this.Query||this.QueryInto||this.Create||this.Update||this.Patch||this.Delete)}add(e){ze.isQueryInto(e)&&!this.QueryInto?this.QueryInto=e:ze.isQuery(e)&&!this.Query?this.Query=e:ze.isCreate(e)&&!this.Create?this.Create=e:ze.isUpdate(e)&&!this.Update?this.Update=e:ze.isPatch(e)&&!this.Patch?this.Patch=e:ze.isDelete(e)&&!this.Delete&&(this.Delete=e)}static from(e){const t=new Pt;return e.forEach(e=>{t.add(e)}),t}static forType(l,e){var t;let a=new Pt;return l&&(null!=(e=e??(null==(t=ne.metadata.value)?void 0:t.api))&&e.operations.forEach(e=>{var t;(null==(t=e.dataModel)?void 0:t.name)==l&&a.add(e)})),a}}const ze={Create:"ICreateDb`1",Update:"IUpdateDb`1",Patch:"IPatchDb`1",Delete:"IDeleteDb`1",AnyRead:["QueryDb`1","QueryDb`2"],AnyWrite:["ICreateDb`1","IUpdateDb`1","IPatchDb`1","IDeleteDb`1"],isAnyQuery:e=>qe(e.request.inherits,e=>0<=ze.AnyRead.indexOf(e.name)),isQuery:e=>qe(e.request.inherits,e=>"QueryDb`1"===e.name),isQueryInto:e=>qe(e.request.inherits,e=>"QueryDb`2"===e.name),isCrud:e=>{return null==(e=e.request.implements)?void 0:e.some(e=>0<=ze.AnyWrite.indexOf(e.name))},isCreate:e=>ul(e,ze.Create),isUpdate:e=>ul(e,ze.Update),isPatch:e=>ul(e,ze.Patch),isDelete:e=>ul(e,ze.Delete),model:e=>{var t;return e?qe(e.inherits,e=>0<=ze.AnyRead.indexOf(e.name))?null==(t=e.inherits)?void 0:t.genericArgs[0]:null==(e=null==(t=e.implements)?void 0:t.find(e=>0<=ze.AnyWrite.indexOf(e.name)))?void 0:e.genericArgs[0]:null}};function ya(e){var t;return(null==(t=e.input)?void 0:t.type)||Vl(mn(e))}function hs(e){return e.endsWith("?")?go(e,1):e}function Vl(e){return va[hs(e)]}function ba(e){return e&&ha[e]||"String"}function mn(e){return"Nullable`1"===e.type?e.genericArgs[0]:e.type}function Gl(e){return e&&"number"==Vl(e)||!1}function gs(e){return e&&"string"==e.toLowerCase()||!1}function wa(e){return"List`1"==e||e.startsWith("List<")||e.endsWith("[]")}function ps(e){var t;return!(null==e||!e.type||(t=mn(e),e.isValueType&&-1==t.indexOf("`"))||e.isEnum||null!=Vl(e.type))}function ys(e){var t;return!!(null!=e&&e.type&&(t=mn(e),e.isValueType&&-1==t.indexOf("`")||e.isEnum||"hidden"==(null==(t=e.input)?void 0:t.type)||"file"==(null==(t=e.input)?void 0:t.type)||"tag"==(null==(t=e.input)?void 0:t.type)||"combobox"==(null==(t=e.input)?void 0:t.type)||null!=Vl(e.type)))}function Gt(e,t){let l="string"==typeof e?Sl(e):e,a=(l||(console.warn("Metadata not found for: "+e),l={request:{name:e}}),function(e){Object.assign(this,e)}),s=(n.prototype.createResponse=function(){return l.returnsVoid?void 0:new a},n.prototype.getTypeName=function(){return l.request.name},n.prototype.getMethod=function(){return l.method||"POST"},n);function n(e){Object.assign(this,e)}return new s(t)}function xa(e,t,l={}){let a=function(e){Object.assign(this,e)},s=(n.prototype.createResponse=function(){return"function"==typeof l.createResponse?l.createResponse():new a},n.prototype.getTypeName=function(){return e},n.prototype.getMethod=function(){return l.method||"POST"},n);function n(e){Object.assign(this,e)}return new s(t)}function ml(l,e){return l?(Object.keys(l).forEach(e=>{var t=l[e];"string"==typeof t?t.startsWith("/Date")&&(l[e]=$l(Vt(t))):null!=t&&"object"==typeof t&&(Array.isArray(t)?l[e]=Array.from(t):l[e]=Object.assign({},t))}),l):{}}function ka(e,r){let i={};return Array.from(e.elements).forEach(a=>{var s;if(a.id&&null!=a.value&&""!==a.value){const n=a.id.toLowerCase(),o=r&&r.find(e=>e.name.toLowerCase()==n);let e=null==o?void 0:o.type,t=null==(s=null==o?void 0:o.genericArgs)?void 0:s[0],l="checkbox"===a.type?a.checked:a.value;Gl(e)?l=Number(l):"List`1"===e&&"string"==typeof l&&(l=l.split(",").map(e=>Gl(t)?Number(e):e)),i[a.id]=l}}),i}function vn(e){var t;return(null==(t=null==e?void 0:e.api)?void 0:t.operations)&&0e)?!1:a)){if((t||l)&&(await Kn(t||Ot,l),null!=ne.metadata.value))return;var s=Ne("client");if(null!=s&&(e=await s.api(new ma)).succeeded&&Wt(e.response),null!=ne.metadata.value)return;await Kn(Ot)}return ne.metadata.value}function ot(t,l){var e,a=null==(a=ne.metadata.value)?void 0:a.api;return a&&t?a.types.find(e=>e.name.toLowerCase()===t.toLowerCase()&&(!l||e.namespace==l))||((e=Sl(t))?e.request:(e=a.operations.find(e=>e.response&&e.response.name.toLowerCase()===t.toLowerCase()&&(!l||e.response.namespace==l)))?e.response:null):null}function Sl(t){var e=null==(e=ne.metadata.value)?void 0:e.api;return e?e.operations.find(e=>e.request.name.toLowerCase()===t.toLowerCase()):null}function La({dataModel:e}){var t=null==(t=ne.metadata.value)?void 0:t.api;if(!t)return[];let l=t.operations;if(e){const a="string"==typeof e?ot(e):e;l=l.filter(e=>bs(e.dataModel,a))}return l}function gn(e){return e?ot(e.name,e.namespace):null}function bs(e,t){return e&&t&&e.name===t.name&&(!e.namespace||!t.namespace||e.namespace===t.namespace)}function Va(e,t){e=ot(e);return e&&e.properties&&e.properties.find(e=>e.name.toLowerCase()===t.toLowerCase())}function ws(e){return xs(ot(e))}function xs(t){if(t&&t.isEnum&&null!=t.enumNames){var l={};for(let e=0;el.push({key:e,value:t[e]})),l}}function Sa(e,t){a=e.name,l=(null==t?void 0:t.type)||ya(e)||"text";var l,a=Object.assign({id:a,name:a,type:l},t);return e.isEnum&&(a.type="select",a.allowableEntries=pn(ks(e))),a}function Ma(e){let n=[];if(e){const o=et(e),t=Sl(e.name),r=gn(null==t?void 0:t.dataModel);o.forEach(t=>{var e;if(ys(t)){const l=Sa(t,t.input);if(l.id=ho(l.id),"file"==l.type&&t.uploadTo&&!l.accept&&(e=null==(e=null==(e=ne.metadata.value)?void 0:e.plugins.filesUpload)?void 0:e.locations.find(e=>e.name==t.uploadTo))&&!l.accept&&e.allowExtensions&&(l.accept=e.allowExtensions.map(e=>e.startsWith(".")?e:"."+e).join(",")),r&&(e=null==(e=r.properties)?void 0:e.find(e=>e.name==t.name),t.ref||(t.ref=null==e?void 0:e.ref)),l.options)try{const a={input:l,$typeFields:o.map(e=>e.name),$dataModelFields:r?et(r).map(e=>e.name):[],...ne.config.scopeWhitelist},s=sn(l.options,a);Object.keys(s).forEach(e=>{l[e]=s[e]})}catch{console.error(`failed to evaluate '${l.options}'`)}n.push(l)}})}return n}function yn(t,e){if(!e.type)return console.error("enumDescriptions missing {type:'EnumType'} options"),[""+t];var l=ot(e.type);if(null==l||!l.enumValues)return console.error("Could not find metadata for "+e.type),[""+t];var a=[];for(let e=0;e"number"==typeof e?yn(e,{type:t}):e}function et(e){if(!e)return[];let t=[],l={};for(;e;)e.properties&&e.properties.forEach(e=>{l[e.name]||(l[e.name]=1,t.push(e))}),e=e.inherits?gn(e.inherits):null;return t.map(e=>e.type.endsWith("[]")?{...e,type:"List`1",genericArgs:[e.type.substring(0,e.type.length-2)]}:e)}function ul(e,t){return(null==(e=e.request.implements)?void 0:e.some(e=>e.name===t))||!1}function el(e){return e?Cs(e,et(e)):null}function Cs(e,t){var l=t.find(e=>"id"===e.name.toLowerCase());if(l&&l.isPrimaryKey)return l;t=t.find(e=>e.isPrimaryKey)||l;if(!t){l=ze.model(e);if(l)return qe(ot(l),e=>el(e));console.error("Primary Key not found in "+e.name)}return t||null}function Aa(e,t){return qe(el(e),e=>ye(t,e.name))}function _s(e,t,l){return e&&"none"===e.valueType?"":"%In"===l.key||"%Between"===l.key?`(${l.value})`:Ta(t,l.value)}function Ta(e,t){return!e||Gl(e=hs(e))||"Boolean"===e?t:wa(e)?`[${t}]`:`'${t}'`}function at(){var e=f(()=>{var e;return(null==(e=ne.metadata.value)?void 0:e.app)||null}),t=f(()=>{var e;return(null==(e=ne.metadata.value)?void 0:e.api)||null}),l=f(()=>{var e;return(null==(e=ne.metadata.value)?void 0:e.plugins.autoQuery.viewerConventions)||[]});return hn(),{loadMetadata:_a,getMetadata:$a,setMetadata:Wt,clearMetadata:Ca,metadataApp:e,metadataApi:t,filterDefinitions:l,typeOf:ot,typeOfRef:gn,typeEquals:bs,apiOf:Sl,findApis:La,typeName:pa,typeName2:vs,property:Va,enumOptions:ws,propertyOptions:ks,createFormLayout:Ma,typeProperties:et,supportsProp:ys,Crud:ze,Apis:Pt,getPrimaryKey:el,getPrimaryKeyByProps:Cs,getId:Aa,createDto:Gt,makeDto:xa,toFormValues:ml,formValues:ka,isComplexProp:ps,asKvps:pn,expandEnumFlags:yn,enumFlagsConverter:$s}}const Xe=class Xe{static async getOrFetchValue(e,t,l,a,s,n,o){return Xe.getValue(l,o,s)??(await Xe.fetchLookupIds(e,t,l,a,s,n,[o]),Xe.getValue(l,o,s))}static getValue(e,t,l){e=Xe.Lookup[e];if(e){e=e[t];if(e)return e[l=l.toLowerCase()]}}static setValue(e,t,l,a){e=Xe.Lookup[e]??(Xe.Lookup[e]={});(e[t]??(e[t]={}))[l=l.toLowerCase()]=a}static setRefValue(e,t){var l=ye(t,e.refId);return null==l||null==e.refLabel?null:(t=ye(t,e.refLabel),Xe.setValue(e.model,l,e.refLabel,t),t)}static async fetchLookupIds(e,t,l,a,s,n,o){t=t.operations.find(e=>{return ze.isAnyQuery(e)&&(null==(e=e.dataModel)?void 0:e.name)==l});if(t){const r=Xe.Lookup[l]??(Xe.Lookup[l]={}),i=[];Object.keys(r).forEach(e=>{var t=r[e];ye(t,s)&&i.push(e)});var o=o.filter(e=>!i.includes(e));0!=o.length&&(n=n?null:a+","+s,o={[a+"In"]:o.join(",")},n&&(o.fields=n),n=Gt(t,o),(o=await e.api(n,{jsconfig:"edv,eccn"})).succeeded?(ye(o.response,"results")||[]).forEach(e=>{var t,l;ye(e,a)?(t=""+ye(e,a),l=ye(e,s),s=s.toLowerCase(),(r[t]??(r[t]={}))[s]=""+l):console.error(`result[${a}] == null`,e)}):console.error("Failed to call "+t.request.name))}}};Ce(Xe,"Lookup",{});let Ft=Xe,Wl=()=>(new Date).getTime(),Fa=["/","T",":","-"],ut={assumeUtc:!0,date:{method:"Intl.DateTimeFormat",options:"{dateStyle:'medium'}"},maxFieldLength:150,maxNestedFields:2,maxNestedFieldLength:30},Ia=new Intl.RelativeTimeFormat(ut.locale,{}),Zn=31536e6,Rl={year:Zn,month:Zn/12,day:864e5,hour:36e5,minute:6e4,second:1e3},bt={currency:Vs,bytes:Ss,link:Ms,linkTel:As,linkMailTo:Ts,icon:Fs,iconRounded:Is,attachment:Ds,hidden:js,time:Os,relativeTime:wn,relativeTimeFromMs:Ml,enumFlags:Bs,formatDate:Ht,formatNumber:bn};"iconOnError"in globalThis||(globalThis.iconOnError=Ll);class Ke{}function Da(e){ut=Object.assign({},ut,e)}function ja(t){Object.keys(t||{}).forEach(e=>{"function"==typeof t[e]&&(bt[e]=t[e])})}function Ls(){return bt}function tl(e,t){return t?rt("span",e,t):e}function Vs(e,t){var l=dt(t,["currency"]);return tl(new Intl.NumberFormat(void 0,{style:"currency",currency:(null==t?void 0:t.currency)||"USD"}).format(e),l)}function Ss(e,t){return tl(cn(e),t)}function Ms(e,t){return rt("a",e,Cl({...t,href:e}))}function As(e,t){return rt("a",e,Cl({...t,href:"tel:"+e}))}function Ts(e,t){var{subject:l,body:a}=t=t||{},t=dt(t,["subject","body"]),s={};return l&&(s.subject=l),a&&(s.body=a),rt("a",e,Cl({...t,href:"mailto:"+Kt(e,s)}))}function Fs(e,t){return rt("img",void 0,Object.assign({class:"w-6 h-6",title:e,src:Dt(e),onerror:"iconOnError(this)"},t))}function Is(e,t){return rt("img",void 0,Object.assign({class:"w-8 h-8 rounded-full",title:e,src:Dt(e),onerror:"iconOnError(this)"},t))}function Ds(e,t){var l=rn(e),a=(null==Yt(l)||dn(e)?Dt:fn)(e),a=Dt(a),s=t&&(t["icon-class"]||t.iconClass),a=rt("img",void 0,Object.assign({class:"w-6 h-6",src:a,onerror:"iconOnError(this,'att')"},s?{class:s}:null));return rt("a",a+`${l}`,Object.assign({class:"flex",href:Dt(e),title:e},t?dt(t,["icon-class","iconClass"]):null))}function js(e){return""}function Os(e,t){var l="string"==typeof e?new Date(1e3*Yn(e)):kl(e)?Vt(e):null;return tl(l?po(l):e,t)}function Ht(e,t){var l,a;return null==e?"":(l="number"==typeof e?new Date(e):"string"==typeof e?Vt(e):e,kl(l)?tl(("function"==typeof(a=ut.date?Al(ut.date):null)?a:Xn)(l),t):(console.warn(l+" is not a Date value"),null==e?"":""+e))}function bn(e,t){if("number"!=typeof e)return e;let l=ut.number?Al(ut.number):null,a="function"==typeof l?l(e):""+e;return""===a&&(console.warn(`formatNumber(${e}) => `+a,l),a=""+e),tl(a,t)}function Ps(t,l,a){var e=yo(t),s=l?Al(l):null;if("function"!=typeof s)return(null!=e?kl(e)?Ht(e,a):"number"==typeof e?bn(e,a):e:null)??"";{let e=a;if(null!=l&&l.options)try{e=sn(l.options,a)}catch(e){console.error(`Could not evaluate '${l.options}'`,e,", with scope:",a)}return s(t,e)}}function Jt(e,t,l){return(_t(e)?Ps:Ea)(e,t,l)}function Oa(e){if(null!=e){if("number"==typeof e)return e;if(kl(e))return e.getTime()-Wl();if("string"==typeof e){var t=Number(e);if(!isNaN(t))return t;if("P"===e[0]||e.startsWith("-P"))return 1e3*Yn(e)*-1;if(0<=bo(e,Fa))return Vt(e).getTime()-Wl()}}return NaN}function Ml(e,t){for(var l in Rl)if(Math.abs(e)>Rl[l]||"second"===l)return(t||Ia).format(Math.round(e/Rl[l]),l)}function wn(e,t){e=Oa(e);return isNaN(e)?"":Ml(e,t)}function Pa(e,t){return Ml(e.getTime()-(t?t.getTime():Wl()))}function Bs(e,t){return yn(e,t).join(", ")}function Al(l){if(l){let{method:e,options:a}=l,s=e+`(${a})`,n=bt[s]||bt[e];if("function"==typeof n)return n;let o=l.locale||ut.locale;if(e.startsWith("Intl.")){l=o?`'${o}'`:"undefined",l=`return new ${e}(${l},${a||"undefined"})`;try{let t=Function(l)();return n="Intl.DateTimeFormat"===e?e=>t.format(Vt(e)):"Intl.NumberFormat"===e?e=>t.format(Number(e)):"Intl.RelativeTimeFormat"===e?e=>wn(e,t):e=>t.format(e),bt[s]=n}catch(e){console.error("Invalid format: "+l,e)}}else{let l=globalThis[e];if("function"==typeof l){let t=null!=a?Function("return "+a)():void 0;return n=e=>l(e,t,o),bt[s]=n}console.error(`No '${e}' function exists`,Object.keys(bt))}}return null}function Rs(e,t){return e?e.length>t?e.substring(0,t)+"...":e:""}function Es(e){return"/Date("===e.substring(0,6)?Ht(Vt(e)):e}function Ba(e){return xn(Bt(e)).replace(/"/g,"")}function Hs(e){if(null==e||""===e)return"";if("string"==typeof e)try{return JSON.parse(e)}catch{console.warn("couldn't parse as JSON",e)}return e}function xn(e,t=4){return"object"!=typeof(e=Hs(e))?"string"==typeof e?e:""+e:JSON.stringify(e,void 0,t)}function Ra(e){return"object"!=typeof(e=Hs(e))?"string"==typeof e?e:""+e:xn(e=Bt(e=Object.assign({},e)))}function Bt(l){if(null==l)return null;if("string"==typeof l)return Es(l);if(_t(l))return l;if(l instanceof Date)return Ht(l);if(Array.isArray(l))return l.map(Bt);if("object"!=typeof l)return l;{let t={};return Object.keys(l).forEach(e=>{"__type"!=e&&(t[e]=Bt(l[e]))}),t}}function Ea(e,t,l){let a=e;if(Array.isArray(e)){if(_t(e[0]))return a.join(",");null!=e[0]&&(a=e[0])}if(null==a)return"";if(a instanceof Date)return Ht(a,l);var s=Object.keys(a),n=[];for(let e=0;e${o}: `+Hl(Rs(Es(r),ut.maxNestedFieldLength)))}return 2t.value.navigate(e.to??"/");return(e,t)=>(a(),u("a",Me({onClick:Ue(s,["prevent"]),title:l.to,href:"javascript:void(0)"},e.$attrs),[Z(e.$slots,"default")],16,Ha))}});class Na{constructor(){Ce(this,"callbacks",{})}register(e,t){this.callbacks[e]=t}has(e){return!!this.callbacks[e]}invoke(e,t){var l=this.callbacks[e];"function"==typeof l&&l(e,t)}}const Ye=class Ye{static component(e){var t=Ye.components[e];if(t)return t;const l=Nn(e),a=Object.keys(Ye.components).find(e=>Nn(e)===l);return a&&Ye.components[a]||null}};Ce(Ye,"config",{redirectSignIn:"/signin",redirectSignOut:"/auth/logout",navigate:e=>location.href=e,assetsPathResolver:e=>e,fallbackPathResolver:e=>e,storage:new ss,tableIcon:{svg:""},scopeWhitelist:{enumFlagsConverter:$s,...Ls()}}),Ce(Ye,"autoQueryGridDefaults",{deny:[],hide:[],toolbarButtonClass:void 0,tableStyle:"stripedRows",take:25,maxFieldLength:150}),Ce(Ye,"events",wo()),Ce(Ye,"user",A(null)),Ce(Ye,"metadata",A(null)),Ce(Ye,"components",{RouterLink:za}),Ce(Ye,"interceptors",new Na);let ne=Ye;function Ua(e){ne.config=Object.assign(ne.config,e)}function qa(e){ne.autoQueryGridDefaults=Object.assign(ne.autoQueryGridDefaults,e)}function kn(e){return e&&ne.config.assetsPathResolver?ne.config.assetsPathResolver(e):e}function Qa(e){return e&&ne.config.fallbackPathResolver?ne.config.fallbackPathResolver(e):e}function Ka(e,t){ne.interceptors.register(e,t)}function St(){var e=f(()=>ne.config),t=f(()=>ne.autoQueryGridDefaults);return{config:e,setConfig:Ua,events:ne.events,autoQueryGridDefaults:t,setAutoQueryGridDefaults:qa,assetsPathResolver:kn,fallbackPathResolver:Qa,registerInterceptor:Ka}}const zs=ce({inheritAttrs:!1,props:{image:Object,svg:String,src:String,alt:String,type:String},setup(s,{attrs:n}){return()=>{let e=s.image;var t,l;s.type&&(l=at()["typeOf"],(l=l(s.type))||console.warn(`Type ${s.type} does not exist`),null!=l&&l.icon?e=null==l?void 0:l.icon:console.warn(`Type ${s.type} does not have a [Svg] icon`));let a=s.svg||(null==e?void 0:e.svg)||"";return a.startsWith("").indexOf("class="),t=`${(null==e?void 0:e.cls)||""} `+(n.class||""),a=-1==l?`Ll(e.target)})}}}),Za={class:"text-2xl font-semibold text-gray-900 dark:text-gray-300"},Ga={class:"flex"},Wa=s("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"},null,-1),Ja=s("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"},null,-1),Xa=[Wa,Ja],Ya=ce({__name:"Loading",props:{imageClass:{default:"w-6 h-6"}},setup(l){return(e,t)=>(a(),u("div",Za,[s("div",Ga,[(a(),u("svg",{class:w(["self-center inline mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-gray-600 dark:fill-gray-300",l.imageClass]),role:"status",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Xa,2)),s("span",null,[Z(e.$slots,"default")])])]))}}),ei=["href","onClick"],ti=["type"],li=ce({__name:"OutlineButton",props:{type:{default:"submit"},href:null},setup(n){const o="inline-flex items-center px-4 py-2 border border-gray-300 dark:border-gray-600 shadow-sm text-sm font-medium rounded-md text-gray-700 dark:text-gray-200 disabled:text-gray-400 bg-white dark:bg-black hover:bg-gray-50 hover:dark:bg-gray-900 disabled:hover:bg-white dark:disabled:hover:bg-black focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black";return(t,e)=>{var l=X("router-link");return n.href?(a(),se(l,{key:0,to:n.href},{default:ke(({navigate:e})=>[s("button",{class:w(o),href:n.href,onClick:e},[Z(t.$slots,"default")],8,ei)]),_:3},8,["to"])):(a(),u("button",Me({key:1,type:n.type,class:o},t.$attrs),[Z(t.$slots,"default")],16,ti))}}}),ni=["href","onClick"],si=["type"],oi=ce({__name:"PrimaryButton",props:{type:{default:"submit"},href:null,color:{default:"indigo"}},setup(n){const e=n,t={blue:"text-white bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 disabled:hover:bg-blue-400 focus:ring-indigo-500 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800",purple:"text-white bg-purple-600 hover:bg-purple-700 disabled:bg-purple-400 disabled:hover:bg-purple-400 focus:ring-indigo-500 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800",red:"focus:ring-red-500 text-white bg-red-600 hover:bg-red-700 disabled:bg-red-400 disabled:hover:bg-red-400 focus:ring-red-500 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-500",green:"focus:ring-green-300 text-white bg-green-600 hover:bg-green-700 disabled:bg-green-400 disabled:hover:bg-green-400 focus:ring-green-500 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-500",sky:"focus:ring-sky-300 text-white bg-sky-600 hover:bg-sky-700 disabled:bg-sky-400 disabled:hover:bg-sky-400 focus:ring-sky-500 dark:bg-sky-600 dark:hover:bg-sky-700 dark:focus:ring-sky-500",cyan:"focus:ring-cyan-300 text-white bg-cyan-600 hover:bg-cyan-700 disabled:bg-cyan-400 disabled:hover:bg-cyan-400 focus:ring-cyan-500 dark:bg-cyan-600 dark:hover:bg-cyan-700 dark:focus:ring-cyan-500",indigo:"focus:ring-2 focus:ring-offset-2 text-white bg-indigo-600 hover:bg-indigo-700 disabled:bg-indigo-400 disabled:hover:bg-indigo-400 focus:ring-indigo-500 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},r=f(()=>"inline-flex justify-center rounded-md border border-transparent py-2 px-4 text-sm font-medium shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 dark:ring-offset-black "+(t[e.color]||t.indigo));return(t,e)=>{var l=X("router-link");return n.href?(a(),se(l,{key:0,to:n.href},{default:ke(({navigate:e})=>[s("button",{class:w(o(r)),href:n.href,onClick:e},[Z(t.$slots,"default")],10,ni)]),_:3},8,["to"])):(a(),u("button",Me({key:1,type:n.type,class:o(r)},t.$attrs),[Z(t.$slots,"default")],16,si))}}}),ai=["type","href","onClick"],ii=["type"],ri=ce({__name:"SecondaryButton",props:{type:null,href:null},setup(n){const o="inline-flex justify-center rounded-md border border-gray-300 py-2 px-4 text-sm font-medium shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 bg-white dark:bg-gray-800 border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-400 dark:hover:text-white hover:bg-gray-50 dark:hover:bg-gray-700 focus:ring-indigo-500 dark:focus:ring-indigo-600 dark:ring-offset-black";return(t,e)=>{var l=X("router-link");return n.href?(a(),se(l,{key:0,to:n.href},{default:ke(({navigate:e})=>[s("button",{type:n.type??"button",class:w(o),href:n.href,onClick:e},[Z(t.$slots,"default")],8,ai)]),_:3},8,["to"])):(a(),u("button",Me({key:1,type:n.type??"button",class:o},t.$attrs),[Z(t.$slots,"default")],16,ii))}}});function We(e,t){return Array.isArray(e)?0<=e.indexOf(t):e==t||e.includes(t)}const bl={blue:"text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-200",purple:"text-purple-600 dark:text-purple-400 hover:text-purple-800 dark:hover:text-purple-200",red:"text-red-700 dark:text-red-400 hover:text-red-900 dark:hover:text-red-200",green:"text-green-600 dark:text-green-400 hover:text-green-800 dark:hover:text-green-200",sky:"text-sky-600 dark:text-sky-400 hover:text-sky-800 dark:hover:text-sky-200",cyan:"text-cyan-600 dark:text-cyan-400 hover:text-cyan-800 dark:hover:text-cyan-200",indigo:"text-indigo-600 dark:text-indigo-400 hover:text-indigo-800 dark:hover:text-indigo-200"},nt={base:"block w-full sm:text-sm rounded-md dark:text-white dark:bg-gray-900 disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none",invalid:"pr-10 border-red-300 text-red-900 placeholder-red-300 focus:outline-none focus:ring-red-500 focus:border-red-500",valid:"shadow-sm focus:ring-indigo-500 focus:border-indigo-500 border-gray-300 dark:border-gray-600"},qt={panelClass:"shadow sm:rounded-md",formClass:"space-y-6 bg-white dark:bg-black py-6 px-4 sm:p-6",headingClass:"text-lg font-medium leading-6 text-gray-900 dark:text-gray-100",subHeadingClass:"mt-1 text-sm text-gray-500 dark:text-gray-400"},It={panelClass:"pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",formClass:"flex h-full flex-col divide-y divide-gray-200 dark:divide-gray-700 shadow-xl bg-white dark:bg-black",titlebarClass:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6",headingClass:"text-lg font-medium text-gray-900 dark:text-gray-100",subHeadingClass:"mt-1 text-sm text-gray-500 dark:text-gray-400",closeButtonClass:"rounded-md bg-gray-50 dark:bg-gray-900 text-gray-400 dark:text-gray-500 hover:text-gray-500 dark:hover:text-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 dark:ring-offset-black"},Jl={modalClass:"relative transform overflow-hidden rounded-lg bg-white dark:bg-black text-left shadow-xl transition-all sm:my-8",sizeClass:"sm:max-w-prose lg:max-w-screen-md xl:max-w-screen-lg 2xl:max-w-screen-xl sm:w-full"},Ze={panelClass(e="slideOver"){return("card"==e?qt:It).panelClass},formClass(e="slideOver"){return("card"==e?qt:It).formClass},headingClass(e="slideOver"){return("card"==e?qt:It).headingClass},subHeadingClass(e="slideOver"){return("card"==e?qt:It).subHeadingClass},buttonsClass:"mt-4 px-4 py-3 bg-gray-50 dark:bg-gray-900 sm:px-6 flex flex-wrap justify-between",legendClass:"text-base font-medium text-gray-900 dark:text-gray-100 text-center mb-4"},ge={getGridClass(e=0){return ge.gridClass},getGrid2Class(e="stripedRows"){return We(e,"fullWidth")?"overflow-x-auto":ge.grid2Class},getGrid3Class(e="stripedRows"){return We(e,"fullWidth")?"inline-block min-w-full py-2 align-middle":ge.grid3Class},getGrid4Class(e="stripedRows"){return We(e,"whiteBackground")?"":We(e,"fullWidth")?"overflow-hidden shadow-sm ring-1 ring-black ring-opacity-5":ge.grid4Class},getTableClass(e="stripedRows"){return We(e,"fullWidth")||We(e,"verticalLines")?"min-w-full divide-y divide-gray-300":ge.tableClass},getTheadClass(e="stripedRows"){return We(e,"whiteBackground")?"":ge.theadClass},getTheadRowClass(e="stripedRows"){return ge.theadRowClass+(We(e,"verticalLines")?" divide-x divide-gray-200 dark:divide-gray-700":"")},getTheadCellClass(e="stripedRows"){return ge.theadCellClass+(We(e,"uppercaseHeadings")?" uppercase":"")},getTbodyClass(e="stripedRows"){return(We(e,"whiteBackground")||We(e,"verticalLines")?"divide-y divide-gray-200 dark:divide-gray-800":ge.tableClass)+(We(e,"verticalLines")?" bg-white":"")},getTableRowClass(e="stripedRows",t,l,a){return(a?"cursor-pointer ":"")+(l?"bg-indigo-100 dark:bg-blue-800":(a?"hover:bg-yellow-50 dark:hover:bg-blue-900 ":"")+(!We(e,"stripedRows")||t%2==0?"bg-white dark:bg-black":"bg-gray-50 dark:bg-gray-800"))+(We(e,"verticalLines")?" divide-x divide-gray-200 dark:divide-gray-700":"")},gridClass:"flex flex-col",grid2Class:"",grid3Class:"inline-block min-w-full py-2 align-middle",grid4Class:"overflow-hidden shadow ring-1 ring-black ring-opacity-5 md:rounded-lg",tableClass:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",theadClass:"bg-gray-50 dark:bg-gray-900",tableCellClass:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400",theadRowClass:"select-none",theadCellClass:"px-6 py-4 text-left text-sm font-medium tracking-wider whitespace-nowrap",toolbarButtonClass:"inline-flex items-center px-2.5 py-1.5 border border-gray-300 dark:border-gray-700 shadow-sm text-sm font-medium rounded text-gray-700 dark:text-gray-300 bg-white dark:bg-black hover:bg-gray-50 dark:hover:bg-gray-900 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black"},ui={colspans:"col-span-3 sm:col-span-3"},Lh=Object.freeze(Object.defineProperty({__proto__:null,a:bl,card:qt,dummy:ui,form:Ze,grid:ge,input:nt,modal:Jl,slideOver:It},Symbol.toStringTag,{value:"Module"})),di=ce({__name:"TextLink",props:{color:{default:"blue"}},setup(e){const t=e,l=so(),s=f(()=>(bl[t.color]||bl.blue)+(l.href?"":" cursor-pointer"));return(e,t)=>(a(),u("a",{class:w(o(s))},[Z(e.$slots,"default")],2))}}),ci={class:"flex","aria-label":"Breadcrumb"},fi={role:"list",class:"flex items-center space-x-4"},mi=["href","title"],vi=s("svg",{class:"h-6 w-6 flex-shrink-0",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[s("path",{"fill-rule":"evenodd",d:"M9.293 2.293a1 1 0 011.414 0l7 7A1 1 0 0117 11h-1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-3a1 1 0 00-1-1H9a1 1 0 00-1 1v3a1 1 0 01-1 1H5a1 1 0 01-1-1v-6H3a1 1 0 01-.707-1.707l7-7z","clip-rule":"evenodd"})],-1),hi={class:"sr-only"},gi=ce({__name:"Breadcrumbs",props:{homeHref:{default:"/"},homeLabel:{default:"Home"}},setup(l){return(e,t)=>(a(),u("nav",ci,[s("ol",fi,[s("li",null,[s("div",null,[s("a",{href:l.homeHref,class:"text-gray-400 dark:text-gray-500 hover:text-gray-500 dark:hover:text-gray-400",title:l.homeLabel},[vi,s("span",hi,T(l.homeLabel),1)],8,mi)])]),Z(e.$slots,"default")])]))}}),pi={class:"flex items-center"},yi=s("svg",{class:"h-6 w-6 flex-shrink-0 text-gray-400 dark:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[s("path",{"fill-rule":"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z","clip-rule":"evenodd"})],-1),bi=["href","title"],wi=["title"],xi=ce({__name:"Breadcrumb",props:{href:null,title:null},setup(l){return(e,t)=>(a(),u("li",null,[s("div",pi,[yi,l.href?(a(),u("a",{key:0,href:l.href,class:"ml-4 text-lg font-medium text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300",title:l.title},[Z(e.$slots,"default")],8,bi)):(a(),u("span",{key:1,class:"ml-4 text-lg font-medium text-gray-700 dark:text-gray-300",title:l.title},[Z(e.$slots,"default")],8,wi))])]))}}),ki={key:0,class:"text-base font-semibold text-gray-500 dark:text-gray-400"},$i={role:"list",class:"mt-4 divide-y divide-gray-200 dark:divide-gray-800 border-t border-b border-gray-200 dark:border-gray-800"},Ci=ce({__name:"NavList",props:{title:null},setup(l){return(e,t)=>(a(),u("div",null,[l.title?(a(),u("h2",ki,T(l.title),1)):k("",!0),s("ul",$i,[Z(e.$slots,"default")])]))}}),_i={class:"relative flex items-start space-x-4 py-6"},Li={class:"flex-shrink-0"},Vi={class:"flex h-12 w-12 items-center justify-center rounded-lg bg-indigo-50 dark:bg-indigo-900"},Si={class:"min-w-0 flex-1"},Mi={class:"text-base font-medium text-gray-900 dark:text-gray-100"},Ai={class:"rounded-sm focus-within:ring-2 focus-within:ring-indigo-500 focus-within:ring-offset-2"},Ti=["href"],Fi=s("span",{class:"absolute inset-0","aria-hidden":"true"},null,-1),Ii={class:"text-base text-gray-500"},Di=s("div",{class:"flex-shrink-0 self-center"},[s("svg",{class:"h-5 w-5 text-gray-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[s("path",{"fill-rule":"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z","clip-rule":"evenodd"})])],-1),ji=ce({__name:"NavListItem",props:{title:null,href:null,icon:null,iconSvg:null,iconSrc:null,iconAlt:null},setup(n){return(e,t)=>{var l=X("Icon");return a(),u("li",_i,[s("div",Li,[s("span",Vi,[$e(l,{class:"w-6 h-6 text-indigo-700 dark:text-indigo-300",image:n.icon,src:n.iconSrc,svg:n.iconSvg,alt:n.iconAlt},null,8,["image","src","svg","alt"])])]),s("div",Si,[s("h3",Mi,[s("span",Ai,[s("a",{href:n.href,class:"focus:outline-none"},[Fi,we(" "+T(n.title),1)],8,Ti)])]),s("p",Ii,[Z(e.$slots,"default")])]),Di])}}});function Ns(e){return e&&e.SessionId?xo(e):e}function Oi(e){ne.user.value=Ns(e),ne.events.publish("signIn",e)}function Pi(){ne.user.value=null,ne.events.publish("signOut",null)}const $n=e=>e.roles||[],Cn=e=>e.permissions||[];function Us(e){return 0<=$n(ne.user.value).indexOf(e)}function Bi(e){return 0<=Cn(ne.user.value).indexOf(e)}function _n(){return Us("Admin")}function vl(e){if(!e)return!1;if(!e.requiresAuth)return!0;var t=ne.user.value;if(!t)return!1;if(_n())return!0;let[l,a]=[$n(t),Cn(t)],[s,n,o,r]=[e.requiredRoles||[],e.requiredPermissions||[],e.requiresAnyRole||[],e.requiresAnyPermission||[]];return!(!s.every(e=>0<=l.indexOf(e))||00<=l.indexOf(e))||!n.every(e=>0<=a.indexOf(e))||00<=a.indexOf(e)))}function Ri(e){if(!e||!e.requiresAuth)return null;var t=ne.user.value;if(!t)return`${e.request.name} requires Authentication`;if(_n())return null;let[l,a]=[$n(t),Cn(t)],[s,n,o,r]=[e.requiredRoles||[],e.requiredPermissions||[],e.requiresAnyRole||[],e.requiresAnyPermission||[]],i=s.filter(e=>l.indexOf(e)<0);return 0""+e+"").join(", ")} Role`+(1a.indexOf(e)<0)).length?`Requires ${t.map(e=>""+e+"").join(", ")} Permission`+(10<=l.indexOf(e))?`Requires any ${o.filter(e=>l.indexOf(e)<0).map(e=>""+e+"").join(", ")} Role`+(10<=a.indexOf(e))?`Requires any ${r.filter(e=>a.indexOf(e)<0).map(e=>""+e+"").join(", ")} Permission`+(1ne.user.value||null),toAuth:Ns,isAuthenticated:f(()=>null!=ne.user.value),hasRole:Us,hasPermission:Bi,isAdmin:_n,canAccess:vl,invalidAccessMessage:Ri}}const Ei={key:0},Hi={class:"md:p-4"},qs=ce({__name:"EnsureAccess",props:{invalidAccess:null,alertClass:null},emits:["done"],setup(r){const i=Ln()["isAuthenticated"],t=St()["config"],d=()=>{var e=location.href.substring(location.origin.length)||"/",e=Kt(t.value.redirectSignIn,{redirect:e});t.value.navigate(e)},c=()=>{var e=location.href.substring(location.origin.length)||"/",e=Kt(t.value.redirectSignOut,{ReturnUrl:e});t.value.navigate(e)};return(e,t)=>{var l=X("Alert"),n=X("SecondaryButton");return r.invalidAccess?(a(),u("div",Ei,[$e(l,{class:w(r.alertClass),innerHTML:r.invalidAccess},null,8,["class","innerHTML"]),s("div",Hi,[o(i)?(a(),se(n,{key:1,onClick:c},{default:ke(()=>[we("Sign Out")]),_:1})):(a(),se(n,{key:0,onClick:d},{default:ke(()=>[we("Sign In")]),_:1}))])])):k("",!0)}}}),zi={class:"absolute top-0 right-0 bg-white dark:bg-black border dark:border-gray-800 rounded normal-case text-sm shadow w-80"},Ni={class:"p-4"},Ui=s("h3",{class:"text-base font-medium mb-3 dark:text-gray-100"},"Sort",-1),qi={class:"flex w-full justify-center"},Qi=s("svg",{class:"w-6 h-6",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},[s("g",{fill:"currentColor"},[s("path",{"fill-rule":"evenodd",d:"M10.082 5.629L9.664 7H8.598l1.789-5.332h1.234L13.402 7h-1.12l-.419-1.371h-1.781zm1.57-.785L11 2.687h-.047l-.652 2.157h1.351z"}),s("path",{d:"M12.96 14H9.028v-.691l2.579-3.72v-.054H9.098v-.867h3.785v.691l-2.567 3.72v.054h2.645V14zm-8.46-.5a.5.5 0 0 1-1 0V3.707L2.354 4.854a.5.5 0 1 1-.708-.708l2-1.999l.007-.007a.498.498 0 0 1 .7.006l2 2a.5.5 0 1 1-.707.708L4.5 3.707V13.5z"})])],-1),Ki=s("span",null,"ASC",-1),Zi=[Qi,Ki],Gi=wl('DESC',2),Wi=[Gi],Ji=s("h3",{class:"text-base font-medium mt-4 mb-2"}," Filter ",-1),Xi={key:0},Yi=["id","value"],er=["for"],tr={key:1},lr={class:"mb-2"},nr={class:"inline-flex rounded-full items-center py-0.5 pl-2.5 pr-1 text-sm font-medium bg-indigo-100 text-indigo-700"},sr=["onClick"],or=s("svg",{class:"h-2 w-2",stroke:"currentColor",fill:"none",viewBox:"0 0 8 8"},[s("path",{"stroke-linecap":"round","stroke-width":"1.5",d:"M1 1l6 6m0-6L1 7"})],-1),ar=[or],ir={class:"flex"},rr=s("svg",{class:"h-6 w-6",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[s("path",{"fill-rule":"evenodd",d:"M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z","clip-rule":"evenodd"})],-1),ur=[rr],dr={class:"bg-gray-50 dark:bg-gray-900 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"},Vn=ce({__name:"FilterColumn",props:{definitions:null,column:null,topLeft:null},emits:["done","save"],setup(d,{emit:l}){const c=d,v=A(),p=A(""),m=A(""),g=A([]),y=f(()=>1==c.column.meta.isEnum),n=f(()=>ot("Nullable`1"===c.column.meta.type?c.column.meta.genericArgs[0]:c.column.meta.type)),h=f(()=>1==c.column.meta.isEnum?pn(ws(n.value.name)):[]),b=f(()=>{var e;return(null==(e=r(c.column.type))?void 0:e.map(e=>({key:e.value,value:e.name})))||[]}),x=A({filters:[]}),C=f(()=>x.value.filters);function r(e){let t=c.definitions;return t=gs(e)?t:t.filter(e=>"string"!==e.types)}function L(e,t){return r(e).find(e=>e.value===t)}function V(){var e;p.value&&(e=null==(e=L(c.column.type,p.value))?void 0:e.name)&&(x.value.filters.push({key:p.value,name:e,value:m.value}),p.value=m.value="")}function M(){l("done")}function S(){var e;p.value="%",null!=(e=v.value)&&e.focus()}function I(){var e,t;m.value&&V(),y.value&&(t=Object.values(g.value).filter(e=>e),x.value.filters=0parseInt(e)).reduce((e,t)=>e+t,0).toString()}]:[{key:"%In",name:"In",value:t.join(",")}]:[]),l("save",x.value),l("done")}function $(e){x.value.sort=e===x.value.sort?void 0:e,xt(I)}return hl(()=>x.value=Object.assign({},c.column.settings,{filters:Array.from(c.column.settings.filters)})),hl(()=>{var e;let t=(null==(e=null==(e=null==(e=c.column.settings.filters)?void 0:e[0])?void 0:e.value)?void 0:e.split(","))||[];if(00<(l&parseInt(e))))||[]}g.value=t}),(e,t)=>{var l=X("SelectInput"),n=X("TextInput"),r=X("PrimaryButton"),i=X("SecondaryButton");return a(),u("div",{class:"fixed z-20 inset-0 overflow-y-auto",onClick:M,onVnodeMounted:S},[s("div",{class:"absolute",style:Xl(`top:${d.topLeft.y}px;left:${d.topLeft.x}px`),onClick:t[5]||(t[5]=Ue(()=>{},["stop"]))},[s("div",zi,[s("div",Ni,[Ui,s("div",qi,[s("button",{type:"button",title:"Sort Ascending",onClick:t[0]||(t[0]=e=>$("ASC")),class:w(`${"ASC"===x.value.sort?"bg-indigo-100 border-indigo-500":"bg-white hover:bg-gray-50 border-gray-300"} mr-1 inline-flex items-center px-2.5 py-1.5 border shadow-sm text-sm font-medium rounded text-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500`)},Zi,2),s("button",{type:"button",title:"Sort Descending",onClick:t[1]||(t[1]=e=>$("DESC")),class:w(`${"DESC"===x.value.sort?"bg-indigo-100 border-indigo-500":"bg-white hover:bg-gray-50 border-gray-300"} ml-1 inline-flex items-center px-2.5 py-1.5 border shadow-sm text-sm font-medium rounded text-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500`)},Wi,2)]),Ji,o(y)?(a(),u("div",Xi,[(a(!0),u(Te,null,Ie(o(h),e=>(a(),u("div",{key:e.key,class:"flex items-center"},[kt(s("input",{type:"checkbox",id:e.key,value:e.key,"onUpdate:modelValue":t[2]||(t[2]=e=>g.value=e),class:"h-4 w-4 border-gray-300 rounded text-indigo-600 focus:ring-indigo-500"},null,8,Yi),[[Yl,g.value]]),s("label",{for:e.key,class:"ml-3"},T(e.value),9,er)]))),128))])):(a(),u("div",tr,[(a(!0),u(Te,null,Ie(o(C),(e,l)=>{return a(),u("div",lr,[s("span",nr,[we(T(d.column.name)+" "+T(e.name)+" "+T((e=e,_s(L(c.column.type,e.key),c.column.type,e)))+" ",1),s("button",{type:"button",onClick:e=>{var t;t=l,x.value.filters.splice(t,1)},class:"flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justify-center text-indigo-400 hover:bg-indigo-200 hover:text-indigo-500 focus:outline-none focus:bg-indigo-500 focus:text-white"},ar,8,sr)])])}),256)),s("div",ir,[$e(l,{id:"filterRule",class:"w-32 mr-1",modelValue:p.value,"onUpdate:modelValue":t[3]||(t[3]=e=>p.value=e),entries:o(b),label:"",placeholder:""},null,8,["modelValue","entries"]),"none"!==(null==(l=L(d.column.type,p.value))?void 0:l.valueType)?(a(),se(n,{key:0,ref_key:"txtFilter",ref:v,id:"filterValue",class:"w-32 mr-1",type:"text",modelValue:m.value,"onUpdate:modelValue":t[4]||(t[4]=e=>m.value=e),onKeyup:Wn(V,["enter"]),label:"",placeholder:""},null,8,["modelValue","onKeyup"])):k("",!0),s("div",{class:"pt-1"},[s("button",{type:"button",onClick:V,class:"inline-flex items-center p-1 border border-transparent rounded-full shadow-sm text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"},ur)])])]))]),s("div",dr,[$e(r,{onClick:I,color:"red",class:"ml-2"},{default:ke(()=>[we(" Save ")]),_:1}),$e(i,{onClick:M},{default:ke(()=>[we(" Cancel ")]),_:1})])])],4)],512)}}}),cr={class:"px-4 sm:px-6 lg:px-8 text-sm"},fr={class:"flex flex-wrap"},mr={class:"group pr-4 sm:pr-6 lg:pr-8"},vr={class:"flex justify-between w-full font-medium"},hr={class:"w-6 flex justify-end"},gr={class:"hidden group-hover:inline"},pr=["onClick","title"],yr=s("svg",{class:"h-2 w-2",stroke:"currentColor",fill:"none",viewBox:"0 0 8 8"},[s("path",{"stroke-linecap":"round","stroke-width":"1.5",d:"M1 1l6 6m0-6L1 7"})],-1),br=[yr],wr={key:0,class:"pt-2"},xr={class:"ml-2"},kr={key:1},$r={class:"pt-2"},Cr={class:"inline-flex rounded-full items-center py-0.5 pl-2.5 pr-1 text-sm font-medium bg-indigo-100 text-indigo-700"},_r=["onClick"],Lr=s("svg",{class:"h-2 w-2",stroke:"currentColor",fill:"none",viewBox:"0 0 8 8"},[s("path",{"stroke-linecap":"round","stroke-width":"1.5",d:"M1 1l6 6m0-6L1 7"})],-1),Vr=[Lr],Sr=s("span",null,"Clear All",-1),Mr=[Sr],Sn=ce({__name:"FilterViews",props:{definitions:null,columns:null},emits:["done","change"],setup(e,{emit:r}){const l=e,n=f(()=>l.columns.filter(e=>0"string"!==e.types)}(e).find(e=>e.value===t)}function d(){l.columns.forEach(e=>{e.settings.filters=[],r("change",e)}),r("done")}return(e,t)=>(a(),u("div",cr,[s("div",fr,[(a(!0),u(Te,null,Ie(o(n),n=>{return a(),u("fieldset",mr,[s("legend",vr,[s("span",null,T(o(He)(n.name)),1),s("span",hr,[s("span",gr,[s("button",{onClick:e=>{var t;(t=n).settings.filters=[],r("change",t)},title:`Clear all ${o(He)(n.name)} filters`,class:"flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justify-center text-red-600 hover:bg-red-200 hover:text-red-500 focus:outline-none focus:bg-red-500 focus:text-white"},br,8,pr)])])]),n.meta.isEnum?(a(),u("div",wr,[(a(!0),u(Te,null,Ie(null==(e=null==(e=null==(e=n.settings.filters)?void 0:e[0])?void 0:e.value)?void 0:e.split(","),e=>(a(),u("div",{key:e,class:"flex items-center"},[s("label",xr,T(e),1)]))),128))])):(a(),u("div",kr,[(a(!0),u(Te,null,Ie(n.settings.filters,(e,l)=>{return a(),u("div",$r,[s("span",Cr,[we(T(n.name)+" "+T(e.name)+" "+T((e=e,_s(i((t=n).type,e.value),t.type,e)))+" ",1),s("button",{type:"button",onClick:e=>{var t;(t=n).settings.filters.splice(l,1),r("change",t)},class:"flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justify-center text-indigo-400 hover:bg-indigo-200 hover:text-indigo-500 focus:outline-none focus:bg-indigo-500 focus:text-white"},Vr,8,_r)])]);var t}),256))]))]);var e}),256))]),s("div",{class:"flex justify-center pt-4"},[s("button",{type:"button",onClick:d,class:"inline-flex items-center px-2.5 py-1.5 border border-gray-300 shadow-sm text-sm font-medium rounded text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"},Mr)])]))}}),Ar={class:"bg-white dark:bg-black px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Tr={class:""},Fr={class:"mt-3 text-center sm:mt-0 sm:mx-4 sm:text-left"},Ir=s("h3",{class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-100"},"Query Preferences",-1),Dr={class:"mt-4"},jr=["for"],Or=["id"],Pr=["value","selected"],Br={class:"mt-4 flex items-center py-4 border-b border-gray-200 dark:border-gray-800"},Rr=["id","checked"],Er=["for"],Hr={class:"mt-4"},zr={class:"pb-2 px-4"},Nr={class:""},Ur=["id","value"],qr=["for"],Qr={class:"bg-gray-50 dark:bg-gray-900 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"},Mn=ce({__name:"QueryPrefs",props:{id:{default:"QueryPrefs"},columns:null,prefs:null,maxLimit:null},emits:["done","save"],setup(r,{emit:e}){const i=r,t=St()["autoQueryGridDefaults"],d=A({}),c=(hl(()=>d.value=Object.assign({take:t.value.take,selectedColumns:[]},i.prefs)),[10,25,50,100,250,500,1e3]);function v(){e("done")}function f(){e("save",d.value)}return(e,t)=>{const l=X("PrimaryButton"),n=X("SecondaryButton"),o=X("ModalDialog");return a(),se(o,{id:r.id,onDone:v,"size-class":"w-full sm:max-w-prose"},{default:ke(()=>[s("div",Ar,[s("div",Tr,[s("div",Fr,[Ir,s("div",Dr,[s("label",{for:r.id+"-take",class:"block text-sm font-medium text-gray-700 dark:text-gray-300"},"Results per page",8,jr),kt(s("select",{id:r.id+"-take","onUpdate:modelValue":t[0]||(t[0]=e=>d.value.take=e),class:"mt-1 block w-full pl-3 pr-10 py-2 text-base bg-white dark:bg-black border-gray-300 dark:border-gray-700 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md"},[(a(!0),u(Te,null,Ie(c.filter(e=>null==i.maxLimit||e<=i.maxLimit),e=>(a(),u("option",{value:e,selected:e===d.value.take},T(e),9,Pr))),256))],8,Or),[[oo,d.value.take]])]),s("div",Br,[s("input",{type:"radio",id:r.id+"-allColumns",onClick:t[1]||(t[1]=e=>d.value.selectedColumns=[]),checked:0===d.value.selectedColumns.length,class:"focus:ring-indigo-500 h-4 w-4 bg-white dark:bg-black text-indigo-600 dark:text-indigo-400 border-gray-300 dark:border-gray-700"},null,8,Rr),s("label",{class:"ml-3 block text-gray-700 dark:text-gray-300",for:r.id+"-allColumns"},"View all columns",8,Er)]),s("div",Hr,[s("div",zr,[s("div",Nr,[(a(!0),u(Te,null,Ie(r.columns,e=>(a(),u("div",{key:e.name,class:"flex items-center"},[kt(s("input",{type:"checkbox",id:e.name,value:e.name,"onUpdate:modelValue":t[2]||(t[2]=e=>d.value.selectedColumns=e),class:"h-4 w-4 bg-white dark:bg-black border-gray-300 dark:border-gray-700 rounded text-indigo-600 dark:text-indigo-400 focus:ring-indigo-500"},null,8,Ur),[[Yl,d.value.selectedColumns]]),s("label",{for:e.name,class:"ml-3"},T(e.name),9,qr)]))),128))])])])])])]),s("div",Qr,[$e(l,{onClick:f,color:"red",class:"ml-2"},{default:ke(()=>[we(" Save ")]),_:1}),$e(n,{onClick:v},{default:ke(()=>[we(" Cancel ")]),_:1})])]),_:1},8,["id"])}}}),Kr={key:0},Zr={key:1},Gr={key:2,class:"pt-1"},Wr={key:0},Jr={key:1},Xr={key:3},Yr={class:"pl-1 pt-1 flex flex-wrap"},eu={class:"flex mt-1"},tu=["title"],lu=s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("g",{"stroke-width":"1.5",fill:"none"},[s("path",{d:"M9 3H3.6a.6.6 0 0 0-.6.6v16.8a.6.6 0 0 0 .6.6H9M9 3v18M9 3h6M9 21h6m0-18h5.4a.6.6 0 0 1 .6.6v16.8a.6.6 0 0 1-.6.6H15m0-18v18",stroke:"currentColor"})])],-1),nu=[lu],su=["disabled"],ou=s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6l6 6zM6 6h2v12H6z",fill:"currentColor"})],-1),au=[ou],iu=["disabled"],ru=s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{d:"M15.41 7.41L14 6l-6 6l6 6l1.41-1.41L10.83 12z",fill:"currentColor"})],-1),uu=[ru],du=["disabled"],cu=s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{d:"M10 6L8.59 7.41L13.17 12l-4.58 4.59L10 18l6-6z",fill:"currentColor"})],-1),fu=[cu],mu=["disabled"],vu=s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6l-6-6zM16 6h2v12h-2z",fill:"currentColor"})],-1),hu=[vu],gu={key:0,class:"flex mt-1"},pu={class:"px-4 text-lg text-black dark:text-white"},yu={key:0},bu={key:1},wu=s("span",{class:"hidden xl:inline"}," Showing Results ",-1),xu={key:2},ku={class:"flex flex-wrap"},$u={key:0,class:"pl-2 mt-1"},Cu=s("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 20v-5h-5M4 4v5h5m10.938 2A8.001 8.001 0 0 0 5.07 8m-1.008 5a8.001 8.001 0 0 0 14.868 3"})],-1),_u=[Cu],Lu={key:1,class:"pl-2 mt-1"},Vu=wl('Excel',2),Su=[Vu],Mu={key:2,class:"pl-2 mt-1"},Au={key:0,class:"w-5 h-5 mr-1 text-green-600 dark:text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Tu=s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1),Fu=[Tu],Iu={key:1,class:"w-5 h-5 mr-1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Du=s("g",{fill:"none"},[s("path",{d:"M8 4v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7.242a2 2 0 0 0-.602-1.43L16.083 2.57A2 2 0 0 0 14.685 2H10a2 2 0 0 0-2 2z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),s("path",{d:"M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1),ju=[Du],Ou=s("span",{class:"whitespace-nowrap"},"Copy URL",-1),Pu={key:3,class:"pl-2 mt-1"},Bu=s("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 24 24"},[s("path",{fill:"currentColor",d:"M6.78 2.72a.75.75 0 0 1 0 1.06L4.56 6h8.69a7.75 7.75 0 1 1-7.75 7.75a.75.75 0 0 1 1.5 0a6.25 6.25 0 1 0 6.25-6.25H4.56l2.22 2.22a.75.75 0 1 1-1.06 1.06l-3.5-3.5a.75.75 0 0 1 0-1.06l3.5-3.5a.75.75 0 0 1 1.06 0Z"})],-1),Ru=[Bu],Eu={key:4,class:"pl-2 mt-1"},Hu=s("svg",{class:"flex-none w-5 h-5 mr-2 text-gray-400 dark:text-gray-500 group-hover:text-gray-500","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[s("path",{"fill-rule":"evenodd",d:"M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z","clip-rule":"evenodd"})],-1),zu={class:"mr-1"},Nu={key:0,class:"h-5 w-5 text-gray-400 dark:text-gray-500 group-hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Uu=s("path",{"fill-rule":"evenodd",d:"M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z","clip-rule":"evenodd"},null,-1),qu=[Uu],Qu={key:1,class:"h-5 w-5 text-gray-400 dark:text-gray-500 group-hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Ku=s("path",{"fill-rule":"evenodd",d:"M5 10a1 1 0 011-1h8a1 1 0 110 2H6a1 1 0 01-1-1z","clip-rule":"evenodd"},null,-1),Zu=[Ku],Gu={key:5,class:"pl-2 mt-1"},Wu=["title"],Ju=s("svg",{class:"w-5 h-5 mr-1 text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-50",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z",fill:"currentColor"})],-1),Xu={class:"whitespace-nowrap"},Yu={key:7},ed={key:0,class:"cursor-pointer flex justify-between items-center hover:text-gray-900 dark:hover:text-gray-50"},td={class:"mr-1 select-none"},ld={key:1,class:"flex justify-between items-center"},nd={class:"mr-1 select-none"},sd=ce({__name:"AutoQueryGrid",props:{filterDefinitions:null,id:{default:"AutoQueryGrid"},apis:null,type:null,prefs:null,deny:null,hide:null,selectedColumns:null,toolbarButtonClass:null,tableStyle:null,gridClass:null,grid2Class:null,grid3Class:null,grid4Class:null,tableClass:null,theadClass:null,tbodyClass:null,theadRowClass:null,theadCellClass:null,headerTitle:null,headerTitles:null,visibleFrom:null,rowClass:null,rowStyle:null,apiPrefs:null,canFilter:null,disableKeyBindings:null,configureField:null,skip:{default:0},create:{type:Boolean},edit:null,filters:null},emits:["headerSelected","rowSelected"],setup(p,{expose:e,emit:v}){const r=p,{config:t,autoQueryGridDefaults:W}=St(),G=W,J=Ne("client"),l=t.value.storage,Y="filtering,queryString,queryFilters".split(","),ee="copyApiUrl,downloadCsv,filtersView,newItem,pagingInfo,pagingNav,preferences,refresh,resetPreferences,toolbar".split(","),te=f(()=>r.deny?wt(Y,r.deny):wt(Y,G.value.deny)),le=f(()=>r.hide?wt(ee,r.hide):wt(ee,G.value.hide));function m(e){return te.value[e]}function g(e){return le.value[e]}const y=f(()=>r.tableStyle??G.value.tableStyle),ae=f(()=>r.gridClass??ge.getGridClass(y.value)),oe=f(()=>r.grid2Class??ge.getGrid2Class(y.value)),re=f(()=>r.grid3Class??ge.getGrid3Class(y.value)),ie=f(()=>r.grid4Class??ge.getGrid4Class(y.value)),ue=f(()=>r.tableClass??ge.getTableClass(y.value)),de=f(()=>r.theadClass??ge.getTheadClass(y.value)),ce=f(()=>r.theadRowClass??ge.getTheadRowClass(y.value)),ve=f(()=>r.theadCellClass??ge.getTheadCellClass(y.value)),h=f(()=>r.toolbarButtonClass??ge.toolbarButtonClass);function fe(e,t){var l,a;return r.rowClass?r.rowClass(e,t):(l=!!q.value.AnyUpdate,a=(null!=(a=i.value)&&a.name?ye(e,i.value.name):null)==S.value,ge.getTableRowClass(r.tableStyle,t,a,l))}const b=en(),pe=f(()=>{var e;return st((null==(e=q.value.AnyQuery.viewModel)?void 0:e.name)||q.value.AnyQuery.dataModel.name)}),me=f(()=>{const t=Object.keys(b).map(e=>e.toLowerCase());return et(pe.value).filter(e=>t.includes(e.name.toLowerCase())||t.includes(e.name.toLowerCase()+"-header")).map(e=>e.name)});const x=f(()=>{var e=(0<(e=pt(r.selectedColumns)).length?e:0e.toLowerCase());const l=et(pe.value);return 0l.find(e=>e.name.toLowerCase()===t)).filter(e=>null!=e):l}),he=f(()=>{let e=x.value.map(e=>e.name),t=pt(O.value.selectedColumns).map(e=>e.toLowerCase());return 0t.includes(e.toLowerCase())):e}),C=A([]),L=A(new Je),be=A(new Je),V=A(),M=A(!1),S=A(),I=A(),$=A(!1),F=A(),B=A(r.skip),j=A(!1),O=A({take:25}),H=A(!1),xe=f(()=>C.value.some(e=>0C.value.map(e=>e.settings.filters.length).reduce((e,t)=>e+t,0)),Le=f(()=>{var e;return et(st(d.value||(null==(e=q.value.AnyQuery)?void 0:e.dataModel.name)))}),i=f(()=>{var e;return el(st(d.value||(null==(e=q.value.AnyQuery)?void 0:e.dataModel.name)))}),D=f(()=>O.value.take??25),E=f(()=>L.value.response?ye(L.value.response,"results"):[]),z=f(()=>{var e;return(null==(e=L.value.response)?void 0:e.total)??E.value.length??0}),Te=f(()=>00E.value.length>=D.value),Me=f(()=>E.value.length>=D.value),_=A(),R=A(),Se={NoQuery:"No Query API was found"};function Fe(t){if(t){if(r.canFilter)return r.canFilter(t);var e=Le.value.find(e=>e.name.toLowerCase()==t.toLowerCase());if(e)return!ps(e)}}function n(e){m("queryString")&&nn(e)}async function N(e){B.value+=e,B.value<0&&(B.value=0);e=Math.floor(z.value/D.value)*D.value;B.value>e&&(B.value=e),n({skip:B.value||void 0}),await P()}async function je(e,t){var l,a;I.value=null,S.value=t,e&&t&&(a=Gt(q.value.AnyQuery,{[e]:t}),(a=await J.api(a)).succeeded)&&((a=null==(a=ye(a.response,"results"))?void 0:a[0])||console.warn(`API ${null==(l=q.value.AnyQuery)?void 0:l.request.name}(${e}:${t}) returned no results`),I.value=a)}async function Oe(e,t){v("rowSelected",e,t);t=null==(t=i.value)?void 0:t.name,e=t?ye(e,t):null;t&&e&&(n({edit:e}),je(t,e))}function He(t,e){var l,a,s;m("filtering")&&(l=e.target,Fe(t)&&"TD"!==(null==l?void 0:l.tagName)&&(l=null==(l=null==l?void 0:l.closest("TABLE"))?void 0:l.getBoundingClientRect(),a=C.value.find(e=>e.name.toLowerCase()==t.toLowerCase()))&&l&&(s=l.x+318+10,F.value={column:a,topLeft:{x:Math.max(Math.floor(e.clientX+159),s),y:l.y+45}}),v("headerSelected",t,e))}function De(){F.value=null}async function Ee(e){var t=null==(t=F.value)?void 0:t.column;t&&(t.settings=e,l.setItem(c(t.name),JSON.stringify(t.settings)),await P()),F.value=null}async function ze(e){l.setItem(c(e.name),JSON.stringify(e.settings)),await P()}async function _e(e){$.value=!1,O.value=e,l.setItem(Ye(),JSON.stringify(e)),await P()}function Re(e){Object.assign(I.value,e),Pe()}function Pe(){null!=(e=_.value)&&e.forceUpdate(),null!=(e=R.value)&&e.forceUpdate();var e=Be();null!=(e=null==e?void 0:e.proxy)&&e.$forceUpdate()}async function P(){await Ue(qe())}async function Ze(){await P()}async function Ue(a){var s=q.value.AnyQuery;if(s){let e=Gt(s,a),t=es(e=>{L.value.response=L.value.error=void 0,H.value=e}),l=await J.api(e);t(),xt(()=>L.value=l);s=ye(l.response,"results")||[];l.succeeded&&s.label}else console.error(Se.NoQuery)}function qe(){let a={include:"total",take:D.value},t=pt(O.value.selectedColumns||r.selectedColumns);if(0{var e,l=s.find(e=>e.name.toLowerCase()==t.toLowerCase());null!=(e=null==l?void 0:l.ref)&&e.selfId&&n.push(l.ref.selfId),ye(b,t)&&n.push(...s.filter(e=>{return(null==(e=null==(e=e.ref)?void 0:e.selfId)?void 0:e.toLowerCase())==t.toLowerCase()}).map(e=>e.name))}),n.forEach(e=>{t.includes(e)||t.push(e)}),a.fields=t.join(",")}let e=[];if(C.value.forEach(l=>{l.settings.sort&&e.push(("DESC"===l.settings.sort?"-":"")+l.name),l.settings.filters.forEach(e=>{var t=e.key.replace("%",l.name);a[t]=e.value})}),r.filters&&Object.keys(r.filters).forEach(e=>{a[e]=r.filters[e]}),m("queryString")&&m("queryFilters")){var l=location.search||(location.hash.includes("?")?"?"+dl(location.hash,"?"):"");let e=zl(l);Object.keys(e).forEach(t=>{x.value.find(e=>e.name.toLowerCase()===t.toLowerCase())&&(a[t]=e[t])}),typeof e.skip<"u"&&(l=parseInt(e.skip),isNaN(l)||(B.value=a.skip=l))}return"u"j.value=!1,3e3)}function Ke(e="json"){var t=qe(),l="/api/"+(null==(l=q.value.AnyQuery)?void 0:l.request.name),l=ko(J.baseUrl,Kt(l,{...t,jsconfig:"edv"}));return 0<=l.indexOf("?")?xl(l,"?")+"."+e+"?"+dl(l,"?"):l+".json"}async function We(){C.value.forEach(e=>{e.settings={filters:[]},l.removeItem(c(e.name))}),O.value={take:25},l.removeItem(Ye()),await P()}function Ge(){M.value=!0,n({create:null})}e({update:P,search:Ue,createRequestArgs:qe,reset:bt,createDone:K,createSave:ht,editDone:Q,editSave:yt,forceUpdate:Pe,setEdit:Re,edit:I}),ne.interceptors.has("AutoQueryGrid.new")&&ne.interceptors.invoke("AutoQueryGrid.new",{props:r});const d=f(()=>Et(r.type)),U=f(()=>{var e;return d.value||(null==(e=q.value.AnyQuery)?void 0:e.dataModel.name)}),Ye=()=>{var e;return r.id+"/ApiPrefs/"+(d.value||(null==(e=q.value.AnyQuery)?void 0:e.dataModel.name))},c=e=>{var t;return`Column/${r.id}:${d.value||(null==(t=q.value.AnyQuery)?void 0:t.dataModel.name)}.`+e},{metadataApi:lt,typeOf:st,apiOf:nt,filterDefinitions:ot}=at(),rt=Ln()["invalidAccessMessage"],it=f(()=>r.filterDefinitions||ot.value),q=f(()=>{var e=pt(r.apis);return 0nt(e)).filter(e=>null!=e).map(e=>e)):Pt.forType(d.value,lt.value)}),ut=e=>`${e}`,dt=f(()=>{var e;return lt.value?0<(e=pt(r.apis).map(e=>null==nt(e)?e:null).filter(e=>null!=e)).length?ut(`Unknown API${1useMetadata()`)}),ct=f(()=>q.value.AnyQuery&&rt(q.value.AnyQuery)),vt=f(()=>q.value.Create&&rt(q.value.Create)),ft=f(()=>q.value.AnyUpdate&&rt(q.value.AnyUpdate)),mt=f(()=>vl(q.value.Create)),gt=(f(()=>vl(q.value.AnyUpdate)),f(()=>vl(q.value.Delete)));function Q(){I.value=null,S.value=null,n({edit:void 0})}function K(){M.value=!1,n({create:void 0})}async function yt(){await P(),Q()}async function ht(){await P(),K()}function bt(){L.value=new Je,be.value=new Je,M.value=!1,S.value=null,I.value=null,$.value=!1,F.value=null,B.value=r.skip,j.value=!1,O.value={take:25},H.value=!1;var e,t=r.prefs||yl(l.getItem(Ye())),t=(t&&(O.value=t),C.value=x.value.map(e=>({name:e.name,type:e.type,meta:e,settings:Object.assign({filters:[]},yl(l.getItem(c(e.name))))})),isNaN(r.skip)||(B.value=r.skip),null==(t=i.value)?void 0:t.name);m("queryString")&&(e=location.search||(location.hash.includes("?")?"?"+dl(location.hash,"?"):""),typeof(e=zl(e)).create<"u"?M.value=typeof e.create<"u":!t||"string"!=typeof e.edit&&"number"!=typeof e.edit||je(t,e.edit)),!0===r.create&&(M.value=!0),t&&null!=r.edit&&je(t,r.edit)}return tt(async()=>{bt(),await P()}),(l,e)=>{const t=X("Alert"),n=X("EnsureAccessDialog"),r=X("AutoCreateForm"),i=X("AutoEditForm"),d=X("ErrorSummary"),c=X("Loading"),v=X("SettingsIcons"),f=X("DataGrid");return o(dt)?(a(),u("div",Kr,[$e(t,{innerHTML:o(dt)},null,8,["innerHTML"])])):o(ct)?(a(),u("div",Zr,[$e(qs,{"invalid-access":o(ct)},null,8,["invalid-access"])])):(a(),u("div",Gr,[M.value&&o(q).Create?(a(),u("div",Wr,[o(vt)?(a(),se(n,{key:0,title:"Create "+o(U),"invalid-access":o(vt),"alert-class":"text-yellow-700",onDone:K},null,8,["title","invalid-access"])):o(b).createform?Z(l.$slots,"createform",{key:1,type:o(q).Create.request.name,configure:p.configureField,done:K,save:ht}):(a(),se(r,{key:2,ref_key:"createForm",ref:_,type:o(q).Create.request.name,configure:p.configureField,onDone:K,onSave:ht},{header:ke(()=>[Z(l.$slots,"formheader",{form:"create",formInstance:_.value,apis:o(q),type:o(U)})]),footer:ke(()=>[Z(l.$slots,"formfooter",{form:"create",formInstance:_.value,apis:o(q),type:o(U)})]),_:3},8,["type","configure"]))])):I.value&&o(q).AnyUpdate?(a(),u("div",Jr,[o(ft)?(a(),se(n,{key:0,title:"Update "+o(U),"invalid-access":o(ft),"alert-class":"text-yellow-700",onDone:Q},null,8,["title","invalid-access"])):o(b).editform?Z(l.$slots,"editform",{key:1,model:I.value,type:o(q).AnyUpdate.request.name,deleteType:o(gt)?o(q).Delete.request.name:null,configure:p.configureField,done:Q,save:yt}):(a(),se(i,{key:2,ref_key:"editForm",ref:R,modelValue:I.value,"onUpdate:modelValue":e[0]||(e[0]=e=>I.value=e),type:o(q).AnyUpdate.request.name,deleteType:o(gt)?o(q).Delete.request.name:null,configure:p.configureField,onDone:Q,onSave:yt,onDelete:yt},{header:ke(()=>[Z(l.$slots,"formheader",{form:"edit",formInstance:R.value,apis:o(q),type:o(U),model:I.value,id:S.value,updateModel:Re})]),footer:ke(()=>[Z(l.$slots,"formfooter",{form:"edit",formInstance:R.value,apis:o(q),type:o(U),model:I.value,id:S.value,updateModel:Re})]),_:3},8,["modelValue","type","deleteType","configure"]))])):k("",!0),o(b).toolbar?Z(l.$slots,"toolbar",{key:2}):g("toolbar")?(a(),u("div",Xr,[$.value?(a(),se(Mn,{key:0,columns:o(x),prefs:O.value,onDone:e[1]||(e[1]=e=>$.value=!1),onSave:_e},null,8,["columns","prefs"])):k("",!0),s("div",Yr,[s("div",eu,[g("preferences")?(a(),u("button",{key:0,type:"button",class:"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400",title:o(U)+" Preferences",onClick:e[2]||(e[2]=e=>$.value=!$.value)},nu,8,tu)):k("",!0),g("pagingNav")?(a(),u("button",{key:1,type:"button",class:w(["pl-2",o(Te)?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"First page",disabled:!o(Te),onClick:e[3]||(e[3]=e=>N(-o(z)))},au,10,su)):k("",!0),g("pagingNav")?(a(),u("button",{key:2,type:"button",class:w(["pl-2",o(Ae)?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Previous page",disabled:!o(Ae),onClick:e[4]||(e[4]=e=>N(-o(D)))},uu,10,iu)):k("",!0),g("pagingNav")?(a(),u("button",{key:3,type:"button",class:w(["pl-2",o(Ve)?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Next page",disabled:!o(Ve),onClick:e[5]||(e[5]=e=>N(o(D)))},fu,10,du)):k("",!0),g("pagingNav")?(a(),u("button",{key:4,type:"button",class:w(["pl-2",o(Me)?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Last page",disabled:!o(Me),onClick:e[6]||(e[6]=e=>N(o(z)))},hu,10,mu)):k("",!0)]),g("pagingInfo")?(a(),u("div",gu,[s("div",pu,[H.value?(a(),u("span",yu,"Querying...")):k("",!0),o(E).length?(a(),u("span",bu,[wu,we(" "+T(B.value+1)+" - "+T(Math.min(B.value+o(E).length,o(z)))+" ",1),s("span",null," of "+T(o(z)),1)])):L.value.completed?(a(),u("span",xu,"No Results")):k("",!0)])])):k("",!0),s("div",ku,[g("refresh")?(a(),u("div",$u,[s("button",{type:"button",onClick:Ze,title:"Refresh",class:w(o(h))},_u,2)])):k("",!0),g("downloadCsv")?(a(),u("div",Lu,[s("button",{type:"button",onClick:Xe,title:"Download CSV",class:w(o(h))},Su,2)])):k("",!0),g("copyApiUrl")?(a(),u("div",Mu,[s("button",{type:"button",onClick:Qe,title:"Copy API URL",class:w(o(h))},[j.value?(a(),u("svg",Au,Fu)):(a(),u("svg",Iu,ju)),Ou],2)])):k("",!0),o(xe)&&g("resetPreferences")?(a(),u("div",Pu,[s("button",{type:"button",onClick:We,title:"Reset Preferences & Filters",class:w(o(h))},Ru,2)])):k("",!0),g("filtersView")&&0V.value="filters"==V.value?null:"filters"),class:w(o(h)),"aria-expanded":"false"},[Hu,s("span",zu,T(o(Ce))+" "+T(1==o(Ce)?"Filter":"Filters"),1),"filters"!=V.value?(a(),u("svg",Nu,qu)):(a(),u("svg",Qu,Zu))],2)])):k("",!0),g("newItem")&&o(q).Create&&o(mt)?(a(),u("div",Gu,[s("button",{type:"button",onClick:Ge,title:o(U),class:w(o(h))},[Ju,s("span",Xu,"New "+T(o(U)),1)],10,Wu)])):k("",!0),o(b).toolbarbuttons?Z(l.$slots,"toolbarbuttons",{key:6,toolbarButtonClass:o(h)}):k("",!0)])])])):k("",!0),"filters"==V.value?(a(),se(Sn,{key:4,class:"border-y border-gray-200 dark:border-gray-800 py-8 my-2",definitions:o(it),columns:C.value,onDone:e[8]||(e[8]=e=>V.value=null),onChange:ze},null,8,["definitions","columns"])):k("",!0),be.value.error??L.value.error?(a(),se(d,{key:5,status:be.value.error??L.value.error},null,8,["status"])):H.value?(a(),se(c,{key:6,class:"p-2"})):k("",!0),F.value?(a(),u("div",Yu,[$e(Vn,{definitions:o(it),column:F.value.column,"top-left":F.value.topLeft,onDone:De,onSave:Ee},null,8,["definitions","column","top-left"])])):k("",!0),o(E).length?(a(),se(f,{key:8,id:p.id,items:o(E),type:p.type,"selected-columns":o(he),class:"mt-1",onFiltersChanged:P,tableStyle:o(y),gridClass:o(ae),grid2Class:o(oe),grid3Class:o(re),grid4Class:o(ie),tableClass:o(ue),theadClass:o(de),theadRowClass:o(ce),theadCellClass:o(ve),tbodyClass:p.tbodyClass,rowClass:fe,onRowSelected:Oe,rowStyle:p.rowStyle,headerTitle:p.headerTitle,headerTitles:p.headerTitles,visibleFrom:p.visibleFrom,onHeaderSelected:He},tn({header:ke(({column:t,label:e})=>{var l;return[m("filtering")&&Fe(t)?(a(),u("div",ed,[s("span",td,T(e),1),$e(v,{column:C.value.find(e=>e.name.toLowerCase()===t.toLowerCase()),"is-open":(null==(l=F.value)?void 0:l.column.name)===t},null,8,["column","is-open"])])):(a(),u("div",ld,[s("span",nd,T(e),1)]))]}),_:2},[Ie(Object.keys(o(b)),t=>({name:t,fn:ke(e=>[Z(l.$slots,t,jt(gl(e)))])}))]),1032,["id","items","type","selected-columns","tableStyle","gridClass","grid2Class","grid3Class","grid4Class","tableClass","theadClass","theadRowClass","theadCellClass","tbodyClass","rowStyle","headerTitle","headerTitles","visibleFrom"])):k("",!0)]))}}}),od={class:"flex"},ad={key:0,class:"w-4 h-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},id=s("g",{fill:"none"},[s("path",{d:"M3 4a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v2.586a1 1 0 0 1-.293.707l-6.414 6.414a1 1 0 0 0-.293.707V17l-4 4v-6.586a1 1 0 0 0-.293-.707L3.293 7.293A1 1 0 0 1 3 6.586V4z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1),rd=[id],ud=s("path",{d:"M505.5 658.7c3.2 4.4 9.7 4.4 12.9 0l178-246c3.8-5.3 0-12.7-6.5-12.7H643c-10.2 0-19.9 4.9-25.9 13.2L512 558.6L406.8 413.2c-6-8.3-15.6-13.2-25.9-13.2H334c-6.5 0-10.3 7.4-6.5 12.7l178 246z",fill:"currentColor"},null,-1),dd=s("path",{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z",fill:"currentColor"},null,-1),cd=[ud,dd],fd={key:2,class:"w-4 h-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},md=s("g",{fill:"none"},[s("path",{d:"M8.998 4.71L6.354 7.354a.5.5 0 1 1-.708-.707L9.115 3.18A.499.499 0 0 1 9.498 3H9.5a.5.5 0 0 1 .354.147l.01.01l3.49 3.49a.5.5 0 1 1-.707.707l-2.65-2.649V16.5a.5.5 0 0 1-1 0V4.71z",fill:"currentColor"})],-1),vd=[md],hd={key:3,class:"w-4 h-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},gd=s("g",{fill:"none"},[s("path",{d:"M10.002 15.29l2.645-2.644a.5.5 0 0 1 .707.707L9.886 16.82a.5.5 0 0 1-.384.179h-.001a.5.5 0 0 1-.354-.147l-.01-.01l-3.49-3.49a.5.5 0 1 1 .707-.707l2.648 2.649V3.5a.5.5 0 0 1 1 0v11.79z",fill:"currentColor"})],-1),pd=[gd],yd=ce({__name:"SettingsIcons",props:{column:null,isOpen:{type:Boolean}},setup(s){return(e,t)=>{var l;return a(),u("div",od,[null!=(l=null==(l=null==(l=s.column)?void 0:l.settings)?void 0:l.filters)&&l.length?(a(),u("svg",ad,rd)):(a(),u("svg",{key:1,class:w(["w-4 h-4 transition-transform",s.isOpen?"rotate-180":""]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},cd,2)),"ASC"===(null==(l=null==(l=s.column)?void 0:l.settings)?void 0:l.sort)?(a(),u("svg",fd,vd)):"DESC"===(null==(l=null==(l=s.column)?void 0:l.settings)?void 0:l.sort)?(a(),u("svg",hd,pd)):k("",!0)])}}}),bd=ce({__name:"EnsureAccessDialog",props:{title:null,subtitle:null,invalidAccess:null,alertClass:null},emits:["done"],setup(n){return(t,e)=>{const l=X("EnsureAccess"),s=X("SlideOver");return n.invalidAccess?(a(),se(s,{key:0,title:n.title,onDone:e[0]||(e[0]=e=>t.$emit("done")),"content-class":"relative flex-1"},tn({default:ke(()=>[$e(l,{alertClass:n.alertClass,invalidAccess:n.invalidAccess},null,8,["alertClass","invalidAccess"])]),_:2},[n.subtitle?{name:"subtitle",fn:ke(()=>[we(T(n.subtitle),1)]),key:"0"}:void 0]),1032,["title"])):k("",!0)}}}),wd=["for"],xd={class:"mt-1 relative rounded-md shadow-sm"},kd=["type","name","id","placeholder","value","aria-invalid","aria-describedby"],$d={key:0,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},Cd=s("svg",{class:"h-5 w-5 text-red-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[s("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1),_d=[Cd],Ld=["id"],Vd=["id"],Sd={inheritAttrs:!1},Md=ce({...Sd,__name:"TextInput",props:{status:null,id:null,type:null,inputClass:null,label:null,labelClass:null,help:null,placeholder:null,modelValue:null},setup(l,{expose:e}){const t=l,n=(e({focus:function(){var e;null!=(e=n.value)&&e.focus()}}),A());const r=f(()=>t.type||"text"),i=f(()=>t.label??He(st(t.id))),d=f(()=>t.placeholder??i.value);let c=Ne("ApiState",void 0);const v=f(()=>mt.call({responseStatus:t.status??(null==c?void 0:c.error.value)},t.id)),p=f(()=>[nt.base,v.value?nt.invalid:nt.valid,t.inputClass]);return(t,e)=>(a(),u("div",{class:w([t.$attrs.class])},[Z(t.$slots,"header",Me({inputElement:n.value,id:l.id,modelValue:l.modelValue,status:l.status},t.$attrs)),o(i)?(a(),u("label",{key:0,for:l.id,class:w("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(l.labelClass??""))},T(o(i)),11,wd)):k("",!0),s("div",xd,[s("input",Me({ref_key:"inputElement",ref:n,type:o(r),name:l.id,id:l.id,class:o(p),placeholder:o(d),value:l.modelValue,onInput:e[0]||(e[0]=e=>t.$emit("update:modelValue",e.target.value)),"aria-invalid":null!=o(v),"aria-describedby":l.id+"-error",step:"any"},o(dt)(t.$attrs,["class"])),null,16,kd),o(v)?(a(),u("div",$d,_d)):k("",!0)]),o(v)?(a(),u("p",{key:1,class:"mt-2 text-sm text-red-500",id:l.id+"-error"},T(o(v)),9,Ld)):l.help?(a(),u("p",{key:2,class:"mt-2 text-sm text-gray-500",id:l.id+"-description"},T(l.help),9,Vd)):k("",!0),Z(t.$slots,"footer",Me({inputElement:n.value,id:l.id,modelValue:l.modelValue,status:l.status},t.$attrs))],2))}}),Ad=["for"],Td={class:"mt-1 relative rounded-md shadow-sm"},Fd=["name","id","placeholder","aria-invalid","aria-describedby"],Id=["id"],Dd=["id"],jd={inheritAttrs:!1},Od=ce({...jd,__name:"TextareaInput",props:{status:null,id:null,inputClass:null,label:null,labelClass:null,help:null,placeholder:null,modelValue:null},setup(l){const e=l,n=f(()=>e.label??He(st(e.id))),r=f(()=>e.placeholder??n.value);let t=Ne("ApiState",void 0);const i=f(()=>mt.call({responseStatus:e.status??(null==t?void 0:t.error.value)},e.id)),d=f(()=>["shadow-sm "+nt.base,i.value?"text-red-900 focus:ring-red-500 focus:border-red-500 border-red-300":"text-gray-900 "+nt.valid,e.inputClass]);return(t,e)=>(a(),u("div",{class:w([t.$attrs.class])},[o(n)?(a(),u("label",{key:0,for:l.id,class:w("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(l.labelClass??""))},T(o(n)),11,Ad)):k("",!0),s("div",Td,[s("textarea",Me({name:l.id,id:l.id,class:o(d),placeholder:o(r),onInput:e[0]||(e[0]=e=>t.$emit("update:modelValue",e.target.value)),"aria-invalid":null!=o(i),"aria-describedby":l.id+"-error"},o(dt)(t.$attrs,["class"])),T(l.modelValue),17,Fd)]),o(i)?(a(),u("p",{key:1,class:"mt-2 text-sm text-red-500",id:l.id+"-error"},T(o(i)),9,Id)):l.help?(a(),u("p",{key:2,class:"mt-2 text-sm text-gray-500",id:l.id+"-description"},T(l.help),9,Dd)):k("",!0)],2))}}),Pd=["for"],Bd=["id","name","value","aria-invalid","aria-describedby"],Rd=["value"],Ed=["id"],Hd={inheritAttrs:!1},zd=ce({...Hd,__name:"SelectInput",props:{status:null,id:null,modelValue:null,inputClass:null,label:null,labelClass:null,options:null,values:null,entries:null},setup(l){const t=l,n=f(()=>t.label??He(st(t.id)));let e=Ne("ApiState",void 0);const r=f(()=>mt.call({responseStatus:t.status??(null==e?void 0:e.error.value)},t.id)),i=f(()=>t.entries||(t.values?t.values.map(e=>({key:e,value:e})):t.options?Object.keys(t.options).map(e=>({key:e,value:t.options[e]})):[]));return(t,e)=>(a(),u("div",{class:w([t.$attrs.class])},[o(n)?(a(),u("label",{key:0,for:l.id,class:w("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(l.labelClass??""))},T(o(n)),11,Pd)):k("",!0),s("select",Me({id:l.id,name:l.id,class:["mt-1 block w-full pl-3 pr-10 py-2 text-base focus:outline-none sm:text-sm rounded-md dark:text-white dark:bg-gray-900 dark:border-gray-600",o(r)?"border-red-300 text-red-900 focus:ring-red-500 focus:border-red-500":"border-gray-300 text-gray-900 focus:ring-indigo-500 focus:border-indigo-500",l.inputClass],value:l.modelValue,onInput:e[0]||(e[0]=e=>t.$emit("update:modelValue",e.target.value)),"aria-invalid":null!=o(r),"aria-describedby":l.id+"-error"},o(dt)(t.$attrs,["class"])),[(a(!0),u(Te,null,Ie(o(i),e=>(a(),u("option",{value:e.key},T(e.value),9,Rd))),256))],16,Bd),o(r)?(a(),u("p",{key:1,class:"mt-2 text-sm text-red-500",id:l.id+"-error"},T(o(r)),9,Ed)):k("",!0)],2))}}),Nd={class:"flex items-center h-5"},Ud=["id","name","checked"],qd={class:"ml-3 text-sm"},Qd=["for"],Kd={key:0,class:"mt-2 text-sm text-red-500",id:"`${id}-error`"},Zd={key:1,class:"mt-2 text-sm text-gray-500",id:"`${id}-description`"},Gd={inheritAttrs:!1},Wd=ce({...Gd,__name:"CheckboxInput",props:{modelValue:{type:Boolean},status:null,id:null,inputClass:null,label:null,labelClass:null,help:null},emits:["update:modelValue"],setup(l,{}){const e=l,n=f(()=>e.label??He(st(e.id)));let t=Ne("ApiState",void 0);const r=f(()=>mt.call({responseStatus:e.status??(null==t?void 0:t.error.value)},e.id));return(t,e)=>(a(),u("div",{class:w(["relative flex items-start",t.$attrs.class])},[s("div",Nd,[s("input",Me({id:l.id,name:l.id,type:"checkbox",checked:l.modelValue,onInput:e[0]||(e[0]=e=>t.$emit("update:modelValue",e.target.checked)),class:["focus:ring-indigo-500 h-4 w-4 text-indigo-600 rounded border-gray-300 dark:border-gray-600 dark:bg-gray-800",l.inputClass]},o(dt)(t.$attrs,["class"])),null,16,Ud)]),s("div",qd,[s("label",{for:l.id,class:w("font-medium text-gray-700 dark:text-gray-300 "+(l.labelClass??""))},T(o(n)),11,Qd),o(r)?(a(),u("p",Kd,T(o(r)),1)):l.help?(a(),u("p",Zd,T(l.help),1)):k("",!0)])],2))}}),Jd=["id"],Xd=["for"],Yd={class:"mt-1 relative rounded-md shadow-sm"},ec=["id","name","value"],tc=["onClick"],lc={class:"flex flex-wrap pb-1.5"},nc={class:"pt-1.5 pl-1"},sc={class:"inline-flex rounded-full items-center py-0.5 pl-2.5 pr-1 text-sm font-medium bg-indigo-100 dark:bg-indigo-800 text-indigo-700 dark:text-indigo-300"},oc=["onClick"],ac=s("svg",{class:"h-2 w-2",stroke:"currentColor",fill:"none",viewBox:"0 0 8 8"},[s("path",{"stroke-linecap":"round","stroke-width":"1.5",d:"M1 1l6 6m0-6L1 7"})],-1),ic=[ac],rc={class:"pt-1.5 pl-1 shrink"},uc=["type","name","id","aria-invalid","aria-describedby","onPaste"],dc=["id"],cc=["onMouseover","onClick"],fc={class:"block truncate"},mc={key:1,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},vc=s("svg",{class:"h-5 w-5 text-red-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[s("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1),hc=[vc],gc=["id"],pc=["id"],yc={inheritAttrs:!1},bc=ce({...yc,__name:"TagInput",props:{status:null,id:null,type:null,inputClass:null,label:null,labelClass:null,help:null,modelValue:{default:()=>[]},delimiters:{default:()=>[","]},allowableValues:null,string:{type:Boolean},converter:null},emits:["update:modelValue"],setup(l,{emit:t}){const n=l;const r=f(()=>{return qe((e=n.modelValue,n.converter?n.converter(e):e),e=>"string"==typeof e?0==e.trim().length?[]:e.split(","):e)||[];var e}),i=A(),d=A(!1),c=f(()=>n.allowableValues&&0!=n.allowableValues.length?n.allowableValues.filter(e=>!r.value.includes(e)&&e.toLowerCase().includes(p.value.toLowerCase())):[]);const v=A(null),p=A(""),m=f(()=>n.type||"text"),g=f(()=>n.label??He(st(n.id)));let e=Ne("ApiState",void 0);const y=f(()=>mt.call({responseStatus:n.status??(null==e?void 0:e.error.value)},n.id)),h=f(()=>["w-full cursor-text flex flex-wrap sm:text-sm rounded-md dark:text-white dark:bg-gray-900 border focus-within:border-transparent focus-within:ring-1 focus-within:outline-none",y.value?"pr-10 border-red-300 text-red-900 placeholder-red-300 focus-within:outline-none focus-within:ring-red-500 focus-within:border-red-500":"shadow-sm border-gray-300 dark:border-gray-600 focus-within:ring-indigo-500 focus-within:border-indigo-500",n.inputClass]),b=t=>M(r.value.filter(e=>e!=t));function x(e){document.activeElement===e.target&&null!=(e=v.value)&&e.focus()}const C=A();function L(){d.value=!0,C.value=!0}function V(){O(I()),C.value=!1,setTimeout(()=>{C.value||(d.value=!1)},200)}function M(e){e=n.string?e.join(","):e;t("update:modelValue",e)}function S(e){var t;"Backspace"==e.key&&0==p.value.length&&0e==t.key))&&t.preventDefault(),"Enter"==t.key||"NumpadEnter"==t.key||1==t.key.length&&e)&&O(l)}const F={behavior:"smooth",block:"nearest",inline:"nearest",scrollMode:"if-needed"};function B(){setTimeout(()=>{var e=pl(`#${n.id}-tag li.active`);e&&e.scrollIntoView(F)},0)}function j(){setTimeout(()=>{var e=pl(`#${n.id}-tag li.active`);e&&("scrollIntoViewIfNeeded"in e?e.scrollIntoViewIfNeeded(F):e.scrollIntoView(F))},0)}function O(e){var t;0!==e.length&&(-1==(t=Array.from(r.value)).indexOf(e)&&t.push(e),M(t),p.value="",d.value=!1)}function H(e){e=null==(e=e.clipboardData)?void 0:e.getData("Text");if(e){const t=new RegExp("\\n|\\t|"+n.delimiters.join("|")),l=Array.from(r.value);e.split(t).map(e=>e.trim()).forEach(e=>{-1==l.indexOf(e)&&l.push(e)}),M(l),p.value=""}}return(e,t)=>(a(),u("div",{class:w([e.$attrs.class]),id:l.id+"-tag",onmousemove:"cancelBlur=true"},[o(g)?(a(),u("label",{key:0,for:l.id,class:w("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(l.labelClass??""))},T(o(g)),11,Xd)):k("",!0),s("div",Yd,[s("input",{type:"hidden",id:l.id,name:l.id,value:o(r).join(",")},null,8,ec),s("button",{class:w(o(h)),onClick:Ue(x,["prevent"]),onFocus:t[2]||(t[2]=e=>d.value=!0),tabindex:"-1"},[s("div",lc,[(a(!0),u(Te,null,Ie(o(r),t=>(a(),u("div",nc,[s("span",sc,[we(T(t)+" ",1),s("button",{type:"button",onClick:e=>b(t),class:"flex-shrink-0 ml-1 h-4 w-4 rounded-full inline-flex items-center justify-center text-indigo-400 dark:text-indigo-500 hover:bg-indigo-200 dark:hover:bg-indigo-800 hover:text-indigo-500 dark:hover:text-indigo-400 focus:outline-none focus:bg-indigo-500 focus:text-white dark:focus:text-black"},ic,8,oc)])]))),256)),s("div",rc,[kt(s("input",Me({ref_key:"txtInput",ref:v,type:o(m),role:"combobox","aria-controls":"options","aria-expanded":"false",autocomplete:"off",spellcheck:"false",name:l.id+"-txt",id:l.id+"-txt",class:"p-0 dark:bg-transparent rounded-md border-none focus:!border-none focus:!outline-none",style:`box-shadow:none !important;width:${p.value.length+1}ch`,"onUpdate:modelValue":t[0]||(t[0]=e=>p.value=e),"aria-invalid":null!=o(y),"aria-describedby":l.id+"-error",onKeydown:S,onKeypress:$,onPaste:Ue(H,["prevent","stop"]),onFocus:L,onBlur:V,onClick:t[1]||(t[1]=e=>d.value=!0)},o(dt)(e.$attrs,["class","required"])),null,16,uc),[[ao,p.value]])])])],42,tc),d.value&&o(c).length?(a(),u("ul",{key:0,class:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white dark:bg-black py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm",onKeydown:S,id:l.id+"-options",role:"listbox"},[(a(!0),u(Te,null,Ie(o(c),l=>(a(),u("li",{class:w([l===i.value?"active bg-indigo-600 text-white":"text-gray-900 dark:text-gray-100","relative cursor-default select-none py-2 pl-3 pr-9"]),onMouseover:e=>{var t;t=l,i.value=t},onClick:e=>O(l),role:"option",tabindex:"-1"},[s("span",fc,T(l),1)],42,cc))),256))],40,dc)):k("",!0),o(y)?(a(),u("div",mc,hc)):k("",!0)]),o(y)?(a(),u("p",{key:1,class:"mt-2 text-sm text-red-500",id:l.id+"-error"},T(o(y)),9,gc)):l.help?(a(),u("p",{key:2,class:"mt-2 text-sm text-gray-500",id:l.id+"-description"},T(l.help),9,pc)):k("",!0)],10,Jd))}}),wc={class:"relative flex-grow mr-2 sm:mr-4"},xc=["for"],kc={class:"block mt-2"},$c={class:"sr-only"},Cc=["multiple","name","id","placeholder","aria-invalid","aria-describedby"],_c={key:0,class:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"},Lc=s("svg",{class:"h-5 w-5 text-red-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[s("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1),Vc=[Lc],Sc=["id"],Mc=["id"],Ac={key:0},Tc=["title"],Fc=["alt","src"],Ic={key:1,class:"mt-3"},Dc={class:"w-full"},jc={class:"pr-6 align-bottom pb-2"},Oc=["title"],Pc=["src","onError"],Bc=["href"],Rc={key:1,class:"overflow-hidden"},Ec={class:"align-top pb-2 whitespace-nowrap"},Hc={key:0,class:"text-gray-500 dark:text-gray-400 text-sm bg-white dark:bg-black"},zc=ce({__name:"FileInput",props:{multiple:{type:Boolean},status:null,id:null,inputClass:null,label:null,labelClass:null,help:null,placeholder:null,modelValue:null,values:null,files:null},setup(l){var e;const t=l,n=A(null),{assetsPathResolver:r,fallbackPathResolver:i}=St(),d={},c=A(),v=A((null==(e=t.files)?void 0:e.map(p))||[]);function p(e){return e.filePath=r(e.filePath),e}t.values&&0{e=e.replace(/\\/g,"/");return{fileName:Co($t(e,"/"),"."),filePath:e,contentType:Kl(e)}}).map(p));const m=f(()=>t.label??He(st(t.id))),g=f(()=>t.placeholder??m.value);let y=Ne("ApiState",void 0);const h=f(()=>mt.call({responseStatus:t.status??(null==y?void 0:y.error.value)},t.id)),b=f(()=>["block w-full sm:text-sm rounded-md dark:text-white dark:bg-gray-900 file:mr-4 file:py-2 file:px-4 file:rounded-full file:border-0 file:text-sm file:font-semibold file:bg-violet-50 dark:file:bg-violet-900 file:text-violet-700 dark:file:text-violet-200 hover:file:bg-violet-100 dark:hover:file:bg-violet-800",h.value?"pr-10 border-red-300 text-red-900 placeholder-red-300 focus:outline-none focus:ring-red-500 focus:border-red-500":"text-slate-500 dark:text-slate-400",t.inputClass]),x=e=>{e=e.target;c.value="",v.value=Array.from(e.files||[]).map(e=>({fileName:e.name,filePath:un(e),contentLength:e.size,contentType:e.type||Kl(e.name)}))},C=()=>{var e;return null==(e=n.value)?void 0:e.click()},L=e=>null!=e&&(e.startsWith("data:")||e.startsWith("blob:")),V=f(()=>{var e;return 0!e||e.startsWith("data:")||e.endsWith(".svg")?"":"rounded-full object-cover";function S(e){c.value=i(V.value)}return Rt(fs),(e,t)=>(a(),u("div",{class:w(["flex",l.multiple?"flex-col":"justify-between"])},[s("div",wc,[o(m)?(a(),u("label",{key:0,for:l.id,class:w("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(l.labelClass??""))},T(o(m)),11,xc)):k("",!0),s("div",kc,[s("span",$c,T(l.help??o(m)),1),s("input",Me({ref_key:"input",ref:n,type:"file",multiple:l.multiple,name:l.id,id:l.id,class:o(b),placeholder:o(g),"aria-invalid":null!=o(h),"aria-describedby":l.id+"-error"},e.$attrs,{onChange:x}),null,16,Cc),o(h)?(a(),u("div",_c,Vc)):k("",!0)]),o(h)?(a(),u("p",{key:1,class:"mt-2 text-sm text-red-500",id:l.id+"-error"},T(o(h)),9,Sc)):l.help?(a(),u("p",{key:2,class:"mt-2 text-sm text-gray-500",id:l.id+"-description"},T(l.help),9,Mc)):k("",!0)]),l.multiple?(a(),u("div",Ic,[s("table",Dc,[(a(!0),u(Te,null,Ie(v.value,t=>(a(),u("tr",null,[s("td",jc,[s("div",{class:"flex w-full",title:L(t.filePath)?"":t.filePath},[s("img",{src:d[o(yt)(t.filePath)]||o(r)(o(yt)(t.filePath)),class:w(["mr-2 h-8 w-8",M(t.filePath)]),onError:e=>d[o(yt)(t.filePath)]=o(i)(o(yt)(t.filePath))},null,42,Pc),L(t.filePath)?(a(),u("span",Rc,T(t.fileName),1)):(a(),u("a",{key:0,href:o(r)(t.filePath||""),target:"_blank",class:"overflow-hidden"},T(t.fileName),9,Bc))],8,Oc)]),s("td",Ec,[t.contentLength&&0[]},modelValue:null,match:null,viewCount:{default:100},pageSize:{default:8}},emits:["update:modelValue"],setup(l,{expose:e,emit:n}){const r=l,i=A(!1);function d(e){return Array.isArray(r.modelValue)&&0<=r.modelValue.indexOf(e)}e({toggle:B});const c=f(()=>r.label??He(st(r.id)));let t=Ne("ApiState",void 0);const v=f(()=>mt.call({responseStatus:r.status??(null==t?void 0:t.error.value)},r.id)),p=f(()=>[nt.base,v.value?nt.invalid:nt.valid]),m=A(null),g=A(""),y=A(null),h=A(r.viewCount),b=A([]),x=f(()=>g.value?r.options.filter(e=>r.match(e,g.value)).slice(0,h.value):r.options),C=["Tab","Escape","ArrowDown","ArrowUp","Enter","PageUp","PageDown","Home","End"];const L=[",",` -`,"\t"];function V(t){var l=null==(t=t.clipboardData)?void 0:t.getData("Text");if(l){t=L.some(e=>l.includes(e));if(r.multiple&&t){if(t){t=new RegExp("\\r|\\n|\\t|,"),t=l.split(t).filter(e=>e.trim()).map(t=>r.options.find(e=>r.match(e,t))).filter(e=>!!e);if(0{d(t)?e=e.filter(e=>e!=t):e.push(t)}),n("update:modelValue",e),cl()}}}else{t=r.options.filter(e=>r.match(e,l));1==t.length&&(O(t[0]),i.value=!1,cl())}}}function M(e){C.indexOf(e.code)||j()}function S(e){var t;e.shiftKey||e.ctrlKey||e.altKey||(i.value?"Escape"==e.code?i.value&&(e.stopPropagation(),i.value=!1):"Tab"==e.code?i.value=!1:"Home"==e.code?(y.value=b.value[0],$()):"End"==e.code?(y.value=b.value[b.value.length-1],$()):"ArrowDown"==e.code?(y.value?(t=b.value.indexOf(y.value),y.value=t+1{var e=pl(`#${r.id}-autocomplete li.active`);e&&e.scrollIntoView(I)},0)}function F(){setTimeout(()=>{var e=pl(`#${r.id}-autocomplete li.active`);e&&("scrollIntoViewIfNeeded"in e?e.scrollIntoViewIfNeeded(I):e.scrollIntoView(I))},0)}function B(e){(i.value=e)&&(j(),null!=(e=m.value))&&e.focus()}function j(){i.value=!0,H()}function O(t){if(g.value="",i.value=!1,r.multiple){let e=Array.from(r.modelValue||[]);d(t)?e=e.filter(e=>e!=t):e.push(t),y.value=null,n("update:modelValue",e)}else{let e=t;r.modelValue==t&&(e=null),n("update:modelValue",e)}}function H(){b.value=x.value}return Lt(g,H),(e,t)=>(a(),u("div",{id:l.id+"-autocomplete"},[o(c)?(a(),u("label",{key:0,for:l.id+"-text",class:"block text-sm font-medium text-gray-700 dark:text-gray-300"},T(o(c)),9,Uc)):k("",!0),s("div",qc,[kt(s("input",Me({ref_key:"txtInput",ref:m,id:l.id+"-text",type:"text",role:"combobox","aria-controls":"options","aria-expanded":"false",autocomplete:"off",spellcheck:"false","onUpdate:modelValue":t[0]||(t[0]=e=>g.value=e),class:o(p),placeholder:l.multiple||!l.modelValue?l.placeholder:"",onFocus:j,onKeydown:S,onKeyup:M,onClick:j,onPaste:V,required:!1},e.$attrs),null,16,Qc),[[io,g.value]]),s("button",{type:"button",onClick:t[1]||(t[1]=e=>B(!i.value)),class:"absolute inset-y-0 right-0 flex items-center rounded-r-md px-2 focus:outline-none",tabindex:"-1"},Zc),i.value?(a(),u("ul",{key:0,class:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white dark:bg-black py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm",onKeydown:S,id:l.id+"-options",role:"listbox"},[(a(!0),u(Te,null,Ie(b.value,l=>(a(),u("li",{class:w([l===y.value?"active bg-indigo-600 text-white":"text-gray-900 dark:text-gray-100","relative cursor-default select-none py-2 pl-3 pr-9"]),onMouseover:e=>{return t=l,y.value=t,void(b.value.indexOf(t)>Math.floor(.9*h.value)&&(h.value+=r.viewCount,H()));var t},onClick:e=>O(l),role:"option",tabindex:"-1"},[Z(e.$slots,"item",jt(gl(l))),d(l)?(a(),u("span",{key:0,class:w(["absolute inset-y-0 right-0 flex items-center pr-4",l===y.value?"text-white":"text-indigo-600"])},Xc,2)):k("",!0)],42,Wc))),256))],40,Gc)):!l.multiple&&l.modelValue?(a(),u("div",{key:1,onKeydown:S,onClick:t[2]||(t[2]=e=>B(!i.value)),class:"h-8 -mt-8 ml-3 pt-0.5"},[Z(e.$slots,"item",jt(gl(l.modelValue)))],32)):k("",!0),o(v)?(a(),u("div",Yc,t0)):k("",!0)]),o(v)?(a(),u("p",{key:1,class:"mt-2 text-sm text-red-500",id:l.id+"-error"},T(o(v)),9,l0)):l.help?(a(),u("p",{key:2,class:"mt-2 text-sm text-gray-500",id:l.id+"-description"},T(l.help),9,n0)):k("",!0)],8,Nc))}}),o0=["id","name","value"],a0={class:"block truncate"},i0=ce({__name:"Combobox",props:{id:null,modelValue:null,multiple:{type:Boolean},options:null,values:null,entries:null},emits:["update:modelValue"],setup(n,{expose:e,emit:t}){const l=n;function r(e){t("update:modelValue",e)}e({toggle(e){var t;null!=(t=d.value)&&t.toggle(e)}});const i=f(()=>null!=l.multiple?l.multiple:Array.isArray(l.modelValue)),d=A();function c(e,t){return!t||e.value.toLowerCase().includes(t.toLowerCase())}const v=f(()=>l.entries||(l.values?l.values.map(e=>({key:e,value:e})):l.options?Object.keys(l.options).map(e=>({key:e,value:l.options[e]})):[])),p=A(i.value?[]:null);tt(function(){let t=l.modelValue&&"object"==typeof l.modelValue?l.modelValue.key:l.modelValue;null==t||""===t?p.value=i.value?[]:null:"string"==typeof t?p.value=v.value.find(e=>e.key===t)||null:Array.isArray(t)&&(p.value=v.value.filter(e=>t.includes(e.key)))});const m=f(()=>null==p.value?"":Array.isArray(p.value)?p.value.map(e=>encodeURIComponent(e.key)).join(","):p.value.key);return(e,t)=>{var l=X("Autocomplete");return a(),u(Te,null,[s("input",{type:"hidden",id:n.id,name:n.id,value:o(m)},null,8,o0),$e(l,Me({ref_key:"input",ref:d,id:n.id,options:o(v),match:c,multiple:o(i)},e.$attrs,{modelValue:p.value,"onUpdate:modelValue":[t[0]||(t[0]=e=>p.value=e),r]}),{item:ke(({value:e})=>[s("span",a0,T(e),1)]),_:1},16,["id","options","multiple","modelValue"])],64)}}}),r0=ce({__name:"DynamicInput",props:{input:null,modelValue:null,api:null},emits:["update:modelValue"],setup(p,{emit:e}){const l=p,m=f(()=>l.input.type||"text"),t="ignore,css,options,meta,allowableValues,allowableEntries,op,prop,type,id,name".split(","),g=f(()=>dt(l.input,t)),y=A(qe(l.modelValue[l.input.id],e=>"file"===l.input.type?null:"date"===l.input.type&&e instanceof Date?$l(e):"time"===l.input.type?ls(e):e)),h=(Lt(y,()=>{l.modelValue[l.input.id]=y.value,e("update:modelValue",l.modelValue)}),f(()=>{var e=l.modelValue[l.input.id];if("file"!==l.input.type||!e)return[];if("string"==typeof e)return[{filePath:e,fileName:$t(e,"/")}];if(!Array.isArray(e)&&"object"==typeof e)return e;if(Array.isArray(e)){const t=[];return e.forEach(e=>{"string"==typeof e?t.push({filePath:e,fileName:$t(e,"/")}):"object"==typeof e&&t.push(e)}),t}}));return(e,t)=>{var l,s=X("SelectInput"),n=X("CheckboxInput"),r=X("TagInput"),i=X("Combobox"),u=X("FileInput"),d=X("TextareaInput"),c=X("MarkdownInput"),v=X("TextInput");return o(ne).component(o(m))?(a(),se(Jn(o(ne).component(o(m))),Me({key:0,id:p.input.id,modelValue:y.value,"onUpdate:modelValue":t[0]||(t[0]=e=>y.value=e),status:null==(l=p.api)?void 0:l.error,"input-class":null==(l=p.input.css)?void 0:l.input,"label-class":null==(l=p.input.css)?void 0:l.label},o(g)),null,16,["id","modelValue","status","input-class","label-class"])):"select"==o(m)?(a(),se(s,Me({key:1,id:p.input.id,modelValue:y.value,"onUpdate:modelValue":t[1]||(t[1]=e=>y.value=e),status:null==(l=p.api)?void 0:l.error,"input-class":null==(s=p.input.css)?void 0:s.input,"label-class":null==(l=p.input.css)?void 0:l.label,entries:p.input.allowableEntries,values:p.input.allowableValues},o(g)),null,16,["id","modelValue","status","input-class","label-class","entries","values"])):"checkbox"==o(m)?(a(),se(n,Me({key:2,id:p.input.id,modelValue:y.value,"onUpdate:modelValue":t[2]||(t[2]=e=>y.value=e),status:null==(s=p.api)?void 0:s.error,"input-class":null==(l=p.input.css)?void 0:l.input,"label-class":null==(n=p.input.css)?void 0:n.label},o(g)),null,16,["id","modelValue","status","input-class","label-class"])):"tag"==o(m)?(a(),se(r,Me({key:3,id:p.input.id,modelValue:y.value,"onUpdate:modelValue":t[3]||(t[3]=e=>y.value=e),status:null==(s=p.api)?void 0:s.error,"input-class":null==(l=p.input.css)?void 0:l.input,"label-class":null==(n=p.input.css)?void 0:n.label,allowableValues:p.input.allowableValues,string:"String"==(null==(r=p.input.prop)?void 0:r.type)},o(g)),null,16,["id","modelValue","status","input-class","label-class","allowableValues","string"])):"combobox"==o(m)?(a(),se(i,Me({key:4,id:p.input.id,modelValue:y.value,"onUpdate:modelValue":t[4]||(t[4]=e=>y.value=e),status:null==(s=p.api)?void 0:s.error,"input-class":null==(l=p.input.css)?void 0:l.input,"label-class":null==(n=p.input.css)?void 0:n.label,entries:p.input.allowableEntries,values:p.input.allowableValues},o(g)),null,16,["id","modelValue","status","input-class","label-class","entries","values"])):"file"==o(m)?(a(),se(u,Me({key:5,id:p.input.id,status:null==(r=p.api)?void 0:r.error,modelValue:y.value,"onUpdate:modelValue":t[5]||(t[5]=e=>y.value=e),"input-class":null==(i=p.input.css)?void 0:i.input,"label-class":null==(s=p.input.css)?void 0:s.label,files:o(h)},o(g)),null,16,["id","status","modelValue","input-class","label-class","files"])):"textarea"==o(m)?(a(),se(d,Me({key:6,id:p.input.id,modelValue:y.value,"onUpdate:modelValue":t[6]||(t[6]=e=>y.value=e),status:null==(l=p.api)?void 0:l.error,"input-class":null==(n=p.input.css)?void 0:n.input,"label-class":null==(u=p.input.css)?void 0:u.label},o(g)),null,16,["id","modelValue","status","input-class","label-class"])):"MarkdownInput"==o(m)?(a(),se(c,Me({key:7,id:p.input.id,modelValue:y.value,"onUpdate:modelValue":t[7]||(t[7]=e=>y.value=e),status:null==(r=p.api)?void 0:r.error,"input-class":null==(i=p.input.css)?void 0:i.input,"label-class":null==(s=p.input.css)?void 0:s.label},o(g)),null,16,["id","modelValue","status","input-class","label-class"])):(a(),se(v,Me({key:8,type:o(m),id:p.input.id,modelValue:y.value,"onUpdate:modelValue":t[8]||(t[8]=e=>y.value=e),status:null==(d=p.api)?void 0:d.error,"input-class":null==(l=p.input.css)?void 0:l.input,"label-class":null==(n=p.input.css)?void 0:n.label},o(g)),null,16,["type","id","modelValue","status","input-class","label-class"]))}}}),u0={class:"lookup-field"},d0=["name","value"],c0={key:0,class:"flex justify-between"},f0=["for"],m0={key:0,class:"flex items-center"},v0={class:"text-sm text-gray-500 dark:text-gray-400 pr-1"},h0=s("span",{class:"sr-only"},"Clear",-1),g0=s("svg",{class:"h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1),p0=[h0,g0],y0={key:1,class:"mt-1 relative"},b0={class:"w-full inline-flex truncate"},w0={class:"text-blue-700 dark:text-blue-300 flex cursor-pointer"},x0=s("span",{class:"absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none"},[s("svg",{class:"h-5 w-5 text-gray-400 dark:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[s("path",{"fill-rule":"evenodd",d:"M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z","clip-rule":"evenodd"})])],-1),k0=["id"],$0=["id"],C0=ce({__name:"LookupInput",props:{id:null,status:null,input:null,metadataType:null,modelValue:null,label:null,labelClass:null,help:null},emits:["update:modelValue"],setup(r,{emit:i}){const d=r,t=St()["config"],n=at()["metadataApi"],c=f(()=>d.id||d.input.id),v=f(()=>d.label??He(st(c.value)));let e=Ne("ApiState",void 0);const p=Ne("client"),m=f(()=>mt.call({responseStatus:d.status??(null==e?void 0:e.error.value)},c.value)),g=A(""),y=A(""),h=f(()=>ye(d.modelValue,c.value)),b=f(()=>et(d.metadataType).find(e=>e.name.toLowerCase()==c.value.toLowerCase())),x=f(()=>{var e;return(null==(e=ot(null==(e=null==(e=b.value)?void 0:e.ref)?void 0:e.model))?void 0:e.icon)||t.value.tableIcon});let C;function L(){d.modelValue[c.value]=null,g.value=""}return tt(async()=>{C=Ne("ModalProvider",void 0);var t,l=d.modelValue;d.modelValue[c.value]||(d.modelValue[c.value]=null);const a=b.value,s=null==a?void 0:a.ref;if(s){g.value="";let e=null==s.selfId?ye(l,a.name):ye(l,s.selfId);null==(e=Zt(e)?ye(l,s.refId):e)||null==(null==(t=n.value)?void 0:t.operations.find(e=>{return(null==(e=e.dataModel)?void 0:e.name)==s.model}))||Zt(t=ye(l,a.name))||(g.value=""+t,y.value=a.name,null!=s.refLabel&&(null==(t=et(d.metadataType).find(e=>e.type==s.model))&&console.warn(`Could not find ${s.model} Property on `+d.metadataType.name),null!=(l=null!=t?ye(l,t.name):null)?(t=ye(l,s.refLabel))&&(g.value=""+t,Ft.setValue(s.model,e,s.refLabel,t)):(t=1==(null==(l=a.attributes)?void 0:l.some(e=>"Computed"==e.name)),l=await Ft.getOrFetchValue(p,n.value,s.model,s.refId,s.refLabel,t,e),g.value=l||s.model+": "+g.value)))}else console.warn(`No RefInfo for property '${c.value}'`)}),(e,t)=>{var l,n=X("Icon");return a(),u("div",u0,[s("input",{type:"hidden",name:o(c),value:o(h)},null,8,d0),o(v)?(a(),u("div",c0,[s("label",{for:o(c),class:w("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(r.labelClass??""))},T(o(v)),11,f0),o(h)?(a(),u("div",m0,[s("span",v0,T(o(h)),1),s("button",{onClick:L,type:"button",title:"clear",class:"mr-1 rounded-md text-gray-400 dark:text-gray-500 hover:text-gray-500 dark:hover:text-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 dark:ring-offset-black"},p0)])):k("",!0)])):k("",!0),null!=(l=o(b))&&l.ref?(a(),u("div",y0,[s("button",{type:"button",class:"lookup flex relative w-full bg-white dark:bg-black border border-gray-300 dark:border-gray-700 rounded-md shadow-sm pl-3 pr-10 py-2 text-left focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm",onClick:t[0]||(t[0]=e=>{var l;(l=o(b).ref)&&(null==C?console.warn("No ModalProvider required by LookupInput"):C.openModal({name:"ModalLookup",ref:l},e=>{var t;console.debug("openModal",g.value," -> ",e,Ft.setRefValue(l,e),l),e&&(t=ye(e,l.refId),g.value=Ft.setRefValue(l,e)||t,(e=o(d.modelValue))[c.value]=t,i("update:modelValue",e))}))}),"aria-haspopup":"listbox","aria-expanded":"true","aria-labelledby":"listbox-label"},[s("span",b0,[s("span",w0,[$e(n,{class:"mr-1 w-5 h-5",image:o(x)},null,8,["image"]),s("span",null,T(g.value),1)])]),x0])])):k("",!0),o(m)?(a(),u("p",{key:2,class:"mt-2 text-sm text-red-500",id:o(c)+"-error"},T(o(m)),9,k0)):r.help?(a(),u("p",{key:3,class:"mt-2 text-sm text-gray-500",id:o(c)+"-description"},T(r.help),9,$0)):k("",!0)])}}}),_0=ce({__name:"AutoFormFields",props:{modelValue:null,type:null,api:null,formLayout:null,configureField:null,configureFormLayout:null,hideSummary:{type:Boolean},flexClass:{default:"flex flex-1 flex-col justify-between"},divideClass:{default:"divide-y divide-gray-200 px-4 sm:px-6"},spaceClass:{default:"space-y-6 pt-6 pb-5"},fieldsetClass:{default:"grid grid-cols-12 gap-6"}},emits:["update:modelValue"],setup(d,{expose:e,emit:l}){const r=d;function n(){var e=Be();null!=(e=null==e?void 0:e.proxy)&&e.$forceUpdate()}function c(e,t){r.modelValue[e]=t,l("update:modelValue",r.modelValue),n()}e({forceUpdate:n,props:r,updateValue:c});const{metadataApi:t,apiOf:i,typeOf:v,typeOfRef:p,createFormLayout:m}=at(),g=f(()=>r.type||Et(r.modelValue)),y=f(()=>v(g.value)),h=f(()=>{var e;return p(null==(e=null==(e=t.value)?void 0:e.operations.find(e=>e.request.name==g.value))?void 0:e.dataModel)||y.value}),b=f(()=>{var e,t=y.value;if(!t){if(r.formLayout)return e=r.formLayout.map(e=>{var t={name:e.id,type:ba(e.type)},t=Object.assign({prop:t},e);return r.configureField&&r.configureField(t),t}),r.configureFormLayout&&r.configureFormLayout(e),e;throw new Error(`MetadataType for ${g.value} not found`)}const a=et(t),s=h.value,l=r.formLayout||m(t),n=[],o=i(t.name);return l.forEach(t=>{var e,l=a.find(e=>e.name==t.name);t.ignore||(e=(null==(e=null==s?void 0:s.properties)?void 0:e.find(e=>{return e.name.toLowerCase()==(null==(e=t.name)?void 0:e.toLowerCase())}))??l,l=Object.assign({prop:e,op:o},t),r.configureField&&r.configureField(l),n.push(l))}),r.configureFormLayout&&r.configureFormLayout(n),n}),x=f(()=>b.value.filter(e=>"hidden"!=e.type).map(e=>e.id));return(l,n)=>{var e;const t=X("ErrorSummary"),r=X("LookupInput"),i=X("DynamicInput");return a(),u(Te,null,[d.hideSummary?k("",!0):(a(),se(t,{key:0,status:null==(e=d.api)?void 0:e.error,except:o(x)},null,8,["status","except"])),s("div",{class:w(d.flexClass)},[s("div",{class:w(d.divideClass)},[s("div",{class:w(d.spaceClass)},[s("fieldset",{class:w(d.fieldsetClass)},[(a(!0),u(Te,null,Ie(o(b),t=>{var e;return a(),u("div",{key:t.id,class:w(["w-full",(null==(e=t.css)?void 0:e.field)??("textarea"==t.type?"col-span-12":"col-span-12 xl:col-span-6"+("checkbox"==t.type?" flex items-center":"")),"hidden"==t.type?"hidden":""])},[null==(null==(e=t.prop)?void 0:e.ref)||"file"==t.type||t.prop.isPrimaryKey?(a(),se(i,{key:1,input:t,modelValue:d.modelValue,"onUpdate:modelValue":n[0]||(n[0]=e=>l.$emit("update:modelValue",e)),api:d.api},null,8,["input","modelValue","api"])):(a(),se(r,{key:0,metadataType:o(h),input:t,modelValue:d.modelValue,"onUpdate:modelValue":e=>{c(t.id,ye(e,t.id))},status:null==(e=d.api)?void 0:e.error},null,8,["metadataType","input","modelValue","onUpdate:modelValue","status"]))],2)}),128))],2)],2)],2)],2)],64)}}});function Tl(){const s=A(!1),n=A(),o=A(),r=Ne("client");function i({message:e,errorCode:t,fieldName:l,errors:a}){return t=t||"Exception",a=a||[],n.value=new Bl(l?{errorCode:t,message:e,errors:[new Un({fieldName:l,errorCode:t,message:e})]}:{errorCode:t,message:e,errors:a})}var e={setError:i,addFieldError:function({fieldName:t,message:e,errorCode:l}){var a;l=l||"Exception",n.value?((a=new Bl(n.value)).errors=[...(a.errors||[]).filter(e=>{return(null==(e=e.fieldName)?void 0:e.toLowerCase())!==(null==t?void 0:t.toLowerCase())}),new Un({fieldName:t,message:e,errorCode:l})],n.value=a):i({fieldName:t,message:e,errorCode:l})},loading:s,error:n,api:async function(e,t,l){return s.value=!0,e=await r.api(Tt(e),t,l),s.value=!1,o.value=e.response,n.value=e.error,e},apiVoid:async function(e,t,l){return s.value=!0,e=await r.apiVoid(Tt(e),t,l),s.value=!1,o.value=e.response,n.value=e.error,e},apiForm:async function(e,t,l,a){return s.value=!0,e=await r.apiForm(Tt(e),t,l,a),s.value=!1,o.value=e.response,n.value=e.error,e},apiFormVoid:async function(e,t,l,a){return s.value=!0,e=await r.apiFormVoid(Tt(e),t,l,a),s.value=!1,o.value=e.response,n.value=e.error,e},swr:async function(e,t,l,a){return os(r,e,t,l,a)},swrEffect:function(l,a){const s=A(new Je),n=as(async e=>{s.value=await r.api(e)},null==a?void 0:a.delayMs);return hl(async()=>{var e=l(),t=on(_l(e));t&&(s.value=new Je({response:t})),0===(null==a?void 0:a.delayMs)?s.value=await r.api(e):n(e)}),(async()=>s.value=await r.api(l(),null==a?void 0:a.args,null==a?void 0:a.method))(),s},unRefs:Tt,setRef:ns};return Xt("ApiState",e),e}const L0={key:0},V0={class:"text-red-700"},S0=s("b",null,"type",-1),M0={key:0},A0={key:2},T0=["innerHTML"],F0=s("input",{type:"submit",class:"hidden"},null,-1),I0={class:"flex justify-end"},D0=s("div",null,null,-1),j0={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},O0=s("div",{class:"fixed inset-0"},null,-1),P0={class:"fixed inset-0 overflow-hidden"},B0={class:"flex min-h-0 flex-1 flex-col overflow-auto"},R0={class:"flex-1"},E0={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},H0={class:"flex items-start justify-between space-x-3"},z0={class:"space-y-1"},N0={key:0},U0={key:2},q0=["innerHTML"],Q0={class:"flex h-7 items-center"},K0={class:"flex justify-end"},Z0=ce({__name:"AutoForm",props:{type:null,modelValue:null,heading:null,subHeading:null,showLoading:{type:Boolean,default:!0},jsconfig:{default:"eccn,edv"},formStyle:{default:"card"},configureField:null,configureFormLayout:null,panelClass:null,bodyClass:null,formClass:null,innerFormClass:null,headerClass:{default:"p-6"},buttonsClass:null,headingClass:null,subHeadingClass:null,submitLabel:{default:"Submit"},allowSubmit:null},emits:["success","error","update:modelValue","done"],setup(p,{expose:e,emit:r}){const i=p,m=A(),g=A(1),y=A();function t(){g.value++,B.value=F();var e=Be();null!=(e=null==e?void 0:e.proxy)&&e.$forceUpdate()}e({forceUpdate:t,props:i,setModel:async function(e){Object.assign(B.value,e),t(),await xt(()=>null)},formFields:m,submit:async function(){D(y.value)},close:P}),Xt("ModalProvider",{openModal:function(e,t){h.value=e,l.value=t}});const h=A(),l=A();async function b(e){l.value&&l.value(e),h.value=void 0,l.value=void 0}const d=Tl(),n=is()["getTypeName"],{typeOf:c,createDto:v}=at(),x=A(new Je),C=f(()=>i.panelClass||Ze.panelClass(i.formStyle)),L=f(()=>i.formClass||"card"==i.formStyle?"shadow sm:rounded-md":It.formClass),V=f(()=>i.headingClass||Ze.headingClass(i.formStyle)),M=f(()=>i.subHeadingClass||Ze.subHeadingClass(i.formStyle)),S=f(()=>("string"==typeof i.buttonsClass?i:Ze).buttonsClass),I=f(()=>{var e;return i.type?n(i.type):null!=(e=i.modelValue)&&e.getTypeName?i.modelValue.getTypeName():null}),$=f(()=>c(I.value)),F=()=>i.modelValue||H(),B=A(F()),j=f(()=>d.loading.value),O=f(()=>{var e;return i.heading||(null==(e=c(I.value))?void 0:e.description)||He(I.value)});function H(){return"string"==typeof i.type?v(i.type):i.type?new i.type:i.modelValue}async function D(e){var t,l,a,s,n;e&&"FORM"==e.tagName?(t=H(),n=qe(null==t?void 0:t.getMethod,e=>"function"==typeof e?e():null)||"POST",l=null==qe(null==t?void 0:t.createResponse,e=>"function"==typeof e?e():null),a=i.jsconfig,ln.hasRequestBody(n)?(n=new t.constructor,s=new FormData(e),console.debug("AutoForm.submitForm",n,s),x.value=l?await d.apiFormVoid(n,s,{jsconfig:a}):await d.apiForm(n,s,{jsconfig:a})):(n=new t.constructor(_o(B.value)),console.debug("AutoForm.submit",n),x.value=l?await d.apiVoid(n,{jsconfig:a}):await d.api(n,{jsconfig:a})),x.value.succeeded?(r("success",x.value.response),P()):r("error",x.value.error)):console.error("Not a valid form",e)}function E(e){r("update:modelValue",e)}function z(){r("done")}const _=A(!1),R=A(""),N={entering:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-full",to:"translate-x-0"},leaving:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-0",to:"translate-x-full"}};function P(){"slideOver"==i.formStyle?_.value=!1:z()}Lt(_,()=>{Ct(N,R,_.value),_.value||setTimeout(z,700)}),_.value=!0;const U=e=>{"Escape"===e.key&&P()};return tt(()=>window.addEventListener("keydown",U)),Rt(()=>window.removeEventListener("keydown",U)),(t,e)=>{var l;const n=X("AutoFormFields"),r=X("FormLoading"),i=X("PrimaryButton"),d=X("CloseButton"),c=X("SecondaryButton"),v=X("ModalLookup");return a(),u("div",null,[o($)?"card"==p.formStyle?(a(),u("div",{key:1,class:w(o(C))},[s("form",{ref_key:"elForm",ref:y,onSubmit:e[0]||(e[0]=Ue(e=>D(e.target),["prevent"])),autocomplete:"off",class:w(p.innerFormClass)},[s("div",{class:w(p.bodyClass)},[s("div",{class:w(p.headerClass)},[t.$slots.heading?(a(),u("div",M0,[Z(t.$slots,"heading")])):(a(),u("h3",{key:1,class:w(o(V))},T(o(O)),3)),t.$slots.subheading?(a(),u("div",A0,[Z(t.$slots,"subheading")])):p.subHeading?(a(),u("p",{key:3,class:w(o(M))},T(p.subHeading),3)):null!=(l=o($))&&l.notes?(a(),u("p",{key:4,class:w(["notes",o(M)]),innerHTML:null==(l=o($))?void 0:l.notes},null,10,T0)):k("",!0)],2),Z(t.$slots,"header",{instance:null==(l=Be())?void 0:l.exposed,model:B.value}),F0,(a(),se(n,{ref_key:"formFields",ref:m,key:g.value,type:p.type,modelValue:B.value,"onUpdate:modelValue":E,api:x.value,configureField:p.configureField,configureFormLayout:p.configureFormLayout},null,8,["type","modelValue","api","configureField","configureFormLayout"])),Z(t.$slots,"footer",{instance:null==(l=Be())?void 0:l.exposed,model:B.value})],2),Z(t.$slots,"buttons",{},()=>{var e;return[s("div",{class:w(o(S))},[s("div",null,[Z(t.$slots,"leftbuttons",{instance:null==(e=Be())?void 0:e.exposed,model:B.value})]),s("div",null,[p.showLoading&&o(j)?(a(),se(r,{key:0})):k("",!0)]),s("div",I0,[D0,$e(i,{disabled:!!p.allowSubmit&&!p.allowSubmit(B.value)},{default:ke(()=>[we(T(p.submitLabel),1)]),_:1},8,["disabled"]),Z(t.$slots,"rightbuttons",{instance:null==(e=Be())?void 0:e.exposed,model:B.value})])],2)]})],34)],2)):(a(),u("div",j0,[O0,s("div",P0,[s("div",{onMousedown:P,class:"absolute inset-0 overflow-hidden"},[s("div",{onMousedown:e[2]||(e[2]=Ue(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[s("div",{class:w(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",R.value])},[s("form",{ref_key:"elForm",ref:y,class:w(o(L)),onSubmit:e[1]||(e[1]=Ue(e=>D(e.target),["prevent"]))},[s("div",B0,[s("div",R0,[s("div",E0,[s("div",H0,[s("div",z0,[t.$slots.heading?(a(),u("div",N0,[Z(t.$slots,"heading")])):(a(),u("h3",{key:1,class:w(o(V))},T(o(O)),3)),t.$slots.subheading?(a(),u("div",U0,[Z(t.$slots,"subheading")])):p.subHeading?(a(),u("p",{key:3,class:w(o(M))},T(p.subHeading),3)):null!=(l=o($))&&l.notes?(a(),u("p",{key:4,class:w(["notes",o(M)]),innerHTML:null==(e=o($))?void 0:e.notes},null,10,q0)):k("",!0)]),s("div",Q0,[$e(d,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:P})])])]),Z(t.$slots,"header",{instance:null==(l=Be())?void 0:l.exposed,model:B.value}),(a(),se(n,{ref_key:"formFields",ref:m,key:g.value,type:p.type,modelValue:B.value,"onUpdate:modelValue":E,api:x.value,configureField:p.configureField,configureFormLayout:p.configureFormLayout},null,8,["type","modelValue","api","configureField","configureFormLayout"])),Z(t.$slots,"footer",{instance:null==(e=Be())?void 0:e.exposed,model:B.value})])]),s("div",{class:w(o(S))},[s("div",null,[Z(t.$slots,"leftbuttons",{instance:null==(l=Be())?void 0:l.exposed,model:B.value})]),s("div",null,[p.showLoading&&o(j)?(a(),se(r,{key:0})):k("",!0)]),s("div",K0,[$e(c,{onClick:P,disabled:o(j)},{default:ke(()=>[we("Cancel")]),_:1},8,["disabled"]),$e(i,{class:"ml-4",disabled:!!p.allowSubmit&&!p.allowSubmit(B.value)},{default:ke(()=>[we(T(p.submitLabel),1)]),_:1},8,["disabled"]),Z(t.$slots,"rightbuttons",{instance:null==(e=Be())?void 0:e.exposed,model:B.value})])],2)],34)],2)],32)],32)])])):(a(),u("div",L0,[s("p",V0,[we("Could not create form for unknown "),S0,we(" "+T(o(I)),1)])])),"ModalLookup"==(null==(l=h.value)?void 0:l.name)&&h.value.ref?(a(),se(v,{key:3,"ref-info":h.value.ref,onDone:b},null,8,["ref-info"])):k("",!0)])}}}),G0={key:0},W0={class:"text-red-700"},J0=s("b",null,"type",-1),X0=["onSubmit"],Y0={key:0},ef={key:2},tf=["innerHTML"],lf={class:"flex justify-end"},nf={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},sf=s("div",{class:"fixed inset-0"},null,-1),of={class:"fixed inset-0 overflow-hidden"},af=["onSubmit"],rf={class:"flex min-h-0 flex-1 flex-col overflow-auto"},uf={class:"flex-1"},df={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},cf={class:"flex items-start justify-between space-x-3"},ff={class:"space-y-1"},mf={key:0},vf={key:2},hf=["innerHTML"],gf={class:"flex h-7 items-center"},pf={class:"flex justify-end"},yf=ce({__name:"AutoCreateForm",props:{type:null,formStyle:{default:"slideOver"},panelClass:null,formClass:null,headingClass:null,subHeadingClass:null,buttonsClass:null,heading:null,subHeading:null,autosave:{type:Boolean,default:!0},showLoading:{type:Boolean,default:!0},showCancel:{type:Boolean,default:!0},configureField:null,configureFormLayout:null},emits:["done","save","error"],setup(p,{expose:e,emit:n}){const r=p,m=A(),g=A(1);function t(){g.value++,null!=(e=m.value)&&e.forceUpdate();var e=Be();null!=(e=null==e?void 0:e.proxy)&&e.$forceUpdate()}function y(e){}e({forceUpdate:t,props:r,setModel:function(e){Object.assign(V.value,e),t()},formFields:m}),Xt("ModalProvider",{openModal:function(e,t){h.value=e,l.value=t}});const h=A(),l=A();async function b(e){l.value&&l.value(e),h.value=void 0,l.value=void 0}const{typeOf:i,typeProperties:d,Crud:c,createDto:v,formValues:x}=at(),C=f(()=>Et(r.type)),L=f(()=>i(C.value)),V=A("string"==typeof r.type?v(r.type):r.type?new r.type:null),M=f(()=>r.panelClass||Ze.panelClass(r.formStyle)),S=f(()=>r.formClass||Ze.formClass(r.formStyle)),I=f(()=>r.headingClass||Ze.headingClass(r.formStyle)),$=f(()=>r.subHeadingClass||Ze.subHeadingClass(r.formStyle)),F=f(()=>r.buttonsClass||Ze.buttonsClass),B=f(()=>c.model(L.value)),j=f(()=>{var e;return r.heading||(null==(e=i(C.value))?void 0:e.description)||(B.value?"New "+He(B.value):He(C.value))}),O=A(new Je);let H=Tl(),D=f(()=>H.loading.value);async function E(e){var t,l,a,e=e.target;r.autosave?(l=qe(null==(l=V.value)?void 0:l.getMethod,e=>"function"==typeof e?e():null)||"POST",t=null==qe(null==(t=V.value)?void 0:t.createResponse,e=>"function"==typeof e?e():null),ln.hasRequestBody(l)?(l=new V.value.constructor,a=new FormData(e),O.value=t?await H.apiFormVoid(l,a,{jsconfig:"eccn"}):await H.apiForm(l,a,{jsconfig:"eccn"})):(l=x(e,d(L.value)),a=new V.value.constructor(l),O.value=t?await H.apiVoid(a,{jsconfig:"eccn"}):await H.api(a,{jsconfig:"eccn"})),O.value.succeeded?(e.reset(),n("save",O.value.response)):n("error",O.value.error)):n("save",new V.value.constructor(x(e,d(L.value))))}function z(){n("done")}ne.interceptors.has("AutoCreateForm.new")&&ne.interceptors.invoke("AutoCreateForm.new",{props:r,model:V});const _=A(!1),R=A(""),N={entering:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-full",to:"translate-x-0"},leaving:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-0",to:"translate-x-full"}};function P(){"slideOver"==r.formStyle?_.value=!1:z()}Lt(_,()=>{Ct(N,R,_.value),_.value||setTimeout(z,700)}),_.value=!0;const U=e=>{"Escape"===e.key&&P()};return tt(()=>window.addEventListener("keydown",U)),Rt(()=>window.removeEventListener("keydown",U)),(e,t)=>{var l,n=X("AutoFormFields"),r=X("FormLoading"),i=X("SecondaryButton"),d=X("PrimaryButton"),c=X("CloseButton"),v=X("ModalLookup");return a(),u("div",null,[o(L)?"card"==p.formStyle?(a(),u("div",{key:1,class:w(o(M))},[s("form",{onSubmit:Ue(E,["prevent"])},[s("div",{class:w(o(S))},[s("div",null,[e.$slots.heading?(a(),u("div",Y0,[Z(e.$slots,"heading")])):(a(),u("h3",{key:1,class:w(o(I))},T(o(j)),3)),e.$slots.subheading?(a(),u("div",ef,[Z(e.$slots,"subheading")])):p.subHeading?(a(),u("p",{key:3,class:w(o($))},T(p.subHeading),3)):null!=(l=o(L))&&l.notes?(a(),u("p",{key:4,class:w(["notes",o($)]),innerHTML:null==(l=o(L))?void 0:l.notes},null,10,tf)):k("",!0)]),Z(e.$slots,"header",{formInstance:null==(l=Be())?void 0:l.exposed,model:V.value}),(a(),se(n,{ref_key:"formFields",ref:m,key:g.value,modelValue:V.value,"onUpdate:modelValue":y,api:O.value,configureField:p.configureField,configureFormLayout:p.configureFormLayout},null,8,["modelValue","api","configureField","configureFormLayout"])),Z(e.$slots,"footer",{formInstance:null==(l=Be())?void 0:l.exposed,model:V.value})],2),s("div",{class:w(o(F))},[s("div",null,[p.showLoading&&o(D)?(a(),se(r,{key:0})):k("",!0)]),s("div",lf,[p.showCancel?(a(),se(i,{key:0,onClick:P,disabled:o(D)},{default:ke(()=>[we("Cancel")]),_:1},8,["disabled"])):k("",!0),$e(d,{type:"submit",class:"ml-4",disabled:o(D)},{default:ke(()=>[we("Save")]),_:1},8,["disabled"])])],2)],40,X0)],2)):(a(),u("div",nf,[sf,s("div",of,[s("div",{onMousedown:P,class:"absolute inset-0 overflow-hidden"},[s("div",{onMousedown:t[0]||(t[0]=Ue(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[s("div",{class:w(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",R.value])},[s("form",{class:w(o(S)),onSubmit:Ue(E,["prevent"])},[s("div",rf,[s("div",uf,[s("div",df,[s("div",cf,[s("div",ff,[e.$slots.heading?(a(),u("div",mf,[Z(e.$slots,"heading")])):(a(),u("h3",{key:1,class:w(o(I))},T(o(j)),3)),e.$slots.subheading?(a(),u("div",vf,[Z(e.$slots,"subheading")])):p.subHeading?(a(),u("p",{key:3,class:w(o($))},T(p.subHeading),3)):null!=(l=o(L))&&l.notes?(a(),u("p",{key:4,class:w(["notes",o($)]),innerHTML:null==(t=o(L))?void 0:t.notes},null,10,hf)):k("",!0)]),s("div",gf,[$e(c,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:P})])])]),Z(e.$slots,"header",{formInstance:null==(l=Be())?void 0:l.exposed,model:V.value}),(a(),se(n,{ref_key:"formFields",ref:m,key:g.value,modelValue:V.value,"onUpdate:modelValue":y,api:O.value,configureField:p.configureField,configureFormLayout:p.configureFormLayout},null,8,["modelValue","api","configureField","configureFormLayout"])),Z(e.$slots,"footer",{formInstance:null==(t=Be())?void 0:t.exposed,model:V.value})])]),s("div",{class:w(o(F))},[s("div",null,[p.showLoading&&o(D)?(a(),se(r,{key:0})):k("",!0)]),s("div",pf,[p.showCancel?(a(),se(i,{key:0,onClick:P,disabled:o(D)},{default:ke(()=>[we("Cancel")]),_:1},8,["disabled"])):k("",!0),$e(d,{type:"submit",class:"ml-4",disabled:o(D)},{default:ke(()=>[we("Save")]),_:1},8,["disabled"])])],2)],42,af)],2)],32)],32)])])):(a(),u("div",G0,[s("p",W0,[we("Could not create form for unknown "),J0,we(" "+T(o(C)),1)])])),"ModalLookup"==(null==(c=h.value)?void 0:c.name)&&h.value.ref?(a(),se(v,{key:3,"ref-info":h.value.ref,onDone:b},null,8,["ref-info"])):k("",!0)])}}}),bf={key:0},wf={class:"text-red-700"},xf=s("b",null,"type",-1),kf=["onSubmit"],$f={key:0},Cf={key:2},_f=["innerHTML"],Lf={class:"flex justify-end"},Vf={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},Sf=s("div",{class:"fixed inset-0"},null,-1),Mf={class:"fixed inset-0 overflow-hidden"},Af=["onSubmit"],Tf={class:"flex min-h-0 flex-1 flex-col overflow-auto"},Ff={class:"flex-1"},If={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},Df={class:"flex items-start justify-between space-x-3"},jf={class:"space-y-1"},Of={key:0},Pf={key:2},Bf=["innerHTML"],Rf={class:"flex h-7 items-center"},Ef={class:"flex justify-end"},Hf=ce({__name:"AutoEditForm",props:{modelValue:null,type:null,deleteType:null,formStyle:{default:"slideOver"},panelClass:null,formClass:null,headingClass:null,subHeadingClass:null,heading:null,subHeading:null,autosave:{type:Boolean,default:!0},showLoading:{type:Boolean,default:!0},configureField:null,configureFormLayout:null},emits:["done","save","delete","error"],setup(p,{expose:e,emit:n}){const r=p,m=A(),g=A(1);function y(e){}e({forceUpdate:function(){g.value++,V.value=L();var e=Be();null!=(e=null==e?void 0:e.proxy)&&e.$forceUpdate()},props:r,setModel:function(e){Object.assign(V.value,e)},formFields:m}),Xt("ModalProvider",{openModal:function(e,t){h.value=e,l.value=t}});const h=A(),l=A();async function b(e){l.value&&l.value(e),h.value=void 0,l.value=void 0}const{typeOf:t,apiOf:q,typeProperties:i,createFormLayout:Q,getPrimaryKey:K,Crud:c,createDto:d,formValues:v}=at(),x=f(()=>Et(r.type)),C=f(()=>t(x.value)),L=()=>"string"==typeof r.type?d(r.type,ml(r.modelValue)):r.type?new r.type(ml(r.modelValue)):null,V=A(L()),W=f(()=>r.panelClass||Ze.panelClass(r.formStyle)),M=f(()=>r.formClass||Ze.formClass(r.formStyle)),S=f(()=>r.headingClass||Ze.headingClass(r.formStyle)),I=f(()=>r.subHeadingClass||Ze.subHeadingClass(r.formStyle)),$=f(()=>c.model(C.value)),F=f(()=>{var e;return r.heading||(null==(e=t(x.value))?void 0:e.description)||($.value?"Update "+He($.value):He(x.value))}),B=A(new Je);let j=Object.assign({},ml(r.modelValue)),O=(ne.interceptors.has("AutoEditForm.new")&&ne.interceptors.invoke("AutoEditForm.new",{props:r,model:V,origModel:j}),Tl()),H=f(()=>O.loading.value);const D=()=>qe(t(c.model(C.value)),e=>K(e));function G(e){var{op:t,prop:l}=e;t&&(c.isPatch(t)||c.isUpdate(t))&&(e.disabled=null==l?void 0:l.isPrimaryKey),r.configureField&&r.configureField(e)}async function E(a){a=a.target;if(r.autosave){let e=qe(null==(s=V.value)?void 0:s.getMethod,e=>"function"==typeof e?e():null)||"POST",l=null==qe(null==(s=V.value)?void 0:s.createResponse,e=>"function"==typeof e?e():null),d=D();if(ln.hasRequestBody(e)){let e=new V.value.constructor,t=ye(r.modelValue,d.name),i=new FormData(a),u=(d&&!Array.from(i.keys()).some(e=>e.toLowerCase()==d.name.toLowerCase())&&i.append(d.name,t),[]);var s=x.value&&q(x.value);if(s&&c.isPatch(s)){let o=Q(C.value),r={};if(d&&(r[d.name]=t),o.forEach(l=>{var a=l.id,s=ye(j,a);if(!d||d.name.toLowerCase()!==a.toLowerCase()){var n=i.get(a);ne.interceptors.has("AutoEditForm.save.formLayout")&&ne.interceptors.invoke("AutoEditForm.save.formLayout",{origValue:s,formLayout:o,input:l,newValue:n});let e=null!=n,t="checkbox"===l.type?e!=!!s:"file"===l.type?e:n!=s;(t=n||s?t:!1)&&(n?r[a]=n:"file"!==l.type&&u.push(a))}}),ne.interceptors.has("AutoEditForm.save")&&ne.interceptors.invoke("AutoEditForm.save",{origModel:j,formLayout:o,dirtyValues:r}),Array.from(i.keys()).filter(e=>!r[e]).forEach(e=>i.delete(e)),0==Array.from(i.keys()).filter(e=>e.toLowerCase()!=d.name.toLowerCase()).length&&0==u.length)return void P()}s=0"function"==typeof e?e():null)?B.value=await O.apiVoid(l):B.value=await O.api(l),B.value.succeeded?n("delete",B.value.response):n("error",B.value.error)):console.error(`Could not find Primary Key for Type ${x.value} (${$.value})`)}function _(){n("done")}const R=A(!1),N=A(""),J={entering:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-full",to:"translate-x-0"},leaving:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-0",to:"translate-x-full"}};function P(){"slideOver"==r.formStyle?R.value=!1:_()}Lt(R,()=>{Ct(J,N,R.value),R.value||setTimeout(_,700)}),R.value=!0;const U=e=>{"Escape"===e.key&&P()};return tt(()=>window.addEventListener("keydown",U)),Rt(()=>window.removeEventListener("keydown",U)),(e,t)=>{var l,n=X("AutoFormFields"),r=X("ConfirmDelete"),i=X("FormLoading"),d=X("SecondaryButton"),c=X("PrimaryButton"),v=X("CloseButton"),f=X("ModalLookup");return a(),u("div",null,[o(C)?"card"==p.formStyle?(a(),u("div",{key:1,class:w(o(W))},[s("form",{onSubmit:Ue(E,["prevent"])},[s("div",{class:w(o(M))},[s("div",null,[e.$slots.heading?(a(),u("div",$f,[Z(e.$slots,"heading")])):(a(),u("h3",{key:1,class:w(o(S))},T(o(F)),3)),e.$slots.subheading?(a(),u("div",Cf,[Z(e.$slots,"subheading")])):p.subHeading?(a(),u("p",{key:3,class:w(o(I))},T(p.subHeading),3)):null!=(l=o(C))&&l.notes?(a(),u("p",{key:4,class:w(["notes",o(I)]),innerHTML:null==(l=o(C))?void 0:l.notes},null,10,_f)):k("",!0)]),Z(e.$slots,"header",{formInstance:null==(l=Be())?void 0:l.exposed,model:V.value}),(a(),se(n,{ref_key:"formFields",ref:m,key:g.value,modelValue:V.value,"onUpdate:modelValue":y,api:B.value,configureField:p.configureField,configureFormLayout:p.configureFormLayout},null,8,["modelValue","api","configureField","configureFormLayout"])),Z(e.$slots,"footer",{formInstance:null==(l=Be())?void 0:l.exposed,model:V.value})],2),s("div",{class:w(o(Ze).buttonsClass)},[s("div",null,[p.deleteType?(a(),se(r,{key:0,onDelete:z})):k("",!0)]),s("div",null,[p.showLoading&&o(H)?(a(),se(i,{key:0})):k("",!0)]),s("div",Lf,[$e(d,{onClick:P,disabled:o(H)},{default:ke(()=>[we("Cancel")]),_:1},8,["disabled"]),$e(c,{type:"submit",class:"ml-4",disabled:o(H)},{default:ke(()=>[we("Save")]),_:1},8,["disabled"])])],2)],40,kf)],2)):(a(),u("div",Vf,[Sf,s("div",Mf,[s("div",{onMousedown:P,class:"absolute inset-0 overflow-hidden"},[s("div",{onMousedown:t[0]||(t[0]=Ue(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[s("div",{class:w(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",N.value])},[s("form",{class:w(o(M)),onSubmit:Ue(E,["prevent"])},[s("div",Tf,[s("div",Ff,[s("div",If,[s("div",Df,[s("div",jf,[e.$slots.heading?(a(),u("div",Of,[Z(e.$slots,"heading")])):(a(),u("h3",{key:1,class:w(o(S))},T(o(F)),3)),e.$slots.subheading?(a(),u("div",Pf,[Z(e.$slots,"subheading")])):p.subHeading?(a(),u("p",{key:3,class:w(o(I))},T(p.subHeading),3)):null!=(l=o(C))&&l.notes?(a(),u("p",{key:4,class:w(["notes",o(I)]),innerHTML:null==(t=o(C))?void 0:t.notes},null,10,Bf)):k("",!0)]),s("div",Rf,[$e(v,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:P})])])]),Z(e.$slots,"header",{formInstance:null==(l=Be())?void 0:l.exposed,model:V.value}),(a(),se(n,{ref_key:"formFields",ref:m,key:g.value,modelValue:V.value,"onUpdate:modelValue":y,api:B.value,configureField:G,configureFormLayout:p.configureFormLayout},null,8,["modelValue","api","configureFormLayout"])),Z(e.$slots,"footer",{formInstance:null==(t=Be())?void 0:t.exposed,model:V.value})])]),s("div",{class:w(o(Ze).buttonsClass)},[s("div",null,[p.deleteType?(a(),se(r,{key:0,onDelete:z})):k("",!0)]),s("div",null,[p.showLoading&&o(H)?(a(),se(i,{key:0})):k("",!0)]),s("div",Ef,[$e(d,{onClick:P,disabled:o(H)},{default:ke(()=>[we("Cancel")]),_:1},8,["disabled"]),$e(c,{type:"submit",class:"ml-4",disabled:o(H)},{default:ke(()=>[we("Save")]),_:1},8,["disabled"])])],2)],42,Af)],2)],32)],32)])])):(a(),u("div",bf,[s("p",wf,[we("Could not create form for unknown "),xf,we(" "+T(o(x)),1)])])),"ModalLookup"==(null==(v=h.value)?void 0:v.name)&&h.value.ref?(a(),se(f,{key:3,"ref-info":h.value.ref,onDone:b},null,8,["ref-info"])):k("",!0)])}}}),zf=s("label",{for:"confirmDelete",class:"ml-2 mr-2 select-none"},"confirm",-1),Nf=["onClick"],Uf=ce({__name:"ConfirmDelete",emits:["delete"],setup(e,{emit:t}){let l=A(!1);const n=()=>{l.value&&t("delete")},r=f(()=>["select-none inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white",l.value?"cursor-pointer bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500":"bg-red-400"]);return(e,t)=>(a(),u(Te,null,[kt(s("input",{id:"confirmDelete",type:"checkbox",class:"focus:ring-indigo-500 h-4 w-4 text-indigo-600 rounded border-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:ring-offset-black","onUpdate:modelValue":t[0]||(t[0]=e=>Gn(l)?l.value=e:l=e)},null,512),[[Yl,o(l)]]),zf,s("span",Me({onClick:Ue(n,["prevent"]),class:o(r)},e.$attrs),[Z(e.$slots,"default",{},()=>[we("Delete")])],16,Nf)],64))}}),qf={class:"flex",title:"loading..."},Qf={key:0,xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",width:"24px",height:"30px",viewBox:"0 0 24 30"},Kf=wl('',3),Zf=[Kf],Gf={class:"ml-2 mt-1 text-gray-400"},Wf=ce({__name:"FormLoading",props:{icon:{type:Boolean,default:!0},text:{default:"loading..."}},setup(l){return Ne("ApiState",void 0),(e,t)=>(a(),u("div",qf,[l.icon?(a(),u("svg",Qf,Zf)):k("",!0),s("span",Gf,T(l.text),1)]))}}),Jf=["onClick"],Xf={key:3,class:"flex justify-between items-center"},Yf={class:"mr-1 select-none"},e1=["onClick"],t1=ce({__name:"DataGrid",props:{items:{default:()=>[]},id:{default:"DataGrid"},type:null,tableStyle:{default:"stripedRows"},selectedColumns:null,gridClass:null,grid2Class:null,grid3Class:null,grid4Class:null,tableClass:null,theadClass:null,tbodyClass:null,theadRowClass:null,theadCellClass:null,isSelected:null,headerTitle:null,headerTitles:null,visibleFrom:null,rowClass:null,rowStyle:null},emits:["headerSelected","rowSelected"],setup(t,{emit:d}){const c=t,l=A(),v=A(null),p=en(),m=t=>Object.keys(p).find(e=>e.toLowerCase()==t.toLowerCase()+"-header"),g=t=>Object.keys(p).find(e=>e.toLowerCase()==t.toLowerCase()),n=f(()=>Nl(c.items).filter(e=>!(!p[e]&&!p[e+"-header"]))),{typeOf:e,typeProperties:r}=at(),i=f(()=>Et(c.type)),y=f(()=>e(i.value)),h=f(()=>r(y.value));function b(e){e=c.headerTitles&&ye(c.headerTitles,e)||e;return c.headerTitle?c.headerTitle(e):ts(e)}function x(e){const t=e.toLowerCase();return h.value.find(e=>e.name.toLowerCase()==t)}const C={xs:"xs:table-cell",sm:"sm:table-cell",md:"md:table-cell",lg:"lg:table-cell",xl:"xl:table-cell","2xl":"2xl:table-cell",never:""};function L(e){e=c.visibleFrom&&ye(c.visibleFrom,e);return e&&qe(C[e],e=>"hidden "+e)}const V=f(()=>c.gridClass??ge.getGridClass(c.tableStyle)),M=f(()=>c.grid2Class??ge.getGrid2Class(c.tableStyle)),S=f(()=>c.grid3Class??ge.getGrid3Class(c.tableStyle)),I=f(()=>c.grid4Class??ge.getGrid4Class(c.tableStyle)),$=f(()=>c.tableClass??ge.getTableClass(c.tableStyle)),F=f(()=>c.tbodyClass??ge.getTbodyClass(c.tbodyClass)),B=f(()=>c.theadClass??ge.getTheadClass(c.tableStyle)),j=f(()=>c.theadRowClass??ge.getTheadRowClass(c.tableStyle)),O=f(()=>c.theadCellClass??ge.getTheadCellClass(c.tableStyle));const H=f(()=>{const e=("string"==typeof c.selectedColumns?c.selectedColumns.split(","):c.selectedColumns)||(0(e[t.name.toLowerCase()]=t.format,e),{});return e.filter(e=>{return"hidden"!=(null==(e=t[e.toLowerCase()])?void 0:e.method)})});return(n,e)=>{const r=X("CellFormat"),i=X("PreviewFormat");return t.items.length?(a(),u("div",{key:0,ref_key:"refResults",ref:l,class:w(o(V))},[s("div",{class:w(o(M))},[s("div",{class:w(o(S))},[s("div",{class:w(o(I))},[s("table",{class:w(o($))},[s("thead",{class:w(o(B))},[s("tr",{class:w(o(j))},[(a(!0),u(Te,null,Ie(o(H),t=>{return a(),u("td",{class:w([L(t),o(O),(e=t,v.value===e?"text-gray-900 dark:text-gray-50":"text-gray-500 dark:text-gray-400")])},[s("div",{onClick:e=>{d("headerSelected",t,e)}},[o(p)[t+"-header"]?Z(n.$slots,t+"-header",{key:0,column:t}):m(t)?Z(n.$slots,m(t),{key:1,column:t}):o(p).header?Z(n.$slots,"header",{key:2,column:t,label:b(t)}):(a(),u("div",Xf,[s("span",Yf,T(b(t)),1)]))],8,Jf)],2);var e}),256))],2)],2),s("tbody",{class:w(o(F))},[(a(!0),u(Te,null,Ie(t.items,(t,e)=>{return a(),u("tr",{class:w((l=t,s=e,c.rowClass?c.rowClass(l,s):ge.getTableRowClass(c.tableStyle,s,!(!c.isSelected||!c.isSelected(l)),null!=c.isSelected))),style:Xl((s=t,l=e,c.rowStyle?c.rowStyle(s,l):void 0)),onClick:e=>{d("rowSelected",t,e)}},[(a(!0),u(Te,null,Ie(o(H),e=>{return a(),u("td",{class:w([L(e),o(ge).tableCellClass])},[o(p)[e]?Z(n.$slots,e,jt(Me({key:0},t))):g(e)?Z(n.$slots,g(e),jt(Me({key:1},t))):x(e)?(a(),se(r,{key:2,type:o(y),propType:x(e),modelValue:t},null,8,["type","propType","modelValue"])):(a(),se(i,{key:3,value:o(ye)(t,e),format:null!=(e=x(e=e))&&e.format?e.format:"TimeSpan"==(null==e?void 0:e.type)||"TimeOnly"==(null==e?void 0:e.type)?{method:"time"}:null},null,8,["value","format"]))],2)}),256))],14,e1);var l,s}),256))],2)],2)],2)],2)],2)],2)):k("",!0)}}}),l1=ce({props:{type:Object,propType:Object,modelValue:Object},setup(i,{attrs:u}){const d=at()["typeOf"];return()=>{var e,t;const l=null!=(e=i.propType)&&e.format?e.format:"TimeSpan"==(null==e?void 0:e.type)||"TimeOnly"==(null==e?void 0:e.type)?{method:"time"}:null,a=ye(i.modelValue,i.propType.name),s=Object.assign({},i,u),n=gt("span",{innerHTML:Jt(a,l,s)}),o=Zt(a)&&Array.isArray(a)?gt("span",{},[gt("span",{class:"mr-2"},""+a.length),n]):n,r=null==(e=i.propType)?void 0:e.ref;return r&&(e=et(i.type).find(e=>e.type===r.model))&&(e=(e=ye(i.modelValue,e.name))&&r.refLabel&&ye(e,r.refLabel))?(t=(t=null==(t=d(r.model))?void 0:t.icon)?gt(zs,{image:t,class:"w-5 h-5 mr-1"}):null,gt("span",{class:"flex",title:r.model+" "+a},[t,e])):o}}}),n1={key:0},s1={key:0,class:"mr-2"},o1=["innerHTML"],a1=["innerHTML"],i1={inheritAttrs:!1},r1=ce({...i1,__name:"PreviewFormat",props:{value:null,format:null,includeIcon:{type:Boolean,default:!0},includeCount:{type:Boolean,default:!0},maxFieldLength:{default:150},maxNestedFields:{default:2},maxNestedFieldLength:{default:30}},setup(l){const e=l,n=f(()=>Array.isArray(e.value));return(e,t)=>o(Zt)(l.value)?(a(),u("span",n1,[l.includeCount&&o(n)?(a(),u("span",s1,T(l.value.length),1)):k("",!0),s("span",{innerHTML:o(Jt)(l.value,l.format,e.$attrs)},null,8,o1)])):(a(),u("span",{key:1,innerHTML:o(Jt)(l.value,l.format,e.$attrs)},null,8,a1))}}),u1=["innerHTML"],d1={key:0},c1=s("b",null,null,-1),f1={key:2},m1=ce({__name:"HtmlFormat",props:{value:null,depth:{default:0},fieldAttrs:null,classes:{type:Function,default:(e,t,l,a,s)=>a}},setup(r){const t=r,i=f(()=>_t(t.value)),d=f(()=>Array.isArray(t.value)),c=e=>ts(e),v=e=>t.fieldAttrs?t.fieldAttrs(e):null,p=f(()=>Nl(t.value));return(e,t)=>{const l=X("HtmlFormat",!0);return a(),u("div",{class:w(0==r.depth?"prose html-format":"")},[o(i)?(a(),u("div",{key:0,innerHTML:o(Jt)(r.value)},null,8,u1)):o(d)?(a(),u("div",{key:1,class:w(r.classes("array","div",r.depth,o(ge).gridClass))},[o(_t)(r.value[0])?(a(),u("div",d1,"[ "+T(r.value.join(", "))+" ]",1)):(a(),u("div",{key:1,class:w(r.classes("array","div",r.depth,o(ge).grid2Class))},[s("div",{class:w(r.classes("array","div",r.depth,o(ge).grid3Class))},[s("div",{class:w(r.classes("array","div",r.depth,o(ge).grid4Class))},[s("table",{class:w(r.classes("object","table",r.depth,o(ge).tableClass))},[s("thead",{class:w(r.classes("array","thead",r.depth,o(ge).theadClass))},[s("tr",null,[(a(!0),u(Te,null,Ie(o(p),e=>(a(),u("th",{class:w(r.classes("array","th",r.depth,o(ge).theadCellClass+" whitespace-nowrap"))},[c1,we(T(c(e)),1)],2))),256))])],2),s("tbody",null,[(a(!0),u(Te,null,Ie(r.value,(t,e)=>(a(),u("tr",{class:w(r.classes("array","tr",r.depth,e%2==0?"bg-white":"bg-gray-50",e))},[(a(!0),u(Te,null,Ie(o(p),e=>(a(),u("td",{class:w(r.classes("array","td",r.depth,o(ge).tableCellClass))},[$e(l,Me({value:t[e],"field-attrs":r.fieldAttrs,depth:r.depth+1,classes:r.classes},v(e)),null,16,["value","field-attrs","depth","classes"])],2))),256))],2))),256))])],2)],2)],2)],2))],2)):(a(),u("div",f1,[s("table",{class:w(r.classes("object","table",r.depth,"table-object"))},[(a(!0),u(Te,null,Ie((n=r.value)?Object.keys(n).map(e=>({key:c(e),val:n[e]})):[],e=>(a(),u("tr",{class:w(r.classes("object","tr",r.depth,""))},[s("th",{class:w(r.classes("object","th",r.depth,"align-top py-2 px-4 text-left text-sm font-medium tracking-wider whitespace-nowrap"))},T(e.key),3),s("td",{class:w(r.classes("object","td",r.depth,"align-top py-2 px-4 text-sm"))},[$e(l,Me({value:e.val,"field-attrs":r.fieldAttrs,depth:r.depth+1,classes:r.classes},v(e.key)),null,16,["value","field-attrs","depth","classes"])],2)],2))),256))],2)]))],2);var n}}}),v1={class:"absolute top-0 right-0 pt-4 pr-4"},h1=s("span",{class:"sr-only"},"Close",-1),g1=s("svg",{class:"h-6 w-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1),p1=[h1,g1],y1=ce({__name:"CloseButton",props:{buttonClass:{default:"bg-white dark:bg-black"}},emits:["close"],setup(l,{}){return(t,e)=>(a(),u("div",v1,[s("button",{type:"button",onClick:e[0]||(e[0]=e=>t.$emit("close")),class:w([l.buttonClass,"rounded-md text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black"])},p1,2)]))}}),b1=["id","aria-labelledby"],w1=s("div",{class:"fixed inset-0"},null,-1),x1={class:"fixed inset-0 overflow-hidden"},k1={class:"flex h-full flex-col bg-white dark:bg-black shadow-xl"},$1={class:"flex min-h-0 flex-1 flex-col overflow-auto"},C1={class:"flex-1"},_1={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},L1={class:"flex items-start justify-between space-x-3"},V1={class:"space-y-1"},S1=["id"],M1={key:1,class:"text-sm text-gray-500"},A1={class:"flex h-7 items-center"},T1={class:"flex-shrink-0 border-t border-gray-200 dark:border-gray-700 px-4 py-5 sm:px-6"},F1=ce({__name:"SlideOver",props:{id:{default:"SlideOver"},title:null,contentClass:{default:"relative mt-6 flex-1 px-4 sm:px-6"}},emits:["done"],setup(n,{emit:e}){const t=A(!1),o=A(""),l={entering:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-full",to:"translate-x-0"},leaving:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-0",to:"translate-x-full"}},r=(Lt(t,()=>{Ct(l,o,t.value),t.value||setTimeout(()=>e("done"),700)}),t.value=!0,()=>t.value=!1),i=e=>{"Escape"===e.key&&r()};return tt(()=>window.addEventListener("keydown",i)),Rt(()=>window.removeEventListener("keydown",i)),(e,t)=>{var l=X("CloseButton");return a(),u("div",{id:n.id,class:"relative z-10","aria-labelledby":n.id+"-title",role:"dialog","aria-modal":"true"},[w1,s("div",x1,[s("div",{onMousedown:r,class:"absolute inset-0 overflow-hidden"},[s("div",{onMousedown:t[0]||(t[0]=Ue(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[s("div",{class:w(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",o.value])},[s("div",k1,[s("div",$1,[s("div",C1,[s("div",_1,[s("div",L1,[s("div",V1,[n.title?(a(),u("h2",{key:0,class:"text-lg font-medium text-gray-900 dark:text-gray-50",id:n.id+"-title"},T(n.title),9,S1)):k("",!0),e.$slots.subtitle?(a(),u("p",M1,[Z(e.$slots,"subtitle")])):k("",!0)]),s("div",A1,[$e(l,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:r})])])]),s("div",{class:w(n.contentClass)},[Z(e.$slots,"default")],2)])]),s("div",T1,[Z(e.$slots,"footer")])])],2)],32)],32)])],8,b1)}}}),I1=["id","data-transition-for","aria-labelledby"],D1={class:"fixed inset-0 z-10 overflow-y-auto"},j1={class:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0"},O1=s("span",{class:"sr-only"},"Close",-1),P1=s("svg",{class:"h-6 w-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1),B1=[O1,P1],R1=ce({__name:"ModalDialog",props:{id:{default:"ModalDialog"},modalClass:{default:Jl.modalClass},sizeClass:{default:Jl.sizeClass}},emits:["done"],setup(n,{emit:e}){const t=A(!1),o=A(""),l={entering:{cls:"ease-out duration-300",from:"opacity-0",to:"opacity-100"},leaving:{cls:"ease-in duration-200",from:"opacity-100",to:"opacity-0"}},r=A(""),i={entering:{cls:"ease-out duration-300",from:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",to:"opacity-100 translate-y-0 sm:scale-100"},leaving:{cls:"ease-in duration-200",from:"opacity-100 translate-y-0 sm:scale-100",to:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"}},d=(Lt(t,()=>{Ct(l,o,t.value),Ct(i,r,t.value),t.value||setTimeout(()=>e("done"),200)}),t.value=!0,()=>t.value=!1),c=(Xt("ModalProvider",{openModal:function(e,t){c.value=e,v.value=t}}),A()),v=A();async function f(e){v.value&&v.value(e),c.value=void 0,v.value=void 0}const p=e=>{"Escape"===e.key&&d()};return tt(()=>window.addEventListener("keydown",p)),Rt(()=>window.removeEventListener("keydown",p)),(e,t)=>{var l=X("ModalLookup");return a(),u("div",{id:n.id,"data-transition-for":n.id,onMousedown:d,class:"relative z-10","aria-labelledby":n.id+"-title",role:"dialog","aria-modal":"true"},[s("div",{class:w(["fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity",o.value])},null,2),s("div",D1,[s("div",j1,[s("div",{class:w([n.modalClass,n.sizeClass,r.value]),onMousedown:t[0]||(t[0]=Ue(()=>{},["stop"]))},[s("div",null,[s("div",{class:"hidden sm:block absolute top-0 right-0 pt-4 pr-4 z-10"},[s("button",{type:"button",onClick:d,class:"bg-white dark:bg-black rounded-md text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black"},B1)]),Z(e.$slots,"default")])],34)])]),"ModalLookup"==(null==(t=c.value)?void 0:t.name)&&c.value.ref?(a(),se(l,{key:0,"ref-info":c.value.ref,onDone:f},null,8,["ref-info"])):k("",!0)],40,I1)}}}),E1={class:"pt-2 overflow-auto",style:{"min-height":"620px"}},H1={class:"mt-3 pl-5 flex flex-wrap items-center"},z1={class:"hidden sm:block text-xl leading-6 font-medium text-gray-900 dark:text-gray-50 mr-3"},N1={class:"hidden md:inline"},U1={class:"flex pb-1 sm:pb-0"},q1=["title"],Q1=s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("g",{"stroke-width":"1.5",fill:"none"},[s("path",{d:"M9 3H3.6a.6.6 0 0 0-.6.6v16.8a.6.6 0 0 0 .6.6H9M9 3v18M9 3h6M9 21h6m0-18h5.4a.6.6 0 0 1 .6.6v16.8a.6.6 0 0 1-.6.6H15m0-18v18",stroke:"currentColor"})])],-1),K1=[Q1],Z1=["disabled"],G1=s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6l6 6zM6 6h2v12H6z",fill:"currentColor"})],-1),W1=[G1],J1=["disabled"],X1=s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{d:"M15.41 7.41L14 6l-6 6l6 6l1.41-1.41L10.83 12z",fill:"currentColor"})],-1),Y1=[X1],em=["disabled"],tm=s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{d:"M10 6L8.59 7.41L13.17 12l-4.58 4.59L10 18l6-6z",fill:"currentColor"})],-1),lm=[tm],nm=["disabled"],sm=s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6l-6-6zM16 6h2v12h-2z",fill:"currentColor"})],-1),om=[sm],am={key:0,class:"flex pb-1 sm:pb-0"},im={class:"px-4 text-lg text-black dark:text-white"},rm={key:0},um={key:1},dm=s("span",{class:"hidden xl:inline"}," Showing Results ",-1),cm={key:2},fm={key:1,class:"pl-2"},mm=s("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 24 24"},[s("path",{fill:"currentColor",d:"M6.78 2.72a.75.75 0 0 1 0 1.06L4.56 6h8.69a7.75 7.75 0 1 1-7.75 7.75a.75.75 0 0 1 1.5 0a6.25 6.25 0 1 0 6.25-6.25H4.56l2.22 2.22a.75.75 0 1 1-1.06 1.06l-3.5-3.5a.75.75 0 0 1 0-1.06l3.5-3.5a.75.75 0 0 1 1.06 0Z"})],-1),vm=[mm],hm={class:"flex pb-1 sm:pb-0"},gm={key:0,class:"pl-2"},pm=s("svg",{class:"flex-none w-5 h-5 mr-2 text-gray-400 dark:text-gray-500 group-hover:text-gray-500","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[s("path",{"fill-rule":"evenodd",d:"M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z","clip-rule":"evenodd"})],-1),ym={class:"mr-1"},bm={key:0,class:"h-5 w-5 text-gray-400 dark:text-gray-500 group-hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},wm=s("path",{"fill-rule":"evenodd",d:"M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z","clip-rule":"evenodd"},null,-1),xm=[wm],km={key:1,class:"h-5 w-5 text-gray-400 dark:text-gray-500 group-hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},$m=s("path",{"fill-rule":"evenodd",d:"M5 10a1 1 0 011-1h8a1 1 0 110 2H6a1 1 0 01-1-1z","clip-rule":"evenodd"},null,-1),Cm=[$m],_m={key:1},Lm={key:4},Vm={key:0},Sm={key:0,class:"cursor-pointer flex justify-between items-center hover:text-gray-900 dark:hover:text-gray-50"},Mm={class:"mr-1 select-none"},Am={key:1,class:"flex justify-between items-center"},Tm={class:"mr-1 select-none"},Fm=ce({__name:"ModalLookup",props:{id:{default:"ModalLookup"},refInfo:null,skip:{default:0},prefs:null,selectedColumns:null,allowFiltering:{type:[Boolean,null],default:!0},showPreferences:{type:[Boolean,null],default:!0},showPagingNav:{type:[Boolean,null],default:!0},showPagingInfo:{type:[Boolean,null],default:!0},showResetPreferences:{type:[Boolean,null],default:!0},showFiltersView:{type:[Boolean,null],default:!0},toolbarButtonClass:null,canFilter:null},emits:["done"],setup(c,{emit:l}){const v=c,p=en(),e=St()["config"],{metadataApi:t,filterDefinitions:n}=at(),r=Ne("client"),i=e.value.storage,m=f(()=>v.toolbarButtonClass??ge.toolbarButtonClass),g=f(()=>n.value),y=A({take:25}),h=A(new Je),b=A(v.skip),x=A(!1),C=A(),d=e=>"string"==typeof e?e.split(","):e||[];function L(e,t){return ge.getTableRowClass("fullWidth",t,!1,!0)}const V=f(()=>ot(v.refInfo.model)),M=f(()=>{var e=(0<(e=d(v.selectedColumns)).length?e:[]).map(e=>e.toLowerCase());const l=et(V.value);return 0l.find(e=>e.name.toLowerCase()===t)).filter(e=>null!=e):l}),S=f(()=>{let e=M.value.map(e=>e.name),t=d(y.value.selectedColumns).map(e=>e.toLowerCase());return 0t.includes(e.toLowerCase())):e}),I=f(()=>y.value.take??25),$=f(()=>h.value.response?ye(h.value.response,"results"):[]),F=f(()=>{var e;return(null==(e=h.value.response)?void 0:e.total)??$.value.length??0}),B=f(()=>00$.value.length>=I.value),H=f(()=>$.value.length>=I.value),D=A([]),q=f(()=>D.value.some(e=>0D.value.map(e=>e.settings.filters.length).reduce((e,t)=>e+t,0)),Q=f(()=>el(V.value)),K=f(()=>{var e;return null==(e=t.value)?void 0:e.operations.find(e=>{var t;return(null==(t=e.dataModel)?void 0:t.name)==v.refInfo.model&&ze.isAnyQuery(e)})}),W=A(),z=A(!1),_=A(),R=()=>v.id+"/ApiPrefs/"+v.refInfo.model,N=e=>`Column/${v.id}:${v.refInfo.model}.`+e;async function P(e){b.value+=e,b.value<0&&(b.value=0);e=Math.floor(F.value/I.value)*I.value;b.value>e&&(b.value=e),await U()}async function G(e,t){l("done",e)}function J(){l("done",null)}function Y(t,e){var l,a=e.target;"TD"!==(null==a?void 0:a.tagName)&&(a=null==(a=null==a?void 0:a.closest("TABLE"))?void 0:a.getBoundingClientRect(),l=D.value.find(e=>e.name.toLowerCase()==t.toLowerCase()))&&a&&(e=("DIV"===(null==(a=e.target)?void 0:a.tagName)?e.target:null==(a=e.target)?void 0:a.closest("DIV")).getBoundingClientRect(),_.value={column:l,topLeft:{x:Math.max(Math.floor(e.x+25),343),y:Math.floor(115)}})}function ee(){_.value=null}async function te(e){var t=null==(t=_.value)?void 0:t.column;t&&(t.settings=e,i.setItem(N(t.name),JSON.stringify(t.settings)),await U()),_.value=null}async function le(e){i.setItem(N(e.name),JSON.stringify(e.settings)),await U()}async function ae(e){z.value=!1,y.value=e,i.setItem(R(),JSON.stringify(e)),await U()}async function U(){(async function(a){var s=K.value;if(s){let e=Gt(s,a),t=es(e=>{h.value.response=h.value.error=void 0,x.value=e}),l=await r.api(e);t(),xt(()=>h.value=l);s=ye(l.response,"results")||[];l.succeeded&&s.label}else console.error("No Query API was found for "+v.refInfo.model)})(function(){let a={include:"total",take:I.value},e=d(y.value.selectedColumns||v.selectedColumns);{var t;0{l.settings.sort&&s.push(("DESC"===l.settings.sort?"-":"")+l.name),l.settings.filters.forEach(e=>{var t=e.key.replace("%",l.name);a[t]=e.value})}),"u"{e.settings={filters:[]},i.removeItem(N(e.name))}),await U()}return tt(async()=>{var e=v.prefs||yl(i.getItem(R()));e&&(y.value=e),D.value=M.value.map(e=>({name:e.name,type:e.type,meta:e,settings:Object.assign({filters:[]},yl(i.getItem(N(e.name))))})),isNaN(v.skip)||(b.value=v.skip),await U()}),(l,e)=>{const t=X("ErrorSummary"),n=X("Loading"),r=X("SettingsIcons"),i=X("DataGrid"),d=X("ModalDialog");return a(),u(Te,null,[c.refInfo?(a(),se(d,{key:0,ref_key:"modalDialog",ref:W,id:c.id,onDone:J},{default:ke(()=>[s("div",E1,[s("div",H1,[s("h3",z1,[we(" Select "),s("span",N1,T(o(He)(c.refInfo.model)),1)]),s("div",U1,[c.showPreferences?(a(),u("button",{key:0,type:"button",class:"pl-2 text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400",title:c.refInfo.model+" Preferences",onClick:e[0]||(e[0]=e=>z.value=!z.value)},K1,8,q1)):k("",!0),c.showPagingNav?(a(),u("button",{key:1,type:"button",class:w(["pl-2",o(B)?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"First page",disabled:!o(B),onClick:e[1]||(e[1]=e=>P(-o(F)))},W1,10,Z1)):k("",!0),c.showPagingNav?(a(),u("button",{key:2,type:"button",class:w(["pl-2",o(j)?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Previous page",disabled:!o(j),onClick:e[2]||(e[2]=e=>P(-o(I)))},Y1,10,J1)):k("",!0),c.showPagingNav?(a(),u("button",{key:3,type:"button",class:w(["pl-2",o(O)?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Next page",disabled:!o(O),onClick:e[3]||(e[3]=e=>P(o(I)))},lm,10,em)):k("",!0),c.showPagingNav?(a(),u("button",{key:4,type:"button",class:w(["pl-2",o(H)?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Last page",disabled:!o(H),onClick:e[4]||(e[4]=e=>P(o(F)))},om,10,nm)):k("",!0)]),c.showPagingInfo?(a(),u("div",am,[s("div",im,[x.value?(a(),u("span",rm,"Querying...")):k("",!0),o($).length?(a(),u("span",um,[dm,we(" "+T(b.value+1)+" - "+T(Math.min(b.value+o($).length,o(F)))+" ",1),s("span",null," of "+T(o(F)),1)])):h.value.completed?(a(),u("span",cm,"No Results")):k("",!0)])])):k("",!0),o(q)&&c.showResetPreferences?(a(),u("div",fm,[s("button",{type:"button",onClick:ne,title:"Reset Preferences & Filters",class:w(o(m))},vm,2)])):k("",!0),s("div",hm,[c.showFiltersView&&0C.value="filters"==C.value?null:"filters"),class:w(o(m)),"aria-expanded":"false"},[pm,s("span",ym,T(o(E))+" "+T(1==o(E)?"Filter":"Filters"),1),"filters"!=C.value?(a(),u("svg",bm,xm)):(a(),u("svg",km,Cm))],2)])):k("",!0)])]),"filters"==C.value?(a(),se(Sn,{key:0,class:"border-y border-gray-200 dark:border-gray-800 py-8 my-2",definitions:o(g),columns:D.value,onDone:e[6]||(e[6]=e=>C.value=null),onChange:le},null,8,["definitions","columns"])):k("",!0),_.value?(a(),u("div",_m,[$e(Vn,{definitions:o(g),column:_.value.column,"top-left":_.value.topLeft,onDone:ee,onSave:te},null,8,["definitions","column","top-left"])])):k("",!0),h.value.error?(a(),se(t,{key:2,status:h.value.error},null,8,["status"])):x.value?(a(),se(n,{key:3})):(a(),u("div",Lm,[o($).length?(a(),u("div",Vm,[$e(i,{id:c.id,items:o($),type:c.refInfo.model,"selected-columns":o(S),onFiltersChanged:U,tableStyle:"fullWidth",rowClass:L,onRowSelected:G,onHeaderSelected:Y},tn({header:ke(({column:t,label:e})=>{return[!c.allowFiltering||v.canFilter&&!v.canFilter(t)?(a(),u("div",Am,[s("span",Tm,T(e),1)])):(a(),u("div",Sm,[s("span",Mm,T(e),1),$e(r,{column:D.value.find(e=>e.name.toLowerCase()===t.toLowerCase()),"is-open":(null==(e=_.value)?void 0:e.column.name)===t},null,8,["column","is-open"])]))]}),_:2},[Ie(Object.keys(o(p)),t=>({name:t,fn:ke(e=>[Z(l.$slots,t,jt(gl(e)))])}))]),1032,["id","items","type","selected-columns"])])):k("",!0)]))])]),_:3},8,["id"])):k("",!0),z.value?(a(),se(Mn,{key:1,columns:o(M),prefs:y.value,onDone:e[7]||(e[7]=e=>z.value=!1),onSave:ae},null,8,["columns","prefs"])):k("",!0)],64)}}}),Im={class:"sm:hidden"},Dm=["for"],jm=["id","name"],Om=["value"],Pm={class:"hidden sm:block"},Bm={class:"border-b border-gray-200"},Rm={class:"-mb-px flex","aria-label":"Tabs"},Em=["onClick"],Hm=ce({__name:"Tabs",props:{tabs:null,id:{default:"tabs"},param:{default:"tab"},label:{type:Function,default:e=>He(e)},selected:null,tabClass:null,bodyClass:{default:"p-4"},url:{type:Boolean,default:!0}},setup(l){const t=l,n=f(()=>Object.keys(t.tabs)),r=e=>t.label?t.label(e):He(e),i=f(()=>t.id||"tabs"),d=f(()=>t.param||"tab"),c=A();function v(e){c.value=e,t.url&&nn({tab:e===n.value[0]?void 0:e})}const p=f(()=>100/Object.keys(t.tabs).length+"%");return tt(()=>{var e;c.value=t.selected||Object.keys(t.tabs)[0],t.url&&(e=location.search||(location.hash.includes("?")?"?"+dl(location.hash,"?"):""),e=zl(e)[d.value])&&(c.value=e)}),(e,t)=>(a(),u("div",null,[s("div",Im,[s("label",{for:o(i),class:"sr-only"},"Select a tab",8,Dm),s("select",{id:o(i),name:o(i),class:"block w-full rounded-md border-gray-300 focus:border-indigo-500 focus:ring-indigo-500",onChange:t[0]||(t[0]=e=>{return v(null==(e=e.target)?void 0:e.value)})},[(a(!0),u(Te,null,Ie(o(n),e=>(a(),u("option",{key:e,value:e},T(r(e)),9,Om))),128))],40,jm)]),s("div",Pm,[s("div",Bm,[s("nav",Rm,[(a(!0),u(Te,null,Ie(o(n),t=>{return a(),u("a",{href:"#",onClick:Ue(e=>v(t),["prevent"]),style:Xl({width:o(p)}),class:w([(e=t,c.value===e?"border-indigo-500 text-indigo-600 py-4 px-1 text-center border-b-2 font-medium text-sm":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 py-4 px-1 text-center border-b-2 font-medium text-sm"),l.tabClass])},T(r(t)),15,Em);var e}),256))])])]),s("div",{class:w(l.bodyClass)},[(a(),se(Jn(l.tabs[c.value])))],2)]))}}),zm=s("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4 text-gray-400",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 32 32"},[s("path",{fill:"currentColor",d:"M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3Z"})],-1),Nm=[zm],Um=s("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4 text-indigo-600",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 32 32"},[s("path",{fill:"currentColor",d:"M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6ZM5.394 6.813L6.81 5.399l3.505 3.506L8.9 10.319zM2 15.005h5v2H2zm3.394 10.193L8.9 21.692l1.414 1.414l-3.505 3.506zM15 25.005h2v5h-2zm6.687-1.9l1.414-1.414l3.506 3.506l-1.414 1.414zm3.313-8.1h5v2h-5zm-3.313-6.101l3.506-3.506l1.414 1.414l-3.506 3.506zM15 2.005h2v5h-2z"})],-1),qm=[Um],Qm=ce({__name:"DarkModeToggle",setup(e){const l=typeof document<"u"?document.querySelector("html"):null;let n=A(null==l?void 0:l.classList.contains("dark"));return(e,t)=>(a(),u("button",{type:"button",class:"bg-gray-200 dark:bg-gray-700 relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black",role:"switch","aria-checked":"false",onClick:t[0]||(t[0]=e=>{n.value?null!=l&&l.classList.remove("dark"):null!=l&&l.classList.add("dark"),n.value=!n.value,localStorage.setItem("color-scheme",n.value?"dark":"light")})},[s("span",{class:w(`${o(n)?"translate-x-0":"translate-x-5"} pointer-events-none relative inline-block h-5 w-5 rounded-full bg-white dark:bg-black shadow transform ring-0 transition ease-in-out duration-200`)},[s("span",{class:w(`${o(n)?"opacity-100 ease-in duration-200":"opacity-0 ease-out duration-100"} absolute inset-0 h-full w-full flex items-center justify-center transition-opacity`),"aria-hidden":"true"},Nm,2),s("span",{class:w(`${o(n)?"opacity-0 ease-out duration-100":"opacity-100 ease-in duration-200"} absolute inset-0 h-full w-full flex items-center justify-center transition-opacity`),"aria-hidden":"true"},qm,2)],2)]))}}),Km={key:0},Zm={key:1,class:"min-h-full flex flex-col justify-center py-12 sm:px-6 lg:px-8"},Gm={class:"sm:mx-auto sm:w-full sm:max-w-md"},Wm={class:"mt-6 text-center text-3xl font-extrabold text-gray-900"},Jm={key:0,class:"mt-4 text-center text-sm text-gray-600"},Xm={class:"relative z-0 inline-flex shadow-sm rounded-md"},Ym=["onClick"],ev={class:"mt-8 sm:mx-auto sm:w-full sm:max-w-md"},tv={class:"bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10"},lv=["onSubmit"],nv={class:"mt-8"},sv={key:1,class:"mt-6"},ov=wl('
Or continue with
',1),av={class:"mt-6 grid grid-cols-3 gap-3"},iv=["href","title"],rv={key:1,class:"h-5 w-5 text-gray-700",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},uv=s("path",{d:"M16 8a5 5 0 1 0 5 5a5 5 0 0 0-5-5z",fill:"currentColor"},null,-1),dv=s("path",{d:"M16 2a14 14 0 1 0 14 14A14.016 14.016 0 0 0 16 2zm7.992 22.926A5.002 5.002 0 0 0 19 20h-6a5.002 5.002 0 0 0-4.992 4.926a12 12 0 1 1 15.985 0z",fill:"currentColor"},null,-1),cv=[uv,dv],fv=ce({__name:"SignIn",props:{provider:null,title:{default:"Sign In"},tabs:{type:[Boolean,String],default:!0},oauth:{type:[Boolean,String],default:!0}},emits:["login"],setup(c,{emit:t}){const l=c,{getMetadata:e,createDto:n}=at(),r=Tl(),i=Ne("client"),d=Ln()["signIn"],v=e({assert:!0}),p=v.plugins.auth,m=document.baseURI,g=v.app.baseUrl,y=A(n("Authenticate")),h=A(new Je),b=A(l.provider),x=(tt(()=>{null!=p&&p.authProviders.map(e=>e.formLayout).filter(e=>e).forEach(e=>e.forEach(e=>y.value[e.id]=""))}),f(()=>(null==p?void 0:p.authProviders.filter(e=>e.formLayout))||[])),C=f(()=>x.value[0]||{}),L=f(()=>x.value[Math.max(x.value.length-1,0)]||{}),V=f(()=>(b.value?null==p?void 0:p.authProviders.find(e=>e.name===b.value):null)??C.value),M=e=>!1===e||"false"===e;function S(e){return e.label||e.navItem&&e.navItem.label}const I=f(()=>{var e;return((null==(e=V.value)?void 0:e.formLayout)||[]).map(e=>{var t;return Object.assign({},e,{type:null==(t=e.type)?void 0:t.toLowerCase(),autocomplete:e.autocomplete||("password"===(null==(t=e.type)?void 0:t.toLowerCase())?"current-password":void 0)||("username"===e.id.toLowerCase()?"username":void 0),css:Object.assign({field:"col-span-12"},e.css)})})}),$=f(()=>!M(l.oauth)&&(null==p?void 0:p.authProviders.filter(e=>"oauth"===e.type))||[]),F=f(()=>{let e=Lo(null==p?void 0:p.authProviders.filter(e=>e.formLayout&&0{e[S(t)||st(t.name)]=t.name===C.value.name?"":t.name});var t=V.value;return e=t&&M(l.tabs)?{[S(t)||st(t.name)]:t}:e}),B=f(()=>{var e=I.value.map(e=>e.id).filter(e=>e);return h.value.summaryMessage(e)});async function j(){var e;y.value.provider=V.value.name,"authsecret"===V.value.name?(i.headers.set("authsecret",y.value.authsecret),y.value=n("Authenticate")):"basic"===V.value.name&&(i.setCredentials(y.value.UserName,y.value.Password),y.value=n("Authenticate"),y.value.UserName=null,y.value.Password=null),h.value=await r.api(y.value),h.value.succeeded&&(e=h.value.response,d(e),t("login",e),h.value=new Je,y.value=n("Authenticate"))}return(e,t)=>{const l=X("ErrorSummary"),n=X("AutoFormFields"),r=X("PrimaryButton"),i=X("Icon"),d=ro("href");return o(p)?(a(),u("div",Zm,[s("div",Gm,[s("h2",Wm,T(c.title),1),1kt((a(),u("a",{onClick:e=>b.value=t,class:w([""===t||t===o(C).name?"rounded-l-md":t===o(L).name?"rounded-r-md -ml-px":"-ml-px",b.value===t?"z-10 outline-none ring-1 ring-indigo-500 border-indigo-500":"","cursor-pointer relative inline-flex items-center px-4 py-1 border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50"])},[we(T(e),1)],10,Ym)),[[d,{provider:t}]])),256))])])):k("",!0)]),s("div",ev,[o(B)?(a(),se(l,{key:0,class:"mb-3",errorSummary:o(B)},null,8,["errorSummary"])):k("",!0),s("div",tv,[o(I).length?(a(),u("form",{key:0,onSubmit:Ue(j,["prevent"])},[$e(n,{modelValue:y.value,formLayout:o(I),api:h.value,hideSummary:!0,"divide-class":"","space-class":"space-y-6"},null,8,["modelValue","formLayout","api"]),s("div",nv,[$e(r,{class:"w-full"},{default:ke(()=>[we("Sign In")]),_:1})])],40,lv)):k("",!0),o($).length?(a(),u("div",sv,[ov,s("div",av,[(a(!0),u(Te,null,Ie(o($),e=>(a(),u("div",null,[s("a",{href:o(g)+e.navItem.href+"?continue="+o(m),title:S(e),class:"w-full inline-flex justify-center py-2 px-4 border border-gray-300 rounded-md shadow-sm bg-white text-sm font-medium text-gray-500 hover:bg-gray-50"},[e.icon?(a(),se(i,{key:0,image:e.icon,class:"h-5 w-5 text-gray-700"},null,8,["image"])):(a(),u("svg",rv,cv))],8,iv)]))),256))])])):k("",!0)])])])):(a(),u("div",Km,"No Auth Plugin"))}}}),mv=["for"],vv={key:1,class:"border border-gray-200 flex justify-between"},hv={class:"p-2 flex flex-wrap gap-x-4"},gv=s("title",null,"Bold text (CTRL+B)",-1),pv=s("path",{fill:"currentColor",d:"M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79c0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79c0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3v-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z"},null,-1),yv=[gv,pv],bv=s("title",null,"Italics (CTRL+I)",-1),wv=s("path",{fill:"currentColor",d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4h-8z"},null,-1),xv=[bv,wv],kv=s("title",null,"Insert Link (CTRL+K)",-1),$v=s("path",{fill:"currentColor",d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7a5 5 0 0 0-5 5a5 5 0 0 0 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8v2m9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1c0 1.71-1.39 3.1-3.1 3.1h-4V17h4a5 5 0 0 0 5-5a5 5 0 0 0-5-5Z"},null,-1),Cv=[kv,$v],_v=s("title",null,"Blockquote (CTRL+Q)",-1),Lv=s("path",{fill:"currentColor",d:"m15 17l2-4h-4V6h7v7l-2 4h-3Zm-9 0l2-4H4V6h7v7l-2 4H6Z"},null,-1),Vv=[_v,Lv],Sv=s("title",null,"Insert Image (CTRL+SHIFT+L)",-1),Mv=s("path",{fill:"currentColor",d:"M2.992 21A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993H2.992ZM20 15V5H4v14L14 9l6 6Zm0 2.828l-6-6L6.828 19H20v-1.172ZM8 11a2 2 0 1 1 0-4a2 2 0 0 1 0 4Z"},null,-1),Av=[Sv,Mv],Tv=s("title",null,"Insert Code (CTRL+<)",-1),Fv=s("path",{fill:"currentColor",d:"m8 18l-6-6l6-6l1.425 1.425l-4.6 4.6L9.4 16.6L8 18Zm8 0l-1.425-1.425l4.6-4.6L14.6 7.4L16 6l6 6l-6 6Z"},null,-1),Iv=[Tv,Fv],Dv=s("title",null,"H2 Heading (CTRL+H)",-1),jv=s("path",{fill:"currentColor",d:"M7 20V7H2V4h13v3h-5v13H7Zm9 0v-8h-3V9h9v3h-3v8h-3Z"},null,-1),Ov=[Dv,jv],Pv=s("title",null,"Numbered List (ALT+1)",-1),Bv=s("path",{fill:"currentColor",d:"M3 22v-1.5h2.5v-.75H4v-1.5h1.5v-.75H3V16h3q.425 0 .713.288T7 17v1q0 .425-.288.713T6 19q.425 0 .713.288T7 20v1q0 .425-.288.713T6 22H3Zm0-7v-2.75q0-.425.288-.713T4 11.25h1.5v-.75H3V9h3q.425 0 .713.288T7 10v1.75q0 .425-.288.713T6 12.75H4.5v.75H7V15H3Zm1.5-7V3.5H3V2h3v6H4.5ZM9 19v-2h12v2H9Zm0-6v-2h12v2H9Zm0-6V5h12v2H9Z"},null,-1),Rv=[Pv,Bv],Ev=s("title",null,"Bulleted List (ALT+-)",-1),Hv=s("path",{fill:"currentColor",d:"M9 19v-2h12v2H9Zm0-6v-2h12v2H9Zm0-6V5h12v2H9ZM5 20q-.825 0-1.413-.588T3 18q0-.825.588-1.413T5 16q.825 0 1.413.588T7 18q0 .825-.588 1.413T5 20Zm0-6q-.825 0-1.413-.588T3 12q0-.825.588-1.413T5 10q.825 0 1.413.588T7 12q0 .825-.588 1.413T5 14Zm0-6q-.825 0-1.413-.588T3 6q0-.825.588-1.413T5 4q.825 0 1.413.588T7 6q0 .825-.588 1.413T5 8Z"},null,-1),zv=[Ev,Hv],Nv=s("title",null,"Strike Through (ALT+S)",-1),Uv=s("path",{fill:"currentColor",d:"M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z"},null,-1),qv=[Nv,Uv],Qv=s("title",null,"Undo (CTRL+Z)",-1),Kv=s("path",{fill:"currentColor",d:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88c3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"},null,-1),Zv=[Qv,Kv],Gv=s("title",null,"Redo (CTRL+SHIFT+Z)",-1),Wv=s("path",{fill:"currentColor",d:"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 0 1 7.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"},null,-1),Jv=[Gv,Wv],Xv={key:0,class:"p-2 flex flex-wrap gap-x-4"},Yv=["href"],eh=s("path",{fill:"currentColor",d:"M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8s8 3.59 8 8s-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5c0-2.21-1.79-4-4-4z"},null,-1),th=[eh],lh={class:""},nh=["name","id","label","value","rows","disabled","onKeydown"],sh=["id"],oh=["id"],ah=ce({__name:"MarkdownInput",props:{status:null,id:null,inputClass:null,label:null,labelClass:null,help:null,placeholder:null,modelValue:null,counter:{type:Boolean},rows:null,errorMessages:null,lang:null,autoFocus:{type:Boolean},disabled:{type:Boolean},helpUrl:{default:"https://guides.github.com/features/mastering-markdown/"},hide:null},emits:["update:modelValue","close"],setup(n,{expose:e,emit:l}){const r=n;let g=[],y=[],t=Ne("ApiState",void 0);const i=f(()=>mt.call({responseStatus:r.status??(null==t?void 0:t.error.value)},r.id)),d=f(()=>r.label??He(st(r.id))),c="bold,italics,link,image,blockquote,code,heading,orderedList,unorderedList,strikethrough,undo,redo,help".split(","),v=f(()=>r.hide?wt(c,r.hide):wt(c,[]));function p(e){return v.value[e]}const m=f(()=>["shadow-sm font-mono"+nt.base.replace("rounded-md",""),i.value?"text-red-900 focus:ring-red-500 focus:border-red-500 border-red-300":"text-gray-900 "+nt.valid,r.inputClass]),h="w-5 h-5 cursor-pointer select-none text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400",b=A();function x(e){l("update:modelValue",e)}function C(){return b.value.selectionStart!==b.value.selectionEnd}function L(){var e=b.value;return e.value.substring(e.selectionStart,e.selectionEnd)||""}function V(){var e=b.value,t=e.value,l=e.selectionStart,e=t.substring(l,e.selectionEnd)||"",a=t.substring(0,l),s=a.lastIndexOf(` +`,"\t"];function V(t){var l=null==(t=t.clipboardData)?void 0:t.getData("Text");if(l){t=L.some(e=>l.includes(e));if(r.multiple&&t){if(t){t=new RegExp("\\r|\\n|\\t|,"),t=l.split(t).filter(e=>e.trim()).map(t=>r.options.find(e=>r.match(e,t))).filter(e=>!!e);if(0{d(t)?e=e.filter(e=>e!=t):e.push(t)}),n("update:modelValue",e),cl()}}}else{t=r.options.filter(e=>r.match(e,l));1==t.length&&(O(t[0]),i.value=!1,cl())}}}function M(e){C.indexOf(e.code)||j()}function S(e){var t;e.shiftKey||e.ctrlKey||e.altKey||(i.value?"Escape"==e.code?i.value&&(e.stopPropagation(),i.value=!1):"Tab"==e.code?i.value=!1:"Home"==e.code?(y.value=b.value[0],$()):"End"==e.code?(y.value=b.value[b.value.length-1],$()):"ArrowDown"==e.code?(y.value?(t=b.value.indexOf(y.value),y.value=t+1{var e=pl(`#${r.id}-autocomplete li.active`);e&&e.scrollIntoView(I)},0)}function F(){setTimeout(()=>{var e=pl(`#${r.id}-autocomplete li.active`);e&&("scrollIntoViewIfNeeded"in e?e.scrollIntoViewIfNeeded(I):e.scrollIntoView(I))},0)}function B(e){(i.value=e)&&(j(),null!=(e=m.value))&&e.focus()}function j(){i.value=!0,H()}function O(t){if(g.value="",i.value=!1,r.multiple){let e=Array.from(r.modelValue||[]);d(t)?e=e.filter(e=>e!=t):e.push(t),y.value=null,n("update:modelValue",e)}else{let e=t;r.modelValue==t&&(e=null),n("update:modelValue",e)}}function H(){b.value=x.value}return Lt(g,H),(e,t)=>(a(),u("div",{id:l.id+"-autocomplete"},[o(c)?(a(),u("label",{key:0,for:l.id+"-text",class:"block text-sm font-medium text-gray-700 dark:text-gray-300"},T(o(c)),9,Uc)):k("",!0),s("div",qc,[kt(s("input",Me({ref_key:"txtInput",ref:m,id:l.id+"-text",type:"text",role:"combobox","aria-controls":"options","aria-expanded":"false",autocomplete:"off",spellcheck:"false","onUpdate:modelValue":t[0]||(t[0]=e=>g.value=e),class:o(p),placeholder:l.multiple||!l.modelValue?l.placeholder:"",onFocus:j,onKeydown:S,onKeyup:M,onClick:j,onPaste:V,required:!1},e.$attrs),null,16,Qc),[[io,g.value]]),s("button",{type:"button",onClick:t[1]||(t[1]=e=>B(!i.value)),class:"absolute inset-y-0 right-0 flex items-center rounded-r-md px-2 focus:outline-none",tabindex:"-1"},Zc),i.value?(a(),u("ul",{key:0,class:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white dark:bg-black py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm",onKeydown:S,id:l.id+"-options",role:"listbox"},[(a(!0),u(Te,null,Ie(b.value,l=>(a(),u("li",{class:w([l===y.value?"active bg-indigo-600 text-white":"text-gray-900 dark:text-gray-100","relative cursor-default select-none py-2 pl-3 pr-9"]),onMouseover:e=>{return t=l,y.value=t,void(b.value.indexOf(t)>Math.floor(.9*h.value)&&(h.value+=r.viewCount,H()));var t},onClick:e=>O(l),role:"option",tabindex:"-1"},[Z(e.$slots,"item",jt(gl(l))),d(l)?(a(),u("span",{key:0,class:w(["absolute inset-y-0 right-0 flex items-center pr-4",l===y.value?"text-white":"text-indigo-600"])},Xc,2)):k("",!0)],42,Wc))),256))],40,Gc)):!l.multiple&&l.modelValue?(a(),u("div",{key:1,onKeydown:S,onClick:t[2]||(t[2]=e=>B(!i.value)),class:"h-8 -mt-8 ml-3 pt-0.5"},[Z(e.$slots,"item",jt(gl(l.modelValue)))],32)):k("",!0),o(v)?(a(),u("div",Yc,t0)):k("",!0)]),o(v)?(a(),u("p",{key:1,class:"mt-2 text-sm text-red-500",id:l.id+"-error"},T(o(v)),9,l0)):l.help?(a(),u("p",{key:2,class:"mt-2 text-sm text-gray-500",id:l.id+"-description"},T(l.help),9,n0)):k("",!0)],8,Nc))}}),o0=["id","name","value"],a0={class:"block truncate"},i0=ce({__name:"Combobox",props:{id:null,modelValue:null,multiple:{type:Boolean},options:null,values:null,entries:null},emits:["update:modelValue"],setup(n,{expose:e,emit:t}){const l=n;function r(e){t("update:modelValue",e)}e({toggle(e){var t;null!=(t=d.value)&&t.toggle(e)}});const i=f(()=>null!=l.multiple?l.multiple:Array.isArray(l.modelValue)),d=A();function c(e,t){return!t||e.value.toLowerCase().includes(t.toLowerCase())}const v=f(()=>l.entries||(l.values?l.values.map(e=>({key:e,value:e})):l.options?Object.keys(l.options).map(e=>({key:e,value:l.options[e]})):[])),p=A(i.value?[]:null);tt(function(){let t=l.modelValue&&"object"==typeof l.modelValue?l.modelValue.key:l.modelValue;null==t||""===t?p.value=i.value?[]:null:"string"==typeof t?p.value=v.value.find(e=>e.key===t)||null:Array.isArray(t)&&(p.value=v.value.filter(e=>t.includes(e.key)))});const m=f(()=>null==p.value?"":Array.isArray(p.value)?p.value.map(e=>encodeURIComponent(e.key)).join(","):p.value.key);return(e,t)=>{var l=X("Autocomplete");return a(),u(Te,null,[s("input",{type:"hidden",id:n.id,name:n.id,value:o(m)},null,8,o0),$e(l,Me({ref_key:"input",ref:d,id:n.id,options:o(v),match:c,multiple:o(i)},e.$attrs,{modelValue:p.value,"onUpdate:modelValue":[t[0]||(t[0]=e=>p.value=e),r]}),{item:ke(({value:e})=>[s("span",a0,T(e),1)]),_:1},16,["id","options","multiple","modelValue"])],64)}}}),r0=ce({__name:"DynamicInput",props:{input:null,modelValue:null,api:null},emits:["update:modelValue"],setup(p,{emit:e}){const l=p,m=f(()=>l.input.type||"text"),t="ignore,css,options,meta,allowableValues,allowableEntries,op,prop,type,id,name".split(","),g=f(()=>dt(l.input,t)),y=A(qe(l.modelValue[l.input.id],e=>"file"===l.input.type?null:"date"===l.input.type&&e instanceof Date?$l(e):"time"===l.input.type?ls(e):e)),h=(Lt(y,()=>{l.modelValue[l.input.id]=y.value,e("update:modelValue",l.modelValue)}),f(()=>{var e=l.modelValue[l.input.id];if("file"!==l.input.type||!e)return[];if("string"==typeof e)return[{filePath:e,fileName:$t(e,"/")}];if(!Array.isArray(e)&&"object"==typeof e)return e;if(Array.isArray(e)){const t=[];return e.forEach(e=>{"string"==typeof e?t.push({filePath:e,fileName:$t(e,"/")}):"object"==typeof e&&t.push(e)}),t}}));return(e,t)=>{var l,s=X("SelectInput"),n=X("CheckboxInput"),r=X("TagInput"),i=X("Combobox"),u=X("FileInput"),d=X("TextareaInput"),c=X("MarkdownInput"),v=X("TextInput");return o(ne).component(o(m))?(a(),se(Jn(o(ne).component(o(m))),Me({key:0,id:p.input.id,modelValue:y.value,"onUpdate:modelValue":t[0]||(t[0]=e=>y.value=e),status:null==(l=p.api)?void 0:l.error,"input-class":null==(l=p.input.css)?void 0:l.input,"label-class":null==(l=p.input.css)?void 0:l.label},o(g)),null,16,["id","modelValue","status","input-class","label-class"])):"select"==o(m)?(a(),se(s,Me({key:1,id:p.input.id,modelValue:y.value,"onUpdate:modelValue":t[1]||(t[1]=e=>y.value=e),status:null==(l=p.api)?void 0:l.error,"input-class":null==(s=p.input.css)?void 0:s.input,"label-class":null==(l=p.input.css)?void 0:l.label,entries:p.input.allowableEntries,values:p.input.allowableValues},o(g)),null,16,["id","modelValue","status","input-class","label-class","entries","values"])):"checkbox"==o(m)?(a(),se(n,Me({key:2,id:p.input.id,modelValue:y.value,"onUpdate:modelValue":t[2]||(t[2]=e=>y.value=e),status:null==(s=p.api)?void 0:s.error,"input-class":null==(l=p.input.css)?void 0:l.input,"label-class":null==(n=p.input.css)?void 0:n.label},o(g)),null,16,["id","modelValue","status","input-class","label-class"])):"tag"==o(m)?(a(),se(r,Me({key:3,id:p.input.id,modelValue:y.value,"onUpdate:modelValue":t[3]||(t[3]=e=>y.value=e),status:null==(s=p.api)?void 0:s.error,"input-class":null==(l=p.input.css)?void 0:l.input,"label-class":null==(n=p.input.css)?void 0:n.label,allowableValues:p.input.allowableValues,string:"String"==(null==(r=p.input.prop)?void 0:r.type)},o(g)),null,16,["id","modelValue","status","input-class","label-class","allowableValues","string"])):"combobox"==o(m)?(a(),se(i,Me({key:4,id:p.input.id,modelValue:y.value,"onUpdate:modelValue":t[4]||(t[4]=e=>y.value=e),status:null==(s=p.api)?void 0:s.error,"input-class":null==(l=p.input.css)?void 0:l.input,"label-class":null==(n=p.input.css)?void 0:n.label,entries:p.input.allowableEntries,values:p.input.allowableValues},o(g)),null,16,["id","modelValue","status","input-class","label-class","entries","values"])):"file"==o(m)?(a(),se(u,Me({key:5,id:p.input.id,status:null==(r=p.api)?void 0:r.error,modelValue:y.value,"onUpdate:modelValue":t[5]||(t[5]=e=>y.value=e),"input-class":null==(i=p.input.css)?void 0:i.input,"label-class":null==(s=p.input.css)?void 0:s.label,files:o(h)},o(g)),null,16,["id","status","modelValue","input-class","label-class","files"])):"textarea"==o(m)?(a(),se(d,Me({key:6,id:p.input.id,modelValue:y.value,"onUpdate:modelValue":t[6]||(t[6]=e=>y.value=e),status:null==(l=p.api)?void 0:l.error,"input-class":null==(n=p.input.css)?void 0:n.input,"label-class":null==(u=p.input.css)?void 0:u.label},o(g)),null,16,["id","modelValue","status","input-class","label-class"])):"MarkdownInput"==o(m)?(a(),se(c,Me({key:7,id:p.input.id,modelValue:y.value,"onUpdate:modelValue":t[7]||(t[7]=e=>y.value=e),status:null==(r=p.api)?void 0:r.error,"input-class":null==(i=p.input.css)?void 0:i.input,"label-class":null==(s=p.input.css)?void 0:s.label},o(g)),null,16,["id","modelValue","status","input-class","label-class"])):(a(),se(v,Me({key:8,type:o(m),id:p.input.id,modelValue:y.value,"onUpdate:modelValue":t[8]||(t[8]=e=>y.value=e),status:null==(d=p.api)?void 0:d.error,"input-class":null==(l=p.input.css)?void 0:l.input,"label-class":null==(n=p.input.css)?void 0:n.label},o(g)),null,16,["type","id","modelValue","status","input-class","label-class"]))}}}),u0={class:"lookup-field"},d0=["name","value"],c0={key:0,class:"flex justify-between"},f0=["for"],m0={key:0,class:"flex items-center"},v0={class:"text-sm text-gray-500 dark:text-gray-400 pr-1"},h0=s("span",{class:"sr-only"},"Clear",-1),g0=s("svg",{class:"h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1),p0=[h0,g0],y0={key:1,class:"mt-1 relative"},b0={class:"w-full inline-flex truncate"},w0={class:"text-blue-700 dark:text-blue-300 flex cursor-pointer"},x0=s("span",{class:"absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none"},[s("svg",{class:"h-5 w-5 text-gray-400 dark:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[s("path",{"fill-rule":"evenodd",d:"M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z","clip-rule":"evenodd"})])],-1),k0=["id"],$0=["id"],C0=ce({__name:"LookupInput",props:{id:null,status:null,input:null,metadataType:null,modelValue:null,label:null,labelClass:null,help:null},emits:["update:modelValue"],setup(r,{emit:i}){const d=r,t=St()["config"],n=at()["metadataApi"],c=f(()=>d.id||d.input.id),v=f(()=>d.label??He(st(c.value)));let e=Ne("ApiState",void 0);const p=Ne("client"),m=f(()=>mt.call({responseStatus:d.status??(null==e?void 0:e.error.value)},c.value)),g=A(""),y=A(""),h=f(()=>ye(d.modelValue,c.value)),b=f(()=>et(d.metadataType).find(e=>e.name.toLowerCase()==c.value.toLowerCase())),x=f(()=>{var e;return(null==(e=ot(null==(e=null==(e=b.value)?void 0:e.ref)?void 0:e.model))?void 0:e.icon)||t.value.tableIcon});let C;function L(){d.modelValue[c.value]=null,g.value=""}return tt(async()=>{C=Ne("ModalProvider",void 0);var t,l=d.modelValue;d.modelValue[c.value]||(d.modelValue[c.value]=null);const a=b.value,s=null==a?void 0:a.ref;if(s){g.value="";let e=null==s.selfId?ye(l,a.name):ye(l,s.selfId);null==(e=Zt(e)?ye(l,s.refId):e)||null==(null==(t=n.value)?void 0:t.operations.find(e=>{return(null==(e=e.dataModel)?void 0:e.name)==s.model}))||Zt(t=ye(l,a.name))||(g.value=""+t,y.value=a.name,null!=s.refLabel&&(null==(t=et(d.metadataType).find(e=>e.type==s.model))&&console.warn(`Could not find ${s.model} Property on `+d.metadataType.name),null!=(l=null!=t?ye(l,t.name):null)?(t=ye(l,s.refLabel))&&(g.value=""+t,Ft.setValue(s.model,e,s.refLabel,t)):(t=1==(null==(l=a.attributes)?void 0:l.some(e=>"Computed"==e.name)),l=await Ft.getOrFetchValue(p,n.value,s.model,s.refId,s.refLabel,t,e),g.value=l||s.model+": "+g.value)))}else console.warn(`No RefInfo for property '${c.value}'`)}),(e,t)=>{var l,n=X("Icon");return a(),u("div",u0,[s("input",{type:"hidden",name:o(c),value:o(h)},null,8,d0),o(v)?(a(),u("div",c0,[s("label",{for:o(c),class:w("block text-sm font-medium text-gray-700 dark:text-gray-300 "+(r.labelClass??""))},T(o(v)),11,f0),o(h)?(a(),u("div",m0,[s("span",v0,T(o(h)),1),s("button",{onClick:L,type:"button",title:"clear",class:"mr-1 rounded-md text-gray-400 dark:text-gray-500 hover:text-gray-500 dark:hover:text-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 dark:ring-offset-black"},p0)])):k("",!0)])):k("",!0),null!=(l=o(b))&&l.ref?(a(),u("div",y0,[s("button",{type:"button",class:"lookup flex relative w-full bg-white dark:bg-black border border-gray-300 dark:border-gray-700 rounded-md shadow-sm pl-3 pr-10 py-2 text-left focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm",onClick:t[0]||(t[0]=e=>{var l;(l=o(b).ref)&&(null==C?console.warn("No ModalProvider required by LookupInput"):C.openModal({name:"ModalLookup",ref:l},e=>{var t;console.debug("openModal",g.value," -> ",e,Ft.setRefValue(l,e),l),e&&(t=ye(e,l.refId),g.value=Ft.setRefValue(l,e)||t,(e=o(d.modelValue))[c.value]=t,i("update:modelValue",e))}))}),"aria-haspopup":"listbox","aria-expanded":"true","aria-labelledby":"listbox-label"},[s("span",b0,[s("span",w0,[$e(n,{class:"mr-1 w-5 h-5",image:o(x)},null,8,["image"]),s("span",null,T(g.value),1)])]),x0])])):k("",!0),o(m)?(a(),u("p",{key:2,class:"mt-2 text-sm text-red-500",id:o(c)+"-error"},T(o(m)),9,k0)):r.help?(a(),u("p",{key:3,class:"mt-2 text-sm text-gray-500",id:o(c)+"-description"},T(r.help),9,$0)):k("",!0)])}}}),_0=ce({__name:"AutoFormFields",props:{modelValue:null,type:null,api:null,formLayout:null,configureField:null,configureFormLayout:null,hideSummary:{type:Boolean},flexClass:{default:"flex flex-1 flex-col justify-between"},divideClass:{default:"divide-y divide-gray-200 px-4 sm:px-6"},spaceClass:{default:"space-y-6 pt-6 pb-5"},fieldsetClass:{default:"grid grid-cols-12 gap-6"}},emits:["update:modelValue"],setup(d,{expose:e,emit:l}){const r=d;function n(){var e=Be();null!=(e=null==e?void 0:e.proxy)&&e.$forceUpdate()}function c(e,t){r.modelValue[e]=t,l("update:modelValue",r.modelValue),n()}e({forceUpdate:n,props:r,updateValue:c});const{metadataApi:t,apiOf:i,typeOf:v,typeOfRef:p,createFormLayout:m}=at(),g=f(()=>r.type||Et(r.modelValue)),y=f(()=>v(g.value)),h=f(()=>{var e;return p(null==(e=null==(e=t.value)?void 0:e.operations.find(e=>e.request.name==g.value))?void 0:e.dataModel)||y.value}),b=f(()=>{var e,t=y.value;if(!t){if(r.formLayout)return e=r.formLayout.map(e=>{var t={name:e.id,type:ba(e.type)},t=Object.assign({prop:t},e);return r.configureField&&r.configureField(t),t}),r.configureFormLayout&&r.configureFormLayout(e),e;throw new Error(`MetadataType for ${g.value} not found`)}const a=et(t),s=h.value,l=r.formLayout||m(t),n=[],o=i(t.name);return l.forEach(t=>{var e,l=a.find(e=>e.name==t.name);t.ignore||(e=(null==(e=null==s?void 0:s.properties)?void 0:e.find(e=>{return e.name.toLowerCase()==(null==(e=t.name)?void 0:e.toLowerCase())}))??l,l=Object.assign({prop:e,op:o},t),r.configureField&&r.configureField(l),n.push(l))}),r.configureFormLayout&&r.configureFormLayout(n),n}),x=f(()=>b.value.filter(e=>"hidden"!=e.type).map(e=>e.id));return(l,n)=>{var e;const t=X("ErrorSummary"),r=X("LookupInput"),i=X("DynamicInput");return a(),u(Te,null,[d.hideSummary?k("",!0):(a(),se(t,{key:0,status:null==(e=d.api)?void 0:e.error,except:o(x)},null,8,["status","except"])),s("div",{class:w(d.flexClass)},[s("div",{class:w(d.divideClass)},[s("div",{class:w(d.spaceClass)},[s("fieldset",{class:w(d.fieldsetClass)},[(a(!0),u(Te,null,Ie(o(b),t=>{var e;return a(),u("div",{key:t.id,class:w(["w-full",(null==(e=t.css)?void 0:e.field)??("textarea"==t.type?"col-span-12":"col-span-12 xl:col-span-6"+("checkbox"==t.type?" flex items-center":"")),"hidden"==t.type?"hidden":""])},[null==(null==(e=t.prop)?void 0:e.ref)||"file"==t.type||t.prop.isPrimaryKey?(a(),se(i,{key:1,input:t,modelValue:d.modelValue,"onUpdate:modelValue":n[0]||(n[0]=e=>l.$emit("update:modelValue",e)),api:d.api},null,8,["input","modelValue","api"])):(a(),se(r,{key:0,metadataType:o(h),input:t,modelValue:d.modelValue,"onUpdate:modelValue":e=>{c(t.id,ye(e,t.id))},status:null==(e=d.api)?void 0:e.error},null,8,["metadataType","input","modelValue","onUpdate:modelValue","status"]))],2)}),128))],2)],2)],2)],2)],64)}}});function Tl(){const s=A(!1),n=A(),o=A(),r=Ne("client");function i({message:e,errorCode:t,fieldName:l,errors:a}){return t=t||"Exception",a=a||[],n.value=new Bl(l?{errorCode:t,message:e,errors:[new Un({fieldName:l,errorCode:t,message:e})]}:{errorCode:t,message:e,errors:a})}var e={setError:i,addFieldError:function({fieldName:t,message:e,errorCode:l}){var a;l=l||"Exception",n.value?((a=new Bl(n.value)).errors=[...(a.errors||[]).filter(e=>{return(null==(e=e.fieldName)?void 0:e.toLowerCase())!==(null==t?void 0:t.toLowerCase())}),new Un({fieldName:t,message:e,errorCode:l})],n.value=a):i({fieldName:t,message:e,errorCode:l})},loading:s,error:n,api:async function(e,t,l){return s.value=!0,e=await r.api(Tt(e),t,l),s.value=!1,o.value=e.response,n.value=e.error,e},apiVoid:async function(e,t,l){return s.value=!0,e=await r.apiVoid(Tt(e),t,l),s.value=!1,o.value=e.response,n.value=e.error,e},apiForm:async function(e,t,l,a){return s.value=!0,e=await r.apiForm(Tt(e),t,l,a),s.value=!1,o.value=e.response,n.value=e.error,e},apiFormVoid:async function(e,t,l,a){return s.value=!0,e=await r.apiFormVoid(Tt(e),t,l,a),s.value=!1,o.value=e.response,n.value=e.error,e},swr:async function(e,t,l,a){return os(r,e,t,l,a)},swrEffect:function(l,a){const s=A(new Je),n=as(async e=>{s.value=await r.api(e)},null==a?void 0:a.delayMs);return hl(async()=>{var e=l(),t=on(_l(e));t&&(s.value=new Je({response:t})),0===(null==a?void 0:a.delayMs)?s.value=await r.api(e):n(e)}),(async()=>s.value=await r.api(l(),null==a?void 0:a.args,null==a?void 0:a.method))(),s},unRefs:Tt,setRef:ns};return Xt("ApiState",e),e}const L0={key:0},V0={class:"text-red-700"},S0=s("b",null,"type",-1),M0={key:0},A0={key:2},T0=["innerHTML"],F0=s("input",{type:"submit",class:"hidden"},null,-1),I0={class:"flex justify-end"},D0=s("div",null,null,-1),j0={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},O0=s("div",{class:"fixed inset-0"},null,-1),P0={class:"fixed inset-0 overflow-hidden"},B0={class:"flex min-h-0 flex-1 flex-col overflow-auto"},R0={class:"flex-1"},E0={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},H0={class:"flex items-start justify-between space-x-3"},z0={class:"space-y-1"},N0={key:0},U0={key:2},q0=["innerHTML"],Q0={class:"flex h-7 items-center"},K0={class:"flex justify-end"},Z0=ce({__name:"AutoForm",props:{type:null,modelValue:null,heading:null,subHeading:null,showLoading:{type:Boolean,default:!0},jsconfig:{default:"eccn,edv"},formStyle:{default:"card"},configureField:null,configureFormLayout:null,panelClass:null,bodyClass:null,formClass:null,innerFormClass:null,headerClass:{default:"p-6"},buttonsClass:null,headingClass:null,subHeadingClass:null,submitLabel:{default:"Submit"},allowSubmit:null},emits:["success","error","update:modelValue","done"],setup(p,{expose:e,emit:r}){const i=p,m=A(),g=A(1),y=A();function t(){g.value++,B.value=F();var e=Be();null!=(e=null==e?void 0:e.proxy)&&e.$forceUpdate()}e({forceUpdate:t,props:i,setModel:async function(e){Object.assign(B.value,e),t(),await xt(()=>null)},formFields:m,submit:async function(){D(y.value)},close:P}),Xt("ModalProvider",{openModal:function(e,t){h.value=e,l.value=t}});const h=A(),l=A();async function b(e){l.value&&l.value(e),h.value=void 0,l.value=void 0}const d=Tl(),n=is()["getTypeName"],{typeOf:c,createDto:v}=at(),x=A(new Je),C=f(()=>i.panelClass||Ze.panelClass(i.formStyle)),L=f(()=>i.formClass||"card"==i.formStyle?"shadow sm:rounded-md":It.formClass),V=f(()=>i.headingClass||Ze.headingClass(i.formStyle)),M=f(()=>i.subHeadingClass||Ze.subHeadingClass(i.formStyle)),S=f(()=>("string"==typeof i.buttonsClass?i:Ze).buttonsClass),I=f(()=>{var e;return i.type?n(i.type):null!=(e=i.modelValue)&&e.getTypeName?i.modelValue.getTypeName():null}),$=f(()=>c(I.value)),F=()=>i.modelValue||H(),B=A(F()),j=f(()=>d.loading.value),O=f(()=>{var e;return i.heading||(null==(e=c(I.value))?void 0:e.description)||He(I.value)});function H(){return"string"==typeof i.type?v(i.type):i.type?new i.type:i.modelValue}async function D(e){var t,l,a,s,n;e&&"FORM"==e.tagName?(t=H(),n=qe(null==t?void 0:t.getMethod,e=>"function"==typeof e?e():null)||"POST",l=null==qe(null==t?void 0:t.createResponse,e=>"function"==typeof e?e():null),a=i.jsconfig,ln.hasRequestBody(n)?(n=new t.constructor,s=new FormData(e),console.debug("AutoForm.submitForm",n,s),x.value=l?await d.apiFormVoid(n,s,{jsconfig:a}):await d.apiForm(n,s,{jsconfig:a})):(n=new t.constructor(_o(B.value)),console.debug("AutoForm.submit",n),x.value=l?await d.apiVoid(n,{jsconfig:a}):await d.api(n,{jsconfig:a})),x.value.succeeded?(r("success",x.value.response),P()):r("error",x.value.error)):console.error("Not a valid form",e)}function E(e){r("update:modelValue",e)}function z(){r("done")}const _=A(!1),R=A(""),N={entering:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-full",to:"translate-x-0"},leaving:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-0",to:"translate-x-full"}};function P(){"slideOver"==i.formStyle?_.value=!1:z()}Lt(_,()=>{Ct(N,R,_.value),_.value||setTimeout(z,700)}),_.value=!0;const U=e=>{"Escape"===e.key&&P()};return tt(()=>window.addEventListener("keydown",U)),Rt(()=>window.removeEventListener("keydown",U)),(t,e)=>{var l;const n=X("AutoFormFields"),r=X("FormLoading"),i=X("PrimaryButton"),d=X("CloseButton"),c=X("SecondaryButton"),v=X("ModalLookup");return a(),u("div",null,[o($)?"card"==p.formStyle?(a(),u("div",{key:1,class:w(o(C))},[s("form",{ref_key:"elForm",ref:y,onSubmit:e[0]||(e[0]=Ue(e=>D(e.target),["prevent"])),autocomplete:"off",class:w(p.innerFormClass)},[s("div",{class:w(p.bodyClass)},[s("div",{class:w(p.headerClass)},[t.$slots.heading?(a(),u("div",M0,[Z(t.$slots,"heading")])):(a(),u("h3",{key:1,class:w(o(V))},T(o(O)),3)),t.$slots.subheading?(a(),u("div",A0,[Z(t.$slots,"subheading")])):p.subHeading?(a(),u("p",{key:3,class:w(o(M))},T(p.subHeading),3)):null!=(l=o($))&&l.notes?(a(),u("p",{key:4,class:w(["notes",o(M)]),innerHTML:null==(l=o($))?void 0:l.notes},null,10,T0)):k("",!0)],2),Z(t.$slots,"header",{instance:null==(l=Be())?void 0:l.exposed,model:B.value}),F0,(a(),se(n,{ref_key:"formFields",ref:m,key:g.value,type:p.type,modelValue:B.value,"onUpdate:modelValue":E,api:x.value,configureField:p.configureField,configureFormLayout:p.configureFormLayout},null,8,["type","modelValue","api","configureField","configureFormLayout"])),Z(t.$slots,"footer",{instance:null==(l=Be())?void 0:l.exposed,model:B.value})],2),Z(t.$slots,"buttons",{},()=>{var e;return[s("div",{class:w(o(S))},[s("div",null,[Z(t.$slots,"leftbuttons",{instance:null==(e=Be())?void 0:e.exposed,model:B.value})]),s("div",null,[p.showLoading&&o(j)?(a(),se(r,{key:0})):k("",!0)]),s("div",I0,[D0,$e(i,{disabled:!!p.allowSubmit&&!p.allowSubmit(B.value)},{default:ke(()=>[we(T(p.submitLabel),1)]),_:1},8,["disabled"]),Z(t.$slots,"rightbuttons",{instance:null==(e=Be())?void 0:e.exposed,model:B.value})])],2)]})],34)],2)):(a(),u("div",j0,[O0,s("div",P0,[s("div",{onMousedown:P,class:"absolute inset-0 overflow-hidden"},[s("div",{onMousedown:e[2]||(e[2]=Ue(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[s("div",{class:w(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",R.value])},[s("form",{ref_key:"elForm",ref:y,class:w(o(L)),onSubmit:e[1]||(e[1]=Ue(e=>D(e.target),["prevent"]))},[s("div",B0,[s("div",R0,[s("div",E0,[s("div",H0,[s("div",z0,[t.$slots.heading?(a(),u("div",N0,[Z(t.$slots,"heading")])):(a(),u("h3",{key:1,class:w(o(V))},T(o(O)),3)),t.$slots.subheading?(a(),u("div",U0,[Z(t.$slots,"subheading")])):p.subHeading?(a(),u("p",{key:3,class:w(o(M))},T(p.subHeading),3)):null!=(l=o($))&&l.notes?(a(),u("p",{key:4,class:w(["notes",o(M)]),innerHTML:null==(e=o($))?void 0:e.notes},null,10,q0)):k("",!0)]),s("div",Q0,[$e(d,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:P})])])]),Z(t.$slots,"header",{instance:null==(l=Be())?void 0:l.exposed,model:B.value}),(a(),se(n,{ref_key:"formFields",ref:m,key:g.value,type:p.type,modelValue:B.value,"onUpdate:modelValue":E,api:x.value,configureField:p.configureField,configureFormLayout:p.configureFormLayout},null,8,["type","modelValue","api","configureField","configureFormLayout"])),Z(t.$slots,"footer",{instance:null==(e=Be())?void 0:e.exposed,model:B.value})])]),s("div",{class:w(o(S))},[s("div",null,[Z(t.$slots,"leftbuttons",{instance:null==(l=Be())?void 0:l.exposed,model:B.value})]),s("div",null,[p.showLoading&&o(j)?(a(),se(r,{key:0})):k("",!0)]),s("div",K0,[$e(c,{onClick:P,disabled:o(j)},{default:ke(()=>[we("Cancel")]),_:1},8,["disabled"]),$e(i,{class:"ml-4",disabled:!!p.allowSubmit&&!p.allowSubmit(B.value)},{default:ke(()=>[we(T(p.submitLabel),1)]),_:1},8,["disabled"]),Z(t.$slots,"rightbuttons",{instance:null==(e=Be())?void 0:e.exposed,model:B.value})])],2)],34)],2)],32)],32)])])):(a(),u("div",L0,[s("p",V0,[we("Could not create form for unknown "),S0,we(" "+T(o(I)),1)])])),"ModalLookup"==(null==(l=h.value)?void 0:l.name)&&h.value.ref?(a(),se(v,{key:3,"ref-info":h.value.ref,onDone:b},null,8,["ref-info"])):k("",!0)])}}}),G0={key:0},W0={class:"text-red-700"},J0=s("b",null,"type",-1),X0=["onSubmit"],Y0={key:0},ef={key:2},tf=["innerHTML"],lf={class:"flex justify-end"},nf={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},sf=s("div",{class:"fixed inset-0"},null,-1),of={class:"fixed inset-0 overflow-hidden"},af=["onSubmit"],rf={class:"flex min-h-0 flex-1 flex-col overflow-auto"},uf={class:"flex-1"},df={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},cf={class:"flex items-start justify-between space-x-3"},ff={class:"space-y-1"},mf={key:0},vf={key:2},hf=["innerHTML"],gf={class:"flex h-7 items-center"},pf={class:"flex justify-end"},yf=ce({__name:"AutoCreateForm",props:{type:null,formStyle:{default:"slideOver"},panelClass:null,formClass:null,headingClass:null,subHeadingClass:null,buttonsClass:null,heading:null,subHeading:null,autosave:{type:Boolean,default:!0},showLoading:{type:Boolean,default:!0},showCancel:{type:Boolean,default:!0},configureField:null,configureFormLayout:null},emits:["done","save","error"],setup(p,{expose:e,emit:n}){const r=p,m=A(),g=A(1);function t(){g.value++,null!=(e=m.value)&&e.forceUpdate();var e=Be();null!=(e=null==e?void 0:e.proxy)&&e.$forceUpdate()}function y(e){}e({forceUpdate:t,props:r,setModel:function(e){Object.assign(V.value,e),t()},formFields:m}),Xt("ModalProvider",{openModal:function(e,t){h.value=e,l.value=t}});const h=A(),l=A();async function b(e){l.value&&l.value(e),h.value=void 0,l.value=void 0}const{typeOf:i,typeProperties:d,Crud:c,createDto:v,formValues:x}=at(),C=f(()=>Et(r.type)),L=f(()=>i(C.value)),V=A("string"==typeof r.type?v(r.type):r.type?new r.type:null),M=f(()=>r.panelClass||Ze.panelClass(r.formStyle)),S=f(()=>r.formClass||Ze.formClass(r.formStyle)),I=f(()=>r.headingClass||Ze.headingClass(r.formStyle)),$=f(()=>r.subHeadingClass||Ze.subHeadingClass(r.formStyle)),F=f(()=>r.buttonsClass||Ze.buttonsClass),B=f(()=>c.model(L.value)),j=f(()=>{var e;return r.heading||(null==(e=i(C.value))?void 0:e.description)||(B.value?"New "+He(B.value):He(C.value))}),O=A(new Je);let H=Tl(),D=f(()=>H.loading.value);async function E(e){var t,l,a,e=e.target;r.autosave?(l=qe(null==(l=V.value)?void 0:l.getMethod,e=>"function"==typeof e?e():null)||"POST",t=null==qe(null==(t=V.value)?void 0:t.createResponse,e=>"function"==typeof e?e():null),ln.hasRequestBody(l)?(l=new V.value.constructor,a=new FormData(e),O.value=t?await H.apiFormVoid(l,a,{jsconfig:"eccn"}):await H.apiForm(l,a,{jsconfig:"eccn"})):(l=x(e,d(L.value)),a=new V.value.constructor(l),O.value=t?await H.apiVoid(a,{jsconfig:"eccn"}):await H.api(a,{jsconfig:"eccn"})),O.value.succeeded?(e.reset(),n("save",O.value.response)):n("error",O.value.error)):n("save",new V.value.constructor(x(e,d(L.value))))}function z(){n("done")}ne.interceptors.has("AutoCreateForm.new")&&ne.interceptors.invoke("AutoCreateForm.new",{props:r,model:V});const _=A(!1),R=A(""),N={entering:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-full",to:"translate-x-0"},leaving:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-0",to:"translate-x-full"}};function P(){"slideOver"==r.formStyle?_.value=!1:z()}Lt(_,()=>{Ct(N,R,_.value),_.value||setTimeout(z,700)}),_.value=!0;const U=e=>{"Escape"===e.key&&P()};return tt(()=>window.addEventListener("keydown",U)),Rt(()=>window.removeEventListener("keydown",U)),(e,t)=>{var l,n=X("AutoFormFields"),r=X("FormLoading"),i=X("SecondaryButton"),d=X("PrimaryButton"),c=X("CloseButton"),v=X("ModalLookup");return a(),u("div",null,[o(L)?"card"==p.formStyle?(a(),u("div",{key:1,class:w(o(M))},[s("form",{onSubmit:Ue(E,["prevent"])},[s("div",{class:w(o(S))},[s("div",null,[e.$slots.heading?(a(),u("div",Y0,[Z(e.$slots,"heading")])):(a(),u("h3",{key:1,class:w(o(I))},T(o(j)),3)),e.$slots.subheading?(a(),u("div",ef,[Z(e.$slots,"subheading")])):p.subHeading?(a(),u("p",{key:3,class:w(o($))},T(p.subHeading),3)):null!=(l=o(L))&&l.notes?(a(),u("p",{key:4,class:w(["notes",o($)]),innerHTML:null==(l=o(L))?void 0:l.notes},null,10,tf)):k("",!0)]),Z(e.$slots,"header",{formInstance:null==(l=Be())?void 0:l.exposed,model:V.value}),(a(),se(n,{ref_key:"formFields",ref:m,key:g.value,modelValue:V.value,"onUpdate:modelValue":y,api:O.value,configureField:p.configureField,configureFormLayout:p.configureFormLayout},null,8,["modelValue","api","configureField","configureFormLayout"])),Z(e.$slots,"footer",{formInstance:null==(l=Be())?void 0:l.exposed,model:V.value})],2),s("div",{class:w(o(F))},[s("div",null,[p.showLoading&&o(D)?(a(),se(r,{key:0})):k("",!0)]),s("div",lf,[p.showCancel?(a(),se(i,{key:0,onClick:P,disabled:o(D)},{default:ke(()=>[we("Cancel")]),_:1},8,["disabled"])):k("",!0),$e(d,{type:"submit",class:"ml-4",disabled:o(D)},{default:ke(()=>[we("Save")]),_:1},8,["disabled"])])],2)],40,X0)],2)):(a(),u("div",nf,[sf,s("div",of,[s("div",{onMousedown:P,class:"absolute inset-0 overflow-hidden"},[s("div",{onMousedown:t[0]||(t[0]=Ue(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[s("div",{class:w(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",R.value])},[s("form",{class:w(o(S)),onSubmit:Ue(E,["prevent"])},[s("div",rf,[s("div",uf,[s("div",df,[s("div",cf,[s("div",ff,[e.$slots.heading?(a(),u("div",mf,[Z(e.$slots,"heading")])):(a(),u("h3",{key:1,class:w(o(I))},T(o(j)),3)),e.$slots.subheading?(a(),u("div",vf,[Z(e.$slots,"subheading")])):p.subHeading?(a(),u("p",{key:3,class:w(o($))},T(p.subHeading),3)):null!=(l=o(L))&&l.notes?(a(),u("p",{key:4,class:w(["notes",o($)]),innerHTML:null==(t=o(L))?void 0:t.notes},null,10,hf)):k("",!0)]),s("div",gf,[$e(c,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:P})])])]),Z(e.$slots,"header",{formInstance:null==(l=Be())?void 0:l.exposed,model:V.value}),(a(),se(n,{ref_key:"formFields",ref:m,key:g.value,modelValue:V.value,"onUpdate:modelValue":y,api:O.value,configureField:p.configureField,configureFormLayout:p.configureFormLayout},null,8,["modelValue","api","configureField","configureFormLayout"])),Z(e.$slots,"footer",{formInstance:null==(t=Be())?void 0:t.exposed,model:V.value})])]),s("div",{class:w(o(F))},[s("div",null,[p.showLoading&&o(D)?(a(),se(r,{key:0})):k("",!0)]),s("div",pf,[p.showCancel?(a(),se(i,{key:0,onClick:P,disabled:o(D)},{default:ke(()=>[we("Cancel")]),_:1},8,["disabled"])):k("",!0),$e(d,{type:"submit",class:"ml-4",disabled:o(D)},{default:ke(()=>[we("Save")]),_:1},8,["disabled"])])],2)],42,af)],2)],32)],32)])])):(a(),u("div",G0,[s("p",W0,[we("Could not create form for unknown "),J0,we(" "+T(o(C)),1)])])),"ModalLookup"==(null==(c=h.value)?void 0:c.name)&&h.value.ref?(a(),se(v,{key:3,"ref-info":h.value.ref,onDone:b},null,8,["ref-info"])):k("",!0)])}}}),bf={key:0},wf={class:"text-red-700"},xf=s("b",null,"type",-1),kf=["onSubmit"],$f={key:0},Cf={key:2},_f=["innerHTML"],Lf={class:"flex justify-end"},Vf={key:2,class:"relative z-10","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},Sf=s("div",{class:"fixed inset-0"},null,-1),Mf={class:"fixed inset-0 overflow-hidden"},Af=["onSubmit"],Tf={class:"flex min-h-0 flex-1 flex-col overflow-auto"},Ff={class:"flex-1"},If={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},Df={class:"flex items-start justify-between space-x-3"},jf={class:"space-y-1"},Of={key:0},Pf={key:2},Bf=["innerHTML"],Rf={class:"flex h-7 items-center"},Ef={class:"flex justify-end"},Hf=ce({__name:"AutoEditForm",props:{modelValue:null,type:null,deleteType:null,formStyle:{default:"slideOver"},panelClass:null,formClass:null,headingClass:null,subHeadingClass:null,heading:null,subHeading:null,autosave:{type:Boolean,default:!0},showLoading:{type:Boolean,default:!0},configureField:null,configureFormLayout:null},emits:["done","save","delete","error"],setup(p,{expose:e,emit:n}){const r=p,m=A(),g=A(1);function y(e){}e({forceUpdate:function(){g.value++,V.value=L();var e=Be();null!=(e=null==e?void 0:e.proxy)&&e.$forceUpdate()},props:r,setModel:function(e){Object.assign(V.value,e)},formFields:m}),Xt("ModalProvider",{openModal:function(e,t){h.value=e,l.value=t}});const h=A(),l=A();async function b(e){l.value&&l.value(e),h.value=void 0,l.value=void 0}const{typeOf:t,apiOf:q,typeProperties:i,createFormLayout:Q,getPrimaryKey:K,Crud:c,createDto:d,formValues:v}=at(),x=f(()=>Et(r.type)),C=f(()=>t(x.value)),L=()=>"string"==typeof r.type?d(r.type,ml(r.modelValue)):r.type?new r.type(ml(r.modelValue)):null,V=A(L()),W=f(()=>r.panelClass||Ze.panelClass(r.formStyle)),M=f(()=>r.formClass||Ze.formClass(r.formStyle)),S=f(()=>r.headingClass||Ze.headingClass(r.formStyle)),I=f(()=>r.subHeadingClass||Ze.subHeadingClass(r.formStyle)),$=f(()=>c.model(C.value)),F=f(()=>{var e;return r.heading||(null==(e=t(x.value))?void 0:e.description)||($.value?"Update "+He($.value):He(x.value))}),B=A(new Je);let j=Object.assign({},ml(r.modelValue)),O=(ne.interceptors.has("AutoEditForm.new")&&ne.interceptors.invoke("AutoEditForm.new",{props:r,model:V,origModel:j}),Tl()),H=f(()=>O.loading.value);const D=()=>qe(t(c.model(C.value)),e=>K(e));function G(e){var{op:t,prop:l}=e;t&&(c.isPatch(t)||c.isUpdate(t))&&(e.disabled=null==l?void 0:l.isPrimaryKey),r.configureField&&r.configureField(e)}async function E(a){a=a.target;if(r.autosave){let e=qe(null==(s=V.value)?void 0:s.getMethod,e=>"function"==typeof e?e():null)||"POST",l=null==qe(null==(s=V.value)?void 0:s.createResponse,e=>"function"==typeof e?e():null),d=D();if(ln.hasRequestBody(e)){let e=new V.value.constructor,t=ye(r.modelValue,d.name),i=new FormData(a),u=(d&&!Array.from(i.keys()).some(e=>e.toLowerCase()==d.name.toLowerCase())&&i.append(d.name,t),[]);var s=x.value&&q(x.value);if(s&&c.isPatch(s)){let o=Q(C.value),r={};if(d&&(r[d.name]=t),o.forEach(l=>{var a=l.id,s=ye(j,a);if(!d||d.name.toLowerCase()!==a.toLowerCase()){var n=i.get(a);ne.interceptors.has("AutoEditForm.save.formLayout")&&ne.interceptors.invoke("AutoEditForm.save.formLayout",{origValue:s,formLayout:o,input:l,newValue:n});let e=null!=n,t="checkbox"===l.type?e!=!!s:"file"===l.type?e:n!=s;(t=n||s?t:!1)&&(n?r[a]=n:"file"!==l.type&&u.push(a))}}),ne.interceptors.has("AutoEditForm.save")&&ne.interceptors.invoke("AutoEditForm.save",{origModel:j,formLayout:o,dirtyValues:r}),Array.from(i.keys()).filter(e=>!r[e]).forEach(e=>i.delete(e)),0==Array.from(i.keys()).filter(e=>e.toLowerCase()!=d.name.toLowerCase()).length&&0==u.length)return void P()}s=0"function"==typeof e?e():null)?B.value=await O.apiVoid(l):B.value=await O.api(l),B.value.succeeded?n("delete",B.value.response):n("error",B.value.error)):console.error(`Could not find Primary Key for Type ${x.value} (${$.value})`)}function _(){n("done")}const R=A(!1),N=A(""),J={entering:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-full",to:"translate-x-0"},leaving:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-0",to:"translate-x-full"}};function P(){"slideOver"==r.formStyle?R.value=!1:_()}Lt(R,()=>{Ct(J,N,R.value),R.value||setTimeout(_,700)}),R.value=!0;const U=e=>{"Escape"===e.key&&P()};return tt(()=>window.addEventListener("keydown",U)),Rt(()=>window.removeEventListener("keydown",U)),(e,t)=>{var l,n=X("AutoFormFields"),r=X("ConfirmDelete"),i=X("FormLoading"),d=X("SecondaryButton"),c=X("PrimaryButton"),v=X("CloseButton"),f=X("ModalLookup");return a(),u("div",null,[o(C)?"card"==p.formStyle?(a(),u("div",{key:1,class:w(o(W))},[s("form",{onSubmit:Ue(E,["prevent"])},[s("div",{class:w(o(M))},[s("div",null,[e.$slots.heading?(a(),u("div",$f,[Z(e.$slots,"heading")])):(a(),u("h3",{key:1,class:w(o(S))},T(o(F)),3)),e.$slots.subheading?(a(),u("div",Cf,[Z(e.$slots,"subheading")])):p.subHeading?(a(),u("p",{key:3,class:w(o(I))},T(p.subHeading),3)):null!=(l=o(C))&&l.notes?(a(),u("p",{key:4,class:w(["notes",o(I)]),innerHTML:null==(l=o(C))?void 0:l.notes},null,10,_f)):k("",!0)]),Z(e.$slots,"header",{formInstance:null==(l=Be())?void 0:l.exposed,model:V.value}),(a(),se(n,{ref_key:"formFields",ref:m,key:g.value,modelValue:V.value,"onUpdate:modelValue":y,api:B.value,configureField:p.configureField,configureFormLayout:p.configureFormLayout},null,8,["modelValue","api","configureField","configureFormLayout"])),Z(e.$slots,"footer",{formInstance:null==(l=Be())?void 0:l.exposed,model:V.value})],2),s("div",{class:w(o(Ze).buttonsClass)},[s("div",null,[p.deleteType?(a(),se(r,{key:0,onDelete:z})):k("",!0)]),s("div",null,[p.showLoading&&o(H)?(a(),se(i,{key:0})):k("",!0)]),s("div",Lf,[$e(d,{onClick:P,disabled:o(H)},{default:ke(()=>[we("Cancel")]),_:1},8,["disabled"]),$e(c,{type:"submit",class:"ml-4",disabled:o(H)},{default:ke(()=>[we("Save")]),_:1},8,["disabled"])])],2)],40,kf)],2)):(a(),u("div",Vf,[Sf,s("div",Mf,[s("div",{onMousedown:P,class:"absolute inset-0 overflow-hidden"},[s("div",{onMousedown:t[0]||(t[0]=Ue(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[s("div",{class:w(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",N.value])},[s("form",{class:w(o(M)),onSubmit:Ue(E,["prevent"])},[s("div",Tf,[s("div",Ff,[s("div",If,[s("div",Df,[s("div",jf,[e.$slots.heading?(a(),u("div",Of,[Z(e.$slots,"heading")])):(a(),u("h3",{key:1,class:w(o(S))},T(o(F)),3)),e.$slots.subheading?(a(),u("div",Pf,[Z(e.$slots,"subheading")])):p.subHeading?(a(),u("p",{key:3,class:w(o(I))},T(p.subHeading),3)):null!=(l=o(C))&&l.notes?(a(),u("p",{key:4,class:w(["notes",o(I)]),innerHTML:null==(t=o(C))?void 0:t.notes},null,10,Bf)):k("",!0)]),s("div",Rf,[$e(v,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:P})])])]),Z(e.$slots,"header",{formInstance:null==(l=Be())?void 0:l.exposed,model:V.value}),(a(),se(n,{ref_key:"formFields",ref:m,key:g.value,modelValue:V.value,"onUpdate:modelValue":y,api:B.value,configureField:G,configureFormLayout:p.configureFormLayout},null,8,["modelValue","api","configureFormLayout"])),Z(e.$slots,"footer",{formInstance:null==(t=Be())?void 0:t.exposed,model:V.value})])]),s("div",{class:w(o(Ze).buttonsClass)},[s("div",null,[p.deleteType?(a(),se(r,{key:0,onDelete:z})):k("",!0)]),s("div",null,[p.showLoading&&o(H)?(a(),se(i,{key:0})):k("",!0)]),s("div",Ef,[$e(d,{onClick:P,disabled:o(H)},{default:ke(()=>[we("Cancel")]),_:1},8,["disabled"]),$e(c,{type:"submit",class:"ml-4",disabled:o(H)},{default:ke(()=>[we("Save")]),_:1},8,["disabled"])])],2)],42,Af)],2)],32)],32)])])):(a(),u("div",bf,[s("p",wf,[we("Could not create form for unknown "),xf,we(" "+T(o(x)),1)])])),"ModalLookup"==(null==(v=h.value)?void 0:v.name)&&h.value.ref?(a(),se(f,{key:3,"ref-info":h.value.ref,onDone:b},null,8,["ref-info"])):k("",!0)])}}}),zf=s("label",{for:"confirmDelete",class:"ml-2 mr-2 select-none"},"confirm",-1),Nf=["onClick"],Uf=ce({__name:"ConfirmDelete",emits:["delete"],setup(e,{emit:t}){let l=A(!1);const n=()=>{l.value&&t("delete")},r=f(()=>["select-none inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white",l.value?"cursor-pointer bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500":"bg-red-400"]);return(e,t)=>(a(),u(Te,null,[kt(s("input",{id:"confirmDelete",type:"checkbox",class:"focus:ring-indigo-500 h-4 w-4 text-indigo-600 rounded border-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:ring-offset-black","onUpdate:modelValue":t[0]||(t[0]=e=>Gn(l)?l.value=e:l=e)},null,512),[[Yl,o(l)]]),zf,s("span",Me({onClick:Ue(n,["prevent"]),class:o(r)},e.$attrs),[Z(e.$slots,"default",{},()=>[we("Delete")])],16,Nf)],64))}}),qf={class:"flex",title:"loading..."},Qf={key:0,xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",width:"24px",height:"30px",viewBox:"0 0 24 30"},Kf=wl('',3),Zf=[Kf],Gf={class:"ml-2 mt-1 text-gray-400"},Wf=ce({__name:"FormLoading",props:{icon:{type:Boolean,default:!0},text:{default:"loading..."}},setup(l){return Ne("ApiState",void 0),(e,t)=>(a(),u("div",qf,[l.icon?(a(),u("svg",Qf,Zf)):k("",!0),s("span",Gf,T(l.text),1)]))}}),Jf=["onClick"],Xf={key:3,class:"flex justify-between items-center"},Yf={class:"mr-1 select-none"},e1=["onClick"],t1=ce({__name:"DataGrid",props:{items:{default:()=>[]},id:{default:"DataGrid"},type:null,tableStyle:{default:"stripedRows"},selectedColumns:null,gridClass:null,grid2Class:null,grid3Class:null,grid4Class:null,tableClass:null,theadClass:null,tbodyClass:null,theadRowClass:null,theadCellClass:null,isSelected:null,headerTitle:null,headerTitles:null,visibleFrom:null,rowClass:null,rowStyle:null},emits:["headerSelected","rowSelected"],setup(t,{emit:d}){const c=t,l=A(),v=A(null),p=en(),m=t=>Object.keys(p).find(e=>e.toLowerCase()==t.toLowerCase()+"-header"),g=t=>Object.keys(p).find(e=>e.toLowerCase()==t.toLowerCase()),n=f(()=>Nl(c.items).filter(e=>!(!p[e]&&!p[e+"-header"]))),{typeOf:e,typeProperties:r}=at(),i=f(()=>Et(c.type)),y=f(()=>e(i.value)),h=f(()=>r(y.value));function b(e){e=c.headerTitles&&ye(c.headerTitles,e)||e;return c.headerTitle?c.headerTitle(e):ts(e)}function x(e){const t=e.toLowerCase();return h.value.find(e=>e.name.toLowerCase()==t)}const C={xs:"xs:table-cell",sm:"sm:table-cell",md:"md:table-cell",lg:"lg:table-cell",xl:"xl:table-cell","2xl":"2xl:table-cell",never:""};function L(e){e=c.visibleFrom&&ye(c.visibleFrom,e);return e&&qe(C[e],e=>"hidden "+e)}const V=f(()=>c.gridClass??ge.getGridClass(c.tableStyle)),M=f(()=>c.grid2Class??ge.getGrid2Class(c.tableStyle)),S=f(()=>c.grid3Class??ge.getGrid3Class(c.tableStyle)),I=f(()=>c.grid4Class??ge.getGrid4Class(c.tableStyle)),$=f(()=>c.tableClass??ge.getTableClass(c.tableStyle)),F=f(()=>c.tbodyClass??ge.getTbodyClass(c.tbodyClass)),B=f(()=>c.theadClass??ge.getTheadClass(c.tableStyle)),j=f(()=>c.theadRowClass??ge.getTheadRowClass(c.tableStyle)),O=f(()=>c.theadCellClass??ge.getTheadCellClass(c.tableStyle));const H=f(()=>{const e=("string"==typeof c.selectedColumns?c.selectedColumns.split(","):c.selectedColumns)||(0(e[t.name.toLowerCase()]=t.format,e),{});return e.filter(e=>{return"hidden"!=(null==(e=t[e.toLowerCase()])?void 0:e.method)})});return(n,e)=>{const r=X("CellFormat"),i=X("PreviewFormat");return t.items.length?(a(),u("div",{key:0,ref_key:"refResults",ref:l,class:w(o(V))},[s("div",{class:w(o(M))},[s("div",{class:w(o(S))},[s("div",{class:w(o(I))},[s("table",{class:w(o($))},[s("thead",{class:w(o(B))},[s("tr",{class:w(o(j))},[(a(!0),u(Te,null,Ie(o(H),t=>{return a(),u("td",{class:w([L(t),o(O),(e=t,v.value===e?"text-gray-900 dark:text-gray-50":"text-gray-500 dark:text-gray-400")])},[s("div",{onClick:e=>{d("headerSelected",t,e)}},[o(p)[t+"-header"]?Z(n.$slots,t+"-header",{key:0,column:t}):m(t)?Z(n.$slots,m(t),{key:1,column:t}):o(p).header?Z(n.$slots,"header",{key:2,column:t,label:b(t)}):(a(),u("div",Xf,[s("span",Yf,T(b(t)),1)]))],8,Jf)],2);var e}),256))],2)],2),s("tbody",{class:w(o(F))},[(a(!0),u(Te,null,Ie(t.items,(t,e)=>{return a(),u("tr",{class:w((l=t,s=e,c.rowClass?c.rowClass(l,s):ge.getTableRowClass(c.tableStyle,s,!(!c.isSelected||!c.isSelected(l)),null!=c.isSelected))),style:Xl((s=t,l=e,c.rowStyle?c.rowStyle(s,l):void 0)),onClick:e=>{d("rowSelected",t,e)}},[(a(!0),u(Te,null,Ie(o(H),e=>{return a(),u("td",{class:w([L(e),o(ge).tableCellClass])},[o(p)[e]?Z(n.$slots,e,jt(Me({key:0},t))):g(e)?Z(n.$slots,g(e),jt(Me({key:1},t))):x(e)?(a(),se(r,{key:2,type:o(y),propType:x(e),modelValue:t},null,8,["type","propType","modelValue"])):(a(),se(i,{key:3,value:o(ye)(t,e),format:null!=(e=x(e=e))&&e.format?e.format:"TimeSpan"==(null==e?void 0:e.type)||"TimeOnly"==(null==e?void 0:e.type)?{method:"time"}:null},null,8,["value","format"]))],2)}),256))],14,e1);var l,s}),256))],2)],2)],2)],2)],2)],2)):k("",!0)}}}),l1=ce({props:{type:Object,propType:Object,modelValue:Object},setup(i,{attrs:u}){const d=at()["typeOf"];return()=>{var e,t;const l=null!=(e=i.propType)&&e.format?e.format:"TimeSpan"==(null==e?void 0:e.type)||"TimeOnly"==(null==e?void 0:e.type)?{method:"time"}:null,a=ye(i.modelValue,i.propType.name),s=Object.assign({},i,u),n=gt("span",{innerHTML:Jt(a,l,s)}),o=Zt(a)&&Array.isArray(a)?gt("span",{},[gt("span",{class:"mr-2"},""+a.length),n]):n,r=null==(e=i.propType)?void 0:e.ref;return r&&(e=et(i.type).find(e=>e.type===r.model))&&(e=(e=ye(i.modelValue,e.name))&&r.refLabel&&ye(e,r.refLabel))?(t=(t=null==(t=d(r.model))?void 0:t.icon)?gt(zs,{image:t,class:"w-5 h-5 mr-1"}):null,gt("span",{class:"flex",title:r.model+" "+a},[t,e])):o}}}),n1={key:0},s1={key:0,class:"mr-2"},o1=["innerHTML"],a1=["innerHTML"],i1={inheritAttrs:!1},r1=ce({...i1,__name:"PreviewFormat",props:{value:null,format:null,includeIcon:{type:Boolean,default:!0},includeCount:{type:Boolean,default:!0},maxFieldLength:{default:150},maxNestedFields:{default:2},maxNestedFieldLength:{default:30}},setup(l){const e=l,n=f(()=>Array.isArray(e.value));return(e,t)=>o(Zt)(l.value)?(a(),u("span",n1,[l.includeCount&&o(n)?(a(),u("span",s1,T(l.value.length),1)):k("",!0),s("span",{innerHTML:o(Jt)(l.value,l.format,e.$attrs)},null,8,o1)])):(a(),u("span",{key:1,innerHTML:o(Jt)(l.value,l.format,e.$attrs)},null,8,a1))}}),u1=["innerHTML"],d1={key:0},c1=s("b",null,null,-1),f1={key:2},m1=ce({__name:"HtmlFormat",props:{value:null,depth:{default:0},fieldAttrs:null,classes:{type:Function,default:(e,t,l,a,s)=>a}},setup(r){const t=r,i=f(()=>_t(t.value)),d=f(()=>Array.isArray(t.value)),c=e=>ts(e),v=e=>t.fieldAttrs?t.fieldAttrs(e):null,p=f(()=>Nl(t.value));return(e,t)=>{const l=X("HtmlFormat",!0);return a(),u("div",{class:w(0==r.depth?"prose html-format":"")},[o(i)?(a(),u("div",{key:0,innerHTML:o(Jt)(r.value)},null,8,u1)):o(d)?(a(),u("div",{key:1,class:w(r.classes("array","div",r.depth,o(ge).gridClass))},[o(_t)(r.value[0])?(a(),u("div",d1,"[ "+T(r.value.join(", "))+" ]",1)):(a(),u("div",{key:1,class:w(r.classes("array","div",r.depth,o(ge).grid2Class))},[s("div",{class:w(r.classes("array","div",r.depth,o(ge).grid3Class))},[s("div",{class:w(r.classes("array","div",r.depth,o(ge).grid4Class))},[s("table",{class:w(r.classes("object","table",r.depth,o(ge).tableClass))},[s("thead",{class:w(r.classes("array","thead",r.depth,o(ge).theadClass))},[s("tr",null,[(a(!0),u(Te,null,Ie(o(p),e=>(a(),u("th",{class:w(r.classes("array","th",r.depth,o(ge).theadCellClass+" whitespace-nowrap"))},[c1,we(T(c(e)),1)],2))),256))])],2),s("tbody",null,[(a(!0),u(Te,null,Ie(r.value,(t,e)=>(a(),u("tr",{class:w(r.classes("array","tr",r.depth,e%2==0?"bg-white":"bg-gray-50",e))},[(a(!0),u(Te,null,Ie(o(p),e=>(a(),u("td",{class:w(r.classes("array","td",r.depth,o(ge).tableCellClass))},[$e(l,Me({value:t[e],"field-attrs":r.fieldAttrs,depth:r.depth+1,classes:r.classes},v(e)),null,16,["value","field-attrs","depth","classes"])],2))),256))],2))),256))])],2)],2)],2)],2))],2)):(a(),u("div",f1,[s("table",{class:w(r.classes("object","table",r.depth,"table-object"))},[(a(!0),u(Te,null,Ie((n=r.value)?Object.keys(n).map(e=>({key:c(e),val:n[e]})):[],e=>(a(),u("tr",{class:w(r.classes("object","tr",r.depth,""))},[s("th",{class:w(r.classes("object","th",r.depth,"align-top py-2 px-4 text-left text-sm font-medium tracking-wider whitespace-nowrap"))},T(e.key),3),s("td",{class:w(r.classes("object","td",r.depth,"align-top py-2 px-4 text-sm"))},[$e(l,Me({value:e.val,"field-attrs":r.fieldAttrs,depth:r.depth+1,classes:r.classes},v(e.key)),null,16,["value","field-attrs","depth","classes"])],2)],2))),256))],2)]))],2);var n}}}),v1={class:"absolute top-0 right-0 pt-4 pr-4"},h1=s("span",{class:"sr-only"},"Close",-1),g1=s("svg",{class:"h-6 w-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1),p1=[h1,g1],y1=ce({__name:"CloseButton",props:{buttonClass:{default:"bg-white dark:bg-black"}},emits:["close"],setup(l,{}){return(t,e)=>(a(),u("div",v1,[s("button",{type:"button",onClick:e[0]||(e[0]=e=>t.$emit("close")),class:w([l.buttonClass,"rounded-md text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black"])},p1,2)]))}}),b1=["id","aria-labelledby"],w1=s("div",{class:"fixed inset-0"},null,-1),x1={class:"fixed inset-0 overflow-hidden"},k1={class:"flex h-full flex-col bg-white dark:bg-black shadow-xl"},$1={class:"flex min-h-0 flex-1 flex-col overflow-auto"},C1={class:"flex-1"},_1={class:"bg-gray-50 dark:bg-gray-900 px-4 py-6 sm:px-6"},L1={class:"flex items-start justify-between space-x-3"},V1={class:"space-y-1"},S1=["id"],M1={key:1,class:"text-sm text-gray-500"},A1={class:"flex h-7 items-center"},T1={class:"flex-shrink-0 border-t border-gray-200 dark:border-gray-700 px-4 py-5 sm:px-6"},F1=ce({__name:"SlideOver",props:{id:{default:"SlideOver"},title:null,contentClass:{default:"relative mt-6 flex-1 px-4 sm:px-6"}},emits:["done"],setup(n,{emit:e}){const t=A(!1),o=A(""),l={entering:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-full",to:"translate-x-0"},leaving:{cls:"transform transition ease-in-out duration-500 sm:duration-700",from:"translate-x-0",to:"translate-x-full"}},r=(Lt(t,()=>{Ct(l,o,t.value),t.value||setTimeout(()=>e("done"),700)}),t.value=!0,()=>t.value=!1),i=e=>{"Escape"===e.key&&r()};return tt(()=>window.addEventListener("keydown",i)),Rt(()=>window.removeEventListener("keydown",i)),(e,t)=>{var l=X("CloseButton");return a(),u("div",{id:n.id,class:"relative z-10","aria-labelledby":n.id+"-title",role:"dialog","aria-modal":"true"},[w1,s("div",x1,[s("div",{onMousedown:r,class:"absolute inset-0 overflow-hidden"},[s("div",{onMousedown:t[0]||(t[0]=Ue(()=>{},["stop"])),class:"pointer-events-none fixed inset-y-0 right-0 flex pl-10"},[s("div",{class:w(["pointer-events-auto w-screen xl:max-w-3xl md:max-w-xl max-w-lg",o.value])},[s("div",k1,[s("div",$1,[s("div",C1,[s("div",_1,[s("div",L1,[s("div",V1,[n.title?(a(),u("h2",{key:0,class:"text-lg font-medium text-gray-900 dark:text-gray-50",id:n.id+"-title"},T(n.title),9,S1)):k("",!0),e.$slots.subtitle?(a(),u("p",M1,[Z(e.$slots,"subtitle")])):k("",!0)]),s("div",A1,[$e(l,{"button-class":"bg-gray-50 dark:bg-gray-900",onClose:r})])])]),s("div",{class:w(n.contentClass)},[Z(e.$slots,"default")],2)])]),s("div",T1,[Z(e.$slots,"footer")])])],2)],32)],32)])],8,b1)}}}),I1=["id","data-transition-for","aria-labelledby"],D1={class:"fixed inset-0 z-10 overflow-y-auto"},j1={class:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0"},O1=s("span",{class:"sr-only"},"Close",-1),P1=s("svg",{class:"h-6 w-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1),B1=[O1,P1],R1=ce({__name:"ModalDialog",props:{id:{default:"ModalDialog"},modalClass:{default:Jl.modalClass},sizeClass:{default:Jl.sizeClass}},emits:["done"],setup(n,{emit:e}){const t=A(!1),o=A(""),l={entering:{cls:"ease-out duration-300",from:"opacity-0",to:"opacity-100"},leaving:{cls:"ease-in duration-200",from:"opacity-100",to:"opacity-0"}},r=A(""),i={entering:{cls:"ease-out duration-300",from:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",to:"opacity-100 translate-y-0 sm:scale-100"},leaving:{cls:"ease-in duration-200",from:"opacity-100 translate-y-0 sm:scale-100",to:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"}},d=(Lt(t,()=>{Ct(l,o,t.value),Ct(i,r,t.value),t.value||setTimeout(()=>e("done"),200)}),t.value=!0,()=>t.value=!1),c=(Xt("ModalProvider",{openModal:function(e,t){c.value=e,v.value=t}}),A()),v=A();async function f(e){v.value&&v.value(e),c.value=void 0,v.value=void 0}const p=e=>{"Escape"===e.key&&d()};return tt(()=>window.addEventListener("keydown",p)),Rt(()=>window.removeEventListener("keydown",p)),(e,t)=>{var l=X("ModalLookup");return a(),u("div",{id:n.id,"data-transition-for":n.id,onMousedown:d,class:"relative z-10","aria-labelledby":n.id+"-title",role:"dialog","aria-modal":"true"},[s("div",{class:w(["fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity",o.value])},null,2),s("div",D1,[s("div",j1,[s("div",{class:w([n.modalClass,n.sizeClass,r.value]),onMousedown:t[0]||(t[0]=Ue(()=>{},["stop"]))},[s("div",null,[s("div",{class:"hidden sm:block absolute top-0 right-0 pt-4 pr-4 z-10"},[s("button",{type:"button",onClick:d,class:"bg-white dark:bg-black rounded-md text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black"},B1)]),Z(e.$slots,"default")])],34)])]),"ModalLookup"==(null==(t=c.value)?void 0:t.name)&&c.value.ref?(a(),se(l,{key:0,"ref-info":c.value.ref,onDone:f},null,8,["ref-info"])):k("",!0)],40,I1)}}}),E1={class:"pt-2 overflow-auto",style:{"min-height":"620px"}},H1={class:"mt-3 pl-5 flex flex-wrap items-center"},z1={class:"hidden sm:block text-xl leading-6 font-medium text-gray-900 dark:text-gray-50 mr-3"},N1={class:"hidden md:inline"},U1={class:"flex pb-1 sm:pb-0"},q1=["title"],Q1=s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("g",{"stroke-width":"1.5",fill:"none"},[s("path",{d:"M9 3H3.6a.6.6 0 0 0-.6.6v16.8a.6.6 0 0 0 .6.6H9M9 3v18M9 3h6M9 21h6m0-18h5.4a.6.6 0 0 1 .6.6v16.8a.6.6 0 0 1-.6.6H15m0-18v18",stroke:"currentColor"})])],-1),K1=[Q1],Z1=["disabled"],G1=s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6l6 6zM6 6h2v12H6z",fill:"currentColor"})],-1),W1=[G1],J1=["disabled"],X1=s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{d:"M15.41 7.41L14 6l-6 6l6 6l1.41-1.41L10.83 12z",fill:"currentColor"})],-1),Y1=[X1],em=["disabled"],tm=s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{d:"M10 6L8.59 7.41L13.17 12l-4.58 4.59L10 18l6-6z",fill:"currentColor"})],-1),lm=[tm],nm=["disabled"],sm=s("svg",{class:"w-8 h-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[s("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6l-6-6zM16 6h2v12h-2z",fill:"currentColor"})],-1),om=[sm],am={key:0,class:"flex pb-1 sm:pb-0"},im={class:"px-4 text-lg text-black dark:text-white"},rm={key:0},um={key:1},dm=s("span",{class:"hidden xl:inline"}," Showing Results ",-1),cm={key:2},fm={key:1,class:"pl-2"},mm=s("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 24 24"},[s("path",{fill:"currentColor",d:"M6.78 2.72a.75.75 0 0 1 0 1.06L4.56 6h8.69a7.75 7.75 0 1 1-7.75 7.75a.75.75 0 0 1 1.5 0a6.25 6.25 0 1 0 6.25-6.25H4.56l2.22 2.22a.75.75 0 1 1-1.06 1.06l-3.5-3.5a.75.75 0 0 1 0-1.06l3.5-3.5a.75.75 0 0 1 1.06 0Z"})],-1),vm=[mm],hm={class:"flex pb-1 sm:pb-0"},gm={key:0,class:"pl-2"},pm=s("svg",{class:"flex-none w-5 h-5 mr-2 text-gray-400 dark:text-gray-500 group-hover:text-gray-500","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[s("path",{"fill-rule":"evenodd",d:"M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z","clip-rule":"evenodd"})],-1),ym={class:"mr-1"},bm={key:0,class:"h-5 w-5 text-gray-400 dark:text-gray-500 group-hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},wm=s("path",{"fill-rule":"evenodd",d:"M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z","clip-rule":"evenodd"},null,-1),xm=[wm],km={key:1,class:"h-5 w-5 text-gray-400 dark:text-gray-500 group-hover:text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},$m=s("path",{"fill-rule":"evenodd",d:"M5 10a1 1 0 011-1h8a1 1 0 110 2H6a1 1 0 01-1-1z","clip-rule":"evenodd"},null,-1),Cm=[$m],_m={key:1},Lm={key:4},Vm={key:0},Sm={key:0,class:"cursor-pointer flex justify-between items-center hover:text-gray-900 dark:hover:text-gray-50"},Mm={class:"mr-1 select-none"},Am={key:1,class:"flex justify-between items-center"},Tm={class:"mr-1 select-none"},Fm=ce({__name:"ModalLookup",props:{id:{default:"ModalLookup"},refInfo:null,skip:{default:0},prefs:null,selectedColumns:null,allowFiltering:{type:[Boolean,null],default:!0},showPreferences:{type:[Boolean,null],default:!0},showPagingNav:{type:[Boolean,null],default:!0},showPagingInfo:{type:[Boolean,null],default:!0},showResetPreferences:{type:[Boolean,null],default:!0},showFiltersView:{type:[Boolean,null],default:!0},toolbarButtonClass:null,canFilter:null},emits:["done"],setup(c,{emit:l}){const v=c,p=en(),e=St()["config"],{metadataApi:t,filterDefinitions:n}=at(),r=Ne("client"),i=e.value.storage,m=f(()=>v.toolbarButtonClass??ge.toolbarButtonClass),g=f(()=>n.value),y=A({take:25}),h=A(new Je),b=A(v.skip),x=A(!1),C=A(),d=e=>"string"==typeof e?e.split(","):e||[];function L(e,t){return ge.getTableRowClass("fullWidth",t,!1,!0)}const V=f(()=>ot(v.refInfo.model)),M=f(()=>{var e=(0<(e=d(v.selectedColumns)).length?e:[]).map(e=>e.toLowerCase());const l=et(V.value);return 0l.find(e=>e.name.toLowerCase()===t)).filter(e=>null!=e):l}),S=f(()=>{let e=M.value.map(e=>e.name),t=d(y.value.selectedColumns).map(e=>e.toLowerCase());return 0t.includes(e.toLowerCase())):e}),I=f(()=>y.value.take??25),$=f(()=>h.value.response?ye(h.value.response,"results"):[]),F=f(()=>{var e;return(null==(e=h.value.response)?void 0:e.total)??$.value.length??0}),B=f(()=>00$.value.length>=I.value),H=f(()=>$.value.length>=I.value),D=A([]),q=f(()=>D.value.some(e=>0D.value.map(e=>e.settings.filters.length).reduce((e,t)=>e+t,0)),Q=f(()=>el(V.value)),K=f(()=>{var e;return null==(e=t.value)?void 0:e.operations.find(e=>{var t;return(null==(t=e.dataModel)?void 0:t.name)==v.refInfo.model&&ze.isAnyQuery(e)})}),W=A(),z=A(!1),_=A(),R=()=>v.id+"/ApiPrefs/"+v.refInfo.model,N=e=>`Column/${v.id}:${v.refInfo.model}.`+e;async function P(e){b.value+=e,b.value<0&&(b.value=0);e=Math.floor(F.value/I.value)*I.value;b.value>e&&(b.value=e),await U()}async function G(e,t){l("done",e)}function J(){l("done",null)}function Y(t,e){var l,a=e.target;"TD"!==(null==a?void 0:a.tagName)&&(a=null==(a=null==a?void 0:a.closest("TABLE"))?void 0:a.getBoundingClientRect(),l=D.value.find(e=>e.name.toLowerCase()==t.toLowerCase()))&&a&&(e=("DIV"===(null==(a=e.target)?void 0:a.tagName)?e.target:null==(a=e.target)?void 0:a.closest("DIV")).getBoundingClientRect(),_.value={column:l,topLeft:{x:Math.max(Math.floor(e.x+25),343),y:Math.floor(115)}})}function ee(){_.value=null}async function te(e){var t=null==(t=_.value)?void 0:t.column;t&&(t.settings=e,i.setItem(N(t.name),JSON.stringify(t.settings)),await U()),_.value=null}async function le(e){i.setItem(N(e.name),JSON.stringify(e.settings)),await U()}async function ae(e){z.value=!1,y.value=e,i.setItem(R(),JSON.stringify(e)),await U()}async function U(){(async function(a){var s=K.value;if(s){let e=Gt(s,a),t=es(e=>{h.value.response=h.value.error=void 0,x.value=e}),l=await r.api(e);t(),xt(()=>h.value=l);s=ye(l.response,"results")||[];l.succeeded&&s.label}else console.error("No Query API was found for "+v.refInfo.model)})(function(){let a={include:"total",take:I.value},e=d(y.value.selectedColumns||v.selectedColumns);{var t;0{l.settings.sort&&s.push(("DESC"===l.settings.sort?"-":"")+l.name),l.settings.filters.forEach(e=>{var t=e.key.replace("%",l.name);a[t]=e.value})}),"u"{e.settings={filters:[]},i.removeItem(N(e.name))}),await U()}return tt(async()=>{var e=v.prefs||yl(i.getItem(R()));e&&(y.value=e),D.value=M.value.map(e=>({name:e.name,type:e.type,meta:e,settings:Object.assign({filters:[]},yl(i.getItem(N(e.name))))})),isNaN(v.skip)||(b.value=v.skip),await U()}),(l,e)=>{const t=X("ErrorSummary"),n=X("Loading"),r=X("SettingsIcons"),i=X("DataGrid"),d=X("ModalDialog");return a(),u(Te,null,[c.refInfo?(a(),se(d,{key:0,ref_key:"modalDialog",ref:W,id:c.id,onDone:J},{default:ke(()=>[s("div",E1,[s("div",H1,[s("h3",z1,[we(" Select "),s("span",N1,T(o(He)(c.refInfo.model)),1)]),s("div",U1,[c.showPreferences?(a(),u("button",{key:0,type:"button",class:"pl-2 text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400",title:c.refInfo.model+" Preferences",onClick:e[0]||(e[0]=e=>z.value=!z.value)},K1,8,q1)):k("",!0),c.showPagingNav?(a(),u("button",{key:1,type:"button",class:w(["pl-2",o(B)?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"First page",disabled:!o(B),onClick:e[1]||(e[1]=e=>P(-o(F)))},W1,10,Z1)):k("",!0),c.showPagingNav?(a(),u("button",{key:2,type:"button",class:w(["pl-2",o(j)?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Previous page",disabled:!o(j),onClick:e[2]||(e[2]=e=>P(-o(I)))},Y1,10,J1)):k("",!0),c.showPagingNav?(a(),u("button",{key:3,type:"button",class:w(["pl-2",o(O)?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Next page",disabled:!o(O),onClick:e[3]||(e[3]=e=>P(o(I)))},lm,10,em)):k("",!0),c.showPagingNav?(a(),u("button",{key:4,type:"button",class:w(["pl-2",o(H)?"text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400":"text-gray-400 dark:text-gray-500"]),title:"Last page",disabled:!o(H),onClick:e[4]||(e[4]=e=>P(o(F)))},om,10,nm)):k("",!0)]),c.showPagingInfo?(a(),u("div",am,[s("div",im,[x.value?(a(),u("span",rm,"Querying...")):k("",!0),o($).length?(a(),u("span",um,[dm,we(" "+T(b.value+1)+" - "+T(Math.min(b.value+o($).length,o(F)))+" ",1),s("span",null," of "+T(o(F)),1)])):h.value.completed?(a(),u("span",cm,"No Results")):k("",!0)])])):k("",!0),o(q)&&c.showResetPreferences?(a(),u("div",fm,[s("button",{type:"button",onClick:ne,title:"Reset Preferences & Filters",class:w(o(m))},vm,2)])):k("",!0),s("div",hm,[c.showFiltersView&&0C.value="filters"==C.value?null:"filters"),class:w(o(m)),"aria-expanded":"false"},[pm,s("span",ym,T(o(E))+" "+T(1==o(E)?"Filter":"Filters"),1),"filters"!=C.value?(a(),u("svg",bm,xm)):(a(),u("svg",km,Cm))],2)])):k("",!0)])]),"filters"==C.value?(a(),se(Sn,{key:0,class:"border-y border-gray-200 dark:border-gray-800 py-8 my-2",definitions:o(g),columns:D.value,onDone:e[6]||(e[6]=e=>C.value=null),onChange:le},null,8,["definitions","columns"])):k("",!0),_.value?(a(),u("div",_m,[$e(Vn,{definitions:o(g),column:_.value.column,"top-left":_.value.topLeft,onDone:ee,onSave:te},null,8,["definitions","column","top-left"])])):k("",!0),h.value.error?(a(),se(t,{key:2,status:h.value.error},null,8,["status"])):x.value?(a(),se(n,{key:3})):(a(),u("div",Lm,[o($).length?(a(),u("div",Vm,[$e(i,{id:c.id,items:o($),type:c.refInfo.model,"selected-columns":o(S),onFiltersChanged:U,tableStyle:"fullWidth",rowClass:L,onRowSelected:G,onHeaderSelected:Y},tn({header:ke(({column:t,label:e})=>{return[!c.allowFiltering||v.canFilter&&!v.canFilter(t)?(a(),u("div",Am,[s("span",Tm,T(e),1)])):(a(),u("div",Sm,[s("span",Mm,T(e),1),$e(r,{column:D.value.find(e=>e.name.toLowerCase()===t.toLowerCase()),"is-open":(null==(e=_.value)?void 0:e.column.name)===t},null,8,["column","is-open"])]))]}),_:2},[Ie(Object.keys(o(p)),t=>({name:t,fn:ke(e=>[Z(l.$slots,t,jt(gl(e)))])}))]),1032,["id","items","type","selected-columns"])])):k("",!0)]))])]),_:3},8,["id"])):k("",!0),z.value?(a(),se(Mn,{key:1,columns:o(M),prefs:y.value,onDone:e[7]||(e[7]=e=>z.value=!1),onSave:ae},null,8,["columns","prefs"])):k("",!0)],64)}}}),Im={class:"sm:hidden"},Dm=["for"],jm=["id","name"],Om=["value"],Pm={class:"hidden sm:block"},Bm={class:"border-b border-gray-200"},Rm={class:"-mb-px flex","aria-label":"Tabs"},Em=["onClick"],Hm=ce({__name:"Tabs",props:{tabs:null,id:{default:"tabs"},param:{default:"tab"},label:{type:Function,default:e=>He(e)},selected:null,tabClass:null,bodyClass:{default:"p-4"},url:{type:Boolean,default:!0}},setup(l){const t=l,n=f(()=>Object.keys(t.tabs)),r=e=>t.label?t.label(e):He(e),i=f(()=>t.id||"tabs"),d=f(()=>t.param||"tab"),c=A();function v(e){c.value=e,t.url&&nn({tab:e===n.value[0]?void 0:e})}const p=f(()=>100/Object.keys(t.tabs).length+"%");return tt(()=>{var e;c.value=t.selected||Object.keys(t.tabs)[0],t.url&&(e=location.search||(location.hash.includes("?")?"?"+dl(location.hash,"?"):""),e=zl(e)[d.value])&&(c.value=e)}),(e,t)=>(a(),u("div",null,[s("div",Im,[s("label",{for:o(i),class:"sr-only"},"Select a tab",8,Dm),s("select",{id:o(i),name:o(i),class:"block w-full rounded-md border-gray-300 focus:border-indigo-500 focus:ring-indigo-500",onChange:t[0]||(t[0]=e=>{return v(null==(e=e.target)?void 0:e.value)})},[(a(!0),u(Te,null,Ie(o(n),e=>(a(),u("option",{key:e,value:e},T(r(e)),9,Om))),128))],40,jm)]),s("div",Pm,[s("div",Bm,[s("nav",Rm,[(a(!0),u(Te,null,Ie(o(n),t=>{return a(),u("a",{href:"#",onClick:Ue(e=>v(t),["prevent"]),style:Xl({width:o(p)}),class:w([(e=t,c.value===e?"border-indigo-500 text-indigo-600 py-4 px-1 text-center border-b-2 font-medium text-sm":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 py-4 px-1 text-center border-b-2 font-medium text-sm"),l.tabClass])},T(r(t)),15,Em);var e}),256))])])]),s("div",{class:w(l.bodyClass)},[(a(),se(Jn(l.tabs[c.value])))],2)]))}}),zm=s("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4 text-gray-400",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 32 32"},[s("path",{fill:"currentColor",d:"M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3Z"})],-1),Nm=[zm],Um=s("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4 text-indigo-600",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 32 32"},[s("path",{fill:"currentColor",d:"M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6ZM5.394 6.813L6.81 5.399l3.505 3.506L8.9 10.319zM2 15.005h5v2H2zm3.394 10.193L8.9 21.692l1.414 1.414l-3.505 3.506zM15 25.005h2v5h-2zm6.687-1.9l1.414-1.414l3.506 3.506l-1.414 1.414zm3.313-8.1h5v2h-5zm-3.313-6.101l3.506-3.506l1.414 1.414l-3.506 3.506zM15 2.005h2v5h-2z"})],-1),qm=[Um],Qm=ce({__name:"DarkModeToggle",setup(e){const l=typeof document<"u"?document.documentElement:null,n=()=>!(null==l||!l.classList.contains("dark")),o=A("dark"==localStorage.getItem("color-scheme"));return(e,t)=>(a(),u("button",{type:"button",class:"bg-gray-200 dark:bg-gray-700 relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black",role:"switch","aria-checked":"false",onClick:t[0]||(t[0]=e=>{n()?null!=l&&l.classList.remove("dark"):null!=l&&l.classList.add("dark"),o.value=n(),localStorage.setItem("color-scheme",o.value?"dark":"light")})},[s("span",{class:w(`${o.value?"translate-x-0":"translate-x-5"} pointer-events-none relative inline-block h-5 w-5 rounded-full bg-white dark:bg-black shadow transform ring-0 transition ease-in-out duration-200`)},[s("span",{class:w(`${o.value?"opacity-100 ease-in duration-200":"opacity-0 ease-out duration-100"} absolute inset-0 h-full w-full flex items-center justify-center transition-opacity`),"aria-hidden":"true"},Nm,2),s("span",{class:w(`${o.value?"opacity-0 ease-out duration-100":"opacity-100 ease-in duration-200"} absolute inset-0 h-full w-full flex items-center justify-center transition-opacity`),"aria-hidden":"true"},qm,2)],2)]))}}),Km={key:0},Zm={key:1,class:"min-h-full flex flex-col justify-center py-12 sm:px-6 lg:px-8"},Gm={class:"sm:mx-auto sm:w-full sm:max-w-md"},Wm={class:"mt-6 text-center text-3xl font-extrabold text-gray-900"},Jm={key:0,class:"mt-4 text-center text-sm text-gray-600"},Xm={class:"relative z-0 inline-flex shadow-sm rounded-md"},Ym=["onClick"],ev={class:"mt-8 sm:mx-auto sm:w-full sm:max-w-md"},tv={class:"bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10"},lv=["onSubmit"],nv={class:"mt-8"},sv={key:1,class:"mt-6"},ov=wl('
Or continue with
',1),av={class:"mt-6 grid grid-cols-3 gap-3"},iv=["href","title"],rv={key:1,class:"h-5 w-5 text-gray-700",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},uv=s("path",{d:"M16 8a5 5 0 1 0 5 5a5 5 0 0 0-5-5z",fill:"currentColor"},null,-1),dv=s("path",{d:"M16 2a14 14 0 1 0 14 14A14.016 14.016 0 0 0 16 2zm7.992 22.926A5.002 5.002 0 0 0 19 20h-6a5.002 5.002 0 0 0-4.992 4.926a12 12 0 1 1 15.985 0z",fill:"currentColor"},null,-1),cv=[uv,dv],fv=ce({__name:"SignIn",props:{provider:null,title:{default:"Sign In"},tabs:{type:[Boolean,String],default:!0},oauth:{type:[Boolean,String],default:!0}},emits:["login"],setup(c,{emit:t}){const l=c,{getMetadata:e,createDto:n}=at(),r=Tl(),i=Ne("client"),d=Ln()["signIn"],v=e({assert:!0}),p=v.plugins.auth,m=document.baseURI,g=v.app.baseUrl,y=A(n("Authenticate")),h=A(new Je),b=A(l.provider),x=(tt(()=>{null!=p&&p.authProviders.map(e=>e.formLayout).filter(e=>e).forEach(e=>e.forEach(e=>y.value[e.id]=""))}),f(()=>(null==p?void 0:p.authProviders.filter(e=>e.formLayout))||[])),C=f(()=>x.value[0]||{}),L=f(()=>x.value[Math.max(x.value.length-1,0)]||{}),V=f(()=>(b.value?null==p?void 0:p.authProviders.find(e=>e.name===b.value):null)??C.value),M=e=>!1===e||"false"===e;function S(e){return e.label||e.navItem&&e.navItem.label}const I=f(()=>{var e;return((null==(e=V.value)?void 0:e.formLayout)||[]).map(e=>{var t;return Object.assign({},e,{type:null==(t=e.type)?void 0:t.toLowerCase(),autocomplete:e.autocomplete||("password"===(null==(t=e.type)?void 0:t.toLowerCase())?"current-password":void 0)||("username"===e.id.toLowerCase()?"username":void 0),css:Object.assign({field:"col-span-12"},e.css)})})}),$=f(()=>!M(l.oauth)&&(null==p?void 0:p.authProviders.filter(e=>"oauth"===e.type))||[]),F=f(()=>{let e=Lo(null==p?void 0:p.authProviders.filter(e=>e.formLayout&&0{e[S(t)||st(t.name)]=t.name===C.value.name?"":t.name});var t=V.value;return e=t&&M(l.tabs)?{[S(t)||st(t.name)]:t}:e}),B=f(()=>{var e=I.value.map(e=>e.id).filter(e=>e);return h.value.summaryMessage(e)});async function j(){var e;y.value.provider=V.value.name,"authsecret"===V.value.name?(i.headers.set("authsecret",y.value.authsecret),y.value=n("Authenticate")):"basic"===V.value.name&&(i.setCredentials(y.value.UserName,y.value.Password),y.value=n("Authenticate"),y.value.UserName=null,y.value.Password=null),h.value=await r.api(y.value),h.value.succeeded&&(e=h.value.response,d(e),t("login",e),h.value=new Je,y.value=n("Authenticate"))}return(e,t)=>{const l=X("ErrorSummary"),n=X("AutoFormFields"),r=X("PrimaryButton"),i=X("Icon"),d=ro("href");return o(p)?(a(),u("div",Zm,[s("div",Gm,[s("h2",Wm,T(c.title),1),1kt((a(),u("a",{onClick:e=>b.value=t,class:w([""===t||t===o(C).name?"rounded-l-md":t===o(L).name?"rounded-r-md -ml-px":"-ml-px",b.value===t?"z-10 outline-none ring-1 ring-indigo-500 border-indigo-500":"","cursor-pointer relative inline-flex items-center px-4 py-1 border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50"])},[we(T(e),1)],10,Ym)),[[d,{provider:t}]])),256))])])):k("",!0)]),s("div",ev,[o(B)?(a(),se(l,{key:0,class:"mb-3",errorSummary:o(B)},null,8,["errorSummary"])):k("",!0),s("div",tv,[o(I).length?(a(),u("form",{key:0,onSubmit:Ue(j,["prevent"])},[$e(n,{modelValue:y.value,formLayout:o(I),api:h.value,hideSummary:!0,"divide-class":"","space-class":"space-y-6"},null,8,["modelValue","formLayout","api"]),s("div",nv,[$e(r,{class:"w-full"},{default:ke(()=>[we("Sign In")]),_:1})])],40,lv)):k("",!0),o($).length?(a(),u("div",sv,[ov,s("div",av,[(a(!0),u(Te,null,Ie(o($),e=>(a(),u("div",null,[s("a",{href:o(g)+e.navItem.href+"?continue="+o(m),title:S(e),class:"w-full inline-flex justify-center py-2 px-4 border border-gray-300 rounded-md shadow-sm bg-white text-sm font-medium text-gray-500 hover:bg-gray-50"},[e.icon?(a(),se(i,{key:0,image:e.icon,class:"h-5 w-5 text-gray-700"},null,8,["image"])):(a(),u("svg",rv,cv))],8,iv)]))),256))])])):k("",!0)])])])):(a(),u("div",Km,"No Auth Plugin"))}}}),mv=["for"],vv={key:1,class:"border border-gray-200 flex justify-between"},hv={class:"p-2 flex flex-wrap gap-x-4"},gv=s("title",null,"Bold text (CTRL+B)",-1),pv=s("path",{fill:"currentColor",d:"M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79c0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79c0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3v-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z"},null,-1),yv=[gv,pv],bv=s("title",null,"Italics (CTRL+I)",-1),wv=s("path",{fill:"currentColor",d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4h-8z"},null,-1),xv=[bv,wv],kv=s("title",null,"Insert Link (CTRL+K)",-1),$v=s("path",{fill:"currentColor",d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7a5 5 0 0 0-5 5a5 5 0 0 0 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8v2m9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1c0 1.71-1.39 3.1-3.1 3.1h-4V17h4a5 5 0 0 0 5-5a5 5 0 0 0-5-5Z"},null,-1),Cv=[kv,$v],_v=s("title",null,"Blockquote (CTRL+Q)",-1),Lv=s("path",{fill:"currentColor",d:"m15 17l2-4h-4V6h7v7l-2 4h-3Zm-9 0l2-4H4V6h7v7l-2 4H6Z"},null,-1),Vv=[_v,Lv],Sv=s("title",null,"Insert Image (CTRL+SHIFT+L)",-1),Mv=s("path",{fill:"currentColor",d:"M2.992 21A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993H2.992ZM20 15V5H4v14L14 9l6 6Zm0 2.828l-6-6L6.828 19H20v-1.172ZM8 11a2 2 0 1 1 0-4a2 2 0 0 1 0 4Z"},null,-1),Av=[Sv,Mv],Tv=s("title",null,"Insert Code (CTRL+<)",-1),Fv=s("path",{fill:"currentColor",d:"m8 18l-6-6l6-6l1.425 1.425l-4.6 4.6L9.4 16.6L8 18Zm8 0l-1.425-1.425l4.6-4.6L14.6 7.4L16 6l6 6l-6 6Z"},null,-1),Iv=[Tv,Fv],Dv=s("title",null,"H2 Heading (CTRL+H)",-1),jv=s("path",{fill:"currentColor",d:"M7 20V7H2V4h13v3h-5v13H7Zm9 0v-8h-3V9h9v3h-3v8h-3Z"},null,-1),Ov=[Dv,jv],Pv=s("title",null,"Numbered List (ALT+1)",-1),Bv=s("path",{fill:"currentColor",d:"M3 22v-1.5h2.5v-.75H4v-1.5h1.5v-.75H3V16h3q.425 0 .713.288T7 17v1q0 .425-.288.713T6 19q.425 0 .713.288T7 20v1q0 .425-.288.713T6 22H3Zm0-7v-2.75q0-.425.288-.713T4 11.25h1.5v-.75H3V9h3q.425 0 .713.288T7 10v1.75q0 .425-.288.713T6 12.75H4.5v.75H7V15H3Zm1.5-7V3.5H3V2h3v6H4.5ZM9 19v-2h12v2H9Zm0-6v-2h12v2H9Zm0-6V5h12v2H9Z"},null,-1),Rv=[Pv,Bv],Ev=s("title",null,"Bulleted List (ALT+-)",-1),Hv=s("path",{fill:"currentColor",d:"M9 19v-2h12v2H9Zm0-6v-2h12v2H9Zm0-6V5h12v2H9ZM5 20q-.825 0-1.413-.588T3 18q0-.825.588-1.413T5 16q.825 0 1.413.588T7 18q0 .825-.588 1.413T5 20Zm0-6q-.825 0-1.413-.588T3 12q0-.825.588-1.413T5 10q.825 0 1.413.588T7 12q0 .825-.588 1.413T5 14Zm0-6q-.825 0-1.413-.588T3 6q0-.825.588-1.413T5 4q.825 0 1.413.588T7 6q0 .825-.588 1.413T5 8Z"},null,-1),zv=[Ev,Hv],Nv=s("title",null,"Strike Through (ALT+S)",-1),Uv=s("path",{fill:"currentColor",d:"M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z"},null,-1),qv=[Nv,Uv],Qv=s("title",null,"Undo (CTRL+Z)",-1),Kv=s("path",{fill:"currentColor",d:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88c3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"},null,-1),Zv=[Qv,Kv],Gv=s("title",null,"Redo (CTRL+SHIFT+Z)",-1),Wv=s("path",{fill:"currentColor",d:"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 0 1 7.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"},null,-1),Jv=[Gv,Wv],Xv={key:0,class:"p-2 flex flex-wrap gap-x-4"},Yv=["href"],eh=s("path",{fill:"currentColor",d:"M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8s8 3.59 8 8s-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5c0-2.21-1.79-4-4-4z"},null,-1),th=[eh],lh={class:""},nh=["name","id","label","value","rows","disabled","onKeydown"],sh=["id"],oh=["id"],ah=ce({__name:"MarkdownInput",props:{status:null,id:null,inputClass:null,label:null,labelClass:null,help:null,placeholder:null,modelValue:null,counter:{type:Boolean},rows:null,errorMessages:null,lang:null,autoFocus:{type:Boolean},disabled:{type:Boolean},helpUrl:{default:"https://guides.github.com/features/mastering-markdown/"},hide:null},emits:["update:modelValue","close"],setup(n,{expose:e,emit:l}){const r=n;let g=[],y=[],t=Ne("ApiState",void 0);const i=f(()=>mt.call({responseStatus:r.status??(null==t?void 0:t.error.value)},r.id)),d=f(()=>r.label??He(st(r.id))),c="bold,italics,link,image,blockquote,code,heading,orderedList,unorderedList,strikethrough,undo,redo,help".split(","),v=f(()=>r.hide?wt(c,r.hide):wt(c,[]));function p(e){return v.value[e]}const m=f(()=>["shadow-sm font-mono"+nt.base.replace("rounded-md",""),i.value?"text-red-900 focus:ring-red-500 focus:border-red-500 border-red-300":"text-gray-900 "+nt.valid,r.inputClass]),h="w-5 h-5 cursor-pointer select-none text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400",b=A();function x(e){l("update:modelValue",e)}function C(){return b.value.selectionStart!==b.value.selectionEnd}function L(){var e=b.value;return e.value.substring(e.selectionStart,e.selectionEnd)||""}function V(){var e=b.value,t=e.value,l=e.selectionStart,e=t.substring(l,e.selectionEnd)||"",a=t.substring(0,l),s=a.lastIndexOf(` `);return{value:t,sel:e,selPos:l,beforeSel:a,afterSel:t.substring(l),prevCRPos:s,beforeCR:0<=s?a.substring(0,s+1):"",afterCR:0<=s?a.substring(s+1):""}}function M({value:e,selectionStart:t,selectionEnd:l}){null==l&&(l=t),x(e),xt(()=>{b.value.focus(),b.value.setSelectionRange(t,l)})}function S(e,t,l="",{selectionAtEnd:a,offsetStart:s,offsetEnd:n,filterValue:o,filterSelection:r}={}){const i=b.value;let u=i.value,d=i.selectionEnd;g.push({value:u,selectionStart:i.selectionStart,selectionEnd:i.selectionEnd}),y=[];var c=i.selectionStart,v=i.selectionEnd,f=u.substring(0,c),p=u.substring(v),m=e&&f.endsWith(e)&&p.startsWith(t);c==v?(m?(u=f.substring(0,f.length-e.length)+p.substring(t.length),d+=-t.length):(u=f+e+l+t+p,d+=e.length,s=0,n=(null==l?void 0:l.length)||0,a&&(d+=n,n=0)),o&&(l={pos:d},u=o(u,l),d=l.pos)):(a=u.substring(c,v),r&&(a=r(a)),m?(u=f.substring(0,f.length-e.length)+a+p.substring(t.length),s=-a.length-e.length,n=a.length):(u=f+e+a+t+p,s?d+=(e+t).length:(d=c,s=e.length,n=a.length))),x(u),xt(()=>{i.focus(),s=d+(s||0),n=(s||0)+(n||0),i.setSelectionRange(s,n)})}e({props:r,textarea:b,updateModelValue:x,selection:L,hasSelection:C,selectionInfo:V,insert:S,replace:M});const I=()=>S("**","**","bold"),$=()=>S("_","_","italics"),F=()=>S("~~","~~","strikethrough"),B=()=>S("[","](https://)","",{offsetStart:-9,offsetEnd:8}),j=()=>S(` > `,` `,"Blockquote",{}),O=()=>S("![](",")");function H(e){var t=L();t&&!e.shiftKey?S("`","`","code"):(e=r.lang||"js",-1===t.indexOf(` diff --git a/MyApp/wwwroot/lib/mjs/servicestack-vue.mjs b/MyApp/wwwroot/lib/mjs/servicestack-vue.mjs index f64e1cd..98bb60d 100644 --- a/MyApp/wwwroot/lib/mjs/servicestack-vue.mjs +++ b/MyApp/wwwroot/lib/mjs/servicestack-vue.mjs @@ -6882,27 +6882,26 @@ const L0 = { key: 0 }, V0 = { class: "text-red-700" }, S0 = /* @__PURE__ */ s("b ], Qm = /* @__PURE__ */ ce({ __name: "DarkModeToggle", setup(e) { - const t = typeof document < "u" ? document.querySelector("html") : null; - let l = A(t == null ? void 0 : t.classList.contains("dark")); - function n() { - l.value ? t == null || t.classList.remove("dark") : t == null || t.classList.add("dark"), l.value = !l.value, localStorage.setItem("color-scheme", l.value ? "dark" : "light"); + const t = typeof document < "u" ? document.documentElement : null, l = () => !!(t != null && t.classList.contains("dark")), n = A(localStorage.getItem("color-scheme") == "dark"); + function i() { + l() ? t == null || t.classList.remove("dark") : t == null || t.classList.add("dark"), n.value = l(), localStorage.setItem("color-scheme", n.value ? "dark" : "light"); } - return (i, r) => (a(), u("button", { + return (r, d) => (a(), u("button", { type: "button", class: "bg-gray-200 dark:bg-gray-700 relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:ring-offset-black", role: "switch", "aria-checked": "false", - onClick: r[0] || (r[0] = (d) => n()) + onClick: d[0] || (d[0] = (c) => i()) }, [ s("span", { - class: w(`${o(l) ? "translate-x-0" : "translate-x-5"} pointer-events-none relative inline-block h-5 w-5 rounded-full bg-white dark:bg-black shadow transform ring-0 transition ease-in-out duration-200`) + class: w(`${n.value ? "translate-x-0" : "translate-x-5"} pointer-events-none relative inline-block h-5 w-5 rounded-full bg-white dark:bg-black shadow transform ring-0 transition ease-in-out duration-200`) }, [ s("span", { - class: w(`${o(l) ? "opacity-100 ease-in duration-200" : "opacity-0 ease-out duration-100"} absolute inset-0 h-full w-full flex items-center justify-center transition-opacity`), + class: w(`${n.value ? "opacity-100 ease-in duration-200" : "opacity-0 ease-out duration-100"} absolute inset-0 h-full w-full flex items-center justify-center transition-opacity`), "aria-hidden": "true" }, Nm, 2), s("span", { - class: w(`${o(l) ? "opacity-0 ease-out duration-100" : "opacity-100 ease-in duration-200"} absolute inset-0 h-full w-full flex items-center justify-center transition-opacity`), + class: w(`${n.value ? "opacity-0 ease-out duration-100" : "opacity-100 ease-in duration-200"} absolute inset-0 h-full w-full flex items-center justify-center transition-opacity`), "aria-hidden": "true" }, qm, 2) ], 2) diff --git a/MyApp/wwwroot/mjs/app.mjs b/MyApp/wwwroot/mjs/app.mjs index d1bd682..c1c7cde 100644 --- a/MyApp/wwwroot/mjs/app.mjs +++ b/MyApp/wwwroot/mjs/app.mjs @@ -64,6 +64,7 @@ export function mount(sel, component, props) { if (client && !app._context.provides.client) { app.provide('client', client) } + app.config.errorHandler = error => { console.log(error) } app.config.compilerOptions.isCustomElement = tag => CustomElements.includes(tag) app.mount(el) Apps.push(app) @@ -199,4 +200,7 @@ document.addEventListener('DOMContentLoaded', () => Blazor.addEventListener('enhancedload', () => { remount() globalThis.hljs?.highlightAll() + if (localStorage.getItem('color-scheme') == 'dark') { + document.documentElement.classList.add('dark') + } }))