@knoflows/engine 0.1.0-alpha.10 → 0.1.0-alpha.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/engine.js +12 -12
  2. package/package.json +1 -1
  3. package/static/assets/i18n/en.json +18 -0
  4. package/static/assets/i18n/es.json +18 -0
  5. package/static/{chunk-BFkZ796p.js → chunk-03U2wfYJ.js} +1 -1
  6. package/static/{chunk-jct1_zOr.js → chunk-6rAx_awr.js} +1 -1
  7. package/static/{chunk-3mppll1n.js → chunk-BGEuPXoV.js} +1 -1
  8. package/static/{chunk-hZzW00VR.js → chunk-BLVF0pVH.js} +1 -1
  9. package/static/{chunk-CJRNatUw.js → chunk-BfWasMGf.js} +1 -1
  10. package/static/{chunk-B8MrNxxk.js → chunk-Bvpl_AF9.js} +1 -1
  11. package/static/{chunk-CEcbtdnK.js → chunk-C2eCmH-q.js} +1 -1
  12. package/static/{chunk-DjibVmY7.js → chunk-CAjGF9LB.js} +1 -1
  13. package/static/{chunk-BAc0DRm8.js → chunk-CT8olEiD.js} +1 -1
  14. package/static/chunk-CUsAuTTX.js +1 -0
  15. package/static/chunk-CgXl_TS9.js +1 -0
  16. package/static/{chunk-BbcTWKT2.js → chunk-CqGGDoIh.js} +1 -1
  17. package/static/{chunk-tYnBYi0l.js → chunk-Crj-4pl_.js} +1 -1
  18. package/static/{chunk-DNOjVPY0.js → chunk-Ct30cLzT.js} +1 -1
  19. package/static/{chunk-wbdetocK.js → chunk-Cw0wBuEr.js} +3 -3
  20. package/static/chunk-CxICQyU8.js +1 -0
  21. package/static/{chunk-B2hO-qT3.js → chunk-DGHakffX.js} +1 -1
  22. package/static/chunk-DIakbH9x.js +1 -0
  23. package/static/{chunk-BjZIiizu.js → chunk-DIntI-KR.js} +1 -1
  24. package/static/{chunk-W5GAgssE.js → chunk-DPWE5cPY.js} +1 -1
  25. package/static/{chunk-Cd8F2jeN.js → chunk-DU6MKU0d.js} +1 -1
  26. package/static/{chunk-Cf_xd8ER.js → chunk-DUR5PalP.js} +1 -1
  27. package/static/{chunk-2KSNHCgb.js → chunk-DWLHaSHg.js} +1 -1
  28. package/static/{chunk-CDWIMt6y.js → chunk-D_R_EFd2.js} +1 -1
  29. package/static/{chunk-Ojn34cvU.js → chunk-DinAvqzQ.js} +1 -1
  30. package/static/{chunk-CWbxWv5I.js → chunk-DlsGU_Dk.js} +1 -1
  31. package/static/{chunk-DblClAqu.js → chunk-DwA32gts.js} +1 -1
  32. package/static/{chunk-DQnMulwi.js → chunk-IOVwMLns.js} +1 -1
  33. package/static/{chunk-cHfOiAJm.js → chunk-L_FnMwpH.js} +1 -1
  34. package/static/{chunk-XLpSkczx.js → chunk-NAyA7aWR.js} +1 -1
  35. package/static/{chunk-eSxb3-OU.js → chunk-TNH96m0D.js} +1 -1
  36. package/static/{chunk-CJDp11v5.js → chunk-Vz5kd858.js} +1 -1
  37. package/static/{chunk-BUuwGTt7.js → chunk-dUlsh7QS.js} +6 -6
  38. package/static/{chunk-A4AkMf2s.js → chunk-h3oyPsBC.js} +1 -1
  39. package/static/{chunk-BVw7xkK9.js → chunk-hKpVm95g.js} +1 -1
  40. package/static/chunk-qYK5KaAK.js +1 -0
  41. package/static/{chunk-mzyds3TS.js → chunk-qwukwlIj.js} +1 -1
  42. package/static/{chunk-CgqRVtSF.js → chunk-vPa4eOmU.js} +1 -1
  43. package/static/index.html +1 -1
  44. package/static/{main-MNK6ZYDO.js → main-HV5WDK2F.js} +1 -1
  45. package/static/chunk-6BQlxALO.js +0 -1
  46. package/static/chunk-BNOYZq-b.js +0 -1
  47. package/static/chunk-BhGgxvgu.js +0 -1
  48. package/static/chunk-D6YfO72h.js +0 -1
  49. package/static/chunk-DoXxOh8j.js +0 -1
@@ -246,4 +246,4 @@ https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/CONTRIBUTING.md`),a||o||th
246
246
  .cdk-drag-preview * {
247
247
  pointer-events: none !important;
248
248
  }
249
- `],encapsulation:2})}return r})(),B=(()=>{class r{_ngZone=C$2(oe$2);_document=C$2(Uo$2);_styleLoader=C$2(R1);_renderer=C$2(Dr$2).createRenderer(null,null);_cleanupDocumentTouchmove;_scroll=new re$2;_dropInstances=new Set;_dragInstances=new Set;_activeDragInstances=qo$2([]);_globalListeners;_draggingPredicate=t=>t.isDragging();_domNodesToDirectives=null;pointerMove=new re$2;pointerUp=new re$2;registerDropContainer(t){this._dropInstances.has(t)||this._dropInstances.add(t);}registerDragItem(t){this._dragInstances.add(t),this._dragInstances.size===1&&this._ngZone.runOutsideAngular(()=>{this._cleanupDocumentTouchmove?.(),this._cleanupDocumentTouchmove=this._renderer.listen(this._document,"touchmove",this._persistentTouchmoveListener,tt);});}removeDropContainer(t){this._dropInstances.delete(t);}removeDragItem(t){this._dragInstances.delete(t),this.stopDragging(t),this._dragInstances.size===0&&this._cleanupDocumentTouchmove?.();}startDragging(t,i){if(!(this._activeDragInstances().indexOf(t)>-1)&&(this._styleLoader.load(pe),this._activeDragInstances.update(s=>[...s,t]),this._activeDragInstances().length===1)){let s=i.type.startsWith("touch"),n=a=>this.pointerUp.next(a),o=[["scroll",a=>this._scroll.next(a),I],["selectstart",this._preventDefaultWhileDragging,tt]];s?o.push(["touchend",n,I],["touchcancel",n,I]):o.push(["mouseup",n,I]),s||o.push(["mousemove",a=>this.pointerMove.next(a),tt]),this._ngZone.runOutsideAngular(()=>{this._globalListeners=o.map(([a,l,h])=>this._renderer.listen(this._document,a,l,h));});}}stopDragging(t){this._activeDragInstances.update(i=>{let s=i.indexOf(t);return s>-1?(i.splice(s,1),[...i]):i}),this._activeDragInstances().length===0&&this._clearGlobalListeners();}isDragging(t){return this._activeDragInstances().indexOf(t)>-1}scrolled(t){let i=[this._scroll];return t&&t!==this._document&&i.push(new S$1(s=>this._ngZone.runOutsideAngular(()=>{let n=this._renderer.listen(t,"scroll",o=>{this._activeDragInstances().length&&s.next(o);},I);return ()=>{n();}}))),zg(...i)}registerDirectiveNode(t,i){this._domNodesToDirectives??=new WeakMap,this._domNodesToDirectives.set(t,i);}removeDirectiveNode(t){this._domNodesToDirectives?.delete(t);}getDragDirectiveForNode(t){return this._domNodesToDirectives?.get(t)||null}ngOnDestroy(){this._dragInstances.forEach(t=>this.removeDragItem(t)),this._dropInstances.forEach(t=>this.removeDropContainer(t)),this._domNodesToDirectives=null,this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete();}_preventDefaultWhileDragging=t=>{this._activeDragInstances().length>0&&t.preventDefault();};_persistentTouchmoveListener=t=>{this._activeDragInstances().length>0&&(this._activeDragInstances().some(this._draggingPredicate)&&t.preventDefault(),this.pointerMove.next(t));};_clearGlobalListeners(){this._globalListeners?.forEach(t=>t()),this._globalListeners=void 0;}static \u0275fac=function(i){return new(i||r)};static \u0275prov=br$2({token:r,factory:r.\u0275fac})}return r})();function Wt(r){let e=r.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(r)*e}function ge(r){let e=getComputedStyle(r),t=et(e,"transition-property"),i=t.find(a=>a==="transform"||a==="all");if(!i)return 0;let s=t.indexOf(i),n=et(e,"transition-duration"),o=et(e,"transition-delay");return Wt(n[s])+Wt(o[s])}function et(r,e){return r.getPropertyValue(e).split(",").map(i=>i.trim())}var ue=new Set(["position"]),nt=class{_document;_rootElement;_direction;_initialDomRect;_previewTemplate;_previewClass;_pickupPositionOnPage;_initialTransform;_zIndex;_renderer;_previewEmbeddedView=null;_preview;get element(){return this._preview}constructor(e,t,i,s,n,o,a,l,h,c){this._document=e,this._rootElement=t,this._direction=i,this._initialDomRect=s,this._previewTemplate=n,this._previewClass=o,this._pickupPositionOnPage=a,this._initialTransform=l,this._zIndex=h,this._renderer=c;}attach(e){this._preview=this._createPreview(),e.appendChild(this._preview),Ut(this._preview)&&this._preview.showPopover();}destroy(){this._preview.remove(),this._previewEmbeddedView?.destroy(),this._preview=this._previewEmbeddedView=null;}setTransform(e){this._preview.style.transform=e;}getBoundingClientRect(){return this._preview.getBoundingClientRect()}addClass(e){this._preview.classList.add(e);}getTransitionDuration(){return ge(this._preview)}addEventListener(e,t){return this._renderer.listen(this._preview,e,t)}_createPreview(){let e=this._previewTemplate,t=this._previewClass,i=e?e.template:null,s;if(i&&e){let n=e.matchSize?this._initialDomRect:null,o=e.viewContainer.createEmbeddedView(i,e.context);o.detectChanges(),s=Jt$1(o,this._document),this._previewEmbeddedView=o,e.matchSize?Gt$1(s,n):s.style.transform=T(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y);}else s=it(this._rootElement),Gt$1(s,this._initialDomRect),this._initialTransform&&(s.style.transform=this._initialTransform);return ct(s.style,{"pointer-events":"none",margin:Ut(s)?"0 auto 0 0":"0",position:"fixed",top:"0",left:"0","z-index":this._zIndex+""},ue),S(s,false),s.classList.add("cdk-drag-preview"),s.setAttribute("popover","manual"),s.setAttribute("dir",this._direction),t&&(Array.isArray(t)?t.forEach(n=>s.classList.add(n)):s.classList.add(t)),s}};function Ut(r){return "showPopover"in r}var fe$1={passive:true},Zt$1={passive:false},me={passive:false,capture:true},ve=800,qt$1="cdk-drag-placeholder",$t$1=new Set(["position"]);function Qt$1(r,e,t={dragStartThreshold:5,pointerDirectionChangeThreshold:5}){let i=r.get(XI,null,{optional:true})||r.get(Dr$2).createRenderer(null,null);return new rt(e,t,r.get(Uo$2),r.get(oe$2),r.get(qt$2),r.get(B),i)}var rt=class{_config;_document;_ngZone;_viewportRuler;_dragDropRegistry;_renderer;_rootElementCleanups;_cleanupShadowRootSelectStart;_preview=null;_previewContainer;_placeholderRef=null;_placeholder;_pickupPositionInElement;_pickupPositionOnPage;_marker;_anchor=null;_passiveTransform={x:0,y:0};_activeTransform={x:0,y:0};_initialTransform;_hasStartedDragging=qo$2(false);_hasMoved=false;_initialContainer;_initialIndex;_parentPositions;_moveEvents=new re$2;_pointerDirectionDelta;_pointerPositionAtLastDirectionChange;_lastKnownPointerPosition;_rootElement;_ownerSVGElement=null;_rootElementTapHighlight;_pointerMoveSubscription=H$2.EMPTY;_pointerUpSubscription=H$2.EMPTY;_scrollSubscription=H$2.EMPTY;_resizeSubscription=H$2.EMPTY;_lastTouchEventTime;_dragStartTime;_boundaryElement=null;_nativeInteractionsEnabled=true;_initialDomRect;_previewRect;_boundaryRect;_previewTemplate;_placeholderTemplate;_handles=[];_disabledHandles=new Set;_dropContainer;_direction="ltr";_parentDragRef=null;_cachedShadowRoot;lockAxis=null;dragStartDelay=0;previewClass;scale=1;get disabled(){return this._disabled||!!(this._dropContainer&&this._dropContainer.disabled)}set disabled(e){e!==this._disabled&&(this._disabled=e,this._toggleNativeDragInteractions(),this._handles.forEach(t=>S(t,e)));}_disabled=false;beforeStarted=new re$2;started=new re$2;released=new re$2;ended=new re$2;entered=new re$2;exited=new re$2;dropped=new re$2;moved=this._moveEvents;data;constrainPosition;constructor(e,t,i,s,n,o,a){this._config=t,this._document=i,this._ngZone=s,this._viewportRuler=n,this._dragDropRegistry=o,this._renderer=a,this.withRootElement(e).withParent(t.parentDragRef||null),this._parentPositions=new H(i),o.registerDragItem(this);}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(e){this._handles=e.map(i=>jt$1(i)),this._handles.forEach(i=>S(i,this.disabled)),this._toggleNativeDragInteractions();let t=new Set;return this._disabledHandles.forEach(i=>{this._handles.indexOf(i)>-1&&t.add(i);}),this._disabledHandles=t,this}withPreviewTemplate(e){return this._previewTemplate=e,this}withPlaceholderTemplate(e){return this._placeholderTemplate=e,this}withRootElement(e){let t=jt$1(e);if(t!==this._rootElement){this._removeRootElementListeners();let i=this._renderer;this._rootElementCleanups=this._ngZone.runOutsideAngular(()=>[i.listen(t,"mousedown",this._pointerDown,Zt$1),i.listen(t,"touchstart",this._pointerDown,fe$1),i.listen(t,"dragstart",this._nativeDragStart,Zt$1)]),this._initialTransform=void 0,this._rootElement=t;}return typeof SVGElement<"u"&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(e){return this._boundaryElement=e?jt$1(e):null,this._resizeSubscription.unsubscribe(),e&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}withParent(e){return this._parentDragRef=e,this}dispose(){this._removeRootElementListeners(),this.isDragging()&&this._rootElement?.remove(),this._marker?.remove(),this._destroyPreview(),this._destroyPlaceholder(),this._dragDropRegistry.removeDragItem(this),this._removeListeners(),this.beforeStarted.complete(),this.started.complete(),this.released.complete(),this.ended.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this._moveEvents.complete(),this._handles=[],this._disabledHandles.clear(),this._dropContainer=void 0,this._resizeSubscription.unsubscribe(),this._parentPositions.clear(),this._boundaryElement=this._rootElement=this._ownerSVGElement=this._placeholderTemplate=this._previewTemplate=this._marker=this._parentDragRef=null;}isDragging(){return this._hasStartedDragging()&&this._dragDropRegistry.isDragging(this)}reset(){this._rootElement.style.transform=this._initialTransform||"",this._activeTransform={x:0,y:0},this._passiveTransform={x:0,y:0};}resetToBoundary(){if(this._boundaryElement&&this._rootElement&&_e(this._boundaryElement.getBoundingClientRect(),this._rootElement.getBoundingClientRect())){let e=this._boundaryElement.getBoundingClientRect(),t=this._rootElement.getBoundingClientRect(),i=0,s=0;t.left<e.left?i=e.left-t.left:t.right>e.right&&(i=e.right-t.right),t.top<e.top?s=e.top-t.top:t.bottom>e.bottom&&(s=e.bottom-t.bottom);let n=this._activeTransform.x,o=this._activeTransform.y,a=n+i,l=o+s;this._rootElement.style.transform=T(a,l),this._activeTransform={x:a,y:l},this._passiveTransform={x:a,y:l};}}disableHandle(e){!this._disabledHandles.has(e)&&this._handles.indexOf(e)>-1&&(this._disabledHandles.add(e),S(e,true));}enableHandle(e){this._disabledHandles.has(e)&&(this._disabledHandles.delete(e),S(e,this.disabled));}withDirection(e){return this._direction=e,this}_withDropContainer(e){this._dropContainer=e;}getFreeDragPosition(){let e=this.isDragging()?this._activeTransform:this._passiveTransform;return {x:e.x,y:e.y}}setFreeDragPosition(e){return this._activeTransform={x:0,y:0},this._passiveTransform.x=e.x,this._passiveTransform.y=e.y,this._dropContainer||this._applyRootElementTransform(e.x,e.y),this}withPreviewContainer(e){return this._previewContainer=e,this}_sortFromLastPointerPosition(){let e=this._lastKnownPointerPosition;e&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(e),e);}_removeListeners(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe(),this._cleanupShadowRootSelectStart?.(),this._cleanupShadowRootSelectStart=void 0;}_destroyPreview(){this._preview?.destroy(),this._preview=null;}_destroyPlaceholder(){this._anchor?.remove(),this._placeholder?.remove(),this._placeholderRef?.destroy(),this._placeholder=this._anchor=this._placeholderRef=null;}_pointerDown=e=>{if(this.beforeStarted.next(),this._handles.length){let t=this._getTargetHandle(e);t&&!this._disabledHandles.has(t)&&!this.disabled&&this._initializeDragSequence(t,e);}else this.disabled||this._initializeDragSequence(this._rootElement,e);};_pointerMove=e=>{let t=this._getPointerPositionOnPage(e);if(!this._hasStartedDragging()){let s=Math.abs(t.x-this._pickupPositionOnPage.x),n=Math.abs(t.y-this._pickupPositionOnPage.y);if(s+n>=this._config.dragStartThreshold){let a=Date.now()>=this._dragStartTime+this._getDragStartDelay(e),l=this._dropContainer;if(!a){this._endDragSequence(e);return}(!l||!l.isDragging()&&!l.isReceiving())&&(e.cancelable&&e.preventDefault(),this._hasStartedDragging.set(true),this._ngZone.run(()=>this._startDragSequence(e)));}return}e.cancelable&&e.preventDefault();let i=this._getConstrainedPointerPosition(t);if(this._hasMoved=true,this._lastKnownPointerPosition=t,this._updatePointerDirectionDelta(i),this._dropContainer)this._updateActiveDropContainer(i,t);else {let s=this.constrainPosition?this._initialDomRect:this._pickupPositionOnPage,n=this._activeTransform;n.x=i.x-s.x+this._passiveTransform.x,n.y=i.y-s.y+this._passiveTransform.y,this._applyRootElementTransform(n.x,n.y);}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:i,event:e,distance:this._getDragDistance(i),delta:this._pointerDirectionDelta});});};_pointerUp=e=>{this._endDragSequence(e);};_endDragSequence(e){if(this._dragDropRegistry.isDragging(this)&&(this._removeListeners(),this._dragDropRegistry.stopDragging(this),this._toggleNativeDragInteractions(),this._handles&&(this._rootElement.style.webkitTapHighlightColor=this._rootElementTapHighlight),!!this._hasStartedDragging()))if(this.released.next({source:this,event:e}),this._dropContainer)this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(e),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this);});else {this._passiveTransform.x=this._activeTransform.x;let t=this._getPointerPositionOnPage(e);this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(t),dropPoint:t,event:e});}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this);}}_startDragSequence(e){x(e)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();let t=this._getShadowRoot(),i=this._dropContainer;if(t&&this._ngZone.runOutsideAngular(()=>{this._cleanupShadowRootSelectStart=this._renderer.listen(t,"selectstart",De,me);}),i){let s=this._rootElement,n=s.parentNode,o=this._placeholder=this._createPlaceholderElement(),a=this._marker=this._marker||this._document.createComment("");n.insertBefore(a,s),this._initialTransform=s.style.transform||"",this._preview=new nt(this._document,this._rootElement,this._direction,this._initialDomRect,this._previewTemplate||null,this.previewClass||null,this._pickupPositionOnPage,this._initialTransform,this._config.zIndex||1e3,this._renderer),this._preview.attach(this._getPreviewInsertionPoint(n,t)),Bt$1(s,false,$t$1),this._document.body.appendChild(n.replaceChild(o,s)),this.started.next({source:this,event:e}),i.start(),this._initialContainer=i,this._initialIndex=i.getItemIndex(this);}else this.started.next({source:this,event:e}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(i?i.getScrollableParents():[]);}_initializeDragSequence(e,t){this._parentDragRef&&t.stopPropagation();let i=this.isDragging(),s=x(t),n=!s&&t.button!==0,o=this._rootElement,a=He(t),l=!s&&this._lastTouchEventTime&&this._lastTouchEventTime+ve>Date.now(),h=s?Ui(t):ji(t);if(a&&a.draggable&&t.type==="mousedown"&&t.preventDefault(),i||n||l||h)return;if(this._handles.length){let v=o.style;this._rootElementTapHighlight=v.webkitTapHighlightColor||"",v.webkitTapHighlightColor="transparent";}this._hasMoved=false,this._hasStartedDragging.set(this._hasMoved),this._removeListeners(),this._initialDomRect=this._rootElement.getBoundingClientRect(),this._pointerMoveSubscription=this._dragDropRegistry.pointerMove.subscribe(this._pointerMove),this._pointerUpSubscription=this._dragDropRegistry.pointerUp.subscribe(this._pointerUp),this._scrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(v=>this._updateOnScroll(v)),this._boundaryElement&&(this._boundaryRect=ht$1(this._boundaryElement));let c=this._previewTemplate;this._pickupPositionInElement=c&&c.template&&!c.matchSize?{x:0,y:0}:this._getPointerPositionInElement(this._initialDomRect,e,t);let g=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(t);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:g.x,y:g.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,t);}_cleanupDragArtifacts(e){Bt$1(this._rootElement,true,$t$1),this._marker.parentNode.replaceChild(this._rootElement,this._marker),this._destroyPreview(),this._destroyPlaceholder(),this._initialDomRect=this._boundaryRect=this._previewRect=this._initialTransform=void 0,this._ngZone.run(()=>{let t=this._dropContainer,i=t.getItemIndex(this),s=this._getPointerPositionOnPage(e),n=this._getDragDistance(s),o=t._isOverContainer(s.x,s.y);this.ended.next({source:this,distance:n,dropPoint:s,event:e}),this.dropped.next({item:this,currentIndex:i,previousIndex:this._initialIndex,container:t,previousContainer:this._initialContainer,isPointerOverContainer:o,distance:n,dropPoint:s,event:e}),t.drop(this,i,this._initialIndex,this._initialContainer,o,n,s,e),this._dropContainer=this._initialContainer;});}_updateActiveDropContainer({x:e,y:t},{x:i,y:s}){let n=this._initialContainer._getSiblingContainerFromPosition(this,e,t);!n&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(e,t)&&(n=this._initialContainer),n&&n!==this._dropContainer&&this._ngZone.run(()=>{let o=this._dropContainer.getItemIndex(this),a=this._dropContainer.getItemAtIndex(o+1)?.getVisibleElement()||null;this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._conditionallyInsertAnchor(n,this._dropContainer,a),this._dropContainer=n,this._dropContainer.enter(this,e,t,n===this._initialContainer&&n.sortingDisabled?this._initialIndex:void 0),this.entered.next({item:this,container:n,currentIndex:n.getItemIndex(this)});}),this.isDragging()&&(this._dropContainer._startScrollingIfNecessary(i,s),this._dropContainer._sortItem(this,e,t,this._pointerDirectionDelta),this.constrainPosition?this._applyPreviewTransform(e,t):this._applyPreviewTransform(e-this._pickupPositionInElement.x,t-this._pickupPositionInElement.y));}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();let e=this._placeholder.getBoundingClientRect();this._preview.addClass("cdk-drag-animating"),this._applyPreviewTransform(e.left,e.top);let t=this._preview.getTransitionDuration();return t===0?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(i=>{let s=a=>{(!a||this._preview&&He(a)===this._preview.element&&a.propertyName==="transform")&&(o(),i(),clearTimeout(n));},n=setTimeout(s,t*1.5),o=this._preview.addEventListener("transitionend",s);}))}_createPlaceholderElement(){let e=this._placeholderTemplate,t=e?e.template:null,i;return t?(this._placeholderRef=e.viewContainer.createEmbeddedView(t,e.context),this._placeholderRef.detectChanges(),i=Jt$1(this._placeholderRef,this._document)):i=it(this._rootElement),i.style.pointerEvents="none",i.classList.add(qt$1),i}_getPointerPositionInElement(e,t,i){let s=t===this._rootElement?null:t,n=s?s.getBoundingClientRect():e,o=x(i)?i.targetTouches[0]:i,a=this._getViewportScrollPosition(),l=o.pageX-n.left-a.left,h=o.pageY-n.top-a.top;return {x:n.left-e.left+l,y:n.top-e.top+h}}_getPointerPositionOnPage(e){let t=this._getViewportScrollPosition(),i=x(e)?e.touches[0]||e.changedTouches[0]||{pageX:0,pageY:0}:e,s=i.pageX-t.left,n=i.pageY-t.top;if(this._ownerSVGElement){let o=this._ownerSVGElement.getScreenCTM();if(o){let a=this._ownerSVGElement.createSVGPoint();return a.x=s,a.y=n,a.matrixTransform(o.inverse())}}return {x:s,y:n}}_getConstrainedPointerPosition(e){let t=this._dropContainer?this._dropContainer.lockAxis:null,{x:i,y:s}=this.constrainPosition?this.constrainPosition(e,this,this._initialDomRect,this._pickupPositionInElement):e;if(this.lockAxis==="x"||t==="x"?s=this._pickupPositionOnPage.y-(this.constrainPosition?this._pickupPositionInElement.y:0):(this.lockAxis==="y"||t==="y")&&(i=this._pickupPositionOnPage.x-(this.constrainPosition?this._pickupPositionInElement.x:0)),this._boundaryRect){let{x:n,y:o}=this.constrainPosition?{x:0,y:0}:this._pickupPositionInElement,a=this._boundaryRect,{width:l,height:h}=this._getPreviewRect(),c=a.top+o,g=a.bottom-(h-o),v=a.left+n,G=a.right-(l-n);i=Kt$1(i,v,G),s=Kt$1(s,c,g);}return {x:i,y:s}}_updatePointerDirectionDelta(e){let{x:t,y:i}=e,s=this._pointerDirectionDelta,n=this._pointerPositionAtLastDirectionChange,o=Math.abs(t-n.x),a=Math.abs(i-n.y);return o>this._config.pointerDirectionChangeThreshold&&(s.x=t>n.x?1:-1,n.x=t),a>this._config.pointerDirectionChangeThreshold&&(s.y=i>n.y?1:-1,n.y=i),s}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;let e=this._handles.length>0||!this.isDragging();e!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=e,S(this._rootElement,e));}_removeRootElementListeners(){this._rootElementCleanups?.forEach(e=>e()),this._rootElementCleanups=void 0;}_applyRootElementTransform(e,t){let i=1/this.scale,s=T(e*i,t*i),n=this._rootElement.style;this._initialTransform==null&&(this._initialTransform=n.transform&&n.transform!="none"?n.transform:""),n.transform=z(s,this._initialTransform);}_applyPreviewTransform(e,t){let i=this._previewTemplate?.template?void 0:this._initialTransform,s=T(e,t);this._preview.setTransform(z(s,i));}_getDragDistance(e){let t=this._pickupPositionOnPage;return t?{x:e.x-t.x,y:e.y-t.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear();}_containInsideBoundaryOnResize(){let{x:e,y:t}=this._passiveTransform;if(e===0&&t===0||this.isDragging()||!this._boundaryElement)return;let i=this._rootElement.getBoundingClientRect(),s=this._boundaryElement.getBoundingClientRect();if(s.width===0&&s.height===0||i.width===0&&i.height===0)return;let n=s.left-i.left,o=i.right-s.right,a=s.top-i.top,l=i.bottom-s.bottom;s.width>i.width?(n>0&&(e+=n),o>0&&(e-=o)):e=0,s.height>i.height?(a>0&&(t+=a),l>0&&(t-=l)):t=0,(e!==this._passiveTransform.x||t!==this._passiveTransform.y)&&this.setFreeDragPosition({y:t,x:e});}_getDragStartDelay(e){let t=this.dragStartDelay;return typeof t=="number"?t:x(e)?t.touch:t?t.mouse:0}_updateOnScroll(e){let t=this._parentPositions.handleScroll(e);if(t){let i=He(e);this._boundaryRect&&i!==this._boundaryElement&&i.contains(this._boundaryElement)&&C(this._boundaryRect,t.top,t.left),this._pickupPositionOnPage.x+=t.left,this._pickupPositionOnPage.y+=t.top,this._dropContainer||(this._activeTransform.x-=t.left,this._activeTransform.y-=t.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y));}}_getViewportScrollPosition(){return this._parentPositions.positions.get(this._document)?.scrollPosition||this._parentPositions.getViewportScrollPosition()}_getShadowRoot(){return this._cachedShadowRoot===void 0&&(this._cachedShadowRoot=D3(this._rootElement)),this._cachedShadowRoot}_getPreviewInsertionPoint(e,t){let i=this._previewContainer||"global";if(i==="parent")return e;if(i==="global"){let s=this._document;return t||s.fullscreenElement||s.webkitFullscreenElement||s.mozFullScreenElement||s.msFullscreenElement||s.body}return jt$1(i)}_getPreviewRect(){return (!this._previewRect||!this._previewRect.width&&!this._previewRect.height)&&(this._previewRect=this._preview?this._preview.getBoundingClientRect():this._initialDomRect),this._previewRect}_nativeDragStart=e=>{if(this._handles.length){let t=this._getTargetHandle(e);t&&!this._disabledHandles.has(t)&&!this.disabled&&e.preventDefault();}else this.disabled||e.preventDefault();};_getTargetHandle(e){return this._handles.find(t=>e.target&&(e.target===t||t.contains(e.target)))}_conditionallyInsertAnchor(e,t,i){if(e===this._initialContainer)this._anchor?.remove(),this._anchor=null;else if(t===this._initialContainer&&t.hasAnchor){let s=this._anchor??=it(this._placeholder);s.classList.remove(qt$1),s.classList.add("cdk-drag-anchor"),s.style.transform="",i?i.before(s):jt$1(t.element).appendChild(s);}}};function Kt$1(r,e,t){return Math.max(e,Math.min(t,r))}function x(r){return r.type[0]==="t"}function De(r){r.preventDefault();}function te(r,e,t){let i=jt(e,r.length-1),s=jt(t,r.length-1);if(i===s)return;let n=r[i],o=s<i?-1:1;for(let a=i;a!==s;a+=o)r[a]=r[a+o];r[s]=n;}function jt(r,e){return Math.max(0,Math.min(e,r))}var V=class{_dragDropRegistry;_element;_sortPredicate;_itemPositions=[];_activeDraggables;orientation="vertical";direction="ltr";constructor(e){this._dragDropRegistry=e;}_previousSwap={drag:null,delta:0,overlaps:false};start(e){this.withItems(e);}sort(e,t,i,s){let n=this._itemPositions,o=this._getItemIndexFromPointerPosition(e,t,i,s);if(o===-1&&n.length>0)return null;let a=this.orientation==="horizontal",l=n.findIndex(u=>u.drag===e),h=n[o],c=n[l].clientRect,g=h.clientRect,v=l>o?1:-1,G=this._getItemOffsetPx(c,g,v),le=this._getSiblingOffsetPx(l,n,v),he=n.slice();return te(n,l,o),n.forEach((u,ce)=>{if(he[ce]===u)return;let dt=u.drag===e,W=dt?G:le,_t=dt?e.getPlaceholderElement():u.drag.getRootElement();u.offset+=W;let pt=Math.round(u.offset*(1/u.drag.scale));a?(_t.style.transform=z(`translate3d(${pt}px, 0, 0)`,u.initialTransform),C(u.clientRect,0,W)):(_t.style.transform=z(`translate3d(0, ${pt}px, 0)`,u.initialTransform),C(u.clientRect,W,0));}),this._previousSwap.overlaps=st(g,t,i),this._previousSwap.drag=h.drag,this._previousSwap.delta=a?s.x:s.y,{previousIndex:l,currentIndex:o}}enter(e,t,i,s){let n=this._activeDraggables,o=n.indexOf(e),a=e.getPlaceholderElement();o>-1&&n.splice(o,1);let l=s==null||s<0?this._getItemIndexFromPointerPosition(e,t,i):s,h=n[l];if(h===e&&(h=n[l+1]),!h&&(l==null||l===-1||l<n.length-1)&&this._shouldEnterAsFirstChild(t,i)&&(h=n[0]),h&&!this._dragDropRegistry.isDragging(h)){let c=h.getRootElement();c.parentElement.insertBefore(a,c),n.splice(l,0,e);}else this._element.appendChild(a),n.push(e);a.style.transform="",this._cacheItemPositions();}withItems(e){this._activeDraggables=e.slice(),this._cacheItemPositions();}withSortPredicate(e){this._sortPredicate=e;}reset(){this._activeDraggables?.forEach(e=>{let t=e.getRootElement();if(t){let i=this._itemPositions.find(s=>s.drag===e)?.initialTransform;t.style.transform=i||"";}}),this._itemPositions=[],this._activeDraggables=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=false;}getActiveItemsSnapshot(){return this._activeDraggables}getItemIndex(e){return this._getVisualItemPositions().findIndex(t=>t.drag===e)}getItemAtIndex(e){return this._getVisualItemPositions()[e]?.drag||null}updateOnScroll(e,t){this._itemPositions.forEach(({clientRect:i})=>{C(i,e,t);}),this._itemPositions.forEach(({drag:i})=>{this._dragDropRegistry.isDragging(i)&&i._sortFromLastPointerPosition();});}withElementContainer(e){this._element=e;}_cacheItemPositions(){let e=this.orientation==="horizontal";this._itemPositions=this._activeDraggables.map(t=>{let i=t.getVisibleElement();return {drag:t,offset:0,initialTransform:i.style.transform||"",clientRect:ht$1(i)}}).sort((t,i)=>e?t.clientRect.left-i.clientRect.left:t.clientRect.top-i.clientRect.top);}_getVisualItemPositions(){return this.orientation==="horizontal"&&this.direction==="rtl"?this._itemPositions.slice().reverse():this._itemPositions}_getItemOffsetPx(e,t,i){let s=this.orientation==="horizontal",n=s?t.left-e.left:t.top-e.top;return i===-1&&(n+=s?t.width-e.width:t.height-e.height),n}_getSiblingOffsetPx(e,t,i){let s=this.orientation==="horizontal",n=t[e].clientRect,o=t[e+i*-1],a=n[s?"width":"height"]*i;if(o){let l=s?"left":"top",h=s?"right":"bottom";i===-1?a-=o.clientRect[l]-n[h]:a+=n[l]-o.clientRect[h];}return a}_shouldEnterAsFirstChild(e,t){if(!this._activeDraggables.length)return false;let i=this._itemPositions,s=this.orientation==="horizontal";if(i[0].drag!==this._activeDraggables[0]){let o=i[i.length-1].clientRect;return s?e>=o.right:t>=o.bottom}else {let o=i[0].clientRect;return s?e<=o.left:t<=o.top}}_getItemIndexFromPointerPosition(e,t,i,s){let n=this.orientation==="horizontal",o=this._itemPositions.findIndex(({drag:a,clientRect:l})=>{if(a===e)return false;if(s){let h=n?s.x:s.y;if(a===this._previousSwap.drag&&this._previousSwap.overlaps&&h===this._previousSwap.delta)return false}return n?t>=Math.floor(l.left)&&t<Math.floor(l.right):i>=Math.floor(l.top)&&i<Math.floor(l.bottom)});return o===-1||!this._sortPredicate(o,e)?-1:o}},ot=class{_document;_dragDropRegistry;_element;_sortPredicate;_rootNode;_activeItems;_previousSwap={drag:null,deltaX:0,deltaY:0,overlaps:false};_relatedNodes=[];constructor(e,t){this._document=e,this._dragDropRegistry=t;}start(e){let t=this._element.childNodes;this._relatedNodes=[];for(let i=0;i<t.length;i++){let s=t[i];this._relatedNodes.push([s,s.nextSibling]);}this.withItems(e);}sort(e,t,i,s){let n=this._getItemIndexFromPointerPosition(e,t,i),o=this._previousSwap;if(n===-1||this._activeItems[n]===e)return null;let a=this._activeItems[n];if(o.drag===a&&o.overlaps&&o.deltaX===s.x&&o.deltaY===s.y)return null;let l=this.getItemIndex(e),h=e.getPlaceholderElement(),c=a.getRootElement();n>l?c.after(h):c.before(h),te(this._activeItems,l,n);let g=this._getRootNode().elementFromPoint(t,i);return o.deltaX=s.x,o.deltaY=s.y,o.drag=a,o.overlaps=c===g||c.contains(g),{previousIndex:l,currentIndex:n}}enter(e,t,i,s){let n=this._activeItems.indexOf(e);n>-1&&this._activeItems.splice(n,1);let o=s==null||s<0?this._getItemIndexFromPointerPosition(e,t,i):s;o===-1&&(o=this._getClosestItemIndexToPointer(e,t,i));let a=this._activeItems[o];a&&!this._dragDropRegistry.isDragging(a)?(this._activeItems.splice(o,0,e),a.getRootElement().before(e.getPlaceholderElement())):(this._activeItems.push(e),this._element.appendChild(e.getPlaceholderElement()));}withItems(e){this._activeItems=e.slice();}withSortPredicate(e){this._sortPredicate=e;}reset(){let e=this._element,t=this._previousSwap;for(let i=this._relatedNodes.length-1;i>-1;i--){let[s,n]=this._relatedNodes[i];s.parentNode===e&&s.nextSibling!==n&&(n===null?e.appendChild(s):n.parentNode===e&&e.insertBefore(s,n));}this._relatedNodes=[],this._activeItems=[],t.drag=null,t.deltaX=t.deltaY=0,t.overlaps=false;}getActiveItemsSnapshot(){return this._activeItems}getItemIndex(e){return this._activeItems.indexOf(e)}getItemAtIndex(e){return this._activeItems[e]||null}updateOnScroll(){this._activeItems.forEach(e=>{this._dragDropRegistry.isDragging(e)&&e._sortFromLastPointerPosition();});}withElementContainer(e){e!==this._element&&(this._element=e,this._rootNode=void 0);}_getItemIndexFromPointerPosition(e,t,i){let s=this._getRootNode().elementFromPoint(Math.floor(t),Math.floor(i)),n=s?this._activeItems.findIndex(o=>{let a=o.getRootElement();return s===a||a.contains(s)}):-1;return n===-1||!this._sortPredicate(n,e)?-1:n}_getRootNode(){return this._rootNode||(this._rootNode=D3(this._element)||this._document),this._rootNode}_getClosestItemIndexToPointer(e,t,i){if(this._activeItems.length===0)return -1;if(this._activeItems.length===1)return 0;let s=1/0,n=-1;for(let o=0;o<this._activeItems.length;o++){let a=this._activeItems[o];if(a!==e){let{x:l,y:h}=a.getRootElement().getBoundingClientRect(),c=Math.hypot(t-l,i-h);c<s&&(s=c,n=o);}}return n}},Yt$1=.05,ee=.05,f=(function(r){return r[r.NONE=0]="NONE",r[r.UP=1]="UP",r[r.DOWN=2]="DOWN",r})(f||{}),p=(function(r){return r[r.NONE=0]="NONE",r[r.LEFT=1]="LEFT",r[r.RIGHT=2]="RIGHT",r})(p||{});function ie(r,e){return new at(e,r.get(B),r.get(Uo$2),r.get(oe$2),r.get(qt$2))}var at=class{_dragDropRegistry;_ngZone;_viewportRuler;element;disabled=false;sortingDisabled=false;lockAxis=null;autoScrollDisabled=false;autoScrollStep=2;hasAnchor=false;enterPredicate=()=>true;sortPredicate=()=>true;beforeStarted=new re$2;entered=new re$2;exited=new re$2;dropped=new re$2;sorted=new re$2;receivingStarted=new re$2;receivingStopped=new re$2;data;_container;_isDragging=false;_parentPositions;_sortStrategy;_domRect;_draggables=[];_siblings=[];_activeSiblings=new Set;_viewportScrollSubscription=H$2.EMPTY;_verticalScrollDirection=f.NONE;_horizontalScrollDirection=p.NONE;_scrollNode;_stopScrollTimers=new re$2;_cachedShadowRoot=null;_document;_scrollableElements=[];_initialScrollSnap;_direction="ltr";constructor(e,t,i,s,n){this._dragDropRegistry=t,this._ngZone=s,this._viewportRuler=n;let o=this.element=jt$1(e);this._document=i,this.withOrientation("vertical").withElementContainer(o),t.registerDropContainer(this),this._parentPositions=new H(i);}dispose(){this._stopScrolling(),this._stopScrollTimers.complete(),this._viewportScrollSubscription.unsubscribe(),this.beforeStarted.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this.sorted.complete(),this.receivingStarted.complete(),this.receivingStopped.complete(),this._activeSiblings.clear(),this._scrollNode=null,this._parentPositions.clear(),this._dragDropRegistry.removeDropContainer(this);}isDragging(){return this._isDragging}start(){this._draggingStarted(),this._notifyReceivingSiblings();}enter(e,t,i,s){this._draggingStarted(),s==null&&this.sortingDisabled&&(s=this._draggables.indexOf(e)),this._sortStrategy.enter(e,t,i,s),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:e,container:this,currentIndex:this.getItemIndex(e)});}exit(e){this._reset(),this.exited.next({item:e,container:this});}drop(e,t,i,s,n,o,a,l){this._reset(),this.dropped.next({item:e,currentIndex:t,previousIndex:i,container:this,previousContainer:s,isPointerOverContainer:n,distance:o,dropPoint:a,event:l});}withItems(e){let t=this._draggables;return this._draggables=e,e.forEach(i=>i._withDropContainer(this)),this.isDragging()&&(t.filter(s=>s.isDragging()).every(s=>e.indexOf(s)===-1)?this._reset():this._sortStrategy.withItems(this._draggables)),this}withDirection(e){return this._direction=e,this._sortStrategy instanceof V&&(this._sortStrategy.direction=e),this}connectedTo(e){return this._siblings=e.slice(),this}withOrientation(e){if(e==="mixed")this._sortStrategy=new ot(this._document,this._dragDropRegistry);else {let t=new V(this._dragDropRegistry);t.direction=this._direction,t.orientation=e,this._sortStrategy=t;}return this._sortStrategy.withElementContainer(this._container),this._sortStrategy.withSortPredicate((t,i)=>this.sortPredicate(t,i,this)),this}withScrollableParents(e){let t=this._container;return this._scrollableElements=e.indexOf(t)===-1?[t,...e]:e.slice(),this}withElementContainer(e){if(e===this._container)return this;jt$1(this.element);let i=this._scrollableElements.indexOf(this._container),s=this._scrollableElements.indexOf(e);return i>-1&&this._scrollableElements.splice(i,1),s>-1&&this._scrollableElements.splice(s,1),this._sortStrategy&&this._sortStrategy.withElementContainer(e),this._cachedShadowRoot=null,this._scrollableElements.unshift(e),this._container=e,this}getScrollableParents(){return this._scrollableElements}getItemIndex(e){return this._isDragging?this._sortStrategy.getItemIndex(e):this._draggables.indexOf(e)}getItemAtIndex(e){return this._isDragging?this._sortStrategy.getItemAtIndex(e):this._draggables[e]||null}isReceiving(){return this._activeSiblings.size>0}_sortItem(e,t,i,s){if(this.sortingDisabled||!this._domRect||!Vt$1(this._domRect,Yt$1,t,i))return;let n=this._sortStrategy.sort(e,t,i,s);n&&this.sorted.next({previousIndex:n.previousIndex,currentIndex:n.currentIndex,container:this,item:e});}_startScrollingIfNecessary(e,t){if(this.autoScrollDisabled)return;let i,s=f.NONE,n=p.NONE;if(this._parentPositions.positions.forEach((o,a)=>{a===this._document||!o.clientRect||i||Vt$1(o.clientRect,Yt$1,e,t)&&([s,n]=we(a,o.clientRect,this._direction,e,t),(s||n)&&(i=a));}),!s&&!n){let{width:o,height:a}=this._viewportRuler.getViewportSize(),l={width:o,height:a,top:0,right:o,bottom:a,left:0};s=se(l,t),n=ne(l,e),i=window;}i&&(s!==this._verticalScrollDirection||n!==this._horizontalScrollDirection||i!==this._scrollNode)&&(this._verticalScrollDirection=s,this._horizontalScrollDirection=n,this._scrollNode=i,(s||n)&&i?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling());}_stopScrolling(){this._stopScrollTimers.next();}_draggingStarted(){let e=this._container.style;this.beforeStarted.next(),this._isDragging=true,this._initialScrollSnap=e.msScrollSnapType||e.scrollSnapType||"",e.scrollSnapType=e.msScrollSnapType="none",this._sortStrategy.start(this._draggables),this._cacheParentPositions(),this._viewportScrollSubscription.unsubscribe(),this._listenToScrollEvents();}_cacheParentPositions(){this._parentPositions.cache(this._scrollableElements),this._domRect=this._parentPositions.positions.get(this._container).clientRect;}_reset(){this._isDragging=false;let e=this._container.style;e.scrollSnapType=e.msScrollSnapType=this._initialScrollSnap,this._siblings.forEach(t=>t._stopReceiving(this)),this._sortStrategy.reset(),this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear();}_startScrollInterval=()=>{this._stopScrolling(),Gg(0,Og).pipe(im(this._stopScrollTimers)).subscribe(()=>{let e=this._scrollNode,t=this.autoScrollStep;this._verticalScrollDirection===f.UP?e.scrollBy(0,-t):this._verticalScrollDirection===f.DOWN&&e.scrollBy(0,t),this._horizontalScrollDirection===p.LEFT?e.scrollBy(-t,0):this._horizontalScrollDirection===p.RIGHT&&e.scrollBy(t,0);});};_isOverContainer(e,t){return this._domRect!=null&&st(this._domRect,e,t)}_getSiblingContainerFromPosition(e,t,i){return this._siblings.find(s=>s._canReceive(e,t,i))}_canReceive(e,t,i){if(!this._domRect||!st(this._domRect,t,i)||!this.enterPredicate(e,this))return false;let s=this._getShadowRoot().elementFromPoint(t,i);return s?s===this._container||this._container.contains(s):false}_startReceiving(e,t){let i=this._activeSiblings;!i.has(e)&&t.every(s=>this.enterPredicate(s,this)||this._draggables.indexOf(s)>-1)&&(i.add(e),this._cacheParentPositions(),this._listenToScrollEvents(),this.receivingStarted.next({initiator:e,receiver:this,items:t}));}_stopReceiving(e){this._activeSiblings.delete(e),this._viewportScrollSubscription.unsubscribe(),this.receivingStopped.next({initiator:e,receiver:this});}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(e=>{if(this.isDragging()){let t=this._parentPositions.handleScroll(e);t&&this._sortStrategy.updateOnScroll(t.top,t.left);}else this.isReceiving()&&this._cacheParentPositions();});}_getShadowRoot(){if(!this._cachedShadowRoot){let e=D3(this._container);this._cachedShadowRoot=e||this._document;}return this._cachedShadowRoot}_notifyReceivingSiblings(){let e=this._sortStrategy.getActiveItemsSnapshot().filter(t=>t.isDragging());this._siblings.forEach(t=>t._startReceiving(this,e));}};function se(r,e){let{top:t,bottom:i,height:s}=r,n=s*ee;return e>=t-n&&e<=t+n?f.UP:e>=i-n&&e<=i+n?f.DOWN:f.NONE}function ne(r,e){let{left:t,right:i,width:s}=r,n=s*ee;return e>=t-n&&e<=t+n?p.LEFT:e>=i-n&&e<=i+n?p.RIGHT:p.NONE}function we(r,e,t,i,s){let n=se(e,s),o=ne(e,i),a=f.NONE,l=p.NONE;if(n){let h=r.scrollTop;n===f.UP?h>0&&(a=f.UP):r.scrollHeight-h>r.clientHeight&&(a=f.DOWN);}if(o){let h=r.scrollLeft;t==="rtl"?o===p.RIGHT?h<0&&(l=p.RIGHT):r.scrollWidth+h>r.clientWidth&&(l=p.LEFT):o===p.LEFT?h>0&&(l=p.LEFT):r.scrollWidth-h>r.clientWidth&&(l=p.RIGHT);}return [a,l]}var be=(()=>{class r{_injector=C$2(Ee$2);createDrag(t,i){return Qt$1(this._injector,t,i)}createDropList(t){return ie(this._injector,t)}static \u0275fac=function(i){return new(i||r)};static \u0275prov=br$2({token:r,factory:r.\u0275fac})}return r})(),lt=new A$2("CDK_DRAG_PARENT");var re=new A$2("CdkDragHandle"),Ge=(()=>{class r{element=C$2(_r$2);_parentDrag=C$2(lt,{optional:true,skipSelf:true});_dragDropRegistry=C$2(B);_stateChanges=new re$2;get disabled(){return this._disabled}set disabled(t){this._disabled=t,this._stateChanges.next(this);}_disabled=false;constructor(){this._parentDrag?._addHandle(this);}ngAfterViewInit(){if(!this._parentDrag){let t=this.element.nativeElement.parentElement;for(;t;){let i=this._dragDropRegistry.getDragDirectiveForNode(t);if(i){this._parentDrag=i,i._addHandle(this);break}t=t.parentElement;}}}ngOnDestroy(){this._parentDrag?._removeHandle(this),this._stateChanges.complete();}static \u0275fac=function(i){return new(i||r)};static \u0275dir=XE({type:r,selectors:[["","cdkDragHandle",""]],hostAttrs:[1,"cdk-drag-handle"],inputs:{disabled:[2,"cdkDragHandleDisabled","disabled",Z0$1]},features:[Sw([{provide:re,useExisting:r}])]})}return r})(),oe=new A$2("CDK_DRAG_CONFIG"),ae=new A$2("CdkDropList"),We=(()=>{class r{element=C$2(_r$2);dropContainer=C$2(ae,{optional:true,skipSelf:true});_ngZone=C$2(oe$2);_viewContainerRef=C$2(ji$2);_dir=C$2(Le,{optional:true});_changeDetectorRef=C$2(z0$1);_selfHandle=C$2(re,{optional:true,self:true});_parentDrag=C$2(lt,{optional:true,skipSelf:true});_dragDropRegistry=C$2(B);_destroyed=new re$2;_handles=new On$1([]);_previewTemplate=null;_placeholderTemplate=null;_dragRef;data;lockAxis=null;rootElementSelector;boundaryElement;dragStartDelay;freeDragPosition;get disabled(){return this._disabled||!!(this.dropContainer&&this.dropContainer.disabled)}set disabled(t){this._disabled=t,this._dragRef.disabled=this._disabled;}_disabled=false;constrainPosition;previewClass;previewContainer;scale=1;started=new Le$2;released=new Le$2;ended=new Le$2;entered=new Le$2;exited=new Le$2;dropped=new Le$2;moved=new S$1(t=>{let i=this._dragRef.moved.pipe(Se$3(s=>({source:this,pointerPosition:s.pointerPosition,event:s.event,delta:s.delta,distance:s.distance}))).subscribe(t);return ()=>{i.unsubscribe();}});_injector=C$2(Ee$2);constructor(){let t=this.dropContainer,i=C$2(oe,{optional:true});this._dragRef=Qt$1(this._injector,this.element,{dragStartThreshold:i&&i.dragStartThreshold!=null?i.dragStartThreshold:5,pointerDirectionChangeThreshold:i&&i.pointerDirectionChangeThreshold!=null?i.pointerDirectionChangeThreshold:5,zIndex:i?.zIndex}),this._dragRef.data=this,this._dragDropRegistry.registerDirectiveNode(this.element.nativeElement,this),i&&this._assignDefaults(i),t&&(t.addItem(this),t._dropListRef.beforeStarted.pipe(im(this._destroyed)).subscribe(()=>{this._dragRef.scale=this.scale;})),this._syncInputs(this._dragRef),this._handleEvents(this._dragRef);}getPlaceholderElement(){return this._dragRef.getPlaceholderElement()}getRootElement(){return this._dragRef.getRootElement()}reset(){this._dragRef.reset();}resetToBoundary(){this._dragRef.resetToBoundary();}getFreeDragPosition(){return this._dragRef.getFreeDragPosition()}setFreeDragPosition(t){this._dragRef.setFreeDragPosition(t);}ngAfterViewInit(){Kf(()=>{this._updateRootElement(),this._setupHandlesListener(),this._dragRef.scale=this.scale,this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition);},{injector:this._injector});}ngOnChanges(t){let i=t.rootElementSelector,s=t.freeDragPosition;i&&!i.firstChange&&this._updateRootElement(),this._dragRef.scale=this.scale,s&&!s.firstChange&&this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition);}ngOnDestroy(){this.dropContainer&&this.dropContainer.removeItem(this),this._dragDropRegistry.removeDirectiveNode(this.element.nativeElement),this._ngZone.runOutsideAngular(()=>{this._handles.complete(),this._destroyed.next(),this._destroyed.complete(),this._dragRef.dispose();});}_addHandle(t){let i=this._handles.getValue();i.push(t),this._handles.next(i);}_removeHandle(t){let i=this._handles.getValue(),s=i.indexOf(t);s>-1&&(i.splice(s,1),this._handles.next(i));}_setPreviewTemplate(t){this._previewTemplate=t;}_resetPreviewTemplate(t){t===this._previewTemplate&&(this._previewTemplate=null);}_setPlaceholderTemplate(t){this._placeholderTemplate=t;}_resetPlaceholderTemplate(t){t===this._placeholderTemplate&&(this._placeholderTemplate=null);}_updateRootElement(){let t=this.element.nativeElement,i=t;this.rootElementSelector&&(i=t.closest!==void 0?t.closest(this.rootElementSelector):t.parentElement?.closest(this.rootElementSelector)),this._dragRef.withRootElement(i||t);}_getBoundaryElement(){let t=this.boundaryElement;return t?typeof t=="string"?this.element.nativeElement.closest(t):jt$1(t):null}_syncInputs(t){t.beforeStarted.subscribe(()=>{if(!t.isDragging()){let i=this._dir,s=this.dragStartDelay,n=this._placeholderTemplate?{template:this._placeholderTemplate.templateRef,context:this._placeholderTemplate.data,viewContainer:this._viewContainerRef}:null,o=this._previewTemplate?{template:this._previewTemplate.templateRef,context:this._previewTemplate.data,matchSize:this._previewTemplate.matchSize,viewContainer:this._viewContainerRef}:null;t.disabled=this.disabled,t.lockAxis=this.lockAxis,t.scale=this.scale,t.dragStartDelay=typeof s=="object"&&s?s:xt(s),t.constrainPosition=this.constrainPosition,t.previewClass=this.previewClass,t.withBoundaryElement(this._getBoundaryElement()).withPlaceholderTemplate(n).withPreviewTemplate(o).withPreviewContainer(this.previewContainer||"global"),i&&t.withDirection(i.value);}}),t.beforeStarted.pipe(yt$2(1)).subscribe(()=>{if(this._parentDrag){t.withParent(this._parentDrag._dragRef);return}let i=this.element.nativeElement.parentElement;for(;i;){let s=this._dragDropRegistry.getDragDirectiveForNode(i);if(s){t.withParent(s._dragRef);break}i=i.parentElement;}});}_handleEvents(t){t.started.subscribe(i=>{this.started.emit({source:this,event:i.event}),this._changeDetectorRef.markForCheck();}),t.released.subscribe(i=>{this.released.emit({source:this,event:i.event});}),t.ended.subscribe(i=>{this.ended.emit({source:this,distance:i.distance,dropPoint:i.dropPoint,event:i.event}),this._changeDetectorRef.markForCheck();}),t.entered.subscribe(i=>{this.entered.emit({container:i.container.data,item:this,currentIndex:i.currentIndex});}),t.exited.subscribe(i=>{this.exited.emit({container:i.container.data,item:this});}),t.dropped.subscribe(i=>{this.dropped.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,previousContainer:i.previousContainer.data,container:i.container.data,isPointerOverContainer:i.isPointerOverContainer,item:this,distance:i.distance,dropPoint:i.dropPoint,event:i.event});});}_assignDefaults(t){let{lockAxis:i,dragStartDelay:s,constrainPosition:n,previewClass:o,boundaryElement:a,draggingDisabled:l,rootElementSelector:h,previewContainer:c}=t;this.disabled=l??false,this.dragStartDelay=s||0,this.lockAxis=i||null,n&&(this.constrainPosition=n),o&&(this.previewClass=o),a&&(this.boundaryElement=a),h&&(this.rootElementSelector=h),c&&(this.previewContainer=c);}_setupHandlesListener(){this._handles.pipe(zl$1(t=>{let i=t.map(s=>s.element);this._selfHandle&&this.rootElementSelector&&i.push(this.element),this._dragRef.withHandles(i);}),Ml$1(t=>zg(...t.map(i=>i._stateChanges.pipe(Gl$1(i))))),im(this._destroyed)).subscribe(t=>{let i=this._dragRef,s=t.element.nativeElement;t.disabled?i.disableHandle(s):i.enableHandle(s);});}static \u0275fac=function(i){return new(i||r)};static \u0275dir=XE({type:r,selectors:[["","cdkDrag",""]],hostAttrs:[1,"cdk-drag"],hostVars:4,hostBindings:function(i,s){i&2&&Mh("cdk-drag-disabled",s.disabled)("cdk-drag-dragging",s._dragRef.isDragging());},inputs:{data:[0,"cdkDragData","data"],lockAxis:[0,"cdkDragLockAxis","lockAxis"],rootElementSelector:[0,"cdkDragRootElement","rootElementSelector"],boundaryElement:[0,"cdkDragBoundary","boundaryElement"],dragStartDelay:[0,"cdkDragStartDelay","dragStartDelay"],freeDragPosition:[0,"cdkDragFreeDragPosition","freeDragPosition"],disabled:[2,"cdkDragDisabled","disabled",Z0$1],constrainPosition:[0,"cdkDragConstrainPosition","constrainPosition"],previewClass:[0,"cdkDragPreviewClass","previewClass"],previewContainer:[0,"cdkDragPreviewContainer","previewContainer"],scale:[2,"cdkDragScale","scale",Y0$1]},outputs:{started:"cdkDragStarted",released:"cdkDragReleased",ended:"cdkDragEnded",entered:"cdkDragEntered",exited:"cdkDragExited",dropped:"cdkDragDropped",moved:"cdkDragMoved"},exportAs:["cdkDrag"],features:[Sw([{provide:lt,useExisting:r}]),ly]})}return r})(),Xt$1=new A$2("CdkDropListGroup");var Ue=(()=>{class r{element=C$2(_r$2);_changeDetectorRef=C$2(z0$1);_scrollDispatcher=C$2(U1);_dir=C$2(Le,{optional:true});_group=C$2(Xt$1,{optional:true,skipSelf:true});_latestSortedRefs;_destroyed=new re$2;_scrollableParentsResolved=false;static _dropLists=[];_dropListRef;connectedTo=[];data;orientation="vertical";id=C$2(K4).getId("cdk-drop-list-");lockAxis=null;get disabled(){return this._disabled||!!this._group&&this._group.disabled}set disabled(t){this._dropListRef.disabled=this._disabled=t;}_disabled=false;sortingDisabled=false;enterPredicate=()=>true;sortPredicate=()=>true;autoScrollDisabled=false;autoScrollStep;elementContainerSelector=null;hasAnchor=false;dropped=new Le$2;entered=new Le$2;exited=new Le$2;sorted=new Le$2;_unsortedItems=new Set;constructor(){let t=C$2(oe,{optional:true}),i=C$2(Ee$2);this._dropListRef=ie(i,this.element),this._dropListRef.data=this,t&&this._assignDefaults(t),this._dropListRef.enterPredicate=(s,n)=>this.enterPredicate(s.data,n.data),this._dropListRef.sortPredicate=(s,n,o)=>this.sortPredicate(s,n.data,o.data),this._setupInputSyncSubscription(this._dropListRef),this._handleEvents(this._dropListRef),r._dropLists.push(this),this._group&&this._group._items.add(this);}addItem(t){this._unsortedItems.add(t),t._dragRef._withDropContainer(this._dropListRef),this._dropListRef.isDragging()&&this._syncItemsWithRef(this.getSortedItems().map(i=>i._dragRef));}removeItem(t){if(this._unsortedItems.delete(t),this._latestSortedRefs){let i=this._latestSortedRefs.indexOf(t._dragRef);i>-1&&(this._latestSortedRefs.splice(i,1),this._syncItemsWithRef(this._latestSortedRefs));}}getSortedItems(){return Array.from(this._unsortedItems).sort((t,i)=>t._dragRef.getVisibleElement().compareDocumentPosition(i._dragRef.getVisibleElement())&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)}ngOnDestroy(){let t=r._dropLists.indexOf(this);t>-1&&r._dropLists.splice(t,1),this._group&&this._group._items.delete(this),this._latestSortedRefs=void 0,this._unsortedItems.clear(),this._dropListRef.dispose(),this._destroyed.next(),this._destroyed.complete();}_setupInputSyncSubscription(t){this._dir&&this._dir.change.pipe(Gl$1(this._dir.value),im(this._destroyed)).subscribe(i=>t.withDirection(i)),t.beforeStarted.subscribe(()=>{let i=u1(this.connectedTo).map(s=>{if(typeof s=="string"){let n=r._dropLists.find(o=>o.id===s);return n}return s});if(this._group&&this._group._items.forEach(s=>{i.indexOf(s)===-1&&i.push(s);}),!this._scrollableParentsResolved){let s=this._scrollDispatcher.getAncestorScrollContainers(this.element).map(n=>n.getElementRef().nativeElement);this._dropListRef.withScrollableParents(s),this._scrollableParentsResolved=true;}if(this.elementContainerSelector){let s=this.element.nativeElement.querySelector(this.elementContainerSelector);t.withElementContainer(s);}t.disabled=this.disabled,t.lockAxis=this.lockAxis,t.sortingDisabled=this.sortingDisabled,t.autoScrollDisabled=this.autoScrollDisabled,t.autoScrollStep=xt(this.autoScrollStep,2),t.hasAnchor=this.hasAnchor,t.connectedTo(i.filter(s=>s&&s!==this).map(s=>s._dropListRef)).withOrientation(this.orientation);});}_handleEvents(t){t.beforeStarted.subscribe(()=>{this._syncItemsWithRef(this.getSortedItems().map(i=>i._dragRef)),this._changeDetectorRef.markForCheck();}),t.entered.subscribe(i=>{this.entered.emit({container:this,item:i.item.data,currentIndex:i.currentIndex});}),t.exited.subscribe(i=>{this.exited.emit({container:this,item:i.item.data}),this._changeDetectorRef.markForCheck();}),t.sorted.subscribe(i=>{this.sorted.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,container:this,item:i.item.data});}),t.dropped.subscribe(i=>{this.dropped.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,previousContainer:i.previousContainer.data,container:i.container.data,item:i.item.data,isPointerOverContainer:i.isPointerOverContainer,distance:i.distance,dropPoint:i.dropPoint,event:i.event}),this._changeDetectorRef.markForCheck();}),zg(t.receivingStarted,t.receivingStopped).subscribe(()=>this._changeDetectorRef.markForCheck());}_assignDefaults(t){let{lockAxis:i,draggingDisabled:s,sortingDisabled:n,listAutoScrollDisabled:o,listOrientation:a}=t;this.disabled=s??false,this.sortingDisabled=n??false,this.autoScrollDisabled=o??false,this.orientation=a||"vertical",this.lockAxis=i||null;}_syncItemsWithRef(t){this._latestSortedRefs=t,this._dropListRef.withItems(t);}static \u0275fac=function(i){return new(i||r)};static \u0275dir=XE({type:r,selectors:[["","cdkDropList",""],["cdk-drop-list"]],hostAttrs:[1,"cdk-drop-list"],hostVars:7,hostBindings:function(i,s){i&2&&(ah("id",s.id),Mh("cdk-drop-list-disabled",s.disabled)("cdk-drop-list-dragging",s._dropListRef.isDragging())("cdk-drop-list-receiving",s._dropListRef.isReceiving()));},inputs:{connectedTo:[0,"cdkDropListConnectedTo","connectedTo"],data:[0,"cdkDropListData","data"],orientation:[0,"cdkDropListOrientation","orientation"],id:"id",lockAxis:[0,"cdkDropListLockAxis","lockAxis"],disabled:[2,"cdkDropListDisabled","disabled",Z0$1],sortingDisabled:[2,"cdkDropListSortingDisabled","sortingDisabled",Z0$1],enterPredicate:[0,"cdkDropListEnterPredicate","enterPredicate"],sortPredicate:[0,"cdkDropListSortPredicate","sortPredicate"],autoScrollDisabled:[2,"cdkDropListAutoScrollDisabled","autoScrollDisabled",Z0$1],autoScrollStep:[0,"cdkDropListAutoScrollStep","autoScrollStep"],elementContainerSelector:[0,"cdkDropListElementContainer","elementContainerSelector"],hasAnchor:[2,"cdkDropListHasAnchor","hasAnchor",Z0$1]},outputs:{dropped:"cdkDropListDropped",entered:"cdkDropListEntered",exited:"cdkDropListExited",sorted:"cdkDropListSorted"},exportAs:["cdkDropList"],features:[Sw([{provide:Xt$1,useValue:void 0},{provide:ae,useExisting:r}])]})}return r})();var Ze=(()=>{class r{static \u0275fac=function(i){return new(i||r)};static \u0275mod=YE({type:r});static \u0275inj=uu$1({providers:[be],imports:[tn$1]})}return r})();var $=(()=>{class r{constructor(){this.http=C$2(Zi$1),this.baseUrl=`${a.apiBaseUrl}/jobs`;}list(t){return this.http.get(this.baseUrl,{params:u$1(t)}).pipe(E())}get(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}`).pipe(E())}start(t){return this.http.post(this.baseUrl,t).pipe(E())}latestBySubject(t,s){return this.http.post(`${this.baseUrl}/latest-by-subject`,{workflowId:t,subjectIds:s}).pipe(E())}resume(t,s){return this.http.post(`${this.baseUrl}/${encodeURIComponent(t)}/resume`,{response:s}).pipe(E())}retry(t){return this.http.post(`${this.baseUrl}/${encodeURIComponent(t)}/retry`,{}).pipe(E())}retryStep(t){return this.http.post(`${this.baseUrl}/${encodeURIComponent(t)}/retry-step`,{}).pipe(E())}cancel(t){return this.http.post(`${this.baseUrl}/${encodeURIComponent(t)}/cancel`,{}).pipe(E())}deleteWorktrees(t){return this.http.post(`${this.baseUrl}/delete-worktrees`,{jobIds:t}).pipe(E())}static{this.\u0275fac=function(s){return new(s||r)};}static{this.\u0275prov=ie$2({token:r,factory:r.\u0275fac,providedIn:"root"});}}return r})();function Dt(t,i){if(t&1&&(_i$2(0,"p",3),vw(1),Kc$1()),t&2){let e=i.$implicit,o=VD(2).$index,n=VD(2);Mh("current",e===n.countArray[o]),gI(),nl$1(" ",e," ");}}function Ot(t,i){if(t&1&&ND(0,Dt,2,3,"p",2,SD),t&2){let e=VD(3);xD(e.countSingleArray);}}function At(t,i){if(t&1&&(_i$2(0,"span",1),bD(1,Ot,2,0),Kc$1()),t&2){let e=i.$index,o=VD(2);_h("transform","translateY("+-o.countArray[e]*100+"%)"),ch("nzNoAnimation",!!o.noAnimation?.nzNoAnimation?.()),gI(),_D(!o.nzDot&&o.countArray[e]!==void 0?1:-1);}}function Tt(t,i){if(t&1&&ND(0,At,2,4,"span",0,SD),t&2){let e=VD();xD(e.maxNumberArray);}}function Nt(t,i){if(t&1&&vw(0),t&2){let e=VD();nl$1(" ",e.nzOverflowCount,"+ ");}}var mt=["*"];function kt(t,i){if(t&1&&(el$1(0),vw(1),tl$1()),t&2){let e=VD(2);gI(),Ph(e.nzText);}}function Pt(t,i){if(t&1&&(lh(0,"span",1),_i$2(1,"span",2),nh(2,kt,2,1,"ng-container",0),Kc$1()),t&2){let e=VD();sw(e.mergedStyle),cw((e.nzStatus||e.presetColor)&&"ant-badge-status-"+(e.nzStatus||e.presetColor)),gI(2),ch("nzStringTemplateOutlet",e.nzText);}}function Et(t,i){if(t&1){let e=LD();_i$2(0,"nz-badge-sup",3),oi(function(){Pu$1(e);let n=VD(2);return Lu$1(n.supAnimationLeave())}),ri$1(function(){Pu$1(e);let n=VD(2);return Lu$1(n.supAnimationEnter())}),Kc$1();}if(t&2){let e=VD(2);ch("isPresetColor",e.nzStatus||e.presetColor)("nzColor",e.nzStatus||e.presetColor||e.nzColor)("nzOffset",e.nzOffset)("nzSize",e.nzSize)("nzTitle",e.nzTitle)("nzStyle",e.mergedStyle)("nzDot",e.nzDot)("nzCount",e.nzCount)("nzOverflowCount",e.nzOverflowCount);}}function Lt(t,i){if(t&1&&(el$1(0),bD(1,Et,1,9,"nz-badge-sup",3),tl$1()),t&2){let e=VD();gI(),_D(e.showSup?1:-1);}}function It(t,i){if(t&1&&(el$1(0),_i$2(1,"span",3),vw(2),Kc$1(),tl$1()),t&2){let e=VD();gI(2),Ph(e.nzText);}}var Bt=(()=>{class t{noAnimation=C$2(t4,{host:true,optional:true});nzOffset;nzTitle;nzStyle=null;nzDot=false;nzOverflowCount=99;nzCount;nzSize="default";isPresetColor=false;nzColor;maxNumberArray=[];countArray=[];count=0;countSingleArray=[0,1,2,3,4,5,6,7,8,9];generateMaxNumberArray(){this.maxNumberArray=this.nzOverflowCount.toString().split("").map((e,o)=>`${e}-${o}`);}ngOnInit(){this.generateMaxNumberArray();}ngOnChanges(e){let{nzOverflowCount:o,nzCount:n}=e;n&&typeof n.currentValue=="number"&&(this.count=Math.max(0,n.currentValue),this.countArray=this.count.toString().split("").map(a=>+a)),o&&this.generateMaxNumberArray();}static \u0275fac=function(o){return new(o||t)};static \u0275cmp=QE({type:t,selectors:[["nz-badge-sup"]],hostAttrs:[1,"ant-scroll-number"],hostVars:17,hostBindings:function(o,n){o&2&&(ah("title",n.nzTitle===null?"":n.nzTitle||n.nzCount),sw(n.nzStyle),cw(n.isPresetColor?"ant-badge-status-"+n.nzColor:""),_h("right",n.nzOffset&&n.nzOffset[0]?-n.nzOffset[0]:null,"px")("margin-top",n.nzOffset&&n.nzOffset[1]?n.nzOffset[1]:null,"px"),Mh("ant-badge-count",!n.nzDot)("ant-badge-count-sm",n.nzSize==="small")("ant-badge-dot",n.nzDot)("ant-badge-multiple-words",n.countArray.length>=2));},inputs:{nzOffset:"nzOffset",nzTitle:"nzTitle",nzStyle:"nzStyle",nzDot:"nzDot",nzOverflowCount:[2,"nzOverflowCount","nzOverflowCount",Y0$1],nzCount:"nzCount",nzSize:"nzSize",isPresetColor:[2,"isPresetColor","isPresetColor",Z0$1],nzColor:"nzColor"},exportAs:["nzBadgeSup"],features:[ly],decls:2,vars:1,consts:[[1,"ant-scroll-number-only",3,"nzNoAnimation","transform"],[1,"ant-scroll-number-only",3,"nzNoAnimation"],[1,"ant-scroll-number-only-unit",3,"current"],[1,"ant-scroll-number-only-unit"]],template:function(o,n){o&1&&bD(0,Tt,2,0)(1,Nt,1,1),o&2&&_D(n.count<=n.nzOverflowCount?0:1);},dependencies:[t4],encapsulation:2})}return t})(),ut=["pink","red","yellow","orange","cyan","green","blue","purple","geekblue","magenta","volcano","gold","lime"],Ft="badge",fe=(()=>{let t,i=[],e=[],o,n=[],a=[];return class he{static{let C=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;t=[ut$1()],o=[ut$1()],pT(null,null,t,{kind:"field",name:"nzOverflowCount",static:false,private:false,access:{has:c=>"nzOverflowCount"in c,get:c=>c.nzOverflowCount,set:(c,m)=>{c.nzOverflowCount=m;}},metadata:C},i,e),pT(null,null,o,{kind:"field",name:"nzColor",static:false,private:false,access:{has:c=>"nzColor"in c,get:c=>c.nzColor,set:(c,m)=>{c.nzColor=m;}},metadata:C},n,a),C&&Object.defineProperty(this,Symbol.metadata,{enumerable:true,configurable:true,writable:true,value:C});}dir=C$2(Le).valueSignal;_nzModuleName=Ft;showSup=false;supAnimationEnter=s0(()=>"ant-badge-zoom-enter");supAnimationLeave=s0(()=>"ant-badge-zoom-leave");presetColor=null;nzShowZero=false;nzShowDot=true;nzStandalone=false;nzDot=false;nzOverflowCount=hT(this,i,99);nzColor=(hT(this,e),hT(this,n,void 0));nzStyle=(hT(this,a),null);nzText=null;nzTitle;nzStatus;nzCount;nzOffset;nzSize="default";get mergedStyle(){return r({backgroundColor:!this.presetColor&&this.nzColor},this.nzStyle??{})}ngOnChanges(C){let{nzColor:c,nzShowDot:m,nzDot:St,nzCount:xt,nzShowZero:Mt}=C;c&&(this.presetColor=this.nzColor&&ut.indexOf(this.nzColor)!==-1?this.nzColor:null),(m||St||xt||Mt)&&(this.showSup=this.nzShowDot&&this.nzDot||typeof this.nzCount=="number"&&(this.nzCount>0||this.nzShowZero));}static \u0275fac=function(c){return new(c||he)};static \u0275cmp=QE({type:he,selectors:[["nz-badge"]],hostAttrs:[1,"ant-badge"],hostVars:6,hostBindings:function(c,m){c&2&&Mh("ant-badge-status",m.nzStatus)("ant-badge-not-a-wrapper",!!(m.nzStandalone||(m.nzStatus||m.nzColor)&&!m.showSup&&!m.nzCount))("ant-badge-rtl",m.dir()==="rtl");},inputs:{nzShowZero:[2,"nzShowZero","nzShowZero",Z0$1],nzShowDot:[2,"nzShowDot","nzShowDot",Z0$1],nzStandalone:[2,"nzStandalone","nzStandalone",Z0$1],nzDot:[2,"nzDot","nzDot",Z0$1],nzOverflowCount:"nzOverflowCount",nzColor:"nzColor",nzStyle:"nzStyle",nzText:"nzText",nzTitle:"nzTitle",nzStatus:"nzStatus",nzCount:"nzCount",nzOffset:"nzOffset",nzSize:"nzSize"},exportAs:["nzBadge"],features:[ly],ngContentSelectors:mt,decls:3,vars:2,consts:[[4,"nzStringTemplateOutlet"],[1,"ant-badge-status-dot"],[1,"ant-badge-status-text"],[3,"isPresetColor","nzColor","nzOffset","nzSize","nzTitle","nzStyle","nzDot","nzCount","nzOverflowCount"]],template:function(c,m){c&1&&(BD(),bD(0,Pt,3,5),$D(1),nh(2,Lt,2,1,"ng-container",0)),c&2&&(_D((m.nzStatus||m.nzColor)&&!m.showSup&&!m.nzCount?0:-1),gI(2),ch("nzStringTemplateOutlet",m.nzCount));},dependencies:[Bt,Tt$1,Ie],encapsulation:2})}})(),Rt=(()=>{class t{nzColor;nzPlacement="end";nzText=null;presetColor=null;ngOnChanges(e){let{nzColor:o}=e;o&&(this.presetColor=this.nzColor&&ut.indexOf(this.nzColor)!==-1?this.nzColor:null);}static \u0275fac=function(o){return new(o||t)};static \u0275cmp=QE({type:t,selectors:[["nz-ribbon"]],hostAttrs:[1,"ant-ribbon-wrapper"],inputs:{nzColor:"nzColor",nzPlacement:"nzPlacement",nzText:"nzText"},exportAs:["nzRibbon"],features:[ly],ngContentSelectors:mt,decls:4,vars:11,consts:[[1,"ant-ribbon"],[4,"nzStringTemplateOutlet"],[1,"ant-ribbon-corner"],[1,"ant-ribbon-text"]],template:function(o,n){o&1&&(BD(),$D(0),_i$2(1,"div",0),nh(2,It,3,1,"ng-container",1),lh(3,"div",2),Kc$1()),o&2&&(gI(),cw(n.presetColor&&"ant-ribbon-color-"+n.presetColor),_h("background-color",!n.presetColor&&n.nzColor),Mh("ant-ribbon-placement-end",n.nzPlacement==="end")("ant-ribbon-placement-start",n.nzPlacement==="start"),gI(),ch("nzStringTemplateOutlet",n.nzText),gI(),_h("color",!n.presetColor&&n.nzColor));},dependencies:[Tt$1,Ie],encapsulation:2})}return t})(),gt=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275mod=YE({type:t});static \u0275inj=uu$1({imports:[fe,Rt]})}return t})();var Vt=["ticket","pull_request","documentation"],Jt={ticket:"shell.group.tickets",pull_request:"shell.group.pullRequests",documentation:"shell.group.documentation"};function $t(t,i){return Jt[t]}function ht(t,i){let e=new Map;for(let o of t){let n=e.get(o.subjectType)??[];n.push(o),e.set(o.subjectType,n);}return Vt.flatMap(o=>{let n=e.get(o);return n?.length?[{subjectType:o,labelKey:$t(o),views:[...n].sort((a,h)=>a.order-h.order)}]:[]})}var Zt=t=>["/views",t],qt=(t,i)=>i.subjectType,ft=(t,i)=>i.id;function Ht(t,i){t&1&&(_i$2(0,"section",3)(1,"h2"),vw(2),Rw(3,"transloco"),Kc$1(),_i$2(4,"p"),vw(5),Rw(6,"transloco"),Kc$1(),_i$2(7,"a",4),vw(8),Rw(9,"transloco"),Kc$1()()),t&2&&(gI(2),Ph(Ow(3,3,"shell.empty.title")),gI(3),Ph(Ow(6,5,"shell.empty.body")),gI(3),nl$1(" ",Ow(9,7,"shell.empty.settingsLink")," "));}function Yt(t,i){if(t&1&&(_i$2(0,"p",5),vw(1),Kc$1()),t&2){let e=VD(2);gI(),Ph(e.reorderError());}}function Gt(t,i){if(t&1&&(_i$2(0,"li",10)(1,"a",11),vw(2),Kc$1()()),t&2){let e=i.$implicit;ah("data-testid","sidebar-view-"+e.id),gI(),ch("routerLink",xw(4,Zt,e.id)),ah("data-testid","sidebar-link-"+e.id),gI(),nl$1(" ",e.name," ");}}function Kt(t,i){if(t&1){let e=LD();_i$2(0,"section",6)(1,"h2",8),vw(2),Rw(3,"transloco"),Kc$1(),_i$2(4,"ul",9),gh("cdkDropListDropped",function(n){let a=Pu$1(e).$implicit,h=VD(2);return Lu$1(h.drop(a,n))}),ND(5,Gt,3,6,"li",10,ft),Kc$1()();}if(t&2){let e=i.$implicit,o=VD(2);ah("data-testid","sidebar-group-"+e.subjectType),gI(2),Ph(Ow(3,5,e.labelKey)),gI(2),ch("cdkDropListData",e.views)("cdkDropListDisabled",o.reordering()),ah("data-testid","sidebar-drop-"+e.subjectType),gI(),xD(e.views);}}function Xt(t,i){if(t&1&&(_i$2(0,"li",10)(1,"a",13),vw(2),Kc$1()()),t&2){let e=i.$implicit;ah("data-testid","sidebar-shortcut-"+e.id),gI(),ah("data-testid","sidebar-shortcut-link-"+e.id),gI(),nl$1(" ",e.name," ");}}function Qt(t,i){if(t&1){let e=LD();_i$2(0,"section",7)(1,"h2",8),vw(2),Rw(3,"transloco"),Kc$1(),_i$2(4,"ul",12),gh("cdkDropListDropped",function(n){Pu$1(e);let a=VD(2);return Lu$1(a.dropShortcut(n))}),ND(5,Xt,3,3,"li",10,ft),Kc$1()();}if(t&2){let e=VD(2);gI(2),Ph(Ow(3,3,"shell.shortcuts")),gI(2),ch("cdkDropListData",e.shortcuts())("cdkDropListDisabled",e.reordering()),gI(),xD(e.shortcuts());}}function en(t,i){if(t&1&&(bD(0,Yt,2,1,"p",5),ND(1,Kt,7,7,"section",6,qt),bD(3,Qt,7,5,"section",7)),t&2){let e=VD();_D(e.reorderError()?0:-1),gI(),xD(e.groups()),gI(2),_D(e.shortcuts().length>0?3:-1);}}var Ct=(()=>{class t{constructor(){this.viewsApi=C$2(U),this.shortcutsApi=C$2(u),this.destroyRef=C$2(at$1),this.groups=$0$1.required(),this.shortcuts=$0$1([]),this.empty=$0$1(false),this.viewsChanged=B0$1(),this.shortcutsChanged=B0$1(),this.reorderError=qo$2(null),this.reordering=qo$2(false);}drop(e,o){if(o.previousIndex===o.currentIndex)return;let n=[...e.views];te(n,o.previousIndex,o.currentIndex),this.reorderError.set(null),this.reordering.set(true),this.viewsApi.reorder(n.map(a=>a.id)).pipe(ue$1(this.destroyRef)).subscribe({next:()=>{this.reordering.set(false),this.viewsChanged.emit();},error:a=>{this.reordering.set(false),this.reorderError.set(a instanceof Error?a.message:"Failed to reorder views");}});}dropShortcut(e){if(e.previousIndex===e.currentIndex)return;let o=[...this.shortcuts()];te(o,e.previousIndex,e.currentIndex),this.reorderError.set(null),this.reordering.set(true),this.shortcutsApi.reorder(o.map(n=>n.id)).pipe(ue$1(this.destroyRef)).subscribe({next:()=>{this.reordering.set(false),this.shortcutsChanged.emit();},error:n=>{this.reordering.set(false),this.reorderError.set(n instanceof Error?n.message:"Failed to reorder shortcuts");}});}static{this.\u0275fac=function(o){return new(o||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-sidebar"]],inputs:{groups:[1,"groups"],shortcuts:[1,"shortcuts"],empty:[1,"empty"]},outputs:{viewsChanged:"viewsChanged",shortcutsChanged:"shortcutsChanged"},decls:6,vars:1,consts:[["data-testid","app-sidebar",1,"sidebar"],["data-testid","app-brand",1,"brand"],[1,"sidebar-body"],["data-testid","sidebar-empty",1,"empty"],["nz-button","","nzType","primary","routerLink","/settings","data-testid","sidebar-empty-settings"],["data-testid","sidebar-reorder-error",1,"error"],[1,"group"],["data-testid","sidebar-group-shortcuts",1,"group"],[1,"group-title"],["cdkDropList","",1,"view-list",3,"cdkDropListDropped","cdkDropListData","cdkDropListDisabled"],["cdkDrag","",1,"view-item"],["routerLinkActive","active",3,"routerLink"],["cdkDropList","","data-testid","sidebar-drop-shortcuts",1,"view-list",3,"cdkDropListDropped","cdkDropListData","cdkDropListDisabled"],["routerLink","/shortcuts","routerLinkActive","active"]],template:function(o,n){o&1&&(_i$2(0,"aside",0)(1,"div",1),vw(2,"knoflows"),Kc$1(),_i$2(3,"div",2),bD(4,Ht,10,9,"section",3)(5,en,4,2),Kc$1()()),o&2&&(gI(4),_D(n.empty()?4:5));},dependencies:[Mi$1,Ze,Ue,We,Ln,Mu,dd,zc,t7,Kt$3],styles:[".sidebar[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:15rem;height:100vh;flex-shrink:0;border-right:1px solid #d6d3d1;background:#ffffffb8;overflow:hidden}.brand[_ngcontent-%COMP%]{flex-shrink:0;padding:.85rem 1rem;font-size:1.1rem;font-weight:700;letter-spacing:.02em;border-bottom:1px solid #d6d3d1}.sidebar-body[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;padding:1rem .75rem 1.5rem}.group[_ngcontent-%COMP%] + .group[_ngcontent-%COMP%]{margin-top:1.25rem}.group-title[_ngcontent-%COMP%]{margin:0 0 .5rem;padding:0 .35rem;font-size:.75rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:#78716c}.view-list[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0}.view-item[_ngcontent-%COMP%]{margin:.15rem 0;border-radius:.35rem;cursor:grab}.view-item.cdk-drag-disabled[_ngcontent-%COMP%]{cursor:default}.view-item[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{display:block;padding:.45rem .5rem;color:#44403c;text-decoration:none;border-radius:.35rem}.view-item[_ngcontent-%COMP%] a.active[_ngcontent-%COMP%], .view-item[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{background:#f5f5f4;color:#0c0a09}.view-item[_ngcontent-%COMP%] a.active[_ngcontent-%COMP%]{font-weight:600}.empty[_ngcontent-%COMP%]{padding:.5rem .35rem}.empty[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem}.empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 1rem;color:#57534e;font-size:.92rem;line-height:1.45}.error[_ngcontent-%COMP%]{margin:0 0 .75rem;padding:0 .35rem;color:#9f1239;font-size:.85rem}.cdk-drag-preview[_ngcontent-%COMP%]{box-shadow:0 4px 12px #0000001f;background:#fff;border-radius:.35rem}.cdk-drag-placeholder[_ngcontent-%COMP%]{opacity:0}"]});}}return t})();var tn=()=>({status:"waiting_for_human"}),nn=3e4,on=500,zt=(()=>{class t{constructor(){this.viewsApi=C$2(U),this.shortcutsApi=C$2(u),this.settingsApi=C$2($$1),this.jobsApi=C$2($),this.destroyRef=C$2(at$1),this.language=C$2(O),this.views=qo$2([]),this.shortcuts=qo$2([]),this.settings=qo$2(null),this.waitingJobsCount=qo$2(0),this.groups=Hw(()=>ht(this.views(),this.settings())),this.sidebarEmpty=Hw(()=>this.views().length===0&&this.shortcuts().length===0),this.loadViews(),this.loadShortcuts(),this.loadSettings(),this.pollWaitingJobs();}onLanguageChange(e){this.language.setLanguage(e);}reloadViews(){this.loadViews();}reloadShortcuts(){this.loadShortcuts();}loadViews(){this.viewsApi.list().pipe(ue$1(this.destroyRef)).subscribe({next:e=>this.views.set(e),error:()=>this.views.set([])});}loadShortcuts(){this.shortcutsApi.list().pipe(ue$1(this.destroyRef)).subscribe({next:e=>this.shortcuts.set(e),error:()=>this.shortcuts.set([])});}loadSettings(){this.settingsApi.getSettings().pipe(ue$1(this.destroyRef)).subscribe({next:e=>this.settings.set(e),error:()=>this.settings.set(null)});}pollWaitingJobs(){Gg(nn).pipe(Gl$1(0),Ml$1(()=>this.jobsApi.list({status:"waiting_for_human",topLevelOnly:false,limit:on,offset:0})),ue$1(this.destroyRef)).subscribe({next:e=>this.waitingJobsCount.set(e.length),error:()=>this.waitingJobsCount.set(0)});}static{this.\u0275fac=function(o){return new(o||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-shell"]],decls:22,vars:17,consts:[["data-testid","app-shell",1,"app-shell"],[3,"viewsChanged","shortcutsChanged","groups","shortcuts","empty"],[1,"main"],["data-testid","app-top-bar",1,"top-bar"],[1,"top-actions"],["routerLink","/jobs","data-testid","jobs-waiting-badge",1,"jobs-badge",3,"queryParams"],[3,"nzCount","nzOverflowCount"],["nz-button","","nzType","link","routerLink","/manage","routerLinkActive","active","data-testid","manage-link"],[1,"lang"],["data-testid","language-select",3,"ngModelChange","ngModel"],["nzValue","en","nzLabel","English"],["nzValue","es","nzLabel","Espa\xF1ol"],[1,"content"]],template:function(o,n){o&1&&(_i$2(0,"div",0)(1,"app-sidebar",1),gh("viewsChanged",function(){return n.reloadViews()})("shortcutsChanged",function(){return n.reloadShortcuts()}),Kc$1(),_i$2(2,"div",2)(3,"header",3)(4,"div",4)(5,"a",5)(6,"nz-badge",6)(7,"span"),vw(8),Rw(9,"transloco"),Kc$1()()(),_i$2(10,"a",7),vw(11),Rw(12,"transloco"),Kc$1(),_i$2(13,"label",8)(14,"span"),vw(15),Rw(16,"transloco"),Kc$1(),_i$2(17,"nz-select",9),gh("ngModelChange",function(h){return n.onLanguageChange(h)}),lh(18,"nz-option",10)(19,"nz-option",11),Kc$1(),oE(),Kc$1()()(),_i$2(20,"div",12),lh(21,"router-outlet"),Kc$1()()()),o&2&&(gI(),ch("groups",n.groups())("shortcuts",n.shortcuts())("empty",n.sidebarEmpty()),gI(4),ch("queryParams",Nw(16,tn)),gI(),ch("nzCount",n.waitingJobsCount())("nzOverflowCount",99),gI(2),Ph(Ow(9,10,"shell.jobs")),gI(3),nl$1(" ",Ow(12,12,"shell.manage")," "),gI(4),Ph(Ow(16,14,"nav.language")),gI(2),ch("ngModel",n.language.currentLang()),sE());},dependencies:[Mi$1,n8,J6,k3,Lr$1,Ln,Mu,gt,fe,dd,zc,t7,Xb,V5,D5,Ct,Kt$3],styles:[".app-shell[_ngcontent-%COMP%]{display:flex;min-height:100vh;background:linear-gradient(180deg,#fafaf9,#f5f5f4);color:#1c1917}.main[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;flex-direction:column}.top-bar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:1rem;padding:.75rem 1.25rem;border-bottom:1px solid #d6d3d1;background:#ffffffd9}.top-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.65rem}.jobs-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;padding:.35rem .5rem;color:#44403c;text-decoration:none;border-radius:.35rem}.jobs-badge[_ngcontent-%COMP%]:hover{background:#f5f5f4}.lang[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;font-size:.9rem;color:#57534e}.content[_ngcontent-%COMP%]{flex:1;min-height:0}[_nghost-%COMP%] .top-actions a.active{font-weight:600}"]});}}return t})();var _t=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-root"]],decls:1,vars:0,template:function(o,n){o&1&&lh(0,"app-shell");},dependencies:[zt],encapsulation:2});}}return t})();var rn="@",an=(()=>{class t{doc;delegate;zone;animationType;moduleImpl;_rendererFactoryPromise=null;scheduler=null;injector=C$2(Ee$2);loadingSchedulerFn=C$2(sn,{optional:true});_engine;constructor(e,o,n,a,h){this.doc=e,this.delegate=o,this.zone=n,this.animationType=a,this.moduleImpl=h;}ngOnDestroy(){this._engine?.flush();}loadImpl(){let e=()=>this.moduleImpl??import('./chunk-mzyds3TS.js').then(n=>n),o;return this.loadingSchedulerFn?o=this.loadingSchedulerFn(e):o=e(),o.catch(n=>{throw new _$1(5300,false)}).then(({\u0275createEngine:n,\u0275AnimationRendererFactory:a})=>{this._engine=n(this.animationType,this.doc);let h=new a(this.delegate,this._engine,this.zone);return this.delegate=h,h})}createRenderer(e,o){let n=this.delegate.createRenderer(e,o);if(n.\u0275type===0)return n;typeof n.throwOnSyntheticProps=="boolean"&&(n.throwOnSyntheticProps=false);let a=new Ce(n);return o?.data?.animation&&!this._rendererFactoryPromise&&(this._rendererFactoryPromise=this.loadImpl()),this._rendererFactoryPromise?.then(h=>{let C=h.createRenderer(e,o);a.use(C),this.scheduler??=this.injector.get(He$3,null,{optional:true}),this.scheduler?.notify(10);}).catch(h=>{a.use(n);}),a}begin(){this.delegate.begin?.();}end(){this.delegate.end?.();}whenRenderingDone(){return this.delegate.whenRenderingDone?.()??Promise.resolve()}componentReplaced(e){this._engine?.flush(),this.delegate.componentReplaced?.(e);}static \u0275fac=function(o){fE();};static \u0275prov=ie$2({token:t,factory:t.\u0275fac})}return t})(),Ce=class{delegate;replay=[];\u0275type=1;constructor(i){this.delegate=i;}use(i){if(this.delegate=i,this.replay!==null){for(let e of this.replay)e(i);this.replay=null;}}get data(){return this.delegate.data}destroy(){this.replay=null,this.delegate.destroy();}createElement(i,e){return this.delegate.createElement(i,e)}createComment(i){return this.delegate.createComment(i)}createText(i){return this.delegate.createText(i)}get destroyNode(){return this.delegate.destroyNode}appendChild(i,e){this.delegate.appendChild(i,e);}insertBefore(i,e,o,n){this.delegate.insertBefore(i,e,o,n);}removeChild(i,e,o,n){this.delegate.removeChild(i,e,o,n);}selectRootElement(i,e){return this.delegate.selectRootElement(i,e)}parentNode(i){return this.delegate.parentNode(i)}nextSibling(i){return this.delegate.nextSibling(i)}setAttribute(i,e,o,n){this.delegate.setAttribute(i,e,o,n);}removeAttribute(i,e,o){this.delegate.removeAttribute(i,e,o);}addClass(i,e){this.delegate.addClass(i,e);}removeClass(i,e){this.delegate.removeClass(i,e);}setStyle(i,e,o,n){this.delegate.setStyle(i,e,o,n);}removeStyle(i,e,o){this.delegate.removeStyle(i,e,o);}setProperty(i,e,o){this.shouldReplay(e)&&this.replay.push(n=>n.setProperty(i,e,o)),this.delegate.setProperty(i,e,o);}setValue(i,e){this.delegate.setValue(i,e);}listen(i,e,o,n){return this.shouldReplay(e)&&this.replay.push(a=>a.listen(i,e,o,n)),this.delegate.listen(i,e,o,n)}shouldReplay(i){return this.replay!==null&&i.startsWith(rn)}},sn=new A$2("");function bt(t="animations"){return ce("NgAsyncAnimations"),Eu$1([{provide:Dr$2,useFactory:()=>new an(C$2(Uo$2),C$2(or$1),C$2(oe$2),t)},{provide:Gm,useValue:t==="noop"?"NoopAnimations":"BrowserAnimations"}])}var vt=(()=>{class t{constructor(){this.http=C$2(Zi$1);}getTranslation(e){return this.http.get(`./assets/i18n/${e}.json`)}static{this.\u0275fac=function(o){return new(o||t)};}static{this.\u0275prov=ie$2({token:t,factory:t.\u0275fac,providedIn:"root"});}}return t})();var yt=[{path:"",pathMatch:"full",redirectTo:"jobs"},{path:"jobs",pathMatch:"full",loadComponent:()=>import('./chunk-tYnBYi0l.js').then(t=>t.JobListComponent)},{path:"jobs/new",loadComponent:()=>import('./chunk-hZzW00VR.js').then(t=>t.JobRunnerComponent)},{path:"jobs/:id",loadComponent:()=>import('./chunk-BFkZ796p.js').then(t=>t.JobDetailComponent)},{path:"batches/:id",loadComponent:()=>import('./chunk-Cd8F2jeN.js').then(t=>t.BatchDetailComponent)},{path:"manage",loadComponent:()=>import('./chunk-DQnMulwi.js').then(t=>t.ManageShellComponent),children:[{path:"",pathMatch:"full",redirectTo:"workflows"},{path:"workflows",loadComponent:()=>import('./chunk-CgqRVtSF.js').then(t=>t.WorkflowsManageComponent)},{path:"views",loadComponent:()=>import('./chunk-B2hO-qT3.js').then(t=>t.ViewsAndShortcutsManageComponent)},{path:"providers",loadComponent:()=>import('./chunk-DjibVmY7.js').then(t=>t.ProvidersManageComponent)},{path:"context-files",loadComponent:()=>import('./chunk-DoXxOh8j.js').then(t=>t.ContextFilesManageComponent)},{path:"local-repositories",loadComponent:()=>import('./chunk-6BQlxALO.js').then(t=>t.LocalRepositoriesManageComponent)},{path:"worktrees",loadComponent:()=>import('./chunk-B8MrNxxk.js').then(t=>t.WorktreesManageComponent)},{path:"preferences",loadComponent:()=>import('./chunk-BVw7xkK9.js').then(t=>t.PreferencesManageComponent)}]},{path:"workflows",pathMatch:"full",redirectTo:"/manage/workflows"},{path:"workflows/new",loadComponent:()=>import('./chunk-D6YfO72h.js').then(t=>t.WorkflowEditorComponent)},{path:"workflows/:id/edit",loadComponent:()=>import('./chunk-D6YfO72h.js').then(t=>t.WorkflowEditorComponent)},{path:"views",pathMatch:"full",redirectTo:"/manage/views"},{path:"views/new",loadComponent:()=>import('./chunk-wbdetocK.js').then(t=>t.ViewEditorComponent)},{path:"views/:id/edit",loadComponent:()=>import('./chunk-wbdetocK.js').then(t=>t.ViewEditorComponent)},{path:"views/:id",loadComponent:()=>import('./chunk-XLpSkczx.js').then(t=>t.ViewDetailComponent)},{path:"shortcuts",loadComponent:()=>import('./chunk-DblClAqu.js').then(t=>t.ShortcutListComponent)},{path:"shortcuts/new",loadComponent:()=>import('./chunk-jct1_zOr.js').then(t=>t.ShortcutEditorComponent)},{path:"shortcuts/:id/edit",loadComponent:()=>import('./chunk-jct1_zOr.js').then(t=>t.ShortcutEditorComponent)},{path:"settings",pathMatch:"full",redirectTo:"/manage/providers"}];var wt={providers:[Fu$1(yt),Ys$1(),bt(),qy(Il),Ey(),Ht$2({config:{availableLangs:["en","es"],defaultLang:"en",fallbackLang:"en",reRenderOnLangChange:true,prodMode:true},loader:vt})]};Ss$1(_t,wt).catch(t=>console.error(t));export{$,xD as A,_D as B,C$2 as C,D5 as D,VD as E,LD as F,Pu$1 as G,Hw as H,Lu$1 as I,J6 as J,Kt$3 as K,Ln as L,Mi$1 as M,ND as N,Ow as O,Ph as P,QE as Q,Rw as R,SD as S,Ie$2 as T,Lh as U,Ve as V,rd as W,Xb as X,Bw as Y,y7 as Z,_$1 as _,ae$1 as a,za as a$,$0$1 as a0,B0$1 as a1,Pw as a2,xw as a3,Mh as a4,ah as a5,Nw as a6,MD as a7,a as a8,Ng as a9,pt as aA,Se as aB,Tt$1 as aC,Ie as aD,ly as aE,Z0$1 as aF,Sw as aG,h1 as aH,wo$2 as aI,Ih as aJ,qD as aK,WD as aL,ut$1 as aM,nh as aN,el$1 as aO,tl$1 as aP,Jc$1 as aQ,Xc$1 as aR,O as aS,de$1 as aT,$6 as aU,Y0$1 as aV,N1 as aW,q0$1 as aX,Ee$2 as aY,ga as aZ,j3 as a_,Xi$2 as aa,Dg as ab,Lr$1 as ac,Mu as ad,Zi$1 as ae,E as af,_h as ag,U as ah,u as ai,$$1 as aj,Ml$1 as ak,Se$3 as al,S4 as am,YE as an,uu$1 as ao,pT as ap,kt$1 as aq,_r$2 as ar,oe$2 as as,z0$1 as at,a3 as au,hT as av,Le as aw,m1 as ax,St as ay,c8 as az,at$1 as b,Uo$2 as b$,Uw as b0,W0$1 as b1,D8 as b2,p9 as b3,a9 as b4,Kf as b5,g9 as b6,va as b7,es$1 as b8,BD as b9,Rt$1 as bA,Bu as bB,pn as bC,Ga as bD,Na as bE,t2 as bF,K1 as bG,A1 as bH,G1 as bI,A$2 as bJ,Le$2 as bK,Sy as bL,Z4 as bM,Da as bN,Ky as bO,eh as bP,on$1 as bQ,W as bR,We as bS,Ge as bT,on$3 as bU,yt$2 as bV,im as bW,Pa as bX,v$1 as bY,wr as bZ,G4 as b_,Lw as ba,B1 as bb,rD as bc,R4 as bd,cw as be,Dh as bf,GD as bg,Eh as bh,U0$1 as bi,zD as bj,Vh as bk,jh as bl,$D as bm,ww as bn,P1 as bo,Vt$2 as bp,sw as bq,vh as br,l9 as bs,XE as bt,uh as bu,rh as bv,Er$2 as bw,re$2 as bx,Vg as by,Gl$1 as bz,t7 as c,nn$1 as c$,i0 as c0,XI as c1,Gm as c2,s9 as c3,x1 as c4,eD as c5,h9 as c6,d9 as c7,Aw as c8,vv as c9,Kg as cA,Yg as cB,kg as cC,kr$2 as cD,xy as cE,r2 as cF,a2 as cG,_e$1 as cH,Fu as cI,vn as cJ,He as cK,i9 as cL,w0 as cM,wn as cN,Ln$1 as cO,On$1 as cP,Fg as cQ,m9 as cR,mt$3 as cS,zg as cT,Ie$3 as cU,Ri as cV,xn as cW,is$1 as cX,c9 as cY,J as cZ,rn$1 as c_,re$1 as ca,N7 as cb,B7 as cc,fr as cd,pr as ce,u$1 as cf,t4 as cg,ec$1 as ch,fh as ci,k8 as cj,em as ck,ql$1 as cl,fn as cm,f1 as cn,gn as co,Xa as cp,Ts as cq,Vs as cr,Gy as cs,s0 as ct,oi as cu,ri$1 as cv,Bh as cw,ji$2 as cx,Wm as cy,jl$1 as cz,dd as d,an$1 as d0,W1 as d1,o9 as d2,jt$1 as d3,S$1 as d4,Vl$1 as d5,om as d6,Yc$1 as d7,TD as d8,ph as d9,Cw as dA,mh as dB,ms as dC,Dr$2 as dD,X$1 as da,r9 as db,u0 as dc,m0 as dd,rs$2 as de,Qg as df,un as dg,hn as dh,Dt$1 as di,f9 as dj,v9 as dk,pb as dl,h0 as dm,X as dn,Vc as dp,u$2 as dq,bt$1 as dr,Me$1 as ds,G5 as dt,p3 as du,zl$1 as dv,$5 as dw,R0 as dx,tr as dy,Tw as dz,V5 as e,_i$2 as f,Kc$1 as g,gh as h,ie$2 as i,oE as j,k3 as k,lh as l,bD as m,n8 as n,o,gI as p,qo$2 as q,r,s,t$1 as t,ue$1 as u,vw as v,nl$1 as w,ch as x,sE as y,zc as z};
249
+ `],encapsulation:2})}return r})(),B=(()=>{class r{_ngZone=C$2(oe$2);_document=C$2(Uo$2);_styleLoader=C$2(R1);_renderer=C$2(Dr$2).createRenderer(null,null);_cleanupDocumentTouchmove;_scroll=new re$2;_dropInstances=new Set;_dragInstances=new Set;_activeDragInstances=qo$2([]);_globalListeners;_draggingPredicate=t=>t.isDragging();_domNodesToDirectives=null;pointerMove=new re$2;pointerUp=new re$2;registerDropContainer(t){this._dropInstances.has(t)||this._dropInstances.add(t);}registerDragItem(t){this._dragInstances.add(t),this._dragInstances.size===1&&this._ngZone.runOutsideAngular(()=>{this._cleanupDocumentTouchmove?.(),this._cleanupDocumentTouchmove=this._renderer.listen(this._document,"touchmove",this._persistentTouchmoveListener,tt);});}removeDropContainer(t){this._dropInstances.delete(t);}removeDragItem(t){this._dragInstances.delete(t),this.stopDragging(t),this._dragInstances.size===0&&this._cleanupDocumentTouchmove?.();}startDragging(t,i){if(!(this._activeDragInstances().indexOf(t)>-1)&&(this._styleLoader.load(pe),this._activeDragInstances.update(s=>[...s,t]),this._activeDragInstances().length===1)){let s=i.type.startsWith("touch"),n=a=>this.pointerUp.next(a),o=[["scroll",a=>this._scroll.next(a),I],["selectstart",this._preventDefaultWhileDragging,tt]];s?o.push(["touchend",n,I],["touchcancel",n,I]):o.push(["mouseup",n,I]),s||o.push(["mousemove",a=>this.pointerMove.next(a),tt]),this._ngZone.runOutsideAngular(()=>{this._globalListeners=o.map(([a,l,h])=>this._renderer.listen(this._document,a,l,h));});}}stopDragging(t){this._activeDragInstances.update(i=>{let s=i.indexOf(t);return s>-1?(i.splice(s,1),[...i]):i}),this._activeDragInstances().length===0&&this._clearGlobalListeners();}isDragging(t){return this._activeDragInstances().indexOf(t)>-1}scrolled(t){let i=[this._scroll];return t&&t!==this._document&&i.push(new S$1(s=>this._ngZone.runOutsideAngular(()=>{let n=this._renderer.listen(t,"scroll",o=>{this._activeDragInstances().length&&s.next(o);},I);return ()=>{n();}}))),zg(...i)}registerDirectiveNode(t,i){this._domNodesToDirectives??=new WeakMap,this._domNodesToDirectives.set(t,i);}removeDirectiveNode(t){this._domNodesToDirectives?.delete(t);}getDragDirectiveForNode(t){return this._domNodesToDirectives?.get(t)||null}ngOnDestroy(){this._dragInstances.forEach(t=>this.removeDragItem(t)),this._dropInstances.forEach(t=>this.removeDropContainer(t)),this._domNodesToDirectives=null,this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete();}_preventDefaultWhileDragging=t=>{this._activeDragInstances().length>0&&t.preventDefault();};_persistentTouchmoveListener=t=>{this._activeDragInstances().length>0&&(this._activeDragInstances().some(this._draggingPredicate)&&t.preventDefault(),this.pointerMove.next(t));};_clearGlobalListeners(){this._globalListeners?.forEach(t=>t()),this._globalListeners=void 0;}static \u0275fac=function(i){return new(i||r)};static \u0275prov=br$2({token:r,factory:r.\u0275fac})}return r})();function Wt(r){let e=r.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(r)*e}function ge(r){let e=getComputedStyle(r),t=et(e,"transition-property"),i=t.find(a=>a==="transform"||a==="all");if(!i)return 0;let s=t.indexOf(i),n=et(e,"transition-duration"),o=et(e,"transition-delay");return Wt(n[s])+Wt(o[s])}function et(r,e){return r.getPropertyValue(e).split(",").map(i=>i.trim())}var ue=new Set(["position"]),nt=class{_document;_rootElement;_direction;_initialDomRect;_previewTemplate;_previewClass;_pickupPositionOnPage;_initialTransform;_zIndex;_renderer;_previewEmbeddedView=null;_preview;get element(){return this._preview}constructor(e,t,i,s,n,o,a,l,h,c){this._document=e,this._rootElement=t,this._direction=i,this._initialDomRect=s,this._previewTemplate=n,this._previewClass=o,this._pickupPositionOnPage=a,this._initialTransform=l,this._zIndex=h,this._renderer=c;}attach(e){this._preview=this._createPreview(),e.appendChild(this._preview),Ut(this._preview)&&this._preview.showPopover();}destroy(){this._preview.remove(),this._previewEmbeddedView?.destroy(),this._preview=this._previewEmbeddedView=null;}setTransform(e){this._preview.style.transform=e;}getBoundingClientRect(){return this._preview.getBoundingClientRect()}addClass(e){this._preview.classList.add(e);}getTransitionDuration(){return ge(this._preview)}addEventListener(e,t){return this._renderer.listen(this._preview,e,t)}_createPreview(){let e=this._previewTemplate,t=this._previewClass,i=e?e.template:null,s;if(i&&e){let n=e.matchSize?this._initialDomRect:null,o=e.viewContainer.createEmbeddedView(i,e.context);o.detectChanges(),s=Jt$1(o,this._document),this._previewEmbeddedView=o,e.matchSize?Gt$1(s,n):s.style.transform=T(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y);}else s=it(this._rootElement),Gt$1(s,this._initialDomRect),this._initialTransform&&(s.style.transform=this._initialTransform);return ct(s.style,{"pointer-events":"none",margin:Ut(s)?"0 auto 0 0":"0",position:"fixed",top:"0",left:"0","z-index":this._zIndex+""},ue),S(s,false),s.classList.add("cdk-drag-preview"),s.setAttribute("popover","manual"),s.setAttribute("dir",this._direction),t&&(Array.isArray(t)?t.forEach(n=>s.classList.add(n)):s.classList.add(t)),s}};function Ut(r){return "showPopover"in r}var fe$1={passive:true},Zt$1={passive:false},me={passive:false,capture:true},ve=800,qt$1="cdk-drag-placeholder",$t$1=new Set(["position"]);function Qt$1(r,e,t={dragStartThreshold:5,pointerDirectionChangeThreshold:5}){let i=r.get(XI,null,{optional:true})||r.get(Dr$2).createRenderer(null,null);return new rt(e,t,r.get(Uo$2),r.get(oe$2),r.get(qt$2),r.get(B),i)}var rt=class{_config;_document;_ngZone;_viewportRuler;_dragDropRegistry;_renderer;_rootElementCleanups;_cleanupShadowRootSelectStart;_preview=null;_previewContainer;_placeholderRef=null;_placeholder;_pickupPositionInElement;_pickupPositionOnPage;_marker;_anchor=null;_passiveTransform={x:0,y:0};_activeTransform={x:0,y:0};_initialTransform;_hasStartedDragging=qo$2(false);_hasMoved=false;_initialContainer;_initialIndex;_parentPositions;_moveEvents=new re$2;_pointerDirectionDelta;_pointerPositionAtLastDirectionChange;_lastKnownPointerPosition;_rootElement;_ownerSVGElement=null;_rootElementTapHighlight;_pointerMoveSubscription=H$2.EMPTY;_pointerUpSubscription=H$2.EMPTY;_scrollSubscription=H$2.EMPTY;_resizeSubscription=H$2.EMPTY;_lastTouchEventTime;_dragStartTime;_boundaryElement=null;_nativeInteractionsEnabled=true;_initialDomRect;_previewRect;_boundaryRect;_previewTemplate;_placeholderTemplate;_handles=[];_disabledHandles=new Set;_dropContainer;_direction="ltr";_parentDragRef=null;_cachedShadowRoot;lockAxis=null;dragStartDelay=0;previewClass;scale=1;get disabled(){return this._disabled||!!(this._dropContainer&&this._dropContainer.disabled)}set disabled(e){e!==this._disabled&&(this._disabled=e,this._toggleNativeDragInteractions(),this._handles.forEach(t=>S(t,e)));}_disabled=false;beforeStarted=new re$2;started=new re$2;released=new re$2;ended=new re$2;entered=new re$2;exited=new re$2;dropped=new re$2;moved=this._moveEvents;data;constrainPosition;constructor(e,t,i,s,n,o,a){this._config=t,this._document=i,this._ngZone=s,this._viewportRuler=n,this._dragDropRegistry=o,this._renderer=a,this.withRootElement(e).withParent(t.parentDragRef||null),this._parentPositions=new H(i),o.registerDragItem(this);}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(e){this._handles=e.map(i=>jt$1(i)),this._handles.forEach(i=>S(i,this.disabled)),this._toggleNativeDragInteractions();let t=new Set;return this._disabledHandles.forEach(i=>{this._handles.indexOf(i)>-1&&t.add(i);}),this._disabledHandles=t,this}withPreviewTemplate(e){return this._previewTemplate=e,this}withPlaceholderTemplate(e){return this._placeholderTemplate=e,this}withRootElement(e){let t=jt$1(e);if(t!==this._rootElement){this._removeRootElementListeners();let i=this._renderer;this._rootElementCleanups=this._ngZone.runOutsideAngular(()=>[i.listen(t,"mousedown",this._pointerDown,Zt$1),i.listen(t,"touchstart",this._pointerDown,fe$1),i.listen(t,"dragstart",this._nativeDragStart,Zt$1)]),this._initialTransform=void 0,this._rootElement=t;}return typeof SVGElement<"u"&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(e){return this._boundaryElement=e?jt$1(e):null,this._resizeSubscription.unsubscribe(),e&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}withParent(e){return this._parentDragRef=e,this}dispose(){this._removeRootElementListeners(),this.isDragging()&&this._rootElement?.remove(),this._marker?.remove(),this._destroyPreview(),this._destroyPlaceholder(),this._dragDropRegistry.removeDragItem(this),this._removeListeners(),this.beforeStarted.complete(),this.started.complete(),this.released.complete(),this.ended.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this._moveEvents.complete(),this._handles=[],this._disabledHandles.clear(),this._dropContainer=void 0,this._resizeSubscription.unsubscribe(),this._parentPositions.clear(),this._boundaryElement=this._rootElement=this._ownerSVGElement=this._placeholderTemplate=this._previewTemplate=this._marker=this._parentDragRef=null;}isDragging(){return this._hasStartedDragging()&&this._dragDropRegistry.isDragging(this)}reset(){this._rootElement.style.transform=this._initialTransform||"",this._activeTransform={x:0,y:0},this._passiveTransform={x:0,y:0};}resetToBoundary(){if(this._boundaryElement&&this._rootElement&&_e(this._boundaryElement.getBoundingClientRect(),this._rootElement.getBoundingClientRect())){let e=this._boundaryElement.getBoundingClientRect(),t=this._rootElement.getBoundingClientRect(),i=0,s=0;t.left<e.left?i=e.left-t.left:t.right>e.right&&(i=e.right-t.right),t.top<e.top?s=e.top-t.top:t.bottom>e.bottom&&(s=e.bottom-t.bottom);let n=this._activeTransform.x,o=this._activeTransform.y,a=n+i,l=o+s;this._rootElement.style.transform=T(a,l),this._activeTransform={x:a,y:l},this._passiveTransform={x:a,y:l};}}disableHandle(e){!this._disabledHandles.has(e)&&this._handles.indexOf(e)>-1&&(this._disabledHandles.add(e),S(e,true));}enableHandle(e){this._disabledHandles.has(e)&&(this._disabledHandles.delete(e),S(e,this.disabled));}withDirection(e){return this._direction=e,this}_withDropContainer(e){this._dropContainer=e;}getFreeDragPosition(){let e=this.isDragging()?this._activeTransform:this._passiveTransform;return {x:e.x,y:e.y}}setFreeDragPosition(e){return this._activeTransform={x:0,y:0},this._passiveTransform.x=e.x,this._passiveTransform.y=e.y,this._dropContainer||this._applyRootElementTransform(e.x,e.y),this}withPreviewContainer(e){return this._previewContainer=e,this}_sortFromLastPointerPosition(){let e=this._lastKnownPointerPosition;e&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(e),e);}_removeListeners(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe(),this._cleanupShadowRootSelectStart?.(),this._cleanupShadowRootSelectStart=void 0;}_destroyPreview(){this._preview?.destroy(),this._preview=null;}_destroyPlaceholder(){this._anchor?.remove(),this._placeholder?.remove(),this._placeholderRef?.destroy(),this._placeholder=this._anchor=this._placeholderRef=null;}_pointerDown=e=>{if(this.beforeStarted.next(),this._handles.length){let t=this._getTargetHandle(e);t&&!this._disabledHandles.has(t)&&!this.disabled&&this._initializeDragSequence(t,e);}else this.disabled||this._initializeDragSequence(this._rootElement,e);};_pointerMove=e=>{let t=this._getPointerPositionOnPage(e);if(!this._hasStartedDragging()){let s=Math.abs(t.x-this._pickupPositionOnPage.x),n=Math.abs(t.y-this._pickupPositionOnPage.y);if(s+n>=this._config.dragStartThreshold){let a=Date.now()>=this._dragStartTime+this._getDragStartDelay(e),l=this._dropContainer;if(!a){this._endDragSequence(e);return}(!l||!l.isDragging()&&!l.isReceiving())&&(e.cancelable&&e.preventDefault(),this._hasStartedDragging.set(true),this._ngZone.run(()=>this._startDragSequence(e)));}return}e.cancelable&&e.preventDefault();let i=this._getConstrainedPointerPosition(t);if(this._hasMoved=true,this._lastKnownPointerPosition=t,this._updatePointerDirectionDelta(i),this._dropContainer)this._updateActiveDropContainer(i,t);else {let s=this.constrainPosition?this._initialDomRect:this._pickupPositionOnPage,n=this._activeTransform;n.x=i.x-s.x+this._passiveTransform.x,n.y=i.y-s.y+this._passiveTransform.y,this._applyRootElementTransform(n.x,n.y);}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:i,event:e,distance:this._getDragDistance(i),delta:this._pointerDirectionDelta});});};_pointerUp=e=>{this._endDragSequence(e);};_endDragSequence(e){if(this._dragDropRegistry.isDragging(this)&&(this._removeListeners(),this._dragDropRegistry.stopDragging(this),this._toggleNativeDragInteractions(),this._handles&&(this._rootElement.style.webkitTapHighlightColor=this._rootElementTapHighlight),!!this._hasStartedDragging()))if(this.released.next({source:this,event:e}),this._dropContainer)this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(e),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this);});else {this._passiveTransform.x=this._activeTransform.x;let t=this._getPointerPositionOnPage(e);this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(t),dropPoint:t,event:e});}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this);}}_startDragSequence(e){x(e)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();let t=this._getShadowRoot(),i=this._dropContainer;if(t&&this._ngZone.runOutsideAngular(()=>{this._cleanupShadowRootSelectStart=this._renderer.listen(t,"selectstart",De,me);}),i){let s=this._rootElement,n=s.parentNode,o=this._placeholder=this._createPlaceholderElement(),a=this._marker=this._marker||this._document.createComment("");n.insertBefore(a,s),this._initialTransform=s.style.transform||"",this._preview=new nt(this._document,this._rootElement,this._direction,this._initialDomRect,this._previewTemplate||null,this.previewClass||null,this._pickupPositionOnPage,this._initialTransform,this._config.zIndex||1e3,this._renderer),this._preview.attach(this._getPreviewInsertionPoint(n,t)),Bt$1(s,false,$t$1),this._document.body.appendChild(n.replaceChild(o,s)),this.started.next({source:this,event:e}),i.start(),this._initialContainer=i,this._initialIndex=i.getItemIndex(this);}else this.started.next({source:this,event:e}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(i?i.getScrollableParents():[]);}_initializeDragSequence(e,t){this._parentDragRef&&t.stopPropagation();let i=this.isDragging(),s=x(t),n=!s&&t.button!==0,o=this._rootElement,a=He(t),l=!s&&this._lastTouchEventTime&&this._lastTouchEventTime+ve>Date.now(),h=s?Ui(t):ji(t);if(a&&a.draggable&&t.type==="mousedown"&&t.preventDefault(),i||n||l||h)return;if(this._handles.length){let v=o.style;this._rootElementTapHighlight=v.webkitTapHighlightColor||"",v.webkitTapHighlightColor="transparent";}this._hasMoved=false,this._hasStartedDragging.set(this._hasMoved),this._removeListeners(),this._initialDomRect=this._rootElement.getBoundingClientRect(),this._pointerMoveSubscription=this._dragDropRegistry.pointerMove.subscribe(this._pointerMove),this._pointerUpSubscription=this._dragDropRegistry.pointerUp.subscribe(this._pointerUp),this._scrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(v=>this._updateOnScroll(v)),this._boundaryElement&&(this._boundaryRect=ht$1(this._boundaryElement));let c=this._previewTemplate;this._pickupPositionInElement=c&&c.template&&!c.matchSize?{x:0,y:0}:this._getPointerPositionInElement(this._initialDomRect,e,t);let g=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(t);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:g.x,y:g.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,t);}_cleanupDragArtifacts(e){Bt$1(this._rootElement,true,$t$1),this._marker.parentNode.replaceChild(this._rootElement,this._marker),this._destroyPreview(),this._destroyPlaceholder(),this._initialDomRect=this._boundaryRect=this._previewRect=this._initialTransform=void 0,this._ngZone.run(()=>{let t=this._dropContainer,i=t.getItemIndex(this),s=this._getPointerPositionOnPage(e),n=this._getDragDistance(s),o=t._isOverContainer(s.x,s.y);this.ended.next({source:this,distance:n,dropPoint:s,event:e}),this.dropped.next({item:this,currentIndex:i,previousIndex:this._initialIndex,container:t,previousContainer:this._initialContainer,isPointerOverContainer:o,distance:n,dropPoint:s,event:e}),t.drop(this,i,this._initialIndex,this._initialContainer,o,n,s,e),this._dropContainer=this._initialContainer;});}_updateActiveDropContainer({x:e,y:t},{x:i,y:s}){let n=this._initialContainer._getSiblingContainerFromPosition(this,e,t);!n&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(e,t)&&(n=this._initialContainer),n&&n!==this._dropContainer&&this._ngZone.run(()=>{let o=this._dropContainer.getItemIndex(this),a=this._dropContainer.getItemAtIndex(o+1)?.getVisibleElement()||null;this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._conditionallyInsertAnchor(n,this._dropContainer,a),this._dropContainer=n,this._dropContainer.enter(this,e,t,n===this._initialContainer&&n.sortingDisabled?this._initialIndex:void 0),this.entered.next({item:this,container:n,currentIndex:n.getItemIndex(this)});}),this.isDragging()&&(this._dropContainer._startScrollingIfNecessary(i,s),this._dropContainer._sortItem(this,e,t,this._pointerDirectionDelta),this.constrainPosition?this._applyPreviewTransform(e,t):this._applyPreviewTransform(e-this._pickupPositionInElement.x,t-this._pickupPositionInElement.y));}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();let e=this._placeholder.getBoundingClientRect();this._preview.addClass("cdk-drag-animating"),this._applyPreviewTransform(e.left,e.top);let t=this._preview.getTransitionDuration();return t===0?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(i=>{let s=a=>{(!a||this._preview&&He(a)===this._preview.element&&a.propertyName==="transform")&&(o(),i(),clearTimeout(n));},n=setTimeout(s,t*1.5),o=this._preview.addEventListener("transitionend",s);}))}_createPlaceholderElement(){let e=this._placeholderTemplate,t=e?e.template:null,i;return t?(this._placeholderRef=e.viewContainer.createEmbeddedView(t,e.context),this._placeholderRef.detectChanges(),i=Jt$1(this._placeholderRef,this._document)):i=it(this._rootElement),i.style.pointerEvents="none",i.classList.add(qt$1),i}_getPointerPositionInElement(e,t,i){let s=t===this._rootElement?null:t,n=s?s.getBoundingClientRect():e,o=x(i)?i.targetTouches[0]:i,a=this._getViewportScrollPosition(),l=o.pageX-n.left-a.left,h=o.pageY-n.top-a.top;return {x:n.left-e.left+l,y:n.top-e.top+h}}_getPointerPositionOnPage(e){let t=this._getViewportScrollPosition(),i=x(e)?e.touches[0]||e.changedTouches[0]||{pageX:0,pageY:0}:e,s=i.pageX-t.left,n=i.pageY-t.top;if(this._ownerSVGElement){let o=this._ownerSVGElement.getScreenCTM();if(o){let a=this._ownerSVGElement.createSVGPoint();return a.x=s,a.y=n,a.matrixTransform(o.inverse())}}return {x:s,y:n}}_getConstrainedPointerPosition(e){let t=this._dropContainer?this._dropContainer.lockAxis:null,{x:i,y:s}=this.constrainPosition?this.constrainPosition(e,this,this._initialDomRect,this._pickupPositionInElement):e;if(this.lockAxis==="x"||t==="x"?s=this._pickupPositionOnPage.y-(this.constrainPosition?this._pickupPositionInElement.y:0):(this.lockAxis==="y"||t==="y")&&(i=this._pickupPositionOnPage.x-(this.constrainPosition?this._pickupPositionInElement.x:0)),this._boundaryRect){let{x:n,y:o}=this.constrainPosition?{x:0,y:0}:this._pickupPositionInElement,a=this._boundaryRect,{width:l,height:h}=this._getPreviewRect(),c=a.top+o,g=a.bottom-(h-o),v=a.left+n,G=a.right-(l-n);i=Kt$1(i,v,G),s=Kt$1(s,c,g);}return {x:i,y:s}}_updatePointerDirectionDelta(e){let{x:t,y:i}=e,s=this._pointerDirectionDelta,n=this._pointerPositionAtLastDirectionChange,o=Math.abs(t-n.x),a=Math.abs(i-n.y);return o>this._config.pointerDirectionChangeThreshold&&(s.x=t>n.x?1:-1,n.x=t),a>this._config.pointerDirectionChangeThreshold&&(s.y=i>n.y?1:-1,n.y=i),s}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;let e=this._handles.length>0||!this.isDragging();e!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=e,S(this._rootElement,e));}_removeRootElementListeners(){this._rootElementCleanups?.forEach(e=>e()),this._rootElementCleanups=void 0;}_applyRootElementTransform(e,t){let i=1/this.scale,s=T(e*i,t*i),n=this._rootElement.style;this._initialTransform==null&&(this._initialTransform=n.transform&&n.transform!="none"?n.transform:""),n.transform=z(s,this._initialTransform);}_applyPreviewTransform(e,t){let i=this._previewTemplate?.template?void 0:this._initialTransform,s=T(e,t);this._preview.setTransform(z(s,i));}_getDragDistance(e){let t=this._pickupPositionOnPage;return t?{x:e.x-t.x,y:e.y-t.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear();}_containInsideBoundaryOnResize(){let{x:e,y:t}=this._passiveTransform;if(e===0&&t===0||this.isDragging()||!this._boundaryElement)return;let i=this._rootElement.getBoundingClientRect(),s=this._boundaryElement.getBoundingClientRect();if(s.width===0&&s.height===0||i.width===0&&i.height===0)return;let n=s.left-i.left,o=i.right-s.right,a=s.top-i.top,l=i.bottom-s.bottom;s.width>i.width?(n>0&&(e+=n),o>0&&(e-=o)):e=0,s.height>i.height?(a>0&&(t+=a),l>0&&(t-=l)):t=0,(e!==this._passiveTransform.x||t!==this._passiveTransform.y)&&this.setFreeDragPosition({y:t,x:e});}_getDragStartDelay(e){let t=this.dragStartDelay;return typeof t=="number"?t:x(e)?t.touch:t?t.mouse:0}_updateOnScroll(e){let t=this._parentPositions.handleScroll(e);if(t){let i=He(e);this._boundaryRect&&i!==this._boundaryElement&&i.contains(this._boundaryElement)&&C(this._boundaryRect,t.top,t.left),this._pickupPositionOnPage.x+=t.left,this._pickupPositionOnPage.y+=t.top,this._dropContainer||(this._activeTransform.x-=t.left,this._activeTransform.y-=t.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y));}}_getViewportScrollPosition(){return this._parentPositions.positions.get(this._document)?.scrollPosition||this._parentPositions.getViewportScrollPosition()}_getShadowRoot(){return this._cachedShadowRoot===void 0&&(this._cachedShadowRoot=D3(this._rootElement)),this._cachedShadowRoot}_getPreviewInsertionPoint(e,t){let i=this._previewContainer||"global";if(i==="parent")return e;if(i==="global"){let s=this._document;return t||s.fullscreenElement||s.webkitFullscreenElement||s.mozFullScreenElement||s.msFullscreenElement||s.body}return jt$1(i)}_getPreviewRect(){return (!this._previewRect||!this._previewRect.width&&!this._previewRect.height)&&(this._previewRect=this._preview?this._preview.getBoundingClientRect():this._initialDomRect),this._previewRect}_nativeDragStart=e=>{if(this._handles.length){let t=this._getTargetHandle(e);t&&!this._disabledHandles.has(t)&&!this.disabled&&e.preventDefault();}else this.disabled||e.preventDefault();};_getTargetHandle(e){return this._handles.find(t=>e.target&&(e.target===t||t.contains(e.target)))}_conditionallyInsertAnchor(e,t,i){if(e===this._initialContainer)this._anchor?.remove(),this._anchor=null;else if(t===this._initialContainer&&t.hasAnchor){let s=this._anchor??=it(this._placeholder);s.classList.remove(qt$1),s.classList.add("cdk-drag-anchor"),s.style.transform="",i?i.before(s):jt$1(t.element).appendChild(s);}}};function Kt$1(r,e,t){return Math.max(e,Math.min(t,r))}function x(r){return r.type[0]==="t"}function De(r){r.preventDefault();}function te(r,e,t){let i=jt(e,r.length-1),s=jt(t,r.length-1);if(i===s)return;let n=r[i],o=s<i?-1:1;for(let a=i;a!==s;a+=o)r[a]=r[a+o];r[s]=n;}function jt(r,e){return Math.max(0,Math.min(e,r))}var V=class{_dragDropRegistry;_element;_sortPredicate;_itemPositions=[];_activeDraggables;orientation="vertical";direction="ltr";constructor(e){this._dragDropRegistry=e;}_previousSwap={drag:null,delta:0,overlaps:false};start(e){this.withItems(e);}sort(e,t,i,s){let n=this._itemPositions,o=this._getItemIndexFromPointerPosition(e,t,i,s);if(o===-1&&n.length>0)return null;let a=this.orientation==="horizontal",l=n.findIndex(u=>u.drag===e),h=n[o],c=n[l].clientRect,g=h.clientRect,v=l>o?1:-1,G=this._getItemOffsetPx(c,g,v),le=this._getSiblingOffsetPx(l,n,v),he=n.slice();return te(n,l,o),n.forEach((u,ce)=>{if(he[ce]===u)return;let dt=u.drag===e,W=dt?G:le,_t=dt?e.getPlaceholderElement():u.drag.getRootElement();u.offset+=W;let pt=Math.round(u.offset*(1/u.drag.scale));a?(_t.style.transform=z(`translate3d(${pt}px, 0, 0)`,u.initialTransform),C(u.clientRect,0,W)):(_t.style.transform=z(`translate3d(0, ${pt}px, 0)`,u.initialTransform),C(u.clientRect,W,0));}),this._previousSwap.overlaps=st(g,t,i),this._previousSwap.drag=h.drag,this._previousSwap.delta=a?s.x:s.y,{previousIndex:l,currentIndex:o}}enter(e,t,i,s){let n=this._activeDraggables,o=n.indexOf(e),a=e.getPlaceholderElement();o>-1&&n.splice(o,1);let l=s==null||s<0?this._getItemIndexFromPointerPosition(e,t,i):s,h=n[l];if(h===e&&(h=n[l+1]),!h&&(l==null||l===-1||l<n.length-1)&&this._shouldEnterAsFirstChild(t,i)&&(h=n[0]),h&&!this._dragDropRegistry.isDragging(h)){let c=h.getRootElement();c.parentElement.insertBefore(a,c),n.splice(l,0,e);}else this._element.appendChild(a),n.push(e);a.style.transform="",this._cacheItemPositions();}withItems(e){this._activeDraggables=e.slice(),this._cacheItemPositions();}withSortPredicate(e){this._sortPredicate=e;}reset(){this._activeDraggables?.forEach(e=>{let t=e.getRootElement();if(t){let i=this._itemPositions.find(s=>s.drag===e)?.initialTransform;t.style.transform=i||"";}}),this._itemPositions=[],this._activeDraggables=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=false;}getActiveItemsSnapshot(){return this._activeDraggables}getItemIndex(e){return this._getVisualItemPositions().findIndex(t=>t.drag===e)}getItemAtIndex(e){return this._getVisualItemPositions()[e]?.drag||null}updateOnScroll(e,t){this._itemPositions.forEach(({clientRect:i})=>{C(i,e,t);}),this._itemPositions.forEach(({drag:i})=>{this._dragDropRegistry.isDragging(i)&&i._sortFromLastPointerPosition();});}withElementContainer(e){this._element=e;}_cacheItemPositions(){let e=this.orientation==="horizontal";this._itemPositions=this._activeDraggables.map(t=>{let i=t.getVisibleElement();return {drag:t,offset:0,initialTransform:i.style.transform||"",clientRect:ht$1(i)}}).sort((t,i)=>e?t.clientRect.left-i.clientRect.left:t.clientRect.top-i.clientRect.top);}_getVisualItemPositions(){return this.orientation==="horizontal"&&this.direction==="rtl"?this._itemPositions.slice().reverse():this._itemPositions}_getItemOffsetPx(e,t,i){let s=this.orientation==="horizontal",n=s?t.left-e.left:t.top-e.top;return i===-1&&(n+=s?t.width-e.width:t.height-e.height),n}_getSiblingOffsetPx(e,t,i){let s=this.orientation==="horizontal",n=t[e].clientRect,o=t[e+i*-1],a=n[s?"width":"height"]*i;if(o){let l=s?"left":"top",h=s?"right":"bottom";i===-1?a-=o.clientRect[l]-n[h]:a+=n[l]-o.clientRect[h];}return a}_shouldEnterAsFirstChild(e,t){if(!this._activeDraggables.length)return false;let i=this._itemPositions,s=this.orientation==="horizontal";if(i[0].drag!==this._activeDraggables[0]){let o=i[i.length-1].clientRect;return s?e>=o.right:t>=o.bottom}else {let o=i[0].clientRect;return s?e<=o.left:t<=o.top}}_getItemIndexFromPointerPosition(e,t,i,s){let n=this.orientation==="horizontal",o=this._itemPositions.findIndex(({drag:a,clientRect:l})=>{if(a===e)return false;if(s){let h=n?s.x:s.y;if(a===this._previousSwap.drag&&this._previousSwap.overlaps&&h===this._previousSwap.delta)return false}return n?t>=Math.floor(l.left)&&t<Math.floor(l.right):i>=Math.floor(l.top)&&i<Math.floor(l.bottom)});return o===-1||!this._sortPredicate(o,e)?-1:o}},ot=class{_document;_dragDropRegistry;_element;_sortPredicate;_rootNode;_activeItems;_previousSwap={drag:null,deltaX:0,deltaY:0,overlaps:false};_relatedNodes=[];constructor(e,t){this._document=e,this._dragDropRegistry=t;}start(e){let t=this._element.childNodes;this._relatedNodes=[];for(let i=0;i<t.length;i++){let s=t[i];this._relatedNodes.push([s,s.nextSibling]);}this.withItems(e);}sort(e,t,i,s){let n=this._getItemIndexFromPointerPosition(e,t,i),o=this._previousSwap;if(n===-1||this._activeItems[n]===e)return null;let a=this._activeItems[n];if(o.drag===a&&o.overlaps&&o.deltaX===s.x&&o.deltaY===s.y)return null;let l=this.getItemIndex(e),h=e.getPlaceholderElement(),c=a.getRootElement();n>l?c.after(h):c.before(h),te(this._activeItems,l,n);let g=this._getRootNode().elementFromPoint(t,i);return o.deltaX=s.x,o.deltaY=s.y,o.drag=a,o.overlaps=c===g||c.contains(g),{previousIndex:l,currentIndex:n}}enter(e,t,i,s){let n=this._activeItems.indexOf(e);n>-1&&this._activeItems.splice(n,1);let o=s==null||s<0?this._getItemIndexFromPointerPosition(e,t,i):s;o===-1&&(o=this._getClosestItemIndexToPointer(e,t,i));let a=this._activeItems[o];a&&!this._dragDropRegistry.isDragging(a)?(this._activeItems.splice(o,0,e),a.getRootElement().before(e.getPlaceholderElement())):(this._activeItems.push(e),this._element.appendChild(e.getPlaceholderElement()));}withItems(e){this._activeItems=e.slice();}withSortPredicate(e){this._sortPredicate=e;}reset(){let e=this._element,t=this._previousSwap;for(let i=this._relatedNodes.length-1;i>-1;i--){let[s,n]=this._relatedNodes[i];s.parentNode===e&&s.nextSibling!==n&&(n===null?e.appendChild(s):n.parentNode===e&&e.insertBefore(s,n));}this._relatedNodes=[],this._activeItems=[],t.drag=null,t.deltaX=t.deltaY=0,t.overlaps=false;}getActiveItemsSnapshot(){return this._activeItems}getItemIndex(e){return this._activeItems.indexOf(e)}getItemAtIndex(e){return this._activeItems[e]||null}updateOnScroll(){this._activeItems.forEach(e=>{this._dragDropRegistry.isDragging(e)&&e._sortFromLastPointerPosition();});}withElementContainer(e){e!==this._element&&(this._element=e,this._rootNode=void 0);}_getItemIndexFromPointerPosition(e,t,i){let s=this._getRootNode().elementFromPoint(Math.floor(t),Math.floor(i)),n=s?this._activeItems.findIndex(o=>{let a=o.getRootElement();return s===a||a.contains(s)}):-1;return n===-1||!this._sortPredicate(n,e)?-1:n}_getRootNode(){return this._rootNode||(this._rootNode=D3(this._element)||this._document),this._rootNode}_getClosestItemIndexToPointer(e,t,i){if(this._activeItems.length===0)return -1;if(this._activeItems.length===1)return 0;let s=1/0,n=-1;for(let o=0;o<this._activeItems.length;o++){let a=this._activeItems[o];if(a!==e){let{x:l,y:h}=a.getRootElement().getBoundingClientRect(),c=Math.hypot(t-l,i-h);c<s&&(s=c,n=o);}}return n}},Yt$1=.05,ee=.05,f=(function(r){return r[r.NONE=0]="NONE",r[r.UP=1]="UP",r[r.DOWN=2]="DOWN",r})(f||{}),p=(function(r){return r[r.NONE=0]="NONE",r[r.LEFT=1]="LEFT",r[r.RIGHT=2]="RIGHT",r})(p||{});function ie(r,e){return new at(e,r.get(B),r.get(Uo$2),r.get(oe$2),r.get(qt$2))}var at=class{_dragDropRegistry;_ngZone;_viewportRuler;element;disabled=false;sortingDisabled=false;lockAxis=null;autoScrollDisabled=false;autoScrollStep=2;hasAnchor=false;enterPredicate=()=>true;sortPredicate=()=>true;beforeStarted=new re$2;entered=new re$2;exited=new re$2;dropped=new re$2;sorted=new re$2;receivingStarted=new re$2;receivingStopped=new re$2;data;_container;_isDragging=false;_parentPositions;_sortStrategy;_domRect;_draggables=[];_siblings=[];_activeSiblings=new Set;_viewportScrollSubscription=H$2.EMPTY;_verticalScrollDirection=f.NONE;_horizontalScrollDirection=p.NONE;_scrollNode;_stopScrollTimers=new re$2;_cachedShadowRoot=null;_document;_scrollableElements=[];_initialScrollSnap;_direction="ltr";constructor(e,t,i,s,n){this._dragDropRegistry=t,this._ngZone=s,this._viewportRuler=n;let o=this.element=jt$1(e);this._document=i,this.withOrientation("vertical").withElementContainer(o),t.registerDropContainer(this),this._parentPositions=new H(i);}dispose(){this._stopScrolling(),this._stopScrollTimers.complete(),this._viewportScrollSubscription.unsubscribe(),this.beforeStarted.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this.sorted.complete(),this.receivingStarted.complete(),this.receivingStopped.complete(),this._activeSiblings.clear(),this._scrollNode=null,this._parentPositions.clear(),this._dragDropRegistry.removeDropContainer(this);}isDragging(){return this._isDragging}start(){this._draggingStarted(),this._notifyReceivingSiblings();}enter(e,t,i,s){this._draggingStarted(),s==null&&this.sortingDisabled&&(s=this._draggables.indexOf(e)),this._sortStrategy.enter(e,t,i,s),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:e,container:this,currentIndex:this.getItemIndex(e)});}exit(e){this._reset(),this.exited.next({item:e,container:this});}drop(e,t,i,s,n,o,a,l){this._reset(),this.dropped.next({item:e,currentIndex:t,previousIndex:i,container:this,previousContainer:s,isPointerOverContainer:n,distance:o,dropPoint:a,event:l});}withItems(e){let t=this._draggables;return this._draggables=e,e.forEach(i=>i._withDropContainer(this)),this.isDragging()&&(t.filter(s=>s.isDragging()).every(s=>e.indexOf(s)===-1)?this._reset():this._sortStrategy.withItems(this._draggables)),this}withDirection(e){return this._direction=e,this._sortStrategy instanceof V&&(this._sortStrategy.direction=e),this}connectedTo(e){return this._siblings=e.slice(),this}withOrientation(e){if(e==="mixed")this._sortStrategy=new ot(this._document,this._dragDropRegistry);else {let t=new V(this._dragDropRegistry);t.direction=this._direction,t.orientation=e,this._sortStrategy=t;}return this._sortStrategy.withElementContainer(this._container),this._sortStrategy.withSortPredicate((t,i)=>this.sortPredicate(t,i,this)),this}withScrollableParents(e){let t=this._container;return this._scrollableElements=e.indexOf(t)===-1?[t,...e]:e.slice(),this}withElementContainer(e){if(e===this._container)return this;jt$1(this.element);let i=this._scrollableElements.indexOf(this._container),s=this._scrollableElements.indexOf(e);return i>-1&&this._scrollableElements.splice(i,1),s>-1&&this._scrollableElements.splice(s,1),this._sortStrategy&&this._sortStrategy.withElementContainer(e),this._cachedShadowRoot=null,this._scrollableElements.unshift(e),this._container=e,this}getScrollableParents(){return this._scrollableElements}getItemIndex(e){return this._isDragging?this._sortStrategy.getItemIndex(e):this._draggables.indexOf(e)}getItemAtIndex(e){return this._isDragging?this._sortStrategy.getItemAtIndex(e):this._draggables[e]||null}isReceiving(){return this._activeSiblings.size>0}_sortItem(e,t,i,s){if(this.sortingDisabled||!this._domRect||!Vt$1(this._domRect,Yt$1,t,i))return;let n=this._sortStrategy.sort(e,t,i,s);n&&this.sorted.next({previousIndex:n.previousIndex,currentIndex:n.currentIndex,container:this,item:e});}_startScrollingIfNecessary(e,t){if(this.autoScrollDisabled)return;let i,s=f.NONE,n=p.NONE;if(this._parentPositions.positions.forEach((o,a)=>{a===this._document||!o.clientRect||i||Vt$1(o.clientRect,Yt$1,e,t)&&([s,n]=we(a,o.clientRect,this._direction,e,t),(s||n)&&(i=a));}),!s&&!n){let{width:o,height:a}=this._viewportRuler.getViewportSize(),l={width:o,height:a,top:0,right:o,bottom:a,left:0};s=se(l,t),n=ne(l,e),i=window;}i&&(s!==this._verticalScrollDirection||n!==this._horizontalScrollDirection||i!==this._scrollNode)&&(this._verticalScrollDirection=s,this._horizontalScrollDirection=n,this._scrollNode=i,(s||n)&&i?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling());}_stopScrolling(){this._stopScrollTimers.next();}_draggingStarted(){let e=this._container.style;this.beforeStarted.next(),this._isDragging=true,this._initialScrollSnap=e.msScrollSnapType||e.scrollSnapType||"",e.scrollSnapType=e.msScrollSnapType="none",this._sortStrategy.start(this._draggables),this._cacheParentPositions(),this._viewportScrollSubscription.unsubscribe(),this._listenToScrollEvents();}_cacheParentPositions(){this._parentPositions.cache(this._scrollableElements),this._domRect=this._parentPositions.positions.get(this._container).clientRect;}_reset(){this._isDragging=false;let e=this._container.style;e.scrollSnapType=e.msScrollSnapType=this._initialScrollSnap,this._siblings.forEach(t=>t._stopReceiving(this)),this._sortStrategy.reset(),this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear();}_startScrollInterval=()=>{this._stopScrolling(),Gg(0,Og).pipe(im(this._stopScrollTimers)).subscribe(()=>{let e=this._scrollNode,t=this.autoScrollStep;this._verticalScrollDirection===f.UP?e.scrollBy(0,-t):this._verticalScrollDirection===f.DOWN&&e.scrollBy(0,t),this._horizontalScrollDirection===p.LEFT?e.scrollBy(-t,0):this._horizontalScrollDirection===p.RIGHT&&e.scrollBy(t,0);});};_isOverContainer(e,t){return this._domRect!=null&&st(this._domRect,e,t)}_getSiblingContainerFromPosition(e,t,i){return this._siblings.find(s=>s._canReceive(e,t,i))}_canReceive(e,t,i){if(!this._domRect||!st(this._domRect,t,i)||!this.enterPredicate(e,this))return false;let s=this._getShadowRoot().elementFromPoint(t,i);return s?s===this._container||this._container.contains(s):false}_startReceiving(e,t){let i=this._activeSiblings;!i.has(e)&&t.every(s=>this.enterPredicate(s,this)||this._draggables.indexOf(s)>-1)&&(i.add(e),this._cacheParentPositions(),this._listenToScrollEvents(),this.receivingStarted.next({initiator:e,receiver:this,items:t}));}_stopReceiving(e){this._activeSiblings.delete(e),this._viewportScrollSubscription.unsubscribe(),this.receivingStopped.next({initiator:e,receiver:this});}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(e=>{if(this.isDragging()){let t=this._parentPositions.handleScroll(e);t&&this._sortStrategy.updateOnScroll(t.top,t.left);}else this.isReceiving()&&this._cacheParentPositions();});}_getShadowRoot(){if(!this._cachedShadowRoot){let e=D3(this._container);this._cachedShadowRoot=e||this._document;}return this._cachedShadowRoot}_notifyReceivingSiblings(){let e=this._sortStrategy.getActiveItemsSnapshot().filter(t=>t.isDragging());this._siblings.forEach(t=>t._startReceiving(this,e));}};function se(r,e){let{top:t,bottom:i,height:s}=r,n=s*ee;return e>=t-n&&e<=t+n?f.UP:e>=i-n&&e<=i+n?f.DOWN:f.NONE}function ne(r,e){let{left:t,right:i,width:s}=r,n=s*ee;return e>=t-n&&e<=t+n?p.LEFT:e>=i-n&&e<=i+n?p.RIGHT:p.NONE}function we(r,e,t,i,s){let n=se(e,s),o=ne(e,i),a=f.NONE,l=p.NONE;if(n){let h=r.scrollTop;n===f.UP?h>0&&(a=f.UP):r.scrollHeight-h>r.clientHeight&&(a=f.DOWN);}if(o){let h=r.scrollLeft;t==="rtl"?o===p.RIGHT?h<0&&(l=p.RIGHT):r.scrollWidth+h>r.clientWidth&&(l=p.LEFT):o===p.LEFT?h>0&&(l=p.LEFT):r.scrollWidth-h>r.clientWidth&&(l=p.RIGHT);}return [a,l]}var be=(()=>{class r{_injector=C$2(Ee$2);createDrag(t,i){return Qt$1(this._injector,t,i)}createDropList(t){return ie(this._injector,t)}static \u0275fac=function(i){return new(i||r)};static \u0275prov=br$2({token:r,factory:r.\u0275fac})}return r})(),lt=new A$2("CDK_DRAG_PARENT");var re=new A$2("CdkDragHandle"),Ge=(()=>{class r{element=C$2(_r$2);_parentDrag=C$2(lt,{optional:true,skipSelf:true});_dragDropRegistry=C$2(B);_stateChanges=new re$2;get disabled(){return this._disabled}set disabled(t){this._disabled=t,this._stateChanges.next(this);}_disabled=false;constructor(){this._parentDrag?._addHandle(this);}ngAfterViewInit(){if(!this._parentDrag){let t=this.element.nativeElement.parentElement;for(;t;){let i=this._dragDropRegistry.getDragDirectiveForNode(t);if(i){this._parentDrag=i,i._addHandle(this);break}t=t.parentElement;}}}ngOnDestroy(){this._parentDrag?._removeHandle(this),this._stateChanges.complete();}static \u0275fac=function(i){return new(i||r)};static \u0275dir=XE({type:r,selectors:[["","cdkDragHandle",""]],hostAttrs:[1,"cdk-drag-handle"],inputs:{disabled:[2,"cdkDragHandleDisabled","disabled",Z0$1]},features:[Sw([{provide:re,useExisting:r}])]})}return r})(),oe=new A$2("CDK_DRAG_CONFIG"),ae=new A$2("CdkDropList"),We=(()=>{class r{element=C$2(_r$2);dropContainer=C$2(ae,{optional:true,skipSelf:true});_ngZone=C$2(oe$2);_viewContainerRef=C$2(ji$2);_dir=C$2(Le,{optional:true});_changeDetectorRef=C$2(z0$1);_selfHandle=C$2(re,{optional:true,self:true});_parentDrag=C$2(lt,{optional:true,skipSelf:true});_dragDropRegistry=C$2(B);_destroyed=new re$2;_handles=new On$1([]);_previewTemplate=null;_placeholderTemplate=null;_dragRef;data;lockAxis=null;rootElementSelector;boundaryElement;dragStartDelay;freeDragPosition;get disabled(){return this._disabled||!!(this.dropContainer&&this.dropContainer.disabled)}set disabled(t){this._disabled=t,this._dragRef.disabled=this._disabled;}_disabled=false;constrainPosition;previewClass;previewContainer;scale=1;started=new Le$2;released=new Le$2;ended=new Le$2;entered=new Le$2;exited=new Le$2;dropped=new Le$2;moved=new S$1(t=>{let i=this._dragRef.moved.pipe(Se$3(s=>({source:this,pointerPosition:s.pointerPosition,event:s.event,delta:s.delta,distance:s.distance}))).subscribe(t);return ()=>{i.unsubscribe();}});_injector=C$2(Ee$2);constructor(){let t=this.dropContainer,i=C$2(oe,{optional:true});this._dragRef=Qt$1(this._injector,this.element,{dragStartThreshold:i&&i.dragStartThreshold!=null?i.dragStartThreshold:5,pointerDirectionChangeThreshold:i&&i.pointerDirectionChangeThreshold!=null?i.pointerDirectionChangeThreshold:5,zIndex:i?.zIndex}),this._dragRef.data=this,this._dragDropRegistry.registerDirectiveNode(this.element.nativeElement,this),i&&this._assignDefaults(i),t&&(t.addItem(this),t._dropListRef.beforeStarted.pipe(im(this._destroyed)).subscribe(()=>{this._dragRef.scale=this.scale;})),this._syncInputs(this._dragRef),this._handleEvents(this._dragRef);}getPlaceholderElement(){return this._dragRef.getPlaceholderElement()}getRootElement(){return this._dragRef.getRootElement()}reset(){this._dragRef.reset();}resetToBoundary(){this._dragRef.resetToBoundary();}getFreeDragPosition(){return this._dragRef.getFreeDragPosition()}setFreeDragPosition(t){this._dragRef.setFreeDragPosition(t);}ngAfterViewInit(){Kf(()=>{this._updateRootElement(),this._setupHandlesListener(),this._dragRef.scale=this.scale,this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition);},{injector:this._injector});}ngOnChanges(t){let i=t.rootElementSelector,s=t.freeDragPosition;i&&!i.firstChange&&this._updateRootElement(),this._dragRef.scale=this.scale,s&&!s.firstChange&&this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition);}ngOnDestroy(){this.dropContainer&&this.dropContainer.removeItem(this),this._dragDropRegistry.removeDirectiveNode(this.element.nativeElement),this._ngZone.runOutsideAngular(()=>{this._handles.complete(),this._destroyed.next(),this._destroyed.complete(),this._dragRef.dispose();});}_addHandle(t){let i=this._handles.getValue();i.push(t),this._handles.next(i);}_removeHandle(t){let i=this._handles.getValue(),s=i.indexOf(t);s>-1&&(i.splice(s,1),this._handles.next(i));}_setPreviewTemplate(t){this._previewTemplate=t;}_resetPreviewTemplate(t){t===this._previewTemplate&&(this._previewTemplate=null);}_setPlaceholderTemplate(t){this._placeholderTemplate=t;}_resetPlaceholderTemplate(t){t===this._placeholderTemplate&&(this._placeholderTemplate=null);}_updateRootElement(){let t=this.element.nativeElement,i=t;this.rootElementSelector&&(i=t.closest!==void 0?t.closest(this.rootElementSelector):t.parentElement?.closest(this.rootElementSelector)),this._dragRef.withRootElement(i||t);}_getBoundaryElement(){let t=this.boundaryElement;return t?typeof t=="string"?this.element.nativeElement.closest(t):jt$1(t):null}_syncInputs(t){t.beforeStarted.subscribe(()=>{if(!t.isDragging()){let i=this._dir,s=this.dragStartDelay,n=this._placeholderTemplate?{template:this._placeholderTemplate.templateRef,context:this._placeholderTemplate.data,viewContainer:this._viewContainerRef}:null,o=this._previewTemplate?{template:this._previewTemplate.templateRef,context:this._previewTemplate.data,matchSize:this._previewTemplate.matchSize,viewContainer:this._viewContainerRef}:null;t.disabled=this.disabled,t.lockAxis=this.lockAxis,t.scale=this.scale,t.dragStartDelay=typeof s=="object"&&s?s:xt(s),t.constrainPosition=this.constrainPosition,t.previewClass=this.previewClass,t.withBoundaryElement(this._getBoundaryElement()).withPlaceholderTemplate(n).withPreviewTemplate(o).withPreviewContainer(this.previewContainer||"global"),i&&t.withDirection(i.value);}}),t.beforeStarted.pipe(yt$2(1)).subscribe(()=>{if(this._parentDrag){t.withParent(this._parentDrag._dragRef);return}let i=this.element.nativeElement.parentElement;for(;i;){let s=this._dragDropRegistry.getDragDirectiveForNode(i);if(s){t.withParent(s._dragRef);break}i=i.parentElement;}});}_handleEvents(t){t.started.subscribe(i=>{this.started.emit({source:this,event:i.event}),this._changeDetectorRef.markForCheck();}),t.released.subscribe(i=>{this.released.emit({source:this,event:i.event});}),t.ended.subscribe(i=>{this.ended.emit({source:this,distance:i.distance,dropPoint:i.dropPoint,event:i.event}),this._changeDetectorRef.markForCheck();}),t.entered.subscribe(i=>{this.entered.emit({container:i.container.data,item:this,currentIndex:i.currentIndex});}),t.exited.subscribe(i=>{this.exited.emit({container:i.container.data,item:this});}),t.dropped.subscribe(i=>{this.dropped.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,previousContainer:i.previousContainer.data,container:i.container.data,isPointerOverContainer:i.isPointerOverContainer,item:this,distance:i.distance,dropPoint:i.dropPoint,event:i.event});});}_assignDefaults(t){let{lockAxis:i,dragStartDelay:s,constrainPosition:n,previewClass:o,boundaryElement:a,draggingDisabled:l,rootElementSelector:h,previewContainer:c}=t;this.disabled=l??false,this.dragStartDelay=s||0,this.lockAxis=i||null,n&&(this.constrainPosition=n),o&&(this.previewClass=o),a&&(this.boundaryElement=a),h&&(this.rootElementSelector=h),c&&(this.previewContainer=c);}_setupHandlesListener(){this._handles.pipe(zl$1(t=>{let i=t.map(s=>s.element);this._selfHandle&&this.rootElementSelector&&i.push(this.element),this._dragRef.withHandles(i);}),Ml$1(t=>zg(...t.map(i=>i._stateChanges.pipe(Gl$1(i))))),im(this._destroyed)).subscribe(t=>{let i=this._dragRef,s=t.element.nativeElement;t.disabled?i.disableHandle(s):i.enableHandle(s);});}static \u0275fac=function(i){return new(i||r)};static \u0275dir=XE({type:r,selectors:[["","cdkDrag",""]],hostAttrs:[1,"cdk-drag"],hostVars:4,hostBindings:function(i,s){i&2&&Mh("cdk-drag-disabled",s.disabled)("cdk-drag-dragging",s._dragRef.isDragging());},inputs:{data:[0,"cdkDragData","data"],lockAxis:[0,"cdkDragLockAxis","lockAxis"],rootElementSelector:[0,"cdkDragRootElement","rootElementSelector"],boundaryElement:[0,"cdkDragBoundary","boundaryElement"],dragStartDelay:[0,"cdkDragStartDelay","dragStartDelay"],freeDragPosition:[0,"cdkDragFreeDragPosition","freeDragPosition"],disabled:[2,"cdkDragDisabled","disabled",Z0$1],constrainPosition:[0,"cdkDragConstrainPosition","constrainPosition"],previewClass:[0,"cdkDragPreviewClass","previewClass"],previewContainer:[0,"cdkDragPreviewContainer","previewContainer"],scale:[2,"cdkDragScale","scale",Y0$1]},outputs:{started:"cdkDragStarted",released:"cdkDragReleased",ended:"cdkDragEnded",entered:"cdkDragEntered",exited:"cdkDragExited",dropped:"cdkDragDropped",moved:"cdkDragMoved"},exportAs:["cdkDrag"],features:[Sw([{provide:lt,useExisting:r}]),ly]})}return r})(),Xt$1=new A$2("CdkDropListGroup");var Ue=(()=>{class r{element=C$2(_r$2);_changeDetectorRef=C$2(z0$1);_scrollDispatcher=C$2(U1);_dir=C$2(Le,{optional:true});_group=C$2(Xt$1,{optional:true,skipSelf:true});_latestSortedRefs;_destroyed=new re$2;_scrollableParentsResolved=false;static _dropLists=[];_dropListRef;connectedTo=[];data;orientation="vertical";id=C$2(K4).getId("cdk-drop-list-");lockAxis=null;get disabled(){return this._disabled||!!this._group&&this._group.disabled}set disabled(t){this._dropListRef.disabled=this._disabled=t;}_disabled=false;sortingDisabled=false;enterPredicate=()=>true;sortPredicate=()=>true;autoScrollDisabled=false;autoScrollStep;elementContainerSelector=null;hasAnchor=false;dropped=new Le$2;entered=new Le$2;exited=new Le$2;sorted=new Le$2;_unsortedItems=new Set;constructor(){let t=C$2(oe,{optional:true}),i=C$2(Ee$2);this._dropListRef=ie(i,this.element),this._dropListRef.data=this,t&&this._assignDefaults(t),this._dropListRef.enterPredicate=(s,n)=>this.enterPredicate(s.data,n.data),this._dropListRef.sortPredicate=(s,n,o)=>this.sortPredicate(s,n.data,o.data),this._setupInputSyncSubscription(this._dropListRef),this._handleEvents(this._dropListRef),r._dropLists.push(this),this._group&&this._group._items.add(this);}addItem(t){this._unsortedItems.add(t),t._dragRef._withDropContainer(this._dropListRef),this._dropListRef.isDragging()&&this._syncItemsWithRef(this.getSortedItems().map(i=>i._dragRef));}removeItem(t){if(this._unsortedItems.delete(t),this._latestSortedRefs){let i=this._latestSortedRefs.indexOf(t._dragRef);i>-1&&(this._latestSortedRefs.splice(i,1),this._syncItemsWithRef(this._latestSortedRefs));}}getSortedItems(){return Array.from(this._unsortedItems).sort((t,i)=>t._dragRef.getVisibleElement().compareDocumentPosition(i._dragRef.getVisibleElement())&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)}ngOnDestroy(){let t=r._dropLists.indexOf(this);t>-1&&r._dropLists.splice(t,1),this._group&&this._group._items.delete(this),this._latestSortedRefs=void 0,this._unsortedItems.clear(),this._dropListRef.dispose(),this._destroyed.next(),this._destroyed.complete();}_setupInputSyncSubscription(t){this._dir&&this._dir.change.pipe(Gl$1(this._dir.value),im(this._destroyed)).subscribe(i=>t.withDirection(i)),t.beforeStarted.subscribe(()=>{let i=u1(this.connectedTo).map(s=>{if(typeof s=="string"){let n=r._dropLists.find(o=>o.id===s);return n}return s});if(this._group&&this._group._items.forEach(s=>{i.indexOf(s)===-1&&i.push(s);}),!this._scrollableParentsResolved){let s=this._scrollDispatcher.getAncestorScrollContainers(this.element).map(n=>n.getElementRef().nativeElement);this._dropListRef.withScrollableParents(s),this._scrollableParentsResolved=true;}if(this.elementContainerSelector){let s=this.element.nativeElement.querySelector(this.elementContainerSelector);t.withElementContainer(s);}t.disabled=this.disabled,t.lockAxis=this.lockAxis,t.sortingDisabled=this.sortingDisabled,t.autoScrollDisabled=this.autoScrollDisabled,t.autoScrollStep=xt(this.autoScrollStep,2),t.hasAnchor=this.hasAnchor,t.connectedTo(i.filter(s=>s&&s!==this).map(s=>s._dropListRef)).withOrientation(this.orientation);});}_handleEvents(t){t.beforeStarted.subscribe(()=>{this._syncItemsWithRef(this.getSortedItems().map(i=>i._dragRef)),this._changeDetectorRef.markForCheck();}),t.entered.subscribe(i=>{this.entered.emit({container:this,item:i.item.data,currentIndex:i.currentIndex});}),t.exited.subscribe(i=>{this.exited.emit({container:this,item:i.item.data}),this._changeDetectorRef.markForCheck();}),t.sorted.subscribe(i=>{this.sorted.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,container:this,item:i.item.data});}),t.dropped.subscribe(i=>{this.dropped.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,previousContainer:i.previousContainer.data,container:i.container.data,item:i.item.data,isPointerOverContainer:i.isPointerOverContainer,distance:i.distance,dropPoint:i.dropPoint,event:i.event}),this._changeDetectorRef.markForCheck();}),zg(t.receivingStarted,t.receivingStopped).subscribe(()=>this._changeDetectorRef.markForCheck());}_assignDefaults(t){let{lockAxis:i,draggingDisabled:s,sortingDisabled:n,listAutoScrollDisabled:o,listOrientation:a}=t;this.disabled=s??false,this.sortingDisabled=n??false,this.autoScrollDisabled=o??false,this.orientation=a||"vertical",this.lockAxis=i||null;}_syncItemsWithRef(t){this._latestSortedRefs=t,this._dropListRef.withItems(t);}static \u0275fac=function(i){return new(i||r)};static \u0275dir=XE({type:r,selectors:[["","cdkDropList",""],["cdk-drop-list"]],hostAttrs:[1,"cdk-drop-list"],hostVars:7,hostBindings:function(i,s){i&2&&(ah("id",s.id),Mh("cdk-drop-list-disabled",s.disabled)("cdk-drop-list-dragging",s._dropListRef.isDragging())("cdk-drop-list-receiving",s._dropListRef.isReceiving()));},inputs:{connectedTo:[0,"cdkDropListConnectedTo","connectedTo"],data:[0,"cdkDropListData","data"],orientation:[0,"cdkDropListOrientation","orientation"],id:"id",lockAxis:[0,"cdkDropListLockAxis","lockAxis"],disabled:[2,"cdkDropListDisabled","disabled",Z0$1],sortingDisabled:[2,"cdkDropListSortingDisabled","sortingDisabled",Z0$1],enterPredicate:[0,"cdkDropListEnterPredicate","enterPredicate"],sortPredicate:[0,"cdkDropListSortPredicate","sortPredicate"],autoScrollDisabled:[2,"cdkDropListAutoScrollDisabled","autoScrollDisabled",Z0$1],autoScrollStep:[0,"cdkDropListAutoScrollStep","autoScrollStep"],elementContainerSelector:[0,"cdkDropListElementContainer","elementContainerSelector"],hasAnchor:[2,"cdkDropListHasAnchor","hasAnchor",Z0$1]},outputs:{dropped:"cdkDropListDropped",entered:"cdkDropListEntered",exited:"cdkDropListExited",sorted:"cdkDropListSorted"},exportAs:["cdkDropList"],features:[Sw([{provide:Xt$1,useValue:void 0},{provide:ae,useExisting:r}])]})}return r})();var Ze=(()=>{class r{static \u0275fac=function(i){return new(i||r)};static \u0275mod=YE({type:r});static \u0275inj=uu$1({providers:[be],imports:[tn$1]})}return r})();var $=(()=>{class r{constructor(){this.http=C$2(Zi$1),this.baseUrl=`${a.apiBaseUrl}/jobs`;}list(t){return this.http.get(this.baseUrl,{params:u$1(t)}).pipe(E())}get(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}`).pipe(E())}start(t){return this.http.post(this.baseUrl,t).pipe(E())}latestBySubject(t,s){return this.http.post(`${this.baseUrl}/latest-by-subject`,{workflowId:t,subjectIds:s}).pipe(E())}resume(t,s){return this.http.post(`${this.baseUrl}/${encodeURIComponent(t)}/resume`,{response:s}).pipe(E())}retry(t){return this.http.post(`${this.baseUrl}/${encodeURIComponent(t)}/retry`,{}).pipe(E())}retryStep(t){return this.http.post(`${this.baseUrl}/${encodeURIComponent(t)}/retry-step`,{}).pipe(E())}cancel(t){return this.http.post(`${this.baseUrl}/${encodeURIComponent(t)}/cancel`,{}).pipe(E())}deleteWorktrees(t){return this.http.post(`${this.baseUrl}/delete-worktrees`,{jobIds:t}).pipe(E())}static{this.\u0275fac=function(s){return new(s||r)};}static{this.\u0275prov=ie$2({token:r,factory:r.\u0275fac,providedIn:"root"});}}return r})();function Dt(t,i){if(t&1&&(_i$2(0,"p",3),vw(1),Kc$1()),t&2){let e=i.$implicit,o=VD(2).$index,n=VD(2);Mh("current",e===n.countArray[o]),gI(),nl$1(" ",e," ");}}function Ot(t,i){if(t&1&&ND(0,Dt,2,3,"p",2,SD),t&2){let e=VD(3);xD(e.countSingleArray);}}function At(t,i){if(t&1&&(_i$2(0,"span",1),bD(1,Ot,2,0),Kc$1()),t&2){let e=i.$index,o=VD(2);_h("transform","translateY("+-o.countArray[e]*100+"%)"),ch("nzNoAnimation",!!o.noAnimation?.nzNoAnimation?.()),gI(),_D(!o.nzDot&&o.countArray[e]!==void 0?1:-1);}}function Tt(t,i){if(t&1&&ND(0,At,2,4,"span",0,SD),t&2){let e=VD();xD(e.maxNumberArray);}}function Nt(t,i){if(t&1&&vw(0),t&2){let e=VD();nl$1(" ",e.nzOverflowCount,"+ ");}}var mt=["*"];function kt(t,i){if(t&1&&(el$1(0),vw(1),tl$1()),t&2){let e=VD(2);gI(),Ph(e.nzText);}}function Pt(t,i){if(t&1&&(lh(0,"span",1),_i$2(1,"span",2),nh(2,kt,2,1,"ng-container",0),Kc$1()),t&2){let e=VD();sw(e.mergedStyle),cw((e.nzStatus||e.presetColor)&&"ant-badge-status-"+(e.nzStatus||e.presetColor)),gI(2),ch("nzStringTemplateOutlet",e.nzText);}}function Et(t,i){if(t&1){let e=LD();_i$2(0,"nz-badge-sup",3),oi(function(){Pu$1(e);let n=VD(2);return Lu$1(n.supAnimationLeave())}),ri$1(function(){Pu$1(e);let n=VD(2);return Lu$1(n.supAnimationEnter())}),Kc$1();}if(t&2){let e=VD(2);ch("isPresetColor",e.nzStatus||e.presetColor)("nzColor",e.nzStatus||e.presetColor||e.nzColor)("nzOffset",e.nzOffset)("nzSize",e.nzSize)("nzTitle",e.nzTitle)("nzStyle",e.mergedStyle)("nzDot",e.nzDot)("nzCount",e.nzCount)("nzOverflowCount",e.nzOverflowCount);}}function Lt(t,i){if(t&1&&(el$1(0),bD(1,Et,1,9,"nz-badge-sup",3),tl$1()),t&2){let e=VD();gI(),_D(e.showSup?1:-1);}}function It(t,i){if(t&1&&(el$1(0),_i$2(1,"span",3),vw(2),Kc$1(),tl$1()),t&2){let e=VD();gI(2),Ph(e.nzText);}}var Bt=(()=>{class t{noAnimation=C$2(t4,{host:true,optional:true});nzOffset;nzTitle;nzStyle=null;nzDot=false;nzOverflowCount=99;nzCount;nzSize="default";isPresetColor=false;nzColor;maxNumberArray=[];countArray=[];count=0;countSingleArray=[0,1,2,3,4,5,6,7,8,9];generateMaxNumberArray(){this.maxNumberArray=this.nzOverflowCount.toString().split("").map((e,o)=>`${e}-${o}`);}ngOnInit(){this.generateMaxNumberArray();}ngOnChanges(e){let{nzOverflowCount:o,nzCount:n}=e;n&&typeof n.currentValue=="number"&&(this.count=Math.max(0,n.currentValue),this.countArray=this.count.toString().split("").map(a=>+a)),o&&this.generateMaxNumberArray();}static \u0275fac=function(o){return new(o||t)};static \u0275cmp=QE({type:t,selectors:[["nz-badge-sup"]],hostAttrs:[1,"ant-scroll-number"],hostVars:17,hostBindings:function(o,n){o&2&&(ah("title",n.nzTitle===null?"":n.nzTitle||n.nzCount),sw(n.nzStyle),cw(n.isPresetColor?"ant-badge-status-"+n.nzColor:""),_h("right",n.nzOffset&&n.nzOffset[0]?-n.nzOffset[0]:null,"px")("margin-top",n.nzOffset&&n.nzOffset[1]?n.nzOffset[1]:null,"px"),Mh("ant-badge-count",!n.nzDot)("ant-badge-count-sm",n.nzSize==="small")("ant-badge-dot",n.nzDot)("ant-badge-multiple-words",n.countArray.length>=2));},inputs:{nzOffset:"nzOffset",nzTitle:"nzTitle",nzStyle:"nzStyle",nzDot:"nzDot",nzOverflowCount:[2,"nzOverflowCount","nzOverflowCount",Y0$1],nzCount:"nzCount",nzSize:"nzSize",isPresetColor:[2,"isPresetColor","isPresetColor",Z0$1],nzColor:"nzColor"},exportAs:["nzBadgeSup"],features:[ly],decls:2,vars:1,consts:[[1,"ant-scroll-number-only",3,"nzNoAnimation","transform"],[1,"ant-scroll-number-only",3,"nzNoAnimation"],[1,"ant-scroll-number-only-unit",3,"current"],[1,"ant-scroll-number-only-unit"]],template:function(o,n){o&1&&bD(0,Tt,2,0)(1,Nt,1,1),o&2&&_D(n.count<=n.nzOverflowCount?0:1);},dependencies:[t4],encapsulation:2})}return t})(),ut=["pink","red","yellow","orange","cyan","green","blue","purple","geekblue","magenta","volcano","gold","lime"],Ft="badge",fe=(()=>{let t,i=[],e=[],o,n=[],a=[];return class he{static{let C=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;t=[ut$1()],o=[ut$1()],pT(null,null,t,{kind:"field",name:"nzOverflowCount",static:false,private:false,access:{has:c=>"nzOverflowCount"in c,get:c=>c.nzOverflowCount,set:(c,m)=>{c.nzOverflowCount=m;}},metadata:C},i,e),pT(null,null,o,{kind:"field",name:"nzColor",static:false,private:false,access:{has:c=>"nzColor"in c,get:c=>c.nzColor,set:(c,m)=>{c.nzColor=m;}},metadata:C},n,a),C&&Object.defineProperty(this,Symbol.metadata,{enumerable:true,configurable:true,writable:true,value:C});}dir=C$2(Le).valueSignal;_nzModuleName=Ft;showSup=false;supAnimationEnter=s0(()=>"ant-badge-zoom-enter");supAnimationLeave=s0(()=>"ant-badge-zoom-leave");presetColor=null;nzShowZero=false;nzShowDot=true;nzStandalone=false;nzDot=false;nzOverflowCount=hT(this,i,99);nzColor=(hT(this,e),hT(this,n,void 0));nzStyle=(hT(this,a),null);nzText=null;nzTitle;nzStatus;nzCount;nzOffset;nzSize="default";get mergedStyle(){return r({backgroundColor:!this.presetColor&&this.nzColor},this.nzStyle??{})}ngOnChanges(C){let{nzColor:c,nzShowDot:m,nzDot:St,nzCount:xt,nzShowZero:Mt}=C;c&&(this.presetColor=this.nzColor&&ut.indexOf(this.nzColor)!==-1?this.nzColor:null),(m||St||xt||Mt)&&(this.showSup=this.nzShowDot&&this.nzDot||typeof this.nzCount=="number"&&(this.nzCount>0||this.nzShowZero));}static \u0275fac=function(c){return new(c||he)};static \u0275cmp=QE({type:he,selectors:[["nz-badge"]],hostAttrs:[1,"ant-badge"],hostVars:6,hostBindings:function(c,m){c&2&&Mh("ant-badge-status",m.nzStatus)("ant-badge-not-a-wrapper",!!(m.nzStandalone||(m.nzStatus||m.nzColor)&&!m.showSup&&!m.nzCount))("ant-badge-rtl",m.dir()==="rtl");},inputs:{nzShowZero:[2,"nzShowZero","nzShowZero",Z0$1],nzShowDot:[2,"nzShowDot","nzShowDot",Z0$1],nzStandalone:[2,"nzStandalone","nzStandalone",Z0$1],nzDot:[2,"nzDot","nzDot",Z0$1],nzOverflowCount:"nzOverflowCount",nzColor:"nzColor",nzStyle:"nzStyle",nzText:"nzText",nzTitle:"nzTitle",nzStatus:"nzStatus",nzCount:"nzCount",nzOffset:"nzOffset",nzSize:"nzSize"},exportAs:["nzBadge"],features:[ly],ngContentSelectors:mt,decls:3,vars:2,consts:[[4,"nzStringTemplateOutlet"],[1,"ant-badge-status-dot"],[1,"ant-badge-status-text"],[3,"isPresetColor","nzColor","nzOffset","nzSize","nzTitle","nzStyle","nzDot","nzCount","nzOverflowCount"]],template:function(c,m){c&1&&(BD(),bD(0,Pt,3,5),$D(1),nh(2,Lt,2,1,"ng-container",0)),c&2&&(_D((m.nzStatus||m.nzColor)&&!m.showSup&&!m.nzCount?0:-1),gI(2),ch("nzStringTemplateOutlet",m.nzCount));},dependencies:[Bt,Tt$1,Ie],encapsulation:2})}})(),Rt=(()=>{class t{nzColor;nzPlacement="end";nzText=null;presetColor=null;ngOnChanges(e){let{nzColor:o}=e;o&&(this.presetColor=this.nzColor&&ut.indexOf(this.nzColor)!==-1?this.nzColor:null);}static \u0275fac=function(o){return new(o||t)};static \u0275cmp=QE({type:t,selectors:[["nz-ribbon"]],hostAttrs:[1,"ant-ribbon-wrapper"],inputs:{nzColor:"nzColor",nzPlacement:"nzPlacement",nzText:"nzText"},exportAs:["nzRibbon"],features:[ly],ngContentSelectors:mt,decls:4,vars:11,consts:[[1,"ant-ribbon"],[4,"nzStringTemplateOutlet"],[1,"ant-ribbon-corner"],[1,"ant-ribbon-text"]],template:function(o,n){o&1&&(BD(),$D(0),_i$2(1,"div",0),nh(2,It,3,1,"ng-container",1),lh(3,"div",2),Kc$1()),o&2&&(gI(),cw(n.presetColor&&"ant-ribbon-color-"+n.presetColor),_h("background-color",!n.presetColor&&n.nzColor),Mh("ant-ribbon-placement-end",n.nzPlacement==="end")("ant-ribbon-placement-start",n.nzPlacement==="start"),gI(),ch("nzStringTemplateOutlet",n.nzText),gI(),_h("color",!n.presetColor&&n.nzColor));},dependencies:[Tt$1,Ie],encapsulation:2})}return t})(),gt=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275mod=YE({type:t});static \u0275inj=uu$1({imports:[fe,Rt]})}return t})();var Vt=["ticket","pull_request","documentation"],Jt={ticket:"shell.group.tickets",pull_request:"shell.group.pullRequests",documentation:"shell.group.documentation"};function $t(t,i){return Jt[t]}function ht(t,i){let e=new Map;for(let o of t){let n=e.get(o.subjectType)??[];n.push(o),e.set(o.subjectType,n);}return Vt.flatMap(o=>{let n=e.get(o);return n?.length?[{subjectType:o,labelKey:$t(o),views:[...n].sort((a,h)=>a.order-h.order)}]:[]})}var Zt=t=>["/views",t],qt=(t,i)=>i.subjectType,ft=(t,i)=>i.id;function Ht(t,i){t&1&&(_i$2(0,"section",3)(1,"h2"),vw(2),Rw(3,"transloco"),Kc$1(),_i$2(4,"p"),vw(5),Rw(6,"transloco"),Kc$1(),_i$2(7,"a",4),vw(8),Rw(9,"transloco"),Kc$1()()),t&2&&(gI(2),Ph(Ow(3,3,"shell.empty.title")),gI(3),Ph(Ow(6,5,"shell.empty.body")),gI(3),nl$1(" ",Ow(9,7,"shell.empty.settingsLink")," "));}function Yt(t,i){if(t&1&&(_i$2(0,"p",5),vw(1),Kc$1()),t&2){let e=VD(2);gI(),Ph(e.reorderError());}}function Gt(t,i){if(t&1&&(_i$2(0,"li",10)(1,"a",11),vw(2),Kc$1()()),t&2){let e=i.$implicit;ah("data-testid","sidebar-view-"+e.id),gI(),ch("routerLink",xw(4,Zt,e.id)),ah("data-testid","sidebar-link-"+e.id),gI(),nl$1(" ",e.name," ");}}function Kt(t,i){if(t&1){let e=LD();_i$2(0,"section",6)(1,"h2",8),vw(2),Rw(3,"transloco"),Kc$1(),_i$2(4,"ul",9),gh("cdkDropListDropped",function(n){let a=Pu$1(e).$implicit,h=VD(2);return Lu$1(h.drop(a,n))}),ND(5,Gt,3,6,"li",10,ft),Kc$1()();}if(t&2){let e=i.$implicit,o=VD(2);ah("data-testid","sidebar-group-"+e.subjectType),gI(2),Ph(Ow(3,5,e.labelKey)),gI(2),ch("cdkDropListData",e.views)("cdkDropListDisabled",o.reordering()),ah("data-testid","sidebar-drop-"+e.subjectType),gI(),xD(e.views);}}function Xt(t,i){if(t&1&&(_i$2(0,"li",10)(1,"a",13),vw(2),Kc$1()()),t&2){let e=i.$implicit;ah("data-testid","sidebar-shortcut-"+e.id),gI(),ah("data-testid","sidebar-shortcut-link-"+e.id),gI(),nl$1(" ",e.name," ");}}function Qt(t,i){if(t&1){let e=LD();_i$2(0,"section",7)(1,"h2",8),vw(2),Rw(3,"transloco"),Kc$1(),_i$2(4,"ul",12),gh("cdkDropListDropped",function(n){Pu$1(e);let a=VD(2);return Lu$1(a.dropShortcut(n))}),ND(5,Xt,3,3,"li",10,ft),Kc$1()();}if(t&2){let e=VD(2);gI(2),Ph(Ow(3,3,"shell.shortcuts")),gI(2),ch("cdkDropListData",e.shortcuts())("cdkDropListDisabled",e.reordering()),gI(),xD(e.shortcuts());}}function en(t,i){if(t&1&&(bD(0,Yt,2,1,"p",5),ND(1,Kt,7,7,"section",6,qt),bD(3,Qt,7,5,"section",7)),t&2){let e=VD();_D(e.reorderError()?0:-1),gI(),xD(e.groups()),gI(2),_D(e.shortcuts().length>0?3:-1);}}var Ct=(()=>{class t{constructor(){this.viewsApi=C$2(U),this.shortcutsApi=C$2(u),this.destroyRef=C$2(at$1),this.groups=$0$1.required(),this.shortcuts=$0$1([]),this.empty=$0$1(false),this.viewsChanged=B0$1(),this.shortcutsChanged=B0$1(),this.reorderError=qo$2(null),this.reordering=qo$2(false);}drop(e,o){if(o.previousIndex===o.currentIndex)return;let n=[...e.views];te(n,o.previousIndex,o.currentIndex),this.reorderError.set(null),this.reordering.set(true),this.viewsApi.reorder(n.map(a=>a.id)).pipe(ue$1(this.destroyRef)).subscribe({next:()=>{this.reordering.set(false),this.viewsChanged.emit();},error:a=>{this.reordering.set(false),this.reorderError.set(a instanceof Error?a.message:"Failed to reorder views");}});}dropShortcut(e){if(e.previousIndex===e.currentIndex)return;let o=[...this.shortcuts()];te(o,e.previousIndex,e.currentIndex),this.reorderError.set(null),this.reordering.set(true),this.shortcutsApi.reorder(o.map(n=>n.id)).pipe(ue$1(this.destroyRef)).subscribe({next:()=>{this.reordering.set(false),this.shortcutsChanged.emit();},error:n=>{this.reordering.set(false),this.reorderError.set(n instanceof Error?n.message:"Failed to reorder shortcuts");}});}static{this.\u0275fac=function(o){return new(o||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-sidebar"]],inputs:{groups:[1,"groups"],shortcuts:[1,"shortcuts"],empty:[1,"empty"]},outputs:{viewsChanged:"viewsChanged",shortcutsChanged:"shortcutsChanged"},decls:6,vars:1,consts:[["data-testid","app-sidebar",1,"sidebar"],["data-testid","app-brand",1,"brand"],[1,"sidebar-body"],["data-testid","sidebar-empty",1,"empty"],["nz-button","","nzType","primary","routerLink","/settings","data-testid","sidebar-empty-settings"],["data-testid","sidebar-reorder-error",1,"error"],[1,"group"],["data-testid","sidebar-group-shortcuts",1,"group"],[1,"group-title"],["cdkDropList","",1,"view-list",3,"cdkDropListDropped","cdkDropListData","cdkDropListDisabled"],["cdkDrag","",1,"view-item"],["routerLinkActive","active",3,"routerLink"],["cdkDropList","","data-testid","sidebar-drop-shortcuts",1,"view-list",3,"cdkDropListDropped","cdkDropListData","cdkDropListDisabled"],["routerLink","/shortcuts","routerLinkActive","active"]],template:function(o,n){o&1&&(_i$2(0,"aside",0)(1,"div",1),vw(2,"knoflows"),Kc$1(),_i$2(3,"div",2),bD(4,Ht,10,9,"section",3)(5,en,4,2),Kc$1()()),o&2&&(gI(4),_D(n.empty()?4:5));},dependencies:[Mi$1,Ze,Ue,We,Ln,Mu,dd,zc,t7,Kt$3],styles:[".sidebar[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:15rem;height:100vh;flex-shrink:0;border-right:1px solid #d6d3d1;background:#ffffffb8;overflow:hidden}.brand[_ngcontent-%COMP%]{flex-shrink:0;padding:.85rem 1rem;font-size:1.1rem;font-weight:700;letter-spacing:.02em;border-bottom:1px solid #d6d3d1}.sidebar-body[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;padding:1rem .75rem 1.5rem}.group[_ngcontent-%COMP%] + .group[_ngcontent-%COMP%]{margin-top:1.25rem}.group-title[_ngcontent-%COMP%]{margin:0 0 .5rem;padding:0 .35rem;font-size:.75rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:#78716c}.view-list[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0}.view-item[_ngcontent-%COMP%]{margin:.15rem 0;border-radius:.35rem;cursor:grab}.view-item.cdk-drag-disabled[_ngcontent-%COMP%]{cursor:default}.view-item[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{display:block;padding:.45rem .5rem;color:#44403c;text-decoration:none;border-radius:.35rem}.view-item[_ngcontent-%COMP%] a.active[_ngcontent-%COMP%], .view-item[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{background:#f5f5f4;color:#0c0a09}.view-item[_ngcontent-%COMP%] a.active[_ngcontent-%COMP%]{font-weight:600}.empty[_ngcontent-%COMP%]{padding:.5rem .35rem}.empty[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem}.empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 1rem;color:#57534e;font-size:.92rem;line-height:1.45}.error[_ngcontent-%COMP%]{margin:0 0 .75rem;padding:0 .35rem;color:#9f1239;font-size:.85rem}.cdk-drag-preview[_ngcontent-%COMP%]{box-shadow:0 4px 12px #0000001f;background:#fff;border-radius:.35rem}.cdk-drag-placeholder[_ngcontent-%COMP%]{opacity:0}"]});}}return t})();var tn=()=>({status:"waiting_for_human"}),nn=3e4,on=500,zt=(()=>{class t{constructor(){this.viewsApi=C$2(U),this.shortcutsApi=C$2(u),this.settingsApi=C$2($$1),this.jobsApi=C$2($),this.destroyRef=C$2(at$1),this.language=C$2(O),this.views=qo$2([]),this.shortcuts=qo$2([]),this.settings=qo$2(null),this.waitingJobsCount=qo$2(0),this.groups=Hw(()=>ht(this.views(),this.settings())),this.sidebarEmpty=Hw(()=>this.views().length===0&&this.shortcuts().length===0),this.loadViews(),this.loadShortcuts(),this.loadSettings(),this.pollWaitingJobs();}onLanguageChange(e){this.language.setLanguage(e);}reloadViews(){this.loadViews();}reloadShortcuts(){this.loadShortcuts();}loadViews(){this.viewsApi.list().pipe(ue$1(this.destroyRef)).subscribe({next:e=>this.views.set(e),error:()=>this.views.set([])});}loadShortcuts(){this.shortcutsApi.list().pipe(ue$1(this.destroyRef)).subscribe({next:e=>this.shortcuts.set(e),error:()=>this.shortcuts.set([])});}loadSettings(){this.settingsApi.getSettings().pipe(ue$1(this.destroyRef)).subscribe({next:e=>this.settings.set(e),error:()=>this.settings.set(null)});}pollWaitingJobs(){Gg(nn).pipe(Gl$1(0),Ml$1(()=>this.jobsApi.list({status:"waiting_for_human",topLevelOnly:false,limit:on,offset:0})),ue$1(this.destroyRef)).subscribe({next:e=>this.waitingJobsCount.set(e.length),error:()=>this.waitingJobsCount.set(0)});}static{this.\u0275fac=function(o){return new(o||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-shell"]],decls:22,vars:17,consts:[["data-testid","app-shell",1,"app-shell"],[3,"viewsChanged","shortcutsChanged","groups","shortcuts","empty"],[1,"main"],["data-testid","app-top-bar",1,"top-bar"],[1,"top-actions"],["routerLink","/jobs","data-testid","jobs-waiting-badge",1,"jobs-badge",3,"queryParams"],[3,"nzCount","nzOverflowCount"],["nz-button","","nzType","link","routerLink","/manage","routerLinkActive","active","data-testid","manage-link"],[1,"lang"],["data-testid","language-select",3,"ngModelChange","ngModel"],["nzValue","en","nzLabel","English"],["nzValue","es","nzLabel","Espa\xF1ol"],[1,"content"]],template:function(o,n){o&1&&(_i$2(0,"div",0)(1,"app-sidebar",1),gh("viewsChanged",function(){return n.reloadViews()})("shortcutsChanged",function(){return n.reloadShortcuts()}),Kc$1(),_i$2(2,"div",2)(3,"header",3)(4,"div",4)(5,"a",5)(6,"nz-badge",6)(7,"span"),vw(8),Rw(9,"transloco"),Kc$1()()(),_i$2(10,"a",7),vw(11),Rw(12,"transloco"),Kc$1(),_i$2(13,"label",8)(14,"span"),vw(15),Rw(16,"transloco"),Kc$1(),_i$2(17,"nz-select",9),gh("ngModelChange",function(h){return n.onLanguageChange(h)}),lh(18,"nz-option",10)(19,"nz-option",11),Kc$1(),oE(),Kc$1()()(),_i$2(20,"div",12),lh(21,"router-outlet"),Kc$1()()()),o&2&&(gI(),ch("groups",n.groups())("shortcuts",n.shortcuts())("empty",n.sidebarEmpty()),gI(4),ch("queryParams",Nw(16,tn)),gI(),ch("nzCount",n.waitingJobsCount())("nzOverflowCount",99),gI(2),Ph(Ow(9,10,"shell.jobs")),gI(3),nl$1(" ",Ow(12,12,"shell.manage")," "),gI(4),Ph(Ow(16,14,"nav.language")),gI(2),ch("ngModel",n.language.currentLang()),sE());},dependencies:[Mi$1,n8,J6,k3,Lr$1,Ln,Mu,gt,fe,dd,zc,t7,Xb,V5,D5,Ct,Kt$3],styles:[".app-shell[_ngcontent-%COMP%]{display:flex;min-height:100vh;background:linear-gradient(180deg,#fafaf9,#f5f5f4);color:#1c1917}.main[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;flex-direction:column}.top-bar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:1rem;padding:.75rem 1.25rem;border-bottom:1px solid #d6d3d1;background:#ffffffd9}.top-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.65rem}.jobs-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;padding:.35rem .5rem;color:#44403c;text-decoration:none;border-radius:.35rem}.jobs-badge[_ngcontent-%COMP%]:hover{background:#f5f5f4}.lang[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;font-size:.9rem;color:#57534e}.content[_ngcontent-%COMP%]{flex:1;min-height:0}[_nghost-%COMP%] .top-actions a.active{font-weight:600}"]});}}return t})();var _t=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-root"]],decls:1,vars:0,template:function(o,n){o&1&&lh(0,"app-shell");},dependencies:[zt],encapsulation:2});}}return t})();var rn="@",an=(()=>{class t{doc;delegate;zone;animationType;moduleImpl;_rendererFactoryPromise=null;scheduler=null;injector=C$2(Ee$2);loadingSchedulerFn=C$2(sn,{optional:true});_engine;constructor(e,o,n,a,h){this.doc=e,this.delegate=o,this.zone=n,this.animationType=a,this.moduleImpl=h;}ngOnDestroy(){this._engine?.flush();}loadImpl(){let e=()=>this.moduleImpl??import('./chunk-qwukwlIj.js').then(n=>n),o;return this.loadingSchedulerFn?o=this.loadingSchedulerFn(e):o=e(),o.catch(n=>{throw new _$1(5300,false)}).then(({\u0275createEngine:n,\u0275AnimationRendererFactory:a})=>{this._engine=n(this.animationType,this.doc);let h=new a(this.delegate,this._engine,this.zone);return this.delegate=h,h})}createRenderer(e,o){let n=this.delegate.createRenderer(e,o);if(n.\u0275type===0)return n;typeof n.throwOnSyntheticProps=="boolean"&&(n.throwOnSyntheticProps=false);let a=new Ce(n);return o?.data?.animation&&!this._rendererFactoryPromise&&(this._rendererFactoryPromise=this.loadImpl()),this._rendererFactoryPromise?.then(h=>{let C=h.createRenderer(e,o);a.use(C),this.scheduler??=this.injector.get(He$3,null,{optional:true}),this.scheduler?.notify(10);}).catch(h=>{a.use(n);}),a}begin(){this.delegate.begin?.();}end(){this.delegate.end?.();}whenRenderingDone(){return this.delegate.whenRenderingDone?.()??Promise.resolve()}componentReplaced(e){this._engine?.flush(),this.delegate.componentReplaced?.(e);}static \u0275fac=function(o){fE();};static \u0275prov=ie$2({token:t,factory:t.\u0275fac})}return t})(),Ce=class{delegate;replay=[];\u0275type=1;constructor(i){this.delegate=i;}use(i){if(this.delegate=i,this.replay!==null){for(let e of this.replay)e(i);this.replay=null;}}get data(){return this.delegate.data}destroy(){this.replay=null,this.delegate.destroy();}createElement(i,e){return this.delegate.createElement(i,e)}createComment(i){return this.delegate.createComment(i)}createText(i){return this.delegate.createText(i)}get destroyNode(){return this.delegate.destroyNode}appendChild(i,e){this.delegate.appendChild(i,e);}insertBefore(i,e,o,n){this.delegate.insertBefore(i,e,o,n);}removeChild(i,e,o,n){this.delegate.removeChild(i,e,o,n);}selectRootElement(i,e){return this.delegate.selectRootElement(i,e)}parentNode(i){return this.delegate.parentNode(i)}nextSibling(i){return this.delegate.nextSibling(i)}setAttribute(i,e,o,n){this.delegate.setAttribute(i,e,o,n);}removeAttribute(i,e,o){this.delegate.removeAttribute(i,e,o);}addClass(i,e){this.delegate.addClass(i,e);}removeClass(i,e){this.delegate.removeClass(i,e);}setStyle(i,e,o,n){this.delegate.setStyle(i,e,o,n);}removeStyle(i,e,o){this.delegate.removeStyle(i,e,o);}setProperty(i,e,o){this.shouldReplay(e)&&this.replay.push(n=>n.setProperty(i,e,o)),this.delegate.setProperty(i,e,o);}setValue(i,e){this.delegate.setValue(i,e);}listen(i,e,o,n){return this.shouldReplay(e)&&this.replay.push(a=>a.listen(i,e,o,n)),this.delegate.listen(i,e,o,n)}shouldReplay(i){return this.replay!==null&&i.startsWith(rn)}},sn=new A$2("");function bt(t="animations"){return ce("NgAsyncAnimations"),Eu$1([{provide:Dr$2,useFactory:()=>new an(C$2(Uo$2),C$2(or$1),C$2(oe$2),t)},{provide:Gm,useValue:t==="noop"?"NoopAnimations":"BrowserAnimations"}])}var vt=(()=>{class t{constructor(){this.http=C$2(Zi$1);}getTranslation(e){return this.http.get(`./assets/i18n/${e}.json`)}static{this.\u0275fac=function(o){return new(o||t)};}static{this.\u0275prov=ie$2({token:t,factory:t.\u0275fac,providedIn:"root"});}}return t})();var yt=[{path:"",pathMatch:"full",redirectTo:"jobs"},{path:"jobs",pathMatch:"full",loadComponent:()=>import('./chunk-Crj-4pl_.js').then(t=>t.JobListComponent)},{path:"jobs/new",loadComponent:()=>import('./chunk-BLVF0pVH.js').then(t=>t.JobRunnerComponent)},{path:"jobs/:id",loadComponent:()=>import('./chunk-03U2wfYJ.js').then(t=>t.JobDetailComponent)},{path:"batches/:id",loadComponent:()=>import('./chunk-DU6MKU0d.js').then(t=>t.BatchDetailComponent)},{path:"manage",loadComponent:()=>import('./chunk-IOVwMLns.js').then(t=>t.ManageShellComponent),children:[{path:"",pathMatch:"full",redirectTo:"workflows"},{path:"workflows",loadComponent:()=>import('./chunk-vPa4eOmU.js').then(t=>t.WorkflowsManageComponent)},{path:"views",loadComponent:()=>import('./chunk-DGHakffX.js').then(t=>t.ViewsAndShortcutsManageComponent)},{path:"providers",loadComponent:()=>import('./chunk-CAjGF9LB.js').then(t=>t.ProvidersManageComponent)},{path:"context-files",loadComponent:()=>import('./chunk-DIakbH9x.js').then(t=>t.ContextFilesManageComponent)},{path:"local-repositories",loadComponent:()=>import('./chunk-CxICQyU8.js').then(t=>t.LocalRepositoriesManageComponent)},{path:"worktrees",loadComponent:()=>import('./chunk-Bvpl_AF9.js').then(t=>t.WorktreesManageComponent)},{path:"preferences",loadComponent:()=>import('./chunk-hKpVm95g.js').then(t=>t.PreferencesManageComponent)}]},{path:"workflows",pathMatch:"full",redirectTo:"/manage/workflows"},{path:"workflows/new",loadComponent:()=>import('./chunk-CUsAuTTX.js').then(t=>t.WorkflowEditorComponent)},{path:"workflows/:id/edit",loadComponent:()=>import('./chunk-CUsAuTTX.js').then(t=>t.WorkflowEditorComponent)},{path:"views",pathMatch:"full",redirectTo:"/manage/views"},{path:"views/new",loadComponent:()=>import('./chunk-Cw0wBuEr.js').then(t=>t.ViewEditorComponent)},{path:"views/:id/edit",loadComponent:()=>import('./chunk-Cw0wBuEr.js').then(t=>t.ViewEditorComponent)},{path:"views/:id",loadComponent:()=>import('./chunk-NAyA7aWR.js').then(t=>t.ViewDetailComponent)},{path:"shortcuts",loadComponent:()=>import('./chunk-DwA32gts.js').then(t=>t.ShortcutListComponent)},{path:"shortcuts/new",loadComponent:()=>import('./chunk-6rAx_awr.js').then(t=>t.ShortcutEditorComponent)},{path:"shortcuts/:id/edit",loadComponent:()=>import('./chunk-6rAx_awr.js').then(t=>t.ShortcutEditorComponent)},{path:"settings",pathMatch:"full",redirectTo:"/manage/providers"}];var wt={providers:[Fu$1(yt),Ys$1(),bt(),qy(Il),Ey(),Ht$2({config:{availableLangs:["en","es"],defaultLang:"en",fallbackLang:"en",reRenderOnLangChange:true,prodMode:true},loader:vt})]};Ss$1(_t,wt).catch(t=>console.error(t));export{$,xD as A,_D as B,C$2 as C,D5 as D,VD as E,LD as F,Pu$1 as G,Hw as H,Lu$1 as I,J6 as J,Kt$3 as K,Ln as L,Mi$1 as M,ND as N,Ow as O,Ph as P,QE as Q,Rw as R,SD as S,Ie$2 as T,Lh as U,Ve as V,rd as W,Xb as X,Bw as Y,y7 as Z,_$1 as _,ae$1 as a,za as a$,$0$1 as a0,B0$1 as a1,Pw as a2,xw as a3,Mh as a4,ah as a5,Nw as a6,MD as a7,a as a8,Ng as a9,pt as aA,Se as aB,Tt$1 as aC,Ie as aD,ly as aE,Z0$1 as aF,Sw as aG,h1 as aH,wo$2 as aI,Ih as aJ,qD as aK,WD as aL,ut$1 as aM,nh as aN,el$1 as aO,tl$1 as aP,Jc$1 as aQ,Xc$1 as aR,O as aS,de$1 as aT,$6 as aU,Y0$1 as aV,N1 as aW,q0$1 as aX,Ee$2 as aY,ga as aZ,j3 as a_,Xi$2 as aa,Dg as ab,Lr$1 as ac,Mu as ad,Zi$1 as ae,E as af,_h as ag,U as ah,u as ai,$$1 as aj,Ml$1 as ak,Se$3 as al,S4 as am,YE as an,uu$1 as ao,pT as ap,kt$1 as aq,_r$2 as ar,oe$2 as as,z0$1 as at,a3 as au,hT as av,Le as aw,m1 as ax,St as ay,c8 as az,at$1 as b,wr as b$,Uw as b0,W0$1 as b1,D8 as b2,p9 as b3,a9 as b4,Kf as b5,g9 as b6,va as b7,es$1 as b8,BD as b9,Vg as bA,Gl$1 as bB,Rt$1 as bC,Bu as bD,pn as bE,Ga as bF,Na as bG,t2 as bH,K1 as bI,A1 as bJ,G1 as bK,A$2 as bL,Le$2 as bM,Sy as bN,Z4 as bO,Da as bP,Ky as bQ,eh as bR,on$1 as bS,W as bT,We as bU,Ge as bV,on$3 as bW,yt$2 as bX,im as bY,Pa as bZ,v$1 as b_,Lw as ba,B1 as bb,rD as bc,R4 as bd,cw as be,Dh as bf,GD as bg,Eh as bh,U0$1 as bi,mh as bj,zD as bk,Vh as bl,jh as bm,$D as bn,ww as bo,P1 as bp,Vt$2 as bq,sw as br,vh as bs,l9 as bt,XE as bu,uh as bv,rh as bw,Er$2 as bx,re$1 as by,re$2 as bz,t7 as c,rn$1 as c$,G4 as c0,Uo$2 as c1,i0 as c2,XI as c3,Gm as c4,s9 as c5,x1 as c6,eD as c7,h9 as c8,d9 as c9,jl$1 as cA,Kg as cB,Yg as cC,kg as cD,kr$2 as cE,xy as cF,r2 as cG,a2 as cH,_e$1 as cI,Fu as cJ,vn as cK,He as cL,i9 as cM,w0 as cN,wn as cO,Ln$1 as cP,On$1 as cQ,Fg as cR,m9 as cS,mt$3 as cT,zg as cU,Ie$3 as cV,Ri as cW,xn as cX,is$1 as cY,c9 as cZ,J as c_,Aw as ca,vv as cb,N7 as cc,B7 as cd,fr as ce,pr as cf,u$1 as cg,t4 as ch,ec$1 as ci,fh as cj,k8 as ck,em as cl,ql$1 as cm,fn as cn,f1 as co,gn as cp,Xa as cq,Ts as cr,Vs as cs,Gy as ct,s0 as cu,oi as cv,ri$1 as cw,Bh as cx,ji$2 as cy,Wm as cz,dd as d,nn$1 as d0,an$1 as d1,W1 as d2,o9 as d3,jt$1 as d4,S$1 as d5,Vl$1 as d6,om as d7,Yc$1 as d8,TD as d9,Tw as dA,Cw as dB,ms as dC,Dr$2 as dD,ph as da,X$1 as db,r9 as dc,u0 as dd,m0 as de,rs$2 as df,Qg as dg,un as dh,hn as di,Dt$1 as dj,f9 as dk,v9 as dl,pb as dm,h0 as dn,X as dp,Vc as dq,u$2 as dr,bt$1 as ds,Me$1 as dt,G5 as du,p3 as dv,zl$1 as dw,$5 as dx,R0 as dy,tr as dz,V5 as e,_i$2 as f,Kc$1 as g,gh as h,ie$2 as i,oE as j,k3 as k,lh as l,bD as m,n8 as n,o,gI as p,qo$2 as q,r,s,t$1 as t,ue$1 as u,vw as v,nl$1 as w,ch as x,sE as y,zc as z};
@@ -1 +0,0 @@
1
- import {q as qe$1}from'./chunk-BhGgxvgu.js';import {a as ai,z}from'./chunk-CWbxWv5I.js';import {_ as _n,C as Cn}from'./chunk-Ojn34cvU.js';import {f}from'./chunk-2KSNHCgb.js';import {p as pc,a as as,d as dc,K as Kl,c as cc,J as Ji,l as ls}from'./chunk-3mppll1n.js';import'./chunk-CEcbtdnK.js';import {Q as QE,l as lh,C,V as Ve,b as at,q as qo,r,u as ue$1,o,M as Mi,n as n8,am as S4,J as J6,k as k3,d as dd,z as zc,c as t7,Z as y7,K as Kt,f as _i,v as vw,R as Rw,g as Kc,h as gh,m as bD,p as gI,P as Ph,O as Ow,w as nl,B as _D,E as VD,F as LD,j as oE,x as ch,y as sE,N as ND,A as xD,a5 as ah,G as Pu,I as Lu}from'./main-MNK6ZYDO.js';var ce=(t,_)=>_.id;function de(t,_){t&1&&(_i(0,"p",3),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function me(t,_){if(t&1&&(_i(0,"p",4),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.loadError());}}function fe(t,_){if(t&1&&(_i(0,"p",5),vw(1),Kc()),t&2){let e=VD(2);gI(),Ph(e.deleteError());}}function _e(t,_){if(t&1&&(_i(0,"p",9),vw(1),Kc()),t&2){let e=VD(3);gI(),Ph(e.saveError());}}function he(t,_){if(t&1){let e=LD();_i(0,"section",6),bD(1,_e,2,1,"p",9),_i(2,"label",10)(3,"span"),vw(4),Rw(5,"transloco"),Kc(),_i(6,"input",11),gh("ngModelChange",function(l){Pu(e);let d=VD(2);return Lu(d.formName.set(l))}),Kc(),oE(),Kc(),_i(7,"div",10)(8,"span"),vw(9),Rw(10,"transloco"),Kc(),_i(11,"app-file-browser",12),gh("pathChange",function(l){Pu(e);let d=VD(2);return Lu(d.formLocalPath.set(l))}),Kc()(),_i(12,"div",10)(13,"span"),vw(14),Rw(15,"transloco"),Kc(),_i(16,"p",13),vw(17),Rw(18,"transloco"),Kc(),_i(19,"app-file-browser",12),gh("pathChange",function(l){Pu(e);let d=VD(2);return Lu(d.formWorktreeBasePath.set(l))}),Kc()(),_i(20,"div",14)(21,"button",15),gh("click",function(){Pu(e);let l=VD(2);return Lu(l.submitForm())}),vw(22),Rw(23,"transloco"),Kc(),_i(24,"button",16),gh("click",function(){Pu(e);let l=VD(2);return Lu(l.cancelForm())}),vw(25),Rw(26,"transloco"),Kc()()();}if(t&2){let e=VD(2);gI(),_D(e.saveError()?1:-1),gI(3),Ph(Ow(5,11,"local-repos.form.name")),gI(2),ch("ngModel",e.formName()),sE(),gI(3),Ph(Ow(10,13,"local-repos.form.localPath")),gI(2),ch("path",e.formLocalPath()),gI(3),Ph(Ow(15,15,"local-repos.form.worktreeBasePath")),gI(3),Ph(Ow(18,17,"local-repos.form.worktreeBaseHint")),gI(2),ch("path",e.formWorktreeBasePath()),gI(2),ch("disabled",e.saving()),gI(),nl(" ",Ow(23,19,"common.save")," "),gI(3),nl(" ",Ow(26,21,"common.cancel")," ");}}function ue(t,_){t&1&&(_i(0,"p",7),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"local-repos.emptyState")));}function Ce(t,_){if(t&1){let e=LD();_i(0,"tr")(1,"td"),vw(2),Kc(),_i(3,"td",17),vw(4),Kc(),_i(5,"td",17),vw(6),Kc(),_i(7,"td",18)(8,"button",19),gh("click",function(){let l=Pu(e).$implicit,d=VD(3);return Lu(d.openEditForm(l))}),vw(9),Rw(10,"transloco"),Kc(),_i(11,"button",20),Rw(12,"transloco"),gh("nzOnConfirm",function(){let l=Pu(e).$implicit,d=VD(3);return Lu(d.deleteRepo(l))}),vw(13),Rw(14,"transloco"),Kc()()();}if(t&2){let e=_.$implicit;ah("data-testid","local-repo-row-"+e.id),gI(2),Ph(e.name),gI(2),Ph(e.localPath),gI(2),Ph(e.worktreeBasePath||"\u2014"),gI(2),ah("data-testid","edit-local-repo-"+e.id),gI(),nl(" ",Ow(10,9,"local-repos.edit")," "),gI(2),ch("nzPopconfirmTitle",Ow(12,11,"local-repos.deleteConfirm")),ah("data-testid","delete-local-repo-"+e.id),gI(2),nl(" ",Ow(14,13,"local-repos.delete")," ");}}function ge(t,_){if(t&1&&(_i(0,"nz-table",8)(1,"thead")(2,"tr")(3,"th"),vw(4),Rw(5,"transloco"),Kc(),_i(6,"th"),vw(7),Rw(8,"transloco"),Kc(),_i(9,"th"),vw(10),Rw(11,"transloco"),Kc(),_i(12,"th"),vw(13),Rw(14,"transloco"),Kc()()(),_i(15,"tbody"),ND(16,Ce,15,15,"tr",null,ce),Kc()()),t&2){let e=VD(2);ch("nzData",e.repos())("nzShowPagination",false),gI(4),Ph(Ow(5,6,"local-repos.column.name")),gI(3),Ph(Ow(8,8,"local-repos.column.localPath")),gI(3),Ph(Ow(11,10,"local-repos.column.worktreeBasePath")),gI(3),Ph(Ow(14,12,"local-repos.column.actions")),gI(3),xD(e.repos());}}function xe(t,_){if(t&1&&(bD(0,fe,2,1,"p",5),bD(1,he,27,23,"section",6),bD(2,ue,3,3,"p",7)(3,ge,18,14,"nz-table",8)),t&2){let e=VD();_D(e.deleteError()?0:-1),gI(),_D(e.formOpen()?1:-1),gI(),_D(e.repos().length===0&&!e.formOpen()?2:e.repos().length>0?3:-1);}}var ae=(()=>{class t{constructor(){this.reposApi=C(f),this.transloco=C(Ve),this.destroyRef=C(at),this.repos=qo([]),this.loading=qo(true),this.loadError=qo(null),this.saveError=qo(null),this.deleteError=qo(null),this.saving=qo(false),this.formOpen=qo(false),this.editingId=qo(null),this.formName=qo(""),this.formLocalPath=qo(""),this.formWorktreeBasePath=qo(""),this.reload();}openCreateForm(){this.editingId.set(null),this.formName.set(""),this.formLocalPath.set(""),this.formWorktreeBasePath.set(""),this.saveError.set(null),this.formOpen.set(true);}openEditForm(e){this.editingId.set(e.id),this.formName.set(e.name),this.formLocalPath.set(e.localPath),this.formWorktreeBasePath.set(e.worktreeBasePath??""),this.saveError.set(null),this.formOpen.set(true);}cancelForm(){this.formOpen.set(false),this.editingId.set(null),this.saveError.set(null);}submitForm(){if(this.saving())return;this.saveError.set(null),this.saving.set(true);let e=r({name:this.formName().trim(),localPath:this.formLocalPath().trim()},this.formWorktreeBasePath().trim()?{worktreeBasePath:this.formWorktreeBasePath().trim()}:{worktreeBasePath:void 0}),r$1=this.editingId();(r$1?this.reposApi.update(r$1,e):this.reposApi.create(e)).pipe(ue$1(this.destroyRef)).subscribe({next:d=>{this.saving.set(false),this.formOpen.set(false),this.editingId.set(null),this.repos.update(le=>[...le.filter(M=>M.id!==d.id),d].sort((M,se)=>M.name.localeCompare(se.name))),this.formName.set(""),this.formLocalPath.set(""),this.formWorktreeBasePath.set("");},error:d=>{this.saving.set(false),this.saveError.set(this.errorMessage(d,this.transloco.translate("local-repos.saveFailed")));}});}deleteRepo(e){this.deleteError.set(null),this.reposApi.delete(e.id).pipe(ue$1(this.destroyRef)).subscribe({next:()=>{this.repos.update(r=>r.filter(l=>l.id!==e.id));},error:r=>{this.deleteError.set(this.errorMessage(r,this.transloco.translate("local-repos.deleteFailed")));}});}reload(){this.loading.set(true),this.loadError.set(null),this.reposApi.list().pipe(ue$1(this.destroyRef)).subscribe({next:e=>{this.repos.set(e),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("local-repos.loadFailed")));}});}errorMessage(e,r){return e instanceof o||e instanceof Error?e.message:r}static{this.\u0275fac=function(r){return new(r||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-local-repository-list"]],decls:11,vars:7,consts:[["data-testid","local-repos-manage",1,"list-page"],[1,"header"],["nz-button","","nzType","primary","type","button","data-testid","create-local-repo",3,"click"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","delete-error",1,"error"],["data-testid","local-repo-form",1,"form"],["data-testid","empty-state",1,"empty"],["data-testid","local-repo-table",3,"nzData","nzShowPagination"],["data-testid","save-error",1,"error"],[1,"field"],["nz-input","","data-testid","local-repo-name",3,"ngModelChange","ngModel"],["selectMode","directory",3,"pathChange","path"],[1,"hint"],[1,"form-actions"],["nz-button","","nzType","primary","type","button","data-testid","save-local-repo",3,"click","disabled"],["nz-button","","type","button","data-testid","cancel-local-repo",3,"click"],[1,"path-cell"],[1,"actions"],["nz-button","","nzType","link","type","button",3,"click"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle"]],template:function(r,l){r&1&&(_i(0,"div",0)(1,"header",1)(2,"h1"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"button",2),gh("click",function(){return l.openCreateForm()}),vw(6),Rw(7,"transloco"),Kc()(),bD(8,de,3,3,"p",3)(9,me,2,1,"p",4)(10,xe,4,3),Kc()),r&2&&(gI(3),Ph(Ow(4,3,"local-repos.title")),gI(3),nl(" ",Ow(7,5,"local-repos.create")," "),gI(2),_D(l.loading()?8:l.loadError()?9:10));},dependencies:[Mi,n8,S4,J6,k3,dd,zc,t7,y7,ai,z,_n,Cn,pc,as,dc,Kl,cc,Ji,ls,qe$1,Kt],styles:[".list-page[_ngcontent-%COMP%]{max-width:72rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.65rem;padding:.85rem;border:1px solid #e7e5e4;background:#fff}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.hint[_ngcontent-%COMP%]{margin:.2rem 0 0;font-size:.8rem;color:#78716c}.form-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{white-space:nowrap}.path-cell[_ngcontent-%COMP%]{overflow-wrap:anywhere;word-break:break-word}"]});}}return t})();var qe=(()=>{class t{static{this.\u0275fac=function(r){return new(r||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-local-repositories-manage"]],decls:1,vars:0,template:function(r,l){r&1&&lh(0,"app-local-repository-list");},dependencies:[ae],encapsulation:2});}}return t})();export{qe as LocalRepositoriesManageComponent};
@@ -1 +0,0 @@
1
- import {U as Ut}from'./chunk-CDWIMt6y.js';import {q as qe}from'./chunk-BhGgxvgu.js';import {a as ai,z}from'./chunk-CWbxWv5I.js';import {_ as _n,C as Cn}from'./chunk-Ojn34cvU.js';import {W,I}from'./chunk-DNOjVPY0.js';import {L as Lt,u as ut,p as pc,a as as,d as dc,K as Kl,c as cc,J as Ji,l as ls}from'./chunk-3mppll1n.js';import {C,V as Ve$1,b as at,a0 as $0,H as Hw,q as qo,r,u as ue,o,Q as QE,M as Mi,n as n8,am as S4,J as J6,k as k3,d as dd,z as zc,c as t7,Z as y7,X as Xb,e as V5,D as D5,K as Kt,f as _i,m as bD,g as Kc,a4 as Mh,a5 as ah,p as gI,B as _D,ae as Zi,a8 as a,af as E,i as ie,F as LD,v as vw,R as Rw,h as gh,P as Ph,O as Ow,w as nl,E as VD,j as oE,N as ND,S as SD,x as ch,y as sE,A as xD,l as lh,G as Pu,I as Lu}from'./main-MNK6ZYDO.js';var Me=(()=>{class t{constructor(){this.http=C(Zi),this.baseUrl=`${a.apiBaseUrl}/context-files`;}list(){return this.http.get(this.baseUrl).pipe(E())}get(e){return this.http.get(`${this.baseUrl}/${encodeURIComponent(e)}`).pipe(E())}create(e){return this.http.post(this.baseUrl,e).pipe(E())}update(e,n){return this.http.patch(`${this.baseUrl}/${encodeURIComponent(e)}`,n).pipe(E())}delete(e){return this.http.delete(`${this.baseUrl}/${encodeURIComponent(e)}`).pipe(E())}static{this.\u0275fac=function(n){return new(n||t)};}static{this.\u0275prov=ie({token:t,factory:t.\u0275fac,providedIn:"root"});}}return t})();var Se=(t,f)=>f.id;function Te(t,f){if(t&1){let e=LD();_i(0,"header",1)(1,"h1"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"button",4),gh("click",function(){Pu(e);let r=VD();return Lu(r.openCreateForm())}),vw(5),Rw(6,"transloco"),Kc()();}t&2&&(gI(2),Ph(Ow(3,2,"context-files.title")),gI(3),nl(" ",Ow(6,4,"context-files.create")," "));}function Ie(t,f){t&1&&(_i(0,"p",2),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function Fe(t,f){if(t&1&&(_i(0,"p",3),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.loadError());}}function ye(t,f){if(t&1&&(_i(0,"p",5),vw(1),Kc()),t&2){let e=VD(2);gI(),Ph(e.deleteError());}}function Ne(t,f){if(t&1&&(_i(0,"p",9),vw(1),Kc()),t&2){let e=VD(3);gI(),Ph(e.saveError());}}function we(t,f){if(t&1&&(lh(0,"nz-option",13),Rw(1,"transloco")),t&2){let e=f.$implicit,n=VD(3);ch("nzValue",e)("nzLabel",Ow(1,2,n.tierKey(e)));}}function De(t,f){if(t&1){let e=LD();_i(0,"button",20),gh("click",function(){Pu(e);let r=VD(3);return Lu(r.cancelForm())}),vw(1),Rw(2,"transloco"),Kc();}t&2&&(gI(),nl(" ",Ow(2,1,"context-files.form.cancel")," "));}function ke(t,f){if(t&1){let e=LD();_i(0,"section",6),bD(1,Ne,2,1,"p",9),_i(2,"label",10)(3,"span"),vw(4),Rw(5,"transloco"),Kc(),_i(6,"input",11),gh("ngModelChange",function(r){Pu(e);let p=VD(2);return Lu(p.formName.set(r))}),Kc(),oE(),Kc(),_i(7,"div",10)(8,"span"),vw(9),Rw(10,"transloco"),Kc(),_i(11,"nz-select",12),gh("ngModelChange",function(r){Pu(e);let p=VD(2);return Lu(p.formTier.set(r))}),ND(12,we,2,4,"nz-option",13,SD),Kc(),oE(),Kc(),_i(14,"div",10)(15,"span"),vw(16),Rw(17,"transloco"),Kc(),_i(18,"app-file-browser",14),gh("pathChange",function(r){Pu(e);let p=VD(2);return Lu(p.formPath.set(r))}),Kc(),_i(19,"p",15),vw(20),Rw(21,"transloco"),Kc()(),_i(22,"label",10)(23,"span"),vw(24),Rw(25,"transloco"),Kc(),_i(26,"input",16),gh("ngModelChange",function(r){Pu(e);let p=VD(2);return Lu(p.formDescription.set(r))}),Kc(),oE(),Kc(),_i(27,"div",17)(28,"button",18),gh("click",function(){Pu(e);let r=VD(2);return Lu(r.submitForm())}),vw(29),Rw(30,"transloco"),Kc(),bD(31,De,3,3,"button",19),Kc()();}if(t&2){let e=VD(2);gI(),_D(e.saveError()?1:-1),gI(3),Ph(Ow(5,13,"context-files.form.name")),gI(2),ch("ngModel",e.formName()),sE(),gI(3),Ph(Ow(10,15,"context-files.form.tier")),gI(2),ch("ngModel",e.formTier()),sE(),gI(),xD(e.tiers),gI(4),Ph(Ow(17,17,"context-files.form.path")),gI(2),ch("path",e.formPath()),gI(2),Ph(Ow(21,19,"context-files.form.pathHint")),gI(4),Ph(Ow(25,21,"context-files.form.description")),gI(2),ch("ngModel",e.formDescription()),sE(),gI(2),ch("nzLoading",e.saving()),gI(),nl(" ",Ow(30,23,e.editingId()?"context-files.form.save":"context-files.form.add")," "),gI(2),_D(e.inSelectionMode()?-1:31);}}function Le(t,f){if(t&1){let e=LD();_i(0,"section",7)(1,"p"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"button",21),gh("click",function(){Pu(e);let r=VD(2);return Lu(r.openCreateForm())}),vw(5),Rw(6,"transloco"),Kc()();}t&2&&(gI(2),Ph(Ow(3,2,"context-files.emptyState")),gI(3),nl(" ",Ow(6,4,"context-files.create")," "));}function Pe(t,f){t&1&&lh(0,"th");}function Ve(t,f){t&1&&(_i(0,"th"),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"context-files.column.actions")));}function Be(t,f){if(t&1){let e=LD();_i(0,"td")(1,"label",24),gh("nzCheckedChange",function(r){Pu(e);let p=VD().$implicit,T=VD(3);return Lu(T.toggleSelected(p.id,r))}),Kc()();}if(t&2){let e=VD().$implicit,n=VD(3);gI(),ch("nzChecked",n.isSelected(e.id)),ah("data-testid","select-"+e.id);}}function Oe(t,f){if(t&1){let e=LD();_i(0,"td",23)(1,"button",25),gh("click",function(){Pu(e);let r=VD().$implicit,p=VD(3);return Lu(p.openEditForm(r))}),vw(2),Rw(3,"transloco"),Kc(),_i(4,"button",26),Rw(5,"transloco"),Rw(6,"transloco"),Rw(7,"transloco"),gh("nzOnConfirm",function(){Pu(e);let r=VD().$implicit,p=VD(3);return Lu(p.deleteFile(r.id))}),vw(8),Rw(9,"transloco"),Kc()();}if(t&2){let e=VD().$implicit;gI(),ah("data-testid","edit-"+e.id),gI(),nl(" ",Ow(3,7,"context-files.edit")," "),gI(2),ch("nzPopconfirmTitle",Ow(5,9,"context-files.deleteConfirm"))("nzOkText",Ow(6,11,"context-files.delete"))("nzCancelText",Ow(7,13,"common.cancel")),ah("data-testid","delete-"+e.id),gI(4),nl(" ",Ow(9,15,"context-files.delete")," ");}}function $e(t,f){if(t&1&&(_i(0,"tr"),bD(1,Be,2,2,"td"),_i(2,"td"),vw(3),Kc(),_i(4,"td")(5,"nz-tag"),vw(6),Rw(7,"transloco"),Kc()(),_i(8,"td",22),vw(9),Kc(),_i(10,"td"),vw(11),Kc(),bD(12,Oe,10,17,"td",23),Kc()),t&2){let e=f.$implicit,n=VD(3);ah("data-testid","context-file-"+e.id),gI(),_D(n.inSelectionMode()?1:-1),gI(),ah("data-testid","name-"+e.id),gI(),Ph(e.name),gI(2),ah("data-testid","tier-"+e.id),gI(),Ph(Ow(7,11,n.tierKey(e.tier))),gI(2),ah("data-testid","path-"+e.id),gI(),Ph(e.path),gI(),ah("data-testid","description-"+e.id),gI(),Ph(e.description),gI(),_D(n.inSelectionMode()?-1:12);}}function Ae(t,f){if(t&1&&(_i(0,"nz-table",8)(1,"thead")(2,"tr"),bD(3,Pe,1,0,"th"),_i(4,"th"),vw(5),Rw(6,"transloco"),Kc(),_i(7,"th"),vw(8),Rw(9,"transloco"),Kc(),_i(10,"th"),vw(11),Rw(12,"transloco"),Kc(),_i(13,"th"),vw(14),Rw(15,"transloco"),Kc(),bD(16,Ve,3,3,"th"),Kc()(),_i(17,"tbody"),ND(18,$e,13,13,"tr",null,Se),Kc()()),t&2){let e=VD(2);ch("nzData",e.files())("nzFrontPagination",false)("nzShowPagination",false),gI(3),_D(e.inSelectionMode()?3:-1),gI(2),Ph(Ow(6,9,"context-files.column.name")),gI(3),Ph(Ow(9,11,"context-files.column.tier")),gI(3),Ph(Ow(12,13,"context-files.column.path")),gI(3),Ph(Ow(15,15,"context-files.column.description")),gI(2),_D(e.inSelectionMode()?-1:16),gI(2),xD(e.files());}}function Ue(t,f){if(t&1&&(bD(0,ye,2,1,"p",5),bD(1,ke,32,25,"section",6),bD(2,Le,7,6,"section",7)(3,Ae,20,17,"nz-table",8)),t&2){let e=VD();_D(e.deleteError()?0:-1),gI(),_D(e.inSelectionMode()||e.formOpen()?1:-1),gI(),_D(e.files().length===0&&!e.inSelectionMode()&&!e.formOpen()?2:3);}}var Re=["user","organization","project"],zt=(()=>{class t{constructor(){this.filesApi=C(Me),this.transloco=C(Ve$1),this.destroyRef=C(at),this.modalData=C(Ut,{optional:true}),this.selectionModeInput=$0(false),this.inSelectionMode=Hw(()=>this.modalData?.selectionMode??this.selectionModeInput()),this.files=qo([]),this.loading=qo(true),this.loadError=qo(null),this.saveError=qo(null),this.deleteError=qo(null),this.saving=qo(false),this.formOpen=qo(false),this.editingId=qo(null),this.selectedIds=qo([...this.modalData?.selectedIds??[]]),this.formName=qo(""),this.formTier=qo("user"),this.formPath=qo(""),this.formDescription=qo(""),this.tiers=Re,this.reload();}currentSelectedIds(){return this.selectedIds()}tierKey(e){return `context-files.tier.${e}`}isSelected(e){return this.selectedIds().includes(e)}toggleSelected(e,n){this.selectedIds.update(r=>n?r.includes(e)?r:[...r,e]:r.filter(p=>p!==e));}openCreateForm(){this.editingId.set(null),this.formName.set(""),this.formTier.set("user"),this.formPath.set(""),this.formDescription.set(""),this.saveError.set(null),this.formOpen.set(true);}openEditForm(e){this.editingId.set(e.id),this.formName.set(e.name),this.formTier.set(e.tier),this.formPath.set(e.path),this.formDescription.set(e.description??""),this.saveError.set(null),this.formOpen.set(true);}cancelForm(){this.formOpen.set(false),this.editingId.set(null),this.saveError.set(null);}submitForm(){if(this.saving())return;this.saveError.set(null),this.saving.set(true);let e=r({name:this.formName().trim(),tier:this.formTier(),path:this.formPath().trim()},this.formDescription().trim()?{description:this.formDescription().trim()}:{description:void 0}),n=this.editingId();(n?this.filesApi.update(n,e):this.filesApi.create(e)).pipe(ue(this.destroyRef)).subscribe({next:p=>{this.saving.set(false),this.formOpen.set(false),this.editingId.set(null),this.files.update(T=>[...T.filter(N=>N.id!==p.id),p].sort((N,ze)=>N.name.localeCompare(ze.name))),this.inSelectionMode()&&!this.isSelected(p.id)&&this.selectedIds.update(T=>[...T,p.id]),this.formName.set(""),this.formTier.set("user"),this.formPath.set(""),this.formDescription.set("");},error:p=>{this.saving.set(false),this.saveError.set(this.errorMessage(p,this.transloco.translate("context-files.saveFailed")));}});}deleteFile(e){this.deleteError.set(null),this.filesApi.delete(e).pipe(ue(this.destroyRef)).subscribe({next:()=>{this.files.update(n=>n.filter(r=>r.id!==e)),this.selectedIds.update(n=>n.filter(r=>r!==e));},error:n=>{this.deleteError.set(this.errorMessage(n,this.transloco.translate("context-files.deleteFailed")));}});}reload(){this.loading.set(true),this.loadError.set(null),this.filesApi.list().pipe(ue(this.destroyRef)).subscribe({next:e=>{this.files.set(e),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("context-files.loadFailed")));}});}errorMessage(e,n){return e instanceof o||e instanceof Error?e.message:n}static{this.\u0275fac=function(n){return new(n||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-context-file-list"]],inputs:{selectionModeInput:[1,"selectionModeInput"]},decls:5,vars:5,consts:[[1,"context-file-list"],[1,"header"],["data-testid","loading"],["data-testid","load-error",1,"error"],["nz-button","","nzType","primary","type","button","data-testid","create-context-file",3,"click"],["data-testid","delete-error",1,"error"],["data-testid","context-file-form",1,"form"],["data-testid","empty-state",1,"empty"],["data-testid","context-file-items",3,"nzData","nzFrontPagination","nzShowPagination"],["data-testid","save-error",1,"error"],[1,"field"],["nz-input","","data-testid","context-file-name",3,"ngModelChange","ngModel"],["data-testid","context-file-tier",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],[3,"pathChange","path"],[1,"hint"],["nz-input","","data-testid","context-file-description",3,"ngModelChange","ngModel"],[1,"form-actions"],["nz-button","","nzType","primary","type","button","data-testid","context-file-submit",3,"click","nzLoading"],["nz-button","","type","button","data-testid","context-file-cancel"],["nz-button","","type","button","data-testid","context-file-cancel",3,"click"],["nz-button","","nzType","primary","type","button","data-testid","empty-create",3,"click"],[1,"path-cell"],[1,"actions"],["nz-checkbox","",3,"nzCheckedChange","nzChecked"],["nz-button","","nzType","link","type","button",3,"click"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle","nzOkText","nzCancelText"]],template:function(n,r){n&1&&(_i(0,"div",0),bD(1,Te,7,6,"header",1),bD(2,Ie,3,3,"p",2)(3,Fe,2,1,"p",3)(4,Ue,4,3),Kc()),n&2&&(Mh("list-page",!r.inSelectionMode()),ah("data-testid",r.inSelectionMode()?"context-file-picker":"context-files-manage"),gI(),_D(r.inSelectionMode()?-1:1),gI(),_D(r.loading()?2:r.loadError()?3:4));},dependencies:[Mi,n8,S4,J6,k3,dd,zc,t7,y7,Lt,ut,ai,z,_n,Cn,Xb,V5,D5,pc,as,dc,Kl,cc,Ji,ls,W,I,qe,Kt],styles:[".list-page[_ngcontent-%COMP%]{max-width:72rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.65rem;padding:.85rem;border:1px solid #e7e5e4;background:#fff}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.hint[_ngcontent-%COMP%]{margin:.2rem 0 0;font-size:.8rem;color:#78716c}.form-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{white-space:nowrap}.path-cell[_ngcontent-%COMP%]{overflow-wrap:anywhere;word-break:break-word}"]});}}return t})();export{Me as M,zt as z};
@@ -1 +0,0 @@
1
- import {a as ai,z as z$1}from'./chunk-CWbxWv5I.js';import {C,V as Ve,b as at,bi as U0,a0 as $0,q as qo,H as Hw,u as ue$1,o,Q as QE,M as Mi,n as n8,am as S4,J as J6,k as k3,d as dd,z as zc,c as t7,Z as y7,K as Kt,f as _i,m as bD,g as Kc,p as gI,B as _D,ae as Zi,a8 as a,ca as re,af as E,i as ie,F as LD,v as vw,R as Rw,N as ND,h as gh,E as VD,w as nl,O as Ow,A as xD,P as Ph,a5 as ah,a4 as Mh,U as Lh,G as Pu,I as Lu,j as oE,x as ch,y as sE}from'./main-MNK6ZYDO.js';var pe=(()=>{class t{constructor(){this.http=C(Zi),this.baseUrl=`${a.apiBaseUrl}/filesystem`;}browse(e){let i=new re;return e!=null&&e.trim()!==""&&(i=i.set("path",e.trim())),this.http.get(`${this.baseUrl}/browse`,{params:i}).pipe(E())}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275prov=ie({token:t,factory:t.\u0275fac,providedIn:"root"});}}return t})();function z(t){if(!t)return [];if(/^[A-Za-z]:/.test(t)){let r=t.includes("\\")?"\\":"/",y=`${t.slice(0,2)}${r}`,v=t.slice(2).replace(/^[\\/]+/,"").split(/[\\/]/).filter(Boolean),P=[{label:t.slice(0,2),path:y}],M=y;for(let k of v)M=M.endsWith(r)?M+k:M+r+k,P.push({label:k,path:M});return P}if(t.startsWith("/")){let r=t.split("/").filter(Boolean),y=[{label:"/",path:"/"}],B="";for(let v of r)B+=`/${v}`,y.push({label:v,path:B});return y}let o=t.includes("\\")?"\\":"/",e=t.split(/[\\/]/).filter(Boolean),i=[],n="";for(let r of e)n=n?n+o+r:r,i.push({label:r,path:n});return i}function N(t){let o=z(t);return o.length<2?null:o[o.length-2].path}var de=(t,o)=>o.path;function ue(t,o){if(t&1){let e=LD();_i(0,"input",1),gh("ngModelChange",function(n){Pu(e);let r=VD();return Lu(r.path.set(n))}),Kc(),oE(),_i(1,"button",2),gh("click",function(){Pu(e);let n=VD();return Lu(n.showBrowser())}),vw(2),Rw(3,"transloco"),Kc();}if(t&2){let e=VD();ch("ngModel",e.path()),sE(),gI(2),nl(" ",Ow(3,2,e.selectMode()==="directory"?"file-browser.browseDirectory":"file-browser.browse")," ");}}function _e(t,o){if(t&1){let e=LD();_i(0,"button",11),gh("click",function(){Pu(e);let n=VD().$implicit,r=VD(2);return Lu(r.loadDir(n.path))}),vw(1),Kc(),_i(2,"span",12),vw(3,"/"),Kc();}if(t&2){let e=VD().$implicit;ah("data-testid","file-browser-crumb-"+e.label),gI(),nl(" ",e.label," ");}}function fe(t,o){if(t&1&&(_i(0,"span",10),vw(1),Kc()),t&2){let e=VD().$implicit;ah("data-testid","file-browser-crumb-"+e.label),gI(),Ph(e.label);}}function he(t,o){if(t&1&&bD(0,_e,4,2)(1,fe,2,2,"span",10),t&2){let e=o.$index,i=o.$count;_D(e!==i-1?0:1);}}function be(t,o){t&1&&(_i(0,"p",5),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function Ce(t,o){if(t&1&&(_i(0,"p",6),vw(1),Kc()),t&2){let e=VD(2);gI(),Ph(e.error());}}function ge(t,o){if(t&1){let e=LD();_i(0,"li")(1,"button",13),gh("click",function(){let n=Pu(e),r=VD(3);return Lu(r.loadDir(n))}),vw(2," ../ "),Kc()();}}function we(t,o){if(t&1){let e=LD();_i(0,"li")(1,"button",14),gh("click",function(){let n=Pu(e).$implicit,r=VD(3);return Lu(r.onEntry(n))}),vw(2),Kc()();}if(t&2){let e=o.$implicit,i=VD(3);gI(),Mh("dir",e.isDirectory)("selected",i.isSelected(e)),ah("data-testid","file-browser-entry-"+e.name),gI(),Lh(" ",e.name,"",e.isDirectory?"/":""," ");}}function xe(t,o){if(t&1&&(_i(0,"ul",7),bD(1,ge,3,0,"li"),ND(2,we,3,7,"li",null,de),Kc()),t&2){let e,i=VD(2);gI(),_D((e=i.parentDir())?1:-1,e),gI(),xD(i.entries());}}function ye(t,o){if(t&1){let e=LD();_i(0,"button",15),gh("click",function(){Pu(e);let n=VD(2);return Lu(n.useCurrentFolder())}),vw(1),Rw(2,"transloco"),Kc();}t&2&&(gI(),nl(" ",Ow(2,1,"file-browser.useFolder")," "));}function Me(t,o){if(t&1){let e=LD();_i(0,"p",3),vw(1),Rw(2,"transloco"),Kc(),_i(3,"nav",4),ND(4,he,2,1,null,null,de),Kc(),bD(6,be,3,3,"p",5)(7,Ce,2,1,"p",6)(8,xe,4,1,"ul",7),_i(9,"button",8),gh("click",function(){Pu(e);let n=VD();return Lu(n.showManual())}),vw(10),Rw(11,"transloco"),Kc(),bD(12,ye,3,3,"button",9);}if(t&2){let e=VD();gI(),nl(" ",e.path()||Ow(2,4,e.selectMode()==="directory"?"file-browser.emptySelectionDirectory":"file-browser.emptySelection")," "),gI(3),xD(e.crumbs()),gI(2),_D(e.loading()?6:e.error()?7:8),gI(4),nl(" ",Ow(11,6,"file-browser.enterManually")," "),gI(2),_D(e.selectMode()==="directory"&&!e.loading()&&!e.error()?12:-1);}}var qe=(()=>{class t{constructor(){this.filesystem=C(pe),this.transloco=C(Ve),this.destroyRef=C(at),this.path=U0(""),this.selectMode=$0("file"),this.manual=qo(false),this.currentDir=qo(""),this.entries=qo([]),this.loading=qo(false),this.error=qo(null),this.crumbs=Hw(()=>z(this.currentDir())),this.parentDir=Hw(()=>N(this.currentDir()));}ngOnInit(){this.openAround(this.path());}isSelected(e){return this.selectMode()==="directory"?e.isDirectory&&e.path===this.path():!e.isDirectory&&e.path===this.path()}onEntry(e){if(e.isDirectory){this.loadDir(e.path);return}this.selectMode()==="file"&&this.path.set(e.path);}useCurrentFolder(){this.path.set(this.currentDir());}loadDir(e){this.loading.set(true),this.error.set(null),this.filesystem.browse(e).pipe(ue$1(this.destroyRef)).subscribe({next:i=>this.applyListing(i),error:i=>{this.loading.set(false),this.error.set(this.errorMessage(i,this.transloco.translate("file-browser.loadFailed")));}});}showManual(){this.manual.set(true);}showBrowser(){this.manual.set(false),this.openAround(this.path());}openAround(e){let i=e.trim();if(!i){this.loadDir(void 0);return}this.loading.set(true),this.error.set(null),this.filesystem.browse(i).pipe(ue$1(this.destroyRef)).subscribe({next:n=>this.applyListing(n),error:()=>this.loadDir(N(i)??void 0)});}applyListing(e){this.currentDir.set(e.path),this.entries.set(e.entries),this.loading.set(false),this.error.set(null);}errorMessage(e,i){return e instanceof o||e instanceof Error?e.message:i}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-file-browser"]],inputs:{path:[1,"path"],selectMode:[1,"selectMode"]},outputs:{path:"pathChange"},decls:3,vars:1,consts:[["data-testid","file-browser",1,"file-browser"],["nz-input","","data-testid","context-file-path",3,"ngModelChange","ngModel"],["nz-button","","type","button","data-testid","file-browser-browse-toggle",3,"click"],["data-testid","file-browser-selected",1,"selected"],["data-testid","file-browser-breadcrumbs",1,"crumbs"],["data-testid","file-browser-loading"],["data-testid","file-browser-error",1,"error"],["data-testid","file-browser-entries",1,"entries"],["nz-button","","nzType","link","type","button","data-testid","file-browser-manual-toggle",3,"click"],["nz-button","","nzType","primary","type","button","data-testid","file-browser-use-folder"],[1,"current"],["nz-button","","nzType","link","type","button",3,"click"],["aria-hidden","true",1,"sep"],["type","button","data-testid","file-browser-up",1,"entry","dir",3,"click"],["type","button",1,"entry",3,"click"],["nz-button","","nzType","primary","type","button","data-testid","file-browser-use-folder",3,"click"]],template:function(i,n){i&1&&(_i(0,"div",0),bD(1,ue,4,4)(2,Me,13,8),Kc()),i&2&&(gI(),_D(n.manual()?1:2));},dependencies:[Mi,n8,S4,J6,k3,dd,zc,t7,y7,ai,z$1,Kt],styles:[".file-browser[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.45rem}.selected[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:#44403c;overflow-wrap:anywhere;word-break:break-word}.crumbs[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.1rem;font-size:.85rem}.crumbs[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding-inline:.15rem;height:auto}.sep[_ngcontent-%COMP%]{color:#a8a29e}.current[_ngcontent-%COMP%]{color:#1c1917;font-weight:600}.entries[_ngcontent-%COMP%]{list-style:none;margin:0;padding:.2rem 0;max-height:12rem;overflow:auto;border:1px solid #e7e5e4;background:#fff}.entry[_ngcontent-%COMP%]{display:block;width:100%;text-align:left;border:0;background:transparent;padding:.3rem .6rem;cursor:pointer;font:inherit;color:inherit}.entry[_ngcontent-%COMP%]:hover{background:#f5f5f4}.entry.dir[_ngcontent-%COMP%]{font-weight:600}.entry.selected[_ngcontent-%COMP%]{background:#e7e5e4}.error[_ngcontent-%COMP%]{margin:0;color:#9f1239}"]});}}return t})();export{qe as q};