(window.webpackJsonp=window.webpackJsonp||[]).push([[29],{1959:function(t,e,n){"use strict";n.d(e,"a",(function(){return j})),n.d(e,"b",(function(){return m})),n.d(e,"c",(function(){return p})),n.d(e,"d",(function(){return E}));n(41);var r,s=n(215),c=n(0);!function(t){t.LOADING="loading",t.COMPLETE="complete",t.ERROR="error"}(r||(r={}));const o={status:r.LOADING,result:null,error:null};function u(t,e){return Object(c.useMemo)(()=>t.status!==r.COMPLETE?t:{...t,result:e(t.result)},[t,e])}const a=t=>t.result;function l(t){return u(function(t){const[e,n]=Object(c.useState)(o),u=Object(c.useRef)(()=>{});return Object(c.useEffect)(()=>{n(o),u.current();let e=!1;return u.current=()=>{e=!0},Object(s.a)({method:"GET",endpoint:t})({}).then(t=>{e||n({status:r.COMPLETE,result:t,error:null})}).catch(t=>{e||n({status:r.ERROR,result:null,error:t})}),()=>{e=!0}},[t]),e}(t),a)}var i=n(11),d=n.n(i),b=n(111);function f({owners:t}){return t?d()(t).call(t,t=>`${t.first_name} ${t.last_name}`):null}const O=n.n(b).a.encode({columns:["owners.first_name","owners.last_name"],keys:["none"]});function j(t){return u(l(`/api/v1/chart/${t}?q=${O}`),f)}const m=t=>u(l(`/api/v1/dashboard/${t}`),t=>({...t,metadata:t.json_metadata&&JSON.parse(t.json_metadata),position_data:t.position_json&&JSON.parse(t.position_json)})),p=t=>l(`/api/v1/dashboard/${t}/charts`),E=t=>l(`/api/v1/dashboard/${t}/datasets`)},4823:function(t,e,n){"use strict";function r(t){const e=document.head||document.getElementsByTagName("head")[0],n=document.querySelector(".CssEditor-css")||function(t){const e=document.createElement("style");return e.className=t,e.type="text/css",e}("CssEditor-css");return"styleSheet"in n?n.styleSheet.cssText=t:n.innerHTML=t,e.appendChild(n),function(){n.remove()}}n.d(e,"a",(function(){return r}))},5042:function(t,e,n){"use strict";n.r(e);var r=n(0),s=n.n(r),c=n(13),o=n(91),u=n(365),a=n(142),l=n(171),i=n(1959),d=n(219),b=n(525),f=n(4823),O=n(1);const j=s.a.lazy(()=>Promise.all([n.e(0),n.e(14),n.e(27)]).then(n.bind(null,4989)));e.default=()=>{const t=Object(o.c)(),{addDangerToast:e}=Object(a.b)(),{idOrSlug:n}=Object(u.g)(),{result:s,error:m}=Object(i.b)(n),{result:p,error:E}=Object(i.c)(n),{result:h,error:w}=Object(i.d)(n),y=m||E,_=Boolean(s&&p),{dashboard_title:v,css:T}=s||{};if(Object(r.useEffect)(()=>{_&&t(Object(d.b)(s,p))},[_]),Object(r.useEffect)(()=>{v&&(document.title=v)},[v]),Object(r.useEffect)(()=>T?Object(f.a)(T):()=>{},[T]),Object(r.useEffect)(()=>{w?e(Object(c.e)("Error loading chart datasources. Filters may not work correctly.")):t(Object(b.c)(h))},[e,h,w,t]),y)throw y;return _?Object(O.jsx)(j,null):Object(O.jsx)(l.a,null)}}}]);