impaktapps-ui-builder 0.0.279 → 0.0.280
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/impaktapps-ui-builder.es.js +4 -4
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +1 -1
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/validationSections.d.ts +1 -1
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/validationSections.ts +5 -5
|
@@ -24,5 +24,5 @@ __p += '`),W&&(x+=`' +
|
|
|
24
24
|
function print() { __p += __j.call(arguments, '') }
|
|
25
25
|
`:`;
|
|
26
26
|
`)+x+`return __p
|
|
27
|
-
}`;var D=rl(function(){return k(s,I+"return "+x).apply(r,c)});if(D.source=x,gi(D))throw D;return D}function uh(e){return U(e).toLowerCase()}function ch(e){return U(e).toUpperCase()}function ph(e,t,n){if(e=U(e),e&&(n||t===r))return po(e);if(!e||!(t=ye(t)))return e;var i=Ee(e),a=Ee(t),s=fo(i,a),c=ho(i,a)+1;return lt(i,s,c).join("")}function fh(e,t,n){if(e=U(e),e&&(n||t===r))return e.slice(0,mo(e)+1);if(!e||!(t=ye(t)))return e;var i=Ee(e),a=ho(i,Ee(t))+1;return lt(i,0,a).join("")}function dh(e,t,n){if(e=U(e),e&&(n||t===r))return e.replace(gr,"");if(!e||!(t=ye(t)))return e;var i=Ee(e),a=fo(i,Ee(t));return lt(i,a).join("")}function hh(e,t){var n=al,i=ll;if(J(t)){var a="separator"in t?t.separator:a;n="length"in t?E(t.length):n,i="omission"in t?ye(t.omission):i}e=U(e);var s=e.length;if(At(e)){var c=Ee(e);s=c.length}if(n>=s)return e;var p=n-Rt(i);if(p<1)return i;var d=c?lt(c,0,p).join(""):e.slice(0,p);if(a===r)return d+i;if(c&&(p+=d.length-p),mi(a)){if(e.slice(p).search(a)){var y,v=d;for(a.global||(a=Er(a.source,U(Di.exec(a))+"g")),a.lastIndex=0;y=a.exec(v);)var x=y.index;d=d.slice(0,x===r?p:x)}}else if(e.indexOf(ye(a),p)!=p){var C=d.lastIndexOf(a);C>-1&&(d=d.slice(0,C))}return d+i}function gh(e){return e=U(e),e&&Ll.test(e)?e.replace(Fi,zs):e}var mh=Ht(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),bi=ia("toUpperCase");function nl(e,t,n){return e=U(e),t=n?r:t,t===r?Ws(e)?qs(e):Rs(e):e.match(t)||[]}var rl=P(function(e,t){try{return ge(e,r,t)}catch(n){return gi(n)?n:new F(n)}}),yh=Ye(function(e,t){return we(t,function(n){n=Ne(n),qe(e,n,di(e[n],e))}),e});function vh(e){var t=e==null?0:e.length,n=B();return e=t?q(e,function(i){if(typeof i[1]!="function")throw new Ce(S);return[n(i[0]),i[1]]}):[],P(function(i){for(var a=-1;++a<t;){var s=e[a];if(ge(s[0],this,i))return ge(s[1],this,i)}})}function bh(e){return zu(Ie(e,Y))}function xi(e){return function(){return e}}function xh(e,t){return e==null||e!==e?t:e}var _h=aa(),Sh=aa(!0);function de(e){return e}function _i(e){return Ho(typeof e=="function"?e:Ie(e,Y))}function wh(e){return Wo(Ie(e,Y))}function Ch(e,t){return ko(e,Ie(t,Y))}var Lh=P(function(e,t){return function(n){return nn(n,e,t)}}),Ih=P(function(e,t){return function(n){return nn(e,n,t)}});function Si(e,t,n){var i=ne(t),a=Wn(t,i);n==null&&!(J(t)&&(a.length||!i.length))&&(n=t,t=e,e=this,a=Wn(t,ne(t)));var s=!(J(n)&&"chain"in n)||!!n.chain,c=Ze(e);return we(a,function(p){var d=t[p];e[p]=d,c&&(e.prototype[p]=function(){var y=this.__chain__;if(s||y){var v=e(this.__wrapped__),x=v.__actions__=ce(this.__actions__);return x.push({func:d,args:arguments,thisArg:e}),v.__chain__=y,v}return d.apply(e,tt([this.value()],arguments))})}),e}function Bh(){return re._===this&&(re._=Qs),this}function wi(){}function Ah(e){return e=E(e),P(function(t){return Uo(t,e)})}var Rh=ei(q),Fh=ei(ao),Th=ei(Lr);function il(e){return li(e)?Ir(Ne(e)):ac(e)}function Eh(e){return function(t){return e==null?r:mt(e,t)}}var Dh=sa(),Ph=sa(!0);function Ci(){return[]}function Li(){return!1}function Mh(){return{}}function Hh(){return""}function Oh(){return!0}function Wh(e,t){if(e=E(e),e<1||e>je)return[];var n=We,i=oe(e,We);t=B(t),e-=We;for(var a=Rr(i,t);++n<e;)t(n);return a}function kh(e){return T(e)?q(e,Ne):ve(e)?[e]:ce(Ca(U(e)))}function Uh(e){var t=++Zs;return U(e)+t}var Nh=$n(function(e,t){return e+t},0),Gh=ti("ceil"),zh=$n(function(e,t){return e/t},1),$h=ti("floor");function Kh(e){return e&&e.length?On(e,de,Ur):r}function qh(e,t){return e&&e.length?On(e,B(t,2),Ur):r}function Vh(e){return uo(e,de)}function Yh(e,t){return uo(e,B(t,2))}function Jh(e){return e&&e.length?On(e,de,$r):r}function Zh(e,t){return e&&e.length?On(e,B(t,2),$r):r}var Xh=$n(function(e,t){return e*t},1),Qh=ti("round"),jh=$n(function(e,t){return e-t},0);function eg(e){return e&&e.length?Ar(e,de):0}function tg(e,t){return e&&e.length?Ar(e,B(t,2)):0}return l.after=wf,l.ary=Ma,l.assign=cd,l.assignIn=Ja,l.assignInWith=rr,l.assignWith=pd,l.at=fd,l.before=Ha,l.bind=di,l.bindAll=yh,l.bindKey=Oa,l.castArray=Mf,l.chain=Ea,l.chunk=zc,l.compact=$c,l.concat=Kc,l.cond=vh,l.conforms=bh,l.constant=xi,l.countBy=jp,l.create=dd,l.curry=Wa,l.curryRight=ka,l.debounce=Ua,l.defaults=hd,l.defaultsDeep=gd,l.defer=Cf,l.delay=Lf,l.difference=qc,l.differenceBy=Vc,l.differenceWith=Yc,l.drop=Jc,l.dropRight=Zc,l.dropRightWhile=Xc,l.dropWhile=Qc,l.fill=jc,l.filter=tf,l.flatMap=of,l.flatMapDeep=af,l.flatMapDepth=lf,l.flatten=Aa,l.flattenDeep=ep,l.flattenDepth=tp,l.flip=If,l.flow=_h,l.flowRight=Sh,l.fromPairs=np,l.functions=Sd,l.functionsIn=wd,l.groupBy=sf,l.initial=ip,l.intersection=op,l.intersectionBy=ap,l.intersectionWith=lp,l.invert=Ld,l.invertBy=Id,l.invokeMap=cf,l.iteratee=_i,l.keyBy=pf,l.keys=ne,l.keysIn=fe,l.map=Xn,l.mapKeys=Ad,l.mapValues=Rd,l.matches=wh,l.matchesProperty=Ch,l.memoize=jn,l.merge=Fd,l.mergeWith=Za,l.method=Lh,l.methodOf=Ih,l.mixin=Si,l.negate=er,l.nthArg=Ah,l.omit=Td,l.omitBy=Ed,l.once=Bf,l.orderBy=ff,l.over=Rh,l.overArgs=Af,l.overEvery=Fh,l.overSome=Th,l.partial=hi,l.partialRight=Na,l.partition=df,l.pick=Dd,l.pickBy=Xa,l.property=il,l.propertyOf=Eh,l.pull=pp,l.pullAll=Fa,l.pullAllBy=fp,l.pullAllWith=dp,l.pullAt=hp,l.range=Dh,l.rangeRight=Ph,l.rearg=Rf,l.reject=mf,l.remove=gp,l.rest=Ff,l.reverse=pi,l.sampleSize=vf,l.set=Md,l.setWith=Hd,l.shuffle=bf,l.slice=mp,l.sortBy=Sf,l.sortedUniq=wp,l.sortedUniqBy=Cp,l.split=oh,l.spread=Tf,l.tail=Lp,l.take=Ip,l.takeRight=Bp,l.takeRightWhile=Ap,l.takeWhile=Rp,l.tap=$p,l.throttle=Ef,l.thru=Zn,l.toArray=qa,l.toPairs=Qa,l.toPairsIn=ja,l.toPath=kh,l.toPlainObject=Ya,l.transform=Od,l.unary=Df,l.union=Fp,l.unionBy=Tp,l.unionWith=Ep,l.uniq=Dp,l.uniqBy=Pp,l.uniqWith=Mp,l.unset=Wd,l.unzip=fi,l.unzipWith=Ta,l.update=kd,l.updateWith=Ud,l.values=kt,l.valuesIn=Nd,l.without=Hp,l.words=nl,l.wrap=Pf,l.xor=Op,l.xorBy=Wp,l.xorWith=kp,l.zip=Up,l.zipObject=Np,l.zipObjectDeep=Gp,l.zipWith=zp,l.entries=Qa,l.entriesIn=ja,l.extend=Ja,l.extendWith=rr,Si(l,l),l.add=Nh,l.attempt=rl,l.camelCase=Kd,l.capitalize=el,l.ceil=Gh,l.clamp=Gd,l.clone=Hf,l.cloneDeep=Wf,l.cloneDeepWith=kf,l.cloneWith=Of,l.conformsTo=Uf,l.deburr=tl,l.defaultTo=xh,l.divide=zh,l.endsWith=qd,l.eq=Pe,l.escape=Vd,l.escapeRegExp=Yd,l.every=ef,l.find=nf,l.findIndex=Ia,l.findKey=md,l.findLast=rf,l.findLastIndex=Ba,l.findLastKey=yd,l.floor=$h,l.forEach=Da,l.forEachRight=Pa,l.forIn=vd,l.forInRight=bd,l.forOwn=xd,l.forOwnRight=_d,l.get=yi,l.gt=Nf,l.gte=Gf,l.has=Cd,l.hasIn=vi,l.head=Ra,l.identity=de,l.includes=uf,l.indexOf=rp,l.inRange=zd,l.invoke=Bd,l.isArguments=bt,l.isArray=T,l.isArrayBuffer=zf,l.isArrayLike=pe,l.isArrayLikeObject=X,l.isBoolean=$f,l.isBuffer=st,l.isDate=Kf,l.isElement=qf,l.isEmpty=Vf,l.isEqual=Yf,l.isEqualWith=Jf,l.isError=gi,l.isFinite=Zf,l.isFunction=Ze,l.isInteger=Ga,l.isLength=tr,l.isMap=za,l.isMatch=Xf,l.isMatchWith=Qf,l.isNaN=jf,l.isNative=ed,l.isNil=nd,l.isNull=td,l.isNumber=$a,l.isObject=J,l.isObjectLike=Z,l.isPlainObject=un,l.isRegExp=mi,l.isSafeInteger=rd,l.isSet=Ka,l.isString=nr,l.isSymbol=ve,l.isTypedArray=Wt,l.isUndefined=id,l.isWeakMap=od,l.isWeakSet=ad,l.join=sp,l.kebabCase=Jd,l.last=Ae,l.lastIndexOf=up,l.lowerCase=Zd,l.lowerFirst=Xd,l.lt=ld,l.lte=sd,l.max=Kh,l.maxBy=qh,l.mean=Vh,l.meanBy=Yh,l.min=Jh,l.minBy=Zh,l.stubArray=Ci,l.stubFalse=Li,l.stubObject=Mh,l.stubString=Hh,l.stubTrue=Oh,l.multiply=Xh,l.nth=cp,l.noConflict=Bh,l.noop=wi,l.now=Qn,l.pad=Qd,l.padEnd=jd,l.padStart=eh,l.parseInt=th,l.random=$d,l.reduce=hf,l.reduceRight=gf,l.repeat=nh,l.replace=rh,l.result=Pd,l.round=Qh,l.runInContext=f,l.sample=yf,l.size=xf,l.snakeCase=ih,l.some=_f,l.sortedIndex=yp,l.sortedIndexBy=vp,l.sortedIndexOf=bp,l.sortedLastIndex=xp,l.sortedLastIndexBy=_p,l.sortedLastIndexOf=Sp,l.startCase=ah,l.startsWith=lh,l.subtract=jh,l.sum=eg,l.sumBy=tg,l.template=sh,l.times=Wh,l.toFinite=Xe,l.toInteger=E,l.toLength=Va,l.toLower=uh,l.toNumber=Re,l.toSafeInteger=ud,l.toString=U,l.toUpper=ch,l.trim=ph,l.trimEnd=fh,l.trimStart=dh,l.truncate=hh,l.unescape=gh,l.uniqueId=Uh,l.upperCase=mh,l.upperFirst=bi,l.each=Da,l.eachRight=Pa,l.first=Ra,Si(l,function(){var e={};return ke(l,function(t,n){N.call(l.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),l.VERSION=h,we(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){l[e].placeholder=l}),we(["drop","take"],function(e,t){H.prototype[e]=function(n){n=n===r?1:te(E(n),0);var i=this.__filtered__&&!t?new H(this):this.clone();return i.__filtered__?i.__takeCount__=oe(n,i.__takeCount__):i.__views__.push({size:oe(n,We),type:e+(i.__dir__<0?"Right":"")}),i},H.prototype[e+"Right"]=function(n){return this.reverse()[e](n).reverse()}}),we(["filter","map","takeWhile"],function(e,t){var n=t+1,i=n==Bi||n==pl;H.prototype[e]=function(a){var s=this.clone();return s.__iteratees__.push({iteratee:B(a,3),type:n}),s.__filtered__=s.__filtered__||i,s}}),we(["head","last"],function(e,t){var n="take"+(t?"Right":"");H.prototype[e]=function(){return this[n](1).value()[0]}}),we(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");H.prototype[e]=function(){return this.__filtered__?new H(this):this[n](1)}}),H.prototype.compact=function(){return this.filter(de)},H.prototype.find=function(e){return this.filter(e).head()},H.prototype.findLast=function(e){return this.reverse().find(e)},H.prototype.invokeMap=P(function(e,t){return typeof e=="function"?new H(this):this.map(function(n){return nn(n,e,t)})}),H.prototype.reject=function(e){return this.filter(er(B(e)))},H.prototype.slice=function(e,t){e=E(e);var n=this;return n.__filtered__&&(e>0||t<0)?new H(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(t=E(t),n=t<0?n.dropRight(-t):n.take(t-e)),n)},H.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},H.prototype.toArray=function(){return this.take(We)},ke(H.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),a=l[i?"take"+(t=="last"?"Right":""):t],s=i||/^find/.test(t);!a||(l.prototype[t]=function(){var c=this.__wrapped__,p=i?[1]:arguments,d=c instanceof H,y=p[0],v=d||T(c),x=function(M){var W=a.apply(l,tt([M],p));return i&&C?W[0]:W};v&&n&&typeof y=="function"&&y.length!=1&&(d=v=!1);var C=this.__chain__,I=!!this.__actions__.length,A=s&&!C,D=d&&!I;if(!s&&v){c=D?c:new H(this);var R=e.apply(c,p);return R.__actions__.push({func:Zn,args:[x],thisArg:r}),new Le(R,C)}return A&&D?e.apply(this,p):(R=this.thru(x),A?i?R.value()[0]:R.value():R)})}),we(["pop","push","shift","sort","splice","unshift"],function(e){var t=Sn[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",i=/^(?:pop|shift)$/.test(e);l.prototype[e]=function(){var a=arguments;if(i&&!this.__chain__){var s=this.value();return t.apply(T(s)?s:[],a)}return this[n](function(c){return t.apply(T(c)?c:[],a)})}}),ke(H.prototype,function(e,t){var n=l[t];if(n){var i=n.name+"";N.call(Dt,i)||(Dt[i]=[]),Dt[i].push({name:t,func:n})}}),Dt[zn(r,ut).name]=[{name:"wrapper",func:r}],H.prototype.clone=hu,H.prototype.reverse=gu,H.prototype.value=mu,l.prototype.at=Kp,l.prototype.chain=qp,l.prototype.commit=Vp,l.prototype.next=Yp,l.prototype.plant=Zp,l.prototype.reverse=Xp,l.prototype.toJSON=l.prototype.valueOf=l.prototype.value=Qp,l.prototype.first=l.prototype.head,Jt&&(l.prototype[Jt]=Jp),l},Ft=Vs();pt?((pt.exports=Ft)._=Ft,_r._=Ft):re._=Ft}).call(commonjsGlobal)})(lodash,lodash.exports);var _=lodash.exports;const ComponentSchema={type:"object",properties:{layout:{type:"array",items:{type:"object",properties:{key:{type:"string"},value:{type:"string"}}}},value:{type:"array",items:{type:"object",properties:{label:{type:"string"},value:{type:"string"}}}},columns:{type:"array",items:{type:"object",properties:{header:{type:"string"},accessorKey:{type:"string"},widgetType:{type:"string"}}}},events:{type:"array",items:{type:"object",properties:{eventType:{type:"string"},configType:{type:"string"}}}},sectionLabels:{type:"array",items:{type:"object",properties:{label:{type:"string"}}}},legendLabels:{type:"array",items:{type:"object",properties:{label:{type:"string"}}}},pieArcColors:{type:"array",items:{type:"object",properties:{label:{type:"string"}}}},validation:{type:"array",items:{type:"object",properties:{componentName:{type:"string"},validationType:{type:"string"},validationValue:{type:"string"}}}}}},componentBasicUiSchema={type:"HorizontalLayout",elements:[{type:"WrapperLayout",config:{main:{rowSpacing:1,header:!0},defaultStyle:!0},elements:[{type:"Control",scope:"#/properties/Component",options:{widget:"Box"},config:{layout:{xs:12,sm:12,md:2},main:{heading:"Component"},style:{float:"left"}}},{type:"Control",scope:"#/properties/pageName",options:{widget:"Box"},config:{layout:{xs:7,sm:7,md:9},main:{heading:" "},style:{float:"right",width:"auto",fontSize:"12px",color:"gray",paddingTop:"10px"}}},{type:"Control",scope:"#/properties/Back_Button",options:{widget:"IconButton"},config:{layout:{xs:2,sm:2,md:.5},main:{icon:"BackIcon",styleDefault:!0,size:"small",onClick:"backHandler",tooltipMessage:"Back"},style:{float:"right"}}}]},{type:"TabLayout",config:{main:{tabLabels:["Core"],defaultStyle:!0,id:"component"}},elements:[{type:"HorizontalLayout",elements:[{type:"Control",scope:"#/properties/type",options:{widget:"SelectInputField"},config:{layout:{xs:12,sm:12,md:6,lg:6},main:{label:"Type",options:[{title:"Select",const:"Select"},{title:"Date",const:"Date"},{title:"CheckBox",const:"CheckBox"},{title:"Table",const:"Table"},{title:"Array",const:"Array"},{title:"Container",const:"WrapperSection"},{title:"Tabs",const:"TabSection"},{title:"Text",const:"Text"},{title:"Radio",const:"Radio"},{title:"Text Area",const:"TextArea"},{title:"Button",const:"Button"},{title:"Card",const:"card"},{title:"Rank",const:"Rank"},{title:"SpeedoMeter",const:"SpeedoMeter"},{title:"ProgressBar",const:"ProgressBar"},{title:"Graph",const:"Graph"},{title:"Label",const:"Box"},{title:"Upload File",const:"UploadFile"},{title:"Download File",const:"DownloadFile"},{title:"Empty Box",const:"EmptyBox"},{title:"ProgressBar Card",const:"ProgressBarCard"},{title:"Rank Card",const:"RankCard"},{title:"Runner Boy Progress Bar",const:"RunnerBoyProgressBar"},{title:"Slider",const:"Slider"},{title:"Timer",const:"Timer"},{title:"MultipleSelect",const:"MultipleSelect"},{title:"LeaderBoard",const:"LeaderBoard"}]}}},{type:"Control",scope:"#/properties/name",options:{widget:"InputField"},config:{layout:{xs:12,sm:12,md:6,lg:6},main:{label:"Name",options:[],color:"secondary",required:!0}}},{type:"Control",scope:"#/properties/label",options:{widget:"InputField"},config:{layout:{xs:12,sm:12,md:6,lg:6},main:{label:"Label",options:[],color:"secondary",required:!0}}},{type:"Control",scope:"#/properties/proc",config:{layout:{xs:11,sm:11,md:6,lg:6}},options:{widget:"EmptyBox"}},{type:"Control",scope:"#/properties/layout",layout:11.5,options:{detail:{type:"HorizontalLayout",elements:[{type:"Control",scope:"#/properties/key",options:{widget:"SelectInputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"Screen Size",options:[{title:"Extra Small",const:"xs"},{title:"Small",const:"sm"},{title:"Medium",const:"md"},{title:"Large",const:"lg"}]}}},{type:"Control",scope:"#/properties/value",options:{widget:"MultipleSelect"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"Value",options:[{title:"3",const:"3"},{title:"5.5",const:"5.5"},{title:"8",const:"8"},{title:"12",const:"12"}]}}}]}}}]}]},{type:"Control",scope:"#/properties/proc",config:{layout:{xs:11,sm:11,md:8,lg:8}},options:{widget:"EmptyBox"}},{type:"Control",scope:"#/properties/btn",options:{widget:"Button"},config:{layout:{xs:11,sm:11,md:3,lg:3},main:{name:"Save",startIcon:"ApproveIcon",variant:"contained",color:"info",type:"text",onClick:"saveHandler",size:"small"},style:{marginBottom:"8px",float:"right"}}},{type:"Control",scope:"#/properties/notify",options:{widget:"Notify"},layout:6}]};var buildConfig=o=>{const u=_.cloneDeep(o);let r={};return u.pageName&&delete u.pageName,u.eventsSelected&&delete u.eventsSelected,(u.type==="Table"||u.type==="WrapperSection"||u.type==="TabSection")&&(r.elements=u.elements||[],u.elements&&delete u.elements),r.events=u.events||[],u.events&&delete u.events,r={...u,...r},r};const createLayoutFormat=o=>{let u={};return o.map(r=>{u[r.key]=+r.value}),u},flatObjectValueInArray=o=>{const u=Object.keys(o[0])[0];return o.map(h=>h[u])},getNavigationHistory=(o,u)=>{if(u){let r=o.name;const h=u.split("."),b=[];return h.map((w,S)=>{if(S===0){b.push(w);return}b.push(`${b[S-1]}.${w}`)}),b.map(w=>{const S=_.get(o,w);S?r=r+` > ${(S==null?void 0:S.name)||(S==null?void 0:S.eventType)}`:r=r+" > NewComponent"}),{pageName:r}}},saveFormdataInLocalStorage=(o,u)=>{let r;if(u){const h=getFormdataFromLocalStorage();r=_.set(h,u,buildConfig(o))}else r=buildConfig(o);return localStorage.setItem("pageFormdata",JSON.stringify(r)),r},getFormdataFromLocalStorage=o=>{const u=localStorage.getItem("pageFormdata")?JSON.parse(localStorage.getItem("pageFormdata")):void 0;let r;return o&&(r=_.get(u,o),r={...r,...getNavigationHistory(u,o)}),r||(r=getNavigationHistory(u,o)),r||u},CoreSection={type:"HorizontalLayout",elements:[{type:"Control",scope:"#/properties/type",options:{widget:"SelectInputField"},config:{layout:{xs:12,sm:12,md:6,lg:6},main:{label:"Type",type:"text",options:[{title:"Select",const:"Select"},{title:"Date",const:"Date"},{title:"CheckBox",const:"CheckBox"},{title:"Table",const:"Table"},{title:"Array",const:"Array"},{title:"Container",const:"WrapperSection"},{title:"Tabs",const:"TabSection"},{title:"Text",const:"Text"},{title:"Text Area",const:"TextArea"},{title:"Button",const:"Button"},{title:"Card",const:"card"},{title:"Radio",const:"Radio"},{title:"Rank",const:"Rank"},{title:"SpeedoMeter",const:"SpeedoMeter"},{title:"ProgressBar",const:"ProgressBar"},{title:"Graph",const:"Graph"},{title:"Label",const:"Box"},{title:"Upload File",const:"UploadFile"},{title:"Download File",const:"DownloadFile"},{title:"Empty Box",const:"EmptyBox"},{title:"ProgressBar Card",const:"ProgressBarCard"},{title:"Rank Card",const:"RankCard"},{title:"Runner Boy Progress Bar",const:"RunnerBoyProgressBar"},{title:"Slider",const:"Slider"},{title:"Timer",const:"Timer"},{title:"MultipleSelect",const:"MultipleSelect"},{title:"LeaderBoard",const:"LeaderBoard"}]}}},{type:"Control",scope:"#/properties/name",options:{widget:"InputField"},config:{layout:{xs:12,sm:12,md:6,lg:6},main:{label:"Name"}}},{type:"Control",scope:"#/properties/label",options:{widget:"InputField"},config:{layout:{xs:12,sm:12,md:6,lg:6},main:{label:"Label"}}},{type:"Control",scope:"#/properties/proc",config:{layout:{xs:11,sm:11,md:6,lg:6}},options:{widget:"EmptyBox"}},{type:"Control",scope:"#/properties/layout",layout:11.5,options:{elementLabelProp:"key",detail:{type:"HorizontalLayout",elements:[{type:"Control",scope:"#/properties/key",options:{widget:"SelectInputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"Screen Size",options:[{title:"Extra Small",const:"xs"},{title:"Small",const:"sm"},{title:"Medium",const:"md"},{title:"Large",const:"lg"}]}}},{type:"Control",scope:"#/properties/value",options:{widget:"MultipleSelect"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"Value",options:[{title:"3",const:"3"},{title:"5.5",const:"5.5"},{title:"8",const:"8"},{title:"12",const:"12"}]}}}]}}}]},OptionArray={type:"Control",scope:"#/properties/value",layout:11.5,options:{detail:{type:"HorizontalLayout",elements:[{type:"Control",scope:"#/properties/label",options:{widget:"InputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"Label"}}},{type:"Control",scope:"#/properties/value",options:{widget:"InputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"Value"}}}]}}},EventSection={type:"HorizontalLayout",elements:[{type:"WrapperLayout",config:{main:{divider:!0},wrapperStyle:{border:"1px solid gray"}},elements:[{type:"Control",scope:"#/properties/programType",options:{widget:"Box"},config:{layout:8,main:{heading:"Event Table"},style:{fontFamily:"Roboto",fontWeight:"500",paddingLeft:"-10px",fontSize:"20px"}}},{type:"Control",scope:"#/properties/Back_Button",options:{widget:"IconButton"},config:{layout:3,main:{icon:"AddIcon",styleDefault:!0,size:"small",onClick:"eventAddHandler",tooltipMessage:"Back"},style:{float:"right"}}},{type:"Control",scope:"#/properties/events",options:{widget:"Table"},config:{main:{disableAction:!0,disableSelection:!0,enableDrag:!0}},elements:[{accessorKey:"eventType",header:"Event Type"},{accessorKey:"Handler",header:"Handler"},{accessorKey:"Edit_Approve_Records",header:"Edit Widget",widget:{type:"Control",scope:"#/properties/Edit_Records",options:{widget:"IconButton"},config:{main:{color:"info",size:"small",icon:"EditIcon",tooltipMessage:"Edit This Record",onClick:"eventEditHandler"},style:{color:"#3949ab"}}}},{accessorKey:"Reject_Records",header:"Delete",widget:{type:"Control",scope:"#/properties/RejectButton",accessorKeyName:"Reject_Records",options:{widget:"IconButton"},config:{main:{icon:"RejectIcon",color:"error",tooltipMessage:"Reject This Record",onClick:"deleteEvent"}}}}]}]}]},EmptyBox={type:"Control",scope:"#/properties/empty",options:{widget:"EmptyBox"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{}}},getArrayControl=(o,u,r)=>({type:"Control",scope:`#/properties/${o}`,layout:11.5,options:{elementLabelProp:u,detail:{type:"HorizontalLayout",elements:[{type:"Control",scope:`#/properties/${u}`,options:{widget:"InputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:r||"Labels for Tab"}}}]}}}),getInputField=(o,u)=>({type:"Control",scope:`#/properties/${o}`,options:{widget:"InputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:u}}}),getRadioInputField=(o,u,r)=>({type:"Control",scope:`#/properties/${o}`,options:{widget:"RadioInputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:u,options:r}}}),getTextArea=(o,u,r,h)=>({type:"Control",scope:`#/properties/${o}`,options:{widget:"TextArea"},config:{layout:h||12,style:{containerStyle:{borderRadius:"20px"},headerContainerStyle:{},textAreaStyle:{borderRadius:"20px",padding:"20px"}},main:{heading:u,minRows:8,hideButton:r}}}),getSelectField=(o,u,r)=>({type:"Control",scope:`#/properties/${o}`,options:{widget:"SelectInputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:u,type:"text",options:r}}}),GraphSection={type:"HorizontalLayout",elements:[]},buildPropertiesSection=function(o){let u=_.cloneDeep(GraphSection);if(o==="SpeedoMeter")u.elements=[getInputField("segments","Segments Count"),getInputField("heading","Container Heading"),getInputField("heading","Container Heading"),getInputField("speedoCaption","Speedometer Caption"),getInputField("width","Speedometer Width")];else if(o==="RankCard")u.elements=[getInputField("rank","Rank"),getInputField("image","Image Url"),getInputField("title","Card Title"),getInputField("description","Card Description")];else if(o==="LeaderBoard")u.elements=[getInputField("valueLabel","Value Label"),getInputField("firstImage","First Image url"),getInputField("secondImage","Second Image url"),getInputField("thirdImage","Third Image url"),getTextArea("functionCode","Write Compare Code",!1)];else if(o==="CardSlider"){const r=getInputField("heading","Heading"),h=getInputField("iconName","Icon Name");u.elements=[r,h]}else if(o==="ProgressBar"||o==="ProgressBarCard"){const r=getInputField("heading","Heading"),h=getInputField("bottomLabel_1","First BottomLabel"),b=getInputField("bottomLabel_2","Second BottomLabel"),w=getInputField("bottomLabel_3","Third BottomLabel");u.elements=[r,h,b,w]}else if(o==="card")u.elements=[getInputField("url","Image Url"),getInputField("label","Label"),getInputField("description","Description")];else if(o==="Box"){const r=getInputField("value","Value");u.elements=[getSelectField("graphType","Label Type",[{title:"URL",const:"url"},{title:"Heading",const:"heading"}]),r]}else if(o==="Button"){const r=getInputField("color","Color"),h=getInputField("size","Size"),b=getInputField("iconName","Icon Name");u.elements=[getSelectField("buttonType","Button Type",[{title:"Button With Text",const:"Button"},{title:"Button With Icon",const:"IconButton"},{title:"Button With Icon and Text",const:"ButtonWithIconAndText"}]),b,h,r,getSelectField("defaultStyle","Default Style",[{title:"Apply Default Style",const:"true"},{title:"No Style",const:"false"}]),JSON.parse(JSON.stringify(EmptyBox))]}else if(o==="Graph"){const r=getInputField("height","Height"),h=getInputField("heading","Heading"),b=getInputField("leftLabel","Left Label"),w=getInputField("bottomLabel","Bottom Label"),S=getRadioInputField("legendHide","Legend Hide",["YES","No"]);u.elements=[h,r,getSelectField("graphType","Graph Type",[{title:"Bar Graph",const:"BarGraph"},{title:"Stack Bar Graph",const:"StackBarGraph"},{title:"Line Graph",const:"LineGraph"},{title:"Pie Graph",const:"PieGraph"},{title:"Horizontal Bar Graph",const:"HorizontalBarGraph"}]),b,w,S,getArrayControl("legendLabels","label"),getArrayControl("pieArcColors","color")]}else o==="WrapperSection"?u.elements=[getRadioInputField("divider","Divider",["YES","No"]),getRadioInputField("heading","Page Heading",["YES","No"])]:o==="TabSection"?u.elements=[getArrayControl("sectionLabels","label")]:o==="Radio"&&(u.elements=[getArrayControl("sectionLabels","label","Options Of Radio")]);return u},StyleSection={type:"HorizontalLayout",elements:[{type:"Control",scope:"#/properties/style",options:{widget:"TextArea"},config:{layout:{xs:12,sm:12,md:12,lg:12},style:{containerStyle:{borderRadius:"20px"},headerContainerStyle:{},textAreaStyle:{borderRadius:"20px",padding:"20px"}},main:{heading:"JSON Style",minRows:8,hideButton:!0}}}]},TableSection={type:"HorizontalLayout",elements:[{type:"WrapperLayout",config:{main:{},wrapperStyle:{border:"1px solid gray"}},elements:[{type:"Control",scope:"#/properties/programType",options:{widget:"Box"},config:{layout:8,main:{heading:"Components Table"},style:{fontFamily:"Roboto",fontWeight:"500",paddingLeft:"-10px",fontSize:"20px"}}},{type:"Control",scope:"#/properties/Back_Button",options:{widget:"IconButton"},config:{layout:3,main:{icon:"AddIcon",styleDefault:!0,size:"small",onClick:"widgetAddClickHandler",tooltipMessage:"Back"},style:{float:"right"}}},{type:"Control",scope:"#/properties/elements",options:{widget:"Table"},config:{main:{disableAction:!0,disableSelection:!0,enableDrag:!0}},elements:[{accessorKey:"name",header:"Name"},{accessorKey:"type",header:"Type"},{header:"Edit Record",field:"Reject_Records",flex:1,widget:{type:"Control",scope:"#/properties/RejectButton",options:{widget:"IconButton"},config:{main:{icon:"EditIcon",color:"primary",onClick:"editComponents",tooltipMessage:"Reject This Record"}}}},{header:"Delete",field:"Reject_Records",flex:1,widget:{type:"Control",scope:"#/properties/RejectButton",options:{widget:"IconButton"},config:{main:{icon:"RejectIcon",color:"error",onClick:"deleteComponents",tooltipMessage:"Reject This Record"}}}}]}]}]},ValueTab={type:"HorizontalLayout",elements:[OptionArray]},ValidationSection={type:"HorizontalLayout",elements:[{type:"Control",scope:"#/properties/validation",layout:11.5,options:{elementLabelProp:"validationType",detail:{type:"HorizontalLayout",elements:[{type:"Control",scope:"#/properties/validationType",options:{widget:"SelectInputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"Validation Type",options:[{title:"required",const:"Required"},{title:"minLength",const:"Minimum Length"},{title:"maxLength",const:"Maximum Length"},{title:"pattern",const:"Pattern"}]}}},{type:"Control",scope:"#/properties/validationValue",options:{widget:"InputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"Validation Value"}}}]}}}]},sectionLabels={Select:["Core","Value","style","Event","Validation"],MultipleSelect:["Core","Value","style","Event","Validation"],Table:["Core","Components","style","Event","Validation"],LeaderBoard:["Core","Components","Properties","style","Event","Validation"],WrapperSection:["Core","Components","Properties","style","Validation"],TabSection:["Core","Components","Properties","style","Validation"],SpeedoMeter:["Core","Properties","style","Event","Validation"],card:["Core","Properties","style","Event","Validation"],UploadFile:["Core","style","Event","Validation"],Graph:["Core","Properties","style","Event","Validation"],DownloadFile:["Core","style","Event","Validation"],Box:["Core","Properties","style","Event","Validation"],Properties:["Core","Properties","style","Event","Validation"],ProgressBarCard:["Core","Properties","style","Event","Validation"],RankCard:["Core","Properties","style","Event","Validation"],Slider:["Core","Components","Properties","style","Event","Validation"],Timer:["Core","Properties","style","Event","Validation"],Rank:["Core","Properties","style","Event","Validation"],Button:["Core","Properties","style","Event","Validation"],Array:["Core","Components","Validation"],Radio:["Core","Properties","style","Event","Validation"],Text:["Core","Event","Validation"]},refreshPage=(o,u)=>{var h;const r=_.cloneDeep(componentBasicUiSchema);if(o){const b={Core:CoreSection,Value:ValueTab,style:StyleSection,Event:EventSection,Components:TableSection,Properties:buildPropertiesSection(o),Validation:ValidationSection},w=(h=sectionLabels[o])==null?void 0:h.map(S=>b[S]);r.elements[1].config.main.tabLabels=sectionLabels[o]||["Core","style","Event","Validation"],r.elements[1].elements=w||[CoreSection,StyleSection,EventSection,ValidationSection]}u.setUiSchema(r)};var Component=(o,u)=>({setPage:async function(){const r=await this.getFormdata();o.setFormdata(r);const h=this.getSchema();o.setSchema(h),this.refreshPage(r==null?void 0:r.type,o)},refreshPage,getFormdata:async function(){var h;const r=(h=o.searchParams)==null?void 0:h.get("path");return getFormdataFromLocalStorage(r)},getSchema:function(){return ComponentSchema},saveHandler:async function(){var h;const r=(h=o.searchParams)==null?void 0:h.get("path");saveFormdataInLocalStorage(o.formData,r),o.navigate(-1),o.setNotify({SuccessMessage:"Save Successfully",Success:!0})},onChange:function(){var r,h,b,w;((r=o==null?void 0:o.formData)==null?void 0:r.type)!==((h=o==null?void 0:o.newData)==null?void 0:h.type)&&((b=o==null?void 0:o.newData)==null?void 0:b.type)!==void 0&&this.refreshPage((w=o==null?void 0:o.newData)==null?void 0:w.type,o)},editComponents:async function(){var w,S,O;const r=u.path.split(".")[1],h=(w=o.searchParams)==null?void 0:w.get("path"),b=(S=o.searchParams)==null?void 0:S.get("id");if(saveFormdataInLocalStorage(o.formData,h),h){const j=`${(O=o.searchParams)==null?void 0:O.get("path")}.elements[${r}]`;o.searchParams.set("path",j),o.setSearchParams(o.searchParams),this.setPage()}else o.navigate(`/Component?path=${`elements[${r}]`}&id=${b}`)},deleteComponents:async function(){var S;const r=(S=o.searchParams)==null?void 0:S.get("path"),h=u.path.split(".")[1];o.formData.elements.splice(h,1);const b=saveFormdataInLocalStorage(o.formData,r),w=r?_.get(b,r):b;o.setFormdata(w)},deleteEvent:async function(){var w;const r=(w=o.searchParams)==null?void 0:w.get("path"),h=u.path.split(".")[1];o.formData.events.splice(h,1);const b=saveFormdataInLocalStorage(o.formData,r);o.setFormdata(_.get(b,r))},widgetAddClickHandler:async function(){var b;Array.isArray(o.formData.elements)||(o.formData.elements=[]);const r=(b=o.searchParams)==null?void 0:b.get("path");saveFormdataInLocalStorage(o.formData,r);const h=`${r}.elements[${o.formData.elements.length}]`;o.searchParams.set("path",h),o.setSearchParams(o.searchParams),this.setPage()},eventEditHandler:async function(){var S,O;const r=u.path.split(".")[1],h=(S=o.searchParams)==null?void 0:S.get("path"),b=(O=o.searchParams)==null?void 0:O.get("id");saveFormdataInLocalStorage(o.formData,h);const w=`${h}.events[${r}]`;o.navigate(`/ComponentEvents?path=${w}&id=${b}`)},eventAddHandler:async function(){var w,S;const r=(w=o.searchParams)==null?void 0:w.get("path"),h=(S=o.searchParams)==null?void 0:S.get("id");Array.isArray(o.formData.events)||(o.formData.events=[]),saveFormdataInLocalStorage(o.formData,r);const b=`${r}.events[${o.formData.events.length}]`;o.navigate(`/ComponentEvents?path=${b}&id=${h}`)},backHandler:function(){o.navigate(-1)}}),leaderBoard={type:"WrapperLayout",config:{main:{rowSpacing:3,header:!0,label:"LeaderBoard",divider:!0},style:{wrapperStyle:{height:{xs:850,sm:1e3}}},wrapperStyle:{position:"relative",width:"100%"}},elements:[{type:"Control",scope:"#/properties/leaderBoard/properties/firstImage",config:{main:{url:"https://my.alfred.edu/zoom/_images/foster-lake.jpg"},containerStyle:{objectFit:"cover",position:"absolute",top:{xs:"90px",md:"60px"},left:{xs:"calc(50% - 50px)",sm:"calc(50% - 50px)",md:"calc(50% - 100px)"},width:{xs:"100px",sm:"100px",md:"200px"},border:"5px solid rgb(179, 198, 255)",height:{xs:"100px",sm:"100px",md:"200px"},borderRadius:"50%"},style:{objectFit:"cover",width:"100%",height:"100%",borderRadius:"50%"},layout:6},options:{widget:"Image"}},{type:"Control",scope:"#/properties/leaderBoard/properties/secondImage",config:{main:{url:"https://my.alfred.edu/zoom/_images/foster-lake.jpg"},containerStyle:{objectFit:"cover",position:"absolute",top:{xs:"160px",md:"130px"},left:{xs:"calc(25% - 45px)",sm:"calc(25% - 45px)",md:"calc(25% - 90px)"},width:{xs:"80px",sm:"80px",md:"180px"},border:"5px solid rgb(179, 198, 255)",height:{xs:"80px",sm:"80px",md:"180px"},borderRadius:"50%"},style:{objectFit:"cover",width:"100%",height:"100%",borderRadius:"50%"},layout:6},options:{widget:"Image"}},{type:"Control",scope:"#/properties/leaderBoard/properties/thirdImage",config:{main:{url:"https://my.alfred.edu/zoom/_images/foster-lake.jpg"},containerStyle:{objectFit:"cover",position:"absolute",top:{xs:"160px",md:"130px"},left:{xs:"calc(75% - 42.5px)",sm:"calc(75% - 42.5px)",md:"calc(75% - 85px)"},width:{xs:"80px",sm:"80px",md:"180px"},border:"5px solid rgb(179, 198, 255)",height:{xs:"80px",sm:"80px",md:"180px"},borderRadius:"50%"},style:{objectFit:"cover",width:"100%",height:"100%",borderRadius:"50%"},layout:6},options:{widget:"Image"}},{type:"Control",scope:"#/properties/leaderBoard/properties/firstName",config:{main:{heading:"Satendra Raghav"},style:{objectFit:"cover",position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",color:"black",top:{xs:"190px",md:"270px"},fontSize:{xs:"12px",md:"20px"},left:"calc(50% - 90px)",width:"180px",fontWeight:"bold",borderRadius:"50%",zIndex:7},layout:6},options:{widget:"Box"}},{type:"Control",scope:"#/properties/leaderBoard/properties/secondName",config:{main:{heading:"Satendra Raghav"},style:{objectFit:"cover",position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",color:"black",top:{xs:"240px",md:"320px"},fontSize:{xs:"12px",md:"20px"},left:"calc(25% - 90px)",width:"180px",fontWeight:"bold",borderRadius:"50%"},layout:6},options:{widget:"Box"}},{type:"Control",scope:"#/properties/leaderBoard/properties/thirdName",config:{main:{heading:"Satendra Raghav"},style:{objectFit:"cover",position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",color:"black",top:{xs:"240px",md:"320px"},fontSize:{xs:"12px",md:"20px"},left:"calc(75% - 90px)",width:"180px",fontWeight:"bold",borderRadius:"50%"},layout:6},options:{widget:"Box"}},{type:"Control",scope:"#/properties/econd",config:{main:{heading:"2"},style:{objectFit:"cover",position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",textShadow:"2px 2px 5px #5065C7",background:"green",color:"white",top:{xs:"225px",md:"280px"},fontSize:{xs:"12px",md:"16px"},left:{xs:"calc(25% - 12px)",md:"calc(25% - 16px)"},width:{xs:"20px",md:"40px"},border:{xs:"2px solid rgb(179, 198, 255)",md:"5px solid rgb(179, 198, 255)"},height:{xs:"20px",md:"40px"},"@keyframes rotateAnimation":{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}},animation:"rotateAnimation 4s infinite",borderRadius:"50%",zIndex:5},layout:6},options:{widget:"Box"}},{type:"Control",scope:"#/properties/first",config:{main:{heading:"1"},style:{objectFit:"cover",position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",textShadow:"2px 2px 5px #5065C7",background:"green",color:"white",top:{xs:"175px",md:"230px"},fontSize:{xs:"12px",md:"16px"},left:{xs:"calc(50% - 12px)",md:"calc(50% - 16px)"},"@keyframes rotateAnimation":{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}},animation:"rotateAnimation 4s infinite",width:{xs:"20px",md:"40px"},border:{xs:"2px solid rgb(179, 198, 255)",md:"5px solid rgb(179, 198, 255)"},height:{xs:"20px",md:"40px"},borderRadius:"50%",zIndex:5},layout:6},options:{widget:"Box"}},{type:"Control",scope:"#/properties/third",config:{main:{heading:"3"},style:{objectFit:"cover",position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",textShadow:"2px 2px 5px #5065C7",background:"green",color:"white",top:{xs:"225px",md:"280px"},fontSize:{xs:"12px",md:"16px"},left:{xs:"calc(75% - 12px)",md:"calc(75% - 16px)"},width:{xs:"20px",md:"40px"},border:{xs:"2px solid rgb(179, 198, 255)",md:"5px solid rgb(179, 198, 255)"},height:{xs:"20px",md:"40px"},"@keyframes rotateAnimation":{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}},animation:"rotateAnimation 4s infinite",borderRadius:"50%",zIndex:5},layout:6},options:{widget:"Box"}},{type:"Control",scope:"#/properties/leaderBoard/properties/table",options:{widget:"Table"},elements:[],config:{style:{tableHeadstyle:{fontWeight:900,background:"rgb(179, 198, 255)"},position:"absolute",top:{xs:"300px",sm:"300px",md:"390px",lg:"390px"},border:"2px solid rgb(179, 198, 255)",width:"95%",left:"2.5%"},main:{disableAction:!0,disableSelection:!0}}}]};const buildLeaderBoard=o=>{const u=_.cloneDeep(leaderBoard);if(o.elements){const r=o.elements.map((h,b)=>h.type?{...{widget:buildUiSchema(h),accessorKey:h.name,header:h.label||h.name}}:{accessorKey:h.name,header:h.label||h.name});u.elements[9].elements=r}return o.name&&(u.elements[0].scope=`#/properties/${o.name}/properties/firstImage`,u.elements[3].scope=`#/properties/${o.name}/properties/firstName`,u.elements[1].scope=`#/properties/${o.name}/properties/secondImage`,u.elements[4].scope=`#/properties/${o.name}/properties/secondName`,u.elements[2].scope=`#/properties/${o.name}/properties/thirdImage`,u.elements[5].scope=`#/properties/${o.name}/properties/thirdName`,u.elements[9].scope=`#/properties/${o.name}/properties/table`),o.firstImage&&(u.elements[0].config.main.url=o.firstImage),o.secondImage&&(u.elements[1].config.main.url=o.secondImage),o.secondImage&&(u.elements[2].config.main.url=o.thirdImage),o.layout&&(u.config.layout=o.layout),u};var progressBar={type:"Control",scope:"#/properties/pbc_progress",options:{widget:"ProgressBar"},config:{layout:6,main:{developOnlyProgresBar:!1,bottomLabel_3:"Remaining",heading:"PBC Details"}}};const buildProgressBarCard=(o,u)=>{const r=_.cloneDeep(progressBar);return r.scope=u,o.heading&&(r.config.main.heading=o.heading),o.bottomLabel_3&&(r.config.main.bottomLabel_3=o.bottomLabel_3),o.bottomLabel_2&&(r.config.main.bottomLabel_2=o.bottomLabel_2),o.bottomLabel_1&&(r.elements[0].config.main.bottomLabel_1=o.bottomLabel_1),o.layout&&(r.config.layout=createLayoutFormat(o.layout)),r},buildProgressBar=(o,u)=>{const r=_.cloneDeep(progressBar);return r.scope=u,o.layout&&(r.config.layout=o.layout),r.config.main.heading=o.heading,o.bottomLabel_3&&(r.config.main.bottomLabel_3=o.bottomLabel_3),o.layout&&(r.config.layout=createLayoutFormat(o.layout)),o.bottomLabel_2&&(r.config.main.bottomLabel_2=o.bottomLabel_2),o.bottomLabel_1&&(r.config.main.bottomLabel_1=o.bottomLabel_1),r},BarGraph={type:"Control",scope:"#/properties/graph",options:{widget:"Graph"},config:{main:{header:"Bar Graph",bottomLabel:"Name of Employe",numTicks:6,leftLabel:"Value in lakhs",axisLeft:!0,axisBottom:!0,hideTicks:!1,hideLeftAxisLine:!1,hideBottomAxisLine:!1,bottomAxisWidth:"10px",legend:{labelColor:"green",legendTitle:"",direction:"row",align:"none"}},style:{containerStyle:{width:"100%",height:300},headerStyle:{},tooltipStyle:{},labelStyle:{margin:{left:80,bottom:20},leftLabelOffset:50,bottomLabelOffset:10},barStyle:{color:{firstBarColor:"#6c5efb",secondBarColor:"#3f51b5"}},legendStyle:{legend:{lineHeight:"0.9em",fontSize:"8px",fontFamily:"arial",padding:"10px 10px",width:"30%",display:"flex",justifyContent:"center",border:"1px solid rgba(255, 255, 255, 0.3)",borderRadius:" 8px",marginRight:"auto"},legendTitle:{fontSize:"10px",marginBottom:"10px",fontWeight:"100"}}}}},PieGraph={type:"Control",scope:"#/properties/graph",options:{widget:"Graph"},config:{main:{header:"Incentive Branch category wise",type:"PieGraph",bottomLabel:"Name of Employe",leftLabel:"Value",axisLeft:!0,axisBottom:!0,legendAvailable:!0,legend:{labelColor:"green",legendTitle:"Branches",direction:"row",align:"right"}},style:{containerStyle:{height:"340"},headerStyle:{},tooltipStyle:{backgroundColor:"black",width:"80px"},labelStyle:{},legendStyle:{legend:{},legendTitle:{}},pieStyle:{}}}},LineGraph={type:"Control",scope:"#/properties/graph",options:{widget:"Graph"},config:{layout:12,main:{type:"LineGraph",header:"Quartely Incentive in Thousand",bottomLabel:"Years",leftLabel:"Incentive",gridHidden:!0,numHidden:!1,tooltipDataKey:["MAMA New Project","Second","Third"],axisLeft:!0,axisBottom:!0,hideLeftAxisLine:!1,hideBottomAxisLine:!1,legend:{labelColor:"green",legendTitle:"Our Assests",direction:"row",align:"right",colorRectWidth:20}},style:{containerStyle:{},headerStyle:{},labelStyle:{},lineStyle:{}}}},HorizontalBarGraph={type:"Control",scope:"#/properties/graph",options:{widget:"Graph"},config:{main:{header:" ",type:"HorizontalBarGraph",bottomLabel:" ",leftLabel:"Value",axisLeft:!1,axisBottom:!0,hideBottomTicks:!1,hideLeftTicks:!1,hideLeftAxisLine:!0,hideBottomAxisLine:!1,bottomAxisWidth:"10px"},style:{containerStyle:{width:"100%"},headerStyle:{},tooltipStyle:{},labelStyle:{},barStyle:{color:"#6c5efb"}}}},buildHorizontalBarGraph=(o,u)=>{const r=_.cloneDeep(HorizontalBarGraph);return r.scope=u,o.layout&&(r.config.layout=createLayoutFormat(o.layout)),r.scope=u,r.config.main.header=o.heading,o.barColor&&(r.config.barStyle.color=o.barColor),o.containerBackground&&(r.config.containerStyle.background=o.containerBackground),o.height&&(r.config.style.containerStyle.height=o.height),o.bottomLabel&&(r.config.main.bottomLabel=o.bottomLabel),o.leftLabel&&(r.config.main.leftLabel=o.leftLabel),r};var SpeedoMeter={type:"Control",scope:"#/properties/emptyBox",options:{widget:"SpeedoMeter"},config:{layout:{xs:12,sm:12,md:11.7,lg:11.7},width:350,segments:"5",main:{currentValueText:"Your Score",customSegmentLabels:[],data:{maxValue:1e5,value:5e4,minValue:0}},style:{segmentColors:[],ringWidth:57,needleHeightRatio:.7,needleColor:"#3f51b5",startColor:"red",textColor:"black",endColor:"green",containerStyle:{background:"white",padding:"20px",borderRadius:"20px",display:"flex",flexDirection:"column",margin:"auto",justifyContent:"center",fontFamily:"Roboto",fontWeight:500},headerStyle:{textAlign:"left",width:"100%",paddingBottom:"20px"}}}};const buildSpeedoMeter=(o,u)=>{const r=_.cloneDeep(SpeedoMeter);if(r.scope=u,o.layout&&(r.config.layout=createLayoutFormat(o.layout)),o.heading&&(r.config.main.header=o.heading),o.segments&&(r.config.main.segments=o.segments),o.style){const h=JSON.parse(o.style);h!=null&&h.style&&(r.config.style={...r.config.style,...h.style}),h!=null&&h.containerStyle&&(r.config.style.containerStyle={...r.config.style.containerStyle,...h.containerStyle})}return o.width&&(r.config.main.width=o.width),o.speedoCaption&&(r.config.main.currentValueText=o.speedoCaption),o.data&&(r.config.main.data=o.data),o.needleColor&&(r.config.style.needleColor=o.needleColor),o.segments&&(r.config.style.segments=o.segments),o.endColor&&(r.config.style.endColor=o.endColor),o.startColor&&(r.config.style.startColor=o.startColor),o.segmentColors&&(r.config.style.segmentColors=o.segmentColors),r},buildPieGraph=(o,u)=>{const r=_.cloneDeep(PieGraph);return o.layout&&(r.config.layout=createLayoutFormat(o.layout)),o.height&&(r.config.style.containerStyle.height=o.height),o.legendHide&&(r.config.main.legendAvailabe=o.legendHide!=="YES"),r.scope=u,r.config.main.header=o.heading,o.legendLabels&&(r.config.main.tooltipDataKey=flatObjectValueInArray(o.legendLabels)),o.pieArcColors&&(r.config.style.pieStyle.colorRange=flatObjectValueInArray(o.pieArcColors)),r},buildStackbarGraph=(o,u)=>{const r=_.cloneDeep(BarGraph);return o.layout&&(r.config.layout=createLayoutFormat(o.layout)),o.legendHide&&(r.config.main.legendAvailable=!1),r.config.main.type=o.graphType,r.config.main.header=o.heading,o.barColor&&(r.config.barStyle.color=o.barColor),o.containerBackground&&(r.config.containerStyle.background=o.containerBackground),o.height&&(r.config.style.containerStyle.height=o.height),o.bottomLabel&&(r.config.main.bottomLabel=o.bottomLabel),o.leftLabel&&(r.config.main.leftLabel=o.leftLabel),r.scope=u,r};var RunnerBoyProgressBar={type:"Control",scope:"#/properties/path",options:{widget:"RunnerBoyProgressBar"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{}}};const RunnerBoyProgressbar=(o,u)=>{const r=_.cloneDeep(RunnerBoyProgressBar);return r.scope=u,o.layout&&(r.config.layout=createLayoutFormat(o.layout)),r};var Tabsection={type:"TabLayout",config:{main:{id:"groupMaster",tabLabels:["default"],layout:12}},elements:[]};const buildTabSection=(o,u)=>{const r=_.cloneDeep(Tabsection);return o.sectionLabels&&(r.config.main.tabLabels=o.sectionLabels.map(h=>h.label)),r.config.main.id=o.name,r};var WrapperSection={type:"WrapperLayout",config:{main:{label:"Default Label",divider:!0},defaultStyle:!0},elements:[]};const buildWrapperSection=(o,u)=>{const r=_.cloneDeep(WrapperSection);return r.config.main.label=o.label,r.config.main.divider=!!o.divider,r.config.main.header=!!o.heading,r};var TextInputField={type:"Control",scope:"#/properties/text",options:{widget:"InputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:""},style:{}}};const buildTextField=(o,u)=>{const r=_.cloneDeep(TextInputField);return r.config.main.label=o.label,o.style&&(r.config.style=JSON.parse(o.style)),o.layout&&(r.config.layout=createLayoutFormat(o.layout)),r.config.main.errorMessage=`${o.name} is empty or invalid`,r.scope=u,r};var SelectInputField={type:"Control",scope:"#/properties/select",options:{widget:"SelectInputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"",type:"text"}}};const buildSelect=(o,u)=>{const r=_.cloneDeep(SelectInputField);if(r.config.main.label=o.label,o.value){const h=o.value.map(b=>({title:b.label,const:b.value}));r.config.main.options=h}return o.layout&&(r.config.layout=createLayoutFormat(o.layout)),r.scope=u,r};var Button={type:"Control",scope:"#/properties/button",options:{widget:"Button"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{name:"Compare",variant:"contained",color:"info",type:"text",startIcon:"",styleDefault:!1,icon:"",onClick:"onClick",size:"small"},style:{}}};const buildButton=(o,u)=>{const r=_.cloneDeep(Button);return o.buttonType&&(r.options.widget=o.buttonType==="IconButton"?"IconButton":"Button",o.buttonType==="ButtonWithIconAndText"?r.config.main.startIcon=o.iconName:r.config.main.icon=o.iconName),o.layout&&(r.config.layout=createLayoutFormat(o.layout)),o.defaultStyle&&(r.config.main.styleDefault=o.defaultStyle==="true"),r.scope=u,o.style&&(r.config.style=JSON.parse(o.style)),o.size&&(r.config.main.size=o.size),o.color&&(r.config.main.color=o.color),o.label&&(r.config.main.name=o.label),r};var Table={type:"Control",scope:"#/properties/ApproveRecords",options:{widget:"Table"},elements:[],config:{main:{allRowData:[],columns:{dataColumns:[],actionColumns:[]}}}};const buildTable=(o,u)=>{const r=_.cloneDeep(Table);return r.scope=u,o.style&&(r.config.style=JSON.parse(o.style)),r.config.main.label=o.label,r};var Box={type:"Control",scope:"#/properties/emptyBox",options:{widget:"Box"},config:{layout:12,main:{},style:{}}};const buildLabel=(o,u)=>{const r=_.cloneDeep(Box);return r.scope=u,r.config.main.heading=o.label,o.layout&&(r.config.layout=createLayoutFormat(o.layout)),o.style&&(r.config.style=JSON.parse(o.style)),r},uploadFile={type:"Control",scope:"#/properties/attachment",config:{main:{label:"AttachmentFile",onClick:"onClick",required:!0,errorMessage:"Attachment File is not uploaded"},style:{backgroundColor:"none"},layout:{lg:5.5,md:5.5,sm:11,xs:11}},options:{widget:"UploadFile"}},downloadFile$1={type:"Control",scope:"#/properties/downloadAttachment",config:{main:{onClick:"onClick",required:!1},style:{backgroundColor:"none"},layout:{lg:5.5,md:5.5,sm:11,xs:11}},options:{widget:"DownloadFile"}},buildUploadFile=(o,u)=>{const r=_.cloneDeep(uploadFile);return r.scope=u,r.config.main.label=o.label,o.layout&&(r.config.layout=o.layout),o.layout&&(uploadFile.config.layout=createLayoutFormat(o.layout)),o.style&&(r.config.style=o.style),o.required&&(r.config.main.required=!0),r.config.main.errorMessage=o.errorMessage,r},buildDownloadFile=(o,u)=>{const r=_.cloneDeep(downloadFile$1);return r.scope=u,o.layout&&(r.config.layout=o.layout),o.style&&(r.config.style=o.style),o.required&&(r.config.main.required=!0),o.layout&&(r.config.layout=createLayoutFormat(o.layout)),o.errorMessage&&(r.config.main.errorMessage=o.errorMessage),r};var Card={type:"WrapperLayout",config:{main:{rowSpacing:.5},style:{wrapperStyle:{position:"relative",color:"white",height:{xs:"120px",md:"160px"},width:"100%",textAlign:"left",background:"#3f51b5",borderRadius:"20px"}},layout:{xs:12,sm:12,md:6,lg:6}},elements:[{type:"Control",scope:"#/properties/programType",config:{main:{heading:"$5000.00"},style:{position:"absolute",left:"10%",top:"15%",color:"#f5effc",height:"80px",display:"flex",fontSize:{xs:"24px",md:"32px"},alignItems:"center",background:"inherit",justifyContent:"flex-start"},layout:5},options:{widget:"Box"}},{type:"Control",scope:"#/properties/programType",config:{main:{url:"$"},style:{color:"#f5effc",objectFit:"contain",position:"absolute",top:"10px",right:"10px",height:"80%",width:"35%",display:"flex",fontSize:"34px",alignItems:"center",background:"inherit",padding:"20px",justifyContent:"left"},layout:5},options:{widget:"Image"}},{type:"Control",scope:"#/properties/programType",config:{main:{heading:"Total Earnings"},style:{position:"absolute",top:"calc(60%)",alignItems:"center",color:"#8999e8",fontSize:"16px",left:"10%",background:"inherit",justifyContent:"center"},layout:12},options:{widget:"Box"}}]};const buildCard=(o,u)=>{const r=_.cloneDeep(Card);return o.style&&(r.config.style=JSON.parse(o.style)),r.elements[0].scope=`#/properties/${o.name}/properties/value`,r.elements[1].scope=`#/properties/${o.name}/properties/url`,r.elements[2].scope=`#/properties/${o.name}/properties/description`,o.layout&&(r.config.layout=createLayoutFormat(o.layout)),r};var DateInputField={type:"Control",scope:"#/properties/date",options:{widget:"DateInputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"",type:"date"}}};const buildDate=(o,u)=>{const r=_.cloneDeep(DateInputField);return r.config.main.label=o.label,r.config.main.errorMessage=`${o.name} is empty or invalid`,r.scope=u,o.layout&&(r.config.layout=createLayoutFormat(o.layout)),r};var RankCard={type:"Control",scope:"#/properties/path",options:{widget:"RankCard"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{}}};const buildRankCard=(o,u)=>{const r=_.cloneDeep(RankCard);return r.scope=u,o.image&&(r.config.main.url=o.image),o.title&&(r.config.main.title=o.title),o.description&&(r.config.main.description=o.description),o.rank&&(r.config.main.rank=`#${o.rank}`),o.layout&&(r.config.layout=createLayoutFormat(o.layout)),r};var RollAndDice={type:"Control",scope:"#/properties/path",options:{widget:"RollAndDice"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{}}};const buildRollAndDice=(o,u)=>{const r=_.cloneDeep(RollAndDice);return o.name&&(r.scope=u),o.layout&&(r.config.layout=createLayoutFormat(o.layout)),r};var Timer={type:"Control",scope:"#/properties/timer",options:{widget:"Timer"},config:{layout:{xs:12,sm:12,md:12,lg:12},main:{},style:{digitContainer:{borderRadius:"4px",textShawdow:"none",width:"22%"},container:{backgroundColor:"#FFFFFF",borderRadius:"18px"},containerLabelColor:{color:"red"}}}};const buildTimer=(o,u)=>{const r=_.cloneDeep(Timer);return r.scope=u,o.label&&(r.config.main.label=o.label),o.layout&&(r.config.layout=createLayoutFormat(o.layout)),r};var MultipleSelect={type:"Control",scope:"#/properties/path",options:{widget:"MultipleSelect"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"",type:"text",multiple:!0,variant:"standard",options:[]}}};const buildMultiSelect=(o,u)=>{const r=_.cloneDeep(MultipleSelect);if(r.scope=u,o.label&&(r.config.main.label=o.label),o.layout&&(r.config.layout=createLayoutFormat(o.layout)),o.value){const h=o.value.map(b=>({title:b.label,const:b.value}));r.config.main.options=h!=null?h:[]}return r},buildBasicUiSchema=o=>({type:"HorizontalLayout",pageName:`${o.name}`,elements:[]}),TextArea={type:"Control",scope:"#/properties/textarea",options:{widget:"TextArea"},config:{layout:{xs:12,sm:12,md:5.5,lg:5.5},style:{containerStyle:{borderRadius:"20px"},headerContainerStyle:{},textAreaStyle:{borderRadius:"20px",padding:"20px",background:"white",color:"black"}},main:{heading:"TextArea",minRows:4,hideButton:!0}}},buildTextArea=(o,u)=>{const r=_.cloneDeep(TextArea);return r.config.main.heading=o.label,o.layout&&(r.config.layout=createLayoutFormat(o.layout)),o.style&&(r.config.style=JSON.parse(o.style)),r.scope=u,r};var cardSlider={type:"Control",scope:"#/properties/path",options:{widget:"Slider"},elements:[],config:{layout:12,main:{}}};const buildSlider=(o,u)=>{const r=_.cloneDeep(cardSlider);return o.name&&(r.scope=u),o.layout&&(r.config.layout=createLayoutFormat(o.layout)),r},Checkbox={type:"Control",scope:"#/properties/username1",layout:12,options:{widget:"CheckBox"},config:{main:{label:"Welcome to Hyperform"}}},buildCheckbox=(o,u)=>{const r=_.cloneDeep(Checkbox);return r.scope=u,r.config.main.label=o.label,o.layout&&(r.config.layout=createLayoutFormat(o.layout)),o.style&&(r.config.style=JSON.parse(o.style)),r},buildLineGraph=(o,u)=>{const r=_.cloneDeep(LineGraph);return o.layout&&(r.config.layout=createLayoutFormat(o.layout)),r.config.main.header=o.heading,o.height&&(r.config.style.containerStyle.height=o.height),o.bottomLabel&&(r.config.main.bottomLabel=o.bottomLabel),o.leftLabel&&(r.config.main.leftLabel=o.leftLabel),o.legendHide&&(r.config.main.legendAvailabe=o.legendHide!=="YES"),o.legendLabels&&(r.config.main.tooltipDataKey=flatObjectValueInArray(o.legendLabels)),o.pieArcColors&&(r.config.style.lineStyle.colorRange=flatObjectValueInArray(o.pieArcColors)),r.scope=u,r},RadioUiSchema={type:"Control",scope:"#/properties/invoiceEnabled",options:{widget:"RadioInputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"Enabled",options:["YES","NO"],errorMessage:"Enabled is not marked as YES or NO"}}},buildRadio=(o,u)=>{const r=_.cloneDeep(RadioUiSchema);return r.scope=u,r.config.main.heading=o.label,o.layout&&(r.config.layout=createLayoutFormat(o.layout)),o.sectionLabels&&(r.config.main.options=o.sectionLabels.map(h=>h.label||h.Options)),o.style&&(r.config.style=JSON.parse(o.style)),r};var emptyBox={type:"Control",scope:"#/properties/emptyBox",options:{widget:"EmptyBox"},config:{layout:{xs:12,sm:12,md:5.5,lg:5.5},main:{},style:{}}};const buildEmptyBox=(o,u)=>{const r=_.cloneDeep(emptyBox);return o.layout&&(r.config.layout=createLayoutFormat(o.layout)),r};exports.schema={type:"object",properties:{},required:[]};function buildRule(o){o.validation&&o.validation.forEach(u=>{exports.schema.properties[o.name]||(exports.schema.properties[o.name]={}),u.validationType==="required"?exports.schema.required.push(o.name):(exports.schema.properties[o.name].type="string",exports.schema.properties[o.name][u.validationType]=isNaN(u.validationValue)?u.validationValue:Number(u.validationValue))})}const buildUiSchema=o=>{let u={};const r=`#/properties/${o.name}`;switch(o.type){case"RunnerBoyProgressBar":u=RunnerBoyProgressbar(o,r);break;case"TabSection":u=buildTabSection(o);break;case"WrapperSection":u=buildWrapperSection(o);break;case"Text":u=buildTextField(o,r),buildRule(o);break;case"TextArea":u=buildTextArea(o,r),buildRule(o);break;case"Date":u=buildDate(o,r),buildRule(o);break;case"Select":u=buildSelect(o,r),buildRule(o);break;case"Radio":u=buildRadio(o,r),buildRule(o);break;case"Button":u=buildButton(o,r),buildRule(o);break;case"Table":u=buildTable(o,r),buildRule(o);break;case"Box":u=buildLabel(o,r),buildRule(o);break;case"CheckBox":u=buildCheckbox(o,r),buildRule(o);break;case"UploadFile":u=buildUploadFile(o,r),buildRule(o);break;case"DownloadFile":u=buildDownloadFile(o,r),buildRule(o);break;case"EmptyBox":u=buildEmptyBox(o);break;case"card":u=buildCard(o);break;case"Graph":switch(o.graphType){case"BarGraph":case"StackBarGraph":u=buildStackbarGraph(o,r);break;case"LineGraph":u=buildLineGraph(o,r);break;case"PieGraph":u=buildPieGraph(o,r);break;case"HorizontalBarGraph":u=buildHorizontalBarGraph(o,r);break}break;case"ProgressBar":u=buildProgressBar(o,r);break;case"SpeedoMeter":u=buildSpeedoMeter(o,r);break;case"ProgressBarCard":u=buildProgressBarCard(o,r);break;case"RankCard":u=buildRankCard(o,r);break;case"Rank":u=buildRollAndDice(o,r);break;case"Slider":u=buildSlider(o,r);break;case"Timer":u=buildTimer(o,r);break;case"MultipleSelect":u=buildMultiSelect(o,r),buildRule(o);break;case"LeaderBoard":u=buildLeaderBoard(o);break;default:exports.schema={type:"object",properties:{},required:[]},u=buildBasicUiSchema(o)}if(o!=null&&o.elements){if((o==null?void 0:o.type)==="LeaderBoard")return u;o.type=="Table"?u.elements=o.elements.map((h,b)=>h.type?{accessorKey:h.name,header:h.label||h.name,widget:buildUiSchema(h)}:{accessorKey:h.name,header:h.label||h.name}):u.elements=o.elements.map((h,b)=>buildUiSchema(h))}return localStorage.setItem("libSchema",JSON.stringify(exports.schema||{})),u};var pageMaster=o=>{const{store:u,dynamicData:r,config:h,submitHandler:b}=o;return{setPage:async function(){const w=await this.getFormdata();u.setFormdata(w);const S=await this.getUiSchema(),O=await this.getSchema();u.setSchema(O),u.setUiSchema(S)},getFormdata:async function(){var S;(S=u.searchParams)==null||S.get("id");const w=getFormdataFromLocalStorage();return w||(saveFormdataInLocalStorage(h),h)},getUiSchema:async function(){return PageMasterUiSchema},getSchema:()=>PageMasterSchema,backHandler:()=>{localStorage.removeItem("pageFormdata"),u.navigate("/PageMasterRecords")},onAddClickHandler:async function(){var O;const w=(O=u.searchParams)==null?void 0:O.get("id");Array.isArray(u.formData.elements)||(u.formData.elements=[]);const S=saveFormdataInLocalStorage(u.formData);u.navigate(`/Component?path=${`elements[${S==null?void 0:S.elements.length}]`}&id=${w}`)},submitPageHandler:async function(){console.log(exports.schema),b(u,o.service).then(w=>{localStorage.removeItem("pageFormdata"),u.navigate(-1),u.setNotify({SuccessMessage:"Submit Successfully",Success:!0})})},Edit_Components:Component(u,r).editComponents,Delete_Components:Component(u,r).deleteComponents,eventAddHandler:async function(){var O;const w=(O=u.searchParams)==null?void 0:O.get("id");Array.isArray(u.formData.events)||(u.formData.events=[]),saveFormdataInLocalStorage(u.formData);const S=`events[${u.formData.events.length}]`;u.navigate(`/ComponentEvents?path=${S}&id=${w}`)},editEvent:async function(){var G;const w=r.path.split(".")[1],S=(G=u.searchParams)==null?void 0:G.get("id");saveFormdataInLocalStorage(u.formData);const O=`events[${w}]`;u.navigate(`/ComponentEvents?path=${O}&id=${S}`)},deleteEvent:async function(){const w=r.path.split(".")[1];u.formData.events.splice(w,1);const S=saveFormdataInLocalStorage(u.formData);u.setFormdata(S)}}};const EventSchema={type:"object",properties:{headers:{type:"array",items:{type:"object",properties:{headers_key:{type:"string"},headers_value:{type:"string"}}}},refreshElements:{type:"array",items:{type:"object",properties:{value:{type:"string"}}}},body:{type:"array",items:{type:"object",properties:{body_key:{type:"string"},body_value:{type:"string"}}}}}},EventUiSchema={type:"HorizontalLayout",elements:[{type:"WrapperLayout",config:{main:{rowSpacing:1,header:!0},defaultStyle:!0},elements:[{type:"Control",scope:"#/properties/Component",options:{widget:"Box"},config:{layout:{xs:12,sm:12,md:2},main:{heading:"Component"},style:{float:"left"}}},{type:"Control",scope:"#/properties/pageName",options:{widget:"Box"},config:{layout:{xs:7,sm:7,md:9},main:{heading:" "},style:{float:"right",width:"auto",fontSize:"12px",color:"gray",paddingTop:"10px"}}},{type:"Control",scope:"#/properties/Back_Button",options:{widget:"IconButton"},config:{layout:{xs:2,sm:2,md:.5},main:{icon:"BackIcon",styleDefault:!0,size:"small",onClick:"backHandler",tooltipMessage:"Back"},style:{float:"right"}}}]},{type:"TabLayout",config:{main:{tabLabels:["Core","Response Event"],defaultStyle:!0,id:"event"}},elements:[{type:"HorizontalLayout",elements:[{type:"Control",scope:"#/properties/eventType",options:{widget:"SelectInputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"Event Type",type:"text",options:[{title:"Click Event",const:"onClick"},{title:"onStart",const:"onStart"},{title:"Load Event",const:"onLoad"},{title:"Change Event",const:"onChange"},{title:"Success",const:"Success"},{title:"Fail",const:"Fail"}]}}},getSelectField("Handler","Handler",[{title:"Custom",const:"custom"},{title:"Api",const:"api"},{title:"Inbuilt Function",const:"inBuiltFunction"},{title:"Refresh",const:"refresh"}])]},{type:"WrapperLayout",config:{main:{divider:!0},wrapperStyle:{border:"1px solid gray"}},elements:[{type:"Control",scope:"#/properties/heading",options:{widget:"Box"},config:{layout:8,main:{heading:"Response Event"},style:{fontFamily:"Roboto",fontWeight:"500",paddingLeft:"-10px",fontSize:"20px"}}},{type:"Control",scope:"#/properties/AddButton",options:{widget:"IconButton"},config:{layout:3,main:{icon:"AddIcon",styleDefault:!0,size:"small",onClick:"addEvent",tooltipMessage:"Back"},style:{float:"right"}}},{type:"Control",scope:"#/properties/events",options:{widget:"Table"},config:{main:{disableAction:!0,disableSelection:!0,enableDrag:!0}},elements:[{accessorKey:"eventType",header:"Event Type"},{accessorKey:"Handler",header:"Handler"},{accessorKey:"Edit_Approve_Records",header:"Edit Widget",widget:{type:"Control",scope:"#/properties/Edit_Records",options:{widget:"IconButton"},config:{main:{color:"info",size:"small",icon:"EditIcon",tooltipMessage:"Edit This Record",onClick:"editEvent"},style:{color:"#3949ab"}}}},{accessorKey:"Reject_Records",header:"Delete",widget:{type:"Control",scope:"#/properties/RejectButton",options:{widget:"IconButton"},config:{main:{icon:"RejectIcon",color:"error",tooltipMessage:"Reject This Record",onClick:"deleteEvent"}}}}]}]}]},{type:"Control",scope:"#/properties/proc",config:{layout:{xs:11,sm:11,md:8,lg:8}},options:{widget:"EmptyBox"}},{type:"Control",scope:"#/properties/btn",options:{widget:"Button"},config:{layout:{xs:11,sm:11,md:3,lg:3},main:{name:"Save",startIcon:"ApproveIcon",variant:"contained",color:"info",type:"text",onClick:"saveHandler",size:"small"},style:{marginBottom:"8px",float:"right"}}},{type:"Control",scope:"#/properties/notify",options:{widget:"Notify"},layout:6}]},APISection={type:"HorizontalLayout",elements:[{type:"Control",scope:"#/properties/method",options:{widget:"SelectInputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"Method",type:"text",options:[{title:"Get",const:"get"},{title:"Post",const:"post"},{title:"Delete",const:"delete"},{title:"Put",const:"put"}]}}},{type:"Control",scope:"#/properties/path",options:{widget:"InputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"Path",type:"text",multiple:!1,options:[]}}},{type:"Control",scope:"#/properties/headers",layout:11.5,options:{elementLabelProp:"key",detail:{type:"HorizontalLayout",elements:[{type:"Control",scope:"#/properties/key",options:{widget:"InputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"Key"}}},{type:"Control",scope:"#/properties/value",options:{widget:"InputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"Value"}}}]}}},{type:"Control",scope:"#/properties/body",layout:11.5,options:{elementLabelProp:"key",detail:{type:"HorizontalLayout",elements:[{type:"Control",scope:"#/properties/key",options:{widget:"InputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"Key"}}},{type:"Control",scope:"#/properties/value",options:{widget:"InputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"Value"}}}]}}},getTextArea("apiBody","Transformer",!0,12)]},refreshSectionUiSchema={type:"HorizontalLayout",elements:[{type:"Control",scope:"#/properties/refreshElements",layout:11.5,options:{detail:{type:"HorizontalLayout",elements:[{type:"Control",scope:"#/properties/value",options:{widget:"InputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"Value"}}}]}}}]};var event=(o,u)=>({setPage:async function(){const r=await this.getFormData();o.setFormdata(r);const h=await this.getSchema();o.setSchema(h),this.refreshPage(r.Handler,o)},refreshPage:(r,h)=>{const b=_.cloneDeep(EventUiSchema);r&&(r==="custom"?b.elements[1].elements[0].elements[2]=getTextArea("eventCode","Write Custom Code",!1):r==="api"?b.elements[1].elements[0].elements[2]=APISection:r==="inBuiltFunction"?(b.elements[1].elements[0].elements[2]=getSelectField("inBuiltFunctionType","Function Name",[{title:"RankProvider",const:"RankProvider"},{title:"Download File",const:"downloadFile"}]),b.elements[1].elements[0].elements[3]=getTextArea("funcParametersCode","Write Custom Code for Functions Parameter",!0,{xs:12,sm:12,md:6})):r==="refresh"&&(b.elements[1].elements[0].elements[2]=refreshSectionUiSchema)),h.setUiSchema(b)},getFormData:Component(o,u).getFormdata,getUiSchema:async function(){return EventUiSchema},getSchema:async()=>EventSchema,onChange:function(){var r,h,b;((r=o==null?void 0:o.formData)==null?void 0:r.Handler)!==((h=o==null?void 0:o.newData)==null?void 0:h.Handler)&&((b=o==null?void 0:o.newData)==null?void 0:b.Handler)!==void 0&&this.refreshPage(o.newData.Handler||o.formdata.Handler,o)},saveHandler:Component(o,u).saveHandler,addEvent:async function(){var b,w,S;const r=(b=o.searchParams)==null?void 0:b.get("path");Array.isArray(o.formData.events)||(o.formData.events=[]),saveFormdataInLocalStorage(o.formData,r);const h=`${r}.events[${(S=(w=o.formData)==null?void 0:w.events)==null?void 0:S.length}]`;o.searchParams.set("path",h),o.setSearchParams(o.searchParams),this.setPage()},editEvent:async function(){var w;const r=u.path.split(".")[1],h=(w=o.searchParams)==null?void 0:w.get("path");saveFormdataInLocalStorage(o.formData,h);const b=`${h}.events[${r}]`;o.searchParams.set("path",b),o.setSearchParams(o.searchParams),this.setPage()},deleteEvent:Component(o,u).deleteEvent,backHandler:function(){o.navigate(-1)}});const downloadFile=o=>{const u=o.name.split("."),r=o.data,h=window.atob(r);let b;b=new File([h],u[u.length-1]);const w=URL.createObjectURL(b),S=document.createElement("a");S.href=u[u.length-1]==="pdf"?"data:application/octet-stream;base64,"+r:w,S.download=`${o.name}`,document.body.appendChild(S),S.click(),URL.revokeObjectURL(w),document.body.removeChild(S)},executeEvents=async(o,u,r,h,b,w,S,O,G)=>{let j=[],V=null;if(o.eventType==="onLoad"){const{response:Y,events:he}=await executetOnLoadEvent(o,u,r,h,b,w,S,O,G);V=Y,j=he}else{if(!shouldEventExecute(o,u,r,h,b,w,S,O))return{response:void 0,events:void 0};const{response:Y,events:he}=await executeEventsHandler(o,u,r,h,b,w,S,O,G);V=Y,j=he}if((j==null?void 0:j.length)>0)for(const Y of j)await executeEvents(Y,u,r,h,b,w,S,O,V)},executetOnLoadEvent=async(o,u,r,h,b,w,S,O,G)=>{try{if(!shouldEventExecute(o,u,r,h,b,w,S,O))return{response:void 0,events:void 0};const{response:j}=await executeEventsHandler(o,u,r,h,b,w,S,O,G),V=o==null?void 0:o.events.filter(he=>he.eventType==="Success"),Y=V.length>0?V:[{Handler:"mergeFormdata",eventType:"Success",type:o.type}];return{response:j,events:Y}}catch{const V=o==null?void 0:o.events.filter(he=>he.eventType==="Fail"),Y=V.length>0?V:[];return{response:void 0,events:Y}}};async function executeEventsHandler(o,u,r,h,b,w,S,O,G){if(o.Handler==="api")return await executeApiEventHandler(o,u,r,h,b,w);if(o.Handler==="inBuiltFunction")return await executeInBuiltFunctionHandler(o,u,r,h,b,w,S,G);if(o.Handler==="custom")return await executeCustomHandler(o,u,r,h,b,w,S,G);if(o.Handler==="refresh")return await executeRefreshHandler(o,u,r,h,b,w,S,G,O);if(o.Handler==="mergeFormdata")return await mergeFormdata(G,u,o,r)}async function executeRefreshHandler(o,u,r,h,b,w,S,O,G){const j=getRefreshElements(o,G);for(const V of j)for(const Y of G.onLoad[V])await executeEvents(Y,V,r,h,b,w,S);return{response:void 0,events:void 0}}async function executeApiEventHandler(o,u,r,h,b,w,S,O){const G={...b==null?void 0:b.payload},j={"X-Requested-With":"XMLHttpRequest","Access-Control-Allow-Origin":"*"},{body:V,headers:Y}=await buildApiPayload(o,G,j,r,h,b);let he;return he=await w[o.method](o.path,V,Y&&{headers:Y}),{response:he,events:o==null?void 0:o.events}}async function executeInBuiltFunctionHandler(refreshHandlerConfig,componentName,store,dynamicData,userValue,service,serviceHolder,parentEventOutput){let parameter={};if(refreshHandlerConfig.funcParametersCode){const makeFunc=eval(refreshHandlerConfig.funcParametersCode);parameter=makeFunc(store,dynamicData,userValue,parentEventOutput,service)}return serviceHolder[refreshHandlerConfig.inBuiltFunctionType](parameter),{response:void 0,events:refreshHandlerConfig==null?void 0:refreshHandlerConfig.events}}async function executeCustomHandler(customHandlerConfig,componentName,store,dynamicData,userValue,service,serviceHolder,parentEventOutput){console.log(service);const makeFunc=eval(customHandlerConfig.eventCode),response=await makeFunc(store,dynamicData,userValue,parentEventOutput,service,componentName);return{response,events:customHandlerConfig==null?void 0:customHandlerConfig.events}}async function mergeFormdata(o,u,r,h){return r.type==="Select"&&!(_.isEmpty(o)&&o)?h.setSchema(b=>({...b,properties:{...b.properties,[u]:{oneOf:o.data}}})):r.type==="page"?h.setFormdata(b=>({...b,...o==null?void 0:o.data})):o&&h.setFormdata(b=>({...b,[u]:o.data})),{response:void 0,events:void 0}}const buildBodyFormat=(o,u,r)=>{const h={...r==null?void 0:r.payload};return o.map(b=>{var w,S;if((w=b==null?void 0:b.value)!=null&&w.startsWith("$userValue")){const O=b.value.substring(11);h[b.key]=_.get(r,O)}else if((S=b==null?void 0:b.value)!=null&&S.startsWith("$")){const O=b.value.substring(1);h[b.key]=_.get(u,O)}else h[b.key]=b.value}),h},buildHeadersFormat=o=>{const u={"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"};return o.map(r=>{u[r.key]=r.value}),u};async function shouldEventExecute(o,u,r,h,b,w,S,O){var j;const G=(j=o==null?void 0:o.events)==null?void 0:j.filter(V=>V.eventType==="onStart");if((G==null?void 0:G.length)>0){const{response:V}=await executeEventsHandler(G[0],u,r,h,b,w,S,O);return V}}async function buildApiPayload(compConfig,body,headers,store,dynamicData,userValue,service){var o,u;if(compConfig!=null&&compConfig.headers&&(headers=buildHeadersFormat(compConfig.headers)),compConfig.body&&(body={...buildBodyFormat(compConfig.body,store.newData||((u=(o=store==null?void 0:store.ctx)==null?void 0:o.core)==null?void 0:u.data)||store.formData,userValue)}),compConfig.apiBody){const makeFunc=eval(compConfig.apiBody),data=await makeFunc(store,dynamicData,userValue,body);body=data}return{body,headers}}function getRefreshElements(o,u){var h;let r=[];return((h=o==null?void 0:o.refreshElements)==null?void 0:h.length)>0?r=o.refreshElements.map(b=>b.value):u!=null&&u.onLoad&&(r=Object.keys(u==null?void 0:u.onLoad),r.push(r[0])),console.log(r),r}let compType,eventGroups={};const notifyUiSchema={type:"Control",scope:"#/properties/notify",options:{widget:"Notify"},layout:6},extractEvents=o=>{function u(r){r.events&&r.events.forEach(h=>{r.type&&(compType=r.type),eventGroups[h.eventType]||(eventGroups[h.eventType]={}),eventGroups[h.eventType][r.name]||(eventGroups[h.eventType][r.name]=[]),eventGroups[h.eventType][r.name].push({...h,type:compType})})}return u(o),o!=null&&o.elements&&o.elements.forEach(extractEvents),eventGroups};var service=o=>({setPage:async function(){o.store.setFormdata({}),eventGroups={},eventGroups=extractEvents(o.config),await executeEvents({Handler:"refresh",eventType:"onPageRefresh"},"all",o.store,o.dynamicData,o.userValue,o.service,this,eventGroups),o.store.setSchema(u=>({...o.schema,properties:{...o.schema.properties,...u.properties}})),o.uiSchema.elements.push(notifyUiSchema),o.store.setUiSchema(o.uiSchema)},onClick:async function(){var r;const u=((r=o.dynamicData)==null?void 0:r.tableButtonPath)||o.dynamicData.path.split(".")[0];for(const h of eventGroups==null?void 0:eventGroups.onClick[u])await executeEvents(h,u,o.store,o.dynamicData,o.userValue,o.service,this,eventGroups)},onChange:async function(){if(eventGroups.onChange){const u=Object.keys(eventGroups.onChange);Promise.all(u.map(async r=>{var h,b;if(((h=o.store)==null?void 0:h.formData[r])!==o.store.newData[r]&&((b=o.store)==null?void 0:b.newData[r])!==void 0)for(const w of eventGroups.onChange[r])await executeEvents(w,r,o.store,o.dynamicData,o.userValue,o.service,this,eventGroups)}))}},downloadFile});const schema={type:"object",properties:{},required:[]},buildSchema=o=>{function u(r){r.validation&&r.validation.forEach(h=>{schema.properties[r.name]||(schema.properties[r.name]={}),h.validationType==="required"?schema.required.push(r.name):(schema.properties[r.name].type="string",schema.properties[r.name][h.validationType]=isNaN(h.validationValue)?h.validationValue:Number(h.validationValue))})}return u(o),console.log(schema),window.localStorage.setItem("schemaDemo",JSON.stringify(schema)),schema};var clearLocalStorage=()=>{localStorage.removeItem("pageFormdata")};exports.buildConfig=buildConfig,exports.buildSchema=buildSchema,exports.buildUiSchema=buildUiSchema,exports.clearPreviousCache=clearLocalStorage,exports.pageMaster=pageMaster,exports.pageMasterComponents=Component,exports.pageMasterEvents=event,exports.pageService=service,Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
27
|
+
}`;var D=rl(function(){return k(s,I+"return "+x).apply(r,c)});if(D.source=x,gi(D))throw D;return D}function uh(e){return U(e).toLowerCase()}function ch(e){return U(e).toUpperCase()}function ph(e,t,n){if(e=U(e),e&&(n||t===r))return po(e);if(!e||!(t=ye(t)))return e;var i=Ee(e),a=Ee(t),s=fo(i,a),c=ho(i,a)+1;return lt(i,s,c).join("")}function fh(e,t,n){if(e=U(e),e&&(n||t===r))return e.slice(0,mo(e)+1);if(!e||!(t=ye(t)))return e;var i=Ee(e),a=ho(i,Ee(t))+1;return lt(i,0,a).join("")}function dh(e,t,n){if(e=U(e),e&&(n||t===r))return e.replace(gr,"");if(!e||!(t=ye(t)))return e;var i=Ee(e),a=fo(i,Ee(t));return lt(i,a).join("")}function hh(e,t){var n=al,i=ll;if(J(t)){var a="separator"in t?t.separator:a;n="length"in t?E(t.length):n,i="omission"in t?ye(t.omission):i}e=U(e);var s=e.length;if(At(e)){var c=Ee(e);s=c.length}if(n>=s)return e;var p=n-Rt(i);if(p<1)return i;var d=c?lt(c,0,p).join(""):e.slice(0,p);if(a===r)return d+i;if(c&&(p+=d.length-p),mi(a)){if(e.slice(p).search(a)){var y,v=d;for(a.global||(a=Er(a.source,U(Di.exec(a))+"g")),a.lastIndex=0;y=a.exec(v);)var x=y.index;d=d.slice(0,x===r?p:x)}}else if(e.indexOf(ye(a),p)!=p){var C=d.lastIndexOf(a);C>-1&&(d=d.slice(0,C))}return d+i}function gh(e){return e=U(e),e&&Ll.test(e)?e.replace(Fi,zs):e}var mh=Ht(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),bi=ia("toUpperCase");function nl(e,t,n){return e=U(e),t=n?r:t,t===r?Ws(e)?qs(e):Rs(e):e.match(t)||[]}var rl=P(function(e,t){try{return ge(e,r,t)}catch(n){return gi(n)?n:new F(n)}}),yh=Ye(function(e,t){return we(t,function(n){n=Ne(n),qe(e,n,di(e[n],e))}),e});function vh(e){var t=e==null?0:e.length,n=B();return e=t?q(e,function(i){if(typeof i[1]!="function")throw new Ce(S);return[n(i[0]),i[1]]}):[],P(function(i){for(var a=-1;++a<t;){var s=e[a];if(ge(s[0],this,i))return ge(s[1],this,i)}})}function bh(e){return zu(Ie(e,Y))}function xi(e){return function(){return e}}function xh(e,t){return e==null||e!==e?t:e}var _h=aa(),Sh=aa(!0);function de(e){return e}function _i(e){return Ho(typeof e=="function"?e:Ie(e,Y))}function wh(e){return Wo(Ie(e,Y))}function Ch(e,t){return ko(e,Ie(t,Y))}var Lh=P(function(e,t){return function(n){return nn(n,e,t)}}),Ih=P(function(e,t){return function(n){return nn(e,n,t)}});function Si(e,t,n){var i=ne(t),a=Wn(t,i);n==null&&!(J(t)&&(a.length||!i.length))&&(n=t,t=e,e=this,a=Wn(t,ne(t)));var s=!(J(n)&&"chain"in n)||!!n.chain,c=Ze(e);return we(a,function(p){var d=t[p];e[p]=d,c&&(e.prototype[p]=function(){var y=this.__chain__;if(s||y){var v=e(this.__wrapped__),x=v.__actions__=ce(this.__actions__);return x.push({func:d,args:arguments,thisArg:e}),v.__chain__=y,v}return d.apply(e,tt([this.value()],arguments))})}),e}function Bh(){return re._===this&&(re._=Qs),this}function wi(){}function Ah(e){return e=E(e),P(function(t){return Uo(t,e)})}var Rh=ei(q),Fh=ei(ao),Th=ei(Lr);function il(e){return li(e)?Ir(Ne(e)):ac(e)}function Eh(e){return function(t){return e==null?r:mt(e,t)}}var Dh=sa(),Ph=sa(!0);function Ci(){return[]}function Li(){return!1}function Mh(){return{}}function Hh(){return""}function Oh(){return!0}function Wh(e,t){if(e=E(e),e<1||e>je)return[];var n=We,i=oe(e,We);t=B(t),e-=We;for(var a=Rr(i,t);++n<e;)t(n);return a}function kh(e){return T(e)?q(e,Ne):ve(e)?[e]:ce(Ca(U(e)))}function Uh(e){var t=++Zs;return U(e)+t}var Nh=$n(function(e,t){return e+t},0),Gh=ti("ceil"),zh=$n(function(e,t){return e/t},1),$h=ti("floor");function Kh(e){return e&&e.length?On(e,de,Ur):r}function qh(e,t){return e&&e.length?On(e,B(t,2),Ur):r}function Vh(e){return uo(e,de)}function Yh(e,t){return uo(e,B(t,2))}function Jh(e){return e&&e.length?On(e,de,$r):r}function Zh(e,t){return e&&e.length?On(e,B(t,2),$r):r}var Xh=$n(function(e,t){return e*t},1),Qh=ti("round"),jh=$n(function(e,t){return e-t},0);function eg(e){return e&&e.length?Ar(e,de):0}function tg(e,t){return e&&e.length?Ar(e,B(t,2)):0}return l.after=wf,l.ary=Ma,l.assign=cd,l.assignIn=Ja,l.assignInWith=rr,l.assignWith=pd,l.at=fd,l.before=Ha,l.bind=di,l.bindAll=yh,l.bindKey=Oa,l.castArray=Mf,l.chain=Ea,l.chunk=zc,l.compact=$c,l.concat=Kc,l.cond=vh,l.conforms=bh,l.constant=xi,l.countBy=jp,l.create=dd,l.curry=Wa,l.curryRight=ka,l.debounce=Ua,l.defaults=hd,l.defaultsDeep=gd,l.defer=Cf,l.delay=Lf,l.difference=qc,l.differenceBy=Vc,l.differenceWith=Yc,l.drop=Jc,l.dropRight=Zc,l.dropRightWhile=Xc,l.dropWhile=Qc,l.fill=jc,l.filter=tf,l.flatMap=of,l.flatMapDeep=af,l.flatMapDepth=lf,l.flatten=Aa,l.flattenDeep=ep,l.flattenDepth=tp,l.flip=If,l.flow=_h,l.flowRight=Sh,l.fromPairs=np,l.functions=Sd,l.functionsIn=wd,l.groupBy=sf,l.initial=ip,l.intersection=op,l.intersectionBy=ap,l.intersectionWith=lp,l.invert=Ld,l.invertBy=Id,l.invokeMap=cf,l.iteratee=_i,l.keyBy=pf,l.keys=ne,l.keysIn=fe,l.map=Xn,l.mapKeys=Ad,l.mapValues=Rd,l.matches=wh,l.matchesProperty=Ch,l.memoize=jn,l.merge=Fd,l.mergeWith=Za,l.method=Lh,l.methodOf=Ih,l.mixin=Si,l.negate=er,l.nthArg=Ah,l.omit=Td,l.omitBy=Ed,l.once=Bf,l.orderBy=ff,l.over=Rh,l.overArgs=Af,l.overEvery=Fh,l.overSome=Th,l.partial=hi,l.partialRight=Na,l.partition=df,l.pick=Dd,l.pickBy=Xa,l.property=il,l.propertyOf=Eh,l.pull=pp,l.pullAll=Fa,l.pullAllBy=fp,l.pullAllWith=dp,l.pullAt=hp,l.range=Dh,l.rangeRight=Ph,l.rearg=Rf,l.reject=mf,l.remove=gp,l.rest=Ff,l.reverse=pi,l.sampleSize=vf,l.set=Md,l.setWith=Hd,l.shuffle=bf,l.slice=mp,l.sortBy=Sf,l.sortedUniq=wp,l.sortedUniqBy=Cp,l.split=oh,l.spread=Tf,l.tail=Lp,l.take=Ip,l.takeRight=Bp,l.takeRightWhile=Ap,l.takeWhile=Rp,l.tap=$p,l.throttle=Ef,l.thru=Zn,l.toArray=qa,l.toPairs=Qa,l.toPairsIn=ja,l.toPath=kh,l.toPlainObject=Ya,l.transform=Od,l.unary=Df,l.union=Fp,l.unionBy=Tp,l.unionWith=Ep,l.uniq=Dp,l.uniqBy=Pp,l.uniqWith=Mp,l.unset=Wd,l.unzip=fi,l.unzipWith=Ta,l.update=kd,l.updateWith=Ud,l.values=kt,l.valuesIn=Nd,l.without=Hp,l.words=nl,l.wrap=Pf,l.xor=Op,l.xorBy=Wp,l.xorWith=kp,l.zip=Up,l.zipObject=Np,l.zipObjectDeep=Gp,l.zipWith=zp,l.entries=Qa,l.entriesIn=ja,l.extend=Ja,l.extendWith=rr,Si(l,l),l.add=Nh,l.attempt=rl,l.camelCase=Kd,l.capitalize=el,l.ceil=Gh,l.clamp=Gd,l.clone=Hf,l.cloneDeep=Wf,l.cloneDeepWith=kf,l.cloneWith=Of,l.conformsTo=Uf,l.deburr=tl,l.defaultTo=xh,l.divide=zh,l.endsWith=qd,l.eq=Pe,l.escape=Vd,l.escapeRegExp=Yd,l.every=ef,l.find=nf,l.findIndex=Ia,l.findKey=md,l.findLast=rf,l.findLastIndex=Ba,l.findLastKey=yd,l.floor=$h,l.forEach=Da,l.forEachRight=Pa,l.forIn=vd,l.forInRight=bd,l.forOwn=xd,l.forOwnRight=_d,l.get=yi,l.gt=Nf,l.gte=Gf,l.has=Cd,l.hasIn=vi,l.head=Ra,l.identity=de,l.includes=uf,l.indexOf=rp,l.inRange=zd,l.invoke=Bd,l.isArguments=bt,l.isArray=T,l.isArrayBuffer=zf,l.isArrayLike=pe,l.isArrayLikeObject=X,l.isBoolean=$f,l.isBuffer=st,l.isDate=Kf,l.isElement=qf,l.isEmpty=Vf,l.isEqual=Yf,l.isEqualWith=Jf,l.isError=gi,l.isFinite=Zf,l.isFunction=Ze,l.isInteger=Ga,l.isLength=tr,l.isMap=za,l.isMatch=Xf,l.isMatchWith=Qf,l.isNaN=jf,l.isNative=ed,l.isNil=nd,l.isNull=td,l.isNumber=$a,l.isObject=J,l.isObjectLike=Z,l.isPlainObject=un,l.isRegExp=mi,l.isSafeInteger=rd,l.isSet=Ka,l.isString=nr,l.isSymbol=ve,l.isTypedArray=Wt,l.isUndefined=id,l.isWeakMap=od,l.isWeakSet=ad,l.join=sp,l.kebabCase=Jd,l.last=Ae,l.lastIndexOf=up,l.lowerCase=Zd,l.lowerFirst=Xd,l.lt=ld,l.lte=sd,l.max=Kh,l.maxBy=qh,l.mean=Vh,l.meanBy=Yh,l.min=Jh,l.minBy=Zh,l.stubArray=Ci,l.stubFalse=Li,l.stubObject=Mh,l.stubString=Hh,l.stubTrue=Oh,l.multiply=Xh,l.nth=cp,l.noConflict=Bh,l.noop=wi,l.now=Qn,l.pad=Qd,l.padEnd=jd,l.padStart=eh,l.parseInt=th,l.random=$d,l.reduce=hf,l.reduceRight=gf,l.repeat=nh,l.replace=rh,l.result=Pd,l.round=Qh,l.runInContext=f,l.sample=yf,l.size=xf,l.snakeCase=ih,l.some=_f,l.sortedIndex=yp,l.sortedIndexBy=vp,l.sortedIndexOf=bp,l.sortedLastIndex=xp,l.sortedLastIndexBy=_p,l.sortedLastIndexOf=Sp,l.startCase=ah,l.startsWith=lh,l.subtract=jh,l.sum=eg,l.sumBy=tg,l.template=sh,l.times=Wh,l.toFinite=Xe,l.toInteger=E,l.toLength=Va,l.toLower=uh,l.toNumber=Re,l.toSafeInteger=ud,l.toString=U,l.toUpper=ch,l.trim=ph,l.trimEnd=fh,l.trimStart=dh,l.truncate=hh,l.unescape=gh,l.uniqueId=Uh,l.upperCase=mh,l.upperFirst=bi,l.each=Da,l.eachRight=Pa,l.first=Ra,Si(l,function(){var e={};return ke(l,function(t,n){N.call(l.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),l.VERSION=h,we(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){l[e].placeholder=l}),we(["drop","take"],function(e,t){H.prototype[e]=function(n){n=n===r?1:te(E(n),0);var i=this.__filtered__&&!t?new H(this):this.clone();return i.__filtered__?i.__takeCount__=oe(n,i.__takeCount__):i.__views__.push({size:oe(n,We),type:e+(i.__dir__<0?"Right":"")}),i},H.prototype[e+"Right"]=function(n){return this.reverse()[e](n).reverse()}}),we(["filter","map","takeWhile"],function(e,t){var n=t+1,i=n==Bi||n==pl;H.prototype[e]=function(a){var s=this.clone();return s.__iteratees__.push({iteratee:B(a,3),type:n}),s.__filtered__=s.__filtered__||i,s}}),we(["head","last"],function(e,t){var n="take"+(t?"Right":"");H.prototype[e]=function(){return this[n](1).value()[0]}}),we(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");H.prototype[e]=function(){return this.__filtered__?new H(this):this[n](1)}}),H.prototype.compact=function(){return this.filter(de)},H.prototype.find=function(e){return this.filter(e).head()},H.prototype.findLast=function(e){return this.reverse().find(e)},H.prototype.invokeMap=P(function(e,t){return typeof e=="function"?new H(this):this.map(function(n){return nn(n,e,t)})}),H.prototype.reject=function(e){return this.filter(er(B(e)))},H.prototype.slice=function(e,t){e=E(e);var n=this;return n.__filtered__&&(e>0||t<0)?new H(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(t=E(t),n=t<0?n.dropRight(-t):n.take(t-e)),n)},H.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},H.prototype.toArray=function(){return this.take(We)},ke(H.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),a=l[i?"take"+(t=="last"?"Right":""):t],s=i||/^find/.test(t);!a||(l.prototype[t]=function(){var c=this.__wrapped__,p=i?[1]:arguments,d=c instanceof H,y=p[0],v=d||T(c),x=function(M){var W=a.apply(l,tt([M],p));return i&&C?W[0]:W};v&&n&&typeof y=="function"&&y.length!=1&&(d=v=!1);var C=this.__chain__,I=!!this.__actions__.length,A=s&&!C,D=d&&!I;if(!s&&v){c=D?c:new H(this);var R=e.apply(c,p);return R.__actions__.push({func:Zn,args:[x],thisArg:r}),new Le(R,C)}return A&&D?e.apply(this,p):(R=this.thru(x),A?i?R.value()[0]:R.value():R)})}),we(["pop","push","shift","sort","splice","unshift"],function(e){var t=Sn[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",i=/^(?:pop|shift)$/.test(e);l.prototype[e]=function(){var a=arguments;if(i&&!this.__chain__){var s=this.value();return t.apply(T(s)?s:[],a)}return this[n](function(c){return t.apply(T(c)?c:[],a)})}}),ke(H.prototype,function(e,t){var n=l[t];if(n){var i=n.name+"";N.call(Dt,i)||(Dt[i]=[]),Dt[i].push({name:t,func:n})}}),Dt[zn(r,ut).name]=[{name:"wrapper",func:r}],H.prototype.clone=hu,H.prototype.reverse=gu,H.prototype.value=mu,l.prototype.at=Kp,l.prototype.chain=qp,l.prototype.commit=Vp,l.prototype.next=Yp,l.prototype.plant=Zp,l.prototype.reverse=Xp,l.prototype.toJSON=l.prototype.valueOf=l.prototype.value=Qp,l.prototype.first=l.prototype.head,Jt&&(l.prototype[Jt]=Jp),l},Ft=Vs();pt?((pt.exports=Ft)._=Ft,_r._=Ft):re._=Ft}).call(commonjsGlobal)})(lodash,lodash.exports);var _=lodash.exports;const ComponentSchema={type:"object",properties:{layout:{type:"array",items:{type:"object",properties:{key:{type:"string"},value:{type:"string"}}}},value:{type:"array",items:{type:"object",properties:{label:{type:"string"},value:{type:"string"}}}},columns:{type:"array",items:{type:"object",properties:{header:{type:"string"},accessorKey:{type:"string"},widgetType:{type:"string"}}}},events:{type:"array",items:{type:"object",properties:{eventType:{type:"string"},configType:{type:"string"}}}},sectionLabels:{type:"array",items:{type:"object",properties:{label:{type:"string"}}}},legendLabels:{type:"array",items:{type:"object",properties:{label:{type:"string"}}}},pieArcColors:{type:"array",items:{type:"object",properties:{label:{type:"string"}}}},validation:{type:"array",items:{type:"object",properties:{componentName:{type:"string"},validationType:{type:"string"},validationValue:{type:"string"}}}}}},componentBasicUiSchema={type:"HorizontalLayout",elements:[{type:"WrapperLayout",config:{main:{rowSpacing:1,header:!0},defaultStyle:!0},elements:[{type:"Control",scope:"#/properties/Component",options:{widget:"Box"},config:{layout:{xs:12,sm:12,md:2},main:{heading:"Component"},style:{float:"left"}}},{type:"Control",scope:"#/properties/pageName",options:{widget:"Box"},config:{layout:{xs:7,sm:7,md:9},main:{heading:" "},style:{float:"right",width:"auto",fontSize:"12px",color:"gray",paddingTop:"10px"}}},{type:"Control",scope:"#/properties/Back_Button",options:{widget:"IconButton"},config:{layout:{xs:2,sm:2,md:.5},main:{icon:"BackIcon",styleDefault:!0,size:"small",onClick:"backHandler",tooltipMessage:"Back"},style:{float:"right"}}}]},{type:"TabLayout",config:{main:{tabLabels:["Core"],defaultStyle:!0,id:"component"}},elements:[{type:"HorizontalLayout",elements:[{type:"Control",scope:"#/properties/type",options:{widget:"SelectInputField"},config:{layout:{xs:12,sm:12,md:6,lg:6},main:{label:"Type",options:[{title:"Select",const:"Select"},{title:"Date",const:"Date"},{title:"CheckBox",const:"CheckBox"},{title:"Table",const:"Table"},{title:"Array",const:"Array"},{title:"Container",const:"WrapperSection"},{title:"Tabs",const:"TabSection"},{title:"Text",const:"Text"},{title:"Radio",const:"Radio"},{title:"Text Area",const:"TextArea"},{title:"Button",const:"Button"},{title:"Card",const:"card"},{title:"Rank",const:"Rank"},{title:"SpeedoMeter",const:"SpeedoMeter"},{title:"ProgressBar",const:"ProgressBar"},{title:"Graph",const:"Graph"},{title:"Label",const:"Box"},{title:"Upload File",const:"UploadFile"},{title:"Download File",const:"DownloadFile"},{title:"Empty Box",const:"EmptyBox"},{title:"ProgressBar Card",const:"ProgressBarCard"},{title:"Rank Card",const:"RankCard"},{title:"Runner Boy Progress Bar",const:"RunnerBoyProgressBar"},{title:"Slider",const:"Slider"},{title:"Timer",const:"Timer"},{title:"MultipleSelect",const:"MultipleSelect"},{title:"LeaderBoard",const:"LeaderBoard"}]}}},{type:"Control",scope:"#/properties/name",options:{widget:"InputField"},config:{layout:{xs:12,sm:12,md:6,lg:6},main:{label:"Name",options:[],color:"secondary",required:!0}}},{type:"Control",scope:"#/properties/label",options:{widget:"InputField"},config:{layout:{xs:12,sm:12,md:6,lg:6},main:{label:"Label",options:[],color:"secondary",required:!0}}},{type:"Control",scope:"#/properties/proc",config:{layout:{xs:11,sm:11,md:6,lg:6}},options:{widget:"EmptyBox"}},{type:"Control",scope:"#/properties/layout",layout:11.5,options:{detail:{type:"HorizontalLayout",elements:[{type:"Control",scope:"#/properties/key",options:{widget:"SelectInputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"Screen Size",options:[{title:"Extra Small",const:"xs"},{title:"Small",const:"sm"},{title:"Medium",const:"md"},{title:"Large",const:"lg"}]}}},{type:"Control",scope:"#/properties/value",options:{widget:"MultipleSelect"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"Value",options:[{title:"3",const:"3"},{title:"5.5",const:"5.5"},{title:"8",const:"8"},{title:"12",const:"12"}]}}}]}}}]}]},{type:"Control",scope:"#/properties/proc",config:{layout:{xs:11,sm:11,md:8,lg:8}},options:{widget:"EmptyBox"}},{type:"Control",scope:"#/properties/btn",options:{widget:"Button"},config:{layout:{xs:11,sm:11,md:3,lg:3},main:{name:"Save",startIcon:"ApproveIcon",variant:"contained",color:"info",type:"text",onClick:"saveHandler",size:"small"},style:{marginBottom:"8px",float:"right"}}},{type:"Control",scope:"#/properties/notify",options:{widget:"Notify"},layout:6}]};var buildConfig=o=>{const u=_.cloneDeep(o);let r={};return u.pageName&&delete u.pageName,u.eventsSelected&&delete u.eventsSelected,(u.type==="Table"||u.type==="WrapperSection"||u.type==="TabSection")&&(r.elements=u.elements||[],u.elements&&delete u.elements),r.events=u.events||[],u.events&&delete u.events,r={...u,...r},r};const createLayoutFormat=o=>{let u={};return o.map(r=>{u[r.key]=+r.value}),u},flatObjectValueInArray=o=>{const u=Object.keys(o[0])[0];return o.map(h=>h[u])},getNavigationHistory=(o,u)=>{if(u){let r=o.name;const h=u.split("."),b=[];return h.map((w,S)=>{if(S===0){b.push(w);return}b.push(`${b[S-1]}.${w}`)}),b.map(w=>{const S=_.get(o,w);S?r=r+` > ${(S==null?void 0:S.name)||(S==null?void 0:S.eventType)}`:r=r+" > NewComponent"}),{pageName:r}}},saveFormdataInLocalStorage=(o,u)=>{let r;if(u){const h=getFormdataFromLocalStorage();r=_.set(h,u,buildConfig(o))}else r=buildConfig(o);return localStorage.setItem("pageFormdata",JSON.stringify(r)),r},getFormdataFromLocalStorage=o=>{const u=localStorage.getItem("pageFormdata")?JSON.parse(localStorage.getItem("pageFormdata")):void 0;let r;return o&&(r=_.get(u,o),r={...r,...getNavigationHistory(u,o)}),r||(r=getNavigationHistory(u,o)),r||u},CoreSection={type:"HorizontalLayout",elements:[{type:"Control",scope:"#/properties/type",options:{widget:"SelectInputField"},config:{layout:{xs:12,sm:12,md:6,lg:6},main:{label:"Type",type:"text",options:[{title:"Select",const:"Select"},{title:"Date",const:"Date"},{title:"CheckBox",const:"CheckBox"},{title:"Table",const:"Table"},{title:"Array",const:"Array"},{title:"Container",const:"WrapperSection"},{title:"Tabs",const:"TabSection"},{title:"Text",const:"Text"},{title:"Text Area",const:"TextArea"},{title:"Button",const:"Button"},{title:"Card",const:"card"},{title:"Radio",const:"Radio"},{title:"Rank",const:"Rank"},{title:"SpeedoMeter",const:"SpeedoMeter"},{title:"ProgressBar",const:"ProgressBar"},{title:"Graph",const:"Graph"},{title:"Label",const:"Box"},{title:"Upload File",const:"UploadFile"},{title:"Download File",const:"DownloadFile"},{title:"Empty Box",const:"EmptyBox"},{title:"ProgressBar Card",const:"ProgressBarCard"},{title:"Rank Card",const:"RankCard"},{title:"Runner Boy Progress Bar",const:"RunnerBoyProgressBar"},{title:"Slider",const:"Slider"},{title:"Timer",const:"Timer"},{title:"MultipleSelect",const:"MultipleSelect"},{title:"LeaderBoard",const:"LeaderBoard"}]}}},{type:"Control",scope:"#/properties/name",options:{widget:"InputField"},config:{layout:{xs:12,sm:12,md:6,lg:6},main:{label:"Name"}}},{type:"Control",scope:"#/properties/label",options:{widget:"InputField"},config:{layout:{xs:12,sm:12,md:6,lg:6},main:{label:"Label"}}},{type:"Control",scope:"#/properties/proc",config:{layout:{xs:11,sm:11,md:6,lg:6}},options:{widget:"EmptyBox"}},{type:"Control",scope:"#/properties/layout",layout:11.5,options:{elementLabelProp:"key",detail:{type:"HorizontalLayout",elements:[{type:"Control",scope:"#/properties/key",options:{widget:"SelectInputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"Screen Size",options:[{title:"Extra Small",const:"xs"},{title:"Small",const:"sm"},{title:"Medium",const:"md"},{title:"Large",const:"lg"}]}}},{type:"Control",scope:"#/properties/value",options:{widget:"MultipleSelect"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"Value",options:[{title:"3",const:"3"},{title:"5.5",const:"5.5"},{title:"8",const:"8"},{title:"12",const:"12"}]}}}]}}}]},OptionArray={type:"Control",scope:"#/properties/value",layout:11.5,options:{detail:{type:"HorizontalLayout",elements:[{type:"Control",scope:"#/properties/label",options:{widget:"InputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"Label"}}},{type:"Control",scope:"#/properties/value",options:{widget:"InputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"Value"}}}]}}},EventSection={type:"HorizontalLayout",elements:[{type:"WrapperLayout",config:{main:{divider:!0},wrapperStyle:{border:"1px solid gray"}},elements:[{type:"Control",scope:"#/properties/programType",options:{widget:"Box"},config:{layout:8,main:{heading:"Event Table"},style:{fontFamily:"Roboto",fontWeight:"500",paddingLeft:"-10px",fontSize:"20px"}}},{type:"Control",scope:"#/properties/Back_Button",options:{widget:"IconButton"},config:{layout:3,main:{icon:"AddIcon",styleDefault:!0,size:"small",onClick:"eventAddHandler",tooltipMessage:"Back"},style:{float:"right"}}},{type:"Control",scope:"#/properties/events",options:{widget:"Table"},config:{main:{disableAction:!0,disableSelection:!0,enableDrag:!0}},elements:[{accessorKey:"eventType",header:"Event Type"},{accessorKey:"Handler",header:"Handler"},{accessorKey:"Edit_Approve_Records",header:"Edit Widget",widget:{type:"Control",scope:"#/properties/Edit_Records",options:{widget:"IconButton"},config:{main:{color:"info",size:"small",icon:"EditIcon",tooltipMessage:"Edit This Record",onClick:"eventEditHandler"},style:{color:"#3949ab"}}}},{accessorKey:"Reject_Records",header:"Delete",widget:{type:"Control",scope:"#/properties/RejectButton",accessorKeyName:"Reject_Records",options:{widget:"IconButton"},config:{main:{icon:"RejectIcon",color:"error",tooltipMessage:"Reject This Record",onClick:"deleteEvent"}}}}]}]}]},EmptyBox={type:"Control",scope:"#/properties/empty",options:{widget:"EmptyBox"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{}}},getArrayControl=(o,u,r)=>({type:"Control",scope:`#/properties/${o}`,layout:11.5,options:{elementLabelProp:u,detail:{type:"HorizontalLayout",elements:[{type:"Control",scope:`#/properties/${u}`,options:{widget:"InputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:r||"Labels for Tab"}}}]}}}),getInputField=(o,u)=>({type:"Control",scope:`#/properties/${o}`,options:{widget:"InputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:u}}}),getRadioInputField=(o,u,r)=>({type:"Control",scope:`#/properties/${o}`,options:{widget:"RadioInputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:u,options:r}}}),getTextArea=(o,u,r,h)=>({type:"Control",scope:`#/properties/${o}`,options:{widget:"TextArea"},config:{layout:h||12,style:{containerStyle:{borderRadius:"20px"},headerContainerStyle:{},textAreaStyle:{borderRadius:"20px",padding:"20px"}},main:{heading:u,minRows:8,hideButton:r}}}),getSelectField=(o,u,r)=>({type:"Control",scope:`#/properties/${o}`,options:{widget:"SelectInputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:u,type:"text",options:r}}}),GraphSection={type:"HorizontalLayout",elements:[]},buildPropertiesSection=function(o){let u=_.cloneDeep(GraphSection);if(o==="SpeedoMeter")u.elements=[getInputField("segments","Segments Count"),getInputField("heading","Container Heading"),getInputField("heading","Container Heading"),getInputField("speedoCaption","Speedometer Caption"),getInputField("width","Speedometer Width")];else if(o==="RankCard")u.elements=[getInputField("rank","Rank"),getInputField("image","Image Url"),getInputField("title","Card Title"),getInputField("description","Card Description")];else if(o==="LeaderBoard")u.elements=[getInputField("valueLabel","Value Label"),getInputField("firstImage","First Image url"),getInputField("secondImage","Second Image url"),getInputField("thirdImage","Third Image url"),getTextArea("functionCode","Write Compare Code",!1)];else if(o==="CardSlider"){const r=getInputField("heading","Heading"),h=getInputField("iconName","Icon Name");u.elements=[r,h]}else if(o==="ProgressBar"||o==="ProgressBarCard"){const r=getInputField("heading","Heading"),h=getInputField("bottomLabel_1","First BottomLabel"),b=getInputField("bottomLabel_2","Second BottomLabel"),w=getInputField("bottomLabel_3","Third BottomLabel");u.elements=[r,h,b,w]}else if(o==="card")u.elements=[getInputField("url","Image Url"),getInputField("label","Label"),getInputField("description","Description")];else if(o==="Box"){const r=getInputField("value","Value");u.elements=[getSelectField("graphType","Label Type",[{title:"URL",const:"url"},{title:"Heading",const:"heading"}]),r]}else if(o==="Button"){const r=getInputField("color","Color"),h=getInputField("size","Size"),b=getInputField("iconName","Icon Name");u.elements=[getSelectField("buttonType","Button Type",[{title:"Button With Text",const:"Button"},{title:"Button With Icon",const:"IconButton"},{title:"Button With Icon and Text",const:"ButtonWithIconAndText"}]),b,h,r,getSelectField("defaultStyle","Default Style",[{title:"Apply Default Style",const:"true"},{title:"No Style",const:"false"}]),JSON.parse(JSON.stringify(EmptyBox))]}else if(o==="Graph"){const r=getInputField("height","Height"),h=getInputField("heading","Heading"),b=getInputField("leftLabel","Left Label"),w=getInputField("bottomLabel","Bottom Label"),S=getRadioInputField("legendHide","Legend Hide",["YES","No"]);u.elements=[h,r,getSelectField("graphType","Graph Type",[{title:"Bar Graph",const:"BarGraph"},{title:"Stack Bar Graph",const:"StackBarGraph"},{title:"Line Graph",const:"LineGraph"},{title:"Pie Graph",const:"PieGraph"},{title:"Horizontal Bar Graph",const:"HorizontalBarGraph"}]),b,w,S,getArrayControl("legendLabels","label"),getArrayControl("pieArcColors","color")]}else o==="WrapperSection"?u.elements=[getRadioInputField("divider","Divider",["YES","No"]),getRadioInputField("heading","Page Heading",["YES","No"])]:o==="TabSection"?u.elements=[getArrayControl("sectionLabels","label")]:o==="Radio"&&(u.elements=[getArrayControl("sectionLabels","label","Options Of Radio")]);return u},StyleSection={type:"HorizontalLayout",elements:[{type:"Control",scope:"#/properties/style",options:{widget:"TextArea"},config:{layout:{xs:12,sm:12,md:12,lg:12},style:{containerStyle:{borderRadius:"20px"},headerContainerStyle:{},textAreaStyle:{borderRadius:"20px",padding:"20px"}},main:{heading:"JSON Style",minRows:8,hideButton:!0}}}]},TableSection={type:"HorizontalLayout",elements:[{type:"WrapperLayout",config:{main:{},wrapperStyle:{border:"1px solid gray"}},elements:[{type:"Control",scope:"#/properties/programType",options:{widget:"Box"},config:{layout:8,main:{heading:"Components Table"},style:{fontFamily:"Roboto",fontWeight:"500",paddingLeft:"-10px",fontSize:"20px"}}},{type:"Control",scope:"#/properties/Back_Button",options:{widget:"IconButton"},config:{layout:3,main:{icon:"AddIcon",styleDefault:!0,size:"small",onClick:"widgetAddClickHandler",tooltipMessage:"Back"},style:{float:"right"}}},{type:"Control",scope:"#/properties/elements",options:{widget:"Table"},config:{main:{disableAction:!0,disableSelection:!0,enableDrag:!0}},elements:[{accessorKey:"name",header:"Name"},{accessorKey:"type",header:"Type"},{header:"Edit Record",field:"Reject_Records",flex:1,widget:{type:"Control",scope:"#/properties/RejectButton",options:{widget:"IconButton"},config:{main:{icon:"EditIcon",color:"primary",onClick:"editComponents",tooltipMessage:"Reject This Record"}}}},{header:"Delete",field:"Reject_Records",flex:1,widget:{type:"Control",scope:"#/properties/RejectButton",options:{widget:"IconButton"},config:{main:{icon:"RejectIcon",color:"error",onClick:"deleteComponents",tooltipMessage:"Reject This Record"}}}}]}]}]},ValueTab={type:"HorizontalLayout",elements:[OptionArray]},ValidationSection={type:"HorizontalLayout",elements:[{type:"Control",scope:"#/properties/validation",layout:11.5,options:{elementLabelProp:"validationType",detail:{type:"HorizontalLayout",elements:[{type:"Control",scope:"#/properties/validationType",options:{widget:"SelectInputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"Validation Type",options:[{const:"required",title:"Required"},{const:"minLength",title:"Minimum Length"},{const:"maxLength",title:"Maximum Length"},{const:"pattern",title:"Pattern"}]}}},{type:"Control",scope:"#/properties/validationValue",options:{widget:"InputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"Validation Value"}}}]}}}]},sectionLabels={Select:["Core","Value","style","Event","Validation"],MultipleSelect:["Core","Value","style","Event","Validation"],Table:["Core","Components","style","Event","Validation"],LeaderBoard:["Core","Components","Properties","style","Event","Validation"],WrapperSection:["Core","Components","Properties","style","Validation"],TabSection:["Core","Components","Properties","style","Validation"],SpeedoMeter:["Core","Properties","style","Event","Validation"],card:["Core","Properties","style","Event","Validation"],UploadFile:["Core","style","Event","Validation"],Graph:["Core","Properties","style","Event","Validation"],DownloadFile:["Core","style","Event","Validation"],Box:["Core","Properties","style","Event","Validation"],Properties:["Core","Properties","style","Event","Validation"],ProgressBarCard:["Core","Properties","style","Event","Validation"],RankCard:["Core","Properties","style","Event","Validation"],Slider:["Core","Components","Properties","style","Event","Validation"],Timer:["Core","Properties","style","Event","Validation"],Rank:["Core","Properties","style","Event","Validation"],Button:["Core","Properties","style","Event","Validation"],Array:["Core","Components","Validation"],Radio:["Core","Properties","style","Event","Validation"],Text:["Core","Event","Validation"]},refreshPage=(o,u)=>{var h;const r=_.cloneDeep(componentBasicUiSchema);if(o){const b={Core:CoreSection,Value:ValueTab,style:StyleSection,Event:EventSection,Components:TableSection,Properties:buildPropertiesSection(o),Validation:ValidationSection},w=(h=sectionLabels[o])==null?void 0:h.map(S=>b[S]);r.elements[1].config.main.tabLabels=sectionLabels[o]||["Core","style","Event","Validation"],r.elements[1].elements=w||[CoreSection,StyleSection,EventSection,ValidationSection]}u.setUiSchema(r)};var Component=(o,u)=>({setPage:async function(){const r=await this.getFormdata();o.setFormdata(r);const h=this.getSchema();o.setSchema(h),this.refreshPage(r==null?void 0:r.type,o)},refreshPage,getFormdata:async function(){var h;const r=(h=o.searchParams)==null?void 0:h.get("path");return getFormdataFromLocalStorage(r)},getSchema:function(){return ComponentSchema},saveHandler:async function(){var h;const r=(h=o.searchParams)==null?void 0:h.get("path");saveFormdataInLocalStorage(o.formData,r),o.navigate(-1),o.setNotify({SuccessMessage:"Save Successfully",Success:!0})},onChange:function(){var r,h,b,w;((r=o==null?void 0:o.formData)==null?void 0:r.type)!==((h=o==null?void 0:o.newData)==null?void 0:h.type)&&((b=o==null?void 0:o.newData)==null?void 0:b.type)!==void 0&&this.refreshPage((w=o==null?void 0:o.newData)==null?void 0:w.type,o)},editComponents:async function(){var w,S,O;const r=u.path.split(".")[1],h=(w=o.searchParams)==null?void 0:w.get("path"),b=(S=o.searchParams)==null?void 0:S.get("id");if(saveFormdataInLocalStorage(o.formData,h),h){const j=`${(O=o.searchParams)==null?void 0:O.get("path")}.elements[${r}]`;o.searchParams.set("path",j),o.setSearchParams(o.searchParams),this.setPage()}else o.navigate(`/Component?path=${`elements[${r}]`}&id=${b}`)},deleteComponents:async function(){var S;const r=(S=o.searchParams)==null?void 0:S.get("path"),h=u.path.split(".")[1];o.formData.elements.splice(h,1);const b=saveFormdataInLocalStorage(o.formData,r),w=r?_.get(b,r):b;o.setFormdata(w)},deleteEvent:async function(){var w;const r=(w=o.searchParams)==null?void 0:w.get("path"),h=u.path.split(".")[1];o.formData.events.splice(h,1);const b=saveFormdataInLocalStorage(o.formData,r);o.setFormdata(_.get(b,r))},widgetAddClickHandler:async function(){var b;Array.isArray(o.formData.elements)||(o.formData.elements=[]);const r=(b=o.searchParams)==null?void 0:b.get("path");saveFormdataInLocalStorage(o.formData,r);const h=`${r}.elements[${o.formData.elements.length}]`;o.searchParams.set("path",h),o.setSearchParams(o.searchParams),this.setPage()},eventEditHandler:async function(){var S,O;const r=u.path.split(".")[1],h=(S=o.searchParams)==null?void 0:S.get("path"),b=(O=o.searchParams)==null?void 0:O.get("id");saveFormdataInLocalStorage(o.formData,h);const w=`${h}.events[${r}]`;o.navigate(`/ComponentEvents?path=${w}&id=${b}`)},eventAddHandler:async function(){var w,S;const r=(w=o.searchParams)==null?void 0:w.get("path"),h=(S=o.searchParams)==null?void 0:S.get("id");Array.isArray(o.formData.events)||(o.formData.events=[]),saveFormdataInLocalStorage(o.formData,r);const b=`${r}.events[${o.formData.events.length}]`;o.navigate(`/ComponentEvents?path=${b}&id=${h}`)},backHandler:function(){o.navigate(-1)}}),leaderBoard={type:"WrapperLayout",config:{main:{rowSpacing:3,header:!0,label:"LeaderBoard",divider:!0},style:{wrapperStyle:{height:{xs:850,sm:1e3}}},wrapperStyle:{position:"relative",width:"100%"}},elements:[{type:"Control",scope:"#/properties/leaderBoard/properties/firstImage",config:{main:{url:"https://my.alfred.edu/zoom/_images/foster-lake.jpg"},containerStyle:{objectFit:"cover",position:"absolute",top:{xs:"90px",md:"60px"},left:{xs:"calc(50% - 50px)",sm:"calc(50% - 50px)",md:"calc(50% - 100px)"},width:{xs:"100px",sm:"100px",md:"200px"},border:"5px solid rgb(179, 198, 255)",height:{xs:"100px",sm:"100px",md:"200px"},borderRadius:"50%"},style:{objectFit:"cover",width:"100%",height:"100%",borderRadius:"50%"},layout:6},options:{widget:"Image"}},{type:"Control",scope:"#/properties/leaderBoard/properties/secondImage",config:{main:{url:"https://my.alfred.edu/zoom/_images/foster-lake.jpg"},containerStyle:{objectFit:"cover",position:"absolute",top:{xs:"160px",md:"130px"},left:{xs:"calc(25% - 45px)",sm:"calc(25% - 45px)",md:"calc(25% - 90px)"},width:{xs:"80px",sm:"80px",md:"180px"},border:"5px solid rgb(179, 198, 255)",height:{xs:"80px",sm:"80px",md:"180px"},borderRadius:"50%"},style:{objectFit:"cover",width:"100%",height:"100%",borderRadius:"50%"},layout:6},options:{widget:"Image"}},{type:"Control",scope:"#/properties/leaderBoard/properties/thirdImage",config:{main:{url:"https://my.alfred.edu/zoom/_images/foster-lake.jpg"},containerStyle:{objectFit:"cover",position:"absolute",top:{xs:"160px",md:"130px"},left:{xs:"calc(75% - 42.5px)",sm:"calc(75% - 42.5px)",md:"calc(75% - 85px)"},width:{xs:"80px",sm:"80px",md:"180px"},border:"5px solid rgb(179, 198, 255)",height:{xs:"80px",sm:"80px",md:"180px"},borderRadius:"50%"},style:{objectFit:"cover",width:"100%",height:"100%",borderRadius:"50%"},layout:6},options:{widget:"Image"}},{type:"Control",scope:"#/properties/leaderBoard/properties/firstName",config:{main:{heading:"Satendra Raghav"},style:{objectFit:"cover",position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",color:"black",top:{xs:"190px",md:"270px"},fontSize:{xs:"12px",md:"20px"},left:"calc(50% - 90px)",width:"180px",fontWeight:"bold",borderRadius:"50%",zIndex:7},layout:6},options:{widget:"Box"}},{type:"Control",scope:"#/properties/leaderBoard/properties/secondName",config:{main:{heading:"Satendra Raghav"},style:{objectFit:"cover",position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",color:"black",top:{xs:"240px",md:"320px"},fontSize:{xs:"12px",md:"20px"},left:"calc(25% - 90px)",width:"180px",fontWeight:"bold",borderRadius:"50%"},layout:6},options:{widget:"Box"}},{type:"Control",scope:"#/properties/leaderBoard/properties/thirdName",config:{main:{heading:"Satendra Raghav"},style:{objectFit:"cover",position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",color:"black",top:{xs:"240px",md:"320px"},fontSize:{xs:"12px",md:"20px"},left:"calc(75% - 90px)",width:"180px",fontWeight:"bold",borderRadius:"50%"},layout:6},options:{widget:"Box"}},{type:"Control",scope:"#/properties/econd",config:{main:{heading:"2"},style:{objectFit:"cover",position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",textShadow:"2px 2px 5px #5065C7",background:"green",color:"white",top:{xs:"225px",md:"280px"},fontSize:{xs:"12px",md:"16px"},left:{xs:"calc(25% - 12px)",md:"calc(25% - 16px)"},width:{xs:"20px",md:"40px"},border:{xs:"2px solid rgb(179, 198, 255)",md:"5px solid rgb(179, 198, 255)"},height:{xs:"20px",md:"40px"},"@keyframes rotateAnimation":{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}},animation:"rotateAnimation 4s infinite",borderRadius:"50%",zIndex:5},layout:6},options:{widget:"Box"}},{type:"Control",scope:"#/properties/first",config:{main:{heading:"1"},style:{objectFit:"cover",position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",textShadow:"2px 2px 5px #5065C7",background:"green",color:"white",top:{xs:"175px",md:"230px"},fontSize:{xs:"12px",md:"16px"},left:{xs:"calc(50% - 12px)",md:"calc(50% - 16px)"},"@keyframes rotateAnimation":{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}},animation:"rotateAnimation 4s infinite",width:{xs:"20px",md:"40px"},border:{xs:"2px solid rgb(179, 198, 255)",md:"5px solid rgb(179, 198, 255)"},height:{xs:"20px",md:"40px"},borderRadius:"50%",zIndex:5},layout:6},options:{widget:"Box"}},{type:"Control",scope:"#/properties/third",config:{main:{heading:"3"},style:{objectFit:"cover",position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",textShadow:"2px 2px 5px #5065C7",background:"green",color:"white",top:{xs:"225px",md:"280px"},fontSize:{xs:"12px",md:"16px"},left:{xs:"calc(75% - 12px)",md:"calc(75% - 16px)"},width:{xs:"20px",md:"40px"},border:{xs:"2px solid rgb(179, 198, 255)",md:"5px solid rgb(179, 198, 255)"},height:{xs:"20px",md:"40px"},"@keyframes rotateAnimation":{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}},animation:"rotateAnimation 4s infinite",borderRadius:"50%",zIndex:5},layout:6},options:{widget:"Box"}},{type:"Control",scope:"#/properties/leaderBoard/properties/table",options:{widget:"Table"},elements:[],config:{style:{tableHeadstyle:{fontWeight:900,background:"rgb(179, 198, 255)"},position:"absolute",top:{xs:"300px",sm:"300px",md:"390px",lg:"390px"},border:"2px solid rgb(179, 198, 255)",width:"95%",left:"2.5%"},main:{disableAction:!0,disableSelection:!0}}}]};const buildLeaderBoard=o=>{const u=_.cloneDeep(leaderBoard);if(o.elements){const r=o.elements.map((h,b)=>h.type?{...{widget:buildUiSchema(h),accessorKey:h.name,header:h.label||h.name}}:{accessorKey:h.name,header:h.label||h.name});u.elements[9].elements=r}return o.name&&(u.elements[0].scope=`#/properties/${o.name}/properties/firstImage`,u.elements[3].scope=`#/properties/${o.name}/properties/firstName`,u.elements[1].scope=`#/properties/${o.name}/properties/secondImage`,u.elements[4].scope=`#/properties/${o.name}/properties/secondName`,u.elements[2].scope=`#/properties/${o.name}/properties/thirdImage`,u.elements[5].scope=`#/properties/${o.name}/properties/thirdName`,u.elements[9].scope=`#/properties/${o.name}/properties/table`),o.firstImage&&(u.elements[0].config.main.url=o.firstImage),o.secondImage&&(u.elements[1].config.main.url=o.secondImage),o.secondImage&&(u.elements[2].config.main.url=o.thirdImage),o.layout&&(u.config.layout=o.layout),u};var progressBar={type:"Control",scope:"#/properties/pbc_progress",options:{widget:"ProgressBar"},config:{layout:6,main:{developOnlyProgresBar:!1,bottomLabel_3:"Remaining",heading:"PBC Details"}}};const buildProgressBarCard=(o,u)=>{const r=_.cloneDeep(progressBar);return r.scope=u,o.heading&&(r.config.main.heading=o.heading),o.bottomLabel_3&&(r.config.main.bottomLabel_3=o.bottomLabel_3),o.bottomLabel_2&&(r.config.main.bottomLabel_2=o.bottomLabel_2),o.bottomLabel_1&&(r.elements[0].config.main.bottomLabel_1=o.bottomLabel_1),o.layout&&(r.config.layout=createLayoutFormat(o.layout)),r},buildProgressBar=(o,u)=>{const r=_.cloneDeep(progressBar);return r.scope=u,o.layout&&(r.config.layout=o.layout),r.config.main.heading=o.heading,o.bottomLabel_3&&(r.config.main.bottomLabel_3=o.bottomLabel_3),o.layout&&(r.config.layout=createLayoutFormat(o.layout)),o.bottomLabel_2&&(r.config.main.bottomLabel_2=o.bottomLabel_2),o.bottomLabel_1&&(r.config.main.bottomLabel_1=o.bottomLabel_1),r},BarGraph={type:"Control",scope:"#/properties/graph",options:{widget:"Graph"},config:{main:{header:"Bar Graph",bottomLabel:"Name of Employe",numTicks:6,leftLabel:"Value in lakhs",axisLeft:!0,axisBottom:!0,hideTicks:!1,hideLeftAxisLine:!1,hideBottomAxisLine:!1,bottomAxisWidth:"10px",legend:{labelColor:"green",legendTitle:"",direction:"row",align:"none"}},style:{containerStyle:{width:"100%",height:300},headerStyle:{},tooltipStyle:{},labelStyle:{margin:{left:80,bottom:20},leftLabelOffset:50,bottomLabelOffset:10},barStyle:{color:{firstBarColor:"#6c5efb",secondBarColor:"#3f51b5"}},legendStyle:{legend:{lineHeight:"0.9em",fontSize:"8px",fontFamily:"arial",padding:"10px 10px",width:"30%",display:"flex",justifyContent:"center",border:"1px solid rgba(255, 255, 255, 0.3)",borderRadius:" 8px",marginRight:"auto"},legendTitle:{fontSize:"10px",marginBottom:"10px",fontWeight:"100"}}}}},PieGraph={type:"Control",scope:"#/properties/graph",options:{widget:"Graph"},config:{main:{header:"Incentive Branch category wise",type:"PieGraph",bottomLabel:"Name of Employe",leftLabel:"Value",axisLeft:!0,axisBottom:!0,legendAvailable:!0,legend:{labelColor:"green",legendTitle:"Branches",direction:"row",align:"right"}},style:{containerStyle:{height:"340"},headerStyle:{},tooltipStyle:{backgroundColor:"black",width:"80px"},labelStyle:{},legendStyle:{legend:{},legendTitle:{}},pieStyle:{}}}},LineGraph={type:"Control",scope:"#/properties/graph",options:{widget:"Graph"},config:{layout:12,main:{type:"LineGraph",header:"Quartely Incentive in Thousand",bottomLabel:"Years",leftLabel:"Incentive",gridHidden:!0,numHidden:!1,tooltipDataKey:["MAMA New Project","Second","Third"],axisLeft:!0,axisBottom:!0,hideLeftAxisLine:!1,hideBottomAxisLine:!1,legend:{labelColor:"green",legendTitle:"Our Assests",direction:"row",align:"right",colorRectWidth:20}},style:{containerStyle:{},headerStyle:{},labelStyle:{},lineStyle:{}}}},HorizontalBarGraph={type:"Control",scope:"#/properties/graph",options:{widget:"Graph"},config:{main:{header:" ",type:"HorizontalBarGraph",bottomLabel:" ",leftLabel:"Value",axisLeft:!1,axisBottom:!0,hideBottomTicks:!1,hideLeftTicks:!1,hideLeftAxisLine:!0,hideBottomAxisLine:!1,bottomAxisWidth:"10px"},style:{containerStyle:{width:"100%"},headerStyle:{},tooltipStyle:{},labelStyle:{},barStyle:{color:"#6c5efb"}}}},buildHorizontalBarGraph=(o,u)=>{const r=_.cloneDeep(HorizontalBarGraph);return r.scope=u,o.layout&&(r.config.layout=createLayoutFormat(o.layout)),r.scope=u,r.config.main.header=o.heading,o.barColor&&(r.config.barStyle.color=o.barColor),o.containerBackground&&(r.config.containerStyle.background=o.containerBackground),o.height&&(r.config.style.containerStyle.height=o.height),o.bottomLabel&&(r.config.main.bottomLabel=o.bottomLabel),o.leftLabel&&(r.config.main.leftLabel=o.leftLabel),r};var SpeedoMeter={type:"Control",scope:"#/properties/emptyBox",options:{widget:"SpeedoMeter"},config:{layout:{xs:12,sm:12,md:11.7,lg:11.7},width:350,segments:"5",main:{currentValueText:"Your Score",customSegmentLabels:[],data:{maxValue:1e5,value:5e4,minValue:0}},style:{segmentColors:[],ringWidth:57,needleHeightRatio:.7,needleColor:"#3f51b5",startColor:"red",textColor:"black",endColor:"green",containerStyle:{background:"white",padding:"20px",borderRadius:"20px",display:"flex",flexDirection:"column",margin:"auto",justifyContent:"center",fontFamily:"Roboto",fontWeight:500},headerStyle:{textAlign:"left",width:"100%",paddingBottom:"20px"}}}};const buildSpeedoMeter=(o,u)=>{const r=_.cloneDeep(SpeedoMeter);if(r.scope=u,o.layout&&(r.config.layout=createLayoutFormat(o.layout)),o.heading&&(r.config.main.header=o.heading),o.segments&&(r.config.main.segments=o.segments),o.style){const h=JSON.parse(o.style);h!=null&&h.style&&(r.config.style={...r.config.style,...h.style}),h!=null&&h.containerStyle&&(r.config.style.containerStyle={...r.config.style.containerStyle,...h.containerStyle})}return o.width&&(r.config.main.width=o.width),o.speedoCaption&&(r.config.main.currentValueText=o.speedoCaption),o.data&&(r.config.main.data=o.data),o.needleColor&&(r.config.style.needleColor=o.needleColor),o.segments&&(r.config.style.segments=o.segments),o.endColor&&(r.config.style.endColor=o.endColor),o.startColor&&(r.config.style.startColor=o.startColor),o.segmentColors&&(r.config.style.segmentColors=o.segmentColors),r},buildPieGraph=(o,u)=>{const r=_.cloneDeep(PieGraph);return o.layout&&(r.config.layout=createLayoutFormat(o.layout)),o.height&&(r.config.style.containerStyle.height=o.height),o.legendHide&&(r.config.main.legendAvailabe=o.legendHide!=="YES"),r.scope=u,r.config.main.header=o.heading,o.legendLabels&&(r.config.main.tooltipDataKey=flatObjectValueInArray(o.legendLabels)),o.pieArcColors&&(r.config.style.pieStyle.colorRange=flatObjectValueInArray(o.pieArcColors)),r},buildStackbarGraph=(o,u)=>{const r=_.cloneDeep(BarGraph);return o.layout&&(r.config.layout=createLayoutFormat(o.layout)),o.legendHide&&(r.config.main.legendAvailable=!1),r.config.main.type=o.graphType,r.config.main.header=o.heading,o.barColor&&(r.config.barStyle.color=o.barColor),o.containerBackground&&(r.config.containerStyle.background=o.containerBackground),o.height&&(r.config.style.containerStyle.height=o.height),o.bottomLabel&&(r.config.main.bottomLabel=o.bottomLabel),o.leftLabel&&(r.config.main.leftLabel=o.leftLabel),r.scope=u,r};var RunnerBoyProgressBar={type:"Control",scope:"#/properties/path",options:{widget:"RunnerBoyProgressBar"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{}}};const RunnerBoyProgressbar=(o,u)=>{const r=_.cloneDeep(RunnerBoyProgressBar);return r.scope=u,o.layout&&(r.config.layout=createLayoutFormat(o.layout)),r};var Tabsection={type:"TabLayout",config:{main:{id:"groupMaster",tabLabels:["default"],layout:12}},elements:[]};const buildTabSection=(o,u)=>{const r=_.cloneDeep(Tabsection);return o.sectionLabels&&(r.config.main.tabLabels=o.sectionLabels.map(h=>h.label)),r.config.main.id=o.name,r};var WrapperSection={type:"WrapperLayout",config:{main:{label:"Default Label",divider:!0},defaultStyle:!0},elements:[]};const buildWrapperSection=(o,u)=>{const r=_.cloneDeep(WrapperSection);return r.config.main.label=o.label,r.config.main.divider=!!o.divider,r.config.main.header=!!o.heading,r};var TextInputField={type:"Control",scope:"#/properties/text",options:{widget:"InputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:""},style:{}}};const buildTextField=(o,u)=>{const r=_.cloneDeep(TextInputField);return r.config.main.label=o.label,o.style&&(r.config.style=JSON.parse(o.style)),o.layout&&(r.config.layout=createLayoutFormat(o.layout)),r.config.main.errorMessage=`${o.name} is empty or invalid`,r.scope=u,r};var SelectInputField={type:"Control",scope:"#/properties/select",options:{widget:"SelectInputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"",type:"text"}}};const buildSelect=(o,u)=>{const r=_.cloneDeep(SelectInputField);if(r.config.main.label=o.label,o.value){const h=o.value.map(b=>({title:b.label,const:b.value}));r.config.main.options=h}return o.layout&&(r.config.layout=createLayoutFormat(o.layout)),r.scope=u,r};var Button={type:"Control",scope:"#/properties/button",options:{widget:"Button"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{name:"Compare",variant:"contained",color:"info",type:"text",startIcon:"",styleDefault:!1,icon:"",onClick:"onClick",size:"small"},style:{}}};const buildButton=(o,u)=>{const r=_.cloneDeep(Button);return o.buttonType&&(r.options.widget=o.buttonType==="IconButton"?"IconButton":"Button",o.buttonType==="ButtonWithIconAndText"?r.config.main.startIcon=o.iconName:r.config.main.icon=o.iconName),o.layout&&(r.config.layout=createLayoutFormat(o.layout)),o.defaultStyle&&(r.config.main.styleDefault=o.defaultStyle==="true"),r.scope=u,o.style&&(r.config.style=JSON.parse(o.style)),o.size&&(r.config.main.size=o.size),o.color&&(r.config.main.color=o.color),o.label&&(r.config.main.name=o.label),r};var Table={type:"Control",scope:"#/properties/ApproveRecords",options:{widget:"Table"},elements:[],config:{main:{allRowData:[],columns:{dataColumns:[],actionColumns:[]}}}};const buildTable=(o,u)=>{const r=_.cloneDeep(Table);return r.scope=u,o.style&&(r.config.style=JSON.parse(o.style)),r.config.main.label=o.label,r};var Box={type:"Control",scope:"#/properties/emptyBox",options:{widget:"Box"},config:{layout:12,main:{},style:{}}};const buildLabel=(o,u)=>{const r=_.cloneDeep(Box);return r.scope=u,r.config.main.heading=o.label,o.layout&&(r.config.layout=createLayoutFormat(o.layout)),o.style&&(r.config.style=JSON.parse(o.style)),r},uploadFile={type:"Control",scope:"#/properties/attachment",config:{main:{label:"AttachmentFile",onClick:"onClick",required:!0,errorMessage:"Attachment File is not uploaded"},style:{backgroundColor:"none"},layout:{lg:5.5,md:5.5,sm:11,xs:11}},options:{widget:"UploadFile"}},downloadFile$1={type:"Control",scope:"#/properties/downloadAttachment",config:{main:{onClick:"onClick",required:!1},style:{backgroundColor:"none"},layout:{lg:5.5,md:5.5,sm:11,xs:11}},options:{widget:"DownloadFile"}},buildUploadFile=(o,u)=>{const r=_.cloneDeep(uploadFile);return r.scope=u,r.config.main.label=o.label,o.layout&&(r.config.layout=o.layout),o.layout&&(uploadFile.config.layout=createLayoutFormat(o.layout)),o.style&&(r.config.style=o.style),o.required&&(r.config.main.required=!0),r.config.main.errorMessage=o.errorMessage,r},buildDownloadFile=(o,u)=>{const r=_.cloneDeep(downloadFile$1);return r.scope=u,o.layout&&(r.config.layout=o.layout),o.style&&(r.config.style=o.style),o.required&&(r.config.main.required=!0),o.layout&&(r.config.layout=createLayoutFormat(o.layout)),o.errorMessage&&(r.config.main.errorMessage=o.errorMessage),r};var Card={type:"WrapperLayout",config:{main:{rowSpacing:.5},style:{wrapperStyle:{position:"relative",color:"white",height:{xs:"120px",md:"160px"},width:"100%",textAlign:"left",background:"#3f51b5",borderRadius:"20px"}},layout:{xs:12,sm:12,md:6,lg:6}},elements:[{type:"Control",scope:"#/properties/programType",config:{main:{heading:"$5000.00"},style:{position:"absolute",left:"10%",top:"15%",color:"#f5effc",height:"80px",display:"flex",fontSize:{xs:"24px",md:"32px"},alignItems:"center",background:"inherit",justifyContent:"flex-start"},layout:5},options:{widget:"Box"}},{type:"Control",scope:"#/properties/programType",config:{main:{url:"$"},style:{color:"#f5effc",objectFit:"contain",position:"absolute",top:"10px",right:"10px",height:"80%",width:"35%",display:"flex",fontSize:"34px",alignItems:"center",background:"inherit",padding:"20px",justifyContent:"left"},layout:5},options:{widget:"Image"}},{type:"Control",scope:"#/properties/programType",config:{main:{heading:"Total Earnings"},style:{position:"absolute",top:"calc(60%)",alignItems:"center",color:"#8999e8",fontSize:"16px",left:"10%",background:"inherit",justifyContent:"center"},layout:12},options:{widget:"Box"}}]};const buildCard=(o,u)=>{const r=_.cloneDeep(Card);return o.style&&(r.config.style=JSON.parse(o.style)),r.elements[0].scope=`#/properties/${o.name}/properties/value`,r.elements[1].scope=`#/properties/${o.name}/properties/url`,r.elements[2].scope=`#/properties/${o.name}/properties/description`,o.layout&&(r.config.layout=createLayoutFormat(o.layout)),r};var DateInputField={type:"Control",scope:"#/properties/date",options:{widget:"DateInputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"",type:"date"}}};const buildDate=(o,u)=>{const r=_.cloneDeep(DateInputField);return r.config.main.label=o.label,r.config.main.errorMessage=`${o.name} is empty or invalid`,r.scope=u,o.layout&&(r.config.layout=createLayoutFormat(o.layout)),r};var RankCard={type:"Control",scope:"#/properties/path",options:{widget:"RankCard"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{}}};const buildRankCard=(o,u)=>{const r=_.cloneDeep(RankCard);return r.scope=u,o.image&&(r.config.main.url=o.image),o.title&&(r.config.main.title=o.title),o.description&&(r.config.main.description=o.description),o.rank&&(r.config.main.rank=`#${o.rank}`),o.layout&&(r.config.layout=createLayoutFormat(o.layout)),r};var RollAndDice={type:"Control",scope:"#/properties/path",options:{widget:"RollAndDice"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{}}};const buildRollAndDice=(o,u)=>{const r=_.cloneDeep(RollAndDice);return o.name&&(r.scope=u),o.layout&&(r.config.layout=createLayoutFormat(o.layout)),r};var Timer={type:"Control",scope:"#/properties/timer",options:{widget:"Timer"},config:{layout:{xs:12,sm:12,md:12,lg:12},main:{},style:{digitContainer:{borderRadius:"4px",textShawdow:"none",width:"22%"},container:{backgroundColor:"#FFFFFF",borderRadius:"18px"},containerLabelColor:{color:"red"}}}};const buildTimer=(o,u)=>{const r=_.cloneDeep(Timer);return r.scope=u,o.label&&(r.config.main.label=o.label),o.layout&&(r.config.layout=createLayoutFormat(o.layout)),r};var MultipleSelect={type:"Control",scope:"#/properties/path",options:{widget:"MultipleSelect"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"",type:"text",multiple:!0,variant:"standard",options:[]}}};const buildMultiSelect=(o,u)=>{const r=_.cloneDeep(MultipleSelect);if(r.scope=u,o.label&&(r.config.main.label=o.label),o.layout&&(r.config.layout=createLayoutFormat(o.layout)),o.value){const h=o.value.map(b=>({title:b.label,const:b.value}));r.config.main.options=h!=null?h:[]}return r},buildBasicUiSchema=o=>({type:"HorizontalLayout",pageName:`${o.name}`,elements:[]}),TextArea={type:"Control",scope:"#/properties/textarea",options:{widget:"TextArea"},config:{layout:{xs:12,sm:12,md:5.5,lg:5.5},style:{containerStyle:{borderRadius:"20px"},headerContainerStyle:{},textAreaStyle:{borderRadius:"20px",padding:"20px",background:"white",color:"black"}},main:{heading:"TextArea",minRows:4,hideButton:!0}}},buildTextArea=(o,u)=>{const r=_.cloneDeep(TextArea);return r.config.main.heading=o.label,o.layout&&(r.config.layout=createLayoutFormat(o.layout)),o.style&&(r.config.style=JSON.parse(o.style)),r.scope=u,r};var cardSlider={type:"Control",scope:"#/properties/path",options:{widget:"Slider"},elements:[],config:{layout:12,main:{}}};const buildSlider=(o,u)=>{const r=_.cloneDeep(cardSlider);return o.name&&(r.scope=u),o.layout&&(r.config.layout=createLayoutFormat(o.layout)),r},Checkbox={type:"Control",scope:"#/properties/username1",layout:12,options:{widget:"CheckBox"},config:{main:{label:"Welcome to Hyperform"}}},buildCheckbox=(o,u)=>{const r=_.cloneDeep(Checkbox);return r.scope=u,r.config.main.label=o.label,o.layout&&(r.config.layout=createLayoutFormat(o.layout)),o.style&&(r.config.style=JSON.parse(o.style)),r},buildLineGraph=(o,u)=>{const r=_.cloneDeep(LineGraph);return o.layout&&(r.config.layout=createLayoutFormat(o.layout)),r.config.main.header=o.heading,o.height&&(r.config.style.containerStyle.height=o.height),o.bottomLabel&&(r.config.main.bottomLabel=o.bottomLabel),o.leftLabel&&(r.config.main.leftLabel=o.leftLabel),o.legendHide&&(r.config.main.legendAvailabe=o.legendHide!=="YES"),o.legendLabels&&(r.config.main.tooltipDataKey=flatObjectValueInArray(o.legendLabels)),o.pieArcColors&&(r.config.style.lineStyle.colorRange=flatObjectValueInArray(o.pieArcColors)),r.scope=u,r},RadioUiSchema={type:"Control",scope:"#/properties/invoiceEnabled",options:{widget:"RadioInputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"Enabled",options:["YES","NO"],errorMessage:"Enabled is not marked as YES or NO"}}},buildRadio=(o,u)=>{const r=_.cloneDeep(RadioUiSchema);return r.scope=u,r.config.main.heading=o.label,o.layout&&(r.config.layout=createLayoutFormat(o.layout)),o.sectionLabels&&(r.config.main.options=o.sectionLabels.map(h=>h.label||h.Options)),o.style&&(r.config.style=JSON.parse(o.style)),r};var emptyBox={type:"Control",scope:"#/properties/emptyBox",options:{widget:"EmptyBox"},config:{layout:{xs:12,sm:12,md:5.5,lg:5.5},main:{},style:{}}};const buildEmptyBox=(o,u)=>{const r=_.cloneDeep(emptyBox);return o.layout&&(r.config.layout=createLayoutFormat(o.layout)),r};exports.schema={type:"object",properties:{},required:[]};function buildRule(o){o.validation&&o.validation.forEach(u=>{exports.schema.properties[o.name]||(exports.schema.properties[o.name]={}),u.validationType==="required"?exports.schema.required.push(o.name):(exports.schema.properties[o.name].type="string",exports.schema.properties[o.name][u.validationType]=isNaN(u.validationValue)?u.validationValue:Number(u.validationValue))})}const buildUiSchema=o=>{let u={};const r=`#/properties/${o.name}`;switch(o.type){case"RunnerBoyProgressBar":u=RunnerBoyProgressbar(o,r);break;case"TabSection":u=buildTabSection(o);break;case"WrapperSection":u=buildWrapperSection(o);break;case"Text":u=buildTextField(o,r),buildRule(o);break;case"TextArea":u=buildTextArea(o,r),buildRule(o);break;case"Date":u=buildDate(o,r),buildRule(o);break;case"Select":u=buildSelect(o,r),buildRule(o);break;case"Radio":u=buildRadio(o,r),buildRule(o);break;case"Button":u=buildButton(o,r),buildRule(o);break;case"Table":u=buildTable(o,r),buildRule(o);break;case"Box":u=buildLabel(o,r),buildRule(o);break;case"CheckBox":u=buildCheckbox(o,r),buildRule(o);break;case"UploadFile":u=buildUploadFile(o,r),buildRule(o);break;case"DownloadFile":u=buildDownloadFile(o,r),buildRule(o);break;case"EmptyBox":u=buildEmptyBox(o);break;case"card":u=buildCard(o);break;case"Graph":switch(o.graphType){case"BarGraph":case"StackBarGraph":u=buildStackbarGraph(o,r);break;case"LineGraph":u=buildLineGraph(o,r);break;case"PieGraph":u=buildPieGraph(o,r);break;case"HorizontalBarGraph":u=buildHorizontalBarGraph(o,r);break}break;case"ProgressBar":u=buildProgressBar(o,r);break;case"SpeedoMeter":u=buildSpeedoMeter(o,r);break;case"ProgressBarCard":u=buildProgressBarCard(o,r);break;case"RankCard":u=buildRankCard(o,r);break;case"Rank":u=buildRollAndDice(o,r);break;case"Slider":u=buildSlider(o,r);break;case"Timer":u=buildTimer(o,r);break;case"MultipleSelect":u=buildMultiSelect(o,r),buildRule(o);break;case"LeaderBoard":u=buildLeaderBoard(o);break;default:exports.schema={type:"object",properties:{},required:[]},u=buildBasicUiSchema(o)}if(o!=null&&o.elements){if((o==null?void 0:o.type)==="LeaderBoard")return u;o.type=="Table"?u.elements=o.elements.map((h,b)=>h.type?{accessorKey:h.name,header:h.label||h.name,widget:buildUiSchema(h)}:{accessorKey:h.name,header:h.label||h.name}):u.elements=o.elements.map((h,b)=>buildUiSchema(h))}return localStorage.setItem("libSchema",JSON.stringify(exports.schema||{})),u};var pageMaster=o=>{const{store:u,dynamicData:r,config:h,submitHandler:b}=o;return{setPage:async function(){const w=await this.getFormdata();u.setFormdata(w);const S=await this.getUiSchema(),O=await this.getSchema();u.setSchema(O),u.setUiSchema(S)},getFormdata:async function(){var S;(S=u.searchParams)==null||S.get("id");const w=getFormdataFromLocalStorage();return w||(saveFormdataInLocalStorage(h),h)},getUiSchema:async function(){return PageMasterUiSchema},getSchema:()=>PageMasterSchema,backHandler:()=>{localStorage.removeItem("pageFormdata"),u.navigate("/PageMasterRecords")},onAddClickHandler:async function(){var O;const w=(O=u.searchParams)==null?void 0:O.get("id");Array.isArray(u.formData.elements)||(u.formData.elements=[]);const S=saveFormdataInLocalStorage(u.formData);u.navigate(`/Component?path=${`elements[${S==null?void 0:S.elements.length}]`}&id=${w}`)},submitPageHandler:async function(){console.log(exports.schema),b(u,o.service).then(w=>{localStorage.removeItem("pageFormdata"),u.navigate(-1),u.setNotify({SuccessMessage:"Submit Successfully",Success:!0})})},Edit_Components:Component(u,r).editComponents,Delete_Components:Component(u,r).deleteComponents,eventAddHandler:async function(){var O;const w=(O=u.searchParams)==null?void 0:O.get("id");Array.isArray(u.formData.events)||(u.formData.events=[]),saveFormdataInLocalStorage(u.formData);const S=`events[${u.formData.events.length}]`;u.navigate(`/ComponentEvents?path=${S}&id=${w}`)},editEvent:async function(){var G;const w=r.path.split(".")[1],S=(G=u.searchParams)==null?void 0:G.get("id");saveFormdataInLocalStorage(u.formData);const O=`events[${w}]`;u.navigate(`/ComponentEvents?path=${O}&id=${S}`)},deleteEvent:async function(){const w=r.path.split(".")[1];u.formData.events.splice(w,1);const S=saveFormdataInLocalStorage(u.formData);u.setFormdata(S)}}};const EventSchema={type:"object",properties:{headers:{type:"array",items:{type:"object",properties:{headers_key:{type:"string"},headers_value:{type:"string"}}}},refreshElements:{type:"array",items:{type:"object",properties:{value:{type:"string"}}}},body:{type:"array",items:{type:"object",properties:{body_key:{type:"string"},body_value:{type:"string"}}}}}},EventUiSchema={type:"HorizontalLayout",elements:[{type:"WrapperLayout",config:{main:{rowSpacing:1,header:!0},defaultStyle:!0},elements:[{type:"Control",scope:"#/properties/Component",options:{widget:"Box"},config:{layout:{xs:12,sm:12,md:2},main:{heading:"Component"},style:{float:"left"}}},{type:"Control",scope:"#/properties/pageName",options:{widget:"Box"},config:{layout:{xs:7,sm:7,md:9},main:{heading:" "},style:{float:"right",width:"auto",fontSize:"12px",color:"gray",paddingTop:"10px"}}},{type:"Control",scope:"#/properties/Back_Button",options:{widget:"IconButton"},config:{layout:{xs:2,sm:2,md:.5},main:{icon:"BackIcon",styleDefault:!0,size:"small",onClick:"backHandler",tooltipMessage:"Back"},style:{float:"right"}}}]},{type:"TabLayout",config:{main:{tabLabels:["Core","Response Event"],defaultStyle:!0,id:"event"}},elements:[{type:"HorizontalLayout",elements:[{type:"Control",scope:"#/properties/eventType",options:{widget:"SelectInputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"Event Type",type:"text",options:[{title:"Click Event",const:"onClick"},{title:"onStart",const:"onStart"},{title:"Load Event",const:"onLoad"},{title:"Change Event",const:"onChange"},{title:"Success",const:"Success"},{title:"Fail",const:"Fail"}]}}},getSelectField("Handler","Handler",[{title:"Custom",const:"custom"},{title:"Api",const:"api"},{title:"Inbuilt Function",const:"inBuiltFunction"},{title:"Refresh",const:"refresh"}])]},{type:"WrapperLayout",config:{main:{divider:!0},wrapperStyle:{border:"1px solid gray"}},elements:[{type:"Control",scope:"#/properties/heading",options:{widget:"Box"},config:{layout:8,main:{heading:"Response Event"},style:{fontFamily:"Roboto",fontWeight:"500",paddingLeft:"-10px",fontSize:"20px"}}},{type:"Control",scope:"#/properties/AddButton",options:{widget:"IconButton"},config:{layout:3,main:{icon:"AddIcon",styleDefault:!0,size:"small",onClick:"addEvent",tooltipMessage:"Back"},style:{float:"right"}}},{type:"Control",scope:"#/properties/events",options:{widget:"Table"},config:{main:{disableAction:!0,disableSelection:!0,enableDrag:!0}},elements:[{accessorKey:"eventType",header:"Event Type"},{accessorKey:"Handler",header:"Handler"},{accessorKey:"Edit_Approve_Records",header:"Edit Widget",widget:{type:"Control",scope:"#/properties/Edit_Records",options:{widget:"IconButton"},config:{main:{color:"info",size:"small",icon:"EditIcon",tooltipMessage:"Edit This Record",onClick:"editEvent"},style:{color:"#3949ab"}}}},{accessorKey:"Reject_Records",header:"Delete",widget:{type:"Control",scope:"#/properties/RejectButton",options:{widget:"IconButton"},config:{main:{icon:"RejectIcon",color:"error",tooltipMessage:"Reject This Record",onClick:"deleteEvent"}}}}]}]}]},{type:"Control",scope:"#/properties/proc",config:{layout:{xs:11,sm:11,md:8,lg:8}},options:{widget:"EmptyBox"}},{type:"Control",scope:"#/properties/btn",options:{widget:"Button"},config:{layout:{xs:11,sm:11,md:3,lg:3},main:{name:"Save",startIcon:"ApproveIcon",variant:"contained",color:"info",type:"text",onClick:"saveHandler",size:"small"},style:{marginBottom:"8px",float:"right"}}},{type:"Control",scope:"#/properties/notify",options:{widget:"Notify"},layout:6}]},APISection={type:"HorizontalLayout",elements:[{type:"Control",scope:"#/properties/method",options:{widget:"SelectInputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"Method",type:"text",options:[{title:"Get",const:"get"},{title:"Post",const:"post"},{title:"Delete",const:"delete"},{title:"Put",const:"put"}]}}},{type:"Control",scope:"#/properties/path",options:{widget:"InputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"Path",type:"text",multiple:!1,options:[]}}},{type:"Control",scope:"#/properties/headers",layout:11.5,options:{elementLabelProp:"key",detail:{type:"HorizontalLayout",elements:[{type:"Control",scope:"#/properties/key",options:{widget:"InputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"Key"}}},{type:"Control",scope:"#/properties/value",options:{widget:"InputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"Value"}}}]}}},{type:"Control",scope:"#/properties/body",layout:11.5,options:{elementLabelProp:"key",detail:{type:"HorizontalLayout",elements:[{type:"Control",scope:"#/properties/key",options:{widget:"InputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"Key"}}},{type:"Control",scope:"#/properties/value",options:{widget:"InputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"Value"}}}]}}},getTextArea("apiBody","Transformer",!0,12)]},refreshSectionUiSchema={type:"HorizontalLayout",elements:[{type:"Control",scope:"#/properties/refreshElements",layout:11.5,options:{detail:{type:"HorizontalLayout",elements:[{type:"Control",scope:"#/properties/value",options:{widget:"InputField"},config:{layout:{xs:11,sm:11,md:5.5,lg:5.5},main:{label:"Value"}}}]}}}]};var event=(o,u)=>({setPage:async function(){const r=await this.getFormData();o.setFormdata(r);const h=await this.getSchema();o.setSchema(h),this.refreshPage(r.Handler,o)},refreshPage:(r,h)=>{const b=_.cloneDeep(EventUiSchema);r&&(r==="custom"?b.elements[1].elements[0].elements[2]=getTextArea("eventCode","Write Custom Code",!1):r==="api"?b.elements[1].elements[0].elements[2]=APISection:r==="inBuiltFunction"?(b.elements[1].elements[0].elements[2]=getSelectField("inBuiltFunctionType","Function Name",[{title:"RankProvider",const:"RankProvider"},{title:"Download File",const:"downloadFile"}]),b.elements[1].elements[0].elements[3]=getTextArea("funcParametersCode","Write Custom Code for Functions Parameter",!0,{xs:12,sm:12,md:6})):r==="refresh"&&(b.elements[1].elements[0].elements[2]=refreshSectionUiSchema)),h.setUiSchema(b)},getFormData:Component(o,u).getFormdata,getUiSchema:async function(){return EventUiSchema},getSchema:async()=>EventSchema,onChange:function(){var r,h,b;((r=o==null?void 0:o.formData)==null?void 0:r.Handler)!==((h=o==null?void 0:o.newData)==null?void 0:h.Handler)&&((b=o==null?void 0:o.newData)==null?void 0:b.Handler)!==void 0&&this.refreshPage(o.newData.Handler||o.formdata.Handler,o)},saveHandler:Component(o,u).saveHandler,addEvent:async function(){var b,w,S;const r=(b=o.searchParams)==null?void 0:b.get("path");Array.isArray(o.formData.events)||(o.formData.events=[]),saveFormdataInLocalStorage(o.formData,r);const h=`${r}.events[${(S=(w=o.formData)==null?void 0:w.events)==null?void 0:S.length}]`;o.searchParams.set("path",h),o.setSearchParams(o.searchParams),this.setPage()},editEvent:async function(){var w;const r=u.path.split(".")[1],h=(w=o.searchParams)==null?void 0:w.get("path");saveFormdataInLocalStorage(o.formData,h);const b=`${h}.events[${r}]`;o.searchParams.set("path",b),o.setSearchParams(o.searchParams),this.setPage()},deleteEvent:Component(o,u).deleteEvent,backHandler:function(){o.navigate(-1)}});const downloadFile=o=>{const u=o.name.split("."),r=o.data,h=window.atob(r);let b;b=new File([h],u[u.length-1]);const w=URL.createObjectURL(b),S=document.createElement("a");S.href=u[u.length-1]==="pdf"?"data:application/octet-stream;base64,"+r:w,S.download=`${o.name}`,document.body.appendChild(S),S.click(),URL.revokeObjectURL(w),document.body.removeChild(S)},executeEvents=async(o,u,r,h,b,w,S,O,G)=>{let j=[],V=null;if(o.eventType==="onLoad"){const{response:Y,events:he}=await executetOnLoadEvent(o,u,r,h,b,w,S,O,G);V=Y,j=he}else{if(!shouldEventExecute(o,u,r,h,b,w,S,O))return{response:void 0,events:void 0};const{response:Y,events:he}=await executeEventsHandler(o,u,r,h,b,w,S,O,G);V=Y,j=he}if((j==null?void 0:j.length)>0)for(const Y of j)await executeEvents(Y,u,r,h,b,w,S,O,V)},executetOnLoadEvent=async(o,u,r,h,b,w,S,O,G)=>{try{if(!shouldEventExecute(o,u,r,h,b,w,S,O))return{response:void 0,events:void 0};const{response:j}=await executeEventsHandler(o,u,r,h,b,w,S,O,G),V=o==null?void 0:o.events.filter(he=>he.eventType==="Success"),Y=V.length>0?V:[{Handler:"mergeFormdata",eventType:"Success",type:o.type}];return{response:j,events:Y}}catch{const V=o==null?void 0:o.events.filter(he=>he.eventType==="Fail"),Y=V.length>0?V:[];return{response:void 0,events:Y}}};async function executeEventsHandler(o,u,r,h,b,w,S,O,G){if(o.Handler==="api")return await executeApiEventHandler(o,u,r,h,b,w);if(o.Handler==="inBuiltFunction")return await executeInBuiltFunctionHandler(o,u,r,h,b,w,S,G);if(o.Handler==="custom")return await executeCustomHandler(o,u,r,h,b,w,S,G);if(o.Handler==="refresh")return await executeRefreshHandler(o,u,r,h,b,w,S,G,O);if(o.Handler==="mergeFormdata")return await mergeFormdata(G,u,o,r)}async function executeRefreshHandler(o,u,r,h,b,w,S,O,G){const j=getRefreshElements(o,G);for(const V of j)for(const Y of G.onLoad[V])await executeEvents(Y,V,r,h,b,w,S);return{response:void 0,events:void 0}}async function executeApiEventHandler(o,u,r,h,b,w,S,O){const G={...b==null?void 0:b.payload},j={"X-Requested-With":"XMLHttpRequest","Access-Control-Allow-Origin":"*"},{body:V,headers:Y}=await buildApiPayload(o,G,j,r,h,b);let he;return he=await w[o.method](o.path,V,Y&&{headers:Y}),{response:he,events:o==null?void 0:o.events}}async function executeInBuiltFunctionHandler(refreshHandlerConfig,componentName,store,dynamicData,userValue,service,serviceHolder,parentEventOutput){let parameter={};if(refreshHandlerConfig.funcParametersCode){const makeFunc=eval(refreshHandlerConfig.funcParametersCode);parameter=makeFunc(store,dynamicData,userValue,parentEventOutput,service)}return serviceHolder[refreshHandlerConfig.inBuiltFunctionType](parameter),{response:void 0,events:refreshHandlerConfig==null?void 0:refreshHandlerConfig.events}}async function executeCustomHandler(customHandlerConfig,componentName,store,dynamicData,userValue,service,serviceHolder,parentEventOutput){console.log(service);const makeFunc=eval(customHandlerConfig.eventCode),response=await makeFunc(store,dynamicData,userValue,parentEventOutput,service,componentName);return{response,events:customHandlerConfig==null?void 0:customHandlerConfig.events}}async function mergeFormdata(o,u,r,h){return r.type==="Select"&&!(_.isEmpty(o)&&o)?h.setSchema(b=>({...b,properties:{...b.properties,[u]:{oneOf:o.data}}})):r.type==="page"?h.setFormdata(b=>({...b,...o==null?void 0:o.data})):o&&h.setFormdata(b=>({...b,[u]:o.data})),{response:void 0,events:void 0}}const buildBodyFormat=(o,u,r)=>{const h={...r==null?void 0:r.payload};return o.map(b=>{var w,S;if((w=b==null?void 0:b.value)!=null&&w.startsWith("$userValue")){const O=b.value.substring(11);h[b.key]=_.get(r,O)}else if((S=b==null?void 0:b.value)!=null&&S.startsWith("$")){const O=b.value.substring(1);h[b.key]=_.get(u,O)}else h[b.key]=b.value}),h},buildHeadersFormat=o=>{const u={"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"};return o.map(r=>{u[r.key]=r.value}),u};async function shouldEventExecute(o,u,r,h,b,w,S,O){var j;const G=(j=o==null?void 0:o.events)==null?void 0:j.filter(V=>V.eventType==="onStart");if((G==null?void 0:G.length)>0){const{response:V}=await executeEventsHandler(G[0],u,r,h,b,w,S,O);return V}}async function buildApiPayload(compConfig,body,headers,store,dynamicData,userValue,service){var o,u;if(compConfig!=null&&compConfig.headers&&(headers=buildHeadersFormat(compConfig.headers)),compConfig.body&&(body={...buildBodyFormat(compConfig.body,store.newData||((u=(o=store==null?void 0:store.ctx)==null?void 0:o.core)==null?void 0:u.data)||store.formData,userValue)}),compConfig.apiBody){const makeFunc=eval(compConfig.apiBody),data=await makeFunc(store,dynamicData,userValue,body);body=data}return{body,headers}}function getRefreshElements(o,u){var h;let r=[];return((h=o==null?void 0:o.refreshElements)==null?void 0:h.length)>0?r=o.refreshElements.map(b=>b.value):u!=null&&u.onLoad&&(r=Object.keys(u==null?void 0:u.onLoad),r.push(r[0])),console.log(r),r}let compType,eventGroups={};const notifyUiSchema={type:"Control",scope:"#/properties/notify",options:{widget:"Notify"},layout:6},extractEvents=o=>{function u(r){r.events&&r.events.forEach(h=>{r.type&&(compType=r.type),eventGroups[h.eventType]||(eventGroups[h.eventType]={}),eventGroups[h.eventType][r.name]||(eventGroups[h.eventType][r.name]=[]),eventGroups[h.eventType][r.name].push({...h,type:compType})})}return u(o),o!=null&&o.elements&&o.elements.forEach(extractEvents),eventGroups};var service=o=>({setPage:async function(){o.store.setFormdata({}),eventGroups={},eventGroups=extractEvents(o.config),await executeEvents({Handler:"refresh",eventType:"onPageRefresh"},"all",o.store,o.dynamicData,o.userValue,o.service,this,eventGroups),o.store.setSchema(u=>({...o.schema,properties:{...o.schema.properties,...u.properties}})),o.uiSchema.elements.push(notifyUiSchema),o.store.setUiSchema(o.uiSchema)},onClick:async function(){var r;const u=((r=o.dynamicData)==null?void 0:r.tableButtonPath)||o.dynamicData.path.split(".")[0];for(const h of eventGroups==null?void 0:eventGroups.onClick[u])await executeEvents(h,u,o.store,o.dynamicData,o.userValue,o.service,this,eventGroups)},onChange:async function(){if(eventGroups.onChange){const u=Object.keys(eventGroups.onChange);Promise.all(u.map(async r=>{var h,b;if(((h=o.store)==null?void 0:h.formData[r])!==o.store.newData[r]&&((b=o.store)==null?void 0:b.newData[r])!==void 0)for(const w of eventGroups.onChange[r])await executeEvents(w,r,o.store,o.dynamicData,o.userValue,o.service,this,eventGroups)}))}},downloadFile});const schema={type:"object",properties:{},required:[]},buildSchema=o=>{function u(r){r.validation&&r.validation.forEach(h=>{schema.properties[r.name]||(schema.properties[r.name]={}),h.validationType==="required"?schema.required.push(r.name):(schema.properties[r.name].type="string",schema.properties[r.name][h.validationType]=isNaN(h.validationValue)?h.validationValue:Number(h.validationValue))})}return u(o),console.log(schema),window.localStorage.setItem("schemaDemo",JSON.stringify(schema)),schema};var clearLocalStorage=()=>{localStorage.removeItem("pageFormdata")};exports.buildConfig=buildConfig,exports.buildSchema=buildSchema,exports.buildUiSchema=buildUiSchema,exports.clearPreviousCache=clearLocalStorage,exports.pageMaster=pageMaster,exports.pageMasterComponents=Component,exports.pageMasterEvents=event,exports.pageService=service,Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
28
28
|
//# sourceMappingURL=impaktapps-ui-builder.umd.js.map
|