@sarafapp/iron_core 1.0.62 → 1.0.63
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.
- package/dist/IronCore.js +3 -3
- package/dist/IronCore.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/IronCore.js
CHANGED
|
@@ -1626,13 +1626,13 @@ class us {
|
|
|
1626
1626
|
return e.key !== this.currentSortDetail.getValue().key || e.order !== this.currentSortDetail.getValue().order;
|
|
1627
1627
|
}
|
|
1628
1628
|
async handleClick(e) {
|
|
1629
|
-
this.tableSource.onRowClick && await this.tableSource.onRowClick();
|
|
1629
|
+
this.tableSource.onRowClick && await this.tableSource.onRowClick(e);
|
|
1630
1630
|
}
|
|
1631
1631
|
async handleMetaClick(e) {
|
|
1632
|
-
this.tableSource.onRowMetaClick && await this.tableSource.onRowMetaClick;
|
|
1632
|
+
this.tableSource.onRowMetaClick && await this.tableSource.onRowMetaClick(e);
|
|
1633
1633
|
}
|
|
1634
1634
|
async handleDoubleClick(e) {
|
|
1635
|
-
this.tableSource.onRowDoubleClick && await this.tableSource.onRowDoubleClick();
|
|
1635
|
+
this.tableSource.onRowDoubleClick && await this.tableSource.onRowDoubleClick(e);
|
|
1636
1636
|
}
|
|
1637
1637
|
hasAnyAction() {
|
|
1638
1638
|
for (const e of this.rows.getValue())
|
package/dist/IronCore.umd.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(o,C){typeof exports=="object"&&typeof module<"u"?C(exports,require("dayjs"),require("vue"),require("json2typescript"),require("pinia")):typeof define=="function"&&define.amd?define(["exports","dayjs","vue","json2typescript","pinia"],C):(o=typeof globalThis<"u"?globalThis:o||self,C(o.IronCore={},o.dayjs,o.Vue,o.json2typescript,o.pinia))})(this,function(o,C,p,M,Xe){"use strict";var le=(t=>(t.BankCard="####-####-####-####",t.Iban="##-####-####-####-####-####-##",t))(le||{}),J=(t=>(t.FullDate="YYYY/M/D HH:mm",t.SimpleDate="YYYY/M/D",t.CompactGregorianDate="YYYYMMDD",t.ShortJalaliDate="YYMM",t.JustHour="HH:mm:ss",t))(J||{});const Qe=[{62198619:{persian:"بلو",english:"blue"}},{603799:{persian:"بانک ملی ایران",english:"melli"}},{589210:{persian:"بانک سپه",english:"sepah"}},{627648:{persian:"بانک توسعه صادرات",english:"export-development"}},{627961:{persian:"بانک صنعت و معدن",english:"industry-mine"}},{603770:{persian:"بانک کشاورزی",english:"agriculture"}},{628023:{persian:"بانک مسکن",english:"housing"}},{627760:{persian:"پست بانک ایران",english:"post"}},{502908:{persian:"بانک توسعه تعاون",english:"development-cooperation"}},{627412:{persian:"بانک اقتصاد نوین",english:"eghtesad-novin"}},{622106:{persian:"بانک پارسیان",english:"parsian"}},{502229:{persian:"بانک پاسارگاد",english:"pasargad"}},{639599:{persian:"بانک قوامین",english:"ghavamin"}},{627488:{persian:"بانک کارآفرین",english:"karafarin"}},{621986:{persian:"بانک سامان",english:"saman"}},{639346:{persian:"بانک سینا",english:"sina"}},{639607:{persian:"بانک سرمایه",english:"sarmayeh"}},{504706:{persian:"بانک شهر",english:"shahr"}},{502806:{persian:"بانک شهر",english:"shahr"}},{502938:{persian:"بانک دی",english:"day"}},{603769:{persian:"بانک صادرات",english:"saderat"}},{610433:{persian:"بانک ملت",english:"mellat"}},{627353:{persian:"بانک تجارت",english:"tejarat"}},{585983:{persian:"بانک تجارت",english:"tejarat"}},{589463:{persian:"بانک رفاه",english:"refah"}},{627381:{persian:"بانک انصار",english:"ansar"}},{639370:{persian:"بانک مهر اقتصاد",english:"mehr-eqtesad"}},{505801:{persian:"موسسه اعتباری کوثر",english:"kosar"}},{606373:{persian:"بانک قرض الحسنه مهرایرانیان",english:"mehr"}},{186214:{persian:"بانک آینده",english:"ayandeh"}},{504172:{persian:"بانک قرض الحسنه رسالت",english:"resalat"}},{505416:{persian:"بانک گردشگری",english:"tourism"}},{505785:{persian:"بانک ایرانزمین",english:"iran-zamin"}},{505809:{persian:"بانک خاورمیانه",english:"middle-east"}},{585947:{persian:"بانک خاورمیانه",english:"middle-east"}},{604932:{persian:"بانک سپه",english:"sepah"}},{627961:{persian:"بانک صنعت و معدن",english:"industry-mine"}},{636214:{persian:"بانک آینده",english:"ayandeh"}},{636795:{persian:"بانک مرکزی",english:"markazi"}},{636949:{persian:"بانک حکمت ایرانیان",english:"hekmat-iranian"}},{639217:{persian:"بانک کشاورزی",english:"agriculture"}}],et=[{"010":{persian:"بانک مرکزی",english:"markazi"}},{"011":{persian:"بانک صنعت و معدن",english:"industry-mine"}},{"012":{persian:"بانک ملت",english:"mellat"}},{"013":{persian:"بانک رفاه",english:"refah"}},{"014":{persian:"بانک مسکن",english:"housing"}},{"015":{persian:"بانک سپه",english:"sepah"}},{"016":{persian:"بانک کشاورزی",english:"agriculture"}},{"017":{persian:"بانک ملّی ایران",english:"melli"}},{"018":{persian:"بانک تجارت",english:"tejarat"}},{"019":{persian:"بانک صادرات",english:"saderat"}},{"020":{persian:"بانک توسعه صادرات",english:"export-development"}},{"021":{persian:"پست بانک",english:"post"}},{"053":{persian:"بانک کارآفرین",english:"karafarin"}},{"054":{persian:"بانک پارسیان",english:"parsian"}},{"055":{persian:"بانک اقتصاد نوین",english:"eghtesad-novin"}},{"056":{persian:"بانک سامان",english:"saman"}},{"057":{persian:"بانک پاسارگاد",english:"pasargad"}},{"058":{persian:"بانک سرمایه",english:"sarmayeh"}},{"059":{persian:"بانک سینا",english:"sina"}},{"060":{persian:"بانک قرض الحسنه مهرایرانیان",english:"mehr"}},{"061":{persian:"بانک شهر",english:"shahr"}},{"062":{persian:"بانک آینده",english:"ayandeh"}},{"065":{persian:"بانک حکمت ایرانیان",english:"hekmat-iranian"}},{"066":{persian:"بانک دی",english:"day"}},{"069":{persian:"بانک ایران زمین",english:"iran-zamin"}},{"070":{persian:"بانک قرض الحسنه رسالت",english:"resalat"}},{"078":{persian:"بانک خاورمیانه",english:"middle-east"}}];var tt=(t=>(t.Normal="YYYY-MM-DD",t.ContainsHour="YYYY-MM-DD HH:mm",t.OnlyHour="HH:mm",t))(tt||{});function ce(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ue={exports:{}},Ot=ue.exports,st;function Tt(){return st||(st=1,function(t,e){(function(s,r){t.exports=r()})(Ot,function(){return function(s,r){r.prototype.weekday=function(n){var i=this.$locale().weekStart||0,a=this.$W,c=(a<i?a+7:a)-i;return this.$utils().u(n)?c:this.subtract(c,"day").add(n,"day")}}})}(ue)),ue.exports}var Lt=Tt();const Pt=ce(Lt);var he={exports:{}},kt=he.exports,rt;function Vt(){return rt||(rt=1,function(t,e){(function(s,r){t.exports=r()})(kt,function(){var s="week",r="year";return function(n,i,a){var c=i.prototype;c.week=function(l){if(l===void 0&&(l=null),l!==null)return this.add(7*(l-this.week()),"day");var u=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var v=a(this).startOf(r).add(1,r).date(u),f=a(this).endOf(s);if(v.isBefore(f))return 1}var g=a(this).startOf(r).date(u).startOf(s).subtract(1,"millisecond"),S=this.diff(g,s,!0);return S<0?a(this).startOf("week").week():Math.ceil(S)},c.weeks=function(l){return l===void 0&&(l=null),this.week(l)}}})}(he)),he.exports}var Ft=Vt();const Nt=ce(Ft);var de={exports:{}},$t=de.exports,nt;function Bt(){return nt||(nt=1,function(t,e){(function(s,r){t.exports=r()})($t,function(){return function(s,r){r.prototype.weekYear=function(){var n=this.month(),i=this.week(),a=this.year();return i===1&&n===11?a+1:n===0&&i>=52?a-1:a}}})}(de)),de.exports}var Ut=Bt();const jt=ce(Ut);var fe={exports:{}},Yt=fe.exports,it;function Ht(){return it||(it=1,function(t,e){(function(s,r){t.exports=r(C)})(Yt,function(s){function r(a){return a&&typeof a=="object"&&"default"in a?a:{default:a}}var n=r(s),i={name:"fa",weekdays:"یکشنبه_دوشنبه_سهشنبه_چهارشنبه_پنجشنبه_جمعه_شنبه".split("_"),weekdaysShort:"یکشنبه_دوشنبه_سهشنبه_چهارشنبه_پنجشنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekStart:6,months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),ordinal:function(a){return a},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"}};return n.default.locale(i,null,!0),i})}(fe)),fe.exports}var qt=Ht();const zt=ce(qt);function ve(t,e){return Jt(t)||Wt(t,e)||Gt()}function Jt(t){if(Array.isArray(t))return t}function Wt(t,e){var s=[],r=!0,n=!1,i=void 0;try{for(var a=t[Symbol.iterator](),c;!(r=(c=a.next()).done)&&(s.push(c.value),!(e&&s.length===e));r=!0);}catch(l){n=!0,i=l}finally{try{!r&&a.return!=null&&a.return()}finally{if(n)throw i}}return s}function Gt(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function at(t,e,s){e<=2&&(t-=1,e+=12);var r=Math.floor(t/100),n=2-r+Math.floor(r/4),i=Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+s+n-1524.5;return i}function xt(t){t=t+.5;var e=Math.floor(t),s=t-e,r=e;if(e>=2299161){var n=Math.floor((e-186721625e-2)/36524.25);r=e+1+n-Math.floor(n/4)}var i=r+1524,a=Math.floor((i-122.1)/365.25),c=Math.floor(365.25*a),l=Math.floor((i-c)/30.6001),u=i-c-Math.floor(30.6001*l)+s,v=l<14?l-1:l-13,f=v>2?a-4716:a-4715;return Xt(f,v,u)}function Kt(t){t=t+.5;var e=Math.floor(t),s=t-e,r=e;if(e>=2299161){var n=Math.floor((e-186721625e-2)/36524.25);r=e+1+n-Math.floor(n/4)}var i=r+1524,a=Math.floor((i-122.1)/365.25),c=Math.floor(365.25*a),l=Math.floor((i-c)/30.6001),u=i-c-Math.floor(30.6001*l)+s,v=l<14?l-1:l-13,f=v>2?a-4716:a-4715;return[Math.floor(f),Math.floor(v),Math.floor(u)]}function Zt(t,e,s){var r=[31,28,31,30,31,30,31,31,30,31,30,31],n=[31,31,31,31,31,31,30,30,30,30,30,29];function i(S,A){return Math.floor(S/A)}t-=979;for(var a=365*t+i(t,33)*8+i(t%33+3,4),c=0;c<e-1;++c)a+=n[c];a+=s-1;var l=a+79,u=1600+400*i(l,146097);l=l%146097;var v=!0;for(l>=36525&&(l--,u+=100*i(l,36524),l=l%36524,l>=365?l++:v=!1),u+=4*i(l,1461),l%=1461,l>=366&&(v=!1,l--,u+=i(l,365),l=l%365),c=0;l>=r[c]+(c==1&&v);c++)l-=r[c]+(c==1&&v);var f=c+1,g=l+1;return at(u,f,g)}function Xt(t,e,s){var r=[31,28,31,30,31,30,31,31,30,31,30,31],n=[31,31,31,31,31,31,30,30,30,30,30,29];function i(ee,te){return Math.floor(ee/te)}for(var a=t-1600,c=e-1,l=s-1,u=365*a+i(a+3,4)-i(a+99,100)+i(a+399,400),v=0;v<c;++v)u+=r[v];c>1&&(t%4==0&&t%100!=0||t%400==0)&&u++,u+=l;var f=u-79,g=i(f,12053);f%=12053;var S=979+33*g+4*i(f,1461);f%=1461,f>=366&&(S+=i(f-1,365),f=(f-1)%365);for(var A=0;A<11&&f>=n[A];++A)f-=n[A];var X=A+1,Q=f+1;return[S,X,Q]}var me={J:function(e,s,r){return xt(at(e,s,r))},G:function(e,s,r){return Kt(Zt(e,s,r))}},Qt=/^(\d{4})[-/]?(\d{1,2})[-/]?(\d{0,2})(.*)?$/,es=/\[.*?\]|jY{2,4}|jM{1,4}|jD{1,2}|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,Le="date",W="day",F="month",N="year",ot="week",ts="YYYY-MM-DDTHH:mm:ssZ",ss={jmonths:"فروردین_اردیبهشت_خرداد_تیر_مرداد_شهریور_مهر_آبان_آذر_دی_بهمن_اسفند".split("_")},rs=function(t,e,s){var r=e.prototype,n=r.$utils(),i=function(d){return d.$C==="jalali"},a=n.prettyUnit||n.p,c=n.isUndefined||n.u,l=n.padStart||n.s,u=n.monthDiff||n.m,v=n.absFloor||n.a,f=function(d){return function(){var m=d.bind(this).apply(void 0,arguments);return m.$C=this.$C,m.isJalali()&&m.InitJalali(),m}};r.startOf=f(r.startOf),r.endOf=f(r.endOf),r.add=f(r.add),r.subtract=f(r.subtract),r.set=f(r.set);var g=r.parse,S=r.init,A=r.startOf,X=r.$set,Q=r.add,ee=r.format,te=r.diff,xe=r.year,Ke=r.month,_e=r.date,Ze=r.daysInMonth,ae=r.toArray;s.$C="gregory",s.$fdow=6,s.calendar=function(h){return s.$C=h,s},r.calendar=function(h){var d=this.clone();return d.$C=h,d.isJalali()&&d.InitJalali(),d},r.isJalali=function(){return i(this)},s.en.jmonths="Farvardin_Ordibehesht_Khordaad_Tir_Mordaad_Shahrivar_Mehr_Aabaan_Aazar_Dey_Bahman_Esfand".split("_"),s.locale("fa",Object.assign({},zt,{},ss),!0);var se=function(d,m){return s(d,{locale:m.$L,utc:m.$u,calendar:m.$C})};r.init=function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};S.bind(this)(h),this.isJalali()&&this.InitJalali()},r.parse=function(h){var d;if(this.$C=h.calendar||this.$C||s.$C,h.jalali&&typeof h.date=="string"&&/.*[^Z]$/i.test(h.date)&&(d=h.date.match(Qt))){var m=me.G(parseInt(d[1],10),parseInt(d[2],10),parseInt(d[3]||1,10)),b=ve(m,3),I=b[0],w=b[1],R=b[2];h.date="".concat(I,"-").concat(w,"-").concat(R).concat(d[4]||"")}return g.bind(this)(h)},r.InitJalali=function(){var h=me.J(this.$y,this.$M+1,this.$D),d=ve(h,3),m=d[0],b=d[1],I=d[2];this.$jy=m,this.$jM=b-1,this.$jD=I},r.startOf=function(h,d){var m=this;if(!i(this))return A.bind(this)(h,d);var b=c(d)?!0:d,I=a(h),w=function(re,q){var P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:m.$jy,Oe=me.G(P,q+1,re),z=ve(Oe,3),oe=z[0],Te=z[1],Lr=z[2],Et=se(new Date(oe,Te-1,Lr),m);return(b?Et:Et.endOf(W)).$set("hour",1)},R=(this.$W+(7-s.$fdow))%7;switch(I){case N:return b?w(1,0):w(0,0,this.$jy+1);case F:return b?w(1,this.$jM):w(0,(this.$jM+1)%12,this.$jy+parseInt((this.$jM+1)/12,10));case ot:return b?w(this.$jD-R,this.$jM):w(this.$jD+(6-R),this.$jM);default:return A.bind(this)(h,d)}},r.$set=function(h,d){var m=this;if(!i(this))return X.bind(this)(h,d);var b=a(h),I=function(R,Ee){var re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:m.$jy,q=me.G(re,Ee+1,R),P=ve(q,3),Oe=P[0],z=P[1],oe=P[2];return m.$d.setFullYear(Oe),m.$d.setMonth(z-1),m.$d.setDate(oe),m};switch(b){case Le:case W:I(d,this.$jM);break;case F:I(this.$jD,d);break;case N:I(this.$jD,this.$jM,d);break;default:return X.bind(this)(h,d)}return this.init(),this},r.add=function(h,d){var m=this;if(!i(this))return Q.bind(this)(h,d);h=Number(h);var b=d&&(d.length===1||d==="ms")?d:a(d),I=function(z,oe){var Te=m.set(Le,1).set(z,oe+h);return Te.set(Le,Math.min(m.$jD,Te.daysInMonth()))};if(["M",F].indexOf(b)>-1){var w=this.$jM+h,R=w<0?-Math.ceil(-w/12):Math.floor(w/12),Ee=this.$jD,re=this.set(W,1).add(R,N).set(F,w-R*12);return re.set(W,Math.min(re.daysInMonth(),Ee))}if(["y",N].indexOf(b)>-1)return I(N,this.$jy);if(["d",W].indexOf(b)>-1){var q=new Date(this.$d);return q.setDate(q.getDate()+h),se(q,this)}if(["w",ot].indexOf(b)>-1){var P=new Date(this.$d);return P.setDate(P.getDate()+h*7),se(P,this)}return Q.bind(this)(h,d)},r.format=function(h,d){var m=this;if(!i(this))return ee.bind(this)(h,d);var b=h||ts,I=d||this.$locale(),w=I.jmonths;return b.replace(es,function(R){if(R.indexOf("[")>-1)return R.replace(/\[|\]/g,"");switch(R){case"YY":return String(m.$jy).slice(-2);case"YYYY":return String(m.$jy);case"M":return String(m.$jM+1);case"MM":return l(m.$jM+1,2,"0");case"MMM":return w[m.$jM].slice(0,3);case"MMMM":return w[m.$jM];case"D":return String(m.$jD);case"DD":return l(m.$jD,2,"0");default:return ee.bind(m)(R,d)}})},r.diff=function(h,d,m){if(!i(this))return te.bind(this)(h,d,m);var b=a(d),I=s(h),w=u(this,I);switch(b){case N:w/=12;break;case F:break;default:return te.bind(this)(h,d,m)}return m?w:v(w)},r.$g=function(h,d,m){return c(h)?this[d]:this.set(m,h)},r.year=function(h){return i(this)?this.$g(h,"$jy",N):xe.bind(this)(h)},r.month=function(h){return i(this)?this.$g(h,"$jM",F):Ke.bind(this)(h)},r.date=function(h){return i(this)?this.$g(h,"$jD",W):_e.bind(this)(h)},r.daysInMonth=function(){return i(this)?this.endOf(F).$jD:Ze.bind(this)()},ae&&(r.toArray=function(){return i(this)?[this.$jy,this.$jM,this.$jD,this.$H,this.$m,this.$s,this.$ms]:ae.bind(this)()}),r.clone=function(){return se(this.toDate(),this)}};const ns={ordinal(t){},relativeTime:void 0,name:"fa",weekdays:"یکشنبه_دوشنبه_سهشنبه_چهارشنبه_پنجشنبه_جمعه_شنبه".split("_"),weekdaysShort:"ی_د_س_چ_پ_ج_ش".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),months:"فروردین_اردیبهشت_خرداد_تیر_مرداد_شهریور_مهر_آبان_آذر_دی_بهمن_اسفند".split("_"),monthsShort:"فروردین_اردیبهشت_خرداد_تیر_مرداد_شهریور_مهر_آبان_آذر_دی_بهمن_اسفند".split("_"),weekStart:6,formats:{L:"YYYY/MM/DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"}};function lt(){C.extend(rs),C.calendar("jalali"),C.extend(Pt),C.extend(Nt),C.extend(jt),C.locale(ns,{},!0)}class is{constructor(e,s){this.start=e,this.end=s}}class as{constructor(e,s,r){this.maxDate=e,this.minDate=s,this.disabledDates=r}}class ${static standardToUnix(e){return Math.floor(new Date(e).getTime()/1e3)}static unixToStandard(e){return new Date(e*1e3).toString()}static getUnixEndOfDayInUnix(e){return C.unix(e).endOf("day").unix()}}class ne{static isDateDisabled(e,s){for(const r of e.disabledDates)if(ne.areUnixesInSameDate(r,s.unix()))return!0;return!!(e.maxDate&&ne.isDateGraterOrSame(e.maxDate,s.unix())||e.minDate&&ne.isDateLowerOrSame(e.minDate,s.unix()))}static areUnixesInSameDate(e,s){return $.getUnixEndOfDayInUnix(e)===$.getUnixEndOfDayInUnix(s)}static isDateGraterOrSame(e,s){return $.getUnixEndOfDayInUnix(s)>=$.getUnixEndOfDayInUnix(e)}static isDateLowerOrSame(e,s){return $.getUnixEndOfDayInUnix(s)<=$.getUnixEndOfDayInUnix(e)}}lt();class _{static toCurrency(e,s){return e.toLocaleString("en-US",s)}static toCurrencyWithDotSeparator(e){return _.toCurrency(e).replaceAll(",",".")}static applyMask(e,s){let r="",n=0,i=0;for(;n<e.length;){if(e[n]==="#"){if(i>=s.length)throw new Error("Value length does not match the format.");r+=s[i],i++}else r+=e[n];n++}if(i!==s.length)throw new Error("Value length does not match the format.");return r}static applyBankCardMask(e){return _.applyMask(le.BankCard,String(e))}static applyIbanMask(e){return _.applyMask(le.Iban,String(e))}static toEnglishDigits(e){const s=["۱","۲","۳","۴","۵","۶","۷","۸","۹","۰"],r=["١","٢","٣","٤","٥","٦","٧","٨","٩","٠"],n=["1","2","3","4","5","6","7","8","9","0"];return e.split("").map(i=>n[s.indexOf(i)]||n[r.indexOf(i)]||i).join("")}static mapUnixToDate(e,s){return C(new Date(e)).subtract(1,"day").format(s)}}var y=(t=>(t.FetchList="fetchList",t.AutoRefresh="autoRefresh",t.FetchItem="fetchItem",t.FetchLastItems="fetchLastItems",t.FetchPreviousItems="fetchPreviousItems",t.Create="CREATE",t.Update="UPDATE",t.Delete="DELETE",t.Search="SEARCH",t.Sort="SORT",t.Success="SUCCESS",t.Error="ERROR",t.Idle="IDLE",t))(y||{}),k=(t=>(t.Width="width",t.Height="height",t[t.DefaultWidth=500]="DefaultWidth",t[t.DefaultHeight=350]="DefaultHeight",t[t.MinimalAvailableSize=0]="MinimalAvailableSize",t))(k||{}),L=(t=>(t.ASC="ASC",t.DESC="DESC",t))(L||{}),ct=(t=>(t.ASC="ascend",t.DESC="descend",t))(ct||{}),ge=(t=>(t.Left="left",t.Right="right",t.Center="center",t))(ge||{}),pe=(t=>(t.Text="text",t))(pe||{}),ye=(t=>(t.Text="text",t.ACTION="action",t.Tag="tag",t.Iban="iban",t.BankCard="bankCard",t.Symbol="symbol",t.TradeDetail="tradeDetail",t.SymbolPrice="symbolPrice",t.TradeSymbol="tradeSymbol",t.Price="price",t.DynamicCurrencyPrice="dynamicCurrencyPrice",t.TradeDate="tradeDate",t.RequestResponseIdentity="requestResponseIdentity",t.Image="image",t))(ye||{}),Pe=(t=>(t[t.MINIMAL_LOADABLE_HEADER_COUNT=0]="MINIMAL_LOADABLE_HEADER_COUNT",t[t.DEFAULT_ITEM_COUNT_PER_PAGE=20]="DEFAULT_ITEM_COUNT_PER_PAGE",t.PAGINATION_POSITION="bottomCenter",t))(Pe||{});o.ApplicationTheme=(t=>(t.FontFamily="IRANSansX",t))(o.ApplicationTheme||{});var G=(t=>(t.Open="open",t.Close="close",t))(G||{}),ut=(t=>(t[t.NotFound=404]="NotFound",t[t.Unauthorized=401]="Unauthorized",t[t.ServerError=500]="ServerError",t))(ut||{}),ie=(t=>(t[t.Invalid=0]="Invalid",t[t.Valid=1]="Valid",t))(ie||{}),V=(t=>(t.Theme="theme",t.AccessList="accessList",t.Token="token",t.SSO_ACCESS_LIST="ssoAccessList",t))(V||{});o.ApplicationTheme=(t=>(t.Light="light",t.Dark="dark",t))(o.ApplicationTheme||{});var Se=(t=>(t.Dialog="dialog",t.Drawer="drawer",t.Module="module",t.Toast="toast",t))(Se||{}),ht=(t=>(t.USDT="USDT",t))(ht||{});class B{static getBankImageBaseOnCardInfo(e,s){return e===void 0?"/img/banks/shetab.png":s==="IBAN"?(e=_.toEnglishDigits(e.replace(/IR/g,"").split(" ").join("")),`/img/banks/${B.iban(e).english}.png`):(e=_.toEnglishDigits(e.replace(/ /g,"")),`/img/banks/${B.card(e).english}.png`)}static card(e){const s={persian:"نامشخص",english:"shetab"};if(e==null)return s;e=e.substring(0,6);try{const r=Qe.find(n=>Object.keys(n)[0]===e);return r===void 0?s:Object.values(r)[0]}catch{return s}}static iban(e){const s={persian:"نامشخص",english:"shetab"};if(e==null)return s;e=e.substring(2,5);try{const r=et.find(n=>Object.keys(n)[0]===e);return r===void 0?s:Object.values(r)[0]}catch{return s}}static async copyValueToClipboard(e){await navigator.clipboard.writeText(String(e))}static downloadBlob(e,s=B.extractFileNameFromHeader(e)){const r=document.createElement("a");r.href=URL.createObjectURL(e.data),r.download=s,r.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,composed:!0})),r.remove()}static extractFileNameFromHeader(e){var r,n,i,a;return((a=(r=e.headers["content-disposition"])==null?void 0:r.split("filename=")[1])==null?void 0:a.slice(1,((i=(n=e.headers["content-disposition"])==null?void 0:n.split("filename="))==null?void 0:i[1].length)-1))||"Saraf-File"}static removeSpacesFromString(e){return e&&typeof e.normalize=="function"&&(e=e.normalize("NFC")),e.replace(/[\s\u00A0\u1680\u180E\u2000-\u200A\u200B-\u200D\u2060\uFEFF\u2028\u2029\u202F\u205F\u3000]+/g,"")}static isArraySorted(e,s=n=>n,r=L.ASC){return e.every((n,i)=>e.length-1===i?!0:r===L.ASC?s(n)<=s(e[i+1]):s(n)>=s(e[i+1]))}}const j=class j{constructor(){this.availableAccesses=new Set}setAvailableAccesses(e){this.setAccessListToStorage(e);for(const s of e)this.availableAccesses.add(s)}setAccessListToStorage(e){localStorage.setItem(V.AccessList,JSON.stringify(e))}everyAccess(e){return e.every(s=>this.availableAccesses.has(s))}someAccess(e){return e.some(s=>this.availableAccesses.has(s))}clearAvailableAccesses(){this.availableAccesses.clear(),localStorage.removeItem(V.AccessList)}initialize(){const e=localStorage.getItem(V.AccessList);e!==null&&this.setAvailableAccesses(JSON.parse(e))}static GetInstance(){return j.Instance||(j.Instance=new j),j.Instance}};j.Instance=null;let x=j;class ke{constructor(){this.mounted=(e,s)=>{this.checkAccess(e,s.value)},this.updated=(e,s)=>{this.checkAccess(e,s.value)},this.checkAccess=(e,s)=>{this.hasAccess(s)||e.remove()},this.accessService=x.GetInstance()}}class os extends ke{hasAccess(e){return this.accessService.everyAccess(e)}}class ls extends ke{hasAccess(e){return this.accessService.someAccess(e)}}const Y=class Y{constructor(){this._accessLevels=new Map}initialize(){this.setAccessLevelFromStorage()}setAccessLevels(e){for(const s in e)this._accessLevels.set(s,new Set(e[s]));this.setAccessLevelsToStorage(e)}setAccessLevelsToStorage(e){localStorage.setItem(V.SSO_ACCESS_LIST,JSON.stringify(e))}getAccessLevelsFromStorage(){let e=localStorage.getItem(V.SSO_ACCESS_LIST);return e!==null?JSON.parse(e):e}getAccessLevelsOfScope(e){if(this._accessLevels.has(e))return this._accessLevels.get(e);throw new Error(`The scope is not exists ${e}`)}setAccessLevelFromStorage(){const e=this.getAccessLevelsFromStorage();e&&this.setAccessLevels(e)}everyAccess(e,s){const r=this.getAccessLevelsOfScope(e);return r?s.every(n=>r.has(n)):!1}someAccess(e,s){const r=this.getAccessLevelsOfScope(e);return r?s.some(n=>r.has(n)):!1}hasScope(e){return this._accessLevels.has(e)}clear(){localStorage.removeItem(V.SSO_ACCESS_LIST),this._accessLevels=new Map}static GetInstance(){return Y._instance||(Y._instance=new Y),Y._instance}};Y._instance=null;let we=Y;class Ve{constructor(){this._authorizationService=we.GetInstance(),this.mounted=this.mounted.bind(this),this.updated=this.updated.bind(this),this.hasAccess=this.hasAccess.bind(this),this.manageElement=this.manageElement.bind(this)}mounted(e,s,r){this.manageElement(e,s.arg,s.modifiers)}updated(e,s,r){this.manageElement(e,s.arg,s.modifiers)}manageElement(e,s,r){if(!this._authorizationService.hasScope(s)){e.remove();return}const n=this.getAccessLevels(s,r);this.hasAccess(s,n)||e.remove()}getAccessLevels(e,s){var n;let r=Object.keys(s);return r.length||(r=Array.from(((n=this._authorizationService.getAccessLevelsOfScope(e))==null?void 0:n.values())??[])),r}}class cs extends Ve{hasAccess(e,s){return this._authorizationService.everyAccess(e,s)}}class us extends Ve{hasAccess(e,s){return this._authorizationService.someAccess(e,s)}}class dt{constructor(){this.value=null,this.initialValue=null,this.name="",this.isValid=!1,this.isBlurSensitive=!1,this.isRequired=!1,this.isIncludeInRequestBody=!0,this.isChangeSensitive=!1,this.notValidMessage="",this.isEmptySensitive=!0,this.hasCustomValidationCheck=!1,this.shouldRemoveValidationMessageOnInteract=!1}}function hs(t){return t===1}function ds(t,e){return t-1===e}function ft(t){return String(t).length===0||t===null||t===void 0}function fs(t){t()}class vs{constructor(e,s){this.initialData=null,this.data=new dt,this._validators=[],this._id=Math.random(),this.data.value=s,this.data.name=e,this.shouldRunValidation()&&this.runValidation(!0)}shouldRunValidation(){return this.data.hasCustomValidationCheck?!1:this.data.isRequired?!0:!ft(this.data.value)}async runValidation(e=!1){for(const s of this._validators){const r=await s.validate(this.data.value);if(r){this.setFormToInvalidState(e,r);return}}this.setFormToValidState()}setFormToInvalidState(e,s){this.data.isValid=!1,(this.data.isChangeSensitive||e)&&this.setNotValidMessage(s)}setFormToValidState(){this.data.isValid=!0,this.setNotValidMessage("")}reset(){this.initialData?this.data=structuredClone(p.toRaw(this.initialData)):console.warn("The "+this.data.name+`input control has no initial data,
|
|
2
|
-
the initial data will be available after calling the [markAsInitial] method on this instance`)}markAsInitial(){this.initialData=structuredClone(p.toRaw(this.data))}setValidators(e){this._validators=e}getChangeSensitive(){return this.data.isChangeSensitive}setChangeSensitive(e){if(e&&this.data.shouldRemoveValidationMessageOnInteract)throw new Error("Input control "+this.getName()+" can not be both change sensitive and remove validation meessage on interact");this.data.isChangeSensitive=e}getIsBlurSensitive(){return this.data.isBlurSensitive}setIsBlurSensitive(e){this.data.isBlurSensitive=e}getIsRequired(){return this.data.isRequired}setIsRequired(e){this.data.isRequired=e}getIsValid(){return this.data.isValid}setIsValid(e){this.data.isValid=e}getIsIncludeInRequestBody(){return this.data.isIncludeInRequestBody}setIsIncludeInRequestBody(e){this.data.isIncludeInRequestBody=e}getNotValidMessage(){return this.data.notValidMessage}setNotValidMessage(e){this.data.notValidMessage=e}getName(){return this.data.name}setName(e){this.data.name=e}setId(e){this._id=e}getId(){return this._id}getIsEmptySensitive(){return this.data.isEmptySensitive}setIsEmptySensitive(e){this.data.isEmptySensitive=e}setHasCustomValidationCheck(e){this.data.hasCustomValidationCheck=e}setShouldRemoveValidationOnInteract(e){if(e&&this.data.isChangeSensitive)throw new Error("Input control "+this.getName()+" can not be both change sensitive and remove validation meessage on interact");this.data.shouldRemoveValidationMessageOnInteract=e}getShouldRemoveValidationOnInteract(){return this.data.shouldRemoveValidationMessageOnInteract}hasCustomValidationCheck(){return this.data.hasCustomValidationCheck}set value(e){this.data.value=e,this.shouldRunValidation()&&this.runValidation(),this.getShouldRemoveValidationOnInteract()&&this.setNotValidMessage("")}get value(){return this.data.value}}class ms{constructor(e){this._inputControl=e}setValidators(e){return this._inputControl.setValidators(e),this}setChangeSensitive(){return this._inputControl.setChangeSensitive(!0),this}setRequired(){return this._inputControl.setIsRequired(!0),this}setValid(){return this._inputControl.setIsValid(!0),this}setBlurSensitive(){return this._inputControl.setIsBlurSensitive(!0),this}setId(e){return this._inputControl.setId(e),this}removeEmptySensitive(){return this._inputControl.setIsEmptySensitive(!1),this}setHasCustomValidationCheck(){return this._inputControl.setHasCustomValidationCheck(!0),this}removeErrorOnInteract(){return this._inputControl.setShouldRemoveValidationOnInteract(!0),this}build(){return this._inputControl}}class gs{constructor(){this.mounted=(e,s)=>{s.value&&s.value.getIsBlurSensitive()&&(e.addEventListener("click",this.handleFocus.bind(this,s.value)),e.addEventListener("blur",this.handleBlur.bind(this,s.value),!0))},this.beforeUnMount=(e,s)=>{e.removeEventListener("blur",this.handleBlur.bind(this,s.value)),e.removeEventListener("click",this.handleFocus.bind(this,s.value))}}handleBlur(e){e.runValidation(!0)}handleFocus(e){e.value||e.getIsEmptySensitive()||e.setNotValidMessage("")}}class vt{shouldBeInRequestBody(e){return!0}}class ps{constructor(){this._inputControls=new Map,this._isValid=!1,this._id=Math.random()}getInputControlsAsArray(){return Array.from(this._inputControls.values())}async runValidation(e){let s=!0;for(const r of this.getInputControlsAsArray())if(e&&await r.runValidation(!0),!r.getIsValid()&&(s=!1,!e)){this._isValid=!1;return}this._isValid=s}addInputControls(e){for(const s of e)this._inputControls.set(s.getName(),s)}getInputControl(e){const s=this._inputControls.get(e);if(!s)throw new Error(`The provided input name (${e}}) has no controls.`);return s}resetControls(e){for(const s of e){const r=this._inputControls.get(s);r?r.reset():console.warn(`Provided input name ${s} has no controllers in this form`)}}resetAll(){for(const e of this.getInputControlsAsArray())e.reset()}createRequestBody(e=new vt){const s={};for(const r of this.getInputControlsAsArray())r.getIsIncludeInRequestBody()&&e.shouldBeInRequestBody(r.value)&&(s[r.getName()]=r.value);return s}setIsValid(e){this._isValid=e}getIsValid(){return this._isValid}setId(e){this._id=e}getId(){return this._id}}function ys(t,e=!1){const s=p.reactive(t),r=p.ref(ie.Invalid);return p.watch(()=>s.getInputControlsAsArray(),()=>{e||(s.runValidation(),s.getIsValid()?r.value=ie.Valid:r.value=ie.Invalid)},{immediate:!0,deep:!0}),{reactiveForm:s,validationStatus:r}}class Fe{constructor(e){this.timerId=null,this.setupInterval=this.setupInterval.bind(this),this.schedule=e}setupInterval(e){const s=this;this.timerId=setTimeout(async function r(){await s.schedule.runAction(),s.timerId=setTimeout(()=>{r()},e)},e)}clearInterval(){this.timerId&&clearInterval(this.timerId)}}const Ne="150px",$e=2,Ss={path:"id",key:"id",title:"عملیات",colspan:$e,width:Ne,cellType:ye.ACTION,align:ge.Center,headerType:pe.Text,accessLevel:null},mt={width:Ne,align:ge.Center,headerType:pe.Text,cellType:ye.Text,colspan:$e};class be{constructor(e,s){this.key=e,this.order=s}}class Be{aSort(e,s){return e.sort((r,n)=>{const i=r[s]??r,a=n[s]??n;if(typeof i=="string"&&typeof a=="string")return i.localeCompare(a);if(typeof i=="number"&&typeof a=="number")return i-a;throw new Error("Not supported data type")})}bSort(e,s){return e.sort((r,n)=>{const i=r[s]??r,a=n[s]??n;if(typeof i=="string"&&typeof a=="string")return a.localeCompare(i);if(typeof i=="number"&&typeof a=="number")return a-i;throw new Error("Not supported data type")})}}class ws{arrayOfObjectSort(e,s,r,n=new Be){return r===L.ASC?n.aSort(e,s):n.bSort(e,s)}arraySort(e,s,r=new Be){return s===L.ASC?r.aSort(e):r.bSort(e)}}class gt{constructor(e){this.currentPage=1,this.currentPageSize=20,this.currentSortDetail=new be("id",L.DESC),this.loadedRows=[],this.headerSchema=[],this.service=e,this.accessService=x.GetInstance()}addHeader(e){this.headerSchema.push(e)}async load(){this.headerSchema=this.filterItemsBaseOnAccessLevel(await this.loadHeader()),await this.loadRows()}filterItemsBaseOnAccessLevel(e){return e.filter(s=>s.hasAccess?s.hasAccess():!0)}async sort(e){this.shouldSendSortRequest(e)&&(this.currentSortDetail=e,this.loadedRows=(await this.handleSort(this.currentSortDetail)).items)}shouldSendSortRequest(e){return e.key!==this.currentSortDetail.key||e.order!==this.currentSortDetail.order}async paginate(e,s){this.shouldSendPaginationRequest(e,s)&&(this.currentPage=e,this.currentPageSize=s,this.loadedRows=(await this.handlePagination(this.currentPage,this.currentPageSize)).items)}shouldSendPaginationRequest(e,s){return this.currentPage!==e||this.currentPageSize!==s}async loadRows(){return this.loadedRows=(await this.service.fetchRows()).items,this.loadedRows}getData(){return this.service.getData()}async handleSort(e){return await this.service.sort(e)}async handlePagination(e,s){return await this.service.paginate(e,s)}getItemCountPerPage(){return Pe.DEFAULT_ITEM_COUNT_PER_PAGE}isLoading(){const e=this.getLoadingStatuses();return e.has(y.Search)||e.has(y.FetchList)||e.has(y.Sort)||e.has(y.FetchLastItems)||e.has(y.FetchPreviousItems)}getLoadingStatuses(){return this.getData().loadingStatus}hasAnyAction(){for(const e of this.loadedRows)if(this.getAccessedActions(e).length)return!0;return!1}getAccessedActions(e){return this.filterItemsBaseOnAccessLevel(this.getActions(e))}getActions(e){return[]}getScrollDetail(){return null}isExpandable(){return!1}async handleClick(e){}async handleMetaClick(e){}async handleDoubleClick(e){}async onDestroy(){}async loadHeader(){throw new Error("No header provided for the table.")}loadSummarySchema(){return{summaryTitle:"",summaryItems:[]}}}class E{constructor(e){this.observers=[],this.attach=this.attach.bind(this),this.detach=this.detach.bind(this),this.notify=this.notify.bind(this),this.notifyObject=this.notifyObject.bind(this),this.next=this.next.bind(this),this.getValue=this.getValue.bind(this),this.next(e)}attach(e){this.observers.push(e),this.notifyObject(e)}detach(e){this.observers=this.observers.filter(s=>s!==e)}notify(){for(const e of this.observers)this.notifyObject(e)}notifyObject(e){typeof e=="function"?e(this._value):e.update(this._value)}next(e){typeof e=="function"?this._value=e(this._value):this._value=e,this.notify()}getValue(){return this._value}}class bs extends gt{constructor(e){super(e),this.selectedRows=new E(new Map),this.rowSelect=this.rowSelect.bind(this),this.selectAll=this.selectAll.bind(this),this.isEveryRowSelected=this.isEveryRowSelected.bind(this),this.handlePagination=this.handlePagination.bind(this),this.clearAllSelectedItems=this.clearAllSelectedItems.bind(this),this.getSelectedRows=this.getSelectedRows.bind(this),this.getSelectedRowsAsArray=this.getSelectedRowsAsArray.bind(this),this.getSelectedRowIds=this.getSelectedRowIds.bind(this)}rowSelect(e){this.getSelectedRowsValue().has(e.id)?(this.getSelectedRowsValue().delete(e.id),this.selectedRows.next(this.selectedRows.getValue())):(this.selectedRows.getValue().set(e.id,e),this.selectedRows.next(this.selectedRows.getValue()))}selectAll(){if(this.isEveryRowSelected())this.clearAllSelectedItems();else for(const e of this.loadedRows)this.selectedRows.getValue().set(e.id,e),this.selectedRows.next(this.selectedRows.getValue())}isEveryRowSelected(){return this.getSelectedRowsValue().size===this.currentPageSize||this.loadedRows.length===this.getSelectedRowsValue().size}async handlePagination(e,s){return this.clearAllSelectedItems(),await super.handlePagination(e,s)}async handleSort(e){return this.clearAllSelectedItems(),await super.handleSort(e)}clearAllSelectedItems(){this.selectedRows.getValue().clear(),this.selectedRows.next(this.selectedRows.getValue())}getSelectedRows(){return this.selectedRows}getSelectedRowsAsArray(){return Array.from(this.selectedRows.getValue().values())}getSelectedRowIds(){return Array.from(this.selectedRows.getValue().keys())}getSelectedRowsValue(){return this.selectedRows.getValue()}}function Is(t){return{...mt,...t}}function As(t){return function(s,r){s.constructor.prototype.headers||(s.constructor.prototype.headers=[]),s.constructor.prototype.headers.push({path:r,...t})}}function Ds(t){return function(s){async function r(){return s.prototype._table=this,s.prototype.headers}function n(c){const l=[],u=s.prototype.actions||[];for(const v of u){if(!v.isAvailable(c))continue;const f={handler:v.handler.bind(c),accessLevel:v.accessLevel,actionName:v.actionName};l.push(f)}return l}async function i(c){s.prototype.rowClick&&await s.prototype.rowClick.call(c)}async function a(){s.prototype.tableDestroy&&await s.prototype.tableDestroy()}t.prototype.loadHeader=r,t.prototype.getActions=n,t.prototype.handleClick=i,t.prototype.onDestroy=a}}function Rs(t){return function(s,r,n){s.constructor.prototype.actions||(s.constructor.prototype.actions=[]),t.handler=n.value,s.constructor.prototype.actions.push(t)}}function Cs(){return function(e,s,r){e.constructor.prototype.tableDestroy=r.value}}function Ms(){return function(e,s,r){e.constructor.prototype.rowClick=r.value}}class _s{constructor(){this.observers=[]}attach(e){this.observers.push(e)}detach(e){this.observers=this.observers.filter(s=>s!==e)}notify(){for(const e of this.observers)e.update(this)}}class pt{constructor(e){this.rows=new E([]),this.headerSchema=new E([]),this.currentPage=new E(1),this.currentPageSize=new E(20),this.totalItems=new E(0),this.currentSortDetail=new E(new be("id",L.DESC)),this.scrollDetail=new E(null),this.isExpandable=new E(!1),this.tableSource=e,this.accessService=x.GetInstance(),this.load=this.load.bind(this),this.paginate=this.paginate.bind(this),this.shouldSendSortRequest=this.shouldSendSortRequest.bind(this),this.sort=this.sort.bind(this),this.handleClick=this.handleClick.bind(this),this.handleMetaClick=this.handleMetaClick.bind(this),this.handleDoubleClick=this.handleDoubleClick.bind(this),this.hasAnyAction=this.hasAnyAction.bind(this),this.loadSummarySchema=this.loadSummarySchema.bind(this),this.filterItemsBaseOnAccessLevel=this.filterItemsBaseOnAccessLevel.bind(this),this.paginate=this.paginate.bind(this),this.shouldSendPaginationRequest=this.shouldSendPaginationRequest.bind(this),this.getRowActions=this.getRowActions.bind(this),this.onDestroy=this.onDestroy.bind(this)}async load(){this.rows.next(await this.tableSource.loadRows()),this.headerSchema.next(this.filterItemsBaseOnAccessLevel(await this.tableSource.loadHeaderSchema()))}async paginate(e,s){this.shouldSendPaginationRequest(e,s)&&(this.currentPage.next(e),this.currentPageSize.next(s),this.rows.next(await this.tableSource.paginate(e,s)))}shouldSendPaginationRequest(e,s){return this.currentPage.getValue()!==e||this.currentPageSize.getValue()!==s}async sort(e){this.shouldSendSortRequest(e)&&(this.currentSortDetail.next(e),this.rows.next(await this.tableSource.sort(e)))}shouldSendSortRequest(e){return e.key!==this.currentSortDetail.getValue().key||e.order!==this.currentSortDetail.getValue().order}async handleClick(e){this.tableSource.onRowClick&&await this.tableSource.onRowClick()}async handleMetaClick(e){this.tableSource.onRowMetaClick&&await this.tableSource.onRowMetaClick}async handleDoubleClick(e){this.tableSource.onRowDoubleClick&&await this.tableSource.onRowDoubleClick()}hasAnyAction(){for(const e of this.rows.getValue())if(this.getRowActions(e).length)return!0;return!1}getRowActions(e){return this.filterItemsBaseOnAccessLevel(this.tableSource.loadRowActions(e))}loadSummarySchema(){return this.tableSource.loadSummarySchema?this.tableSource.loadSummarySchema():{summaryTitle:"",summaryItems:[]}}filterItemsBaseOnAccessLevel(e){return e.filter(s=>s.hasAccess?s.hasAccess():!0)}async onDestroy(){this.tableSource.onTableDestroy()}}class Es extends pt{constructor(e){super(e),this.selectedRows=new E(new Map),this.selectRow=this.selectRow.bind(this),this.selectAll=this.selectAll.bind(this),this.isEveryRowSelected=this.isEveryRowSelected.bind(this),this.clearAllSelectedItems=this.clearAllSelectedItems.bind(this),this.getSelectedRowsAsArray=this.getSelectedRowsAsArray.bind(this),this.getSelectedRowIds=this.getSelectedRowIds.bind(this)}selectRow(e){const s=this.getSelectedRows();s.has(e.id)?(s.delete(e.id),this.selectedRows.next(this.selectedRows.getValue())):(s.set(e.id,e),this.selectedRows.next(this.selectedRows.getValue()))}selectAll(){if(this.isEveryRowSelected())this.clearAllSelectedItems();else for(const e of this.rows.getValue())this.selectedRows.getValue().set(e.id,e),this.selectedRows.next(this.selectedRows.getValue())}isEveryRowSelected(){return this.getSelectedRows().size===this.currentPageSize.getValue()||this.rows.getValue().length===this.getSelectedRows().size}clearAllSelectedItems(){this.getSelectedRows().clear(),this.selectedRows.next(this.selectedRows.getValue)}getSelectedRows(){return this.selectedRows.getValue()}getSelectedRowsAsArray(){return Array.from(this.selectedRows.getValue().values())}getSelectedRowIds(){return Array.from(this.selectedRows.getValue().keys())}}class Os{constructor(){this.setCellComponentRegistry=this.setCellComponentRegistry.bind(this),this.getCellComponentRegistry=this.getCellComponentRegistry.bind(this)}setCellComponentRegistry(e){this.cellComponentRegistry=e}getCellComponentRegistry(){return this.cellComponentRegistry}}class Ts{constructor(){this.registeredComponents=new Map}initialize(){this.registerComponents()}getRegisteredComponents(){return this.registeredComponents}}function Ls(t){return function(s,r){s.constructor.prototype.headers||(s.constructor.prototype.headers=[]),s.constructor.prototype.headers.push({path:r,...t})}}function Ps(t){return function(s){async function r(){return s.prototype.headers||[]}t.prototype.loadHeaderSchema=r}}function yt(){const t=p.ref(new Map),e=p.ref(0),s=p.ref(null),r=p.computed(()=>Array.from(t.value.values()));function n(g){e.value=g}function i(g){for(const S of g)a(S)}function a(g){t.value.set(g.id,g)}function c(g){return s.value=t.value.get(g)||null,s.value}function l(g){const S=c(g);return S&&t.value.delete(g),!!S}function u(){t.value.clear()}function v(g){s.value=g}function f(){s.value=null}return{itemsAsArray:r,totalCount:e,currentItem:s,setTotalCount:n,addOrReplaceItems:i,getById:c,removeById:l,clearItems:u,setCurrentItem:v,clearCurrentItem:f}}class St{constructor(){this.pageNumber=1,this.itemCount=20,this.sortDetail=new be("id",L.DESC),this.filters=[]}}class ks{constructor(e,s){this.items=e,this.totalItems=s}}class Vs{constructor(e,s){this.shouldKeepSync=e,this.intervalInMillisecond=s}}const wt=new St;function bt(){const t=p.ref(structuredClone(wt));function e(){t.value.pageNumber=t.value.pageNumber+1}function s(){t.value.pageNumber=t.value.pageNumber-1}function r(f){t.value.pageNumber=f}function n(f){t.value.itemCount=f}function i(f){t.value.sortDetail.key=f.key,t.value.sortDetail.order=f.order}function a(f){for(const g in f)c(g,f[g])}function c(f,g){const S=t.value.filters.findIndex(A=>A.key===f);S>-1?t.value.filters[S].value=g:t.value.filters.push({key:f,value:g})}function l(f){let g=t.value.filters;g=g.filter(S=>S.key!==f),t.value.filters=g}function u(){const f={page:t.value.pageNumber,count:t.value.itemCount};t.value.sortDetail&&(f.by=t.value.sortDetail.key,f.order=t.value.sortDetail.order);for(const g of t.value.filters)if(g.value)if(typeof g.value=="string"||typeof g.value=="number")f[g.key]=g.value;else{const S=JSON.stringify(g.value);S!=="[]"&&S!=="{}"&&(f[g.key]=S)}return f}function v(){t.value=structuredClone(wt)}return{params:t,setNextPage:e,setPreventPage:s,setPageNumber:r,setItemCount:n,setSortDetail:i,setFilter:c,removeFilter:l,getRequestParams:u,clearParam:v,setFiltersBaseOnRequestBody:a}}function It(){const t=p.ref(new Set),e=p.computed(()=>t.value.has(y.FetchList)),s=p.computed(()=>t.value.has(y.FetchItem)),r=p.computed(()=>t.value.has(y.FetchLastItems)),n=p.computed(()=>t.value.has(y.FetchPreviousItems)),i=p.computed(()=>t.value.has(y.Create)),a=p.computed(()=>t.value.has(y.Update)),c=p.computed(()=>t.value.has(y.Delete)),l=p.computed(()=>t.value.has(y.Search)),u=p.computed(()=>t.value.has(y.Sort));function v(g){t.value.add(g)}function f(g){t.value.delete(g)}return{loadingStatus:t,isFetchingList:e,isFetchingItem:s,isFetchingLastItems:r,isFetchingPreviousItems:n,isCreating:i,isUpdating:a,isDeleting:c,isSearching:l,isSorting:u,setStatus:v,removeStatus:f}}function Fs(t){const e=yt(),s=bt(),r=It(),n=new Fe({runAction:async()=>f(y.AutoRefresh)}),i=p.computed(()=>{const h=s.params.value.pageNumber,d=s.params.value.itemCount,m=h*d-d,b=h*d-1,I=[];for(let w=m;w<=b&&e.itemsAsArray.value[w];w++)I.push(e.itemsAsArray.value[w]);return I}),a=p.computed(()=>({totalItems:e.totalCount.value,currentPage:s.params.value.pageNumber,rows:e.itemsAsArray.value,loadingStatus:r.loadingStatus.value,currentPageItems:i.value})),c=p.computed(()=>({getData:u,sort:ae,paginate:_e,fetchRows:f})),l=p.computed(()=>t.getSyncDetail());function u(){return a.value}async function v(h){const d=await t.fetchList(h);return e.clearItems(),e.addOrReplaceItems(d.items),e.setTotalCount(d.totalItems),d}async function f(h=y.FetchList){r.setStatus(h);const d=await v(s.getRequestParams());return r.removeStatus(h),d}async function g(){S(),await f()}function S(){if(!l.value.shouldKeepSync)throw new Error("The provided repository does not support auto refresh");n.setupInterval(l.value.intervalInMillisecond)}function A(){n.clearInterval()}async function X(h,d=!0){r.setStatus(y.FetchItem),d&&e.clearCurrentItem();const m=await t.fetchItemById(h);return e.setCurrentItem(m),r.removeStatus(y.FetchItem),m}async function Q(h){r.setStatus(y.Create);const d=await t.createItem(h);return d&&e.addOrReplaceItems([d]),r.removeStatus(y.Create),d}async function ee(h,d){r.setStatus(y.Update);const m=await t.updateItem(h,d);return m&&e.addOrReplaceItems([m]),r.removeStatus(y.Update),m}async function te(h){return r.setStatus(y.Delete),await t.deleteItem(h),r.removeStatus(y.Delete),e.removeById(h)}async function xe(){s.setNextPage(),r.setStatus(y.FetchLastItems);const h=await v(s.getRequestParams());return r.removeStatus(y.FetchLastItems),h}async function Ke(){s.setPreventPage(),r.setStatus(y.FetchPreviousItems);const h=await v(s.getRequestParams());return r.removeStatus(y.FetchPreviousItems),h}async function _e(h){s.setPageNumber(h),r.setStatus(y.FetchList);const d=await v(s.getRequestParams());return r.removeStatus(y.FetchList),d}async function Ze(h){s.setFilter("search",h),r.setStatus(y.Search),e.clearItems();const d=await v(s.getRequestParams());return r.removeStatus(y.Search),d}async function ae(h){s.setSortDetail(h),r.setStatus(y.Sort),e.clearItems();const d=await v(s.getRequestParams());return r.removeStatus(y.Sort),d}async function se(){return s.clearParam(),await f()}return p.onBeforeUnmount(()=>{A()}),{loadingStatusManager:r,dataManger:e,paramsManager:s,tableRenderingData:a,fetchList:f,fetchWithAutoRefresh:g,setupAutoRefresh:S,stopAutoRefresh:A,fetchItemById:X,createItem:Q,updateItem:ee,deleteItem:te,fetchLastItems:xe,fetchPreviousItems:Ke,fetchItemsByPageNumber:_e,search:Ze,sort:ae,clearFilters:se,tableService:c,currentPageItems:i}}function Ns(t){const e=p.ref(t),s=p.computed(()=>({getData(){return{totalItems:e.value.length,currentPageItems:e.value,loadingStatus:new Set,rows:e.value,currentPage:1}},async sort(r){return{totalItems:e.value.length,items:e.value}},async fetchRows(){return{totalItems:e.value.length,items:e.value}},async paginate(r,n){return{totalItems:e.value.length,items:e.value}}}));return{tableRows:e,staticTableService:s}}function $s(){const t=p.ref(new Map),e=p.ref(0),s=p.computed(()=>e.value),r=p.computed(()=>Array.from(t.value.values()));function n(v){e.value=v}function i(v){for(const f of v)a(f)}function a(v){t.value.set(String(v.id),v)}function c(v){const f=l(v);return t.value.delete(String(v)),f}function l(v){return t.value.get(String(v))||null}function u(){t.value.clear()}return{entityItemsAsArray:r,addOrReplaceItems:i,removeById:c,getItemById:l,clearItems:u,setTotalCount:n,getTotalCount:s}}function Bs(t,e=3e5){const s=p.ref(structuredClone(t));let r=null;function n(){r&&clearTimeout(r),e>0&&(r=setTimeout(()=>{s.value=t},e))}const i=p.computed({get(){return n(),s.value},set(a){s.value=a,n()}});return n(),i}class Us{constructor(e,s=500){this.timerId=null,this.debounceTimeout=s,this.action=e}runAction(){this.cancelDebounce(),this.action.runImmediate(),this.timerId=setTimeout(()=>{this.action.runDebounce()},this.debounceTimeout)}cancelDebounce(){this.timerId&&clearTimeout(this.timerId)}}function js(t){return function(e,s,r){const n=r.value;r.value=async function(...i){try{return await n.apply(this,i)}catch(a){for(const c of t)await c.handleError(a)}}}}function Ys(t){return function(e,s,r){const n=r.value;r.value=async function(...i){try{const a=await n.apply(this,i);for(const c of t)c.shouldResolveSuccess(a)&&await c.handleSuccess(a);return a}catch(a){for(const c of t)c.shouldResolveFailure(a)&&await c.handleFailure(a)}}}}class Hs{constructor(e,s,r=()=>!0,n=()=>!0){this.successMessageResolver=e,this.failureMessageResolver=s,this.shouldResolveSuccess=r,this.shouldResolveFailure=n}async handleSuccess(e){}async handleFailure(e){}async handleInfo(){}async handleWarning(){}}const T=class T{constructor(){}static GetInstance(){return T.instance||(T.instance=new T),T.instance}static registerHandler(e,s){T.handlers.set(e,s)}handle(e){var n;const s=((n=e.response)==null?void 0:n.status)??0,r=T.handlers.get(s);r&&r.handleError(e)}};T.handlers=new Map,T.instance=null;let Ue=T;class qs{constructor(e){this.axiosInstance=e}setBaseURL(e){return this.axiosInstance.defaults.baseURL=e,this}setTimeout(e){return this.axiosInstance.defaults.timeout=e,this}setHeaders(e){return this.axiosInstance.defaults.headers.common=e,this}attachRequestInterceptors(e){return this.axiosInstance.interceptors.request.use(s=>{for(const r of e)r.intercept(s);return s},s=>Promise.reject(s)),this}attachResponseInterceptors(e){return this.axiosInstance.interceptors.response.use(s=>s,s=>{throw e.handle(s),s}),this}build(){return this.axiosInstance}}class zs{constructor(e){this.axiosInstance=e}async get(e,s){return await this.axiosInstance.get(e,s)}async post(e,s,r){return await this.axiosInstance.post(e,s,r)}async patch(e,s,r){return await this.axiosInstance.patch(e,s,r)}async put(e,s,r){return await this.axiosInstance.put(e,s,r)}async delete(e,s){return await this.axiosInstance.delete(e,s)}}class Js{constructor(){this._initializer=[]}setupInitializers(e){this._initializer.push(...e)}initialize(){for(const e of this._initializer)e.initialize()}}const H=class H{constructor(){this.jsonConverter=new M.JsonConvert}serializeObject(e,s){return this.jsonConverter.serializeObject(e,s)}deserializeObject(e,s){return this.jsonConverter.deserializeObject(e,s)}deserializeArray(e,s){return this.jsonConverter.deserializeArray(e,s)}tryDeserialize(e,s){for(const r of s)try{return this.deserializeObject(e,r)}catch{}throw new Error("Unable to deserialize object")}static GetInstance(){return H.Instance||(H.Instance=new H),H.Instance}};H.Instance=null;let je=H;var At=(t=>(t.Success="success",t.Failure="error",t.Info="info",t.Warning="warning",t))(At||{}),Ye=(t=>(t.BottomLeft="bottomLeft",t.TopLeft="topLeft",t))(Ye||{});class Ws{constructor(e,s,r){this.placement=Ye.BottomLeft,this.type=e,this.message=s,this.description=r}}const Gs=Xe.defineStore(Se.Dialog,()=>{const t=p.reactive({dialogComponent:null,width:k.DefaultWidth,height:k.DefaultHeight,props:null,header:""}),e=p.computed(()=>!!t.dialogComponent),s=p.computed(()=>!!t.header);function r(l){t.dialogComponent=l}function n(l){t.header=l}function i(l){if(!e.value)throw new Error("there is no dialog to set props on");t.props=l}function a(l,u){if(!e.value)throw new Error("there is no dialog to set size on");if(l<k.MinimalAvailableSize)throw new Error("negative size not supported");u===k.Width?t.width=l:t.height=l}function c(){t.props=null,t.height=k.DefaultHeight,t.width=k.DefaultWidth,t.header="",t.dialogComponent=null}return{dialogData:t,openDialog:r,clearDialog:c,setSize:a,setDialogHeader:n,setProps:i,isDialogExists:e,hasDefaultHeader:s}}),xs=Xe.defineStore(Se.Drawer,()=>{const t=p.ref(G.Close),e=p.computed(()=>t.value===G.Open);function s(){t.value=G.Close}function r(){t.value=G.Open}return{closeDrawer:s,openDrawer:r,isDrawerOpen:e}});class Ks{constructor(e){this.mapProcesses=new Map,this.processes=e,this.assignProcessManager()}assignProcessManager(){this.processes.addToManager(this)}setProcessToMap(e){this.mapProcesses.set(e.name,e)}async start(){await this.processes.execute()}async startFrom(e){const s=this.mapProcesses.get(e);if(!s)throw new Error(`Process ${e} not found`);await s.execute()}}class Zs{constructor(e,s){this.next=null,this.name=e,this.next=s}addToManager(e){e.setProcessToMap(this),this.next&&this.next.addToManager(e)}}class Xs{constructor(){this.checkAccessibility=this.checkAccessibility.bind(this),this.isAccessible=this.isAccessible.bind(this),this.getDestinationRouteName=this.getDestinationRouteName.bind(this)}async checkAccessibility(e,s,r){if(await this.isAccessible(e,s)){r();return}if(await this.getDestinationRouteName()){r({name:await this.getDestinationRouteName()});return}if(await this.getDestinationRouteLocation(e,s)){r(await this.getDestinationRouteLocation(e,s));return}r(!1)}async getDestinationRouteName(){return""}async getDestinationRouteLocation(e,s){return null}}class Qs{constructor(e,s,r){this.scheduler=new Fe({runAction:async()=>{await this.fetchList()}}),this.repository=e,this.crudDataManagement=s,this.syncDetail=this.repository.getSyncDetail(),this.paramManager=r,this.syncListWithApi()}async fetchList(){const e=await this.repository.fetchList(this.paramManager.getRequestParams());return this.crudDataManagement.addOrReplaceItems(e.items),this.crudDataManagement.setTotalCount(e.totalItems),e}async fetchItemById(e){const s=await this.repository.fetchItemById(e);return s&&this.crudDataManagement.addOrReplaceItems([s]),s}async createItem(e){const s=await this.repository.createItem(e);return s&&!this.shouldRefreshListAfterCreate()&&this.crudDataManagement.addOrReplaceItems([s]),s&&this.shouldRefreshListAfterCreate()&&await this.fetchList(),s}shouldRefreshListAfterCreate(){return!0}async deleteItem(e){return await this.repository.deleteItem(e)?this.crudDataManagement.removeById(e):null}async updateItem(e,s){const r=await this.repository.updateItem(e,s);return this.shouldRefreshListAfterUpdate()&&r?(await this.fetchList(),this.crudDataManagement.getItemById(e)):r}shouldRefreshListAfterUpdate(){return!0}async removeItem(e){const s=await this.repository.deleteItem(e);return s&&this.shouldRefreshListAfterDelete()&&await this.fetchList(),s?this.crudDataManagement.removeById(e):null}shouldRefreshListAfterDelete(){return!1}syncListWithApi(){this.scheduler.clearInterval(),this.syncDetail.shouldKeepSync&&this.scheduler.setupInterval(this.syncDetail.intervalInMillisecond)}onDestroy(){this.crudDataManagement.clearItems(),this.clearInterval()}clearInterval(){this.scheduler.clearInterval()}}class Dt{}class er extends Dt{search(e,s,r){const n=[];e:for(const i of e)for(const a of r(i))if(B.removeSpacesFromString(String(a).toLowerCase()).indexOf(B.removeSpacesFromString(String(s).toLowerCase()))>-1){n.push(i);continue e}return n}}var He=(t=>(t.Hidden="hidden",t.Visible="visible",t))(He||{});class tr{constructor(e){this._visibilityControl=e,this.mangeVisibilityEvent()}mangeVisibilityEvent(){document.addEventListener("visibilitychange",e=>{document.visibilityState===He.Hidden?this._visibilityControl.screenInvisible(e):this._visibilityControl.screenVisible(e)})}}var sr=Object.defineProperty,rr=Object.getOwnPropertyDescriptor,O=(t,e,s,r)=>{for(var n=r>1?void 0:r?rr(e,s):e,i=t.length-1,a;i>=0;i--)(a=t[i])&&(n=(r?a(e,s,n):a(n))||n);return r&&n&&sr(e,s,n),n};o.Amount=class{constructor(){this.value="",this.symbol=""}get tradeValueInNumber(){return Number(this.value)}get truncatedValue(){return this.tradeValueInNumber.toLocaleString("en-US",{maximumFractionDigits:8})}},O([M.JsonProperty("value",String,!0)],o.Amount.prototype,"value",2),O([M.JsonProperty("symbol",String)],o.Amount.prototype,"symbol",2),o.Amount=O([M.JsonObject("Amount")],o.Amount),o.BaseModel=class{getTable(){const e=Object.getPrototypeOf(this)._table;if(!e)throw new Error("No Table found for the model. are you sure decorated the model with @Table() ?");return e}},O([M.JsonProperty("id",Object)],o.BaseModel.prototype,"id",2),o.BaseModel=O([M.JsonObject("BaseModel")],o.BaseModel),o.MinifiedSymbolModel=class extends o.BaseModel{},O([M.JsonProperty("symbol",String)],o.MinifiedSymbolModel.prototype,"symbol",2),O([M.JsonProperty("enName",String)],o.MinifiedSymbolModel.prototype,"enName",2),O([M.JsonProperty("faName",String)],o.MinifiedSymbolModel.prototype,"faName",2),O([M.JsonProperty("image",String)],o.MinifiedSymbolModel.prototype,"image",2),o.MinifiedSymbolModel=O([M.JsonObject("MinifiedSymbolModel")],o.MinifiedSymbolModel);class nr{constructor(e,s){this.requestedDate=e,this.executedDate=s}get requestedDateInJalali(){return _.mapUnixToDate(this.requestedDate,J.SimpleDate)}get requestedTime(){return _.mapUnixToDate(this.requestedDate,J.JustHour)}get executedDateInJalali(){return _.mapUnixToDate(this.executedDate,J.SimpleDate)}get executedDateTime(){return _.mapUnixToDate(this.executedDate,J.JustHour)}}class ir{constructor(e,s){this.requestedAmount=e,this.executedAmount=s}}class ar{constructor(e,s,r,n,i){this.symbolPrice=e,this.USDTPrice=s,this.symobl=r,this.symbolImage=n,this.USDTImage=i}get truncatedSymbolPrice(){return this.symbolPrice.toLocaleString("en-US",{maximumFractionDigits:8})}get truncatedUSDTPrice(){return this.USDTPrice.toLocaleString("en-US",{maximumFractionDigits:8})}}class or{constructor(e,s){this.soldSymbol=e,this.buySymbol=s}}var qe;(function(t){t[t.Transient=0]="Transient",t[t.Singleton=1]="Singleton",t[t.ResolutionScoped=2]="ResolutionScoped",t[t.ContainerScoped=3]="ContainerScoped"})(qe||(qe={}));const D=qe;/*! *****************************************************************************
|
|
2
|
+
the initial data will be available after calling the [markAsInitial] method on this instance`)}markAsInitial(){this.initialData=structuredClone(p.toRaw(this.data))}setValidators(e){this._validators=e}getChangeSensitive(){return this.data.isChangeSensitive}setChangeSensitive(e){if(e&&this.data.shouldRemoveValidationMessageOnInteract)throw new Error("Input control "+this.getName()+" can not be both change sensitive and remove validation meessage on interact");this.data.isChangeSensitive=e}getIsBlurSensitive(){return this.data.isBlurSensitive}setIsBlurSensitive(e){this.data.isBlurSensitive=e}getIsRequired(){return this.data.isRequired}setIsRequired(e){this.data.isRequired=e}getIsValid(){return this.data.isValid}setIsValid(e){this.data.isValid=e}getIsIncludeInRequestBody(){return this.data.isIncludeInRequestBody}setIsIncludeInRequestBody(e){this.data.isIncludeInRequestBody=e}getNotValidMessage(){return this.data.notValidMessage}setNotValidMessage(e){this.data.notValidMessage=e}getName(){return this.data.name}setName(e){this.data.name=e}setId(e){this._id=e}getId(){return this._id}getIsEmptySensitive(){return this.data.isEmptySensitive}setIsEmptySensitive(e){this.data.isEmptySensitive=e}setHasCustomValidationCheck(e){this.data.hasCustomValidationCheck=e}setShouldRemoveValidationOnInteract(e){if(e&&this.data.isChangeSensitive)throw new Error("Input control "+this.getName()+" can not be both change sensitive and remove validation meessage on interact");this.data.shouldRemoveValidationMessageOnInteract=e}getShouldRemoveValidationOnInteract(){return this.data.shouldRemoveValidationMessageOnInteract}hasCustomValidationCheck(){return this.data.hasCustomValidationCheck}set value(e){this.data.value=e,this.shouldRunValidation()&&this.runValidation(),this.getShouldRemoveValidationOnInteract()&&this.setNotValidMessage("")}get value(){return this.data.value}}class ms{constructor(e){this._inputControl=e}setValidators(e){return this._inputControl.setValidators(e),this}setChangeSensitive(){return this._inputControl.setChangeSensitive(!0),this}setRequired(){return this._inputControl.setIsRequired(!0),this}setValid(){return this._inputControl.setIsValid(!0),this}setBlurSensitive(){return this._inputControl.setIsBlurSensitive(!0),this}setId(e){return this._inputControl.setId(e),this}removeEmptySensitive(){return this._inputControl.setIsEmptySensitive(!1),this}setHasCustomValidationCheck(){return this._inputControl.setHasCustomValidationCheck(!0),this}removeErrorOnInteract(){return this._inputControl.setShouldRemoveValidationOnInteract(!0),this}build(){return this._inputControl}}class gs{constructor(){this.mounted=(e,s)=>{s.value&&s.value.getIsBlurSensitive()&&(e.addEventListener("click",this.handleFocus.bind(this,s.value)),e.addEventListener("blur",this.handleBlur.bind(this,s.value),!0))},this.beforeUnMount=(e,s)=>{e.removeEventListener("blur",this.handleBlur.bind(this,s.value)),e.removeEventListener("click",this.handleFocus.bind(this,s.value))}}handleBlur(e){e.runValidation(!0)}handleFocus(e){e.value||e.getIsEmptySensitive()||e.setNotValidMessage("")}}class vt{shouldBeInRequestBody(e){return!0}}class ps{constructor(){this._inputControls=new Map,this._isValid=!1,this._id=Math.random()}getInputControlsAsArray(){return Array.from(this._inputControls.values())}async runValidation(e){let s=!0;for(const r of this.getInputControlsAsArray())if(e&&await r.runValidation(!0),!r.getIsValid()&&(s=!1,!e)){this._isValid=!1;return}this._isValid=s}addInputControls(e){for(const s of e)this._inputControls.set(s.getName(),s)}getInputControl(e){const s=this._inputControls.get(e);if(!s)throw new Error(`The provided input name (${e}}) has no controls.`);return s}resetControls(e){for(const s of e){const r=this._inputControls.get(s);r?r.reset():console.warn(`Provided input name ${s} has no controllers in this form`)}}resetAll(){for(const e of this.getInputControlsAsArray())e.reset()}createRequestBody(e=new vt){const s={};for(const r of this.getInputControlsAsArray())r.getIsIncludeInRequestBody()&&e.shouldBeInRequestBody(r.value)&&(s[r.getName()]=r.value);return s}setIsValid(e){this._isValid=e}getIsValid(){return this._isValid}setId(e){this._id=e}getId(){return this._id}}function ys(t,e=!1){const s=p.reactive(t),r=p.ref(ie.Invalid);return p.watch(()=>s.getInputControlsAsArray(),()=>{e||(s.runValidation(),s.getIsValid()?r.value=ie.Valid:r.value=ie.Invalid)},{immediate:!0,deep:!0}),{reactiveForm:s,validationStatus:r}}class Fe{constructor(e){this.timerId=null,this.setupInterval=this.setupInterval.bind(this),this.schedule=e}setupInterval(e){const s=this;this.timerId=setTimeout(async function r(){await s.schedule.runAction(),s.timerId=setTimeout(()=>{r()},e)},e)}clearInterval(){this.timerId&&clearInterval(this.timerId)}}const Ne="150px",$e=2,Ss={path:"id",key:"id",title:"عملیات",colspan:$e,width:Ne,cellType:ye.ACTION,align:ge.Center,headerType:pe.Text,accessLevel:null},mt={width:Ne,align:ge.Center,headerType:pe.Text,cellType:ye.Text,colspan:$e};class be{constructor(e,s){this.key=e,this.order=s}}class Be{aSort(e,s){return e.sort((r,n)=>{const i=r[s]??r,a=n[s]??n;if(typeof i=="string"&&typeof a=="string")return i.localeCompare(a);if(typeof i=="number"&&typeof a=="number")return i-a;throw new Error("Not supported data type")})}bSort(e,s){return e.sort((r,n)=>{const i=r[s]??r,a=n[s]??n;if(typeof i=="string"&&typeof a=="string")return a.localeCompare(i);if(typeof i=="number"&&typeof a=="number")return a-i;throw new Error("Not supported data type")})}}class ws{arrayOfObjectSort(e,s,r,n=new Be){return r===L.ASC?n.aSort(e,s):n.bSort(e,s)}arraySort(e,s,r=new Be){return s===L.ASC?r.aSort(e):r.bSort(e)}}class gt{constructor(e){this.currentPage=1,this.currentPageSize=20,this.currentSortDetail=new be("id",L.DESC),this.loadedRows=[],this.headerSchema=[],this.service=e,this.accessService=x.GetInstance()}addHeader(e){this.headerSchema.push(e)}async load(){this.headerSchema=this.filterItemsBaseOnAccessLevel(await this.loadHeader()),await this.loadRows()}filterItemsBaseOnAccessLevel(e){return e.filter(s=>s.hasAccess?s.hasAccess():!0)}async sort(e){this.shouldSendSortRequest(e)&&(this.currentSortDetail=e,this.loadedRows=(await this.handleSort(this.currentSortDetail)).items)}shouldSendSortRequest(e){return e.key!==this.currentSortDetail.key||e.order!==this.currentSortDetail.order}async paginate(e,s){this.shouldSendPaginationRequest(e,s)&&(this.currentPage=e,this.currentPageSize=s,this.loadedRows=(await this.handlePagination(this.currentPage,this.currentPageSize)).items)}shouldSendPaginationRequest(e,s){return this.currentPage!==e||this.currentPageSize!==s}async loadRows(){return this.loadedRows=(await this.service.fetchRows()).items,this.loadedRows}getData(){return this.service.getData()}async handleSort(e){return await this.service.sort(e)}async handlePagination(e,s){return await this.service.paginate(e,s)}getItemCountPerPage(){return Pe.DEFAULT_ITEM_COUNT_PER_PAGE}isLoading(){const e=this.getLoadingStatuses();return e.has(y.Search)||e.has(y.FetchList)||e.has(y.Sort)||e.has(y.FetchLastItems)||e.has(y.FetchPreviousItems)}getLoadingStatuses(){return this.getData().loadingStatus}hasAnyAction(){for(const e of this.loadedRows)if(this.getAccessedActions(e).length)return!0;return!1}getAccessedActions(e){return this.filterItemsBaseOnAccessLevel(this.getActions(e))}getActions(e){return[]}getScrollDetail(){return null}isExpandable(){return!1}async handleClick(e){}async handleMetaClick(e){}async handleDoubleClick(e){}async onDestroy(){}async loadHeader(){throw new Error("No header provided for the table.")}loadSummarySchema(){return{summaryTitle:"",summaryItems:[]}}}class E{constructor(e){this.observers=[],this.attach=this.attach.bind(this),this.detach=this.detach.bind(this),this.notify=this.notify.bind(this),this.notifyObject=this.notifyObject.bind(this),this.next=this.next.bind(this),this.getValue=this.getValue.bind(this),this.next(e)}attach(e){this.observers.push(e),this.notifyObject(e)}detach(e){this.observers=this.observers.filter(s=>s!==e)}notify(){for(const e of this.observers)this.notifyObject(e)}notifyObject(e){typeof e=="function"?e(this._value):e.update(this._value)}next(e){typeof e=="function"?this._value=e(this._value):this._value=e,this.notify()}getValue(){return this._value}}class bs extends gt{constructor(e){super(e),this.selectedRows=new E(new Map),this.rowSelect=this.rowSelect.bind(this),this.selectAll=this.selectAll.bind(this),this.isEveryRowSelected=this.isEveryRowSelected.bind(this),this.handlePagination=this.handlePagination.bind(this),this.clearAllSelectedItems=this.clearAllSelectedItems.bind(this),this.getSelectedRows=this.getSelectedRows.bind(this),this.getSelectedRowsAsArray=this.getSelectedRowsAsArray.bind(this),this.getSelectedRowIds=this.getSelectedRowIds.bind(this)}rowSelect(e){this.getSelectedRowsValue().has(e.id)?(this.getSelectedRowsValue().delete(e.id),this.selectedRows.next(this.selectedRows.getValue())):(this.selectedRows.getValue().set(e.id,e),this.selectedRows.next(this.selectedRows.getValue()))}selectAll(){if(this.isEveryRowSelected())this.clearAllSelectedItems();else for(const e of this.loadedRows)this.selectedRows.getValue().set(e.id,e),this.selectedRows.next(this.selectedRows.getValue())}isEveryRowSelected(){return this.getSelectedRowsValue().size===this.currentPageSize||this.loadedRows.length===this.getSelectedRowsValue().size}async handlePagination(e,s){return this.clearAllSelectedItems(),await super.handlePagination(e,s)}async handleSort(e){return this.clearAllSelectedItems(),await super.handleSort(e)}clearAllSelectedItems(){this.selectedRows.getValue().clear(),this.selectedRows.next(this.selectedRows.getValue())}getSelectedRows(){return this.selectedRows}getSelectedRowsAsArray(){return Array.from(this.selectedRows.getValue().values())}getSelectedRowIds(){return Array.from(this.selectedRows.getValue().keys())}getSelectedRowsValue(){return this.selectedRows.getValue()}}function Is(t){return{...mt,...t}}function As(t){return function(s,r){s.constructor.prototype.headers||(s.constructor.prototype.headers=[]),s.constructor.prototype.headers.push({path:r,...t})}}function Ds(t){return function(s){async function r(){return s.prototype._table=this,s.prototype.headers}function n(c){const l=[],u=s.prototype.actions||[];for(const v of u){if(!v.isAvailable(c))continue;const f={handler:v.handler.bind(c),accessLevel:v.accessLevel,actionName:v.actionName};l.push(f)}return l}async function i(c){s.prototype.rowClick&&await s.prototype.rowClick.call(c)}async function a(){s.prototype.tableDestroy&&await s.prototype.tableDestroy()}t.prototype.loadHeader=r,t.prototype.getActions=n,t.prototype.handleClick=i,t.prototype.onDestroy=a}}function Rs(t){return function(s,r,n){s.constructor.prototype.actions||(s.constructor.prototype.actions=[]),t.handler=n.value,s.constructor.prototype.actions.push(t)}}function Cs(){return function(e,s,r){e.constructor.prototype.tableDestroy=r.value}}function Ms(){return function(e,s,r){e.constructor.prototype.rowClick=r.value}}class _s{constructor(){this.observers=[]}attach(e){this.observers.push(e)}detach(e){this.observers=this.observers.filter(s=>s!==e)}notify(){for(const e of this.observers)e.update(this)}}class pt{constructor(e){this.rows=new E([]),this.headerSchema=new E([]),this.currentPage=new E(1),this.currentPageSize=new E(20),this.totalItems=new E(0),this.currentSortDetail=new E(new be("id",L.DESC)),this.scrollDetail=new E(null),this.isExpandable=new E(!1),this.tableSource=e,this.accessService=x.GetInstance(),this.load=this.load.bind(this),this.paginate=this.paginate.bind(this),this.shouldSendSortRequest=this.shouldSendSortRequest.bind(this),this.sort=this.sort.bind(this),this.handleClick=this.handleClick.bind(this),this.handleMetaClick=this.handleMetaClick.bind(this),this.handleDoubleClick=this.handleDoubleClick.bind(this),this.hasAnyAction=this.hasAnyAction.bind(this),this.loadSummarySchema=this.loadSummarySchema.bind(this),this.filterItemsBaseOnAccessLevel=this.filterItemsBaseOnAccessLevel.bind(this),this.paginate=this.paginate.bind(this),this.shouldSendPaginationRequest=this.shouldSendPaginationRequest.bind(this),this.getRowActions=this.getRowActions.bind(this),this.onDestroy=this.onDestroy.bind(this)}async load(){this.rows.next(await this.tableSource.loadRows()),this.headerSchema.next(this.filterItemsBaseOnAccessLevel(await this.tableSource.loadHeaderSchema()))}async paginate(e,s){this.shouldSendPaginationRequest(e,s)&&(this.currentPage.next(e),this.currentPageSize.next(s),this.rows.next(await this.tableSource.paginate(e,s)))}shouldSendPaginationRequest(e,s){return this.currentPage.getValue()!==e||this.currentPageSize.getValue()!==s}async sort(e){this.shouldSendSortRequest(e)&&(this.currentSortDetail.next(e),this.rows.next(await this.tableSource.sort(e)))}shouldSendSortRequest(e){return e.key!==this.currentSortDetail.getValue().key||e.order!==this.currentSortDetail.getValue().order}async handleClick(e){this.tableSource.onRowClick&&await this.tableSource.onRowClick(e)}async handleMetaClick(e){this.tableSource.onRowMetaClick&&await this.tableSource.onRowMetaClick(e)}async handleDoubleClick(e){this.tableSource.onRowDoubleClick&&await this.tableSource.onRowDoubleClick(e)}hasAnyAction(){for(const e of this.rows.getValue())if(this.getRowActions(e).length)return!0;return!1}getRowActions(e){return this.filterItemsBaseOnAccessLevel(this.tableSource.loadRowActions(e))}loadSummarySchema(){return this.tableSource.loadSummarySchema?this.tableSource.loadSummarySchema():{summaryTitle:"",summaryItems:[]}}filterItemsBaseOnAccessLevel(e){return e.filter(s=>s.hasAccess?s.hasAccess():!0)}async onDestroy(){this.tableSource.onTableDestroy()}}class Es extends pt{constructor(e){super(e),this.selectedRows=new E(new Map),this.selectRow=this.selectRow.bind(this),this.selectAll=this.selectAll.bind(this),this.isEveryRowSelected=this.isEveryRowSelected.bind(this),this.clearAllSelectedItems=this.clearAllSelectedItems.bind(this),this.getSelectedRowsAsArray=this.getSelectedRowsAsArray.bind(this),this.getSelectedRowIds=this.getSelectedRowIds.bind(this)}selectRow(e){const s=this.getSelectedRows();s.has(e.id)?(s.delete(e.id),this.selectedRows.next(this.selectedRows.getValue())):(s.set(e.id,e),this.selectedRows.next(this.selectedRows.getValue()))}selectAll(){if(this.isEveryRowSelected())this.clearAllSelectedItems();else for(const e of this.rows.getValue())this.selectedRows.getValue().set(e.id,e),this.selectedRows.next(this.selectedRows.getValue())}isEveryRowSelected(){return this.getSelectedRows().size===this.currentPageSize.getValue()||this.rows.getValue().length===this.getSelectedRows().size}clearAllSelectedItems(){this.getSelectedRows().clear(),this.selectedRows.next(this.selectedRows.getValue)}getSelectedRows(){return this.selectedRows.getValue()}getSelectedRowsAsArray(){return Array.from(this.selectedRows.getValue().values())}getSelectedRowIds(){return Array.from(this.selectedRows.getValue().keys())}}class Os{constructor(){this.setCellComponentRegistry=this.setCellComponentRegistry.bind(this),this.getCellComponentRegistry=this.getCellComponentRegistry.bind(this)}setCellComponentRegistry(e){this.cellComponentRegistry=e}getCellComponentRegistry(){return this.cellComponentRegistry}}class Ts{constructor(){this.registeredComponents=new Map}initialize(){this.registerComponents()}getRegisteredComponents(){return this.registeredComponents}}function Ls(t){return function(s,r){s.constructor.prototype.headers||(s.constructor.prototype.headers=[]),s.constructor.prototype.headers.push({path:r,...t})}}function Ps(t){return function(s){async function r(){return s.prototype.headers||[]}t.prototype.loadHeaderSchema=r}}function yt(){const t=p.ref(new Map),e=p.ref(0),s=p.ref(null),r=p.computed(()=>Array.from(t.value.values()));function n(g){e.value=g}function i(g){for(const S of g)a(S)}function a(g){t.value.set(g.id,g)}function c(g){return s.value=t.value.get(g)||null,s.value}function l(g){const S=c(g);return S&&t.value.delete(g),!!S}function u(){t.value.clear()}function v(g){s.value=g}function f(){s.value=null}return{itemsAsArray:r,totalCount:e,currentItem:s,setTotalCount:n,addOrReplaceItems:i,getById:c,removeById:l,clearItems:u,setCurrentItem:v,clearCurrentItem:f}}class St{constructor(){this.pageNumber=1,this.itemCount=20,this.sortDetail=new be("id",L.DESC),this.filters=[]}}class ks{constructor(e,s){this.items=e,this.totalItems=s}}class Vs{constructor(e,s){this.shouldKeepSync=e,this.intervalInMillisecond=s}}const wt=new St;function bt(){const t=p.ref(structuredClone(wt));function e(){t.value.pageNumber=t.value.pageNumber+1}function s(){t.value.pageNumber=t.value.pageNumber-1}function r(f){t.value.pageNumber=f}function n(f){t.value.itemCount=f}function i(f){t.value.sortDetail.key=f.key,t.value.sortDetail.order=f.order}function a(f){for(const g in f)c(g,f[g])}function c(f,g){const S=t.value.filters.findIndex(A=>A.key===f);S>-1?t.value.filters[S].value=g:t.value.filters.push({key:f,value:g})}function l(f){let g=t.value.filters;g=g.filter(S=>S.key!==f),t.value.filters=g}function u(){const f={page:t.value.pageNumber,count:t.value.itemCount};t.value.sortDetail&&(f.by=t.value.sortDetail.key,f.order=t.value.sortDetail.order);for(const g of t.value.filters)if(g.value)if(typeof g.value=="string"||typeof g.value=="number")f[g.key]=g.value;else{const S=JSON.stringify(g.value);S!=="[]"&&S!=="{}"&&(f[g.key]=S)}return f}function v(){t.value=structuredClone(wt)}return{params:t,setNextPage:e,setPreventPage:s,setPageNumber:r,setItemCount:n,setSortDetail:i,setFilter:c,removeFilter:l,getRequestParams:u,clearParam:v,setFiltersBaseOnRequestBody:a}}function It(){const t=p.ref(new Set),e=p.computed(()=>t.value.has(y.FetchList)),s=p.computed(()=>t.value.has(y.FetchItem)),r=p.computed(()=>t.value.has(y.FetchLastItems)),n=p.computed(()=>t.value.has(y.FetchPreviousItems)),i=p.computed(()=>t.value.has(y.Create)),a=p.computed(()=>t.value.has(y.Update)),c=p.computed(()=>t.value.has(y.Delete)),l=p.computed(()=>t.value.has(y.Search)),u=p.computed(()=>t.value.has(y.Sort));function v(g){t.value.add(g)}function f(g){t.value.delete(g)}return{loadingStatus:t,isFetchingList:e,isFetchingItem:s,isFetchingLastItems:r,isFetchingPreviousItems:n,isCreating:i,isUpdating:a,isDeleting:c,isSearching:l,isSorting:u,setStatus:v,removeStatus:f}}function Fs(t){const e=yt(),s=bt(),r=It(),n=new Fe({runAction:async()=>f(y.AutoRefresh)}),i=p.computed(()=>{const h=s.params.value.pageNumber,d=s.params.value.itemCount,m=h*d-d,b=h*d-1,I=[];for(let w=m;w<=b&&e.itemsAsArray.value[w];w++)I.push(e.itemsAsArray.value[w]);return I}),a=p.computed(()=>({totalItems:e.totalCount.value,currentPage:s.params.value.pageNumber,rows:e.itemsAsArray.value,loadingStatus:r.loadingStatus.value,currentPageItems:i.value})),c=p.computed(()=>({getData:u,sort:ae,paginate:_e,fetchRows:f})),l=p.computed(()=>t.getSyncDetail());function u(){return a.value}async function v(h){const d=await t.fetchList(h);return e.clearItems(),e.addOrReplaceItems(d.items),e.setTotalCount(d.totalItems),d}async function f(h=y.FetchList){r.setStatus(h);const d=await v(s.getRequestParams());return r.removeStatus(h),d}async function g(){S(),await f()}function S(){if(!l.value.shouldKeepSync)throw new Error("The provided repository does not support auto refresh");n.setupInterval(l.value.intervalInMillisecond)}function A(){n.clearInterval()}async function X(h,d=!0){r.setStatus(y.FetchItem),d&&e.clearCurrentItem();const m=await t.fetchItemById(h);return e.setCurrentItem(m),r.removeStatus(y.FetchItem),m}async function Q(h){r.setStatus(y.Create);const d=await t.createItem(h);return d&&e.addOrReplaceItems([d]),r.removeStatus(y.Create),d}async function ee(h,d){r.setStatus(y.Update);const m=await t.updateItem(h,d);return m&&e.addOrReplaceItems([m]),r.removeStatus(y.Update),m}async function te(h){return r.setStatus(y.Delete),await t.deleteItem(h),r.removeStatus(y.Delete),e.removeById(h)}async function xe(){s.setNextPage(),r.setStatus(y.FetchLastItems);const h=await v(s.getRequestParams());return r.removeStatus(y.FetchLastItems),h}async function Ke(){s.setPreventPage(),r.setStatus(y.FetchPreviousItems);const h=await v(s.getRequestParams());return r.removeStatus(y.FetchPreviousItems),h}async function _e(h){s.setPageNumber(h),r.setStatus(y.FetchList);const d=await v(s.getRequestParams());return r.removeStatus(y.FetchList),d}async function Ze(h){s.setFilter("search",h),r.setStatus(y.Search),e.clearItems();const d=await v(s.getRequestParams());return r.removeStatus(y.Search),d}async function ae(h){s.setSortDetail(h),r.setStatus(y.Sort),e.clearItems();const d=await v(s.getRequestParams());return r.removeStatus(y.Sort),d}async function se(){return s.clearParam(),await f()}return p.onBeforeUnmount(()=>{A()}),{loadingStatusManager:r,dataManger:e,paramsManager:s,tableRenderingData:a,fetchList:f,fetchWithAutoRefresh:g,setupAutoRefresh:S,stopAutoRefresh:A,fetchItemById:X,createItem:Q,updateItem:ee,deleteItem:te,fetchLastItems:xe,fetchPreviousItems:Ke,fetchItemsByPageNumber:_e,search:Ze,sort:ae,clearFilters:se,tableService:c,currentPageItems:i}}function Ns(t){const e=p.ref(t),s=p.computed(()=>({getData(){return{totalItems:e.value.length,currentPageItems:e.value,loadingStatus:new Set,rows:e.value,currentPage:1}},async sort(r){return{totalItems:e.value.length,items:e.value}},async fetchRows(){return{totalItems:e.value.length,items:e.value}},async paginate(r,n){return{totalItems:e.value.length,items:e.value}}}));return{tableRows:e,staticTableService:s}}function $s(){const t=p.ref(new Map),e=p.ref(0),s=p.computed(()=>e.value),r=p.computed(()=>Array.from(t.value.values()));function n(v){e.value=v}function i(v){for(const f of v)a(f)}function a(v){t.value.set(String(v.id),v)}function c(v){const f=l(v);return t.value.delete(String(v)),f}function l(v){return t.value.get(String(v))||null}function u(){t.value.clear()}return{entityItemsAsArray:r,addOrReplaceItems:i,removeById:c,getItemById:l,clearItems:u,setTotalCount:n,getTotalCount:s}}function Bs(t,e=3e5){const s=p.ref(structuredClone(t));let r=null;function n(){r&&clearTimeout(r),e>0&&(r=setTimeout(()=>{s.value=t},e))}const i=p.computed({get(){return n(),s.value},set(a){s.value=a,n()}});return n(),i}class Us{constructor(e,s=500){this.timerId=null,this.debounceTimeout=s,this.action=e}runAction(){this.cancelDebounce(),this.action.runImmediate(),this.timerId=setTimeout(()=>{this.action.runDebounce()},this.debounceTimeout)}cancelDebounce(){this.timerId&&clearTimeout(this.timerId)}}function js(t){return function(e,s,r){const n=r.value;r.value=async function(...i){try{return await n.apply(this,i)}catch(a){for(const c of t)await c.handleError(a)}}}}function Ys(t){return function(e,s,r){const n=r.value;r.value=async function(...i){try{const a=await n.apply(this,i);for(const c of t)c.shouldResolveSuccess(a)&&await c.handleSuccess(a);return a}catch(a){for(const c of t)c.shouldResolveFailure(a)&&await c.handleFailure(a)}}}}class Hs{constructor(e,s,r=()=>!0,n=()=>!0){this.successMessageResolver=e,this.failureMessageResolver=s,this.shouldResolveSuccess=r,this.shouldResolveFailure=n}async handleSuccess(e){}async handleFailure(e){}async handleInfo(){}async handleWarning(){}}const T=class T{constructor(){}static GetInstance(){return T.instance||(T.instance=new T),T.instance}static registerHandler(e,s){T.handlers.set(e,s)}handle(e){var n;const s=((n=e.response)==null?void 0:n.status)??0,r=T.handlers.get(s);r&&r.handleError(e)}};T.handlers=new Map,T.instance=null;let Ue=T;class qs{constructor(e){this.axiosInstance=e}setBaseURL(e){return this.axiosInstance.defaults.baseURL=e,this}setTimeout(e){return this.axiosInstance.defaults.timeout=e,this}setHeaders(e){return this.axiosInstance.defaults.headers.common=e,this}attachRequestInterceptors(e){return this.axiosInstance.interceptors.request.use(s=>{for(const r of e)r.intercept(s);return s},s=>Promise.reject(s)),this}attachResponseInterceptors(e){return this.axiosInstance.interceptors.response.use(s=>s,s=>{throw e.handle(s),s}),this}build(){return this.axiosInstance}}class zs{constructor(e){this.axiosInstance=e}async get(e,s){return await this.axiosInstance.get(e,s)}async post(e,s,r){return await this.axiosInstance.post(e,s,r)}async patch(e,s,r){return await this.axiosInstance.patch(e,s,r)}async put(e,s,r){return await this.axiosInstance.put(e,s,r)}async delete(e,s){return await this.axiosInstance.delete(e,s)}}class Js{constructor(){this._initializer=[]}setupInitializers(e){this._initializer.push(...e)}initialize(){for(const e of this._initializer)e.initialize()}}const H=class H{constructor(){this.jsonConverter=new M.JsonConvert}serializeObject(e,s){return this.jsonConverter.serializeObject(e,s)}deserializeObject(e,s){return this.jsonConverter.deserializeObject(e,s)}deserializeArray(e,s){return this.jsonConverter.deserializeArray(e,s)}tryDeserialize(e,s){for(const r of s)try{return this.deserializeObject(e,r)}catch{}throw new Error("Unable to deserialize object")}static GetInstance(){return H.Instance||(H.Instance=new H),H.Instance}};H.Instance=null;let je=H;var At=(t=>(t.Success="success",t.Failure="error",t.Info="info",t.Warning="warning",t))(At||{}),Ye=(t=>(t.BottomLeft="bottomLeft",t.TopLeft="topLeft",t))(Ye||{});class Ws{constructor(e,s,r){this.placement=Ye.BottomLeft,this.type=e,this.message=s,this.description=r}}const Gs=Xe.defineStore(Se.Dialog,()=>{const t=p.reactive({dialogComponent:null,width:k.DefaultWidth,height:k.DefaultHeight,props:null,header:""}),e=p.computed(()=>!!t.dialogComponent),s=p.computed(()=>!!t.header);function r(l){t.dialogComponent=l}function n(l){t.header=l}function i(l){if(!e.value)throw new Error("there is no dialog to set props on");t.props=l}function a(l,u){if(!e.value)throw new Error("there is no dialog to set size on");if(l<k.MinimalAvailableSize)throw new Error("negative size not supported");u===k.Width?t.width=l:t.height=l}function c(){t.props=null,t.height=k.DefaultHeight,t.width=k.DefaultWidth,t.header="",t.dialogComponent=null}return{dialogData:t,openDialog:r,clearDialog:c,setSize:a,setDialogHeader:n,setProps:i,isDialogExists:e,hasDefaultHeader:s}}),xs=Xe.defineStore(Se.Drawer,()=>{const t=p.ref(G.Close),e=p.computed(()=>t.value===G.Open);function s(){t.value=G.Close}function r(){t.value=G.Open}return{closeDrawer:s,openDrawer:r,isDrawerOpen:e}});class Ks{constructor(e){this.mapProcesses=new Map,this.processes=e,this.assignProcessManager()}assignProcessManager(){this.processes.addToManager(this)}setProcessToMap(e){this.mapProcesses.set(e.name,e)}async start(){await this.processes.execute()}async startFrom(e){const s=this.mapProcesses.get(e);if(!s)throw new Error(`Process ${e} not found`);await s.execute()}}class Zs{constructor(e,s){this.next=null,this.name=e,this.next=s}addToManager(e){e.setProcessToMap(this),this.next&&this.next.addToManager(e)}}class Xs{constructor(){this.checkAccessibility=this.checkAccessibility.bind(this),this.isAccessible=this.isAccessible.bind(this),this.getDestinationRouteName=this.getDestinationRouteName.bind(this)}async checkAccessibility(e,s,r){if(await this.isAccessible(e,s)){r();return}if(await this.getDestinationRouteName()){r({name:await this.getDestinationRouteName()});return}if(await this.getDestinationRouteLocation(e,s)){r(await this.getDestinationRouteLocation(e,s));return}r(!1)}async getDestinationRouteName(){return""}async getDestinationRouteLocation(e,s){return null}}class Qs{constructor(e,s,r){this.scheduler=new Fe({runAction:async()=>{await this.fetchList()}}),this.repository=e,this.crudDataManagement=s,this.syncDetail=this.repository.getSyncDetail(),this.paramManager=r,this.syncListWithApi()}async fetchList(){const e=await this.repository.fetchList(this.paramManager.getRequestParams());return this.crudDataManagement.addOrReplaceItems(e.items),this.crudDataManagement.setTotalCount(e.totalItems),e}async fetchItemById(e){const s=await this.repository.fetchItemById(e);return s&&this.crudDataManagement.addOrReplaceItems([s]),s}async createItem(e){const s=await this.repository.createItem(e);return s&&!this.shouldRefreshListAfterCreate()&&this.crudDataManagement.addOrReplaceItems([s]),s&&this.shouldRefreshListAfterCreate()&&await this.fetchList(),s}shouldRefreshListAfterCreate(){return!0}async deleteItem(e){return await this.repository.deleteItem(e)?this.crudDataManagement.removeById(e):null}async updateItem(e,s){const r=await this.repository.updateItem(e,s);return this.shouldRefreshListAfterUpdate()&&r?(await this.fetchList(),this.crudDataManagement.getItemById(e)):r}shouldRefreshListAfterUpdate(){return!0}async removeItem(e){const s=await this.repository.deleteItem(e);return s&&this.shouldRefreshListAfterDelete()&&await this.fetchList(),s?this.crudDataManagement.removeById(e):null}shouldRefreshListAfterDelete(){return!1}syncListWithApi(){this.scheduler.clearInterval(),this.syncDetail.shouldKeepSync&&this.scheduler.setupInterval(this.syncDetail.intervalInMillisecond)}onDestroy(){this.crudDataManagement.clearItems(),this.clearInterval()}clearInterval(){this.scheduler.clearInterval()}}class Dt{}class er extends Dt{search(e,s,r){const n=[];e:for(const i of e)for(const a of r(i))if(B.removeSpacesFromString(String(a).toLowerCase()).indexOf(B.removeSpacesFromString(String(s).toLowerCase()))>-1){n.push(i);continue e}return n}}var He=(t=>(t.Hidden="hidden",t.Visible="visible",t))(He||{});class tr{constructor(e){this._visibilityControl=e,this.mangeVisibilityEvent()}mangeVisibilityEvent(){document.addEventListener("visibilitychange",e=>{document.visibilityState===He.Hidden?this._visibilityControl.screenInvisible(e):this._visibilityControl.screenVisible(e)})}}var sr=Object.defineProperty,rr=Object.getOwnPropertyDescriptor,O=(t,e,s,r)=>{for(var n=r>1?void 0:r?rr(e,s):e,i=t.length-1,a;i>=0;i--)(a=t[i])&&(n=(r?a(e,s,n):a(n))||n);return r&&n&&sr(e,s,n),n};o.Amount=class{constructor(){this.value="",this.symbol=""}get tradeValueInNumber(){return Number(this.value)}get truncatedValue(){return this.tradeValueInNumber.toLocaleString("en-US",{maximumFractionDigits:8})}},O([M.JsonProperty("value",String,!0)],o.Amount.prototype,"value",2),O([M.JsonProperty("symbol",String)],o.Amount.prototype,"symbol",2),o.Amount=O([M.JsonObject("Amount")],o.Amount),o.BaseModel=class{getTable(){const e=Object.getPrototypeOf(this)._table;if(!e)throw new Error("No Table found for the model. are you sure decorated the model with @Table() ?");return e}},O([M.JsonProperty("id",Object)],o.BaseModel.prototype,"id",2),o.BaseModel=O([M.JsonObject("BaseModel")],o.BaseModel),o.MinifiedSymbolModel=class extends o.BaseModel{},O([M.JsonProperty("symbol",String)],o.MinifiedSymbolModel.prototype,"symbol",2),O([M.JsonProperty("enName",String)],o.MinifiedSymbolModel.prototype,"enName",2),O([M.JsonProperty("faName",String)],o.MinifiedSymbolModel.prototype,"faName",2),O([M.JsonProperty("image",String)],o.MinifiedSymbolModel.prototype,"image",2),o.MinifiedSymbolModel=O([M.JsonObject("MinifiedSymbolModel")],o.MinifiedSymbolModel);class nr{constructor(e,s){this.requestedDate=e,this.executedDate=s}get requestedDateInJalali(){return _.mapUnixToDate(this.requestedDate,J.SimpleDate)}get requestedTime(){return _.mapUnixToDate(this.requestedDate,J.JustHour)}get executedDateInJalali(){return _.mapUnixToDate(this.executedDate,J.SimpleDate)}get executedDateTime(){return _.mapUnixToDate(this.executedDate,J.JustHour)}}class ir{constructor(e,s){this.requestedAmount=e,this.executedAmount=s}}class ar{constructor(e,s,r,n,i){this.symbolPrice=e,this.USDTPrice=s,this.symobl=r,this.symbolImage=n,this.USDTImage=i}get truncatedSymbolPrice(){return this.symbolPrice.toLocaleString("en-US",{maximumFractionDigits:8})}get truncatedUSDTPrice(){return this.USDTPrice.toLocaleString("en-US",{maximumFractionDigits:8})}}class or{constructor(e,s){this.soldSymbol=e,this.buySymbol=s}}var qe;(function(t){t[t.Transient=0]="Transient",t[t.Singleton=1]="Singleton",t[t.ResolutionScoped=2]="ResolutionScoped",t[t.ContainerScoped=3]="ContainerScoped"})(qe||(qe={}));const D=qe;/*! *****************************************************************************
|
|
3
3
|
Copyright (c) Microsoft Corporation.
|
|
4
4
|
|
|
5
5
|
Permission to use, copy, modify, and/or distribute this software for any
|