UNPKG

otus-localization

Version:

A translation tool for Angular i18n(angular-t9n)

2 lines 6.85 kB
"use strict";(self.webpackChunkotus_translation=self.webpackChunkotus_translation||[]).push([[726],{2726:(q,R,o)=>{o.r(R),o.d(R,{AutoMigrateComponent:()=>k});var s=o(6814),i=o(6223),c=o(2296),O=o(5683),g=o(4516),C=o(5940),S=o(3566),T=o(5313),M=o(2596),d=o(5619),G=o(7115),_=o(5879);function D(e,t){1&e&&(_.TgZ(0,"mat-error"),_.SDv(1,9),_.qZA())}function L(e,t){1&e&&(_.TgZ(0,"mat-error"),_.SDv(1,10),_.qZA())}function $(e,t){1&e&&_._UZ(0,"mat-spinner")}function H(e,t){1&e&&(_.ynx(0),_.TgZ(1,"h4"),_.SDv(2,11),_.qZA(),_.BQk())}function b(e,t){1&e&&(_.TgZ(0,"th",24),_.SDv(1,25),_.qZA())}function Z(e,t){if(1&e&&(_.TgZ(0,"td",26),_._uU(1),_.qZA()),2&e){const n=t.$implicit;_.Q6J("matTooltip",null==n.locations?null:n.locations.join("\n"))("matTooltipDisabled",!(null!=n.locations&&n.locations.length)),_.xp6(1),_.hij(" ",n.id," ")}}function K(e,t){1&e&&(_.TgZ(0,"th",24),_.SDv(1,27),_.qZA())}function v(e,t){if(1&e&&(_.TgZ(0,"td",28),_._uU(1),_.qZA()),2&e){const n=t.$implicit;_.xp6(1),_.Oqu(n.description)}}function X(e,t){1&e&&(_.TgZ(0,"th",24),_.SDv(1,29),_.qZA())}function y(e,t){if(1&e&&(_.TgZ(0,"td",28),_._uU(1),_.qZA()),2&e){const n=t.$implicit;_.xp6(1),_.Oqu(n.meaning)}}function x(e,t){1&e&&(_.TgZ(0,"th",24),_.SDv(1,30),_.qZA())}function F(e,t){if(1&e&&(_.TgZ(0,"td",28),_._uU(1),_.qZA()),2&e){const n=t.$implicit;_.xp6(1),_.Oqu(n.source)}}function Q(e,t){1&e&&_._UZ(0,"tr",31)}function w(e,t){1&e&&_._UZ(0,"tr",32)}const u=function(){return["id","description","meaning","source"]};function B(e,t){if(1&e&&(_.ynx(0),_.TgZ(1,"h4"),_.SDv(2,12),_.qZA(),_.TgZ(3,"div",13)(4,"table",14),_.ynx(5,15),_.YNc(6,b,2,0,"th",16),_.YNc(7,Z,2,3,"td",17),_.BQk(),_.ynx(8,18),_.YNc(9,K,2,0,"th",16),_.YNc(10,v,2,1,"td",19),_.BQk(),_.ynx(11,20),_.YNc(12,X,2,0,"th",16),_.YNc(13,y,2,1,"td",19),_.BQk(),_.ynx(14,21),_.YNc(15,x,2,0,"th",16),_.YNc(16,F,2,1,"td",19),_.BQk(),_.YNc(17,Q,1,0,"tr",22),_.YNc(18,w,1,0,"tr",23),_.qZA()(),_.BQk()),2&e){const n=_.oxw().ngIf;_.xp6(4),_.Q6J("dataSource",n),_.xp6(13),_.Q6J("matHeaderRowDef",_.DdM(4,u))("matHeaderRowDefSticky",!0),_.xp6(1),_.Q6J("matRowDefColumns",_.DdM(5,u))}}function Y(e,t){if(1&e&&(_.ynx(0),_.YNc(1,H,3,0,"ng-container",6),_.YNc(2,B,19,6,"ng-container",6),_.BQk()),2&e){const n=t.ngIf;_.xp6(1),_.Q6J("ngIf",!n.length),_.xp6(1),_.Q6J("ngIf",n.length)}}let k=(()=>{class e{constructor(n,E){this._sourceOrphansService=n,this.loading=new d.X(!1),this.migrations=new d.X(null),this.configuration=E.group({distanceThreshold:[0,[i.kI.min(0),i.kI.required]]})}autoMigrate(){this.loading.next(!0);const n=+this.configuration.get("distanceThreshold").value;this._sourceOrphansService.autoMigrateOrphans(n).subscribe(E=>{this.migrations.next(E),this.loading.next(!1)})}static{this.\u0275fac=function(E){return new(E||e)(_.Y36(G.e),_.Y36(i.QS))}}static{this.\u0275cmp=_.Xpm({type:e,selectors:[["t9n-auto-migrate"]],standalone:!0,features:[_.jDz],decls:19,vars:12,consts:function(){let n,E,r,A,l,N,U,f,m,I,P,p,h;return n=$localize`:␟b526d031b42722e7cf8f52258430151b09155310␟8720444212022970709:Auto-Migration`,E=$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. `,r=$localize`:␟d7889457595bfbba70a08a2fda7900d9a03c145d␟1566498821816930256:Distance Threshold`,A=$localize`:␟e3edd3e19833c7f464489875500c01f419dc5bf9␟6106421584531086998: Auto-Migrate `,l=$localize`:␟f65037cd7d8696da381c6bbfdb16a64e68cfd8f9␟8169327733416527426:The distance threshold is required`,N=$localize`:␟9798f27134a0031635334c98475b181d4b5fde46␟5286185694292962955:The distance threshold must be greater or equal to 0`,U=$localize`:␟7a0a2c89ce48e66e873d5af4ab5586dc2325c019␟190365802837090999:No orphans met conditions.`,f=$localize`:␟4d56cc943bf3b8863ab0a40c3e30d1a75763c968␟693184310236136215:Successful migrations`,m=$localize`:␟a449a33f34e3a6c40b82058c0d69ff39a9f1e925␟2250356394431390492:Similar units`,I=$localize`:␟2798cc1e152b1ec07fd8daf94a2a073d1ba1ebcc␟7286430803380181008:Id`,P=$localize`:␟eec715de352a6b114713b30b640d319fa78207a0␟4902817035128594900:Description`,p=$localize`:␟f2081dbd0b230b2e61d03f870d85af5b54aed1ba␟2984907873245479480:Meaning`,h=$localize`:␟6834fa6b43d1ecbdf147c48dd9c4d72f1484571d␟9155608366859514313:Source`,[n,E,["href","https://en.wikipedia.org/wiki/Levenshtein_distance"],[3,"formGroup","ngSubmit"],r,["matInput","","type","number","formControlName","distanceThreshold","required","","min","0"],[4,"ngIf"],["mat-raised-button","","color","primary",3,"disabled"],A,l,N,U,f,[1,"mat-elevation-z1"],["mat-table","","matSort","","aria-label",m,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",""],I,["mat-cell","","matTooltipClass","tooltip-linebreak",3,"matTooltip","matTooltipDisabled"],P,["mat-cell",""],p,h,["mat-header-row",""],["mat-row",""]]},template:function(E,r){if(1&E&&(_.TgZ(0,"h2"),_.SDv(1,0),_.qZA(),_.TgZ(2,"p"),_.tHW(3,1),_._UZ(4,"a",2),_.N_p(),_.qZA(),_.TgZ(5,"form",3),_.NdJ("ngSubmit",function(){return r.autoMigrate()}),_.TgZ(6,"mat-form-field")(7,"mat-label"),_.SDv(8,4),_.qZA(),_._UZ(9,"input",5),_.YNc(10,D,2,0,"mat-error",6),_.YNc(11,L,2,0,"mat-error",6),_.qZA(),_.TgZ(12,"button",7),_.SDv(13,8),_.ALo(14,"async"),_.qZA()(),_.YNc(15,$,1,0,"mat-spinner",6),_.ALo(16,"async"),_.YNc(17,Y,3,2,"ng-container",6),_.ALo(18,"async")),2&E){let A,l;_.xp6(5),_.Q6J("formGroup",r.configuration),_.xp6(5),_.Q6J("ngIf",null==(A=r.configuration.get("distanceThreshold"))||null==A.errors?null:A.errors.required),_.xp6(1),_.Q6J("ngIf",null==(l=r.configuration.get("distanceThreshold"))||null==l.errors?null:l.errors.min),_.xp6(1),_.Q6J("disabled",_.lcZ(14,6,r.loading)&&r.configuration.valid),_.xp6(3),_.Q6J("ngIf",_.lcZ(16,8,r.loading)),_.xp6(2),_.Q6J("ngIf",_.lcZ(18,10,r.migrations))}},dependencies:[i.UX,i._Y,i.Fj,i.wV,i.JJ,i.JL,i.Q7,i.qQ,i.sg,i.u,O.lN,O.KE,O.hX,O.TO,g.c,g.Nt,s.O5,c.ot,c.lW,C.Cq,C.Ou,T.p0,T.BZ,T.fO,T.as,T.w1,T.Dz,T.nj,T.ge,T.ev,T.XQ,T.Gk,S.JX,S.YE,S.nU,M.AV,M.gM,s.Ov],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})}}return e})()}}]);