@nocobase/app 2.1.33 → 2.1.34
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/client/assets/{index-56b3a335.js → index-86ef5cb2.js} +4 -4
- package/dist/client/index.html +1 -1
- package/dist/client/index.html.tpl +1 -1
- package/dist/client/v/assets/{index-693e6f0a.js → index-1508b437.js} +3 -3
- package/dist/client/v/index.html +1 -1
- package/package.json +7 -7
- /package/dist/client/assets/{index-56b3a335.js.LICENSE.txt → index-86ef5cb2.js.LICENSE.txt} +0 -0
- /package/dist/client/v/assets/{index-693e6f0a.js.LICENSE.txt → index-1508b437.js.LICENSE.txt} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! For license information please see index-
|
|
1
|
+
/*! For license information please see index-1508b437.js.LICENSE.txt */
|
|
2
2
|
export const __rspack_esm_id="8410";export const __rspack_esm_ids=["8410"];export const __webpack_modules__={65359(e,t,l){var n={"./en-nz":["35571","4096"],"./bi.js":["95944","5905"],"./id.js":["87420","557"],"./km":["36101","7318"],"./he.js":["92010","1463"],"./me":["80623","3028"],"./tk":["62544","9065"],"./ko.js":["88003","4784"],"./tet.js":["18928","1481"],"./es-do":["61219","448"],"./ku":["16605","9518"],"./hr":["15811","9248"],"./zh-tw.js":["31349","3526"],"./hy-am":["94309","1846"],"./am.js":["4736","192"],"./en-in":["60912","3977"],"./de-at":["32878","3283"],"./pt-br":["92218","1863"],"./ar-iq.js":["13309","3102"],"./en-sg":["12673","1434"],"./zh":["56007","828"],"./en-il.js":["97690","8087"],"./lo":["73860","7141"],"./tlh":["60321","3978"],"./mi.js":["32739","4672"],"./el":["54072","9217"],"./ur.js":["51750","5819"],"./sq":["95977","4930"],"./pa-in.js":["39252","8053"],"./ar-kw.js":["79865","242"],"./fr-ca.js":["86290","4223"],"./de-ch.js":["13672","1329"],"./ru":["62796","6093"],"./eo.js":["33713","7386"],"./nb":["7205","630"],"./br":["72745","1586"],"./fo":["17674","791"],"./zh.js":["56007","828"],"./vi":["96098","8269"],"./fr-ch.js":["73433","5122"],"./ms-my":["26400","8473"],"./es-pr":["3532","9021"],"./bo.js":["59294","5123"],"./ht.js":["8809","4594"],"./lo.js":["73860","7141"],"./my.js":["46803","8480"],"./et":["4288","5881"],"./br.js":["72745","1586"],"./gu":["57409","474"],"./it-ch":["19286","1179"],"./sv-fi":["9160","9953"],"./ne.js":["40880","553"],"./zh-cn.js":["16033"],"./gom-latn.js":["78660","7669"],"./bg.js":["39990","1979"],"./mr.js":["46462","5459"],"./cv.js":["4780","5933"],"./lt.js":["34485","406"],"./pt":["72369","9578"],"./th.js":["47081","2258"],"./cs.js":["9751","4076"],"./es.js":["47317","70"],"./bn.js":["92509","2110"],"./ar-tn":["54405","6870"],"./mi":["32739","4672"],"./sr.js":["45616","3641"],"./tr":["4895","5108"],"./bn-bd":["64608","6345"],"./fa.js":["90292","7413"],"./it":["33900","1469"],"./nl":["69423","8676"],"./zh-hk":["87741","2622"],"./fo.js":["17674","791"],"./bs.js":["25530","8295"],"./ja.js":["50952","4801"],"./my":["46803","8480"],"./es-do.js":["61219","448"],"./gl":["33562","7095"],"./nl-be.js":["60465","6346"],"./en-ca.js":["21995","4456"],"./tzm-latn.js":["58804","2613"],"./types.d.ts":["69224","929"],"./ru.js":["62796","6093"],"./sq.js":["95977","4930"],"./cv":["4780","5933"],"./km.js":["36101","7318"],"./fa":["90292","7413"],"./cs":["9751","4076"],"./ms":["79677","2446"],"./types.d":["69224","929"],"./ca":["25993","9170"],"./tr.js":["4895","5108"],"./x-pseudo":["5760","8217"],"./tzm-latn":["58804","2613"],"./kn":["6364","93"],"./jv":["77741","4686"],"./ms-my.js":["26400","8473"],"./ht":["8809","4594"],"./be":["51532","8349"],"./gd":["68418","3039"],"./en-au":["59881","5861"],"./ka":["46481","9274"],"./ka.js":["46481","9274"],"./ur":["51750","5819"],"./sv.js":["21340","3309"],"./zh-cn":["16033"],"./pl.js":["63225","6914"],"./hi":["52830","3859"],"./ug-cn":["79911","3260"],"./ar-kw":["79865","242"],"./dv.js":["82187","5640"],"./id":["87420","557"],"./dv":["82187","5640"],"./vi.js":["96098","8269"],"./de-ch":["13672","1329"],"./en-in.js":["60912","3977"],"./es-pr.js":["3532","9021"],"./es-us.js":["32498","335"],"./ar-iq":["13309","3102"],"./fi.js":["89964","9565"],"./ca.js":["25993","9170"],"./ms.js":["79677","2446"],"./zh-tw":["31349","3526"],"./bs":["25530","8295"],"./rw.js":["35414","9592"],"./fy":["59836","2301"],"./uz-latn":["80950","8635"],"./mt.js":["99464","6241"],"./fr.js":["813","6062"],"./hu":["38298","183"],"./lv.js":["76467","8624"],"./sr-cyrl.js":["27439","3396"],"./tzl":["3187","896"],"./mn":["12698","8631"],"./pa-in":["39252","8053"],"./nl-be":["60465","6346"],"./kk":["11335","300"],"./en-tt":["2619","7608"],"./ar-ly.js":["85592","2913"],"./hr.js":["15811","9248"],"./kk.js":["11335","300"],"./ar":["2338","5791"],"./ar-dz.js":["48361","2322"],"./ar-sa":["40539","1848"],"./nl.js":["69423","8676"],"./cy":["95681","5757"],"./en-ie":["17329","58"],"./lb.js":["88615","8252"],"./ar-ly":["85592","2913"],"./de.js":["50494","7507"],"./am":["4736","192"],"./lv":["76467","8624"],"./tg":["15012","2565"],"./de-at.js":["32878","3283"],"./sl":["39998","4195"],"./tg.js":["15012","2565"],"./ky.js":["34457","3458"],"./kn.js":["6364","93"],"./bo":["59294","5123"],"./da":["42706","4767"],"./ss.js":["52487","492"],"./uz":["54734","7555"],"./fr-ch":["73433","5122"],"./sk":["46847","6660"],"./hu.js":["38298","183"],"./sr":["45616","3641"],"./he":["92010","1463"],"./uk.js":["34173","2270"],"./es-mx":["64719","9204"],"./se.js":["55285","8294"],"./oc-lnc":["70225","5642"],"./pt-br.js":["92218","1863"],"./rw":["35414","9592"],"./ar-sa.js":["40539","1848"],"./nb.js":["7205","630"],"./fr-ca":["86290","4223"],"./hi.js":["52830","3859"],"./gl.js":["33562","7095"],"./en-ie.js":["17329","58"],"./me.js":["80623","3028"],"./fy.js":["59836","2301"],"./ar.js":["2338","5791"],"./az":["51130","9847"],"./lt":["34485","406"],"./en":["65826","5087"],"./ro.js":["24334","5139"],"./sw":["2979","9584"],"./te.js":["87406","4419"],"./tl-ph.js":["78142","1667"],"./es-mx.js":["64719","9204"],"./ky":["34457","3458"],"./it.js":["33900","1469"],"./zh-hk.js":["87741","2622"],"./da.js":["42706","4767"],"./te":["87406","4419"],"./mt":["99464","6241"],"./lb":["88615","8252"],"./uz-latn.js":["80950","8635"],"./ml.js":["75376","8729"],"./en-sg.js":["12673","1434"],"./uz.js":["54734","7555"],"./tzm.js":["95084","1101"],"./tet":["18928","1481"],"./oc-lnc.js":["70225","5642"],"./az.js":["51130","9847"],"./en-au.js":["59881","5861"],"./fr":["813","6062"],"./gd.js":["68418","3039"],"./yo.js":["87933","5870"],"./nn":["23473","5674"],"./bm":["71092","5701"],"./index.d.ts":["41213","9550"],"./sw.js":["2979","9584"],"./af":["65662","3523"],"./en-il":["97690","8087"],"./eu":["94007","1052"],"./et.js":["4288","5881"],"./rn":["34509","2606"],"./se":["55285","8294"],"./sv-fi.js":["9160","9953"],"./gu.js":["57409","474"],"./gom-latn":["78660","7669"],"./pl":["63225","6914"],"./ar-dz":["48361","2322"],"./ar-ma":["81289","1986"],"./eu.js":["94007","1052"],"./ss":["52487","492"],"./tk.js":["62544","9065"],"./es-us":["32498","335"],"./bi":["95944","5905"],"./ug-cn.js":["79911","3260"],"./mn.js":["12698","8631"],"./pt.js":["72369","9578"],"./cy.js":["95681","5757"],"./mr":["46462","5459"],"./ga.js":["54061","3646"],"./ko":["88003","4784"],"./ku.js":["16605","9518"],"./af.js":["65662","3523"],"./hy-am.js":["94309","1846"],"./es":["47317","70"],"./ml":["75376","8729"],"./en-ca":["21995","4456"],"./bn":["92509","2110"],"./ga":["54061","3646"],"./is.js":["15513","5506"],"./sd.js":["63222","1675"],"./sl.js":["39998","4195"],"./tlh.js":["60321","3978"],"./tl-ph":["78142","1667"],"./uk":["34173","2270"],"./x-pseudo.js":["5760","8217"],"./is":["15513","5506"],"./jv.js":["77741","4686"],"./el.js":["54072","9217"],"./fi":["89964","9565"],"./bn-bd.js":["64608","6345"],"./en-gb":["72026","8759"],"./en-gb.js":["72026","8759"],"./mk":["75877","4358"],"./ne":["40880","553"],"./ro":["24334","5139"],"./mk.js":["75877","4358"],"./si":["65665","3898"],"./tzm":["95084","1101"],"./be.js":["51532","8349"],"./de":["50494","7507"],"./rn.js":["34509","2606"],"./si.js":["65665","3898"],"./yo":["87933","5870"],"./bg":["39990","1979"],"./en.js":["65826","5087"],"./sv":["21340","3309"],"./th":["47081","2258"],"./bm.js":["71092","5701"],"./nn.js":["23473","5674"],"./ar-ma.js":["81289","1986"],"./index.d":["41213","9550"],"./ja":["50952","4801"],"./ta.js":["77250","1887"],"./ar-tn.js":["54405","6870"],"./sd":["63222","1675"],"./sk.js":["46847","6660"],"./tzl.js":["3187","896"],"./en-nz.js":["35571","4096"],"./eo":["33713","7386"],"./ta":["77250","1887"],"./en-tt.js":["2619","7608"],"./it-ch.js":["19286","1179"],"./sr-cyrl":["27439","3396"]};function r(e){if(!l.o(n,e))return Promise.resolve().then(function(){var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=n[e],r=t[0];return Promise.all(t.slice(1).map(l.e)).then(function(){return l.t(r,23)})}r.keys=()=>Object.keys(n),r.id=65359,e.exports=r},35358(e,t,l){var n={"./af":"25177","./af.js":"25177","./ar":"61509","./ar-dz":"41488","./ar-dz.js":"41488","./ar-kw":"58676","./ar-kw.js":"58676","./ar-ly":"42353","./ar-ly.js":"42353","./ar-ma":"24496","./ar-ma.js":"24496","./ar-sa":"82682","./ar-sa.js":"82682","./ar-tn":"89756","./ar-tn.js":"89756","./ar.js":"61509","./az":"95533","./az.js":"95533","./be":"28959","./be.js":"28959","./bg":"47777","./bg.js":"47777","./bm":"54903","./bm.js":"54903","./bn":"61290","./bn-bd":"17357","./bn-bd.js":"17357","./bn.js":"61290","./bo":"31545","./bo.js":"31545","./br":"11470","./br.js":"11470","./bs":"44429","./bs.js":"44429","./ca":"7306","./ca.js":"7306","./cs":"56464","./cs.js":"56464","./cv":"73635","./cv.js":"73635","./cy":"64226","./cy.js":"64226","./da":"93601","./da.js":"93601","./de":"77853","./de-at":"26111","./de-at.js":"26111","./de-ch":"54697","./de-ch.js":"54697","./de.js":"77853","./dv":"60708","./dv.js":"60708","./el":"54691","./el.js":"54691","./en-au":"53872","./en-au.js":"53872","./en-ca":"28298","./en-ca.js":"28298","./en-gb":"56195","./en-gb.js":"56195","./en-ie":"66584","./en-ie.js":"66584","./en-il":"65543","./en-il.js":"65543","./en-in":"9033","./en-in.js":"9033","./en-nz":"79402","./en-nz.js":"79402","./en-sg":"43004","./en-sg.js":"43004","./eo":"32934","./eo.js":"32934","./es":"97650","./es-do":"20838","./es-do.js":"20838","./es-mx":"17730","./es-mx.js":"17730","./es-us":"56575","./es-us.js":"56575","./es.js":"97650","./et":"3035","./et.js":"3035","./eu":"3508","./eu.js":"3508","./fa":"119","./fa.js":"119","./fi":"90527","./fi.js":"90527","./fil":"95995","./fil.js":"95995","./fo":"52477","./fo.js":"52477","./fr":"85498","./fr-ca":"26435","./fr-ca.js":"26435","./fr-ch":"37892","./fr-ch.js":"37892","./fr.js":"85498","./fy":"37071","./fy.js":"37071","./ga":"41734","./ga.js":"41734","./gd":"70217","./gd.js":"70217","./gl":"77329","./gl.js":"77329","./gom-deva":"32124","./gom-deva.js":"32124","./gom-latn":"93383","./gom-latn.js":"93383","./gu":"95050","./gu.js":"95050","./he":"11713","./he.js":"11713","./hi":"43861","./hi.js":"43861","./hr":"26308","./hr.js":"26308","./hu":"90609","./hu.js":"90609","./hy-am":"17160","./hy-am.js":"17160","./id":"74063","./id.js":"74063","./is":"89374","./is.js":"89374","./it":"88383","./it-ch":"21827","./it-ch.js":"21827","./it.js":"88383","./ja":"23827","./ja.js":"23827","./jv":"89722","./jv.js":"89722","./ka":"41794","./ka.js":"41794","./kk":"27088","./kk.js":"27088","./km":"96870","./km.js":"96870","./kn":"84451","./kn.js":"84451","./ko":"63164","./ko.js":"63164","./ku":"98174","./ku.js":"98174","./ky":"78474","./ky.js":"78474","./lb":"79680","./lb.js":"79680","./lo":"15867","./lo.js":"15867","./lt":"45766","./lt.js":"45766","./lv":"69532","./lv.js":"69532","./me":"58076","./me.js":"58076","./mi":"41848","./mi.js":"41848","./mk":"30306","./mk.js":"30306","./ml":"73739","./ml.js":"73739","./mn":"99053","./mn.js":"99053","./mr":"86169","./mr.js":"86169","./ms":"73386","./ms-my":"92297","./ms-my.js":"92297","./ms.js":"73386","./mt":"77075","./mt.js":"77075","./my":"72264","./my.js":"72264","./nb":"22274","./nb.js":"22274","./ne":"8235","./ne.js":"8235","./nl":"92572","./nl-be":"43784","./nl-be.js":"43784","./nl.js":"92572","./nn":"54566","./nn.js":"54566","./oc-lnc":"69330","./oc-lnc.js":"69330","./pa-in":"29849","./pa-in.js":"29849","./pl":"94418","./pl.js":"94418","./pt":"79834","./pt-br":"48303","./pt-br.js":"48303","./pt.js":"79834","./ro":"24457","./ro.js":"24457","./ru":"82271","./ru.js":"82271","./sd":"1221","./sd.js":"1221","./se":"33478","./se.js":"33478","./si":"17538","./si.js":"17538","./sk":"5784","./sk.js":"5784","./sl":"46637","./sl.js":"46637","./sq":"86794","./sq.js":"86794","./sr":"45719","./sr-cyrl":"3322","./sr-cyrl.js":"3322","./sr.js":"45719","./ss":"56000","./ss.js":"56000","./sv":"41011","./sv.js":"41011","./sw":"40748","./sw.js":"40748","./ta":"11025","./ta.js":"11025","./te":"11885","./te.js":"11885","./tet":"28861","./tet.js":"28861","./tg":"86571","./tg.js":"86571","./th":"55802","./th.js":"55802","./tk":"59527","./tk.js":"59527","./tl-ph":"29231","./tl-ph.js":"29231","./tlh":"31052","./tlh.js":"31052","./tr":"85096","./tr.js":"85096","./tzl":"79846","./tzl.js":"79846","./tzm":"81765","./tzm-latn":"97711","./tzm-latn.js":"97711","./tzm.js":"81765","./ug-cn":"48414","./ug-cn.js":"48414","./uk":"16618","./uk.js":"16618","./ur":"57777","./ur.js":"57777","./uz":"57609","./uz-latn":"72475","./uz-latn.js":"72475","./uz.js":"57609","./vi":"21135","./vi.js":"21135","./x-pseudo":"64051","./x-pseudo.js":"64051","./yo":"82218","./yo.js":"82218","./zh-cn":"52648","./zh-cn.js":"52648","./zh-hk":"1632","./zh-hk.js":"1632","./zh-mo":"31541","./zh-mo.js":"31541","./zh-tw":"50304","./zh-tw.js":"50304"};function r(e){return l(i(e))}function i(e){if(!l.o(n,e)){var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}r.keys=function(){return Object.keys(n)},r.resolve=i,e.exports=r,r.id=35358},35963(e,t,l){let n,r,i;var o,a,s,d,u,c,p,h,m,f={};l.r(f),l.d(f,{default:()=>iL,evaluators:()=>i$,getOptions:()=>iB});var g={};l.r(g),l.d(g,{array:()=>i7,bigField:()=>od,boolean:()=>oo,collection:()=>os,datetime:()=>ot,enumType:()=>or,id:()=>on,number:()=>ol,object:()=>oe,string:()=>i9,tableoid:()=>oa,time:()=>oi});var v={};l.r(v),l.d(v,{connectFields:()=>hT,customizeFilterRender:()=>hz,defaultOperator:()=>hB,operatorComponentProps:()=>hU});var y={};l.r(y),l.d(y,{ASSIGN_FIELD_VALUES_STEP_KEY:()=>uo.zL,ActionGroupModel:()=>sN,ActionModel:()=>sB.S0,ActionSceneEnum:()=>sB.s5,ActionWithoutPermission:()=>sB._T,AddChildActionModel:()=>uD,AddNewActionModel:()=>dW,AssignFormGridModel:()=>uV,AssignFormItemModel:()=>ce,AssignFormModel:()=>u$,AssociateActionModel:()=>d2,AssociationFieldGroupModel:()=>sL,AssociationFieldModel:()=>cg,BasePageTabModel:()=>d$,BlockGridModel:()=>dv,BlockModel:()=>dy.z,BlockSceneEnum:()=>dy.P,BulkDeleteActionModel:()=>d5,CascadeSelectFieldModel:()=>g2,CascadeSelectInnerFieldModel:()=>g0,CascadeSelectListFieldModel:()=>g5,CheckboxFieldModel:()=>vw,CheckboxGroupFieldModel:()=>vS,ChildPageModel:()=>dE,ChildPageTabModel:()=>dL,ClickableFieldModel:()=>gV,CollectionActionGroupModel:()=>sO,CollectionActionModel:()=>db.U,CollectionBlockModel:()=>dx.t,CollectionSelectorFieldModel:()=>vF,ColorFieldModel:()=>vP,CommonItemModel:()=>dw,CreateContent:()=>cq,CreateFormModel:()=>hH,CustomWidth:()=>mK,DataBlockModel:()=>dS.R,DateOnlyFieldModel:()=>vL,DateOnlyFilterFieldModel:()=>c5,DateOnlyPicker:()=>vB,DateTimeFilterFieldModel:()=>c1,DateTimeNoTzFieldModel:()=>vq,DateTimeNoTzFilterFieldModel:()=>c8,DateTimeNoTzPicker:()=>vV,DateTimeTzFieldModel:()=>vW,DateTimeTzFilterFieldModel:()=>c6,DateTimeTzPicker:()=>vU,DeleteActionModel:()=>d4,DetailsAssociationFieldGroupModel:()=>ct,DetailsBlockModel:()=>ci,DetailsCustomItemModel:()=>ca,DetailsGridModel:()=>cs,DetailsItemModel:()=>uJ,DetailsJSFieldItemModel:()=>ch,DisassociateActionModel:()=>d8,DisplayCheckboxFieldModel:()=>bN,DisplayColorFieldModel:()=>bi,DisplayDateTimeFieldModel:()=>bs,DisplayEnumFieldModel:()=>bp,DisplayHtmlFieldModel:()=>bm,DisplayIconFieldModel:()=>bf,DisplayJSONFieldModel:()=>by,DisplayNumberFieldModel:()=>bP,DisplayPasswordFieldModel:()=>bE,DisplayPercentFieldModel:()=>bR,DisplaySubItemFieldModel:()=>be,DisplaySubListFieldModel:()=>br,DisplaySubTableFieldModel:()=>y7,DisplayTextFieldModel:()=>bI,DisplayTimeFieldModel:()=>b_,DisplayTitleFieldModel:()=>y4,DisplayURLFieldModel:()=>bT,DividerItemModel:()=>yJ,EditActionModel:()=>d3,EditFormContent:()=>vr,EditFormModel:()=>uX.EditFormModel,ExpandCollapseActionModel:()=>uI,FieldDeletePlaceholder:()=>mL,FieldModel:()=>aC.o,FieldModelSelect:()=>pu,FieldOperatorSelect:()=>pP,FilterActionModel:()=>d7,FilterBlockModel:()=>dM,FilterFormActionGroupModel:()=>pK,FilterFormActionModel:()=>pz,FilterFormBlockModel:()=>hi,FilterFormCollapseActionModel:()=>hu,FilterFormCustomFieldModel:()=>p_,FilterFormCustomItemModel:()=>pj,FilterFormCustomRecordSelectFieldModel:()=>pq,FilterFormFieldModel:()=>cm,FilterFormGridModel:()=>hk,FilterFormItemModel:()=>hF,FilterFormJSActionModel:()=>hC,FilterFormRecordSelectFieldModel:()=>cZ,FilterFormResetActionModel:()=>hP,FilterFormSubmitActionModel:()=>hj,FilterManager:()=>s8,FormActionGroupModel:()=>uu,FormActionModel:()=>us,FormAssociationFieldGroupModel:()=>me,FormAssociationItemModel:()=>mo,FormBlockContent:()=>uO.JU,FormBlockModel:()=>uO.F4,FormComponent:()=>uO.s2,FormCustomItemModel:()=>hG,FormGridModel:()=>uB,FormItemModel:()=>u5,FormJSFieldItemModel:()=>hY,FormModel:()=>uO.mO,FormSubmitActionModel:()=>ud,GRID_FLOW_KEY:()=>ds,GRID_STEP:()=>dd,GridModel:()=>dc,IconFieldModel:()=>vX,InputFieldModel:()=>vQ.m,InputNumberField:()=>ye,JSActionModel:()=>ur,JSBlockModel:()=>mv,JSCollectionActionModel:()=>ui,JSColumnModel:()=>fk,JSEditableFieldModel:()=>yW,JSFieldModel:()=>y_,JSFormActionModel:()=>hJ,JSItemActionModel:()=>uf,JSItemModel:()=>y2,JSRecordActionModel:()=>ug,JsonFieldModel:()=>n,JsonInput:()=>v3,LinkActionModel:()=>uR,MainPageModel:()=>dT,MarkdownItemModel:()=>y1,NBColorPicker:()=>vC,NumberFieldModel:()=>yt,ObjectNester:()=>gA,PageModel:()=>dP,PageTabModel:()=>dV,PasswordFieldModel:()=>yl,PercentFieldModel:()=>yo,PercentInput:()=>yi,PluginSettingsTopbarActionModel:()=>nN,PopupActionModel:()=>dK,PopupCollectionActionModel:()=>uv,PopupSubTableActionGroupModel:()=>vm,PopupSubTableActionsColumnModel:()=>vv,PopupSubTableEditActionModel:()=>vo,PopupSubTableFieldModel:()=>vp,PopupSubTableFormActionGroupModel:()=>uh,PopupSubTableFormModel:()=>vy,PopupSubTableFormSubmitActionModel:()=>up,PopupSubTableRemoveActionModel:()=>vh,QUICK_EDIT_FORM_MAX_HEIGHT:()=>hQ,QUICK_EDIT_MARKDOWN_HEIGHT:()=>hZ,QUICK_EDIT_POPOVER_MAX_HEIGHT:()=>hX,QuickEditFormModel:()=>h7,RadioGroupFieldModel:()=>ya,RecordActionGroupModel:()=>s$,RecordActionModel:()=>dU.L,RecordPickerContent:()=>fZ,RecordPickerFieldModel:()=>f1,RecordSelectFieldModel:()=>cH,RefreshActionModel:()=>uy,RichTextField:()=>yg,RichTextFieldModel:()=>r,RootPageModel:()=>dq,RootPageTabModel:()=>dB,RouteModel:()=>em,SelectFieldModel:()=>yM,SourceCascader:()=>pR,SubFormFieldModel:()=>gF,SubFormListFieldModel:()=>gC,SubPageModel:()=>dz,SubTableColumnModel:()=>gp,SubTableFieldModel:()=>gw,SubTableRecordAction:()=>vi,TABLE_COLUMN_MIN_WIDTH:()=>mq,TableActionsColumnModel:()=>mZ,TableAssociationFieldGroupModel:()=>m0,TableBlockModel:()=>fg,TableColumnModel:()=>mW,TableCustomColumnModel:()=>mH,TableJSFieldItemModel:()=>fA,TableSelectModel:()=>fM,TextareaFieldModel:()=>i,TimeFieldModel:()=>yR,TopbarActionModel:()=>nE,UIEditorTopbarActionModel:()=>nD,USER_CENTER_ACTION_ID:()=>nO,UnitConversion:()=>bj,UpdateRecordActionModel:()=>uA,UserCenterActionItemModel:()=>nW,UserCenterItemModel:()=>nK,UserCenterSelectItemModel:()=>nH,UserCenterTextItemModel:()=>nU,UserCenterTopbarActionModel:()=>nZ,VariableFieldFormModel:()=>yI,ViewActionModel:()=>uF,applyAssociateAction:()=>dZ,applyClickToOpenProps:()=>g$,applyClickToOpenSetting:()=>gL,applyDisassociateAction:()=>dQ,buildDisplayPathFromValue:()=>gG,buildRecordPickerParentItemContext:()=>fY,buildRecordPickerPopupContextInputArgs:()=>fX,canRecordPickerSelectMultiple:()=>fq,collectAssociationHydrationCandidates:()=>cO,collectCascadeHydrationCandidate:()=>gW,connectFields:()=>hT,createAssignFieldValuesStep:()=>uo.KW,createAssignFormSubModelOptions:()=>uo.nF,customizeFilterRender:()=>hz,defaultOperator:()=>hB,findOptionPathByTk:()=>gY,formatNumber:()=>bk,getAllDataModels:()=>sZ,getAssignFieldValuesDefaultParams:()=>uo.Z1,getAssociationBlockResourceSettings:()=>dH,getAssociationHydrationNamePath:()=>c$,getAssociationHydrationSetterContext:()=>cB,getAssociationSelectAssociatedRecordsFilter:()=>fS,getAssociationSelectForeignKeyFilter:()=>fw,getAssociationSelectorContextInputArgs:()=>dJ,getAssociationTargetResourceSettings:()=>dY,getDefaultOperator:()=>sX,getDetailsItemValue:()=>uG,getDisplayNumber:()=>bC,getFilterFormOperatorList:()=>sY,getFilterFormOperatorMeta:()=>sJ,getQuickEditFieldProps:()=>h8,getRecordPickerClearedValue:()=>fW,getRecordPickerEmptyValue:()=>fU,getTopbarPluginSettingsItems:()=>nj,getValueWithIndex:()=>uH,injectRecordPickerPopupContext:()=>fJ,isAssociationBlockContext:()=>dG,isFilterValueEmpty:()=>sQ,joinUrlSearch:()=>uC,markCascadeHydrationDone:()=>gH,mergeAssignFieldValues:()=>uo.GO,normalizeRecordPickerSelectedRows:()=>fK,normalizeRecordPickerValue:()=>fH,normalizeTableColumnWidth:()=>mz,operatorComponentProps:()=>hU,recalculateGridSizes:()=>dh,refreshClickToOpenRuntime:()=>gB,resolveAssignFieldValues:()=>uo.eu,resolveCustomFieldOperatorList:()=>pF,resolveDefaultCustomFieldOperator:()=>pk,shouldClearRecordPickerValueOnMultipleChange:()=>fz,tableRowActionsClassName:()=>mJ,toOperatorSelectOptions:()=>pC,transformNestedData:()=>g_,transformRowsToSingleColumn:()=>dp});var b={};l.r(b),l.d(b,{aclCheck:()=>xF,aclCheckRefresh:()=>xE,actionLinkageRules:()=>Sw,afterSuccess:()=>aA,blockHeight:()=>wb,blockLinkageRules:()=>Sx,confirm:()=>aF,customVariable:()=>b5,dataLoadingMode:()=>xv,dataScope:()=>sT,dateRangeLimit:()=>xm,dateTimeFormat:()=>xc,detailsFieldLinkageRules:()=>SF,displayFieldComponent:()=>xS,fieldComponent:()=>xM,fieldLinkageRules:()=>SM,filterFormDefaultValues:()=>wm,fixed:()=>xO,formAssignRules:()=>wp,layout:()=>xb,linkageAssignField:()=>Sh,linkageRulesRefresh:()=>wf,linkageRunjs:()=>Sf,linkageSetActionProps:()=>Se,linkageSetBlockProps:()=>w7,linkageSetDetailsFieldProps:()=>Sr,linkageSetFieldProps:()=>Sl,linkageSetMenuItemProps:()=>St,menuLinkageRules:()=>SS,navigateToURL:()=>b1,numberFormat:()=>Sj,openView:()=>bH,overflowMode:()=>SC,pattern:()=>x_,refreshTargetBlocks:()=>b9,renderMode:()=>xy,required:()=>xx,runjs:()=>bG,setTargetDataScope:()=>xr,showMessage:()=>bX,showNotification:()=>b0,sortingRule:()=>xg,subFormFieldLinkageRules:()=>SA,subFormLinkageAssignField:()=>Sm,subFormLinkageSetFieldProps:()=>Sn,titleField:()=>xs,validation:()=>xN});var x={};l.r(x),l.d(x,{ACLContext:()=>ne.w0,ACLRolesCheckProvider:()=>ne.rR,ADMIN_LAYOUT_MODEL_UID:()=>tS,ADMIN_SETTINGS_KEY:()=>o6.w$,ADMIN_SETTINGS_LAYOUT_MODEL_UID:()=>nS.O,ADMIN_SETTINGS_PATH:()=>o6.wq,AIManager:()=>ei,APIClient:()=>k,ASSIGN_FIELD_VALUES_STEP_KEY:()=>uo.zL,ActionGroupModel:()=>sN,ActionModel:()=>sB.S0,ActionSceneEnum:()=>sB.s5,ActionWithoutPermission:()=>sB._T,AddChildActionModel:()=>uD,AddNewActionModel:()=>dW,AdminLayoutComponent:()=>rk,AdminLayoutContent:()=>l4,AdminLayoutMenuItemModel:()=>lq,AdminLayoutMenuItemRenderer:()=>lp,AdminLayoutMenuModelRenderer:()=>lf,AdminLayoutModel:()=>r$,AdminLayoutRouteCoordinator:()=>tw,AdminSettingsLayout:()=>Mg.AdminSettingsLayout,AdminSettingsLayoutModel:()=>Mv.C,AntdAppProvider:()=>W,AppError:()=>ea.uV,AppMaintaining:()=>ea.be,AppMaintainingDialog:()=>ea.tp,AppNotFound:()=>ea.bM,AppSpin:()=>ea.gv,Application:()=>aa,ApplicationContext:()=>as,ApplicationModel:()=>i3,AssignFormGridModel:()=>uV,AssignFormItemModel:()=>ce,AssignFormModel:()=>u$,AssociateActionModel:()=>d2,AssociationFieldGroupModel:()=>sL,AssociationFieldModel:()=>cg,BaseApplication:()=>i5,BaseLayoutModel:()=>eB,BaseLayoutRouteCoordinator:()=>eM,BasePageTabModel:()=>d$,BlankComponent:()=>ea.ct,BlockGridModel:()=>dv,BlockModel:()=>dy.z,BlockSceneEnum:()=>dy.P,BulkDeleteActionModel:()=>d5,CascadeSelectFieldModel:()=>g2,CascadeSelectInnerFieldModel:()=>g0,CascadeSelectListFieldModel:()=>g5,CheckboxFieldInterface:()=>M2,CheckboxFieldModel:()=>vw,CheckboxGroupFieldInterface:()=>M5,CheckboxGroupFieldModel:()=>vS,ChildPageModel:()=>dE,ChildPageTabModel:()=>dL,ClickableFieldModel:()=>gV,CodeEditor:()=>ul.BY,CodeEditorExtension:()=>ul.o8,CodeScanner:()=>ea.O5,CollectionActionGroupModel:()=>sO,CollectionActionModel:()=>db.U,CollectionBlockModel:()=>dx.t,CollectionFieldInterface:()=>M1,CollectionFieldInterfaceManager:()=>oH,CollectionFilter:()=>ea.px,CollectionFilterPanel:()=>ea.XO,CollectionSelect:()=>ob,CollectionSelectFieldInterface:()=>M4,CollectionSelectorFieldModel:()=>vF,ColorFieldInterface:()=>M8,ColorFieldModel:()=>vP,CommonItemModel:()=>dw,CreateContent:()=>cq,CreateFormModel:()=>hH,CreatedAtFieldInterface:()=>M3,CreatedByFieldInterface:()=>M6,CurrentUserContext:()=>MD,CustomWidth:()=>mK,DEFAULT_DATA_SOURCE_KEY:()=>tr.Ze,DEFAULT_PAGE_SIZE:()=>ea.yQ,DataBlockModel:()=>dS.R,DateFieldInterface:()=>AR,DateOnlyFieldModel:()=>vL,DateOnlyFilterFieldModel:()=>c5,DateOnlyPicker:()=>vB,DateTimeFilterFieldModel:()=>c1,DateTimeNoTzFieldModel:()=>vq,DateTimeNoTzFilterFieldModel:()=>c8,DateTimeNoTzPicker:()=>vV,DateTimeTzFieldModel:()=>vW,DateTimeTzFilterFieldModel:()=>c6,DateTimeTzPicker:()=>vU,DatetimeFieldInterface:()=>M9,DatetimeNoTzFieldInterface:()=>AI,DefaultToolsManager:()=>er,DeleteActionModel:()=>d4,DetailsAssociationFieldGroupModel:()=>ct,DetailsBlockModel:()=>ci,DetailsCustomItemModel:()=>ca,DetailsGridModel:()=>cs,DetailsItemModel:()=>uJ,DetailsJSFieldItemModel:()=>ch,DialogFormLayout:()=>ea.xg,DisassociateActionModel:()=>d8,DisplayCheckboxFieldModel:()=>bN,DisplayColorFieldModel:()=>bi,DisplayDateTimeFieldModel:()=>bs,DisplayEnumFieldModel:()=>bp,DisplayHtmlFieldModel:()=>bm,DisplayIconFieldModel:()=>bf,DisplayJSONFieldModel:()=>by,DisplayNumberFieldModel:()=>bP,DisplayPasswordFieldModel:()=>bE,DisplayPercentFieldModel:()=>bR,DisplaySubItemFieldModel:()=>be,DisplaySubListFieldModel:()=>br,DisplaySubTableFieldModel:()=>y7,DisplayTextFieldModel:()=>bI,DisplayTimeFieldModel:()=>b_,DisplayTitleFieldModel:()=>y4,DisplayURLFieldModel:()=>bT,DividerItemModel:()=>yJ,DragSortRowContext:()=>ea.c5,DrawerFormLayout:()=>ea.gh,EditActionModel:()=>d3,EditFormContent:()=>vr,EditFormModel:()=>uX.EditFormModel,EmailFieldInterface:()=>M7,EnvVariableInput:()=>ea.s9,ExpandCollapseActionModel:()=>uI,ExtendCollectionsProvider:()=>AN,FieldDeletePlaceholder:()=>mL,FieldFilterOperatorRegistry:()=>ou,FieldModel:()=>aC.o,FieldModelSelect:()=>pu,FieldOperatorSelect:()=>pP,FieldValidationConfigureRegistry:()=>oq,FileSizeInput:()=>ea.c,FilterActionModel:()=>d7,FilterBlockModel:()=>dM,FilterContent:()=>ak.oJ,FilterFormActionGroupModel:()=>pK,FilterFormActionModel:()=>pz,FilterFormBlockModel:()=>hi,FilterFormCollapseActionModel:()=>hu,FilterFormCustomFieldModel:()=>p_,FilterFormCustomItemModel:()=>pj,FilterFormCustomRecordSelectFieldModel:()=>pq,FilterFormFieldModel:()=>cm,FilterFormGridModel:()=>hk,FilterFormItemModel:()=>hF,FilterFormJSActionModel:()=>hC,FilterFormRecordSelectFieldModel:()=>cZ,FilterFormResetActionModel:()=>hP,FilterFormSubmitActionModel:()=>hj,FilterGroup:()=>ak.I8,FilterItem:()=>ak.qi,FilterManager:()=>s8,FlowModelRepository:()=>S_,FlowPage:()=>bL,FlowRoute:()=>rX,FormActionGroupModel:()=>uu,FormActionModel:()=>us,FormAssociationFieldGroupModel:()=>me,FormAssociationItemModel:()=>mo,FormBlockContent:()=>uO.JU,FormBlockModel:()=>uO.F4,FormComponent:()=>uO.s2,FormCustomItemModel:()=>hG,FormGridModel:()=>uB,FormItemModel:()=>u5,FormJSFieldItemModel:()=>hY,FormModel:()=>uO.mO,FormSubmitActionModel:()=>ud,GRID_FLOW_KEY:()=>ds,GRID_STEP:()=>dd,GlobalThemeProvider:()=>el,GridModel:()=>dc,HeaderContext:()=>ll,Icon:()=>ea.In,IconFieldInterface:()=>Ae,IconFieldModel:()=>vX,IdFieldInterface:()=>At,InputFieldInterface:()=>Ar,InputFieldModel:()=>vQ.m,InputNumberField:()=>ye,IntegerFieldInterface:()=>Ai,InternalAdminSettingsLayout:()=>Mg.InternalAdminSettingsLayout,JSActionModel:()=>ur,JSBlockModel:()=>mv,JSCollectionActionModel:()=>ui,JSColumnModel:()=>fk,JSEditableFieldModel:()=>yW,JSFieldModel:()=>y_,JSFormActionModel:()=>hJ,JSItemActionModel:()=>uf,JSItemModel:()=>y2,JSRecordActionModel:()=>ug,JsonFieldInterface:()=>Ao,JsonFieldModel:()=>n,JsonInput:()=>v3,JsonTextArea:()=>ea.V4,LayoutContent:()=>l8,LayoutContentRoute:()=>rZ,LayoutManager:()=>is,LayoutRoute:()=>r6,LinkActionModel:()=>uR,LinkageFilterItem:()=>ak.Ru,M2MFieldInterface:()=>Aa,M2OFieldInterface:()=>As,MAX_MESSAGE_CHARS:()=>ul.hP,MENU_TYPE_OPTIONS:()=>lP,MainPageModel:()=>dT,MarkdownFieldInterface:()=>Ad,MarkdownItemModel:()=>y1,MobileMenuControlContext:()=>lt,MockFlowModelRepository:()=>ST,MultipleSelectFieldInterface:()=>Au,NBColorPicker:()=>vC,NanoidFieldInterface:()=>Aj,NocoBaseBuildInPlugin:()=>MV,NocoBaseBuildInPluginV2:()=>MV,NumberFieldInterface:()=>Ac,NumberFieldModel:()=>yt,O2MFieldInterface:()=>Ah,OBOFieldInterface:()=>Ap,OHOFieldInterface:()=>Am,ObjectNester:()=>gA,OptionsEditor:()=>oB,PAGE_SIZE_OPTIONS:()=>ea.xp,PLUGIN_MANAGER_SETTING_NAME:()=>nS.Bm,PageModel:()=>dP,PageTabModel:()=>dV,PasswordFieldInterface:()=>Af,PasswordFieldModel:()=>yl,PasswordInput:()=>ea.yA,PercentFieldInterface:()=>Ag,PercentFieldModel:()=>yo,PercentInput:()=>yi,PhoneFieldInterface:()=>Av,PinnedPluginListContext:()=>nl,PinnedPluginListLite:()=>n2,Plugin:()=>am,PluginFlowEngine:()=>Mx,PluginManager:()=>o3,PluginManagerPage:()=>My.PluginManagerPage,PluginSettingsManager:()=>o6.mz,PluginSettingsTopbarActionModel:()=>nN,PopupActionModel:()=>dK,PopupCollectionActionModel:()=>uv,PopupSubTableActionGroupModel:()=>vm,PopupSubTableActionsColumnModel:()=>vv,PopupSubTableEditActionModel:()=>vo,PopupSubTableFieldModel:()=>vp,PopupSubTableFormActionGroupModel:()=>uh,PopupSubTableFormModel:()=>vy,PopupSubTableFormSubmitActionModel:()=>up,PopupSubTableRemoveActionModel:()=>vh,PoweredBy:()=>ea.G5,QUICK_EDIT_FORM_MAX_HEIGHT:()=>hQ,QUICK_EDIT_MARKDOWN_HEIGHT:()=>hZ,QUICK_EDIT_POPOVER_MAX_HEIGHT:()=>hX,QuickEditFormModel:()=>h7,RadioGroupFieldInterface:()=>Ay,RadioGroupFieldModel:()=>ya,RangeValidationItems:()=>oV,RecordActionGroupModel:()=>s$,RecordActionModel:()=>dU.L,RecordPickerContent:()=>fZ,RecordPickerFieldModel:()=>f1,RecordSelectFieldModel:()=>cH,RefreshActionModel:()=>uy,RemoteFlowModelRenderer:()=>bV,RemoteSelect:()=>ea.lT,ResetThemeTokenAndKeepAlgorithm:()=>tE,RichTextField:()=>yg,RichTextFieldInterface:()=>Ab,RichTextFieldModel:()=>r,RootPageModel:()=>dq,RootPageTabModel:()=>dB,RouteModel:()=>em,RouteRepository:()=>id,RouterContextCleaner:()=>ea.PK,RouterManager:()=>an,SNIPPET_PREFIX:()=>o6.tJ,SYSTEM_SETTINGS_SETTING_NAME:()=>nS.jm,ScanInput:()=>ea.E5,SelectFieldInterface:()=>Ax,SelectFieldModel:()=>yM,SkeletonFallback:()=>r2,SnowflakeIdFieldInterface:()=>Aw,SortHandle:()=>ea.vm,SortableRow:()=>ea.B7,SourceCascader:()=>pR,SubFormFieldModel:()=>gF,SubFormListFieldModel:()=>gC,SubPageModel:()=>dz,SubTableColumnModel:()=>gp,SubTableFieldModel:()=>gw,SubTableRecordAction:()=>vi,SwitchLanguage:()=>ea.rw,SystemSettingsPage:()=>Mb.SystemSettingsPage,SystemSettingsSource:()=>es.o,TABLE_COLUMN_MIN_WIDTH:()=>mq,Table:()=>ea.XI,TableActionsColumnModel:()=>mZ,TableAssociationFieldGroupModel:()=>m0,TableBlockModel:()=>fg,TableColumnModel:()=>mW,TableCustomColumnModel:()=>mH,TableJSFieldItemModel:()=>fA,TableSelectModel:()=>fM,TableoidFieldInterface:()=>AS,TextAreaWithContextSelector:()=>ag.n,TextareaFieldInterface:()=>AM,TextareaFieldModel:()=>i,TimeFieldInterface:()=>AA,TimeFieldModel:()=>yR,TopbarActionModel:()=>nE,TypedVariableInput:()=>ea.Pb,UIEditorTopbarActionModel:()=>nD,USER_CENTER_ACTION_ID:()=>nO,UUIDFieldInterface:()=>AP,UnitConversion:()=>bj,UnixTimestampFieldInterface:()=>AE,UpdateRecordActionModel:()=>uA,UpdatedAtFieldInterface:()=>AF,UpdatedByFieldInterface:()=>Ak,UrlFieldInterface:()=>AC,UserCenterActionItemModel:()=>nW,UserCenterItemModel:()=>nK,UserCenterSelectItemModel:()=>nH,UserCenterTextItemModel:()=>nU,UserCenterTopbarActionModel:()=>nZ,VariableFieldFormModel:()=>yI,VariableFilterItem:()=>ak.Et,VariableInput:()=>ea.P8,VariableJSON:()=>ea.hJ,VariableJsonTextArea:()=>ea.jr,VariableTextArea:()=>ea.hp,ViewActionModel:()=>uF,WebSocketClient:()=>iu,aclCheck:()=>xF,aclCheckRefresh:()=>xE,actionLinkageRules:()=>Sw,addCustomAlgorithmToTheme:()=>Q,addFieldValidationConfiguresToGroup:()=>oW,afterSuccess:()=>aA,applyAssociateAction:()=>dZ,applyClickToOpenProps:()=>g$,applyClickToOpenSetting:()=>gL,applyDisassociateAction:()=>dQ,applyMobilePaginationProps:()=>ub.hO,array:()=>i7,bigField:()=>od,blockHeight:()=>wb,blockLinkageRules:()=>Sx,boolean:()=>oo,buildDisplayPathFromValue:()=>gG,buildInsertRouteSchema:()=>lB,buildLinkSettingSchema:()=>lF,buildMenuBasicSchema:()=>lj,buildMenuTitleWithIcon:()=>lv,buildRecordPickerParentItemContext:()=>fY,buildRecordPickerPopupContextInputArgs:()=>fX,buildV2SigninHref:()=>tt,canRecordPickerSelectMultiple:()=>fq,collectAssociationHydrationCandidates:()=>cO,collectCascadeHydrationCandidate:()=>gW,collection:()=>os,compatOldTheme:()=>J,configurePropertiesToItems:()=>oP,confirm:()=>aF,connectFields:()=>hT,createAclSnippetAllow:()=>ne.rN,createAssignFieldValuesStep:()=>uo.KW,createAssignFormSubModelOptions:()=>uo.nF,createCompactSimpleItemRender:()=>ub.hH,createDefaultCollectionBlockTitle:()=>ub.lr,createFilterable:()=>ov,createFormRegistry:()=>ea.oV,createInsertMenuStep:()=>l_,createMockClient:()=>ah,createSettingsPathMap:()=>nS.nC,createTypedFilterable:()=>oy,customAlgorithm:()=>X,customVariable:()=>b5,customizeFilterRender:()=>hz,dataLoadingMode:()=>xv,dataScope:()=>sT,dateRangeLimit:()=>xm,dateTimeFormat:()=>xc,dateTimeFormatConfigureItems:()=>oN,datetime:()=>ot,defaultOperator:()=>hB,defaultTheme:()=>Y,detailsFieldLinkageRules:()=>SF,diagnoseRunJS:()=>ul.fL,dispatchEventDeep:()=>ub.Xi,displayFieldComponent:()=>xS,editMarkdownFlow:()=>yZ,enumType:()=>or,escapeHTML:()=>ns.Z,evaluateFieldConfigureExpression:()=>oM,fieldComponent:()=>xM,fieldFilterOperatorPresets:()=>oh,fieldFilterOperators:()=>op,fieldLinkageRules:()=>SM,fieldValidationConfigureRegistry:()=>oz,filterFormDefaultValues:()=>wm,filterOperatorRegistry:()=>oc,filterRenderableSettings:()=>nS.Ui,filterVisibleSettings:()=>nS.eD,findFirstAccessiblePageRoute:()=>ty,findFirstInternalSettingsPage:()=>nS.X2,findFirstV2LandingRoute:()=>tv,findNextSiblingRoute:()=>lO,findOptionPathByTk:()=>gY,findPrevSiblingRoute:()=>lN,findSettingsByName:()=>nS.R0,fixed:()=>xO,formAssignRules:()=>wp,formatEnvPath:()=>ea.EM,formatNumber:()=>bk,formatRunJSPreviewMessage:()=>ul.by,formatVariablePath:()=>ea.X5,getAdminLayoutMenuInitializerButton:()=>lg,getAdminLayoutMenuMovePositionOptions:()=>ln,getAdminLayoutMenuVirtualPath:()=>tJ,getAdminLayoutModel:()=>rB,getAllDataModels:()=>sZ,getAppVersionHTML:()=>ns.p,getAssignFieldValuesDefaultParams:()=>uo.Z1,getAssociationBlockResourceSettings:()=>dH,getAssociationHydrationNamePath:()=>c$,getAssociationHydrationSetterContext:()=>cB,getAssociationSelectAssociatedRecordsFilter:()=>fS,getAssociationSelectForeignKeyFilter:()=>fw,getAssociationSelectorContextInputArgs:()=>dJ,getAssociationTargetResourceSettings:()=>dY,getCoreFieldConfigureState:()=>oT,getCurrentV2RedirectPath:()=>te,getDefaultOperator:()=>sX,getDefaultSettingsPath:()=>nS.C9,getDefaultV2AdminRedirectPath:()=>e7,getDetailsItemValue:()=>uG,getDisplayNumber:()=>bC,getFilterFormOperatorList:()=>sY,getFilterFormOperatorMeta:()=>sJ,getLayoutContentRouteNames:()=>ej,getLayoutModel:()=>eL,getLayoutPageRouteName:()=>eF,getLayoutPageTabRouteName:()=>ek,getLayoutPageTabViewRouteName:()=>eP,getLayoutPageViewRouteName:()=>eC,getMenuCreationDefaultParams:()=>lC,getMenuCreationUiSchema:()=>lI,getMenuEditDefaultParams:()=>lR,getMenuItems:()=>nS.gL,getMobileCompactPaginationClassName:()=>ub.NY,getModernClientPrefix:()=>e5,getPinnedPluginListKeys:()=>nt,getQuickEditFieldProps:()=>h8,getRecordPickerClearedValue:()=>fW,getRecordPickerEmptyValue:()=>fU,getSimpleModePaginationClassName:()=>ub.HZ,getTopbarPluginSettingsItems:()=>nj,getUniqueKeyFromCollection:()=>AT,getUnknownCountPaginationTotal:()=>ub.SM,getV2EffectiveBasePath:()=>e8,getValueWithIndex:()=>uH,hasIcon:()=>ea.cE,hasOwnSettingsPage:()=>nS.lv,icons:()=>ea.Pt,id:()=>on,indexConfigureItems:()=>oD,injectRecordPickerPopupContext:()=>fJ,insertRouteSchema:()=>lk,isAssociationBlockContext:()=>dG,isFilterValueEmpty:()=>sQ,isLayoutContentRouteName:()=>eE,isTitleField:()=>tr.ji,isTitleFieldInterface:()=>tr.w,isV2AdminRuntime:()=>td,isV2MenuRoute:()=>tg,joinUrlSearch:()=>uC,languageCodes:()=>af.A,layout:()=>xb,linkageAssignField:()=>Sh,linkageRulesRefresh:()=>wf,linkageRunjs:()=>Sf,linkageSetActionProps:()=>Se,linkageSetBlockProps:()=>w7,linkageSetDetailsFieldProps:()=>Sr,linkageSetFieldProps:()=>Sl,linkageSetMenuItemProps:()=>St,makeFormatVariablePath:()=>ea.nW,makeParseVariablePath:()=>ea.Dx,makeVariableRegExp:()=>ea.at,markCascadeHydrationDone:()=>gH,matchSettingsRoute:()=>nS.CM,matchesRoutePath:()=>l$,menuLinkageRules:()=>SS,mergeAssignFieldValues:()=>uo.GO,mergePaginationClassName:()=>ub.M6,navigateToURL:()=>b1,normalizeAdminLayoutMenuLegacyVariables:()=>t0,normalizeCollectionTemplateField:()=>A_,normalizeCollectionTemplateFields:()=>AD,normalizeFilterableOperators:()=>of,normalizeLayoutRoutePath:()=>io,normalizeRecordPickerSelectedRows:()=>fK,normalizeRecordPickerValue:()=>fH,normalizeTableColumnWidth:()=>mz,number:()=>ol,numberFormat:()=>Sj,object:()=>oe,openAdminLayoutMenuLink:()=>t2,openView:()=>bH,openViewFlow:()=>ep,operatorComponentProps:()=>hU,overflowMode:()=>SC,parseEnvPath:()=>ea.uO,parseVariablePath:()=>ea.h7,pattern:()=>x_,previewRunJS:()=>ul.zA,recalculateGridSizes:()=>dh,reconcileAdminLayoutMenuItems:()=>li,redirectToV2Signin:()=>tl,refreshClickToOpenRuntime:()=>gB,refreshTargetBlocks:()=>b9,registerFieldValidationConfigure:()=>oK,registerFieldValidationConfigureGroup:()=>oU,registerIcon:()=>ea.pU,registerIcons:()=>ea.K1,removeMarkdownIframes:()=>S3.VC,renderMode:()=>xy,replaceRouteParams:()=>nS.uT,required:()=>xx,resolveAdminLayoutMenuDragMoveOptions:()=>lo,resolveAdminLayoutMenuDragMoveOptionsFromEvent:()=>la,resolveAdminLayoutMenuLink:()=>t1,resolveAdminRouteRuntimeTarget:()=>tx,resolveAssignFieldValues:()=>uo.eu,resolveCustomFieldOperatorList:()=>pF,resolveDefaultCustomFieldOperator:()=>pk,resolveDynamicNamePath:()=>aO.IJ,resolveFilterOperators:()=>om,resolveV2SigninRedirect:()=>tn,reverseFieldConfigureItem:()=>o$,reverseFieldConfigureItems:()=>oO,runCoreFieldConfigureEffects:()=>o_,runjs:()=>bG,setTargetDataScope:()=>xr,shouldClearRecordPickerValueOnMultipleChange:()=>fz,shouldRenderIconInTitle:()=>lh,showMessage:()=>bX,showNotification:()=>b0,sortTopLevelSettings:()=>nS.p$,sortingRule:()=>xg,string:()=>i9,stripMarkdownIframeTags:()=>S3.jR,stripMarkdownIframes:()=>S3.$P,stripModernClientPrefix:()=>e4,subFormFieldLinkageRules:()=>SA,subFormLinkageAssignField:()=>Sm,subFormLinkageSetFieldProps:()=>Sn,tableRowActionsClassName:()=>mJ,tableoid:()=>oa,time:()=>oi,titleField:()=>xs,toOperatorSelectOptions:()=>pC,toRouterNavigationPath:()=>tu,toToolsMap:()=>eo,toTreeSelectItems:()=>lD,toViewStack:()=>eA,transformNestedData:()=>g_,transformRowsToSingleColumn:()=>dp,useACLContext:()=>ne.bq,useACLRoleContext:()=>ne.v6,useAclSnippets:()=>ne.K3,useAdminLayoutRoutePage:()=>Mf,useApp:()=>q.n,useAppListRender:()=>n6,useApplications:()=>n5,useCurrentAppInfo:()=>ni.g,useCurrentRoleMode:()=>ne.GL,useCurrentRoles:()=>MO,useCurrentUserContext:()=>MN,useFilterOptions:()=>ak.uw,useFilteredMetaTree:()=>ea.a7,useGlobalTheme:()=>et,useLayoutRoutePage:()=>rL,useMobileLayout:()=>Mm,usePlugin:()=>no.n,useRoleRecheck:()=>ne.N5,useRouter:()=>na,useSystemSettings:()=>es.e,useUIConfigurationPermissions:()=>ne.uM,validation:()=>xN}),l(70571);var w=l(50467),S=l(33329),M=l(65606);function A(e){let t=Math.floor(Math.abs(e)),l=Math.abs(e%1*60),n=String(t).padStart(2,"0"),r=String(l).padStart(2,"0"),i=e>=0?"+":"-";return`${i}${n}:${r}`}function F(){return A(-(new Date().getTimezoneOffset()/60))}class k extends S.Q9{getHostname(){var e,t;if(M.env.API_BASE_URL)try{return new URL(M.env.API_BASE_URL).hostname}catch{}return null==(t=window)||null==(e=t.location)?void 0:e.hostname}getHeaders(){let e=super.getHeaders();return this.appName&&(e["X-App"]=this.appName),e["X-Timezone"]=F(),e["X-Hostname"]=this.getHostname(),e}interceptors(){this.axios.interceptors.request.use(e=>{let t=this.getHeaders();return Object.keys(t).forEach(l=>{(0,S.bO)(e.headers,l)||(e.headers[l]=t[l])}),e}),super.interceptors()}constructor(e){super(e),(0,w._)(this,"appName",void 0),e&&"function"!=typeof e&&(this.appName=e.appName)}}var C=l(58587),P=l(18150),j=l(68238),E=l(74848),R=l(95243),I=l(11869),T=l(40098),_=l.n(T),D=l(96540),N=l(5338),O=l(52230),$=l(47665),B=l(84976),L=l(47767),V=l(44363),q=l(36098),z=l(88040);let K=(0,D.memo)(e=>{let{children:t}=e,l=(0,q.n)(),{notification:n}=z.A.useApp();return(0,D.useLayoutEffect)(()=>{l.context.defineProperty("notification",{value:n})},[l,n]),(0,E.jsx)(E.Fragment,{children:t})});K.displayName="AppInner";let U=e=>{let{children:t,className:l,style:n}=e;return(0,E.jsx)(z.A,{className:l,style:{height:"100%",...n},children:(0,E.jsx)(K,{children:t})})};U.displayName="AntdAppProvider";let W=U;var H=l(35710),G=l(4888);let Y={name:"",token:{colorPrimaryHeader:"#001529",colorBgHeader:"#001529",colorBgHeaderMenuHover:"#ffffff1a",colorBgHeaderMenuActive:"#ffffff1a",colorTextHeaderMenu:"#ffffffa6",colorTextHeaderMenuHover:"#ffffff",colorTextHeaderMenuActive:"#ffffff",colorSettings:"#F18B62",colorBgSettingsHover:"rgba(241, 139, 98, 0.06)",colorTemplateBgSettingsHover:"rgba(98, 200, 241, 0.06)",colorBorderSettingsHover:"rgba(241, 139, 98, 0.3)",motionUnit:.03}},J=function(e){var t;return(null==(t=e.token)?void 0:t.colorSettings)||(e.token={...e.token,...Y.token}),e},X=(e,t)=>{var l,n,r,i,o,a,s,d,u,c,p,h;let m=t||H.A.defaultAlgorithm(e);return(l=m).paddingPageHorizontal??(l.paddingPageHorizontal=m.sizeLG),(n=m).paddingPageVertical??(n.paddingPageVertical=m.sizeLG),(r=m).paddingPopupHorizontal??(r.paddingPopupHorizontal=m.sizeLG),(i=m).paddingPopupVertical??(i.paddingPopupVertical=m.size),(o=m).marginBlock??(o.marginBlock=m.sizeLG),(a=m).borderRadiusBlock??(a.borderRadiusBlock=m.borderRadiusLG),(s=m).colorBgSider??(s.colorBgSider=m.colorBgElevated),(d=m).colorBgSiderMenuHover??(d.colorBgSiderMenuHover=m.colorBgTextHover||m.colorFillSecondary),(u=m).colorBgSiderMenuActive??(u.colorBgSiderMenuActive=m.colorPrimaryBg),(c=m).colorTextSiderMenu??(c.colorTextSiderMenu=m.colorText),(p=m).colorTextSiderMenuHover??(p.colorTextSiderMenuHover=m.colorText),(h=m).colorTextSiderMenuActive??(h.colorTextSiderMenuActive=m.colorPrimary),m},Q=e=>(Array.isArray(e.algorithm)?e.algorithm.includes(X)||e.algorithm.push(X):e.algorithm=[e.algorithm,X].filter(Boolean),e.algorithm=e.algorithm.filter(Boolean),e);var Z=l(22803);(0,Z.injectGlobal)`
|
|
3
3
|
.ant-form-item-label > label {
|
|
4
4
|
font-weight: 600;
|
|
@@ -1257,7 +1257,7 @@ ctx.render(<JsItem />);
|
|
|
1257
1257
|
... (stack truncated)`}function A(e){let t=String(e||"").split("\n"),l=new Set;for(let e=0;e<t.length;e++){let n=t[e];(g.test(n)||v.test(n))&&l.add(e)}if(0===l.size)return()=>!1;let n=[0];for(let e=1;e<t.length;e++)n[e]=n[e-1]+t[e-1].length+1;let r=e=>{let t=0,l=n.length-1,r=0;for(;t<=l;){let i=t+l>>1;n[i]<=e?(r=i,t=i+1):l=i-1}return r};return e=>l.has(r(e))}function F(e,t){let l=Math.max(0,Math.min(e.length,Math.floor(t))),n=e.lineAt(l);return{line:n.number,column:l-n.from+1}}function k(e){return[...e].sort((e,t)=>{var l,n,r,i,o,a,s,d;let u=+("lint"!==e.type),c=+("lint"!==t.type);if(u!==c)return u-c;let p=(null==(n=e.location)||null==(l=n.start)?void 0:l.line)??Number.MAX_SAFE_INTEGER,h=(null==(i=t.location)||null==(r=i.start)?void 0:r.line)??Number.MAX_SAFE_INTEGER;if(p!==h)return p-h;let m=(null==(a=e.location)||null==(o=a.start)?void 0:o.column)??Number.MAX_SAFE_INTEGER,f=(null==(d=t.location)||null==(s=d.start)?void 0:s.column)??Number.MAX_SAFE_INTEGER;return m!==f?m-f:String(e.ruleId||"").localeCompare(String(t.ruleId||""))})}function C(e){let t={error:0,warn:1,info:2,log:3};return e.map((e,t)=>({log:e,index:t})).sort((e,l)=>{let n=t[e.log.level]??Number.MAX_SAFE_INTEGER,r=t[l.log.level]??Number.MAX_SAFE_INTEGER;return n!==r?n-r:e.index-l.index}).map(e=>e.log)}function P(e){let t,l=String(e||"");if(!l.trim())return[];let n=r.EY.of(l.split("\n")),i=A(l);try{t=f.parse(l).cursor()}catch(e){return[{type:"lint",ruleId:"parse-error",message:`Syntax error: ${y((null==e?void 0:e.message)||e)}`,location:{start:{line:1,column:1}}}]}let o=[],a=new Set,s=e=>{let t=Math.max(0,Math.min(l.length,e));if(i(t)||a.has(t))return;a.add(t);let r=F(n,t),s=l.slice(t,Math.min(l.length,t+24)).replace(/\s+/g," ").trim(),d=s?` near "${s}"`:"";o.push({type:"lint",ruleId:"parse-error",message:`Syntax error${d}.`,location:{start:r}})};do t.type.isError&&s(t.from);while(t.next());return o}function j(e){let t,l=String(e||"");if(!l.trim())return[];let n=A(l),o=r.EY.of(l.split("\n")),d=[],c=(e,t,r)=>{let i=Math.max(0,Math.min(l.length,e));if(n(i))return;let a=F(o,i);d.push({type:"lint",ruleId:t,message:r,location:{start:a}})},p=()=>{let e="no-noncallable-call",t=new Set,r=r=>{let i=Math.max(0,Math.min(l.length,r));n(i)||t.has(i)||(t.add(i),c(i,e,"This expression is not callable."))},i=l.length,o=e=>{if(!e)return!1;let t=e.charCodeAt(0);return t>=65&&t<=90||t>=97&&t<=122||95===t||36===t},a=e=>{if(!e)return!1;let t=e.charCodeAt(0);return o(e)||t>=48&&t<=57},s=e=>{let t=e;for(;t<i&&/\s/.test(l[t]);)t++;return t},d=e=>!(e>=i)&&("("===l[e]||"?"===l[e]&&"."===l[e+1]&&"("===l[e+2]),u=e=>{let t=1,n="code";for(let r=e+1;r<i;r++){let e=l[r],o=r+1<i?l[r+1]:"";if("lineComment"===n){"\n"===e&&(n="code");continue}if("blockComment"===n){"*"===e&&"/"===o&&(n="code",r+=1);continue}if("single"===n){if("\\"===e){r+=1;continue}"'"===e&&(n="code");continue}if("double"===n){if("\\"===e){r+=1;continue}'"'===e&&(n="code");continue}if("template"===n){if("\\"===e){r+=1;continue}"`"===e&&(n="code");continue}if("/"===e&&"/"===o){n="lineComment",r+=1;continue}if("/"===e&&"*"===o){n="blockComment",r+=1;continue}if("'"===e){n="single";continue}if('"'===e){n="double";continue}if("`"===e){n="template";continue}if("("===e)t++;else if(")"===e&&0==--t)return r}return -1},p=e=>"true"===e||"false"===e||"null"===e,h="code";for(let e=0;e<i;e++){let t=l[e],n=e+1<i?l[e+1]:"";if("lineComment"===h){"\n"===t&&(h="code");continue}if("blockComment"===h){"*"===t&&"/"===n&&(h="code",e+=1);continue}if("/"===t&&"/"===n){h="lineComment",e+=1;continue}if("/"===t&&"*"===n){h="blockComment",e+=1;continue}if("'"===t||'"'===t){let n=t,o=e;for(e+=1;e<i;){let t=l[e];if("\\"===t){e+=2;continue}if(t===n)break;e+=1}d(s(Math.min(i,e+1)))&&r(o);continue}if("`"===t){let t=e;for(e+=1;e<i;){let t=l[e];if("\\"===t){e+=2;continue}if("`"===t)break;e+=1}d(s(Math.min(i,e+1)))&&r(t);continue}if(t>="0"&&t<="9"){let t=e;for(e+=1;e<i&&l[e]>="0"&&l[e]<="9";)e++;if("."===l[e])for(e+=1;e<i&&l[e]>="0"&&l[e]<="9";)e++;if("e"===l[e]||"E"===l[e]){let t=l[e+1],n=e+1;if(("+"===t||"-"===t)&&(n+=1),l[n]>="0"&&l[n]<="9")for(e=n+1;e<i&&l[e]>="0"&&l[e]<="9";)e++}"n"===l[e]&&(e+=1),d(s(e))&&r(t),e-=1;continue}if(o(t)){let t=e;for(e+=1;e<i&&a(l[e]);)e++;p(l.slice(t,e))&&d(s(e))&&r(t),e-=1;continue}if("("===t){let t=s(e+1),n=t,c=!1;("+"===l[t]||"-"===l[t])&&(n=t,t=s(t+1));let h=l[t];if("{"===h||"["===h||"'"===h||'"'===h||"`"===h)c=!0;else if(h>="0"&&h<="9")c=!0;else if(o(h)){let e=t+1;for(;e<i&&a(l[e]);)e++;p(l.slice(t,e))&&(c=!0)}if(c){let t=u(e);t>e&&d(s(t+1))&&r(n)}}}};try{let e=i.Parser||i;t=("function"==typeof a()?e.extend(a()()):e).parse(l,{ecmaVersion:2022,sourceType:"script",allowAwaitOutsideFunction:!0,allowReturnOutsideFunction:!0,locations:!0})}catch(e){return p(),d}let h=new Set(["ctx","console","window","document","navigator","Math","Date","Array","Object","Number","String","Boolean","Promise","RegExp","Set","Map","WeakSet","WeakMap","JSON","Intl","URL","Error","TypeError","encodeURIComponent","decodeURIComponent","parseInt","parseFloat","isNaN","isFinite","undefined","NaN","Infinity"]),m=e=>{e&&"string"==typeof e.name&&h.add(e.name)},f=e=>{if(!e)return;let t=[e];for(;t.length;){let e=t.pop();e&&("Identifier"===e.type?m(e):"AssignmentPattern"===e.type?t.push(e.left):"ArrayPattern"===e.type?(e.elements||[]).forEach(e=>e&&t.push(e)):"ObjectPattern"===e.type&&(e.properties||[]).forEach(e=>e&&t.push(e.value||e)))}};try{s.a2(t,e=>{switch(null==e?void 0:e.type){case"VariableDeclarator":f(e.id);break;case"FunctionDeclaration":case"FunctionExpression":m(e.id),(e.params||[]).forEach(f);break;case"ArrowFunctionExpression":(e.params||[]).forEach(f);break;case"CatchClause":f(e.param);break;case"ClassDeclaration":m(e.id)}},u)}catch(e){}try{s.a2(t,e=>{if(!e||"string"!=typeof e.type||"CallExpression"!==e.type)return;let t=e.callee;if(!(t&&("Identifier"===t.type||"MemberExpression"===t.type||"FunctionExpression"===t.type||"ArrowFunctionExpression"===t.type||"CallExpression"===t.type||"ChainExpression"===t.type))){let l=(null==t?void 0:t.start)??e.start??0;c(l,"no-noncallable-call","This expression is not callable.")}},u)}catch(e){}try{let e=new Set,l=new Set(["t"]);s.a2(t,t=>{var n,r,i;if(!t||"string"!=typeof t.type||"CallExpression"!==t.type)return;let o=t.callee;if((null==o?void 0:o.type)==="ChainExpression"&&(o=o.expression),!o||"MemberExpression"!==o.type)return;let a=o.object;if(!a||"Identifier"!==a.type||"ctx"!==a.name)return;let s=null;if(o.computed||(null==(n=o.property)?void 0:n.type)!=="Identifier"?o.computed&&(null==(r=o.property)?void 0:r.type)==="Literal"&&"string"==typeof o.property.value&&(s=o.property.value):s=o.property.name,!s||"string"!=typeof s)return;let d=s.trim();if(!d||d.startsWith("_")||d.length>2||l.has(d)||e.has(d))return;let u=(null==(i=o.property)?void 0:i.start)??o.start??t.start??0;c(u,"possible-undefined-ctx-member-call",`Possible undefined ctx method call: ctx.${d}(). This may be a typo or not available in the current ctx API.`),e.add(d)},u)}catch(e){}try{let e=new Set;s.ai(t,{Identifier(t,l){let n=null==t?void 0:t.name;if(!n||h.has(n)||e.has(n))return;let r=l[l.length-2];if(!r||"VariableDeclarator"===r.type&&r.id===t||"FunctionDeclaration"===r.type&&r.id===t||"FunctionExpression"===r.type&&r.id===t||"ClassDeclaration"===r.type&&r.id===t||"ClassExpression"===r.type&&r.id===t||"Property"===r.type&&r.key===t&&!0!==r.computed||"MemberExpression"===r.type&&r.property===t&&!0!==r.computed||"LabeledStatement"===r.type&&r.label===t||"BreakStatement"===r.type&&r.label===t||"ContinueStatement"===r.type&&r.label===t)return;let i=t.start??0;c(i,"possible-undefined-variable",`Possible undefined variable: ${n}`),e.add(n)}},u)}catch(e){}return d}function E(e){let t=(t,l)=>{let n=l.map(e=>y(e)).join(" ").trim();e.push({level:t,message:n})},l={trace:function(){for(var e=arguments.length,l=Array(e),n=0;n<e;n++)l[n]=arguments[n];return t("log",l)},debug:function(){for(var e=arguments.length,l=Array(e),n=0;n<e;n++)l[n]=arguments[n];return t("log",l)},info:function(){for(var e=arguments.length,l=Array(e),n=0;n<e;n++)l[n]=arguments[n];return t("info",l)},warn:function(){for(var e=arguments.length,l=Array(e),n=0;n<e;n++)l[n]=arguments[n];return t("warn",l)},error:function(){for(var e=arguments.length,l=Array(e),n=0;n<e;n++)l[n]=arguments[n];return t("error",l)},fatal:function(){for(var e=arguments.length,l=Array(e),n=0;n<e;n++)l[n]=arguments[n];return t("error",l)},child:()=>l};return{consoleCapture:{log:function(){for(var e=arguments.length,l=Array(e),n=0;n<e;n++)l[n]=arguments[n];return t("log",l)},info:function(){for(var e=arguments.length,l=Array(e),n=0;n<e;n++)l[n]=arguments[n];return t("info",l)},warn:function(){for(var e=arguments.length,l=Array(e),n=0;n<e;n++)l[n]=arguments[n];return t("warn",l)},error:function(){for(var e=arguments.length,l=Array(e),n=0;n<e;n++)l[n]=arguments[n];return t("error",l)}},loggerCapture:l}}function R(e){if(!e.length)return;let t={timeout:0,internal:1,"preview-start-failed":2};return[...e].sort((e,l)=>{let n=t[String(e.ruleId||"")]??10,r=t[String(l.ruleId||"")]??10;return n!==r?n-r:0})[0]}function I(e){var t;let l=null==(t=e.location)?void 0:t.start,n=l?`line ${l.line}:${l.column} `:"",r=e.ruleId?`(${e.ruleId}) `:"";return`${n}${r}${e.message}`.trim()}function T(e){if(!e)return"Preview execution: unknown";let t="number"==typeof e.durationMs?`${Math.round(e.durationMs)}ms`:"unknown";return`Preview execution: started=${e.started}, finished=${e.finished}, timeout=${e.timeout}, duration=${t}`}function _(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"…",n=String(e||"");return n.length<=t?n:`${n.slice(0,Math.max(0,t-l.length))}${l}`}function D(e,t){let{issues:l,logs:n,execution:r}=e,i=l.filter(e=>"lint"===e.type),o=l.filter(e=>"runtime"===e.type),a=C(n),s=R(o),d=[],u=l.length,c=i.length,p=o.length,h=a.length,m=e=>{e.length&&(d.push("Key logs:"),e.forEach(e=>{d.push(`[${e.level}] ${_(e.message,t.maxLogChars)}`)}),a.length>e.length&&d.push(`... ${a.length-e.length} more logs not shown`))};if(0===u){let e=a.some(e=>"warn"===e.level||"error"===e.level);d.push(e?`RunJS preview completed with warning/error logs: no diagnostic issues found. Logs: ${h}.`:`RunJS preview succeeded: no issues found. Logs: ${h}.`),d.push(T(r));let l=a.slice(0,Math.max(0,t.maxLogs));l.length&&(d.push(""),m(l));let n=d.join("\n").trimEnd();return{message:_(n,t.maxChars),truncated:n.length>t.maxChars}}d.push(`RunJS preview failed: ${u} issues (lint ${c} / runtime ${p}), logs: ${h}.`),d.push(T(r)),d.push("");let f=(e,l)=>{if(!l.length)return;d.push(`${e}:`);let n=l.slice(0,Math.max(0,t.maxIssues));n.forEach((e,l)=>{let n=`${l+1}) ${I(e)}`;if(d.push(n),t.includeStack&&e.stack){let l=_(String(e.stack),t.maxStackChars);d.push(_(l,t.maxStackChars))}}),l.length>n.length&&d.push(`... ${l.length-n.length} more not shown`),d.push("")},g=s&&o.length>1?[s,...o.filter(e=>e!==s)]:o;f("Static issues",i),f("Runtime issues",g);let v=a.slice(0,Math.max(0,t.maxLogs));v.length&&m(v);let y=d.join("\n").trimEnd(),b=y.length>t.maxChars;return{message:b?_(y,t.maxChars):y,truncated:b}}function N(e){let t=`(issues total ${e.issues.length}, logs total ${e.logs.length})`,l=!1;for(let n of[{maxLogs:40,maxLogChars:220,maxIssues:12,includeStack:!0,maxStackChars:800},{maxLogs:20,maxLogChars:160,maxIssues:10,includeStack:!0,maxStackChars:400},{maxLogs:12,maxLogChars:140,maxIssues:8,includeStack:!1,maxStackChars:0},{maxLogs:8,maxLogChars:120,maxIssues:5,includeStack:!1,maxStackChars:0},{maxLogs:3,maxLogChars:100,maxIssues:3,includeStack:!1,maxStackChars:0}]){let{message:r,truncated:i}=D(e,{...n,maxChars:c});if(l=l||i,!i){if(!l)return r;return _(`RunJS preview output was truncated.
|
|
1258
1258
|
${t}
|
|
1259
1259
|
|
|
1260
|
-
${r}`,c)}}let n=R(e.issues.filter(e=>"runtime"===e.type)),r=n?`Key runtime issue: ${I(n)}`:"",i=["RunJS preview output was truncated.",t,e.execution?T(e.execution):void 0,r||void 0].filter(Boolean).join("\n").trim();return i.length<=c?i:_(i,c-1)+"\n"}function O(e){return N(e)}async function $(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n="string"==typeof e?e:String(e??""),r=[],i=[],o=null==l?void 0:l.version,a=(0,d.shouldPreprocessRunJSTemplates)({version:o});i.push(...P(n)),i.push(...j(n));let s="u">typeof performance&&"function"==typeof performance.now?performance.now():Date.now(),u={started:!1,finished:!1,timeout:!1,durationMs:void 0};try{u.started=!0;let{consoleCapture:e,loggerCapture:l}=E(r),s={console:e};try{if("u">typeof window){let e=(0,d.createSafeNavigator)();s.navigator=e,s.window=(0,d.createSafeWindow)({navigator:e}),s.document=(0,d.createSafeDocument)()}}catch(e){}let c=n;try{c=await (0,d.prepareRunJsCode)(n,{preprocessTemplates:a})}catch(n){let e=String((null==n?void 0:n.name)||""),t=y((null==n?void 0:n.message)||n),l=n instanceof SyntaxError||/^SyntaxError\b/i.test(e)||/SyntaxError\b/i.test(t);return i.push({type:"runtime",ruleId:l?"preview-start-failed":"internal",message:l?t:`Preview internal failure: ${t}`,stack:M(n)}),u.finished=!0,u.timeout=!1,{issues:k(i),logs:r,execution:u}}let h=await t.createJSRunner({globals:s,timeoutMs:p,version:o});h.globals.ctx.defineProperty("logger",{value:l});let m=await h.run(c);if(u.finished=!0,u.timeout=!!(null==m?void 0:m.timeout),!(null==m?void 0:m.success)){let e=null==m?void 0:m.error,t=(null==m?void 0:m.timeout)?"Execution timed out":y((null==e?void 0:e.message)||e||"Unknown error"),l=e instanceof SyntaxError||/^SyntaxError\b/i.test(String((null==e?void 0:e.name)||""));i.push({type:"runtime",ruleId:(null==m?void 0:m.timeout)?"timeout":l?"preview-start-failed":"runtime-error",message:t,stack:M(e)})}}catch(e){u.finished=!0,u.timeout=!1,i.push({type:"runtime",ruleId:"internal",message:`Preview internal failure: ${y((null==e?void 0:e.message)||e)}`,stack:M(e)})}finally{let e=Math.max(0,("u">typeof performance&&"function"==typeof performance.now?performance.now():Date.now())-s);u.durationMs=Number.isFinite(e)?e:void 0}return{issues:k(i),logs:r,execution:u}}function B(e){let t=new d.FlowContext;if(t.addDelegate(e),"u">typeof document&&"function"==typeof document.createElement&&!e.element)try{let e=document.createElement("div");t.defineProperty("element",{value:e})}catch(e){}return t}async function L(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=B(t),r=await $(e,n,l),i=0===r.issues.length,o=O(r);return{success:i,message:o.length>c?_(o,c):o}}},68669(e,t,l){l.d(t,{a:()=>a});var n=l(74848),r=l(84626),i=l(71021);l(96540);var o=l(7521);let a=(0,l(11869).observer)(e=>{var t;let{value:l,FilterItem:a,ctx:s}=e;l.logic||(l.logic="$and"),Array.isArray(l.items)||(l.items=[]);let d=()=>{var e;(null==s||null==(e=s.model)?void 0:e.dispatchEvent)&&s.model.dispatchEvent("reset")},u=()=>{var e;(null==s||null==(e=s.model)?void 0:e.dispatchEvent)&&s.model.dispatchEvent("submit")},c=(null==s||null==(t=s.model)?void 0:t.translate)||(e=>e);return(0,n.jsxs)("form",{onSubmit:e=>{e.preventDefault(),u()},children:[(0,n.jsx)(o.I,{value:l,FilterItem:a}),(0,n.jsxs)(r.A,{style:{width:"100%",display:"flex",justifyContent:"flex-end"},children:[(0,n.jsx)(i.Ay,{htmlType:"button",onClick:d,children:c("Reset")}),(0,n.jsx)(i.Ay,{type:"primary",htmlType:"submit",children:c("Submit")})]})]})},{displayName:"FilterContent"})},7521(e,t,l){l.d(t,{I:()=>f});var n=l(74848),r=l(97373),i=l(18853),o=l(35710),a=l(36492),s=l(84626),d=l(71021),u=l(18492);l(96540);var c=l(11869);let p=new WeakMap,h=0,m=e=>{let t=p.get(e);return t||(h+=1,t=`filter-item-${h}`,p.set(e,t)),t},f=(0,c.observer)(e=>{let{token:t}=o.A.useToken(),{value:l={logic:"$and",items:[]},FilterItem:c,showBorder:p=!1,onRemove:h,onChange:g,closeIcon:v=(0,n.jsx)(r.A,{style:{color:t.colorIcon}})}=e,{t:y}=(0,u.B)();l.logic||(l.logic="$and"),Array.isArray(l.items)||(l.items=[]);let{logic:b,items:x}=l,w=p?{position:"relative",border:`1px dashed ${t.colorBorder}`,padding:t.paddingSM,marginBottom:t.marginXS,borderRadius:t.borderRadius}:{position:"relative",marginBottom:t.marginXS},S=e=>{l.logic=e,null==g||g(l)},M=()=>{x.push({path:"",operator:"",value:""}),null==g||g(l)},A=()=>{x.push({logic:"$and",items:[]}),null==g||g(l)},F=e=>{x.splice(e,1),null==g||g(l)},k=e=>"path"in e||"operator"in e||"value"in e,C=e=>"logic"in e&&"items"in e;return(0,n.jsxs)("div",{style:w,children:[p&&h&&(0,n.jsx)("button",{type:"button","aria-label":"icon-close",style:{position:"absolute",right:10,top:10,cursor:"pointer",background:"transparent",border:0,padding:0},onClick:h,children:v}),(0,n.jsx)("div",{style:{marginBottom:8,color:t.colorText},children:(0,n.jsxs)("span",{children:[y("Meet")," ",(0,n.jsxs)(a.A,{"data-testid":"filter-select-all-or-any",style:{width:"auto"},value:b,onChange:S,children:[(0,n.jsx)(a.A.Option,{value:"$and",children:y("All")}),(0,n.jsx)(a.A.Option,{value:"$or",children:y("Any")})]})," ",y("conditions in the group")]})}),(0,n.jsx)("div",{children:x.map((e,r)=>C(e)?(0,n.jsx)(f,{value:e,FilterItem:c,showBorder:!0,onRemove:()=>F(r),onChange:e=>{x[r]=e,null==g||g(l)}},m(e)):k(e)?c?(0,n.jsx)("div",{style:{marginBottom:8,display:"flex",alignItems:"flex-end"},children:(0,n.jsxs)(s.A,{style:{flex:1,minWidth:0},children:[(0,n.jsx)(c,{value:e}),(0,n.jsx)("button",{type:"button","aria-label":"icon-close",style:{marginLeft:8,marginRight:8,flex:"0 0 auto",cursor:"pointer",background:"transparent",border:0,padding:0},onClick:()=>F(r),children:v})]})},m(e)):(0,n.jsx)("div",{style:{marginBottom:8,display:"flex",alignItems:"flex-end"},children:(0,n.jsxs)(s.A,{style:{flex:1,minWidth:0},children:[(0,n.jsxs)("span",{children:[e.path," ",e.operator," ",String(e.value)]}),(0,n.jsx)("button",{type:"button","aria-label":"icon-close",style:{marginLeft:8,marginRight:8,flex:"0 0 auto",cursor:"pointer",background:"transparent",border:0,padding:0},onClick:()=>F(r),children:v})]})},m(e)):(0,n.jsx)("div",{style:{marginBottom:8,display:"flex",alignItems:"flex-end"},children:(0,n.jsxs)(s.A,{style:{flex:1,minWidth:0},children:[(0,n.jsx)("span",{style:{color:t.colorTextTertiary},children:"Invalid filter item"}),(0,n.jsx)("button",{type:"button","aria-label":"icon-close",style:{marginLeft:8,marginRight:8,flex:"0 0 auto",cursor:"pointer",background:"transparent",border:0,padding:0},onClick:()=>F(r),children:v})]})},m(e)))}),(0,n.jsxs)(s.A,{size:16,style:{marginTop:8,marginBottom:8},children:[(0,n.jsx)(d.Ay,{style:{padding:0},type:"link",size:"small",icon:(0,n.jsx)(i.A,{}),onClick:M,children:y("Add condition")}),(0,n.jsx)(d.Ay,{style:{padding:0},type:"link",size:"small",icon:(0,n.jsx)(i.A,{}),onClick:A,children:y("Add condition group")})]})]})},{displayName:"FilterGroup"})},44e3(e,t,l){l.d(t,{H:()=>n});let n=(e,t,l,n)=>e.map(e=>r(e,t,l,n)).filter(Boolean),r=(e,t,l,r)=>{var i;if(l.length&&1===t&&l.includes(e.name)||!e.interface||!1===e.filterable)return;let o=e.getInterfaceOptions();if(!(null==o?void 0:o.filterable))return;let{nested:a,children:s,operators:d}=o.filterable,u={name:e.name,type:e.type,target:e.target,title:r(e.title),schema:null==e?void 0:e.uiSchema,operators:((null==d||null==(i=d.filter)?void 0:i.call(d,t=>!(null==t?void 0:t.visible)||t.visible(e)))||[]).map(e=>({...e,label:r(e.label)}))};if(!e.target||!(t>2)){if(t>2)return u;if((null==s?void 0:s.length)&&(u.children=s),a){let i=[];try{i=e.getFields().filter(e=>"attachments"!==e.target&&"formula"!==e.interface)}catch{i=[]}let o=n(i,t+1,l,r).filter(Boolean);u.children=u.children||[],u.children.push(...o)}return u}}},58528(e,t,l){l.d(t,{Ru:()=>W,I8:()=>r.I,qi:()=>p,oJ:()=>n.a,Et:()=>T,uw:()=>H.u});var n=l(68669),r=l(7521),i=l(74848),o=l(11869),a=l(84626),s=l(36492),d=l(95725),u=l(96540),c=l(44e3);let p=(0,o.observer)(e=>{var t;let{path:l,operator:n,value:r}=e.value,o=e.model,p=(null==(t=o.context.blockModel.collection)?void 0:t.getFields().filter(e=>"attachments"!==e.target))||[],m=h(o.props.filterableFieldNames||[],p.map(e=>e.name)),f=o.translate,g=(0,c.H)(p.filter(e=>"attachments"!==e.target&&"formula"!==e.interface&&!["belongsTo","belongsToMany","hasOne","hasMany","oho","obo","m2o","o2m","m2m"].includes(e.type)),1,e.noIgnore?[]:m,f).filter(Boolean),v=(0,u.useMemo)(()=>{let e=g.find(e=>e.name===l);return(null==e?void 0:e.operators)||[]},[g,l]),y=t=>{var l;e.value.path=t;let n=g.find(e=>e.name===t);(null==n||null==(l=n.operators)?void 0:l.length)>0?e.value.operator=n.operators[0].value:e.value.operator="",e.value.value=""},b=t=>{e.value.operator=t},x=t=>{e.value.value=t.target.value};return(0,i.jsxs)(a.A,{children:[(0,i.jsx)(s.A,{style:{width:200},placeholder:f("Select field"),value:l||void 0,onChange:y,children:g.map(e=>(0,i.jsx)(s.A.Option,{value:e.name,children:e.title},e.name))}),(0,i.jsx)(s.A,{style:{width:120},placeholder:f("Select operator"),value:n||void 0,onChange:b,disabled:!l||0===v.length,children:v.map(e=>(0,i.jsx)(s.A.Option,{value:e.value,children:e.label},e.value))}),(0,i.jsx)(d.A,{style:{width:200},placeholder:f("Enter value"),value:r,onChange:x})]})},{displayName:"FilterItem"});function h(e,t){return null==t?void 0:t.filter(t=>!e.includes(t))}var m=l(63718),f=l(94313),g=l(60518),v=l(51643),y=l(60209),b=l(2077),x=l(18451),w=l.n(x),S=l(40098),M=l.n(S),A=l(20419),F=l(85352),k=l(53869),C=l(10925);let{DateFilterDynamicComponent:P}=(0,b.RZ)(()=>Promise.resolve().then(l.bind(l,13595)),"DateFilterDynamicComponent");async function j(e){var t,l,n,r;let i=async e=>Array.isArray(e)?e:"function"==typeof e?await e():[];if(null==(l=e.getPropertyOptions)||null==(t=l.call(e,"collection"))?void 0:t.meta){let t=null==(r=e.getPropertyMetaTree)?void 0:r.call(e,"{{ ctx.collection }}");return await i(t)}let a=()=>(null==e?void 0:e.collection)??null,s=await (0,o.createEphemeralContext)(e,{defineProperties:{collection:{get:a,meta:(0,o.createCollectionContextMeta)(a,"Current collection")}}}),d=null==(n=s.getPropertyMetaTree)?void 0:n.call(s,"{{ ctx.collection }}");return await i(d)}function E(e,t){return"number"!=typeof t?e:(0,C.W)(e,{maxAssociationDepth:t})}function R(e,t,l,n){var r;let o=null==e?void 0:e["x-component"],a=(null==t||null==(r=t.uiSchema)?void 0:r["x-component-props"])||{},u=(null==e?void 0:e["x-component-props"])||{},c=w()({},a,u),p=(0,F.di)(null==e?void 0:e.enum,l)||[],h={style:{width:200,...(null==c?void 0:c.style)||{}},placeholder:(null==c?void 0:c.placeholder)||l("Enter value"),...c},b=e=>{if("number"==typeof e||(null==c?void 0:c.stringMode)===!0&&"string"==typeof e)return e};return e=>{let{value:t,onChange:l,...r}=e||{};if("InputNumber"===o)return(0,i.jsx)(m.A,{...h,...r,value:b(t),onChange:e=>null==l?void 0:l(e)});if("NumberPicker"===o)return(0,i.jsx)(A.NumberPicker,{...h,...r,value:b(t),onChange:e=>null==l?void 0:l(e)});if("Switch"===o)return(0,i.jsx)(f.A,{...h,...r,checked:!!t,onChange:e=>null==l?void 0:l(e)});if("Select"===o)return(0,i.jsx)(s.A,{options:p,...h,...r,value:(0,F.xO)(t,h),onChange:e=>null==l?void 0:l(e)});if("Checkbox"===o)return(0,i.jsx)(g.A,{...h,...r,checked:!!t,onChange:e=>null==l?void 0:l(e.target.checked)});if("Checkbox.Group"===o)return(0,i.jsx)(g.A.Group,{...h,...r,value:Array.isArray(t)?t:void 0,onChange:e=>null==l?void 0:l(e)});if("Radio.Group"===o)return(0,i.jsx)(v.Ay.Group,{...h,...r,value:Array.isArray(t)||"string"==typeof t||"number"==typeof t||"boolean"==typeof t?t:void 0,onChange:e=>null==l?void 0:l(e.target.value)});if("Cascader"===o)return(0,i.jsx)(y.A,{...h,...r,value:Array.isArray(t)?t:void 0,onChange:e=>null==l?void 0:l(e)});if("Input.TextArea"===o||"TextArea"===o)return(0,i.jsx)(d.A.TextArea,{...h,...r,value:"string"==typeof t?t:null==t?"":String(t),onChange:e=>null==l?void 0:l(e.target.value)});if("DateFilterDynamicComponent"===o)return(0,i.jsx)(P,{...h,...r,value:t,onChange:e=>null==l?void 0:l(e)});if(o&&(null==n?void 0:n.getComponent)){let e=n.getComponent(o);if(e)return(0,i.jsx)(e,{...h,...r,value:t,onChange:e=>null==l?void 0:l(e),style:{width:200,...h.style||{},...null==r?void 0:r.style}})}return(0,i.jsx)(d.A,{...h,...r,value:"string"==typeof t?t:null==t?"":String(t),onChange:e=>null==l?void 0:l(e.target.value)})}}function I(e){if(e&&"object"==typeof e){let l=e;if("function"==typeof l.preventDefault||l.nativeEvent||"target"in l){var t;let n=null==(t=l.target)?void 0:t.value;return void 0!==n?n:e}}return e}let T=(0,o.observer)(e=>{let{value:t,model:l,rightAsVariable:n,rightMetaTree:r,ignoreFieldNames:c,maxAssociationFieldDepth:p}=e,h=(0,o.useFlowViewContext)(),m=l.translate,{path:f,operator:g,value:v}=t,[y,x]=(0,u.useState)(null),S=(0,u.useCallback)(e=>{var t;return(0,b.w6)(e,l.context.dataSourceManager,null==(t=l.context.app)?void 0:t.dataSourceManager)},[l]),A=(0,u.useMemo)(()=>{var e,t;if(!y)return[];let l=y.interface?S(y.interface):void 0,n=null==y||null==(e=y.uiSchema)?void 0:e["x-filter-operators"];return((Array.isArray(n)&&n.length?n:null==l||null==(t=l.filterable)?void 0:t.operators)||[]).filter(e=>!e.visible||e.visible(y))},[S,y]);(0,u.useEffect)(()=>{if(!A.length)return;let e=M().find(A,e=>e.value===t.operator);if(e)t.noValue=!!e.noValue;else{let e=A[0];t.operator=e.value,t.value=!!e.noValue||void 0,t.noValue=!!e.noValue}},[A,t]);let C=(0,u.useMemo)(()=>A.map(e=>({value:e.value,label:"string"==typeof e.label?m(e.label):e.label})),[A,m]),P=(0,u.useCallback)((e,l)=>{let n=t.path||"",r=e||"",i=r!==n;t.path=r,i&&n&&(t.operator="",t.value=void 0,t.noValue=!1),l&&x(l)},[t]),T=(0,u.useMemo)(()=>({resolveValueFromPath:e=>(x(e),(null==e?void 0:e.paths.slice(1).join("."))||null),resolvePathFromValue(e){if(null==e)return;let t=String(e).trim();if(t)return["collection",...t.split(".")]}}),[]),_=(0,u.useCallback)(e=>{t.operator=e;let l=A.find(t=>t.value===e);(null==l?void 0:l.noValue)?(t.value=!0,t.noValue=!0):(t.value=void 0,t.noValue=!1)},[A,t]),D=(0,u.useMemo)(()=>A.find(e=>e.value===g),[A,g]),N=(0,u.useCallback)(e=>{var t,l;return(null==e||null==(t=e.options)?void 0:t.dataType)||(null==e?void 0:e.dataType)||(null==e?void 0:e.type)||(null==e||null==(l=e.uiSchema)?void 0:l.type)||"double"},[]),O=(0,u.useCallback)(e=>{switch(e){case"boolean":return"Switch";case"date":return"DateFilterDynamicComponent";case"integer":case"bigInt":case"double":case"decimal":case"number":return"InputNumber";default:return"Input"}},[]),$=(0,u.useMemo)(()=>{let e=(null==y?void 0:y.uiSchema)||{},t=(null==D?void 0:D.schema)||{},l=w()({},e,t);if((null==y?void 0:y.interface)==="formula"){let e={"x-read-pretty":!1,"x-component":O(N(y)),"x-component-props":{...l["x-component-props"]}};return w()({},l,e)}return l},[y,D,O,N]),B=u.useRef(null==$?void 0:$["x-component"]),L=null==$?void 0:$["x-component"],V=(0,u.useMemo)(()=>{let e=B.current;B.current=L;let l=void 0!==e&&e!==L;if(null==D?void 0:D.noValue)return v;if(l&&null!=v){t.value=void 0;return}return v},[L,v,t,D]),q=(0,u.useCallback)(e=>{t.value=I(e)},[t]),z=u.useRef(m);u.useEffect(()=>{z.current=m},[m]);let K=u.useCallback(e=>{var t;return(null==(t=z.current)?void 0:t.call(z,e))??e},[]),U=(0,u.useMemo)(()=>(0,F.di)(null==$?void 0:$.enum,K)||[],[$,K]),W=(0,u.useMemo)(()=>R($,y,K,l.context.app),[$,y,K,l.context.app]),H=(0,u.useCallback)(()=>{let e=(0,k._H)(l.context.app,g,A),t="$in"===g||"$notIn"===g;if(e&&t){let{Comp:t,props:l}=e,n={...l},r=Array.isArray(n.options)?n.options:void 0;(!r||0===r.length)&&(null==U?void 0:U.length)&&(n.options=U);let o={flex:"1 1 40%",minWidth:160,maxWidth:"100%",...(0,k.VS)(n.style)},a=Array.isArray(V)&&V.every(e=>"string"==typeof e||"number"==typeof e)?V:"string"==typeof V?V.split(/\r?\n/).map(e=>e.trim()).filter(Boolean):[];return(0,i.jsx)("div",{style:o,children:(0,i.jsx)(t,{...n,style:{width:"100%",...(0,k.VS)(n.style)},value:a,onChange:e=>q(e)})})}let n=W;return(0,i.jsx)("div",{style:{flex:"1 1 40%",minWidth:160,maxWidth:"100%"},children:(0,i.jsx)(n,{value:V,onChange:e=>q(e)})})},[g,A,V,W,l.context.app,q,U]),G=(0,u.useMemo)(()=>function(){return(0,i.jsx)(d.A,{placeholder:`<${m("Null")}>`,readOnly:!0})},[m]),Y=(0,u.useMemo)(()=>async()=>{let e="function"==typeof r?await r():r??h.getPropertyMetaTree(),t=Array.isArray(e)?e:await e();return E([{title:m("Constant"),name:"constant",type:"string",paths:["constant"],render:W},{title:m("Null"),name:"null",type:"object",paths:["null"],render:G},...t],p)},[r,h,W,G,m,p]),J=(0,u.useMemo)(()=>({renderInputComponent:e=>{var t;let l=null==e||null==(t=e.paths)?void 0:t[0];return"constant"===l?W:"null"===l?G:null},resolveValueFromPath:e=>{var t;let l=null==e||null==(t=e.paths)?void 0:t[0];return"constant"===l?"":"null"===l?null:void 0},resolvePathFromValue:e=>{if(null===e)return["null"];let t="string"==typeof e?(0,o.parseValueToPath)(e):void 0;return t||["constant"]}}),[G,W]),X=(0,u.useMemo)(()=>async()=>{let e=await j(l.context),t=async e=>{let t=e.interface?S(e.interface):void 0,n=[],r=null==t?void 0:t.filterable,i=null==r?void 0:r.children;if(Array.isArray(i)&&i.length)for(let t of i){var o,a,s;let r=t.title||t.name,i=(null==(o=l.context)?void 0:o.t)?l.context.t(r):r;n.push({name:t.name,title:i,type:(null==(a=t.schema)?void 0:a.type)||"string",interface:(null==(s=t.schema)?void 0:s["x-component"])==="Select"?"select":"input",uiSchema:{...t.schema||{},"x-filter-operators":t.operators},paths:[...e.paths||[],t.name],parentTitles:[...e.parentTitles||[],e.title]})}if("function"==typeof e.children){let t=e.children;return{...e,children:async()=>{let e=await t(),l=[...Array.isArray(e)?e:[],...n];return M().uniqBy(l,"name")}}}let d=[...Array.isArray(e.children)?e.children:[],...n];return{...e,children:d.length?d:e.children}},n=[];for(let l of e)n.push(await t(l));return E(n,p)},[S,l,p]);return(0,i.jsxs)(a.A,{wrap:!0,style:{width:"100%"},children:[(0,i.jsx)(o.VariableInput,{value:f,metaTree:X,onChange:P,converters:T,showValueComponent:!1,style:{flex:"1 1 40%",minWidth:160,maxWidth:"100%"},onlyLeafSelectable:!0,placeholder:m("Select field"),ignoreFieldNames:c}),(0,i.jsx)(s.A,{style:{flex:"0 0 140px",minWidth:120,maxWidth:"100%"},placeholder:m("Comparison"),value:g||void 0,onChange:_,children:C.map(e=>(0,i.jsx)(s.A.Option,{value:e.value,children:e.label},e.value))}),!(null==D?void 0:D.noValue)&&(n?(0,i.jsx)(o.VariableInput,{value:V,onChange:e=>q(e),metaTree:Y,converters:J,showValueComponent:!0,style:{flex:"1 1 40%",minWidth:160,maxWidth:"100%"},placeholder:m("Enter value")}):H())]})});var _=l(68827),D=l.n(_),N=l(97456);let{DateFilterDynamicComponent:O}=(0,b.RZ)(()=>Promise.resolve().then(l.bind(l,13595)),"DateFilterDynamicComponent");function $(e,t){return"number"!=typeof t?e:(0,C.W)(e,{maxAssociationDepth:t})}function B(e,t,l){var n,r,o;let a=null==e?void 0:e["x-component"],u=(null==t||null==(n=t.uiSchema)?void 0:n["x-component-props"])||{},c=(null==e?void 0:e["x-component-props"])||{},p=w()({},u,c),h=Array.isArray(null==t||null==(r=t.uiSchema)?void 0:r.enum)?null==t||null==(o=t.uiSchema)?void 0:o.enum:void 0,g=(0,F.di)(h,l),v={style:{width:200,...(null==p?void 0:p.style)||{}},placeholder:(null==p?void 0:p.placeholder)||l("Enter value"),...p};return e=>{let{value:t,onChange:n,...r}=e||{};if("InputNumber"===a)return(0,i.jsx)(m.A,{...v,...r,value:t,onChange:n});if("NumberPicker"===a)return(0,i.jsx)(A.NumberPicker,{...v,...r,value:t,onChange:n});if("Switch"===a)return(0,i.jsx)(f.A,{...v,...r,checked:!!t,onChange:n});if("Select"===a){let e=v;return Array.isArray(null==e?void 0:e.options)&&e.options.length>0?e={...e,options:(0,F.ZY)(e.options,l)}:g&&(e={...e,options:g}),(0,i.jsx)(s.A,{...e,...r,value:(0,F.xO)(t,e),onChange:n})}return"DateFilterDynamicComponent"===a?(0,i.jsx)(O,{...v,...r,value:t,onChange:n}):(0,i.jsx)(d.A,{...v,...r,value:t,onChange:e=>{var t;return null==n?void 0:n(null==e||null==(t=e.target)?void 0:t.value)}})}}let L=[{value:"$includes",label:"contains",selected:!0},{value:"$notIncludes",label:"does not contain"},{value:"$eq",label:"is"},{value:"$ne",label:"is not"},{value:"$empty",label:"is empty",noValue:!0},{value:"$notEmpty",label:"is not empty",noValue:!0}],V=new Set(["$in","$notIn"]);function q(e,t){let l=Array.isArray(e)?e:[],n=Array.isArray(t)?t:[];if(!n.length)return l;let r=n.find(e=>(null==e?void 0:e.name)==="item");if(!r)return[...n,...l];let i=(0,N.mD)(l,[r]);return[...n.filter(e=>(null==e?void 0:e.name)!=="item"),...i]}function z(e,t){var l,n;return{name:t.name,title:t.title||t.name,type:(null==(l=t.schema)?void 0:l.type)||"string",interface:(null==(n=t.schema)?void 0:n["x-component"])==="Select"?"select":"input",uiSchema:{...t.schema||{},"x-filter-operators":t.operators},paths:[...e.paths||[],t.name],parentTitles:[...e.parentTitles||[],e.title]}}async function K(e,t){var l,n;let r=e.interface&&t?t(e.interface):void 0,i=(Array.isArray(null==r||null==(l=r.filterable)?void 0:l.children)?null==r||null==(n=r.filterable)?void 0:n.children:[]).map(t=>z(e,t)),o=async e=>{let l=[...await Promise.all(e.map(e=>K(e,t))),...i];return D()(l,e=>e.name)};if("function"==typeof e.children){let t=e.children;return{...e,children:async()=>{let e=await t(),l=Array.isArray(e)?e:[];return await o(l)}}}return Array.isArray(e.children)?{...e,children:await o(e.children)}:i.length?{...e,children:i}:e}async function U(e,t){let l=Array.isArray(e)?e:[];return await Promise.all(l.map(e=>K(e,t)))}let W=(0,o.observer)(e=>{var t;let{value:l,model:n,extraMetaTree:r,maxAssociationFieldDepth:c}=e,p=(0,o.useFlowViewContext)(),h=n.translate,{path:m,operator:f,value:g}=l||{},[v,y]=(0,u.useState)(null),x=(0,u.useRef)(!1),S=(0,u.useMemo)(()=>{if(v){var e,t,l;let r=v.interface?(0,b.w6)(v.interface,n.context.dataSourceManager,null==(e=n.context.app)?void 0:e.dataSourceManager):void 0,i=null==v||null==(t=v.uiSchema)?void 0:t["x-filter-operators"];return((Array.isArray(i)&&i.length?i:null==r||null==(l=r.filterable)?void 0:l.operators)||L).filter(e=>!e.visible||e.visible(v)).map(e=>({value:e.value,label:e.label,noValue:!!e.noValue,schema:e.schema,selected:!!e.selected}))}return[]},[v,n]),M=(0,u.useMemo)(()=>S.map(e=>({value:e.value,label:"string"==typeof e.label?h(e.label):e.label})),[S,h]);(0,u.useEffect)(()=>{if(0!==S.length){if(!f){if(x.current){let e=S.find(e=>e.selected)||S[0];l.operator=(null==e?void 0:e.value)||"",(null==e?void 0:e.noValue)?(l.value=!0,l.noValue=!0):l.noValue=!1,x.current=!1}return}if(!S.some(e=>e.value===f)){let e=S.find(e=>e.selected)||S[0];l.operator=(null==e?void 0:e.value)||"",(null==e?void 0:e.noValue)?(l.value=!0,l.noValue=!0):l.noValue=!1}}},[S,f,l]);let A=(0,u.useMemo)(()=>S.find(e=>e.value===f),[S,f]),C=(0,u.useMemo)(()=>{let e=(null==v?void 0:v.uiSchema)||{},t=(null==A?void 0:A.schema)||{};return w()({},e,t)},[v,A]),P=(0,u.useRef)(h);(0,u.useEffect)(()=>{P.current=h},[h]);let j=(0,u.useCallback)(e=>{var t;return(null==(t=P.current)?void 0:t.call(P,e))??e},[]),E=(0,u.useMemo)(()=>B(C,v,j),[C,v,j]),R=(0,u.useMemo)(()=>(0,F.di)(null==C?void 0:C.enum,j)||[],[C,j]),I=(0,u.useMemo)(()=>{let e=(0,k._H)(n.context.app,f,S),t=V.has(f);if(!e||!t)return E;let{Comp:l,props:r}=e;return e=>{let{value:t,onChange:n,...o}=e||{},a={...r},s=Array.isArray(a.options)?a.options:void 0;(!s||0===s.length)&&R.length>0&&(a.options=R);let d=Array.isArray(t)?t:"string"==typeof t?t.split(/\r?\n/).map(e=>e.trim()).filter(Boolean):[];return(0,i.jsx)(l,{...a,...o,value:d,onChange:n,style:{width:200,...(0,k.VS)(a.style),...(0,k.VS)(null==o?void 0:o.style)}})}},[R,n.context.app,S,f,E]),T=(0,u.useMemo)(()=>function(){return(0,i.jsx)(d.A,{placeholder:`<${h("Null")}>`,readOnly:!0})},[h]),_=(0,u.useMemo)(()=>async()=>{let e=q((null==n?void 0:n.context.getPropertyMetaTree())||p.getPropertyMetaTree(),r);return $([{title:h("Constant"),name:"constant",type:"string",paths:["constant"]},{title:h("Null"),name:"null",type:"object",paths:["null"]},...e],c)},[p,n,h,r,c]),D=(0,u.useCallback)(async()=>{var e,t;let l=(null==n||null==(t=n.context)||null==(e=t.getPropertyMetaTree)?void 0:e.call(t))||p.getPropertyMetaTree(),i=q(Array.isArray(l)?l:[],r),o=e=>{var t;return(0,b.w6)(e,n.context.dataSourceManager,null==(t=n.context.app)?void 0:t.dataSourceManager)};return $(await U(i,o),c)},[p,n,r,c]),N=(0,u.useMemo)(()=>({renderInputComponent:e=>{var t;let l=null==e||null==(t=e.paths)?void 0:t[0];return"constant"===l?I:"null"===l?T:null},resolveValueFromPath:e=>{var t;let l=null==e||null==(t=e.paths)?void 0:t[0];return"constant"===l?"":"null"===l?null:void 0},resolvePathFromValue:e=>{if(null===e)return["null"];let t=(0,o.parseValueToPath)(e);return t||["constant"]}}),[T,I]),O=(0,u.useCallback)((e,t)=>{let n=l.path||"",r=e||"",i=r!==n;l.path=r,i&&n&&(l.operator="",l.value="",x.current=!0),n||!r||l.operator||(x.current=!0),t&&y(t)},[l]),z=(0,u.useCallback)(e=>{let t=l.operator;l.operator=e;let n=S.find(t=>t.value===e);(null==n?void 0:n.noValue)?(l.value=!0,l.noValue=!0):(V.has(t)&&!V.has(e)&&Array.isArray(l.value)&&(l.value=l.value.join("\n")),l.noValue=!1)},[l,S]);return(0,i.jsxs)(a.A,{wrap:!0,style:{width:"100%"},children:[(0,i.jsx)(o.VariableInput,{value:m,onChange:O,metaTree:D,showValueComponent:!0,style:{flex:"1 1 40%",minWidth:160,maxWidth:"100%"},placeholder:h("Select variable"),onlyLeafSelectable:!0}),(0,i.jsx)(s.A,{style:{flex:"0 0 140px",minWidth:120,maxWidth:"100%"},placeholder:h("Comparison"),value:f||void 0,onChange:z,children:M.map(e=>(0,i.jsx)(s.A.Option,{value:e.value,children:e.label},e.value))}),!(null==(t=S.find(e=>e.value===f))?void 0:t.noValue)&&(0,i.jsx)(o.VariableInput,{value:g,onChange:e=>l.value=e,metaTree:_,converters:N,showValueComponent:!0,style:{flex:"1 1 40%",minWidth:160,maxWidth:"100%"},placeholder:h("Enter value"),clearValue:""})]})});var H=l(17669)},10925(e,t,l){l.d(t,{W:()=>o});let n=new Set(["m2o","o2o","oho","obo","o2m","m2m","linkTo"]);function r(e){let t=(null==e?void 0:e.options)||{};return!!(t.target||t.targetCollection||t.foreignKey||t.through||n.has(String((null==e?void 0:e.interface)||"")))}function i(e,t,l){let n=r(e),i=t+ +!!n;if(n&&i>l)return null;let a=e=>Array.isArray(e)?o(e,{associationDepth:i,maxAssociationDepth:l}):async()=>{let t=await e();return o(Array.isArray(t)?t:[],{associationDepth:i,maxAssociationDepth:l})};return{...e,children:e.children?a(e.children):void 0}}function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{associationDepth:l=0,maxAssociationDepth:n=2}=t;return Array.isArray(e)?e.map(e=>i(e,l,n)).filter(Boolean):[]}},17669(e,t,l){l.d(t,{u:()=>o});var n=l(96540),r=l(44e3);let i=e=>e;function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{filterableFieldNames:l,nonfilterableFieldNames:o,noIgnore:a=!1,t:s=i}=t,d=(0,n.useMemo)(()=>(null==e?void 0:e.getFields())||[],[e]),u=(0,n.useMemo)(()=>{let e=!a&&(null==l?void 0:l.length)?d.map(e=>e.name).filter(e=>!l.includes(e)):[],t=o??[];return t.length?Array.from(new Set([...e,...t])):e},[d,l,o,a]);return(0,n.useMemo)(()=>(0,r.H)(d.filter(e=>"attachments"!==e.target&&"formula"!==e.interface),1,u,s).filter(Boolean),[d,u,s])}},39580(e,t,l){l.d(t,{b2:()=>r.b,tn:()=>n.t,S5:()=>r.S});var n=l(27941);l(74848),l(98668),l(43627),l(11869),l(96540),l(74979),l(21335);var r=l(36869);l(95266),l(47785)},51612(e,t,l){l.d(t,{g:()=>v});var n=l(74848),r=l(96540),i=l(40098),o=l.n(i),a=l(70413);let s=o().memoize(async e=>{if(!e)return e;let t=await Promise.all([l.e("2512"),l.e("32")]).then(l.bind(l,86419));return(0,a.$P)(t.default.render(e))});function d(e){let[t,l]=(0,r.useState)(""),[n,i]=(0,r.useState)(!0);return(0,r.useEffect)(()=>{i(!0),s(e).then(e=>{l(e),i(!1)}).catch(e=>console.log(e))},[e]),{html:t,loading:n}}function u(e){let t=e,l=document.createElement("div");l.innerHTML=t;let n=l.innerText;return l=null,(null==n?void 0:n.replace(/[\n\r]/g,""))||""}var c=l(24978),p=l(22803),h=l(11869),m=l(35710);let f=()=>{let e=(0,h.useFlowContext)(),{token:t}=m.A.useToken(),l=!!e.isDarkTheme,n=new c.q(t.colorFillAlter).onBackground(t.colorBgContainer).toHexShortString(),r={lineHeight:"inherit","&.nb-markdown-default":{"pre code.hljs":{display:"block",overflowX:"auto",padding:"1em"},"code.hljs":{padding:"3px 5px"},":not(pre) code":{padding:"2px 5px",color:"#d56161",background:t.colorFillQuaternary,border:`1px solid ${t.colorBorder}`,borderRadius:t.borderRadiusSM},blockquote:{borderLeft:"4px solid #ccc",paddingLeft:"20px",marginLeft:"0",color:"#666",fontStyle:"italic"},img:{maxWidth:"100%"},".hljs":{background:"#f8f8f8",color:"#444"},".hljs-comment":{color:"#697070"},".hljs-punctuation,.hljs-tag":{color:"#444a"},".hljs-tag .hljs-attr,.hljs-tag .hljs-name":{color:"#444"},".hljs-attribute,.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-name,.hljs-selector-tag":{fontWeight:700},".hljs-deletion,.hljs-number,.hljs-quote,.hljs-selector-class,.hljs-selector-id,.hljs-string,.hljs-template-tag,.hljs-type":{color:"#800"},".hljs-section,.hljs-title":{color:"#800",fontWeight:700},".hljs-link,.hljs-operator,.hljs-regexp,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-symbol,.hljs-template-variable,.hljs-variable":{color:"#ab5656"},".hljs-literal":{color:"#695"},".hljs-addition,.hljs-built_in,.hljs-bullet,.hljs-code":{color:"#397300"},".hljs-meta":{color:"#1f7199"},".hljs-meta .hljs-string":{color:"#38a"},".hljs-emphasis":{fontStyle:"italic"},".hljs-strong":{fontWeight:700}},"&.nb-markdown-table":{table:{borderCollapse:"collapse",width:"100%",fontFamily:"Arial, sans-serif",marginBottom:"1.5rem"},"th, td":{borderBottom:`1px solid ${t.colorBorderSecondary}`,padding:`${t.paddingContentVertical}px ${t.paddingContentHorizontal}px`,textAlign:"left"},th:{backgroundColor:n,fontWeight:"bold",color:t.colorText},"tr:hover":{backgroundColor:t.colorFillTertiary},"tr:last-child td":{borderBottom:"none"},"tr:first-child th":{borderTop:"none"}}},i={"&.nb-markdown-default":{"pre code.hljs":{display:"block",overflowX:"auto",padding:"1em"},"code.hljs":{padding:"3px 5px"},":not(pre) code":{padding:"2px 5px",color:"#d56161",background:t.colorFillQuaternary,border:`1px solid ${t.colorBorder}`,borderRadius:t.borderRadiusSM},".hljs":{color:"#adbac7",background:"#22272e"},".hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_":{color:"#f47067"},".hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_":{color:"#dcbdfb"},".hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable":{color:"#6cb6ff"},".hljs-meta .hljs-string,.hljs-regexp,.hljs-string":{color:"#96d0ff"},".hljs-built_in,.hljs-symbol":{color:"#f69d50"},".hljs-code,.hljs-comment,.hljs-formula":{color:"#768390"},".hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag":{color:"#8ddb8c"},".hljs-subst":{color:"#adbac7"},".hljs-section":{color:"#316dca",fontWeight:700},".hljs-bullet":{color:"#eac55f"},".hljs-emphasis":{color:"#adbac7",fontStyle:"italic"},".hljs-strong":{color:"#adbac7",fontWeight:700},".hljs-addition":{color:"#b4f1b4",backgroundColor:"#1b4721"},".hljs-deletion":{color:"#ffd8d3",backgroundColor:"#78191b"}},"&.nb-markdown-table":{table:{borderCollapse:"collapse",width:"100%",fontFamily:"Arial, sans-serif",marginBottom:"1.5rem"},"th, td":{borderBottom:`1px solid ${t.colorBorderSecondary}`,padding:`${t.paddingContentVertical}px ${t.paddingContentHorizontal}px`,textAlign:"left"},th:{backgroundColor:n,fontWeight:"bold",color:t.colorText},"tr:hover":{backgroundColor:t.colorFillTertiary},"tr:last-child td":{borderBottom:"none"},"tr:first-child th":{borderTop:"none"}}};return(0,p.css)({lineHeight:t.lineHeight,"& > *:last-child":{marginBottom:"0"},".ant-description-textarea, .ant-description-input":{lineHeight:t.lineHeight},".field-interface-datetime":{minWidth:"100px"},img:{maxWidth:"100%"},...l?i:r})};var g=l(42443);let v=e=>{let{textOnly:t,overflowMode:l,style:i}=e,o=f(),{html:a=""}=d(e.value),s=u(a),c="ellipsis"===l,p=(0,r.useRef)(null),[h,m]=(0,r.useState)(!1);(0,r.useEffect)(()=>{if(p.current){let e=p.current;m(e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight)}},[a,i,l]);let v={...i||{},...c?{display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal",wordBreak:"break-word",cursor:"default"}:{}},y=(0,n.jsx)("div",{ref:p,className:`${o} nb-markdown`,dangerouslySetInnerHTML:{__html:t?s:a},style:v});return c&&h?(0,n.jsx)(g.A,{title:(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:a},style:{maxHeight:500,overflowY:"auto",padding:10,color:"#000"}}),overlayInnerStyle:{background:"#fff",color:"#000",boxShadow:"0 2px 8px rgba(0,0,0,0.15)"},color:"#fff",children:y}):y}},85352(e,t,l){function n(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Array.isArray(e)?e.map(e=>{if(e&&"object"==typeof e&&!Array.isArray(e)){let t=e,l=void 0!==t.label,n=void 0!==t.value,r=l?t.label:String(t.value??""),i=n?t.value:r,o={label:r,value:i};return t.color&&(o.color=t.color),t.icon&&(o.icon=t.icon),o}return{label:String(e),value:e}}):[]}function r(e){return"string"==typeof e&&/\{\{\s*t\s*\(/.test(e)}function i(e,t){return r(e)?t(e):e}function o(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return Array.isArray(e)?e.map(e=>({...e,label:i(null==e?void 0:e.label,t)})):[]}function a(e,t){if(e&&Array.isArray(e)&&0!==e.length)return o(n(e),t)}function s(e,t){let l=null==t?void 0:t.mode,n="multiple"===l||"tags"===l||(null==t?void 0:t.multiple)===!0;return Array.isArray(e)?e.filter(e=>""!==e&&null!=e):""===e||null==e?n?[]:void 0:e}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(Array.isArray(e)?e:null==e?[]:[e]).map(e=>{var l;let n=t.find(t=>(null==t?void 0:t.value)===e);return n?{value:e,label:n.label}:{value:e,label:(null==e||null==(l=e.toString)?void 0:l.call(e))??e}})}function u(e,t){var l,r,i,o;if(!["radioGroup","checkboxGroup","select","multipleSelect"].includes(null==t?void 0:t.interface)||Array.isArray(null==(l=e.props)?void 0:l.options)&&(null==(i=e.props)||null==(r=i.options)?void 0:r.length)>0)return!1;let a=null==(o=t.uiSchema)?void 0:o.enum;if(!Array.isArray(a)||0===a.length)return!1;let s=n(a);return!!s.length&&(e.setProps({options:s}),!0)}l.d(t,{NI:()=>u,OL:()=>i,ZY:()=>o,di:()=>a,xO:()=>s,yg:()=>d})},13940(e,t,l){l.d(t,{E4:()=>i,Gj:()=>d,a_:()=>n,eo:()=>p,pX:()=>s,w7:()=>o});let n="__custom__";function r(e){return`${n}:${e}`}function i(e){var t;if(!e||"object"!=typeof e)return!1;let l=e;if(!(null==(t=l.isAssociationField)?void 0:t.call(l)))return!1;let n=l.type,r=l.interface;return"belongsToMany"===n||"hasMany"===n||"belongsToArray"===n||"m2m"===r||"o2m"===r||"mbm"===r}function o(e){var t;if(!e||"object"!=typeof e)return;let l=e;return l.collection||(null==(t=l.context)?void 0:t.collection)||void 0}function a(e){return"string"==typeof e?e.trim():""}function s(e){if(!e||"object"!=typeof e)return[];let t=e,l="function"==typeof t.getStepParams?t.getStepParams("fieldSettings","init"):void 0,n=l&&"object"==typeof l?l:void 0,i="function"==typeof t.getStepParams?t.getStepParams("formItemSettings","fieldSettings"):void 0,o=i&&"object"==typeof i?i:void 0,s=(null==n?void 0:n.fieldPath)??t.fieldPath,d=(null==n?void 0:n.associationPathName)??t.associationPathName,u=null==o?void 0:o.name,c=a(s),p=a(d),h=a(u),m=new Set;return c&&m.add(c),p&&(c?c.startsWith(`${p}.`)?m.add(c):m.add(`${p}.${c}`):m.add(p)),h&&m.add(r(h)),Array.from(m)}function d(e){return s(e)[0]}function u(e){if(!e||"object"!=typeof e)return[];let t=e.subModels;if(!t||"object"!=typeof t)return[];let l=t.items;if(Array.isArray(l))return l;let n=t.grid;if(!n||"object"!=typeof n)return[];let r=n.subModels;if(!r||"object"!=typeof r)return[];let i=r.items;return Array.isArray(i)?i:[]}function c(e){if(!e||"object"!=typeof e)return[];let t=e.subModels;return t&&"object"==typeof t?u(t.field):[]}function p(e,t){let l=a(t);if(!l)return null;let n=e=>{if(!Array.isArray(e))return null;for(let t of e){if(s(t).some(e=>e===l))return t;let e=n(c(t));if(e)return e}return null};return n(u(e))}},53869(e,t,l){l.d(t,{VS:()=>a,_H:()=>u,i2:()=>c,sI:()=>h});var n=l(96540),r=l(13595),i=l(85352);function o(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function a(e){return o(e)?e:void 0}function s(e){return e}function d(e){var t;let l=s(e);l._reactiveWrapperCache=void 0,null==(t=l.setupReactiveRender)||t.call(l)}function u(e,t,l){let n;if(!l||!Array.isArray(l))return null;let i=l.find(e=>(null==e?void 0:e.value)===t),a=null==i?void 0:i.schema,s=null==a?void 0:a["x-component"];if(!s)return null;if("DateFilterDynamicComponent"===s)n=r.DateFilterDynamicComponent;else{var d;n=null==e||null==(d=e.getComponent)?void 0:d.call(e,s)}return n?{Comp:n,props:o(null==a?void 0:a["x-component-props"])?a["x-component-props"]:{}}:null}function c(e){let t=s(e);return!!t&&"function"==typeof t.__originalRender&&(t.render=t.__originalRender,d(t),!0)}function p(e,t){return Array.isArray(e.options)&&"function"==typeof t?{...e,options:(0,i.ZY)(e.options,t)}:e}function h(e){let{app:t,fieldModel:l,operator:r,operators:i,propsPriority:o="field",style:h}=e,m=s(l),f=u(t,r,i);if(!f)return c(m),!1;m.__originalRender||"function"!=typeof m.render||(m.__originalRender=m.render);let{Comp:g,props:v}=f,y=a(v.style);return m.render=()=>{let e=m.props||{},t=a(e.style),l=p("operator"===o?{...e,...v}:{...v,...e},m.translate),r="operator"===o?{...t,...y}:{...y,...t},i={...h||{},...r};return n.createElement(g,{...l,...Object.keys(i).length>0?{style:i}:{},onCompositionStart:null,onCompositionEnd:null})},d(m),!0}},25359(e,t,l){l.d(t,{ON:()=>i,jI:()=>r});let n="__saveStepParamsWithSubModels";function r(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw Error("[saveStepParamsWithSubModels] model is not an object");e[n]=!0}async function i(e,t){if(!e||"object"!=typeof e&&"function"!=typeof e)throw Error("[saveStepParamsWithSubModels] model is not an object");let l=e;if(!0!==l[n])return await t();if("function"!=typeof l.save)throw Error("[saveStepParamsWithSubModels] model.save is not a function");try{return await l.save()}finally{delete l[n]}}},14252(e,t,l){l.d(t,{S0:()=>o.S0,_T:()=>o._T,s5:()=>o.s5});var n=l(11869),r=l(2077);l(96540);var i=l(2117),o=l(52717);o.S0.registerFlow({key:"buttonSettings",title:(0,n.tExpr)("Button settings"),sort:-999,steps:{general:{title:(0,n.tExpr)("Edit button"),uiSchema:e=>({title:e.model.enableEditTitle?{"x-decorator":"FormItem","x-component":"Input",title:(0,n.tExpr)("Button title")}:void 0,tooltip:e.model.enableEditTooltip?{"x-decorator":"FormItem","x-component":"Input",title:(0,n.tExpr)("Button tooltip")}:void 0,icon:e.model.enableEditIcon?{"x-decorator":"FormItem","x-component":"IconPicker",title:(0,n.tExpr)("Button icon")}:void 0,iconOnly:e.model.enableEditIcon?{"x-decorator":"FormItem","x-component":"Switch",title:(0,n.tExpr)("Icon only")}:void 0,type:e.model.enableEditType?{"x-decorator":"FormItem","x-component":"Radio.Group",title:(0,n.tExpr)("Button type"),enum:e.model.buttonTypeOptions}:void 0,danger:e.model.enableEditDanger?{"x-decorator":"FormItem","x-component":"Switch",title:(0,n.tExpr)("Danger action")}:void 0,color:e.model.enableEditColor?{"x-decorator":"FormItem","x-component":r.sk,title:(0,n.tExpr)("Color")}:void 0}),defaultParams(e){var t,l;let n=e.model.defaultProps||{};return e.model.enableEditColor?{...n,color:(null==(t=e.model.props)?void 0:t.color)??n.color??(null==(l=e.themeToken)?void 0:l.colorPrimary)}:n},handler(e,t){let{title:l,tooltip:n,...r}=t;e.model.setProps({title:e.t(l,{ns:"lm-flow-engine"}),tooltip:e.t(n,{ns:"lm-flow-engine"}),...r})}},linkageRules:{use:"actionLinkageRules"}}}),o.S0.registerFlow({key:"buttonAclSettings",steps:{aclCheck:{use:"aclCheck"}}}),o.S0.registerFlow({key:"paginationChange",on:"paginationChange",steps:{aclCheckRefresh:{use:"aclCheckRefresh"},linkageRulesRefresh:{use:"linkageRulesRefresh",defaultParams:{actionName:"actionLinkageRules",flowKey:"buttonSettings",stepKey:"linkageRules"}}}}),o.S0.registerEvents({click:{title:(0,n.tExpr)("Click"),name:"click",uiSchema:{condition:{type:"object",title:(0,n.tExpr)("Trigger condition"),"x-decorator":"FormItem","x-component":i.H}},handler:i.b}})},52717(e,t,l){l.d(t,{S0:()=>f,_T:()=>h,s5:()=>m});var n=l(50467),r=l(74848),i=l(11869),o=l(2930),a=l(42443),s=l(71021),d=l(40098),u=l.n(d),c=l(96540),p=l(18492);function h(e){let{t}=(0,p.B)(),l=(0,i.useFlowModel)(),n=l.context.blockModel,o=e.collection||n.collection,s=o.dataSource,d=(0,c.useMemo)(()=>{let e=`${t(s.displayName||s.key)} > `,l=o?`${t(o.title)||o.name||o.tableName} `:"";return`${e}${l}`},[o,s.displayName,s.key,t]),{actionName:h}=(null==e?void 0:e.forbidden)||l.forbidden,m=(0,c.useMemo)(()=>t('The current user only has the UI configuration permission, but don\'t have "{{actionName}}" permission for collection "{{name}}"',{name:d,actionName:t(u().capitalize(h))}).replaceAll(">",">"),[h,d,t]);return(0,r.jsx)(a.A,{title:e.message||m,children:e.children})}let m={collection:"collection",record:"record",all:["collection","record"],both:["collection","record"]};class f extends i.FlowModel{static _getScene(){return u().castArray(this.scene||[])}static _isScene(e){return this._getScene().includes(e)}getAclActionName(){return null}onInit(e){super.onInit(e),delete this.props.disabled,this.context.defineProperty("actionName",{get:()=>this.getAclActionName(),cache:!1})}serialize(){let e=super.serialize();return delete e.props.disabled,e}getInputArgs(){let e={},t=[];if(this.context.resource){let l=this.context.resource.getSourceId();l&&(e.sourceId=l,t.push("sourceId"))}if(this.context.collection&&this.context.record){let l=this.context.collection.getFilterByTK(this.context.record);l&&(e.filterByTk=l,t.push("filterByTk"))}return t.length&&(e.defaultInputKeys=t),e}onClick(e){this.dispatchEvent("click",{event:e,...this.getInputArgs()},{debounce:!0})}getTitle(){return this.props.title}getIcon(){return this.props.icon}renderButton(){let{iconOnly:e,...t}=this.props,l=this.getIcon()?(0,r.jsx)(o.In,{type:this.getIcon()}):void 0,n=e&&l?null:t.children||this.getTitle();return(0,r.jsx)(s.Ay,{...t,onClick:this.onClick.bind(this),icon:l,children:n})}render(){return this.props.tooltip?(0,r.jsx)(a.A,{title:this.props.tooltip,children:this.renderButton()}):this.renderButton()}renderHiddenInConfig(){let{iconOnly:e,...t}=this.props,l=this.getIcon()?(0,r.jsx)(o.In,{type:this.getIcon()}):void 0,n=e&&l?null:t.children||this.getTitle();return this.forbidden?(0,r.jsx)(h,{children:(0,r.jsx)(s.Ay,{...t,onClick:this.onClick.bind(this),icon:l,style:{opacity:"0.3"},children:n})}):(0,r.jsx)(a.A,{title:this.context.t("The button is hidden and only visible when the UI Editor is active"),children:(0,r.jsx)(s.Ay,{...t,onClick:this.onClick.bind(this),icon:l,style:{opacity:"0.3"},children:n})})}constructor(...e){super(...e),(0,n._)(this,"defaultProps",{type:"default",title:(0,i.tExpr)("Action"),iconOnly:!1}),(0,n._)(this,"enableEditTooltip",!0),(0,n._)(this,"enableEditTitle",!0),(0,n._)(this,"enableEditIcon",!0),(0,n._)(this,"enableEditType",!0),(0,n._)(this,"enableEditDanger",!0),(0,n._)(this,"enableEditColor",!1),(0,n._)(this,"buttonTypeOptions",[{value:"default",label:'{{t("Default")}}'},{value:"primary",label:'{{t("Primary")}}'},{value:"dashed",label:'{{t("Dashed")}}'},{value:"link",label:'{{t("Link")}}'},{value:"text",label:'{{t("Text")}}'}])}}},15892(e,t,l){l.d(t,{P:()=>w,z:()=>S});var n=l(50467),r=l(74848),i=l(95243),o=l(11869),a=l(40098),s=l.n(a),d=l(96540),u=l(42443),c=l(39580),p=l(2117),h=l(92275),m=l(18492),f=l(27941);function g(e){return"function"==typeof(null==e?void 0:e.getResourceSettingsInitParams)?e.getResourceSettingsInitParams():"function"==typeof(null==e?void 0:e.getStepParams)?e.getStepParams("resourceSettings","init"):void 0}function v(e,t){var l,n,r,i,o,a,s;let d=(null==e||null==(l=e.context)?void 0:l.blockModel)||e,u=g(d)||{},c=(null==d||null==(n=d.context)?void 0:n.collection)||(null==d?void 0:d.collection)||(null==e||null==(r=e.context)?void 0:r.collection),p=(null==c?void 0:c.dataSource)||(null==d||null==(i=d.context)?void 0:i.dataSource)||(null==d?void 0:d.dataSource)||(null==e?void 0:e.dataSource),h=(null==p?void 0:p.key)||(null==c?void 0:c.dataSourceKey)||u.dataSourceKey,m=(null==c?void 0:c.title)||(null==c?void 0:c.name)||(null==c?void 0:c.tableName)||(null==e||null==(o=e.resource)?void 0:o.resourceName)||(null==e||null==(s=e.resource)||null==(a=s.getResourceName)?void 0:a.call(s))||u.associationName||u.collectionName,f=p?t(p.displayName||p.key):h,v=m?`${t(m)||m}`:"",y=f?`${t(f)} > `:"";return{dataSourceName:f,nameValue:`${y}${v}`,isDataSourceUnavailable:!!(h&&!p)}}function y(e){let{dataSourceName:t}=e,{t:l}=(0,m.B)(),n=t?l('The data source "{{name}}" used by this block is disabled or unavailable. Enable the data source to display this block.',{name:t}):l("The data source used by this block is disabled or unavailable. Enable the data source to display this block.");return(0,r.jsx)(f.t,{children:(0,r.jsx)(h.Ay,{status:"403",subTitle:n})})}let b=()=>{let{t:e}=(0,m.B)(),t=(0,o.useFlowModel)(),{dataSourceName:l,isDataSourceUnavailable:n,nameValue:i}=(0,d.useMemo)(()=>v(t,e),[t,e]),{actionName:a}=t.forbidden||{},u=(0,d.useMemo)(()=>e('The current user only has the UI configuration permission, but don\'t have "{{actionName}}" permission for collection "{{name}}"',{name:i,actionName:e(s().capitalize(a))}).replaceAll(">",">"),[a,i,e]);return n?t.context.flowSettingsEnabled?(0,r.jsx)(y,{dataSourceName:l}):null:(0,r.jsx)(f.t,{children:(0,r.jsx)(h.Ay,{status:"403",subTitle:u})})};function x(){let{t:e}=(0,m.B)(),t=(0,o.useFlowModel)(),{dataSourceName:l,isDataSourceUnavailable:n,nameValue:i}=(0,d.useMemo)(()=>v(t,e),[t,e]),a=(0,d.useMemo)(()=>e('The {{type}} "{{name}}" may have been deleted. Please remove this {{blockType}}.',{type:e("Collection"),name:i,blockType:e("Block")}).replaceAll(">",">"),[i,e]);return n?t.context.flowSettingsEnabled?(0,r.jsx)(y,{dataSourceName:l}):null:(0,r.jsx)(f.t,{children:(0,r.jsx)(h.Ay,{status:"404",subTitle:a})})}let w={new:"new",one:"one",many:"many",select:"select",filter:"filter",oam:["one","many"],subForm:"subForm",bulkEditForm:"bulkEditForm"};class S extends o.FlowModel{setFilterActive(e,t){this.activeFilterSources.set(e,t)}hasActiveFilters(){let e=this.resource;if(e&&e.filter&&Object.keys(e.filter).length>0)return!0;for(let[,e]of this.activeFilterSources)if(e)return!0;return!1}removeFilterSource(e){this.activeFilterSources.delete(e)}getDataLoadingMode(){var e;let t=this.getStepParams("dataLoadingModeSettings");return(null==t||null==(e=t.dataLoadingMode)?void 0:e.mode)||"auto"}static _getScene(){return s().castArray(this.scene||[])}static _isScene(e){return this._getScene().includes(e)}getModelClassName(e){return Object.keys(this.customModelClasses).includes(e)?this.customModelClasses[e]:this._defaultCustomModelClasses[e]||e}renderHiddenInConfig(){return this.forbidden?(0,r.jsx)(b,{}):(0,r.jsx)(u.A,{title:this.context.t("The block is hidden and only visible when the UI Editor is active"),children:(0,r.jsx)(c.tn,{ref:this.context.ref,...this.decoratorProps,style:{opacity:"0.3"},children:(0,r.jsx)(this.ObservedRenderComponent,{})})})}onInit(e){super.onInit(e),this.context.defineProperty("blockModel",{value:this}),this.context.defineMethod("getModelClassName",e=>this.getModelClassName(e)),this.ObservedRenderComponent=(0,o.observer)(()=>this.renderComponent(),{displayName:"ObservedRenderComponent"})}setDecoratorProps(e){Object.assign(this.decoratorProps,e)}get title(){return this._title||(this._title=this.defaultBlockTitle()),this._title}defaultBlockTitle(){var e;return`${this.translate((null==(e=this.constructor.meta)?void 0:e.label)||this.constructor.name)}`}renderComponent(){throw Error("renderComponent method must be implemented in subclasses of BlockModel")}render(){return this.collectionRequired&&!this.context.collection?(0,r.jsx)(x,{}):(0,r.jsx)(c.tn,{ref:this.context.ref,...this.decoratorProps,children:(0,r.jsx)(this.ObservedRenderComponent,{})})}constructor(...e){super(...e),(0,n._)(this,"decoratorProps",(0,i.observable)({})),(0,n._)(this,"_defaultCustomModelClasses",{}),(0,n._)(this,"customModelClasses",{}),(0,n._)(this,"collectionRequired",!1),(0,n._)(this,"ObservedRenderComponent",null),(0,n._)(this,"activeFilterSources",new Map)}}(0,n._)(S,"scene",void 0),S.registerFlow({key:"cardSettings",title:(0,o.tExpr)("Card settings"),steps:{titleDescription:{title:(0,o.tExpr)("Title & description"),uiSchema:{title:{"x-component":"Input","x-decorator":"FormItem",title:(0,o.tExpr)("Title")},description:{"x-component":"Input.TextArea","x-decorator":"FormItem",title:(0,o.tExpr)("Description")}},handler(e,t){let l=e.t(t.title,{ns:"lm-flow-engine"}),n=e.t(t.description,{ns:"lm-flow-engine"});e.model.setDecoratorProps({title:l,description:n})}},linkageRules:{use:"blockLinkageRules"},blockHeight:{use:"blockHeight"}}}),S.define({hide:!0,label:(0,o.tExpr)("Other blocks")}),o.FlowModel.registerEvents({beforeRender:{title:(0,o.tExpr)("Before render"),name:"beforeRender",uiSchema:{condition:{type:"object",title:(0,o.tExpr)("Trigger condition"),"x-decorator":"FormItem","x-component":p.H}},handler:p.b}})},72380(e,t,l){l.d(t,{U:()=>i});var n=l(11869),r=l(14252);class i extends r.S0{}i.define({children:async e=>(await (0,n.buildSubModelItems)(r.S0)(e)).filter(t=>e.engine.getModelClass(t.useModel)._isScene(r.s5.collection))})},52175(e,t,l){l.d(t,{t:()=>u});var n=l(50467),r=l(11869),i=l(40098),o=l.n(i),a=l(42632),s=l(94130),d=l(5679);class u extends d.R{onMount(){super.onMount(),this.previousBeforeRenderHash=this.context.location.search}getDirtyTrackingVersion(e,t,l,n){var r;let i=new Set,o=(null==l||null==(r=l.getResourceName)?void 0:r.call(l))||n.associationName||n.collectionName;o&&i.add(String(o)),n.associationName&&i.add(String(n.associationName)),n.collectionName&&i.add(String(n.collectionName));let a=0;for(let l of i)a+=e.getDataSourceDirtyVersion(t,l);return a}onActive(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.hidden&&this.previousBeforeRenderHash!==this.context.location.search&&(this.rerender(),!e)||this.hidden)return;let t=this.context.resource;if(!t)return;let l=this.getResourceSettingsInitParams(),n=t.getDataSourceKey()||l.dataSourceKey||"main",r=this.context.engine,i=this.getDirtyTrackingVersion(r,n,t,l);if(e){if(this.dirtyRefreshing)return;this.dirtyRefreshing=!0,t.refresh().then(()=>{this.lastSeenDirtyVersion=this.getDirtyTrackingVersion(r,n,t,l)}).catch(()=>{}).finally(()=>{this.dirtyRefreshing=!1});return}this.isManualRefresh||null!==this.lastSeenDirtyVersion&&i===this.lastSeenDirtyVersion||this.dirtyRefreshing||(this.dirtyRefreshing=!0,t.refresh().then(()=>{this.lastSeenDirtyVersion=this.getDirtyTrackingVersion(r,n,t,l)}).catch(()=>{}).finally(()=>{this.dirtyRefreshing=!1}))}static filterCollection(e){return!!e.filterTargetKey}static isCollectionAvailable(e){if(!e)return!1;let t=(0,s.b1)(this);return(0,s.F3)(e,t)}static async defineChildren(e){let t=t=>{var l;if(!(null==(l=this.meta)?void 0:l.createModelOptions))return t||{};if("function"==typeof this.meta.createModelOptions){let l=this.meta.createModelOptions(e);return o().merge({},l,t)}return o().merge({},this.meta.createModelOptions,t)},l=e=>this.name+e,{dataSourceKey:n,collectionName:i,associationName:a,filterByTk:s}=e.view.inputArgs,d=e.dataSourceManager.getDataSources().map(e=>0===e.getCollections().length?null:{key:l(`ds-${e.key}`),label:e.displayName,searchable:!0,searchPlaceholder:(0,r.tExpr)("Search"),children:n=>e.getCollections().map(n=>{if(!this.filterCollection(n)||!this.isCollectionAvailable(n))return null;let r={dataSourceKey:n.dataSourceKey,collectionName:n.name};return{key:l(`ds-${e.key}.${n.name}`),label:n.title,useModel:this.name,createModelOptions:t({stepParams:{resourceSettings:{init:r}}})}}).filter(Boolean)}).filter(Boolean),u=e=>1===d.length?d[0].children(e):d;if(!i)return u(e);if(this._isScene("select")){let r={dataSourceKey:n,collectionName:i};a&&(r.associationName=a,r.sourceId="{{ctx.view.inputArgs.sourceId}}");let o=e.dataSourceManager.getCollection(n,i),s=[];return this.isCollectionAvailable(o)&&s.push({key:l("current-collection"),label:"Current collection",useModel:this.name,createModelOptions:t({stepParams:{resourceSettings:{init:r}}})}),s.push({key:l("others-collections"),label:"Other collections",children:u(e)}),s}if(this._isScene("new")){let r={dataSourceKey:n,collectionName:i};a&&(r.associationName=a,r.sourceId="{{ctx.view.inputArgs.sourceId}}");let o=[],d=e.dataSourceManager.getCollection(n,i);return this.isCollectionAvailable(d)&&o.push({key:l("current-collection"),label:"Current collection",useModel:this.name,createModelOptions:t({stepParams:{resourceSettings:{init:r}}})}),null!=s&&o.push({key:l("associated"),label:"Associated records",children:()=>e.dataSourceManager.getCollection(n,i).getAssociationFields(this._getScene()).map(e=>{if(!e.targetCollection||"belongsToArray"===e.type||!this.filterCollection(e.targetCollection)||!this.isCollectionAvailable(e.targetCollection))return null;let r=`{{ctx.popup.record.${e.sourceKey||e.collection.filterTargetKey}}}`;e.sourceKey===e.collection.filterTargetKey&&(r="{{ctx.view.inputArgs.filterByTk}}");let i={dataSourceKey:n,collectionName:e.target,associationName:e.resourceName,sourceId:r};return{key:l(`associated-${e.name}`),label:e.title,useModel:this.name,createModelOptions:t({stepParams:{resourceSettings:{init:i}}})}}).filter(Boolean)}),o.push({key:l("others-collections"),label:"Other collections",children:u(e)}),o}let c=[{key:l("associated"),label:"Associated records",children:()=>e.dataSourceManager.getCollection(n,i).getAssociationFields(this._getScene()).map(e=>{if(!e.targetCollection||"belongsToArray"===e.type||!this.filterCollection(e.targetCollection)||!this.isCollectionAvailable(e.targetCollection))return null;let r=`{{ctx.popup.record.${e.sourceKey||e.collection.filterTargetKey}}}`;e.sourceKey===e.collection.filterTargetKey&&(r="{{ctx.view.inputArgs.filterByTk}}");let i={dataSourceKey:n,collectionName:e.target,associationName:e.resourceName,sourceId:r};return{key:l(`associated-${e.name}`),label:e.title,useModel:this.name,createModelOptions:t({stepParams:{resourceSettings:{init:i}}})}}).filter(Boolean)},{key:l("others-records"),label:"Other records",children:u(e)}];if(this._isScene("one")){let r=e.dataSourceManager.getCollection(n,i);if(!r||!this.filterCollection(r)||!this.isCollectionAvailable(r))return c;let o={dataSourceKey:n,collectionName:i,filterByTk:"{{ctx.view.inputArgs.filterByTk}}"};a&&(o.associationName=a,o.sourceId="{{ctx.view.inputArgs.sourceId}}"),c.unshift({key:l("current-record"),label:"Current record",useModel:this.name,createModelOptions:t({stepParams:{resourceSettings:{init:o}}})})}return c}get dataSource(){return this.context.dataSource}get collection(){return this.context.collection}get resource(){return this.context.resource}get association(){return this.context.association}get associationField(){return this.context.association}getAclActionName(){return"view"}async getFilterFields(){return this.collection.getFields().filter(e=>e.filterable)}getResourceSettingsInitParams(){return this.getStepParams("resourceSettings","init")}onInit(e){super.onInit(e),this.context.defineProperty("blockModel",{value:this}),this.context.defineProperty("actionName",{get:()=>this.getAclActionName(),cache:!1}),this.context.defineProperty("resourceName",{get:()=>this.resource.getResourceName(),cache:!1}),this.context.defineProperty("dataSource",{get:()=>{let e=this.getResourceSettingsInitParams();return this.context.dataSourceManager.getDataSource(e.dataSourceKey)}}),this.context.defineProperty("collection",{get:()=>{let e=this.getResourceSettingsInitParams();return this.context.dataSourceManager.getCollection(e.dataSourceKey,e.collectionName)}}),this.context.defineProperty("resource",{get:()=>{let e=this.getResourceSettingsInitParams(),t=this.createResource(this.context,e);t.setDataSourceKey(e.dataSourceKey),t.setResourceName(e.associationName||e.collectionName);let l=()=>{var l;let n=this.context.engine;if(!(null==n?void 0:n.getDataSourceDirtyVersion))return;let r=(null==(l=t.getDataSourceKey)?void 0:l.call(t))||e.dataSourceKey||"main";this.lastSeenDirtyVersion=this.getDirtyTrackingVersion(n,r,t,e)};return l(),t.on("refresh",()=>{l(),this.invalidateFlowCache("beforeRender")}),t}}),this.context.defineProperty("association",{get:()=>{let e=this.getResourceSettingsInitParams();if(e.associationName)return this.dataSource.getAssociation(e.associationName)}})}createResource(e,t){throw Error("createResource method must be implemented in subclasses of CollectionBlockModel")}refresh(){return this.resource?this.resource.refresh():super.refresh()}defaultBlockTitle(){var e,t,l,n;let r=this.translate((null==(e=this.constructor.meta)?void 0:e.label)||this.constructor.name),i=this.getResourceSettingsInitParams(),o=this.dataSource,s=this.collection,d=(null==o?void 0:o.displayName)||(null==o?void 0:o.key)||(null==i?void 0:i.dataSourceKey),u=(null==(n=this.context)||null==(l=n.dataSourceManager)||null==(t=l.getDataSources)?void 0:t.call(l).length)||0,c=(null==s?void 0:s.title)||(null==s?void 0:s.name)||(null==i?void 0:i.collectionName)||"",p=o?this.association:void 0;if(p){let e=this.resource.getResourceName(),t=o.getCollection(e.split(".")[0]);return(0,a.l)({blockLabel:r,dsName:d,dsCount:u,collectionTitle:c,sourceCollectionTitle:null==t?void 0:t.title,associationTitle:p.title})}return(0,a.l)({blockLabel:r,dsName:d,dsCount:u,collectionTitle:c})}addAppends(e){var t,l;let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e)if(e.includes(".")){let l=this.collection;if(!l)return;let[r,i]=e.split("."),o=this.context.dataSourceManager.getCollectionField(`${l.dataSourceKey}.${l.name}.${r}`);if(!o)return;let a=o.target;if(!a)return;let s=this.context.dataSourceManager.getCollectionField(`${l.dataSourceKey}.${a}.${i}`);if(s&&s.isAssociationField()){if(this.resource.addAppends(e),(null==(t=s.targetCollection)?void 0:t.template)==="tree"){let t=e.includes(".")?e.slice(e.lastIndexOf(".")+1):e;s.name===t&&this.resource.addAppends(`${e}.parent(recursively=true)`)}n&&this.resource.refresh()}}else{if(!this.collection)return;let t=this.context.dataSourceManager.getCollectionField(`${this.collection.dataSourceKey}.${this.collection.name}.${e}`);if(!t)return;t.isAssociationField()&&(this.resource.addAppends(t.name),(null==(l=t.targetCollection)?void 0:l.template)==="tree"&&this.resource.addAppends(`${t.name}.parent(recursively=true)`),n&&this.resource.refresh())}}constructor(...e){super(...e),(0,n._)(this,"isManualRefresh",!1),(0,n._)(this,"collectionRequired",!0),(0,n._)(this,"previousBeforeRenderHash",void 0),(0,n._)(this,"lastSeenDirtyVersion",null),(0,n._)(this,"dirtyRefreshing",!1)}}u.registerFlow({key:"resourceSettings",sort:-999,steps:{collectionCheck:{handler(e){e.collection||e.exitAll()}},aclCheck:{use:"aclCheck"},init:{handler(e,t){if(!t.dataSourceKey)throw Error("dataSourceKey is required");if(!t.collectionName)throw Error("collectionName is required");Object.keys(t).includes("sourceId")&&e.resource.setSourceId(t.sourceId),Object.keys(t).includes("filterByTk")&&e.resource.setFilterByTk(t.filterByTk)}}}}),u.registerFlow({key:"refreshSettings",sort:1e4,steps:{refresh:{async handler(e){let t=e.model,l=e.model.context.filterManager,n=(null==l?void 0:l.prepareFiltersForTarget)?await l.prepareFiltersForTarget(e.model.uid):void 0;l&&l.bindToTarget(e.model.uid);let i=t.getDataLoadingMode(),o=t.resource;if(o instanceof r.MultiRecordResource&&"manual"===i&&!t.hasActiveFilters()){o.setData([]),o.setMeta({count:0,hasNext:!1,page:1}),o.loading=!1;return}null==n||n.forEach(t=>{var l;null==t||null==(l=t.markInitialTargetRefreshHandled)||l.call(t,e.model.uid)}),e.model.isManualRefresh?e.model.resource.loading=!1:await e.model.resource.refresh()}}}}),u.registerFlow({key:"dataLoadingModeSettings",sort:800,title:(0,r.tExpr)("Set data loading mode"),steps:{dataLoadingMode:{use:"dataLoadingMode"}}}),u.define({hide:!0})},5679(e,t,l){l.d(t,{R:()=>i});var n=l(11869),r=l(15892);class i extends r.z{}i.define({hide:!0,label:(0,n.tExpr)("Data blocks"),async children(e){let t=await (0,n.buildSubModelItems)(i)(e),{collectionName:l,filterByTk:r,scene:o}=e.view.inputArgs;return t.filter(t=>{var n,i,a,s,d,u,c;let p=e.engine.getModelClass(t.useModel);return"select"===o?null==(s=p._isScene)?void 0:s.call(p,"select"):"subForm"===o?null==(d=p._isScene)?void 0:d.call(p,"subForm"):"bulkEditForm"===o?null==(u=p._isScene)?void 0:u.call(p,"bulkEditForm"):"new"===o||l&&!r?null==(c=p._isScene)?void 0:c.call(p,"new"):!p._isScene||!(null==(n=p._isScene)?void 0:n.call(p,"select"))&&!(null==(i=p._isScene)?void 0:i.call(p,"subForm"))&&!(null==(a=p._isScene)?void 0:a.call(p,"bulkEditForm"))})}})},81486(e,t,l){l.d(t,{o:()=>r});var n=l(11869);class r extends n.FlowModel{static resolveUse(e,t,l){var n,r;let i=null==e||null==(r=e.stepParams)||null==(n=r.fieldBinding)?void 0:n.use;return i&&i!==(null==e?void 0:e.use)?i:null==e?void 0:e.use}}},33297(e,t,l){l.d(t,{L:()=>i});var n=l(11869),r=l(14252);class i extends r.S0{}i.define({children:async e=>(await (0,n.buildSubModelItems)(r.S0)(e)).filter(t=>e.engine.getModelClass(t.useModel)._isScene(r.s5.record))})},58428(e,t,l){l.d(t,{GO:()=>x,KW:()=>S,Z1:()=>y,eu:()=>b,nF:()=>v,zL:()=>s});var n=l(74848),r=l(11869),i=l(96540),o=l(72380),a=l(33297);let s="assignFieldValues";function d(e){let t=null==e?void 0:e.collection;return t&&"object"==typeof t?t:void 0}function u(e){let t=d(e),l=null==t?void 0:t.dataSourceKey,n=null==t?void 0:t.name;return l&&n?{dataSourceKey:l,collectionName:n}:void 0}function c(e,t){let l=(null==e?void 0:e.collection)||d(t),n=null==l?void 0:l.dataSourceKey,r=null==l?void 0:l.name;return n&&r?{dataSourceKey:n,collectionName:r}:void 0}function p(e){if(!e||"object"!=typeof e)return!1;let t=e;return"string"==typeof t.dataSourceKey&&!!t.dataSourceKey&&"string"==typeof t.collectionName&&!!t.collectionName}function h(e){return e&&"object"==typeof e?e:void 0}function m(e,t){var l,n,r;let i=h(e);i&&(null==(l=i._observableCache)||delete l[t],null==(n=i._cache)||delete n[t],null==(r=i._pending)||delete r[t])}function f(e){m(null==e?void 0:e.context,"dataSource"),m(null==e?void 0:e.context,"collection"),m(null==e?void 0:e.context,"resource"),m(null==e?void 0:e.context,"association")}function g(e){var t,l,n,r,i;if(e.model.assignFormUid){let t=null==(r=(i=e.engine).getModel)?void 0:r.call(i,e.model.assignFormUid,!0);if(t)return t}let o=null==(t=e.model.subModels)?void 0:t.assignForm;return o||(null==(l=(n=e.engine).findModelByParentId)?void 0:l.call(n,e.model.uid,"assignForm"))||void 0}function v(e){return{async:!0,use:"AssignFormModel",stepParams:{resourceSettings:{init:u(e)}}}}function y(e,t){var l,n;let r=(null==(l=(n=e.model).getStepParams)?void 0:l.call(n,t,s))||{};return{assignedValues:(null==r?void 0:r.assignedValues)||{}}}async function b(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"AssignFieldValues";try{return await (0,r.resolveRunJSObjectValues)(e,t)}catch(t){var n,i,o;return console.error(`[${l}] RunJS execution failed`,t),null==(o=e.message)||null==(i=o.error)||i.call(o,(null==(n=e.t)?void 0:n.call(e,"RunJS execution failed"))||"RunJS execution failed"),null}}function x(e,t){return t&&"object"==typeof t&&Object.keys(t).length?{...e,...t}:e}function w(e){let{model:t,blockModel:l}=(0,r.useFlowSettingsContext)(),d=t,u=(0,r.useFlowEngine)(),[h,m]=i.useState(null);return(0,i.useEffect)(()=>{let n=!1;return(async()=>{var r,i,h,g,v;let y=c(l,null==d?void 0:d.context),b=await u.loadOrCreateModel(y?{parentId:d.uid,subKey:"assignForm",use:"AssignFormModel",stepParams:{resourceSettings:{init:y}}}:{parentId:d.uid,subKey:"assignForm",use:"AssignFormModel"},{skipSave:!t.context.flowSettingsEnabled});if(n)return;if(p(y)){let e=null==(h=b.getStepParams)?void 0:h.call(b,"resourceSettings","init");p(e)&&e.dataSourceKey===y.dataSourceKey&&e.collectionName===y.collectionName||null==(v=b.setStepParams)||v.call(b,"resourceSettings","init",y),f(b),f(null==(g=b.subModels)?void 0:g.grid)}let x=(null==(r=d.getStepParams)?void 0:r.call(d,e.settingsFlowKey,s))||{};b.setInitialAssignedValues((null==x?void 0:x.assignedValues)||{});let w=t instanceof o.U&&!(t instanceof a.L);(e.clearRecordContext||w)&&(null==(i=b.context)?void 0:i.defineProperty)&&b.context.defineProperty("record",{get:()=>void 0,cache:!1}),m(b),d.assignFormUid=(null==b?void 0:b.uid)||d.assignFormUid})(),()=>{n=!0}},[d,l,u,t,t.context.flowSettingsEnabled,e.clearRecordContext,e.settingsFlowKey]),h?(0,n.jsx)(r.FlowModelRenderer,{model:h,showFlowSettings:!1}):null}function S(e){return{title:e.title||(0,r.tExpr)("Assign field values"),uiSchema:()=>({tip:e.tipComponent?{"x-decorator":"FormItem","x-component":e.tipComponent}:void 0,editor:{"x-decorator":"FormItem","x-component":()=>(0,n.jsx)(w,{settingsFlowKey:e.settingsFlowKey,clearRecordContext:e.clearRecordContext})}}),async beforeParamsSave(t,l,n){var r,i,o,a,d,u,c;let p=g(t);if(!p){let r=(null==l?void 0:l.assignedValues)||(null==n?void 0:n.assignedValues)||{};null==(a=(d=t.model).setStepParams)||a.call(d,e.settingsFlowKey,s,{assignedValues:r});return}e.validateBeforeSave&&await (null==(c=p.form)||null==(u=c.validateFields)?void 0:u.call(c));let h=(null==(r=p.getAssignedValues)?void 0:r.call(p))||{};null==(i=(o=t.model).setStepParams)||i.call(o,e.settingsFlowKey,s,{assignedValues:h})},handler(){}}}},13595(e,t,l){l.r(t),l.d(t,{DateFilterDynamicComponent:()=>F});var n=l(74848),r=l(96540),i=l(35710),o=l(71500),a=l(84626),s=l(36492),d=l(63718),u=l(22803),c=l(11869),p=l(2077),h=l(96436),m=l(37985),f=l(40098),g=l.n(f);let v=e=>e?e.replace(/\s*HH?:mm(?::ss)?(?:\.SSS)?/g,"").trim():e,y=(e,t)=>{if(!e)return null;if(h.dayjs.isDayjs(e))return e;if("string"==typeof e&&e.endsWith("Z")){let l=(0,h.dayjs)(e).format(t),n=(0,h.dayjs)(l,t);return n.isValid()?n:(0,h.dayjs)(e)}let l=(0,h.dayjs)(e,t);if(l.isValid())return l;let n=(0,h.dayjs)(e);return n.isValid()?n:null},b=e=>{let{value:t,picker:l="date",format:i,showTime:o,timeFormat:a}=e,s=(0,c.useFlowEngine)(),d=s.translate.bind(s),u=(0,p.fD)(),f=[{label:d("Today"),value:u.today},{label:d("Last week"),value:u.lastWeek},{label:d("This week"),value:u.thisWeek},{label:d("Next week"),value:u.nextWeek},{label:d("Last month"),value:u.lastMonth},{label:d("This month"),value:u.thisMonth},{label:d("Next month"),value:u.nextMonth},{label:d("Last quarter"),value:u.lastQuarter},{label:d("This quarter"),value:u.thisQuarter},{label:d("Next quarter"),value:u.nextQuarter},{label:d("Last year"),value:u.lastYear},{label:d("This year"),value:u.thisYear},{label:d("Next year"),value:u.nextYear},{label:d("Last 7 days"),value:u.last7Days},{label:d("Next 7 days"),value:u.next7Days},{label:d("Last 30 days"),value:u.last30Days},{label:d("Next 30 days"),value:u.next30Days},{label:d("Last 90 days"),value:u.last90Days},{label:d("Next 90 days"),value:u.next90Days}],b=t?(0,p.Pn)(null==t?void 0:t[0],l):l,x=b===l&&i?i:(0,h.getPickerFormat)(b),w="date"===b?v(x):x,S=(0,h.getDateTimeFormat)(b,w,o,a),M={utc:!0,presets:f,...e,format:S,picker:b,showTime:!!o&&{defaultValue:[(0,h.dayjs)("00:00:00","HH:mm:ss"),(0,h.dayjs)("23:59:59","HH:mm:ss")]}},A=(0,r.useMemo)(()=>g().castArray(e.value).map(e=>y(e,S)),[e.value,S]);return(0,n.jsx)(m.A.RangePicker,{...M,style:{flex:1,...null==M?void 0:M.style},value:A})},x=e=>e?e.replace(/\s*HH?:mm(?::ss)?(?:\.SSS)?/g,"").trim():e,w=(e,t)=>{if(!e)return null;if(h.dayjs.isDayjs(e))return e;if("string"==typeof e&&e.endsWith("Z")){let l=(0,h.dayjs)(e).format(t),n=(0,h.dayjs)(l,t);return n.isValid()?n:(0,h.dayjs)(e)}let l=(0,h.dayjs)(e,t);if(l.isValid())return l;let n=(0,h.dayjs)(e);return n.isValid()?n:null},S=e=>{let{picker:t="date",format:l,showTime:i,timeFormat:o,onChange:d}=e,u=(0,c.useFlowContext)(),f=Array.isArray(e.value)?e.value[0]:e.value,g=f?(0,p.Pn)(f,t):t,[v,y]=(0,r.useState)(g),b=u.model.translate.bind(u.model),S=e=>{let n=e===t&&l?l:(0,h.getPickerFormat)(e),r="date"===e?x(n):n;return(0,h.getDateTimeFormat)(e,r,i,o)},M=(0,r.useMemo)(()=>S(v),[l,t,i,v,o]),A=(0,r.useMemo)(()=>w(f,M),[f,M]),F={utc:!0,inputReadOnly:u.isMobileLayout,...e,underFilter:!0,showTime:!!i&&{defaultValue:(0,h.dayjs)("00:00:00","HH:mm:ss")},format:M,picker:v};return(0,n.jsxs)(a.A.Compact,{style:{width:"100%"},children:[(0,n.jsx)(s.A,{style:{width:"100px"},popupMatchSelectWidth:!1,value:v,options:[{label:b("Date"),value:"date"},{label:b("Month"),value:"month"},{label:b("Quarter"),value:"quarter"},{label:b("Year"),value:"year"}],onChange:e=>{let t=S(e),l=M;if(y(e),!f||!d)return;let n=w(f,l);n&&n.isValid()&&d(n,n.format(t))}}),(0,n.jsx)(m.A,{...F,style:{flex:1,...null==F?void 0:F.style},value:A})]})},M=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=[{value:"exact",label:e("Exact day")},{value:"past",label:e("Past")},{value:"next",label:e("Next")},{value:"today",label:e("Today")},{value:"yesterday",label:e("Yesterday")},{value:"tomorrow",label:e("Tomorrow")},{value:"thisWeek",label:e("This Week")},{value:"lastWeek",label:e("Last Week")},{value:"nextWeek",label:e("Next Week")},{value:"thisMonth",label:e("This Month")},{value:"lastMonth",label:e("Last Month")},{value:"nextMonth",label:e("Next Month")},{value:"thisQuarter",label:e("This Quarter")},{value:"lastQuarter",label:e("Last Quarter")},{value:"nextQuarter",label:e("Next Quarter")},{value:"thisYear",label:e("This Year")},{value:"lastYear",label:e("Last Year")},{value:"nextYear",label:e("Next Year")}];return t&&l.splice(3,0,{value:"now",label:e("Now")}),l},A=e=>{let{isRange:t,defaultValue:l,onChange:i,...o}=e,a=(0,r.useCallback)((e,t)=>i(t),[i]);return t?(0,n.jsx)(b,{...o,onChange:a}):(0,n.jsx)(S,{...o,onChange:a})},F=e=>{let{value:t,onChange:l,includeNow:p=!1,...h}=e,m=(0,c.useFlowEngine)(),f=m.translate.bind(m),{token:g}=i.A.useToken(),[v,y]=(0,r.useState)(!1),b=(0,r.useMemo)(()=>M(f,p),[f,p]),x=e=>{if(y(!1),"exact"===e)return l(void 0);let t={type:e};["past","next"].includes(e)&&(t.number=1,t.unit="day"),l(t)},w=()=>{let e=b.slice(0,3),t=b.slice(3),l=(0,u.css)`
|
|
1260
|
+
${r}`,c)}}let n=R(e.issues.filter(e=>"runtime"===e.type)),r=n?`Key runtime issue: ${I(n)}`:"",i=["RunJS preview output was truncated.",t,e.execution?T(e.execution):void 0,r||void 0].filter(Boolean).join("\n").trim();return i.length<=c?i:_(i,c-1)+"\n"}function O(e){return N(e)}async function $(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n="string"==typeof e?e:String(e??""),r=[],i=[],o=null==l?void 0:l.version,a=(0,d.shouldPreprocessRunJSTemplates)({version:o});i.push(...P(n)),i.push(...j(n));let s="u">typeof performance&&"function"==typeof performance.now?performance.now():Date.now(),u={started:!1,finished:!1,timeout:!1,durationMs:void 0};try{u.started=!0;let{consoleCapture:e,loggerCapture:l}=E(r),s={console:e};try{if("u">typeof window){let e=(0,d.createSafeNavigator)();s.navigator=e,s.window=(0,d.createSafeWindow)({navigator:e}),s.document=(0,d.createSafeDocument)()}}catch(e){}let c=n;try{c=await (0,d.prepareRunJsCode)(n,{preprocessTemplates:a})}catch(n){let e=String((null==n?void 0:n.name)||""),t=y((null==n?void 0:n.message)||n),l=n instanceof SyntaxError||/^SyntaxError\b/i.test(e)||/SyntaxError\b/i.test(t);return i.push({type:"runtime",ruleId:l?"preview-start-failed":"internal",message:l?t:`Preview internal failure: ${t}`,stack:M(n)}),u.finished=!0,u.timeout=!1,{issues:k(i),logs:r,execution:u}}let h=await t.createJSRunner({globals:s,timeoutMs:p,version:o});h.globals.ctx.defineProperty("logger",{value:l});let m=await h.run(c);if(u.finished=!0,u.timeout=!!(null==m?void 0:m.timeout),!(null==m?void 0:m.success)){let e=null==m?void 0:m.error,t=(null==m?void 0:m.timeout)?"Execution timed out":y((null==e?void 0:e.message)||e||"Unknown error"),l=e instanceof SyntaxError||/^SyntaxError\b/i.test(String((null==e?void 0:e.name)||""));i.push({type:"runtime",ruleId:(null==m?void 0:m.timeout)?"timeout":l?"preview-start-failed":"runtime-error",message:t,stack:M(e)})}}catch(e){u.finished=!0,u.timeout=!1,i.push({type:"runtime",ruleId:"internal",message:`Preview internal failure: ${y((null==e?void 0:e.message)||e)}`,stack:M(e)})}finally{let e=Math.max(0,("u">typeof performance&&"function"==typeof performance.now?performance.now():Date.now())-s);u.durationMs=Number.isFinite(e)?e:void 0}return{issues:k(i),logs:r,execution:u}}function B(e){let t=new d.FlowContext;if(t.addDelegate(e),"u">typeof document&&"function"==typeof document.createElement&&!e.element)try{let e=document.createElement("div");t.defineProperty("element",{value:e})}catch(e){}return t}async function L(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=B(t),r=await $(e,n,l),i=0===r.issues.length,o=O(r);return{success:i,message:o.length>c?_(o,c):o}}},68669(e,t,l){l.d(t,{a:()=>a});var n=l(74848),r=l(84626),i=l(71021);l(96540);var o=l(7521);let a=(0,l(11869).observer)(e=>{var t;let{value:l,FilterItem:a,ctx:s}=e;l.logic||(l.logic="$and"),Array.isArray(l.items)||(l.items=[]);let d=()=>{var e;(null==s||null==(e=s.model)?void 0:e.dispatchEvent)&&s.model.dispatchEvent("reset")},u=()=>{var e;(null==s||null==(e=s.model)?void 0:e.dispatchEvent)&&s.model.dispatchEvent("submit")},c=(null==s||null==(t=s.model)?void 0:t.translate)||(e=>e);return(0,n.jsxs)("form",{onSubmit:e=>{e.preventDefault(),u()},children:[(0,n.jsx)(o.I,{value:l,FilterItem:a}),(0,n.jsxs)(r.A,{style:{width:"100%",display:"flex",justifyContent:"flex-end"},children:[(0,n.jsx)(i.Ay,{htmlType:"button",onClick:d,children:c("Reset")}),(0,n.jsx)(i.Ay,{type:"primary",htmlType:"submit",children:c("Submit")})]})]})},{displayName:"FilterContent"})},7521(e,t,l){l.d(t,{I:()=>f});var n=l(74848),r=l(97373),i=l(18853),o=l(35710),a=l(36492),s=l(84626),d=l(71021),u=l(18492);l(96540);var c=l(11869);let p=new WeakMap,h=0,m=e=>{let t=p.get(e);return t||(h+=1,t=`filter-item-${h}`,p.set(e,t)),t},f=(0,c.observer)(e=>{let{token:t}=o.A.useToken(),{value:l={logic:"$and",items:[]},FilterItem:c,showBorder:p=!1,onRemove:h,onChange:g,closeIcon:v=(0,n.jsx)(r.A,{style:{color:t.colorIcon}})}=e,{t:y}=(0,u.B)();l.logic||(l.logic="$and"),Array.isArray(l.items)||(l.items=[]);let{logic:b,items:x}=l,w=p?{position:"relative",border:`1px dashed ${t.colorBorder}`,padding:t.paddingSM,marginBottom:t.marginXS,borderRadius:t.borderRadius}:{position:"relative",marginBottom:t.marginXS},S=e=>{l.logic=e,null==g||g(l)},M=()=>{x.push({path:"",operator:"",value:""}),null==g||g(l)},A=()=>{x.push({logic:"$and",items:[]}),null==g||g(l)},F=e=>{x.splice(e,1),null==g||g(l)},k=e=>"path"in e||"operator"in e||"value"in e,C=e=>"logic"in e&&"items"in e;return(0,n.jsxs)("div",{style:w,children:[p&&h&&(0,n.jsx)("button",{type:"button","aria-label":"icon-close",style:{position:"absolute",right:10,top:10,cursor:"pointer",background:"transparent",border:0,padding:0},onClick:h,children:v}),(0,n.jsx)("div",{style:{marginBottom:8,color:t.colorText},children:(0,n.jsxs)("span",{children:[y("Meet")," ",(0,n.jsxs)(a.A,{"data-testid":"filter-select-all-or-any",style:{width:"auto"},value:b,onChange:S,children:[(0,n.jsx)(a.A.Option,{value:"$and",children:y("All")}),(0,n.jsx)(a.A.Option,{value:"$or",children:y("Any")})]})," ",y("conditions in the group")]})}),(0,n.jsx)("div",{children:x.map((e,r)=>C(e)?(0,n.jsx)(f,{value:e,FilterItem:c,showBorder:!0,onRemove:()=>F(r),onChange:e=>{x[r]=e,null==g||g(l)}},m(e)):k(e)?c?(0,n.jsx)("div",{style:{marginBottom:8,display:"flex",alignItems:"flex-end"},children:(0,n.jsxs)(s.A,{style:{flex:1,minWidth:0},children:[(0,n.jsx)(c,{value:e}),(0,n.jsx)("button",{type:"button","aria-label":"icon-close",style:{marginLeft:8,marginRight:8,flex:"0 0 auto",cursor:"pointer",background:"transparent",border:0,padding:0},onClick:()=>F(r),children:v})]})},m(e)):(0,n.jsx)("div",{style:{marginBottom:8,display:"flex",alignItems:"flex-end"},children:(0,n.jsxs)(s.A,{style:{flex:1,minWidth:0},children:[(0,n.jsxs)("span",{children:[e.path," ",e.operator," ",String(e.value)]}),(0,n.jsx)("button",{type:"button","aria-label":"icon-close",style:{marginLeft:8,marginRight:8,flex:"0 0 auto",cursor:"pointer",background:"transparent",border:0,padding:0},onClick:()=>F(r),children:v})]})},m(e)):(0,n.jsx)("div",{style:{marginBottom:8,display:"flex",alignItems:"flex-end"},children:(0,n.jsxs)(s.A,{style:{flex:1,minWidth:0},children:[(0,n.jsx)("span",{style:{color:t.colorTextTertiary},children:"Invalid filter item"}),(0,n.jsx)("button",{type:"button","aria-label":"icon-close",style:{marginLeft:8,marginRight:8,flex:"0 0 auto",cursor:"pointer",background:"transparent",border:0,padding:0},onClick:()=>F(r),children:v})]})},m(e)))}),(0,n.jsxs)(s.A,{size:16,style:{marginTop:8,marginBottom:8},children:[(0,n.jsx)(d.Ay,{style:{padding:0},type:"link",size:"small",icon:(0,n.jsx)(i.A,{}),onClick:M,children:y("Add condition")}),(0,n.jsx)(d.Ay,{style:{padding:0},type:"link",size:"small",icon:(0,n.jsx)(i.A,{}),onClick:A,children:y("Add condition group")})]})]})},{displayName:"FilterGroup"})},44e3(e,t,l){l.d(t,{H:()=>n});let n=(e,t,l,n)=>e.map(e=>r(e,t,l,n)).filter(Boolean),r=(e,t,l,r)=>{var i;if(l.length&&1===t&&l.includes(e.name)||!e.interface||!1===e.filterable)return;let o=e.getInterfaceOptions();if(!(null==o?void 0:o.filterable))return;let{nested:a,children:s,operators:d}=o.filterable,u={name:e.name,type:e.type,target:e.target,title:r(e.title),schema:null==e?void 0:e.uiSchema,operators:((null==d||null==(i=d.filter)?void 0:i.call(d,t=>!(null==t?void 0:t.visible)||t.visible(e)))||[]).map(e=>({...e,label:r(e.label)}))};if(!e.target||!(t>2)){if(t>2)return u;if((null==s?void 0:s.length)&&(u.children=s),a){let i=[];try{i=e.getFields().filter(e=>"attachments"!==e.target&&"formula"!==e.interface)}catch{i=[]}let o=n(i,t+1,l,r).filter(Boolean);u.children=u.children||[],u.children.push(...o)}return u}}},58528(e,t,l){l.d(t,{Ru:()=>W,I8:()=>r.I,qi:()=>p,oJ:()=>n.a,Et:()=>T,uw:()=>H.u});var n=l(68669),r=l(7521),i=l(74848),o=l(11869),a=l(84626),s=l(36492),d=l(95725),u=l(96540),c=l(44e3);let p=(0,o.observer)(e=>{var t;let{path:l,operator:n,value:r}=e.value,o=e.model,p=(null==(t=o.context.blockModel.collection)?void 0:t.getFields().filter(e=>"attachments"!==e.target))||[],m=h(o.props.filterableFieldNames||[],p.map(e=>e.name)),f=o.translate,g=(0,c.H)(p.filter(e=>"attachments"!==e.target&&"formula"!==e.interface&&!["belongsTo","belongsToMany","hasOne","hasMany","oho","obo","m2o","o2m","m2m"].includes(e.type)),1,e.noIgnore?[]:m,f).filter(Boolean),v=(0,u.useMemo)(()=>{let e=g.find(e=>e.name===l);return(null==e?void 0:e.operators)||[]},[g,l]),y=t=>{var l;e.value.path=t;let n=g.find(e=>e.name===t);(null==n||null==(l=n.operators)?void 0:l.length)>0?e.value.operator=n.operators[0].value:e.value.operator="",e.value.value=""},b=t=>{e.value.operator=t},x=t=>{e.value.value=t.target.value};return(0,i.jsxs)(a.A,{children:[(0,i.jsx)(s.A,{style:{width:200},placeholder:f("Select field"),value:l||void 0,onChange:y,children:g.map(e=>(0,i.jsx)(s.A.Option,{value:e.name,children:e.title},e.name))}),(0,i.jsx)(s.A,{style:{width:120},placeholder:f("Select operator"),value:n||void 0,onChange:b,disabled:!l||0===v.length,children:v.map(e=>(0,i.jsx)(s.A.Option,{value:e.value,children:e.label},e.value))}),(0,i.jsx)(d.A,{style:{width:200},placeholder:f("Enter value"),value:r,onChange:x})]})},{displayName:"FilterItem"});function h(e,t){return null==t?void 0:t.filter(t=>!e.includes(t))}var m=l(63718),f=l(94313),g=l(60518),v=l(51643),y=l(60209),b=l(2077),x=l(18451),w=l.n(x),S=l(40098),M=l.n(S),A=l(20419),F=l(85352),k=l(53869),C=l(10925);let{DateFilterDynamicComponent:P}=(0,b.RZ)(()=>Promise.resolve().then(l.bind(l,13595)),"DateFilterDynamicComponent");async function j(e){var t,l,n,r;let i=async e=>Array.isArray(e)?e:"function"==typeof e?await e():[];if(null==(l=e.getPropertyOptions)||null==(t=l.call(e,"collection"))?void 0:t.meta){let t=null==(r=e.getPropertyMetaTree)?void 0:r.call(e,"{{ ctx.collection }}");return await i(t)}let a=()=>(null==e?void 0:e.collection)??null,s=await (0,o.createEphemeralContext)(e,{defineProperties:{collection:{get:a,meta:(0,o.createCollectionContextMeta)(a,"Current collection")}}}),d=null==(n=s.getPropertyMetaTree)?void 0:n.call(s,"{{ ctx.collection }}");return await i(d)}function E(e,t){return"number"!=typeof t?e:(0,C.W)(e,{maxAssociationDepth:t})}function R(e,t,l,n){var r;let o=null==e?void 0:e["x-component"],a=(null==t||null==(r=t.uiSchema)?void 0:r["x-component-props"])||{},u=(null==e?void 0:e["x-component-props"])||{},c=w()({},a,u),p=(0,F.di)(null==e?void 0:e.enum,l)||[],h={style:{width:200,...(null==c?void 0:c.style)||{}},placeholder:(null==c?void 0:c.placeholder)||l("Enter value"),...c},b=e=>{if("number"==typeof e||(null==c?void 0:c.stringMode)===!0&&"string"==typeof e)return e};return e=>{let{value:t,onChange:l,...r}=e||{};if("InputNumber"===o)return(0,i.jsx)(m.A,{...h,...r,value:b(t),onChange:e=>null==l?void 0:l(e)});if("NumberPicker"===o)return(0,i.jsx)(A.NumberPicker,{...h,...r,value:b(t),onChange:e=>null==l?void 0:l(e)});if("Switch"===o)return(0,i.jsx)(f.A,{...h,...r,checked:!!t,onChange:e=>null==l?void 0:l(e)});if("Select"===o)return(0,i.jsx)(s.A,{options:p,...h,...r,value:(0,F.xO)(t,h),onChange:e=>null==l?void 0:l(e)});if("Checkbox"===o)return(0,i.jsx)(g.A,{...h,...r,checked:!!t,onChange:e=>null==l?void 0:l(e.target.checked)});if("Checkbox.Group"===o)return(0,i.jsx)(g.A.Group,{...h,...r,value:Array.isArray(t)?t:void 0,onChange:e=>null==l?void 0:l(e)});if("Radio.Group"===o)return(0,i.jsx)(v.Ay.Group,{...h,...r,value:Array.isArray(t)||"string"==typeof t||"number"==typeof t||"boolean"==typeof t?t:void 0,onChange:e=>null==l?void 0:l(e.target.value)});if("Cascader"===o)return(0,i.jsx)(y.A,{...h,...r,value:Array.isArray(t)?t:void 0,onChange:e=>null==l?void 0:l(e)});if("Input.TextArea"===o||"TextArea"===o)return(0,i.jsx)(d.A.TextArea,{...h,...r,value:"string"==typeof t?t:null==t?"":String(t),onChange:e=>null==l?void 0:l(e.target.value)});if("DateFilterDynamicComponent"===o)return(0,i.jsx)(P,{...h,...r,value:t,onChange:e=>null==l?void 0:l(e)});if(o&&(null==n?void 0:n.getComponent)){let e=n.getComponent(o);if(e)return(0,i.jsx)(e,{...h,...r,value:t,onChange:e=>null==l?void 0:l(e),style:{width:200,...h.style||{},...null==r?void 0:r.style}})}return(0,i.jsx)(d.A,{...h,...r,value:"string"==typeof t?t:null==t?"":String(t),onChange:e=>null==l?void 0:l(e.target.value)})}}function I(e){if(e&&"object"==typeof e){let l=e;if("function"==typeof l.preventDefault||l.nativeEvent||"target"in l){var t;let n=null==(t=l.target)?void 0:t.value;return void 0!==n?n:e}}return e}let T=(0,o.observer)(e=>{let{value:t,model:l,rightAsVariable:n,rightMetaTree:r,ignoreFieldNames:c,maxAssociationFieldDepth:p}=e,h=(0,o.useFlowViewContext)(),m=l.translate,{path:f,operator:g,value:v}=t,[y,x]=(0,u.useState)(null),S=(0,u.useCallback)(e=>{var t;return(0,b.w6)(e,l.context.dataSourceManager,null==(t=l.context.app)?void 0:t.dataSourceManager)},[l]),A=(0,u.useMemo)(()=>{var e,t;if(!y)return[];let l=y.interface?S(y.interface):void 0,n=null==y||null==(e=y.uiSchema)?void 0:e["x-filter-operators"];return((Array.isArray(n)&&n.length?n:null==l||null==(t=l.filterable)?void 0:t.operators)||[]).filter(e=>!e.visible||e.visible(y))},[S,y]);(0,u.useEffect)(()=>{if(!A.length)return;let e=M().find(A,e=>e.value===t.operator);if(e)t.noValue=!!e.noValue;else{let e=A[0];t.operator=e.value,t.value=!!e.noValue||void 0,t.noValue=!!e.noValue}},[A,t]);let C=(0,u.useMemo)(()=>A.map(e=>({value:e.value,label:"string"==typeof e.label?m(e.label):e.label})),[A,m]),P=(0,u.useCallback)((e,l)=>{let n=t.path||"",r=e||"",i=r!==n;t.path=r,i&&n&&(t.operator="",t.value=void 0,t.noValue=!1),l&&x(l)},[t]),T=(0,u.useMemo)(()=>({resolveValueFromPath:e=>(x(e),(null==e?void 0:e.paths.slice(1).join("."))||null),resolvePathFromValue(e){if(null==e)return;let t=String(e).trim();if(t)return["collection",...t.split(".")]}}),[]),_=(0,u.useCallback)(e=>{t.operator=e;let l=A.find(t=>t.value===e);(null==l?void 0:l.noValue)?(t.value=!0,t.noValue=!0):(t.value=void 0,t.noValue=!1)},[A,t]),D=(0,u.useMemo)(()=>A.find(e=>e.value===g),[A,g]),N=(0,u.useCallback)(e=>{var t,l;return(null==e||null==(t=e.options)?void 0:t.dataType)||(null==e?void 0:e.dataType)||(null==e?void 0:e.type)||(null==e||null==(l=e.uiSchema)?void 0:l.type)||"double"},[]),O=(0,u.useCallback)(e=>{switch(e){case"boolean":return"Switch";case"date":return"DateFilterDynamicComponent";case"integer":case"bigInt":case"double":case"decimal":case"number":return"InputNumber";default:return"Input"}},[]),$=(0,u.useMemo)(()=>{let e=(null==y?void 0:y.uiSchema)||{},t=(null==D?void 0:D.schema)||{},l=w()({},e,t);if((null==y?void 0:y.interface)==="formula"){let e={"x-read-pretty":!1,"x-component":O(N(y)),"x-component-props":{...l["x-component-props"]}};return w()({},l,e)}return l},[y,D,O,N]),B=u.useRef(null==$?void 0:$["x-component"]),L=null==$?void 0:$["x-component"],V=(0,u.useMemo)(()=>{let e=B.current;B.current=L;let l=void 0!==e&&e!==L;if(null==D?void 0:D.noValue)return v;if(l&&null!=v){t.value=void 0;return}return v},[L,v,t,D]),q=(0,u.useCallback)(e=>{t.value=I(e)},[t]),z=u.useRef(m);u.useEffect(()=>{z.current=m},[m]);let K=u.useCallback(e=>{var t;return(null==(t=z.current)?void 0:t.call(z,e))??e},[]),U=(0,u.useMemo)(()=>(0,F.di)(null==$?void 0:$.enum,K)||[],[$,K]),W=(0,u.useMemo)(()=>R($,y,K,l.context.app),[$,y,K,l.context.app]),H=(0,u.useCallback)(()=>{let e=(0,k._H)(l.context.app,g,A),t="$in"===g||"$notIn"===g;if(e&&t){let{Comp:t,props:l}=e,n={...l},r=Array.isArray(n.options)?n.options:void 0;(!r||0===r.length)&&(null==U?void 0:U.length)&&(n.options=U);let o={flex:"1 1 40%",minWidth:160,maxWidth:"100%",...(0,k.VS)(n.style)},a=Array.isArray(V)&&V.every(e=>"string"==typeof e||"number"==typeof e)?V:"string"==typeof V?V.split(/\r?\n/).map(e=>e.trim()).filter(Boolean):[];return(0,i.jsx)("div",{style:o,children:(0,i.jsx)(t,{...n,style:{width:"100%",...(0,k.VS)(n.style)},value:a,onChange:e=>q(e)})})}let n=W;return(0,i.jsx)("div",{style:{flex:"1 1 40%",minWidth:160,maxWidth:"100%"},children:(0,i.jsx)(n,{value:V,onChange:e=>q(e)})})},[g,A,V,W,l.context.app,q,U]),G=(0,u.useMemo)(()=>function(){return(0,i.jsx)(d.A,{placeholder:`<${m("Null")}>`,readOnly:!0})},[m]),Y=(0,u.useMemo)(()=>async()=>{let e="function"==typeof r?await r():r??h.getPropertyMetaTree(),t=Array.isArray(e)?e:await e();return E([{title:m("Constant"),name:"constant",type:"string",paths:["constant"],render:W},{title:m("Null"),name:"null",type:"object",paths:["null"],render:G},...t],p)},[r,h,W,G,m,p]),J=(0,u.useMemo)(()=>({renderInputComponent:e=>{var t;let l=null==e||null==(t=e.paths)?void 0:t[0];return"constant"===l?W:"null"===l?G:null},resolveValueFromPath:e=>{var t;let l=null==e||null==(t=e.paths)?void 0:t[0];return"constant"===l?"":"null"===l?null:void 0},resolvePathFromValue:e=>{if(null===e)return["null"];let t="string"==typeof e?(0,o.parseValueToPath)(e):void 0;return t||["constant"]}}),[G,W]),X=(0,u.useMemo)(()=>async()=>{let e=await j(l.context),t=async e=>{let t=e.interface?S(e.interface):void 0,n=[],r=null==t?void 0:t.filterable,i=null==r?void 0:r.children;if(Array.isArray(i)&&i.length)for(let t of i){var o,a,s;let r=t.title||t.name,i=(null==(o=l.context)?void 0:o.t)?l.context.t(r):r;n.push({name:t.name,title:i,type:(null==(a=t.schema)?void 0:a.type)||"string",interface:(null==(s=t.schema)?void 0:s["x-component"])==="Select"?"select":"input",uiSchema:{...t.schema||{},"x-filter-operators":t.operators},paths:[...e.paths||[],t.name],parentTitles:[...e.parentTitles||[],e.title]})}if("function"==typeof e.children){let t=e.children;return{...e,children:async()=>{let e=await t(),l=[...Array.isArray(e)?e:[],...n];return M().uniqBy(l,"name")}}}let d=[...Array.isArray(e.children)?e.children:[],...n];return{...e,children:d.length?d:e.children}},n=[];for(let l of e)n.push(await t(l));return E(n,p)},[S,l,p]);return(0,i.jsxs)(a.A,{wrap:!0,style:{width:"100%"},children:[(0,i.jsx)(o.VariableInput,{value:f,metaTree:X,onChange:P,converters:T,showValueComponent:!1,style:{flex:"1 1 40%",minWidth:160,maxWidth:"100%"},onlyLeafSelectable:!0,placeholder:m("Select field"),ignoreFieldNames:c}),(0,i.jsx)(s.A,{style:{flex:"0 0 140px",minWidth:120,maxWidth:"100%"},placeholder:m("Comparison"),value:g||void 0,onChange:_,children:C.map(e=>(0,i.jsx)(s.A.Option,{value:e.value,children:e.label},e.value))}),!(null==D?void 0:D.noValue)&&(n?(0,i.jsx)(o.VariableInput,{value:V,onChange:e=>q(e),metaTree:Y,converters:J,showValueComponent:!0,style:{flex:"1 1 40%",minWidth:160,maxWidth:"100%"},placeholder:m("Enter value")}):H())]})});var _=l(68827),D=l.n(_),N=l(97456);let{DateFilterDynamicComponent:O}=(0,b.RZ)(()=>Promise.resolve().then(l.bind(l,13595)),"DateFilterDynamicComponent");function $(e,t){return"number"!=typeof t?e:(0,C.W)(e,{maxAssociationDepth:t})}function B(e,t,l){var n,r,o;let a=null==e?void 0:e["x-component"],u=(null==t||null==(n=t.uiSchema)?void 0:n["x-component-props"])||{},c=(null==e?void 0:e["x-component-props"])||{},p=w()({},u,c),h=Array.isArray(null==t||null==(r=t.uiSchema)?void 0:r.enum)?null==t||null==(o=t.uiSchema)?void 0:o.enum:void 0,g=(0,F.di)(h,l),v={style:{width:200,...(null==p?void 0:p.style)||{}},placeholder:(null==p?void 0:p.placeholder)||l("Enter value"),...p};return e=>{let{value:t,onChange:n,...r}=e||{};if("InputNumber"===a)return(0,i.jsx)(m.A,{...v,...r,value:t,onChange:n});if("NumberPicker"===a)return(0,i.jsx)(A.NumberPicker,{...v,...r,value:t,onChange:n});if("Switch"===a)return(0,i.jsx)(f.A,{...v,...r,checked:!!t,onChange:n});if("Select"===a){let e=v;return Array.isArray(null==e?void 0:e.options)&&e.options.length>0?e={...e,options:(0,F.ZY)(e.options,l)}:g&&(e={...e,options:g}),(0,i.jsx)(s.A,{...e,...r,value:(0,F.xO)(t,e),onChange:n})}return"DateFilterDynamicComponent"===a?(0,i.jsx)(O,{...v,...r,value:t,onChange:n}):(0,i.jsx)(d.A,{...v,...r,value:t,onChange:e=>{var t;return null==n?void 0:n(null==e||null==(t=e.target)?void 0:t.value)}})}}let L=[{value:"$includes",label:"contains",selected:!0},{value:"$notIncludes",label:"does not contain"},{value:"$eq",label:"is"},{value:"$ne",label:"is not"},{value:"$empty",label:"is empty",noValue:!0},{value:"$notEmpty",label:"is not empty",noValue:!0}],V=new Set(["$in","$notIn"]);function q(e,t){let l=Array.isArray(e)?e:[],n=Array.isArray(t)?t:[];if(!n.length)return l;let r=n.find(e=>(null==e?void 0:e.name)==="item");if(!r)return[...n,...l];let i=(0,N.mD)(l,[r]);return[...n.filter(e=>(null==e?void 0:e.name)!=="item"),...i]}function z(e,t){var l,n;return{name:t.name,title:t.title||t.name,type:(null==(l=t.schema)?void 0:l.type)||"string",interface:(null==(n=t.schema)?void 0:n["x-component"])==="Select"?"select":"input",uiSchema:{...t.schema||{},"x-filter-operators":t.operators},paths:[...e.paths||[],t.name],parentTitles:[...e.parentTitles||[],e.title]}}async function K(e,t){var l,n;let r=e.interface&&t?t(e.interface):void 0,i=(Array.isArray(null==r||null==(l=r.filterable)?void 0:l.children)?null==r||null==(n=r.filterable)?void 0:n.children:[]).map(t=>z(e,t)),o=async e=>{let l=[...await Promise.all(e.map(e=>K(e,t))),...i];return D()(l,e=>e.name)};if("function"==typeof e.children){let t=e.children;return{...e,children:async()=>{let e=await t(),l=Array.isArray(e)?e:[];return await o(l)}}}return Array.isArray(e.children)?{...e,children:await o(e.children)}:i.length?{...e,children:i}:e}async function U(e,t){let l=Array.isArray(e)?e:[];return await Promise.all(l.map(e=>K(e,t)))}let W=(0,o.observer)(e=>{var t;let{value:l,model:n,extraMetaTree:r,maxAssociationFieldDepth:c}=e,p=(0,o.useFlowViewContext)(),h=n.translate,{path:m,operator:f,value:g}=l||{},[v,y]=(0,u.useState)(null),x=(0,u.useRef)(!1),S=(0,u.useMemo)(()=>{if(v){var e,t,l;let r=v.interface?(0,b.w6)(v.interface,n.context.dataSourceManager,null==(e=n.context.app)?void 0:e.dataSourceManager):void 0,i=null==v||null==(t=v.uiSchema)?void 0:t["x-filter-operators"];return((Array.isArray(i)&&i.length?i:null==r||null==(l=r.filterable)?void 0:l.operators)||L).filter(e=>!e.visible||e.visible(v)).map(e=>({value:e.value,label:e.label,noValue:!!e.noValue,schema:e.schema,selected:!!e.selected}))}return[]},[v,n]),M=(0,u.useMemo)(()=>S.map(e=>({value:e.value,label:"string"==typeof e.label?h(e.label):e.label})),[S,h]);(0,u.useEffect)(()=>{if(0!==S.length){if(!f){if(x.current){let e=S.find(e=>e.selected)||S[0];l.operator=(null==e?void 0:e.value)||"",(null==e?void 0:e.noValue)?(l.value=!0,l.noValue=!0):l.noValue=!1,x.current=!1}return}if(!S.some(e=>e.value===f)){let e=S.find(e=>e.selected)||S[0];l.operator=(null==e?void 0:e.value)||"",(null==e?void 0:e.noValue)?(l.value=!0,l.noValue=!0):l.noValue=!1}}},[S,f,l]);let A=(0,u.useMemo)(()=>S.find(e=>e.value===f),[S,f]),C=(0,u.useMemo)(()=>{let e=(null==v?void 0:v.uiSchema)||{},t=(null==A?void 0:A.schema)||{};return w()({},e,t)},[v,A]),P=(0,u.useRef)(h);(0,u.useEffect)(()=>{P.current=h},[h]);let j=(0,u.useCallback)(e=>{var t;return(null==(t=P.current)?void 0:t.call(P,e))??e},[]),E=(0,u.useMemo)(()=>B(C,v,j),[C,v,j]),R=(0,u.useMemo)(()=>(0,F.di)(null==C?void 0:C.enum,j)||[],[C,j]),I=(0,u.useMemo)(()=>{let e=(0,k._H)(n.context.app,f,S),t=V.has(f);if(!e||!t)return E;let{Comp:l,props:r}=e;return e=>{let{value:t,onChange:n,...o}=e||{},a={...r},s=Array.isArray(a.options)?a.options:void 0;(!s||0===s.length)&&R.length>0&&(a.options=R);let d=Array.isArray(t)?t:"string"==typeof t?t.split(/\r?\n/).map(e=>e.trim()).filter(Boolean):[];return(0,i.jsx)(l,{...a,...o,value:d,onChange:n,style:{width:200,...(0,k.VS)(a.style),...(0,k.VS)(null==o?void 0:o.style)}})}},[R,n.context.app,S,f,E]),T=(0,u.useMemo)(()=>function(){return(0,i.jsx)(d.A,{placeholder:`<${h("Null")}>`,readOnly:!0})},[h]),_=(0,u.useMemo)(()=>async()=>{let e=q((null==n?void 0:n.context.getPropertyMetaTree())||p.getPropertyMetaTree(),r);return $([{title:h("Constant"),name:"constant",type:"string",paths:["constant"]},{title:h("Null"),name:"null",type:"object",paths:["null"]},...e],c)},[p,n,h,r,c]),D=(0,u.useCallback)(async()=>{var e,t;let l=(null==n||null==(t=n.context)||null==(e=t.getPropertyMetaTree)?void 0:e.call(t))||p.getPropertyMetaTree(),i=q(Array.isArray(l)?l:[],r),o=e=>{var t;return(0,b.w6)(e,n.context.dataSourceManager,null==(t=n.context.app)?void 0:t.dataSourceManager)};return $(await U(i,o),c)},[p,n,r,c]),N=(0,u.useMemo)(()=>({renderInputComponent:e=>{var t;let l=null==e||null==(t=e.paths)?void 0:t[0];return"constant"===l?I:"null"===l?T:null},resolveValueFromPath:e=>{var t;let l=null==e||null==(t=e.paths)?void 0:t[0];return"constant"===l?"":"null"===l?null:void 0},resolvePathFromValue:e=>{if(null===e)return["null"];let t=(0,o.parseValueToPath)(e);return t||["constant"]}}),[T,I]),O=(0,u.useCallback)((e,t)=>{let n=l.path||"",r=e||"",i=r!==n;l.path=r,i&&n&&(l.operator="",l.value="",x.current=!0),n||!r||l.operator||(x.current=!0),t&&y(t)},[l]),z=(0,u.useCallback)(e=>{let t=l.operator;l.operator=e;let n=S.find(t=>t.value===e);(null==n?void 0:n.noValue)?(l.value=!0,l.noValue=!0):(V.has(t)&&!V.has(e)&&Array.isArray(l.value)&&(l.value=l.value.join("\n")),l.noValue=!1)},[l,S]);return(0,i.jsxs)(a.A,{wrap:!0,style:{width:"100%"},children:[(0,i.jsx)(o.VariableInput,{value:m,onChange:O,metaTree:D,showValueComponent:!0,style:{flex:"1 1 40%",minWidth:160,maxWidth:"100%"},placeholder:h("Select variable"),onlyLeafSelectable:!0}),(0,i.jsx)(s.A,{style:{flex:"0 0 140px",minWidth:120,maxWidth:"100%"},placeholder:h("Comparison"),value:f||void 0,onChange:z,children:M.map(e=>(0,i.jsx)(s.A.Option,{value:e.value,children:e.label},e.value))}),!(null==(t=S.find(e=>e.value===f))?void 0:t.noValue)&&(0,i.jsx)(o.VariableInput,{value:g,onChange:e=>l.value=e,metaTree:_,converters:N,showValueComponent:!0,style:{flex:"1 1 40%",minWidth:160,maxWidth:"100%"},placeholder:h("Enter value"),clearValue:""})]})});var H=l(17669)},10925(e,t,l){l.d(t,{W:()=>o});let n=new Set(["m2o","o2o","oho","obo","o2m","m2m","linkTo"]);function r(e){let t=(null==e?void 0:e.options)||{};return!!(t.target||t.targetCollection||t.foreignKey||t.through||n.has(String((null==e?void 0:e.interface)||"")))}function i(e,t,l){let n=r(e),i=t+ +!!n;if(n&&i>l)return null;let a=e=>Array.isArray(e)?o(e,{associationDepth:i,maxAssociationDepth:l}):async()=>{let t=await e();return o(Array.isArray(t)?t:[],{associationDepth:i,maxAssociationDepth:l})};return{...e,children:e.children?a(e.children):void 0}}function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{associationDepth:l=0,maxAssociationDepth:n=2}=t;return Array.isArray(e)?e.map(e=>i(e,l,n)).filter(Boolean):[]}},17669(e,t,l){l.d(t,{u:()=>o});var n=l(96540),r=l(44e3);let i=e=>e;function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{filterableFieldNames:l,nonfilterableFieldNames:o,noIgnore:a=!1,t:s=i}=t,d=(0,n.useMemo)(()=>(null==e?void 0:e.getFields())||[],[e]),u=(0,n.useMemo)(()=>{let e=!a&&(null==l?void 0:l.length)?d.map(e=>e.name).filter(e=>!l.includes(e)):[],t=o??[];return t.length?Array.from(new Set([...e,...t])):e},[d,l,o,a]);return(0,n.useMemo)(()=>(0,r.H)(d.filter(e=>"attachments"!==e.target&&"formula"!==e.interface),1,u,s).filter(Boolean),[d,u,s])}},39580(e,t,l){l.d(t,{b2:()=>r.b,tn:()=>n.t,S5:()=>r.S});var n=l(27941);l(74848),l(98668),l(43627),l(11869),l(96540),l(74979),l(21335);var r=l(36869);l(95266),l(47785)},51612(e,t,l){l.d(t,{g:()=>v});var n=l(74848),r=l(96540),i=l(40098),o=l.n(i),a=l(70413);let s=o().memoize(async e=>{if(!e)return e;let t=await Promise.all([l.e("2512"),l.e("32")]).then(l.bind(l,86419));return(0,a.$P)(t.default.render(e))});function d(e){let[t,l]=(0,r.useState)(""),[n,i]=(0,r.useState)(!0);return(0,r.useEffect)(()=>{i(!0),s(e).then(e=>{l(e),i(!1)}).catch(e=>console.log(e))},[e]),{html:t,loading:n}}function u(e){let t=e,l=document.createElement("div");l.innerHTML=t;let n=l.innerText;return l=null,(null==n?void 0:n.replace(/[\n\r]/g,""))||""}var c=l(24978),p=l(22803),h=l(11869),m=l(35710);let f=()=>{let e=(0,h.useFlowContext)(),{token:t}=m.A.useToken(),l=!!e.isDarkTheme,n=new c.q(t.colorFillAlter).onBackground(t.colorBgContainer).toHexShortString(),r={lineHeight:"inherit","&.nb-markdown-default":{"pre code.hljs":{display:"block",overflowX:"auto",padding:"1em"},"code.hljs":{padding:"3px 5px"},":not(pre) code":{padding:"2px 5px",color:"#d56161",background:t.colorFillQuaternary,border:`1px solid ${t.colorBorder}`,borderRadius:t.borderRadiusSM},blockquote:{borderLeft:"4px solid #ccc",paddingLeft:"20px",marginLeft:"0",color:"#666",fontStyle:"italic"},img:{maxWidth:"100%"},".hljs":{background:"#f8f8f8",color:"#444"},".hljs-comment":{color:"#697070"},".hljs-punctuation,.hljs-tag":{color:"#444a"},".hljs-tag .hljs-attr,.hljs-tag .hljs-name":{color:"#444"},".hljs-attribute,.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-name,.hljs-selector-tag":{fontWeight:700},".hljs-deletion,.hljs-number,.hljs-quote,.hljs-selector-class,.hljs-selector-id,.hljs-string,.hljs-template-tag,.hljs-type":{color:"#800"},".hljs-section,.hljs-title":{color:"#800",fontWeight:700},".hljs-link,.hljs-operator,.hljs-regexp,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-symbol,.hljs-template-variable,.hljs-variable":{color:"#ab5656"},".hljs-literal":{color:"#695"},".hljs-addition,.hljs-built_in,.hljs-bullet,.hljs-code":{color:"#397300"},".hljs-meta":{color:"#1f7199"},".hljs-meta .hljs-string":{color:"#38a"},".hljs-emphasis":{fontStyle:"italic"},".hljs-strong":{fontWeight:700}},"&.nb-markdown-table":{table:{borderCollapse:"collapse",width:"100%",fontFamily:"Arial, sans-serif",marginBottom:"1.5rem"},"th, td":{borderBottom:`1px solid ${t.colorBorderSecondary}`,padding:`${t.paddingContentVertical}px ${t.paddingContentHorizontal}px`,textAlign:"left"},th:{backgroundColor:n,fontWeight:"bold",color:t.colorText},"tr:hover":{backgroundColor:t.colorFillTertiary},"tr:last-child td":{borderBottom:"none"},"tr:first-child th":{borderTop:"none"}}},i={"&.nb-markdown-default":{"pre code.hljs":{display:"block",overflowX:"auto",padding:"1em"},"code.hljs":{padding:"3px 5px"},":not(pre) code":{padding:"2px 5px",color:"#d56161",background:t.colorFillQuaternary,border:`1px solid ${t.colorBorder}`,borderRadius:t.borderRadiusSM},".hljs":{color:"#adbac7",background:"#22272e"},".hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_":{color:"#f47067"},".hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_":{color:"#dcbdfb"},".hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable":{color:"#6cb6ff"},".hljs-meta .hljs-string,.hljs-regexp,.hljs-string":{color:"#96d0ff"},".hljs-built_in,.hljs-symbol":{color:"#f69d50"},".hljs-code,.hljs-comment,.hljs-formula":{color:"#768390"},".hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag":{color:"#8ddb8c"},".hljs-subst":{color:"#adbac7"},".hljs-section":{color:"#316dca",fontWeight:700},".hljs-bullet":{color:"#eac55f"},".hljs-emphasis":{color:"#adbac7",fontStyle:"italic"},".hljs-strong":{color:"#adbac7",fontWeight:700},".hljs-addition":{color:"#b4f1b4",backgroundColor:"#1b4721"},".hljs-deletion":{color:"#ffd8d3",backgroundColor:"#78191b"}},"&.nb-markdown-table":{table:{borderCollapse:"collapse",width:"100%",fontFamily:"Arial, sans-serif",marginBottom:"1.5rem"},"th, td":{borderBottom:`1px solid ${t.colorBorderSecondary}`,padding:`${t.paddingContentVertical}px ${t.paddingContentHorizontal}px`,textAlign:"left"},th:{backgroundColor:n,fontWeight:"bold",color:t.colorText},"tr:hover":{backgroundColor:t.colorFillTertiary},"tr:last-child td":{borderBottom:"none"},"tr:first-child th":{borderTop:"none"}}};return(0,p.css)({lineHeight:t.lineHeight,"& > *:last-child":{marginBottom:"0"},".ant-description-textarea, .ant-description-input":{lineHeight:t.lineHeight},".field-interface-datetime":{minWidth:"100px"},img:{maxWidth:"100%"},...l?i:r})};var g=l(42443);let v=e=>{let{textOnly:t,overflowMode:l,style:i}=e,o=f(),{html:a=""}=d(e.value),s=u(a),c="ellipsis"===l,p=(0,r.useRef)(null),[h,m]=(0,r.useState)(!1);(0,r.useEffect)(()=>{if(p.current){let e=p.current;m(e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight)}},[a,i,l]);let v={...i||{},...c?{display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal",wordBreak:"break-word",cursor:"default"}:{}},y=(0,n.jsx)("div",{ref:p,className:`${o} nb-markdown`,dangerouslySetInnerHTML:{__html:t?s:a},style:v});return c&&h?(0,n.jsx)(g.A,{title:(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:a},style:{maxHeight:500,overflowY:"auto",padding:10,color:"#000"}}),overlayInnerStyle:{background:"#fff",color:"#000",boxShadow:"0 2px 8px rgba(0,0,0,0.15)"},color:"#fff",children:y}):y}},85352(e,t,l){function n(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Array.isArray(e)?e.map(e=>{if(e&&"object"==typeof e&&!Array.isArray(e)){let t=e,l=void 0!==t.label,n=void 0!==t.value,r=l?t.label:String(t.value??""),i=n?t.value:r,o={label:r,value:i};return t.color&&(o.color=t.color),t.icon&&(o.icon=t.icon),o}return{label:String(e),value:e}}):[]}function r(e){return"string"==typeof e&&/\{\{\s*t\s*\(/.test(e)}function i(e,t){return r(e)?t(e):e}function o(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return Array.isArray(e)?e.map(e=>({...e,label:i(null==e?void 0:e.label,t)})):[]}function a(e,t){if(e&&Array.isArray(e)&&0!==e.length)return o(n(e),t)}function s(e,t){let l=null==t?void 0:t.mode,n="multiple"===l||"tags"===l||(null==t?void 0:t.multiple)===!0;return Array.isArray(e)?e.filter(e=>""!==e&&null!=e):""===e||null==e?n?[]:void 0:e}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(Array.isArray(e)?e:null==e?[]:[e]).map(e=>{var l;let n=t.find(t=>(null==t?void 0:t.value)===e);return n?{value:e,label:n.label}:{value:e,label:(null==e||null==(l=e.toString)?void 0:l.call(e))??e}})}function u(e,t){var l,r,i,o;if(!["radioGroup","checkboxGroup","select","multipleSelect"].includes(null==t?void 0:t.interface)||Array.isArray(null==(l=e.props)?void 0:l.options)&&(null==(i=e.props)||null==(r=i.options)?void 0:r.length)>0)return!1;let a=null==(o=t.uiSchema)?void 0:o.enum;if(!Array.isArray(a)||0===a.length)return!1;let s=n(a);return!!s.length&&(e.setProps({options:s}),!0)}l.d(t,{NI:()=>u,OL:()=>i,ZY:()=>o,di:()=>a,xO:()=>s,yg:()=>d})},13940(e,t,l){l.d(t,{E4:()=>i,Gj:()=>d,a_:()=>n,eo:()=>p,pX:()=>s,w7:()=>o});let n="__custom__";function r(e){return`${n}:${e}`}function i(e){var t;if(!e||"object"!=typeof e)return!1;let l=e;if(!(null==(t=l.isAssociationField)?void 0:t.call(l)))return!1;let n=l.type,r=l.interface;return"belongsToMany"===n||"hasMany"===n||"belongsToArray"===n||"m2m"===r||"o2m"===r||"mbm"===r}function o(e){var t;if(!e||"object"!=typeof e)return;let l=e;return l.collection||(null==(t=l.context)?void 0:t.collection)||void 0}function a(e){return"string"==typeof e?e.trim():""}function s(e){if(!e||"object"!=typeof e)return[];let t=e,l="function"==typeof t.getStepParams?t.getStepParams("fieldSettings","init"):void 0,n=l&&"object"==typeof l?l:void 0,i="function"==typeof t.getStepParams?t.getStepParams("formItemSettings","fieldSettings"):void 0,o=i&&"object"==typeof i?i:void 0,s=(null==n?void 0:n.fieldPath)??t.fieldPath,d=(null==n?void 0:n.associationPathName)??t.associationPathName,u=null==o?void 0:o.name,c=a(s),p=a(d),h=a(u),m=new Set;return c&&m.add(c),p&&(c?c.startsWith(`${p}.`)?m.add(c):m.add(`${p}.${c}`):m.add(p)),h&&m.add(r(h)),Array.from(m)}function d(e){return s(e)[0]}function u(e){if(!e||"object"!=typeof e)return[];let t=e.subModels;if(!t||"object"!=typeof t)return[];let l=t.items;if(Array.isArray(l))return l;let n=t.grid;if(!n||"object"!=typeof n)return[];let r=n.subModels;if(!r||"object"!=typeof r)return[];let i=r.items;return Array.isArray(i)?i:[]}function c(e){if(!e||"object"!=typeof e)return[];let t=e.subModels;return t&&"object"==typeof t?u(t.field):[]}function p(e,t){let l=a(t);if(!l)return null;let n=e=>{if(!Array.isArray(e))return null;for(let t of e){if(s(t).some(e=>e===l))return t;let e=n(c(t));if(e)return e}return null};return n(u(e))}},53869(e,t,l){l.d(t,{VS:()=>a,_H:()=>u,i2:()=>c,sI:()=>h});var n=l(96540),r=l(13595),i=l(85352);function o(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function a(e){return o(e)?e:void 0}function s(e){return e}function d(e){var t;let l=s(e);l._reactiveWrapperCache=void 0,null==(t=l.setupReactiveRender)||t.call(l)}function u(e,t,l){let n;if(!l||!Array.isArray(l))return null;let i=l.find(e=>(null==e?void 0:e.value)===t),a=null==i?void 0:i.schema,s=null==a?void 0:a["x-component"];if(!s)return null;if("DateFilterDynamicComponent"===s)n=r.DateFilterDynamicComponent;else{var d;n=null==e||null==(d=e.getComponent)?void 0:d.call(e,s)}return n?{Comp:n,props:o(null==a?void 0:a["x-component-props"])?a["x-component-props"]:{}}:null}function c(e){let t=s(e);return!!t&&"function"==typeof t.__originalRender&&(t.render=t.__originalRender,d(t),!0)}function p(e,t){return Array.isArray(e.options)&&"function"==typeof t?{...e,options:(0,i.ZY)(e.options,t)}:e}function h(e){let{app:t,fieldModel:l,operator:r,operators:i,propsPriority:o="field",style:h}=e,m=s(l),f=u(t,r,i);if(!f)return c(m),!1;m.__originalRender||"function"!=typeof m.render||(m.__originalRender=m.render);let{Comp:g,props:v}=f,y=a(v.style);return m.render=()=>{let e=m.props||{},t=a(e.style),l=p("operator"===o?{...e,...v}:{...v,...e},m.translate),r="operator"===o?{...t,...y}:{...y,...t},i={...h||{},...r};return n.createElement(g,{...l,...Object.keys(i).length>0?{style:i}:{},onCompositionStart:null,onCompositionEnd:null})},d(m),!0}},25359(e,t,l){l.d(t,{ON:()=>i,jI:()=>r});let n="__saveStepParamsWithSubModels";function r(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw Error("[saveStepParamsWithSubModels] model is not an object");e[n]=!0}async function i(e,t){if(!e||"object"!=typeof e&&"function"!=typeof e)throw Error("[saveStepParamsWithSubModels] model is not an object");let l=e;if(!0!==l[n])return await t();if("function"!=typeof l.save)throw Error("[saveStepParamsWithSubModels] model.save is not a function");try{return await l.save()}finally{delete l[n]}}},14252(e,t,l){l.d(t,{S0:()=>o.S0,_T:()=>o._T,s5:()=>o.s5});var n=l(11869),r=l(2077);l(96540);var i=l(2117),o=l(52717);o.S0.registerFlow({key:"buttonSettings",title:(0,n.tExpr)("Button settings"),sort:-999,steps:{general:{title:(0,n.tExpr)("Edit button"),uiSchema:e=>({title:e.model.enableEditTitle?{"x-decorator":"FormItem","x-component":"Input",title:(0,n.tExpr)("Button title")}:void 0,tooltip:e.model.enableEditTooltip?{"x-decorator":"FormItem","x-component":"Input",title:(0,n.tExpr)("Button tooltip")}:void 0,icon:e.model.enableEditIcon?{"x-decorator":"FormItem","x-component":"IconPicker",title:(0,n.tExpr)("Button icon")}:void 0,iconOnly:e.model.enableEditIcon?{"x-decorator":"FormItem","x-component":"Switch",title:(0,n.tExpr)("Icon only")}:void 0,type:e.model.enableEditType?{"x-decorator":"FormItem","x-component":"Radio.Group",title:(0,n.tExpr)("Button type"),enum:e.model.buttonTypeOptions}:void 0,danger:e.model.enableEditDanger?{"x-decorator":"FormItem","x-component":"Switch",title:(0,n.tExpr)("Danger action")}:void 0,color:e.model.enableEditColor?{"x-decorator":"FormItem","x-component":r.sk,title:(0,n.tExpr)("Color")}:void 0}),defaultParams(e){var t,l;let n=e.model.defaultProps||{};return e.model.enableEditColor?{...n,color:(null==(t=e.model.props)?void 0:t.color)??n.color??(null==(l=e.themeToken)?void 0:l.colorPrimary)}:n},handler(e,t){let{title:l,tooltip:n,...r}=t;e.model.setProps({title:e.t(l,{ns:"lm-flow-engine"}),tooltip:e.t(n,{ns:"lm-flow-engine"}),...r})}},linkageRules:{use:"actionLinkageRules"}}}),o.S0.registerFlow({key:"buttonAclSettings",steps:{aclCheck:{use:"aclCheck"}}}),o.S0.registerFlow({key:"paginationChange",on:"paginationChange",steps:{aclCheckRefresh:{use:"aclCheckRefresh"},linkageRulesRefresh:{use:"linkageRulesRefresh",defaultParams:{actionName:"actionLinkageRules",flowKey:"buttonSettings",stepKey:"linkageRules"}}}}),o.S0.registerEvents({click:{title:(0,n.tExpr)("Click"),name:"click",uiSchema:{condition:{type:"object",title:(0,n.tExpr)("Trigger condition"),"x-decorator":"FormItem","x-component":i.H}},handler:i.b}})},52717(e,t,l){l.d(t,{S0:()=>f,_T:()=>h,s5:()=>m});var n=l(50467),r=l(74848),i=l(11869),o=l(2930),a=l(42443),s=l(71021),d=l(40098),u=l.n(d),c=l(96540),p=l(18492);function h(e){let{t}=(0,p.B)(),l=(0,i.useFlowModel)(),n=l.context.blockModel,o=e.collection||n.collection,s=o.dataSource,d=(0,c.useMemo)(()=>{let e=`${t(s.displayName||s.key)} > `,l=o?`${t(o.title)||o.name||o.tableName} `:"";return`${e}${l}`},[o,s.displayName,s.key,t]),{actionName:h}=(null==e?void 0:e.forbidden)||l.forbidden,m=(0,c.useMemo)(()=>t('The current user only has the UI configuration permission, but don\'t have "{{actionName}}" permission for collection "{{name}}"',{name:d,actionName:t(u().capitalize(h))}).replaceAll(">",">"),[h,d,t]);return(0,r.jsx)(a.A,{title:e.message||m,children:e.children})}let m={collection:"collection",record:"record",all:["collection","record"],both:["collection","record"]};class f extends i.FlowModel{static _getScene(){return u().castArray(this.scene||[])}static _isScene(e){return this._getScene().includes(e)}getAclActionName(){return null}onInit(e){super.onInit(e),delete this.props.disabled,this.context.defineProperty("actionName",{get:()=>this.getAclActionName(),cache:!1})}serialize(){let e=super.serialize();return delete e.props.disabled,e}getInputArgs(){let e={},t=[];if(this.context.resource){let l=this.context.resource.getSourceId();l&&(e.sourceId=l,t.push("sourceId"))}if(this.context.collection&&this.context.record){let l=this.context.collection.getFilterByTK(this.context.record);l&&(e.filterByTk=l,t.push("filterByTk"))}return t.length&&(e.defaultInputKeys=t),e}onClick(e){this.dispatchEvent("click",{event:e,...this.getInputArgs()},{debounce:!0})}getTitle(){return this.props.title}getIcon(){return this.props.icon}renderButton(){let{iconOnly:e,...t}=this.props,l=this.getIcon()?(0,r.jsx)(o.In,{type:this.getIcon()}):void 0,n=e&&l?null:t.children||this.getTitle();return(0,r.jsx)(s.Ay,{...t,onClick:this.onClick.bind(this),icon:l,children:n})}render(){return this.props.tooltip?(0,r.jsx)(a.A,{title:this.props.tooltip,children:this.renderButton()}):this.renderButton()}renderHiddenInConfig(){let{iconOnly:e,...t}=this.props,l=this.getIcon()?(0,r.jsx)(o.In,{type:this.getIcon()}):void 0,n=e&&l?null:t.children||this.getTitle();return this.forbidden?(0,r.jsx)(h,{children:(0,r.jsx)(s.Ay,{...t,onClick:this.onClick.bind(this),icon:l,style:{opacity:"0.3"},children:n})}):(0,r.jsx)(a.A,{title:this.context.t("The button is hidden and only visible when the UI Editor is active"),children:(0,r.jsx)(s.Ay,{...t,onClick:this.onClick.bind(this),icon:l,style:{opacity:"0.3"},children:n})})}constructor(...e){super(...e),(0,n._)(this,"defaultProps",{type:"default",title:(0,i.tExpr)("Action"),iconOnly:!1}),(0,n._)(this,"enableEditTooltip",!0),(0,n._)(this,"enableEditTitle",!0),(0,n._)(this,"enableEditIcon",!0),(0,n._)(this,"enableEditType",!0),(0,n._)(this,"enableEditDanger",!0),(0,n._)(this,"enableEditColor",!1),(0,n._)(this,"buttonTypeOptions",[{value:"default",label:'{{t("Default")}}'},{value:"primary",label:'{{t("Primary")}}'},{value:"dashed",label:'{{t("Dashed")}}'},{value:"link",label:'{{t("Link")}}'},{value:"text",label:'{{t("Text")}}'}])}}},15892(e,t,l){l.d(t,{P:()=>w,z:()=>S});var n=l(50467),r=l(74848),i=l(95243),o=l(11869),a=l(40098),s=l.n(a),d=l(96540),u=l(42443),c=l(39580),p=l(2117),h=l(92275),m=l(18492),f=l(27941);function g(e){return"function"==typeof(null==e?void 0:e.getResourceSettingsInitParams)?e.getResourceSettingsInitParams():"function"==typeof(null==e?void 0:e.getStepParams)?e.getStepParams("resourceSettings","init"):void 0}function v(e,t){var l,n,r,i,o,a,s;let d=(null==e||null==(l=e.context)?void 0:l.blockModel)||e,u=g(d)||{},c=(null==d||null==(n=d.context)?void 0:n.collection)||(null==d?void 0:d.collection)||(null==e||null==(r=e.context)?void 0:r.collection),p=(null==c?void 0:c.dataSource)||(null==d||null==(i=d.context)?void 0:i.dataSource)||(null==d?void 0:d.dataSource)||(null==e?void 0:e.dataSource),h=(null==p?void 0:p.key)||(null==c?void 0:c.dataSourceKey)||u.dataSourceKey,m=(null==c?void 0:c.title)||(null==c?void 0:c.name)||(null==c?void 0:c.tableName)||(null==e||null==(o=e.resource)?void 0:o.resourceName)||(null==e||null==(s=e.resource)||null==(a=s.getResourceName)?void 0:a.call(s))||u.associationName||u.collectionName,f=p?t(p.displayName||p.key):h,v=m?`${t(m)||m}`:"",y=f?`${t(f)} > `:"";return{dataSourceName:f,nameValue:`${y}${v}`,isDataSourceUnavailable:!!(h&&!p)}}function y(e){let{dataSourceName:t}=e,{t:l}=(0,m.B)(),n=t?l('The data source "{{name}}" used by this block is disabled or unavailable. Enable the data source to display this block.',{name:t}):l("The data source used by this block is disabled or unavailable. Enable the data source to display this block.");return(0,r.jsx)(f.t,{children:(0,r.jsx)(h.Ay,{status:"403",subTitle:n})})}let b=()=>{let{t:e}=(0,m.B)(),t=(0,o.useFlowModel)(),{dataSourceName:l,isDataSourceUnavailable:n,nameValue:i}=(0,d.useMemo)(()=>v(t,e),[t,e]),{actionName:a}=t.forbidden||{},u=(0,d.useMemo)(()=>e('The current user only has the UI configuration permission, but don\'t have "{{actionName}}" permission for collection "{{name}}"',{name:i,actionName:e(s().capitalize(a))}).replaceAll(">",">"),[a,i,e]);return n?t.context.flowSettingsEnabled?(0,r.jsx)(y,{dataSourceName:l}):null:(0,r.jsx)(f.t,{children:(0,r.jsx)(h.Ay,{status:"403",subTitle:u})})};function x(){let{t:e}=(0,m.B)(),t=(0,o.useFlowModel)(),{dataSourceName:l,isDataSourceUnavailable:n,nameValue:i}=(0,d.useMemo)(()=>v(t,e),[t,e]),a=(0,d.useMemo)(()=>e('The {{type}} "{{name}}" may have been deleted. Please remove this {{blockType}}.',{type:e("Collection"),name:i,blockType:e("Block")}).replaceAll(">",">"),[i,e]);return n?t.context.flowSettingsEnabled?(0,r.jsx)(y,{dataSourceName:l}):null:(0,r.jsx)(f.t,{children:(0,r.jsx)(h.Ay,{status:"404",subTitle:a})})}let w={new:"new",one:"one",many:"many",select:"select",filter:"filter",oam:["one","many"],subForm:"subForm",bulkEditForm:"bulkEditForm"};class S extends o.FlowModel{setFilterActive(e,t){this.activeFilterSources.set(e,t)}hasActiveFilters(){let e=this.resource;if(e&&e.filter&&Object.keys(e.filter).length>0)return!0;for(let[,e]of this.activeFilterSources)if(e)return!0;return!1}removeFilterSource(e){this.activeFilterSources.delete(e)}getDataLoadingMode(){var e;let t=this.getStepParams("dataLoadingModeSettings");return(null==t||null==(e=t.dataLoadingMode)?void 0:e.mode)||"auto"}static _getScene(){return s().castArray(this.scene||[])}static _isScene(e){return this._getScene().includes(e)}getModelClassName(e){return Object.keys(this.customModelClasses).includes(e)?this.customModelClasses[e]:this._defaultCustomModelClasses[e]||e}renderHiddenInConfig(){return this.forbidden?(0,r.jsx)(b,{}):(0,r.jsx)(u.A,{title:this.context.t("The block is hidden and only visible when the UI Editor is active"),children:(0,r.jsx)(c.tn,{ref:this.context.ref,...this.decoratorProps,style:{opacity:"0.3"},children:(0,r.jsx)(this.ObservedRenderComponent,{})})})}onInit(e){super.onInit(e),this.context.defineProperty("blockModel",{value:this}),this.context.defineMethod("getModelClassName",e=>this.getModelClassName(e)),this.ObservedRenderComponent=(0,o.observer)(()=>this.renderComponent(),{displayName:"ObservedRenderComponent"})}setDecoratorProps(e){Object.assign(this.decoratorProps,e)}get title(){return this._title||(this._title=this.defaultBlockTitle()),this._title}defaultBlockTitle(){var e;return`${this.translate((null==(e=this.constructor.meta)?void 0:e.label)||this.constructor.name)}`}renderComponent(){throw Error("renderComponent method must be implemented in subclasses of BlockModel")}render(){return this.collectionRequired&&!this.context.collection?(0,r.jsx)(x,{}):(0,r.jsx)(c.tn,{ref:this.context.ref,...this.decoratorProps,children:(0,r.jsx)(this.ObservedRenderComponent,{})})}constructor(...e){super(...e),(0,n._)(this,"decoratorProps",(0,i.observable)({})),(0,n._)(this,"_defaultCustomModelClasses",{}),(0,n._)(this,"customModelClasses",{}),(0,n._)(this,"collectionRequired",!1),(0,n._)(this,"ObservedRenderComponent",null),(0,n._)(this,"activeFilterSources",new Map)}}(0,n._)(S,"scene",void 0),S.registerFlow({key:"cardSettings",title:(0,o.tExpr)("Card settings"),steps:{titleDescription:{title:(0,o.tExpr)("Title & description"),uiSchema:{title:{"x-component":"Input","x-decorator":"FormItem",title:(0,o.tExpr)("Title")},description:{"x-component":"Input.TextArea","x-decorator":"FormItem",title:(0,o.tExpr)("Description")}},handler(e,t){let l=e.t(t.title,{ns:"lm-flow-engine"}),n=e.t(t.description,{ns:"lm-flow-engine"});e.model.setDecoratorProps({title:l,description:n})}},linkageRules:{use:"blockLinkageRules"},blockHeight:{use:"blockHeight"}}}),S.define({hide:!0,label:(0,o.tExpr)("Other blocks")}),o.FlowModel.registerEvents({beforeRender:{title:(0,o.tExpr)("Before render"),name:"beforeRender",uiSchema:{condition:{type:"object",title:(0,o.tExpr)("Trigger condition"),"x-decorator":"FormItem","x-component":p.H}},handler:p.b}})},72380(e,t,l){l.d(t,{U:()=>i});var n=l(11869),r=l(14252);class i extends r.S0{}i.define({children:async e=>(await (0,n.buildSubModelItems)(r.S0)(e)).filter(t=>e.engine.getModelClass(t.useModel)._isScene(r.s5.collection))})},52175(e,t,l){l.d(t,{t:()=>u});var n=l(50467),r=l(11869),i=l(40098),o=l.n(i),a=l(42632),s=l(94130),d=l(5679);class u extends d.R{onMount(){super.onMount(),this.previousBeforeRenderHash=this.context.location.search}getDirtyTrackingVersion(e,t,l,n){var r;let i=new Set,o=(null==l||null==(r=l.getResourceName)?void 0:r.call(l))||n.associationName||n.collectionName;o&&i.add(String(o)),n.associationName&&i.add(String(n.associationName)),n.collectionName&&i.add(String(n.collectionName));let a=0;for(let l of i)a+=e.getDataSourceDirtyVersion(t,l);return a}onActive(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.hidden&&this.previousBeforeRenderHash!==this.context.location.search&&(this.rerender(),!e)||this.hidden)return;let t=this.context.resource;if(!t)return;let l=this.getResourceSettingsInitParams(),n=t.getDataSourceKey()||l.dataSourceKey||"main",i=this.context.engine,o=this.getDirtyTrackingVersion(i,n,t,l);if(t instanceof r.MultiRecordResource&&"manual"===this.getDataLoadingMode()&&!this.hasActiveFilters()){t.setData([]),t.setMeta({count:0,hasNext:!1}),t.setPage(1),t.loading=!1,this.lastSeenDirtyVersion=o;return}if(e){if(this.dirtyRefreshing)return;this.dirtyRefreshing=!0,t.refresh().then(()=>{this.lastSeenDirtyVersion=this.getDirtyTrackingVersion(i,n,t,l)}).catch(()=>{}).finally(()=>{this.dirtyRefreshing=!1});return}this.isManualRefresh||null!==this.lastSeenDirtyVersion&&o===this.lastSeenDirtyVersion||this.dirtyRefreshing||(this.dirtyRefreshing=!0,t.refresh().then(()=>{this.lastSeenDirtyVersion=this.getDirtyTrackingVersion(i,n,t,l)}).catch(()=>{}).finally(()=>{this.dirtyRefreshing=!1}))}static filterCollection(e){return!!e.filterTargetKey}static isCollectionAvailable(e){if(!e)return!1;let t=(0,s.b1)(this);return(0,s.F3)(e,t)}static async defineChildren(e){let t=t=>{var l;if(!(null==(l=this.meta)?void 0:l.createModelOptions))return t||{};if("function"==typeof this.meta.createModelOptions){let l=this.meta.createModelOptions(e);return o().merge({},l,t)}return o().merge({},this.meta.createModelOptions,t)},l=e=>this.name+e,{dataSourceKey:n,collectionName:i,associationName:a,filterByTk:s}=e.view.inputArgs,d=e.dataSourceManager.getDataSources().map(e=>0===e.getCollections().length?null:{key:l(`ds-${e.key}`),label:e.displayName,searchable:!0,searchPlaceholder:(0,r.tExpr)("Search"),children:n=>e.getCollections().map(n=>{if(!this.filterCollection(n)||!this.isCollectionAvailable(n))return null;let r={dataSourceKey:n.dataSourceKey,collectionName:n.name};return{key:l(`ds-${e.key}.${n.name}`),label:n.title,useModel:this.name,createModelOptions:t({stepParams:{resourceSettings:{init:r}}})}}).filter(Boolean)}).filter(Boolean),u=e=>1===d.length?d[0].children(e):d;if(!i)return u(e);if(this._isScene("select")){let r={dataSourceKey:n,collectionName:i};a&&(r.associationName=a,r.sourceId="{{ctx.view.inputArgs.sourceId}}");let o=e.dataSourceManager.getCollection(n,i),s=[];return this.isCollectionAvailable(o)&&s.push({key:l("current-collection"),label:"Current collection",useModel:this.name,createModelOptions:t({stepParams:{resourceSettings:{init:r}}})}),s.push({key:l("others-collections"),label:"Other collections",children:u(e)}),s}if(this._isScene("new")){let r={dataSourceKey:n,collectionName:i};a&&(r.associationName=a,r.sourceId="{{ctx.view.inputArgs.sourceId}}");let o=[],d=e.dataSourceManager.getCollection(n,i);return this.isCollectionAvailable(d)&&o.push({key:l("current-collection"),label:"Current collection",useModel:this.name,createModelOptions:t({stepParams:{resourceSettings:{init:r}}})}),null!=s&&o.push({key:l("associated"),label:"Associated records",children:()=>e.dataSourceManager.getCollection(n,i).getAssociationFields(this._getScene()).map(e=>{if(!e.targetCollection||"belongsToArray"===e.type||!this.filterCollection(e.targetCollection)||!this.isCollectionAvailable(e.targetCollection))return null;let r=`{{ctx.popup.record.${e.sourceKey||e.collection.filterTargetKey}}}`;e.sourceKey===e.collection.filterTargetKey&&(r="{{ctx.view.inputArgs.filterByTk}}");let i={dataSourceKey:n,collectionName:e.target,associationName:e.resourceName,sourceId:r};return{key:l(`associated-${e.name}`),label:e.title,useModel:this.name,createModelOptions:t({stepParams:{resourceSettings:{init:i}}})}}).filter(Boolean)}),o.push({key:l("others-collections"),label:"Other collections",children:u(e)}),o}let c=[{key:l("associated"),label:"Associated records",children:()=>e.dataSourceManager.getCollection(n,i).getAssociationFields(this._getScene()).map(e=>{if(!e.targetCollection||"belongsToArray"===e.type||!this.filterCollection(e.targetCollection)||!this.isCollectionAvailable(e.targetCollection))return null;let r=`{{ctx.popup.record.${e.sourceKey||e.collection.filterTargetKey}}}`;e.sourceKey===e.collection.filterTargetKey&&(r="{{ctx.view.inputArgs.filterByTk}}");let i={dataSourceKey:n,collectionName:e.target,associationName:e.resourceName,sourceId:r};return{key:l(`associated-${e.name}`),label:e.title,useModel:this.name,createModelOptions:t({stepParams:{resourceSettings:{init:i}}})}}).filter(Boolean)},{key:l("others-records"),label:"Other records",children:u(e)}];if(this._isScene("one")){let r=e.dataSourceManager.getCollection(n,i);if(!r||!this.filterCollection(r)||!this.isCollectionAvailable(r))return c;let o={dataSourceKey:n,collectionName:i,filterByTk:"{{ctx.view.inputArgs.filterByTk}}"};a&&(o.associationName=a,o.sourceId="{{ctx.view.inputArgs.sourceId}}"),c.unshift({key:l("current-record"),label:"Current record",useModel:this.name,createModelOptions:t({stepParams:{resourceSettings:{init:o}}})})}return c}get dataSource(){return this.context.dataSource}get collection(){return this.context.collection}get resource(){return this.context.resource}get association(){return this.context.association}get associationField(){return this.context.association}getAclActionName(){return"view"}async getFilterFields(){return this.collection.getFields().filter(e=>e.filterable)}getResourceSettingsInitParams(){return this.getStepParams("resourceSettings","init")}onInit(e){super.onInit(e),this.context.defineProperty("blockModel",{value:this}),this.context.defineProperty("actionName",{get:()=>this.getAclActionName(),cache:!1}),this.context.defineProperty("resourceName",{get:()=>this.resource.getResourceName(),cache:!1}),this.context.defineProperty("dataSource",{get:()=>{let e=this.getResourceSettingsInitParams();return this.context.dataSourceManager.getDataSource(e.dataSourceKey)}}),this.context.defineProperty("collection",{get:()=>{let e=this.getResourceSettingsInitParams();return this.context.dataSourceManager.getCollection(e.dataSourceKey,e.collectionName)}}),this.context.defineProperty("resource",{get:()=>{let e=this.getResourceSettingsInitParams(),t=this.createResource(this.context,e);t.setDataSourceKey(e.dataSourceKey),t.setResourceName(e.associationName||e.collectionName);let l=()=>{var l;let n=this.context.engine;if(!(null==n?void 0:n.getDataSourceDirtyVersion))return;let r=(null==(l=t.getDataSourceKey)?void 0:l.call(t))||e.dataSourceKey||"main";this.lastSeenDirtyVersion=this.getDirtyTrackingVersion(n,r,t,e)};return l(),t.on("refresh",()=>{l(),this.invalidateFlowCache("beforeRender")}),t}}),this.context.defineProperty("association",{get:()=>{let e=this.getResourceSettingsInitParams();if(e.associationName)return this.dataSource.getAssociation(e.associationName)}})}createResource(e,t){throw Error("createResource method must be implemented in subclasses of CollectionBlockModel")}refresh(){return this.resource?this.resource.refresh():super.refresh()}defaultBlockTitle(){var e,t,l,n;let r=this.translate((null==(e=this.constructor.meta)?void 0:e.label)||this.constructor.name),i=this.getResourceSettingsInitParams(),o=this.dataSource,s=this.collection,d=(null==o?void 0:o.displayName)||(null==o?void 0:o.key)||(null==i?void 0:i.dataSourceKey),u=(null==(n=this.context)||null==(l=n.dataSourceManager)||null==(t=l.getDataSources)?void 0:t.call(l).length)||0,c=(null==s?void 0:s.title)||(null==s?void 0:s.name)||(null==i?void 0:i.collectionName)||"",p=o?this.association:void 0;if(p){let e=this.resource.getResourceName(),t=o.getCollection(e.split(".")[0]);return(0,a.l)({blockLabel:r,dsName:d,dsCount:u,collectionTitle:c,sourceCollectionTitle:null==t?void 0:t.title,associationTitle:p.title})}return(0,a.l)({blockLabel:r,dsName:d,dsCount:u,collectionTitle:c})}addAppends(e){var t,l;let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e)if(e.includes(".")){let l=this.collection;if(!l)return;let[r,i]=e.split("."),o=this.context.dataSourceManager.getCollectionField(`${l.dataSourceKey}.${l.name}.${r}`);if(!o)return;let a=o.target;if(!a)return;let s=this.context.dataSourceManager.getCollectionField(`${l.dataSourceKey}.${a}.${i}`);if(s&&s.isAssociationField()){if(this.resource.addAppends(e),(null==(t=s.targetCollection)?void 0:t.template)==="tree"){let t=e.includes(".")?e.slice(e.lastIndexOf(".")+1):e;s.name===t&&this.resource.addAppends(`${e}.parent(recursively=true)`)}n&&this.resource.refresh()}}else{if(!this.collection)return;let t=this.context.dataSourceManager.getCollectionField(`${this.collection.dataSourceKey}.${this.collection.name}.${e}`);if(!t)return;t.isAssociationField()&&(this.resource.addAppends(t.name),(null==(l=t.targetCollection)?void 0:l.template)==="tree"&&this.resource.addAppends(`${t.name}.parent(recursively=true)`),n&&this.resource.refresh())}}constructor(...e){super(...e),(0,n._)(this,"isManualRefresh",!1),(0,n._)(this,"collectionRequired",!0),(0,n._)(this,"previousBeforeRenderHash",void 0),(0,n._)(this,"lastSeenDirtyVersion",null),(0,n._)(this,"dirtyRefreshing",!1)}}u.registerFlow({key:"resourceSettings",sort:-999,steps:{collectionCheck:{handler(e){e.collection||e.exitAll()}},aclCheck:{use:"aclCheck"},init:{handler(e,t){if(!t.dataSourceKey)throw Error("dataSourceKey is required");if(!t.collectionName)throw Error("collectionName is required");Object.keys(t).includes("sourceId")&&e.resource.setSourceId(t.sourceId),Object.keys(t).includes("filterByTk")&&e.resource.setFilterByTk(t.filterByTk)}}}}),u.registerFlow({key:"refreshSettings",sort:1e4,steps:{refresh:{async handler(e){let t=e.model,l=e.model.context.filterManager,n=(null==l?void 0:l.prepareFiltersForTarget)?await l.prepareFiltersForTarget(e.model.uid):void 0;l&&l.bindToTarget(e.model.uid);let i=t.getDataLoadingMode(),o=t.resource;if(o instanceof r.MultiRecordResource&&"manual"===i&&!t.hasActiveFilters()){o.setData([]),o.setMeta({count:0,hasNext:!1,page:1}),o.loading=!1;return}null==n||n.forEach(t=>{var l;null==t||null==(l=t.markInitialTargetRefreshHandled)||l.call(t,e.model.uid)}),e.model.isManualRefresh?e.model.resource.loading=!1:await e.model.resource.refresh()}}}}),u.registerFlow({key:"dataLoadingModeSettings",sort:800,title:(0,r.tExpr)("Set data loading mode"),steps:{dataLoadingMode:{use:"dataLoadingMode"}}}),u.define({hide:!0})},5679(e,t,l){l.d(t,{R:()=>i});var n=l(11869),r=l(15892);class i extends r.z{}i.define({hide:!0,label:(0,n.tExpr)("Data blocks"),async children(e){let t=await (0,n.buildSubModelItems)(i)(e),{collectionName:l,filterByTk:r,scene:o}=e.view.inputArgs;return t.filter(t=>{var n,i,a,s,d,u,c;let p=e.engine.getModelClass(t.useModel);return"select"===o?null==(s=p._isScene)?void 0:s.call(p,"select"):"subForm"===o?null==(d=p._isScene)?void 0:d.call(p,"subForm"):"bulkEditForm"===o?null==(u=p._isScene)?void 0:u.call(p,"bulkEditForm"):"new"===o||l&&!r?null==(c=p._isScene)?void 0:c.call(p,"new"):!p._isScene||!(null==(n=p._isScene)?void 0:n.call(p,"select"))&&!(null==(i=p._isScene)?void 0:i.call(p,"subForm"))&&!(null==(a=p._isScene)?void 0:a.call(p,"bulkEditForm"))})}})},81486(e,t,l){l.d(t,{o:()=>r});var n=l(11869);class r extends n.FlowModel{static resolveUse(e,t,l){var n,r;let i=null==e||null==(r=e.stepParams)||null==(n=r.fieldBinding)?void 0:n.use;return i&&i!==(null==e?void 0:e.use)?i:null==e?void 0:e.use}}},33297(e,t,l){l.d(t,{L:()=>i});var n=l(11869),r=l(14252);class i extends r.S0{}i.define({children:async e=>(await (0,n.buildSubModelItems)(r.S0)(e)).filter(t=>e.engine.getModelClass(t.useModel)._isScene(r.s5.record))})},58428(e,t,l){l.d(t,{GO:()=>x,KW:()=>S,Z1:()=>y,eu:()=>b,nF:()=>v,zL:()=>s});var n=l(74848),r=l(11869),i=l(96540),o=l(72380),a=l(33297);let s="assignFieldValues";function d(e){let t=null==e?void 0:e.collection;return t&&"object"==typeof t?t:void 0}function u(e){let t=d(e),l=null==t?void 0:t.dataSourceKey,n=null==t?void 0:t.name;return l&&n?{dataSourceKey:l,collectionName:n}:void 0}function c(e,t){let l=(null==e?void 0:e.collection)||d(t),n=null==l?void 0:l.dataSourceKey,r=null==l?void 0:l.name;return n&&r?{dataSourceKey:n,collectionName:r}:void 0}function p(e){if(!e||"object"!=typeof e)return!1;let t=e;return"string"==typeof t.dataSourceKey&&!!t.dataSourceKey&&"string"==typeof t.collectionName&&!!t.collectionName}function h(e){return e&&"object"==typeof e?e:void 0}function m(e,t){var l,n,r;let i=h(e);i&&(null==(l=i._observableCache)||delete l[t],null==(n=i._cache)||delete n[t],null==(r=i._pending)||delete r[t])}function f(e){m(null==e?void 0:e.context,"dataSource"),m(null==e?void 0:e.context,"collection"),m(null==e?void 0:e.context,"resource"),m(null==e?void 0:e.context,"association")}function g(e){var t,l,n,r,i;if(e.model.assignFormUid){let t=null==(r=(i=e.engine).getModel)?void 0:r.call(i,e.model.assignFormUid,!0);if(t)return t}let o=null==(t=e.model.subModels)?void 0:t.assignForm;return o||(null==(l=(n=e.engine).findModelByParentId)?void 0:l.call(n,e.model.uid,"assignForm"))||void 0}function v(e){return{async:!0,use:"AssignFormModel",stepParams:{resourceSettings:{init:u(e)}}}}function y(e,t){var l,n;let r=(null==(l=(n=e.model).getStepParams)?void 0:l.call(n,t,s))||{};return{assignedValues:(null==r?void 0:r.assignedValues)||{}}}async function b(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"AssignFieldValues";try{return await (0,r.resolveRunJSObjectValues)(e,t)}catch(t){var n,i,o;return console.error(`[${l}] RunJS execution failed`,t),null==(o=e.message)||null==(i=o.error)||i.call(o,(null==(n=e.t)?void 0:n.call(e,"RunJS execution failed"))||"RunJS execution failed"),null}}function x(e,t){return t&&"object"==typeof t&&Object.keys(t).length?{...e,...t}:e}function w(e){let{model:t,blockModel:l}=(0,r.useFlowSettingsContext)(),d=t,u=(0,r.useFlowEngine)(),[h,m]=i.useState(null);return(0,i.useEffect)(()=>{let n=!1;return(async()=>{var r,i,h,g,v;let y=c(l,null==d?void 0:d.context),b=await u.loadOrCreateModel(y?{parentId:d.uid,subKey:"assignForm",use:"AssignFormModel",stepParams:{resourceSettings:{init:y}}}:{parentId:d.uid,subKey:"assignForm",use:"AssignFormModel"},{skipSave:!t.context.flowSettingsEnabled});if(n)return;if(p(y)){let e=null==(h=b.getStepParams)?void 0:h.call(b,"resourceSettings","init");p(e)&&e.dataSourceKey===y.dataSourceKey&&e.collectionName===y.collectionName||null==(v=b.setStepParams)||v.call(b,"resourceSettings","init",y),f(b),f(null==(g=b.subModels)?void 0:g.grid)}let x=(null==(r=d.getStepParams)?void 0:r.call(d,e.settingsFlowKey,s))||{};b.setInitialAssignedValues((null==x?void 0:x.assignedValues)||{});let w=t instanceof o.U&&!(t instanceof a.L);(e.clearRecordContext||w)&&(null==(i=b.context)?void 0:i.defineProperty)&&b.context.defineProperty("record",{get:()=>void 0,cache:!1}),m(b),d.assignFormUid=(null==b?void 0:b.uid)||d.assignFormUid})(),()=>{n=!0}},[d,l,u,t,t.context.flowSettingsEnabled,e.clearRecordContext,e.settingsFlowKey]),h?(0,n.jsx)(r.FlowModelRenderer,{model:h,showFlowSettings:!1}):null}function S(e){return{title:e.title||(0,r.tExpr)("Assign field values"),uiSchema:()=>({tip:e.tipComponent?{"x-decorator":"FormItem","x-component":e.tipComponent}:void 0,editor:{"x-decorator":"FormItem","x-component":()=>(0,n.jsx)(w,{settingsFlowKey:e.settingsFlowKey,clearRecordContext:e.clearRecordContext})}}),async beforeParamsSave(t,l,n){var r,i,o,a,d,u,c;let p=g(t);if(!p){let r=(null==l?void 0:l.assignedValues)||(null==n?void 0:n.assignedValues)||{};null==(a=(d=t.model).setStepParams)||a.call(d,e.settingsFlowKey,s,{assignedValues:r});return}e.validateBeforeSave&&await (null==(c=p.form)||null==(u=c.validateFields)?void 0:u.call(c));let h=(null==(r=p.getAssignedValues)?void 0:r.call(p))||{};null==(i=(o=t.model).setStepParams)||i.call(o,e.settingsFlowKey,s,{assignedValues:h})},handler(){}}}},13595(e,t,l){l.r(t),l.d(t,{DateFilterDynamicComponent:()=>F});var n=l(74848),r=l(96540),i=l(35710),o=l(71500),a=l(84626),s=l(36492),d=l(63718),u=l(22803),c=l(11869),p=l(2077),h=l(96436),m=l(37985),f=l(40098),g=l.n(f);let v=e=>e?e.replace(/\s*HH?:mm(?::ss)?(?:\.SSS)?/g,"").trim():e,y=(e,t)=>{if(!e)return null;if(h.dayjs.isDayjs(e))return e;if("string"==typeof e&&e.endsWith("Z")){let l=(0,h.dayjs)(e).format(t),n=(0,h.dayjs)(l,t);return n.isValid()?n:(0,h.dayjs)(e)}let l=(0,h.dayjs)(e,t);if(l.isValid())return l;let n=(0,h.dayjs)(e);return n.isValid()?n:null},b=e=>{let{value:t,picker:l="date",format:i,showTime:o,timeFormat:a}=e,s=(0,c.useFlowEngine)(),d=s.translate.bind(s),u=(0,p.fD)(),f=[{label:d("Today"),value:u.today},{label:d("Last week"),value:u.lastWeek},{label:d("This week"),value:u.thisWeek},{label:d("Next week"),value:u.nextWeek},{label:d("Last month"),value:u.lastMonth},{label:d("This month"),value:u.thisMonth},{label:d("Next month"),value:u.nextMonth},{label:d("Last quarter"),value:u.lastQuarter},{label:d("This quarter"),value:u.thisQuarter},{label:d("Next quarter"),value:u.nextQuarter},{label:d("Last year"),value:u.lastYear},{label:d("This year"),value:u.thisYear},{label:d("Next year"),value:u.nextYear},{label:d("Last 7 days"),value:u.last7Days},{label:d("Next 7 days"),value:u.next7Days},{label:d("Last 30 days"),value:u.last30Days},{label:d("Next 30 days"),value:u.next30Days},{label:d("Last 90 days"),value:u.last90Days},{label:d("Next 90 days"),value:u.next90Days}],b=t?(0,p.Pn)(null==t?void 0:t[0],l):l,x=b===l&&i?i:(0,h.getPickerFormat)(b),w="date"===b?v(x):x,S=(0,h.getDateTimeFormat)(b,w,o,a),M={utc:!0,presets:f,...e,format:S,picker:b,showTime:!!o&&{defaultValue:[(0,h.dayjs)("00:00:00","HH:mm:ss"),(0,h.dayjs)("23:59:59","HH:mm:ss")]}},A=(0,r.useMemo)(()=>g().castArray(e.value).map(e=>y(e,S)),[e.value,S]);return(0,n.jsx)(m.A.RangePicker,{...M,style:{flex:1,...null==M?void 0:M.style},value:A})},x=e=>e?e.replace(/\s*HH?:mm(?::ss)?(?:\.SSS)?/g,"").trim():e,w=(e,t)=>{if(!e)return null;if(h.dayjs.isDayjs(e))return e;if("string"==typeof e&&e.endsWith("Z")){let l=(0,h.dayjs)(e).format(t),n=(0,h.dayjs)(l,t);return n.isValid()?n:(0,h.dayjs)(e)}let l=(0,h.dayjs)(e,t);if(l.isValid())return l;let n=(0,h.dayjs)(e);return n.isValid()?n:null},S=e=>{let{picker:t="date",format:l,showTime:i,timeFormat:o,onChange:d}=e,u=(0,c.useFlowContext)(),f=Array.isArray(e.value)?e.value[0]:e.value,g=f?(0,p.Pn)(f,t):t,[v,y]=(0,r.useState)(g),b=u.model.translate.bind(u.model),S=e=>{let n=e===t&&l?l:(0,h.getPickerFormat)(e),r="date"===e?x(n):n;return(0,h.getDateTimeFormat)(e,r,i,o)},M=(0,r.useMemo)(()=>S(v),[l,t,i,v,o]),A=(0,r.useMemo)(()=>w(f,M),[f,M]),F={utc:!0,inputReadOnly:u.isMobileLayout,...e,underFilter:!0,showTime:!!i&&{defaultValue:(0,h.dayjs)("00:00:00","HH:mm:ss")},format:M,picker:v};return(0,n.jsxs)(a.A.Compact,{style:{width:"100%"},children:[(0,n.jsx)(s.A,{style:{width:"100px"},popupMatchSelectWidth:!1,value:v,options:[{label:b("Date"),value:"date"},{label:b("Month"),value:"month"},{label:b("Quarter"),value:"quarter"},{label:b("Year"),value:"year"}],onChange:e=>{let t=S(e),l=M;if(y(e),!f||!d)return;let n=w(f,l);n&&n.isValid()&&d(n,n.format(t))}}),(0,n.jsx)(m.A,{...F,style:{flex:1,...null==F?void 0:F.style},value:A})]})},M=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=[{value:"exact",label:e("Exact day")},{value:"past",label:e("Past")},{value:"next",label:e("Next")},{value:"today",label:e("Today")},{value:"yesterday",label:e("Yesterday")},{value:"tomorrow",label:e("Tomorrow")},{value:"thisWeek",label:e("This Week")},{value:"lastWeek",label:e("Last Week")},{value:"nextWeek",label:e("Next Week")},{value:"thisMonth",label:e("This Month")},{value:"lastMonth",label:e("Last Month")},{value:"nextMonth",label:e("Next Month")},{value:"thisQuarter",label:e("This Quarter")},{value:"lastQuarter",label:e("Last Quarter")},{value:"nextQuarter",label:e("Next Quarter")},{value:"thisYear",label:e("This Year")},{value:"lastYear",label:e("Last Year")},{value:"nextYear",label:e("Next Year")}];return t&&l.splice(3,0,{value:"now",label:e("Now")}),l},A=e=>{let{isRange:t,defaultValue:l,onChange:i,...o}=e,a=(0,r.useCallback)((e,t)=>i(t),[i]);return t?(0,n.jsx)(b,{...o,onChange:a}):(0,n.jsx)(S,{...o,onChange:a})},F=e=>{let{value:t,onChange:l,includeNow:p=!1,...h}=e,m=(0,c.useFlowEngine)(),f=m.translate.bind(m),{token:g}=i.A.useToken(),[v,y]=(0,r.useState)(!1),b=(0,r.useMemo)(()=>M(f,p),[f,p]),x=e=>{if(y(!1),"exact"===e)return l(void 0);let t={type:e};["past","next"].includes(e)&&(t.number=1,t.unit="day"),l(t)},w=()=>{let e=b.slice(0,3),t=b.slice(3),l=(0,u.css)`
|
|
1261
1261
|
padding: 3px 10px;
|
|
1262
1262
|
cursor: pointer;
|
|
1263
1263
|
white-space: nowrap;
|
|
@@ -1711,4 +1711,4 @@ ${i.join("\n")}`:""}function k(e){let t=String((null==e?void 0:e.message)||"");i
|
|
|
1711
1711
|
${o.join("\n")}`:""}function j(e,t){let l=Error(t);l.cause=e;try{let t="string"==typeof(null==e?void 0:e.name)?e.name:"";t&&(l.name=t)}catch(e){}try{let n="string"==typeof(null==e?void 0:e.stack)?e.stack:"";if(n){let e=String(n).split("\n");e.length&&(e[0]=`${l.name}: ${t}`,l.stack=e.join("\n"))}}catch(e){}return l}function E(e){if(!e)return null;let t=u.get(e);if(t)return t;if("function"!=typeof e.createElement)return null;let l=e.Component;if("function"!=typeof l)return null;class r extends l{static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e){try{var t,l,n;let r=null==(t=this.props)?void 0:t.enhanceReactError,i="function"==typeof r?r(e):e,o=String((null==i?void 0:i.message)||"");if(o&&/\[RunJS Hint\]/.test(o)){console.error(o);let e=null==(n=this.props)||null==(l=n.ctx)?void 0:l.logger;e&&"function"==typeof e.error&&e.error(o)}}catch(e){}}componentDidUpdate(e){var t,l;(null==e?void 0:e.resetKey)!==(null==(t=this.props)?void 0:t.resetKey)&&(null==(l=this.state)?void 0:l.error)&&this.setState({error:void 0})}render(){var t,l;let n=null==(t=this.state)?void 0:t.error;if(!n)return this.props.children;let r="";try{let e=null==(l=this.props)?void 0:l.enhanceReactError,t="function"==typeof e?e(n):n;r=String((null==t?void 0:t.message)||t||(null==n?void 0:n.message)||n||"")}catch(e){r=String((null==n?void 0:n.message)||n||"")}let i={boxSizing:"border-box",padding:12,borderRadius:6,border:"1px solid #ffccc7",background:"#fff2f0",color:"#a8071a",fontSize:12,lineHeight:1.5,maxWidth:"100%",overflow:"auto"},o={margin:0,whiteSpace:"pre-wrap",wordBreak:"break-word",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},a={fontWeight:600,marginBottom:8};return e.createElement("div",{style:i},e.createElement("div",{style:a},"RunJS render error"),e.createElement("pre",{style:o},r))}constructor(...e){super(...e),(0,n._)(this,"state",{})}}return u.set(e,r),r}function R(e){let{ctx:t,vnode:l,enhanceReactError:n,resetKey:r}=e,i=null==t?void 0:t.React,o=E(i);return o?i.createElement(o,{ctx:t,enhanceReactError:n,resetKey:r},l):l}function I(e){var t;let{ctx:l,entry:n,containerEl:r,rootMap:o,unmountContainerRoot:a,enhanceReactError:s,internalReact:d,internalAntd:u}=e;if(!(!(null==(t=l.ReactDOM)?void 0:t.__nbRunjsInternalShim)&&l.React&&l.React!==d&&l.antd&&l.antd!==u&&void 0!==l.antd.ConfigProvider)){if(n.disposeTheme){try{n.disposeTheme()}catch(e){}n.disposeTheme=void 0}return!1}let c=()=>{var e,t,r,i,o,a,s;null==l||null==(t=l.engine)||null==(e=t.context)||e.themeToken;let d=null==l||null==(i=l.engine)||null==(r=i.context)?void 0:r.antdConfig,u=(null==l||null==(s=l.engine)||null==(a=s.context)||null==(o=a.locales)?void 0:o.antd)||(null==d?void 0:d.locale),c=l.antd.ConfigProvider,p=l.antd.App,h={popupMatchSelectWidth:!1,locale:u||{}};d&&"object"==typeof d&&(void 0!==d.direction&&(h.direction=d.direction),"string"==typeof d.prefixCls&&(h.prefixCls=d.prefixCls),"string"==typeof d.iconPrefixCls&&(h.iconPrefixCls=d.iconPrefixCls),"function"==typeof d.getPopupContainer&&(h.getPopupContainer=d.getPopupContainer),d.theme&&"object"==typeof d.theme&&(h.theme=d.theme));let m=n.lastVnode,f=p?l.React.createElement(c,h,l.React.createElement(p,null,m)):l.React.createElement(c,h,m);n.root.render(f)};return n.disposeTheme?c():n.disposeTheme=(0,i.autorun)(()=>{try{if(r&&1===r.nodeType&&"boolean"==typeof r.isConnected&&!r.isConnected&&n.wasConnected)return void queueMicrotask(()=>{o.get(r)===n&&a()});r&&1===r.nodeType&&"boolean"==typeof r.isConnected&&r.isConnected&&(n.wasConnected=!0),c()}catch(e){throw s(e)}}),!0}function T(e){let{ctx:t,entry:l,vnode:n,containerEl:r,rootMap:i,unmountContainerRoot:o,internalReact:a,internalAntd:s}=e,d=e=>{let l=String((null==e?void 0:e.message)||e||"");if(!l||/\[RunJS Hint\]/.test(l))return e;let n=/invalid hook call/i.test(l),r=k(e);if(!n&&!r)return e;let i=F({ctx:t,internalReact:a,internalAntd:s})||P({ctx:t,internalReact:a,internalAntd:s,err:e});return i?j(e,`${l}${i}`):e};try{return l.__nbRunjsRenderSeq=(l.__nbRunjsRenderSeq||0)+1,l.lastVnode=R({ctx:t,vnode:n,enhanceReactError:d,resetKey:l.__nbRunjsRenderSeq}),I({ctx:t,entry:l,containerEl:r,rootMap:i,unmountContainerRoot:o,enhanceReactError:d,internalReact:a,internalAntd:s})||l.root.render(l.lastVnode),l.root}catch(e){throw d(e)}}},44476(e,t,l){l.d(t,{H:()=>d,a:()=>u});var n=l(2543),r=l.n(n),i=l(35846);function o(e){if(!e)return;let t=e.match(/^([^.[]+)/);return null==t?void 0:t[1]}function a(e,t){var l;if(!e||!t)return;let n=e.getField(t);return n||((null==(l=e.getFields)?void 0:l.call(e))||[]).find(e=>e.name===t)}function s(e,t){if(null!=e){if(Array.isArray(t)){if("object"!=typeof e||!e)return;let l={};for(let n of t){let t=e[n];if(null==t)return;l[n]=t}return l}if("string"==typeof e||"number"==typeof e)return e;if("object"==typeof e)return e[t]}}function d(e,t){return l=>{if(!l||!l.includes("."))return!1;let n=o(l);if(!n)return!1;let i=a(e(),n);if(!(null==i?void 0:i.isAssociationField()))return!1;if("function"==typeof t){let e=t();if(e&&"object"==typeof e&&void 0!==r().get(e,l))return!1}return!0}}function u(e,t,l){let n=(0,i.H)(e,t,!0),r=async()=>{let t=await n();return t?{...t,buildVariablesParams:t=>{var n;let r=e(),i=l(t);if(!r||!i||"object"!=typeof i)return{};let o={};for(let e of(null==(n=r.getFields)?void 0:n.call(r))||[]){let t=e.name;if(!t||!e.isAssociationField())continue;let l=e.target,n=e.targetCollection;if(!l||!n)continue;let r=n.filterTargetKey,a=i[t];if(null!=a)if(Array.isArray(a)){let e=a.map(e=>s(e,r)).filter(e=>null!=e);e.length&&(o[t]={collection:l,dataSourceKey:n.dataSourceKey,filterByTk:e})}else{let e=s(a,r);null!=e&&(o[t]={collection:l,dataSourceKey:n.dataSourceKey,filterByTk:e})}}return o}}:null};return r.title=t,r}},35846(e,t,l){l.d(t,{H:()=>d});let n=["belongsTo","hasOne","hasMany","belongsToMany","belongsToArray"],r=["integer","float","double","decimal"];function i(e,t){return!!(e.interface&&(t||e.filterable))}function o(e,t){let l=s(e);if(e.isAssociationField()){let n=e.targetCollection;return n?{type:"object",...l,properties:async()=>{let e={};return n.fields.forEach(l=>{i(l,t)&&(e[l.name]=o(l,t))}),e}}:{type:"object",...l}}return{type:a(e),...l}}function a(e){let t=e.type;if(n.includes(t))return"object";if(r.includes(t))return"number";switch(t){case"boolean":return"boolean";case"json":return"object";case"array":return"array";default:return"string"}}function s(e){return{title:e.title||e.name,interface:e.interface,options:e.options,uiSchema:e.uiSchema||{}}}function d(e,t,l){let n=async()=>{let n="function"==typeof e?e():e;return n?{type:"object",title:t||n.title||n.name,properties:async()=>{let e={};return n.fields.forEach(t=>{i(t,l)&&(e[t.name]=o(t,l))}),e}}:null};return n.title=t,n}},62572(e,t,l){l.d(t,{v:()=>r});var n=l(29007);async function r(e,t){if(null==t||!t.defineProperties&&!t.defineMethods)return e;let l=new n.cB;l.addDelegate(e);let r=l.createProxy(),i=r,o=e,a=t=>{let l=Reflect.get(o,t,o);return"function"==typeof l?l.bind(e):l},s=e=>"defineProperty"===e||"defineMethod"===e||Reflect.has(i,e)||Reflect.has(o,e),d=new Proxy(r,{get:(e,t,n)=>"string"==typeof t?"defineProperty"===t?(e,t)=>l.defineProperty(e,t):"defineMethod"===t?(e,t,n)=>l.defineMethod(e,t,n):Reflect.has(i,t)?Reflect.get(i,t,n):a(t):Reflect.get(i,t,n),set:(e,t,l)=>Reflect.set(o,t,l),has:(e,t)=>s(t),getOwnPropertyDescriptor:(e,t)=>Object.getOwnPropertyDescriptor(i,t)||Object.getOwnPropertyDescriptor(o,t)});if(t)for(let e of Array.isArray(t)?t:[t]){if(!e)continue;let t=e.defineProperties;if(t){let e="function"==typeof t?await t(d):t;if(!e||"object"!=typeof e)throw TypeError("defineProperties must return an object of PropertyOptions");for(let[t,n]of Object.entries(e)){if(!n||"object"!=typeof n)throw TypeError(`defineProperties['${t}'] must be a PropertyOptions object`);l.defineProperty(t,n)}}let n=e.defineMethods;if(n){let e="function"==typeof n?await n(d):n;if(!e||"object"!=typeof e)throw TypeError("defineMethods must return an object of functions");for(let[t,n]of Object.entries(e)){if("function"!=typeof n)throw TypeError(`defineMethods['${t}'] must be a function`);l.defineMethod(t,n)}}}return new Proxy(r,{get:(t,l,n)=>"string"==typeof l?"defineProperty"===l?(t,l)=>e.defineProperty(t,l):"defineMethod"===l?(t,l,n)=>e.defineMethod(t,l,n):Reflect.has(i,l)?Reflect.get(i,l,n):a(l):Reflect.get(i,l,n),set:(e,t,l)=>Reflect.set(o,t,l),has:(e,t)=>s(t),getOwnPropertyDescriptor:(e,t)=>Object.getOwnPropertyDescriptor(i,t)||Object.getOwnPropertyDescriptor(o,t)})}},44951(e,t,l){l.d(t,{BL:()=>s,T$:()=>i});var n=l(16639);function r(e,t){if(!e||"object"!=typeof e)return;let l=e;if("function"==typeof l.get){let e=l.get(t);if(null!=e&&""!==e)return e}let n=t.toLowerCase();for(let[t,l]of Object.entries(e))if(t.toLowerCase()===n)return l}function i(e){let t=r(e,"x-data-source");return Array.isArray(t)?String(t[0]||"main"):null==t||""===t?"main":String(t)}function o(e){let t=String(e||"").trim();if(!t)return[];let l=new Set([t]);return t.includes(".")&&l.add(t.split(".")[0]),Array.from(l)}function a(e,t){if(!t)return[e];let l=[],n=new Set,r=e,i=0;for(;r&&i++<50;)n.has(r)||(l.push(r),n.add(r)),r=r.previousEngine;return l}function s(e){var t,l,r,i;let{engine:s,resourceName:d,includePreviousEngines:u}=e;if(!(null==s?void 0:s.markDataSourceDirty))return[];let c=o(d);if(!c.length)return[];let p=String(e.dataSourceKey||"main"),h=a(s,u),m=new Map;for(let e of h){let t=new Map;for(let l of(m.set(e,t),c))t.set(l,(null==(r=e.getDataSourceDirtyVersion)?void 0:r.call(e,p,l))||0)}for(let e of h){let t=m.get(e);for(let l of c){let n=(null==t?void 0:t.get(l))||0;((null==(i=e.getDataSourceDirtyVersion)?void 0:i.call(e,p,l))||0)===n&&e.markDataSourceDirty(p,l)}}return null==(l=s.emitter)||null==(t=l.emit)||t.call(l,n.HK,{dataSourceKey:p,resourceNames:c}),c}},9297(e,t,l){l.d(t,{k:()=>O,q:()=>i});var n=l(33329),r=l(44951);let i="__nocobaseSkipDataSourceDirty",o=Symbol("nocobaseDirtyDispatchToken"),a=new WeakMap,s=new WeakSet,d=["add","bulkdestroy","bulkupdate","create","delete","destroy","execute","firstorcreate","import","move","remove","save","saveastemplate","set","setfields","submit","update","updateorcreate","upsert"];function u(e){if(!e||"object"!=typeof e)return!1;let t=e;return"function"==typeof t.resource&&"function"==typeof t.request}function c(e){let t=String(e||"").trim();if(!t)return!1;let l=t.split("/")[0],n=l.toLowerCase();return d.some(e=>{if(n===e)return!0;if(!n.startsWith(e)||l.length<=e.length)return!1;let t=l[e.length];return"-"===t||"_"===t||t>="A"&&t<="Z"})}function p(){var e;return"u"<typeof window||null==(e=window.location)?void 0:e.origin}function h(e,t){try{return new URL(e,t)}catch{return}}function m(e){let t=e.search(/[?#]/);return -1===t?e:e.slice(0,t)}function f(e){let t=m(e).trim();if(!t)return;let l=t.replace(/^\/+/,"");if(l&&"api"!==l)return l.startsWith("api/")?l.slice(4):l}function g(e){return e.endsWith("/")?e:`${e}/`}function v(e){if(null==e?void 0:e.getApiUrl)try{return h(e.getApiUrl(),p())}catch{return}}function y(e,t){let l=m(e).trim();if(!l.startsWith("/"))return;let n=g(t);if(!g(l).startsWith(n))return;let r=n.replace(/\/$/,"");return l.slice(r.length).replace(/^\/+/,"")||void 0}function b(e,t){if(!["http:","https:"].includes(e.protocol))return;if(null==t?void 0:t.getApiUrl){let l=v(t);if(!l||e.origin!==l.origin)return;return y(e.pathname,l.pathname)}let l=p();if(l&&e.origin===l)return f(e.pathname)}function x(e,t){if("string"!=typeof e)return;let l=e.trim();if(!l||l.startsWith("//"))return;if(/^https?:\/\//i.test(l)){let e=h(l);if(!e)return;return b(e,t.app)}let n=v(t.app),r=n?y(l,n.pathname):void 0;return r||f(l)}function w(e){try{return decodeURIComponent(e)}catch{return e}}function S(e){return String(e??"").trim()||void 0}function M(e){let t,l=[],n=-1;for(let r=0;r<e.length;r+=2){let i=e[r],o=i.lastIndexOf(":"),a=-1===o?i:i.slice(0,o);if(!a)return;if(l.push(w(a)),-1!==o){t=w(i.slice(o+1)).trim(),n=r;break}}if(t&&l.length&&!(e.length>n+2))return{resourceName:l.join("."),actionName:t}}function A(e,t){let l=x(e,t);if(!l)return;let n=m(l).split("/").filter(Boolean);if("dataSources"===w(n[0]||"")&&n.length>=3){let e=S(w(n[1])),t=M(n.slice(2));if(e&&t)return{...t,dataSourceKey:e}}return M(n)}function F(e,t,l,n){let r=e.trim(),i=l.trim();if(!r||!i)return;if(r.includes("/")){let e=A(`${r}:${i}`,n);if(e)return e}let o="dataSources.";if(r.startsWith(o)){let e=S(t),l=r.slice(o.length).trim();if(e&&l)return{dataSourceKey:e,resourceName:l,actionName:i}}return{resourceName:r,actionName:i}}function k(e,t){let l="string"==typeof(null==e?void 0:e.resource)?e.resource:void 0,n="string"==typeof(null==e?void 0:e.action)?e.action:void 0;return l&&n?F(l,e.resourceOf,n,t):A(null==e?void 0:e.url,t)}function C(e,t){if(e)return JSON.stringify([e.dataSourceKey||(0,r.T$)(t),e.resourceName,e.actionName])}function P(e,t){return C(k(e,t),e.headers)}function j(e,t,l){let n=String(e??"").trim();if(n)return JSON.stringify([n,String(t??""),(0,r.T$)(l)])}function E(e,t){if(e&&t&&(!e.requestKey||e.requestKey===t))return e}function R(e,t){if(e&&t&&(!e.resourceKey||e.resourceKey===t))return e}function I(e,t,l){(0,r.BL)({engine:e.engine,dataSourceKey:t.dataSourceKey||(0,r.T$)(l),resourceName:t.resourceName,includePreviousEngines:!0})}function T(e,t,l,n){!e.skip&&!e.marked&&l&&c(l.actionName)&&(e.marked=!0,I(t,l,n))}function _(e){return!!e&&"object"==typeof e}function D(e,t,l,n,r,a,s){return new Proxy(t,{get(t,d,u){let p=Reflect.get(t,d,u);if("string"!=typeof d||"function"!=typeof p||!c(d))return p;let h=p;return async function(){let t;for(var c,p,m=arguments.length,f=Array(m),g=0;g<m;g++)f[g]=arguments[g];let v=_(f[1])?f[1]:void 0,y=F(l,n,d,e),b=C(y,r),x=j(l,n,r),w=E(null==v?void 0:v[o],b)||E(s,b),S=w||{marked:!1,skip:!1},M=!w;(c=S).requestKey||(c.requestKey=b),(p=S).resourceKey||(p.resourceKey=x),(null==v?void 0:v[i])&&(S.skip=!0);let A=v||null==f[1]?[f[0],{...v,[o]:S}]:f;a.push({key:b,token:S});try{t=Reflect.apply(h,u,A)}finally{a.pop()}let k=await t;return M&&T(S,e,y,r),k}}})}function N(e,t){let l,r,a=e.resource,d=e.request,u=a===n.Q9.prototype.resource,p=d===n.Q9.prototype.request,h=[],m=[],f=!1,g=!1,v=()=>f?l:w,y=()=>g?r:S,b=(e,t)=>{let l=j(t[0],t[1],t[2]),n=R(e,l),r=!!n&&f;if(n){var i;(i=n).resourceKey||(i.resourceKey=l),h.push({key:l,token:n})}try{let e=Reflect.apply(v(),A,t);if(!r||!n)return e;return new Proxy(e,{get(e,t,r){let i=Reflect.get(e,t,r);if("string"!=typeof t||"function"!=typeof i||!c(t))return i;let a=i;return function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];let s=_(t[1])?t[1]:void 0,d=s||null==t[1]?[t[0],{...s,[o]:n}]:t;h.push({key:l,token:n}),m.push({key:n.requestKey,token:n});try{return Reflect.apply(a,r,d)}finally{m.pop(),h.pop()}}}})}finally{n&&h.pop()}},x=l=>{let n=Object.create(e);return Object.defineProperties(n,{request:{configurable:!0,value:e=>{let n=e,r=P(n,t),i=m.at(-1),a=E(null==n?void 0:n[o],r)||(r&&(null==i?void 0:i.key)===r?i.token:void 0)||E(l,r),{[o]:s,...d}=n,u=a?{...d,[o]:a}:d;if(a){var c;(c=a).requestKey||(c.requestKey=r),m.push({key:r,token:a})}try{return Reflect.apply(y(),A,[u])}finally{a&&m.pop()}}},resource:{configurable:!0,value:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let r=j(t[0],t[1],t[2]),i=h.at(-1);return b(R(l,r)||(r&&(null==i?void 0:i.key)===r?i.token:void 0),t)}}}),n},w=(l,n,r,i)=>{let o=j(l,n,r),s=h.at(-1),d=o&&(null==s?void 0:s.key)===o?s.token:void 0,c=x(d);return D(t,Reflect.apply(a,u?c:e,[l,n,r,i]),l,n,r,m,d)},S=l=>{var n,r;let a=l,s=P(a,t),u=m.at(-1),c=E(null==a?void 0:a[o],s)||(s&&(null==u?void 0:u.key)===s?u.token:void 0),h=c||{marked:!1,skip:!1},f=!c;(n=h).requestKey||(n.requestKey=s),"string"==typeof a.resource&&((r=h).resourceKey||(r.resourceKey=j(a.resource,a.resourceOf,a.headers))),(null==a?void 0:a[i])&&(h.skip=!0);let g=k(a,t),{[o]:v,[i]:y,...b}=a,w=x(h);return Reflect.apply(d,p?w:e,[b]).then(e=>(f&&T(h,t,g,a.headers),e))},M=(e,t)=>{let l=Reflect.getOwnPropertyDescriptor(e,t);return!!l&&!l.configurable},A=new Proxy(e,{get:(e,t,n)=>"resource"===t?M(e,t)?Reflect.get(e,t,n):f?l:w:"request"===t?M(e,t)?Reflect.get(e,t,n):g?r:S:Reflect.get(e,t,n),set(e,t,n,i){if("resource"===t){let r=Reflect.getOwnPropertyDescriptor(e,t);return(!r||!!r.configurable&&!!Reflect.isExtensible(e))&&(f=!0,l=n,!0)}if("request"===t){let l=Reflect.getOwnPropertyDescriptor(e,t);return(!l||!!l.configurable&&!!Reflect.isExtensible(e))&&(g=!0,r=n,!0)}return Reflect.set(e,t,n,i)},deleteProperty(e,t){if("resource"!==t&&"request"!==t)return Reflect.deleteProperty(e,t);let n=Reflect.getOwnPropertyDescriptor(e,t);return(!n||!!n.configurable&&!!Reflect.isExtensible(e))&&("resource"===t?(f=!1,l=void 0):(g=!1,r=void 0),!0)},defineProperty:(e,t,l)=>"resource"!==t&&"request"!==t&&Reflect.defineProperty(e,t,l)});return s.add(A),A}function O(e,t){if(!u(e)||s.has(e))return e;let l=e,n=a.get(l);n||(n=new WeakMap,a.set(l,n));let r=n.get(t);if(r)return r;let i=N(e,t);return n.set(t,i),i}},31108(e,t,l){l.d(t,{VD:()=>o,sy:()=>r,zz:()=>i});var n=l(50467);class r extends Error{constructor(e,t,l){super(l||`Flow '${e}' on model '${t}' exited via ctx.exit().`),(0,n._)(this,"flowKey",void 0),(0,n._)(this,"modelUid",void 0),this.name="FlowExitException",this.flowKey=e,this.modelUid=t}}class i extends Error{constructor(e,t,l){super(l||`Flow '${e}' on model '${t}' exited via ctx.exitAll().`),(0,n._)(this,"flowKey",void 0),(0,n._)(this,"modelUid",void 0),this.name="FlowExitAllException",this.flowKey=e,this.modelUid=t}}class o extends Error{constructor(e="Flow settings save cancelled."){super(e),this.name="FlowCancelSaveException"}}},60182(e,t,l){l.d(t,{pM:()=>ta,Fv:()=>o,ju:()=>P.ju,MI:()=>d,vq:()=>to.v,yz:()=>_,M5:()=>ex,X4:()=>ew,Vv:()=>eM,E2:()=>ek,lW:()=>a,n2:()=>R,FA:()=>p,J3:()=>eC,vP:()=>P.vP,ME:()=>y,H9:()=>k.H,ey:()=>eA.ey,KB:()=>ee,JE:()=>es,kl:()=>r,u4:()=>n,UX:()=>P.UX,XM:()=>F,AP:()=>E,mP:()=>eT,zz:()=>u.zz,D1:()=>eA.D1,gG:()=>h.gG,I2:()=>eA.I2,af:()=>C.a,mv:()=>h.mv,QP:()=>c,Xh:()=>eA.Xh,$S:()=>P.$S,EI:()=>ts,_:()=>eA._,qI:()=>M,sU:()=>L,ln:()=>w,Z8:()=>D,cg:()=>z,zE:()=>tc,wx:()=>g.w,yp:()=>td.y,y4:()=>eb,dN:()=>G,ye:()=>J,$n:()=>eI,VD:()=>u.VD,ji:()=>ti,WJ:()=>i,i:()=>td.i,hz:()=>eS,MZ:()=>s,sy:()=>u.sy,YB:()=>j,xI:()=>P.xI,$X:()=>ey,o7:()=>S,mH:()=>tr,M:()=>h.M,nN:()=>P.nN,GZ:()=>T,Hi:()=>C.H,pc:()=>P.pc,_3:()=>A,Gu:()=>Y,DX:()=>ev,XU:()=>P.XU});let n="flow-engine",r={DATA:"dataBlocks",FILTER:"filterBlocks",OTHER:"otherBlocks"},i={data:{key:r.DATA,label:"Data blocks",type:"group",hasCurrentFlowContext:!0},filter:{key:r.FILTER,label:"Filter blocks",type:"group",hasCurrentFlowContext:!1},other:{key:r.OTHER,label:"Other blocks",type:"group",hasCurrentFlowContext:!1}},o={CURRENT_RECORD:"currentRecord",ASSOCIATION_RECORDS:"associationRecords",OTHER_RECORDS:"otherRecords",OTHER_COLLECTIONS:"otherCollections",CURRENT_COLLECTIONS:"currentCollections"};function a(e){var t;return(null==(t=e.flowEngine)?void 0:t.translate)?(t,l)=>e.flowEngine.translate(t,{ns:[n,"client"],nsMode:"fallback",...l}):e=>e}function s(e,t){return t?`{{t(${JSON.stringify(e)}, ${JSON.stringify(t)})}}`:`{{t(${JSON.stringify(e)})}}`}function d(e,t){return s(e,t)}var u=l(31108);function c(e){return e}function p(e,t){if(e===t)return!1;if(e.prototype instanceof t)return!0;let l=Object.getPrototypeOf(e.prototype);for(;l&&l!==Object.prototype;){if(l.constructor===t)return!0;l=Object.getPrototypeOf(l)}return!1}var h=l(81982),m=l(27153),f=l(29007),g=l(88439);async function v(e,t){if(!e)return{};if("function"==typeof e)try{return await e(t)||{}}catch(e){return console.error("Error resolving uiSchema function:",e),{}}return e}async function y(e,t){if(!e)return"dialog";if("function"==typeof e)try{return await e(t)||"dialog"}catch(e){return console.error("Error resolving uiMode function:",e),"dialog"}return e}let b={},x=e=>{if("function"==typeof e)return!0;if(!e||"object"!=typeof e)return!1;let t=new WeakSet,l=e=>{if("function"==typeof e)return!0;if(!e||"object"!=typeof e||t.has(e))return!1;if(t.add(e),Array.isArray(e)){for(let t of e)if(l(t))return!0;return!1}for(let t of Object.keys(e))if(l(e[t]))return!0;return!1};return l(e)};function w(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{noCache:n=!1}=l,r=e=>/\{\{.*?\}\}/g.test(e);return(t=>{let l,i=!1;if("string"==typeof t&&t.startsWith("{{")&&(i=!0,l=t),t&&"object"==typeof t&&!Array.isArray(t)){try{l=JSON.stringify(t)}catch(e){return console.warn("Failed to stringify:",e),t}let o=!!(i=r(l))&&!n&&x(t);if(b[l]&&!n&&!o)return b[l];if(o)try{return m.S.compile(t,e)}catch(e){return console.warn("Failed to compile with Formily Schema.compile:",e),t}}if(Array.isArray(t)){try{l=JSON.stringify(t)}catch(e){return console.warn("Failed to stringify:",e),t}let o=!!(i=r(l))&&!n&&x(t);if(b[l]&&!n&&!o)return b[l];if(o)try{return m.S.compile(t,e)}catch(e){return console.warn("Failed to compile with Formily Schema.compile:",e),t}}if(i){if(!l)try{return m.S.compile(t,e)}catch(e){return console.warn("Failed to compile with Formily Schema.compile:",e),t}try{if(n)return m.S.compile(t,e);return b[l]=b[l]||m.S.compile(t,e),b[l]}catch(l){console.log("compileUiSchema error",t,l);try{return m.S.compile(t,e)}catch(e){}}}return t})(t)}async function S(e,t,l){let n=new f.W5(e,t.key,"settings");(0,g.w)(n,t.steps,e,t.key),n.defineProperty("currentStep",{value:l});let r=l.uiSchema;if(l.use)try{var i;let t=null==(i=e.getAction)?void 0:i.call(e,l.use);t&&t.uiSchema&&(r=r||t.uiSchema)}catch(e){console.warn(`Failed to get action ${l.use}:`,e)}let o=await v(r||{},n);return 0===Object.keys(o).length?null:o}async function M(e,t,l){if(!l)return!0;let{hideInSettings:n}=l;if("function"==typeof n)try{let l=new f.W5(e,t.key,"settings");return(0,g.w)(l,t.steps||{},e,t.key),!!await n(l)}catch(e){return console.warn(`Error evaluating hideInSettings for event '${l.name||""}' in flow '${t.key}':`,e),!1}return!!n}async function A(e,t,l){if(!l)return!0;let n=l.hideInSettings;if(void 0===n&&l.use){var r;let t=null==(r=e.getAction)?void 0:r.call(e,l.use);n=null==t?void 0:t.hideInSettings}if("function"==typeof n)try{let r=new f.W5(e,t.key,"settings");return(0,g.w)(r,t.steps,e,t.key),r.defineProperty("currentStep",{value:l}),!!await n(r)}catch(e){return console.warn(`Error evaluating hideInSettings for step '${l.key||""}' in flow '${t.key}':`,e),!1}return!!n}async function F(e,t,l){let n;if(!l)return{disabled:!1};let r=l.disabledInSettings,i=l.disabledReasonInSettings;if((void 0===r||void 0===i)&&l.use)try{var o;let t=null==(o=e.getAction)?void 0:o.call(e,l.use);void 0===r&&(r=null==t?void 0:t.disabledInSettings),void 0===i&&(i=null==t?void 0:t.disabledReasonInSettings)}catch(e){console.warn(`Failed to get action ${l.use}:`,e)}let a=null,s=()=>(a||(a=new f.W5(e,t.key,"settings"),(0,g.w)(a,t.steps,e,t.key),a.defineProperty("currentStep",{value:l})),a),d=!1;if("function"==typeof r)try{d=!!await r(s())}catch(e){return console.warn(`Error evaluating disabledInSettings for step '${l.key||""}' in flow '${t.key}':`,e),{disabled:!1}}else d=!!r;if(!d)return{disabled:!1};if("function"==typeof i)try{let e=await i(s());null!=e&&""!==e&&(n=String(e))}catch(e){console.warn(`Error evaluating disabledReasonInSettings for step '${l.key||""}' in flow '${t.key}':`,e)}else null!=i&&""!==i&&(n=String(i));return{disabled:!0,reason:n}}var k=l(35846),C=l(44476),P=l(73398);function j(e){if("string"!=typeof e)return null;let t=e.trim(),l=/^\{\{\s*ctx(?:\.(.+?))?\s*\}\}$/,n=t.match(l);if(!n)return null;let r=n[1];return r?r.split(".").map(e=>e.trim()).filter(e=>e.length>0):[]}function E(e){return 0===e.length?"{{ ctx }}":`{{ ctx.${e.join(".")} }}`}function R(e){if("string"!=typeof e)return!1;let t=e.trim();return/^\{\{\s*ctx(?:\..+?)?\s*\}\}$/.test(t)}let I=new WeakMap;function T(e,t){I.set(e,t??null)}function _(e){return I.get(e)??null}function D(e){I.delete(e)}let N=["drawer","dialog","embed"],O=["small","medium","large"],$="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",B=8,L=Symbol.for("nocobase.runjs.openViewRouteState");function V(e){return"string"==typeof e&&N.includes(e)}function q(e){return"string"==typeof e&&O.includes(e)}function z(e){let t={};return V(null==e?void 0:e.mode)&&(t.mode=e.mode),q(null==e?void 0:e.size)&&(t.size=e.size),t.mode||t.size?t:void 0}function K(e){let t=0x811c9dc5;for(let l=0;l<e.length;l++)t^=e.charCodeAt(l),t=Math.imul(t,0x1000193);return t>>>0}function U(e){let t=4*(e.mode?N.indexOf(e.mode)+1:0)+(e.size?O.indexOf(e.size)+1:0);return t>0?t:void 0}function W(e){let t=Math.floor(e/4),l=e%4;return z({mode:t?N[t-1]:void 0,size:l?O[l-1]:void 0})}function H(e,t){let l=K(`${e}:${t}`),n="";for(let e=0;e<B;e++)n+=$[(l=Math.imul(l^t+17*e,0x1000193)>>>0)%$.length];return n}function G(e){return"string"==typeof e&&e.length===B&&[...e].every(e=>$.includes(e))}function Y(e,t){let l=z(t),n=l?U(l):void 0;return n?H(e,n):void 0}function J(e,t){if(G(t)){for(let l=1;l<16;l++)if(H(e,l)===t)return W(l)}}let X=e=>e&&"/"!==e?`/${e.replace(/^\/+/,"").replace(/\/+$/,"")}`:"/",Q=e=>`/${e.replace(/^\/+/,"").replace(/\/+$/,"")}`,Z=(e,t)=>{let l=X(e),n=Q(t);return l===n?"":l.startsWith(`${n}/`)?l.slice(n.length+1):""},ee=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e||"/"===e)return[];let l=t.rootPrefix||"admin",n=t.basePath?Z(e,t.basePath):"",r=(t.basePath?n:e).replace(/^\/+/,"").split("/").filter(Boolean);if(r.length<(t.basePath?1:2))return[];let i=[],o=null,a=0;for(t.basePath&&(o={viewUid:r[0]},a=1);a<r.length;){let e=r[a];if(e===l||"view"===e)if(o&&i.push(o),a+1<r.length)o={viewUid:r[a+1]},a+=2;else break;else if(o){if("opts"===e){if(a+1<r.length){let e=J(o.viewUid,r[a+1]);e&&(o.openViewRouteState=e),a+=2}else a++;continue}if(a+1>=r.length){a++;continue}let t=r[a+1],l=t;try{l=decodeURIComponent(t)}catch(e){}switch(e){case"tab":o.tabUid=l;break;case"filterbytk":{let e=e=>{let t={};return e.split("&").forEach(e=>{let[l,n=""]=e.split("=");if(l)try{let e=decodeURIComponent(l),r=decodeURIComponent(n);t[e]=r}catch(e){t[l]=n}}),t},t=l;if(l&&(l.startsWith("{")||l.startsWith("[")))try{let e=JSON.parse(l);t=e&&"object"==typeof e&&!Array.isArray(e)?e:l}catch(e){t=l}else l&&/^[^=&]+=[^=&]*(?:&[^=&]+=[^=&]*)*$/.test(l)&&(t=e(l));o.filterByTk=t;break}case"sourceid":o.sourceId=l}a+=2}else a++}return o&&i.push(o),i};var et=l(74353),el=l.n(et);let en=/^\{\{\s*ctx\.date(?:\.(.+?))?\s*\}\}$/,er=new Set(["today","now","yesterday","tomorrow","thisWeek","lastWeek","nextWeek","thisMonth","lastMonth","nextMonth","thisQuarter","lastQuarter","nextQuarter","thisYear","lastYear","nextYear"]),ei=new Set(["next","past"]),eo=new Set(["day","week","month","year"]);function ea(e){if("string"!=typeof e)return null;let t=e.trim().match(en);if(!t)return null;let l=String(t[1]||"");return l?l.split(".").map(e=>e.trim()).filter(Boolean):[]}function es(e){let t=ed((e||[]).map(e=>String(e)));if("date"!==t[0])return!1;if(1===t.length)return!0;if("preset"===t[1])return 2===t.length||3===t.length&&er.has(t[2]);if("relative"===t[1])return 2===t.length||(3===t.length?ei.has(t[2]):4===t.length?ei.has(t[2])&&eo.has(t[3]):5===t.length&&ei.has(t[2])&&eo.has(t[3])&&"number"==typeof em(t[4]));if("exact"===t[1]){if(2===t.length)return!0;if("single"===t[2])return 3===t.length||(4===t.length?"date"===t[3]:5===t.length&&"date"===t[3]&&/^v.+/.test(t[4]));if("range"===t[2]){if(3===t.length)return!0;if(4===t.length)return"date"===t[3];if(5===t.length)return"date"===t[3]&&/^v.+/.test(t[4]);if(6===t.length)return"date"===t[3]&&/^v.+/.test(t[4])&&/^v.+/.test(t[5])}}return!1}function ed(e){return"date"===e[0]?e:["date",...e]}function eu(e){let t=ed(e);return`{{ ctx.${t.join(".")} }}`}function ec(e){var t;let l=null==(t=globalThis)?void 0:t.Buffer;if(l&&"function"==typeof l.from)return l.from(e,"utf8").toString("base64");if("function"==typeof btoa)return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16))));throw Error("No base64 encoder available")}function ep(e){var t;let l=null==(t=globalThis)?void 0:t.Buffer;if(l&&"function"==typeof l.from)return l.from(e,"base64").toString("utf8");if("function"==typeof atob)return decodeURIComponent(Array.from(atob(e)).map(e=>`%${e.charCodeAt(0).toString(16).padStart(2,"0")}`).join(""));throw Error("No base64 decoder available")}function eh(e){if(null!=e){if("string"==typeof e){let t=e.trim();return t.length?t:void 0}if(el().isDayjs(e))return e.toISOString();if(e instanceof Date)return el()(e).toISOString();if("number"==typeof e||"boolean"==typeof e)return String(e)}}function em(e){let t=String(e||"").match(/^n(\d+)$/);if(!t)return;let l=Number(t[1]);if(Number.isFinite(l)&&!(l<=0))return l}function ef(e){let t=e.day(),l=0===t?-6:1-t;return e.add(l,"day").startOf("day")}function eg(e){let t=3*Math.floor(e.month()/3);return e.month(t).startOf("month")}function ev(e){return ec(String(e||"")).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}function ey(e){try{let t=String(e||"").replace(/=+$/g,"");if(!t||!/^[A-Za-z0-9_-]+$/.test(t))return;let l=t.replace(/-/g,"+").replace(/_/g,"/"),n=l.length%4==0?0:4-l.length%4,r=`${l}${"=".repeat(n)}`,i=ep(r);if(ev(i)!==t)return;return i}catch(e){return}}function eb(e){return"string"==typeof e&&en.test(e.trim())}function ex(e){if(!es(e))return!1;let t=ed((e||[]).map(e=>String(e)));return"date"===t[0]&&("preset"===t[1]?3===t.length&&er.has(t[2]):"relative"===t[1]?5===t.length&&ei.has(t[2])&&eo.has(t[3])&&"number"==typeof em(t[4]):"exact"===t[1]&&"single"===t[2]&&"date"===t[3]?5===t.length&&/^v.+/.test(t[4]):"exact"===t[1]&&"range"===t[2]&&"date"===t[3]&&6===t.length&&/^v.+/.test(t[4])&&/^v.+/.test(t[5]))}function ew(e){if(!eb(e))return;let t=ed(ea(e)||[]);if("preset"===t[1]&&3===t.length&&er.has(t[2]))return{type:t[2]};if("relative"===t[1]&&5===t.length&&ei.has(t[2])&&eo.has(t[3])){let e=em(t[4]);return"number"==typeof e?{type:t[2],unit:t[3],number:e}:void 0}if("exact"===t[1]&&"single"===t[2]&&"date"===t[3]&&5===t.length){let e=String(t[4]||"");if(!e.startsWith("v"))return;return ey(e.slice(1))}if("exact"===t[1]&&"range"===t[2]&&"date"===t[3]&&6===t.length){let e=String(t[4]||""),l=String(t[5]||"");if(!e.startsWith("v")||!l.startsWith("v"))return;let n=ey(e.slice(1)),r=ey(l.slice(1));if(void 0===n||void 0===r)return;return[n,r]}}function eS(e){if(eb(e))return String(e).trim();if(null==e||""===e)return;if(Array.isArray(e)){let t=eh(e[0]),l=eh(e[1]);return t&&l?eu(["date","exact","range","date",`v${ev(t)}`,`v${ev(l)}`]):t?eu(["date","exact","single","date",`v${ev(t)}`]):void 0}if("object"==typeof e&&e){let t=e,l="string"==typeof t.type?t.type:"";if("past"===l||"next"===l){let e="string"==typeof t.unit&&eo.has(t.unit)?t.unit:"day",n=Number(t.number),r=Number.isFinite(n)&&n>0?Math.floor(n):1;return eu(["date","relative",l,e,`n${r}`])}if(er.has(l))return eu(["date","preset",l])}let t=eh(e);if(t)return eu(["date","exact","single","date",`v${ev(t)}`])}function eM(e){let t=ed((e||[]).map(e=>String(e)));if("date"===t[0]){if("preset"===t[1]&&3===t.length){let e=t[2];if("now"===e)return el()().toISOString();let l=el()();return"today"===e?l.format("YYYY-MM-DD"):"yesterday"===e?l.add(-1,"day").format("YYYY-MM-DD"):"tomorrow"===e?l.add(1,"day").format("YYYY-MM-DD"):"thisWeek"===e?ef(l).format("YYYY-MM-DD"):"lastWeek"===e?ef(l.add(-1,"week")).format("YYYY-MM-DD"):"nextWeek"===e?ef(l.add(1,"week")).format("YYYY-MM-DD"):"thisMonth"===e?l.startOf("month").format("YYYY-MM-DD"):"lastMonth"===e?l.add(-1,"month").startOf("month").format("YYYY-MM-DD"):"nextMonth"===e?l.add(1,"month").startOf("month").format("YYYY-MM-DD"):"thisQuarter"===e?eg(l).format("YYYY-MM-DD"):"lastQuarter"===e?eg(l.add(-3,"month")).format("YYYY-MM-DD"):"nextQuarter"===e?eg(l.add(3,"month")).format("YYYY-MM-DD"):"thisYear"===e?l.startOf("year").format("YYYY-MM-DD"):"lastYear"===e?l.add(-1,"year").startOf("year").format("YYYY-MM-DD"):"nextYear"===e?l.add(1,"year").startOf("year").format("YYYY-MM-DD"):void 0}if("relative"===t[1]&&5===t.length&&ei.has(t[2])&&eo.has(t[3])){let e=em(t[4]);if("number"!=typeof e)return;let l="past"===t[2]?-1:1,n=t[3];return el()().add(l*e,n).format("YYYY-MM-DD")}if("exact"===t[1]&&"single"===t[2]&&"date"===t[3]&&5===t.length){let e=String(t[4]||"");if(!e.startsWith("v"))return;return ey(e.slice(1))}if("exact"===t[1]&&"range"===t[2]&&"date"===t[3]&&6===t.length){let e=String(t[4]||""),l=String(t[5]||"");if(!e.startsWith("v")||!l.startsWith("v"))return;let n=ey(e.slice(1)),r=ey(l.slice(1));if(void 0===n||void 0===r)return;return[n,r]}}}var eA=l(51143);let eF=new Set(["code","version"]);function ek(e){if(!e||"object"!=typeof e||Array.isArray(e))return!1;let t=Object.keys(e);if(!t.includes("code")||"string"!=typeof e.code||"version"in e&&null!=e.version&&"string"!=typeof e.version)return!1;for(let e of t)if(!eF.has(e))return!1;return!0}function eC(e){return{code:String((null==e?void 0:e.code)??""),version:String((null==e?void 0:e.version)??"v1")}}function eP(e){let t="",l="code";for(let n=0;n<e.length;n++){let r=e[n],i=n+1<e.length?e[n+1]:"";if("code"===l){if("/"===r&&"/"===i){t+=" ",n++,l="line";continue}if("/"===r&&"*"===i){t+=" ",n++,l="block";continue}if("'"===r){t+=" ",l="single";continue}if('"'===r){t+=" ",l="double";continue}t+=r;continue}if("line"===l){"\n"===r?(t+="\n",l="code"):t+=" ";continue}if("block"===l){"*"===r&&"/"===i?(t+=" ",n++,l="code"):t+="\n"===r?"\n":" ";continue}if("single"===l){if("\\"===r){t+=" ",n++;continue}"'"===r?(t+=" ",l="code"):t+="\n"===r?"\n":" ";continue}if("\\"===r){t+=" ",n++;continue}'"'===r?(t+=" ",l="code"):t+="\n"===r?"\n":" "}return t}function ej(e){let t="",l="code";for(let n=0;n<e.length;n++){let r=e[n],i=n+1<e.length?e[n+1]:"";if("code"===l){if("/"===r&&"/"===i){t+=" ",n++,l="line";continue}if("/"===r&&"*"===i){t+=" ",n++,l="block";continue}if("'"===r){t+=r,l="single";continue}if('"'===r){t+=r,l="double";continue}t+=r;continue}if("line"===l){"\n"===r?(t+="\n",l="code"):t+=" ";continue}if("block"===l){"*"===r&&"/"===i?(t+=" ",n++,l="code"):t+="\n"===r?"\n":" ";continue}if("single"===l){if(t+=r,"\\"===r){let l=n+1<e.length?e[n+1]:"";l&&(t+=l,n++);continue}"'"===r&&(l="code");continue}if(t+=r,"\\"===r){let l=n+1<e.length?e[n+1]:"";l&&(t+=l,n++);continue}'"'===r&&(l="code")}return t}function eE(e){let t;if(!e)return{subPath:"",wildcard:!1};let l=e;l=l.replace(/\[['"]([a-zA-Z_$][a-zA-Z0-9_$]*)['"]\]/g,".$1");let n=/\[([^\]]+)\]/g;for(;t=n.exec(l);){let e=String(t[1]??"").trim();if(!(/^\d+$/.test(e)||/^['"][a-zA-Z_$][a-zA-Z0-9_$]*['"]$/.test(e)))return{subPath:l.startsWith(".")?l.slice(1):l,wildcard:!0}}return l.startsWith(".")&&(l=l.slice(1)),{subPath:l,wildcard:!1}}function eR(e){let t=String(e||"").trim();if(!t||"ctx"===t)return null;let l=t.match(/^ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*)([\s\S]*)$/);if(l){let e=l[1]||"",t=eE(l[2]||"");return{varName:e,subPath:t.subPath,wildcard:t.wildcard}}let n=t.match(/^ctx\s*\[\s*(['"])([a-zA-Z_$][a-zA-Z0-9_$]*)\1\s*\]([\s\S]*)$/);if(n){let e=n[2]||"",t=eE(n[3]||"");return{varName:e,subPath:t.subPath,wildcard:t.wildcard}}return null}function eI(e){let t;if("string"!=typeof e||!e.trim())return{};let l=eP(e),n=ej(e),r=new Map,i=(e,t)=>{if(!e)return;let l=r.get(e)||new Set;l.add(t||""),r.set(e,l)},o=e=>{let t=eR(e);(null==t?void 0:t.varName)&&i(t.varName,t.wildcard?"":t.subPath)},a=/ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*(?:(?:\.[a-zA-Z_$][a-zA-Z0-9_$]*)|(?:\[[^\]]+\]))*)(?!\s*\()/g;for(;t=a.exec(l);)o(`ctx.${t[1]||""}`);let s=/ctx\s*\[\s*(['"])([a-zA-Z_$][a-zA-Z0-9_$]*)\1\s*\]((?:(?:\.[a-zA-Z_$][a-zA-Z0-9_$]*)|(?:\[[^\]]+\]))*)(?!\s*\()/g;for(;t=s.exec(n);)o(`ctx['${t[2]||""}']${t[3]||""}`);let d=/ctx\.getVar\s*\(\s*(['"])((?:\\.|(?!\1)[\s\S])*)\1\s*\)/g;for(;t=d.exec(n);){let e=String(t[2]||"").replace(/\\'/g,"'").replace(/\\"/g,'"').trim();e.startsWith("ctx")&&o(e)}let u={};for(let[e,t]of r.entries())u[e]=Array.from(t);return u}async function eT(e,t){let l={};if(!t||"object"!=typeof t||Array.isArray(t))return l;for(let[n,r]of Object.entries(t))if(void 0!==r){if(ek(r)){let{code:t,version:i}=eC(r);if(!t.trim())continue;let o=await (0,eA._)(e,t,{version:i});if(!(null==o?void 0:o.success))throw Error(`RunJS execution failed for "${n}"`);void 0!==o.value&&(l[n]=o.value);continue}l[n]=r}return l}var e_=l(49773);let eD="ctx.resolveJsonTemplate",eN=/\{\{\s*ctx(?:\.|\[|\?\.)/,eO=/\bctx(?:\?\.|\.)libs\b/,e$="__runjs_templateValueToString",eB=/\b__runjs_ctx_tpl_\d+\b/,eL=/\b__runjs_templateValueToString(?:_\d+)?\b/,eV=/\b__runjs_ctx_tpl_\d+\b|\b__runjs_templateValueToString(?:_\d+)?\b/,eq=/\b__runjs_ensure_libs\b/,ez=256,eK={withTemplates:new Map,withoutTemplates:new Map};function eU(e,t){let l=e.get(t);if(void 0!==l)return e.delete(t),e.set(t,l),l}function eW(e,t,l,n){if(e.has(t)&&e.delete(t),e.set(t,l),e.size<=n)return;let r=e.keys().next().value;void 0!==r&&e.delete(r)}function eH(e){return!!e&&/[A-Za-z0-9_$]/.test(e)}function eG(e){if(!e.startsWith("{{")||!e.endsWith("}}"))return!1;let t=e.slice(2,-2).trim();return t.startsWith("ctx.")||t.startsWith("ctx[")||t.startsWith("ctx?.")}function eY(e,t){if(!e.startsWith(eD,t))return!1;let l=t>0?e[t-1]:"",n=e[t+eD.length]||"";return!(eH(l)||eH(n))}function eJ(e,t){let l=t+2;for(;l<e.length;){let t=e[l];if(l+=1,"\n"===t)break}return l}function eX(e,t){let l=t+2;for(;l<e.length;){let t=e[l],n=e[l+1];if("*"===t&&"/"===n)return l+2;l+=1}return l}function eQ(e,t,l){let n=t+1;for(;n<e.length;){let t=e[n];if("\\"===t){n+=2;continue}if(n+=1,t===l)break}return n}function eZ(e,t){let l=t+1;for(;l<e.length;){let t=e[l];if("\\"===t){l+=2;continue}if("`"===t)return l+1;if("$"===t&&"{"===e[l+1]){l+=2;let t=1;for(;l<e.length&&t>0;){let n=e[l],r=e[l+1];if("'"===n||'"'===n){l=eQ(e,l,n);continue}if("`"===n){l=eZ(e,l);continue}if("/"===n&&"/"===r){l=eJ(e,l);continue}if("/"===n&&"*"===r){l=eX(e,l);continue}"{"===n?t+=1:"}"===n&&(t-=1),l+=1}continue}l+=1}return l}function e0(e){if(!eN.test(e))return[];let t=[],l=0;for(;l<e.length;){let n=e.indexOf("{{",l);if(-1===n)break;let r=e.indexOf("}}",n+2);if(-1===r)break;let i=e.slice(n,r+2);eG(i)&&t.push(i),l=r+2}return t}function e1(e,t){let l=t;for(;l<e.length&&/\s/.test(e[l]);)l+=1;return l}function e2(e,t){let l=t;for(;l>=0&&/\s/.test(e[l]);)l-=1;return l}function e5(e,t){let l=t;for(;;){l=e1(e,l);let t=e[l],n=e[l+1];if("/"===t&&"/"===n){l=eJ(e,l);continue}if("/"===t&&"*"===n){l=eX(e,l);continue}return l}}function e4(e){return!!e&&/[A-Za-z_$]/.test(e)}function e8(e,t){if(!e4(e[t]))return null;let l=t+1;for(;l<e.length&&eH(e[l]);)l+=1;return{name:e.slice(t,l),end:l}}function e3(e,t,l){if(e[t]!==l)return null;let n=t+1,r="";for(;n<e.length;){let t=e[n];if("\\"===t){let t=e[n+1];if(void 0===t)break;r+=t,n+=2;continue}if(t===l)return{value:r,end:n+1};r+=t,n+=1}return null}function e6(e,t){if(!e.startsWith("ctx",t))return null;let l=t>0?e[t-1]:"",n=e[t+3]||"";if(eH(l)||eH(n))return null;let r=e.slice(t+3);return r.startsWith(".libs")?t+3+5:r.startsWith("?.libs")?t+3+6:null}function e9(e,t){let l=e6(e,t);if(null===l)return null;let n=e5(e,l),r=e[n],i=e[n+1],o=e[n+2];if("?"===r&&"."===i&&"["===o){n=e5(e,n+3);let t=e[n];if("'"===t||'"'===t){let l=e3(e,n,t);if(!l)return{end:n+1};let r=e5(e,l.end);return"]"===e[r]&&(r+=1),{end:r,key:l.value}}return{end:n}}if("["===r){n=e5(e,n+1);let t=e[n];if("'"===t||'"'===t){let l=e3(e,n,t);if(!l)return{end:n+1};let r=e5(e,l.end);return"]"===e[r]&&(r+=1),{end:r,key:l.value}}return{end:n}}if("?"===r&&"."===i){n=e5(e,n+2);let t=e8(e,n);return t?{end:t.end,key:t.name}:{end:n}}if("."===r){n=e5(e,n+1);let t=e8(e,n);return t?{end:t.end,key:t.name}:{end:n}}return{end:l}}function e7(e){let t=[],l=String(e??""),n=0,r=0,i=0,o=0,a=e=>{let l=String(e??"").trim();if(!l||l.startsWith("..."))return;let n=l,r=0,i=0,o=0,a=0;for(;r<l.length;){let e=l[r],t=l[r+1];if("/"===e&&"/"===t)break;if("/"===e&&"*"===t){let e=l.indexOf("*/",r+2);r=-1===e?l.length:e+2;continue}if("'"===e||'"'===e){let t=r+1;for(;t<l.length;){let n=l[t];if("\\"===n){t+=2;continue}if(t+=1,n===e)break}r=t;continue}if("`"===e){let e=r+1;for(;e<l.length;){let t=l[e];if("\\"===t){e+=2;continue}if(e+=1,"`"===t)break}r=e;continue}if("{"===e?i+=1:"}"===e?i-=1:"["===e?o+=1:"]"===e?o-=1:"("===e?a+=1:")"===e&&(a-=1),0===i&&0===o&&0===a&&(":"===e||"="===e)){n=l.slice(0,r).trim();break}r+=1}if(!n)return;if(n.startsWith("'")||n.startsWith('"')){let e=n[0],l=e3(n,0,e);l&&t.push(l.value);return}let s=n.match(/^[A-Za-z_$][A-Za-z0-9_$]*/);s&&t.push(s[0])},s=0;for(;s<l.length;){let e=l[s],t=l[s+1];if("/"===e&&"/"===t)break;if("/"===e&&"*"===t){let e=l.indexOf("*/",s+2);s=-1===e?l.length:e+2;continue}if("'"===e||'"'===e){s=eQ(l,s,e);continue}if("`"===e){s=eZ(l,s);continue}"{"===e?r+=1:"}"===e?r-=1:"["===e?i+=1:"]"===e?i-=1:"("===e?o+=1:")"===e&&(o-=1),0===r&&0===i&&0===o&&","===e&&(a(l.slice(n,s)),n=s+1),s+=1}return a(l.slice(n)),t}function te(e){if(!eO.test(e))return[];let t=new Set,l=l=>{let r=l,i=1;for(;r<e.length&&i>0;){let l=e[r],o=e[r+1];if("/"===l&&"/"===o){r=eJ(e,r);continue}if("/"===l&&"*"===o){r=eX(e,r);continue}if("'"===l||'"'===l){r=eQ(e,r,l);continue}if("`"===l){r=n(r+1);continue}let a=e9(e,r);if(a){a.key&&t.add(a.key),r=a.end;continue}"{"===l?i+=1:"}"===l&&(i-=1),r+=1}return r},n=t=>{let n=t;for(;n<e.length;){let t=e[n],r=e[n+1];if("\\"===t){n+=2;continue}if("`"===t)return n+1;if("$"===t&&"{"===r){n=l(n+2);continue}n+=1}return n},r=0;for(;r<e.length;){let l=e[r],i=e[r+1];if("/"===l&&"/"===i){r=eJ(e,r);continue}if("/"===l&&"*"===i){r=eX(e,r);continue}if("'"===l||'"'===l){r=eQ(e,r,l);continue}if("`"===l){r=n(r+1);continue}let o=e9(e,r);if(o){o.key&&t.add(o.key),r=o.end;continue}if("="===l&&"="!==i&&">"!==i&&"<"!==i){let l=e5(e,r+1);if(null!==e6(e,l)){let l=e2(e,r-1);if("}"===e[l]){let n=0,r=l;for(;r>=0;){let t=e[r];if("}"===t)n+=1;else if("{"===t&&0==(n-=1))break;r-=1}if(r>=0&&"{"===e[r])for(let n of e7(e.slice(r+1,l)))t.add(n)}}}r+=1}return Array.from(t)}function tt(e){if(eq.test(e)||!eO.test(e))return e;let t=te(e);return t.length?`/* __runjs_ensure_libs */
|
|
1712
1712
|
await ctx.__ensureLibs(${JSON.stringify(t)});
|
|
1713
1713
|
${e}`:e}function tl(e,t,l){let n=e1(e,l);if(":"!==e[n])return!1;let r=e2(e,t-1),i=r>=0?e[r]:"";return"{"===i||","===i}function tn(e,t,l,n){let r=Array.from(new Set(t));if(!r.length)return e;let i=e;for(let e of r){let t=l(e);i=`(${i}).split(${JSON.stringify(e)}).join(${n}(${t}, ${JSON.stringify(e)}))`}return i}function tr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!eN.test(e))return e;let l=!1!==t.processBarePlaceholders,n=!1!==t.processStringLiterals;if(l&&n&&eV.test(e)||l&&!n&&eB.test(e)||!l&&n&&eL.test(e))return e;let r=new Map,i=[],o=!1,a=new Set,s=(t=>{if(!e.includes(t)&&!a.has(t))return a.add(t),t;let l=1;for(;e.includes(`${t}_${l}`)||a.has(`${t}_${l}`);)l+=1;let n=`${t}_${l}`;return a.add(n),n})(e$),d=0,u=()=>{for(;;){let t=`__runjs_ctx_tpl_${d}`;if(d+=1,!(e.includes(t)||a.has(t)))return a.add(t),t}},c=e=>{let t=r.get(e);if(t)return t;let l=u();return r.set(e,l),i.push(`const ${l} = await ctx.resolveJsonTemplate(${JSON.stringify(e)});`),l},p="",h=0,m=!1,f=0;for(;h<e.length;){let t=e[h],r=e[h+1];if("/"===t&&"/"===r){let t=eJ(e,h);p+=e.slice(h,t),h=t;continue}if("/"===t&&"*"===r){let t=eX(e,h);p+=e.slice(h,t),h=t;continue}if("'"===t||'"'===t){let l=eQ(e,h,t),r=e.slice(h,l);if(n&&0===f){let t=e0(r);if(t.length){o=!0;let n=tn(r,t,c,s);p+=tl(e,h,l)?`[${n}]`:n}else p+=r}else p+=r;h=l;continue}if("`"===t){let t=eZ(e,h),l=e.slice(h,t);if(n&&0===f){let n=e0(l);if(n.length){o=!0;let r=tn(l,n,c,s);p+=tl(e,h,t)?`[${r}]`:r}else p+=l}else p+=l;h=t;continue}if(0===f&&!m&&eY(e,h)){p+=eD,h+=eD.length,m=!0;continue}if(m){if(/\s/.test(t)){p+=t,h+=1;continue}if("("===t){p+=t,h+=1,m=!1,f=1;continue}m=!1;continue}if(f>0){"("===t?f+=1:")"===t&&(f-=1),p+=t,h+=1;continue}if(l&&"{"===t&&"{"===r){let t=e.indexOf("}}",h+2);if(-1!==t){let l=e.slice(h,t+2);if(eG(l)){p+=c(l),h=t+2;continue}}}p+=t,h+=1}if(!i.length)return p;let g=[];return o&&g.push(`const ${s} = (value, placeholder) => {`," if (typeof value === 'undefined') return placeholder;"," if (typeof value === 'object' && value !== null) {"," try {"," return JSON.stringify(value);"," } catch (e) {"," return String(value);"," }"," }"," return String(value);","};"),g.push(...i),`${g.join("\n")}
|
|
1714
|
-
${p}`}async function ti(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l="string"==typeof e?e:String(e??""),n=!!t.preprocessTemplates,r=n?eK.withTemplates:eK.withoutTemplates,i=eU(r,l);if(i)return await i;let o=(async()=>{if(!n)return tt(await (0,e_.W)(l));let e=tr(l,{processStringLiterals:!1});return tt(tr(await (0,e_.W)(e),{processBarePlaceholders:!1}))})();eW(r,l,o,ez);try{return await o}catch(e){throw r.delete(l),e}}var to=l(62572);function ta(e){if(Array.isArray(e)){let t=e.map(e=>ta(e)).filter(e=>void 0!==e);return t.length?t:void 0}if(e&&"object"==typeof e){let t={};return Object.keys(e).forEach(l=>{let n=ta(e[l]);void 0!==n&&(t[l]=n)}),Object.keys(t).length?t:void 0}return null==e||"string"==typeof e&&""===e?void 0:e}let ts=e=>"string"==typeof e.on?"beforeRender"===e.on:"object"==typeof e.on?"beforeRender"===e.on.eventName:!e.on&&!0!==e.manual;var td=l(47684);let tu="0123456789abcdefghijklmnopqrstuvwxyz";function tc(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:11,l="";for(let e=0;e<t;e++)l+=tu[Math.random()*tu.length|0];return`${e}${l}`}},49773(e,t,l){l.d(t,{W:()=>n});async function n(e){if(!/<[A-Za-z]|<\//.test(e))return e;try{var t;let n=await l.e("7761").then(l.bind(l,1608)),r=(null==n?void 0:n.transform)||(null==n||null==(t=n.default)?void 0:t.transform);if("function"!=typeof r)return e;let i=r(e,{transforms:["jsx"],jsxPragma:"ctx.React.createElement",jsxFragmentPragma:"ctx.React.Fragment",disableESTransforms:!0,production:!0});return(i&&(i.code||(null==i?void 0:i.output)))??e}catch(t){return e}}},81982(e,t,l){l.d(t,{M:()=>h,gG:()=>o,mv:()=>a,o4:()=>p});var n=l(40542),r=l(2543),i=l.n(r);async function o(e,t){if(!e)return{};if("function"==typeof e)try{return await e(t)||{}}catch(e){return console.error("Error resolving defaultParams function:",e),{}}return e}async function a(e,t,l){if(!e)return{};if("function"==typeof e)try{return await e(t,l)||{}}catch(e){return console.error("Error resolving createModelOptions function:",e),{}}return e}let s={queue:[],timer:null,inflightByRun:new Map},d=10;function u(e){if(Array.isArray(e))return e.map(u);if(i().isPlainObject(e)){let t=Object.entries(e).map(e=>{let[t,l]=e;return[t,u(l)]});return Object.fromEntries(i().sortBy(t,e=>{let[t]=e;return t}))}return e}function c(e){try{return JSON.stringify(u(e))}catch{try{return JSON.stringify(e)}catch{return String(e)}}}function p(e,t){let l,n,r=s,i=e.runId||"GLOBAL",o=c(t),a=r.inflightByRun.get(i);a||(a=new Map,r.inflightByRun.set(i,a));let u=a.get(o);if(u)return u;let p=new Promise((e,t)=>{l=e,n=t});a.set(o,p);let h={id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,ctx:e,payload:t,resolve:l,reject:n,runId:i,dedupKey:o};r.queue.push(h);let m=async()=>{var t,l,n,i,o,a;let s=r.queue.splice(0,r.queue.length);if(r.timer=null,!s.length)return;let d=null==(t=s[0].ctx)?void 0:t.api;if(!d){for(let e of s)try{e.resolve(e.payload.template)}catch(t){e.reject(t)}finally{null==(l=r.inflightByRun.get(e.runId))||l.delete(e.dedupKey)}return}try{let e=s.map(e=>({id:e.id,template:e.payload.template,contextParams:e.payload.contextParams||{}})),t=await d.request({method:"POST",url:"variables:resolve",data:{values:{batch:e}}}),l=t.data??t,i=l.data??l,o=null==i?void 0:i.results,a=Array.isArray(o)?o:Array.isArray(i)?i:[],u=new Map;for(let e of a){let t=(null==e?void 0:e.id)!=null?String(e.id):"";t&&u.set(t,null==e?void 0:e.data)}for(let e of s)try{let t=String(e.id),l=u.has(t)?u.get(t):e.payload.template;e.resolve(l)}catch(t){e.reject(t)}finally{null==(n=r.inflightByRun.get(e.runId))||n.delete(e.dedupKey)}}catch(t){for(let l of s)try{null==e||null==(o=e.logger)||null==(i=o.warn)||i.call(o,{err:t},"variables:resolve(batch) failed, fallback"),l.resolve(l.payload.template)}catch(e){l.reject(e)}finally{null==(a=r.inflightByRun.get(l.runId))||a.delete(l.dedupKey)}}};return r.timer||(r.timer=setTimeout(m,d)),p}async function h(e,t){let l=async e=>{if("string"==typeof e&&/\{\{.*?\}\}/.test(e))return await g(e,t);if(Array.isArray(e))return Promise.all(e.map(l));if(e&&"object"==typeof e){let t={};for(let[n,r]of Object.entries(e))t[n]=await l(r);return t}return e};return l(e)}async function m(e,t){let l=await f(e.trim(),t),n=await t.runjs(`return ${l}`,{t:t.t});return(null==n?void 0:n.success)?n.value:void 0}async function f(e,t){let l,n=/ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*(?:(?:\.[a-zA-Z_$][a-zA-Z0-9_$]*)|(?:\[[^\]]+\]))*)(?!\s*\()/g,r=[],i=new Set;for(;null!==(l=n.exec(e));){let e=l[0],t=l[1],n=t.match(/^([a-zA-Z_$][a-zA-Z0-9_$]*)/);if(n){let l=n[1],o=t.substring(l.length);r.push({fullPath:e,firstKey:l,restPath:o}),i.add(l)}}if(0===r.length)return e;let o=new Map;for(let e of i)try{let l=await t[e],n=l&&!0===l.__isRecordProxy__;o.set(e,n)}catch(t){o.set(e,!1)}r.sort((e,t)=>t.fullPath.length-e.fullPath.length);let a=e;for(let{fullPath:e,firstKey:t,restPath:l}of r){let n,r=o.get(t)||!1;n=""===l?`await ctx.${t}`:r?`await (await ctx.${t})${l}`:`(await ctx.${t})${l}`;let i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),s=RegExp(`\\b${i}\\b`,"g");a=a.replace(s,n)}return a}async function g(e,t){let l=e=>{let t=e.trim().match(/^ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*)(?:\.([a-zA-Z_$][a-zA-Z0-9_$-]*(?:\.[a-zA-Z_$][a-zA-Z0-9_$-]*)*))?$/);return t?t[2]?`${t[1]}.${t[2]}`:t[1]:null},r=async e=>{let l=e.split("."),r=l.shift();if(!r)return;let i=await t[r];return 0===l.length?i:(0,n.D)(i,l.join("."))},i=async e=>{let n=l(e);if(n){let l=await r(n);return void 0===l&&n.includes("-")?await m(e,t):l}return await m(e,t)},o=e.match(/^\s*\{\{\s*([^{}]+?)\s*\}\}\s*$/);if(o){let e=o[1];return await i(e)}let a=[...e.matchAll(/\{\{\s*(.+?)\s*\}\}/g)],s=e;for(let[e,t]of a){let l=await i(t);if(void 0!==l){let t="object"==typeof l&&null!==l?JSON.stringify(l):String(l);s=s.replace(e,t)}}return s}},47684(e,t,l){function n(e,t){if(!e||"string"!=typeof e)throw Error("invalid url");let l=e.trim();if(l.startsWith("http://")||l.startsWith("https://"))return l;let n=window.__esm_cdn_base_url__||"https://esm.sh",r=(null==t?void 0:t.addSuffix)&&window.__esm_cdn_suffix__||"",i=n.replace(/\/$/,""),o=l.replace(/^\//,"");if(null==t?void 0:t.raw){let e=o.includes("?")?"&":"?";return`${i}/${o}${e}raw`}return`${i}/${o}${r}`}function r(e){return!!e&&"string"==typeof e&&e.split("?")[0].split("#")[0].endsWith(".css")}l.d(t,{i:()=>n,y:()=>r})},51143(e,t,l){function n(){var e,t;let l=globalThis;if((null==(e=l.__nocobaseRunJSSafeGlobalsRegistry)?void 0:e.windowAllow)&&(null==(t=l.__nocobaseRunJSSafeGlobalsRegistry)?void 0:t.documentAllow))return l.__nocobaseRunJSSafeGlobalsRegistry;let n={windowAllow:new Set,documentAllow:new Set};return l.__nocobaseRunJSSafeGlobalsRegistry=n,n}function r(e){if(!e)return;let t=n();for(let l of e){if("string"!=typeof l)continue;let e=l.trim();e&&t.windowAllow.add(e)}}function i(e){if(!e)return;let t=n();for(let l of e){if("string"!=typeof l)continue;let e=l.trim();e&&t.documentAllow.add(e)}}function o(e){return n().windowAllow.has(e)}function a(e){return n().documentAllow.has(e)}function s(e){let t=()=>`${window.location.origin}${window.location.pathname}`,l=(e,l,n)=>{if(!(e=>{try{let l=new URL(e,t()),n=l.protocol.toLowerCase();if("about:"===n)return"about:blank"===l.href;return"http:"===n||"https:"===n}catch{return!1}})(e))throw Error("Unsafe URL: window.open only allows http/https/about:blank.");let r="_blank",i=(e=>{let t=new Set;return e&&e.split(",").map(e=>e.trim()).filter(Boolean).forEach(e=>{let l=e.split("=")[0].trim().toLowerCase();"noopener"!==l&&"noreferrer"!==l&&t.add(e)}),t.add("noopener"),t.add("noreferrer"),Array.from(t).join(",")})(n),o=window.open.call(window,e,r,i);if(o&&"opener"in o)try{o.opener=null}catch{}return o},n=(e,n)=>{let r=new URL(e,t()),i=r.protocol.toLowerCase(),o="about:"===i&&"about:blank"===r.href;if("http:"!==i&&"https:"!==i&&!o)throw Error("Unsafe URL: only http/https/about:blank are allowed.");if(o)return(null==n?void 0:n.replace)?window.location.replace("about:blank"):window.location.assign("about:blank");if(r.protocol===window.location.protocol&&r.hostname===window.location.hostname&&r.port===window.location.port)return(null==n?void 0:n.replace)?window.location.replace(r.href):window.location.assign(r.href);if(!l(r.href))throw Error("Popup blocked: cross-origin navigation is opened in a new tab.")},r=new Proxy({},{get(e,t){switch(t){case"origin":return window.location.origin;case"protocol":return window.location.protocol;case"host":return window.location.host;case"hostname":return window.location.hostname;case"port":return window.location.port;case"pathname":return window.location.pathname;case"assign":return e=>n(e,{replace:!1});case"replace":return e=>n(e,{replace:!0});case"reload":return window.location.reload.bind(window.location);case"href":throw Error("Reading location.href is not allowed.");default:throw Error(`Access to location property "${t}" is not allowed.`)}},set(e,t,l){if("href"===t)return n(String(l),{replace:!1}),!0;throw Error("Mutation on location is not allowed.")}}),i={setTimeout:window.setTimeout.bind(window),clearTimeout:window.clearTimeout.bind(window),setInterval:window.setInterval.bind(window),clearInterval:window.clearInterval.bind(window),console,Math,Date,FormData,..."u">typeof Blob?{Blob}:{},..."u">typeof URL?{URL}:{},addEventListener:addEventListener.bind(window),open:l,location:r,...e||{}};return new Proxy(Object.create(null),{get(e,t){if("string"!=typeof t)return Reflect.get(e,t);if(t in i)return i[t];if(Object.prototype.hasOwnProperty.call(e,t))return e[t];if(o(t)){let e=window[t];return"function"==typeof e?e.bind(window):e}throw Error(`Access to global property "${t}" is not allowed.`)},set(e,t,l){if("string"!=typeof t)return Reflect.set(e,t,l),!0;if(t in i)throw Error(`Mutation of global property "${t}" is not allowed.`);return e[t]=l,!0},has:(e,t)=>"string"!=typeof t?Reflect.has(e,t):!!(t in i||Object.prototype.hasOwnProperty.call(e,t)||o(t))})}function d(e){let t={createElement:document.createElement.bind(document),querySelector:document.querySelector.bind(document),querySelectorAll:document.querySelectorAll.bind(document),...e||{}};return new Proxy(Object.create(null),{get(e,l){if("string"!=typeof l)return Reflect.get(e,l);if(l in t)return t[l];if(Object.prototype.hasOwnProperty.call(e,l))return e[l];if(a(l)){let e=document[l];return"function"==typeof e?e.bind(document):e}throw Error(`Access to document property "${l}" is not allowed.`)},set(e,l,n){if("string"!=typeof l)return Reflect.set(e,l,n),!0;if(l in t)throw Error(`Mutation of document property "${l}" is not allowed.`);return e[l]=n,!0},has:(e,l)=>"string"!=typeof l?Reflect.has(e,l):!!(l in t||Object.prototype.hasOwnProperty.call(e,l)||a(l))})}function u(e){var t;let l="u">typeof window&&window.navigator||void 0,n={},r=null==l||null==(t=l.clipboard)?void 0:t.writeText;"function"==typeof r&&(n.writeText=r.bind(l.clipboard));let i={clipboard:n};return Object.defineProperty(i,"onLine",{get:()=>!!(null==l?void 0:l.onLine),enumerable:!0,configurable:!1}),Object.defineProperty(i,"language",{get:()=>null==l?void 0:l.language,enumerable:!0,configurable:!1}),Object.defineProperty(i,"languages",{get:()=>(null==l?void 0:l.languages)?[...l.languages]:void 0,enumerable:!0,configurable:!1}),Object.assign(i,e||{}),new Proxy({},{get(e,t){if(t in i)return i[t];throw Error(`Access to navigator property "${String(t)}" is not allowed.`)}})}function c(e){let t={};try{let e=u();t.navigator=e;try{t.window=s({navigator:e})}catch{}}catch{}try{t.document=d()}catch{}return e?{...t,...e}:t}async function p(e,t,l,n){if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.runjs)return e.runjs(t,c(n),l)}l.d(t,{D1:()=>u,I2:()=>c,Vm:()=>r,Xh:()=>d,_:()=>p,ey:()=>s,yz:()=>i})},22928(e,t,l){function n(e){let t={};return Object.entries(e||{}).forEach(e=>{let[l,n]=e;null!=n&&(t[l]=n)}),t}function r(e,t,l){try{var n,r,i,o,a;let s=null==(r=e.dataSourceManager)||null==(n=r.getDataSource)?void 0:n.call(r,t||"main"),d=null==s||null==(o=s.collectionManager)||null==(i=o.getCollection)?void 0:i.call(o,l);return(null==d||null==(a=d.getPrimaryKey)?void 0:a.call(d))||"id"}catch(e){return"id"}}function i(e,t){var l,i;if(!t)return;let o=t.dataSourceKey||"main",a=t.collection||(null==(l=t.record)?void 0:l.__collectionName);if(!a)return;let s=r(e,o,a)||"id",d=void 0!==t.filterByTk?t.filterByTk:void 0!==t.id?t.id:null==(i=t.record)?void 0:i[s];if(void 0!==d)return n({collection:a,filterByTk:d,dataSourceKey:o,associationName:t.associationName,sourceId:t.sourceId,fields:t.fields,appends:t.appends})}function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=e=>!!e&&"object"==typeof e&&"string"==typeof e.collection&&(void 0!==e.filterByTk||void 0!==e.id||e.record),n={},r=(t,o)=>{if(l(t)){let l=i(e,t);l&&(n[o.join(".")]=l);return}if(Array.isArray(t)){for(let e=0;e<t.length;e++)r(t[e],[...o,String(e)]);return}if(t&&"object"==typeof t){for(let[e,l]of Object.entries(t))r(l,[...o,e]);return}};return r(t,[]),Object.keys(n).length?n:void 0}l.d(t,{d:()=>o})},88439(e,t,l){l.d(t,{w:()=>n});function n(e,t,l,n){let r={},i={};for(let a in t)if(Object.prototype.hasOwnProperty.call(t,a)){let s=t[a],d={};if(s.uiSchema&&"object"==typeof s.uiSchema){for(let[e,t]of Object.entries(s.uiSchema))if(t&&"object"==typeof t){var o;let l=t;d[e]={type:l.type||"any",title:l.title||(null==(o=l["x-decorator-props"])?void 0:o.label)||e,interface:l["x-component"],uiSchema:l}}}let u=Object.keys(d).length>0;i[a]={type:"object",title:e.t(s.title)||a,display:u?"default":"none",properties:u?{params:{type:"object",title:"Parameters",display:"flatten",properties:d}}:void 0},r[a]={get params(){return l.getStepParams(n,a)||{}},get uiSchema(){return s.uiSchema},result:void 0}}e.defineProperty("steps",{get:()=>r})}},73398(e,t,l){function n(e){let t=new Set,l=e=>{if("string"==typeof e){let l,n=/\{\{\s*([^}]+?)\s*\}\}/g;for(;null!==(l=n.exec(e));){let e,n,r=l[1],i=/ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*)/g;for(;null!==(e=i.exec(r));)t.add(e[1]);let o=/ctx\[\s*(["'])\s*([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\1\s*\]/g;for(;null!==(n=o.exec(r));)t.add(n[2])}}else Array.isArray(e)?e.forEach(l):e&&"object"==typeof e&&Object.values(e).forEach(l)};return l(e),t}function r(e){let t={},l=e=>{if("string"==typeof e){let l,n=/\{\{\s*([^}]+?)\s*\}\}/g;for(;null!==(l=n.exec(e));){let e,n,r=l[1],i=/ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*)([^\s)]*)/g;for(;null!==(e=i.exec(r));){let l=e[1],n=e[2]||"";if(t[l]=t[l]||[],n.startsWith("."))t[l].push(n.slice(1));else if(n.startsWith("[")){let e=n.match(/^\[\s*(["'])\s*([^'"\]]+)\s*\1\s*\](.*)$/);if(e){let n=e[2],r=e[3]||"";t[l].push(`${n}${r}`)}else{let e=n.match(/^\[(\d+)\](.*)$/);if(e){let n=e[1],r=e[2]||"";t[l].push(`[${n}]${r}`)}}}else n.startsWith("(")&&!t[l].length&&t[l].push("")}let o=/ctx\[\s*(["'])\s*([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\1\s*\]([^\s)]*)/g;for(;null!==(n=o.exec(r));){let e=n[2],l=n[3]||"";if(t[e]=t[e]||[],l.startsWith("."))t[e].push(l.slice(1));else if(l.startsWith("[")){let n=l.match(/^\[\s*(["'])\s*([^'"\]]+)\s*\1\s*\](.*)$/);if(n){let l=n[2],r=n[3]||"";t[e].push(`${l}${r}`)}else{let n=l.match(/^\[(\d+)\](.*)$/);if(n){let l=n[1],r=n[2]||"";t[e].push(`[${l}]${r}`)}}}else l.startsWith("(")&&!t[e].length&&t[e].push("")}}}else Array.isArray(e)?e.forEach(l):e&&"object"==typeof e&&Object.values(e).forEach(l)};return l(e),t}l.d(t,{xI:()=>m,vP:()=>y,$S:()=>f,pc:()=>g,Cg:()=>c,nN:()=>b,ju:()=>x,Xx:()=>h,vE:()=>p,XU:()=>u,UX:()=>v});var i=l(22928),o=l(35846),a=l(44476),s=l(2543),d=l.n(s);function u(e){var t,l,n,r;let i=e.resource,o=e.collection,a=e.record,s=(null==o?void 0:o.name)||(null==i||null==(t=i.getResourceName)?void 0:t.call(i)),d=(null==o?void 0:o.dataSourceKey)||(null==i||null==(l=i.getDataSourceKey)?void 0:l.call(i)),u=(null==i||null==(n=i.getFilterByTk)?void 0:n.call(i))??(null==o||null==(r=o.getFilterByTK)?void 0:r.call(o,a));if(!s||null==u)return;let c=String(s).split(".");return{collection:c[c.length-1],dataSourceKey:d,filterByTk:u}}function c(e){var t,l,n;let r=e.view;if(!r)return;let i=(null==r?void 0:r.inputArgs)||{},o=(null==i?void 0:i.collectionName)||(null==r||null==(t=r.record)?void 0:t.collection),a=(null==i?void 0:i.dataSourceKey)||(null==r||null==(l=r.record)?void 0:l.dataSourceKey)||"main",s=(null==i?void 0:i.filterByTk)||(null==r||null==(n=r.record)?void 0:n.filterByTk),d=null==i?void 0:i.associationName,u=null==i?void 0:i.sourceId;if(o&&null!=s)return{collection:o,dataSourceKey:a,filterByTk:s,sourceId:u,associationName:d}}function p(e,t){var l,n,r;let i=null==(l=e.inputArgs)?void 0:l.record,o=null==(n=e.collection)?void 0:n.filterTargetKey;if(!i||!o)return;let a=t.view,s=null==a||null==(r=a.inputArgs)?void 0:r.filterByTk,u=i[o];if(null!=s&&null!=u&&s===u)return d().cloneDeep(i)}function h(e,t){return l=>{var n,r,i,o;if(!("record"===l||l.startsWith("record.")))return!1;let s=t();if(!s)return!0;if("record"===l)return!1;let d=c(e),u=null==d?void 0:d.collection,p=(null==d?void 0:d.dataSourceKey)||"main";if(!u)return!0;let h=null==(r=e.dataSourceManager)||null==(n=r.getDataSource)?void 0:n.call(r,p),m=null==h||null==(o=h.collectionManager)||null==(i=o.getCollection)?void 0:i.call(o,u);if(!m)return!0;let f=(0,a.H)(()=>m,()=>s),g=l.startsWith("record.")?l.slice(7):"";return!!g&&f(g)}}function m(e,t){let l=(0,a.H)(e,()=>t());return n=>{let r=t();if(!r)return!0;if(!n)return!1;let i=e();if(!n.includes(".")){var o;let e,t=n;return i&&("function"==typeof i.getField&&(e=i.getField(t)),e||"function"!=typeof i.getFields||(e=(i.getFields()||[]).find(e=>(null==e?void 0:e.name)===t))),!!(null==e||null==(o=e.isAssociationField)?void 0:o.call(e))&&null==(null==r?void 0:r[t])}return l(n)}}async function f(e,t,l){let n=await (0,o.H)(e,t,!0)();return n?{...n,buildVariablesParams:e=>l?l(e):u(e)}:null}function g(e,t,l){let n=async()=>f(e,t,l);return n.title=t,n}function v(e,t,l){var n,r;return g(t,(null==l?void 0:l.title)?(null==(n=e.t)?void 0:n.call(e,l.title))||l.title:(null==(r=e.t)?void 0:r.call(e,"Current record"))||"Current record",e=>u(e))}let y=n,b=r;async function x(e,t){let l=Object.keys(r(t)||{});if(!l.length)return;let n={};for(let t of l){var o;let l,r=null==(o=e.getPropertyOptions)?void 0:o.call(e,t),i=null==r?void 0:r.meta;if(i){try{let t="function"==typeof i?await i():i,n=null==t?void 0:t.buildVariablesParams;"function"==typeof n&&(l=await n(e))}catch(e){continue}l&&(n[t]=l)}}return(0,i.d)(e,n)}},67778(e,t,l){l.d(t,{sp:()=>P,bt:()=>I,U:()=>el,N5:()=>K,xB:()=>B,mW:()=>$,fP:()=>G});var n=l(74848),r=l(96540),i=l(99418),o=l(11869),a=l(29007),s=l(52568),d=l(73398);function u(e){return null!=e}function c(e,t){if(e===t)return!0;if(!u(e)||!u(t))return!1;try{return JSON.stringify(e)===JSON.stringify(t)}catch(l){return String(e)===String(t)}}function p(e){var t;let l=null==e||null==(t=e.navigation)?void 0:t.viewStack;return Array.isArray(l)?l:[]}function h(e){var t;let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p(e);if(!l.length)return -1;let n=(null==e?void 0:e.inputArgs)||{},r=(null==e||null==(t=e.navigation)?void 0:t.viewParams)||{},i=n.viewUid??r.viewUid;if(!i)return l.length-1;let o=l.map((e,t)=>({item:e,index:t})).filter(e=>{let{item:t}=e;return(null==t?void 0:t.viewUid)===i});if(!o.length)return l.length-1;let a=["filterByTk","sourceId","tabUid"],s=o[o.length-1].index,d=-1;for(let{item:e,index:t}of o){let l=0,r=!0;for(let t of a)if(u(n[t])){if(!c(null==e?void 0:e[t],n[t])){r=!1;break}l+=1}r&&l>=d&&(s=t,d=l)}return s}function m(e,t){return t??e.view}function f(e){var t;if(!e)return!1;let l=p(e),n=null==e||null==(t=e.inputArgs)?void 0:t.openerUids,r=Array.isArray(n)&&n.length>0;return h(e,l)>=1||r}function g(e,t){let l=t=>e.t(t),n=function(){let l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e;return f(m(l,t))},r=async e=>{let l=m(e,t);if(!l||!f(l))return;let n=await v(e,l),r=null==n?void 0:n.resource;return(null==r?void 0:r.collectionName)&&null!=r.filterByTk?{collection:r.collectionName,dataSourceKey:r.dataSourceKey||"main",filterByTk:r.filterByTk,associationName:r.associationName,sourceId:r.sourceId}:(0,d.Cg)(e)},i=async()=>{var t,l,n,i;let o=await r(e);if(!(null==o?void 0:o.collection))return null;let a=null==(l=e.dataSourceManager)||null==(t=l.getDataSource)?void 0:t.call(l,o.dataSourceKey||"main");return(null==a||null==(i=a.collectionManager)||null==(n=i.getCollection)?void 0:n.call(i,o.collection))||null},o=async(l,n)=>{var r,i,o,a,s,d;try{let s=n||e,d=m(s,t),u=p(d),c=h(d,u);if(c<1||l<1)return;let f=c-l;if(f<1)return;let g=u[f];if(!(null==g?void 0:g.viewUid))return;let v=null==(r=s.engine)?void 0:r.getModel(g.viewUid,!0);if(!v)try{v=await s.engine.loadModel({uid:g.viewUid})}catch(t){null==(a=s.logger||e.logger)||null==(o=a.warn)||o.call(a,{err:t},"[FlowEngine] popup.getParentRecordRef loadModel failed")}let y=(null==v||null==(i=v.getStepParams)?void 0:i.call(v,"popupSettings","openView"))||{},b=null==y?void 0:y.collectionName,x=(null==y?void 0:y.dataSourceKey)||"main",w=(null==g?void 0:g.filterByTk)??(null==g?void 0:g.sourceId);if(!b||null==w)return;return{collection:b,dataSourceKey:x,filterByTk:w,sourceId:null==g?void 0:g.sourceId,associationName:null==y?void 0:y.associationName}}catch(t){null==(d=(null==n?void 0:n.logger)||e.logger)||null==(s=d.warn)||s.call(d,{err:t},"[FlowEngine] popup.getParentRecordRef failed");return}},a=l=>{try{let n=m(e,t),r=p(n);return h(n,r)-l>=1}catch(e){return!1}},s=t=>{let n=()=>({type:"object",title:l("Parent popup"),disabled:()=>!a(t),disabledReason:()=>a(t)?void 0:l("No parent popup"),hidden:()=>!a(t),properties:async()=>{let n=await o(t),r={};if(r.uid={type:"string",title:l("Popup uid")},n){let t=(()=>{try{var t,l,r,i;let o=null==(l=e.dataSourceManager)||null==(t=l.getDataSource)?void 0:t.call(l,n.dataSourceKey||"main");return(null==o||null==(i=o.collectionManager)||null==(r=i.getCollection)?void 0:r.call(i,n.collection||""))||null}catch(e){return null}})();r.record=await (0,d.$S)(()=>t,l("Popup record"),()=>n)||{type:"object",title:l("Popup record")}}else r.record={type:"object",title:l("Popup record")};return r.resource={type:"object",title:l("Data source"),properties:async()=>({dataSourceKey:{type:"string",title:l("Data source key")},collectionName:{type:"string",title:l("Collection name")},associationName:{type:"string",title:l("Association name")},filterByTk:{type:"string",title:l("filterByTk")},sourceId:{type:"string",title:l("sourceId")}})},r}});return n.title=l("Parent popup"),n},u=()=>({type:"object",title:l("Current popup"),disabled:()=>!n(),hidden:()=>!n(),buildVariablesParams:async e=>{var l,i,a,s;if(!n(e))return;let d=await r(e),u=m(e,t),c=null==u?void 0:u.inputArgs,f={};if(d){let e={...d};!e.associationName&&(null==c?void 0:c.associationName)&&(e.associationName=c.associationName),void 0===e.sourceId&&void 0!==(null==c?void 0:c.sourceId)&&(e.sourceId=null==c?void 0:c.sourceId),f.record=e}try{let t=p(u);if(h(u,t)>=2){let t=f,l=1,n=await o(l,e);for(;n;)t.parent||(t.parent={}),t.parent.record=n,t=t.parent,l+=1,n=await o(l,e)}}catch(t){null==(i=e.logger)||null==(l=i.debug)||l.call(i,{err:t},"[FlowEngine] buildVariablesParams: build parent-chain failed")}try{let e=null==c?void 0:c.sourceId,t=null==c?void 0:c.associationName,l=(null==c?void 0:c.dataSourceKey)||"main";if(null!=e&&""!==e&&t&&"string"==typeof t){let n=String(t).split(".")[0];n&&(f.sourceRecord={collection:n,dataSourceKey:l,filterByTk:e})}}catch(t){null==(s=e.logger)||null==(a=s.debug)||a.call(s,{err:t},"[FlowEngine] buildVariablesParams: infer sourceRecord failed")}return f},properties:async()=>{var n,a,u,c;let f={};if(f.uid={type:"string",title:l("Popup uid")},await r(e)){let e=async()=>{let e=await i();return e?await (0,d.$S)(()=>e,l("Current popup record"),e=>r(e)):null};e.title=l("Current popup record"),e.hasChildren=!0,f.record=e}try{let r=m(e,t),i=null==r?void 0:r.inputArgs,o=null==i?void 0:i.sourceId,s=null==i?void 0:i.associationName,u=(null==i?void 0:i.dataSourceKey)||"main";if(!s||"string"!=typeof s||!s.includes(".")){let t=p(r),l=h(r,t),i=l>=0?null==t?void 0:t[l]:void 0;if(null==i?void 0:i.viewUid){let t=null==e||null==(n=e.engine)?void 0:n.getModel(i.viewUid,!0);t||(t=await e.engine.loadModel({uid:i.viewUid}));let l=(null==t||null==(a=t.getStepParams)?void 0:a.call(t,"popupSettings","openView"))||{};s=(null==l?void 0:l.associationName)||s,u=(null==l?void 0:l.dataSourceKey)||u}}if(null!=o&&""!==o&&s&&"string"==typeof s){let t=String(s).includes(".")?String(s).split(".")[0]:void 0;if(t){let n=()=>{try{var l,n,r,i;let o=null==(n=e.dataSourceManager)||null==(l=n.getDataSource)?void 0:l.call(n,u);return(null==o||null==(i=o.collectionManager)||null==(r=i.getCollection)?void 0:r.call(i,t))||null}catch(e){return null}},r=await (0,d.$S)(n,l("Current popup parent record"),()=>({collection:t,dataSourceKey:u,filterByTk:o}));r&&(f.sourceRecord=r)}}}catch(t){null==(c=e.logger)||null==(u=c.debug)||u.call(c,{err:t},"[FlowEngine] popup.properties: build sourceRecord failed")}return f.resource={type:"object",title:l("Data source"),properties:async()=>({dataSourceKey:{type:"string",title:l("Data source key")},collectionName:{type:"string",title:l("Collection name")},associationName:{type:"string",title:l("Association name")},filterByTk:{type:"string",title:l("filterByTk")},sourceId:{type:"string",title:l("sourceId")}})},await o(1)&&(f.parent=s(1)),f}});return u.title=l("Current popup"),u.sort=975,u}async function v(e,t){var l;let n=p(t),r=h(t,n),i=null==t||null==(l=t.inputArgs)?void 0:l.openerUids,o=Array.isArray(i)&&i.length>0;if(!(r>=1||o))return;if(!n.length){let e=(null==t?void 0:t.inputArgs)||{};if(!(e.collectionName||null!=e.filterByTk||null!=e.sourceId||e.associationName||e.viewUid))return;return{uid:e.viewUid,resource:{dataSourceKey:e.dataSourceKey||"main",collectionName:e.collectionName,associationName:e.associationName,filterByTk:e.filterByTk,sourceId:e.sourceId}}}let a=async t=>{var l,r,i,o,s,d;if(t<0||!(null==(l=n[t])?void 0:l.viewUid))return;let u=n[t].viewUid,c=null==(r=e.engine)?void 0:r.getModel(u,!0);c||(c=await (null==(d=e.engine)?void 0:d.loadModel({uid:u})));let p=(null==c||null==(i=c.getStepParams)?void 0:i.call(c,"popupSettings","openView"))||{},h=null==p?void 0:p.collectionName,m={uid:u,resource:{dataSourceKey:(null==p?void 0:p.dataSourceKey)||"main",collectionName:h,associationName:null==p?void 0:p.associationName,filterByTk:null==(o=n[t])?void 0:o.filterByTk,sourceId:null==(s=n[t])?void 0:s.sourceId}},f=await a(t-1);return f&&(m.parent=f),m};return await a(r)}function y(e,t){let l=/^(?:record|sourceRecord)(?:\.|$)|^parent(?:\.parent)*(?:\.(?:record|sourceRecord))(?:\.|$)/;e.defineProperty("popup",{get:async()=>v(e,t),meta:g(e,t),resolveOnServer:e=>{try{return!!e&&l.test(e)}catch(e){return!1}}})}var b=l(18182);let x=(0,r.forwardRef)((e,t)=>{let{afterClose:l,footer:i,header:o,hidden:a,...s}=e,[d,u]=(0,r.useState)(!0),[c,p]=(0,r.useState)(s),[h,m]=(0,r.useState)(()=>i),[f,g]=(0,r.useState)(o);(0,r.useImperativeHandle)(t,()=>({destroy:()=>{u(!1),null==l||l()},update:e=>p(t=>({...t,...e})),setFooter:e=>{m(e)},setHeader:e=>{0===Object.values(e||{}).length?g(null):g(e)}}));let v={...c,title:(null==f?void 0:f.title)||c.title,extra:null==f?void 0:f.extra,footer:void 0!==h?h:c.footer??null},y=r.useMemo(()=>document.querySelector("#nocobase-app-container"),[]);return(0,n.jsx)(b.A,{closable:!1,rootClassName:a?"nb-hidden":"",getContainer:y,...v,open:d,onCancel:c.onCancel,afterClose:()=>{null==l||l()},children:c.children})});function w(){let[e,t]=r.useState([]);return[e,r.useCallback(e=>(t(t=>[...t,e]),()=>{t(t=>t.filter(t=>t!==e))}),[])]}var S=l(16639),M=l(20616),A=l(47451);async function F(e,t){var l;return!!t.force||!1!==await (null==(l=e.beforeClose)?void 0:l.call(e,t))}function k(e,t){var l;let n=null==t?void 0:t.layoutContext,r=null==t||null==(l=t.engine)?void 0:l.context;n instanceof a.cB&&n!==t&&n!==r&&e.addDelegate(n)}let C=0;function P(){let e=r.useRef(null),t=(t,l)=>{var u,c,p;let h,m,f=null==l?void 0:l.engine;C+=1;let g=r.createRef(),v=new Promise(e=>{m=e}),b=null,w=null,P=e=>{let{children:t}=e;return r.useEffect(()=>{var e;return b=t,null==(e=g.current)||e.setFooter(t),()=>{var e;b=null,null==(e=g.current)||e.setFooter(null)}},[t]),null},j=e=>(r.useEffect(()=>{var t;return w=e,null==(t=g.current)||t.setHeader(e),()=>{var e;w=null,null==(e=g.current)||e.setHeader(null)}},[e]),null),E=new a.cB,R=(0,A._)(l.engine),I=(0,S.eX)(f,R);E.defineProperty("engine",{value:R}),E.addDelegate(R.context),!1!==t.inheritContext?E.addDelegate(l):(E.addDelegate(l.engine.context),k(E,l));let T=!1,_={type:"dialog",inputArgs:t.inputArgs||{},preventClose:!!t.preventClose,beforeClose:void 0,destroy:e=>{var l,n,r,i;if(T)return;T=!0,null==(l=t.onClose)||l.call(t),null==(n=g.current)||n.destroy(),null==h||h(),null==m||m(e);let o=null==I?void 0:I.emitter;(0,S.Z8)(o),null==o||null==(i=o.emit)||i.call(o,S.B9,{type:"dialog",viewUid:null==_||null==(r=_.inputArgs)?void 0:r.viewUid}),R.unlinkFromStack()},update:e=>{var t;return null==(t=g.current)?void 0:t.update(e)},close:async(e,l)=>{var n,r;return(!t.preventClose||!!l)&&!!await F(_,{result:e,force:l})&&(t.triggerByRouter&&(null==(r=t.inputArgs)||null==(n=r.navigation)?void 0:n.back)?t.inputArgs.navigation.back():_.destroy(e),!0)},Footer:P,Header:j,setFooter:e=>{var t;b=e,null==(t=g.current)||t.setFooter(e)},setHeader:e=>{var t;w=e,null==(t=g.current)||t.setHeader(e)},navigation:null==(u=t.inputArgs)?void 0:u.navigation,get record(){return(0,d.vE)(l,E)}};E.defineProperty("view",{get:()=>_,resolveOnServer:(0,d.Xx)(E,()=>(0,d.vE)(l,E))}),R.setDestroyView(()=>{var e,l;t.triggerByRouter&&(null==(l=t.inputArgs)||null==(e=l.navigation)?void 0:e.back)&&t.inputArgs.navigation.back(),_.destroy()}),y(E,_);let D=(0,o.observer)(()=>{var e,l,o,a;let s=r.useRef(!1),d="function"==typeof t.content?t.content(_,E):t.content,u="string"==typeof d?(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:i.A.sanitize(d)}}):d;return(r.useEffect(()=>{var e;null==(e=t.onOpen)||e.call(t,_,E)},[]),(null==(l=t.inputArgs)||null==(e=l.hidden)?void 0:e.value)&&!s.current)?null:(s.current=!0,(0,n.jsx)(x,{className:"nb-dialog-overflow-hidden",ref:g,hidden:null==(a=t.inputArgs)||null==(o=a.hidden)?void 0:o.value,footer:b,header:w,...t,onCancel:()=>{_.close(t.result)},children:u}))},{displayName:"DialogWithContext"}),N=(null==t||null==(c=t.inputArgs)?void 0:c.viewUid)||`page-${C}`,O=(0,n.jsx)(M.I6,{engine:R,children:(0,n.jsx)(s.YQ,{context:E,children:(0,n.jsx)(D,{})})},N);return h=null==(p=e.current)?void 0:p.patchElement(O),Object.assign(v,_)},l=r.useMemo(()=>({open:t}),[]),u=r.memo(r.forwardRef((e,t)=>{let[l,i]=w();return r.useImperativeHandle(t,()=>({patchElement:i}),[i]),(0,n.jsx)(n.Fragment,{children:l})}));return[l,(0,n.jsx)(u,{ref:e},"dialog-holder")]}var j=l(97134),E=l(61793);let R=r.forwardRef((e,t)=>{var l;let{children:i,footer:o,title:a,extra:s,hidden:d,isMobile:u,...c}=e,[p,h]=r.useState(!0),[m,f]=r.useState(()=>o),[g,v]=r.useState({title:a,extra:s,...c.header});r.useImperativeHandle(t,()=>({destroy:()=>{h(!1)},update:e=>{Object.assign(c,e)},setFooter:e=>{f(e)},setHeader:e=>{0===Object.values(e||{}).length?v(null):v(e)}}),[]);let y=r.useMemo(()=>document.querySelector("#nocobase-app-container"),[]);return u?(0,n.jsx)(E.D,{className:d?"nb-hidden":"",visible:p,...c,footer:m,...g,onClose:c.onClose,children:i}):(0,n.jsx)(j.A,{rootClassName:d?"nb-hidden":"",closable:!1,getContainer:y,...c,open:p,footer:m,styles:{...c.styles,footer:{display:"flex",justifyContent:"flex-end",...null==(l=c.styles)?void 0:l.footer}},...g,onClose:c.onClose,children:i})});function I(){let e=r.useRef(null),t=r.useMemo(()=>o.observable.shallow({value:[]}),[]),l=r.memo(e=>{let{index:i}=e,[a,s]=r.useState(null);return(r.useEffect(()=>{(0,o.autorun)(()=>{let e=t.value;e[i]&&a!==e[i]&&s(e[i]),e[i]||s(null)})},[a,i]),a)?(0,n.jsx)(a,{children:(0,n.jsx)(l,{index:i+1})}):null});l.displayName="RenderNestedDrawer";let u=(t,l)=>{var u,c;let p,h,m=l.engine,f=r.createRef(),g=new Promise(e=>{h=e}),v=null,b=null,x=e=>{let{children:t}=e;return r.useEffect(()=>{var e;return v=t,null==(e=f.current)||e.setFooter(t),()=>{var e;v=null,null==(e=f.current)||e.setFooter(null)}},[t]),null},w=e=>(r.useEffect(()=>{var t;return b=e,null==(t=f.current)||t.setHeader(e),()=>{var e;b=null,null==(e=f.current)||e.setHeader(null)}},[e]),null),C=new a.cB,P=(0,A._)(l.engine),j=(0,S.eX)(m,P);C.defineProperty("engine",{value:P}),C.addDelegate(P.context),!1!==t.inheritContext?C.addDelegate(l):(C.addDelegate(l.engine.context),k(C,l));let E=!1,I={type:"drawer",inputArgs:t.inputArgs||{},preventClose:!!t.preventClose,beforeClose:void 0,destroy:e=>{var l,n,r,i;if(E)return;E=!0,null==(l=t.onClose)||l.call(t),null==(n=f.current)||n.destroy(),null==p||p(),null==h||h(e);let o=null==j?void 0:j.emitter;(0,S.Z8)(o),null==o||null==(i=o.emit)||i.call(o,S.B9,{type:"drawer",viewUid:null==I||null==(r=I.inputArgs)?void 0:r.viewUid}),P.unlinkFromStack()},update:e=>{var t;return null==(t=f.current)?void 0:t.update(e)},close:async(e,l)=>{var n,r;return(!t.preventClose||!!l)&&!!await F(I,{result:e,force:l})&&(t.triggerByRouter&&(null==(r=t.inputArgs)||null==(n=r.navigation)?void 0:n.back)?t.inputArgs.navigation.back():I.destroy(e),!0)},Footer:x,Header:w,setFooter:e=>{var t;v=e,null==(t=f.current)||t.setFooter(e)},setHeader:e=>{var t;b=e,null==(t=f.current)||t.setHeader(e)},navigation:null==(u=t.inputArgs)?void 0:u.navigation,get record(){return(0,d.vE)(l,C)}};C.defineProperty("view",{get:()=>I,resolveOnServer:(0,d.Xx)(C,()=>(0,d.vE)(l,C))}),P.setDestroyView(()=>{var e,l;t.triggerByRouter&&(null==(l=t.inputArgs)||null==(e=l.navigation)?void 0:e.back)&&t.inputArgs.navigation.back(),I.destroy()}),y(C,I);let T=r.memo((0,o.observer)(e=>{var l,o,a,s;let d=r.useRef(!1),u="function"==typeof t.content?t.content(I,C):t.content,c="string"==typeof u?(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:i.A.sanitize(u)}}):u;return(r.useEffect(()=>{var e;null==(e=t.onOpen)||e.call(t,I,C)},[]),(null==(o=t.inputArgs)||null==(l=o.hidden)?void 0:l.value)&&!d.current)?(0,n.jsx)(n.Fragment,{children:e.children}):(d.current=!0,(0,n.jsxs)(R,{ref:f,...t,footer:v,header:t.header||b,hidden:null==(s=t.inputArgs)||null==(a=s.hidden)?void 0:a.value,onClose:()=>{I.close(t.result)},isMobile:C.isMobileLayout,children:[c,e.children]}))}));T.displayName="DrawerWithContext";let _=r.memo(e=>{let{children:t}=e;return(0,n.jsx)(M.I6,{engine:P,children:(0,n.jsx)(s.YQ,{context:C,children:(0,n.jsx)(T,{children:t})})})});return _.displayName="RenderDrawer",p=null==(c=e.current)?void 0:c.patchElement(_),Object.assign(g,I)},c=r.useMemo(()=>({open:u}),[]),p=r.memo(r.forwardRef((e,i)=>{let[o,a]=w();return r.useImperativeHandle(i,()=>({patchElement:a}),[a]),r.useEffect(()=>{t.value=o},[o]),(0,n.jsx)(l,{index:0})}));return[c,(0,n.jsx)(p,{ref:e},"drawer-holder")]}var T=l(40961),_=l(31333),D=l(71021);let N=(0,r.forwardRef)((e,t)=>{let[l,i]=r.useState({}),{visible:o=!0,footer:a=null,header:s=null,children:d,hidden:u,title:c,styles:p={},zIndex:h=4,onClose:m}={...e,...l},f=(0,r.useRef)(!1),g=(0,M.uf)(),[v,y]=(0,r.useState)(()=>a),[b,x]=(0,r.useState)(s);(0,r.useImperativeHandle)(t,()=>({destroy:()=>{f.current||(f.current=!0)},update:e=>{i(e)},setFooter:e=>{y(e)},setHeader:e=>{0===Object.values(e||{}).length?x(null):x(e)}}));let w=(0,r.useMemo)(()=>({display:u?"none":"flex",flexDirection:"column",height:"100%",zIndex:h}),[u,h]),S=(0,r.useMemo)(()=>{if(!b&&!c)return null;let{title:e=c,extra:t}=b||{},l=g.context.themeToken;return(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:`${l.paddingSM}px ${l.padding}px`,borderBottom:`1px solid ${l.colorSplit}`,backgroundColor:l.colorBgContainer,...p.header},children:[(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:l.marginXS},children:[(0,n.jsx)(D.Ay,{type:"text",size:"small",icon:(0,n.jsx)(_.A,{}),onClick:async()=>{f.current||!1!==await (null==m?void 0:m())&&(f.current=!0)},style:{color:l.colorTextTertiary}}),e&&(0,n.jsx)("div",{style:{fontSize:l.fontSizeLG,fontWeight:l.fontWeightStrong,color:l.colorText},children:e})]}),t&&(0,n.jsx)("div",{children:t})]})},[b,c,g.context.themeToken,p.header,m]),A=(0,r.useMemo)(()=>{if(!v)return null;let e=g.context.themeToken;return(0,n.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",padding:`${e.paddingXS}px ${e.padding}px`,borderTop:`1px solid ${e.colorSplit}`,backgroundColor:e.colorBgContainer,...p.footer},children:v})},[v,g.context.themeToken,p.footer]);return o?(0,n.jsxs)("div",{style:{...w,...p.content},children:[S,(0,n.jsx)("div",{style:{flex:1,overflowY:"auto",...p.body},children:d}),A]}):null}),O=0,$="nocobase-embed-container",B="nocobaseEmbedReplacing";function L(e){return!!e&&"function"==typeof e.then}function V(e,t){e.dataset[B]="1";try{let l=t.close();if(L(l))return Promise.resolve(l).finally(()=>{delete e.dataset[B]});return delete e.dataset[B],l}catch(t){throw delete e.dataset[B],t}}function q(e,t,l){let n,r={},i=e.then(e=>{let{page:t}=e;return(n=t)&&("beforeClose"in r&&(n.beforeClose=r.beforeClose),"update"in r&&n.update(r.update),"footer"in r&&n.setFooter(r.footer),"header"in r&&n.setHeader(r.header),r.destroyed&&n.destroy(r.destroyed.result)),{page:t}});return Object.assign(i.then(e=>{let{page:t}=e;return!!t&&t}),{type:"embed",inputArgs:t,preventClose:l,Header:null,Footer:null,get beforeClose(){return(null==n?void 0:n.beforeClose)??r.beforeClose},set beforeClose(value){n?n.beforeClose=value:r.beforeClose=value},close:(e,t)=>i.then(l=>{let{page:n}=l;return!!n&&n.close(e,t)}),destroy:e=>{n?n.destroy(e):r.destroyed={result:e}},update:e=>{n?n.update(e):r.update={...r.update,...e}},setFooter:e=>{n?n.setFooter(e):r.footer=e},setHeader:e=>{n?n.setHeader(e):r.header=e}})}let z=r.memo(r.forwardRef((e,t)=>{let[l,i]=w();return r.useImperativeHandle(t,()=>({patchElement:i}),[i]),(0,n.jsx)(n.Fragment,{children:l})}));function K(){let e=r.useRef(null),t=r.useRef(null),l=r.useRef(0),i=(i,u)=>{let{target:c,content:p,preventClose:h,inheritContext:m=!0,inputArgs:f={},onOpenCancelled:g,...v}=i,b=c instanceof HTMLElement&&c.id===$,x=()=>{var l,g,x;let w,C,P,j=null==u?void 0:u.engine;O+=1;let E=r.createRef(),R=new Promise(e=>{C=e}),I=e=>{let{children:t}=e;return r.useEffect(()=>{var e;return null==(e=E.current)||e.setFooter(t),()=>{var e;null==(e=E.current)||e.setFooter(null)}},[t]),null},_=e=>(r.useEffect(()=>{var t;return null==(t=E.current)||t.setHeader(e),()=>{var e;null==(e=E.current)||e.setHeader(null)}},[e]),null),D=new a.cB,$=(0,A._)(u.engine),L=(0,S.eX)(j,$);D.defineProperty("engine",{value:$}),D.addDelegate($.context),m?D.addDelegate(u):(D.addDelegate(u.engine.context),k(D,u));let V=!1,q={type:"embed",inputArgs:f,preventClose:!!i.preventClose,beforeClose:void 0,destroy:e=>{var l,n,r,o,a;if(!V){if(V=!0,null==(l=i.onClose)||l.call(i),null==C||C(e),null==(n=E.current)||n.destroy(),null==w||w(),b&&t.current===q&&(t.current=null),!(b&&c instanceof HTMLElement&&(null==(r=c.dataset)?void 0:r[B])==="1")){let e=null==L?void 0:L.emitter;(0,S.Z8)(e),null==e||null==(a=e.emit)||a.call(e,S.B9,{type:"embed",viewUid:null==q||null==(o=q.inputArgs)?void 0:o.viewUid})}$.unlinkFromStack()}},update:e=>{var t;return null==(t=E.current)?void 0:t.update(e)},close:(e,t)=>V?Promise.resolve(!0):P||(P=(async()=>{try{var l,n;if(h&&!t)return P=void 0,!1;let r=await F(q,{result:e,force:t});if(V)return!0;if(!r)return P=void 0,!1;if(i.triggerByRouter&&(null==(n=i.inputArgs)||null==(l=n.navigation)?void 0:l.back))return i.inputArgs.navigation.back(),!0;return q.destroy(e),!0}catch(e){throw V||(P=void 0),e}})()),Header:_,Footer:I,setFooter:e=>{var t;null==(t=E.current)||t.setFooter(e)},setHeader:e=>{var t;null==(t=E.current)||t.setHeader(e)},navigation:null==(l=i.inputArgs)?void 0:l.navigation,get record(){return(0,d.vE)(u,D)}};D.defineProperty("view",{get:()=>q,resolveOnServer:(0,d.Xx)(D,()=>(0,d.vE)(u,D))}),y(D,q);let z=(0,o.observer)(()=>{var e,t,l,o;let a=r.useRef(!1),s=r.useMemo(()=>"function"==typeof p?p(q,D):p,[]);return(D.themeToken,r.useEffect(()=>{var e;null==(e=i.onOpen)||e.call(i,q,D)},[]),(null==(t=i.inputArgs)||null==(e=t.hidden)?void 0:e.value)&&!a.current)?null:(a.current=!0,(0,n.jsx)(N,{ref:E,hidden:null==(o=i.inputArgs)||null==(l=o.hidden)?void 0:l.value,...v,onClose:()=>q.close(i.result),children:s}))},{displayName:"PageWithContext"}),K=(null==f?void 0:f.viewUid)||`page-${O}`,U=(0,n.jsx)(M.I6,{engine:$,children:(0,n.jsx)(s.YQ,{context:D,children:(0,n.jsx)(z,{})})},K);return w=c&&c instanceof HTMLElement?null==(g=e.current)?void 0:g.patchElement(T.createPortal(U,c,K)):null==(x=e.current)?void 0:x.patchElement(U),b&&(t.current=q),Object.assign(R,q)};if(b&&t.current){let e,n=l.current+=1,r=()=>null==g?void 0:g();try{e=V(c,t.current)}catch(e){throw r(),e}if(L(e))return q(Promise.resolve(e).then(e=>!1===e||n!==l.current?(r(),{page:null}):{page:x()},e=>{throw r(),e}),f,!!i.preventClose);if(!1===e)return r(),q(Promise.resolve({page:null}),f,!!i.preventClose)}return x()};return[r.useMemo(()=>({open:i}),[]),(0,n.jsx)(z,{ref:e},"page-holder")]}var U=l(28073);let W=0,H=r.forwardRef((e,t)=>{var l,i;let{afterClose:o,content:a,placement:s,rect:d,...u}=e,[c,p]=r.useState(!0),[h,m]=r.useState({content:a,placement:s,rect:d,...u});return r.useImperativeHandle(t,()=>({destroy:()=>p(!1),update:e=>m(t=>({...t,...e})),close:(e,t)=>p(!1)})),r.useEffect(()=>{c||null==o||o()},[c,o]),(0,n.jsx)(U.A,{arrow:!1,open:c,trigger:["click"],destroyTooltipOnHide:!0,content:h.content,placement:h.placement,getPopupContainer:()=>document.querySelector("#nocobase-app-container")||document.body,onOpenChange:e=>{(e||!h.preventClose)&&(p(e),e||null==o||o())},...h,children:(0,n.jsx)("span",{style:{position:"absolute",top:((null==(l=h.rect)?void 0:l.top)??0)+window.scrollY,left:((null==(i=h.rect)?void 0:i.left)??0)+window.scrollX,width:0,height:0}})})});function G(){let e=r.useRef(null),t=t=>{var l,o;let a,s;W+=1;let{target:d,placement:u="rightTop",content:c,...p}=t,h=r.createRef(),m=(null==d||null==(l=d.getBoundingClientRect)?void 0:l.call(d))??{top:0,left:0},f=new Promise(e=>{s=e}),g={type:"popover",destroy:()=>{var e;return null==(e=h.current)?void 0:e.destroy()},update:e=>{var t;return null==(t=h.current)?void 0:t.update(e)},close:e=>{var t;null==s||s(e),null==(t=h.current)||t.close(e)}},v="function"==typeof c?c(g):c,y="string"==typeof v?(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:i.A.sanitize(v)}}):v,b=(0,n.jsx)(H,{ref:h,content:y,placement:u,rect:m,afterClose:()=>{var e;null==a||a(),null==(e=t.onClose)||e.call(t),null==s||s(t.result)},...p},`popover-${W}`);return a=null==(o=e.current)?void 0:o.patchElement(b),Object.assign(f,g)},l=r.useMemo(()=>({open:t}),[]),o=r.memo(r.forwardRef((e,t)=>{let[l,i]=w();return r.useImperativeHandle(t,()=>({patchElement:i}),[]),(0,n.jsx)(n.Fragment,{children:l})}));return[l,(0,n.jsx)(o,{ref:e},"popover-holder")]}var Y=l(50467),J=l(52847),X=l(60182);function Q(e){return null==e?"":e&&"object"==typeof e&&!Array.isArray(e)?encodeURIComponent(Object.entries(e).map(e=>{let[t,l]=e;return`${encodeURIComponent(String(t))}=${encodeURIComponent(String(l))}`}).join("&")):encodeURIComponent(String(e))}function Z(e){return null!=e&&""!==String(e)}function ee(e){let t=e||"/admin";return`/${t.replace(/^\/+/,"").replace(/\/+$/,"")}`}function et(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=ee(t.basePath||t.prefix);if(!e||0===e.length)return l;let n=l.replace(/^\/+/,"").split("/").filter(Boolean);return e.forEach((e,t)=>{t>0&&n.push("view"),n.push(e.viewUid);let l=(0,X.Gu)(e.viewUid,e.openViewRouteState);if(l&&n.push("opts",l),e.tabUid&&n.push("tab",e.tabUid),null!=e.filterByTk){let t=Q(e.filterByTk);t&&n.push("filterbytk",t)}Z(e.sourceId)&&n.push("sourceid",String(e.sourceId))}),"/"+n.join("/")}class el{setViewStack(e){this.viewStack=Object.freeze([...e]),this.viewParams=this.viewStack[this.viewStack.length-1]||{}}changeTo(e){let t=et(this.viewStack.map((t,l)=>l===this.viewStack.length-1?{...t,...e}:{...t}),{basePath:this.getLayoutBasePath()});this.ctx.router.navigate(t,{replace:!0})}navigateTo(e,t){let l=et([...this.viewStack,e],{basePath:this.getLayoutBasePath()});this.ctx.router.navigate(l,t)}back(){let e=et(this.viewStack.slice(0,-1),{basePath:this.getLayoutBasePath()});this.ctx.router.navigate(e,{replace:!0})}getLayoutBasePath(){var e,t;let l=null==(e=this.ctx.layout)?void 0:e.routePath;return this.basePath||(null==(t=this.ctx.layoutRoute)?void 0:t.basePathname)||((null==l?void 0:l.startsWith("/"))?l:"/admin")}constructor(e,t,l={}){(0,Y._)(this,"viewStack",void 0),(0,Y._)(this,"ctx",void 0),(0,Y._)(this,"viewParams",void 0),(0,Y._)(this,"basePath",void 0),this.setViewStack(t),this.ctx=e,this.basePath=l.basePath||l.layoutBasePath,(0,J.E8)(this,{viewParams:J.sH})}}},16639(e,t,l){l.d(t,{B9:()=>r,FH:()=>s,HK:()=>i,Z8:()=>d,eX:()=>p,i6:()=>o,tb:()=>n});let n=Symbol.for("__NOCOBASE_VIEW_ACTIVATED_VERSION__"),r="view:activated",i="dataSource:dirty",o="__NOCOBASE_ENGINE_SCOPE__",a="view";function s(e){let t=Reflect.get(e,n),l="number"==typeof t?t:Number(t);return Number.isFinite(l)&&l>0?l:0}function d(e){let t=s(e);if(!Object.isExtensible(e))return t;let l=t+1;return Reflect.set(e,n,l),l}function u(e){return Reflect.get(e,o)===a}function c(e){let t=e,l=0;for(;t&&l++<50;){if(u(t))return t;t=t.previousEngine}}function p(e,t){if(!e)return;let l=c(e);return l||c(null==t?void 0:t.previousEngine)||e}},33329(e,t,l){l.d(t,{xW:()=>f,bO:()=>s,Q9:()=>m});var n=l(50467),r=l(88909),i=l(55373),o=l.n(i);let a=(e,t)=>{if(!e)return;let l="function"==typeof e.toJSON?e.toJSON():e,n=Object.keys(l||{}).find(e=>e.toLowerCase()===t.toLowerCase());return n?l[n]:void 0},s=(e,t)=>{let l=a(e,t);return null!=l&&""!==l};class d{get storagePrefix(){return this.api.storagePrefix}get locale(){return this.getLocale()}set locale(e){this.setLocale(e)}get role(){return this.getRole()}set role(e){this.setRole(e)}get token(){return this.getToken()}set token(e){this.setToken(e)}get authenticator(){return this.getAuthenticator()}set authenticator(e){this.setAuthenticator(e)}getOption(e){return this.api.storage.getItem(e)}setOption(e,t){return this.options[e]=t,this.api.storage.setItem(e,t||"")}getLocale(){return this.getOption("locale")}setLocale(e){this.setOption("locale",e)}getRole(){return this.getOption("role")}setRole(e){this.setOption("role",e)}getToken(){return this.getOption("token")}setToken(e){this.setOption("token",e),this.api.app&&this.api.app.eventBus.dispatchEvent(new CustomEvent("auth:tokenChanged",{detail:{token:e,authenticator:this.authenticator}}))}getAuthenticator(){return this.getOption("auth")}setAuthenticator(e){this.setOption("auth",e)}middleware(e){return this.locale&&e.headers&&(e.headers["X-Locale"]=this.locale),this.role&&e.headers&&(e.headers["X-Role"]=this.role),this.authenticator&&!s(e.headers,"X-Authenticator")&&e.headers&&(e.headers["X-Authenticator"]=this.authenticator),this.token&&!s(e.headers,"Authorization")&&e.headers&&(e.headers.Authorization=`Bearer ${this.token}`),e}async signIn(e,t){var l;let n=await this.api.request({method:"post",url:"auth:signIn",data:e,headers:{"X-Authenticator":t}}),r=null==n||null==(l=n.data)?void 0:l.data;return this.setAuthenticator(t),this.setToken(null==r?void 0:r.token),n}async signUp(e,t){return await this.api.request({method:"post",url:"auth:signUp",data:e,headers:{"X-Authenticator":t}})}async signOut(){let e=await this.api.request({method:"post",url:"auth:signOut"});return this.setToken(null),this.setRole(null),this.setAuthenticator(null),e}async lostPassword(e){let t=Object.fromEntries(new URLSearchParams(window.location.search).entries());return await this.api.request({method:"post",url:"auth:lostPassword",data:{...e,baseURL:window.location.href.split("/forgot-password")[0]},headers:{"X-Authenticator":t.name}})}async resetPassword(e){return await this.api.request({method:"post",url:"auth:resetPassword",data:e})}async checkResetToken(e){return await this.api.request({method:"post",url:"auth:checkResetToken",data:e})}constructor(e){(0,n._)(this,"api",void 0),(0,n._)(this,"options",{locale:null,role:null,authenticator:null,token:null}),this.api=e,this.api.axios.interceptors.request.use(this.middleware.bind(this))}}class u{toUpperCase(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";for(var t=arguments.length,l=Array(t>1?t-1:0),n=1;n<t;n++)l[n-1]=arguments[n];return e.toUpperCase()+l.map(e=>e.toUpperCase()).join("_")}constructor(){(0,n._)(this,"storagePrefix",void 0)}}class c extends u{clear(){this.items.clear()}getItem(e){return this.items.get(e)}setItem(e,t){return this.items.set(e,t)}removeItem(e){return this.items.delete(e)}constructor(...e){super(...e),(0,n._)(this,"items",new Map)}}class p extends u{clear(){return this.items.clear()}getItem(e){return this.shareToken&&"token"===e&&this.baseStoragePrefix?this.items.getItem(this.toUpperCase(this.baseStoragePrefix,e)):this.items.getItem(this.toUpperCase(this.storagePrefix,e))}setItem(e,t){return this.shareToken&&"token"===e&&this.baseStoragePrefix?this.items.setItem(this.toUpperCase(this.baseStoragePrefix,e),t):this.items.setItem(this.toUpperCase(this.storagePrefix,e),t)}removeItem(e){return this.shareToken&&"token"===e&&this.baseStoragePrefix?this.items.removeItem(this.toUpperCase(this.baseStoragePrefix,e)):this.items.removeItem(this.toUpperCase(this.storagePrefix,e))}constructor(e,t="",l=!1){super(),(0,n._)(this,"storagePrefix",void 0),(0,n._)(this,"baseStoragePrefix",void 0),(0,n._)(this,"shareToken",void 0),(0,n._)(this,"items",void 0),this.storagePrefix=e,this.baseStoragePrefix=t,this.shareToken=l,this.items=window.localStorage}}class h extends p{constructor(e,t="",l=!1){super(e,t,l),(0,n._)(this,"storagePrefix",void 0),(0,n._)(this,"baseStoragePrefix",void 0),(0,n._)(this,"shareToken",void 0),this.storagePrefix=e,this.baseStoragePrefix=t,this.shareToken=l,this.items=window.sessionStorage}}class m{toErrMessages(e){var t,l,n,r,i,o,a,s,d,u,c;if("u">typeof document&&"string"==typeof(null==e||null==(t=e.response)?void 0:t.data)){let t=document.createElement("div");t.innerHTML=null==e||null==(d=e.response)?void 0:d.data;let l=t.textContent||t.innerText;return l.includes("Error occurred while trying")||l.includes("502 Bad Gateway")?[{code:"APP_WARNING",message:l="The application may be starting up. Please try again later."}]:[{message:l}]}return(null==e||null==(n=e.response)||null==(l=n.data)?void 0:l.error)?[null==e||null==(c=e.response)||null==(u=c.data)?void 0:u.error]:(null==e||null==(i=e.response)||null==(r=i.data)?void 0:r.errors)||(null==e||null==(a=e.response)||null==(o=a.data)?void 0:o.messages)||(null==e||null==(s=e.response)?void 0:s.error)||[{message:e.message||"Server error"}]}getHeaders(){let e={};return this.auth.locale&&(e["X-Locale"]=this.auth.locale),this.auth.role&&(e["X-Role"]=this.auth.role),this.auth.authenticator&&(e["X-Authenticator"]=this.auth.authenticator),this.auth.token&&(e.Authorization=`Bearer ${this.auth.token}`),e}createStorage(e){return"localStorage"===e&&"u">typeof localStorage?new p(this.storagePrefix,this.baseStoragePrefix,this.shareToken):"sessionStorage"===e&&"u">typeof sessionStorage?new h(this.storagePrefix,this.baseStoragePrefix,this.shareToken):new c}initStorage(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"localStorage";if(e){this.storage=new e(this);return}this.storage=this.createStorage(t)}interceptors(){this.axios.interceptors.request.use(e=>(e.paramsSerializer=e=>o().stringify(e,{strictNullHandling:!0,arrayFormat:"brackets"}),e))}request(e){let{resource:t,resourceOf:l,action:n,params:r,headers:i}=e;return t?this.resource(t,l,i)[n](r):this.axios.request(e)}resource(e,t,l,n){return new Proxy({},{get:(r,i)=>{if(n)return;let o=e.split(".").join(`/${encodeURIComponent(t)||"_"}/`),a={url:o+=`:${i.toString()}`};return["get","list"].includes(i)?a.method="get":a.method="post",async(e,t)=>{let{values:n,filter:r,...i}=e||{};return a.params=i,r&&("string"==typeof r?a.params.filter=r:(r["*"]&&delete r["*"],a.params.filter=JSON.stringify(r))),"get"!==a.method&&(a.data=n||{}),await this.request({...a,...t,headers:l})}}})}constructor(e){if((0,n._)(this,"options",void 0),(0,n._)(this,"axios",void 0),(0,n._)(this,"auth",void 0),(0,n._)(this,"storage",void 0),(0,n._)(this,"storagePrefix","NOCOBASE_"),(0,n._)(this,"baseStoragePrefix","NOCOBASE_"),(0,n._)(this,"shareToken",!1),this.options=e,"function"==typeof e)this.axios=e;else{let{appName:t,authClass:l,storageType:n,storageClass:i,storagePrefix:o="NOCOBASE_",shareToken:a=!1,...s}=e||{};this.shareToken=a,this.baseStoragePrefix=o,this.storagePrefix=t?`${o}${t.toUpperCase()}_`:o,this.axios=r.A.create(s),this.initStorage(i,n),l&&(this.auth=new l(this))}this.storage||this.initStorage(),this.auth||(this.auth=new d(this)),this.interceptors()}}let f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/";if("u"<typeof window||!window.location.pathname)return;let t=`${e}apps/`;if(window.location.pathname.startsWith(t))return window.location.pathname.substring(t.length).split("/",1)[0]||""}},40542(e,t,l){l.d(t,{D:()=>n});let n=(e,t,l)=>{if(!e)return l;let r=t.split("."),i=[],o=e,a=!1;for(let e=0;e<r.length;e++){let t=r[e];if(Array.isArray(o)){for(let t of(a=!0,o)){let o=n(t,r.slice(e).join("."),l);i=i.concat(o)}break}if((null==o?void 0:o[t])===void 0)break;o=o[t],e===r.length-1&&i.push(o)}return 0===(i=i.filter(e=>void 0!==e)).length?l:a?i.filter(e=>null!==e):i[0]}},96436(e,t,l){l.r(t),l.d(t,{getDayRange:()=>tl,isEmptyFilter:()=>ed,sleep:()=>es,getDateVars:()=>ta,isString:()=>ee,unflatten:()=>e8,sortTree:()=>ea,forEach:()=>ek,utc2unit:()=>tr,extractUsedVariablePaths:()=>tE,getValuesByPath:()=>eC,isArray:()=>et,moment2str:()=>eb,transformLiquidContext:()=>tI,isURL:()=>tA,isPortalInBody:()=>tb,extractUsedVariableNames:()=>tj,parseHTML:()=>tx,toGmt:()=>ep,isPlainObject:()=>en,lockdownSes:()=>tg,splitPathToTwoParts:()=>ts,transformFilter:()=>Y,parseSQLBindParams:()=>tD,getPickerFormat:()=>eM,nextTick:()=>ei,removeNullCondition:()=>eu,CollectionsGraph:()=>q,isValidFilter:()=>eT,evaluateConditions:()=>Z,toUnit:()=>ti,BASE_BLOCKED_IDENTIFIERS:()=>th,getFormatFromDateStr:()=>eF,removeInvalidFilterItems:()=>J,toLocal:()=>eh,getDayRangeByParams:()=>L,getDefaultFormat:()=>ec,transformMultiColumnToSingleColumn:()=>tC,treeFind:()=>eo,transformSQL:()=>tN,parseFilter:()=>tt,flatten:()=>e4,getOffsetRangeByParams:()=>N,isEmpty:()=>el,offsetFromString:()=>ex,tval:()=>tv,error:()=>eV,Registry:()=>tu,lodash:()=>r(),parse:()=>eO,hasEmptyValue:()=>er,toFixedByStep:()=>eJ,getDateTimeFormat:()=>eA,showToast:()=>eH,Handlebars:()=>eE(),getLiquidContext:()=>tT,merge:()=>eU,dayjs:()=>o(),parseLiquidContext:()=>t_,uid:()=>tM,str2moment:()=>eg});var n=l(2543),r=l.n(n),i=l(74353),o=l.n(i),a=l(97375),s=l.n(a),d=l(90445),u=l.n(d),c=l(43522),p=l.n(c),h=l(37872),m=l.n(h),f=l(98867),g=l.n(f),v=l(8906),y=l.n(v),b=l(68313),x=l.n(b),w=l(21840),S=l.n(w),M=l(41816),A=l.n(M),F=l(88569),k=l.n(F),C=l(83826),P=l.n(C),j=l(8134),E=l.n(j),R=l(28623),I=l.n(R),T=l(46986),_=l.n(T);o().extend(_()),o().extend(S()),o().extend(k()),o().extend(P()),o().extend(A()),o().extend(x()),o().extend(m()),o().extend(g()),o().extend(y()),o().extend(E()),o().extend(I()),o().extend(u()),o().extend(s()),o().extend(p());let D=e=>{if(!e)return o()();if(/^[+-]\d{2}:\d{2}$/.test(e)){let[t,l,n]=e.match(/([+-])(\d{2}):(\d{2})/).slice(1),r=(60*parseInt(l)+parseInt(n))*("+"===t?1:-1);return o()().utcOffset(r)}return o()().tz(e)},N=e=>{let t,l,{type:n,unit:r="day",number:i=1,timezone:o}=e,a=D(o),s="week"===r?"isoWeek":r;if("past"===n){let e=a.startOf(s);t=e.subtract(i,r).startOf(s),l=e.subtract(1,r).endOf(s)}else if("next"===n)l=(t=a.startOf(s).add(1,r).startOf(s)).add(i-1,r).endOf(s);else throw Error(`Unsupported type: ${n}`);return[t.format("YYYY-MM-DD HH:mm:ss"),l.format("YYYY-MM-DD HH:mm:ss")]},O=(e,t,l)=>{let n="isoWeek"===t?"week":t;return D(l).add(e,n).startOf(t)},$=(e,t,l)=>{let n="isoWeek"===t?"week":t;return D(l).add(e,n).endOf(t)},B={today:e=>[O(0,"day",null==e?void 0:e.timezone),$(0,"day",null==e?void 0:e.timezone)],yesterday:e=>[O(-1,"day",null==e?void 0:e.timezone),$(-1,"day",null==e?void 0:e.timezone)],tomorrow:e=>[O(1,"day",null==e?void 0:e.timezone),$(1,"day",null==e?void 0:e.timezone)],thisWeek:e=>[O(0,"isoWeek",null==e?void 0:e.timezone),$(0,"isoWeek",null==e?void 0:e.timezone)],lastWeek:e=>[O(-1,"isoWeek",null==e?void 0:e.timezone),$(-1,"isoWeek",null==e?void 0:e.timezone)],nextWeek:e=>[O(1,"isoWeek",null==e?void 0:e.timezone),$(1,"isoWeek",null==e?void 0:e.timezone)],thisMonth:e=>[O(0,"month",null==e?void 0:e.timezone),$(0,"month",null==e?void 0:e.timezone)],lastMonth:e=>[O(-1,"month",null==e?void 0:e.timezone),$(-1,"month",null==e?void 0:e.timezone)],nextMonth:e=>[O(1,"month",null==e?void 0:e.timezone),$(1,"month",null==e?void 0:e.timezone)],thisQuarter:e=>[O(0,"quarter",null==e?void 0:e.timezone),$(0,"quarter",null==e?void 0:e.timezone)],lastQuarter:e=>[O(-1,"quarter",null==e?void 0:e.timezone),$(-1,"quarter",null==e?void 0:e.timezone)],nextQuarter:e=>[O(1,"quarter",null==e?void 0:e.timezone),$(1,"quarter",null==e?void 0:e.timezone)],thisYear:e=>[O(0,"year",null==e?void 0:e.timezone),$(0,"year",null==e?void 0:e.timezone)],lastYear:e=>[O(-1,"year",null==e?void 0:e.timezone),$(-1,"year",null==e?void 0:e.timezone)],nextYear:e=>[O(1,"year",null==e?void 0:e.timezone),$(1,"year",null==e?void 0:e.timezone)]},L=e=>{if("past"===e.type||"next"===e.type)return N(e);let t=B[e.type];if(!t)throw Error(`Unsupported type: ${e.type}`);let[l,n]=t(e);return[l.format("YYYY-MM-DD HH:mm:ss"),n.format("YYYY-MM-DD HH:mm:ss")]};var V=l(38362);class q{static graphlib(){return V}static connectedNodes(e){let t=(0,n.castArray)(e.nodes),l=(0,n.castArray)(e.excludes||[]),r=q.build(e),i=new Set;for(let e of t)for(let t of V.alg.preorder(r,e))l.includes(t)||i.add(t);return Array.from(i)}static preOrder(e){return q.graphlib().alg.preorder(q.build(e),e.node)}static build(e){let t=e.collections,l="forward"===((null==e?void 0:e.direction)||"forward"),n=new V.Graph;for(let e of t)n.setNode(e.name);for(let e of t){for(let t of e.inherits||[])l?n.setEdge(e.name,t):n.setEdge(t,e.name);for(let t of e.fields||[])if(("hasMany"===t.type||"belongsTo"===t.type||"hasOne"===t.type)&&(l?n.setEdge(e.name,t.target):n.setEdge(t.target,e.name)),"belongsToMany"===t.type){let r=t.through;l?(n.setEdge(e.name,r),n.setEdge(r,t.target)):(n.setEdge(t.target,r),n.setEdge(r,e.name))}}return n}}var z=l(81814),K=l.n(z);function U(e){return"path"in e&&"operator"in e}function W(e){return"logic"in e&&"items"in e}function H(e){let{path:t,operator:l,value:n}=e;return{[t]:{[l]:n}}}function G(e){let{logic:t,items:l}=e;return{[t]:l.map(e=>{if(U(e))return H(e);if(W(e))return G(e);throw Error("Invalid filter item type")})}}function Y(e){if(!e||"object"!=typeof e)throw Error("Invalid filter: filter must be an object");if(!W(e))throw Error("Invalid filter: filter must have logic and items properties");if(!Array.isArray(e.items))throw Error("Invalid filter: items must be an array");return eu(G(e))}function J(e){if(!e||"object"!=typeof e)throw Error("Invalid filter: filter must be an object");if(!W(e))throw Error("Invalid filter: filter must have logic and items properties");if(!Array.isArray(e.items))throw Error("Invalid filter: items must be an array");return e.items=e.items.filter(e=>U(e)?!!e.operator:!!W(e)&&J(e)),{...e}}function X(e,t){let{path:l,operator:n,value:r}=e;return t(l,n,r)}function Q(e,t){let{logic:l,items:n}=e;if(!n||0===n.length)return!0;let r=n.map(e=>{if(U(e))return X(e,t);if(W(e))return Q(e,t);throw Error("Invalid filter item type")});if("$and"===l)return r.every(e=>!0===e);if("$or"===l)return r.some(e=>!0===e);throw Error(`Unsupported logic operator: ${l}`)}function Z(e,t){if(!e||"object"!=typeof e)throw Error("Invalid conditions: conditions must be an object");if(!W(e))throw Error("Invalid conditions: conditions must have logic and items properties");if(!Array.isArray(e.items))throw Error("Invalid conditions: items must be an array");if("function"!=typeof t)throw Error("Invalid evaluator: evaluator must be a function");return Q(e,t)}let ee=e=>"string"==typeof e,et=e=>Array.isArray(e),el=e=>en(e)?0===Object.keys(e).length:!!Array.isArray(e)&&0===e.length,en=e=>{if("[object Object]"!==Object.prototype.toString.call(e))return!1;let t=Object.getPrototypeOf(e);return null===t||t===Object.prototype},er=e=>{let t=!0;for(let l in e){if(t=!1,et(e[l])&&0===e[l].length||!e[l])return!0;if(en(e[l])||et(e[l]))return er(e[l])}return t},ei=e=>{setTimeout(e)};function eo(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)return;let{childrenKey:n="children"}=l;for(let r of Array.isArray(e)?[...e]:[e]){if(t(r))return r;let e="function"==typeof n?n(r):r[n];if(Array.isArray(e)&&e.length>0){let n=eo(e,t,l);if(void 0!==n)return n}}}function ea(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"children",n=!(arguments.length>3)||void 0===arguments[3]||arguments[3];return e&&Array.isArray(e)&&0!==e.length?r().orderBy(e,t,n?"asc":"desc").map(e=>e[l]&&e[l].length>0?{...e,[l]:ea(e[l],t,l,n)}:e):e}function es(e){return new Promise(t=>{setTimeout(t,e)})}function ed(e){return!!(!e||"$and"in e&&r().isEmpty(e.$and)||"$or"in e&&r().isEmpty(e.$or))}let eu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:K(),l=t(e||{}),n={};for(let e in l){let t=l[e];null==t||el(t)||""===t||(n[e]=t)}let i=t.unflatten(n);for(let e in i)Array.isArray(i[e])&&(i[e]=i[e].filter(e=>null!=e));return r().isEmpty(i)?void 0:i},ec=e=>e.format?e.format:e.dateFormat?e.showTime?`${e.dateFormat} ${e.timeFormat||"HH:mm:ss"}`:e.dateFormat:"month"===e.picker?"YYYY-MM":"quarter"===e.picker?"YYYY-\\QQ":"year"===e.picker?"YYYY":"week"===e.picker?"YYYY[W]W":e.showTime?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD",ep=e=>e&&o().isDayjs(e)?`${e.format("YYYY-MM-DD")}T${e.format("HH:mm:ss.SSS")}Z`:e,eh=e=>e?Array.isArray(e)?e.map(e=>e.startOf("second").toISOString()):o().isDayjs(e)?e.startOf("second").toISOString():void 0:e,em=e=>{try{let t=parseInt(e.slice(0,4)),l=parseInt(e.slice(-1));return o()().quarter(l).year(t)}catch(e){return null}},ef=(e,t)=>{if(!e)return;let l=t.utcOffset,{gmt:n,picker:r,utc:i=!0,dateOnly:a}=t;if(!o()(e).isValid())return em(e);if(a){let t=o()(e);if(!t.isValid())return e;let l=t.format("YYYY-MM-DD");return o().utc(l,"YYYY-MM-DD")}return i?o().isDayjs(e)?l?e.utcOffset(ex(l)):e:n?o()(e).utcOffset(0):l?o()(e).utcOffset(ex(l)):o()(e):o()(e)},eg=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Array.isArray(e)?e.map(e=>ef(e,t)):e?ef(e,t):e},ev=(e,t)=>"year"===t?e.format("YYYY")+"-01-01T00:00:00.000Z":"month"===t||"quarter"===t?e.format("YYYY-MM")+"-01T00:00:00.000Z":e.format("YYYY-MM-DD")+"T00:00:00.000Z",ey=(e,t)=>e?Array.isArray(e)?e.map(e=>ev(e,t)):o().isDayjs(e)?ev(e,t):void 0:e,eb=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{showTime:l,gmt:n,picker:r}=t;return e?l?n?ep(e):eh(e):ey(e,r):e};function ex(e){if(!r().isString(e))return e;let t=/([+-]|\d\d)/gi,l=/Z|[+-]\d\d(?::?\d\d)?/gi,n=/[+-]?\d+(\.\d{1,3})?/,i=(e||"").match(l);if(null===i&&(i=(e||"").match(n)),null===i)return null;let o=((i[i.length-1]||[])+"").match(t)||["-",0,0],a=+(60*Number(o[1]))+ew(o[2]);return 0===a?0:"+"===o[0]?a:-a}function ew(e){let t=+e,l=0;return 0!==t&&isFinite(t)&&(l=eS(t)),l}function eS(e){return e<0?Math.ceil(e)||0:Math.floor(e)}let eM=e=>{switch(e){case"week":return"YYYY[W]W";case"month":return"YYYY-MM";case"quarter":return"YYYY[Q]Q";case"year":return"YYYY";default:return"YYYY-MM-DD"}},eA=(e,t,l,n)=>"date"===e&&l?`${t} ${n||"HH:mm:ss"}`:t;function eF(e){return/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(e)?"YYYY-MM-DD HH:mm:ss":/^\d{4}-\d{2}-\d{2}$/.test(e)?"YYYY-MM-DD":/^\d{4}-\d{2}$/.test(e)?"YYYY-MM":/^\d{4}$/.test(e)?"YYYY":/^\d{4}Q[1-4]$/.test(e)?"YYYY[Q]Q":/^\d{4}-\d{2}-\d{2}T/.test(e)?"YYYY-MM-DDTHH:mm:ss.SSSZ":null}let ek=(e,t)=>{Array.isArray(e)?e.forEach(t):Object.keys(e).forEach(l=>{t(e[l],l)})},eC=(e,t,l)=>{if(!e)return l;let n=t.split("."),r=[],i=e,o=!1;for(let e=0;e<n.length;e++){let t=n[e];if(Array.isArray(i)){for(let t of(o=!0,i)){let i=eC(t,n.slice(e).join("."),l);r=r.concat(i)}break}if((null==i?void 0:i[t])===void 0)break;i=i[t],e===n.length-1&&r.push(i)}return 0===(r=r.filter(e=>void 0!==e)).length?l:o?r.filter(e=>null!==e):r[0]};var eP=l(88835),ej=l(60639),eE=l.n(ej),eR=l(79441);let eI=l.n(eR)()();function eT(e){if(!e)return!1;let t=[e.$and,e.$or].filter(Boolean);return 0==t.length?Object.keys(e).length>0:t.some(e=>{if(Array.isArray(e))return e.some(eT);if(e.$and||e.$or)return eT(e);let[t]=Object.keys(e);if(!t||!e[t])return!1;let[l]=Object.keys(e[t]);return!!l&&void 0!==e[t][l]})}function e_(e){let t=typeof e;return Array.isArray(e)?t="array":e instanceof Date?t="date":null===e&&(t="null"),t}function eD(e){let t=e.substr(2,e.length-4).trim(),l=t.indexOf(":");return -1!==l?{key:t.substr(0,l),defaultValue:t.substr(l+1)}:{key:t}}function eN(e,t){return e.parameters=Array.from(new Map(t.map(e=>[e.key,e])).values()),e}function eO(e){switch(e_(e)){case"string":return e$(e);case"object":return eB(e);case"array":return eL(e);default:return eN(function(){return e},[])}}Object.keys(eI).forEach(function(e){eE().registerHelper(e,eI[e])}),eE().registerHelper("json",function(e){return JSON.stringify(e)}),eE().registerHelper("urlParse",function(e){try{return JSON.stringify(eP.parse(e))}catch(t){return`Invalid URL: ${e}`}}),eE().registerHelper("dateFormat",(e,t,l)=>"string"==typeof l?o()(e).tz(l).format(t):o()(e).format(t)),eE().registerHelper("isNull",e=>r().isNull(e));let e$=(()=>{let e=/{{(\w|:|[\s-+.,@/()?=*_$])+}}/g;return t=>{let l=[],r=e=>t,i=t.match(e);return i&&(l=i.map(eD),r=e=>(e=e||{},i.reduce((r,o,a)=>{let s=l[a],d=(0,n.get)(e,s.key);return(void 0===d&&(d=s.defaultValue),"function"==typeof d&&(d=d()),1===i.length&&t.startsWith("{{")&&t.endsWith("}}"))?d:(d instanceof Date&&(d=d.toISOString()),r.replace(o,null==d?"":d))},t))),eN(r,l)}})();function eB(e){let t=Object.keys(e).map(t=>({keyTemplate:e$(t),valueTemplate:eO(e[t])}));return eN(e=>t.reduce((t,l)=>(t[l.keyTemplate(e)]=l.valueTemplate(e),t),{}),t.reduce((e,t)=>e.concat(t.valueTemplate.parameters,t.keyTemplate.parameters),[]))}function eL(e){let t=e.map(eO);return eN(e=>t.map(t=>t(e)),t.reduce((e,t)=>e.concat(t.parameters),[]))}let eV=function(e){for(var t=arguments.length,l=Array(t>1?t-1:0),n=1;n<t;n++)l[n-1]=arguments[n];console.error(e,...l)};var eq=l(14744),ez=l.n(eq);let eK=(e,t,l)=>t;function eU(e,t,l){return ez()(e,t,{arrayMerge:eK,...l})}var eW=l(98892);let eH=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3;eW.Ay[t]({message:e,duration:l})};var eG=l(5062),eY=l(85738);function eJ(e,t){if(null==e||""===e)return"";let l=(0,eG.i5)(t);return(0,eY.Mg)(String(e),".",l)}var eX=l(63560),eQ=l.n(eX),eZ=l(95093),e0=l.n(eZ);let e1=/^\s*\{\{([\s\S]*)\}\}\s*$/;function e2(e){return e&&e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function e5(e){return e}function e4(e,t){let l=(t=t||{}).delimiter||".",n=t.maxDepth,i=t.transformKey||e5,o=t.transformValue||e5,a={};function s(e,d,u){u=u||1,r().isObjectLike(e)&&Object.keys(e).forEach(function(r){var c;let p=e[r],h=t.safe&&Array.isArray(p),m=Object.prototype.toString.call(p),f=e2(p),g="[object Object]"===m||"[object Array]"===m,v=d?d+l+i(r):i(r);if(null==(c=t.breakOn)?void 0:c.call(t,{key:r,value:p,path:v})){a[v]=o(p,v);return}if(!h&&!f&&g&&Object.keys(p).length&&(!t.maxDepth||u<n))return s(p,v,u+1);a[v]=o(p,v)})}return s(e),a}function e8(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l={},n=t.transformValue||e5;for(let t of Object.keys(e))eQ()(l,t,n(e[t],t));return l}let e3=e=>{let t=e.split(".").pop()||"";return t.startsWith("$")||(t=""),{operator:t}},e6=e=>["$dateOn","$dateNotOn","$dateBefore","$dateAfter","$dateNotBefore","$dateNotAfter","$dateBetween"].includes(e);function e9(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function e7(e){return(null==e?void 0:e.type)==="dateOnly"||(null==e?void 0:e.type)==="datetimeNoTz"||(null==e?void 0:e.constructor.name)==="DateOnlyField"||(null==e?void 0:e.constructor.name)==="DatetimeNoTzField"}let te=(e,t)=>e?(e.type&&(e=L({...e,timezone:t})),Array.isArray(e))?(2===e.length?e.push("[]",t):3===e.length&&e.push(t),e):"string"==typeof e?!t||/(\+|-)\d\d:\d\d$/.test(e)?e:e+t:e9(e)?e.toISOString():void 0:null,tt=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=new Set,n=t.vars||{},r=t.timezone,i=t.now,o=t.getField,a=e4(e,{breakOn(e){let{key:t}=e;return t.startsWith("$")&&"$and"!==t&&"$or"!==t},transformValue(e){if("string"!=typeof e)return e;let t=e1.exec(e);if(t){let e=t[1].trim();e.startsWith("$user")&&l.add(e.substring(6))}return e}});if(l.size>0){let e=await n.$user({fields:[...l.values()]});Object.assign(n,{$user:e})}return e8(a,{transformValue(e,t){let{operator:l}=e3(t);if("string"==typeof e){let a=e1.exec(e);if(a){let s=eC(n,a[1].trim(),null),d=null==o?void 0:o(t);e="function"==typeof s?null==s?void 0:s({field:d,operator:l,timezone:r,now:i}):s}}if(e6(l)){let l=null==o?void 0:o(t);return e7(l)?e.type?L({...e,timezone:(null==l?void 0:l.timezone)||r}):e:te(e,(null==l?void 0:l.timezone)||r)}return e}})};function tl(e){let{now:t,timezone:l="+00:00",offset:n}=e,r=tn(t).utcOffset(ex(l));return n>0?[(r=r.add(1,"day").startOf("day")).format("YYYY-MM-DD"),r.clone().add(n,"day").startOf("day").format("YYYY-MM-DD"),"[)",l]:[r.clone().subtract(-1*n-1,"day").startOf("day").format("YYYY-MM-DD"),r.clone().add(1,"day").startOf("day").format("YYYY-MM-DD"),"[)",l]}function tn(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e?o().isDayjs(e)?e:t?e0()(e):o()(e):t?e0()():o()()}function tr(e){var t;let{now:l,unit:n,timezone:r="+00:00",offset:i}=e,o=tn(l,"isoWeek"===n);o=(o=o.utcOffset(ex(r))).startOf(n),i>0?o=o.add(i,n):i<0&&(o=o.subtract(-1*i,n));let a={year:()=>o.format("YYYY"),quarter:()=>o.format("YYYY[Q]Q"),month:()=>o.format("YYYY-MM"),week:()=>o.format("gggg[w]ww"),isoWeek:()=>o.format("GGGG[W]WW"),day:()=>o.format("YYYY-MM-DD")},s=null==(t=a[n])?void 0:t.call(a);return r?s+r:s}let ti=(e,t)=>l=>{let{now:n,timezone:r,field:i}=l;return(null==i?void 0:i.timezone)&&(r=null==i?void 0:i.timezone),tr({now:n,timezone:r,unit:e,offset:t})},to=e=>t=>{let{now:l,timezone:n,field:r}=t;return(null==r?void 0:r.timezone)&&(n=null==r?void 0:r.timezone),tl({now:l,timezone:n,offset:e})};function ta(){return{now:new Date().toISOString(),today:ti("day"),yesterday:ti("day",-1),tomorrow:ti("day",1),thisWeek:ti("week"),lastWeek:ti("week",-1),nextWeek:ti("week",1),thisIsoWeek:ti("isoWeek"),lastIsoWeek:ti("isoWeek",-1),nextIsoWeek:ti("isoWeek",1),thisMonth:ti("month"),lastMonth:ti("month",-1),nextMonth:ti("month",1),thisQuarter:ti("quarter"),lastQuarter:ti("quarter",-1),nextQuarter:ti("quarter",1),thisYear:ti("year"),lastYear:ti("year",-1),nextYear:ti("year",1),last7Days:to(-7),next7Days:to(7),last30Days:to(-30),next30Days:to(30),last90Days:to(-90),next90Days:to(90)}}function ts(e){let t=e.split(".");return[t.shift(),t.join(".")]}var td=l(50467);class tu{register(e,t){if(!this.options.override&&this.map.has(e))throw Error(`this registry does not allow to override existing keys: "${e}"`);this.map.set(e,t)}get(e){return this.map.get(e)}getKeys(){return this.map.keys()}getValues(){return this.map.values()}getEntities(){return this.map.entries()}constructor(e={override:!1}){(0,td._)(this,"map",new Map),(0,td._)(this,"options",void 0),this.options=e}}l(67980);let tc=Symbol.for("nocobase.utils.sesLockdown"),tp=Symbol.for("nocobase.utils.bufferOverrides"),th=["globalThis","global","self","Function","AsyncFunction","GeneratorFunction","eval","Compartment","lockdown","harden","assert"];function tm(e){return!!e&&"object"==typeof e&&(e.message||"").includes("(SES_ALREADY_LOCKED_DOWN)")}function tf(){let e=globalThis;if(e[tp])return;let t=e.Buffer;if(!t||!t.prototype)return;let l=t.prototype;for(let e of Reflect.ownKeys(l)){let t=Object.getOwnPropertyDescriptor(l,e);if(!t||"function"!=typeof t.value||!t.configurable)continue;let n=t.value,r=function(){return n},i=function(t){if(this===l)throw TypeError(`Cannot assign to read only property '${String(e)}' of object 'Buffer.prototype'`);Object.defineProperty(this,e,{configurable:!0,enumerable:!0,writable:!0,value:t})};Object.defineProperty(r,"originalValue",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(l,e,{configurable:t.configurable,enumerable:t.enumerable,get:r,set:i})}e[tp]=!0}function tg(e){tf();let t=globalThis;if(!t[tc]){if("function"!=typeof lockdown)throw Error("SES lockdown is unavailable in the current runtime environment.");try{lockdown(e)}catch(e){if(!tm(e))throw e}t[tc]=!0}}function tv(e,t){return t?`{{t(${JSON.stringify(e)}, ${JSON.stringify(t)})}}`:`{{t(${JSON.stringify(e)})}}`}var ty=l(65606);let tb=e=>{for(;e;){var t;if("root"===e.id||(null==(t=e.classList)?void 0:t.contains("nb-action")))return!1;e=e.parentNode}return!ty.env.__TEST__};function tx(e,t){return e.replace(/\{\{(\w+)\}\}/g,function(e,l){return void 0!==t[l]?t[l]:e})}let tw=36,tS="";for(;tw--;)tS+=tw.toString(36);function tM(e){let t="",l=e||11;for(;l--;)t+=tS[36*Math.random()|0];return t}function tA(e){let t;try{t=new URL(e)}catch(e){return!1}return"http:"===t.protocol||"https:"===t.protocol}var tF=l(27153),tk="2.1.33";let tC=(e,t)=>{if(!e)return e;if("Grid"!==e["x-component"])return Object.keys(e.properties||{}).forEach(l=>{e.properties[l]=tC(e.properties[l],t)}),e;let l=e.parent;e=e.toJSON?e.toJSON():r().cloneDeep(e);let n={},{properties:i={}}=e,o=0;if(Object.keys(i).forEach((e,l)=>{let a=i[e];if("Grid.Row"!==a["x-component"]){a["x-index"]=++o,n[e]=a;return}if(a.properties){if(1===Object.keys(a.properties).length){a["x-index"]=++o,n[e]=a;return}Object.keys(a.properties).forEach((l,i)=>{let s=a.properties[l];if(r().set(s,"x-component-props.width",100),0===i){a["x-index"]=++o,n[e]=a;return}null!=t&&t(s)||(delete a.properties[l],n[`${tM()}_${l}`]=tP(s,l,++o))})}}),e.properties=n,l){let t=new tF.S(e,l);return l.properties&&Object.keys(l.properties).forEach(n=>{n===e.name&&(l.properties[n]=t)}),t}return e};function tP(e,t,l){return{type:"void",version:"2.0","x-component":"Grid.Row","x-app-version":tk,"x-uid":tM(),"x-async":!1,"x-index":l,_isJSONSchemaObject:!0,properties:{[t]:e}}}function tj(e){let t=new Set,l=e=>{if("string"==typeof e){let l,n=/\{\{\s*([^}]+?)\s*\}\}/g;for(;null!==(l=n.exec(e));){let e,n,r=l[1],i=/ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*)/g;for(;null!==(e=i.exec(r));)t.add(e[1]);let o=/ctx\[\s*(["'])\s*([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\1\s*\]/g;for(;null!==(n=o.exec(r));)t.add(n[2])}}else Array.isArray(e)?e.forEach(l):e&&"object"==typeof e&&Object.values(e).forEach(l)};return l(e),t}function tE(e){let t={},l=e=>{if("string"==typeof e){let l,n=/\{\{\s*([^}]+?)\s*\}\}/g;for(;null!==(l=n.exec(e));){let e,n,r=l[1],i=/ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*)([^\s)]*)/g;for(;null!==(e=i.exec(r));){let l=e[1],n=e[2]||"";if(t[l]=t[l]||[],n.startsWith("."))t[l].push(n.slice(1));else if(n.startsWith("[")){let e=n.match(/^\[\s*(["'])\s*([^'"\]]+)\s*\1\s*\](.*)$/);if(e){let n=e[2],r=e[3]||"";t[l].push(`${n}${r}`)}else{let e=n.match(/^\[(\d+)\](.*)$/);if(e){let n=e[1],r=e[2]||"";t[l].push(`[${n}]${r}`)}}}else n.startsWith("(")&&!t[l].length&&t[l].push("")}let o=/ctx\[\s*(["'])\s*([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\1\s*\]([^\s)]*)/g;for(;null!==(n=o.exec(r));){let e=n[2],l=n[3]||"";if(t[e]=t[e]||[],l.startsWith("."))t[e].push(l.slice(1));else if(l.startsWith("[")){let n=l.match(/^\[\s*(["'])\s*([^'"\]]+)\s*\1\s*\](.*)$/);if(n){let l=n[2],r=n[3]||"";t[e].push(`${l}${r}`)}else{let n=l.match(/^\[(\d+)\](.*)$/);if(n){let l=n[1],r=n[2]||"";t[e].push(`[${l}]${r}`)}}}else l.startsWith("(")&&!t[e].length&&t[e].push("")}}}else Array.isArray(e)?e.forEach(l):e&&"object"==typeof e&&Object.values(e).forEach(l)};return l(e),t}let tR=new(l(23155)).HX;function tI(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t={};for(let l of e){let e=l.replace(/^ctx\./,"").split("."),n=t;for(let t=0;t<e.length;t++){let r=e[t];t===e.length-1?n[r]=`{{${l}}}`:(n[r]=n[r]||{},n=n[r])}}return t}async function tT(e){return tI(await tR.fullVariables(e))}async function t_(e,t){return await tR.parseAndRender(e,{ctx:t})}function tD(e){let t=1,l={};return{sql:e.replace(/{{\s*([^}]+)\s*}}/g,(e,n)=>{let r=`__var${t}`;return l[r]=`{{${n.trim()}}}`,t++,`$${r}`}),bind:l}}async function tN(e){let{sql:t,bind:l}=tD(e),n=await tT(t);return{sql:t,bind:l,liquidContext:n}}},59598(){},23005(){},14892(){},2813(){},9845(){}};import{__webpack_require__}from"./runtime-72080663.js";var __webpack_exec__=function(e){return __webpack_require__(__webpack_require__.s=e)};import*as __rspack_chunk_1 from"./vendor-antd-ecosystem-de737eca.js";__webpack_require__.C(__rspack_chunk_1);import*as __rspack_chunk_2 from"./vendor-moment-84b317dc.js";__webpack_require__.C(__rspack_chunk_2);import*as __rspack_chunk_3 from"./vendor-lodash-905dd3b8.js";__webpack_require__.C(__rspack_chunk_3);import*as __rspack_chunk_4 from"./vendor-ses-b7bccbcd.js";__webpack_require__.C(__rspack_chunk_4);import*as __rspack_chunk_5 from"./vendor-antd-icons-97ed2369.js";__webpack_require__.C(__rspack_chunk_5);import*as __rspack_chunk_6 from"./vendor-antd-f8c3ace1.js";__webpack_require__.C(__rspack_chunk_6);import*as __rspack_chunk_7 from"./8384-4b58de2e.js";__webpack_require__.C(__rspack_chunk_7);import*as __rspack_chunk_8 from"./index-693e6f0a.js";__webpack_require__.C(__rspack_chunk_8),__webpack_exec__(35963);
|
|
1714
|
+
${p}`}async function ti(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l="string"==typeof e?e:String(e??""),n=!!t.preprocessTemplates,r=n?eK.withTemplates:eK.withoutTemplates,i=eU(r,l);if(i)return await i;let o=(async()=>{if(!n)return tt(await (0,e_.W)(l));let e=tr(l,{processStringLiterals:!1});return tt(tr(await (0,e_.W)(e),{processBarePlaceholders:!1}))})();eW(r,l,o,ez);try{return await o}catch(e){throw r.delete(l),e}}var to=l(62572);function ta(e){if(Array.isArray(e)){let t=e.map(e=>ta(e)).filter(e=>void 0!==e);return t.length?t:void 0}if(e&&"object"==typeof e){let t={};return Object.keys(e).forEach(l=>{let n=ta(e[l]);void 0!==n&&(t[l]=n)}),Object.keys(t).length?t:void 0}return null==e||"string"==typeof e&&""===e?void 0:e}let ts=e=>"string"==typeof e.on?"beforeRender"===e.on:"object"==typeof e.on?"beforeRender"===e.on.eventName:!e.on&&!0!==e.manual;var td=l(47684);let tu="0123456789abcdefghijklmnopqrstuvwxyz";function tc(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:11,l="";for(let e=0;e<t;e++)l+=tu[Math.random()*tu.length|0];return`${e}${l}`}},49773(e,t,l){l.d(t,{W:()=>n});async function n(e){if(!/<[A-Za-z]|<\//.test(e))return e;try{var t;let n=await l.e("7761").then(l.bind(l,1608)),r=(null==n?void 0:n.transform)||(null==n||null==(t=n.default)?void 0:t.transform);if("function"!=typeof r)return e;let i=r(e,{transforms:["jsx"],jsxPragma:"ctx.React.createElement",jsxFragmentPragma:"ctx.React.Fragment",disableESTransforms:!0,production:!0});return(i&&(i.code||(null==i?void 0:i.output)))??e}catch(t){return e}}},81982(e,t,l){l.d(t,{M:()=>h,gG:()=>o,mv:()=>a,o4:()=>p});var n=l(40542),r=l(2543),i=l.n(r);async function o(e,t){if(!e)return{};if("function"==typeof e)try{return await e(t)||{}}catch(e){return console.error("Error resolving defaultParams function:",e),{}}return e}async function a(e,t,l){if(!e)return{};if("function"==typeof e)try{return await e(t,l)||{}}catch(e){return console.error("Error resolving createModelOptions function:",e),{}}return e}let s={queue:[],timer:null,inflightByRun:new Map},d=10;function u(e){if(Array.isArray(e))return e.map(u);if(i().isPlainObject(e)){let t=Object.entries(e).map(e=>{let[t,l]=e;return[t,u(l)]});return Object.fromEntries(i().sortBy(t,e=>{let[t]=e;return t}))}return e}function c(e){try{return JSON.stringify(u(e))}catch{try{return JSON.stringify(e)}catch{return String(e)}}}function p(e,t){let l,n,r=s,i=e.runId||"GLOBAL",o=c(t),a=r.inflightByRun.get(i);a||(a=new Map,r.inflightByRun.set(i,a));let u=a.get(o);if(u)return u;let p=new Promise((e,t)=>{l=e,n=t});a.set(o,p);let h={id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,ctx:e,payload:t,resolve:l,reject:n,runId:i,dedupKey:o};r.queue.push(h);let m=async()=>{var t,l,n,i,o,a;let s=r.queue.splice(0,r.queue.length);if(r.timer=null,!s.length)return;let d=null==(t=s[0].ctx)?void 0:t.api;if(!d){for(let e of s)try{e.resolve(e.payload.template)}catch(t){e.reject(t)}finally{null==(l=r.inflightByRun.get(e.runId))||l.delete(e.dedupKey)}return}try{let e=s.map(e=>({id:e.id,template:e.payload.template,contextParams:e.payload.contextParams||{}})),t=await d.request({method:"POST",url:"variables:resolve",data:{values:{batch:e}}}),l=t.data??t,i=l.data??l,o=null==i?void 0:i.results,a=Array.isArray(o)?o:Array.isArray(i)?i:[],u=new Map;for(let e of a){let t=(null==e?void 0:e.id)!=null?String(e.id):"";t&&u.set(t,null==e?void 0:e.data)}for(let e of s)try{let t=String(e.id),l=u.has(t)?u.get(t):e.payload.template;e.resolve(l)}catch(t){e.reject(t)}finally{null==(n=r.inflightByRun.get(e.runId))||n.delete(e.dedupKey)}}catch(t){for(let l of s)try{null==e||null==(o=e.logger)||null==(i=o.warn)||i.call(o,{err:t},"variables:resolve(batch) failed, fallback"),l.resolve(l.payload.template)}catch(e){l.reject(e)}finally{null==(a=r.inflightByRun.get(l.runId))||a.delete(l.dedupKey)}}};return r.timer||(r.timer=setTimeout(m,d)),p}async function h(e,t){let l=async e=>{if("string"==typeof e&&/\{\{.*?\}\}/.test(e))return await g(e,t);if(Array.isArray(e))return Promise.all(e.map(l));if(e&&"object"==typeof e){let t={};for(let[n,r]of Object.entries(e))t[n]=await l(r);return t}return e};return l(e)}async function m(e,t){let l=await f(e.trim(),t),n=await t.runjs(`return ${l}`,{t:t.t});return(null==n?void 0:n.success)?n.value:void 0}async function f(e,t){let l,n=/ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*(?:(?:\.[a-zA-Z_$][a-zA-Z0-9_$]*)|(?:\[[^\]]+\]))*)(?!\s*\()/g,r=[],i=new Set;for(;null!==(l=n.exec(e));){let e=l[0],t=l[1],n=t.match(/^([a-zA-Z_$][a-zA-Z0-9_$]*)/);if(n){let l=n[1],o=t.substring(l.length);r.push({fullPath:e,firstKey:l,restPath:o}),i.add(l)}}if(0===r.length)return e;let o=new Map;for(let e of i)try{let l=await t[e],n=l&&!0===l.__isRecordProxy__;o.set(e,n)}catch(t){o.set(e,!1)}r.sort((e,t)=>t.fullPath.length-e.fullPath.length);let a=e;for(let{fullPath:e,firstKey:t,restPath:l}of r){let n,r=o.get(t)||!1;n=""===l?`await ctx.${t}`:r?`await (await ctx.${t})${l}`:`(await ctx.${t})${l}`;let i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),s=RegExp(`\\b${i}\\b`,"g");a=a.replace(s,n)}return a}async function g(e,t){let l=e=>{let t=e.trim().match(/^ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*)(?:\.([a-zA-Z_$][a-zA-Z0-9_$-]*(?:\.[a-zA-Z_$][a-zA-Z0-9_$-]*)*))?$/);return t?t[2]?`${t[1]}.${t[2]}`:t[1]:null},r=async e=>{let l=e.split("."),r=l.shift();if(!r)return;let i=await t[r];return 0===l.length?i:(0,n.D)(i,l.join("."))},i=async e=>{let n=l(e);if(n){let l=await r(n);return void 0===l&&n.includes("-")?await m(e,t):l}return await m(e,t)},o=e.match(/^\s*\{\{\s*([^{}]+?)\s*\}\}\s*$/);if(o){let e=o[1];return await i(e)}let a=[...e.matchAll(/\{\{\s*(.+?)\s*\}\}/g)],s=e;for(let[e,t]of a){let l=await i(t);if(void 0!==l){let t="object"==typeof l&&null!==l?JSON.stringify(l):String(l);s=s.replace(e,t)}}return s}},47684(e,t,l){function n(e,t){if(!e||"string"!=typeof e)throw Error("invalid url");let l=e.trim();if(l.startsWith("http://")||l.startsWith("https://"))return l;let n=window.__esm_cdn_base_url__||"https://esm.sh",r=(null==t?void 0:t.addSuffix)&&window.__esm_cdn_suffix__||"",i=n.replace(/\/$/,""),o=l.replace(/^\//,"");if(null==t?void 0:t.raw){let e=o.includes("?")?"&":"?";return`${i}/${o}${e}raw`}return`${i}/${o}${r}`}function r(e){return!!e&&"string"==typeof e&&e.split("?")[0].split("#")[0].endsWith(".css")}l.d(t,{i:()=>n,y:()=>r})},51143(e,t,l){function n(){var e,t;let l=globalThis;if((null==(e=l.__nocobaseRunJSSafeGlobalsRegistry)?void 0:e.windowAllow)&&(null==(t=l.__nocobaseRunJSSafeGlobalsRegistry)?void 0:t.documentAllow))return l.__nocobaseRunJSSafeGlobalsRegistry;let n={windowAllow:new Set,documentAllow:new Set};return l.__nocobaseRunJSSafeGlobalsRegistry=n,n}function r(e){if(!e)return;let t=n();for(let l of e){if("string"!=typeof l)continue;let e=l.trim();e&&t.windowAllow.add(e)}}function i(e){if(!e)return;let t=n();for(let l of e){if("string"!=typeof l)continue;let e=l.trim();e&&t.documentAllow.add(e)}}function o(e){return n().windowAllow.has(e)}function a(e){return n().documentAllow.has(e)}function s(e){let t=()=>`${window.location.origin}${window.location.pathname}`,l=(e,l,n)=>{if(!(e=>{try{let l=new URL(e,t()),n=l.protocol.toLowerCase();if("about:"===n)return"about:blank"===l.href;return"http:"===n||"https:"===n}catch{return!1}})(e))throw Error("Unsafe URL: window.open only allows http/https/about:blank.");let r="_blank",i=(e=>{let t=new Set;return e&&e.split(",").map(e=>e.trim()).filter(Boolean).forEach(e=>{let l=e.split("=")[0].trim().toLowerCase();"noopener"!==l&&"noreferrer"!==l&&t.add(e)}),t.add("noopener"),t.add("noreferrer"),Array.from(t).join(",")})(n),o=window.open.call(window,e,r,i);if(o&&"opener"in o)try{o.opener=null}catch{}return o},n=(e,n)=>{let r=new URL(e,t()),i=r.protocol.toLowerCase(),o="about:"===i&&"about:blank"===r.href;if("http:"!==i&&"https:"!==i&&!o)throw Error("Unsafe URL: only http/https/about:blank are allowed.");if(o)return(null==n?void 0:n.replace)?window.location.replace("about:blank"):window.location.assign("about:blank");if(r.protocol===window.location.protocol&&r.hostname===window.location.hostname&&r.port===window.location.port)return(null==n?void 0:n.replace)?window.location.replace(r.href):window.location.assign(r.href);if(!l(r.href))throw Error("Popup blocked: cross-origin navigation is opened in a new tab.")},r=new Proxy({},{get(e,t){switch(t){case"origin":return window.location.origin;case"protocol":return window.location.protocol;case"host":return window.location.host;case"hostname":return window.location.hostname;case"port":return window.location.port;case"pathname":return window.location.pathname;case"assign":return e=>n(e,{replace:!1});case"replace":return e=>n(e,{replace:!0});case"reload":return window.location.reload.bind(window.location);case"href":throw Error("Reading location.href is not allowed.");default:throw Error(`Access to location property "${t}" is not allowed.`)}},set(e,t,l){if("href"===t)return n(String(l),{replace:!1}),!0;throw Error("Mutation on location is not allowed.")}}),i={setTimeout:window.setTimeout.bind(window),clearTimeout:window.clearTimeout.bind(window),setInterval:window.setInterval.bind(window),clearInterval:window.clearInterval.bind(window),console,Math,Date,FormData,..."u">typeof Blob?{Blob}:{},..."u">typeof URL?{URL}:{},addEventListener:addEventListener.bind(window),open:l,location:r,...e||{}};return new Proxy(Object.create(null),{get(e,t){if("string"!=typeof t)return Reflect.get(e,t);if(t in i)return i[t];if(Object.prototype.hasOwnProperty.call(e,t))return e[t];if(o(t)){let e=window[t];return"function"==typeof e?e.bind(window):e}throw Error(`Access to global property "${t}" is not allowed.`)},set(e,t,l){if("string"!=typeof t)return Reflect.set(e,t,l),!0;if(t in i)throw Error(`Mutation of global property "${t}" is not allowed.`);return e[t]=l,!0},has:(e,t)=>"string"!=typeof t?Reflect.has(e,t):!!(t in i||Object.prototype.hasOwnProperty.call(e,t)||o(t))})}function d(e){let t={createElement:document.createElement.bind(document),querySelector:document.querySelector.bind(document),querySelectorAll:document.querySelectorAll.bind(document),...e||{}};return new Proxy(Object.create(null),{get(e,l){if("string"!=typeof l)return Reflect.get(e,l);if(l in t)return t[l];if(Object.prototype.hasOwnProperty.call(e,l))return e[l];if(a(l)){let e=document[l];return"function"==typeof e?e.bind(document):e}throw Error(`Access to document property "${l}" is not allowed.`)},set(e,l,n){if("string"!=typeof l)return Reflect.set(e,l,n),!0;if(l in t)throw Error(`Mutation of document property "${l}" is not allowed.`);return e[l]=n,!0},has:(e,l)=>"string"!=typeof l?Reflect.has(e,l):!!(l in t||Object.prototype.hasOwnProperty.call(e,l)||a(l))})}function u(e){var t;let l="u">typeof window&&window.navigator||void 0,n={},r=null==l||null==(t=l.clipboard)?void 0:t.writeText;"function"==typeof r&&(n.writeText=r.bind(l.clipboard));let i={clipboard:n};return Object.defineProperty(i,"onLine",{get:()=>!!(null==l?void 0:l.onLine),enumerable:!0,configurable:!1}),Object.defineProperty(i,"language",{get:()=>null==l?void 0:l.language,enumerable:!0,configurable:!1}),Object.defineProperty(i,"languages",{get:()=>(null==l?void 0:l.languages)?[...l.languages]:void 0,enumerable:!0,configurable:!1}),Object.assign(i,e||{}),new Proxy({},{get(e,t){if(t in i)return i[t];throw Error(`Access to navigator property "${String(t)}" is not allowed.`)}})}function c(e){let t={};try{let e=u();t.navigator=e;try{t.window=s({navigator:e})}catch{}}catch{}try{t.document=d()}catch{}return e?{...t,...e}:t}async function p(e,t,l,n){if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.runjs)return e.runjs(t,c(n),l)}l.d(t,{D1:()=>u,I2:()=>c,Vm:()=>r,Xh:()=>d,_:()=>p,ey:()=>s,yz:()=>i})},22928(e,t,l){function n(e){let t={};return Object.entries(e||{}).forEach(e=>{let[l,n]=e;null!=n&&(t[l]=n)}),t}function r(e,t,l){try{var n,r,i,o,a;let s=null==(r=e.dataSourceManager)||null==(n=r.getDataSource)?void 0:n.call(r,t||"main"),d=null==s||null==(o=s.collectionManager)||null==(i=o.getCollection)?void 0:i.call(o,l);return(null==d||null==(a=d.getPrimaryKey)?void 0:a.call(d))||"id"}catch(e){return"id"}}function i(e,t){var l,i;if(!t)return;let o=t.dataSourceKey||"main",a=t.collection||(null==(l=t.record)?void 0:l.__collectionName);if(!a)return;let s=r(e,o,a)||"id",d=void 0!==t.filterByTk?t.filterByTk:void 0!==t.id?t.id:null==(i=t.record)?void 0:i[s];if(void 0!==d)return n({collection:a,filterByTk:d,dataSourceKey:o,associationName:t.associationName,sourceId:t.sourceId,fields:t.fields,appends:t.appends})}function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=e=>!!e&&"object"==typeof e&&"string"==typeof e.collection&&(void 0!==e.filterByTk||void 0!==e.id||e.record),n={},r=(t,o)=>{if(l(t)){let l=i(e,t);l&&(n[o.join(".")]=l);return}if(Array.isArray(t)){for(let e=0;e<t.length;e++)r(t[e],[...o,String(e)]);return}if(t&&"object"==typeof t){for(let[e,l]of Object.entries(t))r(l,[...o,e]);return}};return r(t,[]),Object.keys(n).length?n:void 0}l.d(t,{d:()=>o})},88439(e,t,l){l.d(t,{w:()=>n});function n(e,t,l,n){let r={},i={};for(let a in t)if(Object.prototype.hasOwnProperty.call(t,a)){let s=t[a],d={};if(s.uiSchema&&"object"==typeof s.uiSchema){for(let[e,t]of Object.entries(s.uiSchema))if(t&&"object"==typeof t){var o;let l=t;d[e]={type:l.type||"any",title:l.title||(null==(o=l["x-decorator-props"])?void 0:o.label)||e,interface:l["x-component"],uiSchema:l}}}let u=Object.keys(d).length>0;i[a]={type:"object",title:e.t(s.title)||a,display:u?"default":"none",properties:u?{params:{type:"object",title:"Parameters",display:"flatten",properties:d}}:void 0},r[a]={get params(){return l.getStepParams(n,a)||{}},get uiSchema(){return s.uiSchema},result:void 0}}e.defineProperty("steps",{get:()=>r})}},73398(e,t,l){function n(e){let t=new Set,l=e=>{if("string"==typeof e){let l,n=/\{\{\s*([^}]+?)\s*\}\}/g;for(;null!==(l=n.exec(e));){let e,n,r=l[1],i=/ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*)/g;for(;null!==(e=i.exec(r));)t.add(e[1]);let o=/ctx\[\s*(["'])\s*([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\1\s*\]/g;for(;null!==(n=o.exec(r));)t.add(n[2])}}else Array.isArray(e)?e.forEach(l):e&&"object"==typeof e&&Object.values(e).forEach(l)};return l(e),t}function r(e){let t={},l=e=>{if("string"==typeof e){let l,n=/\{\{\s*([^}]+?)\s*\}\}/g;for(;null!==(l=n.exec(e));){let e,n,r=l[1],i=/ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*)([^\s)]*)/g;for(;null!==(e=i.exec(r));){let l=e[1],n=e[2]||"";if(t[l]=t[l]||[],n.startsWith("."))t[l].push(n.slice(1));else if(n.startsWith("[")){let e=n.match(/^\[\s*(["'])\s*([^'"\]]+)\s*\1\s*\](.*)$/);if(e){let n=e[2],r=e[3]||"";t[l].push(`${n}${r}`)}else{let e=n.match(/^\[(\d+)\](.*)$/);if(e){let n=e[1],r=e[2]||"";t[l].push(`[${n}]${r}`)}}}else n.startsWith("(")&&!t[l].length&&t[l].push("")}let o=/ctx\[\s*(["'])\s*([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\1\s*\]([^\s)]*)/g;for(;null!==(n=o.exec(r));){let e=n[2],l=n[3]||"";if(t[e]=t[e]||[],l.startsWith("."))t[e].push(l.slice(1));else if(l.startsWith("[")){let n=l.match(/^\[\s*(["'])\s*([^'"\]]+)\s*\1\s*\](.*)$/);if(n){let l=n[2],r=n[3]||"";t[e].push(`${l}${r}`)}else{let n=l.match(/^\[(\d+)\](.*)$/);if(n){let l=n[1],r=n[2]||"";t[e].push(`[${l}]${r}`)}}}else l.startsWith("(")&&!t[e].length&&t[e].push("")}}}else Array.isArray(e)?e.forEach(l):e&&"object"==typeof e&&Object.values(e).forEach(l)};return l(e),t}l.d(t,{xI:()=>m,vP:()=>y,$S:()=>f,pc:()=>g,Cg:()=>c,nN:()=>b,ju:()=>x,Xx:()=>h,vE:()=>p,XU:()=>u,UX:()=>v});var i=l(22928),o=l(35846),a=l(44476),s=l(2543),d=l.n(s);function u(e){var t,l,n,r;let i=e.resource,o=e.collection,a=e.record,s=(null==o?void 0:o.name)||(null==i||null==(t=i.getResourceName)?void 0:t.call(i)),d=(null==o?void 0:o.dataSourceKey)||(null==i||null==(l=i.getDataSourceKey)?void 0:l.call(i)),u=(null==i||null==(n=i.getFilterByTk)?void 0:n.call(i))??(null==o||null==(r=o.getFilterByTK)?void 0:r.call(o,a));if(!s||null==u)return;let c=String(s).split(".");return{collection:c[c.length-1],dataSourceKey:d,filterByTk:u}}function c(e){var t,l,n;let r=e.view;if(!r)return;let i=(null==r?void 0:r.inputArgs)||{},o=(null==i?void 0:i.collectionName)||(null==r||null==(t=r.record)?void 0:t.collection),a=(null==i?void 0:i.dataSourceKey)||(null==r||null==(l=r.record)?void 0:l.dataSourceKey)||"main",s=(null==i?void 0:i.filterByTk)||(null==r||null==(n=r.record)?void 0:n.filterByTk),d=null==i?void 0:i.associationName,u=null==i?void 0:i.sourceId;if(o&&null!=s)return{collection:o,dataSourceKey:a,filterByTk:s,sourceId:u,associationName:d}}function p(e,t){var l,n,r;let i=null==(l=e.inputArgs)?void 0:l.record,o=null==(n=e.collection)?void 0:n.filterTargetKey;if(!i||!o)return;let a=t.view,s=null==a||null==(r=a.inputArgs)?void 0:r.filterByTk,u=i[o];if(null!=s&&null!=u&&s===u)return d().cloneDeep(i)}function h(e,t){return l=>{var n,r,i,o;if(!("record"===l||l.startsWith("record.")))return!1;let s=t();if(!s)return!0;if("record"===l)return!1;let d=c(e),u=null==d?void 0:d.collection,p=(null==d?void 0:d.dataSourceKey)||"main";if(!u)return!0;let h=null==(r=e.dataSourceManager)||null==(n=r.getDataSource)?void 0:n.call(r,p),m=null==h||null==(o=h.collectionManager)||null==(i=o.getCollection)?void 0:i.call(o,u);if(!m)return!0;let f=(0,a.H)(()=>m,()=>s),g=l.startsWith("record.")?l.slice(7):"";return!!g&&f(g)}}function m(e,t){let l=(0,a.H)(e,()=>t());return n=>{let r=t();if(!r)return!0;if(!n)return!1;let i=e();if(!n.includes(".")){var o;let e,t=n;return i&&("function"==typeof i.getField&&(e=i.getField(t)),e||"function"!=typeof i.getFields||(e=(i.getFields()||[]).find(e=>(null==e?void 0:e.name)===t))),!!(null==e||null==(o=e.isAssociationField)?void 0:o.call(e))&&null==(null==r?void 0:r[t])}return l(n)}}async function f(e,t,l){let n=await (0,o.H)(e,t,!0)();return n?{...n,buildVariablesParams:e=>l?l(e):u(e)}:null}function g(e,t,l){let n=async()=>f(e,t,l);return n.title=t,n}function v(e,t,l){var n,r;return g(t,(null==l?void 0:l.title)?(null==(n=e.t)?void 0:n.call(e,l.title))||l.title:(null==(r=e.t)?void 0:r.call(e,"Current record"))||"Current record",e=>u(e))}let y=n,b=r;async function x(e,t){let l=Object.keys(r(t)||{});if(!l.length)return;let n={};for(let t of l){var o;let l,r=null==(o=e.getPropertyOptions)?void 0:o.call(e,t),i=null==r?void 0:r.meta;if(i){try{let t="function"==typeof i?await i():i,n=null==t?void 0:t.buildVariablesParams;"function"==typeof n&&(l=await n(e))}catch(e){continue}l&&(n[t]=l)}}return(0,i.d)(e,n)}},67778(e,t,l){l.d(t,{sp:()=>P,bt:()=>I,U:()=>el,N5:()=>K,xB:()=>B,mW:()=>$,fP:()=>G});var n=l(74848),r=l(96540),i=l(99418),o=l(11869),a=l(29007),s=l(52568),d=l(73398);function u(e){return null!=e}function c(e,t){if(e===t)return!0;if(!u(e)||!u(t))return!1;try{return JSON.stringify(e)===JSON.stringify(t)}catch(l){return String(e)===String(t)}}function p(e){var t;let l=null==e||null==(t=e.navigation)?void 0:t.viewStack;return Array.isArray(l)?l:[]}function h(e){var t;let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p(e);if(!l.length)return -1;let n=(null==e?void 0:e.inputArgs)||{},r=(null==e||null==(t=e.navigation)?void 0:t.viewParams)||{},i=n.viewUid??r.viewUid;if(!i)return l.length-1;let o=l.map((e,t)=>({item:e,index:t})).filter(e=>{let{item:t}=e;return(null==t?void 0:t.viewUid)===i});if(!o.length)return l.length-1;let a=["filterByTk","sourceId","tabUid"],s=o[o.length-1].index,d=-1;for(let{item:e,index:t}of o){let l=0,r=!0;for(let t of a)if(u(n[t])){if(!c(null==e?void 0:e[t],n[t])){r=!1;break}l+=1}r&&l>=d&&(s=t,d=l)}return s}function m(e,t){return t??e.view}function f(e){var t;if(!e)return!1;let l=p(e),n=null==e||null==(t=e.inputArgs)?void 0:t.openerUids,r=Array.isArray(n)&&n.length>0;return h(e,l)>=1||r}function g(e,t){let l=t=>e.t(t),n=function(){let l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e;return f(m(l,t))},r=async e=>{let l=m(e,t);if(!l||!f(l))return;let n=await v(e,l),r=null==n?void 0:n.resource;return(null==r?void 0:r.collectionName)&&null!=r.filterByTk?{collection:r.collectionName,dataSourceKey:r.dataSourceKey||"main",filterByTk:r.filterByTk,associationName:r.associationName,sourceId:r.sourceId}:(0,d.Cg)(e)},i=async()=>{var t,l,n,i;let o=await r(e);if(!(null==o?void 0:o.collection))return null;let a=null==(l=e.dataSourceManager)||null==(t=l.getDataSource)?void 0:t.call(l,o.dataSourceKey||"main");return(null==a||null==(i=a.collectionManager)||null==(n=i.getCollection)?void 0:n.call(i,o.collection))||null},o=async(l,n)=>{var r,i,o,a,s,d;try{let s=n||e,d=m(s,t),u=p(d),c=h(d,u);if(c<1||l<1)return;let f=c-l;if(f<1)return;let g=u[f];if(!(null==g?void 0:g.viewUid))return;let v=null==(r=s.engine)?void 0:r.getModel(g.viewUid,!0);if(!v)try{v=await s.engine.loadModel({uid:g.viewUid})}catch(t){null==(a=s.logger||e.logger)||null==(o=a.warn)||o.call(a,{err:t},"[FlowEngine] popup.getParentRecordRef loadModel failed")}let y=(null==v||null==(i=v.getStepParams)?void 0:i.call(v,"popupSettings","openView"))||{},b=null==y?void 0:y.collectionName,x=(null==y?void 0:y.dataSourceKey)||"main",w=(null==g?void 0:g.filterByTk)??(null==g?void 0:g.sourceId);if(!b||null==w)return;return{collection:b,dataSourceKey:x,filterByTk:w,sourceId:null==g?void 0:g.sourceId,associationName:null==y?void 0:y.associationName}}catch(t){null==(d=(null==n?void 0:n.logger)||e.logger)||null==(s=d.warn)||s.call(d,{err:t},"[FlowEngine] popup.getParentRecordRef failed");return}},a=l=>{try{let n=m(e,t),r=p(n);return h(n,r)-l>=1}catch(e){return!1}},s=t=>{let n=()=>({type:"object",title:l("Parent popup"),disabled:()=>!a(t),disabledReason:()=>a(t)?void 0:l("No parent popup"),hidden:()=>!a(t),properties:async()=>{let n=await o(t),r={};if(r.uid={type:"string",title:l("Popup uid")},n){let t=(()=>{try{var t,l,r,i;let o=null==(l=e.dataSourceManager)||null==(t=l.getDataSource)?void 0:t.call(l,n.dataSourceKey||"main");return(null==o||null==(i=o.collectionManager)||null==(r=i.getCollection)?void 0:r.call(i,n.collection||""))||null}catch(e){return null}})();r.record=await (0,d.$S)(()=>t,l("Popup record"),()=>n)||{type:"object",title:l("Popup record")}}else r.record={type:"object",title:l("Popup record")};return r.resource={type:"object",title:l("Data source"),properties:async()=>({dataSourceKey:{type:"string",title:l("Data source key")},collectionName:{type:"string",title:l("Collection name")},associationName:{type:"string",title:l("Association name")},filterByTk:{type:"string",title:l("filterByTk")},sourceId:{type:"string",title:l("sourceId")}})},r}});return n.title=l("Parent popup"),n},u=()=>({type:"object",title:l("Current popup"),disabled:()=>!n(),hidden:()=>!n(),buildVariablesParams:async e=>{var l,i,a,s;if(!n(e))return;let d=await r(e),u=m(e,t),c=null==u?void 0:u.inputArgs,f={};if(d){let e={...d};!e.associationName&&(null==c?void 0:c.associationName)&&(e.associationName=c.associationName),void 0===e.sourceId&&void 0!==(null==c?void 0:c.sourceId)&&(e.sourceId=null==c?void 0:c.sourceId),f.record=e}try{let t=p(u);if(h(u,t)>=2){let t=f,l=1,n=await o(l,e);for(;n;)t.parent||(t.parent={}),t.parent.record=n,t=t.parent,l+=1,n=await o(l,e)}}catch(t){null==(i=e.logger)||null==(l=i.debug)||l.call(i,{err:t},"[FlowEngine] buildVariablesParams: build parent-chain failed")}try{let e=null==c?void 0:c.sourceId,t=null==c?void 0:c.associationName,l=(null==c?void 0:c.dataSourceKey)||"main";if(null!=e&&""!==e&&t&&"string"==typeof t){let n=String(t).split(".")[0];n&&(f.sourceRecord={collection:n,dataSourceKey:l,filterByTk:e})}}catch(t){null==(s=e.logger)||null==(a=s.debug)||a.call(s,{err:t},"[FlowEngine] buildVariablesParams: infer sourceRecord failed")}return f},properties:async()=>{var n,a,u,c;let f={};if(f.uid={type:"string",title:l("Popup uid")},await r(e)){let e=async()=>{let e=await i();return e?await (0,d.$S)(()=>e,l("Current popup record"),e=>r(e)):null};e.title=l("Current popup record"),e.hasChildren=!0,f.record=e}try{let r=m(e,t),i=null==r?void 0:r.inputArgs,o=null==i?void 0:i.sourceId,s=null==i?void 0:i.associationName,u=(null==i?void 0:i.dataSourceKey)||"main";if(!s||"string"!=typeof s||!s.includes(".")){let t=p(r),l=h(r,t),i=l>=0?null==t?void 0:t[l]:void 0;if(null==i?void 0:i.viewUid){let t=null==e||null==(n=e.engine)?void 0:n.getModel(i.viewUid,!0);t||(t=await e.engine.loadModel({uid:i.viewUid}));let l=(null==t||null==(a=t.getStepParams)?void 0:a.call(t,"popupSettings","openView"))||{};s=(null==l?void 0:l.associationName)||s,u=(null==l?void 0:l.dataSourceKey)||u}}if(null!=o&&""!==o&&s&&"string"==typeof s){let t=String(s).includes(".")?String(s).split(".")[0]:void 0;if(t){let n=()=>{try{var l,n,r,i;let o=null==(n=e.dataSourceManager)||null==(l=n.getDataSource)?void 0:l.call(n,u);return(null==o||null==(i=o.collectionManager)||null==(r=i.getCollection)?void 0:r.call(i,t))||null}catch(e){return null}},r=await (0,d.$S)(n,l("Current popup parent record"),()=>({collection:t,dataSourceKey:u,filterByTk:o}));r&&(f.sourceRecord=r)}}}catch(t){null==(c=e.logger)||null==(u=c.debug)||u.call(c,{err:t},"[FlowEngine] popup.properties: build sourceRecord failed")}return f.resource={type:"object",title:l("Data source"),properties:async()=>({dataSourceKey:{type:"string",title:l("Data source key")},collectionName:{type:"string",title:l("Collection name")},associationName:{type:"string",title:l("Association name")},filterByTk:{type:"string",title:l("filterByTk")},sourceId:{type:"string",title:l("sourceId")}})},await o(1)&&(f.parent=s(1)),f}});return u.title=l("Current popup"),u.sort=975,u}async function v(e,t){var l;let n=p(t),r=h(t,n),i=null==t||null==(l=t.inputArgs)?void 0:l.openerUids,o=Array.isArray(i)&&i.length>0;if(!(r>=1||o))return;if(!n.length){let e=(null==t?void 0:t.inputArgs)||{};if(!(e.collectionName||null!=e.filterByTk||null!=e.sourceId||e.associationName||e.viewUid))return;return{uid:e.viewUid,resource:{dataSourceKey:e.dataSourceKey||"main",collectionName:e.collectionName,associationName:e.associationName,filterByTk:e.filterByTk,sourceId:e.sourceId}}}let a=async t=>{var l,r,i,o,s,d;if(t<0||!(null==(l=n[t])?void 0:l.viewUid))return;let u=n[t].viewUid,c=null==(r=e.engine)?void 0:r.getModel(u,!0);c||(c=await (null==(d=e.engine)?void 0:d.loadModel({uid:u})));let p=(null==c||null==(i=c.getStepParams)?void 0:i.call(c,"popupSettings","openView"))||{},h=null==p?void 0:p.collectionName,m={uid:u,resource:{dataSourceKey:(null==p?void 0:p.dataSourceKey)||"main",collectionName:h,associationName:null==p?void 0:p.associationName,filterByTk:null==(o=n[t])?void 0:o.filterByTk,sourceId:null==(s=n[t])?void 0:s.sourceId}},f=await a(t-1);return f&&(m.parent=f),m};return await a(r)}function y(e,t){let l=/^(?:record|sourceRecord)(?:\.|$)|^parent(?:\.parent)*(?:\.(?:record|sourceRecord))(?:\.|$)/;e.defineProperty("popup",{get:async()=>v(e,t),meta:g(e,t),resolveOnServer:e=>{try{return!!e&&l.test(e)}catch(e){return!1}}})}var b=l(18182);let x=(0,r.forwardRef)((e,t)=>{let{afterClose:l,footer:i,header:o,hidden:a,...s}=e,[d,u]=(0,r.useState)(!0),[c,p]=(0,r.useState)(s),[h,m]=(0,r.useState)(()=>i),[f,g]=(0,r.useState)(o);(0,r.useImperativeHandle)(t,()=>({destroy:()=>{u(!1),null==l||l()},update:e=>p(t=>({...t,...e})),setFooter:e=>{m(e)},setHeader:e=>{0===Object.values(e||{}).length?g(null):g(e)}}));let v={...c,title:(null==f?void 0:f.title)||c.title,extra:null==f?void 0:f.extra,footer:void 0!==h?h:c.footer??null},y=r.useMemo(()=>document.querySelector("#nocobase-app-container"),[]);return(0,n.jsx)(b.A,{closable:!1,rootClassName:a?"nb-hidden":"",getContainer:y,...v,open:d,onCancel:c.onCancel,afterClose:()=>{null==l||l()},children:c.children})});function w(){let[e,t]=r.useState([]);return[e,r.useCallback(e=>(t(t=>[...t,e]),()=>{t(t=>t.filter(t=>t!==e))}),[])]}var S=l(16639),M=l(20616),A=l(47451);async function F(e,t){var l;return!!t.force||!1!==await (null==(l=e.beforeClose)?void 0:l.call(e,t))}function k(e,t){var l;let n=null==t?void 0:t.layoutContext,r=null==t||null==(l=t.engine)?void 0:l.context;n instanceof a.cB&&n!==t&&n!==r&&e.addDelegate(n)}let C=0;function P(){let e=r.useRef(null),t=(t,l)=>{var u,c,p;let h,m,f=null==l?void 0:l.engine;C+=1;let g=r.createRef(),v=new Promise(e=>{m=e}),b=null,w=null,P=e=>{let{children:t}=e;return r.useEffect(()=>{var e;return b=t,null==(e=g.current)||e.setFooter(t),()=>{var e;b=null,null==(e=g.current)||e.setFooter(null)}},[t]),null},j=e=>(r.useEffect(()=>{var t;return w=e,null==(t=g.current)||t.setHeader(e),()=>{var e;w=null,null==(e=g.current)||e.setHeader(null)}},[e]),null),E=new a.cB,R=(0,A._)(l.engine),I=(0,S.eX)(f,R);E.defineProperty("engine",{value:R}),E.addDelegate(R.context),!1!==t.inheritContext?E.addDelegate(l):(E.addDelegate(l.engine.context),k(E,l));let T=!1,_={type:"dialog",inputArgs:t.inputArgs||{},preventClose:!!t.preventClose,beforeClose:void 0,destroy:e=>{var l,n,r,i;if(T)return;T=!0,null==(l=t.onClose)||l.call(t),null==(n=g.current)||n.destroy(),null==h||h(),null==m||m(e);let o=null==I?void 0:I.emitter;(0,S.Z8)(o),null==o||null==(i=o.emit)||i.call(o,S.B9,{type:"dialog",viewUid:null==_||null==(r=_.inputArgs)?void 0:r.viewUid}),R.unlinkFromStack()},update:e=>{var t;return null==(t=g.current)?void 0:t.update(e)},close:async(e,l)=>{var n,r;return(!t.preventClose||!!l)&&!!await F(_,{result:e,force:l})&&(t.triggerByRouter&&(null==(r=t.inputArgs)||null==(n=r.navigation)?void 0:n.back)?t.inputArgs.navigation.back():_.destroy(e),!0)},Footer:P,Header:j,setFooter:e=>{var t;b=e,null==(t=g.current)||t.setFooter(e)},setHeader:e=>{var t;w=e,null==(t=g.current)||t.setHeader(e)},navigation:null==(u=t.inputArgs)?void 0:u.navigation,get record(){return(0,d.vE)(l,E)}};E.defineProperty("view",{get:()=>_,resolveOnServer:(0,d.Xx)(E,()=>(0,d.vE)(l,E))}),R.setDestroyView(()=>{var e,l;t.triggerByRouter&&(null==(l=t.inputArgs)||null==(e=l.navigation)?void 0:e.back)&&t.inputArgs.navigation.back(),_.destroy()}),y(E,_);let D=(0,o.observer)(()=>{var e,l,o,a;let s=r.useRef(!1),d="function"==typeof t.content?t.content(_,E):t.content,u="string"==typeof d?(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:i.A.sanitize(d)}}):d;return(r.useEffect(()=>{var e;null==(e=t.onOpen)||e.call(t,_,E)},[]),(null==(l=t.inputArgs)||null==(e=l.hidden)?void 0:e.value)&&!s.current)?null:(s.current=!0,(0,n.jsx)(x,{className:"nb-dialog-overflow-hidden",ref:g,hidden:null==(a=t.inputArgs)||null==(o=a.hidden)?void 0:o.value,footer:b,header:w,...t,onCancel:()=>{_.close(t.result)},children:u}))},{displayName:"DialogWithContext"}),N=(null==t||null==(c=t.inputArgs)?void 0:c.viewUid)||`page-${C}`,O=(0,n.jsx)(M.I6,{engine:R,children:(0,n.jsx)(s.YQ,{context:E,children:(0,n.jsx)(D,{})})},N);return h=null==(p=e.current)?void 0:p.patchElement(O),Object.assign(v,_)},l=r.useMemo(()=>({open:t}),[]),u=r.memo(r.forwardRef((e,t)=>{let[l,i]=w();return r.useImperativeHandle(t,()=>({patchElement:i}),[i]),(0,n.jsx)(n.Fragment,{children:l})}));return[l,(0,n.jsx)(u,{ref:e},"dialog-holder")]}var j=l(97134),E=l(61793);let R=r.forwardRef((e,t)=>{var l;let{children:i,footer:o,title:a,extra:s,hidden:d,isMobile:u,...c}=e,[p,h]=r.useState(!0),[m,f]=r.useState(()=>o),[g,v]=r.useState({title:a,extra:s,...c.header});r.useImperativeHandle(t,()=>({destroy:()=>{h(!1)},update:e=>{Object.assign(c,e)},setFooter:e=>{f(e)},setHeader:e=>{0===Object.values(e||{}).length?v(null):v(e)}}),[]);let y=r.useMemo(()=>document.querySelector("#nocobase-app-container"),[]);return u?(0,n.jsx)(E.D,{className:d?"nb-hidden":"",visible:p,...c,footer:m,...g,onClose:c.onClose,children:i}):(0,n.jsx)(j.A,{rootClassName:d?"nb-hidden":"",closable:!1,getContainer:y,...c,open:p,footer:m,styles:{...c.styles,footer:{display:"flex",justifyContent:"flex-end",...null==(l=c.styles)?void 0:l.footer}},...g,onClose:c.onClose,children:i})});function I(){let e=r.useRef(null),t=r.useMemo(()=>o.observable.shallow({value:[]}),[]),l=r.memo(e=>{let{index:i}=e,[a,s]=r.useState(null);return(r.useEffect(()=>{(0,o.autorun)(()=>{let e=t.value;e[i]&&a!==e[i]&&s(e[i]),e[i]||s(null)})},[a,i]),a)?(0,n.jsx)(a,{children:(0,n.jsx)(l,{index:i+1})}):null});l.displayName="RenderNestedDrawer";let u=(t,l)=>{var u,c;let p,h,m=l.engine,f=r.createRef(),g=new Promise(e=>{h=e}),v=null,b=null,x=e=>{let{children:t}=e;return r.useEffect(()=>{var e;return v=t,null==(e=f.current)||e.setFooter(t),()=>{var e;v=null,null==(e=f.current)||e.setFooter(null)}},[t]),null},w=e=>(r.useEffect(()=>{var t;return b=e,null==(t=f.current)||t.setHeader(e),()=>{var e;b=null,null==(e=f.current)||e.setHeader(null)}},[e]),null),C=new a.cB,P=(0,A._)(l.engine),j=(0,S.eX)(m,P);C.defineProperty("engine",{value:P}),C.addDelegate(P.context),!1!==t.inheritContext?C.addDelegate(l):(C.addDelegate(l.engine.context),k(C,l));let E=!1,I={type:"drawer",inputArgs:t.inputArgs||{},preventClose:!!t.preventClose,beforeClose:void 0,destroy:e=>{var l,n,r,i;if(E)return;E=!0,null==(l=t.onClose)||l.call(t),null==(n=f.current)||n.destroy(),null==p||p(),null==h||h(e);let o=null==j?void 0:j.emitter;(0,S.Z8)(o),null==o||null==(i=o.emit)||i.call(o,S.B9,{type:"drawer",viewUid:null==I||null==(r=I.inputArgs)?void 0:r.viewUid}),P.unlinkFromStack()},update:e=>{var t;return null==(t=f.current)?void 0:t.update(e)},close:async(e,l)=>{var n,r;return(!t.preventClose||!!l)&&!!await F(I,{result:e,force:l})&&(t.triggerByRouter&&(null==(r=t.inputArgs)||null==(n=r.navigation)?void 0:n.back)?t.inputArgs.navigation.back():I.destroy(e),!0)},Footer:x,Header:w,setFooter:e=>{var t;v=e,null==(t=f.current)||t.setFooter(e)},setHeader:e=>{var t;b=e,null==(t=f.current)||t.setHeader(e)},navigation:null==(u=t.inputArgs)?void 0:u.navigation,get record(){return(0,d.vE)(l,C)}};C.defineProperty("view",{get:()=>I,resolveOnServer:(0,d.Xx)(C,()=>(0,d.vE)(l,C))}),P.setDestroyView(()=>{var e,l;t.triggerByRouter&&(null==(l=t.inputArgs)||null==(e=l.navigation)?void 0:e.back)&&t.inputArgs.navigation.back(),I.destroy()}),y(C,I);let T=r.memo((0,o.observer)(e=>{var l,o,a,s;let d=r.useRef(!1),u="function"==typeof t.content?t.content(I,C):t.content,c="string"==typeof u?(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:i.A.sanitize(u)}}):u;return(r.useEffect(()=>{var e;null==(e=t.onOpen)||e.call(t,I,C)},[]),(null==(o=t.inputArgs)||null==(l=o.hidden)?void 0:l.value)&&!d.current)?(0,n.jsx)(n.Fragment,{children:e.children}):(d.current=!0,(0,n.jsxs)(R,{ref:f,...t,footer:v,header:t.header||b,hidden:null==(s=t.inputArgs)||null==(a=s.hidden)?void 0:a.value,onClose:()=>{I.close(t.result)},isMobile:C.isMobileLayout,children:[c,e.children]}))}));T.displayName="DrawerWithContext";let _=r.memo(e=>{let{children:t}=e;return(0,n.jsx)(M.I6,{engine:P,children:(0,n.jsx)(s.YQ,{context:C,children:(0,n.jsx)(T,{children:t})})})});return _.displayName="RenderDrawer",p=null==(c=e.current)?void 0:c.patchElement(_),Object.assign(g,I)},c=r.useMemo(()=>({open:u}),[]),p=r.memo(r.forwardRef((e,i)=>{let[o,a]=w();return r.useImperativeHandle(i,()=>({patchElement:a}),[a]),r.useEffect(()=>{t.value=o},[o]),(0,n.jsx)(l,{index:0})}));return[c,(0,n.jsx)(p,{ref:e},"drawer-holder")]}var T=l(40961),_=l(31333),D=l(71021);let N=(0,r.forwardRef)((e,t)=>{let[l,i]=r.useState({}),{visible:o=!0,footer:a=null,header:s=null,children:d,hidden:u,title:c,styles:p={},zIndex:h=4,onClose:m}={...e,...l},f=(0,r.useRef)(!1),g=(0,M.uf)(),[v,y]=(0,r.useState)(()=>a),[b,x]=(0,r.useState)(s);(0,r.useImperativeHandle)(t,()=>({destroy:()=>{f.current||(f.current=!0)},update:e=>{i(e)},setFooter:e=>{y(e)},setHeader:e=>{0===Object.values(e||{}).length?x(null):x(e)}}));let w=(0,r.useMemo)(()=>({display:u?"none":"flex",flexDirection:"column",height:"100%",zIndex:h}),[u,h]),S=(0,r.useMemo)(()=>{if(!b&&!c)return null;let{title:e=c,extra:t}=b||{},l=g.context.themeToken;return(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:`${l.paddingSM}px ${l.padding}px`,borderBottom:`1px solid ${l.colorSplit}`,backgroundColor:l.colorBgContainer,...p.header},children:[(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:l.marginXS},children:[(0,n.jsx)(D.Ay,{type:"text",size:"small",icon:(0,n.jsx)(_.A,{}),onClick:async()=>{f.current||!1!==await (null==m?void 0:m())&&(f.current=!0)},style:{color:l.colorTextTertiary}}),e&&(0,n.jsx)("div",{style:{fontSize:l.fontSizeLG,fontWeight:l.fontWeightStrong,color:l.colorText},children:e})]}),t&&(0,n.jsx)("div",{children:t})]})},[b,c,g.context.themeToken,p.header,m]),A=(0,r.useMemo)(()=>{if(!v)return null;let e=g.context.themeToken;return(0,n.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",padding:`${e.paddingXS}px ${e.padding}px`,borderTop:`1px solid ${e.colorSplit}`,backgroundColor:e.colorBgContainer,...p.footer},children:v})},[v,g.context.themeToken,p.footer]);return o?(0,n.jsxs)("div",{style:{...w,...p.content},children:[S,(0,n.jsx)("div",{style:{flex:1,overflowY:"auto",...p.body},children:d}),A]}):null}),O=0,$="nocobase-embed-container",B="nocobaseEmbedReplacing";function L(e){return!!e&&"function"==typeof e.then}function V(e,t){e.dataset[B]="1";try{let l=t.close();if(L(l))return Promise.resolve(l).finally(()=>{delete e.dataset[B]});return delete e.dataset[B],l}catch(t){throw delete e.dataset[B],t}}function q(e,t,l){let n,r={},i=e.then(e=>{let{page:t}=e;return(n=t)&&("beforeClose"in r&&(n.beforeClose=r.beforeClose),"update"in r&&n.update(r.update),"footer"in r&&n.setFooter(r.footer),"header"in r&&n.setHeader(r.header),r.destroyed&&n.destroy(r.destroyed.result)),{page:t}});return Object.assign(i.then(e=>{let{page:t}=e;return!!t&&t}),{type:"embed",inputArgs:t,preventClose:l,Header:null,Footer:null,get beforeClose(){return(null==n?void 0:n.beforeClose)??r.beforeClose},set beforeClose(value){n?n.beforeClose=value:r.beforeClose=value},close:(e,t)=>i.then(l=>{let{page:n}=l;return!!n&&n.close(e,t)}),destroy:e=>{n?n.destroy(e):r.destroyed={result:e}},update:e=>{n?n.update(e):r.update={...r.update,...e}},setFooter:e=>{n?n.setFooter(e):r.footer=e},setHeader:e=>{n?n.setHeader(e):r.header=e}})}let z=r.memo(r.forwardRef((e,t)=>{let[l,i]=w();return r.useImperativeHandle(t,()=>({patchElement:i}),[i]),(0,n.jsx)(n.Fragment,{children:l})}));function K(){let e=r.useRef(null),t=r.useRef(null),l=r.useRef(0),i=(i,u)=>{let{target:c,content:p,preventClose:h,inheritContext:m=!0,inputArgs:f={},onOpenCancelled:g,...v}=i,b=c instanceof HTMLElement&&c.id===$,x=()=>{var l,g,x;let w,C,P,j=null==u?void 0:u.engine;O+=1;let E=r.createRef(),R=new Promise(e=>{C=e}),I=e=>{let{children:t}=e;return r.useEffect(()=>{var e;return null==(e=E.current)||e.setFooter(t),()=>{var e;null==(e=E.current)||e.setFooter(null)}},[t]),null},_=e=>(r.useEffect(()=>{var t;return null==(t=E.current)||t.setHeader(e),()=>{var e;null==(e=E.current)||e.setHeader(null)}},[e]),null),D=new a.cB,$=(0,A._)(u.engine),L=(0,S.eX)(j,$);D.defineProperty("engine",{value:$}),D.addDelegate($.context),m?D.addDelegate(u):(D.addDelegate(u.engine.context),k(D,u));let V=!1,q={type:"embed",inputArgs:f,preventClose:!!i.preventClose,beforeClose:void 0,destroy:e=>{var l,n,r,o,a;if(!V){if(V=!0,null==(l=i.onClose)||l.call(i),null==C||C(e),null==(n=E.current)||n.destroy(),null==w||w(),b&&t.current===q&&(t.current=null),!(b&&c instanceof HTMLElement&&(null==(r=c.dataset)?void 0:r[B])==="1")){let e=null==L?void 0:L.emitter;(0,S.Z8)(e),null==e||null==(a=e.emit)||a.call(e,S.B9,{type:"embed",viewUid:null==q||null==(o=q.inputArgs)?void 0:o.viewUid})}$.unlinkFromStack()}},update:e=>{var t;return null==(t=E.current)?void 0:t.update(e)},close:(e,t)=>V?Promise.resolve(!0):P||(P=(async()=>{try{var l,n;if(h&&!t)return P=void 0,!1;let r=await F(q,{result:e,force:t});if(V)return!0;if(!r)return P=void 0,!1;if(i.triggerByRouter&&(null==(n=i.inputArgs)||null==(l=n.navigation)?void 0:l.back))return i.inputArgs.navigation.back(),!0;return q.destroy(e),!0}catch(e){throw V||(P=void 0),e}})()),Header:_,Footer:I,setFooter:e=>{var t;null==(t=E.current)||t.setFooter(e)},setHeader:e=>{var t;null==(t=E.current)||t.setHeader(e)},navigation:null==(l=i.inputArgs)?void 0:l.navigation,get record(){return(0,d.vE)(u,D)}};D.defineProperty("view",{get:()=>q,resolveOnServer:(0,d.Xx)(D,()=>(0,d.vE)(u,D))}),y(D,q);let z=(0,o.observer)(()=>{var e,t,l,o;let a=r.useRef(!1),s=r.useMemo(()=>"function"==typeof p?p(q,D):p,[]);return(D.themeToken,r.useEffect(()=>{var e;null==(e=i.onOpen)||e.call(i,q,D)},[]),(null==(t=i.inputArgs)||null==(e=t.hidden)?void 0:e.value)&&!a.current)?null:(a.current=!0,(0,n.jsx)(N,{ref:E,hidden:null==(o=i.inputArgs)||null==(l=o.hidden)?void 0:l.value,...v,onClose:()=>q.close(i.result),children:s}))},{displayName:"PageWithContext"}),K=(null==f?void 0:f.viewUid)||`page-${O}`,U=(0,n.jsx)(M.I6,{engine:$,children:(0,n.jsx)(s.YQ,{context:D,children:(0,n.jsx)(z,{})})},K);return w=c&&c instanceof HTMLElement?null==(g=e.current)?void 0:g.patchElement(T.createPortal(U,c,K)):null==(x=e.current)?void 0:x.patchElement(U),b&&(t.current=q),Object.assign(R,q)};if(b&&t.current){let e,n=l.current+=1,r=()=>null==g?void 0:g();try{e=V(c,t.current)}catch(e){throw r(),e}if(L(e))return q(Promise.resolve(e).then(e=>!1===e||n!==l.current?(r(),{page:null}):{page:x()},e=>{throw r(),e}),f,!!i.preventClose);if(!1===e)return r(),q(Promise.resolve({page:null}),f,!!i.preventClose)}return x()};return[r.useMemo(()=>({open:i}),[]),(0,n.jsx)(z,{ref:e},"page-holder")]}var U=l(28073);let W=0,H=r.forwardRef((e,t)=>{var l,i;let{afterClose:o,content:a,placement:s,rect:d,...u}=e,[c,p]=r.useState(!0),[h,m]=r.useState({content:a,placement:s,rect:d,...u});return r.useImperativeHandle(t,()=>({destroy:()=>p(!1),update:e=>m(t=>({...t,...e})),close:(e,t)=>p(!1)})),r.useEffect(()=>{c||null==o||o()},[c,o]),(0,n.jsx)(U.A,{arrow:!1,open:c,trigger:["click"],destroyTooltipOnHide:!0,content:h.content,placement:h.placement,getPopupContainer:()=>document.querySelector("#nocobase-app-container")||document.body,onOpenChange:e=>{(e||!h.preventClose)&&(p(e),e||null==o||o())},...h,children:(0,n.jsx)("span",{style:{position:"absolute",top:((null==(l=h.rect)?void 0:l.top)??0)+window.scrollY,left:((null==(i=h.rect)?void 0:i.left)??0)+window.scrollX,width:0,height:0}})})});function G(){let e=r.useRef(null),t=t=>{var l,o;let a,s;W+=1;let{target:d,placement:u="rightTop",content:c,...p}=t,h=r.createRef(),m=(null==d||null==(l=d.getBoundingClientRect)?void 0:l.call(d))??{top:0,left:0},f=new Promise(e=>{s=e}),g={type:"popover",destroy:()=>{var e;return null==(e=h.current)?void 0:e.destroy()},update:e=>{var t;return null==(t=h.current)?void 0:t.update(e)},close:e=>{var t;null==s||s(e),null==(t=h.current)||t.close(e)}},v="function"==typeof c?c(g):c,y="string"==typeof v?(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:i.A.sanitize(v)}}):v,b=(0,n.jsx)(H,{ref:h,content:y,placement:u,rect:m,afterClose:()=>{var e;null==a||a(),null==(e=t.onClose)||e.call(t),null==s||s(t.result)},...p},`popover-${W}`);return a=null==(o=e.current)?void 0:o.patchElement(b),Object.assign(f,g)},l=r.useMemo(()=>({open:t}),[]),o=r.memo(r.forwardRef((e,t)=>{let[l,i]=w();return r.useImperativeHandle(t,()=>({patchElement:i}),[]),(0,n.jsx)(n.Fragment,{children:l})}));return[l,(0,n.jsx)(o,{ref:e},"popover-holder")]}var Y=l(50467),J=l(52847),X=l(60182);function Q(e){return null==e?"":e&&"object"==typeof e&&!Array.isArray(e)?encodeURIComponent(Object.entries(e).map(e=>{let[t,l]=e;return`${encodeURIComponent(String(t))}=${encodeURIComponent(String(l))}`}).join("&")):encodeURIComponent(String(e))}function Z(e){return null!=e&&""!==String(e)}function ee(e){let t=e||"/admin";return`/${t.replace(/^\/+/,"").replace(/\/+$/,"")}`}function et(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=ee(t.basePath||t.prefix);if(!e||0===e.length)return l;let n=l.replace(/^\/+/,"").split("/").filter(Boolean);return e.forEach((e,t)=>{t>0&&n.push("view"),n.push(e.viewUid);let l=(0,X.Gu)(e.viewUid,e.openViewRouteState);if(l&&n.push("opts",l),e.tabUid&&n.push("tab",e.tabUid),null!=e.filterByTk){let t=Q(e.filterByTk);t&&n.push("filterbytk",t)}Z(e.sourceId)&&n.push("sourceid",String(e.sourceId))}),"/"+n.join("/")}class el{setViewStack(e){this.viewStack=Object.freeze([...e]),this.viewParams=this.viewStack[this.viewStack.length-1]||{}}changeTo(e){let t=et(this.viewStack.map((t,l)=>l===this.viewStack.length-1?{...t,...e}:{...t}),{basePath:this.getLayoutBasePath()});this.ctx.router.navigate(t,{replace:!0})}navigateTo(e,t){let l=et([...this.viewStack,e],{basePath:this.getLayoutBasePath()});this.ctx.router.navigate(l,t)}back(){let e=et(this.viewStack.slice(0,-1),{basePath:this.getLayoutBasePath()});this.ctx.router.navigate(e,{replace:!0})}getLayoutBasePath(){var e,t;let l=null==(e=this.ctx.layout)?void 0:e.routePath;return this.basePath||(null==(t=this.ctx.layoutRoute)?void 0:t.basePathname)||((null==l?void 0:l.startsWith("/"))?l:"/admin")}constructor(e,t,l={}){(0,Y._)(this,"viewStack",void 0),(0,Y._)(this,"ctx",void 0),(0,Y._)(this,"viewParams",void 0),(0,Y._)(this,"basePath",void 0),this.setViewStack(t),this.ctx=e,this.basePath=l.basePath||l.layoutBasePath,(0,J.E8)(this,{viewParams:J.sH})}}},16639(e,t,l){l.d(t,{B9:()=>r,FH:()=>s,HK:()=>i,Z8:()=>d,eX:()=>p,i6:()=>o,tb:()=>n});let n=Symbol.for("__NOCOBASE_VIEW_ACTIVATED_VERSION__"),r="view:activated",i="dataSource:dirty",o="__NOCOBASE_ENGINE_SCOPE__",a="view";function s(e){let t=Reflect.get(e,n),l="number"==typeof t?t:Number(t);return Number.isFinite(l)&&l>0?l:0}function d(e){let t=s(e);if(!Object.isExtensible(e))return t;let l=t+1;return Reflect.set(e,n,l),l}function u(e){return Reflect.get(e,o)===a}function c(e){let t=e,l=0;for(;t&&l++<50;){if(u(t))return t;t=t.previousEngine}}function p(e,t){if(!e)return;let l=c(e);return l||c(null==t?void 0:t.previousEngine)||e}},33329(e,t,l){l.d(t,{xW:()=>f,bO:()=>s,Q9:()=>m});var n=l(50467),r=l(88909),i=l(55373),o=l.n(i);let a=(e,t)=>{if(!e)return;let l="function"==typeof e.toJSON?e.toJSON():e,n=Object.keys(l||{}).find(e=>e.toLowerCase()===t.toLowerCase());return n?l[n]:void 0},s=(e,t)=>{let l=a(e,t);return null!=l&&""!==l};class d{get storagePrefix(){return this.api.storagePrefix}get locale(){return this.getLocale()}set locale(e){this.setLocale(e)}get role(){return this.getRole()}set role(e){this.setRole(e)}get token(){return this.getToken()}set token(e){this.setToken(e)}get authenticator(){return this.getAuthenticator()}set authenticator(e){this.setAuthenticator(e)}getOption(e){return this.api.storage.getItem(e)}setOption(e,t){return this.options[e]=t,this.api.storage.setItem(e,t||"")}getLocale(){return this.getOption("locale")}setLocale(e){this.setOption("locale",e)}getRole(){return this.getOption("role")}setRole(e){this.setOption("role",e)}getToken(){return this.getOption("token")}setToken(e){this.setOption("token",e),this.api.app&&this.api.app.eventBus.dispatchEvent(new CustomEvent("auth:tokenChanged",{detail:{token:e,authenticator:this.authenticator}}))}getAuthenticator(){return this.getOption("auth")}setAuthenticator(e){this.setOption("auth",e)}middleware(e){return this.locale&&e.headers&&(e.headers["X-Locale"]=this.locale),this.role&&e.headers&&(e.headers["X-Role"]=this.role),this.authenticator&&!s(e.headers,"X-Authenticator")&&e.headers&&(e.headers["X-Authenticator"]=this.authenticator),this.token&&!s(e.headers,"Authorization")&&e.headers&&(e.headers.Authorization=`Bearer ${this.token}`),e}async signIn(e,t){var l;let n=await this.api.request({method:"post",url:"auth:signIn",data:e,headers:{"X-Authenticator":t}}),r=null==n||null==(l=n.data)?void 0:l.data;return this.setAuthenticator(t),this.setToken(null==r?void 0:r.token),n}async signUp(e,t){return await this.api.request({method:"post",url:"auth:signUp",data:e,headers:{"X-Authenticator":t}})}async signOut(){let e=await this.api.request({method:"post",url:"auth:signOut"});return this.setToken(null),this.setRole(null),this.setAuthenticator(null),e}async lostPassword(e){let t=Object.fromEntries(new URLSearchParams(window.location.search).entries());return await this.api.request({method:"post",url:"auth:lostPassword",data:{...e,baseURL:window.location.href.split("/forgot-password")[0]},headers:{"X-Authenticator":t.name}})}async resetPassword(e){return await this.api.request({method:"post",url:"auth:resetPassword",data:e})}async checkResetToken(e){return await this.api.request({method:"post",url:"auth:checkResetToken",data:e})}constructor(e){(0,n._)(this,"api",void 0),(0,n._)(this,"options",{locale:null,role:null,authenticator:null,token:null}),this.api=e,this.api.axios.interceptors.request.use(this.middleware.bind(this))}}class u{toUpperCase(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";for(var t=arguments.length,l=Array(t>1?t-1:0),n=1;n<t;n++)l[n-1]=arguments[n];return e.toUpperCase()+l.map(e=>e.toUpperCase()).join("_")}constructor(){(0,n._)(this,"storagePrefix",void 0)}}class c extends u{clear(){this.items.clear()}getItem(e){return this.items.get(e)}setItem(e,t){return this.items.set(e,t)}removeItem(e){return this.items.delete(e)}constructor(...e){super(...e),(0,n._)(this,"items",new Map)}}class p extends u{clear(){return this.items.clear()}getItem(e){return this.shareToken&&"token"===e&&this.baseStoragePrefix?this.items.getItem(this.toUpperCase(this.baseStoragePrefix,e)):this.items.getItem(this.toUpperCase(this.storagePrefix,e))}setItem(e,t){return this.shareToken&&"token"===e&&this.baseStoragePrefix?this.items.setItem(this.toUpperCase(this.baseStoragePrefix,e),t):this.items.setItem(this.toUpperCase(this.storagePrefix,e),t)}removeItem(e){return this.shareToken&&"token"===e&&this.baseStoragePrefix?this.items.removeItem(this.toUpperCase(this.baseStoragePrefix,e)):this.items.removeItem(this.toUpperCase(this.storagePrefix,e))}constructor(e,t="",l=!1){super(),(0,n._)(this,"storagePrefix",void 0),(0,n._)(this,"baseStoragePrefix",void 0),(0,n._)(this,"shareToken",void 0),(0,n._)(this,"items",void 0),this.storagePrefix=e,this.baseStoragePrefix=t,this.shareToken=l,this.items=window.localStorage}}class h extends p{constructor(e,t="",l=!1){super(e,t,l),(0,n._)(this,"storagePrefix",void 0),(0,n._)(this,"baseStoragePrefix",void 0),(0,n._)(this,"shareToken",void 0),this.storagePrefix=e,this.baseStoragePrefix=t,this.shareToken=l,this.items=window.sessionStorage}}class m{toErrMessages(e){var t,l,n,r,i,o,a,s,d,u,c;if("u">typeof document&&"string"==typeof(null==e||null==(t=e.response)?void 0:t.data)){let t=document.createElement("div");t.innerHTML=null==e||null==(d=e.response)?void 0:d.data;let l=t.textContent||t.innerText;return l.includes("Error occurred while trying")||l.includes("502 Bad Gateway")?[{code:"APP_WARNING",message:l="The application may be starting up. Please try again later."}]:[{message:l}]}return(null==e||null==(n=e.response)||null==(l=n.data)?void 0:l.error)?[null==e||null==(c=e.response)||null==(u=c.data)?void 0:u.error]:(null==e||null==(i=e.response)||null==(r=i.data)?void 0:r.errors)||(null==e||null==(a=e.response)||null==(o=a.data)?void 0:o.messages)||(null==e||null==(s=e.response)?void 0:s.error)||[{message:e.message||"Server error"}]}getHeaders(){let e={};return this.auth.locale&&(e["X-Locale"]=this.auth.locale),this.auth.role&&(e["X-Role"]=this.auth.role),this.auth.authenticator&&(e["X-Authenticator"]=this.auth.authenticator),this.auth.token&&(e.Authorization=`Bearer ${this.auth.token}`),e}createStorage(e){return"localStorage"===e&&"u">typeof localStorage?new p(this.storagePrefix,this.baseStoragePrefix,this.shareToken):"sessionStorage"===e&&"u">typeof sessionStorage?new h(this.storagePrefix,this.baseStoragePrefix,this.shareToken):new c}initStorage(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"localStorage";if(e){this.storage=new e(this);return}this.storage=this.createStorage(t)}interceptors(){this.axios.interceptors.request.use(e=>(e.paramsSerializer=e=>o().stringify(e,{strictNullHandling:!0,arrayFormat:"brackets"}),e))}request(e){let{resource:t,resourceOf:l,action:n,params:r,headers:i}=e;return t?this.resource(t,l,i)[n](r):this.axios.request(e)}resource(e,t,l,n){return new Proxy({},{get:(r,i)=>{if(n)return;let o=e.split(".").join(`/${encodeURIComponent(t)||"_"}/`),a={url:o+=`:${i.toString()}`};return["get","list"].includes(i)?a.method="get":a.method="post",async(e,t)=>{let{values:n,filter:r,...i}=e||{};return a.params=i,r&&("string"==typeof r?a.params.filter=r:(r["*"]&&delete r["*"],a.params.filter=JSON.stringify(r))),"get"!==a.method&&(a.data=n||{}),await this.request({...a,...t,headers:l})}}})}constructor(e){if((0,n._)(this,"options",void 0),(0,n._)(this,"axios",void 0),(0,n._)(this,"auth",void 0),(0,n._)(this,"storage",void 0),(0,n._)(this,"storagePrefix","NOCOBASE_"),(0,n._)(this,"baseStoragePrefix","NOCOBASE_"),(0,n._)(this,"shareToken",!1),this.options=e,"function"==typeof e)this.axios=e;else{let{appName:t,authClass:l,storageType:n,storageClass:i,storagePrefix:o="NOCOBASE_",shareToken:a=!1,...s}=e||{};this.shareToken=a,this.baseStoragePrefix=o,this.storagePrefix=t?`${o}${t.toUpperCase()}_`:o,this.axios=r.A.create(s),this.initStorage(i,n),l&&(this.auth=new l(this))}this.storage||this.initStorage(),this.auth||(this.auth=new d(this)),this.interceptors()}}let f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/";if("u"<typeof window||!window.location.pathname)return;let t=`${e}apps/`;if(window.location.pathname.startsWith(t))return window.location.pathname.substring(t.length).split("/",1)[0]||""}},40542(e,t,l){l.d(t,{D:()=>n});let n=(e,t,l)=>{if(!e)return l;let r=t.split("."),i=[],o=e,a=!1;for(let e=0;e<r.length;e++){let t=r[e];if(Array.isArray(o)){for(let t of(a=!0,o)){let o=n(t,r.slice(e).join("."),l);i=i.concat(o)}break}if((null==o?void 0:o[t])===void 0)break;o=o[t],e===r.length-1&&i.push(o)}return 0===(i=i.filter(e=>void 0!==e)).length?l:a?i.filter(e=>null!==e):i[0]}},96436(e,t,l){l.r(t),l.d(t,{getDayRange:()=>tl,isEmptyFilter:()=>ed,sleep:()=>es,getDateVars:()=>ta,isString:()=>ee,unflatten:()=>e8,sortTree:()=>ea,forEach:()=>ek,utc2unit:()=>tr,extractUsedVariablePaths:()=>tE,getValuesByPath:()=>eC,isArray:()=>et,moment2str:()=>eb,transformLiquidContext:()=>tI,isURL:()=>tA,isPortalInBody:()=>tb,extractUsedVariableNames:()=>tj,parseHTML:()=>tx,toGmt:()=>ep,isPlainObject:()=>en,lockdownSes:()=>tg,splitPathToTwoParts:()=>ts,transformFilter:()=>Y,parseSQLBindParams:()=>tD,getPickerFormat:()=>eM,nextTick:()=>ei,removeNullCondition:()=>eu,CollectionsGraph:()=>q,isValidFilter:()=>eT,evaluateConditions:()=>Z,toUnit:()=>ti,BASE_BLOCKED_IDENTIFIERS:()=>th,getFormatFromDateStr:()=>eF,removeInvalidFilterItems:()=>J,toLocal:()=>eh,getDayRangeByParams:()=>L,getDefaultFormat:()=>ec,transformMultiColumnToSingleColumn:()=>tC,treeFind:()=>eo,transformSQL:()=>tN,parseFilter:()=>tt,flatten:()=>e4,getOffsetRangeByParams:()=>N,isEmpty:()=>el,offsetFromString:()=>ex,tval:()=>tv,error:()=>eV,Registry:()=>tu,lodash:()=>r(),parse:()=>eO,hasEmptyValue:()=>er,toFixedByStep:()=>eJ,getDateTimeFormat:()=>eA,showToast:()=>eH,Handlebars:()=>eE(),getLiquidContext:()=>tT,merge:()=>eU,dayjs:()=>o(),parseLiquidContext:()=>t_,uid:()=>tM,str2moment:()=>eg});var n=l(2543),r=l.n(n),i=l(74353),o=l.n(i),a=l(97375),s=l.n(a),d=l(90445),u=l.n(d),c=l(43522),p=l.n(c),h=l(37872),m=l.n(h),f=l(98867),g=l.n(f),v=l(8906),y=l.n(v),b=l(68313),x=l.n(b),w=l(21840),S=l.n(w),M=l(41816),A=l.n(M),F=l(88569),k=l.n(F),C=l(83826),P=l.n(C),j=l(8134),E=l.n(j),R=l(28623),I=l.n(R),T=l(46986),_=l.n(T);o().extend(_()),o().extend(S()),o().extend(k()),o().extend(P()),o().extend(A()),o().extend(x()),o().extend(m()),o().extend(g()),o().extend(y()),o().extend(E()),o().extend(I()),o().extend(u()),o().extend(s()),o().extend(p());let D=e=>{if(!e)return o()();if(/^[+-]\d{2}:\d{2}$/.test(e)){let[t,l,n]=e.match(/([+-])(\d{2}):(\d{2})/).slice(1),r=(60*parseInt(l)+parseInt(n))*("+"===t?1:-1);return o()().utcOffset(r)}return o()().tz(e)},N=e=>{let t,l,{type:n,unit:r="day",number:i=1,timezone:o}=e,a=D(o),s="week"===r?"isoWeek":r;if("past"===n){let e=a.startOf(s);t=e.subtract(i,r).startOf(s),l=e.subtract(1,r).endOf(s)}else if("next"===n)l=(t=a.startOf(s).add(1,r).startOf(s)).add(i-1,r).endOf(s);else throw Error(`Unsupported type: ${n}`);return[t.format("YYYY-MM-DD HH:mm:ss"),l.format("YYYY-MM-DD HH:mm:ss")]},O=(e,t,l)=>{let n="isoWeek"===t?"week":t;return D(l).add(e,n).startOf(t)},$=(e,t,l)=>{let n="isoWeek"===t?"week":t;return D(l).add(e,n).endOf(t)},B={today:e=>[O(0,"day",null==e?void 0:e.timezone),$(0,"day",null==e?void 0:e.timezone)],yesterday:e=>[O(-1,"day",null==e?void 0:e.timezone),$(-1,"day",null==e?void 0:e.timezone)],tomorrow:e=>[O(1,"day",null==e?void 0:e.timezone),$(1,"day",null==e?void 0:e.timezone)],thisWeek:e=>[O(0,"isoWeek",null==e?void 0:e.timezone),$(0,"isoWeek",null==e?void 0:e.timezone)],lastWeek:e=>[O(-1,"isoWeek",null==e?void 0:e.timezone),$(-1,"isoWeek",null==e?void 0:e.timezone)],nextWeek:e=>[O(1,"isoWeek",null==e?void 0:e.timezone),$(1,"isoWeek",null==e?void 0:e.timezone)],thisMonth:e=>[O(0,"month",null==e?void 0:e.timezone),$(0,"month",null==e?void 0:e.timezone)],lastMonth:e=>[O(-1,"month",null==e?void 0:e.timezone),$(-1,"month",null==e?void 0:e.timezone)],nextMonth:e=>[O(1,"month",null==e?void 0:e.timezone),$(1,"month",null==e?void 0:e.timezone)],thisQuarter:e=>[O(0,"quarter",null==e?void 0:e.timezone),$(0,"quarter",null==e?void 0:e.timezone)],lastQuarter:e=>[O(-1,"quarter",null==e?void 0:e.timezone),$(-1,"quarter",null==e?void 0:e.timezone)],nextQuarter:e=>[O(1,"quarter",null==e?void 0:e.timezone),$(1,"quarter",null==e?void 0:e.timezone)],thisYear:e=>[O(0,"year",null==e?void 0:e.timezone),$(0,"year",null==e?void 0:e.timezone)],lastYear:e=>[O(-1,"year",null==e?void 0:e.timezone),$(-1,"year",null==e?void 0:e.timezone)],nextYear:e=>[O(1,"year",null==e?void 0:e.timezone),$(1,"year",null==e?void 0:e.timezone)]},L=e=>{if("past"===e.type||"next"===e.type)return N(e);let t=B[e.type];if(!t)throw Error(`Unsupported type: ${e.type}`);let[l,n]=t(e);return[l.format("YYYY-MM-DD HH:mm:ss"),n.format("YYYY-MM-DD HH:mm:ss")]};var V=l(38362);class q{static graphlib(){return V}static connectedNodes(e){let t=(0,n.castArray)(e.nodes),l=(0,n.castArray)(e.excludes||[]),r=q.build(e),i=new Set;for(let e of t)for(let t of V.alg.preorder(r,e))l.includes(t)||i.add(t);return Array.from(i)}static preOrder(e){return q.graphlib().alg.preorder(q.build(e),e.node)}static build(e){let t=e.collections,l="forward"===((null==e?void 0:e.direction)||"forward"),n=new V.Graph;for(let e of t)n.setNode(e.name);for(let e of t){for(let t of e.inherits||[])l?n.setEdge(e.name,t):n.setEdge(t,e.name);for(let t of e.fields||[])if(("hasMany"===t.type||"belongsTo"===t.type||"hasOne"===t.type)&&(l?n.setEdge(e.name,t.target):n.setEdge(t.target,e.name)),"belongsToMany"===t.type){let r=t.through;l?(n.setEdge(e.name,r),n.setEdge(r,t.target)):(n.setEdge(t.target,r),n.setEdge(r,e.name))}}return n}}var z=l(81814),K=l.n(z);function U(e){return"path"in e&&"operator"in e}function W(e){return"logic"in e&&"items"in e}function H(e){let{path:t,operator:l,value:n}=e;return{[t]:{[l]:n}}}function G(e){let{logic:t,items:l}=e;return{[t]:l.map(e=>{if(U(e))return H(e);if(W(e))return G(e);throw Error("Invalid filter item type")})}}function Y(e){if(!e||"object"!=typeof e)throw Error("Invalid filter: filter must be an object");if(!W(e))throw Error("Invalid filter: filter must have logic and items properties");if(!Array.isArray(e.items))throw Error("Invalid filter: items must be an array");return eu(G(e))}function J(e){if(!e||"object"!=typeof e)throw Error("Invalid filter: filter must be an object");if(!W(e))throw Error("Invalid filter: filter must have logic and items properties");if(!Array.isArray(e.items))throw Error("Invalid filter: items must be an array");return e.items=e.items.filter(e=>U(e)?!!e.operator:!!W(e)&&J(e)),{...e}}function X(e,t){let{path:l,operator:n,value:r}=e;return t(l,n,r)}function Q(e,t){let{logic:l,items:n}=e;if(!n||0===n.length)return!0;let r=n.map(e=>{if(U(e))return X(e,t);if(W(e))return Q(e,t);throw Error("Invalid filter item type")});if("$and"===l)return r.every(e=>!0===e);if("$or"===l)return r.some(e=>!0===e);throw Error(`Unsupported logic operator: ${l}`)}function Z(e,t){if(!e||"object"!=typeof e)throw Error("Invalid conditions: conditions must be an object");if(!W(e))throw Error("Invalid conditions: conditions must have logic and items properties");if(!Array.isArray(e.items))throw Error("Invalid conditions: items must be an array");if("function"!=typeof t)throw Error("Invalid evaluator: evaluator must be a function");return Q(e,t)}let ee=e=>"string"==typeof e,et=e=>Array.isArray(e),el=e=>en(e)?0===Object.keys(e).length:!!Array.isArray(e)&&0===e.length,en=e=>{if("[object Object]"!==Object.prototype.toString.call(e))return!1;let t=Object.getPrototypeOf(e);return null===t||t===Object.prototype},er=e=>{let t=!0;for(let l in e){if(t=!1,et(e[l])&&0===e[l].length||!e[l])return!0;if(en(e[l])||et(e[l]))return er(e[l])}return t},ei=e=>{setTimeout(e)};function eo(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)return;let{childrenKey:n="children"}=l;for(let r of Array.isArray(e)?[...e]:[e]){if(t(r))return r;let e="function"==typeof n?n(r):r[n];if(Array.isArray(e)&&e.length>0){let n=eo(e,t,l);if(void 0!==n)return n}}}function ea(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"children",n=!(arguments.length>3)||void 0===arguments[3]||arguments[3];return e&&Array.isArray(e)&&0!==e.length?r().orderBy(e,t,n?"asc":"desc").map(e=>e[l]&&e[l].length>0?{...e,[l]:ea(e[l],t,l,n)}:e):e}function es(e){return new Promise(t=>{setTimeout(t,e)})}function ed(e){return!!(!e||"$and"in e&&r().isEmpty(e.$and)||"$or"in e&&r().isEmpty(e.$or))}let eu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:K(),l=t(e||{}),n={};for(let e in l){let t=l[e];null==t||el(t)||""===t||(n[e]=t)}let i=t.unflatten(n);for(let e in i)Array.isArray(i[e])&&(i[e]=i[e].filter(e=>null!=e));return r().isEmpty(i)?void 0:i},ec=e=>e.format?e.format:e.dateFormat?e.showTime?`${e.dateFormat} ${e.timeFormat||"HH:mm:ss"}`:e.dateFormat:"month"===e.picker?"YYYY-MM":"quarter"===e.picker?"YYYY-\\QQ":"year"===e.picker?"YYYY":"week"===e.picker?"YYYY[W]W":e.showTime?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD",ep=e=>e&&o().isDayjs(e)?`${e.format("YYYY-MM-DD")}T${e.format("HH:mm:ss.SSS")}Z`:e,eh=e=>e?Array.isArray(e)?e.map(e=>e.startOf("second").toISOString()):o().isDayjs(e)?e.startOf("second").toISOString():void 0:e,em=e=>{try{let t=parseInt(e.slice(0,4)),l=parseInt(e.slice(-1));return o()().quarter(l).year(t)}catch(e){return null}},ef=(e,t)=>{if(!e)return;let l=t.utcOffset,{gmt:n,picker:r,utc:i=!0,dateOnly:a}=t;if(!o()(e).isValid())return em(e);if(a){let t=o()(e);if(!t.isValid())return e;let l=t.format("YYYY-MM-DD");return o().utc(l,"YYYY-MM-DD")}return i?o().isDayjs(e)?l?e.utcOffset(ex(l)):e:n?o()(e).utcOffset(0):l?o()(e).utcOffset(ex(l)):o()(e):o()(e)},eg=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Array.isArray(e)?e.map(e=>ef(e,t)):e?ef(e,t):e},ev=(e,t)=>"year"===t?e.format("YYYY")+"-01-01T00:00:00.000Z":"month"===t||"quarter"===t?e.format("YYYY-MM")+"-01T00:00:00.000Z":e.format("YYYY-MM-DD")+"T00:00:00.000Z",ey=(e,t)=>e?Array.isArray(e)?e.map(e=>ev(e,t)):o().isDayjs(e)?ev(e,t):void 0:e,eb=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{showTime:l,gmt:n,picker:r}=t;return e?l?n?ep(e):eh(e):ey(e,r):e};function ex(e){if(!r().isString(e))return e;let t=/([+-]|\d\d)/gi,l=/Z|[+-]\d\d(?::?\d\d)?/gi,n=/[+-]?\d+(\.\d{1,3})?/,i=(e||"").match(l);if(null===i&&(i=(e||"").match(n)),null===i)return null;let o=((i[i.length-1]||[])+"").match(t)||["-",0,0],a=+(60*Number(o[1]))+ew(o[2]);return 0===a?0:"+"===o[0]?a:-a}function ew(e){let t=+e,l=0;return 0!==t&&isFinite(t)&&(l=eS(t)),l}function eS(e){return e<0?Math.ceil(e)||0:Math.floor(e)}let eM=e=>{switch(e){case"week":return"YYYY[W]W";case"month":return"YYYY-MM";case"quarter":return"YYYY[Q]Q";case"year":return"YYYY";default:return"YYYY-MM-DD"}},eA=(e,t,l,n)=>"date"===e&&l?`${t} ${n||"HH:mm:ss"}`:t;function eF(e){return/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(e)?"YYYY-MM-DD HH:mm:ss":/^\d{4}-\d{2}-\d{2}$/.test(e)?"YYYY-MM-DD":/^\d{4}-\d{2}$/.test(e)?"YYYY-MM":/^\d{4}$/.test(e)?"YYYY":/^\d{4}Q[1-4]$/.test(e)?"YYYY[Q]Q":/^\d{4}-\d{2}-\d{2}T/.test(e)?"YYYY-MM-DDTHH:mm:ss.SSSZ":null}let ek=(e,t)=>{Array.isArray(e)?e.forEach(t):Object.keys(e).forEach(l=>{t(e[l],l)})},eC=(e,t,l)=>{if(!e)return l;let n=t.split("."),r=[],i=e,o=!1;for(let e=0;e<n.length;e++){let t=n[e];if(Array.isArray(i)){for(let t of(o=!0,i)){let i=eC(t,n.slice(e).join("."),l);r=r.concat(i)}break}if((null==i?void 0:i[t])===void 0)break;i=i[t],e===n.length-1&&r.push(i)}return 0===(r=r.filter(e=>void 0!==e)).length?l:o?r.filter(e=>null!==e):r[0]};var eP=l(88835),ej=l(60639),eE=l.n(ej),eR=l(79441);let eI=l.n(eR)()();function eT(e){if(!e)return!1;let t=[e.$and,e.$or].filter(Boolean);return 0==t.length?Object.keys(e).length>0:t.some(e=>{if(Array.isArray(e))return e.some(eT);if(e.$and||e.$or)return eT(e);let[t]=Object.keys(e);if(!t||!e[t])return!1;let[l]=Object.keys(e[t]);return!!l&&void 0!==e[t][l]})}function e_(e){let t=typeof e;return Array.isArray(e)?t="array":e instanceof Date?t="date":null===e&&(t="null"),t}function eD(e){let t=e.substr(2,e.length-4).trim(),l=t.indexOf(":");return -1!==l?{key:t.substr(0,l),defaultValue:t.substr(l+1)}:{key:t}}function eN(e,t){return e.parameters=Array.from(new Map(t.map(e=>[e.key,e])).values()),e}function eO(e){switch(e_(e)){case"string":return e$(e);case"object":return eB(e);case"array":return eL(e);default:return eN(function(){return e},[])}}Object.keys(eI).forEach(function(e){eE().registerHelper(e,eI[e])}),eE().registerHelper("json",function(e){return JSON.stringify(e)}),eE().registerHelper("urlParse",function(e){try{return JSON.stringify(eP.parse(e))}catch(t){return`Invalid URL: ${e}`}}),eE().registerHelper("dateFormat",(e,t,l)=>"string"==typeof l?o()(e).tz(l).format(t):o()(e).format(t)),eE().registerHelper("isNull",e=>r().isNull(e));let e$=(()=>{let e=/{{(\w|:|[\s-+.,@/()?=*_$])+}}/g;return t=>{let l=[],r=e=>t,i=t.match(e);return i&&(l=i.map(eD),r=e=>(e=e||{},i.reduce((r,o,a)=>{let s=l[a],d=(0,n.get)(e,s.key);return(void 0===d&&(d=s.defaultValue),"function"==typeof d&&(d=d()),1===i.length&&t.startsWith("{{")&&t.endsWith("}}"))?d:(d instanceof Date&&(d=d.toISOString()),r.replace(o,null==d?"":d))},t))),eN(r,l)}})();function eB(e){let t=Object.keys(e).map(t=>({keyTemplate:e$(t),valueTemplate:eO(e[t])}));return eN(e=>t.reduce((t,l)=>(t[l.keyTemplate(e)]=l.valueTemplate(e),t),{}),t.reduce((e,t)=>e.concat(t.valueTemplate.parameters,t.keyTemplate.parameters),[]))}function eL(e){let t=e.map(eO);return eN(e=>t.map(t=>t(e)),t.reduce((e,t)=>e.concat(t.parameters),[]))}let eV=function(e){for(var t=arguments.length,l=Array(t>1?t-1:0),n=1;n<t;n++)l[n-1]=arguments[n];console.error(e,...l)};var eq=l(14744),ez=l.n(eq);let eK=(e,t,l)=>t;function eU(e,t,l){return ez()(e,t,{arrayMerge:eK,...l})}var eW=l(98892);let eH=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3;eW.Ay[t]({message:e,duration:l})};var eG=l(5062),eY=l(85738);function eJ(e,t){if(null==e||""===e)return"";let l=(0,eG.i5)(t);return(0,eY.Mg)(String(e),".",l)}var eX=l(63560),eQ=l.n(eX),eZ=l(95093),e0=l.n(eZ);let e1=/^\s*\{\{([\s\S]*)\}\}\s*$/;function e2(e){return e&&e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function e5(e){return e}function e4(e,t){let l=(t=t||{}).delimiter||".",n=t.maxDepth,i=t.transformKey||e5,o=t.transformValue||e5,a={};function s(e,d,u){u=u||1,r().isObjectLike(e)&&Object.keys(e).forEach(function(r){var c;let p=e[r],h=t.safe&&Array.isArray(p),m=Object.prototype.toString.call(p),f=e2(p),g="[object Object]"===m||"[object Array]"===m,v=d?d+l+i(r):i(r);if(null==(c=t.breakOn)?void 0:c.call(t,{key:r,value:p,path:v})){a[v]=o(p,v);return}if(!h&&!f&&g&&Object.keys(p).length&&(!t.maxDepth||u<n))return s(p,v,u+1);a[v]=o(p,v)})}return s(e),a}function e8(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l={},n=t.transformValue||e5;for(let t of Object.keys(e))eQ()(l,t,n(e[t],t));return l}let e3=e=>{let t=e.split(".").pop()||"";return t.startsWith("$")||(t=""),{operator:t}},e6=e=>["$dateOn","$dateNotOn","$dateBefore","$dateAfter","$dateNotBefore","$dateNotAfter","$dateBetween"].includes(e);function e9(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function e7(e){return(null==e?void 0:e.type)==="dateOnly"||(null==e?void 0:e.type)==="datetimeNoTz"||(null==e?void 0:e.constructor.name)==="DateOnlyField"||(null==e?void 0:e.constructor.name)==="DatetimeNoTzField"}let te=(e,t)=>e?(e.type&&(e=L({...e,timezone:t})),Array.isArray(e))?(2===e.length?e.push("[]",t):3===e.length&&e.push(t),e):"string"==typeof e?!t||/(\+|-)\d\d:\d\d$/.test(e)?e:e+t:e9(e)?e.toISOString():void 0:null,tt=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=new Set,n=t.vars||{},r=t.timezone,i=t.now,o=t.getField,a=e4(e,{breakOn(e){let{key:t}=e;return t.startsWith("$")&&"$and"!==t&&"$or"!==t},transformValue(e){if("string"!=typeof e)return e;let t=e1.exec(e);if(t){let e=t[1].trim();e.startsWith("$user")&&l.add(e.substring(6))}return e}});if(l.size>0){let e=await n.$user({fields:[...l.values()]});Object.assign(n,{$user:e})}return e8(a,{transformValue(e,t){let{operator:l}=e3(t);if("string"==typeof e){let a=e1.exec(e);if(a){let s=eC(n,a[1].trim(),null),d=null==o?void 0:o(t);e="function"==typeof s?null==s?void 0:s({field:d,operator:l,timezone:r,now:i}):s}}if(e6(l)){let l=null==o?void 0:o(t);return e7(l)?e.type?L({...e,timezone:(null==l?void 0:l.timezone)||r}):e:te(e,(null==l?void 0:l.timezone)||r)}return e}})};function tl(e){let{now:t,timezone:l="+00:00",offset:n}=e,r=tn(t).utcOffset(ex(l));return n>0?[(r=r.add(1,"day").startOf("day")).format("YYYY-MM-DD"),r.clone().add(n,"day").startOf("day").format("YYYY-MM-DD"),"[)",l]:[r.clone().subtract(-1*n-1,"day").startOf("day").format("YYYY-MM-DD"),r.clone().add(1,"day").startOf("day").format("YYYY-MM-DD"),"[)",l]}function tn(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e?o().isDayjs(e)?e:t?e0()(e):o()(e):t?e0()():o()()}function tr(e){var t;let{now:l,unit:n,timezone:r="+00:00",offset:i}=e,o=tn(l,"isoWeek"===n);o=(o=o.utcOffset(ex(r))).startOf(n),i>0?o=o.add(i,n):i<0&&(o=o.subtract(-1*i,n));let a={year:()=>o.format("YYYY"),quarter:()=>o.format("YYYY[Q]Q"),month:()=>o.format("YYYY-MM"),week:()=>o.format("gggg[w]ww"),isoWeek:()=>o.format("GGGG[W]WW"),day:()=>o.format("YYYY-MM-DD")},s=null==(t=a[n])?void 0:t.call(a);return r?s+r:s}let ti=(e,t)=>l=>{let{now:n,timezone:r,field:i}=l;return(null==i?void 0:i.timezone)&&(r=null==i?void 0:i.timezone),tr({now:n,timezone:r,unit:e,offset:t})},to=e=>t=>{let{now:l,timezone:n,field:r}=t;return(null==r?void 0:r.timezone)&&(n=null==r?void 0:r.timezone),tl({now:l,timezone:n,offset:e})};function ta(){return{now:new Date().toISOString(),today:ti("day"),yesterday:ti("day",-1),tomorrow:ti("day",1),thisWeek:ti("week"),lastWeek:ti("week",-1),nextWeek:ti("week",1),thisIsoWeek:ti("isoWeek"),lastIsoWeek:ti("isoWeek",-1),nextIsoWeek:ti("isoWeek",1),thisMonth:ti("month"),lastMonth:ti("month",-1),nextMonth:ti("month",1),thisQuarter:ti("quarter"),lastQuarter:ti("quarter",-1),nextQuarter:ti("quarter",1),thisYear:ti("year"),lastYear:ti("year",-1),nextYear:ti("year",1),last7Days:to(-7),next7Days:to(7),last30Days:to(-30),next30Days:to(30),last90Days:to(-90),next90Days:to(90)}}function ts(e){let t=e.split(".");return[t.shift(),t.join(".")]}var td=l(50467);class tu{register(e,t){if(!this.options.override&&this.map.has(e))throw Error(`this registry does not allow to override existing keys: "${e}"`);this.map.set(e,t)}get(e){return this.map.get(e)}getKeys(){return this.map.keys()}getValues(){return this.map.values()}getEntities(){return this.map.entries()}constructor(e={override:!1}){(0,td._)(this,"map",new Map),(0,td._)(this,"options",void 0),this.options=e}}l(67980);let tc=Symbol.for("nocobase.utils.sesLockdown"),tp=Symbol.for("nocobase.utils.bufferOverrides"),th=["globalThis","global","self","Function","AsyncFunction","GeneratorFunction","eval","Compartment","lockdown","harden","assert"];function tm(e){return!!e&&"object"==typeof e&&(e.message||"").includes("(SES_ALREADY_LOCKED_DOWN)")}function tf(){let e=globalThis;if(e[tp])return;let t=e.Buffer;if(!t||!t.prototype)return;let l=t.prototype;for(let e of Reflect.ownKeys(l)){let t=Object.getOwnPropertyDescriptor(l,e);if(!t||"function"!=typeof t.value||!t.configurable)continue;let n=t.value,r=function(){return n},i=function(t){if(this===l)throw TypeError(`Cannot assign to read only property '${String(e)}' of object 'Buffer.prototype'`);Object.defineProperty(this,e,{configurable:!0,enumerable:!0,writable:!0,value:t})};Object.defineProperty(r,"originalValue",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(l,e,{configurable:t.configurable,enumerable:t.enumerable,get:r,set:i})}e[tp]=!0}function tg(e){tf();let t=globalThis;if(!t[tc]){if("function"!=typeof lockdown)throw Error("SES lockdown is unavailable in the current runtime environment.");try{lockdown(e)}catch(e){if(!tm(e))throw e}t[tc]=!0}}function tv(e,t){return t?`{{t(${JSON.stringify(e)}, ${JSON.stringify(t)})}}`:`{{t(${JSON.stringify(e)})}}`}var ty=l(65606);let tb=e=>{for(;e;){var t;if("root"===e.id||(null==(t=e.classList)?void 0:t.contains("nb-action")))return!1;e=e.parentNode}return!ty.env.__TEST__};function tx(e,t){return e.replace(/\{\{(\w+)\}\}/g,function(e,l){return void 0!==t[l]?t[l]:e})}let tw=36,tS="";for(;tw--;)tS+=tw.toString(36);function tM(e){let t="",l=e||11;for(;l--;)t+=tS[36*Math.random()|0];return t}function tA(e){let t;try{t=new URL(e)}catch(e){return!1}return"http:"===t.protocol||"https:"===t.protocol}var tF=l(27153),tk="2.1.34";let tC=(e,t)=>{if(!e)return e;if("Grid"!==e["x-component"])return Object.keys(e.properties||{}).forEach(l=>{e.properties[l]=tC(e.properties[l],t)}),e;let l=e.parent;e=e.toJSON?e.toJSON():r().cloneDeep(e);let n={},{properties:i={}}=e,o=0;if(Object.keys(i).forEach((e,l)=>{let a=i[e];if("Grid.Row"!==a["x-component"]){a["x-index"]=++o,n[e]=a;return}if(a.properties){if(1===Object.keys(a.properties).length){a["x-index"]=++o,n[e]=a;return}Object.keys(a.properties).forEach((l,i)=>{let s=a.properties[l];if(r().set(s,"x-component-props.width",100),0===i){a["x-index"]=++o,n[e]=a;return}null!=t&&t(s)||(delete a.properties[l],n[`${tM()}_${l}`]=tP(s,l,++o))})}}),e.properties=n,l){let t=new tF.S(e,l);return l.properties&&Object.keys(l.properties).forEach(n=>{n===e.name&&(l.properties[n]=t)}),t}return e};function tP(e,t,l){return{type:"void",version:"2.0","x-component":"Grid.Row","x-app-version":tk,"x-uid":tM(),"x-async":!1,"x-index":l,_isJSONSchemaObject:!0,properties:{[t]:e}}}function tj(e){let t=new Set,l=e=>{if("string"==typeof e){let l,n=/\{\{\s*([^}]+?)\s*\}\}/g;for(;null!==(l=n.exec(e));){let e,n,r=l[1],i=/ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*)/g;for(;null!==(e=i.exec(r));)t.add(e[1]);let o=/ctx\[\s*(["'])\s*([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\1\s*\]/g;for(;null!==(n=o.exec(r));)t.add(n[2])}}else Array.isArray(e)?e.forEach(l):e&&"object"==typeof e&&Object.values(e).forEach(l)};return l(e),t}function tE(e){let t={},l=e=>{if("string"==typeof e){let l,n=/\{\{\s*([^}]+?)\s*\}\}/g;for(;null!==(l=n.exec(e));){let e,n,r=l[1],i=/ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*)([^\s)]*)/g;for(;null!==(e=i.exec(r));){let l=e[1],n=e[2]||"";if(t[l]=t[l]||[],n.startsWith("."))t[l].push(n.slice(1));else if(n.startsWith("[")){let e=n.match(/^\[\s*(["'])\s*([^'"\]]+)\s*\1\s*\](.*)$/);if(e){let n=e[2],r=e[3]||"";t[l].push(`${n}${r}`)}else{let e=n.match(/^\[(\d+)\](.*)$/);if(e){let n=e[1],r=e[2]||"";t[l].push(`[${n}]${r}`)}}}else n.startsWith("(")&&!t[l].length&&t[l].push("")}let o=/ctx\[\s*(["'])\s*([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\1\s*\]([^\s)]*)/g;for(;null!==(n=o.exec(r));){let e=n[2],l=n[3]||"";if(t[e]=t[e]||[],l.startsWith("."))t[e].push(l.slice(1));else if(l.startsWith("[")){let n=l.match(/^\[\s*(["'])\s*([^'"\]]+)\s*\1\s*\](.*)$/);if(n){let l=n[2],r=n[3]||"";t[e].push(`${l}${r}`)}else{let n=l.match(/^\[(\d+)\](.*)$/);if(n){let l=n[1],r=n[2]||"";t[e].push(`[${l}]${r}`)}}}else l.startsWith("(")&&!t[e].length&&t[e].push("")}}}else Array.isArray(e)?e.forEach(l):e&&"object"==typeof e&&Object.values(e).forEach(l)};return l(e),t}let tR=new(l(23155)).HX;function tI(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t={};for(let l of e){let e=l.replace(/^ctx\./,"").split("."),n=t;for(let t=0;t<e.length;t++){let r=e[t];t===e.length-1?n[r]=`{{${l}}}`:(n[r]=n[r]||{},n=n[r])}}return t}async function tT(e){return tI(await tR.fullVariables(e))}async function t_(e,t){return await tR.parseAndRender(e,{ctx:t})}function tD(e){let t=1,l={};return{sql:e.replace(/{{\s*([^}]+)\s*}}/g,(e,n)=>{let r=`__var${t}`;return l[r]=`{{${n.trim()}}}`,t++,`$${r}`}),bind:l}}async function tN(e){let{sql:t,bind:l}=tD(e),n=await tT(t);return{sql:t,bind:l,liquidContext:n}}},59598(){},23005(){},14892(){},2813(){},9845(){}};import{__webpack_require__}from"./runtime-72080663.js";var __webpack_exec__=function(e){return __webpack_require__(__webpack_require__.s=e)};import*as __rspack_chunk_1 from"./vendor-antd-ecosystem-de737eca.js";__webpack_require__.C(__rspack_chunk_1);import*as __rspack_chunk_2 from"./vendor-moment-84b317dc.js";__webpack_require__.C(__rspack_chunk_2);import*as __rspack_chunk_3 from"./vendor-lodash-905dd3b8.js";__webpack_require__.C(__rspack_chunk_3);import*as __rspack_chunk_4 from"./vendor-ses-b7bccbcd.js";__webpack_require__.C(__rspack_chunk_4);import*as __rspack_chunk_5 from"./vendor-antd-icons-97ed2369.js";__webpack_require__.C(__rspack_chunk_5);import*as __rspack_chunk_6 from"./vendor-antd-f8c3ace1.js";__webpack_require__.C(__rspack_chunk_6);import*as __rspack_chunk_7 from"./8384-4b58de2e.js";__webpack_require__.C(__rspack_chunk_7);import*as __rspack_chunk_8 from"./index-1508b437.js";__webpack_require__.C(__rspack_chunk_8),__webpack_exec__(35963);
|