"use strict";(self.webpackChunk_aidoop_aidoop_r=self.webpackChunk_aidoop_aidoop_r||[]).push([[820],{20820:(e,t,a)=>{a.r(t);a(35220);var s=a(16682),o=a(94430),i=a(37077),r=a(10979),d=a(15494),n=a(80692),c=a(71277),h=a(62826),l=a(16134);const u="home dashboard",b=(0,c.s2)()?[l.Pq,l.h1,l.s3]:[l.h1,l.s3],g=(0,c.s2)()?l.Pq:l.h1;class p extends r.KB{stateChanged(e){super.stateChanged(e);const t=e?.boardSetting,a=t&&t[b.find((e=>t[e]))];this._boardId=a?.value}get oopsNote(){return{icon:"insert_chart",title:"HOME DASHBOARD",description:"There are no home dashboard setting. Pls, click to setting home dashboard.",click:e=>this.onClickDashboardSetting(g,u)}}get context(){return{title:u}}onClickDashboardSetting(e,t){var a=(0,i.Mw)(o.dy`
        <ox-board-selector
          .creatable=${!0}
          .value=${this._boardId}
          @board-selected=${async s=>{var o=s.detail.board;await this.saveSettings({name:e,value:o.id,category:"board",description:t});var i=await(0,h.h0)([l.s3,l.h1,l.Pq]);n.h.dispatch({type:h.fm,settings:i.reduce(((e,t)=>(e[t.name]=t,e)),{})}),a.close(),this.requestUpdate()}}
        ></ox-board-selector>
      `,{backdrop:!0,size:"large",title:d.z.t("title.dashboard setting")})}async saveSettings({name:e,value:t,category:a,description:o}){e&&t&&await n.Lp.query({query:s.ZP`
      mutation {
        updateSetting(${c.Lg.buildArgs({name:e,patch:{name:e,description:o,category:a,value:t}})}) {
          name
          value
        }
      }`})}}customElements.define("dashboard-home",p)}}]);