UNPKG

angular-t9n

Version:

A translation tool for Angular i18n

4 lines (3 loc) 6.92 kB
import{a as Ce,b as Ne}from"./chunk-VQWKSEEM.js";import{a as Oe}from"./chunk-KZXKYXXO.js";import{c as re,d as le}from"./chunk-PPUOYFLG.js";import"./chunk-3RK6DDJD.js";import{a as ie,b as oe,g as _e,j as ae}from"./chunk-WVL5UBM6.js";import{a as de,b as me,c as se,d as ce,e as Te,f as Me,g as Ae,h as ge,i as ue,j as pe,k as fe,l as Se,m as Ee,n as Re}from"./chunk-F5XE4YAN.js";import{a as q,b as B}from"./chunk-YO72B5SH.js";import{b as x,c as z}from"./chunk-MFCYHQDO.js";import{b as V,c as N,e as j,f as K,j as J,k as Q,m as W,n as Y,o as Z,p as ee,q as te,r as ne}from"./chunk-TOPF3UHX.js";import"./chunk-FK6IRHWX.js";import"./chunk-4NKRI2IB.js";import"./chunk-NRGBO6B5.js";import"./chunk-XUIN44YA.js";import{Ab as T,Bb as M,Fb as L,Gb as H,Hb as l,Ib as F,Ic as X,Jb as w,Kc as k,Ta as _,Xb as p,Yb as f,Zb as v,ac as C,cb as D,da as O,dc as S,ec as E,hb as m,i as R,wb as a,xb as n,yb as i,zb as u}from"./chunk-IRWV2DJQ.js";import"./chunk-4CLCTAJ7.js";var Pe=()=>["id","description","meaning","source"];function he(e,t){e&1&&(n(0,"mat-error"),l(1,4),i())}function Ie(e,t){e&1&&(n(0,"mat-error"),l(1,5),i())}function Ge(e,t){e&1&&u(0,"mat-spinner")}function Ue(e,t){e&1&&(T(0),n(1,"h4"),l(2,6),i(),M())}function $e(e,t){e&1&&(n(0,"th",28),l(1,8),i())}function be(e,t){if(e&1&&(n(0,"td",29),p(1),i()),e&2){let o=t.$implicit;a("matTooltip",o.locations==null?null:o.locations.join(` `))("matTooltipDisabled",!(o.locations!=null&&o.locations.length)),_(),v(" ",o.id," ")}}function ye(e,t){e&1&&(n(0,"th",28),l(1,9),i())}function De(e,t){if(e&1&&(n(0,"td",30),p(1),i()),e&2){let o=t.$implicit;_(),f(o.description)}}function Le(e,t){e&1&&(n(0,"th",28),l(1,10),i())}function He(e,t){if(e&1&&(n(0,"td",30),p(1),i()),e&2){let o=t.$implicit;_(),f(o.meaning)}}function Fe(e,t){e&1&&(n(0,"th",28),l(1,11),i())}function we(e,t){if(e&1&&(n(0,"td",30),p(1),i()),e&2){let o=t.$implicit;_(),f(o.source)}}function ve(e,t){e&1&&u(0,"tr",31)}function Xe(e,t){e&1&&u(0,"tr",32)}function ke(e,t){if(e&1&&(T(0),n(1,"h4"),l(2,7),i(),n(3,"div",17)(4,"table",18),T(5,19),m(6,$e,2,0,"th",20)(7,be,2,3,"td",21),M(),T(8,22),m(9,ye,2,0,"th",20)(10,De,2,1,"td",23),M(),T(11,24),m(12,Le,2,0,"th",20)(13,He,2,1,"td",23),M(),T(14,25),m(15,Fe,2,0,"th",20)(16,we,2,1,"td",23),M(),m(17,ve,1,0,"tr",26)(18,Xe,1,0,"tr",27),i()(),M()),e&2){let o=w().ngIf;_(4),a("dataSource",o),_(13),a("matHeaderRowDef",C(4,Pe))("matHeaderRowDefSticky",!0),_(),a("matRowDefColumns",C(5,Pe))}}function xe(e,t){if(e&1&&(T(0),m(1,Ue,3,0,"ng-container",15)(2,ke,19,6,"ng-container",15),M()),e&2){let o=t.ngIf;_(),a("ngIf",!o.length),_(),a("ngIf",o.length)}}var ct=(()=>{let t=class t{constructor(){this._sourceOrphansService=O(Oe),this.loading=new R(!1),this.migrations=new R(null);let c=O(te);this.configuration=c.group({distanceThreshold:[0,[N.min(0),N.required]]})}autoMigrate(){this.loading.next(!0);let c=+this.configuration.get("distanceThreshold").value;this._sourceOrphansService.autoMigrateOrphans(c).subscribe(s=>{this.migrations.next(s),this.loading.next(!1)})}};t.\u0275fac=function(s){return new(s||t)},t.\u0275cmp=D({type:t,selectors:[["t9n-auto-migrate"]],decls:19,vars:12,consts:()=>{let c;c=$localize`:␟b526d031b42722e7cf8f52258430151b09155310␟8720444212022970709:Auto-Migration`;let s;s=$localize`:␟645da333888a6046d72b7f15fd1e87a9867f6e0b␟3354447976218397931: Migrate orphans which are below or equal to the distance threshold. The distance is according to the ${"\uFFFD#4\uFFFD"}:START_LINK:levenshtein algorithm${"\uFFFD/#4\uFFFD"}:CLOSE_LINK:. It will skip the auto-migration for a unit if multiple units with the same distance are found. `;let d;d=$localize`:␟d7889457595bfbba70a08a2fda7900d9a03c145d␟1566498821816930256:Distance Threshold`;let A;A=$localize`:␟e3edd3e19833c7f464489875500c01f419dc5bf9␟6106421584531086998: Auto-Migrate `;let g;g=$localize`:␟f65037cd7d8696da381c6bbfdb16a64e68cfd8f9␟8169327733416527426:The distance threshold is required`;let P;P=$localize`:␟9798f27134a0031635334c98475b181d4b5fde46␟5286185694292962955:The distance threshold must be greater or equal to 0`;let h;h=$localize`:␟7a0a2c89ce48e66e873d5af4ab5586dc2325c019␟190365802837090999:No orphans met conditions.`;let I;I=$localize`:␟a449a33f34e3a6c40b82058c0d69ff39a9f1e925␟2250356394431390492:Similar units`;let G;G=$localize`:␟4d56cc943bf3b8863ab0a40c3e30d1a75763c968␟693184310236136215:Successful migrations`;let U;U=$localize`:␟2798cc1e152b1ec07fd8daf94a2a073d1ba1ebcc␟7286430803380181008:Id`;let $;$=$localize`:␟eec715de352a6b114713b30b640d319fa78207a0␟4902817035128594900:Description`;let b;b=$localize`:␟f2081dbd0b230b2e61d03f870d85af5b54aed1ba␟2984907873245479480:Meaning`;let y;return y=$localize`:␟6834fa6b43d1ecbdf147c48dd9c4d72f1484571d␟9155608366859514313:Source`,[c,s,d,A,g,P,h,G,U,$,b,y,["href","https://en.wikipedia.org/wiki/Levenshtein_distance"],[3,"ngSubmit","formGroup"],["matInput","","type","number","formControlName","distanceThreshold","required","","min","0"],[4,"ngIf"],["mat-raised-button","","color","primary",3,"disabled"],[1,"mat-elevation-z1"],["mat-table","","matSort","","aria-label",I,3,"dataSource"],["matColumnDef","id"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","","matTooltipClass","tooltip-linebreak",3,"matTooltip","matTooltipDisabled",4,"matCellDef"],["matColumnDef","description"],["mat-cell","",4,"matCellDef"],["matColumnDef","meaning"],["matColumnDef","source"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell","","mat-sort-header",""],["mat-cell","","matTooltipClass","tooltip-linebreak",3,"matTooltip","matTooltipDisabled"],["mat-cell",""],["mat-header-row",""],["mat-row",""]]},template:function(s,d){if(s&1&&(n(0,"h2"),l(1,0),i(),n(2,"p"),L(3,1),u(4,"a",12),H(),i(),n(5,"form",13),F("ngSubmit",function(){return d.autoMigrate()}),n(6,"mat-form-field")(7,"mat-label"),l(8,2),i(),u(9,"input",14),m(10,he,2,0,"mat-error",15)(11,Ie,2,0,"mat-error",15),i(),n(12,"button",16),S(13,"async"),l(14,3),i()(),m(15,Ge,1,0,"mat-spinner",15),S(16,"async"),m(17,xe,3,2,"ng-container",15),S(18,"async")),s&2){let A,g;_(5),a("formGroup",d.configuration),_(5),a("ngIf",(A=d.configuration.get("distanceThreshold"))==null||A.errors==null?null:A.errors.required),_(),a("ngIf",(g=d.configuration.get("distanceThreshold"))==null||g.errors==null?null:g.errors.min),_(),a("disabled",E(13,6,d.loading)&&d.configuration.valid),_(3),a("ngIf",E(16,8,d.loading)),_(2),a("ngIf",E(18,10,d.migrations))}},dependencies:[ne,J,V,Q,j,K,ee,Z,W,Y,ae,_e,ie,oe,le,re,X,z,x,Ne,Ce,Re,ce,Me,pe,Ae,Te,fe,ge,ue,Se,Ee,se,de,me,B,q,k],styles:["[_nghost-%COMP%]{display:block;padding:0 1.5rem}form[_ngcontent-%COMP%]{margin-bottom:1rem}form[_ngcontent-%COMP%] > button[_ngcontent-%COMP%]{display:block;margin-top:2rem}"],changeDetection:0});let e=t;return e})();export{ct as AutoMigrateComponent};