@vuu-ui/vuu-shell 0.8.20 → 0.8.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/index.js +2 -2
- package/cjs/index.js.map +3 -3
- package/esm/index.js +2 -2
- package/esm/index.js.map +3 -3
- package/index.css +1 -1
- package/index.css.map +2 -2
- package/package.json +10 -9
- package/types/persistence-management/LocalPersistenceManager.d.ts +8 -5
- package/types/persistence-management/RemotePersistenceManager.d.ts +1 -0
package/esm/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var at=(e,t,o)=>{if(!t.has(e))throw TypeError("Cannot "+o)};var De=(e,t,o)=>(at(e,t,"read from private field"),o?o.call(e):t.get(e)),nt=(e,t,o)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,o)},rt=(e,t,o,a)=>(at(e,t,"write to private field"),a?a.call(e,o):t.set(e,o),o);import{useCallback as Io}from"react";import{Toolbar as Oo}from"@vuu-ui/vuu-layout";import zo from"clsx";import{useCallback as st,useEffect as Ao,useRef as Vo,useState as ut}from"react";import{Button as Fo,FormField as lt,FormFieldLabel as ct}from"@salt-ds/core";import{VuuInput as pt}from"@vuu-ui/vuu-ui-controls";import{useMemo as ko}from"react";import{jsx as T,jsxs as _}from"react/jsx-runtime";var it=()=>ko(()=>_("svg",{width:"184",height:"90",viewBox:"0 0 184 90",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[_("g",{clipPath:"url(#clip0_1173_59965)",children:[T("path",{d:"M77.0775 31.1019L69.4572 15.1795L66.3997 13.7093L47.6353 44.165L75.7224 61.2361L81.8124 51.2694L77.0775 31.1019Z",fill:"url(#paint0_linear_1173_59965)"}),T("path",{d:"M82.4101 49.7431C81.0488 51.8314 79.1993 53.648 76.8897 54.9809C74.2954 56.4792 71.4601 57.194 68.6623 57.194C63.3422 57.194 58.1597 54.6188 55.0209 49.971L30.5358 7.8193L30.5232 7.84116C25.8791 0.274825 16.0118 -2.26289 8.27258 2.21011C0.411306 6.74866 -2.26753 16.7872 2.28587 24.625L35.5054 81.8189C36.9856 84.3691 39.0542 86.3668 41.4358 87.7527C41.4545 87.7652 41.4733 87.7777 41.4921 87.7902C41.5015 87.7964 41.514 87.8027 41.5234 87.8089C42.6312 88.4457 43.8079 88.942 45.0253 89.3072C45.116 89.3353 45.2099 89.3634 45.3007 89.3883C45.7388 89.5101 46.1801 89.6193 46.6276 89.7067C46.7121 89.7223 46.7966 89.7317 46.8811 89.7473C47.241 89.8097 47.604 89.8628 47.967 89.9003C48.111 89.9159 48.2549 89.9315 48.3989 89.9408C48.8151 89.9752 49.2313 89.997 49.6507 90.0001C49.6726 90.0001 49.6945 90.0001 49.7132 90.0001C49.7195 90.0001 49.7226 90.0001 49.7289 90.0001C49.7352 90.0001 49.7383 90.0001 49.7445 90.0001C50.1983 90.0001 50.6552 89.9752 51.109 89.9377C51.2123 89.9283 51.3155 89.919 51.422 89.9065C51.8663 89.8597 52.3107 89.8004 52.7551 89.7192C52.7614 89.7192 52.7676 89.7192 52.7739 89.7192C53.2621 89.6287 53.7503 89.5101 54.2322 89.3727C54.2635 89.3634 54.2917 89.354 54.323 89.3446C55.024 89.1418 55.7156 88.8889 56.3978 88.5861C56.4104 88.5799 56.426 88.5736 56.4385 88.5674C56.958 88.3364 57.4712 88.0836 57.9751 87.7933C58.4852 87.4999 58.9703 87.1815 59.4334 86.8413C59.8371 86.5478 60.2252 86.2357 60.6039 85.9048C61.0639 85.499 61.4989 85.0745 61.9026 84.6282C62.2062 84.2942 62.4972 83.9446 62.7757 83.5825C62.8665 83.4639 62.951 83.3421 63.0355 83.2235C63.2264 82.9613 63.4079 82.6929 63.5831 82.4182C63.6739 82.2746 63.7646 82.1342 63.8523 81.9906C63.8867 81.9344 63.9242 81.8813 63.9555 81.8251L82.5854 49.7525H82.4039L82.4101 49.7431Z",fill:"url(#paint1_linear_1173_59965)"}),T("path",{d:"M82.8264 32.8436L81.4181 30.4464L75.3375 19.1687L72.5178 14.3929C71.9858 13.1225 70.7309 12.2266 69.26 12.2266C67.3104 12.2266 65.7331 13.8029 65.7331 15.7445C65.7331 16.4031 65.924 17.0086 66.2401 17.5362L66.2025 17.5611L77.1557 36.1617C78.4764 38.4372 78.83 41.0873 78.1509 43.6281C77.4718 46.169 75.8445 48.2915 73.5631 49.6119C72.0609 50.4797 70.3553 50.9385 68.6341 50.9385C65.1166 50.9385 61.84 49.0563 60.0812 46.0285L44.3368 19.2654H44.3681L37.7179 7.81917L37.7054 7.84102C37.5896 7.65061 37.455 7.47893 37.333 7.29477L37.1452 6.97326C37.1452 6.97326 37.1296 6.98262 37.1233 6.98887C34.0001 2.55332 29.0054 0.0780356 23.8512 0.0187285V0H15.3515V0.0436999C21.2881 -0.368328 27.2247 2.46593 30.5232 7.84102L30.5357 7.81917L55.0177 49.974C58.1566 54.6187 63.3422 57.197 68.6592 57.197C71.4569 57.197 74.2922 56.4853 76.8866 54.9839C79.1961 53.651 81.0425 51.8312 82.407 49.7461H82.5885L82.5259 49.8523C83.399 48.4695 84.0687 46.9462 84.5006 45.3231C85.6304 41.0904 85.042 36.6705 82.8201 32.8467L82.8264 32.8436Z",fill:"#F37880"}),_("g",{opacity:"0.86",children:[T("path",{d:"M66.1994 17.5642L77.1526 36.1648C78.4732 38.4403 78.8269 41.0904 78.1478 43.6313C77.7347 45.1795 76.9648 46.5716 75.9133 47.7234C77.2903 46.4686 78.2823 44.8486 78.7737 43.007C79.4527 40.4661 79.0991 37.816 77.7785 35.5405L66.8253 16.94L66.8628 16.915C66.5467 16.3875 66.3558 15.7819 66.3558 15.1233C66.3558 14.3117 66.6344 13.5657 67.0975 12.9695C66.2651 13.6125 65.7299 14.6176 65.7299 15.7476C65.7299 16.4062 65.9208 17.0118 66.2369 17.5393L66.1994 17.5642Z",fill:"white"}),T("path",{d:"M82.5382 49.8335L82.5291 49.8487C82.5291 49.8487 82.5352 49.8365 82.5413 49.8304C82.5413 49.8304 82.5413 49.8304 82.5413 49.8335H82.5382Z",fill:"white"}),T("path",{d:"M77.5156 54.3596C74.9213 55.8579 72.0859 56.5727 69.2882 56.5727C63.9681 56.5727 58.7856 53.9975 55.6467 49.3497L31.1616 7.19488L31.1491 7.21673C28.9053 3.56154 25.4441 1.08626 21.5917 0H15.3515V0.0436999C21.2881 -0.368328 27.2247 2.46593 30.5232 7.84102L30.5357 7.81917L55.0177 49.974C58.1566 54.6187 63.3422 57.197 68.6592 57.197C71.4569 57.197 74.2922 56.4853 76.8866 54.9839C78.2698 54.1848 79.4809 53.2109 80.5293 52.1122C79.6311 52.9581 78.6266 53.7166 77.5125 54.3596H77.5156Z",fill:"white"})]})]}),T("path",{d:"M117.046 58.661C116.362 58.661 115.792 58.509 115.336 58.205C114.906 57.8757 114.551 57.3943 114.272 56.761L104.354 34.493C104.076 33.8597 104 33.3023 104.126 32.821C104.253 32.3397 104.519 31.9597 104.924 31.681C105.33 31.4023 105.811 31.263 106.368 31.263C107.103 31.263 107.648 31.4277 108.002 31.757C108.382 32.061 108.699 32.5297 108.952 33.163L117.958 54.025H116.324L125.292 33.125C125.571 32.517 125.9 32.061 126.28 31.757C126.66 31.4277 127.192 31.263 127.876 31.263C128.434 31.263 128.89 31.4023 129.244 31.681C129.624 31.9597 129.865 32.3397 129.966 32.821C130.068 33.3023 129.979 33.8597 129.7 34.493L119.782 56.761C119.504 57.3943 119.149 57.8757 118.718 58.205C118.313 58.509 117.756 58.661 117.046 58.661Z",fill:"white"}),T("path",{d:"M144.63 58.737C142.781 58.737 141.147 58.4963 139.728 58.015C138.335 57.5337 137.157 56.8243 136.194 55.887C135.232 54.9243 134.51 53.7337 134.028 52.315C133.547 50.8963 133.306 49.2497 133.306 47.375V33.733C133.306 32.897 133.509 32.2763 133.914 31.871C134.345 31.4657 134.953 31.263 135.738 31.263C136.524 31.263 137.119 31.4657 137.524 31.871C137.955 32.2763 138.17 32.897 138.17 33.733V47.337C138.17 49.7437 138.715 51.555 139.804 52.771C140.919 53.9617 142.528 54.557 144.63 54.557C146.733 54.557 148.329 53.9617 149.418 52.771C150.508 51.555 151.052 49.7437 151.052 47.337V33.733C151.052 32.897 151.255 32.2763 151.66 31.871C152.091 31.4657 152.699 31.263 153.484 31.263C154.244 31.263 154.827 31.4657 155.232 31.871C155.663 32.2763 155.878 32.897 155.878 33.733V47.375C155.878 49.8577 155.448 51.9477 154.586 53.645C153.75 55.3423 152.496 56.6217 150.824 57.483C149.152 58.319 147.088 58.737 144.63 58.737Z",fill:"white"}),T("path",{d:"M172.685 58.737C170.836 58.737 169.202 58.4963 167.783 58.015C166.39 57.5337 165.212 56.8243 164.249 55.887C163.286 54.9243 162.564 53.7337 162.083 52.315C161.602 50.8963 161.361 49.2497 161.361 47.375V33.733C161.361 32.897 161.564 32.2763 161.969 31.871C162.4 31.4657 163.008 31.263 163.793 31.263C164.578 31.263 165.174 31.4657 165.579 31.871C166.01 32.2763 166.225 32.897 166.225 33.733V47.337C166.225 49.7437 166.77 51.555 167.859 52.771C168.974 53.9617 170.582 54.557 172.685 54.557C174.788 54.557 176.384 53.9617 177.473 52.771C178.562 51.555 179.107 49.7437 179.107 47.337V33.733C179.107 32.897 179.31 32.2763 179.715 31.871C180.146 31.4657 180.754 31.263 181.539 31.263C182.299 31.263 182.882 31.4657 183.287 31.871C183.718 32.2763 183.933 32.897 183.933 33.733V47.375C183.933 49.8577 183.502 51.9477 182.641 53.645C181.805 55.3423 180.551 56.6217 178.879 57.483C177.207 58.319 175.142 58.737 172.685 58.737Z",fill:"white"}),_("defs",{children:[_("linearGradient",{id:"paint0_linear_1173_59965",x1:"47.6353",y1:"37.4727",x2:"81.8124",y2:"37.4727",gradientUnits:"userSpaceOnUse",children:[T("stop",{stopColor:"#4906A5"}),T("stop",{offset:"1",stopColor:"#D3423A"})]}),_("linearGradient",{id:"paint1_linear_1173_59965",x1:"0.0670626",y1:"45.0017",x2:"82.5916",y2:"45.0017",gradientUnits:"userSpaceOnUse",children:[T("stop",{stopColor:"#7C06A5"}),T("stop",{offset:"1",stopColor:"#D3423A"})]}),T("clipPath",{id:"clip0_1173_59965",children:T("rect",{width:"85",height:"90",fill:"white",transform:"translate(0.0670471)"})})]})]}),[]);import Ho from"clsx";import{jsx as B,jsxs as te}from"react/jsx-runtime";var J="vuuLoginPanel",Kr=({appName:e="Demo App",className:t,requirePassword:o=!0,onSubmit:a,...n})=>{let[r,i]=ut(""),[s,u]=ut(""),c=Vo(null),p=()=>{a(r,s)},h=g=>{i(g.target.value)},y=g=>{u(g.target.value)},v=st(()=>{o||a(r)},[a,o,r]),d=st(()=>{r&&a(r,s)},[a,s,r]),l=r.trim()!==""&&(o===!1||s.trim()!=="");return Ao(()=>{var g;console.log("inputRef",{input:c.current}),(g=c.current)==null||g.focus()},[]),te("div",{...n,className:Ho(J,t),children:[te("div",{className:`${J}-branding`,children:[B(it,{}),B("div",{className:`${J}-appName`,children:e})]}),te("div",{className:`${J}-form`,children:[B("div",{className:`${J}-title`,children:"Welcome Back"}),te(lt,{children:[B(ct,{children:"Username"}),B(pt,{value:r,id:"text-username",inputRef:c,onChange:h,onCommit:v})]}),o?te(lt,{children:[B(ct,{children:"Password"}),B(pt,{className:`${J}-password`,inputProps:{type:"password"},value:s,id:"text-password",onChange:y,onCommit:d,endAdornment:B("span",{"data-icon":"eye",style:{cursor:"pointer"}})})]}):null,B(Fo,{className:`${J}-login`,disabled:!l,onClick:p,variant:"cta",children:"Login"})]})]})};import{getCookieValue as ke}from"@vuu-ui/vuu-utils";var Ro=()=>{let e=ke("vuu-auth-mode");return e!=null?e:""},ti=()=>{let e=ke("vuu-username"),t=ke("vuu-auth-token");return[e,t]},$o=()=>Ro()==="login"?"login.html":"demo.html",Bo=(e=$o())=>{window.location.href=e},dt=e=>{document.cookie="vuu-username= ; expires = Thu, 01 Jan 1970 00:00:00 GMT",document.cookie="vuu-auth-token= ; expires = Thu, 01 Jan 1970 00:00:00 GMT",Bo(e)};import{Button as le}from"@salt-ds/core";import{jsx as ce,jsxs as Ae}from"react/jsx-runtime";var oe="vuuAppHeader",mt=({className:e,layoutId:t,loginUrl:o,onNavigate:a,onSwitchTheme:n,themeMode:r="light",user:i,...s})=>{let u=zo(oe,e),c=Io(()=>{dt(o)},[o]);return Ae(Oo,{alignItems:"end",className:u,height:36,showSeparators:!0,...s,children:[ce(le,{className:`${oe}-menuItem`,variant:"secondary",children:"Help"}),Ae(le,{className:`${oe}-menuItem`,variant:"secondary",children:["History ",ce("span",{"data-icon":"history"})]}),Ae(le,{className:`${oe}-menuItem`,variant:"secondary",children:["View ",ce("span",{"data-icon":"settings"})]}),ce(le,{className:`${oe}-menuItem`,onClick:c,variant:"secondary",children:"Log out"})]})};import Uo,{useEffect as Jo,useState as Zo}from"react";import qo from"clsx";import{Fragment as _o,jsx as Wo,jsxs as ht}from"react/jsx-runtime";var Si=({connectionStatus:e,className:t,element:o="span",...a})=>{let[n,r]=Zo("vuuConnectingStatus");Jo(()=>{switch(e){case"connected":case"reconnected":r("vuuActiveStatus");break;case"connecting":r("vuuConnectingStatus");break;case"disconnected":r("vuuDisconnectedStatus");break;default:break}},[e]);let i=Uo.createElement(o,{...a,className:qo("vuuStatus vuuIcon",n,t)});return Wo(_o,{children:ht("div",{className:"vuuStatus-container salt-theme",children:[i,ht("div",{className:"vuuStatus-text",children:["Status: ",e.toUpperCase()]})]})})};import yt,{Suspense as Yo,useEffect as jo}from"react";import{registerComponent as ea}from"@vuu-ui/vuu-layout";import Go from"react";import{Fragment as Qo,jsx as ft,jsxs as Xo}from"react/jsx-runtime";var pe=class extends Go.Component{constructor(t){super(t),this.state={errorMessage:null}}static getDerivedStateFromError(t){return{errorMessage:t.message}}componentDidCatch(t,o){console.log(`error creating component at ${this.props.url}`),console.log(t,o)}render(){return this.state.errorMessage?Xo(Qo,{children:[ft("h1",{children:"An error occured while creating component."}),ft("p",{children:this.state.errorMessage})]}):this.props.children}};import{jsx as Ko}from"react/jsx-runtime";var gt=()=>Ko("div",{className:"hwLoader"});var vt=async e=>{let t=new CSSStyleSheet;return fetch(e).then(o=>o.text()).then(o=>t.replace(o))};import{jsx as me}from"react/jsx-runtime";var de=new Map,ta=e=>{jo(()=>()=>{de.delete(e)},[e]),de.has(e)||de.set(e,yt.lazy(()=>import(e)));let t=de.get(e);if(t)return t;throw Error(`Unable to load Lazy Feature at url ${e}`)};function oa({url:e,css:t,ComponentProps:o,...a}){t&&vt(t).then(r=>{document.adoptedStyleSheets=[...document.adoptedStyleSheets,r]});let n=ta(e);return me(pe,{url:e,children:me(Yo,{fallback:me(gt,{}),children:me(n,{...a,...o})})})}var he=yt.memo(oa);he.displayName="Feature";ea("Feature",he,"view");import{Checkbox as Ba,ComboBox as Ia,RadioButton as Oa}from"@vuu-ui/vuu-ui-controls";function xt(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;let o=document.implementation.createHTMLDocument(),a=o.createElement("base"),n=o.createElement("a");return o.head.appendChild(a),o.body.appendChild(n),t&&(a.href=t),n.href=e,n.href}var bt=(()=>{let e=0,t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function E(e){let t=[];for(let o=0,a=e.length;o<a;o++)t.push(e[o]);return t}function fe(e,t){let a=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return a?parseFloat(a.replace("px","")):0}function aa(e){let t=fe(e,"border-left-width"),o=fe(e,"border-right-width");return e.clientWidth+t+o}function na(e){let t=fe(e,"border-top-width"),o=fe(e,"border-bottom-width");return e.clientHeight+t+o}function Ve(e,t={}){let o=t.width||aa(e),a=t.height||na(e);return{width:o,height:a}}function wt(){let e,t;try{t=process}catch{}let o=t&&t.env?t.env.devicePixelRatio:null;return o&&(e=parseInt(o,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}var M=16384;function Lt(e){(e.width>M||e.height>M)&&(e.width>M&&e.height>M?e.width>e.height?(e.height*=M/e.width,e.width=M):(e.width*=M/e.height,e.height=M):e.width>M?(e.height*=M/e.width,e.width=M):(e.width*=M/e.height,e.height=M))}function W(e){return new Promise((t,o)=>{let a=new Image;a.decode=()=>t(a),a.onload=()=>t(a),a.onerror=o,a.crossOrigin="anonymous",a.decoding="async",a.src=e})}async function ra(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Ct(e,t,o){let a="http://www.w3.org/2000/svg",n=document.createElementNS(a,"svg"),r=document.createElementNS(a,"foreignObject");return n.setAttribute("width",`${t}`),n.setAttribute("height",`${o}`),n.setAttribute("viewBox",`0 0 ${t} ${o}`),r.setAttribute("width","100%"),r.setAttribute("height","100%"),r.setAttribute("x","0"),r.setAttribute("y","0"),r.setAttribute("externalResourcesRequired","true"),n.appendChild(r),r.appendChild(e),ra(n)}var C=(e,t)=>{if(e instanceof t)return!0;let o=Object.getPrototypeOf(e);return o===null?!1:o.constructor.name===t.name||C(o,t)};function ia(e){let t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function sa(e){return E(e).map(t=>{let o=e.getPropertyValue(t),a=e.getPropertyPriority(t);return`${t}: ${o}${a?" !important":""};`}).join(" ")}function ua(e,t,o){let a=`.${e}:${t}`,n=o.cssText?ia(o):sa(o);return document.createTextNode(`${a}{${n}}`)}function St(e,t,o){let a=window.getComputedStyle(e,o),n=a.getPropertyValue("content");if(n===""||n==="none")return;let r=bt();try{t.className=`${t.className} ${r}`}catch{return}let i=document.createElement("style");i.appendChild(ua(r,o,a)),t.appendChild(i)}function Pt(e,t){St(e,t,":before"),St(e,t,":after")}var Tt="application/font-woff",Mt="image/jpeg",la={woff:Tt,woff2:Tt,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Mt,jpeg:Mt,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function ca(e){let t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function G(e){let t=ca(e).toLowerCase();return la[t]||""}function pa(e){return e.split(/,/)[1]}function ae(e){return e.search(/^(data:)/)!==-1}function He(e,t){return`data:${t};base64,${e}`}async function Re(e,t,o){let a=await fetch(e,t);if(a.status===404)throw new Error(`Resource "${a.url}" not found`);let n=await a.blob();return new Promise((r,i)=>{let s=new FileReader;s.onerror=i,s.onloadend=()=>{try{r(o({res:a,result:s.result}))}catch(u){i(u)}},s.readAsDataURL(n)})}var Fe={};function da(e,t,o){let a=e.replace(/\?.*/,"");return o&&(a=e),/ttf|otf|eot|woff2?/i.test(a)&&(a=a.replace(/.*\//,"")),t?`[${t}]${a}`:a}async function Q(e,t,o){let a=da(e,t,o.includeQueryParams);if(Fe[a]!=null)return Fe[a];o.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let n;try{let r=await Re(e,o.fetchRequestInit,({res:i,result:s})=>(t||(t=i.headers.get("Content-Type")||""),pa(s)));n=He(r,t)}catch(r){n=o.imagePlaceholder||"";let i=`Failed to fetch resource: ${e}`;r&&(i=typeof r=="string"?r:r.message),i&&console.warn(i)}return Fe[a]=n,n}async function ma(e){let t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):W(t)}async function ha(e,t){if(e.currentSrc){let r=document.createElement("canvas"),i=r.getContext("2d");r.width=e.clientWidth,r.height=e.clientHeight,i==null||i.drawImage(e,0,0,r.width,r.height);let s=r.toDataURL();return W(s)}let o=e.poster,a=G(o),n=await Q(o,a,t);return W(n)}async function fa(e){var t;try{if(!((t=e==null?void 0:e.contentDocument)===null||t===void 0)&&t.body)return await ne(e.contentDocument.body,{},!0)}catch{}return e.cloneNode(!1)}async function ga(e,t){return C(e,HTMLCanvasElement)?ma(e):C(e,HTMLVideoElement)?ha(e,t):C(e,HTMLIFrameElement)?fa(e):e.cloneNode(!1)}var va=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT";async function ya(e,t,o){var a,n;let r=[];return va(e)&&e.assignedNodes?r=E(e.assignedNodes()):C(e,HTMLIFrameElement)&&(!((a=e.contentDocument)===null||a===void 0)&&a.body)?r=E(e.contentDocument.body.childNodes):r=E(((n=e.shadowRoot)!==null&&n!==void 0?n:e).childNodes),r.length===0||C(e,HTMLVideoElement)||await r.reduce((i,s)=>i.then(()=>ne(s,o)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function xa(e,t){let o=t.style;if(!o)return;let a=window.getComputedStyle(e);a.cssText?(o.cssText=a.cssText,o.transformOrigin=a.transformOrigin):E(a).forEach(n=>{let r=a.getPropertyValue(n);n==="font-size"&&r.endsWith("px")&&(r=`${Math.floor(parseFloat(r.substring(0,r.length-2)))-.1}px`),C(e,HTMLIFrameElement)&&n==="display"&&r==="inline"&&(r="block"),n==="d"&&t.getAttribute("d")&&(r=`path(${t.getAttribute("d")})`),o.setProperty(n,r,a.getPropertyPriority(n))})}function ba(e,t){C(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),C(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function wa(e,t){if(C(e,HTMLSelectElement)){let o=t,a=Array.from(o.children).find(n=>e.value===n.getAttribute("value"));a&&a.setAttribute("selected","")}}function La(e,t){return C(t,Element)&&(xa(e,t),Pt(e,t),ba(e,t),wa(e,t)),t}async function Ca(e,t){let o=e.querySelectorAll?e.querySelectorAll("use"):[];if(o.length===0)return e;let a={};for(let r=0;r<o.length;r++){let s=o[r].getAttribute("xlink:href");if(s){let u=e.querySelector(s),c=document.querySelector(s);!u&&c&&!a[s]&&(a[s]=await ne(c,t,!0))}}let n=Object.values(a);if(n.length){let r="http://www.w3.org/1999/xhtml",i=document.createElementNS(r,"svg");i.setAttribute("xmlns",r),i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.overflow="hidden",i.style.display="none";let s=document.createElementNS(r,"defs");i.appendChild(s);for(let u=0;u<n.length;u++)s.appendChild(n[u]);e.appendChild(i)}return e}async function ne(e,t,o){return!o&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(a=>ga(a,t)).then(a=>ya(e,a,t)).then(a=>La(e,a)).then(a=>Ca(a,t))}var Et=/url\((['"]?)([^'"]+?)\1\)/g,Sa=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Pa=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Ta(e){let t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function Ma(e){let t=[];return e.replace(Et,(o,a,n)=>(t.push(n),o)),t.filter(o=>!ae(o))}async function Ea(e,t,o,a,n){try{let r=o?xt(t,o):t,i=G(t),s;if(n){let u=await n(r);s=He(u,i)}else s=await Q(r,i,a);return e.replace(Ta(t),`$1${s}$3`)}catch{}return e}function Na(e,{preferredFontFormat:t}){return t?e.replace(Pa,o=>{for(;;){let[a,,n]=Sa.exec(o)||[];if(!n)return"";if(n===t)return`src: ${a};`}}):e}function $e(e){return e.search(Et)!==-1}async function ge(e,t,o){if(!$e(e))return e;let a=Na(e,o);return Ma(a).reduce((r,i)=>r.then(s=>Ea(s,i,t,o)),Promise.resolve(a))}async function ve(e,t,o){var a;let n=(a=t.style)===null||a===void 0?void 0:a.getPropertyValue(e);if(n){let r=await ge(n,null,o);return t.style.setProperty(e,r,t.style.getPropertyPriority(e)),!0}return!1}async function Da(e,t){await ve("background",e,t)||await ve("background-image",e,t),await ve("mask",e,t)||await ve("mask-image",e,t)}async function ka(e,t){let o=C(e,HTMLImageElement);if(!(o&&!ae(e.src))&&!(C(e,SVGImageElement)&&!ae(e.href.baseVal)))return;let a=o?e.src:e.href.baseVal,n=await Q(a,G(a),t);await new Promise((r,i)=>{e.onload=r,e.onerror=i;let s=e;s.decode&&(s.decode=r),s.loading==="lazy"&&(s.loading="eager"),o?(e.srcset="",e.src=n):e.href.baseVal=n})}async function Aa(e,t){let a=E(e.childNodes).map(n=>Be(n,t));await Promise.all(a).then(()=>e)}async function Be(e,t){C(e,Element)&&(await Da(e,t),await ka(e,t),await Aa(e,t))}function Nt(e,t){let{style:o}=e;t.backgroundColor&&(o.backgroundColor=t.backgroundColor),t.width&&(o.width=`${t.width}px`),t.height&&(o.height=`${t.height}px`);let a=t.style;return a!=null&&Object.keys(a).forEach(n=>{o[n]=a[n]}),e}var Dt={};async function kt(e){let t=Dt[e];if(t!=null)return t;let a=await(await fetch(e)).text();return t={url:e,cssText:a},Dt[e]=t,t}async function At(e,t){let o=e.cssText,a=/url\(["']?([^"')]+)["']?\)/g,r=(o.match(/url\([^)]+\)/g)||[]).map(async i=>{let s=i.replace(a,"$1");return s.startsWith("https://")||(s=new URL(s,e.url).href),Re(s,t.fetchRequestInit,({result:u})=>(o=o.replace(i,`url(${u})`),[i,u]))});return Promise.all(r).then(()=>o)}function Vt(e){if(e==null)return[];let t=[],o=/(\/\*[\s\S]*?\*\/)/gi,a=e.replace(o,""),n=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){let u=n.exec(a);if(u===null)break;t.push(u[0])}a=a.replace(n,"");let r=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,i="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",s=new RegExp(i,"gi");for(;;){let u=r.exec(a);if(u===null){if(u=s.exec(a),u===null)break;r.lastIndex=s.lastIndex}else s.lastIndex=r.lastIndex;t.push(u[0])}return t}async function Va(e,t){let o=[],a=[];return e.forEach(n=>{if("cssRules"in n)try{E(n.cssRules||[]).forEach((r,i)=>{if(r.type===CSSRule.IMPORT_RULE){let s=i+1,u=r.href,c=kt(u).then(p=>At(p,t)).then(p=>Vt(p).forEach(h=>{try{n.insertRule(h,h.startsWith("@import")?s+=1:n.cssRules.length)}catch(y){console.error("Error inserting rule from remote css",{rule:h,error:y})}})).catch(p=>{console.error("Error loading remote css",p.toString())});a.push(c)}})}catch(r){let i=e.find(s=>s.href==null)||document.styleSheets[0];n.href!=null&&a.push(kt(n.href).then(s=>At(s,t)).then(s=>Vt(s).forEach(u=>{i.insertRule(u,n.cssRules.length)})).catch(s=>{console.error("Error loading remote stylesheet",s)})),console.error("Error inlining remote css file",r)}}),Promise.all(a).then(()=>(e.forEach(n=>{if("cssRules"in n)try{E(n.cssRules||[]).forEach(r=>{o.push(r)})}catch(r){console.error(`Error while reading CSS rules from ${n.href}`,r)}}),o))}function Fa(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>$e(t.style.getPropertyValue("src")))}async function Ha(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");let o=E(e.ownerDocument.styleSheets),a=await Va(o,t);return Fa(a)}async function Ft(e,t){let o=await Ha(e,t);return(await Promise.all(o.map(n=>{let r=n.parentStyleSheet?n.parentStyleSheet.href:null;return ge(n.cssText,r,t)}))).join(`
|
|
2
|
-
`)}async function Ht(e,t){let o=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Ft(e,t);if(o){let a=document.createElement("style"),n=document.createTextNode(o);a.appendChild(n),e.firstChild?e.insertBefore(a,e.firstChild):e.appendChild(a)}}async function Ra(e,t={}){let{width:o,height:a}=Ve(e,t),n=await ne(e,t,!0);return await Ht(n,t),await Be(n,t),Nt(n,t),await Ct(n,o,a)}async function $a(e,t={}){let{width:o,height:a}=Ve(e,t),n=await Ra(e,t),r=await W(n),i=document.createElement("canvas"),s=i.getContext("2d"),u=t.pixelRatio||wt(),c=t.canvasWidth||o,p=t.canvasHeight||a;return i.width=c*u,i.height=p*u,t.skipAutoScale||Lt(i),i.style.width=`${c}`,i.style.height=`${p}`,t.backgroundColor&&(s.fillStyle=t.backgroundColor,s.fillRect(0,0,i.width,i.height)),s.drawImage(r,0,0,i.width,i.height),i}async function Rt(e,t={}){return(await $a(e,t)).toDataURL()}var $t=e=>new Promise((t,o)=>{Rt(e,{cacheBust:!0}).then(a=>{a||o(new Error("No Screenshot available")),t(a)}).catch(a=>{console.error("the following error occurred while taking a screenshot of a DOMNode",a),o(new Error("Error taking screenshot"))})});import{Button as Bt,FormField as ye,FormFieldLabel as xe,Input as za,Text as Ua}from"@salt-ds/core";import{useEffect as Ja,useMemo as Za,useState as X}from"react";import{jsx as S,jsxs as z}from"react/jsx-runtime";var N="saveLayoutPanel",be=`${N}-formField`,qa=["Group 1","Group 2","Group 3","Group 4","Group 5"],_a=["Value 1","Value 2","Value 3"],It=["Value 1","Value 2","Value 3"],Ot=e=>{let{defaultTitle:t="",onCancel:o,onSave:a,componentId:n}=e,[r,i]=X(t),[s,u]=X(""),[c,p]=X([]),[h,y]=X(It[0]),[v,d]=X(),[l,g]=X();Ja(()=>{n&&$t(document.getElementById(n)).then(f=>{d(f)}).catch(f=>{g(f.message)})},[n]);let b=()=>{a({name:r,group:s,screenshot:v!=null?v:"",user:"User"})},k=Za(()=>v?S("img",{className:`${N}-screenshot`,src:v,alt:"screenshot of current layout"}):l?S(Ua,{children:l}):S("div",{className:"spinner"}),[v,l]);return z("div",{className:`${N}-panelContainer`,children:[z("div",{className:`${N}-panelContent`,children:[z("div",{className:`${N}-formContainer`,children:[z(ye,{className:be,children:[S(xe,{children:"Group"}),S(Ia,{source:qa,allowFreeText:!0,InputProps:{inputProps:{className:`${N}-inputText`,placeholder:"Select Group or Enter New Name",onChange:f=>u(f.target.value)}},width:"100%",onSelectionChange:(f,w)=>u(w||"")})]}),z(ye,{className:be,children:[S(xe,{children:"Layout Name"}),S(za,{inputProps:{className:`${N}-inputText`,placeholder:"Enter Layout Name"},onChange:f=>i(f.target.value),value:r})]}),z(ye,{className:be,children:[S(xe,{children:"Some Layout Setting"}),S("div",{className:`${N}-settingsGroup`,children:_a.map((f,w)=>S(Ba,{onToggle:()=>p(A=>A.includes(f)?A.filter(P=>P!==f):[...A,f]),checked:c.includes(f),label:f},w))})]}),z(ye,{className:be,children:[S(xe,{children:"Some Layout Setting"}),S("div",{className:`${N}-settingsGroup`,children:It.map((f,w)=>S(Oa,{onClick:()=>y(f),checked:h===f,label:f,groupName:"radioGroup"},w))})]})]}),S("div",{className:`${N}-screenshotContainer`,children:k})]}),z("div",{className:`${N}-buttonsContainer`,children:[S(Bt,{className:`${N}-cancelButton`,onClick:o,children:"Cancel"}),S(Bt,{className:`${N}-saveButton`,onClick:b,disabled:r===""||s==="",children:"Save"})]})]})};import{List as kn}from"@vuu-ui/vuu-ui-controls";import Sn,{useCallback as U,useContext as Pn,useEffect as Tn,useRef as Mn,useState as oo}from"react";import{resolveJSONPath as En}from"@vuu-ui/vuu-layout";import on from"clsx";import{useThemeAttributes as an}from"@vuu-ui/vuu-utils";import{useCallback as nn,useLayoutEffect as rn,useRef as qt}from"react";import{Button as Wa,Text as Ga}from"@salt-ds/core";import Qa from"clsx";import{jsx as zt,jsxs as Ka}from"react/jsx-runtime";var Xa="vuuDialogHeader",Ut=({hideCloseButton:e=!1,title:t,onClose:o,...a})=>Ka("div",{...a,className:Qa(Xa,"vuuToolbarProxy"),children:[zt(Ga,{className:"dialogHeader",children:t}),!e&&zt(Wa,{onClick:o,"data-align":"end","data-icon":"close",variant:"secondary"},"close")]});import{useCallback as Ya,useLayoutEffect as ja,useRef as en,useState as tn}from"react";var Jt=(e,t,o,a,n,r)=>{let{bottom:i,height:s,left:u,right:c,top:p,width:h}=e.getBoundingClientRect();switch(t){case"below":return{left:u+o,top:i+a};case"right":return{left:c+o,top:p+a};case"below-center":return{left:u+h/2+o,top:i+a};case"below-right":return{left:u,minWidth:n,top:i+a};case"below-full-width":return{left:u+o,minWidth:n,top:i+a,width:h};case"center":return r?{left:h/2-r.width/2+o,top:s/2-r.height/2+a,visibility:"visible"}:{left:h/2+o,top:s/2+a,visibility:"hidden"};default:throw Error("Popup getPositionRelativeToAnchor only supported placement values are below and right")}},Zt=({anchorElement:e,minWidth:t,offsetLeft:o=0,offsetTop:a=0,placement:n,position:r})=>{let i=en(null),[s,u]=tn(r);ja(()=>{if(n==="absolute"&&r)u(r);else if(e.current&&n!=="auto"){let p=i.current===null?void 0:i.current.getBoundingClientRect(),h=Jt(e.current,n,o,a,t,p);u(h)}},[e,t,o,a,n,r]);let c=Ya(p=>{if(i.current=p,p&&n==="center"&&e.current){let{height:h,width:y}=p.getBoundingClientRect();u(Jt(e.current,n,o,a,void 0,{height:h,width:y}))}},[e,o,a,n]);return{position:s,popupRef:n==="center"?c:void 0}};import{jsx as Ie,jsxs as ln}from"react/jsx-runtime";var _t="vuuDialog",sn={current:document.body},un={},Wt=({PopupProps:e=un,children:t,className:o,isOpen:a=!1,onClose:n,style:r,title:i,hideCloseButton:s=!1,...u})=>{let{anchorElement:c=sn,offsetLeft:p=0,offsetTop:h=0,placement:y="auto"}=e,v=qt(null),d=qt(null),[l,g,b]=an(),{position:k}=Zt({anchorElement:c,offsetLeft:p,offsetTop:h,placement:y}),f=nn(()=>{n==null||n()},[n]);return rn(()=>{if(v.current){if(a){v.current.showModal();let{left:w,top:A}=v.current.getBoundingClientRect();d.current&&(d.current.style.cssText=`left:-${w}px;position:absolute;top:-${A}px;`)}else v.current.close();if(y.endsWith("center")){let{width:w}=v.current.getBoundingClientRect();v.current.style.marginLeft=`-${w/2}px`}}},[a,y]),ln("dialog",{...u,className:on(_t,l),"data-mode":b,onClose:f,id:"vuu-dialog",ref:v,style:{...r,...k},children:[Ie(Ut,{hideCloseButton:s,onClose:f,title:i}),Ie("div",{className:`${_t}-body`,children:t}),Ie("div",{id:"vuu-dialog-portal-root",ref:d})]})};import{useCallback as cn,useState as pn}from"react";import{jsx as dn}from"react/jsx-runtime";var Gt=()=>{let[e,t]=pn(),o=cn(()=>{t(void 0)},[]);return{dialog:e?dn(Wt,{className:"vuDialog",isOpen:!0,onClose:o,style:{maxHeight:500},title:e.title,hideCloseButton:e.hideCloseButton,children:e.content}):null,setDialogState:t}};import{createContext as mn,useCallback as hn,useMemo as fn}from"react";import{jsx as Oe}from"react/jsx-runtime";var Qt=mn(null),gn=({children:e,context:t,menuActionHandler:o,menuBuilder:a})=>{let n=fn(()=>t!=null&&t.menuBuilders&&a?t.menuBuilders.concat(a):a?[a]:(t==null?void 0:t.menuBuilders)||[],[t,a]),r=hn(i=>{var s;if(o!=null&&o(i)||(s=t==null?void 0:t.menuActionHandler)!=null&&s.call(t,i))return!0},[t,o]);return Oe(Qt.Provider,{value:{menuActionHandler:r,menuBuilders:n},children:e})},Xt=({children:e,label:t,menuActionHandler:o,menuBuilder:a})=>Oe(Qt.Consumer,{children:n=>Oe(gn,{context:n,label:t,menuActionHandler:o,menuBuilder:a,children:e})});import vn,{useState as fu,useContext as yn,useCallback as gu,useEffect as vu}from"react";import xu from"clsx";import{getUniqueId as wu}from"@vuu-ui/vuu-utils";import{jsx as Su,jsxs as Pu}from"react/jsx-runtime";var xn=vn.createContext({notify:()=>"have you forgotten to provide a NotificationProvider?"});var Kt=()=>yn(xn);var we={layout:{type:"Component",id:"loading-main",props:{}}},Le={layout:{type:"Stack",id:"main-tabs",props:{className:"vuuShell-mainTabs",TabstripProps:{allowAddTab:!0,allowCloseTab:!0,allowRenameTab:!0,animateSelectionThumb:!1,location:"main-tab",tabClassName:"MainTab"},preserve:!0,active:0},children:[{props:{id:"tab1",title:"Tab 1",className:"vuuShell-Placeholder"},type:"Placeholder"}]}};import{getLocalEntity as ze,saveLocalEntity as Ue}from"@vuu-ui/vuu-filters";import{formatDate as bn,getUniqueId as wn}from"@vuu-ui/vuu-utils";var Yt="layouts/metadata",jt="layouts/layouts",K,Ce=class{constructor(t){nt(this,K,"api/vui");t&&rt(this,K,t)}createLayout(t,o){return new Promise(a=>{Promise.all([this.loadLayouts(),this.loadMetadata()]).then(([n,r])=>{let i=wn(),s={...t,id:i,created:bn({date:"dd.mm.yyyy"})(new Date)};this.saveLayoutsWithMetadata([...n,{id:i,json:o}],[...r,s]),a(s)})})}updateLayout(t,o,a){return new Promise((n,r)=>{this.validateIds(t).then(()=>Promise.all([this.loadLayouts(),this.loadMetadata()])).then(([i,s])=>{let u=i.map(p=>p.id===t?{...p,json:a}:p),c=s.map(p=>p.id===t?{...p,...o}:p);this.saveLayoutsWithMetadata(u,c),n()}).catch(i=>r(i))})}deleteLayout(t){return new Promise((o,a)=>{this.validateIds(t).then(()=>Promise.all([this.loadLayouts(),this.loadMetadata()])).then(([n,r])=>{let i=n.filter(u=>u.id!==t),s=r.filter(u=>u.id!==t);this.saveLayoutsWithMetadata(i,s),o()}).catch(n=>a(n))})}loadLayout(t){return new Promise((o,a)=>{this.validateId(t,"layout").then(()=>this.loadLayouts()).then(n=>{let r=n.find(i=>i.id===t);r?o(r.json):a(new Error(`no layout found matching id ${t}`))}).catch(n=>a(n))})}loadMetadata(){return new Promise(t=>{let o=ze(Yt);t(o||[])})}loadApplicationJSON(){return new Promise(t=>{let o=ze(De(this,K));t(o||Le)})}saveApplicationJSON(t){return new Promise((o,a)=>{Ue(De(this,K),t)?o():a(new Error("Application Json failed to save"))})}loadLayouts(){return new Promise(t=>{let o=ze(jt);t(o||[])})}saveLayoutsWithMetadata(t,o){Ue(jt,t),Ue(Yt,o)}async validateIds(t){return Promise.all([this.validateId(t,"metadata").catch(o=>o.message),this.validateId(t,"layout").catch(o=>o.message)]).then(o=>{let a=o.filter(n=>n!==void 0).join("; ");if(a)throw new Error(a)})}validateId(t,o){return new Promise((a,n)=>{(o==="metadata"?this.loadMetadata:this.loadLayouts)().then(i=>{switch(i.filter(u=>u.id===t).length){case 1:{a();break}case 0:{n(new Error(`No ${o} with ID ${t}`));break}default:n(new Error(`Non-unique ${o} with ID ${t}`))}})})}};K=new WeakMap;import{useCallback as eo,useMemo as Ln}from"react";import{jsx as Cn}from"react/jsx-runtime";var to=e=>{let{saveLayout:t}=Y(),o=eo(()=>{e(void 0)},[e]),a=eo(i=>{t(i),e(void 0)},[t,e]),[n,r]=Ln(()=>[(i,s)=>{let u=i.split(" "),c=[];return u.includes("main-tab")&&c.push({label:"Save Layout",action:"save-layout",options:s},{label:"Layout Settings",action:"layout-settings",options:s}),c},i=>{var s,u;return console.log("menu action",{action:i}),i.menuId==="save-layout"?(e({content:Cn(Ot,{onCancel:o,onSave:a,componentId:(s=i.options)==null?void 0:s.controlledComponentId,defaultTitle:(u=i.options)==null?void 0:u.controlledComponentTitle}),title:"Save Layout",hideCloseButton:!0}),!0):!1}],[o,a,e]);return{buildMenuOptions:n,handleMenuAction:r}};import{jsx as Dn}from"react/jsx-runtime";var Je,re=()=>(Je===void 0&&(Je=new Ce),Je),ao=Sn.createContext({getApplicationSettings:()=>{},layoutMetadata:[],saveLayout:()=>{},applicationJson:Le,saveApplicationLayout:()=>{},saveApplicationSettings:()=>{},loadLayoutById:()=>{}}),Nn=(e,t)=>{var o;return((o=e.props)==null?void 0:o.title)!==void 0?e:{...e,props:{...e.props,title:t.name}}},ol=e=>{let[t,o]=oo([]),[,a]=oo({}),{notify:n}=Kt(),r=Mn(we),i=U((d,l=!0)=>{r.current=d,l&&a({})},[]),s=U((d,l=!0)=>{i({...r.current,layout:d},l)},[i]),u=U(d=>{i({...r.current,settings:{...r.current.settings,...d}},!1)},[i]);Tn(()=>{let d=re();d.loadMetadata().then(l=>{o(l)}).catch(l=>{n({type:"error",header:"Failed to Load Layouts",body:"Could not load list of available layouts"}),console.error("Error occurred while retrieving metadata",l)}),d.loadApplicationJSON().then(l=>{i(l)}).catch(l=>{n({type:"error",header:"Failed to Load Layout",body:"Could not load your latest view"}),console.error("Error occurred while retrieving application layout",l)})},[n,i]);let c=U(d=>{s(d,!1),re().saveApplicationJSON(r.current)},[s]),p=U(d=>{let l=En(r.current.layout,"#main-tabs.ACTIVE_CHILD");l?re().createLayout(d,Nn(l,d)).then(g=>{n({type:"success",header:"Layout Saved Successfully",body:`${g.name} saved successfully`}),o(b=>[...b,g])}).catch(g=>{n({type:"error",header:"Failed to Save Layout",body:`Failed to save layout ${d.name}`}),console.error("Error occurred while saving layout",g)}):n({type:"error",header:"Failed to Save Layout",body:"Cannot save undefined layout"})},[n]),h=U((d,l)=>{let{settings:g}=r.current;u(l?{...g,[l]:d}:d),re().saveApplicationJSON(r.current)},[u]),y=U(d=>{let{settings:l}=r.current;return d?l==null?void 0:l[d]:l},[]),v=U(d=>{re().loadLayout(d).then(l=>{var b,k;let{layout:g}=r.current;s({...g,children:(g.children||[]).concat(l),props:{...g.props,active:(k=(b=g.children)==null?void 0:b.length)!=null?k:0}})}).catch(l=>{n({type:"error",header:"Failed to Load Layout",body:"Failed to load the requested layout"}),console.error("Error occurred while loading layout",l)})},[n,s]);return Dn(ao.Provider,{value:{getApplicationSettings:y,layoutMetadata:t,saveLayout:p,applicationJson:r.current,saveApplicationLayout:c,saveApplicationSettings:h,loadLayoutById:v},children:e.children})},Y=()=>Pn(ao);import{jsx as ie,jsxs as no}from"react/jsx-runtime";var Se="vuuLayoutTile",ro=e=>{let{metadata:t,handleLoadLayout:o}=e;return ie("div",{role:"listitem",children:no("div",{className:`${Se}-layoutTile`,role:"button",onClick:()=>o(t==null?void 0:t.id),children:[ie("img",{className:`${Se}-screenshot`,src:t==null?void 0:t.screenshot}),no("div",{children:[ie("div",{className:`${Se}-layoutName`,children:t==null?void 0:t.name}),ie("div",{className:`${Se}-layoutDetails`,children:ie("div",{children:`${t==null?void 0:t.user}, ${t==null?void 0:t.created}`})})]})]},t==null?void 0:t.id)})};import{Fragment as An,jsx as se,jsxs as io}from"react/jsx-runtime";var Ze="vuuLayoutList",so=e=>{let{layoutMetadata:t,loadLayoutById:o}=Y(),a=r=>{r&&o(r)},n=t.reduce((r,i)=>r[i.group]?{...r,[i.group]:[...r[i.group],i]}:{...r,[i.group]:[i]},{});return io("div",{className:Ze,...e,role:"listbox","aria-label":"my layouts",children:[se("div",{className:`${Ze}-header`,children:"My Layouts"}),se(kn,{height:"auto",source:Object.entries(n),ListItem:({item:r})=>{if(!r)return se(An,{});let[i,s]=r;return io("div",{role:"list","aria-label":i,children:[se("div",{className:`${Ze}-groupName`,children:i}),s.map(u=>se(ro,{metadata:u,handleLoadLayout:a},u.id))]})}})]})};import{VuuLogo as Rn}from"@vuu-ui/vuu-icons";import{Stack as $n,useLayoutProviderDispatch as Bn}from"@vuu-ui/vuu-layout";import{Tab as Pe,Tabstrip as In}from"@vuu-ui/vuu-ui-controls";import{useThemeAttributes as On}from"@vuu-ui/vuu-utils";import We from"clsx";import{useCallback as Ge,useState as zn}from"react";import{Palette as Vn,PaletteItem as Fn}from"@vuu-ui/vuu-layout";import{jsx as ue,jsxs as Hn}from"react/jsx-runtime";var qe="vuuFeatureList",_e=({features:e,title:t="VUU TABLES",...o})=>{let a={},n={height:"100%"};return Hn("div",{...o,className:qe,children:[ue("div",{className:`${qe}-header`,children:t}),ue("div",{className:`${qe}-content`,children:ue(Vn,{orientation:"vertical",ListProps:n,ViewProps:a,children:e.map((r,i)=>ue(Fn,{closeable:!0,label:r.title,resizeable:!0,resize:"defer",header:!0,children:ue(he,{...r})},i))})})]})};import{jsx as D,jsxs as Te}from"react/jsx-runtime";var j="vuuLeftNav",Un=(e,t)=>e===0?t?"menu-full":"menu-icons":t?"menu-full-content":"menu-icons-content",_l=e=>{let t=Bn(),[o]=On(),{"data-path":a,defaultExpanded:n=!0,defaultActiveTabIndex:r=0,features:i,onActiveChange:s,onTogglePrimaryMenu:u,sizeCollapsed:c=80,sizeContent:p=300,sizeExpanded:h=240,style:y,tableFeatures:v,...d}=e,[l,g]=zn({activeTabIndex:r,expanded:n}),b=Ge((P,R)=>P===0?R?h:c:R?h+p:c+p,[c,p,h]),k=Ge(P=>{let{activeTabIndex:R,expanded:$}=l;if(g({activeTabIndex:P,expanded:$}),P===0||R===0){let x=b(P,$);t({type:"layout-resize",path:"#vuu-side-panel",size:x})}s==null||s(P)},[t,b,l,s]),f=Un(l.activeTabIndex,l.expanded),w=Ge(()=>{let{activeTabIndex:P,expanded:R}=l,$=!R;g({activeTabIndex:P,expanded:$}),t({type:"layout-resize",path:"#vuu-side-panel",size:b(P,$)}),u==null||u($)},[t,b,l,u]),A={...y,"--nav-menu-collapsed-width":`${c}px`,"--nav-menu-expanded-width":`${h}px`,"--nav-menu-content-width":`${p}px`};return Te("div",{...d,className:We(j,`${j}-${f}`),style:A,children:[Te("div",{className:We(`${j}-menu-primary`,o),"data-mode":"dark",children:[D("div",{className:"vuuLeftNav-logo",children:D(Rn,{})}),D("div",{className:`${j}-main`,children:Te(In,{activeTabIndex:l.activeTabIndex,animateSelectionThumb:!1,className:`${j}-Tabstrip`,onActiveChange:k,orientation:"vertical",children:[D(Pe,{"data-icon":"demo",label:"DEMO"}),D(Pe,{"data-icon":"features",label:"VUU FEATURES"}),D(Pe,{"data-icon":"tables",label:"VUU TABLES"}),D(Pe,{"data-icon":"layouts",label:"MY LAYOUTS"})]})}),D("div",{className:"vuuLeftNav-buttonBar",children:D("button",{className:We("vuuLeftNav-toggleButton",{"vuuLeftNav-toggleButton-open":f.startsWith("menu-full"),"vuuLeftNav-toggleButton-closed":f.startsWith("menu-icons")}),"data-icon":f.startsWith("menu-full")?"chevron-left":"chevron-right",onClick:w})})]}),Te($n,{active:l.activeTabIndex-1,className:`${j}-menu-secondary`,showTabs:!1,children:[D(_e,{features:i,title:"VUU FEATURES"}),D(_e,{features:v,title:"VUU TABLES"}),D("div",{className:"vuuLeftNav-drawer",children:D(so,{})})]})]})};import{VuuDataSource as Jn}from"@vuu-ui/vuu-data-remote";import{buildColumnMap as Zn,hasAction as qn,isErrorResponse as _n,isValidNumber as uo,shallowEquals as Wn}from"@vuu-ui/vuu-utils";import{Button as lo,useIdMemo as Gn}from"@salt-ds/core";import co from"clsx";import{useCallback as ee,useEffect as po,useMemo as Qn,useRef as Qe,useState as mo}from"react";import{jsx as Z,jsxs as Xe}from"react/jsx-runtime";var I="vuuSessionEditingForm",ho=(e,t)=>{let o=e.find(a=>a.name===t);if(o)return o;throw Error(`SessionEditingForm, no field '${t}' found`)},fo=e=>{let{dataset:{field:t},value:o}=e.target;if(t===void 0)throw Error("SessionEditingForm, form field has no field name");return[t,o]},O={uninitialised:0,unchanged:1,changed:2,invalid:3};function go(e,t,o=!1){switch(t){case"int":case"long":{let a=parseInt(e,10);if(uo(a))return a;if(o)throw Error("SessionEditingForm getTypedValue");return}case"double":{let a=parseFloat(e);return uo(a)?a:void 0}case"boolean":return e==="true";default:return e}}var Xn=(e,t)=>{if(e)return e;if(t)return new Jn({bufferSize:0,table:t.table,columns:t.columns.map(o=>o.name)});throw Error("SessionEditingForm: either a DataSource or a TableSchema must be provided")},uc=({className:e,config:{fields:t,key:o},dataSource:a,id:n,onClose:r,schema:i,...s})=>{let[u,c]=mo(),[p,h]=mo(""),y=Qe(null),v=Qe(),d=Qe(O.uninitialised),l=Qn(()=>{let m=F=>{if(V){let L={};for(let q of l.columns)L[q]=F[V[q]];d.current===O.uninitialised&&(d.current=O.unchanged,v.current=L),c(L)}},x=Xn(a,i),V=Zn(x.columns);return x.subscribe({range:{from:0,to:5}},F=>{F.type==="viewport-update"&&F.rows&&(d.current===O.uninitialised?m(F.rows[0]):console.log("what do we do with server updates"))}),x},[a,i]),g=Gn(n),b=ee(m=>{let[x,V]=fo(m),{type:F}=ho(t,x),L=go(V,F);c((q={})=>{let ot={...q,[x]:L},Do=Wn(ot,v.current);return d.current=Do?O.unchanged:L!==void 0?O.changed:O.invalid,ot})},[t]),k=ee(m=>{let[x,V]=fo(m),{type:F}=ho(t,x),L=u==null?void 0:u[o],q=go(V,F,!0);typeof L=="string"&&l.menuRpcCall({rowKey:L,field:x,value:q,type:"VP_EDIT_CELL_RPC"})},[l,t,o,u]),f=ee(m=>{typeof m=="object"&&m!==null&&"type"in m&&m.type==="CLOSE_DIALOG_ACTION"&&r()},[r]),w=ee(async()=>{let m=await l.menuRpcCall({type:"VP_EDIT_SUBMIT_FORM_RPC"});_n(m)?h(m.error):qn(m)&&f(m.action)},[f,l]),A=ee(m=>{m.key==="Enter"&&d.current===O.changed&&w()},[w]),P=ee(()=>{r()},[r]),R=m=>{var V;let x=String((V=u==null?void 0:u[m.name])!=null?V:"");return m.readonly||m.name===o?Z("div",{className:`${I}-fieldValue vuuReadOnly`,children:x}):Z("input",{className:`${I}-fieldValue`,"data-field":m.name,onBlur:k,onChange:b,type:"text",value:x,id:`${g}-input-${m.name}`})};po(()=>{if(y.current){let m=y.current.querySelector("input");m&&setTimeout(()=>{m.focus(),m.select()},100)}},[]),po(()=>()=>{l&&l.unsubscribe()},[l]);let $=d.current===O.changed;return Xe("div",{...s,className:co(I,e),children:[p?Z("div",{className:`${I}-errorBanner`,"data-icon":"error",title:p,children:"Error, edit(s) not saved"}):void 0,Z("div",{className:`${I}-content`,ref:y,onKeyDown:A,children:t.map(m=>{var x;return Xe("div",{className:`${I}-field`,children:[Z("label",{className:co(`${I}-fieldLabel`,{[`${I}-required`]:m.required}),htmlFor:`${g}-input-${m.name}`,children:(x=m==null?void 0:m.label)!=null?x:m.description}),R(m)]},m.name)})}),Xe("div",{className:`${I}-buttonbar salt-theme salt-density-high`,children:[Z(lo,{type:"submit",variant:"cta",disabled:!$,onClick:w,children:"Submit"}),Z(lo,{variant:"secondary",onClick:P,children:"Cancel"})]})]})};import{connectToServer as gr}from"@vuu-ui/vuu-data-remote";import{DraggableLayout as vr,LayoutProvider as yr,StackLayout as xr}from"@vuu-ui/vuu-layout";import{logger as br,ThemeProvider as wr,useThemeAttributes as Lr}from"@vuu-ui/vuu-utils";import Cr from"clsx";import{useCallback as Ye,useEffect as Sr,useRef as Mo}from"react";import{Button as Kn}from"@salt-ds/core";import vo from"clsx";import{useCallback as Yn,useMemo as jn}from"react";import{layoutFromJson as er,View as tr,useLayoutProviderDispatch as or}from"@vuu-ui/vuu-layout";import{jsx as Me,jsxs as yo}from"react/jsx-runtime";var H="vuuContextPanel",xo=({className:e,expanded:t=!1,content:o,overlay:a=!1,title:n})=>{let r=or(),i=Yn(()=>{r({path:"#context-panel",propName:"expanded",propValue:!1,type:"set-prop"})},[r]),s=vo(H,e,{[`${H}-expanded`]:t,[`${H}-inline`]:a!==!0,[`${H}-overlay`]:a}),u=jn(()=>o&&t?er(o,"context-0"):null,[o,t]);return Me("div",{className:vo(H,s,{[`${H}-expanded`]:t}),children:yo(tr,{className:`${H}-inner`,header:!1,id:"context-panel",children:[yo("div",{className:`${H}-header`,children:[Me("h2",{className:`${H}-title`,children:n}),Me(Kn,{className:`${H}-close`,"data-icon":"close",onClick:i,variant:"secondary"})]}),Me("div",{className:`${H}-content`,children:u})]})})};import{DraggableLayout as sr,Flexbox as wo}from"@vuu-ui/vuu-layout";import{useMemo as ar}from"react";import nr from"clsx";import{jsx as ir}from"react/jsx-runtime";var rr="vuuShellSidePanel",bo=({children:e,open:t=!0,sizeClosed:o=90,sizeOpen:a=200,style:n,...r})=>{let i=ar(()=>({...n,"--shell-left-nav-size":t?`${a}px`:`${o}px`}),[t,o,a,n]);return ir("div",{...r,className:nr(rr),style:i,children:e})};import{jsx as Ke,jsxs as Lo}from"react/jsx-runtime";var Co=({appHeader:e,LeftSidePanelProps:t})=>Lo(wo,{className:"App",style:{flexDirection:"row",height:"100%",width:"100%"},children:[Ke(bo,{...t,id:"vuu-side-panel"}),Lo(wo,{className:"vuuShell-content",style:{flex:1,flexDirection:"column"},children:[e,Ke(sr,{dropTarget:!0,style:{flex:1}},"main-content")]}),Ke(xo,{id:"context-panel",overlay:!0})]});import{DockLayout as ur,DraggableLayout as lr,Drawer as cr,Flexbox as pr,View as dr}from"@vuu-ui/vuu-layout";import{useCallback as So,useRef as mr,useState as hr}from"react";import{jsx as Ee,jsxs as fr}from"react/jsx-runtime";var Po=({appHeader:e,LeftSidePanelProps:t})=>{let o=mr(null),[a,n]=hr(!0),r=So(s=>{var c;let u=s.target;(c=o.current)!=null&&c.contains(u)||n(!a)},[a]),i=So(s=>{let u=[];return u.push(Ee(cr,{onClick:r,open:a,position:"left",inline:!0,peekaboo:!0,sizeOpen:200,toggleButton:"end",children:Ee(dr,{className:"vuuShell-palette",id:"vw-app-palette",ref:o,style:{height:"100%"},children:s},"app-palette")},"left-panel")),u},[r,a]);return fr(pr,{className:"App",style:{flexDirection:"column",height:"100%",width:"100%"},children:[e,Ee(ur,{style:{flex:1},children:i(t==null?void 0:t.children).concat(Ee(lr,{dropTarget:!0,style:{width:"100%",height:"100%"}},"main-content"))})]})};var To=({leftSidePanelLayout:e="inlay",...t})=>(e==="inlay"?Po:Co)(t);import{jsx as Ne,jsxs as Tr}from"react/jsx-runtime";typeof xr!="function"&&console.warn("StackLayout module not loaded, will be unsbale to deserialize from layout JSON");var{error:je}=br("Shell"),Pr={},yp=({LayoutProps:e,LeftSidePanelProps:t=Pr,children:o,className:a,leftSidePanelLayout:n,loginUrl:r,saveLocation:i="remote",saveUrl:s,serverUrl:u,user:c,...p})=>{let h=Mo(null),{dialog:y,setDialogState:v}=Gt(),d=Mo("latest"),{applicationJson:l,saveApplicationLayout:g,loadLayoutById:b}=Y(),{buildMenuOptions:k,handleMenuAction:f}=to(v),w=Ye(L=>{try{g(L)}catch{je==null||je("Failed to save layout")}},[g]),A=Ye(L=>{h.current&&(h.current.dataset.mode=L)},[]),P=Ye(L=>{d.current=L,b(L)},[b]);Sr(()=>{u&&c.token&&gr({authToken:c.token,url:u,username:c.username})},[u,c.token,c.username]);let[R,$,m]=Lr(),x=Cr("vuuShell",a,R,$),V=l===we,F=To({LeftSidePanelProps:t,leftSidePanelLayout:n,appHeader:Ne(mt,{layoutId:d.current,loginUrl:r,user:c,onNavigate:P,onSwitchTheme:A})});return V?null:Ne(wr,{children:Tr(Xt,{menuActionHandler:f,menuBuilder:k,children:[Ne(yr,{...e,layout:l.layout,onLayoutChange:w,children:Ne(vr,{className:x,"data-mode":m,ref:h,...p,children:F})}),o||y]})})};var wp=e=>e==="*",Lp=e=>typeof e=="object"&&typeof e.module=="string"&&typeof e.table=="string";import{createContext as Mr,useContext as Er}from"react";import{jsx as et}from"react/jsx-runtime";var Nr={},tt=Mr(Nr),Dr=({children:e,context:t,inheritedContext:o})=>{let a={...o,...t};return et(tt.Provider,{value:a,children:e})},Mp=({children:e,value:t})=>et(tt.Consumer,{children:o=>et(Dr,{context:t,inheritedContext:o,children:e})}),Ep=()=>Er(tt);import kr from"clsx";import{ToggleButton as Eo,ToggleButtonGroup as Ar,useControlled as Vr}from"@salt-ds/core";import{useCallback as Fr}from"react";import{jsx as No,jsxs as Rr}from"react/jsx-runtime";var Hr="vuuThemeSwitch",Ip=({className:e,defaultMode:t,mode:o,onChange:a,...n})=>{let[r,i]=Vr({controlled:o,default:t!=null?t:"light",name:"ThemeSwitch",state:"mode"}),s=Fr(c=>{let{value:p}=c.target;i(p),a(p)},[a,i]),u=kr(Hr,e);return Rr(Ar,{className:u,...n,onChange:s,value:r,children:[No(Eo,{"aria-label":"alert","data-icon":"light",value:"dark"}),No(Eo,{"aria-label":"home","data-icon":"dark",value:"light"})]})};export{mt as AppHeader,Si as ConnectionStatusIcon,xo as ContextPanel,he as Feature,_e as FeatureList,so as LayoutList,ao as LayoutManagementContext,ol as LayoutManagementProvider,_l as LeftNav,Kr as LoginPanel,Ot as SaveLayoutPanel,uc as SessionEditingForm,yp as Shell,Mp as ShellContextProvider,bo as SidePanel,Ip as ThemeSwitch,ti as getAuthDetailsFromCookies,Ro as getAuthModeFromCookies,Lp as isTableSchema,wp as isWildcardSchema,dt as logout,Bo as redirectToLogin,Y as useLayoutManager,Ep as useShellContext,To as useShellLayout};
|
|
1
|
+
var ne=(t,e,o)=>{if(!e.has(t))throw TypeError("Cannot "+o)};var kt=(t,e,o)=>(ne(t,e,"read from private field"),o?o.call(t):e.get(t)),re=(t,e,o)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,o)},ie=(t,e,o,a)=>(ne(t,e,"write to private field"),a?a.call(t,o):e.set(t,o),o);import{useCallback as Bo}from"react";import{Toolbar as Io}from"@vuu-ui/vuu-layout";import Oo from"clsx";import{useCallback as ue,useEffect as ko,useRef as Ao,useState as le}from"react";import{Button as Vo,FormField as ce,FormFieldLabel as de}from"@salt-ds/core";import{VuuInput as pe}from"@vuu-ui/vuu-ui-controls";import{useMemo as Do}from"react";import{jsx as P,jsxs as _}from"react/jsx-runtime";var se=()=>Do(()=>_("svg",{width:"184",height:"90",viewBox:"0 0 184 90",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[_("g",{clipPath:"url(#clip0_1173_59965)",children:[P("path",{d:"M77.0775 31.1019L69.4572 15.1795L66.3997 13.7093L47.6353 44.165L75.7224 61.2361L81.8124 51.2694L77.0775 31.1019Z",fill:"url(#paint0_linear_1173_59965)"}),P("path",{d:"M82.4101 49.7431C81.0488 51.8314 79.1993 53.648 76.8897 54.9809C74.2954 56.4792 71.4601 57.194 68.6623 57.194C63.3422 57.194 58.1597 54.6188 55.0209 49.971L30.5358 7.8193L30.5232 7.84116C25.8791 0.274825 16.0118 -2.26289 8.27258 2.21011C0.411306 6.74866 -2.26753 16.7872 2.28587 24.625L35.5054 81.8189C36.9856 84.3691 39.0542 86.3668 41.4358 87.7527C41.4545 87.7652 41.4733 87.7777 41.4921 87.7902C41.5015 87.7964 41.514 87.8027 41.5234 87.8089C42.6312 88.4457 43.8079 88.942 45.0253 89.3072C45.116 89.3353 45.2099 89.3634 45.3007 89.3883C45.7388 89.5101 46.1801 89.6193 46.6276 89.7067C46.7121 89.7223 46.7966 89.7317 46.8811 89.7473C47.241 89.8097 47.604 89.8628 47.967 89.9003C48.111 89.9159 48.2549 89.9315 48.3989 89.9408C48.8151 89.9752 49.2313 89.997 49.6507 90.0001C49.6726 90.0001 49.6945 90.0001 49.7132 90.0001C49.7195 90.0001 49.7226 90.0001 49.7289 90.0001C49.7352 90.0001 49.7383 90.0001 49.7445 90.0001C50.1983 90.0001 50.6552 89.9752 51.109 89.9377C51.2123 89.9283 51.3155 89.919 51.422 89.9065C51.8663 89.8597 52.3107 89.8004 52.7551 89.7192C52.7614 89.7192 52.7676 89.7192 52.7739 89.7192C53.2621 89.6287 53.7503 89.5101 54.2322 89.3727C54.2635 89.3634 54.2917 89.354 54.323 89.3446C55.024 89.1418 55.7156 88.8889 56.3978 88.5861C56.4104 88.5799 56.426 88.5736 56.4385 88.5674C56.958 88.3364 57.4712 88.0836 57.9751 87.7933C58.4852 87.4999 58.9703 87.1815 59.4334 86.8413C59.8371 86.5478 60.2252 86.2357 60.6039 85.9048C61.0639 85.499 61.4989 85.0745 61.9026 84.6282C62.2062 84.2942 62.4972 83.9446 62.7757 83.5825C62.8665 83.4639 62.951 83.3421 63.0355 83.2235C63.2264 82.9613 63.4079 82.6929 63.5831 82.4182C63.6739 82.2746 63.7646 82.1342 63.8523 81.9906C63.8867 81.9344 63.9242 81.8813 63.9555 81.8251L82.5854 49.7525H82.4039L82.4101 49.7431Z",fill:"url(#paint1_linear_1173_59965)"}),P("path",{d:"M82.8264 32.8436L81.4181 30.4464L75.3375 19.1687L72.5178 14.3929C71.9858 13.1225 70.7309 12.2266 69.26 12.2266C67.3104 12.2266 65.7331 13.8029 65.7331 15.7445C65.7331 16.4031 65.924 17.0086 66.2401 17.5362L66.2025 17.5611L77.1557 36.1617C78.4764 38.4372 78.83 41.0873 78.1509 43.6281C77.4718 46.169 75.8445 48.2915 73.5631 49.6119C72.0609 50.4797 70.3553 50.9385 68.6341 50.9385C65.1166 50.9385 61.84 49.0563 60.0812 46.0285L44.3368 19.2654H44.3681L37.7179 7.81917L37.7054 7.84102C37.5896 7.65061 37.455 7.47893 37.333 7.29477L37.1452 6.97326C37.1452 6.97326 37.1296 6.98262 37.1233 6.98887C34.0001 2.55332 29.0054 0.0780356 23.8512 0.0187285V0H15.3515V0.0436999C21.2881 -0.368328 27.2247 2.46593 30.5232 7.84102L30.5357 7.81917L55.0177 49.974C58.1566 54.6187 63.3422 57.197 68.6592 57.197C71.4569 57.197 74.2922 56.4853 76.8866 54.9839C79.1961 53.651 81.0425 51.8312 82.407 49.7461H82.5885L82.5259 49.8523C83.399 48.4695 84.0687 46.9462 84.5006 45.3231C85.6304 41.0904 85.042 36.6705 82.8201 32.8467L82.8264 32.8436Z",fill:"#F37880"}),_("g",{opacity:"0.86",children:[P("path",{d:"M66.1994 17.5642L77.1526 36.1648C78.4732 38.4403 78.8269 41.0904 78.1478 43.6313C77.7347 45.1795 76.9648 46.5716 75.9133 47.7234C77.2903 46.4686 78.2823 44.8486 78.7737 43.007C79.4527 40.4661 79.0991 37.816 77.7785 35.5405L66.8253 16.94L66.8628 16.915C66.5467 16.3875 66.3558 15.7819 66.3558 15.1233C66.3558 14.3117 66.6344 13.5657 67.0975 12.9695C66.2651 13.6125 65.7299 14.6176 65.7299 15.7476C65.7299 16.4062 65.9208 17.0118 66.2369 17.5393L66.1994 17.5642Z",fill:"white"}),P("path",{d:"M82.5382 49.8335L82.5291 49.8487C82.5291 49.8487 82.5352 49.8365 82.5413 49.8304C82.5413 49.8304 82.5413 49.8304 82.5413 49.8335H82.5382Z",fill:"white"}),P("path",{d:"M77.5156 54.3596C74.9213 55.8579 72.0859 56.5727 69.2882 56.5727C63.9681 56.5727 58.7856 53.9975 55.6467 49.3497L31.1616 7.19488L31.1491 7.21673C28.9053 3.56154 25.4441 1.08626 21.5917 0H15.3515V0.0436999C21.2881 -0.368328 27.2247 2.46593 30.5232 7.84102L30.5357 7.81917L55.0177 49.974C58.1566 54.6187 63.3422 57.197 68.6592 57.197C71.4569 57.197 74.2922 56.4853 76.8866 54.9839C78.2698 54.1848 79.4809 53.2109 80.5293 52.1122C79.6311 52.9581 78.6266 53.7166 77.5125 54.3596H77.5156Z",fill:"white"})]})]}),P("path",{d:"M117.046 58.661C116.362 58.661 115.792 58.509 115.336 58.205C114.906 57.8757 114.551 57.3943 114.272 56.761L104.354 34.493C104.076 33.8597 104 33.3023 104.126 32.821C104.253 32.3397 104.519 31.9597 104.924 31.681C105.33 31.4023 105.811 31.263 106.368 31.263C107.103 31.263 107.648 31.4277 108.002 31.757C108.382 32.061 108.699 32.5297 108.952 33.163L117.958 54.025H116.324L125.292 33.125C125.571 32.517 125.9 32.061 126.28 31.757C126.66 31.4277 127.192 31.263 127.876 31.263C128.434 31.263 128.89 31.4023 129.244 31.681C129.624 31.9597 129.865 32.3397 129.966 32.821C130.068 33.3023 129.979 33.8597 129.7 34.493L119.782 56.761C119.504 57.3943 119.149 57.8757 118.718 58.205C118.313 58.509 117.756 58.661 117.046 58.661Z",fill:"white"}),P("path",{d:"M144.63 58.737C142.781 58.737 141.147 58.4963 139.728 58.015C138.335 57.5337 137.157 56.8243 136.194 55.887C135.232 54.9243 134.51 53.7337 134.028 52.315C133.547 50.8963 133.306 49.2497 133.306 47.375V33.733C133.306 32.897 133.509 32.2763 133.914 31.871C134.345 31.4657 134.953 31.263 135.738 31.263C136.524 31.263 137.119 31.4657 137.524 31.871C137.955 32.2763 138.17 32.897 138.17 33.733V47.337C138.17 49.7437 138.715 51.555 139.804 52.771C140.919 53.9617 142.528 54.557 144.63 54.557C146.733 54.557 148.329 53.9617 149.418 52.771C150.508 51.555 151.052 49.7437 151.052 47.337V33.733C151.052 32.897 151.255 32.2763 151.66 31.871C152.091 31.4657 152.699 31.263 153.484 31.263C154.244 31.263 154.827 31.4657 155.232 31.871C155.663 32.2763 155.878 32.897 155.878 33.733V47.375C155.878 49.8577 155.448 51.9477 154.586 53.645C153.75 55.3423 152.496 56.6217 150.824 57.483C149.152 58.319 147.088 58.737 144.63 58.737Z",fill:"white"}),P("path",{d:"M172.685 58.737C170.836 58.737 169.202 58.4963 167.783 58.015C166.39 57.5337 165.212 56.8243 164.249 55.887C163.286 54.9243 162.564 53.7337 162.083 52.315C161.602 50.8963 161.361 49.2497 161.361 47.375V33.733C161.361 32.897 161.564 32.2763 161.969 31.871C162.4 31.4657 163.008 31.263 163.793 31.263C164.578 31.263 165.174 31.4657 165.579 31.871C166.01 32.2763 166.225 32.897 166.225 33.733V47.337C166.225 49.7437 166.77 51.555 167.859 52.771C168.974 53.9617 170.582 54.557 172.685 54.557C174.788 54.557 176.384 53.9617 177.473 52.771C178.562 51.555 179.107 49.7437 179.107 47.337V33.733C179.107 32.897 179.31 32.2763 179.715 31.871C180.146 31.4657 180.754 31.263 181.539 31.263C182.299 31.263 182.882 31.4657 183.287 31.871C183.718 32.2763 183.933 32.897 183.933 33.733V47.375C183.933 49.8577 183.502 51.9477 182.641 53.645C181.805 55.3423 180.551 56.6217 178.879 57.483C177.207 58.319 175.142 58.737 172.685 58.737Z",fill:"white"}),_("defs",{children:[_("linearGradient",{id:"paint0_linear_1173_59965",x1:"47.6353",y1:"37.4727",x2:"81.8124",y2:"37.4727",gradientUnits:"userSpaceOnUse",children:[P("stop",{stopColor:"#4906A5"}),P("stop",{offset:"1",stopColor:"#D3423A"})]}),_("linearGradient",{id:"paint1_linear_1173_59965",x1:"0.0670626",y1:"45.0017",x2:"82.5916",y2:"45.0017",gradientUnits:"userSpaceOnUse",children:[P("stop",{stopColor:"#7C06A5"}),P("stop",{offset:"1",stopColor:"#D3423A"})]}),P("clipPath",{id:"clip0_1173_59965",children:P("rect",{width:"85",height:"90",fill:"white",transform:"translate(0.0670471)"})})]})]}),[]);import Fo from"clsx";import{jsx as B,jsxs as et}from"react/jsx-runtime";var J="vuuLoginPanel",Yr=({appName:t="Demo App",className:e,requirePassword:o=!0,onSubmit:a,...n})=>{let[r,i]=le(""),[s,u]=le(""),c=Ao(null),d=()=>{a(r,s)},h=f=>{i(f.target.value)},y=f=>{u(f.target.value)},v=ue(()=>{o||a(r)},[a,o,r]),p=ue(()=>{r&&a(r,s)},[a,s,r]),l=r.trim()!==""&&(o===!1||s.trim()!=="");return ko(()=>{var f;console.log("inputRef",{input:c.current}),(f=c.current)==null||f.focus()},[]),et("div",{...n,className:Fo(J,e),children:[et("div",{className:`${J}-branding`,children:[B(se,{}),B("div",{className:`${J}-appName`,children:t})]}),et("div",{className:`${J}-form`,children:[B("div",{className:`${J}-title`,children:"Welcome Back"}),et(ce,{children:[B(de,{children:"Username"}),B(pe,{value:r,id:"text-username",inputRef:c,onChange:h,onCommit:v})]}),o?et(ce,{children:[B(de,{children:"Password"}),B(pe,{className:`${J}-password`,inputProps:{type:"password"},value:s,id:"text-password",onChange:y,onCommit:p,endAdornment:B("span",{"data-icon":"eye",style:{cursor:"pointer"}})})]}):null,B(Vo,{className:`${J}-login`,disabled:!l,onClick:d,variant:"cta",children:"Login"})]})]})};import{getCookieValue as At}from"@vuu-ui/vuu-utils";var Ho=()=>{let t=At("vuu-auth-mode");return t!=null?t:""},ot=()=>{let t=At("vuu-username"),e=At("vuu-auth-token");return[t,e]},Ro=()=>Ho()==="login"?"login.html":"demo.html",$o=(t=Ro())=>{window.location.href=t},me=t=>{document.cookie="vuu-username= ; expires = Thu, 01 Jan 1970 00:00:00 GMT",document.cookie="vuu-auth-token= ; expires = Thu, 01 Jan 1970 00:00:00 GMT",$o(t)};import{Button as ct}from"@salt-ds/core";import{jsx as dt,jsxs as Vt}from"react/jsx-runtime";var at="vuuAppHeader",he=({className:t,layoutId:e,loginUrl:o,onNavigate:a,onSwitchTheme:n,themeMode:r="light",user:i,...s})=>{let u=Oo(at,t),c=Bo(()=>{me(o)},[o]);return Vt(Io,{alignItems:"end",className:u,height:36,showSeparators:!0,...s,children:[dt(ct,{className:`${at}-menuItem`,variant:"secondary",children:"Help"}),Vt(ct,{className:`${at}-menuItem`,variant:"secondary",children:["History ",dt("span",{"data-icon":"history"})]}),Vt(ct,{className:`${at}-menuItem`,variant:"secondary",children:["View ",dt("span",{"data-icon":"settings"})]}),dt(ct,{className:`${at}-menuItem`,onClick:c,variant:"secondary",children:"Log out"})]})};import zo,{useEffect as Uo,useState as Jo}from"react";import Zo from"clsx";import{Fragment as qo,jsx as _o,jsxs as fe}from"react/jsx-runtime";var Si=({connectionStatus:t,className:e,element:o="span",...a})=>{let[n,r]=Jo("vuuConnectingStatus");Uo(()=>{switch(t){case"connected":case"reconnected":r("vuuActiveStatus");break;case"connecting":r("vuuConnectingStatus");break;case"disconnected":r("vuuDisconnectedStatus");break;default:break}},[t]);let i=zo.createElement(o,{...a,className:Zo("vuuStatus vuuIcon",n,e)});return _o(qo,{children:fe("div",{className:"vuuStatus-container salt-theme",children:[i,fe("div",{className:"vuuStatus-text",children:["Status: ",t.toUpperCase()]})]})})};import xe,{Suspense as Ko,useEffect as Yo}from"react";import{registerComponent as jo}from"@vuu-ui/vuu-layout";import Wo from"react";import{Fragment as Go,jsx as ge,jsxs as Qo}from"react/jsx-runtime";var pt=class extends Wo.Component{constructor(e){super(e),this.state={errorMessage:null}}static getDerivedStateFromError(e){return{errorMessage:e.message}}componentDidCatch(e,o){console.log(`error creating component at ${this.props.url}`),console.log(e,o)}render(){return this.state.errorMessage?Qo(Go,{children:[ge("h1",{children:"An error occured while creating component."}),ge("p",{children:this.state.errorMessage})]}):this.props.children}};import{jsx as Xo}from"react/jsx-runtime";var ve=()=>Xo("div",{className:"hwLoader"});var ye=async t=>{let e=new CSSStyleSheet;return fetch(t).then(o=>o.text()).then(o=>e.replace(o))};import{jsx as ht}from"react/jsx-runtime";var mt=new Map,ta=t=>{Yo(()=>()=>{mt.delete(t)},[t]),mt.has(t)||mt.set(t,xe.lazy(()=>import(t)));let e=mt.get(t);if(e)return e;throw Error(`Unable to load Lazy Feature at url ${t}`)};function ea({url:t,css:e,ComponentProps:o,...a}){e&&ye(e).then(r=>{document.adoptedStyleSheets=[...document.adoptedStyleSheets,r]});let n=ta(t);return ht(pt,{url:t,children:ht(Ko,{fallback:ht(ve,{}),children:ht(n,{...a,...o})})})}var ft=xe.memo(ea);ft.displayName="Feature";jo("Feature",ft,"view");import{Checkbox as $a,ComboBox as Ba,RadioButton as Ia}from"@vuu-ui/vuu-ui-controls";function be(t,e){if(t.match(/^[a-z]+:\/\//i))return t;if(t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i))return t;let o=document.implementation.createHTMLDocument(),a=o.createElement("base"),n=o.createElement("a");return o.head.appendChild(a),o.body.appendChild(n),e&&(a.href=e),n.href=t,n.href}var we=(()=>{let t=0,e=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${e()}${t}`)})();function N(t){let e=[];for(let o=0,a=t.length;o<a;o++)e.push(t[o]);return e}function gt(t,e){let a=(t.ownerDocument.defaultView||window).getComputedStyle(t).getPropertyValue(e);return a?parseFloat(a.replace("px","")):0}function oa(t){let e=gt(t,"border-left-width"),o=gt(t,"border-right-width");return t.clientWidth+e+o}function aa(t){let e=gt(t,"border-top-width"),o=gt(t,"border-bottom-width");return t.clientHeight+e+o}function Ft(t,e={}){let o=e.width||oa(t),a=e.height||aa(t);return{width:o,height:a}}function Le(){let t,e;try{e=process}catch{}let o=e&&e.env?e.env.devicePixelRatio:null;return o&&(t=parseInt(o,10),Number.isNaN(t)&&(t=1)),t||window.devicePixelRatio||1}var E=16384;function Ce(t){(t.width>E||t.height>E)&&(t.width>E&&t.height>E?t.width>t.height?(t.height*=E/t.width,t.width=E):(t.width*=E/t.height,t.height=E):t.width>E?(t.height*=E/t.width,t.width=E):(t.width*=E/t.height,t.height=E))}function W(t){return new Promise((e,o)=>{let a=new Image;a.decode=()=>e(a),a.onload=()=>e(a),a.onerror=o,a.crossOrigin="anonymous",a.decoding="async",a.src=t})}async function na(t){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function Se(t,e,o){let a="http://www.w3.org/2000/svg",n=document.createElementNS(a,"svg"),r=document.createElementNS(a,"foreignObject");return n.setAttribute("width",`${e}`),n.setAttribute("height",`${o}`),n.setAttribute("viewBox",`0 0 ${e} ${o}`),r.setAttribute("width","100%"),r.setAttribute("height","100%"),r.setAttribute("x","0"),r.setAttribute("y","0"),r.setAttribute("externalResourcesRequired","true"),n.appendChild(r),r.appendChild(t),na(n)}var C=(t,e)=>{if(t instanceof e)return!0;let o=Object.getPrototypeOf(t);return o===null?!1:o.constructor.name===e.name||C(o,e)};function ra(t){let e=t.getPropertyValue("content");return`${t.cssText} content: '${e.replace(/'|"/g,"")}';`}function ia(t){return N(t).map(e=>{let o=t.getPropertyValue(e),a=t.getPropertyPriority(e);return`${e}: ${o}${a?" !important":""};`}).join(" ")}function sa(t,e,o){let a=`.${t}:${e}`,n=o.cssText?ra(o):ia(o);return document.createTextNode(`${a}{${n}}`)}function Pe(t,e,o){let a=window.getComputedStyle(t,o),n=a.getPropertyValue("content");if(n===""||n==="none")return;let r=we();try{e.className=`${e.className} ${r}`}catch{return}let i=document.createElement("style");i.appendChild(sa(r,o,a)),e.appendChild(i)}function Te(t,e){Pe(t,e,":before"),Pe(t,e,":after")}var Me="application/font-woff",Ee="image/jpeg",ua={woff:Me,woff2:Me,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Ee,jpeg:Ee,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function la(t){let e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}function G(t){let e=la(t).toLowerCase();return ua[e]||""}function ca(t){return t.split(/,/)[1]}function nt(t){return t.search(/^(data:)/)!==-1}function Rt(t,e){return`data:${e};base64,${t}`}async function $t(t,e,o){let a=await fetch(t,e);if(a.status===404)throw new Error(`Resource "${a.url}" not found`);let n=await a.blob();return new Promise((r,i)=>{let s=new FileReader;s.onerror=i,s.onloadend=()=>{try{r(o({res:a,result:s.result}))}catch(u){i(u)}},s.readAsDataURL(n)})}var Ht={};function da(t,e,o){let a=t.replace(/\?.*/,"");return o&&(a=t),/ttf|otf|eot|woff2?/i.test(a)&&(a=a.replace(/.*\//,"")),e?`[${e}]${a}`:a}async function Q(t,e,o){let a=da(t,e,o.includeQueryParams);if(Ht[a]!=null)return Ht[a];o.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let n;try{let r=await $t(t,o.fetchRequestInit,({res:i,result:s})=>(e||(e=i.headers.get("Content-Type")||""),ca(s)));n=Rt(r,e)}catch(r){n=o.imagePlaceholder||"";let i=`Failed to fetch resource: ${t}`;r&&(i=typeof r=="string"?r:r.message),i&&console.warn(i)}return Ht[a]=n,n}async function pa(t){let e=t.toDataURL();return e==="data:,"?t.cloneNode(!1):W(e)}async function ma(t,e){if(t.currentSrc){let r=document.createElement("canvas"),i=r.getContext("2d");r.width=t.clientWidth,r.height=t.clientHeight,i==null||i.drawImage(t,0,0,r.width,r.height);let s=r.toDataURL();return W(s)}let o=t.poster,a=G(o),n=await Q(o,a,e);return W(n)}async function ha(t){var e;try{if(!((e=t==null?void 0:t.contentDocument)===null||e===void 0)&&e.body)return await rt(t.contentDocument.body,{},!0)}catch{}return t.cloneNode(!1)}async function fa(t,e){return C(t,HTMLCanvasElement)?pa(t):C(t,HTMLVideoElement)?ma(t,e):C(t,HTMLIFrameElement)?ha(t):t.cloneNode(!1)}var ga=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT";async function va(t,e,o){var a,n;let r=[];return ga(t)&&t.assignedNodes?r=N(t.assignedNodes()):C(t,HTMLIFrameElement)&&(!((a=t.contentDocument)===null||a===void 0)&&a.body)?r=N(t.contentDocument.body.childNodes):r=N(((n=t.shadowRoot)!==null&&n!==void 0?n:t).childNodes),r.length===0||C(t,HTMLVideoElement)||await r.reduce((i,s)=>i.then(()=>rt(s,o)).then(u=>{u&&e.appendChild(u)}),Promise.resolve()),e}function ya(t,e){let o=e.style;if(!o)return;let a=window.getComputedStyle(t);a.cssText?(o.cssText=a.cssText,o.transformOrigin=a.transformOrigin):N(a).forEach(n=>{let r=a.getPropertyValue(n);n==="font-size"&&r.endsWith("px")&&(r=`${Math.floor(parseFloat(r.substring(0,r.length-2)))-.1}px`),C(t,HTMLIFrameElement)&&n==="display"&&r==="inline"&&(r="block"),n==="d"&&e.getAttribute("d")&&(r=`path(${e.getAttribute("d")})`),o.setProperty(n,r,a.getPropertyPriority(n))})}function xa(t,e){C(t,HTMLTextAreaElement)&&(e.innerHTML=t.value),C(t,HTMLInputElement)&&e.setAttribute("value",t.value)}function ba(t,e){if(C(t,HTMLSelectElement)){let o=e,a=Array.from(o.children).find(n=>t.value===n.getAttribute("value"));a&&a.setAttribute("selected","")}}function wa(t,e){return C(e,Element)&&(ya(t,e),Te(t,e),xa(t,e),ba(t,e)),e}async function La(t,e){let o=t.querySelectorAll?t.querySelectorAll("use"):[];if(o.length===0)return t;let a={};for(let r=0;r<o.length;r++){let s=o[r].getAttribute("xlink:href");if(s){let u=t.querySelector(s),c=document.querySelector(s);!u&&c&&!a[s]&&(a[s]=await rt(c,e,!0))}}let n=Object.values(a);if(n.length){let r="http://www.w3.org/1999/xhtml",i=document.createElementNS(r,"svg");i.setAttribute("xmlns",r),i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.overflow="hidden",i.style.display="none";let s=document.createElementNS(r,"defs");i.appendChild(s);for(let u=0;u<n.length;u++)s.appendChild(n[u]);t.appendChild(i)}return t}async function rt(t,e,o){return!o&&e.filter&&!e.filter(t)?null:Promise.resolve(t).then(a=>fa(a,e)).then(a=>va(t,a,e)).then(a=>wa(t,a)).then(a=>La(a,e))}var Ne=/url\((['"]?)([^'"]+?)\1\)/g,Ca=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Sa=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Pa(t){let e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}function Ta(t){let e=[];return t.replace(Ne,(o,a,n)=>(e.push(n),o)),e.filter(o=>!nt(o))}async function Ma(t,e,o,a,n){try{let r=o?be(e,o):e,i=G(e),s;if(n){let u=await n(r);s=Rt(u,i)}else s=await Q(r,i,a);return t.replace(Pa(e),`$1${s}$3`)}catch{}return t}function Ea(t,{preferredFontFormat:e}){return e?t.replace(Sa,o=>{for(;;){let[a,,n]=Ca.exec(o)||[];if(!n)return"";if(n===e)return`src: ${a};`}}):t}function Bt(t){return t.search(Ne)!==-1}async function vt(t,e,o){if(!Bt(t))return t;let a=Ea(t,o);return Ta(a).reduce((r,i)=>r.then(s=>Ma(s,i,e,o)),Promise.resolve(a))}async function yt(t,e,o){var a;let n=(a=e.style)===null||a===void 0?void 0:a.getPropertyValue(t);if(n){let r=await vt(n,null,o);return e.style.setProperty(t,r,e.style.getPropertyPriority(t)),!0}return!1}async function Na(t,e){await yt("background",t,e)||await yt("background-image",t,e),await yt("mask",t,e)||await yt("mask-image",t,e)}async function Da(t,e){let o=C(t,HTMLImageElement);if(!(o&&!nt(t.src))&&!(C(t,SVGImageElement)&&!nt(t.href.baseVal)))return;let a=o?t.src:t.href.baseVal,n=await Q(a,G(a),e);await new Promise((r,i)=>{t.onload=r,t.onerror=i;let s=t;s.decode&&(s.decode=r),s.loading==="lazy"&&(s.loading="eager"),o?(t.srcset="",t.src=n):t.href.baseVal=n})}async function ka(t,e){let a=N(t.childNodes).map(n=>It(n,e));await Promise.all(a).then(()=>t)}async function It(t,e){C(t,Element)&&(await Na(t,e),await Da(t,e),await ka(t,e))}function De(t,e){let{style:o}=t;e.backgroundColor&&(o.backgroundColor=e.backgroundColor),e.width&&(o.width=`${e.width}px`),e.height&&(o.height=`${e.height}px`);let a=e.style;return a!=null&&Object.keys(a).forEach(n=>{o[n]=a[n]}),t}var ke={};async function Ae(t){let e=ke[t];if(e!=null)return e;let a=await(await fetch(t)).text();return e={url:t,cssText:a},ke[t]=e,e}async function Ve(t,e){let o=t.cssText,a=/url\(["']?([^"')]+)["']?\)/g,r=(o.match(/url\([^)]+\)/g)||[]).map(async i=>{let s=i.replace(a,"$1");return s.startsWith("https://")||(s=new URL(s,t.url).href),$t(s,e.fetchRequestInit,({result:u})=>(o=o.replace(i,`url(${u})`),[i,u]))});return Promise.all(r).then(()=>o)}function Fe(t){if(t==null)return[];let e=[],o=/(\/\*[\s\S]*?\*\/)/gi,a=t.replace(o,""),n=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){let u=n.exec(a);if(u===null)break;e.push(u[0])}a=a.replace(n,"");let r=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,i="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",s=new RegExp(i,"gi");for(;;){let u=r.exec(a);if(u===null){if(u=s.exec(a),u===null)break;r.lastIndex=s.lastIndex}else s.lastIndex=r.lastIndex;e.push(u[0])}return e}async function Aa(t,e){let o=[],a=[];return t.forEach(n=>{if("cssRules"in n)try{N(n.cssRules||[]).forEach((r,i)=>{if(r.type===CSSRule.IMPORT_RULE){let s=i+1,u=r.href,c=Ae(u).then(d=>Ve(d,e)).then(d=>Fe(d).forEach(h=>{try{n.insertRule(h,h.startsWith("@import")?s+=1:n.cssRules.length)}catch(y){console.error("Error inserting rule from remote css",{rule:h,error:y})}})).catch(d=>{console.error("Error loading remote css",d.toString())});a.push(c)}})}catch(r){let i=t.find(s=>s.href==null)||document.styleSheets[0];n.href!=null&&a.push(Ae(n.href).then(s=>Ve(s,e)).then(s=>Fe(s).forEach(u=>{i.insertRule(u,n.cssRules.length)})).catch(s=>{console.error("Error loading remote stylesheet",s)})),console.error("Error inlining remote css file",r)}}),Promise.all(a).then(()=>(t.forEach(n=>{if("cssRules"in n)try{N(n.cssRules||[]).forEach(r=>{o.push(r)})}catch(r){console.error(`Error while reading CSS rules from ${n.href}`,r)}}),o))}function Va(t){return t.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>Bt(e.style.getPropertyValue("src")))}async function Fa(t,e){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");let o=N(t.ownerDocument.styleSheets),a=await Aa(o,e);return Va(a)}async function He(t,e){let o=await Fa(t,e);return(await Promise.all(o.map(n=>{let r=n.parentStyleSheet?n.parentStyleSheet.href:null;return vt(n.cssText,r,e)}))).join(`
|
|
2
|
+
`)}async function Re(t,e){let o=e.fontEmbedCSS!=null?e.fontEmbedCSS:e.skipFonts?null:await He(t,e);if(o){let a=document.createElement("style"),n=document.createTextNode(o);a.appendChild(n),t.firstChild?t.insertBefore(a,t.firstChild):t.appendChild(a)}}async function Ha(t,e={}){let{width:o,height:a}=Ft(t,e),n=await rt(t,e,!0);return await Re(n,e),await It(n,e),De(n,e),await Se(n,o,a)}async function Ra(t,e={}){let{width:o,height:a}=Ft(t,e),n=await Ha(t,e),r=await W(n),i=document.createElement("canvas"),s=i.getContext("2d"),u=e.pixelRatio||Le(),c=e.canvasWidth||o,d=e.canvasHeight||a;return i.width=c*u,i.height=d*u,e.skipAutoScale||Ce(i),i.style.width=`${c}`,i.style.height=`${d}`,e.backgroundColor&&(s.fillStyle=e.backgroundColor,s.fillRect(0,0,i.width,i.height)),s.drawImage(r,0,0,i.width,i.height),i}async function $e(t,e={}){return(await Ra(t,e)).toDataURL()}var Be=t=>new Promise((e,o)=>{$e(t,{cacheBust:!0}).then(a=>{a||o(new Error("No Screenshot available")),e(a)}).catch(a=>{console.error("the following error occurred while taking a screenshot of a DOMNode",a),o(new Error("Error taking screenshot"))})});import{Button as Ie,FormField as xt,FormFieldLabel as bt,Input as Oa,Text as za}from"@salt-ds/core";import{useEffect as Ua,useMemo as Ja,useState as X}from"react";import{jsx as S,jsxs as z}from"react/jsx-runtime";var D="saveLayoutPanel",wt=`${D}-formField`,Za=["Group 1","Group 2","Group 3","Group 4","Group 5"],qa=["Value 1","Value 2","Value 3"],Oe=["Value 1","Value 2","Value 3"],ze=t=>{let{defaultTitle:e="",onCancel:o,onSave:a,componentId:n}=t,[r,i]=X(e),[s,u]=X(""),[c,d]=X([]),[h,y]=X(Oe[0]),[v,p]=X(),[l,f]=X(),[b]=ot();Ua(()=>{n&&Be(document.getElementById(n)).then(g=>{p(g)}).catch(g=>{f(g.message)})},[n]);let A=()=>{a({name:r,group:s,screenshot:v!=null?v:"",user:b})},T=Ja(()=>v?S("img",{className:`${D}-screenshot`,src:v,alt:"screenshot of current layout"}):l?S(za,{children:l}):S("div",{className:"spinner"}),[v,l]);return z("div",{className:`${D}-panelContainer`,children:[z("div",{className:`${D}-panelContent`,children:[z("div",{className:`${D}-formContainer`,children:[z(xt,{className:wt,children:[S(bt,{children:"Group"}),S(Ba,{source:Za,allowFreeText:!0,InputProps:{inputProps:{className:`${D}-inputText`,placeholder:"Select Group or Enter New Name",onChange:g=>u(g.target.value)}},width:"100%",onSelectionChange:(g,M)=>u(M||"")})]}),z(xt,{className:wt,children:[S(bt,{children:"Layout Name"}),S(Oa,{inputProps:{className:`${D}-inputText`,placeholder:"Enter Layout Name"},onChange:g=>i(g.target.value),value:r})]}),z(xt,{className:wt,children:[S(bt,{children:"Some Layout Setting"}),S("div",{className:`${D}-settingsGroup`,children:qa.map((g,M)=>S($a,{onToggle:()=>d(w=>w.includes(g)?w.filter(V=>V!==g):[...w,g]),checked:c.includes(g),label:g},M))})]}),z(xt,{className:wt,children:[S(bt,{children:"Some Layout Setting"}),S("div",{className:`${D}-settingsGroup`,children:Oe.map((g,M)=>S(Ia,{onClick:()=>y(g),checked:h===g,label:g,groupName:"radioGroup"},M))})]})]}),S("div",{className:`${D}-screenshotContainer`,children:T})]}),z("div",{className:`${D}-buttonsContainer`,children:[S(Ie,{className:`${D}-cancelButton`,onClick:o,children:"Cancel"}),S(Ie,{className:`${D}-saveButton`,onClick:A,disabled:r===""||s==="",children:"Save"})]})]})};import{List as An}from"@vuu-ui/vuu-ui-controls";import Pn,{useCallback as U,useContext as Tn,useEffect as Mn,useRef as En,useState as eo}from"react";import{resolveJSONPath as Nn}from"@vuu-ui/vuu-layout";import en from"clsx";import{useThemeAttributes as on}from"@vuu-ui/vuu-utils";import{useCallback as an,useLayoutEffect as nn,useRef as _e}from"react";import{Button as _a,Text as Wa}from"@salt-ds/core";import Ga from"clsx";import{jsx as Ue,jsxs as Xa}from"react/jsx-runtime";var Qa="vuuDialogHeader",Je=({hideCloseButton:t=!1,title:e,onClose:o,...a})=>Xa("div",{...a,className:Ga(Qa,"vuuToolbarProxy"),children:[Ue(Wa,{className:"dialogHeader",children:e}),!t&&Ue(_a,{onClick:o,"data-align":"end","data-icon":"close",variant:"secondary"},"close")]});import{useCallback as Ka,useLayoutEffect as Ya,useRef as ja,useState as tn}from"react";var Ze=(t,e,o,a,n,r)=>{let{bottom:i,height:s,left:u,right:c,top:d,width:h}=t.getBoundingClientRect();switch(e){case"below":return{left:u+o,top:i+a};case"right":return{left:c+o,top:d+a};case"below-center":return{left:u+h/2+o,top:i+a};case"below-right":return{left:u,minWidth:n,top:i+a};case"below-full-width":return{left:u+o,minWidth:n,top:i+a,width:h};case"center":return r?{left:h/2-r.width/2+o,top:s/2-r.height/2+a,visibility:"visible"}:{left:h/2+o,top:s/2+a,visibility:"hidden"};default:throw Error("Popup getPositionRelativeToAnchor only supported placement values are below and right")}},qe=({anchorElement:t,minWidth:e,offsetLeft:o=0,offsetTop:a=0,placement:n,position:r})=>{let i=ja(null),[s,u]=tn(r);Ya(()=>{if(n==="absolute"&&r)u(r);else if(t.current&&n!=="auto"){let d=i.current===null?void 0:i.current.getBoundingClientRect(),h=Ze(t.current,n,o,a,e,d);u(h)}},[t,e,o,a,n,r]);let c=Ka(d=>{if(i.current=d,d&&n==="center"&&t.current){let{height:h,width:y}=d.getBoundingClientRect();u(Ze(t.current,n,o,a,void 0,{height:h,width:y}))}},[t,o,a,n]);return{position:s,popupRef:n==="center"?c:void 0}};import{jsx as Ot,jsxs as un}from"react/jsx-runtime";var We="vuuDialog",rn={current:document.body},sn={},Ge=({PopupProps:t=sn,children:e,className:o,isOpen:a=!1,onClose:n,style:r,title:i,hideCloseButton:s=!1,...u})=>{let{anchorElement:c=rn,offsetLeft:d=0,offsetTop:h=0,placement:y="auto"}=t,v=_e(null),p=_e(null),[l,f,b]=on(),{position:A}=qe({anchorElement:c,offsetLeft:d,offsetTop:h,placement:y}),T=an(()=>{n==null||n()},[n]);return nn(()=>{if(v.current){if(a){v.current.showModal();let{left:g,top:M}=v.current.getBoundingClientRect();p.current&&(p.current.style.cssText=`left:-${g}px;position:absolute;top:-${M}px;`)}else v.current.close();if(y.endsWith("center")){let{width:g}=v.current.getBoundingClientRect();v.current.style.marginLeft=`-${g/2}px`}}},[a,y]),un("dialog",{...u,className:en(We,l),"data-mode":b,onClose:T,id:"vuu-dialog",ref:v,style:{...r,...A},children:[Ot(Je,{hideCloseButton:s,onClose:T,title:i}),Ot("div",{className:`${We}-body`,children:e}),Ot("div",{id:"vuu-dialog-portal-root",ref:p})]})};import{useCallback as ln,useState as cn}from"react";import{jsx as dn}from"react/jsx-runtime";var Qe=()=>{let[t,e]=cn(),o=ln(()=>{e(void 0)},[]);return{dialog:t?dn(Ge,{className:"vuDialog",isOpen:!0,onClose:o,style:{maxHeight:500},title:t.title,hideCloseButton:t.hideCloseButton,children:t.content}):null,setDialogState:e}};import{createContext as pn,useCallback as mn,useMemo as hn}from"react";import{jsx as zt}from"react/jsx-runtime";var Xe=pn(null),fn=({children:t,context:e,menuActionHandler:o,menuBuilder:a})=>{let n=hn(()=>e!=null&&e.menuBuilders&&a?e.menuBuilders.concat(a):a?[a]:(e==null?void 0:e.menuBuilders)||[],[e,a]),r=mn(i=>{var s;if(o!=null&&o(i)||(s=e==null?void 0:e.menuActionHandler)!=null&&s.call(e,i))return!0},[e,o]);return zt(Xe.Provider,{value:{menuActionHandler:r,menuBuilders:n},children:t})},Ke=({children:t,label:e,menuActionHandler:o,menuBuilder:a})=>zt(Xe.Consumer,{children:n=>zt(fn,{context:n,label:e,menuActionHandler:o,menuBuilder:a,children:t})});import gn,{useState as gu,useContext as vn,useCallback as vu,useEffect as yu}from"react";import bu from"clsx";import{getUniqueId as Lu}from"@vuu-ui/vuu-utils";import{jsx as Pu,jsxs as Tu}from"react/jsx-runtime";var yn=gn.createContext({notify:()=>"have you forgotten to provide a NotificationProvider?"});var Ye=()=>vn(yn);var Lt={layout:{type:"Component",id:"loading-main",props:{}}},Ct={layout:{type:"Stack",id:"main-tabs",props:{className:"vuuShell-mainTabs",TabstripProps:{allowAddTab:!0,allowCloseTab:!0,allowRenameTab:!0,animateSelectionThumb:!1,location:"main-tab",tabClassName:"MainTab"},preserve:!0,active:0},children:[{props:{id:"tab1",title:"Tab 1",className:"vuuShell-Placeholder"},type:"Placeholder"}]}};import{getLocalEntity as Ut,saveLocalEntity as Jt}from"@vuu-ui/vuu-filters";import{formatDate as xn,getUniqueId as bn}from"@vuu-ui/vuu-utils";var wn="layouts/metadata",Ln="layouts/layouts",K,St=class{constructor(e){this.username=ot()[0];this.metadataSaveLocation=`${wn}/${this.username}`;this.layoutsSaveLocation=`${Ln}/${this.username}`;re(this,K,`api/vui/${this.username}`);this.loadLayouts=()=>new Promise(e=>{let o=Ut(this.layoutsSaveLocation);e(o||[])});this.saveLayoutsWithMetadata=(e,o)=>{Jt(this.layoutsSaveLocation,e),Jt(this.metadataSaveLocation,o)};this.validateIds=async e=>Promise.all([this.validateId(e,"metadata").catch(o=>o.message),this.validateId(e,"layout").catch(o=>o.message)]).then(o=>{let a=o.filter(n=>n!==void 0).join("; ");if(a)throw new Error(a)});this.validateId=(e,o)=>new Promise((a,n)=>{(o==="metadata"?()=>this.loadMetadata():()=>this.loadLayouts())().then(i=>{switch(i.filter(u=>u.id===e).length){case 1:{a();break}case 0:{n(new Error(`No ${o} with ID ${e}`));break}default:n(new Error(`Non-unique ${o} with ID ${e}`))}})});e&&ie(this,K,e)}createLayout(e,o){return new Promise(a=>{Promise.all([this.loadLayouts(),this.loadMetadata()]).then(([n,r])=>{let i=bn(),s={...e,id:i,created:xn({date:"dd.mm.yyyy"})(new Date)};this.saveLayoutsWithMetadata([...n,{id:i,json:o}],[...r,s]),a(s)})})}updateLayout(e,o,a){return new Promise((n,r)=>{this.validateIds(e).then(()=>Promise.all([this.loadLayouts(),this.loadMetadata()])).then(([i,s])=>{let u=i.map(d=>d.id===e?{...d,json:a}:d),c=s.map(d=>d.id===e?{...d,...o}:d);this.saveLayoutsWithMetadata(u,c),n()}).catch(i=>r(i))})}deleteLayout(e){return new Promise((o,a)=>{this.validateIds(e).then(()=>Promise.all([this.loadLayouts(),this.loadMetadata()])).then(([n,r])=>{let i=n.filter(u=>u.id!==e),s=r.filter(u=>u.id!==e);this.saveLayoutsWithMetadata(i,s),o()}).catch(n=>a(n))})}loadLayout(e){return new Promise((o,a)=>{this.validateId(e,"layout").then(()=>this.loadLayouts()).then(n=>{let r=n.find(i=>i.id===e);r?o(r.json):a(new Error(`no layout found matching id ${e}`))}).catch(n=>a(n))})}loadMetadata(){return new Promise(e=>{let o=Ut(this.metadataSaveLocation);e(o||[])})}loadApplicationJSON(){return new Promise(e=>{let o=Ut(kt(this,K));e(o||Ct)})}saveApplicationJSON(e){return new Promise((o,a)=>{Jt(kt(this,K),e)?o():a(new Error("Application Json failed to save"))})}};K=new WeakMap;import{useCallback as je,useMemo as Cn}from"react";import{jsx as Sn}from"react/jsx-runtime";var to=t=>{let{saveLayout:e}=Y(),o=je(()=>{t(void 0)},[t]),a=je(i=>{e(i),t(void 0)},[e,t]),[n,r]=Cn(()=>[(i,s)=>{let u=i.split(" "),c=[];return u.includes("main-tab")&&c.push({label:"Save Layout",action:"save-layout",options:s},{label:"Layout Settings",action:"layout-settings",options:s}),c},i=>{var s,u;return console.log("menu action",{action:i}),i.menuId==="save-layout"?(t({content:Sn(ze,{onCancel:o,onSave:a,componentId:(s=i.options)==null?void 0:s.controlledComponentId,defaultTitle:(u=i.options)==null?void 0:u.controlledComponentTitle}),title:"Save Layout",hideCloseButton:!0}),!0):!1}],[o,a,t]);return{buildMenuOptions:n,handleMenuAction:r}};import{jsx as kn}from"react/jsx-runtime";var Zt,it=()=>(Zt===void 0&&(Zt=new St),Zt),oo=Pn.createContext({getApplicationSettings:()=>{},layoutMetadata:[],saveLayout:()=>{},applicationJson:Ct,saveApplicationLayout:()=>{},saveApplicationSettings:()=>{},loadLayoutById:()=>{}}),Dn=(t,e)=>{var o;return((o=t.props)==null?void 0:o.title)!==void 0?t:{...t,props:{...t.props,title:e.name}}},rl=t=>{let[e,o]=eo([]),[,a]=eo({}),{notify:n}=Ye(),r=En(Lt),i=U((p,l=!0)=>{r.current=p,l&&a({})},[]),s=U((p,l=!0)=>{i({...r.current,layout:p},l)},[i]),u=U(p=>{i({...r.current,settings:{...r.current.settings,...p}},!1)},[i]);Mn(()=>{let p=it();p.loadMetadata().then(l=>{o(l)}).catch(l=>{n({type:"error",header:"Failed to Load Layouts",body:"Could not load list of available layouts"}),console.error("Error occurred while retrieving metadata",l)}),p.loadApplicationJSON().then(l=>{i(l)}).catch(l=>{n({type:"error",header:"Failed to Load Layout",body:"Could not load your latest view"}),console.error("Error occurred while retrieving application layout",l)})},[n,i]);let c=U(p=>{s(p,!1),it().saveApplicationJSON(r.current)},[s]),d=U(p=>{let l=Nn(r.current.layout,"#main-tabs.ACTIVE_CHILD");l?it().createLayout(p,Dn(l,p)).then(f=>{n({type:"success",header:"Layout Saved Successfully",body:`${f.name} saved successfully`}),o(b=>[...b,f])}).catch(f=>{n({type:"error",header:"Failed to Save Layout",body:`Failed to save layout ${p.name}`}),console.error("Error occurred while saving layout",f)}):n({type:"error",header:"Failed to Save Layout",body:"Cannot save undefined layout"})},[n]),h=U((p,l)=>{let{settings:f}=r.current;u(l?{...f,[l]:p}:p),it().saveApplicationJSON(r.current)},[u]),y=U(p=>{let{settings:l}=r.current;return p?l==null?void 0:l[p]:l},[]),v=U(p=>{it().loadLayout(p).then(l=>{var b,A;let{layout:f}=r.current;s({...f,children:(f.children||[]).concat(l),props:{...f.props,active:(A=(b=f.children)==null?void 0:b.length)!=null?A:0}})}).catch(l=>{n({type:"error",header:"Failed to Load Layout",body:"Failed to load the requested layout"}),console.error("Error occurred while loading layout",l)})},[n,s]);return kn(oo.Provider,{value:{getApplicationSettings:y,layoutMetadata:e,saveLayout:d,applicationJson:r.current,saveApplicationLayout:c,saveApplicationSettings:h,loadLayoutById:v},children:t.children})},Y=()=>Tn(oo);import{jsx as st,jsxs as ao}from"react/jsx-runtime";var Pt="vuuLayoutTile",no=t=>{let{metadata:e,handleLoadLayout:o}=t;return st("div",{role:"listitem",children:ao("div",{className:`${Pt}-layoutTile`,role:"button",onClick:()=>o(e==null?void 0:e.id),children:[st("img",{className:`${Pt}-screenshot`,src:e==null?void 0:e.screenshot}),ao("div",{children:[st("div",{className:`${Pt}-layoutName`,children:e==null?void 0:e.name}),st("div",{className:`${Pt}-layoutDetails`,children:st("div",{children:`${e==null?void 0:e.user}, ${e==null?void 0:e.created}`})})]})]},e==null?void 0:e.id)})};import{Fragment as Vn,jsx as ut,jsxs as ro}from"react/jsx-runtime";var qt="vuuLayoutList",io=t=>{let{layoutMetadata:e,loadLayoutById:o}=Y(),a=r=>{r&&o(r)},n=e.reduce((r,i)=>r[i.group]?{...r,[i.group]:[...r[i.group],i]}:{...r,[i.group]:[i]},{});return ro("div",{className:qt,...t,role:"listbox","aria-label":"my layouts",children:[ut("div",{className:`${qt}-header`,children:"My Layouts"}),ut(An,{height:"auto",source:Object.entries(n),ListItem:({item:r})=>{if(!r)return ut(Vn,{});let[i,s]=r;return ro("div",{role:"list","aria-label":i,children:[ut("div",{className:`${qt}-groupName`,children:i}),s.map(u=>ut(no,{metadata:u,handleLoadLayout:a},u.id))]})}})]})};import{VuuLogo as $n}from"@vuu-ui/vuu-icons";import{Stack as Bn,useLayoutProviderDispatch as In}from"@vuu-ui/vuu-layout";import{Tab as Tt,Tabstrip as On}from"@vuu-ui/vuu-ui-controls";import{useThemeAttributes as zn}from"@vuu-ui/vuu-utils";import Gt from"clsx";import{useCallback as Qt,useState as Un}from"react";import{Palette as Fn,PaletteItem as Hn}from"@vuu-ui/vuu-layout";import{jsx as lt,jsxs as Rn}from"react/jsx-runtime";var _t="vuuFeatureList",Wt=({features:t,title:e="VUU TABLES",...o})=>{let a={},n={height:"100%"};return Rn("div",{...o,className:_t,children:[lt("div",{className:`${_t}-header`,children:e}),lt("div",{className:`${_t}-content`,children:lt(Fn,{orientation:"vertical",ListProps:n,ViewProps:a,children:t.map((r,i)=>lt(Hn,{closeable:!0,label:r.title,resizeable:!0,resize:"defer",header:!0,children:lt(ft,{...r})},i))})})]})};import{jsx as k,jsxs as Mt}from"react/jsx-runtime";var j="vuuLeftNav",Jn=(t,e)=>t===0?e?"menu-full":"menu-icons":e?"menu-full-content":"menu-icons-content",Ql=t=>{let e=In(),[o]=zn(),{"data-path":a,defaultExpanded:n=!0,defaultActiveTabIndex:r=0,features:i,onActiveChange:s,onTogglePrimaryMenu:u,sizeCollapsed:c=80,sizeContent:d=300,sizeExpanded:h=240,style:y,tableFeatures:v,...p}=t,[l,f]=Un({activeTabIndex:r,expanded:n}),b=Qt((w,V)=>w===0?V?h:c:V?h+d:c+d,[c,d,h]),A=Qt(w=>{let{activeTabIndex:V,expanded:$}=l;if(f({activeTabIndex:w,expanded:$}),w===0||V===0){let x=b(w,$);e({type:"layout-resize",path:"#vuu-side-panel",size:x})}s==null||s(w)},[e,b,l,s]),T=Jn(l.activeTabIndex,l.expanded),g=Qt(()=>{let{activeTabIndex:w,expanded:V}=l,$=!V;f({activeTabIndex:w,expanded:$}),e({type:"layout-resize",path:"#vuu-side-panel",size:b(w,$)}),u==null||u($)},[e,b,l,u]),M={...y,"--nav-menu-collapsed-width":`${c}px`,"--nav-menu-expanded-width":`${h}px`,"--nav-menu-content-width":`${d}px`};return Mt("div",{...p,className:Gt(j,`${j}-${T}`),style:M,children:[Mt("div",{className:Gt(`${j}-menu-primary`,o),"data-mode":"dark",children:[k("div",{className:"vuuLeftNav-logo",children:k($n,{})}),k("div",{className:`${j}-main`,children:Mt(On,{activeTabIndex:l.activeTabIndex,animateSelectionThumb:!1,className:`${j}-Tabstrip`,onActiveChange:A,orientation:"vertical",children:[k(Tt,{"data-icon":"demo",label:"DEMO"}),k(Tt,{"data-icon":"features",label:"VUU FEATURES"}),k(Tt,{"data-icon":"tables",label:"VUU TABLES"}),k(Tt,{"data-icon":"layouts",label:"MY LAYOUTS"})]})}),k("div",{className:"vuuLeftNav-buttonBar",children:k("button",{className:Gt("vuuLeftNav-toggleButton",{"vuuLeftNav-toggleButton-open":T.startsWith("menu-full"),"vuuLeftNav-toggleButton-closed":T.startsWith("menu-icons")}),"data-icon":T.startsWith("menu-full")?"chevron-left":"chevron-right",onClick:g})})]}),Mt(Bn,{active:l.activeTabIndex-1,className:`${j}-menu-secondary`,showTabs:!1,children:[k(Wt,{features:i,title:"VUU FEATURES"}),k(Wt,{features:v,title:"VUU TABLES"}),k("div",{className:"vuuLeftNav-drawer",children:k(io,{})})]})]})};import{VuuDataSource as Zn}from"@vuu-ui/vuu-data-remote";import{buildColumnMap as qn,hasAction as _n,isErrorResponse as Wn,isValidNumber as so,shallowEquals as Gn}from"@vuu-ui/vuu-utils";import{Button as uo,useIdMemo as Qn}from"@salt-ds/core";import lo from"clsx";import{useCallback as tt,useEffect as co,useMemo as Xn,useRef as Xt,useState as po}from"react";import{jsx as Z,jsxs as Kt}from"react/jsx-runtime";var I="vuuSessionEditingForm",mo=(t,e)=>{let o=t.find(a=>a.name===e);if(o)return o;throw Error(`SessionEditingForm, no field '${e}' found`)},ho=t=>{let{dataset:{field:e},value:o}=t.target;if(e===void 0)throw Error("SessionEditingForm, form field has no field name");return[e,o]},O={uninitialised:0,unchanged:1,changed:2,invalid:3};function fo(t,e,o=!1){switch(e){case"int":case"long":{let a=parseInt(t,10);if(so(a))return a;if(o)throw Error("SessionEditingForm getTypedValue");return}case"double":{let a=parseFloat(t);return so(a)?a:void 0}case"boolean":return t==="true";default:return t}}var Kn=(t,e)=>{if(t)return t;if(e)return new Zn({bufferSize:0,table:e.table,columns:e.columns.map(o=>o.name)});throw Error("SessionEditingForm: either a DataSource or a TableSchema must be provided")},dc=({className:t,config:{fields:e,key:o},dataSource:a,id:n,onClose:r,schema:i,...s})=>{let[u,c]=po(),[d,h]=po(""),y=Xt(null),v=Xt(),p=Xt(O.uninitialised),l=Xn(()=>{let m=H=>{if(F){let L={};for(let q of l.columns)L[q]=H[F[q]];p.current===O.uninitialised&&(p.current=O.unchanged,v.current=L),c(L)}},x=Kn(a,i),F=qn(x.columns);return x.subscribe({range:{from:0,to:5}},H=>{H.type==="viewport-update"&&H.rows&&(p.current===O.uninitialised?m(H.rows[0]):console.log("what do we do with server updates"))}),x},[a,i]),f=Qn(n),b=tt(m=>{let[x,F]=ho(m),{type:H}=mo(e,x),L=fo(F,H);c((q={})=>{let ae={...q,[x]:L},No=Gn(ae,v.current);return p.current=No?O.unchanged:L!==void 0?O.changed:O.invalid,ae})},[e]),A=tt(m=>{let[x,F]=ho(m),{type:H}=mo(e,x),L=u==null?void 0:u[o],q=fo(F,H,!0);typeof L=="string"&&l.menuRpcCall({rowKey:L,field:x,value:q,type:"VP_EDIT_CELL_RPC"})},[l,e,o,u]),T=tt(m=>{typeof m=="object"&&m!==null&&"type"in m&&m.type==="CLOSE_DIALOG_ACTION"&&r()},[r]),g=tt(async()=>{let m=await l.menuRpcCall({type:"VP_EDIT_SUBMIT_FORM_RPC"});Wn(m)?h(m.error):_n(m)&&T(m.action)},[T,l]),M=tt(m=>{m.key==="Enter"&&p.current===O.changed&&g()},[g]),w=tt(()=>{r()},[r]),V=m=>{var F;let x=String((F=u==null?void 0:u[m.name])!=null?F:"");return m.readonly||m.name===o?Z("div",{className:`${I}-fieldValue vuuReadOnly`,children:x}):Z("input",{className:`${I}-fieldValue`,"data-field":m.name,onBlur:A,onChange:b,type:"text",value:x,id:`${f}-input-${m.name}`})};co(()=>{if(y.current){let m=y.current.querySelector("input");m&&setTimeout(()=>{m.focus(),m.select()},100)}},[]),co(()=>()=>{l&&l.unsubscribe()},[l]);let $=p.current===O.changed;return Kt("div",{...s,className:lo(I,t),children:[d?Z("div",{className:`${I}-errorBanner`,"data-icon":"error",title:d,children:"Error, edit(s) not saved"}):void 0,Z("div",{className:`${I}-content`,ref:y,onKeyDown:M,children:e.map(m=>{var x;return Kt("div",{className:`${I}-field`,children:[Z("label",{className:lo(`${I}-fieldLabel`,{[`${I}-required`]:m.required}),htmlFor:`${f}-input-${m.name}`,children:(x=m==null?void 0:m.label)!=null?x:m.description}),V(m)]},m.name)})}),Kt("div",{className:`${I}-buttonbar salt-theme salt-density-high`,children:[Z(uo,{type:"submit",variant:"cta",disabled:!$,onClick:g,children:"Submit"}),Z(uo,{variant:"secondary",onClick:w,children:"Cancel"})]})]})};import{connectToServer as vr}from"@vuu-ui/vuu-data-remote";import{DraggableLayout as yr,LayoutProvider as xr,StackLayout as br}from"@vuu-ui/vuu-layout";import{logger as wr,ThemeProvider as Lr,useThemeAttributes as Cr}from"@vuu-ui/vuu-utils";import Sr from"clsx";import{useCallback as jt,useEffect as Pr,useRef as To}from"react";import{Button as Yn}from"@salt-ds/core";import go from"clsx";import{useCallback as jn,useMemo as tr}from"react";import{layoutFromJson as er,View as or,useLayoutProviderDispatch as ar}from"@vuu-ui/vuu-layout";import{jsx as Et,jsxs as vo}from"react/jsx-runtime";var R="vuuContextPanel",yo=({className:t,expanded:e=!1,content:o,overlay:a=!1,title:n})=>{let r=ar(),i=jn(()=>{r({path:"#context-panel",propName:"expanded",propValue:!1,type:"set-prop"})},[r]),s=go(R,t,{[`${R}-expanded`]:e,[`${R}-inline`]:a!==!0,[`${R}-overlay`]:a}),u=tr(()=>o&&e?er(o,"context-0"):null,[o,e]);return Et("div",{className:go(R,s,{[`${R}-expanded`]:e}),children:vo(or,{className:`${R}-inner`,header:!1,id:"context-panel",children:[vo("div",{className:`${R}-header`,children:[Et("h2",{className:`${R}-title`,children:n}),Et(Yn,{className:`${R}-close`,"data-icon":"close",onClick:i,variant:"secondary"})]}),Et("div",{className:`${R}-content`,children:u})]})})};import{DraggableLayout as ur,Flexbox as bo}from"@vuu-ui/vuu-layout";import{useMemo as nr}from"react";import rr from"clsx";import{jsx as sr}from"react/jsx-runtime";var ir="vuuShellSidePanel",xo=({children:t,open:e=!0,sizeClosed:o=90,sizeOpen:a=200,style:n,...r})=>{let i=nr(()=>({...n,"--shell-left-nav-size":e?`${a}px`:`${o}px`}),[e,o,a,n]);return sr("div",{...r,className:rr(ir),style:i,children:t})};import{jsx as Yt,jsxs as wo}from"react/jsx-runtime";var Lo=({appHeader:t,LeftSidePanelProps:e})=>wo(bo,{className:"App",style:{flexDirection:"row",height:"100%",width:"100%"},children:[Yt(xo,{...e,id:"vuu-side-panel"}),wo(bo,{className:"vuuShell-content",style:{flex:1,flexDirection:"column"},children:[t,Yt(ur,{dropTarget:!0,style:{flex:1}},"main-content")]}),Yt(yo,{id:"context-panel",overlay:!0})]});import{DockLayout as lr,DraggableLayout as cr,Drawer as dr,Flexbox as pr,View as mr}from"@vuu-ui/vuu-layout";import{useCallback as Co,useRef as hr,useState as fr}from"react";import{jsx as Nt,jsxs as gr}from"react/jsx-runtime";var So=({appHeader:t,LeftSidePanelProps:e})=>{let o=hr(null),[a,n]=fr(!0),r=Co(s=>{var c;let u=s.target;(c=o.current)!=null&&c.contains(u)||n(!a)},[a]),i=Co(s=>{let u=[];return u.push(Nt(dr,{onClick:r,open:a,position:"left",inline:!0,peekaboo:!0,sizeOpen:200,toggleButton:"end",children:Nt(mr,{className:"vuuShell-palette",id:"vw-app-palette",ref:o,style:{height:"100%"},children:s},"app-palette")},"left-panel")),u},[r,a]);return gr(pr,{className:"App",style:{flexDirection:"column",height:"100%",width:"100%"},children:[t,Nt(lr,{style:{flex:1},children:i(e==null?void 0:e.children).concat(Nt(cr,{dropTarget:!0,style:{width:"100%",height:"100%"}},"main-content"))})]})};var Po=({leftSidePanelLayout:t="inlay",...e})=>(t==="inlay"?So:Lo)(e);import{jsx as Dt,jsxs as Mr}from"react/jsx-runtime";typeof br!="function"&&console.warn("StackLayout module not loaded, will be unsbale to deserialize from layout JSON");var{error:te}=wr("Shell"),Tr={},wd=({LayoutProps:t,LeftSidePanelProps:e=Tr,children:o,className:a,leftSidePanelLayout:n,loginUrl:r,saveLocation:i="remote",saveUrl:s,serverUrl:u,user:c,...d})=>{let h=To(null),{dialog:y,setDialogState:v}=Qe(),p=To("latest"),{applicationJson:l,saveApplicationLayout:f,loadLayoutById:b}=Y(),{buildMenuOptions:A,handleMenuAction:T}=to(v),g=jt(L=>{try{f(L)}catch{te==null||te("Failed to save layout")}},[f]),M=jt(L=>{h.current&&(h.current.dataset.mode=L)},[]),w=jt(L=>{p.current=L,b(L)},[b]);Pr(()=>{u&&c.token&&vr({authToken:c.token,url:u,username:c.username})},[u,c.token,c.username]);let[V,$,m]=Cr(),x=Sr("vuuShell",a,V,$),F=l===Lt,H=Po({LeftSidePanelProps:e,leftSidePanelLayout:n,appHeader:Dt(he,{layoutId:p.current,loginUrl:r,user:c,onNavigate:w,onSwitchTheme:M})});return F?null:Dt(Lr,{children:Mr(Ke,{menuActionHandler:T,menuBuilder:A,children:[Dt(xr,{...t,layout:l.layout,onLayoutChange:g,children:Dt(yr,{className:x,"data-mode":m,ref:h,...d,children:H})}),o||y]})})};var Sd=t=>t==="*",Pd=t=>typeof t=="object"&&typeof t.module=="string"&&typeof t.table=="string";import{createContext as Er,useContext as Nr}from"react";import{jsx as ee}from"react/jsx-runtime";var Dr={},oe=Er(Dr),kr=({children:t,context:e,inheritedContext:o})=>{let a={...o,...e};return ee(oe.Provider,{value:a,children:t})},Dd=({children:t,value:e})=>ee(oe.Consumer,{children:o=>ee(kr,{context:e,inheritedContext:o,children:t})}),kd=()=>Nr(oe);import Ar from"clsx";import{ToggleButton as Mo,ToggleButtonGroup as Vr,useControlled as Fr}from"@salt-ds/core";import{useCallback as Hr}from"react";import{jsx as Eo,jsxs as $r}from"react/jsx-runtime";var Rr="vuuThemeSwitch",Ud=({className:t,defaultMode:e,mode:o,onChange:a,...n})=>{let[r,i]=Fr({controlled:o,default:e!=null?e:"light",name:"ThemeSwitch",state:"mode"}),s=Hr(c=>{let{value:d}=c.target;i(d),a(d)},[a,i]),u=Ar(Rr,t);return $r(Vr,{className:u,...n,onChange:s,value:r,children:[Eo(Mo,{"aria-label":"alert","data-icon":"light",value:"dark"}),Eo(Mo,{"aria-label":"home","data-icon":"dark",value:"light"})]})};export{he as AppHeader,Si as ConnectionStatusIcon,yo as ContextPanel,ft as Feature,Wt as FeatureList,io as LayoutList,oo as LayoutManagementContext,rl as LayoutManagementProvider,Ql as LeftNav,Yr as LoginPanel,ze as SaveLayoutPanel,dc as SessionEditingForm,wd as Shell,Dd as ShellContextProvider,xo as SidePanel,Ud as ThemeSwitch,ot as getAuthDetailsFromCookies,Ho as getAuthModeFromCookies,Pd as isTableSchema,Sd as isWildcardSchema,me as logout,$o as redirectToLogin,Y as useLayoutManager,kd as useShellContext,Po as useShellLayout};
|
|
3
3
|
//# sourceMappingURL=index.js.map
|