!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx"));else if("function"==typeof define&&define.amd)define(["lit","lit/decorators.js","lit/directives/class-map.js","lit/directives/style-map.js","lit/directives/if-defined.js","@momentum-ui/icons/data/momentumUiIconsNames.json","@momentum-ui/utils/lib/getColorValue","mobx"],t);else{var i="object"==typeof exports?t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx")):t(e.lit,e["lit/decorators.js"],e["lit/directives/class-map.js"],e["lit/directives/style-map.js"],e["lit/directives/if-defined.js"],e["@momentum-ui/icons/data/momentumUiIconsNames.json"],e["@momentum-ui/utils/lib/getColorValue"],e.mobx);for(var r in i)("object"==typeof exports?exports:e)[r]=i[r]}}(self,(e,t,i,r,s,o,d,a)=>(()=>{"use strict";var n,m={7224(e,t,i){i.r(t),i.d(t,{CardAi:()=>s,CardAiVariant:()=>r}),i(5983),i(1821);var r,s,o=i(9609),d=i(4084),a=i(7161),n=i(429),m=i(5125),c=i(2927),l=function(e,t,i,r){var s,o=arguments.length,d=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)d=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(d=(o<3?s(d):o>3?s(t,i,d):s(t,i))||d);return o>3&&d&&Object.defineProperty(t,i,d),d};!function(e){e.USER_QUERY="user_query",e.RESPONSE="response"}(r||(r={})),function(e){let t=class extends a.LitElement{constructor(){super(...arguments),this.id="",this.title="",this.cardText="",this.timestamp="",this.summariseMoreVisible=!1,this.variant=r.RESPONSE,this.copyChecked=!1,this.thumbsUpChecked=!1,this.thumbsDownChecked=!1}static get styles(){return[d.A,c.A]}thumbsUpToggled(){this.thumbsDownChecked=!1,this.thumbsUpChecked=!this.thumbsUpChecked,this.dispatchEvent(new CustomEvent("thumbs-up-toggled",{detail:{id:this.id},bubbles:!0,composed:!0}))}thumbsDownToggled(){this.thumbsUpChecked=!1,this.thumbsDownChecked=!this.thumbsDownChecked,this.dispatchEvent(new CustomEvent("thumbs-down-toggled",{detail:{id:this.id},bubbles:!0,composed:!0}))}summariseMoreToggled(){this.dispatchEvent(new CustomEvent("summarise-more-toggled",{detail:{id:this.id},bubbles:!0,composed:!0}))}copyToggled(){navigator.clipboard.writeText(this.cardText),this.copyChecked=!0,setTimeout(()=>{this.copyChecked=!1},2e3)}get bottomBorderRadiusClass(){return this.timestamp?"with-bottom-border-radius":"no-bottom-border-radius"}get cardTextClassMap(){return{"md-card-ai-card-body-user-query":this.variant===r.USER_QUERY,[`md-card-ai-card-body-response-${this.bottomBorderRadiusClass}`]:this.variant===r.RESPONSE}}renderHeader(){return this.variant===r.RESPONSE&&""!==this.title?a.html`
          <div class="md-card-ai-header">
            <slot name="card-header-aside">
              <md-icon name="cisco-ai-assistant-color-gradient" iconSet="momentumBrandVisuals"></md-icon>
            </slot>
            <div class="md-card-ai-header-title">
              <slot name="card-header-title">
                <h3>${this.title}</h3>
              </slot>
            </div>
          </div>
        `:a.nothing}renderCardText(){return""!==this.cardText?a.html`
          <div class=${(0,m.classMap)(this.cardTextClassMap)}>
            <h3>${this.cardText}</h3>
            ${this.renderResponseCard()}
          </div>
        `:a.nothing}renderThumbsUpButton(){const e=this.thumbsUpChecked?"secondary":"ghost",t=this.thumbsUpChecked?"This is helpful, selected":"This is helpful";return a.html`
        <div class="md-card-ai-thumbs-up">
          <md-button
            circle
            variant=${e}
            size="28"
            ariaLabel=${t}
            @click=${this.thumbsUpToggled}
          >
            <md-icon slot="icon" name="like-regular" iconSet="momentumDesign"></md-icon>
          </md-button>
        </div>
      `}renderThumbsDownButton(){const e=this.thumbsDownChecked?"secondary":"ghost",t=this.thumbsDownChecked?"This is not helpful, selected":"This is not helpful";return a.html`
        <div>
          <md-button
            circle
            variant=${e}
            size="28"
            ariaLabel=${t}
            @click=${this.thumbsDownToggled}
          >
            <md-icon slot="icon" name="dislike-regular" iconSet="momentumDesign"></md-icon>
          </md-button>
        </div>
      `}renderCopyButton(){const e=this.copyChecked?"secondary":"ghost",t=this.copyChecked?"Copied, selected":"Copy summary";return a.html`
        <div class="md-card-ai-copy-button-container">
          <md-button
            size="32"
            variant=${e}
            ariaLabel=${t}
            outline
            @click=${this.copyToggled}
          >
            <md-icon
              slot="icon"
              name=${this.copyChecked?"check-regular":"copy-regular"}
              iconSet="momentumDesign"
            ></md-icon>
            <span slot="text">${this.copyChecked?"Copied":"Copy"}</span>
          </md-button>
        </div>
      `}renderResponseCard(){return this.variant===r.RESPONSE&&""!==this.timestamp?a.html`
          <div class="md-card-ai-divider"></div>
          <div class="md-card-ai-time-wrapper">
            <time class="md-card-ai-time" aria-hidden="true" datetime=${this.timestamp}> ${this.timestamp} </time>
            <span class="md-card-ai-dot-separator">&#8226;</span>
            <div class="md-card-ai-feedback">${this.renderThumbsUpButton()} ${this.renderThumbsDownButton()}</div>
            ${this.renderCopyButton()}
          </div>
        `:a.nothing}renderFooter(){return this.variant===r.RESPONSE&&this.summariseMoreVisible?a.html`
          <div class="md-card-ai-footer">
            <md-button size="32" variant="ghost" outline @click=${this.summariseMoreToggled}>
              <span slot="text">Summarise more</span>
            </md-button>
          </div>
        `:a.nothing}render(){return a.html`
        <div class="md-card-ai" id="${this.id}" part="card" tabindex="0">
          ${this.renderHeader()}
          <div class="content-margin">${this.renderCardText()} ${this.renderFooter()}</div>
        </div>
      `}};l([(0,n.property)({type:String})],t.prototype,"id",void 0),l([(0,n.property)({type:String})],t.prototype,"title",void 0),l([(0,n.property)({type:String})],t.prototype,"cardText",void 0),l([(0,n.property)({type:String})],t.prototype,"timestamp",void 0),l([(0,n.property)({type:Boolean})],t.prototype,"summariseMoreVisible",void 0),l([(0,n.property)({type:String})],t.prototype,"variant",void 0),l([(0,n.state)()],t.prototype,"copyChecked",void 0),l([(0,n.state)()],t.prototype,"thumbsUpChecked",void 0),l([(0,n.state)()],t.prototype,"thumbsDownChecked",void 0),t=l([(0,o.w)("md-card-ai")],t),e.ELEMENT=t}(s||(s={}))},2022(e){e.exports=o},554(e){e.exports=d},7161(t){t.exports=e},429(e){e.exports=t},5125(e){e.exports=i},291(e){e.exports=s},318(e){e.exports=r},5314(e){e.exports=a}},c={};function l(e){var t=c[e];if(void 0!==t)return t.exports;var i=c[e]={exports:{}};return m[e](i,i.exports,l),i.exports}l.m=m,n=[],l.O=(e,t,i,r)=>{if(!t){var s=1/0;for(m=0;m<n.length;m++){for(var[t,i,r]=n[m],o=!0,d=0;d<t.length;d++)(!1&r||s>=r)&&Object.keys(l.O).every(e=>l.O[e](t[d]))?t.splice(d--,1):(o=!1,r<s&&(s=r));if(o){n.splice(m--,1);var a=i();void 0!==a&&(e=a)}}return e}r=r||0;for(var m=n.length;m>0&&n[m-1][2]>r;m--)n[m]=n[m-1];n[m]=[t,i,r]},l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},l.d=(e,t)=>{for(var i in t)l.o(t,i)&&!l.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={4971:0};l.O.j=t=>0===e[t];var t=(t,i)=>{var r,s,[o,d,a]=i,n=0;if(o.some(t=>0!==e[t])){for(r in d)l.o(d,r)&&(l.m[r]=d[r]);if(a)var m=a(l)}for(t&&t(i);n<o.length;n++)s=o[n],l.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return l.O(m)},i=self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();var u=l.O(void 0,[9609,4084,3305,4739,7154,9773,5983,9488,1821,519,2927],()=>l(7224));return l.O(u)})());