1import{u as e,_ as t,R as a,j as l}from"#entry";import{y as o,k as s,Y as i,$ as m,aB as p,a0 as n,a2 as r,af as u,Q as d,aa as c,z as v,ax as _,aD as T,a9 as y,F as b,aE as h,ab as S,a3 as C,P as E,ag as g,b as I,r as A,D as O,q as w,w as R,T as f,a8 as L,aS as V,n as N,al as P}from"./BIBbM2GB.js";import{S as D,e as M,b as k,d as U,j as x,C as B,k as z,a as F,g as K,l as j,m as $,s as H,n as Y}from"./CRM6eZzB.js";import{_ as W}from"./BCo6x5W8.js";const G={class:"template-dialog__header"},X={class:"template-dialog__title"},q=["aria-label"],Q={class:"template-dialog__body"},J={class:"template-dialog__field"},Z={class:"template-dialog__label"},ee={class:"template-dialog__field"},te={class:"template-dialog__label-row"},ae={class:"template-dialog__label"},le={class:"template-dialog__count"},oe={class:"template-dialog__footer"},se=o({__name:"DetailSummaryCustomPromptDialog",props:{visible:{type:Boolean},isMobileViewport:{type:Boolean},mode:{},titleValue:{},promptValue:{},titleLimit:{},promptLimit:{},promptPlaceholder:{},canSave:{type:Boolean}},emits:["update:visible","update:titleValue","update:promptValue","save","cancel"],setup(a,{emit:l}){const o=a,b=l,{t:h}=e(),S=s(()=>"edit"===o.mode?h("components.detail.summaryTemplates.editCustomPromptTitle"):h("components.detail.summaryTemplates.addCustomPromptTitle")),C=s(()=>"edit"===o.mode?h("components.detail.actions.update"):h("components.detail.actions.save")),E=s(()=>o.promptValue.length),g=()=>{b("update:visible",!1),b("cancel")};return(e,l)=>{const o=t,s=_,I=T,A=p;return m(),i(A,{"model-value":a.visible,class:n(["detail-summary-template-dialog",{"element-mobile-full-dialog":a.isMobileViewport}]),width:"560px","z-index":2300,"append-to-body":"","show-close":!1,"onUpdate:modelValue":l[3]||(l[3]=e=>b("update:visible",e))},{header:r(()=>[u("div",G,[u("div",X,c(S.value),1),u("button",{type:"button",class:"template-dialog__close","aria-label":v(h)("components.detail.actions.closeDialog"),onClick:g},[d(o,{name:"bi:x-lg"})],8,q)])]),footer:r(()=>[u("div",oe,[d(I,{onClick:g},{default:r(()=>[y(c(v(h)("components.detail.actions.cancel")),1)]),_:1}),d(I,{type:"primary",disabled:!a.canSave,onClick:l[2]||(l[2]=e=>b("save"))},{default:r(()=>[y(c(C.value),1)]),_:1},8,["disabled"])])]),default:r(()=>[u("div",Q,[u("div",J,[u("div",Z,c(v(h)("components.detail.summaryTemplates.titleLabel")),1),d(s,{"model-value":a.titleValue,placeholder:v(h)("components.detail.summaryTemplates.titlePlaceholder"),maxlength:a.titleLimit,clearable:"","onUpdate:modelValue":l[0]||(l[0]=e=>b("update:titleValue",e))},null,8,["model-value","placeholder","maxlength"])]),u("div",ee,[u("div",te,[u("div",ae,c(v(h)("components.detail.summaryTemplates.promptLabel")),1),u("div",le,c(E.value)+"/"+c(a.promptLimit),1)]),d(s,{"model-value":a.promptValue,type:"textarea",rows:15,resize:"none",placeholder:a.promptPlaceholder,maxlength:a.promptLimit,"onUpdate:modelValue":l[1]||(l[1]=e=>b("update:promptValue",e))},null,8,["model-value","placeholder","maxlength"])])])]),_:1},8,["model-value","class"])}}}),ie=Object.assign(se,{__name:"DetailSummaryTemplatesDetailSummaryCustomPromptDialog"}),me=o({__name:"DetailSummaryAddPromptButton",emits:["click"],setup(a,{emit:l}){const o=l,{t:s}=e(),i=()=>{o("click")};return(e,a)=>{const l=t;return m(),b("button",{type:"button",class:"detail-summary-add-prompt-btn",onClick:i},[d(l,{name:"bi:plus-lg"}),u("span",null,c(v(s)("components.detail.summaryTemplates.addCustomPrompt")),1)])}}}),pe=Object.assign(W(me,[["__scopeId","data-v-882b695c"]]),{__name:"DetailSummaryTemplatesDetailSummaryAddPromptButton"}),ne=["onKeydown"],re={class:"template-popover__item-main"},ue={class:"template-popover__item-name"},de={class:"template-popover__item-desc"},ce={key:0,class:"template-popover__item-footer"},ve=["aria-label"],_e=["aria-label"],Te={key:0,class:"template-popover__item-actions"},ye=o({__name:"DetailSummaryTemplateItem",props:{item:{},selected:{type:Boolean},showCustomActions:{type:Boolean,default:!0}},emits:["select","edit","delete"],setup(a,{emit:l}){const o=a,s=l,{t:i}=e(),p=()=>{s("select",o.item.value)},r=e=>{e.stopPropagation(),s("edit",o.item.value)},_=e=>{e.stopPropagation(),s("delete",o.item.value)};return(e,l)=>{const o=t;return m(),b("div",{class:n(["template-popover__item",{"is-selected":a.selected}]),role:"button",tabindex:"0",onClick:p,onKeydown:h(S(p,["prevent"]),["enter"])},[u("div",re,[u("div",ue,c(a.item.name),1),u("div",de,c(a.item.desc),1),a.item.isCustom&&a.showCustomActions?(m(),b("div",ce,[u("button",{type:"button",class:"template-popover__item-footer-btn template-popover__item-footer-btn--edit","aria-label":v(i)("components.detail.summaryTemplates.editCustomPrompt"),onClick:r},[d(o,{name:"bi:pencil-square"}),y(" "+c(v(i)("components.detail.actions.edit")),1)],8,ve),u("button",{type:"button",class:"template-popover__item-footer-btn template-popover__item-footer-btn--danger","aria-label":v(i)("components.detail.summaryTemplates.deleteCustomPrompt"),onClick:_},[d(o,{name:"bi:trash3"}),y(" "+c(v(i)("components.detail.actions.delete")),1)],8,_e)])):C("",!0)]),a.selected?(m(),b("div",Te,[d(o,{name:"bi:check2-circle",class:"template-popover__item-check"})])):C("",!0)],42,ne)}}}),be=Object.assign(W(ye,[["__scopeId","data-v-73b276ed"]]),{__name:"DetailSummaryTemplatesDetailSummaryTemplateItem"}
1),he={class:"template-popover__list-content"},Se=o({__name:"DetailSummaryTemplateList",props:{items:{},selectedValue:{},showAddButton:{type:Boolean,default:!1},showCustomActions:{type:Boolean,default:!0}},emits:["add-custom","select","edit","delete"],setup(e,{emit:t}){const a=e,l=t;return(e,t)=>(m(),b("div",he,[a.showAddButton?(m(),i(pe,{key:0,onClick:t[0]||(t[0]=e=>l("add-custom"))})):C("",!0),(m(!0),b(E,null,g(a.items,e=>(m(),i(be,{key:e.value,item:e,selected:a.selectedValue===e.value,"show-custom-actions":a.showCustomActions,onSelect:t[1]||(t[1]=e=>l("select",e)),onEdit:t[2]||(t[2]=e=>l("edit",e)),onDelete:t[3]||(t[3]=e=>l("delete",e))},null,8,["item","selected","show-custom-actions"]))),128))]))}}),Ce=Object.assign(W(Se,[["__scopeId","data-v-c52ca7d8"]]),{__name:"DetailSummaryTemplatesDetailSummaryTemplateList"}),Ee={[D.TIMELINE]:"timeline",[D.SMART]:"smart",[D.VIRAL_CLIP_IDEAS]:"viralClipIdeas",[D.VIDEO_TO_BLOG]:"videoToBlog",[D.NOTE]:"note",[D.CORE]:"core",[D.BULLET]:"bullet",[D.TABLE]:"table",[D.CHAPTER]:"chapter",[D.VIDEO_TO_TWITTER_THREAD]:"videoToTwitterThread",[D.VIDEO_TO_LINKEDIN_POST]:"videoToLinkedinPost",[D.VIDEO_TO_NEWSLETTER]:"videoToNewsletter",[D.CONTENT_IDEAS]:"contentIdeas",[D.COURSE]:"course",[D.EXPLAIN_LIKE_12]:"explainLike12",[D.VOCABULARY_EXTRACTOR]:"vocabularyExtractor",[D.INDUSTRY]:"industry",[D.COMPETITOR_ANALYSIS]:"competitorAnalysis",[D.INVESTOR_BRIEF]:"investorBrief",[D.MEETING_MINUTES]:"meetingMinutes",[D.FINANCIAL]:"financial",[D.ANNUAL]:"annual",[D.LEGAL_DOCUMENT_SUMMARY]:"legalDocumentSummary",[D.CONTRACT_RISK_REVIEW]:"contractRiskReview",[D.CINEMATIC_PLOT_RECAP]:"cinematicPlotRecap",aiChat:"aiChatNote"},ge={[M.MOST_POPULAR]:"mostPopular",[M.QUICK_FORMATS]:"quickFormats",[M.CONTENT_REMIX]:"contentRemix",[M.STUDY_NOTES]:"studyNotes",[M.BUSINESS_RESEARCH]:"businessResearch",[M.CUSTOM]:"customPrompt"},Ie={"Chapter Summary":D.TIMELINE,"Smart Summary":D.SMART,"Viral Clip Ideas":D.VIRAL_CLIP_IDEAS,"Video to Blog":D.VIDEO_TO_BLOG,"Smart Notes":D.NOTE,"Key Insights":D.CORE,"Bullet Summary":D.BULLET,"Table Summary":D.TABLE,"Chapter Digest":D.CHAPTER,"Video to Twitter Thread":D.VIDEO_TO_TWITTER_THREAD,"Video to LinkedIn Post":D.VIDEO_TO_LINKEDIN_POST,"Video to Newsletter":D.VIDEO_TO_NEWSLETTER,"10 Content Ideas from Video":D.CONTENT_IDEAS,"Study Guide":D.COURSE,"Explain Like I'm 12":D.EXPLAIN_LIKE_12,"Vocabulary Extractor":D.VOCABULARY_EXTRACTOR,"Market Insight Summary":D.INDUSTRY,"Competitor Analysis":D.COMPETITOR_ANALYSIS,"Investor Brief":D.INVESTOR_BRIEF,"Meeting Minutes Summary":D.MEETING_MINUTES,"Financial Report Summary":D.FINANCIAL,"Annual Report Summary":D.ANNUAL,"Legal Document Summary":D.LEGAL_DOCUMENT_SUMMARY,"Contract Risk Review":D.CONTRACT_RISK_REVIEW,"Cinematic Plot Recap":D.CINEMATIC_PLOT_RECAP,"AI Chat Note":"aiChat",Summary:D.SMART},Ae=()=>{const{t:t}=e(),a=(e,a="")=>{const l=t(e);return l===e?a:l},l=(e,t)=>{const a=String(e||"").trim();return a||(Ie[String(t||"").trim()]||"")},o=(e,t="")=>{const o=l(e,t),s=Ee[o];return s?a(`components.detail.summaryTemplates.templates.${s}.name`,t):t},s=(e,t="")=>{const o=l(e),s=Ee[o];return s?a(`components.detail.summaryTemplates.templates.${s}.desc`,t):t};return{localizeCategory:e=>{const t=ge[e.value];return t?{...e,label:a(`components.detail.summaryTemplates.categories.${t}`,e.label)}:e},localizeTemplateInfo:e=>e.isCustom?e:{...e,name:o(e.value,e.name),desc:s(e.value,e.desc)},resolveTemplateName:o}},Oe={class:"detail-summary-template-popover"},we={class:"template-popover__header"},Re={class:"template-popover__title"},fe={class:"template-popover__desktop-body"},Le=["onClick"],Ve={class:"template-popover__category-label"},Ne={class:"template-popover__category-count"},Pe={class:"template-popover__panel"},De={class:"template-popover__panel-title"},Me={class:"template-popover template-popover--mobile"},ke={class:"template-popover__header"},Ue={class:"template-popover__title"},xe={class:"template-popover__mobile-menu yi-scrollbar"},Be=["onClick"],ze={class:"template-popover__mobile-category-main"}
1,Fe={class:"template-popover__mobile-category-label"},Ke={class:"template-popover__mobile-category-count"},je={class:"template-popover template-popover--mobile"},$e={class:"template-popover__header template-popover__header--with-back"},He=["aria-label"],Ye={class:"template-popover__title"},We={class:"template-popover__list template-popover__list--mobile yi-scrollbar"},Ge=o({__name:"DetailSummaryTemplatePopover",props:{tempValue:{},platform:{},availableTemplateValues:{},readonlySharedTemplates:{type:Boolean}},emits:["update:tempValue","templates-changed"],setup(o,{expose:p,emit:_}){const T=I(!1),y=I(!1),h=I(!1),S=I("create"),D=I(""),W=I(null),G=I(null),X=I(M.MOST_POPULAR),q=I("420px"),Q=I({}),J=I(a()),Z=I([]),ee=A({title:"",prompt:""}),{t:te}=e(),{localizeCategory:ae,localizeTemplateInfo:le}=Ae(),oe=s(()=>te("components.detail.summaryTemplates.customPromptPlaceholder")),se=o,me=_,pe=e=>e.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),ne=e=>({name:pe(e),value:e,desc:te("components.detail.summaryTemplates.generatedSummaryResult"),categories:[U(e)?M.CUSTOM:M.QUICK_FORMATS],isCustom:U(e)}),re=s(()=>{const e=k(se.readonlySharedTemplates?[]:Z.value,se.platform),t=Array.isArray(se.availableTemplateValues)?se.availableTemplateValues.map(e=>String(e||"").trim()).filter(Boolean):[];if(!t.length)return e.map(le);const a=new Map(e.map(e=>[e.value,e]));return t.map(e=>le(a.get(e)||ne(e)))}),ue=s(()=>(e=>{const t=String(e||"").trim()||re.value[0]?.value||F(se.platform),a=re.value.find(e=>e.value===t);if(a)return a;const l=K(t,Z.value,se.platform);return l.value===t?l:ne(t)})(se.tempValue)),de=s(()=>ae(x.find(e=>e.value===X.value)||x[0])),ce=e=>re.value.filter(t=>he(t,e)),ve=e=>ce(e).length,_e=s(()=>x.filter(e=>!se.readonlySharedTemplates||e.value!==M.CUSTOM||ve(e.value)>0).map(ae)),Te=s(()=>Boolean(ee.title.trim()&&ee.prompt.trim())),ye=()=>{se.readonlySharedTemplates?Z.value=[]:Z.value=j()},be=()=>{me("templates-changed")},he=(e,t)=>t===M.MOST_POPULAR?Boolean(e.isPopular):e.categories.includes(t),Se=s(()=>ce(X.value)),Ee=()=>{T.value=!1,y.value=!1},ge=()=>{ee.title="",ee.prompt="",D.value="",S.value="create"},Ie=()=>{var e;he(ue.value,X.value)||(X.value=(e=ue.value).categories[0]||(e.isPopular?M.MOST_POPULAR:M.QUICK_FORMATS)),_e.value.some(e=>e.value===X.value)||(X.value=_e.value[0]?.value||M.MOST_POPULAR)},Ge=()=>{J.value=a()},Xe=()=>{if(J.value||!T.value)return;const e=W.value;if(!e||!e.isConnected)return;const t=12,a=e.getBoundingClientRect(),l=Math.min(560,Math.max(360,window.innerWidth-24)),o=Math.min(640,window.innerHeight-24);q.value=`${Math.max(120,o-116)}px`;const s=window.innerWidth-l-t,i=a.right-l,m=Math.min(Math.max(i,12),s),p=a.bottom+10,n=window.innerHeight-t-o,r=Math.max(t,Math.min(p,n));Q.value={position:"fixed",top:`${r}px`,left:`${m}px`,width:`${l}px`,maxHeight:`${o}px`}},qe=()=>{N(()=>{Xe(),window.setTimeout(()=>Xe(),0)})},Qe=e=>{if(J.value||!T.value)return;const t=G.value,a=W.value,l=e.target;t?.contains(l)||a?.contains(l)||Ee()},Je=e=>{me("update:tempValue",e),Ee()},Ze=()=>{y.value=!1,T.value=!0},et=()=>{ge(),Ee(),h.value=!0},tt=e=>{const t=$(e);if(!t)return;const a=Z.value.find(e=>e.id===t);a&&(S.value="edit",D.value=a.id,ee.title=a.title,ee.prompt=a.prompt,Ee(),h.value=!0)},at=()=>{h.value=!1,ge()},lt=e=>{h.value=e,e||ge()},ot=()=>{const e=ee.title.trim().slice(0,z),t=ee.prompt.trim();if(!e||!t)return void P.warning(te("components.detail.summaryTemplates.titleAndPromptRequired"));if("edit"===S.value){const a=D.value;if(!a)return void P.warning(te("components.detail.summaryTemplates.templateNotFound"));let l=!1;const o=Z.value.map(o=>o.id!==a?o:(l=!0,{...o,title:e,prompt:t}));return l?(Z.value=o,H(o),be(),void at()):void P.warning(te("components.detail.summaryTemplates.templateNotFound"))}const a=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,l={id:a,title:e,prompt:t,createdAt:Date.now()};Z.value=[l,...Z.value],H(Z.value),be(),at(),X.value=M.CUSTOM,Je(Y(a))},st=e=>{if(!U(e))return;const t=$(e);if(!t)return;const a=Z.value.filter(e=>e.id!==t);Z.value=a,H(a),be(),se.tempValue===e&&me("update:tempValue",F(se.platform))};return O(()=>{Ge(),ye(),document.addEventListener("mousedown",Qe),window.addEventListener("resize",Ge),window.addEventListener("resize",Xe)}),w(()=>{document.removeEventListener("mousedown",Qe),window.removeEventListener("resize",Ge),window.removeEventListener("resize",Xe)}),R(()=>se.tempValue,()=>{(T.value||y.value)&&Ie()},{immediate:!0}),R(()=>T.value,e=>{e&&!J.value&&qe()}),R(()=>J.value,e=>
1{T.value&&!e&&qe()}),p({toggle:e=>{if(e&&(W.value=e),ye(),Ge(),Ie(),J.value)return T.value||y.value?void Ee():void(T.value=!0);T.value=!T.value,T.value&&(Xe(),qe())},close:Ee}),(e,a)=>{const s=t,p=V,_=l;return m(),b("div",Oe,[d(f,{name:"template-popover-fade"},{default:r(()=>[T.value&&!J.value?(m(),b("div",{key:0,ref_key:"popoverRef",ref:G,style:L(Q.value),class:"template-popover template-popover--desktop border border-gray-200 bg-white shadow-xl"},[u("div",we,[u("div",Re,c(v(te)("components.detail.summaryTemplates.chooseTitle")),1)]),u("div",fe,[u("div",{class:"template-popover__category-menu yi-scrollbar",style:L({maxHeight:q.value})},[(m(!0),b(E,null,g(_e.value,e=>(m(),b("button",{key:e.value,type:"button",class:n(["template-popover__category-item",{"is-active":X.value===e.value}]),onClick:t=>X.value=e.value},[u("span",Ve,c(e.label),1),u("span",Ne,c(ve(e.value)),1)],10,Le))),128))],4),u("div",Pe,[u("div",De,c(de.value.label),1),u("div",{class:"template-popover__list yi-scrollbar",style:L({maxHeight:q.value})},[d(Ce,{items:Se.value,"selected-value":ue.value.value,"show-add-button":!o.readonlySharedTemplates&&X.value===v(M).CUSTOM,"show-custom-actions":!o.readonlySharedTemplates,onAddCustom:et,onSelect:Je,onEdit:tt,onDelete:st},null,8,["items","selected-value","show-add-button","show-custom-actions"])],4)])])],4)):C("",!0)]),_:1}),d(_,null,{default:r(()=>[J.value?(m(),i(p,{key:0,modelValue:T.value,"onUpdate:modelValue":a[0]||(a[0]=e=>T.value=e),direction:"btt",size:"auto","with-header":!1,"show-close":!1,"z-index":2100,"append-to-body":"","destroy-on-close":"",class:"detail-summary-template-drawer"},{default:r(()=>[u("div",Me,[u("div",ke,[u("div",Ue,c(v(te)("components.detail.summaryTemplates.chooseTitle")),1)]),u("div",xe,[(m(!0),b(E,null,g(_e.value,e=>(m(),b("button",{key:e.value,type:"button",class:"template-popover__mobile-category-item",onClick:t=>(e=>{X.value=e,T.value=!1,y.value=!0})(e.value)},[u("div",ze,[u("div",Fe,c(e.label),1),u("div",Ke,c(v(te)("components.detail.summaryTemplates.templatesCount",{count:ve(e.value)})),1)]),d(s,{name:"bi:chevron-right"})],8,Be))),128))])])]),_:1},8,["modelValue"])):C("",!0),J.value?(m(),i(p,{key:1,modelValue:y.value,"onUpdate:modelValue":a[1]||(a[1]=e=>y.value=e),direction:"btt",size:"auto","with-header":!1,"show-close":!1,"z-index":2110,"append-to-body":"","destroy-on-close":"",class:"detail-summary-template-drawer"},{default:r(()=>[u("div",je,[u("div",$e,[u("button",{type:"button",class:"template-popover__back-btn","aria-label":v(te)("components.detail.summaryTemplates.backToCategories"),onClick:Ze},[d(s,{name:"bi:chevron-left"})],8,He),u("div",Ye,c(de.value.label),1)]),u("div",We,[d(Ce,{items:Se.value,"selected-value":ue.value.value,"show-add-button":!o.readonlySharedTemplates&&X.value===v(M).CUSTOM,"show-custom-actions":!o.readonlySharedTemplates,onAddCustom:et,onSelect:Je,onEdit:tt,onDelete:st},null,8,["items","selected-value","show-add-button","show-custom-actions"])])])]),_:1},8,["modelValue"])):C("",!0),d(ie,{visible:h.value,"is-mobile-viewport":J.value,mode:S.value,"title-value":ee.title,"prompt-value":ee.prompt,"title-limit":v(z),"prompt-limit":v(B),"prompt-placeholder":oe.value,"can-save":Te.value,"onUpdate:visible":lt,"onUpdate:titleValue":a[2]||(a[2]=e=>ee.title=e),"onUpdate:promptValue":a[3]||(a[3]=e=>ee.prompt=e),onSave:ot,onCancel:at},null,8,["visible","is-mobile-viewport","mode","title-value","prompt-value","title-limit","prompt-limit","prompt-placeholder","can-save"])]),_:1})])}}}),Xe=Object.assign(Ge,{__name:"DetailSummaryTemplatesDetailSummaryTemplatePopover"});export{Xe as D,Ce as a,ie as b,Ae as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.