@nebula.js/cli-serve 8.0.0-alpha.2 → 8.0.0-alpha.3
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/README.md +23 -12
- package/dist/eRender.js +1 -1
- package/dist/eRender.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/q.js +2 -2
- package/lib/https.js +40 -0
- package/lib/init-config.js +3 -7
- package/lib/rsbuild.serve.js +23 -48
- package/lib/serve.js +40 -61
- package/package.json +9 -8
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(()=>{"use strict";var e,t,n,r,i,o,s,a={pxi(e){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAAAHUlEQVQYV2PYvXu3JAi7uLiAMaYAjAGTQBPYLQkAa/0Zef3qRswAAAAASUVORK5CYII="},LYh(e){e.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCA1MyAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwKSI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDguMDM2NCA0LjAxMDQySDQuMDA3NzlMNC4wMDc3OSAzMi4wMjg2SDQ4LjAzNjRWNC4wMTA0MlpNNC4wMDc3OSAwLjAwNzgxMjVDMS43OTcyMSAwLjAwNzgxMjUgMC4wMDUxODc5OSAxLjc5OTg0IDAuMDA1MTg3OTkgNC4wMTA0MlYzMi4wMjg2QzAuMDA1MTg3OTkgMzQuMjM5MiAxLjc5NzIxIDM2LjAzMTIgNC4wMDc3OSAzNi4wMzEySDQ4LjAzNjRDNTAuMjQ3IDM2LjAzMTIgNTIuMDM5IDM0LjIzOTIgNTIuMDM5IDMyLjAyODZWNC4wMTA0MkM1Mi4wMzkgMS43OTk4NCA1MC4yNDcgMC4wMDc4MTI1IDQ4LjAzNjQgMC4wMDc4MTI1SDQuMDA3NzlaTTguMDEwNDIgOC4wMTMwMkgxMi4wMTNWMTIuMDE1Nkg4LjAxMDQyVjguMDEzMDJaTTIwLjAxODIgOC4wMTMwMkgxNi4wMTU2VjEyLjAxNTZIMjAuMDE4MlY4LjAxMzAyWk0yNC4wMjA4IDguMDEzMDJIMjguMDIzNFYxMi4wMTU2SDI0LjAyMDhWOC4wMTMwMlpNMzYuMDI4NiA4LjAxMzAySDMyLjAyNlYxMi4wMTU2SDM2LjAyODZWOC4wMTMwMlpNNDAuMDMxMiA4LjAxMzAySDQ0LjAzMzlWMTIuMDE1Nkg0MC4wMzEyVjguMDEzMDJaTTE2LjAxNTYgMTYuMDE4Mkg4LjAxMDQyVjIwLjAyMDhIMTYuMDE1NlYxNi4wMTgyWk0yMC4wMTgyIDE2LjAxODJIMjQuMDIwOFYyMC4wMjA4SDIwLjAxODJWMTYuMDE4MlpNMzIuMDI2IDE2LjAxODJIMjguMDIzNFYyMC4wMjA4SDMyLjAyNlYxNi4wMTgyWk00NC4wMzM5IDE2LjAxODJWMjAuMDIwOEgzNi4wMjg2VjE2LjAxODJINDQuMDMzOVpNMTIuMDEzIDI0LjAyMzRIOC4wMTA0MlYyOC4wMjZIMTIuMDEzVjI0LjAyMzRaTTE2LjAxNTYgMjQuMDIzNEgzNi4wMjg2VjI4LjAyNkgxNi4wMTU2VjI0LjAyMzRaTTQ0LjAzMzkgMjQuMDIzNEg0MC4wMzEyVjI4LjAyNkg0NC4wMzM5VjI0LjAyMzRaIiBmaWxsPSIjNDI0MjQyIi8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iY2xpcDAiPgo8cmVjdCB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg=="},oDx(e){e.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCA1MyAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwKSI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDguMDM2NCA0LjAxMDQySDQuMDA3NzlMNC4wMDc3OSAzMi4wMjg2SDQ4LjAzNjRWNC4wMTA0MlpNNC4wMDc3OSAwLjAwNzgxMjVDMS43OTcyMSAwLjAwNzgxMjUgMC4wMDUxODc5OSAxLjc5OTg0IDAuMDA1MTg3OTkgNC4wMTA0MlYzMi4wMjg2QzAuMDA1MTg3OTkgMzQuMjM5MiAxLjc5NzIxIDM2LjAzMTIgNC4wMDc3OSAzNi4wMzEySDQ4LjAzNjRDNTAuMjQ3IDM2LjAzMTIgNTIuMDM5IDM0LjIzOTIgNTIuMDM5IDMyLjAyODZWNC4wMTA0MkM1Mi4wMzkgMS43OTk4NCA1MC4yNDcgMC4wMDc4MTI1IDQ4LjAzNjQgMC4wMDc4MTI1SDQuMDA3NzlaTTguMDEwNDIgOC4wMTMwMkgxMi4wMTNWMTIuMDE1Nkg4LjAxMDQyVjguMDEzMDJaTTIwLjAxODIgOC4wMTMwMkgxNi4wMTU2VjEyLjAxNTZIMjAuMDE4MlY4LjAxMzAyWk0yNC4wMjA4IDguMDEzMDJIMjguMDIzNFYxMi4wMTU2SDI0LjAyMDhWOC4wMTMwMlpNMzYuMDI4NiA4LjAxMzAySDMyLjAyNlYxMi4wMTU2SDM2LjAyODZWOC4wMTMwMlpNNDAuMDMxMiA4LjAxMzAySDQ0LjAzMzlWMTIuMDE1Nkg0MC4wMzEyVjguMDEzMDJaTTE2LjAxNTYgMTYuMDE4Mkg4LjAxMDQyVjIwLjAyMDhIMTYuMDE1NlYxNi4wMTgyWk0yMC4wMTgyIDE2LjAxODJIMjQuMDIwOFYyMC4wMjA4SDIwLjAxODJWMTYuMDE4MlpNMzIuMDI2IDE2LjAxODJIMjguMDIzNFYyMC4wMjA4SDMyLjAyNlYxNi4wMTgyWk00NC4wMzM5IDE2LjAxODJWMjAuMDIwOEgzNi4wMjg2VjE2LjAxODJINDQuMDMzOVpNMTIuMDEzIDI0LjAyMzRIOC4wMTA0MlYyOC4wMjZIMTIuMDEzVjI0LjAyMzRaTTE2LjAxNTYgMjQuMDIzNEgzNi4wMjg2VjI4LjAyNkgxNi4wMTU2VjI0LjAyMzRaTTQ0LjAzMzkgMjQuMDIzNEg0MC4wMzEyVjI4LjAyNkg0NC4wMzM5VjI0LjAyMzRaIiBmaWxsPSIjQzVDNUM1Ii8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iY2xpcDAiPgo8cmVjdCB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg=="},Q(e,t,n){var r=n("K"),i=n.t(r,2),o=n("g"),s=n.t(o,2),a=n("X"),l=n.t(a,2),d=n("V"),c=n("G"),u=n("Nb"),h=n("D"),p=n.n(h),g=n("H"),x=n("h"),m=n("HA"),f=n("Hg");async function j(e){try{let t=(await fetch(`${e}/qps/csrftoken`,{credentials:"include"})).headers.get("QLIK-CSRF-TOKEN");if(t)return t}catch(e){console.log("Failed to fetch csrf-token",e)}return""}let y=/(wss?):\/\/([^/:?&]+)(?::(\d+))?/,b=/\/app\/([^?&#:]+)/,A=/(wss?):\/\/([^/:?&]+)(?::(\d+))?\/?([a-z0-9-._~]+)?/,M=()=>fetch("/info").then(e=>e.json()).then(async e=>{let t,n=e,r=(t={},window.location.search.substring(1).split("&").forEach(e=>{let n=e.indexOf("="),r=e.substr(0,n),i=decodeURIComponent(e.substring(n+1));"cols"===r&&(i=i.split(",")),t[r]=i}),t);if(r.engine_url?n={...n,...(e=>{let t,n,r=y.exec(e);if(!r)return{engineUrl:e,invalid:!0};let i=e.trim(),o=i,s=b.exec(i);s&&([,t]=s,o=i.substring(0,s.index),n=i);let a=A.exec(o);return a?{engine:{secure:"wss"===r[1],host:r[2],port:r[3]||void 0,prefix:a[4]||void 0,appId:t},engineUrl:o,appUrl:n}:{engineUrl:e,invalid:!0}})(r.engine_url)}:r.app&&(n={...n,engine:{...n.engine,appId:r.app}}),r["qlik-web-integration-id"]&&(n.webIntegrationId=r["qlik-web-integration-id"]),r["qlik-client-id"]&&(n.clientId=r["qlik-client-id"]),n.invalid)return n;let i=`${n.engine.secure?"https":"http"}://${n.engine.host}`;return{...n,rootPath:i}}),v=e=>{let{webIntegrationId:t,clientId:n,host:r}=e;t?x.Ay.setDefaultHostConfig({authType:"cookie",webIntegrationId:t,host:r}):n&&x.Ay.setDefaultHostConfig({authType:"oauth2",clientId:n,host:r,redirectUri:`${window.location.origin}/auth/login/callback`,accessTokenStorage:"session"})},w=async()=>{try{let{data:e=[]}=(await (0,m.JS)({resourceType:"app",limit:30,sort:"-updatedAt"})).data;return e.map(e=>({qDocId:e.resourceId,qTitle:e.name}))}catch(e){throw Error("Failed to fetch app list",{cause:e})}},C=()=>{let[e,t]=(0,o.useState)();return(0,o.useEffect)(()=>{M().then(e=>{t(e)})},[]),{info:e,setInfo:t}},D=e=>{let{result:t,setError:n,setGlobal:r}=e;t.session&&t.session.on("notification:OnAuthenticationInformation",e=>{e.mustAuthenticate&&(n({message:"Could not authenticate.",hints:[`In your virtual proxy advanced settings in the QMC, make sure to whitelist ${window.location.host}, ensure "Has secure attribute" is enabled and that "SameSite attribute" is set to "None".`]}),r(null))})};var q=e=>{let t=window.localStorage.getItem("nebula-dev"),n=t?JSON.parse(t):{},r=e?.id,i={save(e,t){n[e]=t,window.localStorage.setItem("nebula-dev",JSON.stringify(n))},get:e=>n[e],props(e,t){if(t)return void i.save(`props:${r}:${e}`,JSON.stringify(t));let n=i.get(`props:${r}:${e}`);return n?JSON.parse(n):{}}};return i};let I=(0,o.createContext)({info:{}}),S=()=>{let e=(0,o.useContext)(I);if(!e)throw Error("RootContext not defined!");return e},k=e=>{let{children:t}=e,n=(0,u.zy)(),i=(0,u.Zp)(),s=(0,o.useMemo)(()=>q({}),[]),{info:a,setInfo:l}=C(),d=(e=>{let{storage:t}=e,[n,r]=(0,o.useState)(t.get("connections")||[]);return{cachedConnections:n,removeCachedConnection:e=>{let i=n.indexOf(e);if(-1!==e){let e=n.slice();e.splice(i,1),t.save("connections",e),r(e)}},addCachedConnections:e=>{let{info:i}=e,o="",s=i.engine.secure?"wss":"ws",a="localhost"===i.engine.host?`${i.engine.host}:${i.engine.port}`:i.engine.host,l=i.engine.prefix?`/${i.engine.prefix}`:"",d=`${s}://${a}${l}`;if(o=i.clientId?`${d}/?qlik-client-id=${i.clientId}`:i.webIntegrationId?`${d}/?qlik-web-integration-id=${i.webIntegrationId}`:d,-1===n.indexOf(o)&&0!==o.length){let e=[...n,o];t.save("connections",e),r(e)}}}})({storage:s}),c=(e=>{let{info:t,cachedConnectionsData:n}=e,r=(0,u.zy)(),[i,s]=(0,o.useState)(),[a,l]=(0,o.useState)(!1),[d,c]=(0,o.useState)(),[h,x]=(0,o.useState)(0);return(0,o.useEffect)(()=>{if("/"!==r.pathname&&t&&t.engineUrl){if(t.invalid)return void c({message:"Connection failed",hints:["The WebSocket URL is not valid."]});(async()=>{try{let{clientId:e,webIntegrationId:t,engine:n,engine:{host:r}}=await M();if(t)return v({webIntegrationId:t,host:r}),{getDocList:w,getConfiguration:async()=>({})};if(e)return v({clientId:e,host:r}),{getDocList:w,getConfiguration:async()=>({})};let i=await j(`https://${n.host}${n.prefix?`/${n.prefix}`:""}`),o=!1!==n.secure?"wss":"ws",s=n.port?`:${n.port}`:"",a=n.prefix?`/${n.prefix}`:"",l=`${o}://${n.host}${s}${a}?qlik-csrf-token=${i}`;return p().create({schema:g,url:l}).open()}catch(e){throw Error("Failed to return enigma instance",{cause:e})}})().then(e=>(async e=>{let{result:t,setGlobal:n,setTreatAsDesktop:r,setError:i}=e;if(D({result:t,setError:i,setGlobal:n}),n(t),t.getDocList)try{let e=await t.getConfiguration();e&&e.qFeatures&&e.qFeatures.qIsDesktop&&r(!0)}catch(e){throw Error("Failed to get configuration")}})({result:e,setGlobal:s,setError:c,setTreatAsDesktop:l})).then(()=>n.addCachedConnections({info:t})).catch(e=>(e=>{let{error:t,info:n,setError:r}=e,i={message:"Something went wrong, check the devtools console",hints:[]};if(t.target instanceof WebSocket){i.message=`Connection failed to ${n.engineUrl}`,/\.qlik[A-Za-z0-9-]+\.com/.test(n.engineUrl)&&!n.webIntegrationId&&(i.hints.push("- If you are connecting to Qlik Cloud, make sure to provide a web integration id or client id."),i.hints.push("- For Qlik Sense on Windows, make sure the proxy setup is correct and that you are authenticated."),i.hints.push("- Press the ? in the top right for more information on how to set up the connection correctly.")),r(i);return}r(i),console.error(t)})({error:e,info:t,setError:c}))}},[t,r.pathname]),{glob:i,setGlobal:s,treatAsDesktop:a,setTreatAsDesktop:l,error:d,setError:c,activeStep:h,setActiveStep:x}})({info:a,cachedConnectionsData:d});(0,o.useEffect)(()=>{c.error&&i("/"),"/"===n.pathname&&(c.setActiveStep(0),c.setGlobal(),c.setTreatAsDesktop(!1))},[n.pathname,c.error]);let h=(0,o.useMemo)(()=>({info:a,setInfo:l,...c,storage:s,cachedConnectionsData:d}),[a,l,c,s,d]);return(0,r.jsx)(I.Provider,{value:h,children:t})};var L=n("Z"),E=n("wA"),T=n("aw"),N=n("c7"),O=n("eL"),z=n("A"),R=n("Cp"),$={typography:{fontSize:14,htmlFontSize:16,fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:600,fontFamily:'"Source Sans Pro","Segoe UI","Helvetica Neue",-apple-system,Arial,sans-serif',button:{textTransform:"initial",fontWeight:400}},shape:{borderRadius:2},shadows:["none","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)"]},B={green:"#00873D",greenPale:"#0AAF54",red:"#DC423F",redPale:"#F05551",blue:"#3F8AB3",bluePale:"#469DCD",blueDark:"#005DB9",grey100:"#ffffff",grey98:"#FBFBFB",grey95:"#F2F2F2",grey90:"#E6E6E6",grey85:"#D9D9D9",grey55:"#8C8C8C",grey45:"#737373",grey30:"#4D4D4D",grey25:"#404040",grey20:"#333333",grey15:"#262626",grey10:"#1A1A1A",grey5:"#0E0E0E",grey0:"#000000"};let P={mode:"light",palette:{primary:{main:B.grey25,contrastText:B.grey100},secondary:{light:"#0AAF54",main:"#009845",dark:"#006937"},text:{primary:B.grey25,secondary:"rgba(0, 0, 0, 0.55)",disabled:"rgba(0, 0, 0, 0.3)",light:B.grey100,dark:B.grey0},action:{active:"#545454",hover:"rgba(0, 0, 0, 0.03)",hoverOpacity:.08,selected:"rgba(0, 0, 0, 0.05)",disabled:"rgba(0, 0, 0, 0.3)",disabledBackground:"rgba(0, 0, 0, 0.12)"},background:{paper:B.grey100,default:B.grey100,lightest:B.grey100,lighter:B.grey98,darker:B.grey95,darkest:B.grey90},custom:{whiteBorder:"rgb(255, 255, 255)",newFocusBorder:B.blueDark,focusBorder:B.blue,focusOutline:"rgba(70, 157, 205, 0.3)",inputBackground:"rgba(255, 255, 255, 1)",disabledBackground:B.grey45,disabledContrastText:B.grey100},selected:{main:B.green,alternative:"#E4E4E4",excluded:"#BEBEBE",selectedExcluded:"#BEBEBE",possible:B.grey100,selectedContrastText:B.grey100,mainContrastText:B.grey100,alternativeContrastText:B.grey25,excludedContrastText:B.grey25,selectedExcludedContrastText:B.grey100,possibleContrastText:B.grey0},btn:{normal:"rgba(255, 255, 255, 0.6)",hover:"rgba(0, 0, 0, 0.03)",active:"rgba(0, 0, 0, 0.1)",disabled:"rgba(255, 255, 255, 0.6)",border:"rgba(0, 0, 0, 0.15)",borderHover:"rgba(0, 0, 0, 0.15)"}}},W={mode:"dark",palette:{primary:{main:B.grey20,contrastText:B.grey100},secondary:{light:"#0AAF54",main:"#009845",dark:"#006937"},text:{primary:B.grey100,secondary:"rgba(255, 255, 255, 0.6)",disabled:"rgba(255, 255, 255, 0.3)",light:B.grey100,dark:B.grey0},action:{active:B.grey100,hover:"rgba(255, 255, 255, 0.05)",hoverOpacity:.08,selected:"rgba(0, 0, 0, 0.03)",disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(0, 0, 0, 0.12)"},divider:"rgba(0,0,0,0.3)",background:{default:"#323232",paper:"#323232",lightest:B.grey25,lighter:B.grey20,darker:B.grey15,darkest:B.grey10},custom:{whiteBorder:"rgb(255, 255, 255)",newFocusBorder:B.blueDark,focusBorder:B.blue,focusOutline:"rgba(70, 157, 205, 0.3)",inputBackground:"rgba(0, 0, 0, 0.2)",disabledBackground:B.grey45,disabledContrastText:B.grey100},selected:{main:B.green,alternative:B.grey20,excluded:B.grey10,selectedExcluded:B.grey10,possible:B.grey80,selectedContrastText:B.grey100,mainContrastText:B.grey100,alternativeContrastText:B.grey100,excludedContrastText:B.grey100,selectedExcludedContrastText:B.grey100,possibleContrastText:B.grey0},btn:{normal:"rgba(255, 255, 255, 0.15)",hover:"rgba(255, 255, 255, 0.25)",active:"rgba(0, 0, 0, 0.6)",disabled:"rgba(255, 255, 255, 0.15)",border:"rgba(0, 0, 0, 0.15)",borderHover:"rgba(0, 0, 0, 0.30)"}}},F={};function U(e){let t=P,n="";"string"==typeof e&&(n=e,"light"!==e&&"dark"!==e?console.warn(`Invalid theme: '${e}'`):"dark"===e&&(t=W));let r=JSON.stringify(t);if(F[r])return F[r];let i={palette:{type:t.mode,...$.palette,...t.palette},typography:{...$.typography},shadows:$.shadows,shape:{...$.shape}},o={...i,components:{MuiCheckbox:{defaultProps:{color:"secondary"}},MuiRadio:{defaultProps:{color:"secondary"}},MuiTabs:{defaultProps:{indicatorColor:"secondary"}},MuiTypography:{styleOverrides:{root:{color:i.palette.text.primary}}},MuiGrid:{styleOverrides:{variants:[{props:{alignItems:"center"},style:{"align-items":"center"}}]}},MuiButtonBase:{defaultProps:{disableRipple:!0,disableTouchRipple:!0,focusRipple:!1},styleOverrides:{root:{borderRadius:2,border:"1px solid transparent","&.Mui-focused":{borderColor:i.palette.custom.focusBorder,boxShadow:`0 0 0 2px ${i.palette.custom.focusOutline}`}}}},MuiIconButton:{styleOverrides:{root:{padding:7,borderRadius:2,border:"1px solid transparent","&:hover":{backgroundColor:i.palette.btn.hover},"&.Mui-focusVisible":{borderColor:i.palette.custom.focusBorder,boxShadow:`0 0 0 2px ${i.palette.custom.focusOutline}`},"&.Mui-active":{borderColor:"transparent",boxShadow:"none",backgroundColor:i.palette.btn.active},"&:not(.Mui-active):not(.Mui-focusVisible)":{borderColor:"transparent",boxShadow:"none"}}}},MuiOutlinedInput:{styleOverrides:{root:{backgroundColor:i.palette.custom.inputBackground,"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:i.palette.btn.border},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:i.palette.custom.focusBorder,borderWidth:2}}}},MuiButton:{styleOverrides:{outlined:{padding:"3px 11px",[`&.${R.A.focusVisible}`]:{borderColor:i.palette.custom.focusBorder,boxShadow:`0 0 0 2px ${i.palette.custom.focusOutline}`}},contained:{color:i.palette.text.primary,padding:"3px 11px",border:`1px solid ${i.palette.btn.border}`,backgroundColor:i.palette.btn.normal,boxShadow:"none",[`&.${R.A.focusVisible}`]:{borderColor:i.palette.custom.focusBorder,boxShadow:`0 0 0 2px ${i.palette.custom.focusOutline}`},"&:hover":{backgroundColor:i.palette.btn.hover,borderColor:i.palette.btn.borderHover,boxShadow:"none",[`&.${R.A.disabled}`]:{backgroundColor:i.palette.btn.disabled}},"&.Mui-active":{boxShadow:"none",backgroundColor:i.palette.btn.active},[`&.${R.A.disabled}`]:{backgroundColor:i.palette.btn.disabled}}}},MuiAccordionSummary:{styleOverrides:{content:{margin:"8px 0"}}}}};return F[r]=(0,z.A)(o),F[r].name=n,F[r]}let V=e=>{let{themeName:t,children:n}=e,i=(0,o.useMemo)(()=>U(t),[t]);return(0,r.jsx)(O.A,{injectFirst:!0,children:(0,r.jsx)(N.A,{theme:i,children:(0,r.jsx)(E.A,{maxWidth:"md",children:n})})})};var Q=n("ND"),Z=n("bS"),H=n("dJ"),_=n("AI");let Y=(0,Z.A)(Q.A)(e=>{let{theme:t,marginTop:n=0}=e;return{position:"relative",padding:t.spacing(2,2),backgroundColor:"white",borderRadius:t.spacing(1),marginTop:t.spacing(n)}}),J=(0,Z.A)(H.A)(e=>{let{theme:t}=e;return{backgroundColor:"transparent",padding:t.spacing(3)}}),G=(0,Z.A)(_.A,{shouldForwardProp:e=>"shouldBePointer"!==e})(e=>{let{shouldBePointer:t=!1}=e;return{cursor:t?"pointer":"default"}}),K=["Connect to engine","Select app","Develop"];var X=()=>{let e=(0,u.Zp)(),{activeStep:t,glob:n,error:i,setError:o}=S(),s=()=>{(n||i)&&(o(),e("/"))};return(0,r.jsx)(V,{themeName:"dark",children:(0,r.jsx)(J,{alternativeLabel:!0,activeStep:t,children:K.map((e,t)=>(0,r.jsx)(L.A,{children:(0,r.jsx)(G,{onClick:s,shouldBePointer:n||i,error:!!i&&!t,children:e})},e))})})},ee=()=>(0,r.jsxs)(V,{children:[(0,r.jsx)(X,{}),(0,r.jsx)(c.sv,{})]}),et=n("Zp"),en=n("l"),er=n("PE"),ei=n("ew"),eo=n("Yu"),es=n("oZ"),ea=e=>{let{showGuid:t}=e;return(0,r.jsxs)(es.A,{in:t,children:[(0,r.jsx)(ei.A,{variant:"h6",gutterBottom:!0,style:{marginTop:"1rem"},children:"WebSocket URL"}),(0,r.jsx)(ei.A,{variant:"body2",paragraph:!0,children:"The development server needs to connect to and communicate with the Qlik Associative Engine running within any of Qlik's product offerings. The connection is done through the WebSocket protocol using a WebSocket URL format that differs slightly between products. Enter the WebSocket URL that corresponds to the Qlik product you are using."}),(0,r.jsx)(ei.A,{variant:"subtitle1",gutterBottom:!0,children:"Qlik Cloud Services"}),(0,r.jsxs)(ei.A,{variant:"body2",paragraph:!0,children:[(0,r.jsx)("b",{children:"Web integration id format:"}),"There are two ways in order to connect through WebSocket:",(0,r.jsx)("br",{}),"1. ",(0,r.jsx)("code",{children:"qlik-web-integration-id"}),(0,r.jsx)("br",{}),"2. ",(0,r.jsx)("code",{children:"qlik-client-id"}),(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),(0,r.jsx)("b",{children:"Web integration id:"}),(0,r.jsx)("br",{}),(0,r.jsx)("code",{children:"wss://<tenant>.<region>.qlikcloud.com?qlik-web-integration-id=<web-integration-id>"}),(0,r.jsx)("br",{}),"Example: ",(0,r.jsx)("code",{children:"wss://qlik.eu.qlikcloud.com?qlik-web-integration-id=xxx"}),(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),"For more info, visit"," ",(0,r.jsx)(eo.A,{color:"secondary",underline:"always",href:"https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Admin/mc-adminster-web-integrations.htm",children:"Managing web integrations"}),"."]}),(0,r.jsxs)(ei.A,{variant:"body2",paragraph:!0,children:[(0,r.jsx)("b",{children:"OAuth Client ID URL format:"}),(0,r.jsx)("br",{}),(0,r.jsx)("code",{children:"wss://<tenant>.<region>.qlikcloud.com?qlik-client-id=<client-id>"}),(0,r.jsx)("br",{}),"Example: ",(0,r.jsx)("code",{children:"wss://qlik.eu.qlikcloud.com?qlik-client-id=xxx"}),(0,r.jsx)("br",{}),"Redirect URL form: ",(0,r.jsx)("code",{children:"http://localhost:8000/auth/login/callback"}),(0,r.jsx)("br",{}),"The ",(0,r.jsx)("code",{children:"qlik-web-integration-id"})," ",(0,r.jsx)("b",{children:"OR"})," ",(0,r.jsx)("code",{children:"qlik-client-id"})," must be present in order for QCS to confirm that the request originates from a whitelisted domain.",(0,r.jsx)("br",{}),(0,r.jsx)("br",{})]}),(0,r.jsx)(ei.A,{variant:"subtitle1",gutterBottom:!0,children:"Qlik Sense on Windows"}),(0,r.jsxs)(ei.A,{variant:"body2",paragraph:!0,children:["WebSocket URL format: ",(0,r.jsx)("code",{children:"wss://<sense-host.com>/<virtual-proxy-prefix>"}),(0,r.jsx)("br",{}),"Example: ",(0,r.jsx)("code",{children:"wss://mycompany.com/bi"}),(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),"Note that for the Qlik Sense Proxy to allow sessions from this webpage,",(0,r.jsx)("code",{children:window.location.host})," needs to be whitelisted in QMC in your Qlik Sense on Windows deployment. In addition, you need to enable ",(0,r.jsx)("i",{children:"Has secure attribute"})," and set ",(0,r.jsx)("i",{children:"SameSite attribute"})," to ",(0,r.jsx)("i",{children:"None"}),".",(0,r.jsx)("br",{}),'Also some "Additional reponse headers" needs to align with the whitelisted domain:',(0,r.jsxs)("ul",{children:[(0,r.jsxs)("li",{children:["Access-Control-Allow-Origin: ",(0,r.jsx)("code",{children:window.location.host})]}),(0,r.jsx)("li",{children:"Access-Control-Allow-Credentials: true"}),(0,r.jsx)("li",{children:"Access-Control-Expose-Headers: qlik-csrf-token"})]}),"Make sure you are logged in to Qlik Sense in another browser tab."]}),(0,r.jsx)(ei.A,{variant:"subtitle1",gutterBottom:!0,children:"Qlik Sense Desktop"}),(0,r.jsxs)(ei.A,{variant:"body2",paragraph:!0,children:["WebSocket URL format: ",(0,r.jsx)("code",{children:"ws://localhost:4848"})]})]})};function el(e){let{size:t,style:n={},viewBox:i="0 0 16 16",shapes:o=[]}=e,s={fontSize:"large"===t?"20px":"small"===t?"12px":"16px",display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-.125em",textRendering:"optimizeLegibility",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",...n};return(0,r.jsx)("i",{style:s,children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:i,fill:"currentColor",children:o.map((e,t)=>{let{type:n,attrs:i}=e;return(0,r.jsx)(n,{...i},t)})})})}var ed=e=>el({...e,shapes:[{type:"path",attrs:{d:"M9.41421356,8 L11.8890873,5.52512627 C12.065864,5.34834957 12.0305087,4.95944084 11.8183766,4.74730881 L11.2526912,4.18162338 C11.0405592,3.96949135 10.6516504,3.93413601 10.4748737,4.1109127 L8,6.58578644 L5.52512627,4.1109127 C5.34834957,3.93413601 4.95944084,3.96949135 4.74730881,4.18162338 L4.25233406,4.67659813 C3.96949135,4.95944084 3.93413601,5.34834957 4.1109127,5.52512627 L6.58578644,8 L4.1109127,10.4748737 C3.93413601,10.6516504 3.96949135,11.0405592 4.18162338,11.2526912 L4.67659813,11.7476659 C4.95944084,12.0305087 5.34834957,12.065864 5.52512627,11.8890873 L8,9.41421356 L10.4748737,11.8890873 C10.6516504,12.065864 11.0405592,12.0305087 11.2526912,11.8183766 L11.8183766,11.2526912 C12.0305087,11.0405592 12.065864,10.6516504 11.8890873,10.4748737 L9.41421356,8 Z M8,0 C12.4,0 16,3.6 16,8 C16,12.4 12.4,16 8,16 C3.6,16 0,12.4 0,8 C0,3.6 3.6,0 8,0 Z"}}]}),ec=n("l5"),eu=n("Db"),eh=n("nm");let ep=[{id:0,label:"Local Engine",formFields:["Engine WebSocket URL"]},{id:1,label:"Web Integration Id",formFields:["Engine WebSocket URL","Web Integration Id"]},{id:2,label:"Client Id",formFields:["Engine WebSocket URL","Client Id"]}];n("gO"),n("Hj"),U("light");var eg=()=>{let e=(0,u.Zp)(),{info:t,setError:n,cachedConnectionsData:i}=S();return i.cachedConnections.length?(0,r.jsxs)(Q.A,{mb:2,children:[(0,r.jsx)(ei.A,{variant:"h6",children:"Previous connections"}),(0,r.jsx)(ec.A,{children:i.cachedConnections.map(o=>(0,r.jsxs)(eu.A,{component:"a",onClick:()=>{n(),e(`/app-list?engine_url=${o.replace("?","&")}`)},disabled:(e=>{let{item:t,info:n}=e;return!!n&&(!!((n.isClientIdProvided||n.isWebIntegrationIdProvided)&&t.includes("localhost"))||(n.isClientIdProvided?!t.includes("qlik-client-id"):!!n.isWebIntegrationIdProvided&&!t.includes("qlik-web-integration-id")))})({item:o,info:t}),children:[(0,r.jsx)(eh.A,{primary:o}),(0,r.jsx)(en.A,{onClick:()=>i.removeCachedConnection(o),"data-testid":"close-btn",size:"large",edge:"end",children:(0,r.jsx)(ed,{})})]},o))})]}):null},ex=n("jQ"),em=n("IR"),ef=n("c0"),ej=n("hW");function ey(e){let{error:{message:t,hints:n}}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ei.A,{variant:"subtitle1",color:"error",gutterBottom:!0,style:{marginBottom:0},children:t}),n.map(e=>(0,r.jsx)(ei.A,{variant:"body2",children:e},e))]})}function eb(e){let{info:t,fields:n,error:i,isCredentialProvided:s}=e,a=(0,u.Zp)(),{setError:l}=S(),[d,c]=(0,o.useState)({});return(0,r.jsx)("form",{onSubmit:e=>{e.preventDefault(),l();let t=new URL(d["engine-websocket-url"]);d["web-integration-id"]&&t.searchParams.append("qlik-web-integration-id",d["web-integration-id"]),d["client-id"]&&t.searchParams.append("qlik-client-id",d["client-id"]),a(`/app-list?engine_url=${t.toString().replace("?","&")}`)},children:(0,r.jsxs)(er.A,{container:!0,spacing:2,direction:"column",justifyContent:"center",children:[n.map((e,n)=>(0,r.jsx)(er.A,{size:12,children:(0,r.jsx)(ef.A,{fullWidth:!0,autoFocus:0===n,disabled:s&&1===n,name:e.split(" ").map(e=>e.toLowerCase()).join("-"),error:t?.invalid,placeholder:0===n?e:(e=>{let{isCredentialProvided:t,field:n}=e;return t?`You have provided "${n}" through cli or nebula.config.js file already!`:n})({field:e,isCredentialProvided:s}),onChange:e=>{c({...d,[e.target.name]:e.target.value})}})},e)),(0,r.jsxs)(er.A,{container:!0,size:12,alignItems:"center",children:[(0,r.jsx)(er.A,{size:10,children:i&&(0,r.jsx)(ey,{error:i})}),(0,r.jsx)(er.A,{container:!0,size:2,direction:"row",alignItems:"center",justifyContent:"flex-end",children:(0,r.jsx)(ej.A,{type:"submit",variant:"contained",size:"large",disabled:(e=>{let{isCredentialProvided:t,inputs:n,fields:r}=e;return t?!n["engine-websocket-url"]:Object.entries(n).length!==r.length||Object.values(n).some(e=>!e)})({isCredentialProvided:s,inputs:d,fields:n}),children:"Connect"})})]})]})})}function eA(){let{info:e,error:t}=S(),[n,i]=(0,o.useState)(0);return(0,o.useEffect)(()=>{let t=e?e.isWebIntegrationIdProvided?ep.findIndex(e=>"Web Integration Id"===e.label):e.isClientIdProvided?ep.findIndex(e=>"Client Id"===e.label):0:0;t&&i(t)},[e]),(0,r.jsxs)(Q.A,{children:[(0,r.jsx)(ei.A,{variant:"h6",gutterBottom:!0,children:"New connection with:"}),(0,r.jsxs)(Q.A,{sx:{width:"100%"},children:[(0,r.jsx)(Q.A,{sx:{borderBottom:1,borderColor:"divider"},children:(0,r.jsx)(ex.A,{value:n,onChange:(e,t)=>i(t),"aria-label":"basic tabs example",children:ep.map(t=>{let{id:n,label:i}=t;return(0,r.jsx)(em.A,{label:i,disabled:(e=>{let{label:t,info:n}=e;if(!n)return!1;let r=t.split(" ").map(e=>e.toLowerCase()).join("-");return n.isWebIntegrationIdProvided?"web-integration-id"!==r:!!n.isClientIdProvided&&"client-id"!==r})({info:e,label:i})},n)})})}),ep.map(i=>{let{id:o,formFields:s}=i;return(0,r.jsx)(eM,{tabIdx:n,idx:o,children:(0,r.jsx)(eb,{info:e,error:t,fields:s,isCredentialProvided:e?.isWebIntegrationIdProvided||e?.isClientIdProvided})},o)})]})]})}function eM(e){let{children:t,tabIdx:n,idx:i}=e;return n===i?(0,r.jsx)(Q.A,{sx:{p:3,pb:1},children:t}):null}var ev=()=>{let{cachedConnectionsData:e}=S(),[t,n]=(0,o.useState)(!1);return(()=>{let{cachedConnectionsData:e}=S();(0,o.useEffect)(()=>{x.Ay.setDefaultHostConfig(void 0)},[e.cachedConnections.length])})(),(0,o.useEffect)(()=>{n(!e.cachedConnections.length)},[e.cachedConnections.length]),(0,r.jsxs)(Y,{children:[(0,r.jsxs)(er.A,{container:!0,children:[(0,r.jsx)(er.A,{sx:{flex:1},children:(0,r.jsx)(ei.A,{variant:"h5",gutterBottom:!0,children:"Connect to an engine"})}),(0,r.jsx)(er.A,{item:!0,children:(0,r.jsx)(en.A,{onClick:()=>n(!t),size:"small",children:(0,r.jsx)(et.A,{})})})]}),(0,r.jsx)(eg,{}),(0,r.jsx)(eA,{}),(0,r.jsx)(ea,{showGuid:t})]})},ew=n("tW"),eC=()=>{let e=(0,u.Zp)(),t=(0,u.zy)(),{info:n,glob:i,treatAsDesktop:s}=S(),{loading:a,appList:l}=(e=>{let{glob:t,info:n}=e,{setInfo:r,setActiveStep:i}=S(),[s,a]=(0,o.useState)(),[l,d]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{i(1),M().then(e=>{r(e)})},[]),(0,o.useEffect)(()=>{s?.length||(d(!0),t?.getDocList()?.then(e=>{a(e),e&&d(!1)})?.catch(e=>{console.error("Failed to fetch app list:",e),d(!1)}))},[n,t]),{appList:s,loading:l}})({glob:i,info:n});return(0,r.jsxs)(Y,{children:[(0,r.jsx)(ei.A,{variant:"h5",gutterBottom:!0,children:"Select an app"}),a&&(0,r.jsx)(ew.A,{"data-testid":"loading",size:32}),!a&&l&&!l.length&&(0,r.jsx)(ei.A,{component:"span",children:"No apps found!"}),l&&l.length>0&&(0,r.jsx)(ec.A,{children:l.map(i=>(0,r.jsx)(eu.A,{button:!0,component:"a",onClick:()=>(async e=>{let{navigate:t,location:n,targetApp:r,info:i}=e,{search:o}=n,s=i.engine.secure?"wss":"ws",a=i.engine.port?`:${i.engine.port}`:"",l=i.engine.prefix?`/${i.engine.prefix}`:"",d=("localhost"===i.engine.host?`${i.engine.host}${a}`:i.engine.host)+l,c=await j(`https://${i.engine.host}${l}`),u=c?`&qlik-csrf-token=${c}`:"",h=`${s}://${d}/app/${encodeURIComponent(r)}${u}`,p=o.replace(i.engineUrl,h);t(`/dev/${p}`.replace("&shouldFetchAppList=true",""))})({info:n,navigate:e,location:t,targetApp:s?i.qDocName:i.qDocId}),children:(0,r.jsx)(eh.A,{primary:i.qTitle,secondary:i.qDocId})},i.qDocId))})]})},eD=n("o"),eq=n("NT"),eI=n("Fh"),eS=n("I3"),ek=n("r5"),eL=n("EE"),eE=o.createContext({language:null,theme:null,translator:null,constraints:{},interactions:{},themeApi:null,modelStore:{},selectionStore:{},hostConfig:null,queryParams:null});function eT(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},n=[],r={},i={get:t=>e[t],set:(n,i)=>{if(void 0===n||"object"==typeof n)throw Error(`Invalid key: ${JSON.stringify(n)}`);return e[n]=i,r[n]=t({type:"SET",value:i}),i},clear:t=>{if(void 0===t||"object"==typeof t)throw Error(`Invalid key: ${JSON.stringify(t)}`);let n=r[t];delete r[t],n&&n(),e[t]=null},dispatch:t=>{n.forEach(n=>n(t?{}:e))},destroy:()=>{Object.keys(r).forEach(e=>{r[e]&&r[e]()})}};return[()=>{let[,t]=(0,o.useState)(e);return(0,o.useEffect)(()=>(n.push(t),()=>{let e=n.indexOf(t);n.splice(e,1)}),[t]),[i]},i]}var eN=n("Vf"),eO=n("m3"),ez=n("Mc"),eR=n("NQ"),e$=n("Hb"),eB=n("r");let eP={"@nebula.js/stardust":eD,react:s,"react-dom":n.t(eB,2),"react-dom/client":l,"react/jsx-runtime":i},eW=/^[A-Za-z_$][\w$]*$/,eF=!1,eU=async(e,t)=>{let n;(()=>{if(eF)return;eF=!0,globalThis.nebulaShared=eP;let e={};Object.entries(eP).forEach(t=>{let n,[r,i]=t;e[r]=URL.createObjectURL(new Blob([(n=Object.keys(i).filter(e=>"default"!==e&&eW.test(e)).map(e=>`export const ${e} = shared[${JSON.stringify(e)}];`),[`const shared = globalThis.nebulaShared[${JSON.stringify(r)}];`,"export default shared.default !== undefined ? shared.default : shared;",...n].join("\n"))],{type:"text/javascript"}))});let t=document.createElement("script");t.type="importmap",t.textContent=JSON.stringify({imports:e}),document.head.appendChild(t)})();let r=t||`/pkg/${encodeURIComponent(e)}`;return(n=await import(`${r}${r.includes("?")?"&":"?"}t=${Date.now()}`))&&"object"==typeof n&&"default"in n?n.default:n},eV={};window.onHotChange=(e,t)=>(eV[e]||(eV[e]=[]),eV[e].push(t),window[e]&&t(),()=>{let n=eV[e].indexOf(t);eV[e].splice(n,1)});var eQ=n("jk"),eZ=n("p7e"),eH=n("Tc");function e_(e){let[t,n]=(0,o.useState)();return(0,o.useEffect)(()=>{if(e){let t=()=>{e.getProperties().then(e=>{n({...e})})};return e.on("changed",t),t(),()=>{e.removeListener("changed",t)}}return()=>{}},[e,n]),[t,t=>e.setProperties(t)]}let eY=o.createContext();var eJ=n("RA");let eG=[[10,31],[0,31],[0,31],[0,31],[0,31],[0,31]];function eK(e){let[t,n]=e;return(t+(Math.random()*(n-t)|0)).toString(32)}function eX(){return eG.map(eK).join("")}function e0(e,t){for(let n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)}function e1(e,t){let n=0;for(let r=0;r<e.length;++r)e[r]>t?--e[r]:e[r]===t&&(n=r);return e.splice(n,1),n}function e2(e){let{dc:t,def:n,properties:r}=e;t.qDimensions=t.qDimensions||[],t.qMeasures=t.qMeasures||[],t.qInterColumnSortOrder=t.qInterColumnSortOrder||[],t.qInitialDataFetch=t.qInitialDataFetch||[],t.qColumnOrder=t.qColumnOrder||[],t.qExpansionState=t.qExpansionState||[];let i={dimensions:()=>t.qDimensions,measures:()=>t.qMeasures,addDimension(e){let o="string"==typeof e?{qDef:{qFieldDefs:[e]}}:{...e,qDef:e.qDef||{}};return o.qDef.cId=o.qDef.cId||eX(),o.qDef.qSortCriterias=o.qDef.qSortCriterias||[{qSortByLoadOrder:1,qSortByNumeric:1,qSortByAscii:1}],o.qOtherTotalSpec=o.qOtherTotalSpec||{},o.qAttributeExpressions=o.qAttributeExpressions||[],o.qAttributeDimensions=o.qAttributeDimensions||[],t.qDimensions.length<i.maxDimensions()?(t.qDimensions.push(o),e0(t.qInterColumnSortOrder,t.qDimensions.length-1),n.dimensions.added(o,r)):(t.qLayoutExclude=t.qLayoutExclude||{},t.qLayoutExclude.qHyperCubeDef=t.qLayoutExclude.qHyperCubeDef||{},t.qLayoutExclude.qHyperCubeDef.qDimensions=t.qLayoutExclude.qHyperCubeDef.qDimensions||[],t.qLayoutExclude.qHyperCubeDef.qMeasures=t.qLayoutExclude.qHyperCubeDef.qMeasures||[],t.qLayoutExclude.qHyperCubeDef.qDimensions.push(o)),o},removeDimension(e){let i=t.qDimensions.splice(e,1)[0];return e1(t.qInterColumnSortOrder,e),n.dimensions.removed(i,r,e),i},addMeasure(e){let o="string"==typeof e?{qDef:{qDef:e}}:{...e,qDef:e.qDef||{}};o.qDef.cId=o.qDef.cId||eX(),o.qSortBy=o.qSortBy||{qSortByLoadOrder:1,qSortByNumeric:-1},o.qAttributeDimensions=o.qAttributeDimensions||[],o.qAttributeExpressions=o.qAttributeExpressions||[],t.qMeasures.length<i.maxMeasures()?(t.qMeasures.push(o),e0(t.qInterColumnSortOrder,t.qDimensions.length+t.qMeasures.length-1),n.measures.added(o,r)):(t.qLayoutExclude=t.qLayoutExclude||{},t.qLayoutExclude.qHyperCubeDef=t.qLayoutExclude.qHyperCubeDef||{},t.qLayoutExclude.qHyperCubeDef.qDimensions=t.qLayoutExclude.qHyperCubeDef.qDimensions||[],t.qLayoutExclude.qHyperCubeDef.qMeasures=t.qLayoutExclude.qHyperCubeDef.qMeasures||[],t.qLayoutExclude.qHyperCubeDef.qMeasures.push(o))},removeMeasure(e){let i=t.qMeasures.splice(e,1)[0];e1(t.qInterColumnSortOrder,t.qDimensions.length+e),n.measures.removed(i,r,e)},maxDimensions:()=>n.dimensions.max(t.qMeasures.length),maxMeasures:()=>n.measures.max(t.qDimensions.length),canAddDimension:()=>t.qDimensions.length<i.maxDimensions(),canAddMeasure:()=>t.qMeasures.length<i.maxMeasures()};return i}function e4(e){let{dc:t,def:n,properties:r}=e;t.qInitialDataFetch=t.qInitialDataFetch||[];let i={dimensions:()=>t.qLibraryId||t.qDef&&t.qDef.qFieldDefs&&0!==t.qDef.qFieldDefs.length?[t]:[],measures:()=>[],addDimension(e){let i="string"==typeof e?{qDef:{qFieldDefs:[e]}}:{...e,qDef:e.qDef||{}};return i.qDef.cId=i.qDef.cId||eX(),i.qDef.qSortCriterias=t.qDef.qSortCriterias||[{qSortByState:1,qSortByLoadOrder:1,qSortByNumeric:1,qSortByAscii:1}],Object.keys(i).forEach(e=>{t[e]=i[e]}),n.dimensions.added(i,r),i},removeDimension:e=>(delete t.qDef,delete t.qLibraryId,n.dimensions.removed(t,r,e),t),addMeasure(){},removeMeasure(){},maxDimensions:()=>1,maxMeasures:()=>0,canAddDimension:()=>0===i.dimensions().length,canAddMeasure:()=>!1};return i}function e5(e){let{dc:t,def:n,properties:r,dimensions:i}=e,o={dimensions:()=>i,measures:()=>[],addDimension(e){let i="string"==typeof e?{qDef:{qFieldDefs:[e]}}:{...e,qDef:e.qDef||{}};return i.qDef.cId=i.qDef.cId||eX(),i.qDef.qSortCriterias=t&&t.qDef.qSortCriterias||[{qSortByState:1,qSortByLoadOrder:1,qSortByNumeric:1,qSortByAscii:1}],n.dimensions.added(i,r),i},removeDimension(e){let t=i[e];return n.dimensions.removed(t,r,e),t},maxDimensions(){let{max:e}=n.dimensions||{};return("function"==typeof e?e():e)||0},maxMeasures:()=>0,canAddDimension:()=>o.dimensions().length<o.maxDimensions(),canAddMeasure:()=>!1};return o}function e3(){let{useModelStore:e}=(0,o.useContext)(eE).modelStore;return e()}function e6(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];let s=t?`${t.id}/${JSON.stringify(e)}`:null,[a]=e3(),[l]=function(){let{useRpcRequestSessionModelStore:e}=(0,o.useContext)(eE).modelStore;return e()}(),[d,c]=(0,o.useState)();return(0,o.useEffect)(()=>{t&&(async()=>{let n=l.get(s);n||(n=t.createSessionObject(e),l.set(s,n));let r=await n;a.set(s,r),c(r)})()},[t,...r]),[d]}let e8=(e,t)=>{let n,{rpcResultStore:r,key:i,method:o}=t;switch(t.type){case"INVALID":n={...e,valid:!1,invalid:!0,validating:!0,canCancel:!0,canRetry:!1,rpcRetry:!1};break;case"VALID":n={result:{...t.result},invalid:!1,valid:!0,validating:!1,canCancel:!1,canRetry:!1,rpcRetry:!1};break;case"CANCELLED":n={...e,invalid:!0,valid:!1,validating:!1,canCancel:!1,canRetry:!0,rpcRetry:!1};break;default:throw Error("Undefined action")}let s=r.get(i);return s||(s={}),s[o]=n,r.set(i,s),n};function e9(e,t){let n,r=e?`${e.id}`:null,[i]=function(){let{useRpcResultStore:e}=(0,o.useContext)(eE).modelStore;return e()}(),[s,a]=(0,o.useReducer)(e8,r?i.get(r):null),[l]=function(){let{useModelChangedStore:e}=(0,o.useContext)(eE).modelStore;return e()}(),[d]=function(){let{useRpcRequestStore:e}=(0,o.useContext)(eE).modelStore;return e()}();r&&((n=d.get(r))||(n={},d.set(r,n)));let c=async o=>{let s=n[t];(!s||s&&s.rpcRetry)&&(s={rpc:e[t](),rpcRetry:!1},n[t]=s,a({type:"INVALID",method:t,key:r,model:e,rpcResultStore:i,canCancel:!0}));try{await new Promise(e=>{setTimeout(e,0)});let n=await s.rpc;a({type:"VALID",result:n,key:r,method:t,model:e,rpcResultStore:i})}catch(e){15!==e.code||o||(s.rpcRetry||(s.rpcRetry=!0),c(!0))}};return(0,o.useEffect)(()=>{e&&c()},[e,l.get(e&&e.id),r,t]),[s&&s.result,{validating:s&&s.validating,canCancel:s&&s.canCancel,canRetry:s&&s.canRetry},{cancel:async()=>{let o=e.session.getObjectApi({handle:-1});await o.cancelRequest(n[t].rpc.requestId),a({type:"CANCELLED",key:r,method:t,model:e,rpcResultStore:i})},retry:()=>{n[t].rpcRetry=!0,c()}}]}function e7(e){let[t,{validating:n,canCancel:r,canRetry:i},o]=e9(e,"getLayout");return e?.pureLayout&&t?[e.pureLayout,{validating:n,canCancel:r,canRetry:i},o]:[t,{validating:n,canCancel:r,canRetry:i},o]}let te={qInfo:{qType:"DimensionList",qId:"DimensionList"},qDimensionListDef:{qType:"dimension",qData:{labelExpression:"/qDimension/qLabelExpression",title:"/qMetaDef/title"}}},tt={qInfo:{qType:"MeasureList",qId:"MeasureList"},qMeasureListDef:{qType:"measure",qData:{labelExpression:"/qMeasure/qLabelExpression",title:"/qMetaDef/title"}}};function tn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"dimension",[n]=e6("dimension"===t?te:tt,e),[r]=e7(n);return[r&&(r.qDimensionList||r.qMeasureList).qItems||[]]}var tr=n("IU"),ti=n("aT"),to=n("kV"),ts=n("QW"),ta=n.n(ts),tl=n("Ka"),td=n.n(tl),tc=n("fU"),tu=n("ra"),th=n("f"),tp=n("b1"),tg=e=>el({...e,shapes:[{type:"path",attrs:{d:"M8.588 11.415a6 6 0 1 1 2.828-2.829l4.101 4a1.5 1.5 0 0 1 .014 2.134l-.707.707a1.5 1.5 0 0 1-2.108.014l-4.128-4.026ZM11 6A5 5 0 1 0 1 6a5 5 0 0 0 10 0Zm-1.52 4.888 3.934 3.837a.5.5 0 0 0 .703-.005l.707-.707a.5.5 0 0 0-.005-.711l-3.926-3.829a6.034 6.034 0 0 1-1.413 1.415Z"}}]});let tx="Search",tm={gridContainer:`${tx}-gridContainer`,gridItem:`${tx}-gridItem`},tf=(0,th.A)(er.A)(e=>{let{theme:t}=e;return{[`& .${tm.gridContainer}`]:{padding:t.spacing(0,1,0,1)},[`& .${tm.gridItem}`]:{padding:t.spacing(0,1,0,1)}}});function tj(){let e=document.querySelector('meta[name="viewport"]');e instanceof HTMLMetaElement&&(e.content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0")}function ty(e){let{onChange:t=()=>{},onEnter:n=()=>{},onEscape:i=()=>{}}=e,[s,a]=(0,o.useState)("");return(0,r.jsxs)(tf,{className:tm.gridContainer,container:!0,direction:"row",alignItems:"center",children:[(0,r.jsx)(er.A,{children:(0,r.jsx)(tg,{})}),(0,r.jsx)(er.A,{className:tm.gridItem,sx:{flex:1},children:(0,r.jsx)(tp.A,{fullWidth:!0,autoFocus:!0,placeholder:"Search",value:s,onChange:e=>{a(e.target.value),t(e.target.value)},onFocus:tj,onKeyDown:e=>{switch(e.key){case"Enter":n(),a("");break;case"Escape":i()}}})})]})}function tb(e){let{field:t,onSelect:n,sub:i,parts:o}=e;return(0,r.jsxs)(eu.A,{onClick:()=>n(t.qName),"data-key":t.qName,children:[(0,r.jsx)(eh.A,{children:o.map((e,t)=>(0,r.jsx)("span",{style:e.highlight?{flex:"0 1 auto",backgroundColor:"#FFC72A"}:{flex:"0 1 auto"},children:e.text},t))}),i&&(0,r.jsx)(tc.A,{fontSize:"small"})]})}function tA(e){let{item:t,onSelect:n,parts:i}=e;return(0,r.jsx)(eu.A,{onClick:()=>n(t.qInfo),"data-key":t.qInfo.qId,children:(0,r.jsx)(eh.A,{children:i.map((e,t)=>(0,r.jsx)("span",{style:e.highlight?{flex:"0 1 auto",backgroundColor:"#FFC72A"}:{flex:"0 1 auto"},children:e.text},t))})})}function tM(e){let{aggr:t,field:n,onSelect:i}=e;return(0,r.jsx)(eu.A,{onClick:()=>i(t),"data-key":t,children:(0,r.jsx)(eh.A,{children:`${t}(${n})`})})}function tv(e){let{app:t,onSelect:n,title:i="",type:s="dimension",searchTerm:a=""}=e,[l]=tn(t,s),d=(0,o.useMemo)(()=>l.slice().sort((e,t)=>e.qData.title.toLowerCase().localeCompare(t.qData.title.toLowerCase())),[l]);return l.length>0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(tr.A,{component:"div",style:{backgroundColor:"inherit"},children:i}),d.map(e=>{let t=td()(e.qData.title,a),i=ta()(e.qData.title,t);return a&&0===t.length?null:(0,r.jsx)(tA,{item:e,onSelect:n,parts:i},e.qInfo.qId)})]}):null}function tw(e){let{alignTo:t,show:n,close:i,onSelected:s,type:a}=e,l=(0,o.useContext)(eY),[d,c]=(0,o.useState)(null),[u,h]=(0,o.useState)(""),p=(0,T.A)(),[g]=e6({qInfo:{qType:"FieldList",qId:"FieldList"},qFieldListDef:{qShowDerivedFelds:!1,qShowHidden:!1,qShowSemantic:!0,qShowSrcTables:!0,qShowSystem:!1}},l),[x]=e7(g),m=(0,o.useMemo)(()=>(x&&x.qFieldList.qItems||[]).slice().sort((e,t)=>e.qName.toLowerCase().localeCompare(t.qName.toLowerCase())),[x]),f=e=>{e&&e.qId?(s(e),i()):"measure"===a?c(e):(s({field:e}),i())},j=e=>{s({field:d,aggregation:e}),i()};return(0,r.jsxs)(ti.Ay,{open:n,onClose:i,anchorEl:t.current,marginThreshold:16,elevation:3,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},PaperProps:{style:{minWidth:"250px",maxHeight:"300px",background:p.palette.background.lightest}},children:[!d&&(0,r.jsx)(ty,{onChange:h}),d&&(0,r.jsxs)(ec.A,{dense:!0,component:"nav",children:[(0,r.jsxs)(eu.A,{onClick:()=>c(null),children:[(0,r.jsx)(to.A,{children:(0,r.jsx)(tu.A,{})}),(0,r.jsx)(eh.A,{children:"Back"})]}),(0,r.jsx)(eH.A,{}),(0,r.jsx)(tr.A,{component:"div",children:"Aggregation"}),["sum","count","avg","min","max"].map(e=>(0,r.jsx)(tM,{aggr:e,field:d,onSelect:j},e))]}),!d&&m.length>0&&(0,r.jsxs)(ec.A,{dense:!0,component:"nav",style:{background:p.palette.background.lightest},children:[(0,r.jsx)(tv,{app:l,onSelect:f,type:a,title:"measure"===a?"Measures":"Dimensions",searchTerm:u}),(0,r.jsx)(tr.A,{component:"div",style:{backgroundColor:"inherit"},children:"Fields"}),m.map(e=>{let t=td()(e.qName,u),n=ta()(e.qName,t);return u&&0===t.length?null:(0,r.jsx)(tb,{field:e,onSelect:f,sub:"measure"===a,parts:n},e.qName)})]})]})}let tC=e=>{let{field:t,libraryItems:n}=e;if(t.qLibraryId){let e=n.filter(e=>e.qInfo.qId===t.qLibraryId)[0];return e?e.qData.title:"!!!"}return t.qDef&&t.qDef.qFieldDefs?t.qDef.qFieldDefs[0]:t.qDef&&t.qDef.qDef?t.qDef.qDef:"???"};function tD(e){let{items:t,type:n="dimension",label:i="",addLabel:s="Add",onAdded:a,onRemoved:l,canAdd:d=!0}=e,[c,u]=(0,o.useState)(!1),h=(0,o.useRef)(null),[p]=tn((0,o.useContext)(eY),n);return(0,r.jsxs)("div",{children:[(0,r.jsx)(ei.A,{variant:"overline",children:i}),(0,r.jsx)(ec.A,{dense:!0,children:t.map((e,t)=>(0,r.jsx)(eJ.Ay,{disableGutters:!0,secondaryAction:(0,r.jsx)(en.A,{onClick:()=>{l(t)},size:"large",children:(0,r.jsx)(ed,{})}),children:(0,r.jsx)(eh.A,{children:(0,r.jsx)(tC,{field:e,libraryItems:p,type:n})})},e.qDef&&e.qDef.cId||t))}),(0,r.jsx)(ej.A,{variant:"contained",fullWidth:!0,onClick:()=>{u(!c)},ref:h,disabled:!d,children:s}),c&&(0,r.jsx)(tw,{alignTo:h,show:c,close:()=>u(!1),onSelected:e=>{e.qId?a(e):e&&("dimension"===n?a(e.field):a(`${e.aggregation||"sum"}([${e.field}])`))},type:n})]})}function tq(e){let{setProperties:t,target:n,properties:i}=e,[s,a]=(0,o.useState)([]),l=n.dimensions&&n.dimensions.max&&n.dimensions.max()>1,d=n.propertyPath.match("/qHyperCube")?e2:l?e5:e4,c=((e,t)=>{let n=t.split("/"),r=e;if(void 0!==r){for(let e=0;e<n.length;++e)if(""!==n[e]){if(void 0===r[n[e]])return;r=r[n[e]]}return r}})(i,n.propertyPath),u=(0,o.useMemo)(()=>d({def:n,dc:c,properties:i,dimensions:s}),[c,n,i,s]);return(0,r.jsxs)("div",{style:{width:"100%"},children:[(0,r.jsx)(ei.A,{color:"textSecondary",style:{fontFamily:"Monaco, monospace",fontSize:"0.7rem"},children:n.propertyPath}),(0,r.jsx)(tD,{onAdded:e=>{let n="object"==typeof e?{qLibraryId:e.qId}:e,r=u.addDimension(n);t(i).then(()=>{a([...s,r])})},onRemoved:e=>{u.removeDimension(e),t(i).then(()=>{a([...s.slice(0,e),...s.slice(e+1)])})},canAdd:u.canAddDimension(),items:u.dimensions(),type:"dimension",label:"Dimensions",addLabel:"Add dimension"},"dimensions"),(0,r.jsx)(tD,{onAdded:e=>{u.addMeasure("object"==typeof e?{qLibraryId:e.qId}:e),t(i)},onRemoved:e=>{u.removeMeasure(e),t(i)},canAdd:u.canAddMeasure(),items:u.measures(),type:"measure",label:"Measures",addLabel:"Add measures"},"measures")]})}function tI(e){let{setProperties:t,sn:n,properties:i}=e;if(!n)return null;let{targets:o}=n.qae.data;return o.length?(0,r.jsx)(ec.A,{children:o.map(e=>(0,r.jsx)(eJ.Ay,{divider:!0,disableGutters:!0,children:(0,r.jsx)(tq,{target:e,properties:i,setProperties:t})},e.propertyPath))}):(0,r.jsx)(ei.A,{children:"No data targets found"})}var tS=n("yY"),tk=n("QL"),tL=n("le"),tE=n("Nq"),tT=n("dc"),tN=n("UK"),tO=n("DG");let tz=null,tR="AutoComponents",t$={summary:`${tR}-summary`,details:`${tR}-details`,root:`${tR}-root`},tB=(0,th.A)(er.A)(e=>{let{theme:t}=e;return{[`& .${t$.summary}`]:{padding:t.spacing(0,1),backgroundColor:t.palette.background.lighter,borderBottom:`1px solid ${t.palette.divider}`},[`& .${t$.details}`]:{padding:t.spacing(1)}}}),tP=(0,th.A)(tS.A)(e=>{let{theme:t}=e;return{[`& .${t$.root}`]:{boxShadow:"none",marginLeft:-t.spacing(1),marginRight:-t.spacing(1),"&$expanded":{marginLeft:-t.spacing(1),marginRight:-t.spacing(1)}}}}),tW={boolean:function(e){let{property:t,value:n,target:i,changed:o}=e;return(0,r.jsx)(eQ.A,{control:(0,r.jsx)(eZ.A,{checked:n,onChange:e=>{i[t]=e.target.checked,o()}}),label:t,labelPlacement:"end"})},string:function(e){let{property:t,value:n,target:i,changed:s}=e,[a,l]=(0,o.useState)(n);return(0,r.jsx)(tp.A,{variant:"standard",fullWidth:!0,onChange:e=>{l(e.target.value)},onBlur:()=>{a!==n&&(i[t]=a,s())},label:t,value:a})},object:function(e){let{property:t,value:n,changed:i,app:o}=e;return(0,r.jsxs)(tP,{square:!0,className:t$.root,children:[(0,r.jsx)(tL.A,{expandIcon:(0,r.jsx)(tT.A,{}),className:t$.summary,children:(0,r.jsx)(ei.A,{children:t})}),(0,r.jsx)(tE.A,{className:t$.details,children:tV(n,i,o)})]})},number:function(e){let{property:t,value:n,target:i,changed:s}=e,[a,l]=(0,o.useState)(+n);return(0,r.jsx)(tp.A,{variant:"standard",fullWidth:!0,onChange:e=>{l(e.target.value)},onBlur:()=>{a!==n&&(i[t]=+a,s())},label:t,value:a})},expression:function(e){let{property:t,value:n,target:i,changed:s}=e,a=n.qStringExpression&&n.qStringExpression.qExpr?n.qStringExpression.qExpr:"",[l,d]=(0,o.useState)(a);return(0,r.jsx)(tp.A,{variant:"standard",InputProps:{startAdornment:(0,r.jsx)(tk.A,{position:"start",children:"="})},fullWidth:!0,onChange:e=>{d(e.target.value)},onBlur:()=>{l!==n&&(i[t].qStringExpression={qExpr:`=${l}`},s())},label:t,value:l})},variable:function(e){let{property:t,value:n,target:i,changed:s,app:a}=e,[l,d]=(0,o.useState)(n.name),[c,u]=(0,o.useState)([]);return(0,o.useEffect)(()=>{!async function(){u(await async function(e){return tz||(tz=await e.createSessionObject({qInfo:{qType:"VariableList"},qVariableListDef:{qType:"variable",qShowReserved:!1,qShowConfig:!1}})),(await tz.getLayout()).qVariableList.qItems.map(e=>({value:e.qName,label:e.qName.length>50?`${e.qName.slice(0,50)}...`:e.qName}))}(a))}()},[]),0===c.length?(0,r.jsx)("em",{children:"No variables in app"}):(0,r.jsx)(tN.A,{size:"small",fullWidth:!0,children:(0,r.jsx)(tO.A,{onChange:e=>{d(e.target.value),i[t].name=e.target.value,i[t].value={qStringExpression:{qExpr:`[${e.target.value}]`}},s()},displayEmpty:!0,fullWidth:!0,value:l,renderValue:e=>0===e.length?(0,r.jsx)("em",{children:"Select a variable"}):e,children:c.map(e=>(0,r.jsx)(e$.A,{value:e.value,children:e.label},e.value))})})}},tF=/^q[A-Z]/,tU=!1;function tV(e,t,n,i){i&&i.PP_EXPRESSIONS&&(tU=!0);let o=Object.keys(e).map(t=>{var n;if(-1!==["visualization","version"].indexOf(t)||tF.test(t))return!1;let r=(n=e[t],Array.isArray(n)?"array":tU&&"variable"===t&&"object"==typeof n&&"name"in n&&"value"in n?"variable":tU&&n&&"object"==typeof n&&"qStringExpression"in n?"expression":"boolean"==typeof n?"boolean":"string"==typeof n?"string":"number"==typeof n?"number":n&&"object"==typeof n?"object":"unknown");return!!tW[r]&&{Component:tW[r],property:t,target:e,value:e[t],key:`${t}:${e[t]}`}}).filter(Boolean);return(0,r.jsx)(tB,{container:!0,direction:"column",gap:0,alignItems:"stretch",children:o.map(i=>(0,r.jsx)(er.A,{style:{width:"100%"},children:(0,r.jsx)(i.Component,{app:n,property:i.property,value:i.value,target:e,changed:t},i.key)},i.key))})}function tQ(e){let{viz:t,sn:n,isTemp:i,storage:s,flags:a}=e,[l,d]=e_(t?.model),c=(0,o.useContext)(eY),[u,h]=(0,o.useState)(!1!==s.get("readFromCache")),p=(0,o.useCallback)(()=>{d(l)},[t,n,l]);return n&&t&&l?(0,r.jsxs)("div",{style:{minWidth:"250px",padding:"8px"},children:[i&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(er.A,{item:!0,container:!0,alignItems:"center",children:(0,r.jsx)(eQ.A,{control:(0,r.jsx)(eZ.A,{checked:u,onChange:e=>{s.save("readFromCache",e.target.checked),h(e.target.checked)},value:"isReadFromCacheEnabled"}),label:"Enable property cache",labelPlacement:"end"})}),(0,r.jsx)(eH.A,{})]}),(0,r.jsx)(tI,{properties:l,setProperties:d,sn:n}),tV(l,p,c,a)]}):null}var tZ=n("Qt"),tH=n("kg"),t_=n("Ig"),tY=n("sf"),tJ=n("IL");function tG(e){let{model:t,show:n,close:i}=e,[s,a]=(0,o.useState)(""),[l,d]=(0,o.useState)(null),[c,u]=(0,o.useState)([]),[h,p,g]=function(){let[e,t]=(0,o.useState)(),[n,r]=(0,o.useState)(),i=(0,o.useCallback)(e=>{e&&t(e)},[]),s=()=>{let{left:t,top:n,width:i,height:o}=e.getBoundingClientRect();r({left:t,top:n,width:i,height:o})};return(0,o.useLayoutEffect)(()=>{if(e){if("function"==typeof ResizeObserver){let t=new ResizeObserver(s);return t.observe(e),()=>{t.unobserve(e),t.disconnect(e),t=null}}return s(),window.addEventListener("resize",s),()=>{window.removeEventListener("resize",s)}}},[e]),[i,n,e]}(),x=(0,T.A)(),m=(0,o.useCallback)(()=>{c.length||t.setProperties(JSON.parse(l.getValue())).then(i)});return(0,o.useEffect)(()=>{if(!n)return;let e=()=>{t&&n&&t.getProperties().then(e=>{n&&a(JSON.stringify(e||{},null,2))})};return t.on("changed",e),e(),()=>{t&&t.removeListener("changed",e)}},[t&&t.id,n]),(0,o.useEffect)(()=>{if(!h||!g||!p||!s)return;let{left:e,top:t,width:n,height:r}=p;if(0===e&&0===t&&0===n&&0===r)return;let i=tJ.EN.create(g,{value:s,language:"json",scrollBeyondLastLine:!1,theme:"dark"===x.palette.mode?"vs-dark":"vs-light"});i.layout({width:p.width,height:p.height});let o=i.onDidChangeModelDecorations(()=>{u(tJ.EN.getModelMarkers())});return i.focus(),d(i),()=>{o.dispose();let e=i.getModel();e&&e.dispose(),i.dispose()}},[g,p,s]),(0,r.jsxs)(tZ.A,{disableEscapeKeyDown:!0,open:n,scroll:"paper",maxWidth:"md",onClose:i,PaperProps:{style:{height:"80%",width:"80%"}},children:[(0,r.jsx)(tH.A,{children:"Modify object properties"}),(0,r.jsx)(t_.A,{dividers:!0,children:(0,r.jsx)("div",{ref:h,style:{overflow:"hidden",height:"100%"}})}),(0,r.jsxs)(tY.A,{children:[(0,r.jsx)(ej.A,{variant:"contained",onClick:i,children:"Cancel"}),(0,r.jsx)(ej.A,{variant:"contained",onClick:m,disabled:c.length>0,children:"Confirm"})]})]})}self.MonacoEnvironment={getWorker:(e,t)=>new Worker("json"===t?new URL(n.p+n.u("u"),n.b):new URL(n.p+n.u(7),n.b))};let tK=o.createContext({currentThemeName:null,activeViz:null,setActiveViz:()=>{},expandedObject:null,setExpandedObject:()=>{}}),tX=o.createContext();function t0(e){let{id:t,onLoad:n}=e,i=(0,o.useContext)(tX),s=(0,o.useRef)();return(0,o.useEffect)(()=>{let e=i.render({id:t,element:s.current});return e.then(e=>{n(e,s.current)}),()=>{e.then(e=>{e.destroy()})}},[t]),(0,r.jsx)("div",{ref:s,style:{height:"100%",backgroundColor:"white"}})}let t1="Cell",t2={secondaryIcon:`${t1}-secondaryIcon`,drop:`${t1}-drop`},t4=(0,th.A)(er.A)(e=>{let{theme:t}=e;return{[`& .${t2.secondaryIcon}`]:{color:t.palette.text.secondary},[`& .${t2.drop}`]:{boxShadow:t.shadows[1],borderRadius:`${t.shape.borderRadius}px`}}});function t5(e){let{id:t,expandable:n,minHeight:i}=e,s=(0,o.useContext)(eY),[a]=e3(),[l,d]=(0,o.useState)(null),[c,u]=(0,o.useState)(!1),[h,p]=(0,o.useState)(null),{currentThemeName:g,activeViz:x,setActiveViz:m,setExpandedObject:f,expandedObject:j}=(0,o.useContext)(tK),y=j===t,b=(0,o.useRef)();(0,o.useEffect)(()=>{let e=s.getObject(t).then(e=>(d(e),a.set(`${t}`,e),e));return()=>{e.then(e=>e.emit("close"))}},[t]);let[A,M]=(0,o.useState)(!1),v=(0,o.useCallback)(()=>{M(!1)},[]),w=(0,o.useCallback)((e,t)=>{b.current={viz:e,el:t},p(e)},[t]),C=(0,o.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(b.current)if(e)u(!0),b.current.viz.__DO_NOT_USE__.exportImage().then(e=>{e&&e.url&&window.open(e.url),u(!1)});else{let e=b.current.el.getBoundingClientRect();b.current.viz.__DO_NOT_USE__.takeSnapshot().then(t=>{fetch("/njs/snapshot",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),window.open(`/render?snapshot=${t.key}`,"snapshot",`height=${Math.round(e.height)},width=${Math.round(e.width)}`)})}},[l,g]),D=!y&&b.current&&x&&x===b.current.viz?{boxShadow:"0px 0px 4px 2px rgba(0,100,200,0.85)"}:{};return(0,r.jsxs)(t4,{container:!0,direction:"column",style:{minHeight:i,height:"100%",position:"relative"},children:[(0,r.jsx)(er.A,{item:!0,children:(0,r.jsxs)(eN.A,{variant:"dense",disableGutters:!0,style:{padding:"0 0px",opacity:1},children:[(0,r.jsx)(tG,{model:l,show:A,close:v}),(0,r.jsx)(en.A,{title:"Modify object properties",className:t2.secondaryIcon,disabled:!l,onClick:()=>M(!0),size:"large",children:el({size:"medium",viewBox:"0 0 16 16",shapes:[{type:"path",attrs:{d:"M14,8 C14,8.2 14,8.4 14,8.6 L16,9.6 L15.4,11.4 L13.2,11 C13,11.3 12.8,11.7 12.5,12 L13.6,14 L12,15 L10.4,13.4 C10,13.5 9.7,13.7 9.3,13.8 L9,16 L7,16 L6.7,13.8 C6.3,13.7 5.9,13.6 5.6,13.4 L4,15 L2.4,13.9 L3.5,11.9 C3.2,11.6 3,11.3 2.8,10.9 L0.6,11.3 L0,9.6 L2,8.6 C2,8.4 2,8.2 2,8 C2,7.8 2,7.6 2,7.4 L0,6.4 L0.6,4.6 L2.8,5 C3,4.7 3.2,4.3 3.5,4 L2.4,2 L4,1 L5.6,2.6 C6,2.4 6.3,2.3 6.7,2.2 L7,0 L9,0 L9.3,2.2 C9.7,2.3 10.1,2.4 10.4,2.6 L12,1 L13.6,2.1 L12.5,4.1 C12.8,4.4 13,4.7 13.2,5.1 L15.4,4.7 L16,6.4 L14,7.4 C14,7.6 14,7.8 14,8 Z M8,11 C9.7,11 11,9.7 11,8 C11,6.3 9.7,5 8,5 C6.3,5 5,6.3 5,8 C5,9.7 6.3,11 8,11 Z"}}]})}),(0,r.jsx)(en.A,{title:"Open in single render view",className:t2.secondaryIcon,disabled:!l,href:l?`${document.location.href.replace(/\/dev\//,"/render/")}${window.location.search?"&":"?"}object=${l.id}&theme=${g}&language=en-US`:"",target:"_blank",size:"large",children:el({size:"medium",viewBox:"0 0 24 24",shapes:[{type:"path",attrs:{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"}}]})}),(0,r.jsx)(en.A,{title:"Take and render as snapshot",className:t2.secondaryIcon,disabled:!l,onClick:()=>C(),size:"large",children:el({size:"medium",viewBox:"0 0 24 24",shapes:[{type:"path",attrs:{d:"M9 2L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2H9zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z"}}]})}),c?(0,r.jsx)(ew.A,{size:24}):(0,r.jsx)(en.A,{title:"Export as image",className:t2.secondaryIcon,disabled:!l,onClick:()=>C(!0),size:"large",children:el({size:"medium",viewBox:"0 0 24 24",shapes:[{type:"path",attrs:{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"}}]})}),(0,r.jsx)(er.A,{sx:{flex:1}}),n&&(0,r.jsx)(en.A,{title:"Edit",className:t2.secondaryIcon,disabled:!h||x===h,onClick:()=>m(h),size:"large",children:el({size:"medium",viewBox:"0 0 24 24",shapes:[{type:"path",attrs:{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}}]})}),n&&(0,r.jsx)(en.A,{title:"Expand",disabled:!l||!h,className:t2.secondaryIcon,onClick:()=>void(y?f(null):(f(t),m(h))),size:"large",children:el({size:"medium",viewBox:"0 0 24 24",shapes:[{type:"path",attrs:{d:y?"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z":"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"}}]})})]})}),(0,r.jsx)(er.A,{item:!0,xs:!0,style:{...D,flex:1,minHeight:0},className:t2.drop,children:(0,r.jsx)(t0,{id:t,onLoad:w})})]})}function t3(e){let{info:t,storage:n,uid:i}=e,s=(0,o.useContext)(tX),{activeViz:a,setActiveViz:l}=(0,o.useContext)(tK),[d]=e_(a?.model);return((0,o.useEffect)(()=>{if(!i)return;let e=s.render({type:t.supernova.name,properties:{...!1!==n.get("readFromCache")?n.props(t.supernova.name):{},qInfo:{qId:i,qType:t.supernova.name}}});return e.then(e=>{l(e)}),()=>{e.then(e=>e.destroy())}},[i]),(0,o.useEffect)(()=>{d&&n.props(t.supernova.name,d)},[d]),a&&a.id===i)?(0,r.jsx)(er.A,{item:!0,container:!0,justifyContent:"center",style:{height:"100%"},children:(0,r.jsx)(er.A,{item:!0,xs:!0,style:{flex:1,minWidth:0},children:(0,r.jsx)(t5,{id:i})})}):null}function t6(e){let{types:t,cache:n}=e,i=(0,o.useContext)(eY),[s]=e9(i,"getAppLayout"),[a,l]=(0,o.useState)(null),{expandedObject:d}=(0,o.useContext)(tK);if((0,o.useEffect)(()=>{i.getObjects({qTypes:t,qData:{title:"/qMetaDef/title"}}).then(e=>{l(e.slice(0,20))})},[s,t.join(":")]),!a)return null;let c=d?a.filter(e=>e.qInfo.qId===d):a;return(0,r.jsx)(er.A,{container:!0,justifyContent:"center",gap:2*!d,style:{height:d?"100%":void 0},children:c[0]?c.map(e=>(0,r.jsx)(er.A,{item:!0,xs:12,md:d?12:6,lg:d?12:4,children:(0,r.jsx)(t5,{id:e.qInfo.qId,expandable:!0,minHeight:600})},`${e.qInfo.qId}::${n}`)):(0,r.jsx)(er.A,{item:!0,children:(0,r.jsxs)("div",{children:[(0,r.jsx)(ei.A,{display:"inline",children:"Could not find any components with "}),(0,r.jsx)(ei.A,{display:"inline",children:(0,r.jsx)("code",{children:`qType: "${t[0]}"`})}),(0,r.jsx)(ei.A,{display:"inline",children:" in the current app"})]})})})}let t8=["en-US","it-IT","zh-CN","zh-TW","ko-KR","de-DE","sv-SE","es-ES","pt-BR","ja-JP","fr-FR","nl-NL","tr-TR","pl-PL","ru-RU"],t9=["select","active","passive"];function t7(e){return{select:-1!==e.indexOf("select"),active:-1!==e.indexOf("active"),passive:-1!==e.indexOf("passive"),edit:-1!==e.indexOf("edit")}}function ne(){let e=(0,o.useRef)(),t=(0,u.Zp)(),{info:n}=C(),{waiting:i,app:s}=(e=>{let{info:t}=e,[n,r]=(0,o.useState)(null),[i,s]=(0,o.useState)(!0);(0,o.useEffect)(()=>{s(!0),t&&a().then(e=>r(e)).catch(e=>console.log(e)).finally(()=>s(!1))},[t]);let a=async()=>{try{let{clientId:e,webIntegrationId:n,engine:r=null,engine:{host:i}={}}=t,o=t?.engine?.appId;if(!o)throw Error("Missing appId in connection info");if(n)return(0,f.qs)({appId:o,hostConfig:{authType:"cookie",webIntegrationId:n,host:i}}).getDoc();if(e)return(0,f.qs)({appId:o,hostConfig:{authType:"oauth2",clientId:e,host:i,redirectUri:`${window.location.origin}/auth/login/callback`,accessTokenStorage:"session"}}).getDoc();let s=!1!==r.secure?"https":"http",a=`${s}://${r.host}${r.port?`:${r.port}`:""}`;return(0,f.qs)({appId:o,hostConfig:{authType:"noauth",host:a}}).getDoc()}catch(e){throw Error("Failed to open app!",{cause:e})}};return{waiting:i,app:n,setApp:r}})({info:n}),a=(0,o.useMemo)(()=>q(s),[s]),[l,d]=(0,o.useState)(null),[c,h]=(0,o.useState)(null),[p,g]=(0,o.useState)(null),[x,m]=(0,o.useState)(a.get("themeName")),[j,y]=(0,o.useState)(a.get("language")||"en-US"),[b,A]=(0,o.useState)("light"),[M,v]=(0,o.useState)(t9),[w,D]=(0,o.useState)(!0===a.get("objectListMode")),I=(0,o.useRef)(null),[S,k]=(0,o.useState)(),[L,E]=o.useState(null),[T,z]=o.useState(null),[R,$]=(0,o.useState)(!1),[B,P]=(0,o.useState)(null),W=Array.isArray(n?.themes)&&n.themes.length?["light","dark",...n.themes]:[],[F,V]=(0,o.useState)(),Q=(0,o.useMemo)(()=>U(b),[b]),Z=(0,o.useMemo)(()=>({currentThemeName:x,activeViz:l,setActiveViz:d,expandedObject:c,setExpandedObject:h}),[l,c,x]);(0,o.useEffect)(()=>{(async()=>{if(n){let e;await (e=()=>{eU(n.supernova.name,n.supernova.url).then(e=>{var t;window[n.supernova.name]=e,eV[t=n.supernova.name]&&eV[t].forEach(e=>e())})},(n.sock.port&&(new WebSocket(`ws://localhost:${n.sock.port}`).onmessage=()=>{e()}),e(),n.types)?Promise.all(n.types.map(e=>eU(e.name,e.url).then(t=>{window[e.name]=t}))):Promise.resolve()),$(!0)}})()},[n]),(0,o.useEffect)(()=>{if(i||!R)return;let e=(0,eD.embed)(s,{hostConfig:n?.engine?(e=>{let{clientId:t,webIntegrationId:n,engine:{host:r,port:i,secure:o}}=e;return n?{authType:"cookie",webIntegrationId:n,host:r}:t?{authType:"oauth2",clientId:t,host:r,redirectUri:`${window.location.origin}/auth/login/callback`,accessTokenStorage:"session"}:{authType:"noauth",host:`${!1!==o?"https":"http"}://${r}${i?`:${i}`:""}`}})(n):void 0,context:{theme:x,language:j,interactions:t7(M),keyboardNavigation:n?.keyboardNavigation},load:e=>Promise.resolve(window[e.name]),flags:n?.flags,themes:n?.themes?n?.themes.map(e=>({id:e,load:()=>fetch(`/theme/${e}`).then(e=>e.json()).then(e=>(A("dark"===e.type?"dark":"light"),e))})):null});e.__DO_NOT_USE__.types.register(n?.supernova),n?.types&&n?.types.forEach(t=>{e.__DO_NOT_USE__.types.register(t)}),P(e)},[s,n,i,R]),(0,o.useLayoutEffect)(()=>{B&&(B.context({theme:x}),("light"===x||"dark"===x)&&A(x))},[B,x]);let H=()=>{window[n?.supernova.name]&&(e.current=String(Date.now()),k(e.current))};return(0,o.useEffect)(()=>{B&&(B.selections().then(e=>e.mount(I.current)),window.onHotChange(n?.supernova.name,()=>{B.__DO_NOT_USE__.types.clearFromCache(n?.supernova.name),B.__DO_NOT_USE__.types.register(n?.supernova),H(),B.__DO_NOT_USE__.types.get({name:n?.supernova.name}).supernova().then(g)}),H())},[B,n]),(0,o.useEffect)(()=>{let t=()=>{s&&s.destroySessionObject(e.current)};return window.addEventListener("beforeunload",t),s&&V({modelStore:function(e){let[t,n]=eT({}),[r,i]=eT({}),[o,s]=eT({}),[a,l]=eT({}),[d,c]=eT({}),[,u]=eT({}),h=e=>{let{type:t,value:r}=e,o=u.get(r.id);u.set(r.id,{});let a=()=>{i.clear(r.id),c.set(r.id,{}),c.dispatch(!0)},d=()=>{r.removeListener("closed",d),r.removeListener("changed",a),n.clear(r.id),i.clear(r.id),s.clear(r.id),l.clear(r.id),c.clear(r.id),u.clear(r.id)};return"SET"===t&&(o||(r.on("changed",a),r.once("closed",d))),d},[p,g]=eT({},h);return{subscribe:e=>{let t=h({type:"SET",value:e});return()=>{t(),g.clear(e.id)}},destroy:()=>{g.destroy()},useModelStore:p,modelStore:g,useModelChangedStore:d,useRpcResultStore:t,rpcResultStore:n,useRpcRequestStore:r,rpcRequestStore:i,useRpcRequestModelStore:a,rpcRequestModelStore:l,useRpcRequestSessionModelStore:o,rpcRequestSessionModelStore:s,modelChangedStore:c,appId:e}}(s.id),selectionStore:function(e){let[t,n]=eT({}),[r,i]=eT({}),[o,s]=eT({});return{useAppSelectionsStore:t,useAppModalStore:r,appSelectionsStore:n,appModalStore:i,useModalObjectStore:o,modalObjectStore:s,appId:e}}(s.id),myKey:"this is the key here"}),()=>{window.removeEventListener("beforeunload",t)}},[s]),(0,r.jsx)(eE.Provider,{value:F,children:(0,r.jsx)(eY.Provider,{value:s,children:(0,r.jsx)(O.A,{injectFirst:!0,children:(0,r.jsx)(N.A,{theme:Q,children:(0,r.jsx)(tX.Provider,{value:B,children:(0,r.jsxs)(er.A,{container:!0,wrap:"nowrap",direction:"column",style:{background:Q.palette.background.darkest,height:"100%"},gap:0,children:[(0,r.jsx)(er.A,{item:!0,children:(0,r.jsx)(eN.A,{variant:"dense",style:{background:Q.palette.background.paper,boxShadow:Q.shadows[1],width:"calc(100% - 48px)"},children:(0,r.jsxs)(er.A,{container:!0,gap:1,style:{width:"100%"},children:[(0,r.jsx)(er.A,{item:!0,container:!0,alignItems:"center",children:(0,r.jsx)(er.A,{item:!0,children:(0,r.jsx)("a",{href:"https://github.com/qlik-oss/nebula.js",target:"_blank",rel:"noopener noreferrer",children:(0,r.jsx)("img",{src:"/assets/logo.svg",alt:"nebula.js logo",href:"https://github.com/qlik-oss/nebula.js",style:{height:"24px",position:"relative",top:"2px"}})})})}),(0,r.jsx)(er.A,{item:!0,container:!0,alignItems:"center",children:(0,r.jsx)(en.A,{title:"Home",onClick:()=>t("/"),size:"large",children:(0,r.jsx)(eq.A,{style:{verticalAlign:"middle"}})})}),(0,r.jsx)(er.A,{children:(0,r.jsxs)(ex.A,{value:+!!w,onChange:(e,t)=>{let n=1===t;a.save("objectListMode",n),n&&(d(null),h(null)),D(n)},"aria-label":"Navigation",children:[(0,r.jsx)(em.A,{label:(0,r.jsx)(ei.A,{children:"Create"}),value:0}),(0,r.jsx)(em.A,{label:(0,r.jsx)(ei.A,{children:"Edit"}),value:1})]})}),(0,r.jsxs)(er.A,{item:!0,container:!0,alignItems:"center",offset:{md:"auto"},children:[(0,r.jsx)(er.A,{item:!0,gap:1,children:(0,r.jsx)(ei.A,{children:"State:"})}),(0,r.jsx)(er.A,{item:!0,gap:2,children:(0,r.jsxs)(eO.A,{size:"small",value:M,onChange:(e,t)=>{v(t),B&&B.context({interactions:t7(t)})},color:"primary",children:[(0,r.jsx)(ez.A,{value:"select",children:"Select"}),(0,r.jsx)(ez.A,{value:"active",children:"Active"}),(0,r.jsx)(ez.A,{value:"passive",children:"Passive"}),(0,r.jsx)(ez.A,{value:"edit",children:"Edit"})]})}),(0,r.jsx)(er.A,{item:!0,children:W.length?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(en.A,{title:"Select theme",onClick:e=>E(e.currentTarget),size:"large",children:(0,r.jsx)(eI.A,{fontSize:"small"})}),(0,r.jsx)(eR.A,{anchorEl:L,open:!!L,keepMounted:!0,onClose:()=>E(null),children:W.map(e=>(0,r.jsx)(e$.A,{selected:e===x,onClick:()=>{E(null),a.save("themeName",e),m(e)},children:e},e))})]}):(0,r.jsx)(en.A,{title:"Toggle light/dark mode",onClick:()=>{let e="dark"===x?"light":"dark";a.save("themeName",e),m(e),A(e)},size:"large",children:"dark"===x?(0,r.jsx)(eS.A,{fontSize:"small"}):(0,r.jsx)(ek.A,{fontSize:"small"})})}),(0,r.jsxs)(er.A,{item:!0,children:[(0,r.jsx)(ej.A,{startIcon:(0,r.jsx)(eL.A,{}),title:"Select language",onClick:e=>z(e.currentTarget),children:j}),(0,r.jsx)(eR.A,{anchorEl:T,open:!!T,keepMounted:!0,onClose:()=>z(null),children:t8.map(e=>(0,r.jsx)(e$.A,{selected:e===j,onClick:()=>{z(null),a.save("language",e),y(e),B&&B.context({language:e})},children:e},e))})]})]})]})})}),(0,r.jsx)(er.A,{item:!0,style:{padding:Q.spacing(1,1,0,1)},children:(0,r.jsx)("div",{ref:I,style:{flex:"0 0 auto",boxShadow:Q.shadows[1]}})}),(0,r.jsx)(er.A,{item:!0,xs:!0,style:{flex:1,minHeight:0,overflowX:"hidden",overflowY:"auto",padding:Q.spacing(0,1,1,1)},children:(0,r.jsx)(tK.Provider,{value:Z,children:p?(0,r.jsxs)(er.A,{container:!0,wrap:"nowrap",style:{height:"100%"},gap:1,children:[(0,r.jsx)(er.A,{item:!0,xs:!0,style:{flex:1,minWidth:0},children:w?(0,r.jsx)(t6,{cache:S,types:[n?.supernova.name]}):(0,r.jsx)(t3,{info:n,storage:a,uid:S})}),l&&(0,r.jsx)(er.A,{item:!0,style:{background:Q.palette.background.paper,overflow:"hidden auto",marginTop:48,boxShadow:Q.shadows[1],padding:0},children:(0,r.jsx)(tQ,{sn:p,viz:l,isTemp:!w,storage:a,flags:n?.flags})})]}):(0,r.jsx)(er.A,{container:!0,wrap:"nowrap",style:{paddingTop:"48px"},justifyContent:"center",children:(0,r.jsx)(er.A,{item:!0,children:(0,r.jsx)(ew.A,{})})})})})]})})})})})})}var nt=()=>(0,r.jsx)(V,{children:(0,r.jsxs)(Y,{marginTop:5,children:[(0,r.jsx)(ei.A,{variant:"h4",gutterBottom:!0,children:"Error!"}),(0,r.jsx)(ei.A,{variant:"subtitle1",gutterBottom:!0,children:"OAUTH REDIRECT LINK ERROR!"}),(0,r.jsxs)(ei.A,{variant:"body2",paragraph:!0,children:["We updated our route which was previously had the responsibility to handle the redirected link including the correct credentials to have"," ",(0,r.jsx)("code",{children:(0,r.jsx)("b",{children:"/auth/"})})," ","part within it. This change is now impacting your redirect links if you already using your old client-id."]}),(0,r.jsx)(ei.A,{variant:"h6",gutterBottom:!0,children:"Here is what you need to do:"}),(0,r.jsxs)(ei.A,{variant:"body2",paragraph:!0,children:[(0,r.jsx)("b",{children:"1."})," Go to your tenant that you created your client id",(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),(0,r.jsx)("b",{children:"2."})," Open Managment console",(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),(0,r.jsx)("b",{children:"3."})," Click on OAuth menu in left panel (if you dont see that menu it means you dont have access to it and you need to ask a person who has the proper access)",(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),(0,r.jsx)("b",{children:"4."})," Find your Client id and from ... menu, click on edit",(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),(0,r.jsx)("b",{children:"5."}),' There is a section called "Add redirect URLs", find it and add your new link. The only difference is that your new link will include `/auth/` part in it, for example, if you had this redirect link previously:',(0,r.jsx)("code",{children:"http://localhost:8000/login/callback"}),(0,r.jsx)("br",{}),"now it will be like:",(0,r.jsxs)("code",{children:["http://localhost:8000/",(0,r.jsx)("b",{children:"auth/"}),"login/callback"]}),(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),(0,r.jsx)("b",{children:"6."})," Click on save and you are set!",(0,r.jsx)("br",{})]})]})});a.createRoot(document.querySelector("#app")).render((0,r.jsx)(()=>(0,r.jsx)(d.Kd,{children:(0,r.jsx)(k,{children:(0,r.jsxs)(c.BV,{children:[(0,r.jsxs)(c.qh,{element:(0,r.jsx)(ee,{}),children:[(0,r.jsx)(c.qh,{path:"/",element:(0,r.jsx)(ev,{})}),(0,r.jsx)(c.qh,{path:"/app-list",element:(0,r.jsx)(eC,{})})]}),(0,r.jsx)(c.qh,{path:"/dev",element:(0,r.jsx)(ne,{})}),(0,r.jsx)(c.qh,{path:"/login/callback",element:(0,r.jsx)(nt,{})})]})})}),{}))}},l={};function d(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={id:e,exports:{}};return a[e].call(n.exports,n,n.exports,d),n.exports}d.m=a,d.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return d.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,d.t=function(n,r){if(1&r&&(n=this(n)),8&r||"object"==typeof n&&n&&(4&r&&n.__esModule||16&r&&"function"==typeof n.then))return n;var i=Object.create(null);d.r(i);var o={};e=e||[null,t({}),t([]),t(t)];for(var s=2&r&&n;("object"==typeof s||"function"==typeof s)&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach(e=>{o[e]=()=>n[e]});return o.default=()=>n,d.d(i,o),i},d.d=(e,t,n)=>{var r=(t,n)=>{for(var r in t)d.o(t,r)&&!d.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,[n]:t[r]})};r(t,"get"),r(n,"value")},d.f={},d.e=e=>Promise.all(Object.keys(d.f).reduce((t,n)=>(d.f[n](e,t),t),[])),d.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),d.u=e=>"async/"+e+".js",d.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})(),d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},d.l=function(e,t,r,i){if(n[e])return void n[e].push(t);if(void 0!==r)for(var o,s,a=document.getElementsByTagName("script"),l=0;l<a.length;l++){var c=a[l];if(c.getAttribute("src")==e){o=c;break}}o||(s=!0,(o=document.createElement("script")).timeout=120,d.nc&&o.setAttribute("nonce",d.nc),o.src=e),n[e]=[t];var u=function(t,r){o.onerror=o.onload=null,clearTimeout(h);var i=n[e];if(delete n[e],o.parentNode&&o.parentNode.removeChild(o),i&&i.forEach(function(e){return e(r)}),t)return t(r)},h=setTimeout(u.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=u.bind(null,o.onerror),o.onload=u.bind(null,o.onload),s&&document.head.appendChild(o)},d.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),d.nc=void 0,r=[],d.O=(e,t,n,i)=>{if(t){i=i||0;for(var o=r.length;o>0&&r[o-1][2]>i;o--)r[o]=r[o-1];r[o]=[t,n,i];return}for(var s=1/0,o=0;o<r.length;o++){for(var[t,n,i]=r[o],a=!0,l=0;l<t.length;l++)(!1&i||s>=i)&&Object.keys(d.O).every(e=>d.O[e](t[l]))?t.splice(l--,1):(a=!1,i<s&&(s=i));if(a){r.splice(o--,1);var c=n();void 0!==c&&(e=c)}}return e},d.p="/",d.b=document.baseURI||self.location.href,i={qz:0},d.f.j=function(e,t){var n=d.o(i,e)?i[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise((t,r)=>n=i[e]=[t,r]);t.push(n[2]=r);var o=d.p+d.u(e),s=Error();d.l(o,function(t){if(d.o(i,e)&&(0!==(n=i[e])&&(i[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;s.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",s.name="ChunkLoadError",s.type=r,s.request=o,n[1](s)}},"chunk-"+e,e)}},d.O.j=e=>0===i[e],o=(e,t)=>{var n,r,[o,s,a]=t,l=0;if(o.some(e=>0!==i[e])){for(n in s)d.o(s,n)&&(d.m[n]=s[n]);if(a)var c=a(d)}for(e&&e(t);l<o.length;l++)r=o[l],d.o(i,r)&&i[r]&&i[r][0](),i[r]=0;return d.O(c)},(s=self.rspackChunk=self.rspackChunk||[]).forEach(o.bind(null,0)),s.push=o.bind(null,s.push.bind(s));var c=d.O(void 0,["5","g","zt","q"],()=>d("Q"));c=d.O(c)})();
|
|
1
|
+
(()=>{"use strict";var e,t,n,r,i,o,s,a={pxi(e){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAAAHUlEQVQYV2PYvXu3JAi7uLiAMaYAjAGTQBPYLQkAa/0Zef3qRswAAAAASUVORK5CYII="},LYh(e){e.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCA1MyAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwKSI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDguMDM2NCA0LjAxMDQySDQuMDA3NzlMNC4wMDc3OSAzMi4wMjg2SDQ4LjAzNjRWNC4wMTA0MlpNNC4wMDc3OSAwLjAwNzgxMjVDMS43OTcyMSAwLjAwNzgxMjUgMC4wMDUxODc5OSAxLjc5OTg0IDAuMDA1MTg3OTkgNC4wMTA0MlYzMi4wMjg2QzAuMDA1MTg3OTkgMzQuMjM5MiAxLjc5NzIxIDM2LjAzMTIgNC4wMDc3OSAzNi4wMzEySDQ4LjAzNjRDNTAuMjQ3IDM2LjAzMTIgNTIuMDM5IDM0LjIzOTIgNTIuMDM5IDMyLjAyODZWNC4wMTA0MkM1Mi4wMzkgMS43OTk4NCA1MC4yNDcgMC4wMDc4MTI1IDQ4LjAzNjQgMC4wMDc4MTI1SDQuMDA3NzlaTTguMDEwNDIgOC4wMTMwMkgxMi4wMTNWMTIuMDE1Nkg4LjAxMDQyVjguMDEzMDJaTTIwLjAxODIgOC4wMTMwMkgxNi4wMTU2VjEyLjAxNTZIMjAuMDE4MlY4LjAxMzAyWk0yNC4wMjA4IDguMDEzMDJIMjguMDIzNFYxMi4wMTU2SDI0LjAyMDhWOC4wMTMwMlpNMzYuMDI4NiA4LjAxMzAySDMyLjAyNlYxMi4wMTU2SDM2LjAyODZWOC4wMTMwMlpNNDAuMDMxMiA4LjAxMzAySDQ0LjAzMzlWMTIuMDE1Nkg0MC4wMzEyVjguMDEzMDJaTTE2LjAxNTYgMTYuMDE4Mkg4LjAxMDQyVjIwLjAyMDhIMTYuMDE1NlYxNi4wMTgyWk0yMC4wMTgyIDE2LjAxODJIMjQuMDIwOFYyMC4wMjA4SDIwLjAxODJWMTYuMDE4MlpNMzIuMDI2IDE2LjAxODJIMjguMDIzNFYyMC4wMjA4SDMyLjAyNlYxNi4wMTgyWk00NC4wMzM5IDE2LjAxODJWMjAuMDIwOEgzNi4wMjg2VjE2LjAxODJINDQuMDMzOVpNMTIuMDEzIDI0LjAyMzRIOC4wMTA0MlYyOC4wMjZIMTIuMDEzVjI0LjAyMzRaTTE2LjAxNTYgMjQuMDIzNEgzNi4wMjg2VjI4LjAyNkgxNi4wMTU2VjI0LjAyMzRaTTQ0LjAzMzkgMjQuMDIzNEg0MC4wMzEyVjI4LjAyNkg0NC4wMzM5VjI0LjAyMzRaIiBmaWxsPSIjNDI0MjQyIi8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iY2xpcDAiPgo8cmVjdCB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg=="},oDx(e){e.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCA1MyAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwKSI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDguMDM2NCA0LjAxMDQySDQuMDA3NzlMNC4wMDc3OSAzMi4wMjg2SDQ4LjAzNjRWNC4wMTA0MlpNNC4wMDc3OSAwLjAwNzgxMjVDMS43OTcyMSAwLjAwNzgxMjUgMC4wMDUxODc5OSAxLjc5OTg0IDAuMDA1MTg3OTkgNC4wMTA0MlYzMi4wMjg2QzAuMDA1MTg3OTkgMzQuMjM5MiAxLjc5NzIxIDM2LjAzMTIgNC4wMDc3OSAzNi4wMzEySDQ4LjAzNjRDNTAuMjQ3IDM2LjAzMTIgNTIuMDM5IDM0LjIzOTIgNTIuMDM5IDMyLjAyODZWNC4wMTA0MkM1Mi4wMzkgMS43OTk4NCA1MC4yNDcgMC4wMDc4MTI1IDQ4LjAzNjQgMC4wMDc4MTI1SDQuMDA3NzlaTTguMDEwNDIgOC4wMTMwMkgxMi4wMTNWMTIuMDE1Nkg4LjAxMDQyVjguMDEzMDJaTTIwLjAxODIgOC4wMTMwMkgxNi4wMTU2VjEyLjAxNTZIMjAuMDE4MlY4LjAxMzAyWk0yNC4wMjA4IDguMDEzMDJIMjguMDIzNFYxMi4wMTU2SDI0LjAyMDhWOC4wMTMwMlpNMzYuMDI4NiA4LjAxMzAySDMyLjAyNlYxMi4wMTU2SDM2LjAyODZWOC4wMTMwMlpNNDAuMDMxMiA4LjAxMzAySDQ0LjAzMzlWMTIuMDE1Nkg0MC4wMzEyVjguMDEzMDJaTTE2LjAxNTYgMTYuMDE4Mkg4LjAxMDQyVjIwLjAyMDhIMTYuMDE1NlYxNi4wMTgyWk0yMC4wMTgyIDE2LjAxODJIMjQuMDIwOFYyMC4wMjA4SDIwLjAxODJWMTYuMDE4MlpNMzIuMDI2IDE2LjAxODJIMjguMDIzNFYyMC4wMjA4SDMyLjAyNlYxNi4wMTgyWk00NC4wMzM5IDE2LjAxODJWMjAuMDIwOEgzNi4wMjg2VjE2LjAxODJINDQuMDMzOVpNMTIuMDEzIDI0LjAyMzRIOC4wMTA0MlYyOC4wMjZIMTIuMDEzVjI0LjAyMzRaTTE2LjAxNTYgMjQuMDIzNEgzNi4wMjg2VjI4LjAyNkgxNi4wMTU2VjI0LjAyMzRaTTQ0LjAzMzkgMjQuMDIzNEg0MC4wMzEyVjI4LjAyNkg0NC4wMzM5VjI0LjAyMzRaIiBmaWxsPSIjQzVDNUM1Ii8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iY2xpcDAiPgo8cmVjdCB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg=="},Q(e,t,n){var r=n("K"),i=n.t(r,2),o=n("g"),s=n.t(o,2),a=n("X"),l=n.t(a,2),d=n("V"),c=n("G"),u=n("Nb"),h=n("D"),p=n.n(h),g=n("H"),x=n("h"),m=n("HA"),f=n("Hg");async function j(e){try{let t=(await fetch(`${e}/qps/csrftoken`,{credentials:"include"})).headers.get("QLIK-CSRF-TOKEN");if(t)return t}catch(e){console.log("Failed to fetch csrf-token",e)}return""}let y=/(wss?):\/\/([^/:?&]+)(?::(\d+))?/,b=/\/app\/([^?&#:]+)/,A=/(wss?):\/\/([^/:?&]+)(?::(\d+))?\/?([a-z0-9-._~]+)?/,M=()=>fetch("/info").then(e=>e.json()).then(async e=>{let t,n=e,r=(t={},window.location.search.substring(1).split("&").forEach(e=>{let n=e.indexOf("="),r=e.substr(0,n),i=decodeURIComponent(e.substring(n+1));"cols"===r&&(i=i.split(",")),t[r]=i}),t);if(r.engine_url?n={...n,...(e=>{let t,n,r=y.exec(e);if(!r)return{engineUrl:e,invalid:!0};let i=e.trim(),o=i,s=b.exec(i);s&&([,t]=s,o=i.substring(0,s.index),n=i);let a=A.exec(o);return a?{engine:{secure:"wss"===r[1],host:r[2],port:r[3]||void 0,prefix:a[4]||void 0,appId:t},engineUrl:o,appUrl:n}:{engineUrl:e,invalid:!0}})(r.engine_url)}:r.app&&(n={...n,engine:{...n.engine,appId:r.app}}),r["qlik-web-integration-id"]&&(n.webIntegrationId=r["qlik-web-integration-id"]),r["qlik-client-id"]&&(n.clientId=r["qlik-client-id"]),n.invalid)return n;let i=`${n.engine.secure?"https":"http"}://${n.engine.host}`;return{...n,rootPath:i}}),v=e=>{let{webIntegrationId:t,clientId:n,host:r}=e;t?x.Ay.setDefaultHostConfig({authType:"cookie",webIntegrationId:t,host:r}):n&&x.Ay.setDefaultHostConfig({authType:"oauth2",clientId:n,host:r,redirectUri:`${window.location.origin}/auth/login/callback`,accessTokenStorage:"session"})},w=async()=>{try{let{data:e=[]}=(await (0,m.JS)({resourceType:"app",limit:30,sort:"-updatedAt"})).data;return e.map(e=>({qDocId:e.resourceId,qTitle:e.name}))}catch(e){throw Error("Failed to fetch app list",{cause:e})}},C=()=>{let[e,t]=(0,o.useState)();return(0,o.useEffect)(()=>{M().then(e=>{t(e)})},[]),{info:e,setInfo:t}},D=e=>{let{result:t,setError:n,setGlobal:r}=e;t.session&&t.session.on("notification:OnAuthenticationInformation",e=>{e.mustAuthenticate&&(n({message:"Could not authenticate.",hints:[`In your virtual proxy advanced settings in the QMC, make sure to whitelist ${window.location.host}, ensure "Has secure attribute" is enabled and that "SameSite attribute" is set to "None".`]}),r(null))})};var q=e=>{let t=window.localStorage.getItem("nebula-dev"),n=t?JSON.parse(t):{},r=e?.id,i={save(e,t){n[e]=t,window.localStorage.setItem("nebula-dev",JSON.stringify(n))},get:e=>n[e],props(e,t){if(t)return void i.save(`props:${r}:${e}`,JSON.stringify(t));let n=i.get(`props:${r}:${e}`);return n?JSON.parse(n):{}}};return i};let I=(0,o.createContext)({info:{}}),S=()=>{let e=(0,o.useContext)(I);if(!e)throw Error("RootContext not defined!");return e},k=e=>{let{children:t}=e,n=(0,u.zy)(),i=(0,u.Zp)(),s=(0,o.useMemo)(()=>q({}),[]),{info:a,setInfo:l}=C(),d=(e=>{let{storage:t}=e,[n,r]=(0,o.useState)(t.get("connections")||[]);return{cachedConnections:n,removeCachedConnection:e=>{let i=n.indexOf(e);if(-1!==e){let e=n.slice();e.splice(i,1),t.save("connections",e),r(e)}},addCachedConnections:e=>{let{info:i}=e,o="",s=i.engine.secure?"wss":"ws",a="localhost"===i.engine.host?`${i.engine.host}:${i.engine.port}`:i.engine.host,l=i.engine.prefix?`/${i.engine.prefix}`:"",d=`${s}://${a}${l}`;if(o=i.clientId?`${d}/?qlik-client-id=${i.clientId}`:i.webIntegrationId?`${d}/?qlik-web-integration-id=${i.webIntegrationId}`:d,-1===n.indexOf(o)&&0!==o.length){let e=[...n,o];t.save("connections",e),r(e)}}}})({storage:s}),c=(e=>{let{info:t,cachedConnectionsData:n}=e,r=(0,u.zy)(),[i,s]=(0,o.useState)(),[a,l]=(0,o.useState)(!1),[d,c]=(0,o.useState)(),[h,x]=(0,o.useState)(0);return(0,o.useEffect)(()=>{if("/"!==r.pathname&&t&&t.engineUrl){if(t.invalid)return void c({message:"Connection failed",hints:["The WebSocket URL is not valid."]});(async()=>{try{let{clientId:e,webIntegrationId:t,engine:n,engine:{host:r}}=await M();if(t)return v({webIntegrationId:t,host:r}),{getDocList:w,getConfiguration:async()=>({})};if(e)return v({clientId:e,host:r}),{getDocList:w,getConfiguration:async()=>({})};let i=await j(`https://${n.host}${n.prefix?`/${n.prefix}`:""}`),o=!1!==n.secure?"wss":"ws",s=n.port?`:${n.port}`:"",a=n.prefix?`/${n.prefix}`:"",l=`${o}://${n.host}${s}${a}?qlik-csrf-token=${i}`;return p().create({schema:g,url:l}).open()}catch(e){throw Error("Failed to return enigma instance",{cause:e})}})().then(e=>(async e=>{let{result:t,setGlobal:n,setTreatAsDesktop:r,setError:i}=e;if(D({result:t,setError:i,setGlobal:n}),n(t),t.getDocList)try{let e=await t.getConfiguration();e&&e.qFeatures&&e.qFeatures.qIsDesktop&&r(!0)}catch(e){throw Error("Failed to get configuration")}})({result:e,setGlobal:s,setError:c,setTreatAsDesktop:l})).then(()=>n.addCachedConnections({info:t})).catch(e=>(e=>{let{error:t,info:n,setError:r}=e,i={message:"Something went wrong, check the devtools console",hints:[]};if(t.target instanceof WebSocket){i.message=`Connection failed to ${n.engineUrl}`,/\.qlik[A-Za-z0-9-]+\.com/.test(n.engineUrl)&&!n.webIntegrationId&&(i.hints.push("- If you are connecting to Qlik Cloud, make sure to provide a web integration id or client id."),i.hints.push("- For Qlik Sense on Windows, make sure the proxy setup is correct and that you are authenticated."),i.hints.push("- Press the ? in the top right for more information on how to set up the connection correctly.")),r(i);return}r(i),console.error(t)})({error:e,info:t,setError:c}))}},[t,r.pathname]),{glob:i,setGlobal:s,treatAsDesktop:a,setTreatAsDesktop:l,error:d,setError:c,activeStep:h,setActiveStep:x}})({info:a,cachedConnectionsData:d});(0,o.useEffect)(()=>{c.error&&i("/"),"/"===n.pathname&&(c.setActiveStep(0),c.setGlobal(),c.setTreatAsDesktop(!1))},[n.pathname,c.error]);let h=(0,o.useMemo)(()=>({info:a,setInfo:l,...c,storage:s,cachedConnectionsData:d}),[a,l,c,s,d]);return(0,r.jsx)(I.Provider,{value:h,children:t})};var L=n("Z"),E=n("wA"),T=n("aw"),N=n("c7"),O=n("eL"),z=n("A"),R=n("Cp"),$={typography:{fontSize:14,htmlFontSize:16,fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:600,fontFamily:'"Source Sans Pro","Segoe UI","Helvetica Neue",-apple-system,Arial,sans-serif',button:{textTransform:"initial",fontWeight:400}},shape:{borderRadius:2},shadows:["none","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)"]},B={green:"#00873D",greenPale:"#0AAF54",red:"#DC423F",redPale:"#F05551",blue:"#3F8AB3",bluePale:"#469DCD",blueDark:"#005DB9",grey100:"#ffffff",grey98:"#FBFBFB",grey95:"#F2F2F2",grey90:"#E6E6E6",grey85:"#D9D9D9",grey55:"#8C8C8C",grey45:"#737373",grey30:"#4D4D4D",grey25:"#404040",grey20:"#333333",grey15:"#262626",grey10:"#1A1A1A",grey5:"#0E0E0E",grey0:"#000000"};let P={mode:"light",palette:{primary:{main:B.grey25,contrastText:B.grey100},secondary:{light:"#0AAF54",main:"#009845",dark:"#006937"},text:{primary:B.grey25,secondary:"rgba(0, 0, 0, 0.55)",disabled:"rgba(0, 0, 0, 0.3)",light:B.grey100,dark:B.grey0},action:{active:"#545454",hover:"rgba(0, 0, 0, 0.03)",hoverOpacity:.08,selected:"rgba(0, 0, 0, 0.05)",disabled:"rgba(0, 0, 0, 0.3)",disabledBackground:"rgba(0, 0, 0, 0.12)"},background:{paper:B.grey100,default:B.grey100,lightest:B.grey100,lighter:B.grey98,darker:B.grey95,darkest:B.grey90},custom:{whiteBorder:"rgb(255, 255, 255)",newFocusBorder:B.blueDark,focusBorder:B.blue,focusOutline:"rgba(70, 157, 205, 0.3)",inputBackground:"rgba(255, 255, 255, 1)",disabledBackground:B.grey45,disabledContrastText:B.grey100},selected:{main:B.green,alternative:"#E4E4E4",excluded:"#BEBEBE",selectedExcluded:"#BEBEBE",possible:B.grey100,selectedContrastText:B.grey100,mainContrastText:B.grey100,alternativeContrastText:B.grey25,excludedContrastText:B.grey25,selectedExcludedContrastText:B.grey100,possibleContrastText:B.grey0},btn:{normal:"rgba(255, 255, 255, 0.6)",hover:"rgba(0, 0, 0, 0.03)",active:"rgba(0, 0, 0, 0.1)",disabled:"rgba(255, 255, 255, 0.6)",border:"rgba(0, 0, 0, 0.15)",borderHover:"rgba(0, 0, 0, 0.15)"}}},W={mode:"dark",palette:{primary:{main:B.grey20,contrastText:B.grey100},secondary:{light:"#0AAF54",main:"#009845",dark:"#006937"},text:{primary:B.grey100,secondary:"rgba(255, 255, 255, 0.6)",disabled:"rgba(255, 255, 255, 0.3)",light:B.grey100,dark:B.grey0},action:{active:B.grey100,hover:"rgba(255, 255, 255, 0.05)",hoverOpacity:.08,selected:"rgba(0, 0, 0, 0.03)",disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(0, 0, 0, 0.12)"},divider:"rgba(0,0,0,0.3)",background:{default:"#323232",paper:"#323232",lightest:B.grey25,lighter:B.grey20,darker:B.grey15,darkest:B.grey10},custom:{whiteBorder:"rgb(255, 255, 255)",newFocusBorder:B.blueDark,focusBorder:B.blue,focusOutline:"rgba(70, 157, 205, 0.3)",inputBackground:"rgba(0, 0, 0, 0.2)",disabledBackground:B.grey45,disabledContrastText:B.grey100},selected:{main:B.green,alternative:B.grey20,excluded:B.grey10,selectedExcluded:B.grey10,possible:B.grey80,selectedContrastText:B.grey100,mainContrastText:B.grey100,alternativeContrastText:B.grey100,excludedContrastText:B.grey100,selectedExcludedContrastText:B.grey100,possibleContrastText:B.grey0},btn:{normal:"rgba(255, 255, 255, 0.15)",hover:"rgba(255, 255, 255, 0.25)",active:"rgba(0, 0, 0, 0.6)",disabled:"rgba(255, 255, 255, 0.15)",border:"rgba(0, 0, 0, 0.15)",borderHover:"rgba(0, 0, 0, 0.30)"}}},F={};function V(e){let t=P,n="";"string"==typeof e&&(n=e,"light"!==e&&"dark"!==e?console.warn(`Invalid theme: '${e}'`):"dark"===e&&(t=W));let r=JSON.stringify(t);if(F[r])return F[r];let i={palette:{type:t.mode,...$.palette,...t.palette},typography:{...$.typography},shadows:$.shadows,shape:{...$.shape}},o={...i,components:{MuiCheckbox:{defaultProps:{color:"secondary"}},MuiRadio:{defaultProps:{color:"secondary"}},MuiTabs:{defaultProps:{indicatorColor:"secondary"}},MuiTypography:{styleOverrides:{root:{color:i.palette.text.primary}}},MuiGrid:{styleOverrides:{variants:[{props:{alignItems:"center"},style:{"align-items":"center"}}]}},MuiButtonBase:{defaultProps:{disableRipple:!0,disableTouchRipple:!0,focusRipple:!1},styleOverrides:{root:{borderRadius:2,border:"1px solid transparent","&.Mui-focused":{borderColor:i.palette.custom.focusBorder,boxShadow:`0 0 0 2px ${i.palette.custom.focusOutline}`}}}},MuiIconButton:{styleOverrides:{root:{padding:7,borderRadius:2,border:"1px solid transparent","&:hover":{backgroundColor:i.palette.btn.hover},"&.Mui-focusVisible":{borderColor:i.palette.custom.focusBorder,boxShadow:`0 0 0 2px ${i.palette.custom.focusOutline}`},"&.Mui-active":{borderColor:"transparent",boxShadow:"none",backgroundColor:i.palette.btn.active},"&:not(.Mui-active):not(.Mui-focusVisible)":{borderColor:"transparent",boxShadow:"none"}}}},MuiOutlinedInput:{styleOverrides:{root:{backgroundColor:i.palette.custom.inputBackground,"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:i.palette.btn.border},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:i.palette.custom.focusBorder,borderWidth:2}}}},MuiButton:{styleOverrides:{outlined:{padding:"3px 11px",[`&.${R.A.focusVisible}`]:{borderColor:i.palette.custom.focusBorder,boxShadow:`0 0 0 2px ${i.palette.custom.focusOutline}`}},contained:{color:i.palette.text.primary,padding:"3px 11px",border:`1px solid ${i.palette.btn.border}`,backgroundColor:i.palette.btn.normal,boxShadow:"none",[`&.${R.A.focusVisible}`]:{borderColor:i.palette.custom.focusBorder,boxShadow:`0 0 0 2px ${i.palette.custom.focusOutline}`},"&:hover":{backgroundColor:i.palette.btn.hover,borderColor:i.palette.btn.borderHover,boxShadow:"none",[`&.${R.A.disabled}`]:{backgroundColor:i.palette.btn.disabled}},"&.Mui-active":{boxShadow:"none",backgroundColor:i.palette.btn.active},[`&.${R.A.disabled}`]:{backgroundColor:i.palette.btn.disabled}}}},MuiAccordionSummary:{styleOverrides:{content:{margin:"8px 0"}}}}};return F[r]=(0,z.A)(o),F[r].name=n,F[r]}let Q=e=>{let{themeName:t,children:n}=e,i=(0,o.useMemo)(()=>V(t),[t]);return(0,r.jsx)(O.A,{injectFirst:!0,children:(0,r.jsx)(N.A,{theme:i,children:(0,r.jsx)(E.A,{maxWidth:"md",children:n})})})};var U=n("ND"),Z=n("bS"),H=n("dJ"),_=n("AI");let Y=(0,Z.A)(U.A)(e=>{let{theme:t,marginTop:n=0}=e;return{position:"relative",padding:t.spacing(2,2),backgroundColor:"white",borderRadius:t.spacing(1),marginTop:t.spacing(n)}}),J=(0,Z.A)(H.A)(e=>{let{theme:t}=e;return{backgroundColor:"transparent",padding:t.spacing(3)}}),G=(0,Z.A)(_.A,{shouldForwardProp:e=>"shouldBePointer"!==e})(e=>{let{shouldBePointer:t=!1}=e;return{cursor:t?"pointer":"default"}}),K=["Connect to engine","Select app","Develop"];var X=()=>{let e=(0,u.Zp)(),{activeStep:t,glob:n,error:i,setError:o}=S(),s=()=>{(n||i)&&(o(),e("/"))};return(0,r.jsx)(Q,{themeName:"dark",children:(0,r.jsx)(J,{alternativeLabel:!0,activeStep:t,children:K.map((e,t)=>(0,r.jsx)(L.A,{children:(0,r.jsx)(G,{onClick:s,shouldBePointer:n||i,error:!!i&&!t,children:e})},e))})})},ee=()=>(0,r.jsxs)(Q,{children:[(0,r.jsx)(X,{}),(0,r.jsx)(c.sv,{})]}),et=n("Zp"),en=n("l"),er=n("PE"),ei=n("ew"),eo=n("Yu"),es=n("oZ"),ea=e=>{let{showGuid:t}=e;return(0,r.jsxs)(es.A,{in:t,children:[(0,r.jsx)(ei.A,{variant:"h6",gutterBottom:!0,style:{marginTop:"1rem"},children:"WebSocket URL"}),(0,r.jsx)(ei.A,{variant:"body2",paragraph:!0,children:"The development server needs to connect to and communicate with the Qlik Associative Engine running within any of Qlik's product offerings. The connection is done through the WebSocket protocol using a WebSocket URL format that differs slightly between products. Enter the WebSocket URL that corresponds to the Qlik product you are using."}),(0,r.jsx)(ei.A,{variant:"subtitle1",gutterBottom:!0,children:"Qlik Cloud Services"}),(0,r.jsxs)(ei.A,{variant:"body2",paragraph:!0,children:[(0,r.jsx)("b",{children:"Web integration id format:"}),"There are two ways in order to connect through WebSocket:",(0,r.jsx)("br",{}),"1. ",(0,r.jsx)("code",{children:"qlik-web-integration-id"}),(0,r.jsx)("br",{}),"2. ",(0,r.jsx)("code",{children:"qlik-client-id"}),(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),(0,r.jsx)("b",{children:"Web integration id:"}),(0,r.jsx)("br",{}),(0,r.jsx)("code",{children:"wss://<tenant>.<region>.qlikcloud.com?qlik-web-integration-id=<web-integration-id>"}),(0,r.jsx)("br",{}),"Example: ",(0,r.jsx)("code",{children:"wss://qlik.eu.qlikcloud.com?qlik-web-integration-id=xxx"}),(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),"For more info, visit"," ",(0,r.jsx)(eo.A,{color:"secondary",underline:"always",href:"https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Admin/mc-adminster-web-integrations.htm",children:"Managing web integrations"}),"."]}),(0,r.jsxs)(ei.A,{variant:"body2",paragraph:!0,children:[(0,r.jsx)("b",{children:"OAuth Client ID URL format:"}),(0,r.jsx)("br",{}),(0,r.jsx)("code",{children:"wss://<tenant>.<region>.qlikcloud.com?qlik-client-id=<client-id>"}),(0,r.jsx)("br",{}),"Example: ",(0,r.jsx)("code",{children:"wss://qlik.eu.qlikcloud.com?qlik-client-id=xxx"}),(0,r.jsx)("br",{}),"Redirect URL form: ",(0,r.jsx)("code",{children:"http://localhost:8000/auth/login/callback"}),(0,r.jsx)("br",{}),"The ",(0,r.jsx)("code",{children:"qlik-web-integration-id"})," ",(0,r.jsx)("b",{children:"OR"})," ",(0,r.jsx)("code",{children:"qlik-client-id"})," must be present in order for QCS to confirm that the request originates from a whitelisted domain.",(0,r.jsx)("br",{}),(0,r.jsx)("br",{})]}),(0,r.jsx)(ei.A,{variant:"subtitle1",gutterBottom:!0,children:"Qlik Sense on Windows"}),(0,r.jsxs)(ei.A,{variant:"body2",paragraph:!0,children:["WebSocket URL format: ",(0,r.jsx)("code",{children:"wss://<sense-host.com>/<virtual-proxy-prefix>"}),(0,r.jsx)("br",{}),"Example: ",(0,r.jsx)("code",{children:"wss://mycompany.com/bi"}),(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),"Note that for the Qlik Sense Proxy to allow sessions from this webpage,",(0,r.jsx)("code",{children:window.location.host})," needs to be whitelisted in QMC in your Qlik Sense on Windows deployment. In addition, you need to enable ",(0,r.jsx)("i",{children:"Has secure attribute"})," and set ",(0,r.jsx)("i",{children:"SameSite attribute"})," to ",(0,r.jsx)("i",{children:"None"}),".",(0,r.jsx)("br",{}),'Also some "Additional reponse headers" needs to align with the whitelisted domain:',(0,r.jsxs)("ul",{children:[(0,r.jsxs)("li",{children:["Access-Control-Allow-Origin: ",(0,r.jsx)("code",{children:window.location.host})]}),(0,r.jsx)("li",{children:"Access-Control-Allow-Credentials: true"}),(0,r.jsx)("li",{children:"Access-Control-Expose-Headers: qlik-csrf-token"})]}),"Make sure you are logged in to Qlik Sense in another browser tab."]}),(0,r.jsx)(ei.A,{variant:"subtitle1",gutterBottom:!0,children:"Qlik Sense Desktop"}),(0,r.jsxs)(ei.A,{variant:"body2",paragraph:!0,children:["WebSocket URL format: ",(0,r.jsx)("code",{children:"ws://localhost:4848"})]})]})};function el(e){let{size:t,style:n={},viewBox:i="0 0 16 16",shapes:o=[]}=e,s={fontSize:"large"===t?"20px":"small"===t?"12px":"16px",display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-.125em",textRendering:"optimizeLegibility",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",...n};return(0,r.jsx)("i",{style:s,children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:i,fill:"currentColor",children:o.map((e,t)=>{let{type:n,attrs:i}=e;return(0,r.jsx)(n,{...i},t)})})})}var ed=e=>el({...e,shapes:[{type:"path",attrs:{d:"M9.41421356,8 L11.8890873,5.52512627 C12.065864,5.34834957 12.0305087,4.95944084 11.8183766,4.74730881 L11.2526912,4.18162338 C11.0405592,3.96949135 10.6516504,3.93413601 10.4748737,4.1109127 L8,6.58578644 L5.52512627,4.1109127 C5.34834957,3.93413601 4.95944084,3.96949135 4.74730881,4.18162338 L4.25233406,4.67659813 C3.96949135,4.95944084 3.93413601,5.34834957 4.1109127,5.52512627 L6.58578644,8 L4.1109127,10.4748737 C3.93413601,10.6516504 3.96949135,11.0405592 4.18162338,11.2526912 L4.67659813,11.7476659 C4.95944084,12.0305087 5.34834957,12.065864 5.52512627,11.8890873 L8,9.41421356 L10.4748737,11.8890873 C10.6516504,12.065864 11.0405592,12.0305087 11.2526912,11.8183766 L11.8183766,11.2526912 C12.0305087,11.0405592 12.065864,10.6516504 11.8890873,10.4748737 L9.41421356,8 Z M8,0 C12.4,0 16,3.6 16,8 C16,12.4 12.4,16 8,16 C3.6,16 0,12.4 0,8 C0,3.6 3.6,0 8,0 Z"}}]}),ec=n("l5"),eu=n("Db"),eh=n("nm");let ep=[{id:0,label:"Local Engine",formFields:["Engine WebSocket URL"]},{id:1,label:"Web Integration Id",formFields:["Engine WebSocket URL","Web Integration Id"]},{id:2,label:"Client Id",formFields:["Engine WebSocket URL","Client Id"]}];n("gO"),n("Hj"),V("light");var eg=()=>{let e=(0,u.Zp)(),{info:t,setError:n,cachedConnectionsData:i}=S();return i.cachedConnections.length?(0,r.jsxs)(U.A,{mb:2,children:[(0,r.jsx)(ei.A,{variant:"h6",children:"Previous connections"}),(0,r.jsx)(ec.A,{children:i.cachedConnections.map(o=>(0,r.jsxs)(eu.A,{component:"a",onClick:()=>{n(),e(`/app-list?engine_url=${o.replace("?","&")}`)},disabled:(e=>{let{item:t,info:n}=e;return!!n&&(!!((n.isClientIdProvided||n.isWebIntegrationIdProvided)&&t.includes("localhost"))||(n.isClientIdProvided?!t.includes("qlik-client-id"):!!n.isWebIntegrationIdProvided&&!t.includes("qlik-web-integration-id")))})({item:o,info:t}),children:[(0,r.jsx)(eh.A,{primary:o}),(0,r.jsx)(en.A,{onClick:()=>i.removeCachedConnection(o),"data-testid":"close-btn",size:"large",edge:"end",children:(0,r.jsx)(ed,{})})]},o))})]}):null},ex=n("jQ"),em=n("IR"),ef=n("c0"),ej=n("hW");function ey(e){let{error:{message:t,hints:n}}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ei.A,{variant:"subtitle1",color:"error",gutterBottom:!0,style:{marginBottom:0},children:t}),n.map(e=>(0,r.jsx)(ei.A,{variant:"body2",children:e},e))]})}function eb(e){let{info:t,fields:n,error:i,isCredentialProvided:s}=e,a=(0,u.Zp)(),{setError:l}=S(),[d,c]=(0,o.useState)({});return(0,r.jsx)("form",{onSubmit:e=>{e.preventDefault(),l();let t=new URL(d["engine-websocket-url"]);d["web-integration-id"]&&t.searchParams.append("qlik-web-integration-id",d["web-integration-id"]),d["client-id"]&&t.searchParams.append("qlik-client-id",d["client-id"]),a(`/app-list?engine_url=${t.toString().replace("?","&")}`)},children:(0,r.jsxs)(er.A,{container:!0,spacing:2,direction:"column",justifyContent:"center",children:[n.map((e,n)=>(0,r.jsx)(er.A,{size:12,children:(0,r.jsx)(ef.A,{fullWidth:!0,autoFocus:0===n,disabled:s&&1===n,name:e.split(" ").map(e=>e.toLowerCase()).join("-"),error:t?.invalid,placeholder:0===n?e:(e=>{let{isCredentialProvided:t,field:n}=e;return t?`You have provided "${n}" through cli or nebula.config.js file already!`:n})({field:e,isCredentialProvided:s}),onChange:e=>{c({...d,[e.target.name]:e.target.value})}})},e)),(0,r.jsxs)(er.A,{container:!0,size:12,alignItems:"center",children:[(0,r.jsx)(er.A,{size:10,children:i&&(0,r.jsx)(ey,{error:i})}),(0,r.jsx)(er.A,{container:!0,size:2,direction:"row",alignItems:"center",justifyContent:"flex-end",children:(0,r.jsx)(ej.A,{type:"submit",variant:"contained",size:"large",disabled:(e=>{let{isCredentialProvided:t,inputs:n,fields:r}=e;return t?!n["engine-websocket-url"]:Object.entries(n).length!==r.length||Object.values(n).some(e=>!e)})({isCredentialProvided:s,inputs:d,fields:n}),children:"Connect"})})]})]})})}function eA(){let{info:e,error:t}=S(),[n,i]=(0,o.useState)(0);return(0,o.useEffect)(()=>{let t=e?e.isWebIntegrationIdProvided?ep.findIndex(e=>"Web Integration Id"===e.label):e.isClientIdProvided?ep.findIndex(e=>"Client Id"===e.label):0:0;t&&i(t)},[e]),(0,r.jsxs)(U.A,{children:[(0,r.jsx)(ei.A,{variant:"h6",gutterBottom:!0,children:"New connection with:"}),(0,r.jsxs)(U.A,{sx:{width:"100%"},children:[(0,r.jsx)(U.A,{sx:{borderBottom:1,borderColor:"divider"},children:(0,r.jsx)(ex.A,{value:n,onChange:(e,t)=>i(t),"aria-label":"basic tabs example",children:ep.map(t=>{let{id:n,label:i}=t;return(0,r.jsx)(em.A,{label:i,disabled:(e=>{let{label:t,info:n}=e;if(!n)return!1;let r=t.split(" ").map(e=>e.toLowerCase()).join("-");return n.isWebIntegrationIdProvided?"web-integration-id"!==r:!!n.isClientIdProvided&&"client-id"!==r})({info:e,label:i})},n)})})}),ep.map(i=>{let{id:o,formFields:s}=i;return(0,r.jsx)(eM,{tabIdx:n,idx:o,children:(0,r.jsx)(eb,{info:e,error:t,fields:s,isCredentialProvided:e?.isWebIntegrationIdProvided||e?.isClientIdProvided})},o)})]})]})}function eM(e){let{children:t,tabIdx:n,idx:i}=e;return n===i?(0,r.jsx)(U.A,{sx:{p:3,pb:1},children:t}):null}var ev=()=>{let{cachedConnectionsData:e}=S(),[t,n]=(0,o.useState)(!1);return(()=>{let{cachedConnectionsData:e}=S();(0,o.useEffect)(()=>{x.Ay.setDefaultHostConfig(void 0)},[e.cachedConnections.length])})(),(0,o.useEffect)(()=>{n(!e.cachedConnections.length)},[e.cachedConnections.length]),(0,r.jsxs)(Y,{children:[(0,r.jsxs)(er.A,{container:!0,children:[(0,r.jsx)(er.A,{sx:{flex:1},children:(0,r.jsx)(ei.A,{variant:"h5",gutterBottom:!0,children:"Connect to an engine"})}),(0,r.jsx)(er.A,{item:!0,children:(0,r.jsx)(en.A,{onClick:()=>n(!t),size:"small",children:(0,r.jsx)(et.A,{})})})]}),(0,r.jsx)(eg,{}),(0,r.jsx)(eA,{}),(0,r.jsx)(ea,{showGuid:t})]})},ew=n("tW"),eC=()=>{let e=(0,u.Zp)(),t=(0,u.zy)(),{info:n,glob:i,treatAsDesktop:s}=S(),{loading:a,appList:l}=(e=>{let{glob:t,info:n}=e,{setInfo:r,setActiveStep:i}=S(),[s,a]=(0,o.useState)(),[l,d]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{i(1),M().then(e=>{r(e)})},[]),(0,o.useEffect)(()=>{s?.length||(d(!0),t?.getDocList()?.then(e=>{a(e),e&&d(!1)})?.catch(e=>{console.error("Failed to fetch app list:",e),d(!1)}))},[n,t]),{appList:s,loading:l}})({glob:i,info:n});return(0,r.jsxs)(Y,{children:[(0,r.jsx)(ei.A,{variant:"h5",gutterBottom:!0,children:"Select an app"}),a&&(0,r.jsx)(ew.A,{"data-testid":"loading",size:32}),!a&&l&&!l.length&&(0,r.jsx)(ei.A,{component:"span",children:"No apps found!"}),l&&l.length>0&&(0,r.jsx)(ec.A,{children:l.map(i=>(0,r.jsx)(eu.A,{button:!0,component:"a",onClick:()=>(async e=>{let{navigate:t,location:n,targetApp:r,info:i}=e,{search:o}=n,s=i.engine.secure?"wss":"ws",a=i.engine.port?`:${i.engine.port}`:"",l=i.engine.prefix?`/${i.engine.prefix}`:"",d=("localhost"===i.engine.host?`${i.engine.host}${a}`:i.engine.host)+l,c=await j(`https://${i.engine.host}${l}`),u=c?`&qlik-csrf-token=${c}`:"",h=`${s}://${d}/app/${encodeURIComponent(r)}${u}`,p=o.replace(i.engineUrl,h);t(`/dev/${p}`.replace("&shouldFetchAppList=true",""))})({info:n,navigate:e,location:t,targetApp:s?i.qDocName:i.qDocId}),children:(0,r.jsx)(eh.A,{primary:i.qTitle,secondary:i.qDocId})},i.qDocId))})]})},eD=n("o"),eq=n("NT"),eI=n("Fh"),eS=n("I3"),ek=n("r5"),eL=n("EE"),eE=o.createContext({language:null,theme:null,translator:null,constraints:{},interactions:{},themeApi:null,modelStore:{},selectionStore:{},hostConfig:null,queryParams:null});function eT(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},n=[],r={},i={get:t=>e[t],set:(n,i)=>{if(void 0===n||"object"==typeof n)throw Error(`Invalid key: ${JSON.stringify(n)}`);return e[n]=i,r[n]=t({type:"SET",value:i}),i},clear:t=>{if(void 0===t||"object"==typeof t)throw Error(`Invalid key: ${JSON.stringify(t)}`);let n=r[t];delete r[t],n&&n(),e[t]=null},dispatch:t=>{n.forEach(n=>n(t?{}:e))},destroy:()=>{Object.keys(r).forEach(e=>{r[e]&&r[e]()})}};return[()=>{let[,t]=(0,o.useState)(e);return(0,o.useEffect)(()=>(n.push(t),()=>{let e=n.indexOf(t);n.splice(e,1)}),[t]),[i]},i]}var eN=n("Vf"),eO=n("m3"),ez=n("Mc"),eR=n("NQ"),e$=n("Hb"),eB=n("r");let eP={"@nebula.js/stardust":eD,react:s,"react-dom":n.t(eB,2),"react-dom/client":l,"react/jsx-runtime":i},eW=/^[A-Za-z_$][\w$]*$/,eF=!1,eV=async(e,t)=>{let n;return(()=>{if(eF)return;eF=!0,globalThis.nebulaShared=eP;let e={};Object.entries(eP).forEach(t=>{let n,[r,i]=t;e[r]=URL.createObjectURL(new Blob([(n=Object.keys(i).filter(e=>"default"!==e&&eW.test(e)).map(e=>`export const ${e} = shared[${JSON.stringify(e)}];`),[`const shared = globalThis.nebulaShared[${JSON.stringify(r)}];`,"export default shared.default !== undefined ? shared.default : shared;",...n].join("\n"))],{type:"text/javascript"}))});let t=document.createElement("script");t.type="importmap",t.textContent=JSON.stringify({imports:e}),document.head.appendChild(t)})(),(n=await import(`${t}${t.includes("?")?"&":"?"}t=${Date.now()}`))&&"object"==typeof n&&"default"in n?n.default:n},eQ={};window.onHotChange=(e,t)=>(eQ[e]||(eQ[e]=[]),eQ[e].push(t),window[e]&&t(),()=>{let n=eQ[e].indexOf(t);eQ[e].splice(n,1)});var eU=n("jk"),eZ=n("p7e"),eH=n("Tc");function e_(e){let[t,n]=(0,o.useState)();return(0,o.useEffect)(()=>{if(e){let t=()=>{e.getProperties().then(e=>{n({...e})})};return e.on("changed",t),t(),()=>{e.removeListener("changed",t)}}return()=>{}},[e,n]),[t,t=>e.setProperties(t)]}let eY=o.createContext();var eJ=n("RA");let eG=[[10,31],[0,31],[0,31],[0,31],[0,31],[0,31]];function eK(e){let[t,n]=e;return(t+(Math.random()*(n-t)|0)).toString(32)}function eX(){return eG.map(eK).join("")}function e0(e,t){for(let n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)}function e1(e,t){let n=0;for(let r=0;r<e.length;++r)e[r]>t?--e[r]:e[r]===t&&(n=r);return e.splice(n,1),n}function e2(e){let{dc:t,def:n,properties:r}=e;t.qDimensions=t.qDimensions||[],t.qMeasures=t.qMeasures||[],t.qInterColumnSortOrder=t.qInterColumnSortOrder||[],t.qInitialDataFetch=t.qInitialDataFetch||[],t.qColumnOrder=t.qColumnOrder||[],t.qExpansionState=t.qExpansionState||[];let i={dimensions:()=>t.qDimensions,measures:()=>t.qMeasures,addDimension(e){let o="string"==typeof e?{qDef:{qFieldDefs:[e]}}:{...e,qDef:e.qDef||{}};return o.qDef.cId=o.qDef.cId||eX(),o.qDef.qSortCriterias=o.qDef.qSortCriterias||[{qSortByLoadOrder:1,qSortByNumeric:1,qSortByAscii:1}],o.qOtherTotalSpec=o.qOtherTotalSpec||{},o.qAttributeExpressions=o.qAttributeExpressions||[],o.qAttributeDimensions=o.qAttributeDimensions||[],t.qDimensions.length<i.maxDimensions()?(t.qDimensions.push(o),e0(t.qInterColumnSortOrder,t.qDimensions.length-1),n.dimensions.added(o,r)):(t.qLayoutExclude=t.qLayoutExclude||{},t.qLayoutExclude.qHyperCubeDef=t.qLayoutExclude.qHyperCubeDef||{},t.qLayoutExclude.qHyperCubeDef.qDimensions=t.qLayoutExclude.qHyperCubeDef.qDimensions||[],t.qLayoutExclude.qHyperCubeDef.qMeasures=t.qLayoutExclude.qHyperCubeDef.qMeasures||[],t.qLayoutExclude.qHyperCubeDef.qDimensions.push(o)),o},removeDimension(e){let i=t.qDimensions.splice(e,1)[0];return e1(t.qInterColumnSortOrder,e),n.dimensions.removed(i,r,e),i},addMeasure(e){let o="string"==typeof e?{qDef:{qDef:e}}:{...e,qDef:e.qDef||{}};o.qDef.cId=o.qDef.cId||eX(),o.qSortBy=o.qSortBy||{qSortByLoadOrder:1,qSortByNumeric:-1},o.qAttributeDimensions=o.qAttributeDimensions||[],o.qAttributeExpressions=o.qAttributeExpressions||[],t.qMeasures.length<i.maxMeasures()?(t.qMeasures.push(o),e0(t.qInterColumnSortOrder,t.qDimensions.length+t.qMeasures.length-1),n.measures.added(o,r)):(t.qLayoutExclude=t.qLayoutExclude||{},t.qLayoutExclude.qHyperCubeDef=t.qLayoutExclude.qHyperCubeDef||{},t.qLayoutExclude.qHyperCubeDef.qDimensions=t.qLayoutExclude.qHyperCubeDef.qDimensions||[],t.qLayoutExclude.qHyperCubeDef.qMeasures=t.qLayoutExclude.qHyperCubeDef.qMeasures||[],t.qLayoutExclude.qHyperCubeDef.qMeasures.push(o))},removeMeasure(e){let i=t.qMeasures.splice(e,1)[0];e1(t.qInterColumnSortOrder,t.qDimensions.length+e),n.measures.removed(i,r,e)},maxDimensions:()=>n.dimensions.max(t.qMeasures.length),maxMeasures:()=>n.measures.max(t.qDimensions.length),canAddDimension:()=>t.qDimensions.length<i.maxDimensions(),canAddMeasure:()=>t.qMeasures.length<i.maxMeasures()};return i}function e4(e){let{dc:t,def:n,properties:r}=e;t.qInitialDataFetch=t.qInitialDataFetch||[];let i={dimensions:()=>t.qLibraryId||t.qDef&&t.qDef.qFieldDefs&&0!==t.qDef.qFieldDefs.length?[t]:[],measures:()=>[],addDimension(e){let i="string"==typeof e?{qDef:{qFieldDefs:[e]}}:{...e,qDef:e.qDef||{}};return i.qDef.cId=i.qDef.cId||eX(),i.qDef.qSortCriterias=t.qDef.qSortCriterias||[{qSortByState:1,qSortByLoadOrder:1,qSortByNumeric:1,qSortByAscii:1}],Object.keys(i).forEach(e=>{t[e]=i[e]}),n.dimensions.added(i,r),i},removeDimension:e=>(delete t.qDef,delete t.qLibraryId,n.dimensions.removed(t,r,e),t),addMeasure(){},removeMeasure(){},maxDimensions:()=>1,maxMeasures:()=>0,canAddDimension:()=>0===i.dimensions().length,canAddMeasure:()=>!1};return i}function e5(e){let{dc:t,def:n,properties:r,dimensions:i}=e,o={dimensions:()=>i,measures:()=>[],addDimension(e){let i="string"==typeof e?{qDef:{qFieldDefs:[e]}}:{...e,qDef:e.qDef||{}};return i.qDef.cId=i.qDef.cId||eX(),i.qDef.qSortCriterias=t&&t.qDef.qSortCriterias||[{qSortByState:1,qSortByLoadOrder:1,qSortByNumeric:1,qSortByAscii:1}],n.dimensions.added(i,r),i},removeDimension(e){let t=i[e];return n.dimensions.removed(t,r,e),t},maxDimensions(){let{max:e}=n.dimensions||{};return("function"==typeof e?e():e)||0},maxMeasures:()=>0,canAddDimension:()=>o.dimensions().length<o.maxDimensions(),canAddMeasure:()=>!1};return o}function e3(){let{useModelStore:e}=(0,o.useContext)(eE).modelStore;return e()}function e6(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];let s=t?`${t.id}/${JSON.stringify(e)}`:null,[a]=e3(),[l]=function(){let{useRpcRequestSessionModelStore:e}=(0,o.useContext)(eE).modelStore;return e()}(),[d,c]=(0,o.useState)();return(0,o.useEffect)(()=>{t&&(async()=>{let n=l.get(s);n||(n=t.createSessionObject(e),l.set(s,n));let r=await n;a.set(s,r),c(r)})()},[t,...r]),[d]}let e8=(e,t)=>{let n,{rpcResultStore:r,key:i,method:o}=t;switch(t.type){case"INVALID":n={...e,valid:!1,invalid:!0,validating:!0,canCancel:!0,canRetry:!1,rpcRetry:!1};break;case"VALID":n={result:{...t.result},invalid:!1,valid:!0,validating:!1,canCancel:!1,canRetry:!1,rpcRetry:!1};break;case"CANCELLED":n={...e,invalid:!0,valid:!1,validating:!1,canCancel:!1,canRetry:!0,rpcRetry:!1};break;default:throw Error("Undefined action")}let s=r.get(i);return s||(s={}),s[o]=n,r.set(i,s),n};function e9(e,t){let n,r=e?`${e.id}`:null,[i]=function(){let{useRpcResultStore:e}=(0,o.useContext)(eE).modelStore;return e()}(),[s,a]=(0,o.useReducer)(e8,r?i.get(r):null),[l]=function(){let{useModelChangedStore:e}=(0,o.useContext)(eE).modelStore;return e()}(),[d]=function(){let{useRpcRequestStore:e}=(0,o.useContext)(eE).modelStore;return e()}();r&&((n=d.get(r))||(n={},d.set(r,n)));let c=async o=>{let s=n[t];(!s||s&&s.rpcRetry)&&(s={rpc:e[t](),rpcRetry:!1},n[t]=s,a({type:"INVALID",method:t,key:r,model:e,rpcResultStore:i,canCancel:!0}));try{await new Promise(e=>{setTimeout(e,0)});let n=await s.rpc;a({type:"VALID",result:n,key:r,method:t,model:e,rpcResultStore:i})}catch(e){15!==e.code||o||(s.rpcRetry||(s.rpcRetry=!0),c(!0))}};return(0,o.useEffect)(()=>{e&&c()},[e,l.get(e&&e.id),r,t]),[s&&s.result,{validating:s&&s.validating,canCancel:s&&s.canCancel,canRetry:s&&s.canRetry},{cancel:async()=>{let o=e.session.getObjectApi({handle:-1});await o.cancelRequest(n[t].rpc.requestId),a({type:"CANCELLED",key:r,method:t,model:e,rpcResultStore:i})},retry:()=>{n[t].rpcRetry=!0,c()}}]}function e7(e){let[t,{validating:n,canCancel:r,canRetry:i},o]=e9(e,"getLayout");return e?.pureLayout&&t?[e.pureLayout,{validating:n,canCancel:r,canRetry:i},o]:[t,{validating:n,canCancel:r,canRetry:i},o]}let te={qInfo:{qType:"DimensionList",qId:"DimensionList"},qDimensionListDef:{qType:"dimension",qData:{labelExpression:"/qDimension/qLabelExpression",title:"/qMetaDef/title"}}},tt={qInfo:{qType:"MeasureList",qId:"MeasureList"},qMeasureListDef:{qType:"measure",qData:{labelExpression:"/qMeasure/qLabelExpression",title:"/qMetaDef/title"}}};function tn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"dimension",[n]=e6("dimension"===t?te:tt,e),[r]=e7(n);return[r&&(r.qDimensionList||r.qMeasureList).qItems||[]]}var tr=n("IU"),ti=n("aT"),to=n("kV"),ts=n("QW"),ta=n.n(ts),tl=n("Ka"),td=n.n(tl),tc=n("fU"),tu=n("ra"),th=n("f"),tp=n("b1"),tg=e=>el({...e,shapes:[{type:"path",attrs:{d:"M8.588 11.415a6 6 0 1 1 2.828-2.829l4.101 4a1.5 1.5 0 0 1 .014 2.134l-.707.707a1.5 1.5 0 0 1-2.108.014l-4.128-4.026ZM11 6A5 5 0 1 0 1 6a5 5 0 0 0 10 0Zm-1.52 4.888 3.934 3.837a.5.5 0 0 0 .703-.005l.707-.707a.5.5 0 0 0-.005-.711l-3.926-3.829a6.034 6.034 0 0 1-1.413 1.415Z"}}]});let tx="Search",tm={gridContainer:`${tx}-gridContainer`,gridItem:`${tx}-gridItem`},tf=(0,th.A)(er.A)(e=>{let{theme:t}=e;return{[`& .${tm.gridContainer}`]:{padding:t.spacing(0,1,0,1)},[`& .${tm.gridItem}`]:{padding:t.spacing(0,1,0,1)}}});function tj(){let e=document.querySelector('meta[name="viewport"]');e instanceof HTMLMetaElement&&(e.content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0")}function ty(e){let{onChange:t=()=>{},onEnter:n=()=>{},onEscape:i=()=>{}}=e,[s,a]=(0,o.useState)("");return(0,r.jsxs)(tf,{className:tm.gridContainer,container:!0,direction:"row",alignItems:"center",children:[(0,r.jsx)(er.A,{children:(0,r.jsx)(tg,{})}),(0,r.jsx)(er.A,{className:tm.gridItem,sx:{flex:1},children:(0,r.jsx)(tp.A,{fullWidth:!0,autoFocus:!0,placeholder:"Search",value:s,onChange:e=>{a(e.target.value),t(e.target.value)},onFocus:tj,onKeyDown:e=>{switch(e.key){case"Enter":n(),a("");break;case"Escape":i()}}})})]})}function tb(e){let{field:t,onSelect:n,sub:i,parts:o}=e;return(0,r.jsxs)(eu.A,{onClick:()=>n(t.qName),"data-key":t.qName,children:[(0,r.jsx)(eh.A,{children:o.map((e,t)=>(0,r.jsx)("span",{style:e.highlight?{flex:"0 1 auto",backgroundColor:"#FFC72A"}:{flex:"0 1 auto"},children:e.text},t))}),i&&(0,r.jsx)(tc.A,{fontSize:"small"})]})}function tA(e){let{item:t,onSelect:n,parts:i}=e;return(0,r.jsx)(eu.A,{onClick:()=>n(t.qInfo),"data-key":t.qInfo.qId,children:(0,r.jsx)(eh.A,{children:i.map((e,t)=>(0,r.jsx)("span",{style:e.highlight?{flex:"0 1 auto",backgroundColor:"#FFC72A"}:{flex:"0 1 auto"},children:e.text},t))})})}function tM(e){let{aggr:t,field:n,onSelect:i}=e;return(0,r.jsx)(eu.A,{onClick:()=>i(t),"data-key":t,children:(0,r.jsx)(eh.A,{children:`${t}(${n})`})})}function tv(e){let{app:t,onSelect:n,title:i="",type:s="dimension",searchTerm:a=""}=e,[l]=tn(t,s),d=(0,o.useMemo)(()=>l.slice().sort((e,t)=>e.qData.title.toLowerCase().localeCompare(t.qData.title.toLowerCase())),[l]);return l.length>0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(tr.A,{component:"div",style:{backgroundColor:"inherit"},children:i}),d.map(e=>{let t=td()(e.qData.title,a),i=ta()(e.qData.title,t);return a&&0===t.length?null:(0,r.jsx)(tA,{item:e,onSelect:n,parts:i},e.qInfo.qId)})]}):null}function tw(e){let{alignTo:t,show:n,close:i,onSelected:s,type:a}=e,l=(0,o.useContext)(eY),[d,c]=(0,o.useState)(null),[u,h]=(0,o.useState)(""),p=(0,T.A)(),[g]=e6({qInfo:{qType:"FieldList",qId:"FieldList"},qFieldListDef:{qShowDerivedFelds:!1,qShowHidden:!1,qShowSemantic:!0,qShowSrcTables:!0,qShowSystem:!1}},l),[x]=e7(g),m=(0,o.useMemo)(()=>(x&&x.qFieldList.qItems||[]).slice().sort((e,t)=>e.qName.toLowerCase().localeCompare(t.qName.toLowerCase())),[x]),f=e=>{e&&e.qId?(s(e),i()):"measure"===a?c(e):(s({field:e}),i())},j=e=>{s({field:d,aggregation:e}),i()};return(0,r.jsxs)(ti.Ay,{open:n,onClose:i,anchorEl:t.current,marginThreshold:16,elevation:3,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},PaperProps:{style:{minWidth:"250px",maxHeight:"300px",background:p.palette.background.lightest}},children:[!d&&(0,r.jsx)(ty,{onChange:h}),d&&(0,r.jsxs)(ec.A,{dense:!0,component:"nav",children:[(0,r.jsxs)(eu.A,{onClick:()=>c(null),children:[(0,r.jsx)(to.A,{children:(0,r.jsx)(tu.A,{})}),(0,r.jsx)(eh.A,{children:"Back"})]}),(0,r.jsx)(eH.A,{}),(0,r.jsx)(tr.A,{component:"div",children:"Aggregation"}),["sum","count","avg","min","max"].map(e=>(0,r.jsx)(tM,{aggr:e,field:d,onSelect:j},e))]}),!d&&m.length>0&&(0,r.jsxs)(ec.A,{dense:!0,component:"nav",style:{background:p.palette.background.lightest},children:[(0,r.jsx)(tv,{app:l,onSelect:f,type:a,title:"measure"===a?"Measures":"Dimensions",searchTerm:u}),(0,r.jsx)(tr.A,{component:"div",style:{backgroundColor:"inherit"},children:"Fields"}),m.map(e=>{let t=td()(e.qName,u),n=ta()(e.qName,t);return u&&0===t.length?null:(0,r.jsx)(tb,{field:e,onSelect:f,sub:"measure"===a,parts:n},e.qName)})]})]})}let tC=e=>{let{field:t,libraryItems:n}=e;if(t.qLibraryId){let e=n.filter(e=>e.qInfo.qId===t.qLibraryId)[0];return e?e.qData.title:"!!!"}return t.qDef&&t.qDef.qFieldDefs?t.qDef.qFieldDefs[0]:t.qDef&&t.qDef.qDef?t.qDef.qDef:"???"};function tD(e){let{items:t,type:n="dimension",label:i="",addLabel:s="Add",onAdded:a,onRemoved:l,canAdd:d=!0}=e,[c,u]=(0,o.useState)(!1),h=(0,o.useRef)(null),[p]=tn((0,o.useContext)(eY),n);return(0,r.jsxs)("div",{children:[(0,r.jsx)(ei.A,{variant:"overline",children:i}),(0,r.jsx)(ec.A,{dense:!0,children:t.map((e,t)=>(0,r.jsx)(eJ.Ay,{disableGutters:!0,secondaryAction:(0,r.jsx)(en.A,{onClick:()=>{l(t)},size:"large",children:(0,r.jsx)(ed,{})}),children:(0,r.jsx)(eh.A,{children:(0,r.jsx)(tC,{field:e,libraryItems:p,type:n})})},e.qDef&&e.qDef.cId||t))}),(0,r.jsx)(ej.A,{variant:"contained",fullWidth:!0,onClick:()=>{u(!c)},ref:h,disabled:!d,children:s}),c&&(0,r.jsx)(tw,{alignTo:h,show:c,close:()=>u(!1),onSelected:e=>{e.qId?a(e):e&&("dimension"===n?a(e.field):a(`${e.aggregation||"sum"}([${e.field}])`))},type:n})]})}function tq(e){let{setProperties:t,target:n,properties:i}=e,[s,a]=(0,o.useState)([]),l=n.dimensions&&n.dimensions.max&&n.dimensions.max()>1,d=n.propertyPath.match("/qHyperCube")?e2:l?e5:e4,c=((e,t)=>{let n=t.split("/"),r=e;if(void 0!==r){for(let e=0;e<n.length;++e)if(""!==n[e]){if(void 0===r[n[e]])return;r=r[n[e]]}return r}})(i,n.propertyPath),u=(0,o.useMemo)(()=>d({def:n,dc:c,properties:i,dimensions:s}),[c,n,i,s]);return(0,r.jsxs)("div",{style:{width:"100%"},children:[(0,r.jsx)(ei.A,{color:"textSecondary",style:{fontFamily:"Monaco, monospace",fontSize:"0.7rem"},children:n.propertyPath}),(0,r.jsx)(tD,{onAdded:e=>{let n="object"==typeof e?{qLibraryId:e.qId}:e,r=u.addDimension(n);t(i).then(()=>{a([...s,r])})},onRemoved:e=>{u.removeDimension(e),t(i).then(()=>{a([...s.slice(0,e),...s.slice(e+1)])})},canAdd:u.canAddDimension(),items:u.dimensions(),type:"dimension",label:"Dimensions",addLabel:"Add dimension"},"dimensions"),(0,r.jsx)(tD,{onAdded:e=>{u.addMeasure("object"==typeof e?{qLibraryId:e.qId}:e),t(i)},onRemoved:e=>{u.removeMeasure(e),t(i)},canAdd:u.canAddMeasure(),items:u.measures(),type:"measure",label:"Measures",addLabel:"Add measures"},"measures")]})}function tI(e){let{setProperties:t,sn:n,properties:i}=e;if(!n)return null;let{targets:o}=n.qae.data;return o.length?(0,r.jsx)(ec.A,{children:o.map(e=>(0,r.jsx)(eJ.Ay,{divider:!0,disableGutters:!0,children:(0,r.jsx)(tq,{target:e,properties:i,setProperties:t})},e.propertyPath))}):(0,r.jsx)(ei.A,{children:"No data targets found"})}var tS=n("yY"),tk=n("QL"),tL=n("le"),tE=n("Nq"),tT=n("dc"),tN=n("UK"),tO=n("DG");let tz=null,tR="AutoComponents",t$={summary:`${tR}-summary`,details:`${tR}-details`,root:`${tR}-root`},tB=(0,th.A)(er.A)(e=>{let{theme:t}=e;return{[`& .${t$.summary}`]:{padding:t.spacing(0,1),backgroundColor:t.palette.background.lighter,borderBottom:`1px solid ${t.palette.divider}`},[`& .${t$.details}`]:{padding:t.spacing(1)}}}),tP=(0,th.A)(tS.A)(e=>{let{theme:t}=e;return{[`& .${t$.root}`]:{boxShadow:"none",marginLeft:-t.spacing(1),marginRight:-t.spacing(1),"&$expanded":{marginLeft:-t.spacing(1),marginRight:-t.spacing(1)}}}}),tW={boolean:function(e){let{property:t,value:n,target:i,changed:o}=e;return(0,r.jsx)(eU.A,{control:(0,r.jsx)(eZ.A,{checked:n,onChange:e=>{i[t]=e.target.checked,o()}}),label:t,labelPlacement:"end"})},string:function(e){let{property:t,value:n,target:i,changed:s}=e,[a,l]=(0,o.useState)(n);return(0,r.jsx)(tp.A,{variant:"standard",fullWidth:!0,onChange:e=>{l(e.target.value)},onBlur:()=>{a!==n&&(i[t]=a,s())},label:t,value:a})},object:function(e){let{property:t,value:n,changed:i,app:o}=e;return(0,r.jsxs)(tP,{square:!0,className:t$.root,children:[(0,r.jsx)(tL.A,{expandIcon:(0,r.jsx)(tT.A,{}),className:t$.summary,children:(0,r.jsx)(ei.A,{children:t})}),(0,r.jsx)(tE.A,{className:t$.details,children:tQ(n,i,o)})]})},number:function(e){let{property:t,value:n,target:i,changed:s}=e,[a,l]=(0,o.useState)(+n);return(0,r.jsx)(tp.A,{variant:"standard",fullWidth:!0,onChange:e=>{l(e.target.value)},onBlur:()=>{a!==n&&(i[t]=+a,s())},label:t,value:a})},expression:function(e){let{property:t,value:n,target:i,changed:s}=e,a=n.qStringExpression&&n.qStringExpression.qExpr?n.qStringExpression.qExpr:"",[l,d]=(0,o.useState)(a);return(0,r.jsx)(tp.A,{variant:"standard",InputProps:{startAdornment:(0,r.jsx)(tk.A,{position:"start",children:"="})},fullWidth:!0,onChange:e=>{d(e.target.value)},onBlur:()=>{l!==n&&(i[t].qStringExpression={qExpr:`=${l}`},s())},label:t,value:l})},variable:function(e){let{property:t,value:n,target:i,changed:s,app:a}=e,[l,d]=(0,o.useState)(n.name),[c,u]=(0,o.useState)([]);return(0,o.useEffect)(()=>{!async function(){u(await async function(e){return tz||(tz=await e.createSessionObject({qInfo:{qType:"VariableList"},qVariableListDef:{qType:"variable",qShowReserved:!1,qShowConfig:!1}})),(await tz.getLayout()).qVariableList.qItems.map(e=>({value:e.qName,label:e.qName.length>50?`${e.qName.slice(0,50)}...`:e.qName}))}(a))}()},[]),0===c.length?(0,r.jsx)("em",{children:"No variables in app"}):(0,r.jsx)(tN.A,{size:"small",fullWidth:!0,children:(0,r.jsx)(tO.A,{onChange:e=>{d(e.target.value),i[t].name=e.target.value,i[t].value={qStringExpression:{qExpr:`[${e.target.value}]`}},s()},displayEmpty:!0,fullWidth:!0,value:l,renderValue:e=>0===e.length?(0,r.jsx)("em",{children:"Select a variable"}):e,children:c.map(e=>(0,r.jsx)(e$.A,{value:e.value,children:e.label},e.value))})})}},tF=/^q[A-Z]/,tV=!1;function tQ(e,t,n,i){i&&i.PP_EXPRESSIONS&&(tV=!0);let o=Object.keys(e).map(t=>{var n;if(-1!==["visualization","version"].indexOf(t)||tF.test(t))return!1;let r=(n=e[t],Array.isArray(n)?"array":tV&&"variable"===t&&"object"==typeof n&&"name"in n&&"value"in n?"variable":tV&&n&&"object"==typeof n&&"qStringExpression"in n?"expression":"boolean"==typeof n?"boolean":"string"==typeof n?"string":"number"==typeof n?"number":n&&"object"==typeof n?"object":"unknown");return!!tW[r]&&{Component:tW[r],property:t,target:e,value:e[t],key:`${t}:${e[t]}`}}).filter(Boolean);return(0,r.jsx)(tB,{container:!0,direction:"column",gap:0,alignItems:"stretch",children:o.map(i=>(0,r.jsx)(er.A,{style:{width:"100%"},children:(0,r.jsx)(i.Component,{app:n,property:i.property,value:i.value,target:e,changed:t},i.key)},i.key))})}function tU(e){let{viz:t,sn:n,isTemp:i,storage:s,flags:a}=e,[l,d]=e_(t?.model),c=(0,o.useContext)(eY),[u,h]=(0,o.useState)(!1!==s.get("readFromCache")),p=(0,o.useCallback)(()=>{d(l)},[t,n,l]);return n&&t&&l?(0,r.jsxs)("div",{style:{minWidth:"250px",padding:"8px"},children:[i&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(er.A,{item:!0,container:!0,alignItems:"center",children:(0,r.jsx)(eU.A,{control:(0,r.jsx)(eZ.A,{checked:u,onChange:e=>{s.save("readFromCache",e.target.checked),h(e.target.checked)},value:"isReadFromCacheEnabled"}),label:"Enable property cache",labelPlacement:"end"})}),(0,r.jsx)(eH.A,{})]}),(0,r.jsx)(tI,{properties:l,setProperties:d,sn:n}),tQ(l,p,c,a)]}):null}var tZ=n("Qt"),tH=n("kg"),t_=n("Ig"),tY=n("sf"),tJ=n("IL");function tG(e){let{model:t,show:n,close:i}=e,[s,a]=(0,o.useState)(""),[l,d]=(0,o.useState)(null),[c,u]=(0,o.useState)([]),[h,p,g]=function(){let[e,t]=(0,o.useState)(),[n,r]=(0,o.useState)(),i=(0,o.useCallback)(e=>{e&&t(e)},[]),s=()=>{let{left:t,top:n,width:i,height:o}=e.getBoundingClientRect();r({left:t,top:n,width:i,height:o})};return(0,o.useLayoutEffect)(()=>{if(e){if("function"==typeof ResizeObserver){let t=new ResizeObserver(s);return t.observe(e),()=>{t.unobserve(e),t.disconnect(e),t=null}}return s(),window.addEventListener("resize",s),()=>{window.removeEventListener("resize",s)}}},[e]),[i,n,e]}(),x=(0,T.A)(),m=(0,o.useCallback)(()=>{c.length||t.setProperties(JSON.parse(l.getValue())).then(i)});return(0,o.useEffect)(()=>{if(!n)return;let e=()=>{t&&n&&t.getProperties().then(e=>{n&&a(JSON.stringify(e||{},null,2))})};return t.on("changed",e),e(),()=>{t&&t.removeListener("changed",e)}},[t&&t.id,n]),(0,o.useEffect)(()=>{if(!h||!g||!p||!s)return;let{left:e,top:t,width:n,height:r}=p;if(0===e&&0===t&&0===n&&0===r)return;let i=tJ.EN.create(g,{value:s,language:"json",scrollBeyondLastLine:!1,theme:"dark"===x.palette.mode?"vs-dark":"vs-light"});i.layout({width:p.width,height:p.height});let o=i.onDidChangeModelDecorations(()=>{u(tJ.EN.getModelMarkers())});return i.focus(),d(i),()=>{o.dispose();let e=i.getModel();e&&e.dispose(),i.dispose()}},[g,p,s]),(0,r.jsxs)(tZ.A,{disableEscapeKeyDown:!0,open:n,scroll:"paper",maxWidth:"md",onClose:i,PaperProps:{style:{height:"80%",width:"80%"}},children:[(0,r.jsx)(tH.A,{children:"Modify object properties"}),(0,r.jsx)(t_.A,{dividers:!0,children:(0,r.jsx)("div",{ref:h,style:{overflow:"hidden",height:"100%"}})}),(0,r.jsxs)(tY.A,{children:[(0,r.jsx)(ej.A,{variant:"contained",onClick:i,children:"Cancel"}),(0,r.jsx)(ej.A,{variant:"contained",onClick:m,disabled:c.length>0,children:"Confirm"})]})]})}self.MonacoEnvironment={getWorker:(e,t)=>new Worker("json"===t?new URL(n.p+n.u("u"),n.b):new URL(n.p+n.u(7),n.b))};let tK=o.createContext({currentThemeName:null,activeViz:null,setActiveViz:()=>{},expandedObject:null,setExpandedObject:()=>{}}),tX=o.createContext();function t0(e){let{id:t,onLoad:n}=e,i=(0,o.useContext)(tX),s=(0,o.useRef)();return(0,o.useEffect)(()=>{let e=i.render({id:t,element:s.current});return e.then(e=>{n(e,s.current)}),()=>{e.then(e=>{e.destroy()})}},[t]),(0,r.jsx)("div",{ref:s,style:{height:"100%",backgroundColor:"white"}})}let t1="Cell",t2={secondaryIcon:`${t1}-secondaryIcon`,drop:`${t1}-drop`},t4=(0,th.A)(er.A)(e=>{let{theme:t}=e;return{[`& .${t2.secondaryIcon}`]:{color:t.palette.text.secondary},[`& .${t2.drop}`]:{boxShadow:t.shadows[1],borderRadius:`${t.shape.borderRadius}px`}}});function t5(e){let{id:t,expandable:n,minHeight:i}=e,s=(0,o.useContext)(eY),[a]=e3(),[l,d]=(0,o.useState)(null),[c,u]=(0,o.useState)(!1),[h,p]=(0,o.useState)(null),{currentThemeName:g,activeViz:x,setActiveViz:m,setExpandedObject:f,expandedObject:j}=(0,o.useContext)(tK),y=j===t,b=(0,o.useRef)();(0,o.useEffect)(()=>{let e=s.getObject(t).then(e=>(d(e),a.set(`${t}`,e),e));return()=>{e.then(e=>e.emit("close"))}},[t]);let[A,M]=(0,o.useState)(!1),v=(0,o.useCallback)(()=>{M(!1)},[]),w=(0,o.useCallback)((e,t)=>{b.current={viz:e,el:t},p(e)},[t]),C=(0,o.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(b.current)if(e)u(!0),b.current.viz.__DO_NOT_USE__.exportImage().then(e=>{e&&e.url&&window.open(e.url),u(!1)});else{let e=b.current.el.getBoundingClientRect();b.current.viz.__DO_NOT_USE__.takeSnapshot().then(t=>{fetch("/njs/snapshot",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),window.open(`/render?snapshot=${t.key}`,"snapshot",`height=${Math.round(e.height)},width=${Math.round(e.width)}`)})}},[l,g]),D=!y&&b.current&&x&&x===b.current.viz?{boxShadow:"0px 0px 4px 2px rgba(0,100,200,0.85)"}:{};return(0,r.jsxs)(t4,{container:!0,direction:"column",style:{minHeight:i,height:"100%",position:"relative"},children:[(0,r.jsx)(er.A,{item:!0,children:(0,r.jsxs)(eN.A,{variant:"dense",disableGutters:!0,style:{padding:"0 0px",opacity:1},children:[(0,r.jsx)(tG,{model:l,show:A,close:v}),(0,r.jsx)(en.A,{title:"Modify object properties",className:t2.secondaryIcon,disabled:!l,onClick:()=>M(!0),size:"large",children:el({size:"medium",viewBox:"0 0 16 16",shapes:[{type:"path",attrs:{d:"M14,8 C14,8.2 14,8.4 14,8.6 L16,9.6 L15.4,11.4 L13.2,11 C13,11.3 12.8,11.7 12.5,12 L13.6,14 L12,15 L10.4,13.4 C10,13.5 9.7,13.7 9.3,13.8 L9,16 L7,16 L6.7,13.8 C6.3,13.7 5.9,13.6 5.6,13.4 L4,15 L2.4,13.9 L3.5,11.9 C3.2,11.6 3,11.3 2.8,10.9 L0.6,11.3 L0,9.6 L2,8.6 C2,8.4 2,8.2 2,8 C2,7.8 2,7.6 2,7.4 L0,6.4 L0.6,4.6 L2.8,5 C3,4.7 3.2,4.3 3.5,4 L2.4,2 L4,1 L5.6,2.6 C6,2.4 6.3,2.3 6.7,2.2 L7,0 L9,0 L9.3,2.2 C9.7,2.3 10.1,2.4 10.4,2.6 L12,1 L13.6,2.1 L12.5,4.1 C12.8,4.4 13,4.7 13.2,5.1 L15.4,4.7 L16,6.4 L14,7.4 C14,7.6 14,7.8 14,8 Z M8,11 C9.7,11 11,9.7 11,8 C11,6.3 9.7,5 8,5 C6.3,5 5,6.3 5,8 C5,9.7 6.3,11 8,11 Z"}}]})}),(0,r.jsx)(en.A,{title:"Open in single render view",className:t2.secondaryIcon,disabled:!l,href:l?`${document.location.href.replace(/\/dev\//,"/render/")}${window.location.search?"&":"?"}object=${l.id}&theme=${g}&language=en-US`:"",target:"_blank",size:"large",children:el({size:"medium",viewBox:"0 0 24 24",shapes:[{type:"path",attrs:{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"}}]})}),(0,r.jsx)(en.A,{title:"Take and render as snapshot",className:t2.secondaryIcon,disabled:!l,onClick:()=>C(),size:"large",children:el({size:"medium",viewBox:"0 0 24 24",shapes:[{type:"path",attrs:{d:"M9 2L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2H9zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z"}}]})}),c?(0,r.jsx)(ew.A,{size:24}):(0,r.jsx)(en.A,{title:"Export as image",className:t2.secondaryIcon,disabled:!l,onClick:()=>C(!0),size:"large",children:el({size:"medium",viewBox:"0 0 24 24",shapes:[{type:"path",attrs:{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"}}]})}),(0,r.jsx)(er.A,{sx:{flex:1}}),n&&(0,r.jsx)(en.A,{title:"Edit",className:t2.secondaryIcon,disabled:!h||x===h,onClick:()=>m(h),size:"large",children:el({size:"medium",viewBox:"0 0 24 24",shapes:[{type:"path",attrs:{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}}]})}),n&&(0,r.jsx)(en.A,{title:"Expand",disabled:!l||!h,className:t2.secondaryIcon,onClick:()=>void(y?f(null):(f(t),m(h))),size:"large",children:el({size:"medium",viewBox:"0 0 24 24",shapes:[{type:"path",attrs:{d:y?"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z":"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"}}]})})]})}),(0,r.jsx)(er.A,{item:!0,xs:!0,style:{...D,flex:1,minHeight:0},className:t2.drop,children:(0,r.jsx)(t0,{id:t,onLoad:w})})]})}function t3(e){let{info:t,storage:n,uid:i}=e,s=(0,o.useContext)(tX),{activeViz:a,setActiveViz:l}=(0,o.useContext)(tK),[d]=e_(a?.model);return((0,o.useEffect)(()=>{if(!i)return;let e=s.render({type:t.supernova.name,properties:{...!1!==n.get("readFromCache")?n.props(t.supernova.name):{},qInfo:{qId:i,qType:t.supernova.name}}});return e.then(e=>{l(e)}),()=>{e.then(e=>e.destroy())}},[i]),(0,o.useEffect)(()=>{d&&n.props(t.supernova.name,d)},[d]),a&&a.id===i)?(0,r.jsx)(er.A,{item:!0,container:!0,justifyContent:"center",style:{height:"100%"},children:(0,r.jsx)(er.A,{item:!0,xs:!0,style:{flex:1,minWidth:0},children:(0,r.jsx)(t5,{id:i})})}):null}function t6(e){let{types:t,cache:n}=e,i=(0,o.useContext)(eY),[s]=e9(i,"getAppLayout"),[a,l]=(0,o.useState)(null),{expandedObject:d}=(0,o.useContext)(tK);if((0,o.useEffect)(()=>{i.getObjects({qTypes:t,qData:{title:"/qMetaDef/title"}}).then(e=>{l(e.slice(0,20))})},[s,t.join(":")]),!a)return null;let c=d?a.filter(e=>e.qInfo.qId===d):a;return(0,r.jsx)(er.A,{container:!0,justifyContent:"center",gap:2*!d,style:{height:d?"100%":void 0},children:c[0]?c.map(e=>(0,r.jsx)(er.A,{item:!0,xs:12,md:d?12:6,lg:d?12:4,children:(0,r.jsx)(t5,{id:e.qInfo.qId,expandable:!0,minHeight:600})},`${e.qInfo.qId}::${n}`)):(0,r.jsx)(er.A,{item:!0,children:(0,r.jsxs)("div",{children:[(0,r.jsx)(ei.A,{display:"inline",children:"Could not find any components with "}),(0,r.jsx)(ei.A,{display:"inline",children:(0,r.jsx)("code",{children:`qType: "${t[0]}"`})}),(0,r.jsx)(ei.A,{display:"inline",children:" in the current app"})]})})})}let t8=["en-US","it-IT","zh-CN","zh-TW","ko-KR","de-DE","sv-SE","es-ES","pt-BR","ja-JP","fr-FR","nl-NL","tr-TR","pl-PL","ru-RU"],t9=["select","active","passive"];function t7(e){return{select:-1!==e.indexOf("select"),active:-1!==e.indexOf("active"),passive:-1!==e.indexOf("passive"),edit:-1!==e.indexOf("edit")}}function ne(){let e=(0,o.useRef)(),t=(0,u.Zp)(),{info:n}=C(),{waiting:i,app:s}=(e=>{let{info:t}=e,[n,r]=(0,o.useState)(null),[i,s]=(0,o.useState)(!0);(0,o.useEffect)(()=>{s(!0),t&&a().then(e=>r(e)).catch(e=>console.log(e)).finally(()=>s(!1))},[t]);let a=async()=>{try{let{clientId:e,webIntegrationId:n,engine:r=null,engine:{host:i}={}}=t,o=t?.engine?.appId;if(!o)throw Error("Missing appId in connection info");if(n)return(0,f.qs)({appId:o,hostConfig:{authType:"cookie",webIntegrationId:n,host:i}}).getDoc();if(e)return(0,f.qs)({appId:o,hostConfig:{authType:"oauth2",clientId:e,host:i,redirectUri:`${window.location.origin}/auth/login/callback`,accessTokenStorage:"session"}}).getDoc();let s=!1!==r.secure?"https":"http",a=`${s}://${r.host}${r.port?`:${r.port}`:""}`;return(0,f.qs)({appId:o,hostConfig:{authType:"noauth",host:a}}).getDoc()}catch(e){throw Error("Failed to open app!",{cause:e})}};return{waiting:i,app:n,setApp:r}})({info:n}),a=(0,o.useMemo)(()=>q(s),[s]),[l,d]=(0,o.useState)(null),[c,h]=(0,o.useState)(null),[p,g]=(0,o.useState)(null),[x,m]=(0,o.useState)(a.get("themeName")),[j,y]=(0,o.useState)(a.get("language")||"en-US"),[b,A]=(0,o.useState)("light"),[M,v]=(0,o.useState)(t9),[w,D]=(0,o.useState)(!0===a.get("objectListMode")),I=(0,o.useRef)(null),[S,k]=(0,o.useState)(),[L,E]=o.useState(null),[T,z]=o.useState(null),[R,$]=(0,o.useState)(!1),[B,P]=(0,o.useState)(null),W=Array.isArray(n?.themes)&&n.themes.length?["light","dark",...n.themes]:[],[F,Q]=(0,o.useState)(),U=(0,o.useMemo)(()=>V(b),[b]),Z=(0,o.useMemo)(()=>({currentThemeName:x,activeViz:l,setActiveViz:d,expandedObject:c,setExpandedObject:h}),[l,c,x]);(0,o.useEffect)(()=>{(async()=>{if(n){let e;await (e=()=>{eV(n.supernova.name,n.supernova.url||n.supernova.module).then(e=>{var t;window[n.supernova.name]=e,eQ[t=n.supernova.name]&&eQ[t].forEach(e=>e())})},(n.sock.port&&(new WebSocket(`ws://localhost:${n.sock.port}`).onmessage=()=>{e()}),e(),n.types)?Promise.all(n.types.map(e=>eV(e.name,e.url).then(t=>{window[e.name]=t}))):Promise.resolve()),$(!0)}})()},[n]),(0,o.useEffect)(()=>{if(i||!R)return;let e=(0,eD.embed)(s,{hostConfig:n?.engine?(e=>{let{clientId:t,webIntegrationId:n,engine:{host:r,port:i,secure:o}}=e;return n?{authType:"cookie",webIntegrationId:n,host:r}:t?{authType:"oauth2",clientId:t,host:r,redirectUri:`${window.location.origin}/auth/login/callback`,accessTokenStorage:"session"}:{authType:"noauth",host:`${!1!==o?"https":"http"}://${r}${i?`:${i}`:""}`}})(n):void 0,context:{theme:x,language:j,interactions:t7(M),keyboardNavigation:n?.keyboardNavigation},load:e=>Promise.resolve(window[e.name]),flags:n?.flags,themes:n?.themes?n?.themes.map(e=>({id:e,load:()=>fetch(`/theme/${e}`).then(e=>e.json()).then(e=>(A("dark"===e.type?"dark":"light"),e))})):null});e.__DO_NOT_USE__.types.register(n?.supernova),n?.types&&n?.types.forEach(t=>{e.__DO_NOT_USE__.types.register(t)}),P(e)},[s,n,i,R]),(0,o.useLayoutEffect)(()=>{B&&(B.context({theme:x}),("light"===x||"dark"===x)&&A(x))},[B,x]);let H=()=>{window[n?.supernova.name]&&(e.current=String(Date.now()),k(e.current))};return(0,o.useEffect)(()=>{B&&(B.selections().then(e=>e.mount(I.current)),window.onHotChange(n?.supernova.name,()=>{B.__DO_NOT_USE__.types.clearFromCache(n?.supernova.name),B.__DO_NOT_USE__.types.register(n?.supernova),H(),B.__DO_NOT_USE__.types.get({name:n?.supernova.name}).supernova().then(g)}),H())},[B,n]),(0,o.useEffect)(()=>{let t=()=>{s&&s.destroySessionObject(e.current)};return window.addEventListener("beforeunload",t),s&&Q({modelStore:function(e){let[t,n]=eT({}),[r,i]=eT({}),[o,s]=eT({}),[a,l]=eT({}),[d,c]=eT({}),[,u]=eT({}),h=e=>{let{type:t,value:r}=e,o=u.get(r.id);u.set(r.id,{});let a=()=>{i.clear(r.id),c.set(r.id,{}),c.dispatch(!0)},d=()=>{r.removeListener("closed",d),r.removeListener("changed",a),n.clear(r.id),i.clear(r.id),s.clear(r.id),l.clear(r.id),c.clear(r.id),u.clear(r.id)};return"SET"===t&&(o||(r.on("changed",a),r.once("closed",d))),d},[p,g]=eT({},h);return{subscribe:e=>{let t=h({type:"SET",value:e});return()=>{t(),g.clear(e.id)}},destroy:()=>{g.destroy()},useModelStore:p,modelStore:g,useModelChangedStore:d,useRpcResultStore:t,rpcResultStore:n,useRpcRequestStore:r,rpcRequestStore:i,useRpcRequestModelStore:a,rpcRequestModelStore:l,useRpcRequestSessionModelStore:o,rpcRequestSessionModelStore:s,modelChangedStore:c,appId:e}}(s.id),selectionStore:function(e){let[t,n]=eT({}),[r,i]=eT({}),[o,s]=eT({});return{useAppSelectionsStore:t,useAppModalStore:r,appSelectionsStore:n,appModalStore:i,useModalObjectStore:o,modalObjectStore:s,appId:e}}(s.id),myKey:"this is the key here"}),()=>{window.removeEventListener("beforeunload",t)}},[s]),(0,r.jsx)(eE.Provider,{value:F,children:(0,r.jsx)(eY.Provider,{value:s,children:(0,r.jsx)(O.A,{injectFirst:!0,children:(0,r.jsx)(N.A,{theme:U,children:(0,r.jsx)(tX.Provider,{value:B,children:(0,r.jsxs)(er.A,{container:!0,wrap:"nowrap",direction:"column",style:{background:U.palette.background.darkest,height:"100%"},gap:0,children:[(0,r.jsx)(er.A,{item:!0,children:(0,r.jsx)(eN.A,{variant:"dense",style:{background:U.palette.background.paper,boxShadow:U.shadows[1],width:"calc(100% - 48px)"},children:(0,r.jsxs)(er.A,{container:!0,gap:1,style:{width:"100%"},children:[(0,r.jsx)(er.A,{item:!0,container:!0,alignItems:"center",children:(0,r.jsx)(er.A,{item:!0,children:(0,r.jsx)("a",{href:"https://github.com/qlik-oss/nebula.js",target:"_blank",rel:"noopener noreferrer",children:(0,r.jsx)("img",{src:"/assets/logo.svg",alt:"nebula.js logo",href:"https://github.com/qlik-oss/nebula.js",style:{height:"24px",position:"relative",top:"2px"}})})})}),(0,r.jsx)(er.A,{item:!0,container:!0,alignItems:"center",children:(0,r.jsx)(en.A,{title:"Home",onClick:()=>t("/"),size:"large",children:(0,r.jsx)(eq.A,{style:{verticalAlign:"middle"}})})}),(0,r.jsx)(er.A,{children:(0,r.jsxs)(ex.A,{value:+!!w,onChange:(e,t)=>{let n=1===t;a.save("objectListMode",n),n&&(d(null),h(null)),D(n)},"aria-label":"Navigation",children:[(0,r.jsx)(em.A,{label:(0,r.jsx)(ei.A,{children:"Create"}),value:0}),(0,r.jsx)(em.A,{label:(0,r.jsx)(ei.A,{children:"Edit"}),value:1})]})}),(0,r.jsxs)(er.A,{item:!0,container:!0,alignItems:"center",offset:{md:"auto"},children:[(0,r.jsx)(er.A,{item:!0,gap:1,children:(0,r.jsx)(ei.A,{children:"State:"})}),(0,r.jsx)(er.A,{item:!0,gap:2,children:(0,r.jsxs)(eO.A,{size:"small",value:M,onChange:(e,t)=>{v(t),B&&B.context({interactions:t7(t)})},color:"primary",children:[(0,r.jsx)(ez.A,{value:"select",children:"Select"}),(0,r.jsx)(ez.A,{value:"active",children:"Active"}),(0,r.jsx)(ez.A,{value:"passive",children:"Passive"}),(0,r.jsx)(ez.A,{value:"edit",children:"Edit"})]})}),(0,r.jsx)(er.A,{item:!0,children:W.length?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(en.A,{title:"Select theme",onClick:e=>E(e.currentTarget),size:"large",children:(0,r.jsx)(eI.A,{fontSize:"small"})}),(0,r.jsx)(eR.A,{anchorEl:L,open:!!L,keepMounted:!0,onClose:()=>E(null),children:W.map(e=>(0,r.jsx)(e$.A,{selected:e===x,onClick:()=>{E(null),a.save("themeName",e),m(e)},children:e},e))})]}):(0,r.jsx)(en.A,{title:"Toggle light/dark mode",onClick:()=>{let e="dark"===x?"light":"dark";a.save("themeName",e),m(e),A(e)},size:"large",children:"dark"===x?(0,r.jsx)(eS.A,{fontSize:"small"}):(0,r.jsx)(ek.A,{fontSize:"small"})})}),(0,r.jsxs)(er.A,{item:!0,children:[(0,r.jsx)(ej.A,{startIcon:(0,r.jsx)(eL.A,{}),title:"Select language",onClick:e=>z(e.currentTarget),children:j}),(0,r.jsx)(eR.A,{anchorEl:T,open:!!T,keepMounted:!0,onClose:()=>z(null),children:t8.map(e=>(0,r.jsx)(e$.A,{selected:e===j,onClick:()=>{z(null),a.save("language",e),y(e),B&&B.context({language:e})},children:e},e))})]})]})]})})}),(0,r.jsx)(er.A,{item:!0,style:{padding:U.spacing(1,1,0,1)},children:(0,r.jsx)("div",{ref:I,style:{flex:"0 0 auto",boxShadow:U.shadows[1]}})}),(0,r.jsx)(er.A,{item:!0,xs:!0,style:{flex:1,minHeight:0,overflowX:"hidden",overflowY:"auto",padding:U.spacing(0,1,1,1)},children:(0,r.jsx)(tK.Provider,{value:Z,children:p?(0,r.jsxs)(er.A,{container:!0,wrap:"nowrap",style:{height:"100%"},gap:1,children:[(0,r.jsx)(er.A,{item:!0,xs:!0,style:{flex:1,minWidth:0},children:w?(0,r.jsx)(t6,{cache:S,types:[n?.supernova.name]}):(0,r.jsx)(t3,{info:n,storage:a,uid:S})}),l&&(0,r.jsx)(er.A,{item:!0,style:{background:U.palette.background.paper,overflow:"hidden auto",marginTop:48,boxShadow:U.shadows[1],padding:0},children:(0,r.jsx)(tU,{sn:p,viz:l,isTemp:!w,storage:a,flags:n?.flags})})]}):(0,r.jsx)(er.A,{container:!0,wrap:"nowrap",style:{paddingTop:"48px"},justifyContent:"center",children:(0,r.jsx)(er.A,{item:!0,children:(0,r.jsx)(ew.A,{})})})})})]})})})})})})}var nt=()=>(0,r.jsx)(Q,{children:(0,r.jsxs)(Y,{marginTop:5,children:[(0,r.jsx)(ei.A,{variant:"h4",gutterBottom:!0,children:"Error!"}),(0,r.jsx)(ei.A,{variant:"subtitle1",gutterBottom:!0,children:"OAUTH REDIRECT LINK ERROR!"}),(0,r.jsxs)(ei.A,{variant:"body2",paragraph:!0,children:["We updated our route which was previously had the responsibility to handle the redirected link including the correct credentials to have"," ",(0,r.jsx)("code",{children:(0,r.jsx)("b",{children:"/auth/"})})," ","part within it. This change is now impacting your redirect links if you already using your old client-id."]}),(0,r.jsx)(ei.A,{variant:"h6",gutterBottom:!0,children:"Here is what you need to do:"}),(0,r.jsxs)(ei.A,{variant:"body2",paragraph:!0,children:[(0,r.jsx)("b",{children:"1."})," Go to your tenant that you created your client id",(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),(0,r.jsx)("b",{children:"2."})," Open Managment console",(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),(0,r.jsx)("b",{children:"3."})," Click on OAuth menu in left panel (if you dont see that menu it means you dont have access to it and you need to ask a person who has the proper access)",(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),(0,r.jsx)("b",{children:"4."})," Find your Client id and from ... menu, click on edit",(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),(0,r.jsx)("b",{children:"5."}),' There is a section called "Add redirect URLs", find it and add your new link. The only difference is that your new link will include `/auth/` part in it, for example, if you had this redirect link previously:',(0,r.jsx)("code",{children:"http://localhost:8000/login/callback"}),(0,r.jsx)("br",{}),"now it will be like:",(0,r.jsxs)("code",{children:["http://localhost:8000/",(0,r.jsx)("b",{children:"auth/"}),"login/callback"]}),(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),(0,r.jsx)("b",{children:"6."})," Click on save and you are set!",(0,r.jsx)("br",{})]})]})});a.createRoot(document.querySelector("#app")).render((0,r.jsx)(()=>(0,r.jsx)(d.Kd,{children:(0,r.jsx)(k,{children:(0,r.jsxs)(c.BV,{children:[(0,r.jsxs)(c.qh,{element:(0,r.jsx)(ee,{}),children:[(0,r.jsx)(c.qh,{path:"/",element:(0,r.jsx)(ev,{})}),(0,r.jsx)(c.qh,{path:"/app-list",element:(0,r.jsx)(eC,{})})]}),(0,r.jsx)(c.qh,{path:"/dev",element:(0,r.jsx)(ne,{})}),(0,r.jsx)(c.qh,{path:"/login/callback",element:(0,r.jsx)(nt,{})})]})})}),{}))}},l={};function d(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={id:e,exports:{}};return a[e].call(n.exports,n,n.exports,d),n.exports}d.m=a,d.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return d.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,d.t=function(n,r){if(1&r&&(n=this(n)),8&r||"object"==typeof n&&n&&(4&r&&n.__esModule||16&r&&"function"==typeof n.then))return n;var i=Object.create(null);d.r(i);var o={};e=e||[null,t({}),t([]),t(t)];for(var s=2&r&&n;("object"==typeof s||"function"==typeof s)&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach(e=>{o[e]=()=>n[e]});return o.default=()=>n,d.d(i,o),i},d.d=(e,t,n)=>{var r=(t,n)=>{for(var r in t)d.o(t,r)&&!d.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,[n]:t[r]})};r(t,"get"),r(n,"value")},d.f={},d.e=e=>Promise.all(Object.keys(d.f).reduce((t,n)=>(d.f[n](e,t),t),[])),d.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),d.u=e=>"async/"+e+".js",d.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})(),d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},d.l=function(e,t,r,i){if(n[e])return void n[e].push(t);if(void 0!==r)for(var o,s,a=document.getElementsByTagName("script"),l=0;l<a.length;l++){var c=a[l];if(c.getAttribute("src")==e){o=c;break}}o||(s=!0,(o=document.createElement("script")).timeout=120,d.nc&&o.setAttribute("nonce",d.nc),o.src=e),n[e]=[t];var u=function(t,r){o.onerror=o.onload=null,clearTimeout(h);var i=n[e];if(delete n[e],o.parentNode&&o.parentNode.removeChild(o),i&&i.forEach(function(e){return e(r)}),t)return t(r)},h=setTimeout(u.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=u.bind(null,o.onerror),o.onload=u.bind(null,o.onload),s&&document.head.appendChild(o)},d.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),d.nc=void 0,r=[],d.O=(e,t,n,i)=>{if(t){i=i||0;for(var o=r.length;o>0&&r[o-1][2]>i;o--)r[o]=r[o-1];r[o]=[t,n,i];return}for(var s=1/0,o=0;o<r.length;o++){for(var[t,n,i]=r[o],a=!0,l=0;l<t.length;l++)(!1&i||s>=i)&&Object.keys(d.O).every(e=>d.O[e](t[l]))?t.splice(l--,1):(a=!1,i<s&&(s=i));if(a){r.splice(o--,1);var c=n();void 0!==c&&(e=c)}}return e},d.p="/",d.b=document.baseURI||self.location.href,i={qz:0},d.f.j=function(e,t){var n=d.o(i,e)?i[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise((t,r)=>n=i[e]=[t,r]);t.push(n[2]=r);var o=d.p+d.u(e),s=Error();d.l(o,function(t){if(d.o(i,e)&&(0!==(n=i[e])&&(i[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;s.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",s.name="ChunkLoadError",s.type=r,s.request=o,n[1](s)}},"chunk-"+e,e)}},d.O.j=e=>0===i[e],o=(e,t)=>{var n,r,[o,s,a]=t,l=0;if(o.some(e=>0!==i[e])){for(n in s)d.o(s,n)&&(d.m[n]=s[n]);if(a)var c=a(d)}for(e&&e(t);l<o.length;l++)r=o[l],d.o(i,r)&&i[r]&&i[r][0](),i[r]=0;return d.O(c)},(s=self.rspackChunk=self.rspackChunk||[]).forEach(o.bind(null,0)),s.push=o.bind(null,s.push.bind(s));var c=d.O(void 0,["5","g","zt","q"],()=>d("Q"));c=d.O(c)})();
|
|
2
2
|
//# sourceMappingURL=index.js.map
|