-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchunk-7TRGOINF.js
1 lines (1 loc) · 54.9 KB
/
chunk-7TRGOINF.js
1
import{a as Ae,b as ht}from"./chunk-ZLPS55V2.js";import{e as st}from"./chunk-ZM57XGTE.js";import{a as ke}from"./chunk-LBZNYUHD.js";import{d as U,g as dt}from"./chunk-DQ47BEOY.js";import"./chunk-A7YDWOAO.js";import{a as ut,b as ct}from"./chunk-MRBFV4MS.js";import{a as lt}from"./chunk-GNGLHN23.js";import{$ as _e,$b as Me,B as We,Cb as Je,D as $e,Db as et,Ea as j,Eb as tt,Fb as s,Gb as H,H as ze,Hb as w,Ia as K,K as ge,Kb as I,Lb as O,M as Ye,Mb as T,Nb as J,Ob as it,P as ye,Pb as _,Qb as ae,Rb as D,Ua as u,Ub as se,Va as g,Wb as Ee,X as Qe,Xb as N,Ya as we,Yb as L,_a as x,a as y,b as v,ba as ve,bb as Ze,cb as Ve,db as S,e as Ge,ea as Z,eb as P,ga as Ce,gb as E,ia as G,ib as Ke,jc as rt,k as je,kc as nt,l as me,mb as Xe,nb as A,nc as ot,oc as at,pb as X,q as He,qb as k,r as Ue,rb as De,sb as xe,tb as o,ua as be,ub as a,v as B,va as h,vb as m,w as qe,wa as f,wb as Se,xa as C,xb as p,ya as b,yb as M,za as oe}from"./chunk-PPE7DTG5.js";var wt=(()=>{class i{_renderer;_elementRef;onChange=e=>{};onTouched=()=>{};constructor(e,r){this._renderer=e,this._elementRef=r}setProperty(e,r){this._renderer.setProperty(this._elementRef.nativeElement,e,r)}registerOnTouched(e){this.onTouched=e}registerOnChange(e){this.onChange=e}setDisabledState(e){this.setProperty("disabled",e)}static \u0275fac=function(r){return new(r||i)(g(we),g(K))};static \u0275dir=S({type:i})}return i})(),Vt=(()=>{class i extends wt{static \u0275fac=(()=>{let e;return function(n){return(e||(e=oe(i)))(n||i)}})();static \u0275dir=S({type:i,features:[P]})}return i})(),Te=new G("");var Rt={provide:Te,useExisting:Z(()=>he),multi:!0};function Bt(){let i=Me()?Me().getUserAgent():"";return/android (\d+)/.test(i.toLowerCase())}var Gt=new G(""),he=(()=>{class i extends wt{_compositionMode;_composing=!1;constructor(e,r,n){super(e,r),this._compositionMode=n,this._compositionMode==null&&(this._compositionMode=!Bt())}writeValue(e){let r=e??"";this.setProperty("value",r)}_handleInput(e){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(e)}_compositionStart(){this._composing=!0}_compositionEnd(e){this._composing=!1,this._compositionMode&&this.onChange(e)}static \u0275fac=function(r){return new(r||i)(g(we),g(K),g(Gt,8))};static \u0275dir=S({type:i,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(r,n){r&1&&p("input",function(d){return n._handleInput(d.target.value)})("blur",function(){return n.onTouched()})("compositionstart",function(){return n._compositionStart()})("compositionend",function(d){return n._compositionEnd(d.target.value)})},standalone:!1,features:[J([Rt]),P]})}return i})();function jt(i){return i==null||(typeof i=="string"||Array.isArray(i))&&i.length===0}var Dt=new G(""),Ht=new G("");function Ut(i){return jt(i.value)?{required:!0}:null}function ft(i){return null}function xt(i){return i!=null}function St(i){return Ke(i)?He(i):i}function Et(i){let t={};return i.forEach(e=>{t=e!=null?y(y({},t),e):t}),Object.keys(t).length===0?null:t}function Mt(i,t){return t.map(e=>e(i))}function qt(i){return!i.validate}function At(i){return i.map(t=>qt(t)?t:e=>t.validate(e))}function Wt(i){if(!i)return null;let t=i.filter(xt);return t.length==0?null:function(e){return Et(Mt(e,t))}}function kt(i){return i!=null?Wt(At(i)):null}function $t(i){if(!i)return null;let t=i.filter(xt);return t.length==0?null:function(e){let r=Mt(e,t).map(St);return We(r).pipe(B(Et))}}function Ft(i){return i!=null?$t(At(i)):null}function pt(i,t){return i===null?[t]:Array.isArray(i)?[...i,t]:[i,t]}function zt(i){return i._rawValidators}function Yt(i){return i._rawAsyncValidators}function Fe(i){return i?Array.isArray(i)?i:[i]:[]}function de(i,t){return Array.isArray(i)?i.includes(t):i===t}function mt(i,t){let e=Fe(t);return Fe(i).forEach(n=>{de(e,n)||e.push(n)}),e}function gt(i,t){return Fe(t).filter(e=>!de(i,e))}var ue=class{get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators=[];_rawAsyncValidators=[];_setValidators(t){this._rawValidators=t||[],this._composedValidatorFn=kt(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=Ft(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_onDestroyCallbacks=[];_registerOnDestroy(t){this._onDestroyCallbacks.push(t)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(t=>t()),this._onDestroyCallbacks=[]}reset(t=void 0){this.control&&this.control.reset(t)}hasError(t,e){return this.control?this.control.hasError(t,e):!1}getError(t,e){return this.control?this.control.getError(t,e):null}},Pe=class extends ue{name;get formDirective(){return null}get path(){return null}},ne=class extends ue{_parent=null;name=null;valueAccessor=null},Ie=class{_cd;constructor(t){this._cd=t}get isTouched(){return this._cd?.control?._touched?.(),!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return this._cd?.control?._pristine?.(),!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return this._cd?.control?._status?.(),!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return this._cd?._submitted?.(),!!this._cd?.submitted}},Qt={"[class.ng-untouched]":"isUntouched","[class.ng-touched]":"isTouched","[class.ng-pristine]":"isPristine","[class.ng-dirty]":"isDirty","[class.ng-valid]":"isValid","[class.ng-invalid]":"isInvalid","[class.ng-pending]":"isPending"},Xi=v(y({},Qt),{"[class.ng-submitted]":"isSubmitted"}),Pt=(()=>{class i extends Ie{constructor(e){super(e)}static \u0275fac=function(r){return new(r||i)(g(ne,2))};static \u0275dir=S({type:i,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(r,n){r&2&&X("ng-untouched",n.isUntouched)("ng-touched",n.isTouched)("ng-pristine",n.isPristine)("ng-dirty",n.isDirty)("ng-valid",n.isValid)("ng-invalid",n.isInvalid)("ng-pending",n.isPending)},standalone:!1,features:[P]})}return i})();var ee="VALID",le="INVALID",q="PENDING",te="DISABLED",$=class{},ce=class extends ${value;source;constructor(t,e){super(),this.value=t,this.source=e}},ie=class extends ${pristine;source;constructor(t,e){super(),this.pristine=t,this.source=e}},re=class extends ${touched;source;constructor(t,e){super(),this.touched=t,this.source=e}},W=class extends ${status;source;constructor(t,e){super(),this.status=t,this.source=e}};function Zt(i){return(fe(i)?i.validators:i)||null}function Kt(i){return Array.isArray(i)?kt(i):i||null}function Xt(i,t){return(fe(t)?t.asyncValidators:i)||null}function Jt(i){return Array.isArray(i)?Ft(i):i||null}function fe(i){return i!=null&&!Array.isArray(i)&&typeof i=="object"}var Oe=class{_pendingDirty=!1;_hasOwnPendingAsyncValidator=null;_pendingTouched=!1;_onCollectionChange=()=>{};_updateOn;_parent=null;_asyncValidationSubscription;_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators;_rawAsyncValidators;value;constructor(t,e){this._assignValidators(t),this._assignAsyncValidators(e)}get validator(){return this._composedValidatorFn}set validator(t){this._rawValidators=this._composedValidatorFn=t}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(t){this._rawAsyncValidators=this._composedAsyncValidatorFn=t}get parent(){return this._parent}get status(){return L(this.statusReactive)}set status(t){L(()=>this.statusReactive.set(t))}_status=N(()=>this.statusReactive());statusReactive=x(void 0);get valid(){return this.status===ee}get invalid(){return this.status===le}get pending(){return this.status==q}get disabled(){return this.status===te}get enabled(){return this.status!==te}errors;get pristine(){return L(this.pristineReactive)}set pristine(t){L(()=>this.pristineReactive.set(t))}_pristine=N(()=>this.pristineReactive());pristineReactive=x(!0);get dirty(){return!this.pristine}get touched(){return L(this.touchedReactive)}set touched(t){L(()=>this.touchedReactive.set(t))}_touched=N(()=>this.touchedReactive());touchedReactive=x(!1);get untouched(){return!this.touched}_events=new je;events=this._events.asObservable();valueChanges;statusChanges;get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(t){this._assignValidators(t)}setAsyncValidators(t){this._assignAsyncValidators(t)}addValidators(t){this.setValidators(mt(t,this._rawValidators))}addAsyncValidators(t){this.setAsyncValidators(mt(t,this._rawAsyncValidators))}removeValidators(t){this.setValidators(gt(t,this._rawValidators))}removeAsyncValidators(t){this.setAsyncValidators(gt(t,this._rawAsyncValidators))}hasValidator(t){return de(this._rawValidators,t)}hasAsyncValidator(t){return de(this._rawAsyncValidators,t)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(t={}){let e=this.touched===!1;this.touched=!0;let r=t.sourceControl??this;this._parent&&!t.onlySelf&&this._parent.markAsTouched(v(y({},t),{sourceControl:r})),e&&t.emitEvent!==!1&&this._events.next(new re(!0,r))}markAllAsTouched(t={}){this.markAsTouched({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:this}),this._forEachChild(e=>e.markAllAsTouched(t))}markAsUntouched(t={}){let e=this.touched===!0;this.touched=!1,this._pendingTouched=!1;let r=t.sourceControl??this;this._forEachChild(n=>{n.markAsUntouched({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:r})}),this._parent&&!t.onlySelf&&this._parent._updateTouched(t,r),e&&t.emitEvent!==!1&&this._events.next(new re(!1,r))}markAsDirty(t={}){let e=this.pristine===!0;this.pristine=!1;let r=t.sourceControl??this;this._parent&&!t.onlySelf&&this._parent.markAsDirty(v(y({},t),{sourceControl:r})),e&&t.emitEvent!==!1&&this._events.next(new ie(!1,r))}markAsPristine(t={}){let e=this.pristine===!1;this.pristine=!0,this._pendingDirty=!1;let r=t.sourceControl??this;this._forEachChild(n=>{n.markAsPristine({onlySelf:!0,emitEvent:t.emitEvent})}),this._parent&&!t.onlySelf&&this._parent._updatePristine(t,r),e&&t.emitEvent!==!1&&this._events.next(new ie(!0,r))}markAsPending(t={}){this.status=q;let e=t.sourceControl??this;t.emitEvent!==!1&&(this._events.next(new W(this.status,e)),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.markAsPending(v(y({},t),{sourceControl:e}))}disable(t={}){let e=this._parentMarkedDirty(t.onlySelf);this.status=te,this.errors=null,this._forEachChild(n=>{n.disable(v(y({},t),{onlySelf:!0}))}),this._updateValue();let r=t.sourceControl??this;t.emitEvent!==!1&&(this._events.next(new ce(this.value,r)),this._events.next(new W(this.status,r)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(v(y({},t),{skipPristineCheck:e}),this),this._onDisabledChange.forEach(n=>n(!0))}enable(t={}){let e=this._parentMarkedDirty(t.onlySelf);this.status=ee,this._forEachChild(r=>{r.enable(v(y({},t),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent}),this._updateAncestors(v(y({},t),{skipPristineCheck:e}),this),this._onDisabledChange.forEach(r=>r(!1))}_updateAncestors(t,e){this._parent&&!t.onlySelf&&(this._parent.updateValueAndValidity(t),t.skipPristineCheck||this._parent._updatePristine({},e),this._parent._updateTouched({},e))}setParent(t){this._parent=t}getRawValue(){return this.value}updateValueAndValidity(t={}){if(this._setInitialStatus(),this._updateValue(),this.enabled){let r=this._cancelExistingSubscription();this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===ee||this.status===q)&&this._runAsyncValidator(r,t.emitEvent)}let e=t.sourceControl??this;t.emitEvent!==!1&&(this._events.next(new ce(this.value,e)),this._events.next(new W(this.status,e)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.updateValueAndValidity(v(y({},t),{sourceControl:e}))}_updateTreeValidity(t={emitEvent:!0}){this._forEachChild(e=>e._updateTreeValidity(t)),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?te:ee}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(t,e){if(this.asyncValidator){this.status=q,this._hasOwnPendingAsyncValidator={emitEvent:e!==!1};let r=St(this.asyncValidator(this));this._asyncValidationSubscription=r.subscribe(n=>{this._hasOwnPendingAsyncValidator=null,this.setErrors(n,{emitEvent:e,shouldHaveEmitted:t})})}}_cancelExistingSubscription(){if(this._asyncValidationSubscription){this._asyncValidationSubscription.unsubscribe();let t=this._hasOwnPendingAsyncValidator?.emitEvent??!1;return this._hasOwnPendingAsyncValidator=null,t}return!1}setErrors(t,e={}){this.errors=t,this._updateControlsErrors(e.emitEvent!==!1,this,e.shouldHaveEmitted)}get(t){let e=t;return e==null||(Array.isArray(e)||(e=e.split(".")),e.length===0)?null:e.reduce((r,n)=>r&&r._find(n),this)}getError(t,e){let r=e?this.get(e):this;return r&&r.errors?r.errors[t]:null}hasError(t,e){return!!this.getError(t,e)}get root(){let t=this;for(;t._parent;)t=t._parent;return t}_updateControlsErrors(t,e,r){this.status=this._calculateStatus(),t&&this.statusChanges.emit(this.status),(t||r)&&this._events.next(new W(this.status,e)),this._parent&&this._parent._updateControlsErrors(t,e,r)}_initObservables(){this.valueChanges=new j,this.statusChanges=new j}_calculateStatus(){return this._allControlsDisabled()?te:this.errors?le:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(q)?q:this._anyControlsHaveStatus(le)?le:ee}_anyControlsHaveStatus(t){return this._anyControls(e=>e.status===t)}_anyControlsDirty(){return this._anyControls(t=>t.dirty)}_anyControlsTouched(){return this._anyControls(t=>t.touched)}_updatePristine(t,e){let r=!this._anyControlsDirty(),n=this.pristine!==r;this.pristine=r,this._parent&&!t.onlySelf&&this._parent._updatePristine(t,e),n&&this._events.next(new ie(this.pristine,e))}_updateTouched(t={},e){this.touched=this._anyControlsTouched(),this._events.next(new re(this.touched,e)),this._parent&&!t.onlySelf&&this._parent._updateTouched(t,e)}_onDisabledChange=[];_registerOnCollectionChange(t){this._onCollectionChange=t}_setUpdateStrategy(t){fe(t)&&t.updateOn!=null&&(this._updateOn=t.updateOn)}_parentMarkedDirty(t){let e=this._parent&&this._parent.dirty;return!t&&!!e&&!this._parent._anyControlsDirty()}_find(t){return null}_assignValidators(t){this._rawValidators=Array.isArray(t)?t.slice():t,this._composedValidatorFn=Kt(this._rawValidators)}_assignAsyncValidators(t){this._rawAsyncValidators=Array.isArray(t)?t.slice():t,this._composedAsyncValidatorFn=Jt(this._rawAsyncValidators)}};var It=new G("CallSetDisabledState",{providedIn:"root",factory:()=>Ne}),Ne="always";function ei(i,t){return[...t.path,i]}function ti(i,t,e=Ne){ri(i,t),t.valueAccessor.writeValue(i.value),(i.disabled||e==="always")&&t.valueAccessor.setDisabledState?.(i.disabled),ni(i,t),ai(i,t),oi(i,t),ii(i,t)}function yt(i,t){i.forEach(e=>{e.registerOnValidatorChange&&e.registerOnValidatorChange(t)})}function ii(i,t){if(t.valueAccessor.setDisabledState){let e=r=>{t.valueAccessor.setDisabledState(r)};i.registerOnDisabledChange(e),t._registerOnDestroy(()=>{i._unregisterOnDisabledChange(e)})}}function ri(i,t){let e=zt(i);t.validator!==null?i.setValidators(pt(e,t.validator)):typeof e=="function"&&i.setValidators([e]);let r=Yt(i);t.asyncValidator!==null?i.setAsyncValidators(pt(r,t.asyncValidator)):typeof r=="function"&&i.setAsyncValidators([r]);let n=()=>i.updateValueAndValidity();yt(t._rawValidators,n),yt(t._rawAsyncValidators,n)}function ni(i,t){t.valueAccessor.registerOnChange(e=>{i._pendingValue=e,i._pendingChange=!0,i._pendingDirty=!0,i.updateOn==="change"&&Ot(i,t)})}function oi(i,t){t.valueAccessor.registerOnTouched(()=>{i._pendingTouched=!0,i.updateOn==="blur"&&i._pendingChange&&Ot(i,t),i.updateOn!=="submit"&&i.markAsTouched()})}function Ot(i,t){i._pendingDirty&&i.markAsDirty(),i.setValue(i._pendingValue,{emitModelToViewChange:!1}),t.viewToModelUpdate(i._pendingValue),i._pendingChange=!1}function ai(i,t){let e=(r,n)=>{t.valueAccessor.writeValue(r),n&&t.viewToModelUpdate(r)};i.registerOnChange(e),t._registerOnDestroy(()=>{i._unregisterOnChange(e)})}function si(i,t){if(!i.hasOwnProperty("model"))return!1;let e=i.model;return e.isFirstChange()?!0:!Object.is(t,e.currentValue)}function li(i){return Object.getPrototypeOf(i.constructor)===Vt}function di(i,t){if(!t)return null;Array.isArray(t);let e,r,n;return t.forEach(l=>{l.constructor===he?e=l:li(l)?r=l:n=l}),n||r||e||null}function _t(i,t){let e=i.indexOf(t);e>-1&&i.splice(e,1)}function vt(i){return typeof i=="object"&&i!==null&&Object.keys(i).length===2&&"value"in i&&"disabled"in i}var ui=class extends Oe{defaultValue=null;_onChange=[];_pendingValue;_pendingChange=!1;constructor(t=null,e,r){super(Zt(e),Xt(r,e)),this._applyFormState(t),this._setUpdateStrategy(e),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),fe(e)&&(e.nonNullable||e.initialValueIsDefault)&&(vt(t)?this.defaultValue=t.value:this.defaultValue=t)}setValue(t,e={}){this.value=this._pendingValue=t,this._onChange.length&&e.emitModelToViewChange!==!1&&this._onChange.forEach(r=>r(this.value,e.emitViewToModelChange!==!1)),this.updateValueAndValidity(e)}patchValue(t,e={}){this.setValue(t,e)}reset(t=this.defaultValue,e={}){this._applyFormState(t),this.markAsPristine(e),this.markAsUntouched(e),this.setValue(this.value,e),this._pendingChange=!1}_updateValue(){}_anyControls(t){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(t){this._onChange.push(t)}_unregisterOnChange(t){_t(this._onChange,t)}registerOnDisabledChange(t){this._onDisabledChange.push(t)}_unregisterOnDisabledChange(t){_t(this._onDisabledChange,t)}_forEachChild(t){}_syncPendingControls(){return this.updateOn==="submit"&&(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),this._pendingChange)?(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),!0):!1}_applyFormState(t){vt(t)?(this.value=this._pendingValue=t.value,t.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=t}};var ci={provide:ne,useExisting:Z(()=>Le)},Ct=Promise.resolve(),Le=(()=>{class i extends ne{_changeDetectorRef;callSetDisabledState;control=new ui;static ngAcceptInputType_isDisabled;_registered=!1;viewModel;name="";isDisabled;model;options;update=new j;constructor(e,r,n,l,d,c){super(),this._changeDetectorRef=d,this.callSetDisabledState=c,this._parent=e,this._setValidators(r),this._setAsyncValidators(n),this.valueAccessor=di(this,l)}ngOnChanges(e){if(this._checkForErrors(),!this._registered||"name"in e){if(this._registered&&(this._checkName(),this.formDirective)){let r=e.name.previousValue;this.formDirective.removeControl({name:r,path:this._getPath(r)})}this._setUpControl()}"isDisabled"in e&&this._updateDisabled(e),si(e,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!!(this.options&&this.options.standalone)}_setUpStandalone(){ti(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._isStandalone()||this._checkParentType(),this._checkName()}_checkParentType(){}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),!this._isStandalone()&&this.name}_updateValue(e){Ct.then(()=>{this.control.setValue(e,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(e){let r=e.isDisabled.currentValue,n=r!==0&&Ee(r);Ct.then(()=>{n&&!this.control.disabled?this.control.disable():!n&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(e){return this._parent?ei(e,this._parent):[e]}static \u0275fac=function(r){return new(r||i)(g(Pe,9),g(Dt,10),g(Ht,10),g(Te,10),g(se,8),g(It,8))};static \u0275dir=S({type:i,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"],options:[0,"ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],standalone:!1,features:[J([ci]),P,be]})}return i})();var hi={provide:Te,useExisting:Z(()=>Re),multi:!0},Re=(()=>{class i extends Vt{writeValue(e){let r=e??"";this.setProperty("value",r)}registerOnChange(e){this.onChange=r=>{e(r==""?null:parseFloat(r))}}static \u0275fac=(()=>{let e;return function(n){return(e||(e=oe(i)))(n||i)}})();static \u0275dir=S({type:i,selectors:[["input","type","number","formControlName",""],["input","type","number","formControl",""],["input","type","number","ngModel",""]],hostBindings:function(r,n){r&1&&p("input",function(d){return n.onChange(d.target.value)})("blur",function(){return n.onTouched()})},standalone:!1,features:[J([hi]),P]})}return i})();var fi=(()=>{class i{_validator=ft;_onChange;_enabled;ngOnChanges(e){if(this.inputName in e){let r=this.normalizeInput(e[this.inputName].currentValue);this._enabled=this.enabled(r),this._validator=this._enabled?this.createValidator(r):ft,this._onChange&&this._onChange()}}validate(e){return this._validator(e)}registerOnValidatorChange(e){this._onChange=e}enabled(e){return e!=null}static \u0275fac=function(r){return new(r||i)};static \u0275dir=S({type:i,features:[be]})}return i})();var pi={provide:Dt,useExisting:Z(()=>Be),multi:!0};var Be=(()=>{class i extends fi{required;inputName="required";normalizeInput=Ee;createValidator=e=>Ut;enabled(e){return e}static \u0275fac=(()=>{let e;return function(n){return(e||(e=oe(i)))(n||i)}})();static \u0275dir=S({type:i,selectors:[["","required","","formControlName","",3,"type","checkbox"],["","required","","formControl","",3,"type","checkbox"],["","required","","ngModel","",3,"type","checkbox"]],hostVars:1,hostBindings:function(r,n){r&2&&Xe("required",n._enabled?"":null)},inputs:{required:"required"},standalone:!1,features:[J([pi]),P]})}return i})();var mi=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275mod=Ve({type:i});static \u0275inj=Ce({})}return i})();var Tt=(()=>{class i{static withConfig(e){return{ngModule:i,providers:[{provide:It,useValue:e.callSetDisabledState??Ne}]}}static \u0275fac=function(r){return new(r||i)};static \u0275mod=Ve({type:i});static \u0275inj=Ce({imports:[mi]})}return i})();var Nt=(()=>{class i{constructor(e){this.elementRef=e,this.appDrawerClosed=new j;let r=this.elementRef.nativeElement;this.changes=new MutationObserver(n=>{n.forEach(l=>l.oldValue==="dialog"&&this.appDrawerClosed.emit())}),this.changes.observe(r,{attributeFilter:["role"],attributeOldValue:!0})}static{this.\u0275fac=function(r){return new(r||i)(g(K))}}static{this.\u0275dir=S({type:i,selectors:[["","appDrawerClosed",""]],outputs:{appDrawerClosed:"appDrawerClosed"}})}}return i})();var yi=["transactionDateInput"],_i=(i,t)=>t.id,vi=(i,t)=>t.vendorCode.etm.primary,Ci=(i,t)=>[i,t];function bi(i,t){if(i&1&&(o(0,"dl",76)(1,"div",77)(2,"div")(3,"dd",78),s(4,"Investment"),a(),o(5,"dt",79),s(6),_(7,"number"),a()(),o(8,"div",80)(9,"dd",78),s(10,"Market Value"),a(),o(11,"dt",79),s(12),_(13,"number"),a()()(),o(14,"div",81)(15,"div")(16,"dd",78),s(17,"Day Profit/Loss"),a(),o(18,"dt",82),s(19),_(20,"number"),o(21,"span",83),s(22),_(23,"number"),a()()(),o(24,"div",80)(25,"dd",78),s(26,"Total Profit/Loss"),a(),o(27,"dt",82),s(28),_(29,"number"),o(30,"span",83),s(31),_(32,"number"),a()()()()()),i&2){let e=M(),r=M();u(6),w(" \u20B9",D(7,8,e.investment,"1.2-2")," "),u(6),w(" \u20B9",D(13,11,e.marketValue,"1.2-2")," "),u(6),A("ngClass",e.dayProfitLoss.direction===r.Direction.UP?"text-green-500 dark:text-green-400":"text-red-600 dark:text-red-500"),u(),w(" \u20B9",D(20,14,e.dayProfitLoss.value,"1.2-2")," "),u(3),w("(",D(23,17,e.dayProfitLoss.percentage,"1.2-2"),"%)"),u(5),A("ngClass",e.totalProfitLoss.direction===r.Direction.UP?"text-green-500 dark:text-green-400":"text-red-600 dark:text-red-500"),u(),w(" \u20B9",D(29,20,e.totalProfitLoss.value,"1.2-2")," "),u(3),w("(",D(32,23,e.totalProfitLoss.percentage,"1.2-2"),"%)")}}function wi(i,t){i&1&&E(0,bi,33,26,"dl",76),i&2&&k(t.holdings.length>0?0:-1)}function Vi(i,t){if(i&1&&(o(0,"tr",93)(1,"th",94)(2,"div",22)(3,"div",95),s(4),a(),o(5,"div",96),s(6),a()(),o(7,"div"),s(8),_(9,"number"),a(),o(10,"div"),s(11),_(12,"number"),a()(),o(13,"td",97)(14,"div"),s(15),_(16,"number"),a(),o(17,"div"),s(18),_(19,"number"),a(),o(20,"div"),s(21),_(22,"number"),a()(),o(23,"td",97)(24,"div"),s(25),_(26,"number"),a(),o(27,"div"),s(28),_(29,"number"),a(),o(30,"div"),s(31),_(32,"number"),a()()()),i&2){let e=t.$implicit,r=M(3);A("routerLink",it(37,Ci,"/"+r.Routes.STOCKS,e.vendorCode.etm.primary)),u(4),w(" ",e.name," "),u(2),w("(",e.quantity,")"),u(2),H(D(9,13,e.averagePrice,"1.2-2")),u(3),H(D(12,16,e.investment,"1.2-2")),u(2),A("ngClass",(e.quote==null||e.quote.nse==null||e.quote.nse.change==null?null:e.quote.nse.change.direction)===r.Direction.UP?"text-green-500 dark:text-green-400":"text-red-600 dark:text-red-500"),u(2),w(" ",D(16,19,(e.quote==null||e.quote.nse==null||e.quote.nse.change==null?null:e.quote.nse.change.value)*e.quantity,"1.2-2")," "),u(3),w(" (",D(19,22,e.quote==null||e.quote.nse==null||e.quote.nse.change==null?null:e.quote.nse.change.percentage,"1.2-2"),"%) "),u(3),H(D(22,25,e.quote==null||e.quote.nse==null?null:e.quote.nse.price,"1.2-2")),u(2),A("ngClass",(e.totalProfitLoss==null?null:e.totalProfitLoss.direction)===r.Direction.UP?"text-green-500 dark:text-green-400":"text-red-600 dark:text-red-500"),u(2),H(D(26,28,e.totalProfitLoss==null?null:e.totalProfitLoss.value,"1.2-2")),u(3),w(" (",D(29,31,e.totalProfitLoss==null?null:e.totalProfitLoss.percentage,"1.2-2"),"%) "),u(3),H(D(32,34,e.marketValue,"1.2-2"))}}function Di(i,t){if(i&1&&(o(0,"div",84)(1,"table",86)(2,"colgroup"),m(3,"col",87)(4,"col",88)(5,"col",88),a(),o(6,"thead",89)(7,"tr")(8,"th",90)(9,"div",91),s(10,"Company (Qty)"),a(),o(11,"div"),s(12,"Avg. Price (\u20B9)"),a(),o(13,"div"),s(14,"Investment (\u20B9)"),a()(),o(15,"th",92)(16,"div"),s(17,"Day P/L (\u20B9)"),a(),o(18,"div"),s(19,"Day P/L (%)"),a(),o(20,"div"),s(21,"LTP (\u20B9)"),a()(),o(22,"th",92)(23,"div"),s(24,"Total P/L (\u20B9)"),a(),o(25,"div"),s(26,"Total P/L (%)"),a(),o(27,"div"),s(28,"Cur. Val. (\u20B9)"),a()()()(),o(29,"tbody"),De(30,Vi,33,40,"tr",93,_i),a()()()),i&2){let e=M();u(30),xe(e.holdings)}}function xi(i,t){i&1&&(o(0,"div",85),C(),o(1,"svg",98),m(2,"path",72),a(),b(),o(3,"p"),s(4,"No Holdings!"),a()())}function Si(i,t){i&1&&E(0,Di,32,0,"div",84)(1,xi,5,0,"div",85),i&2&&k(t.holdings.length>0?0:1)}function Ei(i,t){i&1&&(o(0,"div",32),C(),o(1,"svg",99),m(2,"path",65)(3,"path",66),a(),b(),o(4,"span",38),s(5,"Loading..."),a()())}function Mi(i,t){if(i&1){let e=Se();o(0,"li",21),p("click",function(){let n=h(e).$implicit,l=M(3);return f(l.selectStock(n))}),s(1),a()}if(i&2){let e=t.$implicit;u(),w(" ",e.name," ")}}function Ai(i,t){if(i&1&&(o(0,"ul",100),De(1,Mi,2,1,"li",101,vi),a()),i&2){let e=M();u(),xe(e)}}function ki(i,t){if(i&1&&E(0,Ai,3,0,"ul",100),i&2){let e=M();k(e.showSearchResults&&t.length>0?0:-1)}}function Fi(i,t){if(i&1&&(o(0,"div")(1,"p",102),s(2),a()()),i&2){let e=M();u(2),w(" ",e.transactionFormError," ")}}var F=function(i){return i[i.NONE=0]="NONE",i[i.DAY_GAINERS=1]="DAY_GAINERS",i[i.DAY_LOSERS=2]="DAY_LOSERS",i[i.OVERALL_GAINERS=3]="OVERALL_GAINERS",i[i.OVERALL_LOSERS=4]="OVERALL_LOSERS",i}(F||{}),z=function(i){return i[i.NAME=0]="NAME",i[i.DAY_PROFIT_LOSS=1]="DAY_PROFIT_LOSS",i[i.OVERALL_PROFIT_LOSS=2]="OVERALL_PROFIT_LOSS",i}(z||{}),Y=function(i){return i[i.ASC=0]="ASC",i[i.DSC=1]="DSC",i}(Y||{}),Pr=(()=>{class i{constructor(e,r,n,l){this.cdr=e,this.storageService=r,this.marketService=n,this.portfolioFilter$=new me(F.NONE),this.portfolioSort$=new me([z.DAY_PROFIT_LOSS,Y.DSC]),this.Routes=lt.routes,this.Direction=U,this.TransactionType=Ae,this.PortfolioFilter=F,this.PortfolioSortType=z,this.PortfolioSortOrder=Y,this.portfolioSearchQuery=x(""),this.name=x(""),this.date=x(""),this.price=x(0),this.quantity=x(0),this.charges=x(0),this.gross=N(()=>this.price()*this.quantity()),this.net=N(()=>this.gross()+this.charges()),this.portfolioSearchQuery$=ke(this.portfolioSearchQuery).pipe(ge(200),ye()),this.portfolio$=qe([l.portfolio$,this.portfolioFilter$,this.portfolioSort$,this.portfolioSearchQuery$]).pipe(B(([d,c,[Q,pe],Lt])=>v(y({},d),{holdings:d.holdings.filter(V=>V.quantity&&V.quantity>0&&V.name.toLowerCase().includes(Lt.toLowerCase())).filter(V=>{switch(c){case F.DAY_GAINERS:return V.quote?.nse?.change?.direction===U.UP;case F.DAY_LOSERS:return V.quote?.nse?.change?.direction===U.DOWN;case F.OVERALL_GAINERS:return V.totalProfitLoss?.direction===U.UP;case F.OVERALL_LOSERS:return V.totalProfitLoss?.direction===U.DOWN;default:return!0}}).sort((V,R)=>{switch(Q){case z.NAME:return pe===Y.ASC?V.name.localeCompare(R.name):R.name.localeCompare(V.name);case z.DAY_PROFIT_LOSS:return pe===Y.ASC?(V.quote?.nse?.change?.percentage||0)-(R.quote?.nse?.change?.percentage||0):(R.quote?.nse?.change?.percentage||0)-(V.quote?.nse?.change?.percentage||0);case z.OVERALL_PROFIT_LOSS:return pe===Y.ASC?(V.totalProfitLoss?.percentage||0)-(R.totalProfitLoss?.percentage||0):(R.totalProfitLoss?.percentage||0)-(V.totalProfitLoss?.percentage||0)}})})),Qe()),this.stockSearchResults$=ke(this.name).pipe(ge(500),ye(),ve(d=>{this.showSearchResults=!1,d!==this.selectedStock?.name&&(this.selectedStock=void 0)}),ze(d=>d.length>2&&d!==this.selectedStock?.name),_e(d=>$e(()=>this.transactionType===Ae.BUY,this.marketService.search(d),l.portfolio$.pipe(B(c=>c.holdings.filter(Q=>Q.quantity&&Q.quantity>0&&Q.name.toLowerCase().includes(d.toLowerCase())))))),ve(()=>{this.showSearchResults=!0}))}ngOnInit(){this.initDatePicker(),this.sortDropdown=window.FlowbiteInstances.getInstance("Dropdown","sortDropdown"),this.filterDropdown=window.FlowbiteInstances.getInstance("Dropdown","filterDropdown")}addTransaction(){return Ge(this,null,function*(){if(this.selectedStock&&this.transactionType&&this.date()&&this.price()>0&&this.quantity()>0&&(!this.charges()||this.charges()>0)){let e=this.date().split("/"),r=new Date(`${e[2]}/${e[1]}/${e[0]}`);if(r<new Date){this.showTransactionProgress=!0;let n={id:ut(),type:this.transactionType,date:r.getTime(),price:this.price(),quantity:this.quantity(),charges:this.charges()};yield this.storageService.addOrUpdate(this.selectedStock,n),this.resetTransactionForm(),this.showTransactionProgress=!1,this.showStatusModal=!0}else this.showTransactionFormError("Date is in future!")}else this.showTransactionFormError("One or more field(s) containing invalid value(s)!")})}openAddTransactionDrawer(e){this.transactionType=e}selectStock(e){e.scripCode.isin?(this.selectedStock=e,this.name.set(e.name)):this.marketService.getStock(e.vendorCode.etm.primary,!0).pipe(_e(r=>r&&(r.scripCode.nse||r.scripCode.bse)?this.marketService.searchSecondary(r.scripCode.nse||r.scripCode.bse||"").pipe(B(n=>{if(n.length>0){let l=n.find(d=>d.scripCode.isin&&d.scripCode.isin===r.scripCode.isin||d.scripCode.nse&&d.scripCode.nse===r.scripCode.nse||d.scripCode.bse&&d.scripCode.bse===r.scripCode.bse);return l?v(y({},r),{vendorCode:v(y({},r.vendorCode),{mc:l.vendorCode.mc})}):r}else return r})):Ue(null)),Ye(1)).subscribe(r=>{r?(this.selectedStock=v(y({},e),{scripCode:r.scripCode,vendorCode:v(y({},e.vendorCode),{mc:r.vendorCode.mc})}),this.name.set(e.name)):this.showTransactionFormError("Unable to get the details of the selected stock!")}),this.showSearchResults=!1}resetTransactionForm(){this.selectedStock=void 0,this.showSearchResults=!1,this.name.set(""),this.date.set(this.datepicker?.getDate("dd/mm/yyyy")||""),this.price.set(0),this.quantity.set(0),this.charges.set(0),this.resetDatepicker()}closeStatusModal(e){this.showStatusModal=!1,e||(this.transactionType=void 0)}filterPortfolio(e){this.portfolioFilter$.next(e),this.filterDropdown&&this.filterDropdown.hide()}clearPortfolioFilters(){this.portfolioFilter$.next(F.NONE),this.filterDropdown&&this.filterDropdown.hide()}sortPortfolio(e,r){this.portfolioSort$.next([e,r]),this.sortDropdown&&this.sortDropdown.hide()}showTransactionFormError(e){this.transactionFormError=e,setTimeout(()=>{this.transactionFormError="",this.cdr.markForCheck()},2e3)}resetDatepicker(){this.datepicker?.setDate(Date.now(),{clear:!0})}initDatePicker(){this.transactionDateInputRef&&(this.datepicker=new Datepicker(this.transactionDateInputRef.nativeElement,{autohide:!0,format:"dd/mm/yyyy",todayBtn:!0,clearBtn:!0,todayBtnMode:1,todayHighlight:!0,maxDate:Date.now()}),this.transactionDateInputRef.nativeElement.addEventListener("changeDate",e=>{let r=e.target.value;this.date.set(r)}),this.resetDatepicker())}static{this.\u0275fac=function(r){return new(r||i)(g(se),g(ct),g(dt),g(ht))}}static{this.\u0275cmp=Ze({type:i,selectors:[["app-portfolio"]],viewQuery:function(r,n){if(r&1&&Je(yi,7),r&2){let l;et(l=tt())&&(n.transactionDateInputRef=l.first)}},decls:152,vars:24,consts:[["transactionDateInput",""],[1,"flex","h-full","flex-col","pb-4"],[1,"flex","flex-col","items-center","justify-between","space-y-3","p-4","pt-2","md:flex-row","md:space-x-4","md:space-y-0"],[1,"w-full","md:w-64","xl:w-96"],[1,"flex","items-center"],["for","simple-search",1,"sr-only"],[1,"relative","w-full"],[1,"pointer-events-none","absolute","inset-y-0","left-0","flex","items-center","pl-3"],["aria-hidden","true","fill","currentColor","viewBox","0 0 20 20","xmlns","http://www.w3.org/2000/svg",1,"h-5","w-5","text-gray-500","dark:text-gray-400"],["fill-rule","evenodd","d","M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z","clip-rule","evenodd"],["type","text","placeholder","Search",1,"focus:ring-primary-500","focus:border-primary-500","dark:focus:ring-primary-500","dark:focus:border-primary-500","block","w-full","rounded-lg","border","border-gray-300","bg-gray-50","p-2","pl-10","text-sm","text-gray-900","dark:border-gray-600","dark:bg-gray-700","dark:text-white","dark:placeholder-gray-400",3,"ngModelChange","ngModel"],[1,"flex","w-full","flex-shrink-0","flex-col","items-stretch","justify-end","space-y-3","md:w-auto","md:flex-row","md:items-center","md:space-x-3","md:space-y-0"],[1,"flex","space-x-3"],[1,"flex","w-full","items-center","md:w-auto"],["id","sortDropdownButton","data-dropdown-toggle","sortDropdown","type","button",1,"hover:text-primary-700","flex","w-full","items-center","justify-center","rounded-lg","border","border-gray-200","bg-white","px-4","py-2","text-sm","font-medium","text-gray-900","hover:bg-gray-100","focus:z-10","focus:outline-none","focus:ring-4","focus:ring-gray-200","md:w-auto","dark:border-gray-600","dark:bg-gray-800","dark:text-gray-400","dark:hover:bg-gray-700","dark:hover:text-white","dark:focus:ring-gray-700"],["xmlns","http://www.w3.org/2000/svg","aria-hidden","true","viewBox","0 0 24 24","fill","currentColor",1,"mr-2","h-4","w-4","text-gray-400"],["stroke","currentColor","stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M7 4v16M7 4l3 3M7 4 4 7m9-3h6l-6 6h6m-6.5 10 3.5-7 3.5 7M14 18h4"],["fill","currentColor","viewBox","0 0 20 20","xmlns","http://www.w3.org/2000/svg","aria-hidden","true",1,"-mr-1","ml-1.5","h-5","w-5"],["clip-rule","evenodd","fill-rule","evenodd","d","M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"],["id","sortDropdown",1,"z-10","hidden","w-44","divide-y","divide-gray-100","rounded","bg-white","shadow","dark:divide-gray-600","dark:bg-gray-700"],["aria-labelledby","sortDropdownButton",1,"py-1","text-sm","text-gray-700","dark:text-gray-200"],[1,"block","cursor-pointer","px-4","py-2","hover:bg-gray-100","dark:hover:bg-gray-600","dark:hover:text-white",3,"click"],[1,"flex"],["aria-hidden","true","xmlns","http://www.w3.org/2000/svg","fill","none","viewBox","0 0 24 24",1,"h-5","w-5","text-gray-800","dark:text-white"],["stroke","currentColor","stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M12 6v13m0-13 4 4m-4-4-4 4"],["stroke","currentColor","stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M12 19V5m0 14-4-4m4 4 4-4"],["id","filterDropdownButton","data-dropdown-toggle","filterDropdown","type","button",1,"hover:text-primary-700","flex","w-full","items-center","justify-center","rounded-lg","border","border-gray-200","bg-white","px-4","py-2","text-sm","font-medium","text-gray-900","hover:bg-gray-100","focus:z-10","focus:outline-none","focus:ring-4","focus:ring-gray-200","md:w-auto","dark:border-gray-600","dark:bg-gray-800","dark:text-gray-400","dark:hover:bg-gray-700","dark:hover:text-white","dark:focus:ring-gray-700"],["xmlns","http://www.w3.org/2000/svg","aria-hidden","true","viewBox","0 0 20 20","fill","currentColor",1,"mr-2","h-4","w-4","text-gray-400"],["fill-rule","evenodd","d","M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z","clip-rule","evenodd"],["id","filterDropdown",1,"z-10","hidden","w-44","divide-y","divide-gray-100","rounded","bg-white","shadow","dark:divide-gray-600","dark:bg-gray-700"],["aria-labelledby","filterDropdownButton",1,"py-1","text-sm","text-gray-700","dark:text-gray-200"],["data-drawer-target","add-transaction-drawer","data-drawer-show","add-transaction-drawer","aria-controls","add-transaction-drawer","data-drawer-placement","right","type","button",1,"bg-primary-700","hover:bg-primary-800","focus:ring-primary-300","dark:bg-primary-600","dark:hover:bg-primary-700","dark:focus:ring-primary-800","flex","w-1/2","items-center","justify-center","rounded-lg","px-4","py-2","text-sm","font-medium","text-white","focus:outline-none","focus:ring-4","md:w-24",3,"click"],["role","status",1,"flex","flex-1","items-center","justify-center"],["id","add-transaction-drawer","tabindex","-1","aria-labelledby","drawer-label","aria-hidden","true",1,"fixed","right-0","top-0","z-50","h-full","w-full","max-w-xs","translate-x-full","overflow-y-auto","bg-white","p-4","transition-transform","dark:bg-gray-800",3,"appDrawerClosed"],["id","drawer-label",1,"mb-6","inline-flex","items-center","text-sm","font-semibold","uppercase","text-gray-500","dark:text-gray-400"],["type","button","data-drawer-dismiss","add-transaction-drawer","aria-controls","add-transaction-drawer",1,"absolute","right-2.5","top-2.5","inline-flex","items-center","rounded-lg","bg-transparent","p-1.5","text-sm","text-gray-400","hover:bg-gray-200","hover:text-gray-900","dark:hover:bg-gray-600","dark:hover:text-white",3,"click"],["aria-hidden","true","fill","currentColor","viewBox","0 0 20 20","xmlns","http://www.w3.org/2000/svg",1,"h-5","w-5"],["fill-rule","evenodd","d","M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule","evenodd"],[1,"sr-only"],[1,"space-y-4"],[1,"relative"],["for","name",1,"mb-2","block","text-sm","font-medium","text-gray-900","dark:text-white"],["type","text","name","name","id","name","placeholder","Type company name/symbol...","required","",1,"focus:ring-primary-600","focus:border-primary-600","dark:focus:ring-primary-500","dark:focus:border-primary-500","block","w-full","rounded-lg","border","border-gray-300","bg-gray-50","p-2.5","text-sm","text-gray-900","dark:border-gray-600","dark:bg-gray-700","dark:text-white","dark:placeholder-gray-400",3,"ngModelChange","ngModel"],[1,"absolute","z-10","mt-px","w-full","divide-y","divide-gray-100","rounded-lg","bg-white","shadow","dark:bg-gray-700"],["for","date",1,"mb-2","block","text-sm","font-medium","text-gray-900","dark:text-white"],[1,"pointer-events-none","absolute","inset-y-0","start-0","flex","items-center","ps-3.5"],["aria-hidden","true","xmlns","http://www.w3.org/2000/svg","fill","currentColor","viewBox","0 0 20 20",1,"h-4","w-4","text-gray-500","dark:text-gray-400"],["d","M20 4a2 2 0 0 0-2-2h-2V1a1 1 0 0 0-2 0v1h-3V1a1 1 0 0 0-2 0v1H6V1a1 1 0 0 0-2 0v1H2a2 2 0 0 0-2 2v2h20V4ZM0 18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8H0v10Zm5-8h10a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2Z"],["type","text","name","date","id","date","placeholder","DD/MM/YYYY","required","","readonly","",1,"focus:ring-primary-600","focus:border-primary-600","dark:focus:ring-primary-500","dark:focus:border-primary-500","block","w-full","rounded-lg","border","border-gray-300","bg-gray-50","p-2.5","ps-10","text-sm","text-gray-900","dark:border-gray-600","dark:bg-gray-700","dark:text-white","dark:placeholder-gray-400",3,"ngModelChange","ngModel"],["for","price",1,"mb-2","block","text-sm","font-medium","text-gray-900","dark:text-white"],["type","number","name","price","id","price","placeholder","\u20B9 0","required","",1,"focus:ring-primary-600","focus:border-primary-600","dark:focus:ring-primary-500","dark:focus:border-primary-500","block","w-full","rounded-lg","border","border-gray-300","bg-gray-50","p-2.5","text-sm","text-gray-900","dark:border-gray-600","dark:bg-gray-700","dark:text-white","dark:placeholder-gray-400",3,"ngModelChange","ngModel"],["for","quantity",1,"mb-2","block","text-sm","font-medium","text-gray-900","dark:text-white"],["type","number","name","quantity","id","quantity","placeholder","0","required","",1,"focus:ring-primary-600","focus:border-primary-600","dark:focus:ring-primary-500","dark:focus:border-primary-500","block","w-full","rounded-lg","border","border-gray-300","bg-gray-50","p-2.5","text-sm","text-gray-900","dark:border-gray-600","dark:bg-gray-700","dark:text-white","dark:placeholder-gray-400",3,"ngModelChange","ngModel"],["for","gross",1,"mb-2","block","text-sm","font-medium","text-gray-900","dark:text-white"],["type","number","name","gross","id","gross","placeholder","0","readonly","",1,"focus:ring-primary-600","focus:border-primary-600","dark:focus:ring-primary-500","dark:focus:border-primary-500","block","w-full","rounded-lg","border","border-gray-300","bg-gray-50","p-2.5","text-sm","text-gray-900","dark:border-gray-600","dark:bg-gray-700","dark:text-white","dark:placeholder-gray-400",3,"value"],["for","changes",1,"mb-2","block","text-sm","font-medium","text-gray-900","dark:text-white"],["type","number","name","changes","id","changes","placeholder","\u20B9 0",1,"focus:ring-primary-600","focus:border-primary-600","dark:focus:ring-primary-500","dark:focus:border-primary-500","block","w-full","rounded-lg","border","border-gray-300","bg-gray-50","p-2.5","text-sm","text-gray-900","dark:border-gray-600","dark:bg-gray-700","dark:text-white","dark:placeholder-gray-400",3,"ngModelChange","ngModel"],["for","net",1,"mb-2","block","text-sm","font-medium","text-gray-900","dark:text-white"],["type","number","name","net","id","net","placeholder","0","readonly","",1,"focus:ring-primary-600","focus:border-primary-600","dark:focus:ring-primary-500","dark:focus:border-primary-500","block","w-full","rounded-lg","border","border-gray-300","bg-gray-50","p-2.5","text-sm","text-gray-900","dark:border-gray-600","dark:bg-gray-700","dark:text-white","dark:placeholder-gray-400",3,"value"],[1,"bottom-0","left-0","flex","w-full","justify-center","space-x-4","pb-4","md:absolute","md:px-4"],["type","submit",1,"bg-primary-700","hover:bg-primary-800","focus:ring-primary-300","dark:bg-primary-600","dark:hover:bg-primary-700","dark:focus:ring-primary-800","inline-flex","w-full","justify-center","rounded-lg","px-5","py-2.5","text-center","text-sm","font-medium","text-white","focus:outline-none","focus:ring-4",3,"click"],["type","button","data-drawer-dismiss","add-transaction-drawer","aria-controls","add-transaction-drawer",1,"focus:ring-primary-300","inline-flex","w-full","items-center","justify-center","rounded-lg","border","border-gray-200","bg-white","px-5","py-2.5","text-sm","font-medium","text-gray-500","hover:bg-gray-100","hover:text-gray-900","focus:z-10","focus:outline-none","focus:ring-4","dark:border-gray-500","dark:bg-gray-700","dark:text-gray-300","dark:hover:bg-gray-600","dark:hover:text-white","dark:focus:ring-gray-600",3,"click"],["tabindex","-1",1,"fixed","left-0","right-0","top-0","z-50","flex","h-full","max-h-full","w-full","items-center","justify-center","overflow-y-auto","overflow-x-hidden","bg-gray-900","bg-opacity-50","md:inset-0","dark:bg-opacity-80"],["role","status"],["aria-hidden","true","viewBox","0 0 100 101","fill","none","xmlns","http://www.w3.org/2000/svg",1,"inline","h-8","w-8","animate-spin","fill-blue-600","text-gray-200","dark:text-gray-600"],["d","M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z","fill","currentColor"],["d","M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z","fill","currentFill"],["tabindex","-1",1,"fixed","left-0","right-0","top-0","z-50","flex","h-[calc(100%-1rem)]","max-h-full","w-full","items-center","justify-center","overflow-y-auto","overflow-x-hidden","bg-gray-900","bg-opacity-50","md:inset-0","dark:bg-opacity-80"],[1,"relative","max-h-full","w-full","max-w-md","p-4"],[1,"relative","rounded-lg","bg-white","shadow","dark:bg-gray-700"],[1,"p-4","text-center","md:p-5"],["aria-hidden","true","xmlns","http://www.w3.org/2000/svg","fill","none","viewBox","0 0 20 20",1,"mx-auto","mb-4","h-12","w-12","text-gray-400","dark:text-gray-200"],["stroke","currentColor","stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M10 11V6m0 8h.01M19 10a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"],[1,"mb-5","text-lg","font-normal","text-gray-500","dark:text-gray-400"],["type","button",1,"bg-primary-700","hover:bg-primary-800","focus:ring-primary-300","dark:bg-primary-600","dark:hover:bg-primary-700","dark:focus:ring-primary-800","inline-flex","items-center","rounded-lg","px-5","py-2.5","text-center","text-sm","font-medium","text-white","focus:outline-none","focus:ring-4",3,"click"],["data-drawer-dismiss","add-transaction-drawer","type","button",1,"ms-3","rounded-lg","border","border-gray-200","bg-white","px-5","py-2.5","text-sm","font-medium","text-gray-900","hover:bg-gray-100","hover:text-blue-700","focus:z-10","focus:outline-none","focus:ring-4","focus:ring-gray-100","dark:border-gray-600","dark:bg-gray-800","dark:text-gray-400","dark:hover:bg-gray-700","dark:hover:text-white","dark:focus:ring-gray-700",3,"click"],[1,"m-4","flex","justify-between","rounded-lg","border","border-gray-200","bg-white","p-4","shadow","dark:border-gray-700","dark:bg-gray-800"],[1,"flex","flex-col"],[1,"mb-2","text-gray-500","dark:text-gray-400"],[1,"text-lg","font-extrabold"],[1,"mt-6"],[1,"ms-6","flex","flex-col"],[1,"text-lg","font-extrabold",3,"ngClass"],[1,"text-sm","font-normal"],[1,"relative","overflow-x-auto","shadow","sm:mx-4","sm:rounded-lg"],["role","status",1,"flex","flex-1","flex-col","items-center","justify-center","text-gray-500","dark:text-gray-400"],[1,"w-screen","text-left","text-sm","text-gray-500","sm:w-full","rtl:text-right","dark:text-gray-400"],["width","100%"],["width","0%"],[1,"whitespace-nowrap","bg-gray-50","text-center","text-xs","uppercase","text-gray-700","dark:bg-gray-700","dark:text-gray-400"],["scope","col",1,"p-2","text-left","sm:p-4"],[1,"whitespace-nowrap"],["scope","col",1,"p-2","sm:p-4"],[1,"cursor-pointer","border-b","bg-white","dark:border-gray-700","dark:bg-gray-800",3,"routerLink"],["scope","row",1,"max-w-[1px]","p-2","font-normal","sm:p-4"],[1,"truncate","font-medium","text-gray-900","dark:text-white"],[1,"ps-0.5"],[1,"p-2","text-center","sm:p-4",3,"ngClass"],["aria-hidden","true","xmlns","http://www.w3.org/2000/svg","fill","none","viewBox","0 0 20 20",1,"mx-auto","mb-4","h-12","w-12"],["aria-hidden","true","viewBox","0 0 100 101","fill","none","xmlns","http://www.w3.org/2000/svg",1,"h-8","w-8","animate-spin","fill-blue-600","text-gray-200","dark:text-gray-600"],[1,"py-2","text-sm","text-gray-700","dark:text-gray-200"],[1,"block","cursor-pointer","px-4","py-2","hover:bg-gray-100","dark:hover:bg-gray-600","dark:hover:text-white"],[1,"mt-4","text-sm","text-red-600","dark:text-red-500"]],template:function(r,n){if(r&1){let l=Se();o(0,"div",1),E(1,wi,1,1),_(2,"async"),o(3,"div",2)(4,"div",3)(5,"div",4)(6,"label",5),s(7,"Search"),a(),o(8,"div",6)(9,"div",7),C(),o(10,"svg",8),m(11,"path",9),a()(),b(),o(12,"input",10),T("ngModelChange",function(c){return h(l),O(n.portfolioSearchQuery,c)||(n.portfolioSearchQuery=c),f(c)}),a()()()(),o(13,"div",11)(14,"div",12)(15,"div",13)(16,"button",14),C(),o(17,"svg",15),m(18,"path",16),a(),s(19," Sort "),o(20,"svg",17),m(21,"path",18),a()(),b(),o(22,"div",19)(23,"ul",20)(24,"li",21),p("click",function(){return h(l),f(n.sortPortfolio(n.PortfolioSortType.NAME,n.PortfolioSortOrder.ASC))}),o(25,"div",22),s(26," Company Name "),C(),o(27,"svg",23),m(28,"path",24),a()()(),b(),o(29,"li",21),p("click",function(){return h(l),f(n.sortPortfolio(n.PortfolioSortType.NAME,n.PortfolioSortOrder.DSC))}),o(30,"div",22),s(31," Company Name "),C(),o(32,"svg",23),m(33,"path",25),a()()(),b(),o(34,"li",21),p("click",function(){return h(l),f(n.sortPortfolio(n.PortfolioSortType.DAY_PROFIT_LOSS,n.PortfolioSortOrder.ASC))}),o(35,"div",22),s(36," Day Profit/Loss "),C(),o(37,"svg",23),m(38,"path",24),a()()(),b(),o(39,"li",21),p("click",function(){return h(l),f(n.sortPortfolio(n.PortfolioSortType.DAY_PROFIT_LOSS,n.PortfolioSortOrder.DSC))}),o(40,"div",22),s(41," Day Profit/Loss "),C(),o(42,"svg",23),m(43,"path",25),a()()(),b(),o(44,"li",21),p("click",function(){return h(l),f(n.sortPortfolio(n.PortfolioSortType.OVERALL_PROFIT_LOSS,n.PortfolioSortOrder.ASC))}),o(45,"div",22),s(46," Overall Profit/Loss "),C(),o(47,"svg",23),m(48,"path",24),a()()(),b(),o(49,"li",21),p("click",function(){return h(l),f(n.sortPortfolio(n.PortfolioSortType.OVERALL_PROFIT_LOSS,n.PortfolioSortOrder.DSC))}),o(50,"div",22),s(51," Overall Profit/Loss "),C(),o(52,"svg",23),m(53,"path",25),a()()()()()(),b(),o(54,"div",13)(55,"button",26),C(),o(56,"svg",27),m(57,"path",28),a(),s(58," Filter "),o(59,"svg",17),m(60,"path",18),a()(),b(),o(61,"div",29)(62,"ul",30)(63,"li",21),p("click",function(){return h(l),f(n.clearPortfolioFilters())}),s(64," All "),a(),o(65,"li",21),p("click",function(){return h(l),f(n.filterPortfolio(n.PortfolioFilter.DAY_GAINERS))}),s(66," Day Gainers "),a(),o(67,"li",21),p("click",function(){return h(l),f(n.filterPortfolio(n.PortfolioFilter.DAY_LOSERS))}),s(68," Day Losers "),a(),o(69,"li",21),p("click",function(){return h(l),f(n.filterPortfolio(n.PortfolioFilter.OVERALL_GAINERS))}),s(70," Overall Gainers "),a(),o(71,"li",21),p("click",function(){return h(l),f(n.filterPortfolio(n.PortfolioFilter.OVERALL_LOSERS))}),s(72," Overall Losers "),a()()()()(),o(73,"div",12)(74,"button",31),p("click",function(){return h(l),f(n.openAddTransactionDrawer(n.TransactionType.BUY))}),s(75," Buy "),a(),o(76,"button",31),p("click",function(){return h(l),f(n.openAddTransactionDrawer(n.TransactionType.SELL))}),s(77," Sell "),a()()()(),E(78,Si,2,1),_(79,"async"),E(80,Ei,6,0,"div",32),o(81,"div",33),p("appDrawerClosed",function(){return h(l),f(n.resetTransactionForm())}),o(82,"h5",34),s(83),a(),o(84,"button",35),p("click",function(){return h(l),f(n.resetTransactionForm())}),C(),o(85,"svg",36),m(86,"path",37),a(),b(),o(87,"span",38),s(88,"Close"),a()(),o(89,"div",39)(90,"div",40)(91,"label",41),s(92,"Company"),a(),o(93,"input",42),T("ngModelChange",function(c){return h(l),O(n.name,c)||(n.name=c),f(c)}),a(),o(94,"div",43),E(95,ki,1,1),_(96,"async"),a()(),o(97,"div")(98,"label",44),s(99,"Date"),a(),o(100,"div",40)(101,"div",45),C(),o(102,"svg",46),m(103,"path",47),a()(),b(),o(104,"input",48,0),T("ngModelChange",function(c){return h(l),O(n.date,c)||(n.date=c),f(c)}),a()()(),o(106,"div")(107,"label",49),s(108,"Price"),a(),o(109,"input",50),T("ngModelChange",function(c){return h(l),O(n.price,c)||(n.price=c),f(c)}),a()(),o(110,"div")(111,"label",51),s(112,"Quantity"),a(),o(113,"input",52),T("ngModelChange",function(c){return h(l),O(n.quantity,c)||(n.quantity=c),f(c)}),a()(),o(114,"div")(115,"label",53),s(116,"Gross Amount"),a(),m(117,"input",54),a(),o(118,"div")(119,"label",55),s(120,"Charges (optional)"),a(),o(121,"input",56),T("ngModelChange",function(c){return h(l),O(n.charges,c)||(n.charges=c),f(c)}),a()(),o(122,"div")(123,"label",57),s(124,"Net Amount"),a(),m(125,"input",58),a(),E(126,Fi,3,1,"div"),o(127,"div",59)(128,"button",60),p("click",function(){return h(l),f(n.addTransaction())}),s(129),a(),o(130,"button",61),p("click",function(){return h(l),f(n.resetTransactionForm())}),s(131," Cancel "),a()()()(),o(132,"div",62)(133,"div",63),C(),o(134,"svg",64),m(135,"path",65)(136,"path",66),a(),s(137," Processing... "),a()(),b(),o(138,"div",67)(139,"div",68)(140,"div",69)(141,"div",70),C(),o(142,"svg",71),m(143,"path",72),a(),b(),o(144,"h3",73),s(145," Transaction added successfully!"),m(146,"br"),s(147,"Do you want to add one more transaction? "),a(),o(148,"button",74),p("click",function(){return h(l),f(n.closeStatusModal(!0))}),s(149," Yes "),a(),o(150,"button",75),p("click",function(){return h(l),f(n.closeStatusModal())}),s(151," No "),a()()()()()()}if(r&2){let l,d,c;u(),k((l=ae(2,18,n.portfolio$))?1:-1,l),u(11),I("ngModel",n.portfolioSearchQuery),u(66),k((d=ae(79,20,n.portfolio$))?78:80,d),u(5),w(" ",n.transactionType===n.TransactionType.SELL?"Sell":"Buy"," Stock "),u(10),I("ngModel",n.name),u(2),k((c=ae(96,22,n.stockSearchResults$))?95:-1,c),u(9),I("ngModel",n.date),u(5),I("ngModel",n.price),u(4),I("ngModel",n.quantity),u(4),A("value",n.gross()),u(4),I("ngModel",n.charges),u(4),A("value",n.net()),u(),k(n.transactionFormError?126:-1),u(3),w(" ",n.transactionType===n.TransactionType.SELL?"Sell":"Buy"," "),u(3),X("hidden",!n.showTransactionProgress),u(6),X("hidden",!n.showStatusModal)}},dependencies:[at,rt,nt,ot,Tt,he,Re,Pt,Be,Le,st,Nt],encapsulation:2,changeDetection:0})}}return i})();export{Pr as PortfolioPage};