1import{a as Xt,b as Ie}from"./chunk-2GSRSE4G.js";import{a as ut,c as be}from"./chunk-5PW3IXDN.js";import{c as Yt,d as Ce}from"./chunk-WMWTXPHF.js";import{a as Bt,c as fe}from"./chunk-P27FRGFY.js";import{a as Ht,b as xe}from"./chunk-LZ4XC2TM.js";import{A as zt,C as jt,c as Ut,k as Ft,l as qt,n as Kt,p as $t,q as Gt,v as Qt,w as Vt,x as Wt}from"./chunk-TT2QA5N2.js";import{a as F,b as _t}from"./chunk-6MOVM5NX.js";import{f as wt,h as Rt,m as Nt,n as ye}from"./chunk-REXD3XXG.js";import{d as Pt,e as Lt,j as he}from"./chunk-XZTRQ27X.js";import{b as kt,c as E,e as S,f as D}from"./chunk-OVGYRFXU.js";import{G as pt,M as Mt,o as St,s as Dt,z as At}from"./chunk-MZWCCPRN.js";import{A as yt,C as ft,Ca as ue,Cc as lt,Da as nt,Dc as dt,Ec as ct,F as Ct,G as it,Ia as K,Ic as Ot,L as bt,Lb as x,M as xt,Nb as f,Ob as C,Oc as r,P as _e,Pc as s,Qb as W,Qc as Et,Rb as v,Sb as T,Tb as I,U as It,Ub as g,Vb as p,Wb as w,Xb as m,Yb as d,Yc as X,Z as L,Zb as H,ab as Tt,bc as $,d as mt,da as B,ea as Y,fc as M,gb as n,gc as U,hc as y,i as gt,ja as vt,kb as ot,la as N,lb as at,lc as z,mc as G,nb as rt,nc as Q,pa as A,tc as R,td as P,ub as O,vc as st,wc as a,xc as u,yc as h}from"./chunk-JXIB5BED.js";import{e as q}from"./chunk-J6LPXIX4.js";var Jt,Zt=q(()=>{"use strict";P();Mt();_t();P();Jt=(()=>{class e{http=L(pt);api=F.apiUrl;base="/api/v1/dictionary";define(t){return this.http.post(`${this.api}${this.base}/define`,t)}getHistory(t){let o={};return t?.limit!=null&&(o.limit=String(t.limit)),this.http.get(`${this.api}${this.base}/history`,{params:o})}addFavorite(t){return this.http.post(`${this.api}${this.base}/favorites/${encodeURIComponent(t)}`,null)}toggleFavorite(t,o){return o?this.removeFavorite(t):this.addFavorite(t)}removeFavorite(t){return this.http.delete(`${this.api}${this.base}/favorites/${encodeURIComponent(t)}`)}sendFeedback(t){return this.http.post(`${this.api}${this.base}/feedback`,t)}translate(t){return this.http.post(`${this.api}${this.base}/translate`,t)}history(t=50){return this.http.get(`${this.api}${this.base}/history`,{params:{limit:t}})}static \u0275fac=function(o){return new(o||e)};static \u0275prov=It({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})()});function Te(e,l){if(e&1){let t=$();g(0,"button",16),M("mouseenter",function(){let i=B(t).$index,c=y(2);return Y(c.activeIndex=i)})("mousedown",function(){let i=B(t).$implicit,c=y(2);return Y(c.chooseSuggestion(i))}),a(1),p()}if(e&2){let t=l.$implicit,o=l.$index,i=y(2);R("is-active",o===i.activeIndex),x("aria-selected",o===i.activeIndex?"true":"false"),n(),h(" ",t," ")}}function Oe(e,l){if(e&1&&(g(0,"div",7),r(1,"translate"),v(2,Te,2,4,"button",15,W),p()),e&2){let t=y();I("id",t.suggestListId),x("aria-label",s(1,2,"DICTIONARY_AI.AUTOCOMPLETE")),n(2),T(t.internalSuggestions)}}function Ee(e,l){if(e&1&&(g(0,"option",10),a(1),r(2,"translate"),p()),e&2){let t=l.$implicit;I("value",t.code),n(),u(s(2,2,t.labelKey))}}function Se(e,l){if(e&1&&(g(0,"option",10),a(1),r(2,"translate"),p()),e&2){let t=l.$implicit;I("value",t.code),n(),u(s(2,2,t.labelKey))}}function De(e,l){if(e&1){let t=$();g(0,"span",17),a(1,"\u2192"),p(),g(2,"div",8)(3,"select",18),r(4,"translate"),ct("ngModelChange",function(i){B(t);let c=y();return dt(c.localTargetLang,i)||(c.localTargetLang=i),Y(i)}),v(5,Se,3,4,"option",10,te),p(),ot(),p()}if(e&2){let t=y();n(2),R("is-disabled",t.loading),n(),lt("ngModel",t.localTargetLang),I("disabled",t.loading||t.langsToUse.length===0),x("aria-label",s(4,5,"DICTIONARY_AI.TARGET_LANG")),at(),n(2),T(t.langsToUse)}}function Ae(e,l){e&1&&(g(0,"span",13),a(1),r(2,"translate"),p()),e&2&&(n(),u(s(2,1,"DICTIONARY_AI.LOADING")))}var ve,te,Me,ee,ie=q(()=>{"use strict";P();jt();D();_e();_t();P();Mt();jt();D();ve=["qInput"],te=(e,l)=>l.code;Me=[{code:"fr",labelKey:"LANG.FR"},{code:"en",labelKey:"LANG.EN"},{code:"es",labelKey:"LANG.ES"},{code:"it",labelKey:"LANG.IT"},{code:"de",labelKey:"LANG.DE"},{code:"pl",labelKey:"LANG.PL"},{code:"ar",labelKey:"LANG.AR"},{code:"pt",labelKey:"LANG.PT"},{code:"nl",labelKey:"LANG.NL"},{code:"sv",labelKey:"LANG.SV"},{code:"no",labelKey:"LANG.NO"},{code:"da",labelKey:"LANG.DA"},{code:"fi",labelKey:"LANG.FI"},{code:"cs",labelKey:"LANG.CS"},{code:"sk",labelKey:"LANG.SK"},{code:"hu",labelKey:"LANG.HU"},{code:"ro",labelKey:"LANG.RO"},{code:"bg",labelKey:"LANG.BG"},{code:"el",labelKey:"LANG.EL"},{code:"tr",labelKey:"LANG.TR"},{code:"uk",labelKey:"LANG.UK"},{code:"ru",labelKey:"LANG.RU"},{code:"id",labelKey:"LANG.ID"},{code:"ms",labelKey:"LANG.MS"},{code:"vi",labelKey:"LANG.VI"},{code:"th",labelKey:"LANG.TH"},{code:"ja",labelKey:"LANG.JA"},{code:"ko",labelKey:"LANG.KO"},{code:"zh",labelKey:"LANG.ZH"},{code:"hi",labelKey:"LANG.HI"},{code:"bn",labelKey:"LANG.BN"},{code:"ta",labelKey:"LANG.TA"},{code:"te",labelKey:"LANG.TE"},{code:"ur",labelKey:"LANG.UR"},{code:"he",labelKey:"LANG.HE"}],ee=(()=>{class e{http;tab;query="";sourceLang="en";targetLang="en";loading=!1;langsOverride=null;suggestions=[];queryChange=new N;pickSuggestion=new N;search=new N;qInput;inputId="dictQueryInput";helpId="dictHelp";suggestListId="dictSuggestList";langsAll=Me;get langsToUse(){return this.langsOverride??this.langsAll}localQuery="";localSourceLang="en";localTargetLang="en";showSuggest=!1;activeIndex=-1;inputHasFocus=!1;internalSuggestions=[];suggestLoading=!1;
1searchTerms$=new mt;destroy$=new mt;constructor(t){this.http=t,this.setupAutocomplete()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}setupAutocomplete(){this.searchTerms$.pipe(ft(250),Ct(),bt(t=>this.fetchSuggestions(t)),xt(this.destroy$)).subscribe(t=>{this.internalSuggestions=t,this.suggestLoading=!1,this.syncSuggestVisibility()})}fetchSuggestions(t){let o=(t||"").trim();if(o.length<2)return gt([]);this.suggestLoading=!0;let i=this.localSourceLang||"en",c=`${F.apiUrl}/api/v1/dictionary/autocomplete?q=${encodeURIComponent(o)}&lang=${encodeURIComponent(i)}&limit=10`;return this.http.get(c).pipe(yt(()=>gt([])))}ngOnChanges(t){if(t.query&&!t.query.firstChange){let i=t.query.currentValue||"";this.localQuery!==i&&!this.inputHasFocus&&(this.localQuery=i)}else t.query?.firstChange&&(this.localQuery=this.query||"");t.sourceLang&&(this.localSourceLang=this.sourceLang||"en"),t.targetLang&&(this.localTargetLang=this.targetLang||"en");let o=new Set(this.langsToUse.map(i=>i.code));if(!o.has(this.localSourceLang)&&this.langsToUse.length>0&&(this.localSourceLang=this.langsToUse[0].code),!o.has(this.localTargetLang)&&this.langsToUse.length>0){let i=this.langsToUse.find(c=>c.code!==this.localSourceLang)?.code??this.langsToUse[0].code;this.localTargetLang=i}t.suggestions&&(this.suggestions.length>0&&(this.internalSuggestions=this.suggestions),this.syncSuggestVisibility()),t.loading&&this.syncSuggestVisibility()}syncSuggestVisibility(){let t=(this.localQuery||"").trim(),o=this.internalSuggestions.length>0;if(this.showSuggest=!this.loading&&!this.suggestLoading&&this.inputHasFocus&&t.length>=2&&o,!this.showSuggest){this.activeIndex=-1;return}this.activeIndex<0&&(this.activeIndex=0),this.activeIndex>=this.internalSuggestions.length&&(this.activeIndex=0)}canSubmitRaw(t){return(t||"").trim().length>0}onQueryChange(t){this.localQuery=t??"",this.queryChange.emit(this.localQuery),this.searchTerms$.next(this.localQuery),this.activeIndex=0,this.syncSuggestVisibility()}onSourceLangChange(){this.internalSuggestions=[],this.activeIndex=-1,this.showSuggest=!1;let t=(this.localQuery||"").trim();t.length>=2&&this.searchTerms$.next(t)}onFocus(){this.inputHasFocus=!0,this.syncSuggestVisibility(),this.localQuery.length>=2&&this.internalSuggestions.length===0&&this.searchTerms$.next(this.localQuery)}onBlur(){setTimeout(()=>{this.inputHasFocus=!1,this.showSuggest=!1},200)}chooseSuggestion(t){t&&(this.localQuery=t,this.showSuggest=!1,this.activeIndex=-1,this.internalSuggestions=[],this.pickSuggestion.emit(t),this.queryChange.emit(t),queueMicrotask(()=>this.qInput?.nativeElement?.focus()))}onKeydown(t){if(!(!this.showSuggest||this.internalSuggestions.length===0)){if(t.key==="Escape"){this.showSuggest=!1,this.activeIndex=-1;return}if(t.key==="ArrowDown"){t.preventDefault(),this.activeIndex=Math.min(this.activeIndex+1,this.internalSuggestions.length-1);return}if(t.key==="ArrowUp"){t.preventDefault(),this.activeIndex=Math.max(this.activeIndex-1,0);return}t.key==="Enter"&&this.activeIndex>=0&&this.activeIndex<this.internalSuggestions.length&&(t.preventDefault(),this.chooseSuggestion(this.internalSuggestions[this.activeIndex]))}}submit(t){let o=(t??this.localQuery??"").trim();!o||this.loading||(this.showSuggest=!1,this.activeIndex=-1,this.localQuery=o,this.internalSuggestions=[],this.search.emit({query:o,sourceLang:this.localSourceLang,targetLang:this.localTargetLang}))}static \u0275fac=function(o){return new(o||e)(rt(pt))};static \u0275cmp=O({type:e,selectors:[["app-dictionary-search-bar"]],viewQuery:function(o,i){if(o&1&&z(ve,5,K),o&2){let c;G(c=Q())&&(i.qInput=c.first)}},hostBindings:function(o,i){o&1&&M("keydown",function(_){return i.onKeydown(_)})},inputs:{tab:"tab",query:"query",sourceLang:"sourceLang",targetLang:"targetLang",loading:"loading",langsOverride:"langsOverride",suggestions:"suggestions"},outputs:{queryChange:"queryChange",pickSuggestion:"pickSuggestion",search:"search"},features:[nt],decls:30,vars:40,consts:[["qInput",""],[1,"box","dictionary-search",3,"ngSubmit"],[1,"field"],[1,"label"],[1,"control","dictionary-search-row"],[1,"dict-input-wrap"],["name","query","autocomplete","off",1,"input","dictionary-search-input",3,"ngModelChange","focus","blur","id","placeholder","ngModel","disabled"],["role","listbox",1,"dict-suggest",3,"id"],[1,"select","dictionary-search-select"],["name","sourceLang",3,"ngModelChange","ngModel","disabled"],[3,"value"],["type","submit",1,"button","is-link","dictionary-search-btn","shine-hover",3,"disabled"],["aria-hidden","true",1,"icon","is-small"],[1,"sr-only"],[1,"help",3,"id"],["type","button","role","option",1,"dict-suggest__item",3,"is-active"],["type","button","role","option",1,"dict-suggest__item",3,"mouseenter","mousedown"],["aria-hidden","true",1,"dictionary-search-arrow"],["name","targetLang",3,"ngModelChange","ngModel","disabled"]],template:function(o,i){if(o&1){let c=$();g(0,"form",1),M("ngSubmit",function(){return i.submit()}),g(1,"div",2)(2,"label",3),a(3),r(4,"translate"),p(),g(5,"div",4)(6,"div",5)(7,"input",6,0),r(9,"translate"),ct("ngModelChange",function(b){return B(c),dt(i.localQuery,b)||(i.localQuery=b),Y(b)}),M("ngModelChange",function(b){return i.onQueryChange(b)})("focus",function(){return i.onFocus()})("blur",function(){return i.onBlur()}),p(),ot(),f(10,Oe,4,4,"div",7),p(),g(11,"div",8)(12,"select",9),r(13,"translate"),r(14,"translate"),ct("ngModelChange",function(b){return B(c),dt(i.localSourceLang,b)||(i.localSourceLang=b),Y(b)}),M("ngModelChange",function(){return i.onSourceLangChange()}),v(15,Ee,3,4,"option",10,te),p(),ot(),p(),f(17,De,7,7),g(18,"button",11)(19,"span",12),w(20,"i"),p(),g(21,"span"),a(22),r(23,"translate"),r(24,"translate"),p(),f(25,Ae,3,3,"span",13),p()(),g(26,"p",14),a(27),r(28,"translate"),r(29,"translate"),p()()()}o&2&&(n(2),x("for",i.inputId),n(),h(" ",s(4,24,"DICTIONARY_AI.SEARCH_LABEL")," "),n(4),I("id",i.inputId)("placeholder",s(9,26,"DICTIONARY_AI.SEARCH_PLACEHOLDER")),lt("ngModel",i.localQuery),I("disabled",i.loading),x("aria-expanded",i.showSuggest?"true":"false")("aria-controls",i.suggestListId)("aria-autocomplete","list"),at(),n(3),C(i.showSuggest&&i.internalSuggestions.length>0?10:-1),n(),R("is-disabled",i.loading),n(),lt("ngModel",i.localSourceLang),I("disabled",i.loading||i.langsToUse.length===0),x("aria-label",i.tab==="definition"?s(13,28,"DICTIONARY_AI.SOURCE_LANG_WORD"):s(14,30,"DICTIONARY_AI.SOURCE_LANG")),at(),n(3),T(i.langsToUse),n(2),C(i.tab==="translation"?17:-1),n(),I("disabled",i.loading||!i.canSubmitRaw(i.localQuery)),x("aria-busy",i.loading?"true":null),n(2),st(i.tab==="translation"?"pi pi-language":"pi pi-search"),n(2),h(" ",i.tab==="translation"?s(23,32,"DICTIONARY_AI.SEARCH_BUTTON_TRANSLATE"):s(24,34,"DICTIONARY_AI.SEARCH_BUTTON_DEFINE")," "),n(3),C(i.loading?25:-1),n(),I("id",i.helpId),n(),h(" ",i.tab==="definition"?s(28,36,"DICTIONARY_AI.HELP_DEFINITION"):s(29,38,"DICTIONARY_AI.HELP_TRANSLATION")," "))},dependencies:[zt,Gt,Vt,Wt,Ut,Qt,Ft,qt,$t,Kt,S,E],styles:['@charset "UTF-8";.dictionary-search[_ngcontent-%COMP%]{max-width:980px;margin:0 auto}.dict-meta[_ngcontent-%COMP%]{margin:0 0 8px;font-size:.78rem;opacity:.75;line-height:1.1;display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.dict-meta__sep[_ngcontent-%COMP%]{opacity:.5}.dictionary-search-row[_ngcontent-%COMP%]{display:flex;gap:.6rem;
1align-items:center;flex-wrap:wrap}.dict-input-wrap[_ngcontent-%COMP%]{position:relative;flex:1 1 420px;min-width:260px}.dictionary-search-input[_ngcontent-%COMP%]{width:100%}.dictionary-search-select[_ngcontent-%COMP%]{flex:0 0 auto}.dictionary-search-btn[_ngcontent-%COMP%]{flex:0 0 auto;white-space:nowrap;border-radius:999px}.dictionary-search-arrow[_ngcontent-%COMP%]{opacity:.7;font-weight:600;margin:0 .25rem}.dict-suggest[_ngcontent-%COMP%]{position:absolute;z-index:60;top:calc(100% + 6px);left:0;right:0;max-height:280px;overflow-y:auto;border:1px solid rgba(16,24,40,.12);background:#fff;border-radius:12px;box-shadow:0 12px 28px #0000001f}[_ngcontent-%COMP%]:root[data-theme=dark] .dict-suggest[_ngcontent-%COMP%]{background:var(--bulma-box-background-color);border-color:#ffffff1a}.dict-suggest__item[_ngcontent-%COMP%]{width:100%;text-align:left;padding:10px 12px;background:transparent;border:0;cursor:pointer;color:inherit;font:inherit}.dict-suggest__item[_ngcontent-%COMP%]:hover, .dict-suggest__item.is-active[_ngcontent-%COMP%]{background:#6366f11a}@media(max-width:640px){.dict-meta[_ngcontent-%COMP%]{justify-content:flex-start}.dictionary-search-row[_ngcontent-%COMP%]{align-items:stretch}.dictionary-search-btn[_ngcontent-%COMP%]{width:100%;justify-content:center}}'],changeDetection:1})}return e})()});function Re(e,l){e&1&&(m(0,"div",0),a(1),r(2,"translate"),d()),e&2&&(n(),h(" ",s(2,1,"DICTIONARY_AI.NO_RESULT")," "))}function Ne(e,l){if(e&1&&(m(0,"li")(1,"span",10),a(2),d()()),e&2){let t=l.$implicit;n(2),u(t)}}function ke(e,l){e&1&&(m(0,"li")(1,"span",11),a(2),r(3,"translate"),d()()),e&2&&(n(2),u(s(3,1,"DICTIONARY_AI.CACHED")))}function Be(e,l){if(e&1&&(m(0,"p",5)(1,"span",12),a(2),r(3,"translate"),d(),a(4),d()),e&2){let t=y(2);n(2),h("",s(3,2,"DICTIONARY_AI.PHONETICS"),": "),n(2),h(" ",t.data.phonetics?.join(" \xB7 ")," ")}}function Ye(e,l){if(e&1&&(m(0,"span",17),a(1),d()),e&2){let t=l.$implicit;n(),u(t)}}function He(e,l){if(e&1&&(m(0,"div",14)(1,"p",16),a(2),r(3,"translate"),d(),m(4,"div",4),v(5,Ye,2,1,"span",17,W),d()()),e&2){let t=y().$implicit;n(2),h(" ",s(3,1,"DICTIONARY_AI.SYNONYMS")," "),n(3),T(t.synonyms)}}function Ue(e,l){if(e&1&&(m(0,"p",19),a(1),d()),e&2){let t=y().$implicit;n(),h("\u2192 ",t.translation)}}function Fe(e,l){if(e&1&&(m(0,"li",13)(1,"blockquote",18)(2,"p"),a(3),d()(),f(4,Ue,2,1,"p",19),d()),e&2){let t=l.$implicit;n(3),u(t.source),n(),C(t.translation?4:-1)}}function qe(e,l){if(e&1&&(m(0,"div",13)(1,"p",16),a(2),r(3,"translate"),d(),m(4,"ul"),v(5,Fe,5,2,"li",13,we),d()()),e&2){let t=y().$implicit;n(2),h(" ",s(3,1,"DICTIONARY_AI.EXAMPLES")," "),n(3),T(t.examples)}}function Ke(e,l){if(e&1&&(m(0,"p",15),a(1),d()),e&2){let t=y().$implicit;n(),u(t.notes)}}function $e(e,l){if(e&1&&(m(0,"div",8)(1,"p",13)(2,"strong"),a(3),d(),a(4),d(),f(5,He,7,3,"div",14),f(6,qe,7,3,"div",13),f(7,Ke,2,1,"p",15),H(8,"hr"),d()),e&2){let t=l.$implicit;n(3),h("",t.sense_id,"."),n(),h(" ",t.definition," "),n(),C(t.synonyms?.length?5:-1),n(),C(t.examples?.length?6:-1),n(),C(t.notes?7:-1)}}function Ge(e,l){if(e&1&&(m(0,"li"),a(1),d()),e&2){let t=l.$implicit;n(),u(t)}}function Qe(e,l){if(e&1&&(m(0,"div",9)(1,"p",20)(2,"strong"),a(3),r(4,"translate"),d()(),m(5,"ul"),v(6,Ge,2,1,"li",null,W),d()()),e&2){let t=y(2);n(3),u(s(4,1,"DICTIONARY_AI.WARNINGS")),n(3),T(t.data.safety.warnings)}}function Ve(e,l){if(e&1&&(m(0,"div",1)(1,"div",2)(2,"h3",3),a(3),d(),m(4,"ul",4),r(5,"translate"),v(6,Ne,3,1,"li",null,W),f(8,ke,4,3,"li"),d(),f(9,Be,5,4,"p",5),d(),H(10,"hr",6),m(11,"div",7),v(12,$e,9,5,"div",8,Le),d(),f(14,Qe,8,3,"div",9),d()),e&2){let t=y();n(3),u(t.data.query),n(),x("aria-label",s(5,5,"DICTIONARY_AI.PARTS_OF_SPEECH")),n(2),T(t.data.pos||Ot(7,Pe)),n(2),C(t.data.cached?8:-1),n(),C(t.data.phonetics?.length?9:-1),n(3),T(t.data.meanings),n(2),C(t.data.safety?.warnings?.length?14:-1)}}var Pe,Le,we,ne,oe=q(()=>{"use strict";D();P();D();Pe=()=>[],Le=(e,l)=>l.sense_id,we=(e,l)=>l.source;ne=(()=>{class e{data=null;static \u0275fac=function(o){return new(o||e)};static \u0275cmp=O({type:e,selectors:[["app-dictionary-definition-result"]],inputs:{data:"data"},decls:2,vars:1,consts:[["role","status","aria-live","polite","aria-atomic","true",1,"dictionary-empty"],[1,"box","dictionary-result"],[1,"dictionary-result-head"],[1,"title","is-4","mb-1"],[1,"tags"],[1,"has-text-grey"],["aria-hidden","true"],[1,"dictionary-meanings"],[1,"dictionary-meaning"],["role","alert","aria-live","assertive",1,"n
1otification","is-warning","is-light","mt-3"],[1,"tag","is-info","is-light"],[1,"tag","is-light"],[1,"sr-only"],[1,"mb-2"],[1,"mb-3"],[1,"is-size-7","has-text-grey"],[1,"is-size-7","has-text-grey","mb-1"],[1,"tag"],[1,"dict-quote"],[1,"has-text-grey","is-size-7"],[1,"mb-1"]],template:function(o,i){o&1&&f(0,Re,3,3,"div",0)(1,Ve,15,8,"div",1),o&2&&C(i.data?1:0)},dependencies:[S,E],styles:[".dictionary-result[_ngcontent-%COMP%] .dictionary-result-head[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem}.dictionary-result[_ngcontent-%COMP%] .dictionary-empty[_ngcontent-%COMP%]{padding:.75rem 0}.dictionary-result[_ngcontent-%COMP%] .dict-quote[_ngcontent-%COMP%]{margin:0}.dictionary-result[_ngcontent-%COMP%] .dictionary-meaning[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{margin-left:1rem;list-style:disc}"],changeDetection:1})}return e})()});var ae,re=q(()=>{"use strict";P();D();P();D();ae=(()=>{class e{tab;tabChange=new N;onClick(t,o){t.preventDefault(),this.tabChange.emit(o)}onKeydown(t,o){if(t.key!=="ArrowLeft"&&t.key!=="ArrowRight")return;t.preventDefault();let i=o==="definition"?"translation":"definition";this.tabChange.emit(i),queueMicrotask(()=>{let c=i==="definition"?"dict-tab-definition":"dict-tab-translation";document.getElementById(c)?.focus()})}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=O({type:e,selectors:[["app-dictionary-tabs"]],inputs:{tab:"tab"},outputs:{tabChange:"tabChange"},decls:12,vars:19,consts:[[1,"dictionary-tabs","mb-5"],[1,"tabs","is-toggle","is-fullwidth"],["role","tablist"],["role","presentation"],["href","#dict-panel-definition","role","tab","id","dict-tab-definition",3,"click","keydown"],["href","#dict-panel-translation","role","tab","id","dict-tab-translation",3,"click","keydown"]],template:function(o,i){o&1&&(m(0,"nav",0),r(1,"translate"),m(2,"div",1)(3,"ul",2)(4,"li",3)(5,"a",4),U("click",function(_){return i.onClick(_,"definition")})("keydown",function(_){return i.onKeydown(_,"definition")}),a(6),r(7,"translate"),d()(),m(8,"li",3)(9,"a",5),U("click",function(_){return i.onClick(_,"translation")})("keydown",function(_){return i.onKeydown(_,"translation")}),a(10),r(11,"translate"),d()()()()()),o&2&&(x("aria-label",s(1,13,"DICTIONARY_AI.TABS_ARIA")),n(4),R("is-active",i.tab==="definition"),n(),x("aria-selected",i.tab==="definition")("aria-controls","dict-panel-definition")("tabindex",i.tab==="definition"?0:-1),n(),h(" ",s(7,15,"DICTIONARY_AI.TAB_DEFINITION")," "),n(2),R("is-active",i.tab==="translation"),n(),x("aria-selected",i.tab==="translation")("aria-controls","dict-panel-translation")("tabindex",i.tab==="translation"?0:-1),n(),h(" ",s(11,17,"DICTIONARY_AI.TAB_TRANSLATION")," "))},dependencies:[S,E],styles:[".dictionary-tabs[_ngcontent-%COMP%]{max-width:760px;margin:0 auto}.tabs[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:focus-visible{outline:none;box-shadow:0 0 0 4px #6366f138;border-radius:8px}"],changeDetection:1})}return e})()});var se,le=q(()=>{"use strict";D();P();D();se=(()=>{class e{static \u0275fac=function(o){return new(o||e)};static \u0275cmp=O({type:e,selectors:[["app-dictionary-empty-state"]],decls:7,vars:6,consts:[[1,"box","has-text-centered"],[1,"title","is-5","mb-2"],[1,"subtitle","is-6"]],template:function(o,i){o&1&&(m(0,"div",0)(1,"p",1),a(2),r(3,"translate"),d(),m(4,"p",2),a(5),r(6,"translate"),d()()),o&2&&(n(2),u(s(3,2,"DICTIONARY_AI.EMPTY_TITLE")),n(3),u(s(6,4,"DICTIONARY_AI.EMPTY_SUBTITLE")))},dependencies:[S,E],encapsulation:2,changeDetection:1})}return e})()});function je(e,l){e&1&&(m(0,"div",0),a(1),r(2,"translate"),d()),e&2&&(n(),h(" ",s(2,1,"DICTIONARY_AI.NO_RESULT")," "))}function Xe(e,l){if(e&1&&(m(0,"li")(1,"span",9),a(2),d()()),e&2){let t=l.$implicit;n(2),u(t.text)}}function Je(e,l){if(e&1&&(m(0,"li",14)(1,"blockquote",15)(2,"p",16),a(3),d()(),m(4,"p",17)(5,"span",10),a(6,"\u2192"),d(),m(7,"span",18),a(8),r(9,"translate"),d(),a(10),d()()),e&2){let t=l.$implicit;n(3),u(t.source),n(5),h("",s(9,3,"DICTIONARY_AI.TRANSLATION"),": "),n(2),h(" ",t.target," ")}}function Ze(e,l){if(e&1&&(H(0,"hr",10),m(1,"section",4)(2,"p",11)(3,"span",6),H(4,"i",12),d(),a(5),r(6,"translate"),d(),m(7,"ul",13),v(8,Je,11,5,"li",14,ze),d()()),e&2){let t=y(2);n(),x("aria-labelledby","dictExamplesTitle"),n(4),h(" ",s(6,2,"DICTIONARY_AI.EXAMPLES")," "),n(3),T(t.data.examples)}}function ti(e,l){if(e&1&&(m(0,"article",1)(1,"header",2)(2,"h3",3),a(3),d()(),m(4,"section",4)(5,"p",5)(6,"span",6),H(7,"i",7),d(),a(8),r(9,"translate"),d(),m(10,"ul",8),v(11,Xe,3,1,"li",null,We),d()(),f(13,Ze,10,4),d()),e&2){let t=y();n(3),u(t.data.query),n(),x("aria-labelledby","dictTranslationsTitle"),n(4),h(" ",s(9,4,"DICTIONARY_AI.TRANSLATIONS")," "),n(3),T(t.data.translations),n(2),C(t.data.examples.length?13:-1)}}var We,ze,de,ce=q(()=>{"use strict";D();P();D();We=(e,l)=>l.text,ze=(e,l)=>l.source;de=(()=>{class e{data=null;static \u0275fac=function(o){return new(o||e)};static \u0275cmp=O({type:e,selectors:[["app-dictionary-translate-result"]],inputs:{data:"data"},decls:2,vars:1,consts:[["role","status","aria-live","polite","aria-atomic","true",1,"dictionary-empty"],[1,"dictionary-translate"],[1,"dictionary-translate__head"],[1,"title","is-4","mb-3"],[1,"dictionary-translate__section"],["id","dictTranslationsTitle",1,"is-size-7","has-text-grey","mb-2"],["aria-hidden","true",1,"icon","is-small"],[1,"pi","pi-language"],["role","list",1,"tags","dictionary-translate__tags"],[1,"tag","is-link","is-light"],["aria-hidden","true"],["id","dictExamplesTitle",1,"is-size-7","has-text-grey","mb-2"],[1,"pi","pi-comment"],["role","list",1,"dictionary-translate__examples"],[1,"mb-3"],[1,"dictionary-translate__quote"],[1,"mb-1"],[1,"has-text-grey","is-size-7","mb-0"],[1,"sr-only"]],template:function(o,i){o&1&&f(0,je,3,3,"div",0)(1,ti,14,6,"article",1),o&2&&C(i.data?1:0)},dependencies:[S,E],styles:['@charset "UTF-8";.dictionary-empty[_ngcontent-%COMP%]{padding:.75rem 0}.dictionary-translate__tags[_ngcontent-%COMP%]{margin:0}.dictionary-translate__tags[_ngcontent-%COMP%], .dictionary-translate__examples[_ngcontent-%COMP%]{list-style:none;padding-left:0}.dictionary-translate__examples[_ngcontent-%COMP%]{margin-left:0}.dictionary-translate__quote[_ngcontent-%COMP%]{margin:0;padding-left:0}.sr-only[_ngcontent-%COMP%]{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}'],changeDetection:1})}return e})()});function oi(e,l){if(e&1){let t=$();m(0,"div",8),H(1,"img",9),m(2,"p",10),a(3),r(4,"translate"),d(),m(5,"p",11),a(6),r(7,"translate"),d(),m(8,"button",12),U("click",function(){B(t);let i=y();
1return Y(i.plans.emit())}),a(9),r(10,"translate"),d()()}e&2&&(n(3),u(s(4,3,"DICTIONARY_AI.HISTORY_LOCK_TITLE")),n(3),u(s(7,5,"DICTIONARY_AI.HISTORY_LOCK_TEXT")),n(3),h(" ",s(10,7,"DICTIONARY_AI.HISTORY_LOCK_CTA")," "))}function ai(e,l){e&1&&(m(0,"p",13),a(1),r(2,"translate"),d()),e&2&&(n(),u(s(2,1,"DICTIONARY_AI.LOADING_HISTORY")))}function ri(e,l){e&1&&(m(0,"p",13),a(1),r(2,"translate"),d()),e&2&&(n(),u(s(2,1,"DICTIONARY_AI.HISTORY_EMPTY")))}function si(e,l){if(e&1&&a(0),e&2){let t=y().$implicit;h(" \u2192 ",(t.target_lang||"").toUpperCase()," ")}}function li(e,l){e&1&&(m(0,"span",22),a(1,"cache"),d())}function di(e,l){if(e&1){let t=$();m(0,"button",16),U("click",function(){let i=B(t).$implicit,c=y(4);return Y(c.pick.emit(i))}),m(1,"div",17)(2,"strong",18),a(3),d(),m(4,"span",19),a(5),f(6,si,1,1),d()(),m(7,"div",20)(8,"span",21),a(9),r(10,"date"),d(),f(11,li,2,0,"span",22),d()()}if(e&2){let t=l.$implicit;x("aria-label",t.query),n(3),u(t.query),n(2),h(" ",(t.source_lang||"").toUpperCase()," "),n(),C(t.mode==="translate"&&t.target_lang?6:-1),n(3),h(" ",Et(10,6,t.created_at,"dd/MM/yyyy")," "),n(2),C(t.cached?11:-1)}}function ci(e,l){if(e&1&&(m(0,"div",14),v(1,di,12,9,"button",15,ni),d()),e&2){let t=y(3);n(),T(t.items)}}function pi(e,l){if(e&1&&f(0,ri,3,3,"p",13)(1,ci,3,0,"div",14),e&2){let t=y(2);C(t.items.length?1:0)}}function mi(e,l){if(e&1&&f(0,ai,3,3,"p",13)(1,pi,2,1),e&2){let t=y();C(t.loading?0:1)}}var ei,ii,ni,pe,me=q(()=>{"use strict";At();P();D();P();At();D();ei=["panel"],ii=["closeBtn"],ni=(e,l)=>l.id;pe=(()=>{class e{open=!1;loading=!1;items=[];hasAccess=!0;close=new N;pick=new N;plans=new N;viewAll=new N;panel;closeBtn;onEsc(t){this.open&&(t.preventDefault(),this.close.emit())}ngOnChanges(t){t.open?.currentValue===!0&&queueMicrotask(()=>this.closeBtn?.nativeElement?.focus())}onKeydown(t){if(!this.open||t.key!=="Tab")return;let o=this.panel?.nativeElement;if(!o)return;let i=Array.from(o.querySelectorAll('button,[href],input,select,textarea,[tabindex]:not([tabindex="-1"])')).filter(k=>!k.hasAttribute("disabled")&&!k.getAttribute("aria-hidden"));if(!i.length)return;let c=i[0],_=i[i.length-1],b=document.activeElement;t.shiftKey?(!b||b===c)&&(t.preventDefault(),_.focus()):b===_&&(t.preventDefault(),c.focus())}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=O({type:e,selectors:[["app-dictionary-history-drawer"]],viewQuery:function(o,i){if(o&1&&z(ei,5,K)(ii,5,K),o&2){let c;G(c=Q())&&(i.panel=c.first),G(c=Q())&&(i.closeBtn=c.first)}},hostBindings:function(o,i){o&1&&M("keydown.escape",function(_){return i.onEsc(_)},Tt)},inputs:{open:"open",loading:"loading",items:"items",hasAccess:"hasAccess"},outputs:{close:"close",pick:"pick",plans:"plans",viewAll:"viewAll"},features:[nt],decls:13,vars:14,consts:[["panel",""],["closeBtn",""],[1,"dict-history-overlay",3,"click"],["role","dialog","aria-modal","true",1,"dict-history",3,"keydown"],[1,"dict-history__head"],["id","dictHistoryTitle",1,"dict-history__title"],["id","dictHistoryCloseBtn","type","button",1,"delete",3,"click"],[1,"dict-history__body"],["role","note","aria-live","polite",1,"dict-history-lock"],["src","assets/imgs/history.svg","alt","","aria-hidden","true","loading","lazy","decoding","async",1,"lock-illustration"],[1,"lock-title"],[1,"lock-text"],["type","button",1,"button","is-link","is-small",3,"click"],[1,"has-text-grey"],[1,"dict-history__list"],["type","button",1,"dict-history__item"],["type","button",1,"dict-history__item",3,"click"],[1,"dict-history__row"],[1,"dict-history__q"],[1,"tag","is-light"],[1,"dict-history__meta"],[1,"has-text-grey","is-size-7"],[1,"tag","is-success","is-light","is-size-7"]],template:function(o,i){o&1&&(m(0,"div",2),U("click",function(){return i.close.emit()}),d(),m(1,"aside",3,0),U("keydown",function(_){return i.onKeydown(_)}),m(3,"div",4)(4,"p",5),a(5),r(6,"translate"),d(),m(7,"button",6,1),r(9,"translate"),U("click",function(){return i.close.emit()}),d()(),m(10,"div",7),f(11,oi,11,9,"div",8)(12,mi,2,1),d()()),o&2&&(R("is-active",i.open),x("aria-hidden",i.open?null:"true"),n(),R("is-open",i.open),x("aria-labelledby","dictHistoryTitle")("aria-hidden",i.open?null:"true"),n(4),h(" ",s(6,10,"DICTIONARY_AI.HISTORY_TITLE")," "),n(2),x("aria-label",s(9,12,"COMMON.CLOSE")),n(4),C(i.hasAccess?12:11))},dependencies:[Dt,S,St,E],styles:['@charset "UTF-8";.dict-history-overlay[_ngcontent-%COMP%]{position:fixed;inset:0;background:#00000059;opacity:0;pointer-events:none;transition:opacity .16s ease;z-index:1200}.dict-history-overlay.is-active[_ngcontent-%COMP%]{opacity:1;pointer-events:auto}.dict-history[_ngcontent-%COMP%]{position:fixed;top:0;right:0;height:100vh;width:360px;max-width:92vw;background:#fff;box-shadow:-16px 0 40px #0000002e;transform:translate(110%);transition:transform .2s ease;z-index:1210;display:flex;flex-direction:column;visibility:hidden;pointer-events:none}.dict-history.is-open[_ngcontent-%COMP%]{transform:translate(0);visibility:visible;pointer-events:auto}.dict-history__head[_ngcontent-%COMP%]{padding:1rem;border-bottom:1px solid rgba(16,24,40,.08);display:flex;align-items:center;justify-content:space-between;gap:.75rem}.dict-history__title[_ngcontent-%COMP%]{margin:0;font-weight:700}.dict-history__body[_ngcontent-%COMP%]{padding:1rem;overflow:auto;flex:1}.dict-history__list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.6rem}.dict-history__item[_ngcontent-%COMP%]{border:1px solid rgba(16,24,40,.1);background:#fff;border-radius:12px;padding:.75rem;text-align:left;cursor:pointer;transition:border-color .16s ease,background .16s ease,transform .16s ease}.dict-history__item[_ngcontent-%COMP%]:hover{border-color:#3b82f659;transform:translateY(-1px)}.dict-history__row[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.75rem}.dict-history__meta[_ngcontent-%COMP%]{margin-top:.35rem;display:flex;align-items:center;justify-content:space-between}.dict-history__foot[_ngcontent-%COMP%]{padding:.85rem 1rem;border-top:1px solid rgba(16,24,40,.08)}.dict-history-lock[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:.55rem;padding:1rem .75rem}.lock-illustration[_ngcontent-%COMP%]{width:150px;height:150px;display:block;margin:0 0 .35rem;opacity:.95}.lock-title[_ngcontent-%COMP%]{margin:0;font-weight:800;font-size:1rem}.lock-text[_ngcontent-%COMP%]{margin:0;max-width:320px;font-size:.92rem;line-height:1.35;color:#000000a6}.dict-history[_ngcontent-%COMP%]{background-color:#fff!important;background-image:none!important;opacity:1!important}:root[data-theme=dark][_nghost-%COMP%] .dict-history-overlay[_ngcontent-%COMP%], :root[data-theme=dark] [_nghost-%COMP%] .dict-history-overlay[_ngcontent-%COMP%]{background:#0000008c}:root[data-theme=dark][_nghost-%COMP%] .dict-history[_ngcontent-%COMP%], :root[data-theme=dark] [_nghost-%COMP%] .dict-history[_ngcontent-%COMP%]{background-color:var(--bulma-scheme-main)!important;background-image:none!important;opacity:1!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;box-shadow:-16px 0 44px #0000008c;border-left:1px solid rgba(255,255,255,.08);color:var(--bulma-text-strong)}:root[data-theme=dark][_nghost-%COMP%] .dict-history__head[_ngcontent-%COMP%], :root[data-theme=dark] [_nghost-%COMP%] .dict-history__head[_ngcontent-%COMP%]{border-bottom:1px solid rgba(255,255,255,.08)}:root[data-theme=dark][_nghost-%COMP%] .dict-history__item[_ngcontent-%COMP%], :root[data-theme=dark] [_nghost-%COMP%] .dict-history__item[_ngcontent-%COMP%]{background:#ffffff08;border:1px solid rgba(255,255,255,.1);color:var(--bulma-text-strong)}:root[data-theme=dark][_nghost-%COMP%] .dict-history__item[_ngcontent-%COMP%]:hover, :root[data-theme=dark] [_nghost-%COMP%] .dict-history__item[_ngcontent-%COMP%]:hover{border-color:#3b82f673;background:#3b82f614}:root[data-theme=dark][_nghost-%COMP%] .dict-history__meta[_ngcontent-%COMP%] .has-text-grey[_ngcontent-%COMP%], :root[data-theme=dark] [_nghost-%COMP%] .dict-history__meta[_ngcontent-%COMP%] .has-text-grey[_ngcontent-%COMP%], :root[data-theme=dark][_nghost-%COMP%] .dict-history__body[_ngcontent-%COMP%] .has-text-grey[_ngcontent-%COMP%], :root[data-theme=dark] [_nghost-%COMP%] .dict-history__body[_ngcontent-%COMP%] .has-text-grey[_ngcontent-%COMP%]{color:#ffffffa6!important}:root[data-theme=dark][_nghost-%COMP%] .dict-history[_ngcontent-%COMP%] .tag.is-light[_ngcontent-%COMP%], :root[data-theme=dark] [_nghost-%COMP%] .dict-history[_ngcontent-%COMP%] .tag.is-light[_ngcontent-%COMP%]{background:#ffffff14!important;color:#ffffffd9!important;border:1px solid rgba(255,255,255,.1)}:root[data-theme=dark][_nghost-%COMP%] .dict-history[_ngcontent-%COMP%] .tag.is-success.is-light[_ngcontent-%COMP%], :root[data-theme=dark] [_nghost-%COMP%] .dict-history[_ngcontent-%COMP%] .tag.is-success.is-light[_ngcontent-%COMP%]{background:#48c78e29!important;color:#d2ffe8f2!important;border:1px solid rgba(72,199,142,.28)}:root[data-theme=dark][_nghost-%COMP%] .dict-history[_ngcontent-%COMP%] .delete[_ng
1content-%COMP%], :root[data-theme=dark] [_nghost-%COMP%] .dict-history[_ngcontent-%COMP%] .delete[_ngcontent-%COMP%]{background-color:#ffffff14}:root[data-theme=dark][_nghost-%COMP%] .dict-history[_ngcontent-%COMP%] .delete[_ngcontent-%COMP%]:before, :root[data-theme=dark] [_nghost-%COMP%] .dict-history[_ngcontent-%COMP%] .delete[_ngcontent-%COMP%]:before, :root[data-theme=dark][_nghost-%COMP%] .dict-history[_ngcontent-%COMP%] .delete[_ngcontent-%COMP%]:after, :root[data-theme=dark] [_nghost-%COMP%] .dict-history[_ngcontent-%COMP%] .delete[_ngcontent-%COMP%]:after{background-color:#ffffffd9}:root[data-theme=dark][_nghost-%COMP%] .lock-text[_ngcontent-%COMP%], :root[data-theme=dark] [_nghost-%COMP%] .lock-text[_ngcontent-%COMP%]{color:#ffffffa6!important}:root[data-theme=dark][_nghost-%COMP%] .dict-history__foot[_ngcontent-%COMP%], :root[data-theme=dark] [_nghost-%COMP%] .dict-history__foot[_ngcontent-%COMP%]{border-top:1px solid rgba(255,255,255,.08)}'],changeDetection:1})}return e})()});function _i(e,l){e&1&&(g(0,"span",10),a(1),r(2,"translate"),p()),e&2&&(n(),h(" ",s(2,1,"DICTIONARY_AI.LOADING_HISTORY")," "))}function ui(e,l){e&1&&(g(0,"div",16),w(1,"app-dictionary-empty-state"),p())}function hi(e,l){e&1&&(g(0,"div",33)(1,"p",34)(2,"span",35),w(3,"i",36),p(),a(4),r(5,"translate"),p()()),e&2&&(n(4),h(" ",s(5,1,"DICTIONARY_AI.LOADING")," "))}function yi(e,l){if(e&1&&(g(0,"div",37)(1,"span",38),w(2,"i",39),p(),a(3),r(4,"translate"),p()),e&2){let t=y(3);n(3),h(" ",s(4,1,t.errorMsgKey())," ")}}function fi(e,l){if(e&1&&w(0,"app-dictionary-definition-result",40),e&2){let t=y(4);I("data",t.definitionResult())}}function Ci(e,l){if(e&1&&w(0,"app-dictionary-translate-result",40),e&2){let t=y(4);I("data",t.translateResult())}}function bi(e,l){if(e&1&&(g(0,"div",16),f(1,fi,1,1,"app-dictionary-definition-result",40)(2,Ci,1,1,"app-dictionary-translate-result",40),p()),e&2){let t=y(3);n(),C(t.tab()==="definition"?1:2)}}function xi(e,l){if(e&1&&f(0,yi,5,3,"div",37)(1,bi,3,1,"div",16),e&2){let t=y(2);C(t.errorMsgKey()?0:1)}}function Ii(e,l){if(e&1&&f(0,hi,6,3,"div",33)(1,xi,2,1),e&2){let t=y();C(t.loading()?0:1)}}var gi,J,Z,Nn,vi=q(()=>{P();ye();D();ue();he();Zt();Ie();be();ie();oe();re();le();ce();me();fe();xe();_t();P();Ce();D();gi=["historyBtn"];J=["fr","en","es","it","de","pl","ar","pt","nl","sv","no","da","fi","cs","sk","hu","ro","bg","el","tr","uk","ru","id","ms","vi","th","ja","ko","zh","hi","bn","ta","te","ur","he"],Z=["fr","en","es","it","de","pl","pt","nl","sv","da","fi","cs","sk","hu","ro","bg","el","tr","uk","ru","id","ja","zh","ar"],Nn=(()=>{class e{auth;route=L(wt);router=L(Rt);api=L(Jt);apiTranslate=L(Xt);ngxI18n=L(kt);seo=L(Ht);destroyRef=L(vt);titleSrv=L(Lt);metaSrv=L(Pt);langSub;historyBtn;tab=A("definition");query=A("");sourceLang=A("en");targetLang=A("en");loading=A(!1);hasSearched=A(!1);definitionResult=A(null);translateResult=A(null);errorCode=A(null);historyOpen=A(!1);historyLoading=A(!1);historyItems=A([]);langsForTab=X(()=>(this.tab()==="translation"?Z:J).map(o=>({code:o,labelKey:`LANG.${String(o).toUpperCase()}`})));isRtl=X(()=>(this.ngxI18n.currentLang||"").toLowerCase()==="ar");errorMsgKey=X(()=>{let t=this.errorCode();return t?t==="SUBSCRIPTION_REQUIRED"?"DICTIONARY_AI.ERROR_SUBSCRIPTION":t==="RATE_LIMIT"?"DICTIONARY_AI.ERROR_RATE_LIMIT":"DICTIONARY_AI.ERROR_GENERIC":null});hasHistoryAccess=X(()=>this.auth.hasHistoryAccess());constructor(t){this.auth=t}goToPlans(){let t=(this.ngxI18n.currentLang||"en").toLowerCase();this.historyOpen.set(!1),this.router.navigate(["/",t,"plans"])}goToFullHistory(){let t=(this.ngxI18n.currentLang||"en").toLowerCase();this.historyOpen.set(!1),this.router.navigate(["/",t,"account","history"],{queryParams:{type:"dictionary"}})}_pickSourceLang(t){let o=(t||"").toLowerCase();return J.includes(o)?o:"en"}ngOnInit(){this.sourceLang.set(this._pickSourceLang(this.ngxI18n.currentLang||"en")),this.setSeo(),this.langSub=this.ngxI18n.onLangChange.subscribe(({lang:t})=>{this.setSeo(this.query()),this.hasSearched()||this.sourceLang.set(this._pickSourceLang(t))}),this.route.paramMap.pipe(Bt(this.destroyRef)).subscribe(t=>{let o=(t.get("sourceLang")||"").toLowerCase(),i=(t.get("targetLang")||"").toLowerCase(),c=t.get("query")||"",_=c?decode
1URIComponent(c):"";if(J.includes(o)&&this.sourceLang.set(o),Z.includes(i)&&this.targetLang.set(i),_&&this.query.set(_),this.setSeo(_),!!_)if(this.hasSearched.set(!0),this.errorCode.set(null),this.tab()==="definition")this.runDefine(_,this.sourceLang());else{let b=Z.includes(i)?i:this.targetLang();this.runTranslate(_,this.sourceLang(),b)}})}ngOnDestroy(){this.langSub?.unsubscribe()}setSeo(t){let o=(t??this.query()??"").trim(),i=this.ngxI18n.instant("DICTIONARY_AI.SEO.TITLE"),c=this.ngxI18n.instant("DICTIONARY_AI.SEO.DESCRIPTION"),_=this.ngxI18n.instant("DICTIONARY_AI.SEO.TITLE_QUERY",{q:o}),k=o&&(_&&_!=="DICTIONARY_AI.SEO.TITLE_QUERY")?_:i,ht=c,tt=(k||"").trim();tt&&(this.titleSrv.setTitle(tt),this.metaSrv.updateTag({property:"og:title",content:tt},"property='og:title'"),this.metaSrv.updateTag({name:"twitter:title",content:tt},"name='twitter:title'"));let et=(ht||"").trim();et&&(this.metaSrv.updateTag({name:"description",content:et},"name='description'"),this.metaSrv.updateTag({property:"og:description",content:et},"property='og:description'"),this.metaSrv.updateTag({name:"twitter:description",content:et},"name='twitter:description'")),this.seo.setRobotsIndex(),this.seo.setCanonical(),this.seo.setOgBasics({siteName:"Textiaa",type:"website",image:`${F.appBaseUrl}/assets/og/og-image.jpg`}),this.seo.setHreflangsAuto(F.appBaseUrl,F.supportedLangs);let ge=this.ngxI18n.currentLang||"en";this.seo.setJsonLd({"@context":"https://schema.org","@type":"SoftwareApplication",name:k||"Dictionnaire IA",applicationCategory:"EducationalApplication",operatingSystem:"Web",description:ht,inLanguage:ge,offers:{"@type":"Offer",price:"0",priceCurrency:"EUR",availability:"https://schema.org/OnlineOnly",category:"FreeTrial"},publisher:{"@type":"Organization",name:"Textiaa",url:F.appBaseUrl}})}openHistory(){if(this.historyOpen.set(!0),!this.hasHistoryAccess()){this.historyLoading.set(!1),this.historyItems.set([]);return}this.historyLoading.set(!0),this.api.history(50).pipe(it(()=>this.historyLoading.set(!1))).subscribe({next:t=>this.historyItems.set(t.items||[]),error:t=>this.historyItems.set([])})}closeHistoryAndRestoreFocus(){this.historyOpen.set(!1),queueMicrotask(()=>this.historyBtn?.nativeElement?.focus())}onPickHistory(t){let o=(t.query||"").trim();if(!o)return;this.query.set(o),this.sourceLang.set(t.source_lang);let i=(this.ngxI18n.currentLang||"en").toLowerCase(),c=encodeURIComponent(o);this.router.navigate(["/",i,ut("dictionary-ai",i),t.source_lang,c],{replaceUrl:!1}),this.hasSearched.set(!0),this.errorCode.set(null),this.setSeo(o),this.tab()==="definition"?this.runDefine(o,t.source_lang):this.runTranslate(o,t.source_lang,this.targetLang()),this.historyOpen.set(!1)}onTabChange(t){this.tab.set(t),this.errorCode.set(null),t==="translation"&&!Z.includes(this.targetLang())&&this.targetLang.set("en"),t==="translation"&&!Z.includes(this.sourceLang())&&this.sourceLang.set("en");let o=(this.query()||"").trim();this.setSeo(o),this.hasSearched()&&o&&(t==="definition"?this.runDefine(o,this.sourceLang()):this.runTranslate(o,this.sourceLang(),this.targetLang()))}onSearch(t){let o=(t.query||"").trim();if(!o)return;let i=(this.ngxI18n.currentLang||"en").toLowerCase(),c=encodeURIComponent(o),_=ut("dictionary-ai",i),b=`/${i}/${_}/${t.sourceLang}/${c}`,k=this.router.url;if(this.query.set(o),this.sourceLang.set(t.sourceLang),this.targetLang.set(t.targetLang),this.hasSearched.set(!0),this.errorCode.set(null),this.setSeo(o),k===b&&this.tab()==="translation"){this.runTranslate(o,t.sourceLang,t.targetLang);return}this.loading.set(!0),this.router.navigate(["/",i,_,t.sourceLang,c])}runDefine(t,o){this.loading.set(!0),this.definitionResult.set(null);let i=(this.ngxI18n.currentLang||"en").toLowerCase(),c=J.includes(i)?i:"en";this.api.define({query:t,source_lang:o,ui_lang:c,domain:"general",register:"neutral",level:"standard",include_examples:!0,include_synonyms:!0}).pipe(it(()=>this.loading.set(!1))).subscribe({next:_=>this.definitionResult.set(_),error:_=>{let b=this.extractApiCode(_);this.errorCode.set(b||"GENERIC")}})}runTranslate(t,o,i){this.loading.set(!0),this.translateResult.set(null);let c=(this.ngxI18n.currentLang||"en").toLowerCase(),_=J.includes(c)?c:"en";this.api.translate({query:t,source_lang:o,target_lang:i,ui_lang:_}).pipe(it(()=>this.loading.set(!1))).subscribe({next:b=>{this.translateResult.set(b),this.historyOpen()&&this.openHistory()},error:b=>{let k=this.extractApiCode(b);this.errorCode.set(k||"GENERIC")}})}extractApiCode(t){let o=t?.error?.detail?.code??t?.error?.code??t?.error?.detail??t?.error?.error??null;return o==null?null:String(o).toUpperCase()}static \u0275fac=function(o){return new(o||e)(rt(Yt))};static \u0275cmp=O({type:e,selectors:[["app-dictionary-ai-page"]],viewQuery:function(o,i){if(o&1&&z(gi,5,K),o&2){let c;G(c=Q())&&(i.historyBtn=c.first)}},decls:109,vars:94,consts:[["historyBtn",""],[1,"section","dictionary-ai-section"],[1,"container"],[1,"dict-hero"],[1,"dict-hero__left"],[1,"title","is-3","is-size-4-mobile","mb-1","gradient-1"],[1,"subtitle","is-6","dict-hero__subtitle"],[1,"dict-hero__actions"],["type","button",1,"button","is-light","dict-hero__btn",3,"click","disabled"],["aria-hidden","true",1,"icon","is-small"],[1,"sr-only"],[3,"close","pick","plans","viewAll","o
1pen","items","loading","hasAccess"],[1,"box","dict-shell"],[3,"tabChange","tab"],[3,"search","tab","query","sourceLang","targetLang","langsOverride","loading"],[1,"dict-body"],[1,"box","dict-body__box"],[1,"section","about"],[1,"container","about__wrap"],[1,"columns","is-vcentered","is-multiline",2,"max-width","95%","margin-inline","auto"],[1,"column","is-6"],[1,"section__title-wrapper","mb-4"],[1,"section__title"],[1,"yellow-bg-big"],["src","assets/imgs/yellow-bg.png","alt","","aria-hidden","true"],[1,"mt-2","has-text-grey"],[1,"about__list","mb-5"],["aria-hidden","true",1,"about__check"],[1,"column","is-6","has-text-centered"],[1,"about__thumb"],["src","assets/imgs/Dictionary.svg",1,"about__img",3,"alt"],[1,"content","mt-6",2,"max-width","95%","margin-inline","auto"],[1,"mt-5"],["role","status","aria-live","polite","aria-atomic","true",1,"box","dict-body__box","dict-loading"],[1,"has-text-centered"],[1,"icon"],["aria-hidden","true",1,"pi","pi-spinner","pi-spin"],["role","alert","aria-live","assertive",1,"notification","is-danger","dict-body__box"],["aria-hidden","true",1,"icon"],[1,"pi","pi-exclamation-triangle"],[3,"data"]],template:function(o,i){o&1&&(g(0,"section",1)(1,"div",2)(2,"header",3)(3,"div",4)(4,"h1",5),a(5),r(6,"translate"),p(),g(7,"p",6),a(8),r(9,"translate"),p()(),g(10,"div",7)(11,"button",8,0),M("click",function(){return i.openHistory()}),g(13,"span",9),w(14,"i"),p(),g(15,"span"),a(16),r(17,"translate"),p(),f(18,_i,3,3,"span",10),p()()(),g(19,"app-dictionary-history-drawer",11),M("close",function(){return i.historyOpen.set(!1)})("pick",function(_){return i.onPickHistory(_)})("plans",function(){return i.goToPlans()})("viewAll",function(){return i.goToFullHistory()}),p(),g(20,"div",12)(21,"app-dictionary-tabs",13),M("tabChange",function(_){return i.onTabChange(_)}),p(),g(22,"app-dictionary-search-bar",14),M("search",function(_){return i.onSearch(_)}),p()(),g(23,"div",15),f(24,ui,2,0,"div",16)(25,Ii,2,1),p()()(),g(26,"section",17)(27,"div",18)(28,"div",19)(29,"div",20)(30,"div",21)(31,"h2",22),a(32),r(33,"translate"),w(34,"br"),g(35,"span",23),a(36),r(37,"translate"),w(38,"img",24),p(),a(39),r(40,"translate"),p(),g(41,"p",25),a(42),r(43,"translate"),p()(),g(44,"div",26)(45,"ul")(46,"li")(47,"span",27),a(48,"\u2713"),p(),a(49),r(50,"translate"),p(),g(51,"li")(52,"span",27),a(53,"\u2713"),p(),a(54),r(55,"translate"),p(),g(56,"li")(57,"span",27),a(58,"\u2713"),p(),a(59),r(60,"translate"),p()()()(),g(61,"div",28)(62,"div",29),w(63,"img",30),r(64,"translate"),p()()(),g(65,"div",31)(66,"h3"),a(67),r(68,"translate"),p(),g(69,"p"),a(70),r(71,"translate"),p(),g(72,"p"),a(73),r(74,"translate"),p(),g(75,"h3",32),a(76),r(77,"translate"),p(),g(78,"p"),a(79),r(80,"translate"),p(),g(81,"h3",32),a(82),r(83,"translate"),p(),g(84,"p"),a(85),r(86,"translate"),p(),g(87,"h3",32),a(88),r(89,"translate"),p(),g(90,"ul")(91,"li"),a(92),r(93,"translate"),p(),g(94,"li"),a(95),r(96,"translate"),p(),g(97,"li"),a(98),r(99,"translate"),p(),g(100,"li"),a(101),r(102,"translate"),p(),g(103,"li"),a(104),r(105,"translate"),p(),g(106,"li"),a(107),r(108,"translate"),p()()()()()),o&2&&(n(5),h(" ",s(6,44,"DICTIONARY_AI.TITLE")," "),n(3),h(" ",s(9,46,"DICTIONARY_AI.SUBTITLE")," "),n(3),I("disabled",i.historyLoading()),x("aria-busy",i.historyLoading()?"true":null),n(3),st(i.historyLoading()?"pi pi-spinner pi-spin":"pi pi-history"),n(2),u(s(17,48,"DICTIONARY_AI.HISTORY_BTN")),n(2),C(i.historyLoading()?18:-1),n(),I("open",i.historyOpen())("items",i.historyItems())("loading",i.historyLoading())("hasAccess",i.hasHistoryAccess()),n(2),I("tab",i.tab()),n(),I("tab",i.tab())("query",i.query())("sourceLang",i.sourceLang())("targetLang",i.targetLang())("langsOverride",i.langsForTab())("loading",i.loading()),n(2),C(i.hasSearched()?25:24),n(2),R("is-rtl",i.isRtl()),n(6),h(" ",s(33,50,"ABOUT.DICTIONARY.TITLE.PREFIX")," "),n(4),h(" ",s(37,52,"ABOUT.DICTIONARY.TITLE.HIGHLIGHT")," "),n(3),h(" ",s(40,54,"ABOUT.DICTIONARY.TITLE.SUFFIX")," "),n(3),h(" ",s(43,56,"ABOUT.DICTIONARY.DESC")," "),n(7),h(" ",s(50,58,"ABOUT.DICTIONARY.LI1")," "),n(5),h(" ",s(55,60,"ABOUT.DICTIONARY.LI2")," "),n(5),h(" ",s(60,62,"ABOUT.DICTIONARY.LI3")," "),n(4),I("alt",s(64,64,"ABOUT.DICTIONARY.ILLUSTRATION_ALT")),n(4),u(s(68,66,"ABOUT.DICTIONARY.HOW.TITLE")),n(3),u(s(71,68,"ABOUT.DICTIONARY.HOW.P1")),n(3),u(s(74,70,"ABOUT.DICTIONARY.HOW.P2")),n(3),u(s(77,72,"ABOUT.DICTIONARY.WHY_IMPORTANT.TITLE")),n(3),u(s(80,74,"ABOUT.DICTIONARY.WHY_IMPORTANT.P1")),n(3),u(s(83,76,"ABOUT.DICTIONARY.BENEFITS.TITLE")),n(3),u(s(86,78,"ABOUT.DICTIONARY.BENEFITS.P1")),n(3),u(s(89,80,"ABOUT.DICTIONARY.WHY_US.TITLE")),n(4),u(s(93,82,"ABOUT.DICTIONARY.WHY_US.L1")),n(3),u(s(96,84,"ABOUT.DICTIONARY.WHY_US.L2")),n(3),u(s(99,86,"ABOUT.DICTIONARY.WHY_US.L3")),n(3),u(s(102,88,"ABOUT.DICTIONARY.WHY_US.L4")),n(3),u(s(105,90,"ABOUT.DICTIONARY.WHY_US.L5")),n(3),u(s(108,92,"ABOUT.DICTIONARY.WHY_US.L6")))},dependencies:[Nt,S,ee,ae,ne,de,se,pe,E],styles:['@charset "UTF-8";.dictionary-ai-section[_ngcontent-%COMP%]{padding-top:1.75rem}.dict-hero[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;max-width:1040px;margin:0 0 1rem!important}.dict-hero__subtitle[_ngcontent-%COMP%]{margin-bottom:0;opacity:.85}.dict-hero__actions[_ngcontent-%COMP%]{flex:0 0 auto;display:flex;align-items:center;gap:.75rem}.dict-hero__btn[_ngcontent-%COMP%]{border-radius:999px}.dict-shell[_ngcontent-%COMP%]{max-width:1040px;margin:0 auto;padding:1.25rem;border-radius:16px;box-shadow:0 14px 30px #0000000f}.dict-body[_ngcontent-%COMP%]{max-width:980px;margin:1.25rem 0 0!important}.dict-body__box[_ngcontent-%COMP%]{border-radius:16px;box-shadow:0 14px 30px #0000000f}.dict-loading[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;min-height:140px}@media(max-width:768px){.dict-hero[_ngcontent-%COMP%]{flex-direction:column;align-items:stretch;text-align:center}.dict-hero__actions[_ngcontent-%COMP%]{justify-content:center}.dict-hero__btn[_ngcontent-%COMP%]{width:100%}}.about[_ngcontent-%COMP%]{padding:0rem 0;color:var(--text);background:transparent}.about__wrap[_ngcontent-%COMP%]{max-width:clamp(760px,82vw,980px);margin-inline:auto;padding-inline:clamp(1rem,3vw,1.25rem)}.about__thumb[_ngcontent-%COMP%]{text-align:center}.about__thumb[_ngcontent-%COMP%] img.about__img[_ngcontent-%COMP%]{max-width:100%;border-radius:.625rem;display:inline-block}.section__title[_ngcontent-%COMP%]{font-size:clamp(28px,3.2vw,40px);line-height:1.15;margin-bottom:3px;color:var(--text);text-transform:capitalize}
1.section__title[_ngcontent-%COMP%] .yellow-bg-big[_ngcontent-%COMP%]{position:relative;display:inline-block}.section__title[_ngcontent-%COMP%] .yellow-bg-big[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{position:absolute;left:0;right:0;bottom:-23%;width:100%;height:40%;pointer-events:none;animation:_ngcontent-%COMP%_section-animation-2 3s infinite ease-in-out;opacity:.9;filter:saturate(1.1)}@keyframes _ngcontent-%COMP%_section-animation-2{0%,to{transform:translateY(0);opacity:.9}50%{transform:translateY(3px);opacity:1}}.about__list[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{margin-left:0;padding-left:0;list-style:none}.about__list[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:flex;gap:10px;align-items:flex-start;padding:.35rem 0}.about__check[_ngcontent-%COMP%]{font-weight:900;color:var(--primary);line-height:1.2;margin-top:2px}.about.is-rtl[_ngcontent-%COMP%], .about.is-rtl[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{direction:rtl;text-align:right}.about.is-rtl[_ngcontent-%COMP%] .about__check[_ngcontent-%COMP%]{margin-left:0;margin-right:0}.dict-hero[_ngcontent-%COMP%], .dict-shell[_ngcontent-%COMP%], .dict-body[_ngcontent-%COMP%]{width:100%;max-width:none;margin-left:auto;margin-right:auto}.dict-hero[_ngcontent-%COMP%], .dict-shell[_ngcontent-%COMP%]{margin:0 0 1rem}.dict-body[_ngcontent-%COMP%]{margin:1.25rem 0 0}[_nghost-%COMP%]{--dict-radius: 16px;--dict-border: rgba(16, 24, 40, .12);--dict-border-dark: rgba(255, 255, 255, .1);--dict-bg: #fff;--dict-bg-soft: rgba(99, 102, 241, .04)}:root[data-theme=dark] [_nghost-%COMP%]{--dict-border: var(--dict-border-dark);--dict-bg: var(--bulma-box-background-color);--dict-bg-soft: rgba(99, 102, 241, .1)}.dict-shell[_ngcontent-%COMP%], .dict-body__box[_ngcontent-%COMP%]{border-radius:var(--dict-radius);background:var(--dict-bg);border:1px solid var(--dict-border);box-shadow:none!important}.dict-shell[_ngcontent-%COMP%], .dict-body__box[_ngcontent-%COMP%]{padding:1.1rem}.dict-shell[_ngcontent-%COMP%]:hover, .dict-body__box[_ngcontent-%COMP%]:hover{border-color:#6366f159}.dict-hero[_ngcontent-%COMP%]{padding:.35rem 0}.dict-hero__btn[_ngcontent-%COMP%]{border-radius:999px;border:1px solid var(--dict-border);background:var(--dict-bg)}.dict-hero__btn[_ngcontent-%COMP%]:focus, .dict-hero__btn[_ngcontent-%COMP%]:focus-visible{outline:none;box-shadow:0 0 0 4px #6366f12e}.sr-only[_ngcontent-%COMP%]{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}.dict-hero__btn.button[_ngcontent-%COMP%]{background:var(--dict-bg)!important;border:1px solid var(--dict-border)!important;color:var(--bulma-text-strong)!important}.dict-hero__btn.button[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{color:currentColor!important}.dict-hero__btn.button[_ngcontent-%COMP%]:not([disabled]):hover{border-color:#6366f18c!important;background:var(--dict-bg-soft)!important}[_ngcontent-%COMP%]:root[data-theme=dark] .dict-hero__btn.button[_ngcontent-%COMP%]{background:#ffffff0f!important;border-color:#ffffff2e!important;color:var(--bulma-text-strong)!important}[_ngcontent-%COMP%]:root[data-theme=dark] .dict-hero__btn.button[_ngcontent-%COMP%]:not([disabled]):hover{background:#ffffff17!important;border-color:#6366f1bf!important}.dict-hero__btn.button[disabled][_ngcontent-%COMP%]{opacity:.6;cursor:not-allowed}'],changeDetection:1})}return e})()});vi();export{Nn as DictionaryAiPageComponent};
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.