1(self.webpackChunkdspace_angular=self.webpackChunkdspace_angular||[]).push([[3725],{18617:(k,w,i)=>{"use strict";i.d(w,{t:()=>A});var E=i(85102),a=i(54460),t=i(53107),G=(i(47587),i(64756)),y=i(50277),M=i(11509);function b(D,h){if(1&D){const o=t.RV6();t.j41(0,"ds-dso-edit-metadata-value",3),t.bIt("edit",function(){const _=t.eBV(o).$implicit;return t.Njj(_.editing=!0)})("confirm",function(_){const v=t.eBV(o).$implicit,T=t.XpG();return v.confirmChanges(_),T.form.resetReinstatable(),t.Njj(T.valueSaved.emit())})("remove",function(){const _=t.eBV(o),v=_.$implicit,T=_.index,C=t.XpG();return v.change===C.DsoEditMetadataChangeTypeEnum.ADD?C.form.remove(C.mdField,T):v.change=C.DsoEditMetadataChangeTypeEnum.REMOVE,C.form.resetReinstatable(),t.Njj(C.valueSaved.emit())})("undo",function(){const _=t.eBV(o),v=_.$implicit,T=_.index,C=t.XpG();return v.change===C.DsoEditMetadataChangeTypeEnum.ADD?C.form.remove(C.mdField,T):v.discard(),t.Njj(C.valueSaved.emit())})("dragging",function(_){t.eBV(o);const v=t.XpG();return t.Njj(v.draggingMdField$.next(_?v.mdField:null))}),t.k0s()}if(2&D){const o=h.$implicit,l=t.XpG();t.Y8G("dso",l.dso)("mdValue",o)("mdField",l.mdField)("dsoType",l.dsoType)("saving$",l.saving$)("isOnlyValue",1===l.form.fields[l.mdField].length)}}let A=(()=>{class D{constructor(){this.valueSaved=new t.bkB,this.DsoEditMetadataChangeTypeEnum=G.QR}drop(o){(0,E.HD)(this.form.fields[this.mdField],o.previousIndex,o.currentIndex),this.form.fields[this.mdField].forEach((v,T)=>{v.newValue.place=T,v.confirmChanges()}),this.form.resetReinstatable(),this.valueSaved.emit()}static#t=this.\u0275fac=function(l){return new(l||D)};static#e=this.\u0275cmp=t.VBU({type:D,selectors:[["ds-dso-edit-metadata-field-values"]],inputs:{dso:"dso",form:"form",mdField:"mdField",dsoType:"dsoType",saving$:"saving$",draggingMdField$:"draggingMdField$"},outputs:{valueSaved:"valueSaved"},standalone:!0,features:[t.aNF],decls:5,vars:8,consts:[["cdkDropList","","role","table",1,"flex-grow-1","ds-drop-list","h-100",3,"cdkDropListDropped"],["role","presentation",3,"dsoType"],["role","presentation",3,"dso","mdValue","mdField","dsoType","saving$","isOnlyValue","edit","confirm","remove","undo","dragging",4,"ngFor","ngForOf"],["role","presentation",3,"edit","confirm","remove","undo","dragging","dso","mdValue","mdField","dsoType","saving$","isOnlyValue"]],template:function(l,_){1&l&&(t.j41(0,"div",0),t.nI1(1,"async"),t.nI1(2,"async"),t.bIt("cdkDropListDropped",function(T){return _.drop(T)}),t.nrm(3,"ds-dso-edit-metadata-value-headers",1),t.DNE(4,b,1,6,"ds-dso-edit-metadata-value",2),t.k0s()),2&l&&(t.AVh("disabled",t.bMT(1,4,_.draggingMdField$)&&t.bMT(2,6,_.draggingMdField$)!==_.mdField),t.R7$(3),t.Y8G("dsoType",_.dsoType),t.R7$(),t.Y8G("ngForOf",_.form.fields[_.mdField]))},dependencies:[E.O7,M.c,a.pM,y.o,a.Jj],styles:[".ds-drop-list[_ngcontent-%COMP%]{background-color:var(--bs-gray-500)}.ds-drop-list.disabled[_ngcontent-%COMP%]{opacity:.3}"]})}return D})()},64756:(k,w,i)=>{"use strict";i.d(w,{QR:()=>b,qf:()=>D});class E{constructor(o,l){this.op=o,this.field=l}}let a=(()=>
1{class h extends E{static#t=this.operationType="add";constructor(l,_){super(h.operationType,l),this.value=_}toOperation(){return{op:this.op,path:`/metadata/${this.field}/-`,value:this.value}}}return h})(),t=(()=>{class h extends E{static#t=this.operationType="move";constructor(l,_,v){super(h.operationType,l),this.from=_,this.to=v}toOperation(){return{op:this.op,from:`/metadata/${this.field}/${this.from}`,path:`/metadata/${this.field}/${this.to}`}}}return h})(),f=(()=>{class h extends E{static#t=this.operationType="remove";constructor(l,_){super(h.operationType,l),this.place=_}toOperation(){return{op:this.op,path:`/metadata/${this.field}/${this.place}`}}}return h})(),G=(()=>{class h extends E{static#t=this.operationType="replace";constructor(l,_,v){super(h.operationType,l),this.place=_,this.value=v}toOperation(){return{op:this.op,path:`/metadata/${this.field}/${this.place}`,value:this.value}}}return h})();var y=i(64953),M=i(72683),b=function(h){return h[h.UPDATE=1]="UPDATE",h[h.ADD=2]="ADD",h[h.REMOVE=3]="REMOVE",h}(b||{});class A{constructor(o,l=!1){this.editing=!1,this.reordered=!1,this.originalValue=o,this.newValue=Object.assign(new y.vD,o),l&&(this.change=b.ADD,this.editing=!0)}confirmChanges(o=!1){this.reordered=this.originalValue.place!==this.newValue.place,((0,M.Tn)(this.change)||this.change===b.UPDATE)&&(this.change=this.originalValue.value!==this.newValue.value||this.originalValue.language!==this.newValue.language||this.originalValue.authority!==this.newValue.authority||this.originalValue.confidence!==this.newValue.confidence?b.UPDATE:void 0),o&&(this.editing=!1)}hasChanges(){return(0,M.a4)(this.change)||this.reordered}discardAndMarkReinstatable(){(this.change===b.UPDATE||this.reordered)&&(this.reinstatableValue=this.newValue),this.reinstatableChange=this.change,this.discard(!1)}discard(o=!0){this.change=void 0;const l=this.newValue.place;this.newValue=Object.assign(new y.vD,this.originalValue),o&&(this.newValue.place=l),this.confirmChanges(!0)}reinstate(){(0,M.a4)(this.reinstatableValue)&&(this.newValue=this.reinstatableValue,this.reinstatableValue=void 0),(0,M.a4)(this.reinstatableChange)&&(this.change=this.reinstatableChange,this.reinstatableChange=void 0),this.confirmChanges()}isReinstatable(){return(0,M.a4)(this.reinstatableValue)||(0,M.a4)(this.reinstatableChange)}resetReinstatable(){this.reinstatableValue=void 0,this.reinstatableChange=void 0}}class D{constructor(o){this.originalFieldKeys=[],this.fieldKeys=[],this.fields={},this.reinstatableNewValues={},Object.entries(o).forEach(([l,_])=>{this.originalFieldKeys.push(l),this.fieldKeys.push(l),this.setValuesForFieldSorted(l,_.map(v=>new A(v)))}),this.sortFieldKeys()}add(){(0,M.Tn)(this.newValue)&&(this.newValue=new A(new y.vD,!0))}setMetadataField(o){this.newValue.editing=!1,this.addValueToField(this.newValue,o);const l=this.fields[o].length-1;this.fields[o][l].originalValue.place=l,this.fields[o][l].newValue.place=l,this.newValue=void 0}addValueToField(o,l){(0,M.Im)(this.fields[l])&&(this.fieldKeys.push(l),this.sortFieldKeys(),this.fields[l]=[]),this.fields[l].push(o)}remove(o,l){(0,M.hj)(this.fields[o])&&(this.fields[o].splice(l,1),0===this.fields[o].length&&(this.fieldKeys.splice(this.fieldKeys.indexOf(o),1),delete this.fields[o]))}hasChanges(){return Object.values(this.fields).some(o=>o.some(l=>l.hasChanges()))}hasOrderChanges(o){return this.fields[o].some(l=>l.originalValue.place!==l.newValue.place)}discard(){this.resetReinstatable(),Object.entries(this.fields).forEach(([o,l])=>{let _=-1;l.forEach((v,T)=>{v.change===b.ADD?((0,M.Im)(this.reinstatableNewValues[o])&&(this.reinstatableNewValues[o]=[]),this.reinstatableNewValues[o].push(v),-1===_&&(_=T)):v.discardAndMarkReinstatable()}),_>-1&&this.fields[o].splice(_,this.fields[o].length-_)}),this.fieldKeys.forEach(o=>{this.originalFieldKeys.indexOf(o)<0&&delete this.fields[o]}),this.fieldKeys=[...this.originalFieldKeys],this.sortFieldKeys(),this.fieldKeys.forEach(o=>{this.setValuesForFieldSorted(o,this.fields[o])})}resetOrder(o){this.fields[o].forEach(l=>{l.newValue.place=l.originalValue.place,l.confirmChanges()}),this.setValuesForFieldSorted(o,this.fields[o])}sortFieldKeys(){this.fieldKeys.sort((o,l)=>o.localeCompare(l))}
1reinstate(){Object.values(this.fields).forEach(o=>{o.forEach(l=>{l.reinstate()})}),Object.entries(this.reinstatableNewValues).forEach(([o,l])=>{l.forEach(_=>{this.addValueToField(_,o)})}),this.fieldKeys.forEach(o=>{this.setValuesForFieldSorted(o,this.fields[o])}),this.reinstatableNewValues={}}isReinstatable(){return(0,M.hj)(this.reinstatableNewValues)||Object.values(this.fields).some(o=>o.some(l=>l.isReinstatable()))}resetReinstatable(){this.reinstatableNewValues={},Object.values(this.fields).forEach(o=>{o.forEach(l=>{l.resetReinstatable()})})}setValuesForFieldSorted(o,l){this.fields[o]=l.sort((_,v)=>_.newValue.place-v.newValue.place)}getOperations(o){const l=[];return Object.entries(this.fields).forEach(([_,v])=>{const T=[],C=[],O=[];[...v].sort((m,L)=>m.originalValue.place-L.originalValue.place).forEach(m=>{(0,M.a4)(m.change)&&(m.change===b.UPDATE?(m.originalValue.value!==m.newValue.value||m.originalValue.language!==m.newValue.language||m.originalValue.authority!==m.newValue.authority||m.originalValue.confidence!==m.newValue.confidence)&&T.push(new G(_,m.originalValue.place,{value:m.newValue.value,language:m.newValue.language,authority:m.newValue.authority,confidence:m.newValue.confidence})):m.change===b.REMOVE?C.push(new f(_,m.originalValue.place)):m.change===b.ADD?O.push(new a(_,{value:m.newValue.value,language:m.newValue.language,authority:m.newValue.authority,confidence:m.newValue.confidence})):console.warn("Illegal metadata change state detected for",m))}),l.push(...T.map(m=>m.toOperation())),l.push(...C.sort((m,L)=>L.place-m.place).map(m=>m.toOperation())),l.push(...O.map(m=>m.toOperation()))}),Object.entries(this.fields).forEach(([_,v])=>{const T=v.filter(O=>O.change!==b.REMOVE),C=o.diff([...T].sort((O,m)=>O.originalValue.place-m.originalValue.place).map(O=>O.originalValue.place),[...T].sort((O,m)=>O.newValue.place-m.newValue.place).map(O=>O.originalValue.place)).map(O=>new t(_,+O.from.substr(1),+O.path.substr(1)).toOperation());l.push(...C)}),l}}},55933:(k,w,i)=>{"use strict";i.d(w,{L:()=>t});var E=i(69685),a=i(53107);let t=(()=>{class f{static#t=this.\u0275fac=function(M){return new(M||f)};static#e=this.\u0275cmp=a.VBU({type:f,selectors:[["ds-dso-edit-metadata-headers"]],inputs:{dsoType:"dsoType"},standalone:!0,features:[a.aNF],decls:18,vars:12,consts:[[1,"d-flex","flex-row","ds-field-row","ds-header-row"],[1,"lbl-cell"],[1,"flex-grow-1"],[1,"d-flex","flex-row"],[1,"flex-grow-1","ds-flex-cell","ds-value-cell"],[1,"dont-break-out","preserve-line-breaks"],[1,"ds-flex-cell","ds-lang-cell"],[1,"text-center","ds-flex-cell","ds-edit-cell"]],template:function(M,b){1&M&&(a.j41(0,"div",0)(1,"div",1),a.EFF(2),a.nI1(3,"translate"),a.k0s(),a.j41(4,"div",2)(5,"div",3)(6,"div",4)(7,"b",5),a.EFF(8),a.nI1(9,"translate"),a.k0s()(),a.j41(10,"div",6)(11,"b"),a.EFF(12),a.nI1(13,"translate"),a.k0s()(),a.j41(14,"div",7)(15,"b"),a.EFF(16),a.nI1(17,"translate"),a.k0s()()()()()),2&M&&(a.R7$(2),a.JRh(a.bMT(3,4,b.dsoType+".edit.metadata.headers.field")),a.R7$(6),a.JRh(a.bMT(9,6,b.dsoType+".edit.metadata.headers.value")),a.R7$(4),a.JRh(a.bMT(13,8,b.dsoType+".edit.metadata.headers.language")),a.R7$(4),a.JRh(a.bMT(17,10,b.dsoType+".edit.metadata.headers.edit")))},dependencies:[E.h,E.D9],styles:[".lbl-cell[_ngcontent-%COMP%]{min-width:var(--ds-dso-edit-field-width);max-width:var(--ds-dso-edit-field-width);background-color:var(--bs-gray-100);font-weight:700;padding:1rem;border:1px solid var(--bs-gray-200)}.ds-header-row[_ngcontent-%COMP%]{background-color:var(--bs-gray-100)}",".ds-field-row[_ngcontent-%COMP%]{border:1px solid var(--bs-gray-400)}.ds-flex-cell[_ngcontent-%COMP%]{padding:1rem;border:1px solid var(--bs-gray-200)}.ds-lang-cell[_ngcontent-%COMP%]{min-width:var(--ds-dso-edit-lang-width);max-width:var(--ds-dso-edit-lang-width)}.ds-edit-cell[_ngcontent-%COMP%]{min-width:var(--ds-dso-edit-actions-width)}.ds-value-row[_ngcontent-%COMP%]{background-color:#fff}.ds-value-row[_ngcontent-%COMP%]:active{cursor:grabbing}.ds-value-row.ds-warning[_ngcontent-%COMP%]{background-color:var(--ds-warning-bg)}.ds-value-row.ds-warning[_ngcontent-%COMP%] .ds-flex-cell[_ngcontent-%COMP%]{border:1px solid var(--bs-warning)}.ds-value-row.ds-danger[_ngcontent-%COMP%]{background-color:var(--ds-danger-bg)}.ds-value-row.ds-danger[_ngcontent-%COMP%] .ds-flex-cell[_ngcontent-%COMP%]{border:1px solid var(--bs-danger)}.ds-value-row.ds-success[_ngcontent-%COMP%]{background-color:var(--ds-success-bg)}.ds-value-row.ds-success[_ngcontent-%COMP%] .ds-flex-cell[_ngcontent-%COMP%]{border:1px solid var(--bs-success)}"]})}return f})()},11509:(k,w,i)=>{"use strict";i.d(w,{c:()=>t});
1var E=i(69685),a=i(53107);let t=(()=>{class f{static#t=this.\u0275fac=function(M){return new(M||f)};static#e=this.\u0275cmp=a.VBU({type:f,selectors:[["ds-dso-edit-metadata-value-headers"]],inputs:{dsoType:"dsoType"},standalone:!0,features:[a.aNF],decls:10,vars:9,consts:[["role","row",1,"visually-hidden"],["role","columnheader"]],template:function(M,b){1&M&&(a.j41(0,"div",0)(1,"div",1),a.EFF(2),a.nI1(3,"translate"),a.k0s(),a.j41(4,"div",1),a.EFF(5),a.nI1(6,"translate"),a.k0s(),a.j41(7,"div",1),a.EFF(8),a.nI1(9,"translate"),a.k0s()()),2&M&&(a.R7$(2),a.JRh(a.bMT(3,3,b.dsoType+".edit.metadata.headers.value")),a.R7$(3),a.JRh(a.bMT(6,5,b.dsoType+".edit.metadata.headers.language")),a.R7$(3),a.JRh(a.bMT(9,7,b.dsoType+".edit.metadata.headers.edit")))},dependencies:[E.h,E.D9],styles:[".ds-field-row[_ngcontent-%COMP%]{border:1px solid var(--bs-gray-400)}.ds-flex-cell[_ngcontent-%COMP%]{padding:1rem;border:1px solid var(--bs-gray-200)}.ds-lang-cell[_ngcontent-%COMP%]{min-width:var(--ds-dso-edit-lang-width);max-width:var(--ds-dso-edit-lang-width)}.ds-edit-cell[_ngcontent-%COMP%]{min-width:var(--ds-dso-edit-actions-width)}.ds-value-row[_ngcontent-%COMP%]{background-color:#fff}.ds-value-row[_ngcontent-%COMP%]:active{cursor:grabbing}.ds-value-row.ds-warning[_ngcontent-%COMP%]{background-color:var(--ds-warning-bg)}.ds-value-row.ds-warning[_ngcontent-%COMP%] .ds-flex-cell[_ngcontent-%COMP%]{border:1px solid var(--bs-warning)}.ds-value-row.ds-danger[_ngcontent-%COMP%]{background-color:var(--ds-danger-bg)}.ds-value-row.ds-danger[_ngcontent-%COMP%] .ds-flex-cell[_ngcontent-%COMP%]{border:1px solid var(--bs-danger)}.ds-value-row.ds-success[_ngcontent-%COMP%]{background-color:var(--ds-success-bg)}.ds-value-row.ds-success[_ngcontent-%COMP%] .ds-flex-cell[_ngcontent-%COMP%]{border:1px solid var(--bs-success)}"]})}return f})()},50277:(k,w,i)=>{"use strict";i.d(w,{o:()=>_t});var E=i(85102),a=i(54460),t=i(53107),f=i(10936),G=i(95968),y=i(2155),M=i(69685),b=i(71217),A=i(76564),D=i(63016),h=i(47947),o=i(22867),l=i(82040),_=i(37610),v=i(84940),T=i(59678),C=i(79224),O=i(83116),m=i(17584),L=i(96459),H=i(20960),U=i(977),X=(i(47587),i(38706)),e=i(12007),R=i(15497),$=i(72683),V=i(27076),F=i(66642),I=i(87180),B=i(83418),W=i(36302),J=i(14143),Z=i(15614),q=i(54872),z=i(24106),tt=i(63524),et=i(64756);const at=(c,P,n,d)=>({"ds-warning":c,"ds-danger":P,"ds-success":n,"h-100":d}),g=c=>({disabled:c});function S(c,P){if(1&c&&(t.j41(0,"div",24),t.EFF(1),t.k0s()),2&c){const n=t.XpG(3);t.R7$(),t.JRh(n.mdValue.newValue.value)}}function s(c,P){if(1&c){const n=t.RV6();t.j41(0,"textarea",25),t.nI1(1,"translate"),t.mxI("ngModelChange",function(r){t.eBV(n);const x=t.XpG(3);return t.DH7(x.mdValue.newValue.value,r)||(x.mdValue.newValue.value=r),t.Njj(r)}),t.bIt("onDebounce",function(){t.eBV(n);const r=t.XpG(3);return t.Njj(r.confirm.emit(!1))}),t.k0s()}if(2&c){const n=t.XpG(3);t.R50("ngModel",n.mdValue.newValue.value),t.Y8G("dsDebounce",300),t.BMQ("aria-label",t.bMT(1,3,n.dsoType+".edit.metadata.edit.value"))}}function u(c,P){if(1&c){const n=t.RV6();t.j41(0,"ds-dynamic-scrollable-dropdown",26),t.bIt("change",function(r){t.eBV(n);const x=t.XpG(3);return t.Njj(x.onChangeAuthorityField(r))}),t.k0s()}if(2&c){const n=t.XpG(3);t.Y8G("bindId",n.mdField)("group",n.group)("model",n.getModel())}}function p(c,P){if(1&c){const n=t.RV6();t.j41(0,"ds-dynamic-onebox",27),t.bIt("change",function(r){t.eBV(n);const x=t.XpG(3);return t.Njj(x.onChangeAuthorityField(r))}),t.k0s()}if(2&c){const n=t.XpG(3);t.Y8G("group",n.group)("model",n.getModel())}}function j(c,P){if(1&c&&(t.j41(0,"div")(1,"span",28),t.nrm(2,"i",29),t.EFF(3),t.nI1(4,"translate"),t.k0s()()),2&c){const n=t.XpG(3);t.R7$(2),t.Y8G("authorityValue",n.mdValue.newValue)("iconMode",!0),t.R7$(),t.Lme(" ",t.bMT(4,4,n.dsoType+".edit.metadata.authority.label")," ",n.mdValue.newValue.authority," ")}}function N(c,P){if(1&c){const n=t.RV6();t.j41(0,"button",36),t.nI1(1,"translate"),t.nI1(2,"translate"),t.bIt("click",function(){t.eBV(n);const r=t.XpG(4);return t.Njj(r.onChangeEditingAuthorityStatus(!0))}),t.nrm(3,"i",37),t.k0s()}if(2&c){const n=t.XpG(4);t.FS9("ngbTooltip",t.bMT(1,2,n.dsoType+".edit.metadata.edit.buttons.open-authority-edition")),t.Y8G("title",t.bMT(2,4,n.dsoType+".edit.metadata.edit.buttons.open-authority-edition"))}}function K(c,P){if(1&c){const n=t.RV6();t.j41(0,"button",38),t.nI1(1,"translate"),t.nI1(2,"translate"),t.bIt("click",function(){t.eBV(n);const r=t.XpG(4);return t.Njj(r.onChangeEditingAuthorityStatus(!1))}),t.nrm(3,"i",39),t.k0s()}if(2&c){const n=t.XpG(4);t.FS9("ngbTooltip",t.bMT(1,2,n.dsoType+".edit.metadata.edit.buttons.close-authority-edition")),t.Y8G("title",t.bMT(2,4,n.dsoType+".edit.metadata.edit.buttons.close-authority-edition"))}}function Y(c,P){if(1&c){const n=t.RV6();t.j41(0,"div",30)(1,"div",31),t.nrm(2,"i",32),t.j41(3,"input",33),t.nI1(4,"translate"),t.mxI("ngModelChange",function(r){t.eBV(n);const x=t.XpG(3);return t.DH7(x.mdValue.newValue.authority,r)||(x.mdValue.newValue.authority=r),t.Njj(r)}),t.bIt("change",function(){t.eBV(n);const r=t.XpG(3);return t.Njj(r.onChangeAuthorityKey())}),t.k0s(),t.DNE(5,N,4,6,"button",34)(6,K,4,6,"button",35),t.k0s()()}if(2&c){const n=t.XpG(3);t.R7$(2),t.Y8G("authorityValue",n.mdValue.newValue.confidence)("iconMode",!0),t.R7$(),t.R50("ngModel",n.mdValue.newValue.authority),t.Y8G("disabled",!n.editingAuthority),t.BMQ("aria-label",t.bMT(4,7,n.dsoType+".edit.metadata.edit.authority.key")),t.R7$(2),t.Y8G("ngIf",!n.editingAuthority),t.R7$(),t.Y8G("ngIf",n.editingAuthority)}}function nt(c,P){if(1&c&&(t.j41(0,"div",40)(1,"a",41),t.nI1(2,"async"),t.EFF(3),t.nI1(4,"async"),t.k0s(),t.nrm(5,"ds-type-badge",42),t.k0s()),2&c){const n=t.XpG().ngVar,d=t.XpG(2);t.R7$(),t.Y8G("routerLink",t.bMT(2,3,d.mdRepresentationItemRoute$)),t.R7$(2),t.JRh(t.bMT(4,5,d.mdRepresentationName$)),t.R7$(2),t.Y8G("object",n)}}function it(c,P){if(1&c&&(t.j41(0,"div",17),t.DNE(1,S,2,1,"div",4)(2,s,2,5,"textarea",18),t.nI1(3,"async"),t.DNE(4,u,1,3,"ds-dynamic-scrollable-dropdown",19),t.nI1(5,"async"),t.DNE(6,p,1,2,"ds-dynamic-onebox",20),t.nI1(7,"async"),t.nI1(8,"async"),t.DNE(9,j,5,6,"div",21)(10,Y,7,9,"div",22),t.nI1(11,"async"),t.nI1(12,"async"),t.DNE(13,nt,6,7,"div",23),t.k0s()),2&c){const n=P.ngVar,d=t.XpG().ngVar,r=t.XpG
1();t.R7$(),t.Y8G("ngIf",!r.mdValue.editing&&!n),t.R7$(),t.Y8G("ngIf",r.mdValue.editing&&!n&&!0!==t.bMT(3,7,r.isAuthorityControlled())),t.R7$(2),t.Y8G("ngIf",r.mdValue.editing&&t.bMT(5,9,r.isScrollableVocabulary())),t.R7$(2),t.Y8G("ngIf",r.mdValue.editing&&(t.bMT(7,11,r.isHierarchicalVocabulary())||t.bMT(8,13,r.isSuggesterVocabulary()))),t.R7$(3),t.Y8G("ngIf",!d&&!r.mdValue.editing&&r.mdValue.newValue.authority&&r.mdValue.newValue.confidence!==r.ConfidenceTypeEnum.CF_UNSET&&r.mdValue.newValue.confidence!==r.ConfidenceTypeEnum.CF_NOVALUE),t.R7$(),t.Y8G("ngIf",r.mdValue.editing&&t.bMT(11,15,r.isAuthorityControlled())&&t.bMT(12,17,r.isSuggesterVocabulary())),t.R7$(3),t.Y8G("ngIf",n)}}function st(c,P){if(1&c&&(t.j41(0,"div",24),t.EFF(1),t.k0s()),2&c){const n=t.XpG(2);t.R7$(),t.JRh(n.mdValue.newValue.language)}}function dt(c,P){if(1&c){const n=t.RV6();t.j41(0,"input",43),t.nI1(1,"translate"),t.mxI("ngModelChange",function(r){t.eBV(n);const x=t.XpG(2);return t.DH7(x.mdValue.newValue.language,r)||(x.mdValue.newValue.language=r),t.Njj(r)}),t.bIt("onDebounce",function(){t.eBV(n);const r=t.XpG(2);return t.Njj(r.confirm.emit(!1))}),t.k0s()}if(2&c){const n=t.XpG(2);t.R50("ngModel",n.mdValue.newValue.language),t.Y8G("dsDebounce",300),t.BMQ("aria-label",t.bMT(1,3,n.dsoType+".edit.metadata.edit.language"))}}function ot(c,P){if(1&c){const n=t.RV6();t.j41(0,"button",44),t.nI1(1,"translate"),t.nI1(2,"translate"),t.nI1(3,"async"),t.bIt("click",function(){t.eBV(n);const r=t.XpG(2);return t.Njj(r.edit.emit())}),t.nrm(4,"i",45),t.k0s()}if(2&c){const n=t.XpG().ngVar,d=t.XpG();t.FS9("ngbTooltip",t.bMT(1,3,d.dsoType+".edit.metadata.edit.buttons.edit")),t.Y8G("title",t.bMT(2,5,d.dsoType+".edit.metadata.edit.buttons.edit"))("disabled",n||d.mdValue.change===d.DsoEditMetadataChangeTypeEnum.REMOVE||t.bMT(3,7,d.saving$))}}function lt(c,P){if(1&c){const n=t.RV6();t.j41(0,"button",46),t.nI1(1,"translate"),t.nI1(2,"translate"),t.nI1(3,"async"),t.bIt("click",function(){t.eBV(n);const r=t.XpG(2);return t.Njj(r.confirm.emit(!0))}),t.nrm(4,"i",47),t.k0s()}if(2&c){const n=t.XpG().ngVar,d=t.XpG();t.FS9("ngbTooltip",t.bMT(1,3,d.dsoType+".edit.metadata.edit.buttons.confirm")),t.Y8G("title",t.bMT(2,5,d.dsoType+".edit.metadata.edit.buttons.confirm"))("disabled",n||t.bMT(3,7,d.saving$))}}function rt(c,P){if(1&c&&(t.j41(0,"button",48),t.nI1(1,"translate"),t.nI1(2,"translate"),t.nrm(3,"i",49),t.k0s()),2&c){const n=P.ngVar,d=t.XpG(2);t.FS9("ngbTooltip",t.bMT(1,5,d.dsoType+".edit.metadata.edit.buttons.drag")),t.Y8G("cdkDragHandleDisabled",n)("ngClass",t.eq3(9,g,n))("disabled",n)("title",t.bMT(2,7,d.dsoType+".edit.metadata.edit.buttons.drag"))}}function ct(c,P){if(1&c){const n=t.RV6();t.j41(0,"div",1),t.bIt("cdkDragStarted",function(){t.eBV(n);const r=t.XpG();return t.Njj(r.dragging.emit(!0))})("cdkDragEnded",function(){t.eBV(n);const r=t.XpG();return t.Njj(r.dragging.emit(!1))}),t.DNE(1,it,14,19,"div",2),t.nI1(2,"async"),t.j41(3,"div",3),t.DNE(4,st,2,1,"div",4)(5,dt,2,5,"input",5),t.k0s(),t.j41(6,"div",6)(7,"div",7)(8,"div",8)(9,"div",9),t.nI1(10,"translate"),t.DNE(11,ot,5,9,"button",10)(12,lt,5,9,"button",11),t.j41(13,"button",12),t.nI1(14,"translate"),t.nI1(15,"translate"),t.nI1(16,"async"),t.bIt("click",function(){t.eBV(n);const r=t.XpG();return t.Njj(r.remove.emit())}),t.nrm(17,"i",13),t.k0s(),t.j41(18,"button",14),t.nI1(19,"translate"),t.nI1(20,"translate"),t.nI1(21,"async"),t.bIt("click",function(){t.eBV(n);const r=t.XpG();return t.Njj(r.undo.emit())}),t.nrm(22,"i",15),t.k0s(),t.DNE(23,rt,4,11,"button",16),t.nI1(24,"async"),t.k0s()()()()()}if(2&c){const n=P.ngVar,d=t.XpG();t.Y8G("ngClass",t.ziG(32,at,d.mdValue.reordered||d.mdValue.change===d.DsoEditMetadataChangeTypeEnum.UPDATE,d.mdValue.change===d.DsoEditMetadataChangeTypeEnum.REMOVE,d.mdValue.change===d.DsoEditMetadataChangeTypeEnum.ADD,d.isOnlyValue)),t.R7$(),t.Y8G("ngVar",t.bMT(2,14,d.mdRepresentation$)),t.R7$(3),t.Y8G("ngIf",!d.mdValue.editing),t.R7$(),t.Y8G("ngIf",d.mdValue.editing),t.R7$(4),t.Y8G("ngbTooltip",n?t.bMT(10,16,d.dsoType+".edit.metadata.edit.buttons.virtual"):null),t.R7$(2),t.Y8G("ngIf",!d.mdValue.editing),t.R7$(),t.Y8G("ngIf",d.mdValue.editing),t.R7$(),t.FS9("ngbTooltip",t.bMT(14,18,d.dsoType+".edit.metadata.edit.buttons.remove")),t.Y8G("title",t.bMT(15,20,d.dsoType+".edit.metadata.edit.buttons.remove"))("disabled",n||d.mdValue.change&&d.mdValue.change!==d.DsoEditMetadataChangeTypeEnum.ADD||d.mdValue.editing||t.bMT(16,22,d.saving$)),t.R7$(5),t.FS9("ngbTooltip",t.bMT(19,24,d.dsoType+".edit.metadata.edit.buttons.undo")),t.Y8G("title",t.bMT(20,26,d.dsoType+".edit.metadata.edit.buttons.undo"))("disabled",n||!d.mdValue.change&&d.mdValue.reordered||!d.mdValue.change&&!d.mdValue.editing||t.bMT(21,28,d.saving$)),t.R7$(5),t.Y8G("ngVar",d.isOnlyValue||t.bMT(24,30,d.saving$))}}let _t=(()=>{class c{constructor(n,d,r,x,ut,mt,ht,pt,gt){this.relationshipService=n,this.dsoNameService=d,this.vocabularyService=r,this.itemService=x,this.cdr=ut,this.registryService=mt,this.notificationsService=ht,this.translate=pt,this.metadataService=gt,this.isOnlyValue=!1,this.edit=new t.bkB,this.confirm=new t.bkB,this.remove=ne
1w t.bkB,this.undo=new t.bkB,this.dragging=new t.bkB,this.DsoEditMetadataChangeTypeEnum=et.QR,this.ConfidenceTypeEnum=U.l,this.editingAuthority=!1,this.group=new f.J3({authorityField:new f.hs}),this.model$=new b.t(null)}ngOnInit(){this.initVirtualProperties(),this.initAuthorityProperties()}initVirtualProperties(){this.mdRepresentation$=this.metadataService.isVirtual(this.mdValue.newValue)?this.relationshipService.resolveMetadataRepresentation(this.mdValue.newValue,this.dso,"Item").pipe((0,h.T)(n=>n.representationType===X.d.Item?n:null)):A.w,this.mdRepresentationItemRoute$=this.mdRepresentation$.pipe((0,h.T)(n=>n?(0,R._o)(n):null)),this.mdRepresentationName$=this.mdRepresentation$.pipe((0,h.T)(n=>n?this.dsoNameService.getName(n):null))}initAuthorityProperties(){if((0,$.hj)(this.mdField)){const n=this.itemService.findByHref(this.dso._links.self.href,!0,!0,(0,z.s)("owningCollection")).pipe((0,e.yd)(),(0,e.Bo)(),(0,o.n)(d=>d.owningCollection),(0,e.yd)(),(0,e.Bo)());this.vocabulary$=n.pipe((0,o.n)(d=>this.vocabularyService.getVocabularyByMetadataAndCollection(this.mdField,d.uuid).pipe((0,e.ak)())))}else this.vocabulary$=(0,D.of)(void 0);this.isAuthorityControlled$=this.vocabulary$.pipe((0,l.M)(n=>this.model$.next(this.createModel(n))),(0,h.T)(n=>(0,$.hj)(n))),this.isHierarchicalVocabulary$=this.vocabulary$.pipe((0,h.T)(n=>(0,$.hj)(n)&&n.hierarchical)),this.isScrollableVocabulary$=this.vocabulary$.pipe((0,h.T)(n=>(0,$.hj)(n)&&n.scrollable)),this.isSuggesterVocabulary$=this.vocabulary$.pipe((0,h.T)(n=>(0,$.hj)(n)&&!n.hierarchical&&!n.scrollable))}createModel(n){if((0,$.hj)(n)){let d;(0,$.hj)(this.mdValue.newValue.value)?(d=new W.e,d.value=this.mdValue.newValue.value,d.display=this.mdValue.newValue.value,this.mdValue.newValue.authority&&(d.authority=this.mdValue.newValue.authority,d.confidence=this.mdValue.newValue.confidence)):d=this.mdValue.newValue.value;const r=n?{closed:!1,name:n.name}:null;return n.scrollable?new B.j({id:"authorityField",label:`${this.dsoType}.edit.metadata.edit.value`,placeholder:`${this.dsoType}.edit.metadata.edit.value`,vocabularyOptions:r,metadataFields:[this.mdField],value:d,repeatable:!1,submissionId:"edit-metadata",hasSelectableMetadata:!1,maxOptions:10}):new F.K({id:"authorityField",label:`${this.dsoType}.edit.metadata.edit.value`,vocabularyOptions:r,metadataFields:[this.mdField],value:d,repeatable:!1,submissionId:"edit-metadata",hasSelectableMetadata:!1})}return null}ngOnChanges(n){(0,$.hj)(n.mdField)&&!n.mdField.firstChange&&(0,$.hj)(n.mdField.currentValue)&&((0,$.hj)(n.mdField.previousValue)&&n.mdField.previousValue!==n.mdField.currentValue&&(this.mdValue.newValue.authority=null,this.mdValue.newValue.confidence=U.l.CF_UNSET),n.mdField.currentValue.includes(".")&&this.validateMetadataField().subscribe(d=>{d&&(this.initAuthorityProperties(),this.cdr.detectChanges())}))}validateMetadataField(){return this.registryService.queryMetadataFields(this.mdField,null,!0,!1,(0,z.s)("schema")).pipe((0,e.qD)(),(0,o.n)(n=>n.hasSucceeded?(0,D.of)(n).pipe((0,e.LB)(),(0,_.s)(1),(0,h.T)(d=>d.indexOf(this.mdField)>-1)):(this.notificationsService.error(this.translate.instant(`${this.dsoType}.edit.metadata.metadatafield.error`),n.errorMessage),[!1])))}isAuthorityControlled(){return this.isAuthorityControlled$}isHierarchicalVocabulary(){return this.isHierarchicalVocabulary$}isScrollableVocabulary(){return this.isScrollableVocabulary$}isSuggesterVocabulary(){return this.isSuggesterVocabulary$}onChangeAuthorityField(n){this.mdValue.newValue.value=n.value,n.authority?(this.mdValue.newValue.authority=n.authority,this.mdValue.newValue.confidence=U.l.CF_ACCEPTED):(this.mdValue.newValue.authority=null,this.mdValue.newValue.confidence=U.l.CF_UNSET),this.confirm.emit(!1)}getModel(){return this.model$.value}onChangeEditingAuthorityStatus(n){this.editingAuthority=n}onChangeAuthorityKey(){""===this.mdValue.newValue.authority?(this.mdValue.newValue.confidence=U.l.CF_NOVALUE,this.confirm.emit(!1)):this.mdValue.newValue.authority!==this.mdValue.originalValue.authority&&(this.mdValue.newValue.confidence=U.l.CF_ACCEPTED,this.confirm.emit(!1))}static#t=this.\u0275fac=function(d){return new(d||c)(t.rXU(L.RelationshipD
1ataService),t.rXU(O.f),t.rXU(T.g),t.rXU(m.ItemDataService),t.rXU(t.gRc),t.rXU(v.x),t.rXU(C.I),t.rXU(M.c$),t.rXU(H.T))};static#e=this.\u0275cmp=t.VBU({type:c,selectors:[["ds-dso-edit-metadata-value"]],inputs:{dso:"dso",mdValue:"mdValue",dsoType:"dsoType",saving$:"saving$",isOnlyValue:"isOnlyValue",mdField:"mdField"},outputs:{edit:"edit",confirm:"confirm",remove:"remove",undo:"undo",dragging:"dragging"},standalone:!0,features:[t.OA$,t.aNF],decls:1,vars:1,consts:[["class","d-flex flex-row ds-value-row","role","row","cdkDrag","",3,"ngClass","cdkDragStarted","cdkDragEnded",4,"ngVar"],["role","row","cdkDrag","",1,"d-flex","flex-row","ds-value-row",3,"cdkDragStarted","cdkDragEnded","ngClass"],["class","flex-grow-1 ds-flex-cell ds-value-cell d-flex flex-column","role","cell",4,"ngVar"],["role","cell",1,"ds-flex-cell","ds-lang-cell"],["class","dont-break-out preserve-line-breaks",4,"ngIf"],["class","form-control","type","text",3,"ngModel","dsDebounce","ngModelChange","onDebounce",4,"ngIf"],["role","cell",1,"text-center","ds-flex-cell","ds-edit-cell"],[1,"btn-group"],[1,"edit-field"],[1,"btn-group","edit-buttons",3,"ngbTooltip"],["class","btn btn-outline-primary btn-sm ng-star-inserted","data-test","metadata-edit-btn",3,"title","ngbTooltip","disabled","click",4,"ngIf"],["class","btn btn-outline-success btn-sm ng-star-inserted","data-test","metadata-confirm-btn",3,"title","ngbTooltip","disabled","click",4,"ngIf"],["data-test","metadata-remove-btn",1,"btn","btn-outline-danger","btn-sm",3,"click","title","ngbTooltip","disabled"],[1,"fas","fa-trash-alt","fa-fw"],["data-test","metadata-undo-btn",1,"btn","btn-outline-warning","btn-sm",3,"click","title","ngbTooltip","disabled"],[1,"fas","fa-undo-alt","fa-fw"],["class","btn btn-outline-secondary ds-drag-handle btn-sm","data-test","metadata-drag-btn","cdkDragHandle","",3,"cdkDragHandleDisabled","ngClass","disabled","title","ngbTooltip",4,"ngVar"],["role","cell",1,"flex-grow-1","ds-flex-cell","ds-value-cell","d-flex","flex-column"],["class","form-control","rows","5",3,"ngModel","dsDebounce","ngModelChange","onDebounce",4,"ngIf"],[3,"bindId","group","model","change",4,"ngIf"],[3,"group","model","change",4,"ngIf"],[4,"ngIf"],["class","mt-2",4,"ngIf"],["class","d-flex",4,"ngIf"],[1,"dont-break-out","preserve-line-breaks"],["rows","5",1,"form-control",3,"ngModelChange","onDebounce","ngModel","dsDebounce"],[3,"change","bindId","group","model"],[3,"change","group","model"],[1,"badge","badge-light","border"],["dsAuthorityConfidenceState","","aria-hidden","true",1,"fas","fa-fw","p-0",3,"authorityValue","iconMode"],[1,"mt-2"],[1,"btn-group","w-75"],["dsAuthorityConfidenceState","","aria-hidden","true",1,"fas","fa-fw","p-0","mr-1","mt-auto","mb-auto",3,"authorityValue","iconMode"],["data-test","authority-input",1,"form-control","form-outline",3,"ngModelChange","change","ngModel","disabled"],["class","btn btn-outline-secondary btn-sm ng-star-inserted","id","metadata-confirm-btn",3,"title","ngbTooltip","click",4,"ngIf"],["class","btn btn-outline-success btn-sm ng-star-inserted","id","metadata-confirm-btn",3,"title","ngbTooltip","click",4,"ngIf"],["id","metadata-confirm-btn",1,"btn","btn-outline-secondary","btn-sm","ng-star-inserted",3,"click","title","ngbTooltip"],[1,"fas","fa-lock","fa-fw"],["id","metadata-confirm-btn",1,"btn","btn-outline-success","btn-sm","ng-star-inserted",3,"click","title","ngbTooltip"],[1,"fas","fa-lock-open","fa-fw"],[1,"d-flex"],["target","_blank",1,"mr-2",3,"routerLink"],[3,"object"],["type","text",1,"form-control",3,"ngModelChange","onDebounce","ngModel","dsDebounce"],["data-test","metadata-edit-btn",1,"btn","btn-outline-primary","btn-sm","ng-star-inserted",3,"click","title","ngbTooltip","disabled"],[1,"fas","fa-edit","fa-fw"],["data-test","metadata-confirm-btn",1,"btn","btn-outline-success","btn-sm","ng-star-inserted",3,"click","title","ngbTooltip","disabled"],[1,"fas","fa-check","fa-fw"],["data-test","metadata-drag-btn","cdkDragHandle","",1,"btn","btn-outline-secondary","ds-drag-handle","btn-sm",3,"cdkDragHandleDisabled","ngClass","disabled","title","ngbTooltip"],[1,"fas","fa-grip-vertical","fa-fw"]],template:function(d,r){1&d&&t.DNE(0,ct,25,37,"div",0),2&d&&t.Y8G("ngVar",r.metadataService.isVirtual(r.mdValue.newValue))},dependencies:[tt.r,E.T1,a.YU,a.bT,f.YN,f.me,f.BC,f.vS,q.R,G.Wk,Z.C,y.n8,y.md,E.Fb,a.Jj,M.h,M.D9,I.s,V.d,J.K],styles:[".ds-success[_ngcontent-%COMP%]{background-color:var(--ds-success-bg);border:1px solid var(--bs-success)}.ds-drag-handle[_ngcontent-%COMP%]:not(.disabled){cursor:grab} .edit-field>ngb-tooltip-window .tooltip-inner{min-width:var(--ds-dso-edit-virtual-tooltip-min-width)}.cdk-drag-placeholder[_ngcontent-%COMP%]{opacity:0}
1",".ds-field-row[_ngcontent-%COMP%]{border:1px solid var(--bs-gray-400)}.ds-flex-cell[_ngcontent-%COMP%]{padding:1rem;border:1px solid var(--bs-gray-200)}.ds-lang-cell[_ngcontent-%COMP%]{min-width:var(--ds-dso-edit-lang-width);max-width:var(--ds-dso-edit-lang-width)}.ds-edit-cell[_ngcontent-%COMP%]{min-width:var(--ds-dso-edit-actions-width)}.ds-value-row[_ngcontent-%COMP%]{background-color:#fff}.ds-value-row[_ngcontent-%COMP%]:active{cursor:grabbing}.ds-value-row.ds-warning[_ngcontent-%COMP%]{background-color:var(--ds-warning-bg)}.ds-value-row.ds-warning[_ngcontent-%COMP%] .ds-flex-cell[_ngcontent-%COMP%]{border:1px solid var(--bs-warning)}.ds-value-row.ds-danger[_ngcontent-%COMP%]{background-color:var(--ds-danger-bg)}.ds-value-row.ds-danger[_ngcontent-%COMP%] .ds-flex-cell[_ngcontent-%COMP%]{border:1px solid var(--bs-danger)}.ds-value-row.ds-success[_ngcontent-%COMP%]{background-color:var(--ds-success-bg)}.ds-value-row.ds-success[_ngcontent-%COMP%] .ds-flex-cell[_ngcontent-%COMP%]{border:1px solid var(--bs-success)}"]})}return c})()},12086:(k,w,i)=>{"use strict";i.r(w),i.d(w,{DsoEditMetadataComponent:()=>at});var E=i(54460),a=i(69685),t=i(71217),f=i(76627),G=i(63016),y=i(47947),M=i(82040),b=i(27035),A=i(18062),D=i(53169),o=(i(47587),i(12007)),l=i(98573),_=i(96858),v=i(16700),T=i(72683),C=i(21548),O=i(79224),m=i(18617),L=i(64756),H=i(55933),U=i(50277),Q=i(11509),X=i(65789),e=i(53107),R=i(95968),$=i(85102);let V=(()=>{class g{diff(s,u){return this.getMoves(s,u).map(p=>Object.assign({op:"move",from:"/"+p[0],path:"/"+p[1]}))}getMoves(s,u){const p=[...u];return s.reduce((j,N,K)=>{if((0,T.a4)(N)&&N!==p[K]){const Y=p.lastIndexOf(N);(0,$.HD)(p,Y,K),j.unshift([K,Y])}return j},[])}static#t=this.\u0275fac=function(u){return new(u||g)};static#e=this.\u0275prov=e.jDH({token:g,factory:g.\u0275fac,providedIn:"root"})}return g})();function F(g,S){if(1&g){const s=e.RV6();e.j41(0,"button",20),e.nI1(1,"async"),e.nI1(2,"translate"),e.bIt("click",function(){e.eBV(s);const p=e.XpG(2);return e.Njj(p.reinstate())}),e.nrm(3,"i",21),e.j41(4,"span",6),e.EFF(5),e.nI1(6,"translate"),e.k0s()()}if(2&g){const s=e.XpG(2);e.Y8G("disabled",e.bMT(1,3,s.saving$))("title",e.bMT(2,5,s.dsoType+".edit.metadata.reinstate-button")),e.R7$(5),e.SpI("\xa0",e.bMT(6,7,s.dsoType+".edit.metadata.reinstate-button"),"")}}function I(g,S){if(1&g){const s=e.RV6();e.j41(0,"button",22),e.nI1(1,"translate"),e.nI1(2,"async"),e.bIt("click",function(){e.eBV(s);const p=e.XpG(2);return e.Njj(p.discard())}),e.nrm(3,"i",23),e.j41(4,"span",6),e.EFF(5),e.nI1(6,"translate"),e.k0s()()}if(2&g){const s=e.XpG(2);e.Y8G("title",e.bMT(1,3,s.dsoType+".edit.metadata.discard-button"))("disabled",!s.hasChanges||e.bMT(2,5,s.saving$)),e.R7$(5),e.SpI("\xa0",e.bMT(6,7,s.dsoType+".edit.metadata.discard-button"),"")}}function B(g,S){if(1&g){const s=e.RV6();e.j41(0,"div",24)(1,"div",25)(2,"ds-metadata-field-selector",26),e.mxI("mdFieldChange",function(p){e.eBV(s);const j=e.XpG(2);return e.DH7(j.newMdField,p)||(j.newMdField=p),e.Njj(p)}),e.k0s()(),e.j41(3,"div",27)(4,"div",11),e.nrm(5,"ds-dso-edit-metadata-value-headers",28),e.j41(6,"ds-dso-edit-metadata-value",29),e.bIt("confirm",function(p){e.eBV(s);const j=e.XpG(2);return e.Njj(j.confirmNewValue(p))})("remove",function(){e.eBV(s);const p=e.XpG(2);return e.Njj(p.form.newValue=void 0)})("undo",function(){e.eBV(s);const p=e.XpG(2);return e.Njj(p.form.newValue=void 0)}),e.k0s()()()()}if(2&g){const s=e.XpG(2);e.R7$(2),e.Y8G("dsoType",s.dsoType),e.R50("mdField",s.newMdField),e.Y8G("autofocus",!0),e.R7$(3),e.Y8G("dsoType",s.dsoType),e.R7$(),e.Y8G("dso",s.dso)("mdValue",s.form.newValue)("dsoType",s.dsoType)("saving$",s.savingOrLoadingFieldValidation$)("isOnlyValue",!0)("mdField",s.newMdField)}}function W(g,S){if(1&g){const s=e.RV6();e.j41(0,"div",34),e.bIt("click",function(){e.eBV(s);const p=e.XpG().$implicit,j=e.XpG(2);return j.form.resetOrder(p),e.Njj(j.onValueSaved())}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}if(2&g){const s=e.XpG(3);e.R7$(),e.SpI(" ",e.bMT(2,1,s.dsoType+".edit.metadata.reset-order-button")," ")}}function J(g,S){if(1&g){const s=e.RV6();e.j41(0,"div",24)(1,"div",30)(2,"span",31),e.EFF(3),e.k0s(),e.DNE(4,W,3,3,"div",32),e.k0s(),e.j41(5,"ds-dso-edit-metadata-field-values",33),e.bIt("valueSaved",function(){e.eBV(s);const p=e.XpG(2);return e.Njj(p.onValueSaved())}),e.k0s()()}if(2&g){const s=S.$implicit,u=e.XpG(2);e.R7$(3),e.JRh(s),e.R7$(),e.Y8G("ngIf",u.form.hasOrderChanges(s)),e.R7$(),e.Y8G("dso",u.dso)("form",u.form)("dsoType",u.dsoType)("saving$",u.
1saving$)("draggingMdField$",u.draggingMdField$)("mdField",s)}}function Z(g,S){if(1&g&&(e.j41(0,"div"),e.nrm(1,"ds-alert",35),e.k0s()),2&g){const s=e.XpG(2);e.R7$(),e.Y8G("content",s.dsoType+".edit.metadata.empty")("type",s.AlertTypeEnum.Info)}}function q(g,S){if(1&g){const s=e.RV6();e.j41(0,"button",36),e.nI1(1,"async"),e.nI1(2,"translate"),e.bIt("click",function(){e.eBV(s);const p=e.XpG(2);return e.Njj(p.reinstate())}),e.nrm(3,"i",21),e.EFF(4),e.nI1(5,"translate"),e.k0s()}if(2&g){const s=e.XpG(2);e.Y8G("disabled",e.bMT(1,3,s.saving$))("title",e.bMT(2,5,s.dsoType+".edit.metadata.reinstate-button")),e.R7$(4),e.SpI(" ",e.bMT(5,7,s.dsoType+".edit.metadata.reinstate-button")," ")}}function z(g,S){if(1&g){const s=e.RV6();e.j41(0,"button",37),e.nI1(1,"translate"),e.nI1(2,"async"),e.bIt("click",function(){e.eBV(s);const p=e.XpG(2);return e.Njj(p.discard())}),e.nrm(3,"i",23),e.EFF(4),e.nI1(5,"translate"),e.k0s()}if(2&g){const s=e.XpG(2);e.Y8G("title",e.bMT(1,3,s.dsoType+".edit.metadata.discard-button"))("disabled",!s.hasChanges||e.bMT(2,5,s.saving$)),e.R7$(4),e.SpI(" ",e.bMT(5,7,s.dsoType+".edit.metadata.discard-button")," ")}}function tt(g,S){if(1&g){const s=e.RV6();e.j41(0,"div",2)(1,"div",3)(2,"button",4),e.nI1(3,"async"),e.nI1(4,"translate"),e.bIt("click",function(){e.eBV(s);const p=e.XpG();return e.Njj(p.add())}),e.nrm(5,"i",5),e.j41(6,"span",6),e.EFF(7),e.nI1(8,"translate"),e.k0s()(),e.DNE(9,F,7,9,"button",7),e.j41(10,"button",8),e.nI1(11,"async"),e.nI1(12,"translate"),e.bIt("click",function(){e.eBV(s);const p=e.XpG();return e.Njj(p.submit())}),e.nrm(13,"i",9),e.j41(14,"span",6),e.EFF(15),e.nI1(16,"translate"),e.k0s()(),e.DNE(17,I,7,9,"button",10),e.k0s(),e.j41(18,"div",11),e.nI1(19,"translate"),e.nrm(20,"ds-dso-edit-metadata-headers",12),e.DNE(21,B,7,10,"div",13)(22,J,6,8,"div",14),e.k0s(),e.DNE(23,Z,2,2,"div",1),e.j41(24,"div",15)(25,"div",16),e.DNE(26,q,6,9,"button",17),e.j41(27,"button",18),e.nI1(28,"async"),e.nI1(29,"translate"),e.bIt("click",function(){e.eBV(s);const p=e.XpG();return e.Njj(p.submit())}),e.nrm(30,"i",9),e.EFF(31),e.nI1(32,"translate"),e.k0s(),e.DNE(33,z,6,9,"button",19),e.k0s()()()}if(2&g){const s=e.XpG();e.R7$(2),e.Y8G("disabled",s.form.newValue||e.bMT(3,18,s.saving$))("title",e.bMT(4,20,s.dsoType+".edit.metadata.add-button")),e.R7$(5),e.SpI("\xa0",e.bMT(8,22,s.dsoType+".edit.metadata.add-button"),""),e.R7$(2),e.Y8G("ngIf",s.isReinstatable),e.R7$(),e.Y8G("disabled",!s.hasChanges||e.bMT(11,24,s.saving$))("title",e.bMT(12,26,s.dsoType+".edit.metadata.save-button")),e.R7$(5),e.SpI("\xa0",e.bMT(16,28,s.dsoType+".edit.metadata.save-button"),""),e.R7$(2),e.Y8G("ngIf",!s.isReinstatable),e.R7$(),e.BMQ("aria-label",e.bMT(19,30,"item.edit.head")),e.R7$(2),e.Y8G("dsoType",s.dsoType),e.R7$(),e.Y8G("ngIf",s.form.newValue),e.R7$(),e.Y8G("ngForOf",s.form.fieldKeys),e.R7$(),e.Y8G("ngIf",s.isEmpty&&!s.form.newValue),e.R7$(3),e.Y8G("ngIf",s.isReinstatable),e.R7$(),e.Y8G("disabled",!s.hasChanges||e.bMT(28,32,s.saving$))("title",e.bMT(29,34,s.dsoType+".edit.metadata.save-button")),e.R7$(4),e.SpI(" ",e.bMT(32,36,s.dsoType+".edit.metadata.save-button")," "),e.R7$(2),e.Y8G("ngIf",!s.isReinstatable)}}function et(g,S){1&g&&e.nrm(0,"ds-loading")}let at=(()=>{class g{constructor(s,u,p,j,N,K,Y){this.route=s,this.notificationsService=u,this.translateService=p,this.parentInjector=j,this.arrayMoveChangeAnalyser=N,this.cdr=K,this.dataServiceMap=Y,this.saving$=new t.t(!1),this.draggingMdField$=new t.t(null),this.loadingFieldValidation$=new t.t(!1),this.AlertTypeEnum=v.v}ngOnInit(){(0,T.Tn)(this.dso)?this.dsoUpdateSubscription=(0,f.z)([this.route.data,this.route.parent.data]).pipe((0,y.T)(([s,u])=>Object.assign({},s,u)),(0,M.M)(s=>this.initDSO(s.dso.payload)),(0,b.Z)(()=>this.retrieveDataService())).subscribe(s=>{this.initDataService(s),this.initForm()}):(this.initDSOType(this.dso),this.retrieveDataService().subscribe(s=>{this.initDataService(s),this.initForm()})),this.savingOrLoadingFieldValidation$=(0,f.z)([this.saving$,this.loadingFieldValidation$]).pipe((0,y.T)(([s,u])=>s||u))}retrieveDataService(){return(0,T.Tn)(this.updateDataService)?(0,D.M)(this.dataServiceMap,this.dsoType,this.parentInjector):(0,G.of)(this.updateDataService)}initDSO(s){this.dso=s,this.initDSOType(s)}initDSOType(s){let u;u="string"==typeof s.type?new l.v(s.type):s.type,this.dsoType=u.value}initDataService(s){(0,T.hj)(s)&&(this.updateDataService=s)}initForm(){this.form=new L.qf(this.dso.metadata),this.onValueSaved(),this.cdr.detectChanges()}onValueSaved(){this.hasChanges=this.form.hasChanges(),this.isReinstatable=this.form.isReinstatable(),this.isEmpty=0===Object.keys(this.form.fields).length}submit(){this.saving$.next(!0),this.updateDataService.patch(this.dso,this.form.getOperations(this.arrayMoveChangeAnalyser)).pipe((0,o.qD)()).subscribe(s=>{this.saving$.next(!1),s.hasFailed?this.notificationsService.error(this.translateService.instant(`${this.dsoType}.edit.metadata.notifications.error.title`),s.errorMessage):(this.notificationsService.success(this.translateService.instant(`${this.dsoType}.edit.metadata.notifications.saved.title`),this.translateService.instant(`${this.dsoType}.edit.metadata.notifications.saved.content`)),this.dso=s.payload,this.initForm())})}confirmNewValue(s){s&&this.setMetadataField()}setMetadataField(){this.form.resetReinstatable(),this.loadingFieldValidation$.next(!0),this.metadataFieldSelectorComponent.validate().subscribe(s=>{this.loadingFieldValidation$.next(!1),s&&(this.form.setMetadataField(this.newMdField),this.onValueSaved())})}add(){this.newMdField=void 0,this.form.add()}discard(){this.form.discard(),this.onValueSaved()}reinstate(){this.form.reinstate(),this.onValueSaved()}ngOnDestroy(){(0,T.a4)(this.dsoUpdateSubscription)&&this.dsoUpdateSubscription.unsubscribe()}static#t=this.\u0275fac=function(u){return new(u||g)(e.rXU(R.nX),e.rXU(O.I),e.rXU(a.c$),e.rXU(e.zZn),e.rXU(V),e.rXU(e.gRc),e.rXU(A.l9))};static#e=this.\u0275cmp=e.VBU({type:g,selectors:[["ds-base-dso-edit-metadata"]],viewQuery:function(u,p){if(1&u&&e.GBs(X.g,5),2&u){let j;e.mGM(j=e.lsd())&&(p.metadataFieldSelectorComponent=j.first)}},inputs:{dso:"dso",updateDataService:"updateDataService"},standalone:!0,features:[e.aNF],decls:2,vars:2,consts:[["class","item-metadata",4,"ngIf"],[4,"ngIf"],[1,"item-metadata"],[1,"button-row","top","d-flex","my-2","space-children-mr","ml-gap"],["id","dso-add-btn",1,"mr-auto","btn","btn-success",3,"click","disabled","title"],["aria-hidden","true",1,"fas","fa-plus"],[1,"d-none","d-sm-inline"],["class","btn btn-warning ml-1","id","dso-reinstate-btn",3,"disabled","title","click",4,"ngIf"],["id","dso-save-btn",1,"btn","btn-primary","ml-1",3,"click","disabled","title"],["aria-hidden","true",1,"fas","fa-save"],["class","btn btn-danger ml-1","id","dso-discard-btn",3,"title","disabled","click",4,"ngIf"],["role","table"],[3,"dsoType"],["class","d-flex flex-row ds-field-row","role","row",4,"ngIf"],["class","d-flex flex-row ds-field-row","role","row",4,"ngFor","ngForOf"],[1,"button-row","bottom","d-inline-block","w-100"],[1,"mt-2","float-right","space-children-mr","ml-gap"],["class","btn btn-warning",3,"disabled","title","click",4,"ngIf"],[1,"btn","btn-primary",3,"click","disabled","title"],["class","btn btn-danger",3,"title","disabled","click",4,"ngIf"],["id","dso-reinstate-btn",1,"btn","btn-warning","ml-1",3,"click","disabled","title"],["aria-hidden","true",1,"fas","fa-undo-alt"],["id","dso-discard-btn",1,"btn","btn-danger","ml-1",3,"click","title","disabled"],["aria-hidden","true",1,"fas","fa-times"],["role","row",1,"d-flex","flex-row","ds-field-row"],["role","rowheader",1,"lbl-cell","ds-success"],[3,"mdFieldChange","dsoType","mdField","autofocus"],["role","cell",1,"flex-grow-1","ds-drop-list"],["role","presentation",3,"dsoType"],[3,"confirm","remove","undo","dso","mdValue","dsoType","saving$","isOnlyValue","mdField"],["role","rowheader",1,"lbl-cell"],[1,"dont-break-out","preserve-line-breaks"],["class","btn btn-warning reset-order-button mt-2 w-100",3,"click",4,"ngIf"],["role","cell",1,"flex-grow-1",3,"valueSaved","dso","form","dsoType","saving$","draggingMdField$","mdField"],[1,"btn","btn-warning","reset-order-button","mt-2","w-100",3,"click"],[3,"content","type"],[1,"btn","btn-warning",3,"click","disabled","title"],[1,"btn","btn-danger",3,"click","title","disabled"]],template:function(u,p){1&u&&e.DNE(0,tt,34,38,"div",0)(1,et,1,0,"ds-loading",1),2&u&&(e.Y8G("ngIf",p.form),e.R7$(),e.Y8G("ngIf",!p.form))},dependencies:[E.bT,H.L,X.g,Q.c,U.o,E.pM,m.t,_.C,C.v,E.Jj,a.h,a.D9],styles:[".lbl-cell[_ngcontent-%COMP%]{min-width:var(--ds-dso-edit-field-width);max-width:var(--ds-dso-edit-field-width);background-color:var(--bs-gray-100);font-weight:700;padding:1rem;border:1px solid var(--bs-gray-200)}.lbl-cell.ds-success[_ngcontent-%COMP%]{background-color:var(--ds-success-bg);border:1px solid var(--bs-success)}.ds-field-row[_ngcontent-%COMP%]{border:1px solid var(--bs-gray-400)}.reset-order-button[_ngcontent-%COMP%]:hover{cursor:pointer}"]})}return g})()},65789:(k,w,i)=>{"use strict";i.d(w,{g:()=>e});var E=i(54460),a=i(53107),t=i(10936),f=i(69685),G=i(71217),y=i(63016),M=i(88627),b=i(66645),A=i(22867),D=i(37610),h=i(47947),o=i(82040),l=i(89632),_=i(84940),v=i(12007),T=i(72683),C=i(79224),O=i(47331),m=i(24106);const L=["mdFieldInput"],H=R=>({"is-invalid":R}),U=R=>({show:R});function Q(R,$){if(1&R&&(a.j41(0,"div",7),a.EFF(1),a.nI1(2,"translate"),a.k0s()),2&R){const V=a.XpG();a.R7$(),a.JRh(a.bMT(2,1,V.dsoType+".edit.metadata.metadatafield.invalid"))}}function X(R,$){if(1&R){const V=a.RV6();a.j41(0,"div")(1,"button",8),a.bIt("click",function(){const I=a.eBV(V).$implicit,B=a.XpG();return a.Njj(B.select(I))}),a.nrm(2,"span",9),a.k0s()()}if(2&R){const V=$.$implicit;a.R7$(2),a.Y8G("innerHTML",V,a.npT)}}let e=(()=>{class R{constructor(V,F,I){this.registryService=V,this.notificationsService=F,this.translate=I,this.autofocus=!1,this.mdFieldChange=new a.bkB,this.input=new t.hs,this.query$=new G.t(null),this.debounceTime=300,this.selectedValueLoading=!1,this.showInvalid=!1,this.subs=[]}ngOnInit(){this.subs.push(this.input.valueChanges.pipe((0,M.B)(this.debounceTime)).subscribe(V=>{this.selectedValueLoading||this.query$.next(V),this.selectedValueLoading=!1,this.mdField=V,this.mdFieldChange.emit(this.mdField)})),this.mdFieldOptions$=this.query$.pipe((0,b.F)(),(0,A.n)(V=>(this.showInvalid=!1,null!==V?this.registryService.queryMetadataFields(V,{elementsPerPage:10,sort:new l.z("fieldName",l.U.ASC)},!0,!1,(0,m.s)("schema")).pipe((0,v.v7)(),(0,v.LB)()):[[]])))}ngAfterViewInit(){this.autofocus&&this.mdFieldInput.nativeElement.focus()}validate(){return this.registryService.queryMetadataFields(this.mdField,null,!0,!1,(0,m.s)("schema")).pipe((0,v.qD)(),(0,A.n)(V=>V.hasSucceeded?(0,y.of)(V).pipe((0,v.LB)(),(0,D.s)(1),(0,h.T)(F=>F.indexOf(this.mdField)>-1),(0,o.M)(F=>this.showInvalid=!F)):(this.notificationsService.error(this.translate.instant(`${this.dsoType}.edit.metadata.metadatafield.error`),V.errorMessage),[!1])))}select(V){this.selectedValueLoading=!0,this.input.setValue(V)}ngOnDestroy(){this.subs.filter(V=>
1(0,T.a4)(V)).forEach(V=>V.unsubscribe())}static#t=this.\u0275fac=function(F){return new(F||R)(a.rXU(_.x),a.rXU(C.I),a.rXU(f.c$))};static#e=this.\u0275cmp=a.VBU({type:R,selectors:[["ds-metadata-field-selector"]],viewQuery:function(F,I){if(1&F&&a.GBs(L,7),2&F){let B;a.mGM(B=a.lsd())&&(I.mdFieldInput=B.first)}},inputs:{dsoType:"dsoType",mdField:"mdField",autofocus:"autofocus"},outputs:{mdFieldChange:"mdFieldChange"},standalone:!0,features:[a.aNF],decls:10,vars:17,consts:[["mdFieldInput",""],[1,"w-100","position-relative"],["type","text",1,"form-control",3,"focusin","dsClickOutside","click","ngClass","value","formControl"],["class","invalid-feedback show-feedback",4,"ngIf"],[1,"autocomplete","dropdown-menu",3,"ngClass"],[1,"dropdown-list"],[4,"ngFor","ngForOf"],[1,"invalid-feedback","show-feedback"],[1,"d-block","dropdown-item",3,"click"],[3,"innerHTML"]],template:function(F,I){if(1&F){const B=a.RV6();a.j41(0,"div",1)(1,"input",2,0),a.nI1(3,"translate"),a.bIt("focusin",function(){return a.eBV(B),a.Njj(I.query$.next(I.mdField))})("dsClickOutside",function(){return a.eBV(B),a.Njj(I.query$.next(null))})("click",function(J){return a.eBV(B),a.Njj(J.stopPropagation())}),a.k0s(),a.DNE(4,Q,3,3,"div",3),a.j41(5,"div",4),a.nI1(6,"async"),a.j41(7,"div",5),a.DNE(8,X,3,1,"div",6),a.nI1(9,"async"),a.k0s()()()}if(2&F){let B;a.R7$(),a.Y8G("ngClass",a.eq3(13,H,I.showInvalid))("value",I.mdField)("formControl",I.input),a.BMQ("aria-label",a.bMT(3,7,I.dsoType+".edit.metadata.metadatafield")),a.R7$(3),a.Y8G("ngIf",I.showInvalid),a.R7$(),a.Y8G("ngClass",a.eq3(15,U,(null==(B=a.bMT(6,9,I.mdFieldOptions$))?null:B.length)>0)),a.R7$(3),a.Y8G("ngForOf",a.bMT(9,11,I.mdFieldOptions$))}},dependencies:[t.YN,t.me,t.BC,E.YU,t.X1,t.l_,O.z,E.bT,E.pM,E.Jj,f.h,f.D9]})}return R})()},23725:(k,w,i)=>{"use strict";i.d(w,{Q:()=>M}),i(47587);var a=i(21124),f=(i(12086),i(53107));const G=["*"];function y(b,A){}let M=(()=>{class b extends a.J{constructor(){super(...arguments),this.inAndOutputNames=["dso","updateDataService"]}getComponentName(){return"DsoEditMetadataComponent"}importThemedComponent(D){return i(30207)(`./${D}/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component`)}importUnthemedComponent(){return Promise.resolve().then(i.bind(i,12086))}static#t=this.\u0275fac=(()=>{let D;return function(o){return(D||(D=f.xGo(b)))(o||b)}})();static#e=this.\u0275cmp=f.VBU({type:b,selectors:[["ds-dso-edit-metadata"]],inputs:{dso:"dso",updateDataService:"updateDataService"},standalone:!0,features:[f.Vt3,f.aNF],ngContentSelectors:G,decls:5,vars:0,consts:[["vcr",""],["content",""]],template:function(h,o){1&h&&(f.NAR(),f.DNE(0,y,0,0,"ng-template",null,0,f.C5r),f.j41(2,"div",null,1),f.SdG(4),f.k0s())},encapsulation:2})}return b})()},30207:(k,w,i)=>{var E={"./custom/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component":[17286,7286]};function a(t){if(!i.o(E,t))return Promise.resolve().then(()=>{var y=new Error("Cannot find module '"+t+"'");throw y.code="MODULE_NOT_FOUND",y});var f=E[t],G=f[0];return i.e(f[1]).then(()=>i(G))}a.keys=()=>Object.keys(E),a.id=30207,k.exports=a}}]);
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.