@ibiz-template/runtime 0.1.21 → 0.1.23-alpha.0
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/index.esm.js +923 -204
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/out/constant/view-call-tag.d.ts +9 -1
- package/out/constant/view-call-tag.d.ts.map +1 -1
- package/out/constant/view-call-tag.js +8 -0
- package/out/controller/control/data-view/data-view.controller.d.ts +25 -2
- package/out/controller/control/data-view/data-view.controller.d.ts.map +1 -1
- package/out/controller/control/data-view/data-view.controller.js +70 -30
- package/out/controller/control/data-view/data-view.service.d.ts +1 -1
- package/out/controller/control/data-view/data-view.service.d.ts.map +1 -1
- package/out/controller/control/data-view/data-view.service.js +2 -1
- package/out/controller/control/form/edit-form/edit-form.service.d.ts.map +1 -1
- package/out/controller/control/form/edit-form/edit-form.service.js +1 -0
- package/out/controller/control/form/form-detail/form-druipart/form-druipart.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-druipart/form-druipart.controller.js +8 -4
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +1 -1
- package/out/controller/control/grid/grid/grid.service.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.service.js +1 -0
- package/out/controller/control/index.d.ts +1 -0
- package/out/controller/control/index.d.ts.map +1 -1
- package/out/controller/control/index.js +1 -0
- package/out/controller/control/kanban/index.d.ts +3 -0
- package/out/controller/control/kanban/index.d.ts.map +1 -0
- package/out/controller/control/kanban/index.js +2 -0
- package/out/controller/control/kanban/kanban.controller.d.ts +99 -0
- package/out/controller/control/kanban/kanban.controller.d.ts.map +1 -0
- package/out/controller/control/kanban/kanban.controller.js +310 -0
- package/out/controller/control/kanban/kanban.service.d.ts +24 -0
- package/out/controller/control/kanban/kanban.service.d.ts.map +1 -0
- package/out/controller/control/kanban/kanban.service.js +26 -0
- package/out/controller/control/list/list.controller.d.ts.map +1 -1
- package/out/controller/control/list/list.controller.js +3 -0
- package/out/controller/control/list/list.service.d.ts.map +1 -1
- package/out/controller/control/list/list.service.js +1 -0
- package/out/controller/control/md-ctrl/md-ctrl.service.d.ts.map +1 -1
- package/out/controller/control/md-ctrl/md-ctrl.service.js +1 -0
- package/out/controller/control/pickup-view-panel/pickup-view-panel.controller.d.ts.map +1 -1
- package/out/controller/control/pickup-view-panel/pickup-view-panel.controller.js +3 -2
- package/out/controller/control/toolbar/toolbar.controllerr.js +2 -2
- package/out/controller/ctx/ctx.d.ts +8 -0
- package/out/controller/ctx/ctx.d.ts.map +1 -1
- package/out/controller/ctx/ctx.js +12 -0
- package/out/de-logic/utils/handle-src-val.d.ts.map +1 -1
- package/out/de-logic/utils/handle-src-val.js +6 -4
- package/out/engine/view-base.engine.d.ts.map +1 -1
- package/out/engine/view-base.engine.js +2 -1
- package/out/interface/controller/controller/common/i-drag-change-info.d.ts +38 -0
- package/out/interface/controller/controller/common/i-drag-change-info.d.ts.map +1 -0
- package/out/interface/controller/controller/common/i-drag-change-info.js +1 -0
- package/out/interface/controller/controller/common/index.d.ts +1 -0
- package/out/interface/controller/controller/common/index.d.ts.map +1 -1
- package/out/interface/controller/controller/common/index.js +1 -0
- package/out/interface/controller/controller/control/i-data-view-control.controller.d.ts +1 -1
- package/out/interface/controller/controller/control/i-data-view-control.controller.d.ts.map +1 -1
- package/out/interface/controller/controller/control/i-kanban.controller.d.ts +14 -0
- package/out/interface/controller/controller/control/i-kanban.controller.d.ts.map +1 -0
- package/out/interface/controller/controller/control/i-kanban.controller.js +1 -0
- package/out/interface/controller/controller/control/i-panel.controller.d.ts +7 -0
- package/out/interface/controller/controller/control/i-panel.controller.d.ts.map +1 -1
- package/out/interface/controller/controller/control/index.d.ts +1 -0
- package/out/interface/controller/controller/control/index.d.ts.map +1 -1
- package/out/interface/controller/controller/control/index.js +1 -0
- package/out/interface/controller/controller/control/panel-item/i-panel-data-container.controller.d.ts +7 -0
- package/out/interface/controller/controller/control/panel-item/i-panel-data-container.controller.d.ts.map +1 -1
- package/out/interface/controller/event/control/i-kanban.event.d.ts +3 -3
- package/out/interface/controller/event/control/i-kanban.event.d.ts.map +1 -1
- package/out/interface/controller/event/view/i-kanban-view.event.d.ts +1 -1
- package/out/interface/controller/state/control/i-kanban.state.d.ts +33 -0
- package/out/interface/controller/state/control/i-kanban.state.d.ts.map +1 -0
- package/out/interface/controller/state/control/i-kanban.state.js +1 -0
- package/out/interface/controller/state/control/i-md-control.state.d.ts +7 -0
- package/out/interface/controller/state/control/i-md-control.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/index.d.ts +1 -0
- package/out/interface/controller/state/control/index.d.ts.map +1 -1
- package/out/interface/controller/state/control/index.js +1 -0
- package/out/interface/controller/state/view/i-kanban-view.state.d.ts +11 -0
- package/out/interface/controller/state/view/i-kanban-view.state.d.ts.map +1 -0
- package/out/interface/controller/state/view/i-kanban-view.state.js +1 -0
- package/out/interface/controller/state/view/index.d.ts +1 -0
- package/out/interface/controller/state/view/index.d.ts.map +1 -1
- package/out/interface/controller/state/view/index.js +1 -0
- package/out/logic-scheduler/trigger/timer-trigger.d.ts +1 -2
- package/out/logic-scheduler/trigger/timer-trigger.d.ts.map +1 -1
- package/out/service/dto/method.dto.d.ts.map +1 -1
- package/out/service/dto/method.dto.js +1 -2
- package/out/service/service/entity/method/method.d.ts.map +1 -1
- package/out/service/service/entity/method/method.js +3 -1
- package/out/service/service/work-flow/work-flow.service.d.ts +11 -0
- package/out/service/service/work-flow/work-flow.service.d.ts.map +1 -1
- package/out/service/service/work-flow/work-flow.service.js +15 -0
- package/out/service/vo/control.vo.d.ts +1 -0
- package/out/service/vo/control.vo.d.ts.map +1 -1
- package/out/service/vo/control.vo.js +18 -5
- package/out/service/vo/ui-map-field.d.ts +8 -0
- package/out/service/vo/ui-map-field.d.ts.map +1 -1
- package/out/service/vo/ui-map-field.js +3 -0
- package/out/ui-logic/ui-logic-link/ui-logic-link-single-cond/ui-logic-link-single-cond.js +1 -1
- package/out/ui-logic/ui-logic-node/append-param-node/append-param-node.d.ts +17 -0
- package/out/ui-logic/ui-logic-node/append-param-node/append-param-node.d.ts.map +1 -0
- package/out/ui-logic/ui-logic-node/append-param-node/append-param-node.js +25 -0
- package/out/ui-logic/ui-logic-node/copy-param-node/copy-param-node.d.ts +17 -0
- package/out/ui-logic/ui-logic-node/copy-param-node/copy-param-node.d.ts.map +1 -0
- package/out/ui-logic/ui-logic-node/copy-param-node/copy-param-node.js +23 -0
- package/out/ui-logic/ui-logic-node/data-set-node/data-set-node.d.ts +17 -0
- package/out/ui-logic/ui-logic-node/data-set-node/data-set-node.d.ts.map +1 -0
- package/out/ui-logic/ui-logic-node/data-set-node/data-set-node.js +21 -0
- package/out/ui-logic/ui-logic-node/execute-de-logic-node/execute-de-logic-node.d.ts +17 -0
- package/out/ui-logic/ui-logic-node/execute-de-logic-node/execute-de-logic-node.d.ts.map +1 -0
- package/out/ui-logic/ui-logic-node/execute-de-logic-node/execute-de-logic-node.js +37 -0
- package/out/ui-logic/ui-logic-node/index.d.ts +9 -0
- package/out/ui-logic/ui-logic-node/index.d.ts.map +1 -1
- package/out/ui-logic/ui-logic-node/index.js +9 -0
- package/out/ui-logic/ui-logic-node/prepare-js-param-node/prepare-js-param-node.d.ts +56 -1
- package/out/ui-logic/ui-logic-node/prepare-js-param-node/prepare-js-param-node.d.ts.map +1 -1
- package/out/ui-logic/ui-logic-node/prepare-js-param-node/prepare-js-param-node.js +122 -12
- package/out/ui-logic/ui-logic-node/renew-param-node/renew-param-node.d.ts +17 -0
- package/out/ui-logic/ui-logic-node/renew-param-node/renew-param-node.d.ts.map +1 -0
- package/out/ui-logic/ui-logic-node/renew-param-node/renew-param-node.js +20 -0
- package/out/ui-logic/ui-logic-node/reset-param-node/reset-param-node.d.ts +17 -0
- package/out/ui-logic/ui-logic-node/reset-param-node/reset-param-node.d.ts.map +1 -0
- package/out/ui-logic/ui-logic-node/reset-param-node/reset-param-node.js +20 -0
- package/out/ui-logic/ui-logic-node/sort-param-node/sort-param-node.d.ts +17 -0
- package/out/ui-logic/ui-logic-node/sort-param-node/sort-param-node.d.ts.map +1 -0
- package/out/ui-logic/ui-logic-node/sort-param-node/sort-param-node.js +24 -0
- package/out/ui-logic/ui-logic-node/throw-exception-node/throw-exception-node.d.ts +17 -0
- package/out/ui-logic/ui-logic-node/throw-exception-node/throw-exception-node.d.ts.map +1 -0
- package/out/ui-logic/ui-logic-node/throw-exception-node/throw-exception-node.js +17 -0
- package/out/ui-logic/ui-logic-node/view-ctrl-fire-event-node/view-ctrl-fire-event-node.d.ts +16 -0
- package/out/ui-logic/ui-logic-node/view-ctrl-fire-event-node/view-ctrl-fire-event-node.d.ts.map +1 -0
- package/out/ui-logic/ui-logic-node/view-ctrl-fire-event-node/view-ctrl-fire-event-node.js +37 -0
- package/out/ui-logic/ui-logic-param/ui-logic-param.d.ts.map +1 -1
- package/out/ui-logic/ui-logic-param/ui-logic-param.js +2 -2
- package/out/ui-logic/ui-logic.d.ts.map +1 -1
- package/out/ui-logic/ui-logic.js +24 -6
- package/out/ui-logic/utils/handle-src-val.d.ts.map +1 -1
- package/out/ui-logic/utils/handle-src-val.js +7 -5
- package/out/utils/verify/de-rule-verify.js +1 -1
- package/package.json +7 -7
- package/src/constant/view-call-tag.ts +8 -0
- package/src/controller/control/data-view/data-view.controller.ts +93 -43
- package/src/controller/control/data-view/data-view.service.ts +5 -2
- package/src/controller/control/form/edit-form/edit-form.service.ts +1 -0
- package/src/controller/control/form/form-detail/form-druipart/form-druipart.controller.ts +10 -5
- package/src/controller/control/grid/grid/grid.controller.ts +1 -1
- package/src/controller/control/grid/grid/grid.service.ts +1 -0
- package/src/controller/control/index.ts +1 -0
- package/src/controller/control/kanban/index.ts +2 -0
- package/src/controller/control/kanban/kanban.controller.ts +370 -0
- package/src/controller/control/kanban/kanban.service.ts +33 -0
- package/src/controller/control/list/list.controller.ts +3 -0
- package/src/controller/control/list/list.service.ts +1 -0
- package/src/controller/control/md-ctrl/md-ctrl.service.ts +1 -0
- package/src/controller/control/pickup-view-panel/pickup-view-panel.controller.ts +3 -2
- package/src/controller/control/toolbar/toolbar.controllerr.ts +2 -2
- package/src/controller/ctx/ctx.ts +13 -0
- package/src/de-logic/utils/handle-src-val.ts +6 -4
- package/src/engine/view-base.engine.ts +2 -1
- package/src/interface/controller/controller/common/i-drag-change-info.ts +40 -0
- package/src/interface/controller/controller/common/index.ts +1 -0
- package/src/interface/controller/controller/control/i-data-view-control.controller.ts +5 -6
- package/src/interface/controller/controller/control/i-kanban.controller.ts +14 -0
- package/src/interface/controller/controller/control/i-panel.controller.ts +8 -0
- package/src/interface/controller/controller/control/index.ts +1 -0
- package/src/interface/controller/controller/control/panel-item/i-panel-data-container.controller.ts +8 -0
- package/src/interface/controller/event/control/i-kanban.event.ts +3 -3
- package/src/interface/controller/event/view/i-kanban-view.event.ts +1 -1
- package/src/interface/controller/state/control/i-kanban.state.ts +35 -0
- package/src/interface/controller/state/control/i-md-control.state.ts +8 -0
- package/src/interface/controller/state/control/index.ts +1 -0
- package/src/interface/controller/state/view/i-kanban-view.state.ts +10 -0
- package/src/interface/controller/state/view/index.ts +1 -0
- package/src/logic-scheduler/trigger/timer-trigger.ts +2 -2
- package/src/service/dto/method.dto.ts +1 -2
- package/src/service/service/entity/method/method.ts +3 -1
- package/src/service/service/work-flow/work-flow.service.ts +28 -0
- package/src/service/vo/control.vo.ts +19 -4
- package/src/service/vo/ui-map-field.ts +12 -0
- package/src/ui-logic/ui-logic-link/ui-logic-link-single-cond/ui-logic-link-single-cond.ts +1 -1
- package/src/ui-logic/ui-logic-node/append-param-node/append-param-node.ts +44 -0
- package/src/ui-logic/ui-logic-node/copy-param-node/copy-param-node.ts +31 -0
- package/src/ui-logic/ui-logic-node/data-set-node/data-set-node.ts +37 -0
- package/src/ui-logic/ui-logic-node/execute-de-logic-node/execute-de-logic-node.ts +57 -0
- package/src/ui-logic/ui-logic-node/index.ts +9 -0
- package/src/ui-logic/ui-logic-node/prepare-js-param-node/prepare-js-param-node.ts +153 -17
- package/src/ui-logic/ui-logic-node/renew-param-node/renew-param-node.ts +25 -0
- package/src/ui-logic/ui-logic-node/reset-param-node/reset-param-node.ts +25 -0
- package/src/ui-logic/ui-logic-node/sort-param-node/sort-param-node.ts +29 -0
- package/src/ui-logic/ui-logic-node/throw-exception-node/throw-exception-node.ts +23 -0
- package/src/ui-logic/ui-logic-node/view-ctrl-fire-event-node/view-ctrl-fire-event-node.ts +47 -0
- package/src/ui-logic/ui-logic-param/ui-logic-param.ts +2 -5
- package/src/ui-logic/ui-logic.ts +32 -5
- package/src/ui-logic/utils/handle-src-val.ts +7 -5
- package/src/utils/verify/de-rule-verify.ts +1 -1
package/dist/index.system.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["@ibiz-template/core","lodash-es","qx-util","qs","ramda","dayjs","dayjs/plugin/minMax","dayjs/plugin/isSameOrBefore","dayjs/plugin/quarterOfYear","dayjs/plugin/weekOfYear","dayjs/plugin/isoWeek","async-validator"],(function(t){"use strict";var e,a,s,i,n,r,o,c,l,h,d,u,p,m,f,g,E,w,v,y,I,D,C,b,A,P,_,S,x,T,L,O,N,R,M,V,k,F,W,B,U,j,z,G,H,X,K,Y,$,q,Q,J,Z,tt,et,at,st,it,nt,rt,ot,ct,lt;return{setters:[function(t){e=t.RuntimeError,a=t.RuntimeModelError,s=t.ModelError,i=t.IBizContext,n=t.HttpResponse,r=t.HttpError,o=t.CoreConst,c=t.Net,l=t.NOOP,h=t.NoticeError,d=t.isElementSame,u=t.findRecursiveChild,p=t.StringUtil,m=t.recursiveIterate,f=t.debounceAndAsyncMerge,g=t.mergeDefaultInLeft,E=t.isOverlap,w=t.awaitTimeout,v=t.mergeInLeft,y=t.DataTypes,I=t.toNumberOrNil},function(t){D=t.isEmpty,C=t.debounce,b=t.isArray,A=t.camelCase,P=t.eq,_=t.gt,S=t.gte,x=t.findIndex,T=t.lt,L=t.lte,O=t.upperFirst,N=t.snakeCase,R=t.kebabCase,M=t.isFunction},function(t){V=t.notNilEmpty,k=t.isNilOrEmpty,F=t.AsyncSeriesHook,W=t.QXEvent,B=t.createUUID,U=t.isArray,j=t.setCookie,z=t.clearCookie,G=t.clearAll,H=t.ascSort,X=t.descSort},function(t){K=t.default},function(t){Y=t.isNotNil,$=t.isNil,q=t.mergeRight,Q=t.isEmpty,J=t.clone,Z=t.equals,tt=t.where,et=t.mergeLeft,at=t.mergeDeepRight},function(t){st=t.default},function(t){it=t.default},function(t){nt=t.default},function(t){rt=t.default},function(t){ot=t.default},function(t){ct=t.default},function(t){lt=t.default}],execute:function(){t({calcContentAlignStyle:function(t){const{valignSelf:e,halignSelf:a}=t;let s;if(e||a){switch(s={display:"flex"},e){case"TOP":Object.assign(s,{"align-items":"flex-start"});break;case"MIDDLE":Object.assign(s,{"align-items":"center"});break;case"BOTTOM":Object.assign(s,{"align-items":"flex-end"})}switch(a){case"LEFT":Object.assign(s,{"justify-content":"flex-start"});break;case"CENTER":Object.assign(s,{"justify-content":"center"});break;case"RIGHT":Object.assign(s,{"justify-content":"flex-end"});break;case"JUSTIFY":Object.assign(s,{"justify-content":"space-between"})}}return s},calcDeCodeNameById:ze,calcDynaClass:Be,calcGridLayoutPos:function(t){const{layout:e,colXS:a,colXSOffset:s,colSM:i,colSMOffset:n,colMD:r,colMDOffset:o,colLG:c,colLGOffset:l}=t,h=(t,a)=>({span:(t&&-1!==t?t:"TABLE_24COL"===e?24:12)*("TABLE_24COL"===e?1:2),offset:a&&-1!==a?a:void 0});return{xs:h(a,s),sm:h(i,n),md:h(r,o),lg:h(c,l)}},calcLayoutHeightWidth:We,calcMainStateOPPrivsStrs:je,calcNavParams:Ve,calcResPath:xs,compare:oa,compareNumber:ca,contains:la,convertNavData:Le,convertNavDataByArray:Oe,convertNavDataByObject:Ne,convertObjectToNavParams:Re,execDELogic:ii,execDELogicAction:ni,execDELogicById:async function(t,a,s,i,n){const r=await async function(t,e,a){const s=await ibiz.hub.getAppDataEntity(e,a);return Xe(t,s)}(t,a,s.srfappid);if(!r)throw new e("".concat(a,"找不到实体逻辑").concat(t));return ii(r,s,i,n)},execFieldLogics:ri,execUILogic:In,filterFieldLogics:Ke,filterValueRules:xa,findChildFormDetails:ta,findDELogic:Xe,findEditItem:Ze,findFieldById:Ye,findModelChild:ke,formatMultiData:Me,generateRules:Fi,getAppCounterProvider:ws,getAppViewRef:function(t,e){var a,s;let i=t.appViewRefs||[];(null==(s=null==(a=t.viewLayoutPanel)?void 0:a.appViewRefs)?void 0:s.length)&&(i=i.concat(t.viewLayoutPanel.appViewRefs));return i.find((t=>t.name===e||t.id===e))},getChildNodeRSs:Je,getControl:function(t,e){var a,s;let i=t.controls||[];(null==(s=null==(a=t.viewLayoutPanel)?void 0:a.controls)?void 0:s.length)&&(i=i.concat(t.viewLayoutPanel.controls));return i.find((t=>t.name===e||t.codeName===e||t.id===e))},getControlProvider:Ka,getControlsByView:ea,getDeACMode:async function(t,e,a){var s;const i=await ibiz.hub.getAppDataEntity(e,a);return null==(s=i.appDEACModes)?void 0:s.find((e=>e.id===t))},getEditorProvider:qa,getFormDetailProvider:Za,getFormTypeFieldName:He,getGridColumnProvider:as,getMatchResPath:Ss,getOriginData:ki,getPanelItemProvider:ns,getPortletProvider:ms,getRootNode:qe,getTreeNode:Qe,getUIActionById:$e,getUIActionProvider:ls,getViewEngines:sa,getViewLogics:aa,getViewProvider:async function(t){let e;const{viewType:a,viewStyle:s,sysPFPluginId:i,appId:n}=t;if(i){const t=await Ga(i,n);if(t&&(e=ds(t)),e)return e;ibiz.log.error("找不到视图插件".concat(t,"对应的适配器"))}if(s&&"DEFAULT"!==s){if(e=ds("".concat(a,"_").concat(s)),e)return e;ibiz.log.error("找不到视图类型:[".concat(a,"]的视图样式:[").concat(s,"]对应的适配器"),t)}e||(e=ds(a));e||(e=ds("DEFAULT"));return e},getWFContext:va,getWFSubmitViewId:function(t,e){var a;const{type:s,sequenceflowview:i,sequenceflowmobview:n}=e,r=(null==(a=t.viewLayoutPanel)?void 0:a.appViewRefs)||t.appViewRefs,o=s?"WFUTILACTION@".concat(s.toUpperCase()):"WFACTION@".concat(ibiz.env.isMob?n:i),c=r.find((t=>t.name===o));return null==c?void 0:c.refAppViewId},hasDeCodeName:Ge,install:function(){const{ibiz:t}=window;t.util=new Ir,t.hub=new wr,t.register=new ce,t.config=new oe,t.auth=new fi,t.engine=new vr,Ma(),Sn(),Ds(),ibiz.scheduler=new Sr,ibiz.scheduler.triggerFactory.register("ITEMVISIBLE",((t,e)=>new Lr(t,e))),ibiz.scheduler.triggerFactory.register("ITEMENABLE",((t,e)=>new Lr(t,e))),ibiz.scheduler.triggerFactory.register("ITEMBLANK",((t,e)=>new Lr(t,e))),ibiz.scheduler.triggerFactory.register("TIMER",((t,e)=>new Or(t,e))),ibiz.scheduler.triggerFactory.register("CUSTOM",((t,e)=>new Tr(t,e))),ibiz.scheduler.triggerFactory.register("VIEWEVENT",((t,e)=>new Rr(t,e))),ibiz.scheduler.triggerFactory.register("CTRLEVENT",((t,e)=>new Mr(t,e))),ibiz.scheduler.executorFactory.register("SCRIPT",((t,e)=>new Cr(t,e))),ibiz.scheduler.executorFactory.register("APPDEUILOGIC",((t,e)=>new br(t,e))),ibiz.scheduler.executorFactory.register("DEUILOGIC",((t,e)=>new br(t,e))),ibiz.scheduler.executorFactory.register("APPUILOGIC",((t,e)=>new Nr(t,e)))},installCommand:Ma,isDataContainer:function(t){return"CONTAINER"===t.itemType&&["CONTAINER_MULTIDATA","CONTAINER_SINGLEDATA"].includes(t.predefinedType)},isValueChange:Vi,matchMainState:Ue,openRedirectView:ia,parseUserParams:Fe,presetAppCounterProvider:Ds,presetUIActionProvider:Sn,registerAppCounterProvider:gs,registerControlProvider:function(t,e){ibiz.register.register("".concat(Ha,"_").concat(t),e)},registerEditorProvider:function(t,e){ibiz.register.register("".concat(Ya,"_").concat(t),e)},registerFormDetailProvider:function(t,e){ibiz.register.register("".concat(Qa,"_").concat(t),e)},registerGridColumnProvider:function(t,e){ibiz.register.register("".concat(ts,"_").concat(t),e)},registerPanelItemProvider:function(t,e){ibiz.register.register("".concat(ss,"_").concat(t.toUpperCase()),e)},registerPortletProvider:function(t,e){ibiz.register.register("".concat(us,"_").concat(t),e)},registerUIActionProvider:os,registerViewProvider:function(t,e){ibiz.register.register("".concat(hs,"_").concat(t),e)},strContain:ha,testCond:ra,toLocalOpenWFRedirectView:na,verifyDeRules:ma,verifyFormGroupLogic:ga,verifyPanelGroupLogic:Ea});var ht=Object.create,dt=Object.defineProperty,ut=Object.getOwnPropertyDescriptor,pt=Object.getOwnPropertyNames,mt=Object.getPrototypeOf,ft=Object.prototype.hasOwnProperty,gt=(t,e)=>function(){return e||(0,t[pt(t)[0]])((e={exports:{}}).exports,e),e.exports},Et=(t,e,a)=>(a=null!=t?ht(mt(t)):{},((t,e,a,s)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let i of pt(e))ft.call(t,i)||i===a||dt(t,i,{get:()=>e[i],enumerable:!(s=ut(e,i))||s.enumerable});return t})(!e&&t&&t.__esModule?a:dt(a,"default",{value:t,enumerable:!0}),t)),wt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/utils.js"(t){t.__esModule=!0,t.extend=n,t.indexOf=function(t,e){for(var a=0,s=t.length;a<s;a++)if(t[a]===e)return a;return-1},t.escapeExpression=function(t){if("string"!=typeof t){if(t&&t.toHTML)return t.toHTML();if(null==t)return"";if(!t)return t+"";t=""+t}if(!s.test(t))return t;return t.replace(a,i)},t.isEmpty=function(t){return!t&&0!==t||!(!c(t)||0!==t.length)},t.createFrame=function(t){var e=n({},t);return e._parent=t,e},t.blockParams=function(t,e){return t.path=e,t},t.appendContextPath=function(t,e){return(t?t+".":"")+e};var e={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},a=/[&<>"'`=]/g,s=/[&<>"'`=]/;function i(t){return e[t]}function n(t){for(var e=1;e<arguments.length;e++)for(var a in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],a)&&(t[a]=arguments[e][a]);return t}var r=Object.prototype.toString;t.toString=r;var o=function(t){return"function"==typeof t};o(/x/)&&(t.isFunction=o=function(t){return"function"==typeof t&&"[object Function]"===r.call(t)}),t.isFunction=o;var c=Array.isArray||function(t){return!(!t||"object"!=typeof t)&&"[object Array]"===r.call(t)};t.isArray=c}}),vt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/exception.js"(t,e){t.__esModule=!0;var a=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function s(t,e){var i=e&&e.loc,n=void 0,r=void 0,o=void 0,c=void 0;i&&(n=i.start.line,r=i.end.line,o=i.start.column,c=i.end.column,t+=" - "+n+":"+o);for(var l=Error.prototype.constructor.call(this,t),h=0;h<a.length;h++)this[a[h]]=l[a[h]];Error.captureStackTrace&&Error.captureStackTrace(this,s);try{i&&(this.lineNumber=n,this.endLineNumber=r,Object.defineProperty?(Object.defineProperty(this,"column",{value:o,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:c,enumerable:!0})):(this.column=o,this.endColumn=c))}catch(t){}}s.prototype=new Error,t.default=s,e.exports=t.default}}),yt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers/block-helper-missing.js"(t,e){t.__esModule=!0;var a=wt();t.default=function(t){t.registerHelper("blockHelperMissing",(function(e,s){var i=s.inverse,n=s.fn;if(!0===e)return n(this);if(!1===e||null==e)return i(this);if(a.isArray(e))return e.length>0?(s.ids&&(s.ids=[s.name]),t.helpers.each(e,s)):i(this);if(s.data&&s.ids){var r=a.createFrame(s.data);r.contextPath=a.appendContextPath(s.data.contextPath,s.name),s={data:r}}return n(e,s)}))},e.exports=t.default}}),It=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers/each.js"(t,e){t.__esModule=!0;var a,s=wt(),i=vt(),n=(a=i)&&a.__esModule?a:{default:a};t.default=function(t){t.registerHelper("each",(function(t,e){if(!e)throw new n.default("Must pass iterator to #each");var a,i=e.fn,r=e.inverse,o=0,c="",l=void 0,h=void 0;function d(e,a,n){l&&(l.key=e,l.index=a,l.first=0===a,l.last=!!n,h&&(l.contextPath=h+e)),c+=i(t[e],{data:l,blockParams:s.blockParams([t[e],e],[h+e,null])})}if(e.data&&e.ids&&(h=s.appendContextPath(e.data.contextPath,e.ids[0])+"."),s.isFunction(t)&&(t=t.call(this)),e.data&&(l=s.createFrame(e.data)),t&&"object"==typeof t)if(s.isArray(t))for(var u=t.length;o<u;o++)o in t&&d(o,o,o===t.length-1);else if("function"==typeof Symbol&&t[Symbol.iterator]){for(var p=[],m=t[Symbol.iterator](),f=m.next();!f.done;f=m.next())p.push(f.value);for(u=(t=p).length;o<u;o++)d(o,o,o===t.length-1)}else a=void 0,Object.keys(t).forEach((function(t){void 0!==a&&d(a,o-1),a=t,o++})),void 0!==a&&d(a,o-1,!0);return 0===o&&(c=r(this)),c}))},e.exports=t.default}}),Dt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js"(t,e){t.__esModule=!0;var a,s=vt(),i=(a=s)&&a.__esModule?a:{default:a};t.default=function(t){t.registerHelper("helperMissing",(function(){if(1!==arguments.length)throw new i.default('Missing helper: "'+arguments[arguments.length-1].name+'"')}))},e.exports=t.default}}),Ct=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers/if.js"(t,e){t.__esModule=!0;var a,s=wt(),i=vt(),n=(a=i)&&a.__esModule?a:{default:a};t.default=function(t){t.registerHelper("if",(function(t,e){if(2!=arguments.length)throw new n.default("#if requires exactly one argument");return s.isFunction(t)&&(t=t.call(this)),!e.hash.includeZero&&!t||s.isEmpty(t)?e.inverse(this):e.fn(this)})),t.registerHelper("unless",(function(e,a){if(2!=arguments.length)throw new n.default("#unless requires exactly one argument");return t.helpers.if.call(this,e,{fn:a.inverse,inverse:a.fn,hash:a.hash})}))},e.exports=t.default}}),bt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers/log.js"(t,e){t.__esModule=!0,t.default=function(t){t.registerHelper("log",(function(){for(var e=[void 0],a=arguments[arguments.length-1],s=0;s<arguments.length-1;s++)e.push(arguments[s]);var i=1;null!=a.hash.level?i=a.hash.level:a.data&&null!=a.data.level&&(i=a.data.level),e[0]=i,t.log.apply(t,e)}))},e.exports=t.default}}),At=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers/lookup.js"(t,e){t.__esModule=!0,t.default=function(t){t.registerHelper("lookup",(function(t,e,a){return t?a.lookupProperty(t,e):t}))},e.exports=t.default}}),Pt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers/with.js"(t,e){t.__esModule=!0;var a,s=wt(),i=vt(),n=(a=i)&&a.__esModule?a:{default:a};t.default=function(t){t.registerHelper("with",(function(t,e){if(2!=arguments.length)throw new n.default("#with requires exactly one argument");s.isFunction(t)&&(t=t.call(this));var a=e.fn;if(s.isEmpty(t))return e.inverse(this);var i=e.data;return e.data&&e.ids&&((i=s.createFrame(e.data)).contextPath=s.appendContextPath(e.data.contextPath,e.ids[0])),a(t,{data:i,blockParams:s.blockParams([t],[i&&i.contextPath])})}))},e.exports=t.default}}),_t=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers.js"(t){function e(t){return t&&t.__esModule?t:{default:t}}t.__esModule=!0,t.registerDefaultHelpers=function(t){a.default(t),s.default(t),i.default(t),n.default(t),r.default(t),o.default(t),c.default(t)},t.moveHelperToHooks=function(t,e,a){t.helpers[e]&&(t.hooks[e]=t.helpers[e],a||delete t.helpers[e])};var a=e(yt()),s=e(It()),i=e(Dt()),n=e(Ct()),r=e(bt()),o=e(At()),c=e(Pt())}}),St=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/decorators/inline.js"(t,e){t.__esModule=!0;var a=wt();t.default=function(t){t.registerDecorator("inline",(function(t,e,s,i){var n=t;return e.partials||(e.partials={},n=function(i,n){var r=s.partials;s.partials=a.extend({},r,e.partials);var o=t(i,n);return s.partials=r,o}),e.partials[i.args[0]]=i.fn,n}))},e.exports=t.default}}),xt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/decorators.js"(t){t.__esModule=!0,t.registerDefaultDecorators=function(t){s.default(t)};var e,a=St(),s=(e=a)&&e.__esModule?e:{default:e}}}),Tt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/logger.js"(t,e){t.__esModule=!0;var a=wt(),s={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(t){if("string"==typeof t){var e=a.indexOf(s.methodMap,t.toLowerCase());t=e>=0?e:parseInt(t,10)}return t},log:function(t){if(t=s.lookupLevel(t),"undefined"!=typeof console&&s.lookupLevel(s.level)<=t){var e=s.methodMap[t];console[e]||(e="log");for(var a=arguments.length,i=Array(a>1?a-1:0),n=1;n<a;n++)i[n-1]=arguments[n];console[e].apply(console,i)}}};t.default=s,e.exports=t.default}}),Lt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/internal/create-new-lookup-object.js"(t){t.__esModule=!0,t.createNewLookupObject=function(){for(var t=arguments.length,a=Array(t),s=0;s<t;s++)a[s]=arguments[s];return e.extend.apply(void 0,[Object.create(null)].concat(a))};var e=wt()}}),Ot=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/internal/proto-access.js"(t){t.__esModule=!0,t.createProtoAccessControl=function(t){var e=Object.create(null);e.constructor=!1,e.__defineGetter__=!1,e.__defineSetter__=!1,e.__lookupGetter__=!1;var s=Object.create(null);return s.__proto__=!1,{properties:{whitelist:a.createNewLookupObject(s,t.allowedProtoProperties),defaultValue:t.allowProtoPropertiesByDefault},methods:{whitelist:a.createNewLookupObject(e,t.allowedProtoMethods),defaultValue:t.allowProtoMethodsByDefault}}},t.resultIsAllowed=function(t,e,a){return r("function"==typeof t?e.methods:e.properties,a)},t.resetLoggedProperties=function(){Object.keys(n).forEach((function(t){delete n[t]}))};var e,a=Lt(),s=Tt(),i=(e=s)&&e.__esModule?e:{default:e},n=Object.create(null);function r(t,e){return void 0!==t.whitelist[e]?!0===t.whitelist[e]:void 0!==t.defaultValue?t.defaultValue:(function(t){!0!==n[t]&&(n[t]=!0,i.default.log("error",'Handlebars: Access has been denied to resolve the property "'+t+'" because it is not an "own property" of its parent.\nYou can add a runtime option to disable the check or this warning:\nSee https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details'))}(e),!1)}}}),Nt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/base.js"(t){function e(t){return t&&t.__esModule?t:{default:t}}t.__esModule=!0,t.HandlebarsEnvironment=l;var a=wt(),s=e(vt()),i=_t(),n=xt(),r=e(Tt()),o=Ot();t.VERSION="4.7.8";t.COMPILER_REVISION=8;t.LAST_COMPATIBLE_COMPILER_REVISION=7;t.REVISION_CHANGES={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};var c="[object Object]";function l(t,e,a){this.helpers=t||{},this.partials=e||{},this.decorators=a||{},i.registerDefaultHelpers(this),n.registerDefaultDecorators(this)}l.prototype={constructor:l,logger:r.default,log:r.default.log,registerHelper:function(t,e){if(a.toString.call(t)===c){if(e)throw new s.default("Arg not supported with multiple helpers");a.extend(this.helpers,t)}else this.helpers[t]=e},unregisterHelper:function(t){delete this.helpers[t]},registerPartial:function(t,e){if(a.toString.call(t)===c)a.extend(this.partials,t);else{if(void 0===e)throw new s.default('Attempting to register a partial called "'+t+'" as undefined');this.partials[t]=e}},unregisterPartial:function(t){delete this.partials[t]},registerDecorator:function(t,e){if(a.toString.call(t)===c){if(e)throw new s.default("Arg not supported with multiple decorators");a.extend(this.decorators,t)}else this.decorators[t]=e},unregisterDecorator:function(t){delete this.decorators[t]},resetLoggedPropertyAccesses:function(){o.resetLoggedProperties()}};var h=r.default.log;t.log=h,t.createFrame=a.createFrame,t.logger=r.default}}),Rt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/safe-string.js"(t,e){function a(t){this.string=t}t.__esModule=!0,a.prototype.toString=a.prototype.toHTML=function(){return""+this.string},t.default=a,e.exports=t.default}}),Mt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js"(t){t.__esModule=!0,t.wrapHelper=function(t,e){if("function"!=typeof t)return t;return function(){return arguments[arguments.length-1]=e(arguments[arguments.length-1]),t.apply(this,arguments)}}}}),Vt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/runtime.js"(t){t.__esModule=!0,t.checkRevision=function(t){var e=t&&t[0]||1,a=n.COMPILER_REVISION;if(e>=n.LAST_COMPATIBLE_COMPILER_REVISION&&e<=n.COMPILER_REVISION)return;if(e<n.LAST_COMPATIBLE_COMPILER_REVISION){var s=n.REVISION_CHANGES[a],r=n.REVISION_CHANGES[e];throw new i.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+s+") or downgrade your runtime to an older version ("+r+").")}throw new i.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+t[1]+").")},t.template=function(t,e){if(!e)throw new i.default("No environment passed to template");if(!t||!t.main)throw new i.default("Unknown template object: "+typeof t);t.main.decorator=t.main_d,e.VM.checkRevision(t.compiler);var s=t.compiler&&7===t.compiler[0];var h={strict:function(t,e,a){if(!t||!(e in t))throw new i.default('"'+e+'" not defined in '+t,{loc:a});return h.lookupProperty(t,e)},lookupProperty:function(t,e){var a=t[e];return null==a||Object.prototype.hasOwnProperty.call(t,e)||c.resultIsAllowed(a,h.protoAccessControl,e)?a:void 0},lookup:function(t,e){for(var a=t.length,s=0;s<a;s++){if(null!=(t[s]&&h.lookupProperty(t[s],e)))return t[s][e]}},lambda:function(t,e){return"function"==typeof t?t.call(e):t},escapeExpression:a.escapeExpression,invokePartial:function(s,n,r){r.hash&&(n=a.extend({},n,r.hash),r.ids&&(r.ids[0]=!0)),s=e.VM.resolvePartial.call(this,s,n,r);var o=a.extend({},r,{hooks:this.hooks,protoAccessControl:this.protoAccessControl}),c=e.VM.invokePartial.call(this,s,n,o);if(null==c&&e.compile&&(r.partials[r.name]=e.compile(s,t.compilerOptions,e),c=r.partials[r.name](n,o)),null!=c){if(r.indent){for(var l=c.split("\n"),h=0,d=l.length;h<d&&(l[h]||h+1!==d);h++)l[h]=r.indent+l[h];c=l.join("\n")}return c}throw new i.default("The partial "+r.name+" could not be compiled when running in runtime-only mode")},fn:function(e){var a=t[e];return a.decorator=t[e+"_d"],a},programs:[],program:function(t,e,a,s,i){var n=this.programs[t],r=this.fn(t);return e||i||s||a?n=l(this,t,r,e,a,s,i):n||(n=this.programs[t]=l(this,t,r)),n},data:function(t,e){for(;t&&e--;)t=t._parent;return t},mergeIfNeeded:function(t,e){var s=t||e;return t&&e&&t!==e&&(s=a.extend({},e,t)),s},nullContext:Object.seal({}),noop:e.VM.noop,compilerInfo:t.compiler};function u(e){var a=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],s=a.data;u._setup(a),!a.partial&&t.useData&&(s=function(t,e){e&&"root"in e||((e=e?n.createFrame(e):{}).root=t);return e}(e,s));var i=void 0,r=t.useBlockParams?[]:void 0;function o(e){return""+t.main(h,e,h.helpers,h.partials,s,r,i)}return t.useDepths&&(i=a.depths?e!=a.depths[0]?[e].concat(a.depths):a.depths:[e]),(o=d(t.main,o,h,a.depths||[],s,r))(e,a)}return u.isTop=!0,u._setup=function(i){if(i.partial)h.protoAccessControl=i.protoAccessControl,h.helpers=i.helpers,h.partials=i.partials,h.decorators=i.decorators,h.hooks=i.hooks;else{var n=a.extend({},e.helpers,i.helpers);!function(t,e){Object.keys(t).forEach((function(s){var i=t[s];t[s]=function(t,e){var s=e.lookupProperty;return o.wrapHelper(t,(function(t){return a.extend({lookupProperty:s},t)}))}(i,e)}))}(n,h),h.helpers=n,t.usePartial&&(h.partials=h.mergeIfNeeded(i.partials,e.partials)),(t.usePartial||t.useDecorators)&&(h.decorators=a.extend({},e.decorators,i.decorators)),h.hooks={},h.protoAccessControl=c.createProtoAccessControl(i);var l=i.allowCallsToHelperMissing||s;r.moveHelperToHooks(h,"helperMissing",l),r.moveHelperToHooks(h,"blockHelperMissing",l)}},u._child=function(e,a,s,n){if(t.useBlockParams&&!s)throw new i.default("must pass block params");if(t.useDepths&&!n)throw new i.default("must pass parent depths");return l(h,e,t[e],a,0,s,n)},u},t.wrapProgram=l,t.resolvePartial=function(t,e,a){t?t.call||a.name||(a.name=t,t=a.partials[t]):t="@partial-block"===a.name?a.data["partial-block"]:a.partials[a.name];return t},t.invokePartial=function(t,e,s){var r=s.data&&s.data["partial-block"];s.partial=!0,s.ids&&(s.data.contextPath=s.ids[0]||s.data.contextPath);var o=void 0;s.fn&&s.fn!==h&&function(){s.data=n.createFrame(s.data);var t=s.fn;o=s.data["partial-block"]=function(e){var a=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return a.data=n.createFrame(a.data),a.data["partial-block"]=r,t(e,a)},t.partials&&(s.partials=a.extend({},s.partials,t.partials))}();void 0===t&&o&&(t=o);if(void 0===t)throw new i.default("The partial "+s.name+" could not be found");if(t instanceof Function)return t(e,s)},t.noop=h;var e,a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e.default=t,e}(wt()),s=vt(),i=(e=s)&&e.__esModule?e:{default:e},n=Nt(),r=_t(),o=Mt(),c=Ot();function l(t,e,a,s,i,n,r){function o(e){var i=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],o=r;return!r||e==r[0]||e===t.nullContext&&null===r[0]||(o=[e].concat(r)),a(t,e,t.helpers,t.partials,i.data||s,n&&[i.blockParams].concat(n),o)}return(o=d(a,o,t,r,s,n)).program=e,o.depth=r?r.length:0,o.blockParams=i||0,o}function h(){return""}function d(t,e,s,i,n,r){if(t.decorator){var o={};e=t.decorator(e,o,s,i&&i[0],n,r,i),a.extend(e,o)}return e}}}),kt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/no-conflict.js"(t,e){t.__esModule=!0,t.default=function(t){"object"!=typeof globalThis&&(Object.prototype.__defineGetter__("__magic__",(function(){return this})),__magic__.globalThis=__magic__,delete Object.prototype.__magic__);var e=globalThis.Handlebars;t.noConflict=function(){return globalThis.Handlebars===t&&(globalThis.Handlebars=e),t}},e.exports=t.default}}),Ft=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars.runtime.js"(t,e){function a(t){return t&&t.__esModule?t:{default:t}}function s(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e.default=t,e}t.__esModule=!0;var i=s(Nt()),n=a(Rt()),r=a(vt()),o=s(wt()),c=s(Vt()),l=a(kt());function h(){var t=new i.HandlebarsEnvironment;return o.extend(t,i),t.SafeString=n.default,t.Exception=r.default,t.Utils=o,t.escapeExpression=o.escapeExpression,t.VM=c,t.template=function(e){return c.template(e,t)},t}var d=h();d.create=h,l.default(d),d.default=d,t.default=d,e.exports=t.default}}),Wt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/ast.js"(t,e){t.__esModule=!0;var a={helpers:{helperExpression:function(t){return"SubExpression"===t.type||("MustacheStatement"===t.type||"BlockStatement"===t.type)&&!!(t.params&&t.params.length||t.hash)},scopedId:function(t){return/^\.|this\b/.test(t.original)},simpleId:function(t){return 1===t.parts.length&&!a.helpers.scopedId(t)&&!t.depth}}};t.default=a,e.exports=t.default}}),Bt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/parser.js"(t,e){t.__esModule=!0;var a=function(){var t={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(t,e,a,s,i,n,r){var o=n.length-1;switch(i){case 1:return n[o-1];case 2:this.$=s.prepareProgram(n[o]);break;case 3:case 4:case 5:case 6:case 7:case 8:case 20:case 27:case 28:case 33:case 34:case 40:case 41:this.$=n[o];break;case 9:this.$={type:"CommentStatement",value:s.stripComment(n[o]),strip:s.stripFlags(n[o],n[o]),loc:s.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:n[o],value:n[o],loc:s.locInfo(this._$)};break;case 11:this.$=s.prepareRawBlock(n[o-2],n[o-1],n[o],this._$);break;case 12:this.$={path:n[o-3],params:n[o-2],hash:n[o-1]};break;case 13:this.$=s.prepareBlock(n[o-3],n[o-2],n[o-1],n[o],!1,this._$);break;case 14:this.$=s.prepareBlock(n[o-3],n[o-2],n[o-1],n[o],!0,this._$);break;case 15:this.$={open:n[o-5],path:n[o-4],params:n[o-3],hash:n[o-2],blockParams:n[o-1],strip:s.stripFlags(n[o-5],n[o])};break;case 16:case 17:this.$={path:n[o-4],params:n[o-3],hash:n[o-2],blockParams:n[o-1],strip:s.stripFlags(n[o-5],n[o])};break;case 18:this.$={strip:s.stripFlags(n[o-1],n[o-1]),program:n[o]};break;case 19:var c=s.prepareBlock(n[o-2],n[o-1],n[o],n[o],!1,this._$),l=s.prepareProgram([c],n[o-1].loc);l.chained=!0,this.$={strip:n[o-2].strip,program:l,chain:!0};break;case 21:this.$={path:n[o-1],strip:s.stripFlags(n[o-2],n[o])};break;case 22:case 23:this.$=s.prepareMustache(n[o-3],n[o-2],n[o-1],n[o-4],s.stripFlags(n[o-4],n[o]),this._$);break;case 24:this.$={type:"PartialStatement",name:n[o-3],params:n[o-2],hash:n[o-1],indent:"",strip:s.stripFlags(n[o-4],n[o]),loc:s.locInfo(this._$)};break;case 25:this.$=s.preparePartialBlock(n[o-2],n[o-1],n[o],this._$);break;case 26:this.$={path:n[o-3],params:n[o-2],hash:n[o-1],strip:s.stripFlags(n[o-4],n[o])};break;case 29:this.$={type:"SubExpression",path:n[o-3],params:n[o-2],hash:n[o-1],loc:s.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:n[o],loc:s.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:s.id(n[o-2]),value:n[o],loc:s.locInfo(this._$)};break;case 32:this.$=s.id(n[o-1]);break;case 35:this.$={type:"StringLiteral",value:n[o],original:n[o],loc:s.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(n[o]),original:Number(n[o]),loc:s.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:"true"===n[o],original:"true"===n[o],loc:s.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:s.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:s.locInfo(this._$)};break;case 42:this.$=s.preparePath(!0,n[o],this._$);break;case 43:this.$=s.preparePath(!1,n[o],this._$);break;case 44:n[o-2].push({part:s.id(n[o]),original:n[o],separator:n[o-1]}),this.$=n[o-2];break;case 45:this.$=[{part:s.id(n[o]),original:n[o]}];break;case 46:case 48:case 50:case 58:case 64:case 70:case 78:case 82:case 86:case 90:case 94:this.$=[];break;case 47:case 49:case 51:case 59:case 65:case 71:case 79:case 83:case 87:case 91:case 95:case 99:case 101:n[o-1].push(n[o]);break;case 98:case 100:this.$=[n[o]]}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function(t,e){throw new Error(t)},parse:function(t){var e=this,a=[0],s=[null],i=[],n=this.table,r="",o=0,c=0;this.lexer.setInput(t),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,void 0===this.lexer.yylloc&&(this.lexer.yylloc={});var l=this.lexer.yylloc;i.push(l);var h=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var d,u,p,m,f,g,E,w,v,y={};;){if(u=a[a.length-1],this.defaultActions[u]?p=this.defaultActions[u]:(null==d&&(v=void 0,"number"!=typeof(v=e.lexer.lex()||1)&&(v=e.symbols_[v]||v),d=v),p=n[u]&&n[u][d]),void 0===p||!p.length||!p[0]){var I="";for(f in w=[],n[u])this.terminals_[f]&&f>2&&w.push("'"+this.terminals_[f]+"'");I=this.lexer.showPosition?"Parse error on line "+(o+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+w.join(", ")+", got '"+(this.terminals_[d]||d)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==d?"end of input":"'"+(this.terminals_[d]||d)+"'"),this.parseError(I,{text:this.lexer.match,token:this.terminals_[d]||d,line:this.lexer.yylineno,loc:l,expected:w})}if(p[0]instanceof Array&&p.length>1)throw new Error("Parse Error: multiple actions possible at state: "+u+", token: "+d);switch(p[0]){case 1:a.push(d),s.push(this.lexer.yytext),i.push(this.lexer.yylloc),a.push(p[1]),d=null,c=this.lexer.yyleng,r=this.lexer.yytext,o=this.lexer.yylineno,l=this.lexer.yylloc;break;case 2:if(g=this.productions_[p[1]][1],y.$=s[s.length-g],y._$={first_line:i[i.length-(g||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(g||1)].first_column,last_column:i[i.length-1].last_column},h&&(y._$.range=[i[i.length-(g||1)].range[0],i[i.length-1].range[1]]),void 0!==(m=this.performAction.call(y,r,c,o,this.yy,p[1],s,i)))return m;g&&(a=a.slice(0,-1*g*2),s=s.slice(0,-1*g),i=i.slice(0,-1*g)),a.push(this.productions_[p[1]][0]),s.push(y.$),i.push(y._$),E=n[a[a.length-2]][a[a.length-1]],a.push(E);break;case 3:return!0}}return!0}},e={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t){return this._input=t,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,a=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e-1),this.offset-=e;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===s.length?this.yylloc.first_column:0)+s[s.length-a.length].length-a[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this},more:function(){return this._more=!0,this},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},next:function(){if(this.done)return this.EOF;var t,e,a,s,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),r=0;r<n.length&&(!(a=this._input.match(this.rules[n[r]]))||e&&!(a[0].length>e[0].length)||(e=a,s=r,this.options.flex));r++);return e?((i=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],t=this.performAction.call(this,this.yy,this,n[s],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),t||void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return void 0!==t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(t){this.begin(t)},options:{},performAction:function(t,e,a,s){function i(t,a){return e.yytext=e.yytext.substring(t,e.yyleng-a+t)}switch(a){case 0:if("\\\\"===e.yytext.slice(-2)?(i(0,1),this.begin("mu")):"\\"===e.yytext.slice(-1)?(i(0,1),this.begin("emu")):this.begin("mu"),e.yytext)return 15;break;case 1:case 5:return 15;case 2:return this.popState(),15;case 3:return this.begin("raw"),15;case 4:return this.popState(),"raw"===this.conditionStack[this.conditionStack.length-1]?15:(i(5,9),"END_RAW_BLOCK");case 6:case 22:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:case 23:return 48;case 21:this.unput(e.yytext),this.popState(),this.begin("com");break;case 24:return 73;case 25:case 26:case 41:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return e.yytext=i(1,2).replace(/\\"/g,'"'),80;case 32:return e.yytext=i(1,2).replace(/\\'/g,"'"),80;case 33:return 85;case 34:case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 42:return e.yytext=e.yytext.replace(/\\([\\\]])/g,"$1"),72;case 43:return"INVALID";case 44:return 5}},rules:[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],conditions:{mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}}};function a(){this.yy={}}return t.lexer=e,a.prototype=t,t.Parser=a,new a}();t.default=a,e.exports=t.default}}),Ut=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/visitor.js"(t,e){t.__esModule=!0;var a,s=vt(),i=(a=s)&&a.__esModule?a:{default:a};function n(){this.parents=[]}function r(t){this.acceptRequired(t,"path"),this.acceptArray(t.params),this.acceptKey(t,"hash")}function o(t){r.call(this,t),this.acceptKey(t,"program"),this.acceptKey(t,"inverse")}function c(t){this.acceptRequired(t,"name"),this.acceptArray(t.params),this.acceptKey(t,"hash")}n.prototype={constructor:n,mutating:!1,acceptKey:function(t,e){var a=this.accept(t[e]);if(this.mutating){if(a&&!n.prototype[a.type])throw new i.default('Unexpected node type "'+a.type+'" found when accepting '+e+" on "+t.type);t[e]=a}},acceptRequired:function(t,e){if(this.acceptKey(t,e),!t[e])throw new i.default(t.type+" requires "+e)},acceptArray:function(t){for(var e=0,a=t.length;e<a;e++)this.acceptKey(t,e),t[e]||(t.splice(e,1),e--,a--)},accept:function(t){if(t){if(!this[t.type])throw new i.default("Unknown type: "+t.type,t);this.current&&this.parents.unshift(this.current),this.current=t;var e=this[t.type](t);return this.current=this.parents.shift(),!this.mutating||e?e:!1!==e?t:void 0}},Program:function(t){this.acceptArray(t.body)},MustacheStatement:r,Decorator:r,BlockStatement:o,DecoratorBlock:o,PartialStatement:c,PartialBlockStatement:function(t){c.call(this,t),this.acceptKey(t,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:r,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(t){this.acceptArray(t.pairs)},HashPair:function(t){this.acceptRequired(t,"value")}},t.default=n,e.exports=t.default}}),jt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/whitespace-control.js"(t,e){t.__esModule=!0;var a,s=Ut(),i=(a=s)&&a.__esModule?a:{default:a};function n(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.options=t}function r(t,e,a){void 0===e&&(e=t.length);var s=t[e-1],i=t[e-2];return s?"ContentStatement"===s.type?(i||!a?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(s.original):void 0:a}function o(t,e,a){void 0===e&&(e=-1);var s=t[e+1],i=t[e+2];return s?"ContentStatement"===s.type?(i||!a?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(s.original):void 0:a}function c(t,e,a){var s=t[null==e?0:e+1];if(s&&"ContentStatement"===s.type&&(a||!s.rightStripped)){var i=s.value;s.value=s.value.replace(a?/^\s+/:/^[ \t]*\r?\n?/,""),s.rightStripped=s.value!==i}}function l(t,e,a){var s=t[null==e?t.length-1:e-1];if(s&&"ContentStatement"===s.type&&(a||!s.leftStripped)){var i=s.value;return s.value=s.value.replace(a?/\s+$/:/[ \t]+$/,""),s.leftStripped=s.value!==i,s.leftStripped}}n.prototype=new i.default,n.prototype.Program=function(t){var e=!this.options.ignoreStandalone,a=!this.isRootSeen;this.isRootSeen=!0;for(var s=t.body,i=0,n=s.length;i<n;i++){var h=s[i],d=this.accept(h);if(d){var u=r(s,i,a),p=o(s,i,a),m=d.openStandalone&&u,f=d.closeStandalone&&p,g=d.inlineStandalone&&u&&p;d.close&&c(s,i,!0),d.open&&l(s,i,!0),e&&g&&(c(s,i),l(s,i)&&"PartialStatement"===h.type&&(h.indent=/([ \t]+$)/.exec(s[i-1].original)[1])),e&&m&&(c((h.program||h.inverse).body),l(s,i)),e&&f&&(c(s,i),l((h.inverse||h.program).body))}}return t},n.prototype.BlockStatement=n.prototype.DecoratorBlock=n.prototype.PartialBlockStatement=function(t){this.accept(t.program),this.accept(t.inverse);var e=t.program||t.inverse,a=t.program&&t.inverse,s=a,i=a;if(a&&a.chained)for(s=a.body[0].program;i.chained;)i=i.body[i.body.length-1].program;var n={open:t.openStrip.open,close:t.closeStrip.close,openStandalone:o(e.body),closeStandalone:r((s||e).body)};if(t.openStrip.close&&c(e.body,null,!0),a){var h=t.inverseStrip;h.open&&l(e.body,null,!0),h.close&&c(s.body,null,!0),t.closeStrip.open&&l(i.body,null,!0),!this.options.ignoreStandalone&&r(e.body)&&o(s.body)&&(l(e.body),c(s.body))}else t.closeStrip.open&&l(e.body,null,!0);return n},n.prototype.Decorator=n.prototype.MustacheStatement=function(t){return t.strip},n.prototype.PartialStatement=n.prototype.CommentStatement=function(t){var e=t.strip||{};return{inlineStandalone:!0,open:e.open,close:e.close}},t.default=n,e.exports=t.default}}),zt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/helpers.js"(t){t.__esModule=!0,t.SourceLocation=function(t,e){this.source=t,this.start={line:e.first_line,column:e.first_column},this.end={line:e.last_line,column:e.last_column}},t.id=function(t){return/^\[.*\]$/.test(t)?t.substring(1,t.length-1):t},t.stripFlags=function(t,e){return{open:"~"===t.charAt(2),close:"~"===e.charAt(e.length-3)}},t.stripComment=function(t){return t.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")},t.preparePath=function(t,e,a){a=this.locInfo(a);for(var i=t?"@":"",n=[],r=0,o=0,c=e.length;o<c;o++){var l=e[o].part,h=e[o].original!==l;if(i+=(e[o].separator||"")+l,h||".."!==l&&"."!==l&&"this"!==l)n.push(l);else{if(n.length>0)throw new s.default("Invalid path: "+i,{loc:a});".."===l&&r++}}return{type:"PathExpression",data:t,depth:r,parts:n,original:i,loc:a}},t.prepareMustache=function(t,e,a,s,i,n){var r=s.charAt(3)||s.charAt(2),o="{"!==r&&"&"!==r;return{type:/\*/.test(s)?"Decorator":"MustacheStatement",path:t,params:e,hash:a,escaped:o,strip:i,loc:this.locInfo(n)}},t.prepareRawBlock=function(t,e,a,s){i(t,a),s=this.locInfo(s);var n={type:"Program",body:e,strip:{},loc:s};return{type:"BlockStatement",path:t.path,params:t.params,hash:t.hash,program:n,openStrip:{},inverseStrip:{},closeStrip:{},loc:s}},t.prepareBlock=function(t,e,a,n,r,o){n&&n.path&&i(t,n);var c=/\*/.test(t.open);e.blockParams=t.blockParams;var l=void 0,h=void 0;if(a){if(c)throw new s.default("Unexpected inverse block on decorator",a);a.chain&&(a.program.body[0].closeStrip=n.strip),h=a.strip,l=a.program}r&&(r=l,l=e,e=r);return{type:c?"DecoratorBlock":"BlockStatement",path:t.path,params:t.params,hash:t.hash,program:e,inverse:l,openStrip:t.strip,inverseStrip:h,closeStrip:n&&n.strip,loc:this.locInfo(o)}},t.prepareProgram=function(t,e){if(!e&&t.length){var a=t[0].loc,s=t[t.length-1].loc;a&&s&&(e={source:a.source,start:{line:a.start.line,column:a.start.column},end:{line:s.end.line,column:s.end.column}})}return{type:"Program",body:t,strip:{},loc:e}},t.preparePartialBlock=function(t,e,a,s){return i(t,a),{type:"PartialBlockStatement",name:t.path,params:t.params,hash:t.hash,program:e,openStrip:t.strip,closeStrip:a&&a.strip,loc:this.locInfo(s)}};var e,a=vt(),s=(e=a)&&e.__esModule?e:{default:e};function i(t,e){if(e=e.path?e.path.original:e,t.path.original!==e){var a={loc:t.path.loc};throw new s.default(t.path.original+" doesn't match "+e,a)}}}}),Gt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/base.js"(t){function e(t){return t&&t.__esModule?t:{default:t}}t.__esModule=!0,t.parseWithoutProcessing=o,t.parse=function(t,e){var a=o(t,e);return new s.default(e).accept(a)};var a=e(Bt()),s=e(jt()),i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e.default=t,e}(zt()),n=wt();t.parser=a.default;var r={};function o(t,e){return"Program"===t.type?t:(a.default.yy=r,r.locInfo=function(t){return new r.SourceLocation(e&&e.srcName,t)},a.default.parse(t))}n.extend(r,i)}}),Ht=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js"(t){function e(t){return t&&t.__esModule?t:{default:t}}t.__esModule=!0,t.Compiler=r,t.precompile=function(t,e,s){if(null==t||"string"!=typeof t&&"Program"!==t.type)throw new a.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+t);"data"in(e=e||{})||(e.data=!0);e.compat&&(e.useDepths=!0);var i=s.parse(t,e),n=(new s.Compiler).compile(i,e);return(new s.JavaScriptCompiler).compile(n,e)},t.compile=function(t,e,i){void 0===e&&(e={});if(null==t||"string"!=typeof t&&"Program"!==t.type)throw new a.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+t);"data"in(e=s.extend({},e))||(e.data=!0);e.compat&&(e.useDepths=!0);var n=void 0;function r(){var a=i.parse(t,e),s=(new i.Compiler).compile(a,e),n=(new i.JavaScriptCompiler).compile(s,e,void 0,!0);return i.template(n)}function o(t,e){return n||(n=r()),n.call(this,t,e)}return o._setup=function(t){return n||(n=r()),n._setup(t)},o._child=function(t,e,a,s){return n||(n=r()),n._child(t,e,a,s)},o};var a=e(vt()),s=wt(),i=e(Wt()),n=[].slice;function r(){}function o(t,e){if(t===e)return!0;if(s.isArray(t)&&s.isArray(e)&&t.length===e.length){for(var a=0;a<t.length;a++)if(!o(t[a],e[a]))return!1;return!0}}function c(t){if(!t.path.parts){var e=t.path;t.path={type:"PathExpression",data:!1,depth:0,parts:[e.original+""],original:e.original+"",loc:e.loc}}}r.prototype={compiler:r,equals:function(t){var e=this.opcodes.length;if(t.opcodes.length!==e)return!1;for(var a=0;a<e;a++){var s=this.opcodes[a],i=t.opcodes[a];if(s.opcode!==i.opcode||!o(s.args,i.args))return!1}e=this.children.length;for(a=0;a<e;a++)if(!this.children[a].equals(t.children[a]))return!1;return!0},guid:0,compile:function(t,e){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=e,this.stringParams=e.stringParams,this.trackIds=e.trackIds,e.blockParams=e.blockParams||[],e.knownHelpers=s.extend(Object.create(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,if:!0,unless:!0,with:!0,log:!0,lookup:!0},e.knownHelpers),this.accept(t)},compileProgram:function(t){var e=(new this.compiler).compile(t,this.options),a=this.guid++;return this.usePartial=this.usePartial||e.usePartial,this.children[a]=e,this.useDepths=this.useDepths||e.useDepths,a},accept:function(t){if(!this[t.type])throw new a.default("Unknown type: "+t.type,t);this.sourceNode.unshift(t);var e=this[t.type](t);return this.sourceNode.shift(),e},Program:function(t){this.options.blockParams.unshift(t.blockParams);for(var e=t.body,a=e.length,s=0;s<a;s++)this.accept(e[s]);return this.options.blockParams.shift(),this.isSimple=1===a,this.blockParams=t.blockParams?t.blockParams.length:0,this},BlockStatement:function(t){c(t);var e=t.program,a=t.inverse;e=e&&this.compileProgram(e),a=a&&this.compileProgram(a);var s=this.classifySexpr(t);"helper"===s?this.helperSexpr(t,e,a):"simple"===s?(this.simpleSexpr(t),this.opcode("pushProgram",e),this.opcode("pushProgram",a),this.opcode("emptyHash"),this.opcode("blockValue",t.path.original)):(this.ambiguousSexpr(t,e,a),this.opcode("pushProgram",e),this.opcode("pushProgram",a),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},DecoratorBlock:function(t){var e=t.program&&this.compileProgram(t.program),a=this.setupFullMustacheParams(t,e,void 0),s=t.path;this.useDecorators=!0,this.opcode("registerDecorator",a.length,s.original)},PartialStatement:function(t){this.usePartial=!0;var e=t.program;e&&(e=this.compileProgram(t.program));var s=t.params;if(s.length>1)throw new a.default("Unsupported number of partial arguments: "+s.length,t);s.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):s.push({type:"PathExpression",parts:[],depth:0}));var i=t.name.original,n="SubExpression"===t.name.type;n&&this.accept(t.name),this.setupFullMustacheParams(t,e,void 0,!0);var r=t.indent||"";this.options.preventIndent&&r&&(this.opcode("appendContent",r),r=""),this.opcode("invokePartial",n,i,r),this.opcode("append")},PartialBlockStatement:function(t){this.PartialStatement(t)},MustacheStatement:function(t){this.SubExpression(t),t.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(t){this.DecoratorBlock(t)},ContentStatement:function(t){t.value&&this.opcode("appendContent",t.value)},CommentStatement:function(){},SubExpression:function(t){c(t);var e=this.classifySexpr(t);"simple"===e?this.simpleSexpr(t):"helper"===e?this.helperSexpr(t):this.ambiguousSexpr(t)},ambiguousSexpr:function(t,e,a){var s=t.path,i=s.parts[0],n=null!=e||null!=a;this.opcode("getContext",s.depth),this.opcode("pushProgram",e),this.opcode("pushProgram",a),s.strict=!0,this.accept(s),this.opcode("invokeAmbiguous",i,n)},simpleSexpr:function(t){var e=t.path;e.strict=!0,this.accept(e),this.opcode("resolvePossibleLambda")},helperSexpr:function(t,e,s){var n=this.setupFullMustacheParams(t,e,s),r=t.path,o=r.parts[0];if(this.options.knownHelpers[o])this.opcode("invokeKnownHelper",n.length,o);else{if(this.options.knownHelpersOnly)throw new a.default("You specified knownHelpersOnly, but used the unknown helper "+o,t);r.strict=!0,r.falsy=!0,this.accept(r),this.opcode("invokeHelper",n.length,r.original,i.default.helpers.simpleId(r))}},PathExpression:function(t){this.addDepth(t.depth),this.opcode("getContext",t.depth);var e=t.parts[0],a=i.default.helpers.scopedId(t),s=!t.depth&&!a&&this.blockParamIndex(e);s?this.opcode("lookupBlockParam",s,t.parts):e?t.data?(this.options.data=!0,this.opcode("lookupData",t.depth,t.parts,t.strict)):this.opcode("lookupOnContext",t.parts,t.falsy,t.strict,a):this.opcode("pushContext")},StringLiteral:function(t){this.opcode("pushString",t.value)},NumberLiteral:function(t){this.opcode("pushLiteral",t.value)},BooleanLiteral:function(t){this.opcode("pushLiteral",t.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(t){var e=t.pairs,a=0,s=e.length;for(this.opcode("pushHash");a<s;a++)this.pushParam(e[a].value);for(;a--;)this.opcode("assignToHash",e[a].key);this.opcode("popHash")},opcode:function(t){this.opcodes.push({opcode:t,args:n.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(t){t&&(this.useDepths=!0)},classifySexpr:function(t){var e=i.default.helpers.simpleId(t.path),a=e&&!!this.blockParamIndex(t.path.parts[0]),s=!a&&i.default.helpers.helperExpression(t),n=!a&&(s||e);if(n&&!s){var r=t.path.parts[0],o=this.options;o.knownHelpers[r]?s=!0:o.knownHelpersOnly&&(n=!1)}return s?"helper":n?"ambiguous":"simple"},pushParams:function(t){for(var e=0,a=t.length;e<a;e++)this.pushParam(t[e])},pushParam:function(t){var e=null!=t.value?t.value:t.original||"";if(this.stringParams)e.replace&&(e=e.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".")),t.depth&&this.addDepth(t.depth),this.opcode("getContext",t.depth||0),this.opcode("pushStringParam",e,t.type),"SubExpression"===t.type&&this.accept(t);else{if(this.trackIds){var a=void 0;if(!t.parts||i.default.helpers.scopedId(t)||t.depth||(a=this.blockParamIndex(t.parts[0])),a){var s=t.parts.slice(1).join(".");this.opcode("pushId","BlockParam",a,s)}else(e=t.original||e).replace&&(e=e.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"")),this.opcode("pushId",t.type,e)}this.accept(t)}},setupFullMustacheParams:function(t,e,a,s){var i=t.params;return this.pushParams(i),this.opcode("pushProgram",e),this.opcode("pushProgram",a),t.hash?this.accept(t.hash):this.opcode("emptyHash",s),i},blockParamIndex:function(t){for(var e=0,a=this.options.blockParams.length;e<a;e++){var i=this.options.blockParams[e],n=i&&s.indexOf(i,t);if(i&&n>=0)return[e,n]}}}}}),Xt=gt({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64.js"(t){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");t.encode=function(t){if(0<=t&&t<e.length)return e[t];throw new TypeError("Must be between 0 and 63: "+t)},t.decode=function(t){return 65<=t&&t<=90?t-65:97<=t&&t<=122?t-97+26:48<=t&&t<=57?t-48+52:43==t?62:47==t?63:-1}}}),Kt=gt({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64-vlq.js"(t){var e=Xt();t.encode=function(t){var a,s="",i=function(t){return t<0?1+(-t<<1):0+(t<<1)}(t);do{a=31&i,(i>>>=5)>0&&(a|=32),s+=e.encode(a)}while(i>0);return s},t.decode=function(t,a,s){var i,n,r,o,c=t.length,l=0,h=0;do{if(a>=c)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(n=e.decode(t.charCodeAt(a++))))throw new Error("Invalid base64 digit: "+t.charAt(a-1));i=!!(32&n),l+=(n&=31)<<h,h+=5}while(i);s.value=(o=(r=l)>>1,1==(1&r)?-o:o),s.rest=a}}}),Yt=gt({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/util.js"(t){t.getArg=function(t,e,a){if(e in t)return t[e];if(3===arguments.length)return a;throw new Error('"'+e+'" is a required argument.')};var e=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,a=/^data:.+\,.+$/;function s(t){var a=t.match(e);return a?{scheme:a[1],auth:a[2],host:a[3],port:a[4],path:a[5]}:null}function i(t){var e="";return t.scheme&&(e+=t.scheme+":"),e+="//",t.auth&&(e+=t.auth+"@"),t.host&&(e+=t.host),t.port&&(e+=":"+t.port),t.path&&(e+=t.path),e}function n(e){var a=e,n=s(e);if(n){if(!n.path)return e;a=n.path}for(var r,o=t.isAbsolute(a),c=a.split(/\/+/),l=0,h=c.length-1;h>=0;h--)"."===(r=c[h])?c.splice(h,1):".."===r?l++:l>0&&(""===r?(c.splice(h+1,l),l=0):(c.splice(h,2),l--));return""===(a=c.join("/"))&&(a=o?"/":"."),n?(n.path=a,i(n)):a}function r(t,e){""===t&&(t="."),""===e&&(e=".");var r=s(e),o=s(t);if(o&&(t=o.path||"/"),r&&!r.scheme)return o&&(r.scheme=o.scheme),i(r);if(r||e.match(a))return e;if(o&&!o.host&&!o.path)return o.host=e,i(o);var c="/"===e.charAt(0)?e:n(t.replace(/\/+$/,"")+"/"+e);return o?(o.path=c,i(o)):c}t.urlParse=s,t.urlGenerate=i,t.normalize=n,t.join=r,t.isAbsolute=function(t){return"/"===t.charAt(0)||e.test(t)},t.relative=function(t,e){""===t&&(t="."),t=t.replace(/\/$/,"");for(var a=0;0!==e.indexOf(t+"/");){var s=t.lastIndexOf("/");if(s<0)return e;if((t=t.slice(0,s)).match(/^([^\/]+:\/)?\/*$/))return e;++a}return Array(a+1).join("../")+e.substr(t.length+1)};var o=!("__proto__"in Object.create(null));function c(t){return t}function l(t){if(!t)return!1;var e=t.length;if(e<9)return!1;if(95!==t.charCodeAt(e-1)||95!==t.charCodeAt(e-2)||111!==t.charCodeAt(e-3)||116!==t.charCodeAt(e-4)||111!==t.charCodeAt(e-5)||114!==t.charCodeAt(e-6)||112!==t.charCodeAt(e-7)||95!==t.charCodeAt(e-8)||95!==t.charCodeAt(e-9))return!1;for(var a=e-10;a>=0;a--)if(36!==t.charCodeAt(a))return!1;return!0}function h(t,e){return t===e?0:null===t?1:null===e?-1:t>e?1:-1}t.toSetString=o?c:function(t){return l(t)?"$"+t:t},t.fromSetString=o?c:function(t){return l(t)?t.slice(1):t},t.compareByOriginalPositions=function(t,e,a){var s=h(t.source,e.source);return 0!==s||0!==(s=t.originalLine-e.originalLine)||0!==(s=t.originalColumn-e.originalColumn)||a||0!==(s=t.generatedColumn-e.generatedColumn)||0!==(s=t.generatedLine-e.generatedLine)?s:h(t.name,e.name)},t.compareByGeneratedPositionsDeflated=function(t,e,a){var s=t.generatedLine-e.generatedLine;return 0!==s||0!==(s=t.generatedColumn-e.generatedColumn)||a||0!==(s=h(t.source,e.source))||0!==(s=t.originalLine-e.originalLine)||0!==(s=t.originalColumn-e.originalColumn)?s:h(t.name,e.name)},t.compareByGeneratedPositionsInflated=function(t,e){var a=t.generatedLine-e.generatedLine;return 0!==a||0!==(a=t.generatedColumn-e.generatedColumn)||0!==(a=h(t.source,e.source))||0!==(a=t.originalLine-e.originalLine)||0!==(a=t.originalColumn-e.originalColumn)?a:h(t.name,e.name)},t.parseSourceMapInput=function(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))},t.computeSourceURL=function(t,e,a){if(e=e||"",t&&("/"!==t[t.length-1]&&"/"!==e[0]&&(t+="/"),e=t+e),a){var o=s(a);if(!o)throw new Error("sourceMapURL could not be parsed");if(o.path){var c=o.path.lastIndexOf("/");c>=0&&(o.path=o.path.substring(0,c+1))}e=r(i(o),e)}return n(e)}}}),$t=gt({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/array-set.js"(t){var e=Yt(),a=Object.prototype.hasOwnProperty,s="undefined"!=typeof Map;function i(){this._array=[],this._set=s?new Map:Object.create(null)}i.fromArray=function(t,e){for(var a=new i,s=0,n=t.length;s<n;s++)a.add(t[s],e);return a},i.prototype.size=function(){return s?this._set.size:Object.getOwnPropertyNames(this._set).length},i.prototype.add=function(t,i){var n=s?t:e.toSetString(t),r=s?this.has(t):a.call(this._set,n),o=this._array.length;r&&!i||this._array.push(t),r||(s?this._set.set(t,o):this._set[n]=o)},i.prototype.has=function(t){if(s)return this._set.has(t);var i=e.toSetString(t);return a.call(this._set,i)},i.prototype.indexOf=function(t){if(s){var i=this._set.get(t);if(i>=0)return i}else{var n=e.toSetString(t);if(a.call(this._set,n))return this._set[n]}throw new Error('"'+t+'" is not in the set.')},i.prototype.at=function(t){if(t>=0&&t<this._array.length)return this._array[t];throw new Error("No element indexed by "+t)},i.prototype.toArray=function(){return this._array.slice()},t.ArraySet=i}}),qt=gt({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/mapping-list.js"(t){var e=Yt();function a(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}a.prototype.unsortedForEach=function(t,e){this._array.forEach(t,e)},a.prototype.add=function(t){var a,s,i,n,r,o;a=this._last,s=t,i=a.generatedLine,n=s.generatedLine,r=a.generatedColumn,o=s.generatedColumn,n>i||n==i&&o>=r||e.compareByGeneratedPositionsInflated(a,s)<=0?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))},a.prototype.toArray=function(){return this._sorted||(this._array.sort(e.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},t.MappingList=a}}),Qt=gt({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-map-generator.js"(t){var e=Kt(),a=Yt(),s=$t().ArraySet,i=qt().MappingList;function n(t){t||(t={}),this._file=a.getArg(t,"file",null),this._sourceRoot=a.getArg(t,"sourceRoot",null),this._skipValidation=a.getArg(t,"skipValidation",!1),this._sources=new s,this._names=new s,this._mappings=new i,this._sourcesContents=null}n.prototype._version=3,n.fromSourceMap=function(t){var e=t.sourceRoot,s=new n({file:t.file,sourceRoot:e});return t.eachMapping((function(t){var i={generated:{line:t.generatedLine,column:t.generatedColumn}};null!=t.source&&(i.source=t.source,null!=e&&(i.source=a.relative(e,i.source)),i.original={line:t.originalLine,column:t.originalColumn},null!=t.name&&(i.name=t.name)),s.addMapping(i)})),t.sources.forEach((function(i){var n=i;null!==e&&(n=a.relative(e,i)),s._sources.has(n)||s._sources.add(n);var r=t.sourceContentFor(i);null!=r&&s.setSourceContent(i,r)})),s},n.prototype.addMapping=function(t){var e=a.getArg(t,"generated"),s=a.getArg(t,"original",null),i=a.getArg(t,"source",null),n=a.getArg(t,"name",null);this._skipValidation||this._validateMapping(e,s,i,n),null!=i&&(i=String(i),this._sources.has(i)||this._sources.add(i)),null!=n&&(n=String(n),this._names.has(n)||this._names.add(n)),this._mappings.add({generatedLine:e.line,generatedColumn:e.column,originalLine:null!=s&&s.line,originalColumn:null!=s&&s.column,source:i,name:n})},n.prototype.setSourceContent=function(t,e){var s=t;null!=this._sourceRoot&&(s=a.relative(this._sourceRoot,s)),null!=e?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[a.toSetString(s)]=e):this._sourcesContents&&(delete this._sourcesContents[a.toSetString(s)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},n.prototype.applySourceMap=function(t,e,i){var n=e;if(null==e){if(null==t.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');n=t.file}var r=this._sourceRoot;null!=r&&(n=a.relative(r,n));var o=new s,c=new s;this._mappings.unsortedForEach((function(e){if(e.source===n&&null!=e.originalLine){var s=t.originalPositionFor({line:e.originalLine,column:e.originalColumn});null!=s.source&&(e.source=s.source,null!=i&&(e.source=a.join(i,e.source)),null!=r&&(e.source=a.relative(r,e.source)),e.originalLine=s.line,e.originalColumn=s.column,null!=s.name&&(e.name=s.name))}var l=e.source;null==l||o.has(l)||o.add(l);var h=e.name;null==h||c.has(h)||c.add(h)}),this),this._sources=o,this._names=c,t.sources.forEach((function(e){var s=t.sourceContentFor(e);null!=s&&(null!=i&&(e=a.join(i,e)),null!=r&&(e=a.relative(r,e)),this.setSourceContent(e,s))}),this)},n.prototype._validateMapping=function(t,e,a,s){if(e&&"number"!=typeof e.line&&"number"!=typeof e.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if((!(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0)||e||a||s)&&!(t&&"line"in t&&"column"in t&&e&&"line"in e&&"column"in e&&t.line>0&&t.column>=0&&e.line>0&&e.column>=0&&a))throw new Error("Invalid mapping: "+JSON.stringify({generated:t,source:a,original:e,name:s}))},n.prototype._serializeMappings=function(){for(var t,s,i,n,r=0,o=1,c=0,l=0,h=0,d=0,u="",p=this._mappings.toArray(),m=0,f=p.length;m<f;m++){if(t="",(s=p[m]).generatedLine!==o)for(r=0;s.generatedLine!==o;)t+=";",o++;else if(m>0){if(!a.compareByGeneratedPositionsInflated(s,p[m-1]))continue;t+=","}t+=e.encode(s.generatedColumn-r),r=s.generatedColumn,null!=s.source&&(n=this._sources.indexOf(s.source),t+=e.encode(n-d),d=n,t+=e.encode(s.originalLine-1-l),l=s.originalLine-1,t+=e.encode(s.originalColumn-c),c=s.originalColumn,null!=s.name&&(i=this._names.indexOf(s.name),t+=e.encode(i-h),h=i)),u+=t}return u},n.prototype._generateSourcesContent=function(t,e){return t.map((function(t){if(!this._sourcesContents)return null;null!=e&&(t=a.relative(e,t));var s=a.toSetString(t);return Object.prototype.hasOwnProperty.call(this._sourcesContents,s)?this._sourcesContents[s]:null}),this)},n.prototype.toJSON=function(){var t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(t.file=this._file),null!=this._sourceRoot&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t},n.prototype.toString=function(){return JSON.stringify(this.toJSON())},t.SourceMapGenerator=n}}),Jt=gt({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/binary-search.js"(t){function e(a,s,i,n,r,o){var c=Math.floor((s-a)/2)+a,l=r(i,n[c],!0);return 0===l?c:l>0?s-c>1?e(c,s,i,n,r,o):o==t.LEAST_UPPER_BOUND?s<n.length?s:-1:c:c-a>1?e(a,c,i,n,r,o):o==t.LEAST_UPPER_BOUND?c:a<0?-1:a}t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2,t.search=function(a,s,i,n){if(0===s.length)return-1;var r=e(-1,s.length,a,s,i,n||t.GREATEST_LOWER_BOUND);if(r<0)return-1;for(;r-1>=0&&0===i(s[r],s[r-1],!0);)--r;return r}}}),Zt=gt({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/quick-sort.js"(t){function e(t,e,a){var s=t[e];t[e]=t[a],t[a]=s}function a(t,s,i,n){if(i<n){var r=i-1;e(t,(h=i,d=n,Math.round(h+Math.random()*(d-h))),n);for(var o=t[n],c=i;c<n;c++)s(t[c],o)<=0&&e(t,r+=1,c);e(t,r+1,c);var l=r+1;a(t,s,i,l-1),a(t,s,l+1,n)}var h,d}t.quickSort=function(t,e){a(t,e,0,t.length-1)}}}),te=gt({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-map-consumer.js"(t){var e=Yt(),a=Jt(),s=$t().ArraySet,i=Kt(),n=Zt().quickSort;function r(t,a){var s=t;return"string"==typeof t&&(s=e.parseSourceMapInput(t)),null!=s.sections?new l(s,a):new o(s,a)}function o(t,a){var i=t;"string"==typeof t&&(i=e.parseSourceMapInput(t));var n=e.getArg(i,"version"),r=e.getArg(i,"sources"),o=e.getArg(i,"names",[]),c=e.getArg(i,"sourceRoot",null),l=e.getArg(i,"sourcesContent",null),h=e.getArg(i,"mappings"),d=e.getArg(i,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);c&&(c=e.normalize(c)),r=r.map(String).map(e.normalize).map((function(t){return c&&e.isAbsolute(c)&&e.isAbsolute(t)?e.relative(c,t):t})),this._names=s.fromArray(o.map(String),!0),this._sources=s.fromArray(r,!0),this._absoluteSources=this._sources.toArray().map((function(t){return e.computeSourceURL(c,t,a)})),this.sourceRoot=c,this.sourcesContent=l,this._mappings=h,this._sourceMapURL=a,this.file=d}function c(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function l(t,a){var i=t;"string"==typeof t&&(i=e.parseSourceMapInput(t));var n=e.getArg(i,"version"),o=e.getArg(i,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new s,this._names=new s;var c={line:-1,column:0};this._sections=o.map((function(t){if(t.url)throw new Error("Support for url field in sections not implemented.");var s=e.getArg(t,"offset"),i=e.getArg(s,"line"),n=e.getArg(s,"column");if(i<c.line||i===c.line&&n<c.column)throw new Error("Section offsets must be ordered and non-overlapping.");return c=s,{generatedOffset:{generatedLine:i+1,generatedColumn:n+1},consumer:new r(e.getArg(t,"map"),a)}}))}r.fromSourceMap=function(t,e){return o.fromSourceMap(t,e)},r.prototype._version=3,r.prototype.__generatedMappings=null,Object.defineProperty(r.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),r.prototype.__originalMappings=null,Object.defineProperty(r.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),r.prototype._charIsMappingSeparator=function(t,e){var a=t.charAt(e);return";"===a||","===a},r.prototype._parseMappings=function(t,e){throw new Error("Subclasses must implement _parseMappings")},r.GENERATED_ORDER=1,r.ORIGINAL_ORDER=2,r.GREATEST_LOWER_BOUND=1,r.LEAST_UPPER_BOUND=2,r.prototype.eachMapping=function(t,a,s){var i,n=a||null;switch(s||r.GENERATED_ORDER){case r.GENERATED_ORDER:i=this._generatedMappings;break;case r.ORIGINAL_ORDER:i=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var o=this.sourceRoot;i.map((function(t){var a=null===t.source?null:this._sources.at(t.source);return{source:a=e.computeSourceURL(o,a,this._sourceMapURL),generatedLine:t.generatedLine,generatedColumn:t.generatedColumn,originalLine:t.originalLine,originalColumn:t.originalColumn,name:null===t.name?null:this._names.at(t.name)}}),this).forEach(t,n)},r.prototype.allGeneratedPositionsFor=function(t){var s=e.getArg(t,"line"),i={source:e.getArg(t,"source"),originalLine:s,originalColumn:e.getArg(t,"column",0)};if(i.source=this._findSourceIndex(i.source),i.source<0)return[];var n=[],r=this._findMapping(i,this._originalMappings,"originalLine","originalColumn",e.compareByOriginalPositions,a.LEAST_UPPER_BOUND);if(r>=0){var o=this._originalMappings[r];if(void 0===t.column)for(var c=o.originalLine;o&&o.originalLine===c;)n.push({line:e.getArg(o,"generatedLine",null),column:e.getArg(o,"generatedColumn",null),lastColumn:e.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++r];else for(var l=o.originalColumn;o&&o.originalLine===s&&o.originalColumn==l;)n.push({line:e.getArg(o,"generatedLine",null),column:e.getArg(o,"generatedColumn",null),lastColumn:e.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++r]}return n},t.SourceMapConsumer=r,o.prototype=Object.create(r.prototype),o.prototype.consumer=r,o.prototype._findSourceIndex=function(t){var a,s=t;if(null!=this.sourceRoot&&(s=e.relative(this.sourceRoot,s)),this._sources.has(s))return this._sources.indexOf(s);for(a=0;a<this._absoluteSources.length;++a)if(this._absoluteSources[a]==t)return a;return-1},o.fromSourceMap=function(t,a){var i=Object.create(o.prototype),r=i._names=s.fromArray(t._names.toArray(),!0),l=i._sources=s.fromArray(t._sources.toArray(),!0);i.sourceRoot=t._sourceRoot,i.sourcesContent=t._generateSourcesContent(i._sources.toArray(),i.sourceRoot),i.file=t._file,i._sourceMapURL=a,i._absoluteSources=i._sources.toArray().map((function(t){return e.computeSourceURL(i.sourceRoot,t,a)}));for(var h=t._mappings.toArray().slice(),d=i.__generatedMappings=[],u=i.__originalMappings=[],p=0,m=h.length;p<m;p++){var f=h[p],g=new c;g.generatedLine=f.generatedLine,g.generatedColumn=f.generatedColumn,f.source&&(g.source=l.indexOf(f.source),g.originalLine=f.originalLine,g.originalColumn=f.originalColumn,f.name&&(g.name=r.indexOf(f.name)),u.push(g)),d.push(g)}return n(i.__originalMappings,e.compareByOriginalPositions),i},o.prototype._version=3,Object.defineProperty(o.prototype,"sources",{get:function(){return this._absoluteSources.slice()}}),o.prototype._parseMappings=function(t,a){for(var s,r,o,l,h,d=1,u=0,p=0,m=0,f=0,g=0,E=t.length,w=0,v={},y={},I=[],D=[];w<E;)if(";"===t.charAt(w))d++,w++,u=0;else if(","===t.charAt(w))w++;else{for((s=new c).generatedLine=d,l=w;l<E&&!this._charIsMappingSeparator(t,l);l++);if(o=v[r=t.slice(w,l)])w+=r.length;else{for(o=[];w<l;)i.decode(t,w,y),h=y.value,w=y.rest,o.push(h);if(2===o.length)throw new Error("Found a source, but no line and column");if(3===o.length)throw new Error("Found a source and line, but no column");v[r]=o}s.generatedColumn=u+o[0],u=s.generatedColumn,o.length>1&&(s.source=f+o[1],f+=o[1],s.originalLine=p+o[2],p=s.originalLine,s.originalLine+=1,s.originalColumn=m+o[3],m=s.originalColumn,o.length>4&&(s.name=g+o[4],g+=o[4])),D.push(s),"number"==typeof s.originalLine&&I.push(s)}n(D,e.compareByGeneratedPositionsDeflated),this.__generatedMappings=D,n(I,e.compareByOriginalPositions),this.__originalMappings=I},o.prototype._findMapping=function(t,e,s,i,n,r){if(t[s]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+t[s]);if(t[i]<0)throw new TypeError("Column must be greater than or equal to 0, got "+t[i]);return a.search(t,e,n,r)},o.prototype.computeColumnSpans=function(){for(var t=0;t<this._generatedMappings.length;++t){var e=this._generatedMappings[t];if(t+1<this._generatedMappings.length){var a=this._generatedMappings[t+1];if(e.generatedLine===a.generatedLine){e.lastGeneratedColumn=a.generatedColumn-1;continue}}e.lastGeneratedColumn=1/0}},o.prototype.originalPositionFor=function(t){var a={generatedLine:e.getArg(t,"line"),generatedColumn:e.getArg(t,"column")},s=this._findMapping(a,this._generatedMappings,"generatedLine","generatedColumn",e.compareByGeneratedPositionsDeflated,e.getArg(t,"bias",r.GREATEST_LOWER_BOUND));if(s>=0){var i=this._generatedMappings[s];if(i.generatedLine===a.generatedLine){var n=e.getArg(i,"source",null);null!==n&&(n=this._sources.at(n),n=e.computeSourceURL(this.sourceRoot,n,this._sourceMapURL));var o=e.getArg(i,"name",null);return null!==o&&(o=this._names.at(o)),{source:n,line:e.getArg(i,"originalLine",null),column:e.getArg(i,"originalColumn",null),name:o}}}return{source:null,line:null,column:null,name:null}},o.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some((function(t){return null==t})))},o.prototype.sourceContentFor=function(t,a){if(!this.sourcesContent)return null;var s=this._findSourceIndex(t);if(s>=0)return this.sourcesContent[s];var i,n=t;if(null!=this.sourceRoot&&(n=e.relative(this.sourceRoot,n)),null!=this.sourceRoot&&(i=e.urlParse(this.sourceRoot))){var r=n.replace(/^file:\/\//,"");if("file"==i.scheme&&this._sources.has(r))return this.sourcesContent[this._sources.indexOf(r)];if((!i.path||"/"==i.path)&&this._sources.has("/"+n))return this.sourcesContent[this._sources.indexOf("/"+n)]}if(a)return null;throw new Error('"'+n+'" is not in the SourceMap.')},o.prototype.generatedPositionFor=function(t){var a=e.getArg(t,"source");if((a=this._findSourceIndex(a))<0)return{line:null,column:null,lastColumn:null};var s={source:a,originalLine:e.getArg(t,"line"),originalColumn:e.getArg(t,"column")},i=this._findMapping(s,this._originalMappings,"originalLine","originalColumn",e.compareByOriginalPositions,e.getArg(t,"bias",r.GREATEST_LOWER_BOUND));if(i>=0){var n=this._originalMappings[i];if(n.source===s.source)return{line:e.getArg(n,"generatedLine",null),column:e.getArg(n,"generatedColumn",null),lastColumn:e.getArg(n,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},t.BasicSourceMapConsumer=o,l.prototype=Object.create(r.prototype),l.prototype.constructor=r,l.prototype._version=3,Object.defineProperty(l.prototype,"sources",{get:function(){for(var t=[],e=0;e<this._sections.length;e++)for(var a=0;a<this._sections[e].consumer.sources.length;a++)t.push(this._sections[e].consumer.sources[a]);return t}}),l.prototype.originalPositionFor=function(t){var s={generatedLine:e.getArg(t,"line"),generatedColumn:e.getArg(t,"column")},i=a.search(s,this._sections,(function(t,e){var a=t.generatedLine-e.generatedOffset.generatedLine;return a||t.generatedColumn-e.generatedOffset.generatedColumn})),n=this._sections[i];return n?n.consumer.originalPositionFor({line:s.generatedLine-(n.generatedOffset.generatedLine-1),column:s.generatedColumn-(n.generatedOffset.generatedLine===s.generatedLine?n.generatedOffset.generatedColumn-1:0),bias:t.bias}):{source:null,line:null,column:null,name:null}},l.prototype.hasContentsOfAllSources=function(){return this._sections.every((function(t){return t.consumer.hasContentsOfAllSources()}))},l.prototype.sourceContentFor=function(t,e){for(var a=0;a<this._sections.length;a++){var s=this._sections[a].consumer.sourceContentFor(t,!0);if(s)return s}if(e)return null;throw new Error('"'+t+'" is not in the SourceMap.')},l.prototype.generatedPositionFor=function(t){for(var a=0;a<this._sections.length;a++){var s=this._sections[a];if(-1!==s.consumer._findSourceIndex(e.getArg(t,"source"))){var i=s.consumer.generatedPositionFor(t);if(i)return{line:i.line+(s.generatedOffset.generatedLine-1),column:i.column+(s.generatedOffset.generatedLine===i.line?s.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},l.prototype._parseMappings=function(t,a){this.__generatedMappings=[],this.__originalMappings=[];for(var s=0;s<this._sections.length;s++)for(var i=this._sections[s],r=i.consumer._generatedMappings,o=0;o<r.length;o++){var c=r[o],l=i.consumer._sources.at(c.source);l=e.computeSourceURL(i.consumer.sourceRoot,l,this._sourceMapURL),this._sources.add(l),l=this._sources.indexOf(l);var h=null;c.name&&(h=i.consumer._names.at(c.name),this._names.add(h),h=this._names.indexOf(h));var d={source:l,generatedLine:c.generatedLine+(i.generatedOffset.generatedLine-1),generatedColumn:c.generatedColumn+(i.generatedOffset.generatedLine===c.generatedLine?i.generatedOffset.generatedColumn-1:0),originalLine:c.originalLine,originalColumn:c.originalColumn,name:h};this.__generatedMappings.push(d),"number"==typeof d.originalLine&&this.__originalMappings.push(d)}n(this.__generatedMappings,e.compareByGeneratedPositionsDeflated),n(this.__originalMappings,e.compareByOriginalPositions)},t.IndexedSourceMapConsumer=l}}),ee=gt({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-node.js"(t){var e=Qt().SourceMapGenerator,a=Yt(),s=/(\r?\n)/,i="$$$isSourceNode$$$";function n(t,e,a,s,n){this.children=[],this.sourceContents={},this.line=null==t?null:t,this.column=null==e?null:e,this.source=null==a?null:a,this.name=null==n?null:n,this[i]=!0,null!=s&&this.add(s)}n.fromStringWithSourceMap=function(t,e,i){var r=new n,o=t.split(s),c=0,l=function(){return t()+(t()||"");function t(){return c<o.length?o[c++]:void 0}},h=1,d=0,u=null;return e.eachMapping((function(t){if(null!==u){if(!(h<t.generatedLine)){var e=(a=o[c]||"").substr(0,t.generatedColumn-d);return o[c]=a.substr(t.generatedColumn-d),d=t.generatedColumn,p(u,e),void(u=t)}p(u,l()),h++,d=0}for(;h<t.generatedLine;)r.add(l()),h++;if(d<t.generatedColumn){var a=o[c]||"";r.add(a.substr(0,t.generatedColumn)),o[c]=a.substr(t.generatedColumn),d=t.generatedColumn}u=t}),this),c<o.length&&(u&&p(u,l()),r.add(o.splice(c).join(""))),e.sources.forEach((function(t){var s=e.sourceContentFor(t);null!=s&&(null!=i&&(t=a.join(i,t)),r.setSourceContent(t,s))})),r;function p(t,e){if(null===t||void 0===t.source)r.add(e);else{var s=i?a.join(i,t.source):t.source;r.add(new n(t.originalLine,t.originalColumn,s,e,t.name))}}},n.prototype.add=function(t){if(Array.isArray(t))t.forEach((function(t){this.add(t)}),this);else{if(!t[i]&&"string"!=typeof t)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);t&&this.children.push(t)}return this},n.prototype.prepend=function(t){if(Array.isArray(t))for(var e=t.length-1;e>=0;e--)this.prepend(t[e]);else{if(!t[i]&&"string"!=typeof t)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);this.children.unshift(t)}return this},n.prototype.walk=function(t){for(var e,a=0,s=this.children.length;a<s;a++)(e=this.children[a])[i]?e.walk(t):""!==e&&t(e,{source:this.source,line:this.line,column:this.column,name:this.name})},n.prototype.join=function(t){var e,a,s=this.children.length;if(s>0){for(e=[],a=0;a<s-1;a++)e.push(this.children[a]),e.push(t);e.push(this.children[a]),this.children=e}return this},n.prototype.replaceRight=function(t,e){var a=this.children[this.children.length-1];return a[i]?a.replaceRight(t,e):"string"==typeof a?this.children[this.children.length-1]=a.replace(t,e):this.children.push("".replace(t,e)),this},n.prototype.setSourceContent=function(t,e){this.sourceContents[a.toSetString(t)]=e},n.prototype.walkSourceContents=function(t){for(var e=0,s=this.children.length;e<s;e++)this.children[e][i]&&this.children[e].walkSourceContents(t);var n=Object.keys(this.sourceContents);for(e=0,s=n.length;e<s;e++)t(a.fromSetString(n[e]),this.sourceContents[n[e]])},n.prototype.toString=function(){var t="";return this.walk((function(e){t+=e})),t},n.prototype.toStringWithSourceMap=function(t){var a={code:"",line:1,column:0},s=new e(t),i=!1,n=null,r=null,o=null,c=null;return this.walk((function(t,e){a.code+=t,null!==e.source&&null!==e.line&&null!==e.column?(n===e.source&&r===e.line&&o===e.column&&c===e.name||s.addMapping({source:e.source,original:{line:e.line,column:e.column},generated:{line:a.line,column:a.column},name:e.name}),n=e.source,r=e.line,o=e.column,c=e.name,i=!0):i&&(s.addMapping({generated:{line:a.line,column:a.column}}),n=null,i=!1);for(var l=0,h=t.length;l<h;l++)10===t.charCodeAt(l)?(a.line++,a.column=0,l+1===h?(n=null,i=!1):i&&s.addMapping({source:e.source,original:{line:e.line,column:e.column},generated:{line:a.line,column:a.column},name:e.name})):a.column++})),this.walkSourceContents((function(t,e){s.setSourceContent(t,e)})),{code:a.code,map:s}},t.SourceNode=n}}),ae=gt({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/source-map.js"(t){t.SourceMapGenerator=Qt().SourceMapGenerator,t.SourceMapConsumer=te().SourceMapConsumer,t.SourceNode=ee().SourceNode}}),se=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/code-gen.js"(t,e){t.__esModule=!0;var a,s=wt(),i=void 0;try{"function"==typeof define&&define.amd||(a=ae(),i=a.SourceNode)}catch(t){}function n(t,e,a){if(s.isArray(t)){for(var i=[],n=0,r=t.length;n<r;n++)i.push(e.wrap(t[n],a));return i}return"boolean"==typeof t||"number"==typeof t?t+"":t}function r(t){this.srcFile=t,this.source=[]}i||((i=function(t,e,a,s){this.src="",s&&this.add(s)}).prototype={add:function(t){s.isArray(t)&&(t=t.join("")),this.src+=t},prepend:function(t){s.isArray(t)&&(t=t.join("")),this.src=t+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}}),r.prototype={isEmpty:function(){return!this.source.length},prepend:function(t,e){this.source.unshift(this.wrap(t,e))},push:function(t,e){this.source.push(this.wrap(t,e))},merge:function(){var t=this.empty();return this.each((function(e){t.add([" ",e,"\n"])})),t},each:function(t){for(var e=0,a=this.source.length;e<a;e++)t(this.source[e])},empty:function(){var t=this.currentLocation||{start:{}};return new i(t.start.line,t.start.column,this.srcFile)},wrap:function(t){var e=arguments.length<=1||void 0===arguments[1]?this.currentLocation||{start:{}}:arguments[1];return t instanceof i?t:(t=n(t,this,e),new i(e.start.line,e.start.column,this.srcFile,t))},functionCall:function(t,e,a){return a=this.generateList(a),this.wrap([t,e?"."+e+"(":"(",a,")"])},quotedString:function(t){return'"'+(t+"").replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(t){var e=this,a=[];Object.keys(t).forEach((function(s){var i=n(t[s],e);"undefined"!==i&&a.push([e.quotedString(s),":",i])}));var s=this.generateList(a);return s.prepend("{"),s.add("}"),s},generateList:function(t){for(var e=this.empty(),a=0,s=t.length;a<s;a++)a&&e.add(","),e.add(n(t[a],this));return e},generateArray:function(t){var e=this.generateList(t);return e.prepend("["),e.add("]"),e}},t.default=r,e.exports=t.default}}),ie=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js"(t,e){function a(t){return t&&t.__esModule?t:{default:t}}t.__esModule=!0;var s=Nt(),i=a(vt()),n=wt(),r=a(se());function o(t){this.value=t}function c(){}c.prototype={nameLookup:function(t,e){return this.internalNameLookup(t,e)},depthedLookup:function(t){return[this.aliasable("container.lookup"),"(depths, ",JSON.stringify(t),")"]},compilerInfo:function(){var t=s.COMPILER_REVISION;return[t,s.REVISION_CHANGES[t]]},appendToBuffer:function(t,e,a){return n.isArray(t)||(t=[t]),t=this.source.wrap(t,e),this.environment.isSimple?["return ",t,";"]:a?["buffer += ",t,";"]:(t.appendToBuffer=!0,t)},initializeBuffer:function(){return this.quotedString("")},internalNameLookup:function(t,e){return this.lookupPropertyFunctionIsUsed=!0,["lookupProperty(",t,",",JSON.stringify(e),")"]},lookupPropertyFunctionIsUsed:!1,compile:function(t,e,a,s){this.environment=t,this.options=e,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!s,this.name=this.environment.name,this.isChild=!!a,this.context=a||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(t,e),this.useDepths=this.useDepths||t.useDepths||t.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||t.useBlockParams;var n=t.opcodes,r=void 0,o=void 0,c=void 0,l=void 0;for(c=0,l=n.length;c<l;c++)r=n[c],this.source.currentLocation=r.loc,o=o||r.loc,this[r.opcode].apply(this,r.args);if(this.source.currentLocation=o,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new i.default("Compile completed with content left on stack");this.decorators.isEmpty()?this.decorators=void 0:(this.useDecorators=!0,this.decorators.prepend(["var decorators = container.decorators, ",this.lookupPropertyFunctionVarDeclaration(),";\n"]),this.decorators.push("return fn;"),s?this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]):(this.decorators.prepend("function(fn, props, container, depth0, data, blockParams, depths) {\n"),this.decorators.push("}\n"),this.decorators=this.decorators.merge()));var h=this.createFunctionContext(s);if(this.isChild)return h;var d={compiler:this.compilerInfo(),main:h};this.decorators&&(d.main_d=this.decorators,d.useDecorators=!0);var u=this.context,p=u.programs,m=u.decorators;for(c=0,l=p.length;c<l;c++)p[c]&&(d[c]=p[c],m[c]&&(d[c+"_d"]=m[c],d.useDecorators=!0));return this.environment.usePartial&&(d.usePartial=!0),this.options.data&&(d.useData=!0),this.useDepths&&(d.useDepths=!0),this.useBlockParams&&(d.useBlockParams=!0),this.options.compat&&(d.compat=!0),s?d.compilerOptions=this.options:(d.compiler=JSON.stringify(d.compiler),this.source.currentLocation={start:{line:1,column:0}},d=this.objectLiteral(d),e.srcName?(d=d.toStringWithSourceMap({file:e.destName})).map=d.map&&d.map.toString():d=d.toString()),d},preamble:function(){this.lastContext=0,this.source=new r.default(this.options.srcName),this.decorators=new r.default(this.options.srcName)},createFunctionContext:function(t){var e=this,a="",s=this.stackVars.concat(this.registers.list);s.length>0&&(a+=", "+s.join(", "));var i=0;Object.keys(this.aliases).forEach((function(t){var s=e.aliases[t];s.children&&s.referenceCount>1&&(a+=", alias"+ ++i+"="+t,s.children[0]="alias"+i)})),this.lookupPropertyFunctionIsUsed&&(a+=", "+this.lookupPropertyFunctionVarDeclaration());var n=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&n.push("blockParams"),this.useDepths&&n.push("depths");var r=this.mergeSource(a);return t?(n.push(r),Function.apply(this,n)):this.source.wrap(["function(",n.join(","),") {\n ",r,"}"])},mergeSource:function(t){var e=this.environment.isSimple,a=!this.forceBuffer,s=void 0,i=void 0,n=void 0,r=void 0;return this.source.each((function(t){t.appendToBuffer?(n?t.prepend(" + "):n=t,r=t):(n&&(i?n.prepend("buffer += "):s=!0,r.add(";"),n=r=void 0),i=!0,e||(a=!1))})),a?n?(n.prepend("return "),r.add(";")):i||this.source.push('return "";'):(t+=", buffer = "+(s?"":this.initializeBuffer()),n?(n.prepend("return buffer + "),r.add(";")):this.source.push("return buffer;")),t&&this.source.prepend("var "+t.substring(2)+(s?"":";\n")),this.source.merge()},lookupPropertyFunctionVarDeclaration:function(){return"\n lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n }\n ".trim()},blockValue:function(t){var e=this.aliasable("container.hooks.blockHelperMissing"),a=[this.contextName(0)];this.setupHelperArgs(t,0,a);var s=this.popStack();a.splice(1,0,s),this.push(this.source.functionCall(e,"call",a))},ambiguousBlockValue:function(){var t=this.aliasable("container.hooks.blockHelperMissing"),e=[this.contextName(0)];this.setupHelperArgs("",0,e,!0),this.flushInline();var a=this.topStack();e.splice(1,0,a),this.pushSource(["if (!",this.lastHelper,") { ",a," = ",this.source.functionCall(t,"call",e),"}"])},appendContent:function(t){this.pendingContent?t=this.pendingContent+t:this.pendingLocation=this.source.currentLocation,this.pendingContent=t},append:function(){if(this.isInline())this.replaceStack((function(t){return[" != null ? ",t,' : ""']})),this.pushSource(this.appendToBuffer(this.popStack()));else{var t=this.popStack();this.pushSource(["if (",t," != null) { ",this.appendToBuffer(t,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(t){this.lastContext=t},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(t,e,a,s){var i=0;s||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(t[i++])),this.resolvePath("context",t,i,e,a)},lookupBlockParam:function(t,e){this.useBlockParams=!0,this.push(["blockParams[",t[0],"][",t[1],"]"]),this.resolvePath("context",e,1)},lookupData:function(t,e,a){t?this.pushStackLiteral("container.data(data, "+t+")"):this.pushStackLiteral("data"),this.resolvePath("data",e,0,!0,a)},resolvePath:function(t,e,a,s,i){var n=this;if(this.options.strict||this.options.assumeObjects)this.push(function(t,e,a,s,i){var n=e.popStack(),r=a.length;t&&r--;for(;s<r;s++)n=e.nameLookup(n,a[s],i);return t?[e.aliasable("container.strict"),"(",n,", ",e.quotedString(a[s]),", ",JSON.stringify(e.source.currentLocation)," )"]:n}(this.options.strict&&i,this,e,a,t));else for(var r=e.length;a<r;a++)this.replaceStack((function(i){var r=n.nameLookup(i,e[a],t);return s?[" && ",r]:[" != null ? ",r," : ",i]}))},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(t,e){this.pushContext(),this.pushString(e),"SubExpression"!==e&&("string"==typeof t?this.pushString(t):this.pushStackLiteral(t))},emptyHash:function(t){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(t?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function(){var t=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(t.ids)),this.stringParams&&(this.push(this.objectLiteral(t.contexts)),this.push(this.objectLiteral(t.types))),this.push(this.objectLiteral(t.values))},pushString:function(t){this.pushStackLiteral(this.quotedString(t))},pushLiteral:function(t){this.pushStackLiteral(t)},pushProgram:function(t){null!=t?this.pushStackLiteral(this.programExpression(t)):this.pushStackLiteral(null)},registerDecorator:function(t,e){var a=this.nameLookup("decorators",e,"decorator"),s=this.setupHelperArgs(e,t);this.decorators.push(["fn = ",this.decorators.functionCall(a,"",["fn","props","container",s])," || fn;"])},invokeHelper:function(t,e,a){var s=this.popStack(),i=this.setupHelper(t,e),n=[];a&&n.push(i.name),n.push(s),this.options.strict||n.push(this.aliasable("container.hooks.helperMissing"));var r=["(",this.itemsSeparatedBy(n,"||"),")"],o=this.source.functionCall(r,"call",i.callParams);this.push(o)},itemsSeparatedBy:function(t,e){var a=[];a.push(t[0]);for(var s=1;s<t.length;s++)a.push(e,t[s]);return a},invokeKnownHelper:function(t,e){var a=this.setupHelper(t,e);this.push(this.source.functionCall(a.name,"call",a.callParams))},invokeAmbiguous:function(t,e){this.useRegister("helper");var a=this.popStack();this.emptyHash();var s=this.setupHelper(0,t,e),i=["(","(helper = ",this.lastHelper=this.nameLookup("helpers",t,"helper")," || ",a,")"];this.options.strict||(i[0]="(helper = ",i.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"))),this.push(["(",i,s.paramsInit?["),(",s.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",s.callParams)," : helper))"])},invokePartial:function(t,e,a){var s=[],i=this.setupParams(e,1,s);t&&(e=this.popStack(),delete i.name),a&&(i.indent=JSON.stringify(a)),i.helpers="helpers",i.partials="partials",i.decorators="container.decorators",t?s.unshift(e):s.unshift(this.nameLookup("partials",e,"partial")),this.options.compat&&(i.depths="depths"),i=this.objectLiteral(i),s.push(i),this.push(this.source.functionCall("container.invokePartial","",s))},assignToHash:function(t){var e=this.popStack(),a=void 0,s=void 0,i=void 0;this.trackIds&&(i=this.popStack()),this.stringParams&&(s=this.popStack(),a=this.popStack());var n=this.hash;a&&(n.contexts[t]=a),s&&(n.types[t]=s),i&&(n.ids[t]=i),n.values[t]=e},pushId:function(t,e,a){"BlockParam"===t?this.pushStackLiteral("blockParams["+e[0]+"].path["+e[1]+"]"+(a?" + "+JSON.stringify("."+a):"")):"PathExpression"===t?this.pushString(e):"SubExpression"===t?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:c,compileChildren:function(t,e){for(var a=t.children,s=void 0,i=void 0,n=0,r=a.length;n<r;n++){s=a[n],i=new this.compiler;var o=this.matchExistingProgram(s);if(null==o){this.context.programs.push("");var c=this.context.programs.length;s.index=c,s.name="program"+c,this.context.programs[c]=i.compile(s,e,this.context,!this.precompile),this.context.decorators[c]=i.decorators,this.context.environments[c]=s,this.useDepths=this.useDepths||i.useDepths,this.useBlockParams=this.useBlockParams||i.useBlockParams,s.useDepths=this.useDepths,s.useBlockParams=this.useBlockParams}else s.index=o.index,s.name="program"+o.index,this.useDepths=this.useDepths||o.useDepths,this.useBlockParams=this.useBlockParams||o.useBlockParams}},matchExistingProgram:function(t){for(var e=0,a=this.context.environments.length;e<a;e++){var s=this.context.environments[e];if(s&&s.equals(t))return s}},programExpression:function(t){var e=this.environment.children[t],a=[e.index,"data",e.blockParams];return(this.useBlockParams||this.useDepths)&&a.push("blockParams"),this.useDepths&&a.push("depths"),"container.program("+a.join(", ")+")"},useRegister:function(t){this.registers[t]||(this.registers[t]=!0,this.registers.list.push(t))},push:function(t){return t instanceof o||(t=this.source.wrap(t)),this.inlineStack.push(t),t},pushStackLiteral:function(t){this.push(new o(t))},pushSource:function(t){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),t&&this.source.push(t)},replaceStack:function(t){var e=["("],a=void 0,s=void 0,n=void 0;if(!this.isInline())throw new i.default("replaceStack on non-inline");var r=this.popStack(!0);if(r instanceof o)e=["(",a=[r.value]],n=!0;else{s=!0;var c=this.incrStack();e=["((",this.push(c)," = ",r,")"],a=this.topStack()}var l=t.call(this,a);n||this.popStack(),s&&this.stackSlot--,this.push(e.concat(l,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var t=this.inlineStack;this.inlineStack=[];for(var e=0,a=t.length;e<a;e++){var s=t[e];if(s instanceof o)this.compileStack.push(s);else{var i=this.incrStack();this.pushSource([i," = ",s,";"]),this.compileStack.push(i)}}},isInline:function(){return this.inlineStack.length},popStack:function(t){var e=this.isInline(),a=(e?this.inlineStack:this.compileStack).pop();if(!t&&a instanceof o)return a.value;if(!e){if(!this.stackSlot)throw new i.default("Invalid stack pop");this.stackSlot--}return a},topStack:function(){var t=this.isInline()?this.inlineStack:this.compileStack,e=t[t.length-1];return e instanceof o?e.value:e},contextName:function(t){return this.useDepths&&t?"depths["+t+"]":"depth"+t},quotedString:function(t){return this.source.quotedString(t)},objectLiteral:function(t){return this.source.objectLiteral(t)},aliasable:function(t){var e=this.aliases[t];return e?(e.referenceCount++,e):((e=this.aliases[t]=this.source.wrap(t)).aliasable=!0,e.referenceCount=1,e)},setupHelper:function(t,e,a){var s=[];return{params:s,paramsInit:this.setupHelperArgs(e,t,s,a),name:this.nameLookup("helpers",e,"helper"),callParams:[this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})")].concat(s)}},setupParams:function(t,e,a){var s={},i=[],n=[],r=[],o=!a,c=void 0;o&&(a=[]),s.name=this.quotedString(t),s.hash=this.popStack(),this.trackIds&&(s.hashIds=this.popStack()),this.stringParams&&(s.hashTypes=this.popStack(),s.hashContexts=this.popStack());var l=this.popStack(),h=this.popStack();(h||l)&&(s.fn=h||"container.noop",s.inverse=l||"container.noop");for(var d=e;d--;)c=this.popStack(),a[d]=c,this.trackIds&&(r[d]=this.popStack()),this.stringParams&&(n[d]=this.popStack(),i[d]=this.popStack());return o&&(s.args=this.source.generateArray(a)),this.trackIds&&(s.ids=this.source.generateArray(r)),this.stringParams&&(s.types=this.source.generateArray(n),s.contexts=this.source.generateArray(i)),this.options.data&&(s.data="data"),this.useBlockParams&&(s.blockParams="blockParams"),s},setupHelperArgs:function(t,e,a,s){var i=this.setupParams(t,e,a);return i.loc=JSON.stringify(this.source.currentLocation),i=this.objectLiteral(i),s?(this.useRegister("options"),a.push("options"),["options=",i]):a?(a.push(i),""):i}},function(){for(var t="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),e=c.RESERVED_WORDS={},a=0,s=t.length;a<s;a++)e[t[a]]=!0}(),c.isValidJavaScriptVariableName=function(t){return!c.RESERVED_WORDS[t]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(t)},t.default=c,e.exports=t.default}}),ne=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars.js"(t,e){function a(t){return t&&t.__esModule?t:{default:t}}t.__esModule=!0;var s=a(Ft()),i=a(Wt()),n=Gt(),r=Ht(),o=a(ie()),c=a(Ut()),l=a(kt()),h=s.default.create;function d(){var t=h();return t.compile=function(e,a){return r.compile(e,a,t)},t.precompile=function(e,a){return r.precompile(e,a,t)},t.AST=i.default,t.Compiler=r.Compiler,t.JavaScriptCompiler=o.default,t.Parser=n.parser,t.parse=n.parse,t.parseWithoutProcessing=n.parseWithoutProcessing,t}var u=d();u.create=d,l.default(u),u.Visitor=c.default,u.default=u,t.default=u,e.exports=t.default}}),re=gt({"../../node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.js"(t,e){function a(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function s(t,e){for(var a,s="",i=0,n=-1,r=0,o=0;o<=t.length;++o){if(o<t.length)a=t.charCodeAt(o);else{if(47===a)break;a=47}if(47===a){if(n===o-1||1===r);else if(n!==o-1&&2===r){if(s.length<2||2!==i||46!==s.charCodeAt(s.length-1)||46!==s.charCodeAt(s.length-2))if(s.length>2){var c=s.lastIndexOf("/");if(c!==s.length-1){-1===c?(s="",i=0):i=(s=s.slice(0,c)).length-1-s.lastIndexOf("/"),n=o,r=0;continue}}else if(2===s.length||1===s.length){s="",i=0,n=o,r=0;continue}e&&(s.length>0?s+="/..":s="..",i=2)}else s.length>0?s+="/"+t.slice(n+1,o):s=t.slice(n+1,o),i=o-n-1;n=o,r=0}else 46===a&&-1!==r?++r:r=-1}return s}var i={resolve:function(){for(var t,e="",i=!1,n=arguments.length-1;n>=-1&&!i;n--){var r;n>=0?r=arguments[n]:(void 0===t&&(t=process.cwd()),r=t),a(r),0!==r.length&&(e=r+"/"+e,i=47===r.charCodeAt(0))}return e=s(e,!i),i?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(t){if(a(t),0===t.length)return".";var e=47===t.charCodeAt(0),i=47===t.charCodeAt(t.length-1);return 0!==(t=s(t,!e)).length||e||(t="."),t.length>0&&i&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return a(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e<arguments.length;++e){var s=arguments[e];a(s),s.length>0&&(void 0===t?t=s:t+="/"+s)}return void 0===t?".":i.normalize(t)},relative:function(t,e){if(a(t),a(e),t===e)return"";if((t=i.resolve(t))===(e=i.resolve(e)))return"";for(var s=1;s<t.length&&47===t.charCodeAt(s);++s);for(var n=t.length,r=n-s,o=1;o<e.length&&47===e.charCodeAt(o);++o);for(var c=e.length-o,l=r<c?r:c,h=-1,d=0;d<=l;++d){if(d===l){if(c>l){if(47===e.charCodeAt(o+d))return e.slice(o+d+1);if(0===d)return e.slice(o+d)}else r>l&&(47===t.charCodeAt(s+d)?h=d:0===d&&(h=0));break}var u=t.charCodeAt(s+d);if(u!==e.charCodeAt(o+d))break;47===u&&(h=d)}var p="";for(d=s+h+1;d<=n;++d)d!==n&&47!==t.charCodeAt(d)||(0===p.length?p+="..":p+="/..");return p.length>0?p+e.slice(o+h):(o+=h,47===e.charCodeAt(o)&&++o,e.slice(o))},_makeLong:function(t){return t},dirname:function(t){if(a(t),0===t.length)return".";for(var e=t.charCodeAt(0),s=47===e,i=-1,n=!0,r=t.length-1;r>=1;--r)if(47===(e=t.charCodeAt(r))){if(!n){i=r;break}}else n=!1;return-1===i?s?"/":".":s&&1===i?"//":t.slice(0,i)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');a(t);var s,i=0,n=-1,r=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var o=e.length-1,c=-1;for(s=t.length-1;s>=0;--s){var l=t.charCodeAt(s);if(47===l){if(!r){i=s+1;break}}else-1===c&&(r=!1,c=s+1),o>=0&&(l===e.charCodeAt(o)?-1==--o&&(n=s):(o=-1,n=c))}return i===n?n=c:-1===n&&(n=t.length),t.slice(i,n)}for(s=t.length-1;s>=0;--s)if(47===t.charCodeAt(s)){if(!r){i=s+1;break}}else-1===n&&(r=!1,n=s+1);return-1===n?"":t.slice(i,n)},extname:function(t){a(t);for(var e=-1,s=0,i=-1,n=!0,r=0,o=t.length-1;o>=0;--o){var c=t.charCodeAt(o);if(47!==c)-1===i&&(n=!1,i=o+1),46===c?-1===e?e=o:1!==r&&(r=1):-1!==e&&(r=-1);else if(!n){s=o+1;break}}return-1===e||-1===i||0===r||1===r&&e===i-1&&e===s+1?"":t.slice(e,i)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function(t,e){var a=e.dir||e.root,s=e.base||(e.name||"")+(e.ext||"");return a?a===e.root?a+s:a+t+s:s}("/",t)},parse:function(t){a(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var s,i=t.charCodeAt(0),n=47===i;n?(e.root="/",s=1):s=0;for(var r=-1,o=0,c=-1,l=!0,h=t.length-1,d=0;h>=s;--h)if(47!==(i=t.charCodeAt(h)))-1===c&&(l=!1,c=h+1),46===i?-1===r?r=h:1!==d&&(d=1):-1!==r&&(d=-1);else if(!l){o=h+1;break}return-1===r||-1===c||0===d||1===d&&r===c-1&&r===o+1?-1!==c&&(e.base=e.name=0===o&&n?t.slice(1,c):t.slice(o,c)):(0===o&&n?(e.name=t.slice(1,r),e.base=t.slice(1,c)):(e.name=t.slice(o,r),e.base=t.slice(o,c)),e.ext=t.slice(r,c)),o>0?e.dir=t.slice(0,o-1):n&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};i.posix=i,e.exports=i}}),oe=class{constructor(){this.view={enableDataInfoBar:!0},this.grid={editShowMode:"row",editSaveMode:"cell-blur"},this.appMenu={enableEcho:!0},this.codeList={timeout:36e5}}},ce=t("RegisterCenter",class{constructor(){this.providers=new Map}register(t,e){this.providers.set(t,e)}unRegister(t){this.providers.delete(t)}get(t,...e){const a=this.providers.get(t);if(a)return a(...e)}}),le=class{static isHelperName(t){return this.helperNames.includes(t)}static handleJudgmentExecute(t,e,a){return a.fn?e?a.fn(t):a.inverse(t):e?a.hash.yes=!0:a.hash.no=!1}};le.helperNames=["lookup","log","and","camelCase","concat","eq","gt","get","lowerCase","lt","lte","neq","not","or","pascalCase","pluralize","snakeCase","spinalCase","upperCase"];var he=class{constructor(t,e){t.registerHelper(e,this.onExecute)}},de=class extends he{constructor(t){super(t,"and")}onExecute(...t){const e=t[t.length-1];t.pop();const a=t.filter((t=>!!t)).length===t.length;return le.handleJudgmentExecute(this,a,e)}},ue=class extends he{constructor(t){super(t,"camelCase")}onExecute(t){return t?A(t):""}},pe=class extends he{constructor(t){super(t,"concat")}onExecute(...t){return t.pop(),t.join("")}},me=class extends he{constructor(t){super(t,"eq")}onExecute(t,e,a){const s=P(t,e);return le.handleJudgmentExecute(this,s,a)}},fe=class extends he{constructor(t){super(t,"gt")}onExecute(t,e,a){const s=_(t,e);return le.handleJudgmentExecute(this,s,a)}},ge=class extends he{constructor(t){super(t,"gte")}onExecute(t,e,a){const s=S(t,e);return le.handleJudgmentExecute(this,s,a)}},Ee=class extends he{constructor(t){super(t,"eqPropertyValue")}onExecute(t,e,a,s){let i=!1;return i=b(t)?!P(x(t,(t=>P(t[e],a))),-1):t.hasOwnProperty(e)&&(i=P(t[e],a)),le.handleJudgmentExecute(this,i,s)}},we=class extends he{constructor(t){super(t,"jsonParse")}onExecute(t){return JSON.parse(t)}},ve=class extends he{constructor(t){super(t,"jsonStringify")}onExecute(t,e){return JSON.stringify(t,null,"number"==typeof e?e:void 0)}},ye=class extends he{constructor(t){super(t,"lowerCase")}onExecute(t){return t?t.toLowerCase():""}},Ie=class extends he{constructor(t){super(t,"lt")}onExecute(t,e,a){const s=T(t,e);return le.handleJudgmentExecute(this,s,a)}},De=class extends he{constructor(t){super(t,"lte")}onExecute(t,e,a){const s=L(t,e);return le.handleJudgmentExecute(this,s,a)}},Ce=class extends he{constructor(t){super(t,"neq")}onExecute(t,e,a){const s=!P(t,e);return le.handleJudgmentExecute(this,s,a)}},be=class extends he{constructor(t){super(t,"not")}onExecute(t,e){const a=Handlebars.Utils.isEmpty(t);return le.handleJudgmentExecute(this,a,e)}},Ae=class extends he{constructor(t){super(t,"or")}onExecute(...t){var e;const a=t[t.length-1];t.pop();const s=t.find((t=>!!t));if(a.fn){const t=(null==(e=a.data)?void 0:e.root)||{};return s?a.fn(t):a.inverse(t)}return s||""}},Pe=class extends he{constructor(t){super(t,"pascalCase")}onExecute(t){return t?O(t):""}},_e=class extends he{constructor(t){super(t,"snakeCase")}onExecute(t){return t?N(t):""}},Se=class extends he{constructor(t){super(t,"spinalCase")}onExecute(t){return t?R(t):""}},xe=class extends he{constructor(t){super(t,"upperCase")}onExecute(t){return t?t.toUpperCase():""}};var Te=t("HandlebarsUtil",class{constructor(){this.p=null}get isInit(){return!!this.hsb}async init(){var t;if(!this.isInit)return this.p?this.p:(this.p=Promise.resolve().then((()=>Et(ne(),1))),this.hsb=await this.p,this.p=null,t=this.hsb,new de(t),new ue(t),new pe(t),new me(t),new fe(t),new ge(t),new we(t),new ve(t),new ye(t),new Ie(t),new De(t),new Ce(t),new be(t),new Ae(t),new Pe(t),new _e(t),new Se(t),new xe(t),new Ee(t),this.hsb)}async render(t,e){this.hsb||await this.init();return this.hsb.compile(t)(e)}syncRender(t,e){if(!this.hsb)throw new Error("handlebars not init");return this.hsb.compile(t)(e)}});function Le(t,...e){return!t||D(t)?{}:"[object Array]"===Object.prototype.toString.call(t)?Oe(t,...e):"[object Object]"===Object.prototype.toString.call(t)?Ne(t,...e):{}}function Oe(t,...e){const a={};for(const s of t)if(V(s.value)&&!s.rawValue){const t=e.find((t=>!k(t)&&(t[s.value]||Object.prototype.hasOwnProperty.call(t,s.value))));t&&(a[s.key.toLowerCase()]=t[s.value])}else a[s.key.toLowerCase()]=s.value||null;return a}function Ne(t,...e){const a={},s=/^%(.+)%$/;for(const i in t)if(V(t[i])&&s.test(t[i])){const s=t[i].substring(1,t[i].length-1),n=e.find((t=>Object.prototype.hasOwnProperty.call(t,s)));n&&(a[i.toLowerCase()]=n[s])}else a[i.toLowerCase()]=t[i]||null;return a}function Re(t){const e=[],a=/^%(.+)%$/;for(const s in t){let i=!0,n=t[s];V(t[s])&&a.test(t[s])&&(i=!1,n=t[s].substring(1,t[s].length-1)),e.push({key:s.toLowerCase(),rawValue:i,value:n})}return e}function Me(t,e){const a={};if(!t)return a;const s=Array.isArray(t)?t:Re(t),i=e[0];return s.forEach((t=>{const{rawValue:s,value:n}=t;!s&&n&&Object.prototype.hasOwnProperty.call(i,n)&&(a[n]=e.map((t=>t[n])).join(";"))})),a}function Ve(t,e){const{deName:a,navFilter:s,pickupDEFName:i,navContexts:n,navParams:r}=t,{context:o,params:c,data:l,derValue:h}=e,d={},u={},p=h||l.srfkey;p&&(a&&(d[a]=p),s&&(u[s]=p),i&&(u["n_".concat(i.toLowerCase(),"_eq")]=p));const m=Le(n,o,c,l),f=Le(r,o,c,l);return Object.assign(d,m),Object.assign(u,f),{resultContext:d,resultParams:u}}function ke(t,e){if(t){const a=t.find((t=>t.id===e));if(a)return a}return null}function Fe(t){const e={},a={},s={};for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)){const n=t[i];if(-1!==i.indexOf(".")){const t=i.split(".");switch(t[0]){case"SRFNAVPARAM":Object.assign(e,{[t[1]]:n});break;case"SRFNAVCTX":Object.assign(a,{[t[1]]:n});break;default:Object.assign(s,{key:n})}}}return{navigateContexts:e,navigateParams:a,other:s}}function We(t){const{width:e,height:a,widthMode:s,heightMode:i}=t,n={width:"",height:""};return"FULL"===s?n.width="100%":e&&e>0&&(n.width=e>0&&e<=1?"".concat(100*e,"%"):"".concat(e,"PERCENTAGE"===s?"%":"px")),"FULL"===i?n.height="100%":a&&a>0&&(n.height=a>0&&a<=1?"".concat(100*a,"%"):"".concat(a,"PERCENTAGE"===i?"%":"px")),n}function Be(t,e){return pa.execScriptFn({data:e},t,{singleRowReturn:!0,isAsync:!1})}function Ue(t,e){const{mainStateAppDEFieldIds:a,demainStates:s}=t;if(a&&s){const t=[];return a.forEach((a=>{t.push(e[a])})),s.find((e=>{const{stateValue:a,state2Value:s,state3Value:i}=e;let n=!0;const r=[a,s,i];for(let e=0;e<t.length;e++)if("".concat(t[e])!=="".concat(r[e])){n=!1;break}return n}))}}function je(t,e){const a=ibiz.hub.getApp().model,{demainStateOPPrivs:s,opprivAllowMode:i}=t,n=(null==s?void 0:s.map((t=>t.name)))||[];let r=[];if(i)r=n;else{r=[...a.deopprivs,...e.deopprivs].filter((t=>!n.includes(t.name))).map((t=>t.name))}return r}function ze(t){return t.split(".").pop()}function Ge(t,e){const a=ze(e);return Y(t[a])}async function He(t){return(await ibiz.hub.getAppDataEntity(t)).formTypeAppDEFieldId}function Xe(t,e){var a;return null==(a=e.appDELogics)?void 0:a.find((e=>e.id===t))}function Ke(t,e){var a,s;const i=[];return null==(a=t.appDEFields)||a.forEach((t=>{"compute"===e&&t.computeAppDEFLogicId?i.push(t.computeAppDEFLogicId):"change"===e&&t.onChangeAppDEFLogicId?i.push(t.onChangeAppDEFLogicId):"default"===e&&t.defaultValueAppDEFLogicId&&i.push(t.defaultValueAppDEFLogicId)})),(null==(s=t.appDELogics)?void 0:s.filter((t=>i.includes(t.id))))||[]}function Ye(t,e){var a;return null==(a=t.appDEFields)?void 0:a.find((t=>t.id===e))}async function $e(t){const[,,e]=t.split("@");return ibiz.hub.getApp(e).getUIAction(t)}function qe(t){return t.detreeNodes.find((t=>t.rootNode))}function Qe(t,e){return t.detreeNodes.find((t=>t.id===e))}function Je(t,e){const a=e.parentId||qe(t).id;return t.detreeNodeRSs.filter((t=>{return t.parentDETreeNodeId===a&&(s=t.searchMode,i=e.hasQuery,3===s||(i?1===s:2===s));var s,i}))}function Ze(t,e){var a;return null==(a=t.degridEditItems)?void 0:a.find((t=>t.codeName===e))}function ta(t){let e;switch(t.detailType){case"TABPANEL":e=t.deformTabPages;break;case"FORMPAGE":case"TABPAGE":case"GROUPPANEL":e=t.deformDetails}return e||[]}function ea(t){const{viewLayoutPanel:e}=t,a=t.controls||[];return e&&a.push(...e.controls||[]),a}function aa(t){const{viewLayoutPanel:e}=t,a=t.appViewLogics||[];return e&&a.push(...e.appViewLogics||[]),a}function sa(t){const{viewLayoutPanel:e}=t,a=t.appViewEngines||[];return e&&a.push(...e.appViewEngines||[]),a}async function ia(t,e,s={},i={}){return async function(t,e,s={},i={}){var n;const r=t.appViewNavContexts||[],o=Le(r,e,s);e=Object.assign(e.clone(),o);const c=t.appViewNavParams||[],l=Le(c,e,s);Object.assign(s,l);const h=t.appDataEntityId,d=ze(h);let u=(null==(n=i.data)?void 0:n[0])||{};e[d]=u[d]||e[d]||s[d];const p=t.getDataAppDEActionId,m=ibiz.hub.getApp(t.appId),f=await m.deService.getService(h);ibiz.loading.showRedirect();try{const t=await f.exec(p||"get",e,s);if(t.ok){u=t.data;let a=u.linkurl;if(a)return e.srfprocessinstanceid&&(a+=";srfprocessinstanceid=".concat(e.srfprocessinstanceid)),ibiz.env.dev&&-1!==a.indexOf("appredirectview?")&&(a=a.slice(a.indexOf("appredirectview?"))),a.startsWith("http://")||a.startsWith("https://")?new Promise((t=>{const e=window.open(a,"_blank");e&&(e.callback=()=>{t({ok:!0,data:[]})})})):a.startsWith("appredirectview?")?(await na(e,a,i),{ok:!0,data:[]}):{ok:!1,data:[]}}}finally{ibiz.loading.hideRedirect()}const g=await ibiz.hub.getAppDataEntity(h,t.appId),E=await async function(t,e,a,s){let i="";const n=e.typeAppDEFieldId;if(n){const{codeName:a}=Ye(t,n),i=s[a.toLowerCase()];if(V(i))return"".concat(i);ibiz.log.warn("重定向视图[".concat(e.name,"]自定义类别属性[").concat(n,"]值为空"),s)}const r="".concat(ibiz.env.isMob?"MOB":"","EDITVIEW"),o=a.srfwf;if(V(o))return V(a.wf)?"".concat(r,":").concat(o.toUpperCase(),":").concat(a.wf.toUpperCase()):"".concat(r,":").concat(o.toUpperCase());let c="";if(t.indexTypeAppDEFieldId){const{codeName:e}=Ye(t,t.indexTypeAppDEFieldId);c=s[e.toLowerCase()]}if(k(c)&&t.formTypeAppDEFieldId){const{codeName:e}=Ye(t,t.formTypeAppDEFieldId);c=s[e.toLowerCase()]}i=V(c)?"".concat(r,":").concat(c.toString().toUpperCase()):"".concat(r);return i}(g,t,s,u),w=E.split(":"),v=2===w.length?E:w.slice(0,2).join(":"),y="".concat(g.name.toUpperCase(),":").concat(E),I=t.redirectAppViewRefs,D=null==I?void 0:I.find((t=>{const e=t.name||t.id;return e===y||e===E||e===v}));if(!D)throw ibiz.log.error("重定向视图引用有:",null==I?void 0:I.map((({refAppViewId:t,name:e,realTitle:a})=>({viewId:t,tag:e,title:a})))),new a(t,"未找到重定向标识[".concat(E,"]或[").concat(y,"]或工作流[").concat(v,"]对应视图"));{const t=D.refAppViewId;if(!t)throw new a(D,"未配置实际引用视图");{const a=await ibiz.commands.execute(Oa.TAG,t,e,s,{...i,data:[u]});if(a)return a}}return{ok:!0,data:[]}}(t,e,s,i)}async function na(t,a,s={}){const i=a.lastIndexOf("?"),n=decodeURIComponent(a.substring(i+1,a.length)),r=K.parse(n,{delimiter:";"}),o=r.srfdename||"";if(!o)throw new e("重定向参数缺少实体名称");const c=ibiz.hub.getApp(t.srfappid).deName2DeCodeName.get(o.toUpperCase());if(!c)throw new e("未找到指定实体的codeName: ".concat(o));r[c.toLowerCase()]=r[o.toLowerCase()];const l="".concat(c).concat(ibiz.env.isMob?"Mob":"","RedirectView"),h=await ibiz.hub.getAppView(l);if(delete r.srfdename,"undo"!==r.srfwf){const t=r.processDefinitionKey.split("-")[3],e=t.substring(0,t.lastIndexOf("v")),a=t.substring(t.lastIndexOf("v"));r.wf=e,r.wfVersion=a}r.srfprocessinstanceid&&(t.srfprocessinstanceid=r.srfprocessinstanceid,delete r.srfprocessinstanceid),await ibiz.commands.execute(Oa.TAG,h.id,t,r,s)}function ra(t,a,s){if(Object.is(a,"IN"))return la(t,s);if(Object.is(a,"NOTIN"))return!la(t,s);switch(a){case"EQ":return"".concat(t)==="".concat(s);case"NOTEQ":return"".concat(t)!=="".concat(s);case"LT":return oa(t,s)<0;case"LTANDEQ":return oa(t,s)<=0;case"GT":return oa(t,s)>0;case"GTANDEQ":return oa(t,s)>=0;case"ISNULL":return k(t);case"ISNOTNULL":return V(t);case"TESTNULL":return $(t);case"IN":return la(t,s);case"NOTIN":return!la(t,s);case"LIKE":return ha(t,s);case"LEFTLIKE":return ha(t,s,"start");case"RIGHTLIKE":return ha(t,s,"end");default:throw new e("值操作:".concat(a,",暂未支持"))}}function oa(t,a){const s=Number(t),i=Number(a);if(!Number.isNaN(s)&&!Number.isNaN(i))return ca(s,i);const n=new Date(t).getTime(),r=new Date(a).getTime();if(!Number.isNaN(n)&&!Number.isNaN(r))return ca(n,r);throw new e("".concat(t," 和 ").concat(a," 无法比较大小"))}function ca(t,e){return Number.isNaN(t)&&(t=0),Number.isNaN(e)&&(e=0),t>e?1:t<e?-1:0}function la(t,a){if(!a||"string"!=typeof a)throw new e("范围比较的条件值不存或者不是字符串");if(t){return a.split(",").includes("".concat(t))}return!1}function ha(t,e,a){if(!t||!e)return!1;const s="".concat(t).toUpperCase(),i="".concat(e).toUpperCase(),n=s.indexOf(i);switch(a){case"start":return 0===n;case"end":return n+i.length===s.length;default:return-1!==n}}var da={singleRowReturn:!1,isAsync:!0},ua=t("ScriptFunction",class{constructor(t,e,a=da){this.argKeys=[],this.options=a;const s=this.formatCode(e,a);this.calcArgKeys(t,a);const i=new Function(...this.argKeys,s);this.scriptFn=function(...t){return i.apply({},t)}}formatCode(t,e){let a=t;return e.singleRowReturn&&(a="return (".concat(a,")")),e.isAsync&&(a="return (async function() { ".concat(a,"} )();")),a}calcArgKeys(t,e){const a=e.presetParams?Object.keys(e.presetParams):[];a.push(...t);a.push("document","el","selector","env","appSession","topViewSession","viewSession","context","viewParam","activeData","data","app","topView","parentView","view","parent","util"),this.argKeys=Array.from(new Set(a))}convertArgs(t){const{presetParams:e}=this.options,a=e?q(e,t):t;a.document=document,a.selector=t=>document.getElementsByClassName(t);const s=[];return this.argKeys.forEach((t=>{void 0===a[t]&&this.fillDefaultParams(t,a),s.push(a[t])})),s}fillDefaultParams(t,e){const a=e.view;switch(t){case"util":e.util={message:ibiz.message,notification:ibiz.notification,modal:ibiz.modal,confirm:ibiz.confirm,openView:ibiz.openView};break;case"viewParam":e.viewParam=e.params;break;case"env":e.env=ibiz.env;break;case"app":e.app=ibiz.hub.controller;break;case"parent":e.parent=null==a?void 0:a.parentView;break;case"topView":e.topView=null==a?void 0:a.getTopView();break;case"parentView":e.parentView=null==a?void 0:a.parentView;break;case"topViewSession":e.topViewSession=null==a?void 0:a.getTopView().session;break;case"viewSession":e.viewSession=null==a?void 0:a.session;break;case"appSession":e.appSession=ibiz.hub.controller.session}}exec(t){const e=this.convertArgs(t);return this.scriptFn(...e)}}),pa=t("ScriptFactory",class{static createScriptFn(t,e,a){return new ua(t,e,a)}static execScriptFn(t,e,a){return this.createScriptFn(Object.keys(t),e,a).exec(t)}});function ma(t,a,s){const i={isPast:!0,infoMessage:s.ruleInfo};if(function(t){return"GROUP"===t.condType}(s)){const e=s.conds;e&&e.length>0&&(i.isPast=function(t,e,a="AND",s=!1){if(!((null==t?void 0:t.length)>0))return!1;let i="AND"===a;for(let s=0,n=t.length;s<n;s++){const n=e(t[s],s);if("AND"===a){if(!n){i=!1;break}}else if("OR"===a&&n){i=!0;break}}return s?!i:i}(e,(e=>{const{isPast:s,infoMessage:n}=ma(t,a,e);return i.infoMessage=n,s}),s.condOp,!!s.notMode),!i.isPast&&("AND"===s.condOp&&s.notMode||"OR"===s.condOp&&!s.notMode)&&(i.infoMessage=s.ruleInfo))}else{t=null==s?void 0:s.defname.toLowerCase();try{if(function(t){return"SIMPLE"===t.condType}(s))i.isPast=!function(t,a,s,i,n,r,o){Object.is(n,"CURTIME")&&(s="".concat(new Date));if(Object.is(n,"ENTITYFIELD")){s=r[s=s?s.toLowerCase():""]?r[s]:s}($(i)||Q(i))&&(i="内容必须符合值规则");const c=ra(t,a,s);if(!c&&o)throw new e(i);return!c}(a[t],s.condOp,s.paramValue,s.ruleInfo,s.paramType,a,s.keyCond);else if(function(t){return"VALUERANGE2"===t.condType}(s))i.isPast=!function(t,a,s,i,n,r,o){k(r)&&(r="值必须符合值范围规则");if(k(t)){if(o)throw new e("值为空");return r="值为空",!0}if(fa(t,/^-?\d*\.?\d+$/,"",o))return!0;const c=Number.parseFloat(t);if(null!==a)if(s){if(c<a){if(o)throw new e(r);return!0}}else if(c<=a){if(o)throw new e(r);return!0}if(null!=i)if(n){if(c>i){if(o)throw new e(r);return!0}}else if(c>=i){if(o)throw new e(r);return!0}return r="",!1}(a[t],s.minValue,s.includeMinValue,s.maxValue,s.includeMaxValue,s.ruleInfo,s.keyCond);else if(function(t){return"REGEX"===t.condType}(s))i.isPast=!fa(a[t],s.regExCode,s.ruleInfo,s.keyCond);else if(function(t){return"STRINGLENGTH"===t.condType}(s))i.isPast=!function(t,a,s,i,n,r,o){k(r)&&(r="内容长度必须符合范围规则");if(k(t)){if(o)throw new e("值为空");return r="值为空",!0}const c=t.length;if(null!==a)if(s){if(c<a){if(o)throw new e(r);return!0}}else if(c<=a){if(o)throw new e(r);return!0}if(null!==i)if(n){if(c>i){if(o)throw new e(r);return!0}}else if(c>=i){if(o)throw new e(r);return!0}return r="",!1}(a[t],s.minValue,s.includeMinValue,s.maxValue,s.includeMaxValue,s.ruleInfo,s.keyCond);else if(function(t){return"SYSVALUERULE"===t.condType}(s)&&(null==s?void 0:s.sysValueRule)){const{ruleType:n,regExCode:r,scriptCode:o,ruleInfo:c}=s.sysValueRule;if(i.infoMessage=s.ruleInfo||c,"REG"===n)i.isPast=!fa(a[t],r,i.infoMessage,s.keyCond);else if("SCRIPT"===n){const{isPast:n,infoMessage:r}=function(t,a,s,i,n){k(i)&&(i="值必须符合脚本规则");const r=a;let o="",c=!0;const l=t=>{c=!1,(null==t?void 0:t.length)>0?t.forEach((t=>{(null==t?void 0:t.message)&&(o+=t.message)})):(null==t?void 0:t.message)&&(o=t.message)};try{const e=pa.execScriptFn({value:t,data:r},s,{isAsync:!1});"boolean"==typeof e&&(c=e)}catch(t){ibiz.log.error(t),l(t)}if(i="",!c&&n)throw new e(i);return{isPast:c,infoMessage:o||i}}(a[t],a,o,i.infoMessage,s.keyCond);i.isPast=n,i.infoMessage=r||i.infoMessage}}}catch(t){i.isPast=!1}i.isPast=s.notMode?!i.isPast:i.isPast}return i}function fa(t,a,s,i){k(s)&&(s="值必须符合正则规则");if(k(t)){if(i)throw new e("值为空");return s="值为空",!0}if(!new RegExp(a).test(t)){if(i)throw new e(s);return!0}return s="",!1}function ga(t,e){if(function(t){return"GROUP"===t.logicType}(e)){const s=e.defdlogics;if(!s||0===s.length)throw new a(e,"发现空逻辑组,逻辑无法正常执行!");let i=!0;if("AND"===e.groupOP){i=void 0===s.find((e=>!ga(t,e)))}else if("OR"===e.groupOP){i=void 0!==e.defdlogics.find((e=>ga(t,e)))}return e.notMode?!i:i}if(function(t){return"SINGLE"===t.logicType}(e))return ra(t[e.defdname.toLowerCase()],e.condOP,e.value);throw new s(e,"未支持的逻辑类型".concat(e.logicType))}function Ea(t,e){if(function(t){return"GROUP"===t.logicType}(e)){const s=e.panelItemLogics;if(!s||0===s.length)throw new a(e,"发现空逻辑组,逻辑无法正常执行!");let i=!0;if("AND"===e.groupOP){i=void 0===s.find((e=>!Ea(t,e)))}else if("OR"===e.groupOP){i=void 0!==e.panelItemLogics.find((e=>Ea(t,e)))}return e.notMode?!i:i}if(function(t){return"SINGLE"===t.logicType}(e))return ra(t[e.dstModelField.toLowerCase()],e.condOp,e.value);throw new s(e,"未支持的逻辑类型".concat(e.logicType))}var wa=t("LayoutPanelUtil",class{constructor(){this.cache=new Map}register(t,e){this.cache.set(t,e)}get(t){return this.cache.get(t)}fill(t){const{viewLayoutPanel:e}=t;if(!e||!0===e.useDefaultLayout){const e=this.calcLayoutTag(t);if(this.cache.has(e)){const a=J(this.cache.get(e));t.viewLayoutPanel=a,t.appCounterRefs&&(a.appCounterRefs=t.appCounterRefs,delete t.appCounterRefs),t.appViewEngines&&(a.appViewEngines=t.appViewEngines,delete t.appViewEngines),t.appViewLogics&&(a.appViewLogics=t.appViewLogics,delete t.appViewLogics),t.appViewRefs&&(a.appViewRefs=t.appViewRefs,delete t.appViewRefs),t.controls&&(a.controls=t.controls,delete t.controls)}}return t}calcLayoutTag(t){const{viewType:e,viewStyle:a}=t;return"APPINDEXVIEW"===e?this.calcIndexViewLayoutTag(t):"".concat(e,"_").concat(a)}calcIndexViewLayoutTag(t){const{viewType:e,viewStyle:a,blankMode:s,mainMenuAlign:i}=t;let n="";return s?n="BLANK_MODE":i&&(n=i.toUpperCase()),""!==n?"".concat(e,"_").concat(a,"_").concat(n):"".concat(e,"_").concat(a)}});function va(t){const e={};return t.param09&&(e.srfprocessinstanceid=t.param09),e}var ya=t("ControlType",(t=>(t.APP_MENU="APPMENU",t.GRID="GRID",t.FORM="FORM",t.SEARCHFORM="SEARCHFORM",t.TOOLBAR="TOOLBAR",t.DRBAR="DRBAR",t.VIEWPANEL="VIEWPANEL",t.PICKUP_VIEW_PANEL="PICKUPVIEWPANEL",t.DATAVIEW="DATAVIEW",t.TREEGRID="TREEGRID",t.WF_EXPBAR="WFEXPBAR",t.TREEVIEW="TREEVIEW",t.TREE_EXP_BAR="TREEEXPBAR",t.TAB_VIEWPANEL="TABVIEWPANEL",t.DRTAB="DRTAB",t.CHART="CHART",t.REPORT_PANEL="REPORTPANEL",t.LIST="LIST",t.MOB_MDCTRL="MOBMDCTRL",t.MULTI_EDIT_VIEWPANEL="MULTIEDITVIEWPANEL",t.WIZARD_PANEL="WIZARDPANEL",t.UPDATE_PANEL="UPDATEPANEL",t.SEARCHBAR="SEARCHBAR",t.DASHBOARD="DASHBOARD",t.CALENDAR="CALENDAR",t.PANEL="PANEL",t.VIEW_LAYOUT_PANEL="VIEWLAYOUTPANEL",t.MAP="MAP",t.GANTT="GANTT",t.TREE_GRIDEX="TREEGRIDEX",t.KANBAN="KANBAN",t.CALENDAR_EXPBAR="CALENDAREXPBAR",t.CHART_EXPBAR="CHARTEXPBAR",t.DATA_VIEW_EXPBAR="DATAVIEWEXPBAR",t.GANTT_EXPBAR="GANTTEXPBAR",t.GRID_EXPBAR="GRIDEXPBAR",t.LIST_EXPBAR="LISTEXPBAR",t.MAP_EXPBAR="MAPEXPBAR",t.STATE_WIZARD_PANEL="STATEWIZARDPANEL",t.TAB_EXP_PANEL="TABEXPPANEL",t.CUSTOM="CUSTOM",t.CAPTIONBAR="CAPTIONBAR",t))(ya||{})),Ia=t("ViewType",(t=>(t.APP_INDEX_VIEW="APPINDEXVIEW",t.DE_GRID_VIEW="DEGRIDVIEW",t.DE_EDIT_VIEW="DEEDITVIEW",t.APP_DATA_UPLOAD_VIEW="APPDATAUPLOADVIEW",t.APP_ERROR_VIEW="APPERRORVIEW",t.APP_FILE_UPLOAD_VIEW="APPFILEUPLOADVIEW",t.APP_FUN_PICKUP_VIEW="APPFUNCPICKUPVIEW",t.APP_LOGIN_VIEW="APPLOGINVIEW",t.APP_LOGOUT_VIEW="APPLOGOUTVIEW",t.APP_PANEL_VIEW="APPPANELVIEW",t.APP_PIC_UPLOAD_VIEW="APPPICUPLOADVIEW",t.APP_PORTAL_VIEW="APPPORTALVIEW",t.APP_REDIRECT_VIEW="APPREDIRECTVIEW",t.APP_START_VIEW="APPSTARTVIEW",t.APP_WELCOME_VIEW="APPWELCOMEVIEW",t.APP_WF_ADD_STEP_AFTER_VIEW="APPWFADDSTEPAFTERVIEW",t.APP_WF_ADD_STEP_BEFORE_VIEW="APPWFADDSTEPBEFOREVIEW",t.APP_WF_REDIRECT_VIEW="APPWFREDIRECTVIEW",t.APP_WF_SENDBAC_VIEW="APPWFSENDBACKVIEW",t.APP_WF_STEP_ACTOR_VIEW="APPWFSTEPACTORVIEW",t.APP_WF_STEP_DATA_VIEW="APPWFSTEPDATAVIEW",t.APP_WF_STEP_TRACE_VIEW="APPWFSTEPTRACEVIEW",t.APP_WF_SUPPLY_INFO_VIEW="APPWFSUPPLYINFOVIEW",t.APP_WF_TAKE_ADVICE_VIEW="APPWFTAKEADVICEVIEW",t.DE_CALENDAR_EXP_VIEW="DECALENDAREXPVIEW",t.DE_CALENDAR_VIEW="DECALENDARVIEW",t.DE_CHART_EXP_VIEW="DECHARTEXPVIEW",t.DE_CHART_VIEW="DECHARTVIEW",t.DE_CHART_VIEW9="DECHARTVIEW9",t.DE_CUSTOM_VIEW="DECUSTOMVIEW",t.DE_DATA_VIEW="DEDATAVIEW",t.DE_DATA_VIEW9="DEDATAVIEW9",t.DE_DATAVIEW_EXP_VIEW="DEDATAVIEWEXPVIEW",t.DE_EDIT_VIEW2="DEEDITVIEW2",t.DE_EDIT_VIEW3="DEEDITVIEW3",t.DE_EDIT_VIEW4="DEEDITVIEW4",t.DE_EDIT_VIEW9="DEEDITVIEW9",t.DE_FORM_PICKUP_DATA_VIEW="DEFORMPICKUPDATAVIEW",t.DE_GANTT_EXP_VIEW="DEGANTTEXPVIEW",t.DE_GANTT_VIEW="DEGANTTVIEW",t.DE_GANTT_VIEW9="DEGANTTVIEW9",t.DE_GRID_EXP_VIEW="DEGRIDEXPVIEW",t.DE_GRID_VIEW2="DEGRIDVIEW2",t.DE_GRID_VIEW4="DEGRIDVIEW4",t.DE_GRID_VIEW8="DEGRIDVIEW8",t.DE_GRID_VIEW9="DEGRIDVIEW9",t.DE_HTML_VIEW="DEHTMLVIEW",t.DE_INDEX_PICKUP_DATA_VIEW="DEINDEXPICKUPDATAVIEW",t.DE_INDEX_VIEW="DEINDEXVIEW",t.DE_KANBAN_VIEW="DEKANBANVIEW",t.DE_KANBAN_VIEW9="DEKANBANVIEW9",t.DE_LIST_EXP_VIEW="DELISTEXPVIEW",t.DE_LIST_VIEW="DELISTVIEW",t.DE_LIST_VIEW9="DELISTVIEW9",t.DE_MAP_EXP_VIEW="DEMAPEXPVIEW",t.DE_MAP_VIEW="DEMAPVIEW",t.DE_MAP_VIEW9="DEMAPVIEW9",t.DE_MD_CUSTOM_VIEW="DEMDCUSTOMVIEW",t.DE_MEDITVIEW9="DEMEDITVIEW9",t.DE_MOB_CALENDAR_EXP_VIEW="DEMOBCALENDAREXPVIEW",t.DE_MOB_CALENDAR_VIEW="DEMOBCALENDARVIEW",t.DE_MOB_CALENDAR_VIEW9="DEMOBCALENDARVIEW9",t.DE_MOB_CHART_EXP_VIEW="DEMOBCHARTEXPVIEW",t.DE_MO_BCHART_VIEW="DEMOBCHARTVIEW",t.D_EMOB_CHART_VIEW9="DEMOBCHARTVIEW9",t.DE_MOB_CUSTOM_VIEW="DEMOBCUSTOMVIEW",t.DE_MOB_DATA_VIEW="DEMOBDATAVIEW",t.DE_MOB_DATA_VIEW_EXP_VIEW="DEMOBDATAVIEWEXPVIEW",t.DE_MOB_EDIT_VIEW="DEMOBEDITVIEW",t.DE_MOB_EDIT_VIEW3="DEMOBEDITVIEW3",t.DE_MOB_EDITVIEW9="DEMOBEDITVIEW9",t.DE_MOB_FORM_PICKUP_MDVIEW="DEMOBFORMPICKUPMDVIEW",t.DE_MOB_GANTT_EXP_VIEW="DEMOBGANTTEXPVIEW",t.DE_MOB_GANTT_VIEW="DEMOBGANTTVIEW",t.DE_MOB_GANTT_VIEW9="DEMOBGANTTVIEW9",t.DE_MOB_HTML_VIEW="DEMOBHTMLVIEW",t.DE_MOB_INDEX_PICKUP_MDVIEW="DEMOBINDEXPICKUPMDVIEW",t.DE_MOB_LIST_EXP_VIEW="DEMOBLISTEXPVIEW",t.DE_MOB_LIST_VIEW="DEMOBLISTVIEW",t.DE_MOB_MAP_VIEW="DEMOBMAPVIEW",t.DE_MOB_MAP_VIEW9="DEMOBMAPVIEW9",t.DE_MOB_MDVIEW="DEMOBMDVIEW",t.DE_MOB_MDVIEW9="DEMOBMDVIEW9",t.DE_MOB_MEDIT_VIEW9="DEMOBMEDITVIEW9",t.DE_MOB_MPICKUP_VIEW="DEMOBMPICKUPVIEW",t.DE_MOB_OPT_VIEW="DEMOBOPTVIEW",t.DE_MOB_PANEL_VIEW="DEMOBPANELVIEW",t.DE_MOB_PANEL_VIEW9="DEMOBPANELVIEW9",t.DE_MOB_PICKUP_LIST_VIEW="DEMOBPICKUPLISTVIEW",t.DE_MOB_PICKUP_MDVIEW="DEMOBPICKUPMDVIEW",t.DE_MOB_PICKUP_TREE_VIEW="DEMOBPICKUPTREEVIEW",t.DE_MOB_PICKUP_VIEW="DEMOBPICKUPVIEW",t.DE_MOB_PORTAL_VIEW="DEMOBPORTALVIEW",t.DE_MOB_PORTAL_VIEW9="DEMOBPORTALVIEW9",t.DE_MOB_REDIRECT_VIEW="DEMOBREDIRECTVIEW",t.DE_MOB_REPORT_VIEW="DEMOBREPORTVIEW",t.DE_MOB_TAB_EXP_VIEW="DEMOBTABEXPVIEW",t.DE_MOB_TAB_EXP_VIEW9="DEMOBTABEXPVIEW9",t.DE_MOB_TAB_SEARCH_VIEW="DEMOBTABSEARCHVIEW",t.DE_MOB_TAB_SEARCH_VIEW9="DEMOBTABSEARCHVIEW9",t.DE_MOB_TREE_EXP_VIEW="DEMOBTREEEXPVIEW",t.DEMOBTREEEXPVIEW9="DEMOBTREEEXPVIEW9",t.DE_MOB_TREE_VIEW="DEMOBTREEVIEW",t.DE_MOB_WFACTION_VIEW="DEMOBWFACTIONVIEW",t.DE_MOB_WF_DATA_REDIRECT_VIEW="DEMOBWFDATAREDIRECTVIEW",t.DE_MOB_WF_DYNAACTIO_NVIEW="DEMOBWFDYNAACTIONVIEW",t.DE_MOB_WFDYNA_EDIT_VIEW="DEMOBWFDYNAEDITVIEW",t.DE_MOB_WF_DYNA_EDIT_VIEW3="DEMOBWFDYNAEDITVIEW3",t.DE_MOB_WF_DYNA_EXP_MDVIEW="DEMOBWFDYNAEXPMDVIEW",t.DE_MO_BWF_DYNA_START_VIEW="DEMOBWFDYNASTARTVIEW",t.DE_MOB_WF_EDIT_VIEW="DEMOBWFEDITVIEW",t.DE_MOB_WF_EDIT_VIEW3="DEMOBWFEDITVIEW3",t.DE_MOB_WF_MDVIEW="DEMOBWFMDVIEW",t.DE_MOB_WF_PROXY_RESULT_VIEW="DEMOBWFPROXYRESULTVIEW",t.DE_MOB_WF_PROXY_START_VIEW="DEMOBWFPROXYSTARTVIEW",t.DE_MOB_WF_START_VIEW="DEMOBWFSTARTVIEW",t.DE_MOB_WIZARD_VIEW="DEMOBWIZARDVIEW",t.DE_MPICKUP_VIEW="DEMPICKUPVIEW",t.DE_MPICKUP_VIEW2="DEMPICKUPVIEW2",t.DE_OPT_VIEW="DEOPTVIEW",t.DE_PANEL_VIEW="DEPANELVIEW",t.DE_PANEL_VIEW9="DEPANELVIEW9",t.DE_PICKUP_DATA_VIEW="DEPICKUPDATAVIEW",t.DE_PICKUP_GRID_VIEW="DEPICKUPGRIDVIEW",t.DE_PICKUP_TREE_VIEW="DEPICKUPTREEVIEW",t.DE_PICKUP_VIEW="DEPICKUPVIEW",t.DE_PICKUP_VIEW2="DEPICKUPVIEW2",t.DE_PICK_UP_VIEW3="DEPICKUPVIEW3",t.DE_PORTAL_VIEW="DEPORTALVIEW",t.DE_PORTAL_VIEW9="DEPORTALVIEW9",t.DE_REDIRECT_VIEW="DEREDIRECTVIEW",t.DE_REPORT_VIEW="DEREPORTVIEW",t.DE_TAB_EXP_VIEW="DETABEXPVIEW",t.DE_TAB_EXP_VIEW9="DETABEXPVIEW9",t.DE_TAB_SEARCH_VIEW="DETABSEARCHVIEW",t.DE_TAB_SEARCH_VIEW9="DETABSEARCHVIEW9",t.DE_TREE_EXP_VIEW="DETREEEXPVIEW",t.DE_TREE_EXP_VIEW2="DETREEEXPVIEW2",t.DE_TREE_EXP_VIEW3="DETREEEXPVIEW3",t.DE_TREE_GRID_EXVIEW="DETREEGRIDEXVIEW",t.DE_TREE_GRID_EXVIEW9="DETREEGRIDEXVIEW9",t.DE_TREE_GRID_VIEW="DETREEGRIDVIEW",t.DE_TREE_GRID_VIEW9="DETREEGRIDVIEW9",t.DE_TREE_VIEW="DETREEVIEW",t.DE_TREE_VIEW9="DETREEVIEW9",t.DE_WF_ACTION_VIEW="DEWFACTIONVIEW",t.DE_WF_DATA_REDIRECT_VIEW="DEWFDATAREDIRECTVIEW",t.DE_WF_DYNA_ACTION_VIEW="DEWFDYNAACTIONVIEW",t.DE_WF_DYNA_EDIT_VIEW="DEWFDYNAEDITVIEW",t.DE_WF_DYNA_EDIT_VIEW3="DEWFDYNAEDITVIEW3",t.DE_WF_DYNA_EXP_GRID_VIEW="DEWFDYNAEXPGRIDVIEW",t.DE_WF_DYNA_START_VIEW="DEWFDYNASTARTVIEW",t.DE_WF_EDIT_PROXY_DATA_VIEW="DEWFEDITPROXYDATAVIEW",t.DE_WF_EDIT_VIEW="DEWFEDITVIEW",t.DE_WF_EDIT_VIEW2="DEWFEDITVIEW2",t.DE_WF_EDIT_VIEW3="DEWFEDITVIEW3",t.DE_WF_EDIT_VIEW9="DEWFEDITVIEW9",t.DE_WF_EXP_VIEW="DEWFEXPVIEW",t.DE_WF_GRID_VIEW="DEWFGRIDVIEW",t.DE_WF_PROXY_DATA_VIEW="DEWFPROXYDATAVIEW",t.DE_WF_PROXY_RESULT_VIEW="DEWFPROXYRESULTVIEW",t.DE_WF_PROXY_START_VIEW="DEWFPROXYSTARTVIEW",t.DE_WF_START_VIEW="DEWFSTARTVIEW",t.DE_WIZARD_VIEW="DEWIZARDVIEW",t))(Ia||{})),Da=t("ViewMode",(t=>(t.ROUTE="ROUTE",t.MODAL="MODAL",t.DRAWER="DRAWER",t.EMBED="EMBED",t.POPOVER="POPOVER",t))(Da||{})),Ca=t("SysUIActionTag",(t=>(t.NEW="New",t.EDIT="Edit",t.REFRESH="Refresh",t.EXIT="Exit",t.SAVE_AND_EXIT="SaveAndExit",t.SAVE_AND_NEW="SaveAndNew",t.SAVE="Save",t.SAVE_ROW="SaveRow",t.REMOVE="Remove",t.REMOVE_AND_EXIT="RemoveAndExit",t.NEW_ROW="NewRow",t.TOGGLE_FILTER="ToggleFilter",t.IMPORT="Import",t.EXPORT_EXCEL="ExportExcel",t.SAVE_AND_START="SaveAndStart",t.VIEW_WF_STEP="ViewWFStep",t.NO="No",t.YES="Yes",t.CANCEL="Cancel",t.OK="Ok",t.SEARCH="Search",t.FINISH="Finish",t.NEXT_STEP="NextStep",t.PREV_STEP="PrevStep",t.ADD_SELECTION="AddSelection",t.REMOVE_SELECTION="RemoveSelection",t.REMOVE_ALL="RemoveAll",t.ADD_ALL="AddAll",t.LOGOUT="Logout",t.LOGIN="Login",t.CANCEL_CHANGES="CancelChanges",t.COPY="Copy",t.VIEW="View",t.TOGGLE_ROW_EDIT="ToggleRowEdit",t.REFRESH_ALL="RefreshAll",t.REFRESH_PARENT="RefreshParent",t.LOAD_MORE="LoadMore",t))(Ca||{})),ba=t("ViewCallTag",(t=>(t.LOAD="Load",t))(ba||{})),Aa=t("StudioViewEvents",class{});Aa.onViewMounted="onMounted",Aa.onViewDestroyed="onDestroyed";var Pa=t("StudioPanelEvents",class{});Pa.onClick="onClick",Pa.onChange="onChange",Pa.onEnter="onEnter",Pa.onLeave="onLeave";var _a=t("StudioControlEvents",class{});_a.onBeforeLoad="onBeforeLoad",_a.onLoadSuccess="onLoadSuccess",_a.onLoadError="onLoadError",_a.onBeforeLoadDraft="onBeforeLoadDraft",_a.onLoadDraftSuccess="onLoadDraftSuccess",_a.onLoadDraftError="onLoadDraftError",_a.onBeforeSave="onBeforeSave",_a.onSaveSuccess="onSaveSuccess",_a.onSaveError="onSaveError",_a.onBeforeRemove="onBeforeRemove",_a.onRemoveSuccess="onRemoveSuccess",_a.onRemoveError="onRemoveError",_a.CLICK="onClick";var Sa=t("Modal",class{constructor(t){this.mode="EMBED",this.viewUsage=4,this.ignoreDismissCheck=!1,this.hooks={shouldDismiss:new F,beforeDismiss:new F},this._dismiss=t=>{ibiz.log.error("外部关闭能力未注册",t)},t.mode&&(this.mode=t.mode),t.routeDepth&&(this.routeDepth=t.routeDepth),t.viewUsage&&(this.viewUsage=t.viewUsage),t.dismiss&&(this._dismiss=t.dismiss)}injectDismiss(t){this._dismiss=t}async dismiss(t={ok:!1,data:[]}){const e={allowClose:!0};return!0!==this.ignoreDismissCheck&&await this.hooks.shouldDismiss.call(e),e.allowClose?(await this.hooks.beforeDismiss.call(t),this._dismiss(t),this.destroy(),!0):(ibiz.log.debug("shouldDismiss结果为false,关闭中断。"),!1)}destroy(){this.hooks.shouldDismiss.clear(),this.hooks.beforeDismiss.clear()}});function xa(t,e){return t.filter((t=>{const{checkMode:a}=t,s=t.deformItemName||t.degridEditItemName;return 2!==a&&s===e}))}var Ta=t("TextUtil",class{constructor(){this.inputElement=null}format(t,e){return t}copy(t){return this.inputElement||(this.inputElement=document.createElement("input"),this.inputElement.style.position="absolute",this.inputElement.style.left="-9999px",document.body.appendChild(this.inputElement)),this.inputElement.value=t,this.inputElement.select(),document.execCommand("copy")}}),La=class t{constructor(){ibiz.commands.register(t.TAG,this.exec.bind(this))}async exec(t,a,i={},n={}){const r=await ibiz.hub.config.view.get(t);if(!r)throw new e("应用视图[".concat(t,"]不存在"));if(a.srfkey&&r.appDataEntityId){a[ze(r.appDataEntityId)]=a.srfkey,a.srfkey=void 0}if(r.redirectView){return ia(await ibiz.hub.getAppView(t),a,i,n)}const{openMode:o="INDEXVIEWTAB"}=r;switch(n.openMode||o){case"INDEXVIEWTAB":return n.noWaitRoute?(this.openIndexViewTab(r,a,i),{ok:!0}):this.openIndexViewTab(r,a,i);case"POPUP":throw new s(r,"未支持的视图打开模式: POPUP");case"POPUPMODAL":return this.openModal(r,a,i);case"POPUPAPP":throw new s(r,"未支持的视图打开模式: POPUPAPP");case"POPOVER":return this.openPopover(r,n.event,a,i);case"DRAWER_LEFT":case"DRAWER_RIGHT":case"DRAWER_TOP":case"DRAWER_BOTTOM":return this.openDrawer(r,a,i);case"USER":return this.openUserCustom(r,a,i);default:return this.openIndexViewTab(r,a,i)}}openIndexViewTab(t,e,a={}){return ibiz.openView.root(t.id,e,a)}async openModal(t,e,a={}){return ibiz.openView.modal(t.id,e,a)}async openPopover(t,a,s,i={}){if(!a)throw new e("气泡打开缺少event");return ibiz.openView.popover(t.id,a,s,i)}async openDrawer(t,e,a={}){return ibiz.openView.drawer(t.id,e,a)}async openUserCustom(t,e,a={}){return ibiz.openView.custom(t.id,e,a)}};La.TAG="ibiz.app-view.open";var Oa=t("OpenAppViewCommand",La),Na=class t{constructor(){ibiz.commands.register(t.TAG,this.exec.bind(this))}async exec(t,a,i={},n={}){const r=ibiz.hub.getApp(a.srfappid).getAppFunc(t);if(!r)throw new e("找不到叫".concat(t,"的应用功能"));const{navigateContexts:o,navigateParams:c,appFuncType:l}=r,h=a.clone();Object.assign(h,Le(o,a,i));const d=Le(c,a,i);switch(l){case"APPVIEW":return this.openAppView(r,h,d,n);case"OPENHTMLPAGE":return this.openHtmlPage(r);case"PDTAPPFUNC":return this.openPdAppFunc(r,h,d);case"JAVASCRIPT":return this.executeJavaScript(r,h,d);case"CUSTOM":return this.custom(r,h,d);default:throw new s(r,"未支持的应用功能类型: ".concat(l))}}async openAppView(t,a,s,i){if(!t.appViewId)throw new e("应用视图[".concat(t.appViewId,"]不存在"));return ibiz.commands.execute(Oa.TAG,t.appViewId,a,s,i)}openHtmlPage(t){const e=t.htmlPageUrl;window.open(e,"_blank")}openPdAppFunc(t,a,s){throw ibiz.log.warn("openPdAppFunc",t,a,s),new e("未实现")}executeJavaScript(t,a,s){throw ibiz.log.warn("executeJavaScript",t,a,s),new e("未实现")}custom(t,a,s){throw ibiz.log.warn("custom",t,a,s),new e("未实现")}};Na.TAG="ibiz.app-func.exec";var Ra=t("AppFuncCommand",Na);function Ma(){new Ra,new Oa}var Va=class{constructor(){this.psModelGroupCondBase=null}parse(t){if(t instanceof Array){const e=this.createPSModelGroupCond();e.parse(t),this.psModelGroupCondBase=e}}testSingleCond(t,e,a){try{if("ISNULL"===t)return null==e;if("ISNOTNULL"===t)return null!=e;if("EQ"===t||"ABSEQ"===t||"GT"===t||"GTANDEQ"===t||"LT"===t||"LTANDEQ"===t||"NOTEQ"===t){let s=-1;if(e==a?s=0:e>a&&(s=1),"EQ"===t||"ABSEQ"===t)return 0===s;if("GT"===t)return s>0;if("GTANDEQ"===t)return s>=0;if("LT"===t)return s<0;if("LTANDEQ"===t)return s<=0;if("NOTEQ"===t)return 0!==s}if("LIKE"===t)return null!=e&&null!=a&&-1!==e.toString().toUpperCase().indexOf(a.toString().toUpperCase());if("LEFTLIKE"===t)return null!=e&&null!=a&&0===e.toString().toUpperCase().indexOf(a.toString().toUpperCase())}catch(t){ibiz.log.error(t)}return!1}getPSModelGroupCondBase(){return this.psModelGroupCondBase}},ka=class{constructor(){this.strCondOp=null}getCondOp(){return this.strCondOp}setCondOp(t){this.strCondOp=t}},Fa=class extends ka{parse(t){const e=t.length;let a=!0,s=!1,i=!1;for(let n=0;n<e;n++)if(a){const e=t[n];this.setCondOp(e),a=!1,s=!0}else if(s){const e=t[n];this.setParam(e),s=!1,i=!0}else if(i){const e=t[n];if(e instanceof Object&&!(e instanceof Array)){const t=e;null!=t.type&&this.setValueType(t.type.toString()),null!=t.value&&this.setValue(t.value.toString())}else this.setValue(e);break}}getValueType(){return this.strValueType}setValueType(t){this.strValueType=t}getValue(){return this.strValue}setValue(t){this.strValue=t}getParamType(){return this.strParamType}setParamType(t){this.strParamType=t}getParam(){return this.strParam}setParam(t){this.strParam=t}},Wa=class t extends ka{constructor(){super(...arguments),this.childCondList=[],this.bNotMode=!1}parse(a){const s=a.length;let i=!0,n=!0,r=!1;for(let o=0;o<s;o++){if(i&&n){if("!"===a[o]){this.setNotMode(!0),i=!1;continue}}if(n){const t=a[o];this.setCondOp(t),n=!1,i=!1,r=!0}else if(r){const s=a[o];if(!(s instanceof Array))throw new e("值必须为数组");s.forEach((e=>{if(e.length>0){const a=e[0].toString();if("!"===a||"OR"===a||"AND"===a){const a=new t;a.parse(e),this.childCondList.push(a)}else{const t=new Fa;t.parse(e),this.childCondList.push(t)}}}))}}}setNotMode(t){this.bNotMode=t}isNotMode(){return this.bNotMode}getChildPSModelCondBases(){return this.childCondList}},Ba=class extends Wa{},Ua=class extends Fa{},ja=class t extends Va{test(t,e){return this.testCond(this.getPSModelGroupCondBase(),t,e)}testCond(e,a,s){if(e instanceof Wa){const t=e.getChildPSModelCondBases();if(null==t||Q(t))return!e.isNotMode();const i="AND"===e.getCondOp();let n=i;for(let e=0;e<t.length;e++){const r=t[e];if(this.testCond(r,a,s)){if(!i){n=!0;break}}else if(i){n=!1;break}}return e.isNotMode()?!n:n}if(e instanceof Fa){Q(e.getParam())&&ibiz.log.warn("没有指定属性名称",e);const i=a[e.getParam().toLowerCase()];let n=null;const r=e.getValueType(),o=e.getValue();return null==r||Q(r)?n=e.getValue():(Q(o)&&ibiz.log.warn("没有指定上下文参数名称"),t.PARAMTYPE_WEBCONTEXT===r?n=s.data[o.toLowerCase()]:t.PARAMTYPE_DATACONTEXT===r&&(n=s.getValue(o.toLowerCase()))),this.testSingleCond(e.getCondOp(),i,n)}return ibiz.log.warn("无法识别的条件对象",e),!1}createPSModelSingleCond(){return new Ua}createPSModelGroupCond(){return new Ba}};ja.PARAMTYPE_DATACONTEXT="DATACONTEXT",ja.PARAMTYPE_WEBCONTEXT="WEBCONTEXT";var za=t("PSDEDQCondEngine",ja);async function Ga(t,e){var a;const s=null==(a=ibiz.hub.getApp(e).model.appPFPluginRefs)?void 0:a.find((e=>e.pluginCode.toLowerCase()===t));if(s)return await ibiz.plugin.loadPlugin(s),"".concat(s.pluginType,"_").concat(s.pluginCode);ibiz.log.error("找不到".concat(t,"的插件模型"))}var Ha=t("CONTROL_PROVIDER_PREFIX","CONTROL");function Xa(t){return ibiz.register.get("".concat(Ha,"_").concat(t))}async function Ka(t){let e;const{controlType:a,controlStyle:s,sysPFPluginId:i,appId:n}=t;if(i){const t=await Ga(i,n);if(t&&(e=Xa(t)),e)return e;ibiz.log.error("找不到部件插件".concat(t,"对应的适配器"))}if(s&&"DEFAULT"!==s){if(e=Xa("".concat(a,"_").concat(s)),e)return e;ibiz.log.error("找不到部件类型:[".concat(a,"]的部件样式:[").concat(s,"]对应的适配器"),t)}if(e=Xa(a),e)return e;ibiz.log.error("找不到部件类型".concat(a,"对应的适配器"))}var Ya=t("EDITOR_PROVIDER_PREFIX","EDITOR");function $a(t){return ibiz.register.get("".concat(Ya,"_").concat(t))}async function qa(t){let e;const{editorType:a,editorStyle:s,predefinedType:i,sysPFPluginId:n,appId:r}=t;if(n){const t=await Ga(n,r);if(t&&(e=$a(t)),e)return e;ibiz.log.error("找不到编辑器插件".concat(t,"对应的适配器"))}if(s&&"DEFAULT"!==s){if(e=$a("".concat(a,"_").concat(s)),e)return e;ibiz.log.error("找不到编辑器类型:[".concat(a,"]的编辑器样式:[").concat(s,"]对应的适配器"),t)}if(i){let n="".concat(i,"_").concat(a);if(s&&"DEFAULT"!==s&&(n+="_".concat(s)),e=$a(n),e)return e;ibiz.log.error("找不到编辑器类型:[".concat(a,"]的预置类型:[").concat(i,"]对应的适配器"),t)}if(e=$a(a),e)return e;ibiz.log.error("找不到编辑器类型".concat(a,"对应的适配器"))}var Qa=t("FORMDETAIL_PROVIDER_PREFIX","FORMDETAIL");function Ja(t){return ibiz.register.get("".concat(Qa,"_").concat(t))}async function Za(t){let e;const{detailType:a,sysPFPluginId:s,appId:i}=t;if(s){const t=await Ga(s,i);if(t&&(e=Ja(t)),e)return e;ibiz.log.error("找不到表单成员插件".concat(t,"对应的适配器"))}if(e=Ja(a),e)return e;ibiz.log.error("找不到表单成员类型".concat(a,"对应的适配器"))}var ts=t("GRIDCOLUMN_PROVIDER_PREFIX","GRIDCOLUMN");function es(t){return ibiz.register.get("".concat(ts,"_").concat(t))}async function as(t){let e;const{columnType:a,enableRowEdit:s,sysPFPluginId:i,appId:n}=t;if(i){const t=await Ga(i,n);if(t&&(e=es(t)),e)return e;ibiz.log.error("找不到表格列插件".concat(t,"对应的适配器"))}const r=s?"".concat(a,"_EDIT"):a;if(e=es(r),e)return e;ibiz.log.error("找不到表格列类型".concat(r,"对应的适配器"))}var ss=t("PANELITEM_PROVIDER_PREFIX","PANELITEM");function is(t){return ibiz.register.get("".concat(ss,"_").concat(t.toUpperCase()))}async function ns(t){var e;let a;const{itemType:s,sysPFPluginId:i,appId:n}=t;if(i){const t=await Ga(i,n);if(t&&(a=is(t)),a)return a;ibiz.log.error("找不到面板成员插件".concat(t,"对应的适配器"))}if("CONTAINER"===s){const e=t.predefinedType||"DEFAULT";if(a=is("CONTAINER_".concat(e)),a)return a;ibiz.log.error("找不到面板容器预置类型为".concat(e,"的适配器"))}if("RAWITEM"===s){const s=(null==(e=t.rawItem)?void 0:e.predefinedType)||"DEFAULT";if(a=is("RAWITEM_".concat(s)),a)return a;ibiz.log.error("找不到面板成员直接内容预置类型为".concat(s,"的适配器"))}if(a=is(s),a)return a;ibiz.log.error("找不到面板成员类型".concat(s,"对应的适配器"))}var rs=t("UIACTION_PROVIDER_PREFIX","UIACTION");function os(t,e){ibiz.register.register("".concat(rs,"_").concat(t),e)}function cs(t){return ibiz.register.get("".concat(rs,"_").concat(t))}async function ls(t){let a;const{uiactionMode:s,sysPFPluginId:i,appId:n}=t;if(i){const t=await Ga(i,n);if(t&&(a=cs(t)),a)return a;ibiz.log.error("找不到界面行为插件".concat(t,"对应的适配器"))}if(a=cs(s),a)return a;throw new e("找不界面行为模式".concat(s,"对应的适配器"))}var hs=t("VIEW_PROVIDER_PREFIX","VIEW");function ds(t){return ibiz.register.get("".concat(hs,"_").concat(t))}var us=t("PORTLET_PROVIDER_PREFIX","PORTLET");function ps(t){return ibiz.register.get("".concat(us,"_").concat(t))}async function ms(t){let e;const{portletType:a,sysPFPluginId:s,appId:i}=t;if(s){const t=await Ga(s,i);if(t&&(e=ps(t)),e)return e;ibiz.log.error("找不到门户部件插件".concat(t,"对应的适配器"))}if(e=ps(a),e)return e;ibiz.log.error("找不到门户部件成员类型".concat(a,"对应的适配器"))}var fs=t("APP_COUNTER_PROVIDER_PREFIX","APPCOUNTER");function gs(t,e){ibiz.register.register("".concat(fs,"_").concat(t),e)}function Es(t){return ibiz.register.get("".concat(fs,"_").concat(t))}async function ws(t){let a;const{codeName:s,counterType:i,sysPFPluginId:n,appId:r}=t;if(n){const t=await Ga(n,r);if(t&&(a=Es(t)),a)return a;ibiz.log.error("找不到系统计数器插件".concat(t,"对应的适配器"))}if("CUSTOM"===i){if(a=Es(s),a)return a;throw new e("找不到自定义系统计数器".concat(s,"对应的适配器"))}if(a=Es(i),a)return a;throw new e("找不系统计数器类型".concat(i,"对应的适配器"))}var vs=t("AppCounter",class{constructor(t){this.model=t,this.destroyed=!1,this.context=i.create(),this.params={},this.evt=new W,this.data={}}get isDestroyed(){return this.destroyed}async init(t,e){this.setParams(t,e),this.interval(),await this.load()}setParams(t,e){t&&(this.context=J(t)),e&&(this.params=J(e))}interval(){this.destroyInterval(),this.intervalTimer=setInterval((()=>{this.evt.getSize("change")>0&&this.load()}),this.model.timer||6e3)}destroyInterval(){this.intervalTimer&&(clearInterval(this.intervalTimer),this.intervalTimer=null)}async load(){throw new e("未实现计数器加载方法")}refresh(t,e){return this.setParams(t,e),this.load()}onChange(t,e=!0){this.evt.on("change",t),e&&V(this.data)&&t(this.data)}offChange(t){this.evt.off("change",t)}getCounter(t){return this.data[t.toLowerCase()]||0}destroy(){this.destroyed=!0,this.context.destroy(),this.destroyInterval(),this.evt.reset()}}),ys=t("AppDECounter",class extends vs{async init(t,e){this.appDataEntityId=this.model.appDataEntityId;const s=this.model.getAppDEActionId;if(!s)throw new a(this.model,"未找到获取计数器行为!");this.action=s,await super.init(t,e)}async load(){const t=ibiz.hub.getApp(this.context.srfappid),e=await t.deService.exec(this.appDataEntityId,this.action,this.context,this.params);return e.ok&&(this.data=e.data,this.evt.emit("change",this.data)),this.data}}),Is=t("AppDECounterProvider",class{createCounter(t){return new ys(t)}});function Ds(){gs("DEDR",(()=>new Is))}t("DEDQCondUtil",class{static getCond(t){if(this.map.has(t))return this.map.get(t);const e=t.dedqgroupConditions;if(e){const a=new za;return a.parse(["OR",this.calcCond(e)]),this.map.set(t,a),a}return null}static calcCond(t){const e=[];return t.forEach((t=>{const a=[];if("GROUP"===t.condType){const e=t;e.notMode&&a.push("!"),a.push(t.condOp);const s=e.dedqconditions;if(s){const t=this.calcCond(s);a.push(t)}}else{if("SINGLE"!==t.condType)throw new s(t,"暂未支持的查询条件类型: ".concat(t.condType));{const e=t;a.push(e.fieldName),e.condValue||a.push("")}}e.push(a)})),e}}).map=new WeakMap;var Cs=t("DynamicCodeListCache",class{constructor(t){this.cache=new Map,this.isPredefined=!1,this.codeList=t}async init(){return this.initPromise=(async()=>{const{predefinedType:t}=this.codeList;if(t){if(this.isPredefined=!0,!["OPERATOR","RUNTIME"].includes(t))throw new s(this.codeList,"预定义类型".concat(t,"暂不支持"))}else this.initPromise=void 0})(),this.initPromise}convertData(t){const e={},{valueAppDEFieldId:a,textAppDEFieldId:s}=this.codeList,i=a?t[a]:t.srfkey;return e.id=i,e.value=i,e.text=s?t[s]:t.srfmajortext,Object.freeze(e)}async load(t={},e={}){const s=ibiz.hub.getApp(t.srfappid);if(this.isPredefined){e.size||(e={...e,size:1e4});const t=await s.net.get("/dictionaries/codelist/".concat(this.codeList.codeName),e);return Object.freeze(t.data.items)}const{appDataEntityId:i,appDEDataSetId:n}=this.codeList;if(!i)throw new a(this.codeList,"未配置应用实体");if(!n)throw new a(this.codeList,"未配置数据集");const r=await s.deService.exec(i,n,t,{},e);let o=[];return r.data.length&&(o=r.data.map((t=>this.convertData(t)))),o}async get(t={},e={}){if(this.initPromise&&await this.initPromise,!this.codeList.enableCache)return this.load(t,e);const a=JSON.stringify(t)+JSON.stringify(e);if(this.cache.has(a)){const t=this.cache.get(a);if(t.expirationTime>(new Date).getTime())return t.promise?t.promise:t.items;this.cache.delete(a)}const s=this.load(t,e),{cacheTimeout:i}=this.codeList,n=-1===i||$(i)?ibiz.config.codeList.timeout:this.codeList.cacheTimeout,r={expirationTime:(new Date).getTime()+n,promise:s};this.cache.set(a,r);const o=await s;return r.items=o,delete r.promise,o}});function bs(t,a){if(null!=a){const{srfkey:t}=a;if(!$(t)&&!Q(t))return!0}throw new e("执行「".concat(t,"」不存在「srfkey」无法处理"))}function As(t,a){const{srfsessionid:s}=a;if(!$(s)&&!Q(s))return!0;throw new e("执行「".concat(t,"」不存在「srfsessionid」无法处理"))}var Ps=t("DECache",class{constructor(){this.cacheMap=new Map}forceAdd(t,e){const a=this.getCacheByTag(t).get(e.srfkey);a&&(a.assign(e),ibiz.log.warn("forceAdd",e.srfkey,e))}forceUpdate(t,e){this.getCacheByTag(t).set(e.srfkey,J(e)),ibiz.log.warn("forceUpdate",e.srfkey,e)}forceDelete(t,e){this.getCacheByTag(t).delete(e),ibiz.log.warn("forceDelete",e)}add(t,e){try{As("add",t),($(e.srfkey)||Q(e.srfkey))&&(e.srfkey=B()),e.srftempdate=(new Date).getTime();return this.getCacheByTag(t).set(e.srfkey,J(e)),ibiz.log.warn("add",e.srfkey,e),e}catch(t){return ibiz.log.error(t),null}}get(t,e){try{As("get",t);const a=this.getCacheByTag(t).get(e);return ibiz.log.warn("get",e,a),J(a)}catch(t){return ibiz.log.error(t),null}}update(t,e){try{As("update",t),bs("update",e),e.srftempdate=(new Date).getTime();const a=this.getCacheByTag(t),s=a.get(e.srfkey);if(s)return s.assign(e),a.set(e.srfkey,s),ibiz.log.warn("update",e.srfkey,e),J(s);throw new Error("数据不存在,无法更新!")}catch(t){return ibiz.log.error(t),null}}delete(t,e){try{As("delete",t);const a=this.getCacheByTag(t),s=e;if(a.has(s)){const t=a.get(s);return t.srftempdate=(new Date).getTime(),a.delete(s),ibiz.log.warn("delete",s),t}return null}catch(t){return ibiz.log.error(t),null}}createBatch(t,e){try{As("add",t);const a=this.getCacheByTag(t);for(let t=0;t<e.length;t++){const s=e[t];($(s.srfkey)||Q(s.srfkey))&&(s.srfkey=B()),s.srftempdate=(new Date).getTime();const i=J(s);a.set(s.srfkey,i),e[t]=i,ibiz.log.warn("add",s.srfkey,s)}return e}catch(t){ibiz.log.error(t)}return[]}updateBatch(t,e){try{As("update",t);const a=this.getCacheByTag(t);for(let t=0;t<e.length;t++){const s=e[t];bs("update",s),s.srftempdate=(new Date).getTime();const i=a.get(s.srfkey);if(!i)throw new Error("数据[".concat(s.srfdename,"-").concat(s.srfmajortext,"(").concat(s.srfkey,")]不存在,无法更新!"));i.assign(s),a.set(s.srfkey,i),ibiz.log.warn("update",s.srfkey,s),e[t]=J(i)}return e}catch(t){return ibiz.log.error(t),null}}deleteBatch(t,e){try{As("delete",t)}catch(t){return ibiz.log.error(t),e}const a=this.getCacheByTag(t),s=[];for(let t=0;t<e.length;t++){const i=e[t];a.has(i)||s.push(i)}if(s.length>0)throw new Error("未找到以下数据「".concat(s.join("、"),"」,无法删除!"));for(let t=0;t<e.length;t++){const s=e[t];a.delete(s),ibiz.log.warn("delete",s)}return[]}checkData(t,e){return-1!==this.getList(t).findIndex((t=>t.srfkey===e))}getList(t){try{As("getList",t);const e=this.getCacheByTag(t);if(!e)return[];const a=e.values();return Array.from(a)}catch(t){return ibiz.log.error(t),[]}}generatePred(t={}){const e={};t.srfkey&&(e.srfkey=Z(t.srfkey)),delete t.srfkey;for(const a in t)if(Object.prototype.hasOwnProperty.call(t,a)){const s=t[a];e[a]=Z(s)}return tt(e)}clear(t){const e=t.srfsessionid;this.cacheMap.size>0&&this.cacheMap.delete(e)}getCacheByTag(t){const e=t.srfsessionid;return this.cacheMap.has(e)||this.cacheMap.set(e,new Map),this.cacheMap.get(e)}}),_s=new RegExp("(?<=\\$\\{)(.*?)(?=\\})","g");function Ss(t,e){const a=(e.requestPaths||[]).map((t=>({path:t,keys:t.match(_s)||[]}))).filter((e=>{const{keys:a}=e;return 0===a.length||a.every(((e,s)=>s===a.length-1||null!=t[e]))})).sort(((t,e)=>e.keys.length-t.keys.length));if(a.length>0)return a[0]}function xs(t,e){const a=Ss(t,e);if(a){if(a.keys.length>0){let{path:e}=a;return a.keys.forEach(((s,i)=>{e=i===a.keys.length-1?e.replace(new RegExp("/[^/]+/\\$\\{".concat(s,"\\}")),""):e.replace("${".concat(s,"}"),t[s])})),e}return a.path}return""}var Ts=t("SearchFilter",class{constructor(t,e){if(this.page=0,this.size=1e3,this.data={},this.sortField="srfordervalue",this.sortMode="ASC",this.context=t,e){if($(e.page)||Q(e.page)||(this.page=e.page),$(e.size)||Q(e.size)||(this.size=e.size),$(e.query)||Q(e.query)||(this.query=e.query),!$(e.sort)&&!Q(e.sort)){const t=e.sort.split(",");t.length>=1&&([this.sortField]=t),t.length>=2&&(this.sortMode=t[1].toUpperCase())}$(e.srfparentkey)||Q(e.srfparentkey)||(this.srfparentkey=e.srfparentkey),$(e.srfparentdename)||Q(e.srfparentdename)||(this.srfparentdename=e.srfparentdename),this.data={...e},delete this.data.page,delete this.data.size,delete this.data.query,delete this.data.sort,delete this.data.srfparentkey,delete this.data.srfparentdename}}getValue(t){return this.data[t]?this.data[t]:this.context[t]}}),Ls=t("CodeListService",class{constructor(t){this.appModel=t,this.allCodeLists=new Map,this.cache=new Map}getStatic(t){const e=t.codeName;if(this.cache.has(e))return this.cache.get(e);const a=t.codeItems;let s=[];return(null==a?void 0:a.length)&&(s=this.formatStaticItems(a,t.codeItemValueNumber)),this.cache.set(e,Object.freeze(s)),s}setCodeList(t){const{id:e,codeName:a}=t;this.allCodeLists.set(e,t),this.allCodeLists.set(a,t)}getCodeList(t){return this.allCodeLists.get(t)}formatStaticItems(t,e){return t.map((t=>{var a;let s=t.text;t.textLanguageRes&&(s=ibiz.i18n.t(t.textLanguageRes.lanResTag,t.text));const i={text:s,value:e?Number(t.value):t.value,color:t.color,id:t.codeName,textCls:t.textCls};return(null==(a=t.codeItems)?void 0:a.length)&&(i.children=this.formatStaticItems(t.codeItems,e)),Object.freeze(i)}))}async getDynamicCodeList(t,e={},a={}){let s;const i=t.codeName;return this.cache.has(i)?s=this.cache.get(i):(s=new Cs(t),this.cache.set(i,s),await s.init()),s.get(e,a)}async get(t,a,s){const i=this.allCodeLists.get(t);if(!i)throw new e("找不到".concat(t,"代码表"));return"STATIC"===i.codeListType?this.getStatic(i):"DYNAMIC"===i.codeListType?this.getDynamicCodeList(i,a,s):[]}}),Os=t("CounterService",class{static async getCounter(t,e,a){const s=t.id;if(this.counterMap.has(s)){const t=this.counterMap.get(s);if(!1===t.isDestroyed)return t;this.counterMap.delete(s)}const i=(await ws(t)).createCounter(t);return await i.init(e,a),this.counterMap.set(s,i),i}static async getCounterByRef(t,e,s){const{appCounter:i}=t;if(!i)throw new a(t,"未配置应用计数器!");return this.getCounter(i,e,s)}});Os.counterMap=new Map;var Ns=t("WorkFlowService",class{constructor(t){this.model=t,this.commonBaseUrl="",this.app=ibiz.hub.getApp(t.appId);const e=ibiz.appData.context;this.commonBaseUrl="/wfcore/".concat(e.srfsystemid,"-app-").concat(this.app.model.codeName.toLowerCase(),"/").concat(this.model.name.toLowerCase())}getBaseUrl(){return this.commonBaseUrl}getActiveData(t,e){return e.srfprocessinstanceid&&(t.srfprocessinstanceid=e.srfprocessinstanceid),t}async getWFStep(t){const{processDefinitionKey:e,taskDefinitionKey:a}=t;return this.app.net.get("".concat(this.getBaseUrl(),"/process-definitions/").concat(e,"/usertasks/").concat(a))}async getWFLink(t,e){const a=t[this.model.codeName.toLowerCase()],{taskDefinitionKey:s}=t;return this.app.net.post("".concat(this.getBaseUrl(),"/").concat(a,"/usertasks/").concat(s,"/ways"),{activedata:this.getActiveData(e,t)})}async getWFHistory(t){const e=t[this.model.codeName.toLowerCase()];return this.app.net.get("".concat(this.getBaseUrl(),"/").concat(e,"/process-instances/alls/history"))}async getWFProcessDiagram(t){const e=t[this.model.codeName.toLowerCase()];return this.app.net.request("".concat(this.getBaseUrl(),"/").concat(e,"/process-instances/alls/processdiagram"),{method:"post",data:{},responseType:"blob"})}async getWFVersion(){return this.app.net.get("".concat(this.getBaseUrl(),"/process-definitions2"))}async wfStart(t,e,a){return this.app.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/process-instances"),{...e,activedata:this.getActiveData(a,t)})}async wfSubmit(t,e,a){return this.app.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId),{...e,activedata:this.getActiveData(a,t)})}async wfWithdraw(t,e,a){return this.app.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/withdraw"),{...e,activedata:this.getActiveData(a,t)})}async wfReassign(t,e,a){return ibiz.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/transfer"),{...e,activedata:this.getActiveData(a,t)})}async wfAddStepBefore(t,e,a){return ibiz.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/beforesign"),{...e,activedata:this.getActiveData(a,t)})}async wfSendBack(t,e,a){return ibiz.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/sendback"),{...e,activedata:this.getActiveData(a,t)})}async wfSendCopy(t,e,a){return ibiz.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/sendcopy"),{...e,activedata:this.getActiveData(a,t)})}async exec(t,a,s={},i={}){switch(t){case"wfstart":return this.wfStart(a,s,i);case"wfsubmit":return this.wfSubmit(a,s,i);case"reassign":return this.wfReassign(a,s,i);case"addstepbefore":return this.wfAddStepBefore(a,s,i);case"sendback":return this.wfSendBack(a,s,i);case"sendcopy":return this.wfSendCopy(a,s,i);default:throw new e("「".concat(t,"」未实现"))}}}),Rs=t("Srfuf",(t=>(t[t.CREATE=0]="CREATE",t[t.UPDATE=1]="UPDATE",t))(Rs||{})),Ms=t("AppDataEntity",class t{get srfuf(){return this.srfkey?1:0}constructor(e,a){let s;Object.defineProperty(this,"_entity",{enumerable:!1,configurable:!0,value:e}),Object.defineProperty(this,"_data",{enumerable:!1,configurable:!0,value:J(a instanceof t?a._data:a)}),Object.defineProperty(this,"srfdeid",{get:()=>e.id}),Object.defineProperty(this,"srfdecodename",{get:()=>e.codeName});const i=ke(e.appDEFields||[],e.keyAppDEFieldId);if(i){const t=i.codeName.toLowerCase();Object.defineProperty(this,"srfkeyfile",{get:()=>t}),Object.defineProperty(this,"srfkey",{set(t){s=t},get(){return this._data[t]||s}}),Object.defineProperty(this,"srfsourcekey",{set(e){this._data[t]=e},get(){return this._data[t]}})}else ibiz.log.warn("实体[".concat(e.codeName,"]未配置主键字段"));const n=ke(e.appDEFields||[],e.majorAppDEFieldId);if(n){const t=n.codeName.toLowerCase();Object.defineProperty(this,"srfmajorfile",{get:()=>t}),Object.defineProperty(this,"srfmajortext",{set(e){this._data[t]=e},get(){return this._data[t]}})}else ibiz.log.warn("实体[".concat(e.codeName,"]未配置主文本字段"));this.defineProperties()}defineProperties(){var t;const{_data:e}=this,a={},s=Object.keys(e);s.forEach((t=>{a[t]={enumerable:!0,set(a){e[t]=a},get:()=>e[t]}})),null==(t=this._entity.appDEFields)||t.forEach((t=>{const i=t.codeName.toLowerCase();s.includes(i)||(a[i]={enumerable:!0,set(t){e[i]=t},get:()=>e[i]})})),Object.defineProperties(this,a)}clone(){const e=new t(this._entity,this._data);return e.srfkey=this.srfkey,e}assign(e){return e instanceof t?Object.assign(this._data,e._data):Object.assign(this._data,e),this}}),Vs=t("MethodDto",class t{constructor(t,e,a){this.entity=t,this.isLocalMode=e,this.dto=a,this.dtoMap=new Map,a?(this.app=ibiz.hub.getApp(t.appId),this.fields=a.appDEMethodDTOFields||[]):this.fields=[]}async get(t,e){const a={};for(let i=0;i<this.fields.length;i++){const n=this.fields[i],r=n.codeName.toLowerCase();switch(n.type){case"SIMPLE":break;case"DTOS":{if(V(e[r]))break;if(!n.refAppDataEntityId)break;const s=await this.getFieldDto(n),i=(await this.app.deService.getService(n.refAppDataEntityId)).local.getList(t);if(i){const e=[];for(let a=0;a<i.length;a++)e.push(await s.get(t,i[a]));e.length>0&&(a[r]=e)}break}default:throw new s(n,"未支持的应用实体方法输入属性类型: ".concat(n.type))}}return{...e,...a}}async sets(t,e){const a=await this.app.deService.getService(this.entity.id);return this.isLocalMode&&a.local.clear(t),Promise.all(e.map((async e=>{const s=this.fields.filter((t=>"DTOS"===t.type)).map((async a=>{if(!a.refAppDataEntityId)return;const s=a.codeName.toLowerCase(),i=await this.getFieldDto(a),n=e[s];n&&await i.sets(t,n)}));for(let t=0;t<s.length;t++)await s[t];const i=new Ms(this.entity,e);return this.isLocalMode&&await a.local.add(t,i),i})))}async getFieldDto(e){if(this.dtoMap.has(e.codeName))return this.dtoMap.get(e.codeName);const a=await ibiz.hub.getAppDataEntity(e.refAppDataEntityId,this.entity.appId),s=ke(a.appDEMethodDTOs||[],e.refAppDEMethodDTOId),i=new t(a,!0,s);return this.dtoMap.set(e.codeName,i),i}});function ks(t){return"BUILTIN"===t.actionType||"DATAQUERY"===t.dataSetType}var Fs=class{constructor(t,e){this.entity=t,this.method=e,this.app=ibiz.hub.getApp(t.appId),this.input=new class{constructor(t,e){this.entity=t,this.method=e;const a=e.appDEMethodInput;if(a){const e=ke(t.appDEMethodDTOs||[],a.appDEMethodDTOId);e&&(this.dto=new Vs(t,this.isLocalMode,e))}}get isLocalMode(){return ks(this.method)}async handle(t,e){return this.dto?this.dto.get(t,e):e}}(t,e),this.result=new class{constructor(t,e){this.entity=t,this.method=e;const a=e.appDEMethodReturn;if(a){const e=ke(t.appDEMethodDTOs||[],a.appDEMethodDTOId);e&&(this.dto=new Vs(t,this.isLocalMode,e))}}get isLocalMode(){return ks(this.method)}async handle(t,e){return this.dto?(await this.dto.sets(t,[e]))[0]:new Ms(this.entity,e)}}(t,e)}async request(t,e,s,i){const{actionType:n,requestMethod:r}=this.method;if("REMOTE"===n){const e=this.method.codeName.toLowerCase();let n=null;switch(r){case"POST":n=await this.app.net.post("".concat(t,"/").concat(e),V(s)?s:i);break;case"GET":n=await this.app.net.get("".concat(t,"/").concat(e),s);break;case"PUT":n=await this.app.net.put("".concat(t,"/").concat(e),V(s)?s:i);break;case"DELETE":n=await this.app.net.delete("".concat(t,"/").concat(e),s);break;default:throw new a(this.method,r?"未支持的请求方式: ".concat(r):"未配置请求方式")}return n}throw new a(this.method,"未支持的行为类型[".concat(n,"]"))}calcPath(t){const e="/".concat(this.entity.codeName2.toLowerCase());return xs(t,this.entity)+e}async getService(){return this.service||(this.service=await this.app.deService.getService(this.entity.id)),this.service}createEntity(t){return t instanceof Ms?t.clone():new Ms(this.entity,t)}},Ws=class{},Bs=class extends Ws{constructor(t){super(),this.model=t,this.srcParam=t.srcLogicParamId,this.dstParam=t.dstLogicParamId}get dstField(){return this.model.dstFieldName.toLowerCase()}get op(){return this.model.condOP}get type(){return this.model.paramType}get value(){return this.model.paramValue}test(t,e,i){const n=t.params[this.dstParam];switch(this.type){case"ENTITYFIELD":{if(!this.value)throw new a(this.model,"当前条件值类型为[数据对象属性],缺少配置条件值");const t=null!=i[this.value]?i[this.value]:e[this.value];return ra(n[this.dstField],this.op,t)}case"SRCENTITYFIELD":{if(!this.value)throw new a(this.model,"当前条件值类型为[源数据对象属性],缺少配置条件值");const e=t.params[this.srcParam];return ra(n[this.dstField],this.op,e[this.value])}case"CURTIME":throw new s(this.model,"暂未支持条件值类型为[当前时间]");default:return ra(n[this.dstField],this.op,this.value)}}},Us=class t extends Ws{constructor(e){super(),this.model=e;const a=e.conds||[];this.conds=a.map((e=>"SINGLE"===e.logicType?new Bs(e):new t(e)))}get op(){return this.model.groupOP}get notMode(){return!0===this.model.notMode}test(t,e,s){let i=!0;if(0===this.conds.length)throw new a(this.model,"界面连接条件逻辑组未配置逻辑项");for(let a=0;a<this.conds.length;a++){const n=this.conds[a].test(t,e,s);if("AND"===this.op&&!1===n){i=!1;break}if("OR"===this.op&&!0===n){i=!0;break}}return this.notMode?!i:i}},js=class{constructor(t){var e;this.model=t,this.links=null==(e=t.links||[])?void 0:e.map((t=>new class{constructor(t){this.model=t,this.srcNode=null,this.dstNode=null,this.groupCond=null;const e=this.model.delogicLinkGroupCond;e&&(this.groupCond=new Us(e))}async exec(t){const{defaultLink:e}=this.model;return!(!e&&this.groupCond)||this.groupCond.test(t,t.context,t.data||{})}}(t)))}},zs=class extends js{async exec(t){const{dstAppDataEntityId:e,dstAppDEActionId:s,dstDELogicParamId:i,retDELogicParamId:n}=this.model;if(!e)throw new a(this.model,"未指定应用实体");if(!s)throw new a(this.model,"未指定实体行为");const r=t.params[i],o=ibiz.hub.getApp(t.context.srfappid),c=await o.deService.exec(e,s,t.context,r,t.viewParams);c.ok&&(t.params[n]=c.data)}},Gs=class extends js{async exec(t){}},Hs=class extends js{async exec(t){t.isEndNode=!0;const{returnParamId:e,returnType:a,rawValue:i}=this.model;switch(a){case"NONEVALUE":t.result=void 0;break;case"NULLVALUE":t.result=null;break;case"SRCVALUE":t.result=i;break;case"LOGICPARAM":t.result=t.params[e];break;default:throw new s(this.model,"暂未支持的结束节点返回值类型: ".concat(a))}}};function Xs(t,e){const{srcDELogicParamId:a,srcValueType:i,srcFieldName:n,srcValue:r}=e;let o;switch(e.srcValueType||(e.srcValueType="SRCDLPARAM"),i){case"SRCDLPARAM":o=t.params[a];break;case"NULLVALUE":return null;case"NONEVALUE":return;case"SRCVALUE":return r;case"VIEWPARAM":o=t.viewParams;break;case"APPDATA":o=t.context;break;case"ENVPARAM":o=J(ibiz.env);break;default:throw new s(e,"暂未支持源值类型".concat(i))}const c=null==n?void 0:n.toLowerCase();return o&&c&&(o=o[c]),o}var Ks=class extends js{async exec(t){const e=this.model.delogicNodeParams;(null==e?void 0:e.length)&&await Promise.all(e.map((e=>{switch(e.paramAction){case"SETPARAMVALUE":return this.setParamValue(e,t);case"RESETPARAM":return this.resetParam(e,t);case"COPYPARAM":return this.copyParam(e,t);case"BINDPARAM":return this.bindParam(e,t);case"RENEWPARAM":return this.renewParam(e,t);case"APPENDPARAM":return this.appendParam(e,t);case"SORTPARAM":return this.sortParam(e,t);default:throw new s(e,"暂未支持逻辑处理参数操作".concat(e.paramAction))}})))}copyParam(t,e){const{dstDELogicParamId:a}=t,s=Xs(e,t);e.params[a]=J(s)}bindParam(t,e){const a=Xs(e,t);e.params[t.dstDELogicParamId]=a}setParamValue(t,e){const{dstFieldName:a,dstDELogicParamId:s}=t,i=null==a?void 0:a.toLowerCase(),n=Xs(e,t);i?e.params[s][i]=n:e.params[s]=n}resetParam(t,e){const{dstDELogicParamId:a}=t;e.resetParam(a)}renewParam(t,e){const{dstDELogicParamId:a}=t;e.renewParam(a)}appendParam(t,e){const{dstDELogicParamId:a,dstIndex:s,srcIndex:i,srcSize:n}=t,r=Xs(e,t),o=s||0,c=i||0,l=n||r.length;e.params[a].splice(o,0,...r.slice(c,l))}sortParam(t,e){const{dstDELogicParamId:a,dstFieldName:s,dstSortDir:i}=t,n=s.toLowerCase();e.params[a].sort(((t,e)=>"ASC"===i?t[n]-e[n]:e[n]-t[n]))}},Ys=class extends js{async exec(t){const{dstAppDEDataSetId:e,dstAppDataEntityId:a,dstDELogicParamId:s,retDELogicParamId:i}=this.model,n=t.params[s],r=ibiz.hub.getApp(t.context.srfappid),o=await r.deService.exec(a,e,t.context,n,t.viewParams);o.ok&&(t.params[i]=o.data)}},$s=class extends js{async exec(t){const{dstDELogicParamId:e,srcDELogicParamId:s}=this.model;if(!e||!s)throw new a(this.model,"缺少目标参数对象或者源参数对象配置");const i=Xs(t,this.model);t.params[e]=i}},qs=class extends js{async exec(t){const{dstDELogicParamId:e}=this.model;if(!e)throw new a(this.model,"缺少目标参数对象配置");t.resetParam(e)}},Qs=class extends js{async exec(t){const{dstDELogicParamId:e}=this.model;if(!e)throw new a(this.model,"缺少目标参数对象配置");t.renewParam(e)}},Js=class extends js{async exec(t){const{dstDELogicParamId:e,srcDELogicParamId:s}=this.model;if(!e||!s)throw new a(this.model,"缺少目标参数对象或者源参数对象配置");const i=Xs(t,this.model);t.params[e]=J(i)}},Zs=class extends js{async exec(t){const{dstDELogicParamId:e,dstSortDir:s,dstFieldName:i}=this.model;if(!e||!i)throw new a(this.model,"缺少目标参数对象或目标属性配置");const n=i.toLowerCase();t.params[e].sort(((t,e)=>"ASC"===s?t[n]-e[n]:e[n]-t[n]))}},ti=class extends js{async exec(t){const{dstDELogicParamId:e,srcDELogicParamId:s,dstIndex:i,srcIndex:n,srcSize:r}=this.model;if(!e||!s)throw new a(this.model,"缺少目标参数对象或者源参数对象配置");const o=Xs(t,this.model),c=i||0,l=n||0,h=r||o.length;t.params[e].splice(c,0,...o.slice(l,h))}},ei=class extends js{async exec(t){const{errorCode:e,errorInfo:a}=this.model;throw new r({response:{status:e,statusText:a}})}},ai=class{constructor(t){var e,i;if(this.model=t,this.nodes=new Map,this.params=new Map,!(null==(e=t.delogicNodes)?void 0:e.length))throw new a(t,"实体逻辑没有配置逻辑节点");t.delogicNodes.forEach((t=>{const{logicNodeType:e}=t;let a;switch(e){case"BEGIN":a=new Gs(t);break;case"END":a=new Hs(t);break;case"DEACTION":a=new zs(t);break;case"PREPAREPARAM":a=new Ks(t);break;case"DEDATASET":a=new Ys(t);break;case"THROWEXCEPTION":a=new ei(t);break;case"BINDPARAM":a=new $s(t);break;case"RESETPARAM":a=new qs(t);break;case"COPYPARAM":a=new Js(t);break;case"RENEWPARAM":a=new Qs(t);break;case"APPENDPARAM":a=new ti(t);break;case"SORTPARAM":a=new Zs(t);break;default:throw new s(t,"未支持的逻辑节点类型: ".concat(e))}this.nodes.set(t.id,a)})),null==(i=t.delogicParams)||i.forEach((t=>{this.params.set(t.id,new class{constructor(t){this.model=t}calc(t){const e=this.model.id,a=this.model;if(a.default)t.params[e]=t.data||{};else if(a.appGlobalParam)t.params[e]=J(ibiz.env);else if(a.entityListParam)t.params[e]=[];else{if(a.entityPageParam)throw new s(a,"未支持的逻辑参数类型: 分页查询结果");if(a.entityParam)t.params[e]={};else if(a.lastReturnParam)t.initLastReturnParam(e);else if(a.appContextParam)t.params[e]=t.context;else if(a.simpleListParam)t.params[e]=[];else if(a.simpleParam)t.params[e]={};else if(a.cloneParam)t.params[e]=J(t.data||{});else{if(a.envParam)throw new s(a,"未支持的逻辑参数类型: 系统环境变量");if(a.fileListParam)throw new s(a,"未支持的逻辑参数类型: 文件对象列表变量");if(a.fileParam)throw new s(a,"未支持的逻辑参数类型: 文件对象变量");if(a.filterParam)throw new s(a,"未支持的逻辑参数类型: 过滤器对象变量");if(a.lastParam)throw new s(a,"未支持的逻辑参数类型: 最后数据变量");if(a.originEntity)throw new s(a,"未支持的逻辑参数类型: 原始数据对象");if(a.sessionParam)throw new s(a,"未支持的逻辑参数类型: 操作会话变量")}}}renew(t){const e=this.model.id,a=this.model;if(a.entityListParam||a.simpleListParam||a.entityPageParam)t.params[e]=[];else{if(!a.simpleParam&&!a.entityParam)throw new s(a,"未支持的逻辑参数类型重新建立变量");t.params[e]={}}}}(t))})),this.nodes.forEach((t=>{t.links.forEach((e=>{e.srcNode=t,this.nodes.has(e.model.thenId)&&(e.dstNode=this.nodes.get(e.model.thenId))}))}))}initLogicParams(t){this.params.forEach((e=>{e.model.default&&(t.defaultParamName=e.model.id),e.calc(t)}))}async exec(t,e,s){const i=new class{constructor(t,e,a,s){this.deLogicParams=t,this.context=e,this.data=a,this.viewParams=s,this.params={},this.result=null,this.isEndNode=!1,this.defaultParamName="Default"}resetParam(t){var e;null==(e=this.deLogicParams.get(t))||e.calc(this)}renewParam(t){var e;null==(e=this.deLogicParams.get(t))||e.renew(this)}setLastReturn(t){this.lastReturn=t}initLastReturnParam(t){Object.defineProperty(this.params,t,{enumerable:!0,configurable:!0,get:()=>this.lastReturn})}}(this.params,t,e,s);this.initLogicParams(i);const{startDELogicNodeId:n}=this.model;if(!n||!this.nodes.has(n))throw new a(this.model,"未设置起始节点");{const t=this.nodes.get(n);await this.deepExec(t,i)}return i.isEndNode?i.result:i.params[i.defaultParamName]?i.params[i.defaultParamName]:null}async deepExec(t,e){await t.exec(e);const{links:a}=t;for(let s=0;s<a.length;s++){const i=a[s];if(await i.exec(e)&&i.dstNode&&(await this.deepExec(i.dstNode,e),!1===t.model.parallelOutput))break}}},si=new Map;async function ii(t,e,a,s){si.has(t)||si.set(t,new ai(t));return si.get(t).exec(e,a,s)}async function ni(t,e,a,s){try{const i=await ii(t,e,a,s);return new n(i)}catch(t){if(t instanceof r)return new n(t,500);throw t}}async function ri(t,e,a,s,i){const n=Ke(t,e);if(n.length){(await Promise.all(n.map((t=>ii(t,a,s,i))))).forEach((t=>{Object.assign(s,t)}))}}var oi=class extends Fs{get isLocalMode(){return ks(this.method)}async exec(t,e,s){if("DELOGIC"===this.method.actionType){const i=Xe(this.method.appDELogicId,this.entity);if(!i)throw new a(this.method,"缺少实体处理逻辑");return ni(i,t,e,s)}let i;switch(this.isLocalMode||(e=await this.input.handle(t,e)),["READ","GETDRAFT"].includes(this.method.actionMode)||await ri(this.entity,"change",t,e,s),this.method.codeName){case"Create":i=await this.create(t,e,s);break;case"Get":i=await this.get(t,s);break;case"GetDraft":i=await this.getDraft(t,s);break;case"Remove":i=await this.remove(t,s);break;case"Update":i=await this.update(t,e,s);break;case"CreateTemp":i=await this.createTemp(t,e);break;case"GetTemp":i=await this.getTemp(t,e);break;case"GetDraftTemp":i=await this.getDraftTemp(t,s);break;case"RemoveTemp":i=await this.removeTemp(t,e);break;case"UpdateTemp":i=await this.updateTemp(t,e);break;default:{let a=this.calcPath(t);this.method.needResourceKey&&(a="".concat(a,"/").concat(t[this.entity.codeName.toLowerCase()]||e[this.entity.keyAppDEFieldId]));const n=await this.request(a,t,e,s);n.data=await this.result.handle(t,n.data),i=n}}return await ri(this.entity,"compute",t,i.data,s),i}async create(t,e,a){if(this.isLocalMode)return this.createTemp(t,this.createEntity(e));const s=this.calcPath(t),i=await this.app.net.post(s,e,a);return i.data=await this.result.handle(t,i.data),i}async remove(t,e){if(this.isLocalMode)return this.removeTemp(t,e);const a=this.calcPath(t);return await this.app.net.delete("".concat(a,"/").concat(t[this.entity.codeName.toLowerCase()]),e)}async update(t,e,a={}){if(this.isLocalMode)return this.updateTemp(t,this.createEntity(e));const s=this.calcPath(t),i=await this.app.net.put("".concat(s,"/").concat(t[this.entity.codeName.toLowerCase()]),e,a);return i.data=await this.result.handle(t,i.data),i}async get(t,e={}){if(this.isLocalMode)return this.getTemp(t,e);const a=this.calcPath(t),s=await this.app.net.get("".concat(a,"/").concat(t[this.entity.codeName.toLowerCase()]),e);return s.data=await this.result.handle(t,s.data),s}async getDraft(t,e){if(this.isLocalMode)return this.getDraftTemp(t,e);const a=this.calcPath(t),s=await this.app.net.get("".concat(a,"/getdraft"),e);return s.data=await this.result.handle(t,s.data),s}async createTemp(t,e){try{const a=await this.getService(),s=await a.local.add(t,this.createEntity(e));return new n(s)}catch(t){return new n(t,500)}}async getDraftTemp(t,e){try{const t=this.createEntity({});return t?new n(t):new n(t,500)}catch(t){return new n(t,500)}}async removeTemp(t,e){try{let e=null;!e&&t&&(e=t[this.entity.codeName.toLowerCase()]);const a=(await this.getService()).local.delete(t,e);return a?new n(a):new n(a,500)}catch(t){return new n(t,500)}}async updateTemp(t,e){try{const a=(await this.getService()).local.update(t,this.createEntity(e));return a?new n(a):new n(a,500)}catch(t){return new n(t,500)}}async getTemp(t,e){try{let e=null;!e&&t&&(e=t[this.entity.codeName.toLowerCase()]);const a=(await this.getService()).local.get(t,e);return a?new n(a):new n(a,500)}catch(t){return new n(t,500)}}async removeBatchTemp(t,e){return new n(!0)}},ci=class extends Fs{get isLocalMode(){return ks(this.method)}async exec(t,e,a){if(this.isLocalMode){const a=await this.searchLocal(null,new Ts(t,e));return new n(a,200)}let i;switch(this.method.dataSetType){case"INDEXDE":case"CODELIST":case"MULTIFORM":i=await this.fetchCodeListSet(t,a);break;case"REMOTE":{const s=this.calcPath(t);i=await this.request(s,t,e,a)}break;default:throw new s(this.method,"数据来源类型".concat(this.method.dataSetType,"暂未支持"))}const r=i.data||[];return i.data=r.map((t=>this.createEntity(t))),i.data.length&&await Promise.all(i.data.map((e=>ri(this.entity,"compute",t,e,a)))),i}async selectLocal(t,e={}){let a=(await this.getService()).local.getList(t);a=H(a,"srfordervalue");const s={},i={},n={},r={};e.srfkey&&(s.srfkey=Z(e.srfkey),delete e.srfkey);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const a=e[t];null==a?(i[t]=Z(null),n[t]=Z(void 0),r[t]=Z("")):s[t]=Z(a)}if(!Q(s)){const t=tt(s),e=tt(i),o=tt(n),c=tt(r);a=a.filter((a=>{if(Q(i)){if(t(a))return!0}else if(t(a)&&(e(a)||o(a)||c(a)))return!0;return!1}))}return a.map((t=>t.clone()))}async searchLocal(t,e,a=this.entity.quickSearchAppDEFieldIds){const s=await this.getService();let i=[];t?(i=s.local.getList(e.context),i.length>0&&(i=i.filter((a=>t.test(a,e))))):(i=await this.selectLocal(e.context),i.length>0&&e.query&&""!==e.query&&a&&(i=i.filter((t=>{const s=new RegExp(e.query);for(let e=0;e<a.length;e+=1){const i=t[a[e]];if(s.test(i))return!0}return!1})))),$(e.sortField)||Q(e.sortField)||(i="DESC"===e.sortMode?X(i,e.sortField):H(i,e.sortField));const{page:n,size:r}=e,o=n*r,c=(n+1)*r-1;return i.slice(o,c).map((t=>J(t)))}async fetchCodeListSet(t,e){const{appCodeListId:s}=this.method;if(!s)throw new a(this.method,"没有指定数据来源代码表");const i=await this.app.codeList.get(s,t,e),{keyAppDEFieldId:r,majorAppDEFieldId:o}=this.entity,c=i.map((t=>({[r]:t.value,[o]:t.text})));return new n(c,200)}},li=t("DEService",class{constructor(t){this.model=t,this.methodMap=new Map,this.local=new Ps,this.wf=new Ns(t),this.file=new class{constructor(t){this.model=t}exportData(t,e,a,s){const i=xs(a,this.model),n="".concat(i,"/").concat(this.model.codeName2.toLowerCase(),"/exportdata/").concat(e.toLowerCase(),"/?srfexporttag=").concat(t.codeName);return ibiz.net.request(n,{method:"post",data:s,responseType:"blob"})}}(t)}getMethod(t){if(this.methodMap.has(t))return this.methodMap.get(t);const e=ke(this.model.appDEMethods,t);let a=null;switch(e.methodType){case"DEACTION":a=new oi(this.model,e);break;case"FETCH":case"FETCHTEMP":a=new ci(this.model,e);break;default:throw new s(e,"未支持的服务方法类型: ".concat(e.methodType))}return this.methodMap.set(t,a),a}exec(t,a,s={},i={}){const n=this.getMethod(t);if(n)return n.exec(a,s,i);throw new e("".concat(this.model.codeName,"未支持「").concat(t,"」方法"))}}),hi=t("ControlVO",class t{get srfuf(){return $(this.$origin.srfuf)?this.srfkey?1:0:this.$origin.srfuf}get srfkey(){return this.$origin.srfkey}get srfmajortext(){return this.$origin.srfmajortext}get srfdeid(){return this.$origin.srfdeid}get srfdecodename(){return this.$origin.srfdecodename}get srfkeyfile(){return this.$origin.srfkeyfile}get srfmajorfile(){return this.$origin.srfmajorfile}constructor(t={},e=new Map){Object.defineProperty(this,"$origin",{enumerable:!1,configurable:!0,value:t||{}}),Object.defineProperty(this,"$dataUIMap",{enumerable:!1,configurable:!0,value:e||new Map}),this.$dataUIMap.forEach(((t,e)=>{const a=t.dataKey;this.linkProperty(e,a,t.isOriginField)})),Object.keys(t).forEach((t=>{Object.prototype.hasOwnProperty.call(this,t)||this.linkProperty(t,t)}))}linkProperty(t,e,a=!0){"srfuf"!==t&&"srfkey"!==t&&(a||Object.prototype.hasOwnProperty.call(this.$origin,t)?Object.defineProperty(this,t,{enumerable:!0,configurable:!0,get(){return this.$origin[e]},set(t){this.$origin[e]=t}}):Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:null}))}getOrigin(){return this.$origin}setOrigin(e){this.$origin=e instanceof t?e.getOrigin():e}clone(){const e=J(this.$origin),a=new t(e,this.$dataUIMap);return Object.keys(this).forEach((t=>{a[t]=this[t]})),a}}),di=t("ControlService",class{constructor(t){this.dataUIMap=new Map,this.model=t}async init(t){this.app=ibiz.hub.getApp(null==t?void 0:t.srfappid),this.initUIDataMap()}initUIDataMap(){}async exec(t,e,a={},s={}){return await this.app.deService.exec(this.model.appDataEntityId,t,e,a,s)}handleResponse(t){return t}toUIData(t){return new hi(t,this.dataUIMap)}}),ui=t("MDControlService",class extends di{async fetch(t,e={}){var a;const s=(null==(a=this.model.fetchControlAction)?void 0:a.appDEMethodId)||"fetchdefault";let i=await this.exec(s,t,e);return i=this.handleResponse(i),i}async get(t,e={}){var a;const s=(null==(a=this.model.getControlAction)?void 0:a.appDEMethodId)||"get";let i=await this.exec(s,t,void 0,e);return i=this.handleResponse(i),i}async getDraft(t,e={}){var a;const s=(null==(a=this.model.getDraftControlAction)?void 0:a.appDEMethodId)||"getdraft";let i=await this.exec(s,t,void 0,e);return i=this.handleResponse(i),i}async remove(t,e={}){var a;const s=(null==(a=this.model.removeControlAction)?void 0:a.appDEMethodId)||"remove";return await this.exec(s,t,void 0,e)}async create(t,e){var a;const s=(null==(a=this.model.createControlAction)?void 0:a.appDEMethodId)||"create";let i=await this.exec(s,t,e.getOrigin());return i=this.handleResponse(i),i}async update(t,e){var a;const s=(null==(a=this.model.updateControlAction)?void 0:a.appDEMethodId)||"update";let i=await this.exec(s,t,e.getOrigin());return i=this.handleResponse(i),i}async exportData(t,a,s={}){throw new e("未实现")}handleResponse(t){const e=super.handleResponse(t);return e.headers&&(e.headers["x-page"]&&(e.page=Number(e.headers["x-page"])),e.headers["x-per-page"]&&(e.size=Number(e.headers["x-per-page"])),e.headers["x-total"]&&(e.total=Number(e.headers["x-total"]))),e.ok&&(U(e.data)?e.data=e.data.map((t=>this.toUIData(t))):e.data=this.toUIData(e.data)),e}}),pi=t("DeAuthorityService",class{constructor(t){this.entityModel=t}async calcByDataAccessAction(t,e){if(e.srfopprivs&&!e.srfopprivs.includes(t))return!1;return!!await this.calcByDeMainState(t,e)}async calcByDeMainState(t,e){let a=!0;const s=this.entityModel;if(!s.enableDEMainState)return ibiz.log.debug("".concat(s.codeName,"实体不存在或者为启用主状态,返回true")),a;ibiz.log.debug("操作标识".concat(t,"主状态计算开始"),e,s);const i=Ue(s,e);if(i){ibiz.log.debug("匹配主状态",i);const e=je(i,s);ibiz.log.debug("允许的主状态权限集合",e),a=e.includes(t)}else ibiz.log.debug("没匹配主状态,返回false"),a=!1;return ibiz.log.debug("操作标识".concat(t,"权限计算结束:").concat(a)),a}}),mi=t("AuthorityService",class{constructor(t){this.appModel=t,this.cache=new Map,this.constructorCache=new Map,this.resCodes=[],this.enablePermission=!1}register(t,e){this.constructorCache.set(t,e)}async getService(t){if(!this.cache.has(t)){const a=await ibiz.hub.getAppDataEntity(t,this.appModel.appId);if(!a)throw new e("未找到应用实体[".concat(t,"]"));const s=this.constructorCache.get(t);let i;i=s?await s(a):new pi(a),this.cache.set(t,i)}return this.cache.get(t)}async init(t=ibiz.appData){t&&(t.unires&&(this.resCodes=t.unires),!0===t.enablepermissionvalid&&ibiz.env.enablePermission&&(this.enablePermission=!0))}calcByResCode(t){return!this.enablePermission||this.resCodes.includes(t)}async calcByDataAccessAction(t,e,a){if(this.enablePermission){const e=await ibiz.hub.getApp(this.appModel.appId),s=await e.getOPPriv(t,a);if(this.enablePermission&&(null==s?void 0:s.mapSysUniResCode)&&!this.calcByResCode(s.mapSysUniResCode))return!1}if(e&&a){return(await this.getService(a)).calcByDataAccessAction(t,e)}return!0}}),fi=t("V7AuthService",class{async login(t,e){try{const a=await ibiz.net.post("/v7/login",{loginname:t,password:e}),{data:s}=a;if(s&&s.token){j(o.TOKEN,s.token,0,!0);const t=(new Date).getTime()+1e3*(s.expirein||7199);j(o.TOKEN_EXPIRES,"".concat(t),0,!0)}return!0}catch(t){ibiz.notification.error({title:"登录失败",desc:t.message||""})}return!1}async logout(){try{return await ibiz.net.get("/v7/logout"),z(o.TOKEN),z(o.TOKEN_EXPIRES),!0}catch(t){ibiz.notification.error({title:"登出失败",desc:t.message||""})}return!1}}),gi=t("TreeNodeData",class{constructor(t,e,a){this.leaf=!1,this.leaf=!0===a.leaf,this.parent=e,this.parent&&(this.context={...this.parent.context}),a.navContext&&(this.context=Object.assign(this.context||{},a.navContext)),a.navParams&&(this.params={...a.navParams}),this.nodeId=t.id}calcIcon(t){const{sysImage:e}=t,a={};return e&&(e.cssClass&&(a.cssClass=e.cssClass),e.imagePath&&(a.imagePath=e.imagePath)),Object.values(a).length>0?a:void 0}}),Ei=t("TreeCodeListNodeData",class extends gi{constructor(t,e,a){super(t,e,a);const{data:s}=a;if(this.deData=s,this.text=s.text,this.value=s.value,this.id=e?"".concat(e.id,":").concat(t.id,"@").concat(this.value):t.id+this.value,this.id=this.id.toLowerCase(),t.appDataEntityId){const e=ze(t.appDataEntityId);this.context=Object.assign(this.context||{},{[e]:this.value})}this.srfkey=this.value,this.srfmajortext=this.text,this.icon=this.calcIcon(t)}}),wi=t("TreeDataSetNodeData",class extends gi{constructor(t,e,a){super(t,e,a);const{data:s}=a;if(this.deData=s,this.text=s.srfmajortext,this.value=s.srfkey,this.id=e?"".concat(e.id,":").concat(t.id,"@").concat(s.srfkey):t.id+s.srfkey,this.id=this.id.toLowerCase(),t.appDataEntityId){const e=ze(t.appDataEntityId);this.context=Object.assign(this.context||{},{[e]:s.srfkey})}this.srfkey=this.deData.srfkey,this.srfmajortext=this.deData.srfmajortext,this.icon=this.calcIcon(t),this.textHtml=this.calcTextHtml(t)}calcIcon(t){const e=super.calcIcon(t)||{},{iconAppDEFieldId:a,detreeNodeDataItems:s}=t;a&&this.deData[a]&&(e.imagePath=this.deData[a]),e&&(this.icon=e);const i=null==s?void 0:s.find((t=>"icon"===t.id));return i&&(e.htmlStr=this.calcDataItemScript(i)),Object.values(e).length>0?e:void 0}calcDataItemScript(t){if(t.customCode&&t.scriptCode)return pa.execScriptFn({data:this.deData},t.scriptCode,{isAsync:!1})}calcTextHtml(t){let e;const{detreeNodeDataItems:a}=t,s=null==a?void 0:a.find((t=>"text"===t.id));return s&&(e=this.calcDataItemScript(s)),e}}),vi=t("TreeStaticNodeData",class extends gi{constructor(t,e,a){var s,i;super(t,e,a);const n="root"===t.nodeValue?void 0:t.nodeValue;if(this.id=e?"".concat(e.id,":").concat(t.id):t.id,this.id=this.id.toLowerCase(),this.text=t.text,this.value=n,e&&a.parentValueLevel){let t=e;for(let e=1;e<a.parentValueLevel;e++)t=null==t?void 0:t.parent;(null==t?void 0:t.deData)&&(this.deData=t.deData),this.value=n||(null==t?void 0:t.value)}this.srfkey=(null==(s=this.deData)?void 0:s.srfkey)||this.value,this.srfmajortext=(null==(i=this.deData)?void 0:i.srfmajortext)||this.text,this.icon=this.calcIcon(t)}}),yi=t("UIMapField",class{constructor(t,e,a={}){this.isOriginField=!1,this.isRequestNeed=!0,this.uiKey=t,this.dataKey=e,$(a.isOriginField)||(this.isOriginField=a.isOriginField)}}),Ii=t("CalendarItemData",class{constructor(t,e){this.model=t,this.data=e}get deData(){return this.data}get navId(){return"".concat(this.itemType,"@").concat(this.id)}get itemType(){return this.model.itemType}get bkColor(){const t=this.model.bkcolorAppDEFieldId;return t&&this.data[t]?this.data[t]:this.model.bkcolor}get beginTime(){const t=this.model.beginTimeAppDEFieldId;return t?this.data[t]:void 0}get color(){const t=this.model.colorAppDEFieldId;return t&&this.data[t]?this.data[t]:this.model.color}get content(){const t=this.model.contentAppDEFieldId;return t?this.data[t]:void 0}get endTime(){const t=this.model.endTimeAppDEFieldId;return t?this.data[t]:void 0}get icon(){const t=this.model.iconAppDEFieldId;return t?this.data[t]:void 0}get id(){const t=this.model.idAppDEFieldId;return t&&this.data[t]?this.data[t]:this.data.srfkey}get level(){const t=this.model.levelAppDEFieldId;return t?this.data[t]:void 0}get tag2(){const t=this.model.tag2AppDEFieldId;return t?this.data[t]:void 0}get tag(){const t=this.model.tagAppDEFieldId;return t?this.data[t]:void 0}get text(){const t=this.model.textAppDEFieldId;return t?this.data[t]:void 0}get tips(){const t=this.model.tipsAppDEFieldId;return t?this.data[t]:void 0}}),Di=t("DEServiceUtil",class{constructor(t){this.appModel=t,this.cache=new Map,this.constructorCache=new Map}register(t,e){this.constructorCache.set(t,e)}async getService(t){if(!this.cache.has(t)){const a=await ibiz.hub.getAppDataEntity(t,this.appModel.appId);if(!a)throw new e("未找到应用实体[".concat(t,"]"));const s=this.constructorCache.get(t);let i;i=s?await s(a):new li(a),this.cache.set(t,i)}return this.cache.get(t)}clearTempCache(t){this.cache.forEach((e=>{e.local.clear(t)}))}async exec(t,e,a,s,i){return(await this.getService(t)).exec(e,a,s,i)}}),Ci=t("Application",class{constructor(t){this.model=t,this.deName2DeCodeName=new Map,this.net=new c({baseURL:"".concat(ibiz.env.baseUrl,"/").concat(t.appId)}),this.deService=new Di(t),this.codeList=new Ls(t),this.authority=new mi(t)}get appId(){return this.model.appId}async init(){await this.authority.init(),await this.loadAppModelStyle()}async loadAppModelStyle(){const t=await ibiz.hub.getAppStyle(this.appId);if(t){const e=document.createElement("style");e.setAttribute("type","text/css"),e.id=this.appId,e.innerHTML=t,document.head.appendChild(e)}}getAppFunc(t){return(this.model.appFuncs||[]).find((e=>e.id===t))||null}async getUIAction(t){const[,e]=t.split("@");if(e){const a=(await ibiz.hub.getAppDataEntity(e,this.model.appId)).appDEUIActions.find((e=>e.id===t));if(a)return a}return this.model.appDEUIActions.find((e=>e.id===t))}async getOPPriv(t,e){var a,s;let i=null==(a=this.model.deopprivs)?void 0:a.find((e=>e.name===t));if(!i&&e){i=null==(s=(await ibiz.hub.getAppDataEntity(e,this.model.appId)).deopprivs)?void 0:s.find((e=>e.name===t))}return i}async getDEUILogic(t,e){return(await ibiz.hub.getAppDataEntity(e,this.model.appId)).appDEUILogics.find((e=>e.id===t))}}),bi=t("FormNotifyState",(t=>(t.LOAD="LOAD",t.DRAFT="DRAFT",t.SAVE="SAVE",t))(bi||{})),Ai=t("GridNotifyState",(t=>(t.LOAD="LOAD",t.DRAFT="DRAFT",t.SAVE="SAVE",t))(Ai||{})),Pi=t("PanelNotifyState",(t=>(t.LOAD="LOAD",t.DRAFT="DRAFT",t.SAVE="SAVE",t))(Pi||{})),_i=t("Counter",class{constructor(t){this.callback=t,this.count=0,this.state="Unused",this.reusable=!0}increment(){return"Used"===this.state||(this.count+=1),this.count}decrement(t){if("Used"!==this.state){if(0===this.count)throw new e("错误的调用!decrement不能对count为0调用");this.count-=1,0===this.count&&(t?t():this.callback&&this.callback(),this.reusable||(this.state="Used"))}}destroy(){this.callback=void 0}}),Si=t("LoadingState",class{constructor(){this.isLoading=!1,this.counter=new _i(l)}begin(){this.isLoading=!0,this.counter.increment()}end(){this.counter.decrement((()=>{this.isLoading=!1}))}}),xi=t("CTXState",class{}),Ti=t("CTX",class{constructor(t){this.parent=t,this.evt=new W(3e3),this.controllersMap=new Map,this.state=new xi}async init(t){this.view=t,this.registerController(t.model.name,t)}destroy(){this.controllersMap.clear(),this.view=null,this.state=null}async setState(t){Object.assign(this.state,t)}startLoading(){this.view.startLoading()}endLoading(){this.view.endLoading()}registerController(t,e){this.controllersMap.set(t,e),this.evt.emit("onRegister",t,e)}getController(t,e=!1){return this.controllersMap.has(t)?this.controllersMap.get(t):this.parent&&e?this.parent.getController(t):void 0}getTopView(){return this.parent?2===this.view.modal.routeDepth?this.view:this.parent.getTopView():this.view}}),Li=t("ActivityCounter",class extends _i{constructor(){super(...arguments),this.reusable=!1,this.registration=new Map}enroll(t){"Unused"!==this.state||this.registration.has(t)||(this.registration.set(t,!1),this.increment())}attend(t){this.registration.has(t)&&!1===this.registration.get(t)&&(this.registration.set(t,!0),this.decrement())}}),Oi=t("UIActionButtonState",class{constructor(t,e,a){this.disabled=!1,this.visible=!0,this.loading=!1,this.permitted=!0,this.noPermissionHidden=!0,this.noDataDisabled=!1,this.isInit=!1,this.name=t,this.uiActionId=a,this.appId=e}async init(){if(!this.uiActionId)return void(this.isInit=!0);const t=await $e(this.uiActionId);if([,this.appDeName]=this.uiActionId.split("@"),!t)return;const{dataAccessAction:e,noPrivDisplayMode:a,actionTarget:s,uiactionMode:i,uiactionTag:n}=t;this.dataAccessAction=e,1===a?this.noPermissionHidden=!1:6===a&&(this.visible=!1),(s&&"NONE"!==s||"SYS"===i&&["Save","SaveAndExit","SaveAndNew","Edit","Remove","RemoveAndExit"].includes(n))&&(this.noDataDisabled=!0),this.isInit=!0}async calcPermission(t,e){if(!this.dataAccessAction)return;const a=await ibiz.hub.getApp(this.appId);this.appDeName&&e&&!e.includes(this.appDeName)&&ibiz.log.warn("".concat(this.uiActionId,"界面行为的实体").concat(this.appDeName,"和数据的实体").concat(e,"不一致")),this.permitted=await a.authority.calcByDataAccessAction(this.dataAccessAction,t,e)}async update(t,e){this.isInit||await this.init(),await this.calcPermission(t,e),this.permitted?(this.visible=!0,this.disabled=this.noDataDisabled&&!t):(this.disabled=!0,this.visible=!this.noPermissionHidden)}}),Ni=t("ButtonContainerState",class{constructor(){Object.defineProperty(this,"children",{enumerable:!1,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,get:()=>0!==this.children.length&&!!this.children.find((t=>t.visible))})}addState(t,e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e}),this.children.push(e)}setLoading(t){this.children.forEach((e=>{e.setLoading?e.setLoading(t):e.loading=!!t&&e.name===t}))}async update(t,e){await Promise.all(this.children.map((a=>a.update(t,e))))}}),Ri=t("QXEventEx",class extends W{constructor(){super(...arguments),this.anyEventFns=[]}onAll(t){this.anyEventFns.includes(t)||this.anyEventFns.push(t)}emit(t,...e){super.emit(t,...e),this.anyEventFns.forEach((a=>{a(t,...e)}))}async asyncEmit(t,...e){const a=super.asyncEmit(t,...e),s=this.anyEventFns.map((a=>a(t,...e))),i=Promise.all(s),n=await a,r=await i;return n.concat(...r)}reset(){super.reset(),G(this.anyEventFns)}}),Mi=t("ControllerEvent",class{constructor(t){this.getBaseArgs=t,this.isDestroyed=!1,this.evt=new Ri}async emit(t,e){this.isDestroyed||await this.evt.asyncEmit(t,{...this.getBaseArgs(),eventName:t,...e||{}})}on(t,e){this.isDestroyed||this.evt.on(t,e)}onAll(t){this.isDestroyed||this.evt.onAll(t)}destroy(){this.getBaseArgs=void 0,this.evt.reset(),this.isDestroyed=!0}});function Vi(t,e){return(!$(t)&&""!==t||!$(e)&&""!==e)&&t!==e}function ki(t){let e=Array.isArray(t)?t[0]:t;return e&&e instanceof hi&&(e=e.getOrigin()),e}function Fi(t,a,s){const i=[];return t.forEach((t=>{const{valueRuleType:n}=t,r=t.sysValueRule,o=t.defvalueRule;if("SYSVALUERULE"===n&&r)"REG"===r.ruleType?i.push({pattern:new RegExp(r.regExCode),message:r.ruleInfo,trigger:"change blur"}):"SCRIPT"===r.ruleType&&i.push({validator:(t,e,a,s)=>{if(!e)return!0;try{pa.execScriptFn({rule:t,value:e,callback:a,source:s},r.scriptCode,{isAsync:!1})}catch(t){return console.error(t),!1}return!0},trigger:"change blur"});else if("DEFVALUERULE"===n&&o){const t=s||a;i.push({validator:(a,s,i,n)=>{if(k(n[t]))return!0;const{isPast:r,infoMessage:c}=ma(t,n,o.groupCond);return r||i(new e(c||o.ruleInfo)),!0},trigger:"change blur"})}})),i}var Wi=t("ValueExUtil",class{static mergeDefault(t){return et(t,{textSeparator:",",valueSeparator:","})}static toText(t,a){if($(a)||""===a)return"";const{valueType:s,objectNameField:i,textSeparator:n}=this.mergeDefault(t);if(["OBJECTS","OBJECT"].includes(s)){if(!i)throw new e("缺少objectNameField");const t=i.toLowerCase();return"OBJECTS"===s?a.map((e=>e[t]||"---")).join(n):a[t]}return"SIMPLES"===s?a.join(n):"".concat(a)}}),Bi="__self",Ui=t("BaseController",class{constructor(t,e,a,s){this.model=t,this.context=e,this.params=a,this.ctx=s,this.state={},this.name="",this.evt=new Mi(this.getEventArgs.bind(this)),this.mountCounter=new Li(this.mounted.bind(this)),this.childNames=[],this.name=t.name||t.id,this.initState()}get _evt(){return this.evt}initState(){this.state.isCreated=!1,this.state.isMounted=!1,this.state.isDestroyed=!1}getEventArgs(){return{context:this.context,params:this.params,data:[],targetName:this.model.name,view:this.ctx.view}}async created(){this.mountCounter.enroll(Bi),await this.onCreated(),this.state.isCreated=!0,this.force((()=>{this.mountSelf()})),ibiz.log.debug("".concat(this.constructor.name,":").concat(this.name," onCreated")),this._evt.emit("onCreated",void 0)}async onCreated(){this.ctx.evt.on("onForecast",(t=>{this.childNames.includes(t)&&this.mountCounter.enroll(t)})),this.ctx.evt.on("onRegister",((t,e)=>{this.childNames.includes(t)&&e.evt.on("onMounted",(()=>{this.mountCounter.attend(t)}))}))}async mountSelf(){this.mountCounter.registration.get(Bi)||this.mountCounter.attend(Bi)}async mounted(){await this.onMounted(),this.state.isMounted=!0,ibiz.log.debug("".concat(this.constructor.name,":").concat(this.name," onMounted")),this._evt.emit("onMounted",void 0)}async onMounted(){}async destroyed(){await this.onDestroyed(),this.state.isDestroyed=!0,ibiz.log.debug("".concat(this.constructor.name,":").concat(this.name," onDestroyed")),await this._evt.emit("onDestroyed",void 0),this.evt.destroy()}async onDestroyed(){}force(t){}getController(t,e=!1){return this.ctx.getController(t,e)}getTopView(){return this.ctx.getTopView()}listenNewController(t){this.ctx.evt.on("onRegister",t)}}),ji=t("ViewController",class extends Ui{constructor(t,e,a,s){super(ibiz.util.layoutPanel.fill(t),i.create({},e),a||{},new Ti(s)),this.session={},this.modal=new Sa({}),this.providers={},this.engines=[],this.slotProps={},this.counters={},this.viewLoading=new Si,this.isCloseView=!1,this._isActive=!0,s&&s.registerController(this.model.name,this),this.ctx.init(this),this.initEngines()}get _evt(){return this.evt}get parentView(){var t;return null==(t=this.ctx.parent)?void 0:t.view}get isActive(){return this._isActive}onActivated(){this._isActive=!0,ibiz.log.debug("视图[".concat(this.model.name,"](").concat(this.model.id,")激活"))}onDeactivated(){this._isActive=!1,ibiz.log.debug("视图[".concat(this.model.name,"](").concat(this.model.id,")暂停"))}initEngines(){const t=sa(this.model);if(t.length)t.forEach((t=>{const e=ibiz.engine.getEngine(t,this);e&&this.engines.push(e)}));else{const t=ibiz.engine.getEngine({engineCat:"VIEW",engineType:this.model.viewType},this);t&&this.engines.push(t)}}async initCounters(){const t=this.model.viewLayoutPanel,{appCounterRefs:e}=t;if(e&&e.length>0)try{await Promise.all(e.map((async t=>{const e=await Os.getCounterByRef(t,this.context);this.counters[t.id]=e})))}catch(t){console.error(t)}}initState(){super.initState(),this.state.isLoading=!1,this.state.caption=this.model.caption,this.state.srfactiveviewdata=null}async onCreated(){await super.onCreated(),this.modal.hooks.beforeDismiss.tapPromise((async t=>{Y(this.state.closeOK)&&(t.ok=this.state.closeOK),await this._evt.emit("onCloseView",{...t})})),this._evt.emit("onViewInfoChange",{caption:this.model.caption,title:this.model.title}),this.handleContextParams();const t=this.model.viewLayoutPanel;this.childNames.push(t.name);const e=await Ka(t);this.providers[t.name]=e;const a=ea(this.model);a&&await Promise.all(a.map((async t=>{const e=await Ka(t);this.providers[t.name||t.id]=e}))),await this.initCounters();const s=aa(this.model);s.length&&(this.scheduler=ibiz.scheduler.createViewScheduler(s),this.scheduler.defaultParamsCb=()=>this.getEventArgs(),this.scheduler.hasViewEventTrigger&&this.evt.onAll(((t,e)=>{this.scheduler.triggerViewEvent(e)}))),this.engines.length&&await Promise.all(this.engines.map((t=>t.onCreated())))}async onMounted(){var t;await super.onMounted(),this.engines.length&&await Promise.all(this.engines.map((t=>t.onMounted()))),null==(t=this.scheduler)||t.startTimerTrigger()}async onDestroyed(){await super.onDestroyed(),this.engines.length&&await Promise.all(this.engines.map((t=>t.onDestroyed()))),this.ctx.destroy(),this.context.destroy(),this.engines=[],this.scheduler&&this.scheduler.destroy(),ibiz.log.debug("视图[".concat(this.model.name,"](").concat(this.model.id,")销毁"))}handleContextParams(){this.context.srfappid=this.model.appId,($(this.context.srfsessionid)||Q(this.context.srfsessionid))&&(this.context.srfsessionid=B());const t=this.model.appViewNavContexts;let e={};V(t)&&(e=Le(t,this.context,this.params)),Object.assign(this.context,e);const a=this.model.appViewNavParams;let s={};V(a)&&(s=Le(a,this.context,this.params)),Object.assign(this.params,s),this.state.isMounted&&this.callUIAction("Refresh")}async call(t,e){let a;for(const s of this.engines)if(a=await s.call(t,e),void 0!==a)break;return a}async callUIAction(t,a){const s=this.call(t,a);if(void 0===s)throw new e("没有引擎支持预置界面行为".concat(t));return s}async closeView(t={ok:!1,data:[]}){await this.modal.dismiss(t)}startLoading(){this.viewLoading.begin(),this.state.isLoading=this.viewLoading.isLoading}endLoading(){this.viewLoading.end(),this.state.isLoading=this.viewLoading.isLoading}setLayoutPanel(t){var e;this.layoutPanel=t,this.layoutPanel.state.isMounted?this.mountCounter.attend(this.layoutPanel.model.name):this.layoutPanel.evt.on("onMounted",(()=>{this.mountCounter.attend(this.layoutPanel.model.name)})),(null==(e=this.scheduler)?void 0:e.hasControlEventTrigger)&&t.evt.on("onControlEvent",(t=>{this.scheduler.triggerControlEvent(t.triggerControlName,t.triggerEvent)}))}}),zi=(t("MobViewController",class extends ji{}),t("WFStepTraceViewController",class extends ji{initState(){super.initState(),this.state.historyData=null}async onCreated(){var t;await super.onCreated();const e=ibiz.hub.getApp(this.context.srfappid);if(null==(t=this.ctx.parent)?void 0:t.view.model.appDataEntityId){const t=await e.deService.getService(this.ctx.parent.view.model.appDataEntityId),a=Object.assign(this.context.clone(),this.params),s=await t.wf.getWFHistory(a);s.data&&(this.state.historyData=s.data)}}}),t("EditorController",class{constructor(t,e){this.placeHolder="",this.editorParams={},this.model=t,this.parent=e,this.context=e.context,this.params=e.params}get readonly(){return!!this.model.readOnly}async init(){await this.onInit()}async onInit(){this.model.placeHolder&&(this.placeHolder=this.model.placeHolder),this.model.editorParams&&Object.keys(this.model.editorParams).forEach((t=>{this.editorParams[t]=this.model.editorParams[t]}))}handlePublicParams(t,e,a){const{navigateContexts:s,navigateParams:i}=this.model;let n={};s&&t&&(n=Le(s,e,a,t));const r=Object.assign(e.clone(),n);let o={};i&&t&&(o=Le(i,e,a,t));return{context:r,params:{...a,...o}}}toObj(t){if(!t)return;return new Function("return (".concat(t,");"))()}toBoolean(t){return Object.is("true",t)}})),Gi=(t("CodeListEditorController",class extends zi{async loadCodeList(t){const{context:e,params:s}=this.handlePublicParams(t,this.context,this.params);if(this.model.appCodeListId){const t=await ibiz.hub.getApp(this.context.srfappid);let a=[];return a=await t.codeList.get(this.model.appCodeListId,e,s),a}throw new a(this.model,"请配置代码表")}}),t("ControlController",class extends Ui{constructor(t,e,a,s){super(t,e,a,s),this.providers={},this.registerToCtx();const i=ibiz.util.layoutPanel.get("".concat(t.controlType,"_DEFAULT"));i&&(this.controlPanel=i)}get _evt(){return this.evt}get view(){return this.ctx.view}registerToCtx(){this.ctx.registerController(this.model.name||this.model.id,this)}getEventArgs(){return{...super.getEventArgs(),data:this.getData()||[],ctrl:this}}initState(){super.initState(),this.state.isLoading=!1}async onCreated(){if(await super.onCreated(),this.controlPanel){this.childNames.push(this.controlPanel.name);const t=await Ka(this.controlPanel);this.providers[this.controlPanel.name]=t}this.initControlScheduler(this.model.controlLogics)}async onDestroyed(){await super.onDestroyed(),this.scheduler&&this.scheduler.destroy()}getControlType(){return this.model.controlType}getData(){return null}async startLoading(){this.state.isLoading=!0,this.ctx.startLoading()}async endLoading(){this.state.isLoading=!1,this.ctx.endLoading()}handlerAbilityParams(t){return{context:this.context.clone(),params:{...this.params},data:(null==t?void 0:t.data)||this.getData()||[]}}setLayoutPanel(t){this.layoutPanel=t,this.layoutPanel.state.isMounted?this.mountCounter.attend(this.layoutPanel.model.name):this.layoutPanel.evt.on("onMounted",(()=>{this.mountCounter.attend(this.layoutPanel.model.name)}))}initControlScheduler(t=[]){0!==t.length&&(this.scheduler=ibiz.scheduler.createControlScheduler(t),this.scheduler.defaultParamsCb=()=>this.getEventArgs())}actionNotification(t,e){var a;const{ctrlMsg:s}=this.model,i=null==(a=null==s?void 0:s.ctrlMsgItems)?void 0:a.find((e=>e.name===t));let n,r;if(i&&i.content){r=$(i.timeout)?void 0:i.timeout/1e3;const t={...this.getEventArgs()};(null==e?void 0:e.data)&&(t.data=e.data),n=pa.execScriptFn(t,"`".concat(i.content,"`"),{isAsync:!1,singleRowReturn:!0})}else{const e="CONTROL.".concat(this.model.controlType,".").concat(t).toUpperCase();n=ibiz.i18n.t(e,""),n===e&&(n="")}if(!n&&(null==e?void 0:e.default)&&(n=e.default),!n&&(null==e?void 0:e.error)&&(n=n||e.error.message),n){if(null==e?void 0:e.error)throw new h(n,r);ibiz.message.success(n,r,0===r)}}})),Hi=t("MDControlController",class extends Gi{constructor(){super(...arguments),this.fieldIdNameMap=new Map}get _evt(){return this.evt}initState(){super.initState(),this.state.items=[],this.state.selectedData=[],this.state.searchParams={},this.state.noSort=!1,this.state.sortQuery="",this.state.curPage=1,this.state.size=20,this.state.total=0,this.state.isLoaded=!1,this.state.singleSelect=!0,this.state.mdctrlActiveMode=0,this.state.groups=[]}async onCreated(){var t;await super.onCreated();null==(t=(await ibiz.hub.getAppDataEntity(this.model.appDataEntityId)).appDEFields)||t.forEach((t=>{this.fieldIdNameMap.set(t.id,t.name)})),this.setSort()}setSort(t,e){t&&e&&(this.state.sortQuery="".concat(t,",").concat(e))}async getFetchParams(t){const{curPage:e,size:a,sortQuery:s,noSort:i}=this.state,n={...this.params};return a&&(n.page=e-1,n.size=a),!i&&s&&(n.sort=s),await this._evt.emit("onBeforeLoad",void 0),Object.assign(n,{...this.state.searchParams}),t&&Object.assign(n,t),n}async load(t={}){await this.startLoading();try{const e=!0===t.isInitialLoad,a=!0===t.isLoadMore;e?this.state.curPage=1:a&&(this.state.curPage+=1);const{context:s}=this.handlerAbilityParams(t),i=await this.getFetchParams(null==t?void 0:t.params),n=await this.service.fetch(s,i);"number"==typeof n.total&&(this.state.total=n.total),a?this.state.items.push(...n.data):this.state.items=n.data,await this.afterLoad(t,n.data),this.state.isLoaded=!0,await this._evt.emit("onLoadSuccess",{isInitialLoad:e})}catch(t){throw await this._evt.emit("onLoadError",void 0),this.actionNotification("FETCHERROR",{error:t}),t}finally{await this.endLoading()}return this.actionNotification("FETCHSUCCESS"),this.state.items}async afterLoad(t,e){return e}async refresh(){await this.load({isInitialLoad:!1})}async remove(t){const{context:a,params:s,data:i}=this.handlerAbilityParams(t);if(!(null==i?void 0:i.length))throw new e("未选中数据");if(!0!==(null==t?void 0:t.silent)){if(!await ibiz.confirm.error({title:"数据删除",desc:"确认删除数据?"}))return}await this._evt.emit("onBeforeRemove",void 0),await this.startLoading();let n=!1;try{const e=ze(this.model.appDataEntityId);await Promise.allSettled(i.map((async t=>{if(0!==t.srfuf){const i=a.clone();i[e]=t.srfkey,await this.service.remove(i,s),n=!0}this.afterRemove(t)}))),!0!==(null==t?void 0:t.silent)&&this.actionNotification("REMOVESUCCESS",{data:i,default:"数据[".concat(i.map((t=>t.srfmajortext)).join("、"),"]删除成功!")}),n&&this.refresh()}catch(t){throw await this._evt.emit("onRemoveError",void 0),this.actionNotification("REMOVEERROR",{error:t,data:i}),t}finally{await this.endLoading()}this.state.selectedData=[],await this._evt.emit("onRemoveSuccess",void 0)}afterRemove(t){const e=this.state.items.findIndex((e=>e.srfkey===t.srfkey));-1!==e&&this.state.items.splice(e,1)}getData(){return this.state.selectedData||[]}setActive(t){return this._evt.emit("onActive",{data:[t]})}setSelection(t){const{selectedData:e}=this.state;d(e,t)||(this.state.selectedData=t,this._evt.emit("onSelectionChange",{data:t}))}async onRowClick(t){const{selectedData:e}=this.state,a=e.filter((e=>e.srfkey!==t.srfkey));a.length===e.length?this.setSelection(this.state.singleSelect?[t]:e.concat([t])):this.setSelection(a),1===this.state.mdctrlActiveMode&&await this.setActive(t)}async onDbRowClick(t){2===this.state.mdctrlActiveMode&&await this.setActive(t)}async importData(){}async exportData(t){}}),Xi=t("AppMenuController",class extends Gi{initState(){super.initState(),this.state.menuItemsState={}}get routeDepth(){return this.view.modal.routeDepth}async onCreated(){var t;await super.onCreated(),this.app=await ibiz.hub.getApp(this.context.srfappid),null==(t=this.model.appMenuItems)||t.forEach((t=>{this.initMenuItemState(t)}))}async onClickMenuItem(t,s,i=!0){const n=u(this.model,t,{compareField:"id",childrenFields:["appMenuItems"]});if(!n)throw new e("找不到名为".concat(t,"的菜单项"));if(this.evt.emit("onClick",{eventArg:t,event:s}),!n.appFuncId)throw new a(n,"没有配置应用功能");const r=this.context.clone();this.routeDepth&&i&&Object.assign(r,{toRouteDepth:this.routeDepth+1}),await ibiz.commands.execute(Ra.TAG,n.appFuncId,r,this.params)}initMenuItemState(t){var e;const a={permitted:!0,visible:!0};if(t.hidden)a.visible=!1;else{let s=!0;t.accessKey&&(s=this.app.authority.calcByResCode(t.accessKey));let i=s;if(null==(e=t.appMenuItems)?void 0:e.length){const e=t.appMenuItems.map((t=>this.initMenuItemState(t).visible));i=i&&e.includes(!0)}a.permitted=s,a.visible=i}return this.state.menuItemsState[t.id]=a,a}getAllItems(){const t=[],e=a=>{a.forEach((a=>{t.push(a),a.appMenuItems&&a.appMenuItems.length>0&&e(a.appMenuItems)}))};return e(this.model.appMenuItems),t}getCounter(t){const{counters:e}=this.ctx.view;return e[t]?e[t]:null}}),Ki=(t("AppMenuIconViewController",class extends Xi{async onClickMenuItem(t,s){const i=u(this.model,t,{compareField:"id",childrenFields:["appMenuItems"]});if(!i)throw new e("找不到名为".concat(t,"的菜单项"));if(this.evt.emit("onClick",{eventArg:t,event:s}),!i.appFuncId)throw new a(i,"没有配置应用功能");const n=this.context.clone();1===this.routeDepth&&Object.assign(n,{toRouteDepth:1}),await ibiz.commands.execute(Ra.TAG,i.appFuncId,n,this.params)}}),t("CalendarService",class extends ui{async search(t,e={}){const{sysCalendarItems:a}=this.model;if(!a)return[];const s=a.map((async a=>{const s=a.appDEDataSetId||"fetchdefault";return this.exec2(s,t,e,void 0,a.appDataEntityId)}));return(await Promise.all(s)).map(((t,e)=>this.setCalendarConfigData(t.data,e))).flat()}setCalendarConfigData(t,a){const{sysCalendarItems:s}=this.model;if(!s)throw new e("未找到日历项模型");const i=s[a];if(!i)throw new e("未找到日历项模型");return t.map((t=>new Ii(i,t)))}async exec2(t,e,a={},s={},i=this.model.appDataEntityId){return await this.app.deService.exec(i,t,e,a,s)}}));t("CalendarController",class extends Hi{initState(){super.initState(),this.state.selectedDate=new Date,this.state.size=1e3}async onCreated(){await super.onCreated(),this.service=new Ki(this.model),await this.service.init(this.context)}async load(t={}){const e=!0===t.isInitialLoad,{context:a}=this.handlerAbilityParams(t),s=await this.getFetchParams(null==t?void 0:t.params);let i;await this.startLoading();try{i=await this.service.search(a,s)}finally{await this.endLoading()}return await this.afterLoad(t,i),this.state.isLoaded=!0,this.state.items=i,await this.evt.emit("onLoadSuccess",{isInitialLoad:e}),i}getCurSelectDate(t){const{selectedDate:e}=this.state,{start:a,end:s}=t;if(!a||!s){const t=new Date(e.getFullYear(),e.getMonth(),1),a=new Date(e.getFullYear(),e.getMonth()+1,1);return{start:st(t).format("YYYY-MM-DD HH:mm:ss"),end:st(a).format("YYYY-MM-DD HH:mm:ss")}}return{start:a,end:s}}async getFetchParams(t={}){const{curPage:e,size:a,sortQuery:s,noSort:i}=this.state,n={...this.params};!i&&s&&(n.sort=s),await this._evt.emit("onBeforeLoad",void 0),Object.assign(n,{...this.state.searchParams}),a&&(n.page=e-1,n.size=a),t&&Object.assign(n,t);const r=this.getCurSelectDate(n);return Object.assign(n,r),n}async onRowClick(t){const{selectedData:e}=this.state,a=e.filter((e=>e.deData.srfkey!==t.deData.srfkey));a.length===e.length?this.setSelection(this.state.singleSelect?[t]:e.concat([t])):this.setSelection(a),1===this.state.mdctrlActiveMode&&await this.setActive(t)}setSelectDate(t){this.state.selectedDate=t}});st.extend(it),st.extend(nt),st.extend(rt),st.extend(ot),st.extend(ct);var Yi="$default_group",$i=class{constructor(t,e){this.model=t,this.chartGenerator=e,this.staticOptions={},this.autoCompleteCategory=!0,this.model=t,this.chartGenerator=e;const{chartSeriesEncode:s,caption:i,id:n,userParam:r}=t;if(!t.catalogField)throw new a(t,"缺少分类属性配置");if(!t.valueField)throw new a(t,"缺少值属性配置");this.catalogField=e.getFieldKey(t.catalogField),this.valueField=e.getFieldKey(t.valueField),this.groupField=t.seriesField?e.getFieldKey(t.seriesField):void 0;const{chartXAxisId:o,chartYAxisId:c}=s||{};this.xAxisIndex=I(o),this.yAxisIndex=I(c),this.seriesName=i||n,this.staticOptions=this.calcStaticOptions(),r&&(this.seriesUserParam=an(r))}calcStaticOptions(){return{type:this.model.seriesType,name:this.seriesName,emphasis:{label:{fontSize:20,show:!0}},label:{position:"top",show:!0}}}translateVal(t,e,a=!1){if($(e))return;if($(t))return e;const s=this.chartGenerator.codeListMap.get(t);if(null==s?void 0:s.length){const t=s.find((t=>t.value===e));if(t)return t.text}return a?void 0:e}calcGroupData(t){this.groupData={};const e=this.groupData,{seriesCodeListId:a,catalogCodeListId:s}=this.model;return t.forEach((t=>{let i=Yi;if(this.groupField){const e=this.translateVal(a,t[this.groupField]);if($(e))return;i=e}if(!e[i]&&(e[i]=new Map,s&&this.autoCompleteCategory)){this.chartGenerator.codeListMap.get(s).forEach((t=>{e[i].set(t.text,{value:0})}))}const n=this.translateVal(s,t[this.catalogField],!0);n&&(e[i].get(n)||e[i].set(n,{value:0}),e[i].get(n).value+=t[this.valueField],e[i].get(n).deData=t)})),e}calcGroupSeries(t){return Object.keys(t).map((e=>{const a=t[e],s=this.calcSeriesData(a);let i={...this.staticOptions,data:s};return e!==Yi&&(i.name=e),this.seriesUserParam&&(i=at(i,this.seriesUserParam)),i}))}calcSeriesData(t){const e=[];return t.forEach(((t,a)=>{var s;e.push([a,t.value,null==(s=t.deData)?void 0:s.srfkey])})),e}calcByData(t){const e=this.dataPreprocess(t),a=this.calcGroupData(e);return this.addTimeData(a),this.calcGroupSeries(a)}getSrfkeyByParams(t){return t.value[2]}dataPreprocess(t){const e=[];t.forEach((t=>{e.push(J(t))}));const{groupMode:a}=this.model;return a&&e.forEach((t=>{let e="";if("DAY"===a||"YEAR"===a||"MONTH"===a){if("DAY"===a?e="YYYY-MM-DD":"YEAR"===a?e="YYYY":"MONTH"===a&&(e="YYYY-MM"),t[this.catalogField]){const a=st(t[this.catalogField]).format(e);t[this.catalogField]=a}}else if("QUARTER"===a){if(t[this.catalogField]){const e="".concat(st(t[this.catalogField]).format("YYYY"),"-").concat(st(t[this.catalogField]).quarter());t[this.catalogField]=e}}else if("YEARWEEK"===a&&t[this.catalogField]){const e="".concat(st(t[this.catalogField]).format("YYYY"),"-").concat(st(t[this.catalogField]).week());t[this.catalogField]=e}})),e}sortTimeData(t){const{groupMode:e}=this.model;Object.keys(t).forEach((a=>{const s=t[a];let i=[];"DAY"===e||"YEAR"===e||"MONTH"===e?i=Array.from(s.keys()).sort(((t,e)=>st(t).diff(st(e)))):"QUARTER"!==e&&"YEARWEEK"!==e||(i=Array.from(s.keys()).sort(((t,e)=>{const[a,s]=t.split("-"),[i,n]=e.split("-");return a!==i?parseInt(a,10)-parseInt(i,10):parseInt(s,10)-parseInt(n,10)})));const n=new Map;i.forEach((t=>{n.set(t,s.get(t))})),t[a]=n}))}addTimeData(t){const{groupMode:e}=this.model;if(!e||"CODELIST"===e)return;const a=[];Object.keys(t).forEach((e=>{t[e].forEach(((t,e)=>{a.push(st(e))}))}));const s=st.max(a),i=st.min(a);if("DAY"===e){let e=i;const a=s;for(;null==e?void 0:e.isSameOrBefore(a,"day");){const a=e.format("YYYY-MM-DD");Object.keys(t).forEach((e=>{t[e].get(a)||t[e].set(a,{value:0})})),e=e.add(1,"day")}}else if("YEAR"===e){let e=i.year();const a=s.year();for(;e<=a;){const a=e.toString();Object.keys(t).forEach((e=>{t[e].get(a)||t[e].set(a,{value:0})})),e+=1}}else if("MONTH"===e){let e=i.clone().startOf("month");const a=s.clone().startOf("month");for(;e.isSameOrBefore(a);){const a=e.format("YYYY-MM");Object.keys(t).forEach((e=>{t[e].get(a)||t[e].set(a,{value:0})})),e=e.add(1,"month")}}else if("QUARTER"===e){const e=[];Object.keys(t).forEach((a=>{t[a].forEach(((t,a)=>{e.push(a)}))}));const a=e.reduce(((t,e)=>e<t?e:t),e[0]),s=e.reduce(((t,e)=>e>t?e:t),e[0]),[i]=a.split("-"),[n]=s.split("-");for(let e=parseInt(i,10);e<=parseInt(n,10);e++)for(let a=1;a<=4;a++){const s="".concat(e,"-").concat(a);Object.keys(t).forEach((e=>{t[e].get(s)||t[e].set(s,{value:0})}))}}else if("YEARWEEK"===e){const e=[];Object.keys(t).forEach((a=>{t[a].forEach(((t,a)=>{e.push(a)}))}));const a=e.reduce(((t,e)=>e<t?e:t),e[0]),s=e.reduce(((t,e)=>e>t?e:t),e[0]),[i]=a.split("-"),[n]=s.split("-");for(let e=parseInt(i,10);e<=parseInt(n,10);e++){const a=st("".concat(e,"-12-31")).isoWeek();for(let s=1;s<=a;s++){const a="".concat(e,"-").concat(s);Object.keys(t).forEach((e=>{t[e].get(a)||t[e].set(a,{value:0})}))}}}this.sortTimeData(t)}},qi=class extends $i{calcStaticOptions(){if(void 0===this.xAxisIndex)throw new a(this.model,"序列没有配置X坐标轴");if(void 0===this.yAxisIndex)throw new a(this.model,"序列没有配置Y坐标轴");const t=super.calcStaticOptions();t.xAxisIndex=this.xAxisIndex,t.yAxisIndex=this.yAxisIndex;const{stack:e,step:s}=this.model;return s&&(t.step="middle"),t}},Qi=class extends $i{calcStaticOptions(){if(void 0===this.xAxisIndex)throw new a(this.model,"序列没有配置X坐标轴");if(void 0===this.yAxisIndex)throw new a(this.model,"序列没有配置Y坐标轴");const t=super.calcStaticOptions();return t.xAxisIndex=this.xAxisIndex,t.yAxisIndex=this.yAxisIndex,this.model,t}},Ji=class extends $i{calcStaticOptions(){const t=super.calcStaticOptions();return t.label.formatter="{b}: {d}%({c})",t.label.position="outer",t}calcSeriesData(t){return Object.keys(t).map((e=>{var a;const s=t.get(e);return{name:e,value:[s.value,null==(a=s.deData)?void 0:a.srfkey]}}))}getSrfkeyByParams(t){return t.value[1]}},Zi=class extends $i{calcStaticOptions(){const t=super.calcStaticOptions();return t.label.formatter="{b}: {d}%({c})",t.label.position="outside",t}calcSeriesData(t){return Object.keys(t).map((e=>{var a;const s=t.get(e);return{name:e,value:[s.value,null==(a=s.deData)?void 0:a.srfkey]}}))}getSrfkeyByParams(t){return t.value[1]}},tn=class extends $i{calcStaticOptions(){if(void 0===this.xAxisIndex)throw new a(this.model,"序列没有配置X坐标轴");if(void 0===this.yAxisIndex)throw new a(this.model,"序列没有配置Y坐标轴");const t=super.calcStaticOptions();return t.xAxisIndex=this.xAxisIndex,t.yAxisIndex=this.yAxisIndex,t}},en=class extends $i{calcStaticOptions(){return super.calcStaticOptions()}calcRadarCoordSystem(t){const e=this.calcGroupData(t);this.chartGenerator.radarMap.has(this.catalogField)||this.chartGenerator.radarMap.set(this.catalogField,new class{constructor(t){this.indicator={},this.index=t}get indicatorKeys(){return this._indicatorKeys&&this._indicatorKeys.length===Object.keys(this.indicator).length||(this._indicatorKeys=Object.keys(this.indicator).sort()),this._indicatorKeys}updateIndicator(t,e){const a=this.indicator[t];(!a||a.max<e)&&(this.indicator[t]={max:e})}toOptions(){const t=Math.max(...Object.values(this.indicator).map((t=>t.max)));return{indicator:this.indicatorKeys.map((e=>({name:e,max:t})))}}}(this.chartGenerator.radarMap.size));const a=this.chartGenerator.radarMap.get(this.catalogField);Object.values(e).forEach((t=>{Object.keys(t).forEach((e=>{a.updateIndicator(e,t.get(e).value)}))}))}calcByData(t){const e=this.groupData,a=this.chartGenerator.radarMap.get(this.catalogField),s=Object.keys(e).map((t=>{const s=e[t],i=a.indicatorKeys.map((t=>s.has(t)?s.get(t):0));return{name:t===Yi?this.seriesName:t,value:i}}));let i={...this.staticOptions,data:s};return this.seriesUserParam&&(i=at(i,this.seriesUserParam)),i}getSrfkeyByParams(t){return t.value[1]}};function an(t){const e={};return t&&Object.keys(t).forEach((a=>{const s=a.indexOf(".");if(-1===s)return;const i=a.slice(s+1);if(i)try{e[i]=JSON.parse(t[a])}catch(s){e[i]=t[a]}})),e}var sn=t("ChartService",class extends ui{}),nn=(t("ChartController",class extends Hi{initState(){super.initState(),this.state.size=1e3}async onCreated(){await super.onCreated(),this.service=new sn(this.model),await this.service.init(this.context),this.generator=new class{constructor(t){this.model=t,this.staticOptions={tooltip:{show:!0}},this.options={},this.seriesGenerators=[],this.radarMap=new Map,this.codeListMap=new Map;const{dechartTitle:e,dechartLegend:a,chartXAxises:s,chartYAxises:i,userParam:n}=t;e&&(this.staticOptions.title=this.calcTitleOption(e)),a&&(this.staticOptions.legend=this.calcLegendOption(a)),(null==s?void 0:s.length)&&(this.staticOptions.xAxis=this.calcXYAxisOption(s)),(null==i?void 0:i.length)&&(this.staticOptions.yAxis=this.calcXYAxisOption(i)),n&&(this.chartUserParam=an(n))}initSeriesGenerators(){var t;null==(t=this.model.dechartSerieses)||t.forEach((t=>{let e;switch(t.seriesType){case"line":e=new qi(t,this);break;case"bar":e=new Qi(t,this);break;case"scatter":e=new tn(t,this);break;case"pie":e=new Zi(t,this);break;case"funnel":e=new Ji(t,this);break;case"radar":e=new en(t,this);break;default:ibiz.log.error("图表暂未支持序列类型".concat(t.seriesType))}e&&this.seriesGenerators.push(e)}))}calcTitleOption(t){const{showTitle:e,title:a,subTitle:s,titlePos:i}=t,n={show:e,text:a,subtext:s,left:"center"},r=null==i?void 0:i.toLowerCase();return"left"===r||"right"===r?n.left=r:"bottom"!==r&&"top"!==r||(n.top=r),n}calcLegendOption(t){var e;const{showLegend:a,legendPos:s}=t,i={};i.show=a,1===(null==(e=this.model.dechartSerieses)?void 0:e.length)&&(i.show=!1);const n=null==s?void 0:s.toLowerCase();return"left"===n||"right"===n?(i.left=n,i.top="middle",i.orient="vertical"):"bottom"===n&&(i.top=n),i}calcXYAxisOption(t){const e=[];return t.forEach((t=>{const{position:a,dataShowMode:s,userParam:i}=t;let n={type:t.echartsType,name:t.caption,max:t.maxValue,min:t.minValue,position:a,axisLabel:{formatter:t=>1===s?t.length>4?"".concat(t.slice(0,4).split("").join("\n"),"\n..."):t.split("").join("\n"):2===s&&t.length>4?"".concat(t.slice(0,4),"..."):t,rotate:3===s?45:0}};i&&(n=at(n,an(i))),e.push(n)})),e}async init(t,e){await this.loadCodeList(t,e),this.entity=await ibiz.hub.getAppDataEntity(this.model.appDataEntityId),this.initSeriesGenerators()}getFieldKey(t){const e=this.entity.appDEFields.find((e=>e.name===t));return e?e.codeName.toLowerCase():t.toLowerCase()}async loadCodeList(t,e){var a;if(this.codeListMap.clear(),!(null==(a=this.model.dechartSerieses)?void 0:a.length))return;const s=ibiz.hub.getApp(t.srfappid),i=async a=>{if(!a||this.codeListMap.has(a))return;const i=await s.codeList.get(a,t,e);this.codeListMap.set(a,i)};await Promise.all(this.model.dechartSerieses.map((async t=>{const{seriesCodeListId:e,catalogCodeListId:a}=t;await i(e),await i(a)})))}calcOptionsByData(t){this.radarMap.clear(),this.options={series:[],radar:[]},this.seriesGenerators.forEach((e=>{"radar"===e.model.seriesType&&e.calcRadarCoordSystem(t)})),this.radarMap.size&&(this.options.radar=[...this.radarMap.values()].map((t=>t.toOptions())));const e=[];return this.seriesGenerators.forEach((a=>{const s=a.calcByData(t);s instanceof Array?e.push(...s):e.push(s)})),this.options.series=e,this.options=at(this.staticOptions,this.options),this.chartUserParam&&(this.options=at(this.options,this.chartUserParam)),this.options}getSrfkeyByParams(t){const a=this.seriesGenerators[t.seriesIndex];if(!a)throw new e("找不到".concat(t.seriesIndex,"序列的generator!"));return a.getSrfkeyByParams(t)}}(this.model),await this.generator.init(this.context,this.params),window.addEventListener("resize",this.resizeChart)}async afterLoad(t,e){const a=await super.afterLoad(t,e);return e.forEach((t=>{Object.assign(t,{srfcount:1})})),this.calcOptions(),a}initChart(t){this.chart=t,this.chart.on("click",(t=>{const e=this.generator.getSrfkeyByParams(t),a=this.state.items.find((t=>t.srfkey===e));console.log("实体数据",a)}))}calcOptions(t=this.state.items){this.options=this.generator.calcOptionsByData(t),this.updateChart()}updateChart(){if(!this.chart)throw new e("chart对象没有正确初始化");if(!this.options)throw new e("options还没计算");this.chart.setOption(this.options),this.resizeChart()}resizeChart(){this.chart&&this.chart.resize()}async onDestroyed(){var t;window.removeEventListener("resize",this.resizeChart),await super.onDestroyed(),null==(t=this.chart)||t.dispose()}}),t("CaptionBarController",class extends Gi{initState(){super.initState(),this.view.model.capLanguageRes?this.state.caption=ibiz.i18n.t(this.view.model.capLanguageRes.lanResTag,this.view.model.caption):this.state.caption=this.view.model.caption}async onCreated(){await super.onCreated(),this.view.evt.on("onViewInfoChange",(({caption:t,dataInfo:e})=>{this.state.caption="".concat(this.view.model.caption).concat(e?"-".concat(e):"")}))}}),class{}),rn=class extends nn{constructor(t){super(),this.model=t,this.srcParam=t.srcLogicParamId,this.dstParam=t.dstLogicParamId}get dstField(){return this.model.dstFieldName.toLowerCase()}get op(){return this.model.condOP}get type(){return this.model.paramType}get value(){return this.model.paramValue}test(t,e,i){const n=t.params[this.dstParam];switch(this.type){case"ENTITYFIELD":{if(!this.value)throw new a(this.model,"当前条件值类型为[数据对象属性],缺少配置条件值");const t=null!=i[this.value]?i[this.value]:e[this.value];return ra(n[this.dstField],this.op,t)}case"SRCENTITYFIELD":{if(!this.value)throw new a(this.model,"当前条件值类型为[源数据对象属性],缺少配置条件值");const e=t.params[this.srcParam];return ra(n[this.dstField],this.op,e[this.value])}case"CURTIME":throw new s(this.model,"暂未支持条件值类型为[当前时间]");default:return ra(n[this.dstField],this.op,this.value)}}},on=class t extends nn{constructor(e){super(),this.model=e;const a=e.deuilogicLinkConds||[];this.conds=a.map((e=>"SINGLE"===e.logicType?new rn(e):new t(e)))}get op(){return this.model.groupOP}get notMode(){return!0===this.model.notMode}test(t,e,s){let i=!0;if(0===this.conds.length)throw new a(this.model,"界面连接条件逻辑组未配置逻辑项");for(let a=0;a<this.conds.length;a++){const n=this.conds[a].test(t,e,s);if("AND"===this.op&&!1===n){i=!1;break}if("OR"===this.op&&!0===n){i=!0;break}}return this.notMode?!i:i}},cn=class{constructor(t){this.model=t,this.links=(t.deuilogicLinks||[]).map((t=>new class{constructor(t){this.model=t,this.srcNode=null,this.dstNode=null,this.groupCond=null;const{linkMode:e,deuilogicLinkGroupCond:a}=this.model;0===e&&a&&(this.groupCond=new on(a))}async exec(t){const{linkMode:e}=this.model,{context:a,data:i}=t;switch(e||0){case 0:return!this.groupCond||this.groupCond.test(t,a,i&&i.length>0?i[0]:{});case 1:return!0;case 2:throw new s(this.model,"未支持的逻辑连接类型: 异步结束");case 3:throw new s(this.model,"未支持的逻辑连接类型: 异步拒绝");case 9:throw new s(this.model,"未支持的逻辑连接类型: 异常处理");default:throw new s(this.model,"未支持的逻辑连接类型:".concat(e))}}}(t)))}},ln=class extends cn{async exec(t){const{dstAppDataEntityId:e,dstAppDEActionId:s,dstDEUILogicParamId:i,retDEUILogicParamId:n}=this.model;if(!e)throw new a(this.model,"未指定应用实体");if(!s)throw new a(this.model,"未指定实体行为");const r=t.params[i],o=ibiz.hub.getApp(t.context.srfappid),c=await o.deService.exec(e,s,t.context,r,t.viewParams);c.ok&&(t.params[n]=c.data)}},hn=class extends cn{async exec(t){const{dstAppDEUIActionId:e,dstDEUILogicParamId:s}=this.model,{data:i,parameters:n}=t;if(!e)throw new a(this.model,"未配置界面行为");let r=[i];if(s){const e=t.params[s];r=e instanceof Array?e:[e]}await Dn.execAndResolved(e,{...n,data:r})}},dn=class extends cn{async exec(t){}},un=class extends cn{async exec(t){t.isEndNode=!0;const{returnType:e,rawValue:a,returnParamId:i}=this.model;switch(e){case"NONEVALUE":t.result=void 0;break;case"NULLVALUE":t.result=null;break;case"SRCVALUE":t.result=a;break;case"LOGICPARAM":t.result=t.params[i];break;default:throw new s(this.model,"暂未支持的结束节点返回值类型: ".concat(e))}}};function pn(t,e){const{srcDEUILogicParamId:a,srcFieldName:i,srcValue:n}=e,r=e.srcValueType||"SRCDLPARAM";let o;switch(r){case"SRCDLPARAM":o=t.params[a];break;case"NULLVALUE":return null;case"NONEVALUE":return;case"SRCVALUE":return n;case"VIEWPARAM":o=t.viewParams;break;case"APPDATA":o=t.context;break;case"ENVPARAM":o=J(ibiz.env);break;default:throw new s(e,"暂未支持源值类型".concat(r))}const c=null==i?void 0:i.toLowerCase();return o&&c&&(o=o[c]),o}var mn=class extends cn{async exec(t){const e=this.model.deuilogicNodeParams;(null==e?void 0:e.length)&&await Promise.all(e.map((e=>{if("SETPARAMVALUE"===e.paramAction)return this.setParamValue(e,t);throw new s(e,"暂未支持逻辑处理参数操作".concat(e.paramAction))})))}setParamValue(t,e){const{dstFieldName:a,dstDEUILogicParamId:s}=t,i=null==a?void 0:a.toLowerCase(),n=pn(e,t);i?e.params[s][i]=n:e.params[s]=n}},fn=class extends cn{async exec(t){t.isEndNode=!0;const{invokeMethod:s,invokeCtrlId:i,invokeParamId:n}=this.model;if(!i)throw new a(this.model,"没有配置界面对象");if(!n)throw new a(this.model,"没有配置操作参数");if(!s)throw new a(this.model,"没有配置调用方法");const r=t.params[n];if(!r)throw new e("没有找到操作参数".concat(n));const o=t.params[i];if(!o)throw new e("没有找到界面对象".concat(i));if(!o[s]||!M(o[s]))throw new e("没有找到调用方法".concat(s));await o[s](r)}},gn=class extends cn{async exec(t){const{dstDEUILogicParamId:e,srcDEUILogicParamId:s}=this.model;if(!e||!s)throw new a(this.model,"缺少目标参数对象或者源参数对象配置");const i=pn(t,this.model);t.params[e]=i}},En=class extends cn{constructor(){super(...arguments),this.typeMap={INFO:"info",QUESTION:"success",WARNING:"warning",ERROR:"error"}}async exec(t){const{msgBoxType:e,buttonsType:i,msgBoxParamId:n}=this.model;if(!e)throw new a(this.model,"缺少消息类型的配置");if(!i)throw new a(this.model,"缺少按钮类型的配置");let{title:r}=this.model,{message:o}=this.model;if(n){const e=t.params[n];e.title&&(r=e.title),e.message&&(o=e.message)}const c={type:this.typeMap[e],title:r||"消息",desc:o};let l=[];switch(i){case"YESNO":c.confirmButtonText="是",c.cancelButtonText="否",c.showConfirmButton=!0,c.showCancelButton=!0,l=["yes","no"];break;case"OK":c.confirmButtonText="确定",c.showConfirmButton=!0,c.showCancelButton=!1,l=["ok"];break;case"OKCANCEL":c.confirmButtonText="确定",c.cancelButtonText="取消",c.showConfirmButton=!0,c.showCancelButton=!0,l=["ok","cancel"];break;default:throw new s(this.model,"".concat(i,"暂未支持"))}const h=await ibiz.modal.confirm(c);t.setLastReturn(l[h?0:1])}},wn=class extends cn{async exec(t){const{dstDEUILogicParamId:e,name:s}=this.model;if(!e)throw new a(this.model,"缺少目标参数对象配置");const i=t.params[e];console.log("逻辑节点".concat(s,"操作参数值:"),i)}},vn=class{constructor(t){var e;if(this.model=t,this.nodes=new Map,this.params=new Map,!(null==(e=t.deuilogicNodes)?void 0:e.length))throw new a(t,"界面逻辑没有配置逻辑节点");t.deuilogicNodes.forEach((t=>{const{logicNodeType:e}=t;let a;switch(e){case"BEGIN":a=new dn(t);break;case"END":a=new un(t);break;case"DEACTION":a=new ln(t);break;case"DEUIACTION":a=new hn(t);break;case"PREPAREJSPARAM":a=new mn(t);break;case"BINDPARAM":a=new gn(t);break;case"VIEWCTRLINVOKE":a=new fn(t);break;case"MSGBOX":a=new En(t);break;case"DEBUGPARAM":a=new wn(t);break;default:throw new s(t,"未支持的逻辑节点类型: ".concat(e))}this.nodes.set(t.id,a)})),t.deuilogicParams.forEach((t=>{this.params.set(t.id,new class{constructor(t){this.model=t}calc(t){const e=this.model.id,i=this.model,{context:n,viewParams:r,data:o,parameters:c}=t,l=ibiz.hub.getApp(n.srfappid);if(i.default)t.params[e]=o&&o.length>0?o[0]:{};else if(i.activeContainerParam)t.params[e]=c.ctrl||c.view;else if(i.activeCtrlParam)t.params[e]=c.ctrl;else if(i.ctrlParam){const s=c.view.getController(i.codeName.toLowerCase());if(!s)throw new a(this.model,"视图逻辑初始化参数,未找到".concat(i.codeName,"指定部件对象"));t.params[e]=s}else if(i.activeViewParam)t.params[e]=c.view;else if(i.appGlobalParam)t.params[e]=ibiz.env;else if(i.applicationParam)t.params[e]=l;else if(i.entityListParam)t.params[e]=[];else{if(i.entityPageParam)throw new s(i,"未支持的逻辑参数类型: 分页查询结果");if(i.entityParam)t.params[e]={};else if(i.lastReturnParam)t.initLastReturnParam(e);else if(i.navContextParam)t.params[e]=n;else{if(i.navViewParamParam)throw new s(i,"未支持的逻辑参数类型: 视图路由参数");if(i.routeViewSessionParam)throw new s(i,"未支持的逻辑参数类型: 路由视图会话");if(i.simpleListParam)t.params[e]=[];else if(i.simpleParam)t.params[e]={};else if(i.viewNavDataParam)t.params[e]=r;else if(i.viewSessionParam)throw new s(i,"未支持的逻辑参数类型: 当前视图会话")}}}renew(t){const e=this.model.id,a=this.model;if(a.entityListParam||a.simpleListParam||a.entityPageParam)t.params[e]=[];else{if(!a.simpleParam&&!a.entityParam)throw new s(a,"未支持的逻辑参数类型重新建立变量");t.params[e]={}}}}(t))})),this.nodes.forEach((t=>{t.links.forEach((e=>{e.srcNode=t,this.nodes.has(e.model.dstDEUILogicNodeId)&&(e.dstNode=this.nodes.get(e.model.dstDEUILogicNodeId))}))}))}initLogicParams(t){this.params.forEach((e=>{e.model.default&&(t.defaultParamName=e.model.id),e.calc(t)}))}async exec(t){const e=new class{constructor(t,e){this.deLogicParams=t,this.parameters=e,this.params={},this.result=null,this.isEndNode=!1,this.defaultParamName="Default"}get context(){return this.parameters.context}get data(){return this.parameters.data}get viewParams(){return this.parameters.params}resetParam(t){var e;null==(e=this.deLogicParams.get(t))||e.calc(this)}renewParam(t){var e;null==(e=this.deLogicParams.get(t))||e.renew(this)}setLastReturn(t){this.lastReturn=t}initLastReturnParam(t){Object.defineProperty(this.params,t,{enumerable:!0,configurable:!0,get:()=>this.lastReturn})}}(this.params,t);this.initLogicParams(e);const{startDEUILogicNodeId:s}=this.model;if(!s||!this.nodes.has(s))throw new a(this.model,"未设置起始节点");{const t=this.nodes.get(s);await this.deepExec(t,e)}return e.isEndNode?e.result:e.params[e.defaultParamName]?e.params[e.defaultParamName]:null}async deepExec(t,e){await t.exec(e);const{links:a}=t;for(let s=0;s<a.length;s++){const i=a[s];if(await i.exec(e)&&i.dstNode&&(await this.deepExec(i.dstNode,e),!1===t.model.parallelOutput))break}}},yn=new Map;async function In(t,a,s){const i=ibiz.hub.getApp(s.context.srfappid),n=await i.getDEUILogic(t,a);if(!n)throw new e("找不到实体".concat(a,"的界面逻辑").concat(t));yn.has(n)||yn.set(n,new vn(n));const r=yn.get(n);return await r.exec(s),null}var Dn=t("UIActionUtil",class{static async exec(t,a){const s=await $e(t);if(!s)throw new e("没找到".concat(t,"的界面行为模型"));return(await ls(s)).exec(s,a)}static async execAndResolved(t,e){var a,s;const i=await this.exec(t,e);if(i.closeView)e.view.modal.ignoreDismissCheck=!0,e.view.closeView({ok:!0});else if(i.refresh)switch(i.refreshMode){case 1:await e.view.callUIAction("Refresh");break;case 2:await(null==(a=e.view.parentView)?void 0:a.callUIAction("Refresh"));break;case 3:await(null==(s=e.view.getTopView())?void 0:s.callUIAction("Refresh"))}}}),Cn=class{async exec(t,e){const{context:s,params:i,data:n}=e,r={refresh:t.reloadData,refreshMode:t.refreshMode,closeView:t.closeEditView},{appDEUILogicId:o,appDataEntityId:c,uilogicAttachMode:l}=t;if("REPLACE"===l){if(!o)throw new a(t,"没有配置实体界面逻辑");return await In(o,c,e),r}if(!await this.isConfirm(t))return this.returnError(r);const h=await this.execAction(t,e);if(Object.assign(r,h),!0===r.cancel)return this.returnError(r);const d=await this.doNextAction(t,{...e,context:r.nextContext||s,data:r.data||n,params:r.nextParams||i});if(d&&(Object.assign(r,d),!0===d.cancel))return this.returnError(r);if("AFTER"===t.uilogicAttachMode){if(!o)throw new a(t,"没有配置实体界面逻辑");await In(o,c,e)}return r}returnError(t){return Object.assign(t,{refresh:!1,closeView:!1})}async isConfirm(t){return!t.enableConfirm||!t.confirmMsg||ibiz.modal.confirm({title:t.confirmMsg})}async doNextAction(t,e){const a=t.nextId;if(a)return Dn.exec(a,e)}async handleParams(t,e,a,s){let i=[];const n=ze(t.appDataEntityId);switch(t.actionTarget){case"NONE":i=[];break;case"SINGLEDATA":i=[a[0]];break;case"MULTIDATA":i=a;break;case"MULTIKEY":i=n&&a.length>0?a.map((t=>({[n]:t.srfkey||t[n]}))):[{}];break;case"SINGLEKEY":{const t=a[0]||{};i=n?[{[n]:t.srfkey||t[n]}]:[{}]}}const r=e.clone(),o=[...t.navigateContexts||[]];if(n&&"NONE"!==t.actionTarget){const{valueItem:e,paramItem:a}=t,s=a||n,i=e||"srfkey";o.unshift({key:s,value:i,rawValue:!1})}const c=["MULTIKEY","MULTIDATA"].includes(t.actionTarget)&&a.length>0,l=Le(o,e,s,c?Me(o,a):a[0]||{});Object.assign(r,l);const h=t.navigateParams;return{resultContext:r,resultData:i,resultParams:Le(h,r,s,c?Me(h,a):a[0]||{})}}},bn=t("BackendUIActionProvider",class extends Cn{async execAction(t,e){const{context:s,params:i,data:n,event:r}=e,o={},c=t.appDataEntityId,l=t.appDEMethodId;if(!c||!l)throw new a(t,"未配置实体或实体行为");const{resultContext:h,resultParams:d,resultData:u}=await this.handleParams(t,s,n,i),p={...d},m=t.frontAppViewId;if(m){const t=await ibiz.commands.execute(Oa.TAG,m,h,d,{event:r});if(!(null==t?void 0:t.ok))return o.cancel=!0,o;(null==t?void 0:t.ok)&&t.data&&(0===u.length&&u.push({}),u.forEach((e=>{e.srfactionparam=t.data})))}const f=ibiz.hub.getApp(null==s?void 0:s.srfappid),g=u.map((t=>{var e;return(null==(e=t.getOrigin)?void 0:e.call(t))||t||{}})).map((t=>Object.assign(t,p))),E=["MULTIKEY","MULTIDATA"].includes(t.actionTarget),w=await f.deService.exec(c,l,h,E?g:g[0],p);return w.ok&&t.successMsg&&ibiz.message.success(t.successMsg),Object.assign(o,{data:U(w.data)?w.data:[w.data],nextContext:h,nextParams:p}),o}}),An=t("SysUIActionProvider",class extends Cn{constructor(){super(...arguments),this.predefinedActionMap=new Map([["EDITVIEW_EXITACTION","Exit"],["EDITVIEW_SAVEANDEXITACTION","SaveAndExit"],["TREEVIEW_REFRESHPARENTACTION","RefreshParent"],["GRIDVIEW_EXPORTXMLACTION","ExportModel"],["GRIDVIEW_EXPORTACTION","ExportExcel"],["EDITVIEW_REMOVEANDEXITACTION","RemoveAndExit"],["GRIDVIEW_PRINTACTION","Print"],["EDITVIEW_NEXTRECORDACTION","NextRecord"],["GRIDVIEW_NEWROWACTION","NewRow"],["EDITVIEW_LASTRECORDACTION","LastRecord"],["EDITVIEW_PREVRECORDACTION","PrevRecord"],["GRIDVIEW_SEARCHBAR","ToggleFilter"],["EDITVIEW_SAVEANDSTARTWFACTION","SaveAndStart"],["EDITVIEW_NEWACTION","New"],["EDITVIEW_PRINTACTION","Print"],["EDITVIEW_COPYACTION","Copy"],["EDITVIEW_HELPACTION","Help"],["EDITVIEW_FIRSTRECORDACTION","FirstRecord"],["GRIDVIEW_REFRESHACTION","Refresh"],["EDITVIEW_SAVEANDNEWACTION","SaveAndNew"],["EDITVIEW_VIEWWFSTEPACTORACTION","ViewWFStep"],["EDITVIEW_SAVEACTION","Save"],["TREEVIEW_REFRESHALLACTION","RefreshAll"],["GRIDVIEW_IMPORTBAR","Import"],["GRIDVIEW_ROWEDITACTION","ToggleRowEdit"],["GRIDVIEW_NEWACTION","New"],["GRIDVIEW_EDITACTION","Edit"],["GRIDVIEW_HELPACTION","Help"],["EDITVIEW_REFRESHACTION","Refresh"],["GRIDVIEW_REMOVEACTION","Remove"],["GRIDVIEW_COPYACTION","Copy"],["GRIDVIEW_VIEWACTION","View"],["GRIDVIEW_SAVEROWACTION","SaveRow"],["APP_LOGIN","login"],["APP_LOGOUT","logout"]])}async execAction(t,e){const{view:a}=e,s=this.predefinedActionMap.get(t.predefinedType)||t.uiactionTag;if("Exit"===s)return{closeView:!0};return await a.callUIAction(s,e)||{}}}),Pn=t("FrontUIActionProvider",class extends Cn{async execAction(t,e){const{context:i,params:n,data:r,event:o,noWaitRoute:c}=e;let l={};switch(t.frontProcessType){case"OPENHTMLPAGE":{const e=p.fill(t.htmlPageUrl,i,null==r?void 0:r[0]);window.open(e,"_blank");break}case"TOP":case"WIZARD":{const e=t.frontAppViewId;if(!e)throw new a(t,"未配置打开视图");const{resultContext:s,resultParams:h}=await this.handleParams(t,i,r,n),d=await ibiz.commands.execute(Oa.TAG,e,s,h,{event:o,noWaitRoute:c});(null==d?void 0:d.ok)||(l.cancel=!0),(null==d?void 0:d.ok)&&d.data&&(l.data=d.data,l.nextContext=s,l.nextParams={...n,...h});break}case"OTHER":l=this.doOther(t,e);break;default:throw new s(t,"未支持的前台处理模式[".concat(t.frontProcessType,"]"))}return l}doOther(t,e){const{scriptCode:s}=t,{context:i,params:n,data:r,event:o}=e;if(s){return pa.execScriptFn({context:i,params:n,data:r,el:null==o?void 0:o.target},s)||{}}throw new a(t,"自定义类型缺少配置脚本代码")}}),_n=t("WFWithdrawUIActionProvider",class extends Cn{async execAction(t,e){const{view:a}=e;let s=!1;return await ibiz.modal.confirm({title:"提示",desc:"是否确认执行撤回操作?"})&&a&&(await a.call("WFWithdraw",e),s=!0),{refresh:!1,closeView:s}}});function Sn(){const t=new Pn;os("FRONT",(()=>t));const e=new bn;os("BACKEND",(()=>e));const a=new An;os("SYS",(()=>a));const s=new _n;os("DEUIACTION_WFWithdraw",(()=>s))}var xn=t("ToolbarController",class extends Gi{get _evt(){return this.evt}initState(){super.initState(),this.state.buttonsState=new Ni,this.state.viewMode="EMBED",this.state.extraButtons={}}async doUIAction(t,e,a={}){if("DEUIACTION"===t.itemType){const s=t.uiactionId,i=await this.ctx.view.call("GetData")||[],n=this.getEventArgs();n.params=Object.assign(a,n.params),await Dn.execAndResolved(s,{...n,data:i,event:e})}}async onCreated(){await super.onCreated(),this.state.viewMode=this.ctx.view.modal.mode,m(this.model,(t=>{if("DEUIACTION"===t.itemType){const e=t,a=new Oi(e.id,this.context.srfappid,e.uiactionId);this.state.buttonsState.addState(e.id,a)}}),{childrenFields:["detoolbarItems"]}),await this.state.buttonsState.update()}async onItemClick(t,e,a){this.state.buttonsState.setLoading(t.id);const s="extra"===t.buttonType;try{await this._evt.emit("onClick",{event:e,eventArg:t.id,buttonType:s?"extra":"deuiaction"}),s||await this.doUIAction(t,e,a)}finally{this.state.buttonsState.setLoading("")}}async calcButtonState(t,e){let a=t;t&&t instanceof hi&&(a=t.getOrigin()),await this.state.buttonsState.update(a,e),this.scheduler&&a&&m(this.model,(t=>{const e=this.state.buttonsState[t.id];if(e.visible){const s=this.scheduler.triggerItemVisible(t.id,{data:[a]});void 0!==s&&(e.visible=s)}if(!e.disabled){const s=this.scheduler.triggerItemEnable(t.id,{data:[a]});void 0!==s&&(e.disabled=!s)}}),{childrenFields:["detoolbarItems"]})}setExtraButtons(t,e){this.state.extraButtons[t]||(this.state.extraButtons[t]=[]),this.state.extraButtons[t].push(...e)}clearExtraButtons(t){void 0===t?this.state.extraButtons={}:this.state.extraButtons[t]=[]}initControlScheduler(t=[]){const e=[...t];m(this.model,(t=>{t.controlLogics&&e.push(...t.controlLogics)}),{childrenFields:["detoolbarItems"]}),super.initControlScheduler(e)}}),Tn=t("ContextMenuController",class extends xn{}),Ln=(t("DashboardController",class extends Gi{constructor(){super(...arguments),this.providers={},this.portlets={}}initState(){super.initState()}async onCreated(){await super.onCreated(),await this.initPortlets(this.model.controls);const{appDataEntityId:t}=this.view.model;t&&this.view.evt.on("onDataChange",(t=>{const e=ki(t.data);e&&this.dataChangeNotify(e)}))}async initPortlets(t,e){(null==t?void 0:t.length)&&await Promise.all(t.map((async t=>{var a;const s=await ms(t);if(s){this.providers[t.id]=s;const i=await s.createController(t,this,e);this.portlets[t.id]=i,(null==(a=t.controls)?void 0:a.length)&&await this.initPortlets(t.controls,i)}})))}async dataChangeNotify(t){const e=await Promise.allSettled(Object.values(this.portlets).map((async e=>e.dataChangeNotify(t)))),a=e.find((t=>"rejected"===t.status));if(a)throw ibiz.log.error("dataChangeNotify报错",e),a.reason}}),t("PortletPartState",class{constructor(){this.visible=!0,this.keepAlive=!1,this.layout={width:"",height:"",extraStyle:{},extraClass:[],contentStyle:{}},this.class={container:[],containerDyna:[]},this.actionGroupState=null}})),On=t("PortletPartController",class{get context(){return this.dashboard.context}get params(){return this.dashboard.params}get containerClass(){return[...this.state.class.container,...this.state.class.containerDyna]}constructor(t,e,a){this.model=t,this.dashboard=e,this.parent=a,this.state=this.createState()}async init(){await this.onInit()}async onInit(){const{layoutPos:t,sysCss:e}=this.model;if(t){const{width:t,height:e}=We(this.model);this.state.layout.width="".concat(t),this.state.layout.height="".concat(e)}(null==e?void 0:e.cssName)&&this.state.class.container.push(e.cssName),await this.initActionStates()}createState(){return new Ln}async initActionStates(){var t;const{uiactionGroup:e}=this.model;if(!(null==(t=null==e?void 0:e.uiactionGroupDetails)?void 0:t.length))return;const a=new Ni;e.uiactionGroupDetails.forEach((t=>{const e=t.uiactionId;if(e){const s=new Oi(t.id,this.dashboard.context.srfappid,e);a.addState(t.id,s)}})),await a.update(),this.state.actionGroupState=a;const{appDataEntityId:s}=this.dashboard.view.model;s&&this.dashboard.view.evt.on("onDataChange",(t=>{let e=t.data[0];e&&e instanceof hi&&(e=e.getOrigin()),e&&this.state.actionGroupState.update(e,s)}))}async onActionClick(t,e,a=[]){const s=t.uiactionId;await Dn.execAndResolved(s,{context:this.dashboard.context,params:this.dashboard.params,data:a,view:this.dashboard.view,event:e})}async dataChangeNotify(t){if(this.state.actionGroupState){const{appDataEntityId:e}=this.dashboard.view.model;this.state.actionGroupState.update(t,e)}this.calcDynaClass(t)}calcDynaClass(t){if(this.model.dynaClass){const e=Be(this.model.dynaClass,t);e.length&&(this.state.class.containerDyna=e)}}}),Nn=(t("ContainerPortletController",class extends On{}),t("ViewPortletController",class extends On{}),t("DataViewControlService",class extends ui{initUIDataMap(){var t;super.initUIDataMap(),null==(t=this.model.dedataViewDataItems)||t.forEach((t=>{const e=t.id.toLowerCase(),a=t.appDEFieldId;let s;if(a){const t=a.toLowerCase();s=new yi(e,t,{isOriginField:!0})}else s=new yi(e,e);this.dataUIMap.set(e,s)}))}})),Rn=(t("DataViewControlController",class extends Hi{initState(){super.initState(),this.state.noSort=!0===this.model.noSort}async onCreated(){await super.onCreated(),this.state.size=this.model.pagingSize||20,this.service=new Nn(this.model),await this.service.init(this.context)}async loadMore(){this.state.total>this.state.items.length&&await this.load({isLoadMore:!0})}async afterLoad(t,e){return await this.handleDataGroup(),e}getOptItemModel(){let t=null;const{dedataViewItems:e}=this.model;if(e)for(let a=0;a<e.length;a++)"ACTIONITEM"===e[a].itemType&&(t=e[a]);return t}getOptItemAction(t){var e;const s=new Ni,i=this.getOptItemModel();if(i){if(!i.deuiactionGroup)throw new a(this.model,"操作项没有配置界面行为组");if(!(null==(e=i.deuiactionGroup.uiactionGroupDetails)?void 0:e.length))return ibiz.log.debug("操作项界面行为组没有配置界面行为"),s;i.deuiactionGroup.uiactionGroupDetails.forEach((t=>{const e=t.uiactionId;if(e){const a=new Oi(t.id,this.context.srfappid,e);s.addState(t.id,a)}})),s.update(t.getOrigin())}return s}async onActionClick(t,e,a){const s=t.uiactionId;await Dn.execAndResolved(s,{context:this.context,params:this.params,data:[e],view:this.view,event:a})}async handleDataGroup(){const{enableGroup:t,groupMode:e}=this.model;t&&e&&("AUTO"===e?this.handleAutoGroup():"CODELIST"===e&&await this.handleCodeListGroup())}handleAutoGroup(){const{groupAppDEFieldId:t}=this.model;if(t){const{items:e}=this.state,a=new Map;e.forEach((e=>{const s=a.get(e[t])||[];s.push(e),a.set(e[t],s)}));const s=[];a.forEach(((t,e)=>{s.push({caption:e,children:[...t]})})),this.state.groups=s}}async handleCodeListGroup(){const{groupAppDEFieldId:t,groupCodeListId:e}=this.model;if(t&&e){const{items:a}=this.state,s=[],i=ibiz.hub.getApp(this.context.srfappid),n=await i.codeList.get(e,this.context,this.params),r=[];n.forEach((e=>{const i=a.filter((a=>a[t]===e.value));s.push({caption:e.text,children:[...i]}),r.push(e.value)}));const o=a.filter((e=>-1===r.indexOf(e[t])));o.length>0&&s.push({caption:"其他",children:[...o]}),this.state.groups=s}}setSort(t,e){if(t&&e)super.setSort(t,e);else{const{minorSortAppDEFieldId:t,minorSortDir:e}=this.model;if(t&&e){const a=this.fieldIdNameMap.get(t);this.state.sortQuery="".concat(a.toLowerCase(),",").concat(e.toLowerCase())}else this.state.sortQuery=""}}}),t("ExpBarControlController",class extends Gi{constructor(){super(...arguments),this.navKeyName="srfkey"}get _evt(){return this.evt}get routeDepth(){return this.view.modal.routeDepth}initState(){super.initState(),this.state.query=""}load(){return this.xDataController.load({isInitialLoad:!0})}get xDataController(){const t=this.view.getController(this.model.xdataControlName);if(!t)throw new a(this.model,"无法获取多数据部件[".concat(this.model.xdataControlName,"]控制器"));return t}get toolbarController(){return this.view.getController("".concat(this.model.xdataControlName.split("_")[0],"_toolbar"))}get XDataModel(){var t;return null==(t=this.model.controls)?void 0:t.find((t=>t.name===this.model.xdataControlName))}async onCreated(){var t;await super.onCreated(),this.childNames.push(this.model.xdataControlName);const e=await ibiz.hub.getAppDataEntity(this.model.appDataEntityId,this.context.srfappid);if(e){const a=null==(t=e.appDEFields)?void 0:t.filter((t=>t.enableQuickSearch)),s=[];null==a||a.forEach((t=>{(null==t?void 0:t.lnlanguageRes)&&t.lnlanguageRes.lanResTag?s.push(ibiz.i18n.t(t.lnlanguageRes.lanResTag,t.logicName)):(null==t?void 0:t.logicName)&&s.push(t.logicName)})),s.length>0&&(this.state.placeHolder=s.join("、"))}}async onMounted(){super.onMounted(),this.xDataController&&(this.xDataController.evt.on("onActive",(t=>{this.xDataActive(t)})),this.xDataController.evt.on("onLoadSuccess",(t=>{this.xDataLoadSuccess(t)})),this.xDataController.evt.on("onRemoveSuccess",(()=>{this.defaultNavByFirstItem()}))),this.toolbarController&&this.xDataController.evt.on("onSelectionChange",(async t=>{this.toolbarController.calcButtonState(t.data[0],this.model.appDataEntityId)}))}xDataLoadSuccess(t){t.isInitialLoad&&(this.state.srfnav&&this.routeDepth?this.defaultNavBySrfnav():this.defaultNavByFirstItem())}defaultNavBySrfnav(){var t;const e=null==(t=this.xDataController)?void 0:t.state.items.find((t=>t[this.navKeyName]===this.state.srfnav));e&&this.xDataController.setSelection([e]),this._evt.emit("onNavViewChange",{navViewMsg:{key:this.state.srfnav},context:this.context})}defaultNavByFirstItem(){const t=this.xDataController.state.items[0];t?(this.xDataController.setActive(t),this.xDataController.setSelection([t])):this._evt.emit("onNavViewChange",{navViewMsg:{key:""}})}xDataActive(t){const{data:e,context:a,params:s}=t,i=this.getNavViewMsg(e[0],a,s);this._evt.emit("onNavViewChange",{navViewMsg:i})}prepareParams(t,e,a,s){const{navDER:i,navFilter:n,navigateContexts:r,navigateParams:o,appDataEntityId:c}=t,l={deName:c?ze(c):void 0,navFilter:n,pickupDEFName:null==i?void 0:i.pickupDEFName,navContexts:r,navParams:o},h={context:a,params:s,data:e},{resultContext:d,resultParams:u}=Ve(l,h);return{context:Object.assign(a.clone(),d,{currentSrfNav:e[this.navKeyName]}),params:{...u}}}calcViewModelId(){var t;if(["GRID","DATAVIEW","LIST"].includes((null==(t=this.XDataModel)?void 0:t.controlType)||""))return this.XDataModel.navAppViewId;throw new e("多节点视图由子类实现")}getNavViewMsg(t,e,a){const s=this.calcViewModelId(),i=this.prepareParams(this.XDataModel,t,e,a);return{key:t[this.navKeyName],context:i.context,params:i.params,viewId:s}}calcControlHeaderVisible(){const t=!!this.toolbarController;if(!t&&this.layoutPanel){const t=this.layoutPanel.panelItems.control_toolbar;t&&(t.state.visible=!1)}return t||!(!this.model.showTitleBar||!this.model.title)||!!this.model.enableSearch}setLayoutPanel(t){super.setLayoutPanel(t),t.evt.on("onMounted",(()=>{if(!this.calcControlHeaderVisible()){const t=this.layoutPanel.panelItems.control_header;t&&(t.state.visible=!1)}}))}})),Mn=(t("CalendarExpBarController",class extends Rn{constructor(){super(...arguments),this.navKeyName="navId"}getCalendarItemModel(t){const{sysCalendarItems:e}=this.XDataModel;if(e)return e.find((e=>e.itemType===t))}get xDataController(){const t=this.view.getController(this.model.xdataControlName);if(!t)throw new a(this.model,"无法获取多数据部件[".concat(this.model.xdataControlName,"]控制器"));return t}defaultNavBySrfnav(){var t;const e=null==(t=this.xDataController)?void 0:t.state.items.find((t=>t.navId===this.state.srfnav));if(super.defaultNavBySrfnav(),!e)return;const a=new Date(e.beginTime);this.xDataController.setSelectDate(a)}getNavViewMsg(t){const e=this.getCalendarItemModel(t.itemType);if(e){const{context:a,params:s}=this.prepareParams(e,t.deData?t.deData:t,this.context,this.params);return a.currentSrfNav=t.navId,{key:t.navId,context:a,params:s,viewId:e.navAppViewId}}return{key:t.navId,context:this.context,params:this.params}}}),t("TreeExpBarController",class extends Rn{constructor(){super(...arguments),this.navKeyName="id",this.navNodeModelIds=[]}get xDataController(){const t=this.view.getController(this.model.xdataControlName);if(!t)throw new a(this.model,"无法获取多数据部件[".concat(this.model.xdataControlName,"]控制器"));return t}getNodeModel(t){const{detreeNodes:e}=this.XDataModel;let a;return e&&e.forEach((e=>{e.id===t&&(a=e)})),a}xDataActive(t){const{nodeData:e}=t;super.xDataActive({...t,data:[e]})}getNavViewMsg(t,a,s){const i=t.id,n=t.deData||t,r=this.getNodeModel(t.nodeId);if(!r)throw new e("找不到".concat(t.nodeId,"的节点模型"));const o=this.prepareParams(r,n,a,s);return o.context.currentSrfNav=i,{key:i,viewId:r.navAppViewId,...o}}defaultNavByFirstItem(){const t=this.xDataController.state.items.find((t=>!(!this.xDataController.model.rootVisible&&this.xDataController.state.rootNodes.includes(t))&&(!!this.state.noNeedNavView||this.navNodeModelIds.includes(t.nodeId))));t&&(this.xDataController.setActive(t),this.xDataController.setSelection([t]))}async onCreated(){await super.onCreated();const{detreeNodes:t}=this.XDataModel;if(null==t||t.forEach((t=>{t.navAppViewId&&this.navNodeModelIds.push(t.id)})),this.state.srfnav){const t=[];this.state.srfnav.split(":").forEach(((e,a)=>{0===a?t.push(e):t.push("".concat(t[a-1],":").concat(e))})),t.pop(),this.defaultExpandedKeys=t}}}),t("FormController",class extends Gi{constructor(){super(...arguments),this.details={},this.providers={},this.formItems=[]}get _evt(){return this.evt}get data(){return this.state.data}initState(){super.initState(),this.state.data=new hi,this.state.isLoaded=!1,this.state.processing=!1,this.state.modified=!1}async dataChangeNotify(t){const e=await Promise.allSettled(Object.values(this.details).map((async e=>e.dataChangeNotify(t)))),a=e.find((t=>"rejected"===t.status));if(a)throw ibiz.log.error("dataChangeNotify报错",e),a.reason}formStateNotify(t){Object.values(this.details).forEach((e=>{e.formStateNotify(t)}))}async onCreated(){await super.onCreated(),await this.initDetailControllers(),this.dataChangeNotify=f(this.dataChangeNotify.bind(this),((t,e)=>[Array.from(new Set([...t[0],...e[0]]))]),200)}async getDraftParams(){const t={};return await Promise.all(this.formItems.map((e=>e.setDefaultValue(!0,t)))),t}async initDetailControllers(t=this.model.deformPages,e=this,a=void 0){await Promise.all(t.map((async t=>{const s=await Za(t);if(!s)return;e.providers[t.id]=s;const i=await s.createController(t,e,a);e.details[t.id]=i,"FORMITEM"!==t.detailType&&"MDCTRL"!==t.detailType||e.formItems.push(i);const n=ta(t);n.length&&await this.initDetailControllers(n,e,i)})))}getData(){return[this.state.data]}async setDataValue(t,e){if(!Object.prototype.hasOwnProperty.call(this.state.data,t)||Vi(this.state.data[t],e)){this.state.data[t]=e,this.state.processing=!0,this.state.modified=!0,await this._evt.emit("onFormDataChange",void 0);try{await this.dataChangeNotify([t])}finally{this.state.processing=!1}}}async validate(){return-1===(await Promise.all(this.formItems.map((t=>t.validate())))).findIndex((t=>!t))}actionNotification(t,e){super.actionNotification(t,{data:this.data,...e||{}})}})),Vn=t("SearchFormService",class extends di{async getDraft(t,e={}){let a={ok:!0,status:200,data:{...e}};return a=this.handleResponse(a),a}initUIDataMap(){m(this.model,(t=>{if("FORMITEM"===t.detailType){const e=t.id.toLowerCase();this.dataUIMap.set(e,new yi(e,e))}}),{childrenFields:["deformPages","deformDetails"]})}handleResponse(t){const e=super.handleResponse(t);return e.ok&&e.data&&(e.data=this.toUIData(e.data)),e}}),kn=(t("SearchFormController",class extends Mn{async onCreated(){await super.onCreated(),this.service=new Vn(this.model),await this.service.init(this.context),await this.load()}async load(){const t={...this.params},e=await this.getDraftParams();let a;Object.assign(t,e),await this.evt.emit("onBeforeLoadDraft",{params:t});try{a=await this.service.getDraft(this.context,t)}catch(t){throw this.actionNotification("GETDRAFTERROR",{error:t}),t}return this.state.data=a.data,g(this.data,e),this.state.isLoaded=!0,this.formStateNotify("DRAFT"),this.actionNotification("GETDRAFTSUCCESS"),this.data}getParams(){return{...this.data.getOrigin()}}async search(){await this.evt.emit("onSearch",void 0)}async onSearchButtonClick(){await this.search()}async reset(){await this.load(),await this.search()}async dataChangeNotify(t){await super.dataChangeNotify(t),this.model.enableAutoSearch&&this.search()}async onKeyUp(t){const e=t||window.event;e&&"Enter"===e.code&&await this.onSearchButtonClick()}}),t("FormDetailState",class{constructor(t){this.parent=t,this.disabled=!1,this.layout={width:"",height:"",extraStyle:{},extraClass:[],contentStyle:{}},this.class={container:[],containerDyna:[],label:[],labelDyna:[]},this.required=!1,this.showMoreMode=0;let e,a=!0;Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,get(){if(this.parent){if(!1===this.parent.visible)return!1;if(1===this.showMoreMode&&!1===this.parent.isShowMore)return!1}return a},set:t=>(a=t,!0)}),Object.defineProperty(this,"keepAlive",{enumerable:!0,configurable:!0,get(){return void 0!==e?e:!!this.parent&&this.parent.keepAlive},set:t=>(e=t,!0)})}})),Fn=t("FormDetailController",class{get data(){return this.form.data}get containerClass(){return[...this.state.class.container,...this.state.class.containerDyna]}get labelClass(){return[...this.state.class.label,...this.state.class.labelDyna]}constructor(t,e,a){this.model=t,this.form=e,this.parent=a,this.state=this.createState()}async init(){await this.onInit()}async onInit(){this.state.showMoreMode=this.model.showMoreMode;const{layoutPos:t,sysCss:e,labelSysCss:a}=this.model;if(t){const{width:e,height:a}=We(t);this.state.layout.width="".concat(e),this.state.layout.height="".concat(a)}(null==e?void 0:e.cssName)&&this.state.class.container.push(e.cssName),(null==a?void 0:a.cssName)&&this.state.class.label.push(a.cssName)}createState(){var t;return new kn(null==(t=this.parent)?void 0:t.state)}async dataChangeNotify(t){this.calcDynamicLogic(t),this.calcDynaClass(this.data)}async formStateNotify(t){this.calcDynamicLogic([],t),this.calcDynaClass(this.data)}calcDynamicLogic(t,e){var a;this.parent&&!this.parent.state.visible||null==(a=this.model.defdgroupLogics)||a.forEach((a=>{const s=a.relatedDetailNames||[];if(e||E(s,t))try{const t=ga(this.form.data,a);switch(a.logicCat){case"ITEMBLANK":this.state.required=!t;break;case"ITEMENABLE":this.state.disabled=!t;break;case"PANELVISIBLE":this.state.visible=t}}catch(t){ibiz.log.error(t)}}))}force(t){}calcDynaClass(t){if(this.model.dynaClass){const e=Be(this.model.dynaClass,t);e.length&&(this.state.class.containerDyna=e)}if(this.model.labelDynaClass){const e=Be(this.model.labelDynaClass,t);e.length&&(this.state.class.labelDyna=e)}}}),Wn=t("FormButtonState",class extends kn{constructor(){super(...arguments),this.loading=!1}}),Bn=(t("FormButtonController",class extends Fn{createState(){var t;return new Wn(null==(t=this.parent)?void 0:t.state)}get data(){return this.form.data}async onClick(t){this.state.loading=!0;try{"UIACTION"===this.model.actionType&&await this.doUIAction(t),await this.doFormItemUpdate()}finally{this.state.loading=!1}}async doUIAction(t){const e=this.model.uiactionId;await Dn.execAndResolved(e,{context:this.form.context,params:this.form.params,data:[this.data],view:this.form.view,event:t,noWaitRoute:!0})}async doFormItemUpdate(){this.model.deformItemUpdateId&&await this.form.updateFormItem(this.model.deformItemUpdateId)}}),t("FormDruipartState",class extends kn{constructor(){super(...arguments),this.showMask=!1}})),Un=(t("FormDRUIPartController",class extends Fn{constructor(){super(...arguments),this.refreshItems=["srfkey"],this.paramItem="srfkey",this.isNewData=!1}createState(){var t;return new Bn(null==(t=this.parent)?void 0:t.state)}async onInit(){if(await super.onInit(),Object.assign(this.state.layout.extraStyle,{overflow:"auto"}),this.model.refreshItems){let t=this.model.refreshItems.split(";");t=t.filter((t=>!!t)),this.refreshItems.push(...t)}this.model.paramItem&&(this.paramItem=this.model.paramItem)}async dataChangeNotify(t){await super.dataChangeNotify(t),E(this.refreshItems,t)&&this.calcViewParams()}async formStateNotify(t){await super.formStateNotify(t),this.isNewData="DRAFT"===t,this.state.showMask=this.isNewData,"LOAD"!==t&&"DRAFT"!==t||this.calcViewParams()}calcViewParams(){let t=this.form.context.clone();const e=this.model.navigateContexts;V(e)&&(t=Object.assign(t,Le(e,this.form.context,this.form.params,this.form.data)));const a=Le(this.model.navigateParams,this.form.params,this.form.context,this.form.data);if(this.state.viewComponentKey){if(JSON.stringify(this.navContext)!==JSON.stringify(t)||JSON.stringify(this.navParams)!==JSON.stringify(a))this.navContext=t,this.navParams=a,this.force();else if(this.embedView){if(this.isNewData)return;this.embedView.callUIAction("Refresh")}}else this.state.viewComponentKey=B(),this.navContext=t,this.navParams=a}setEmbedView(t){this.embedView=t,this.embedView.evt.on("onMounted",(()=>{this.isNewData||this.embedView.callUIAction("Refresh")})),this.embedView.evt.on("onDataChange",(t=>{["LOAD","LOADDRAFT"].includes(t.actionType)||(ibiz.log.debug("接收到关系界面的数据变更事件",t),this.model.deformItemUpdateId&&this.form.updateFormItem(this.model.deformItemUpdateId))}))}}),t("FormGroupPanelState",class extends kn{constructor(){super(...arguments),this.isShowMore=!1,this.actionGroupState=null}})),jn=t("FormGroupPanelController",class extends Fn{get disableClose(){const{titleBarCloseMode:t}=this.model;return 0===t||void 0===t}get defaultExpansion(){const{titleBarCloseMode:t}=this.model;return this.disableClose||1===t}createState(){var t;return new Un(null==(t=this.parent)?void 0:t.state)}async onInit(){super.onInit(),await this.initActionStates()}async formStateNotify(t){super.calcDynamicLogic([],t),this.state.actionGroupState&&this.state.actionGroupState.update(this.form.data.getOrigin())}async initActionStates(){var t;const{uiactionGroup:e}=this.model;if(!(null==(t=null==e?void 0:e.uiactionGroupDetails)?void 0:t.length))return;const a=new Ni;e.uiactionGroupDetails.forEach((t=>{const e=t.uiactionId;if(e){const s=new Oi(t.id,this.form.context.srfappid,e);a.addState(t.id,s)}})),await a.update(),this.state.actionGroupState=a}async onActionClick(t,e){const a=t.uiactionId;await Dn.execAndResolved(a,{context:this.form.context,params:this.form.params,data:[this.data],view:this.form.view,event:e})}}),zn=t("FormItemState",class extends kn{constructor(t){super(t),this.parent=t,this.error=null,this.enableCondDisabled=!1;let e=!1;Object.defineProperty(this,"disabled",{enumerable:!0,configurable:!0,get(){return!!this.enableCondDisabled||e},set:t=>(e=t,!0)})}}),Gn=(t("FormItemController",class extends Fn{constructor(t,e,a){super(t,e,a),this.rules=[],this.context=e.context,this.params=e.params}createState(){var t;return new zn(null==(t=this.parent)?void 0:t.state)}get name(){return this.model.fieldName||this.model.id}get value(){return this.form.data[this.name]}get valueItemName(){if(this.model.editor)return this.model.editor.valueItemName}get unitName(){return this.model.unitName}get valueFormat(){return this.model.valueFormat}get dataType(){return this.model.dataType}async onInit(){await super.onInit(),this.state.required=!this.model.allowEmpty,this.model.editor&&"HIDDEN"!==this.model.editor.editorType&&(this.editorProvider=await qa(this.model.editor),this.editorProvider&&(this.editor=await this.editorProvider.createController(this.model.editor,this),await this.initRules()))}async initRules(){const t=xa(this.form.model.deformItemVRs||[],this.name);t&&(this.rules=Fi(t,this.name,this.valueItemName),this.validator=new lt({[this.name]:this.rules}))}calcEnableCond(){const{enableCond:t}=this.model,e=0===this.data.srfuf;t?(e&&2===t||!e&&1===t)&&(this.state.enableCondDisabled=!0):this.state.enableCondDisabled=!0}async dataChangeNotify(t){await super.dataChangeNotify(t);const{resetItemNames:e}=this.model;let a=!1;e&&e.length>0&&e.forEach((e=>{t.includes(e)&&(a=!0)})),a&&this.setDataValue(null,this.name),(t.includes(this.name)||t.includes(this.valueItemName))&&this.validate(),t.includes(this.name)&&this.model.deformItemUpdateId&&await this.form.updateFormItem(this.model.deformItemUpdateId)}async formStateNotify(t){super.formStateNotify(t),this.calcEnableCond(),"LOAD"===t&&this.setDefaultValue(!1)}calcDynamicLogic(t,e){this.model.hidden||super.calcDynamicLogic(t,e)}async validate(){if(!this.state.visible)return this.state.error=null,!0;if(this.state.required&&k(this.data[this.name]))return this.state.error="请填写".concat(this.model.caption||""),!1;if(this.validator)try{await this.validator.validate(this.data)}catch({errors:t,_fields:e}){return this.state.error=t[0].message,!1}return this.state.error=null,!0}async setDataValue(t,e){e=e||this.name,await this.form.setDataValue(e,t)}setDefaultValue(t,a=this.data){var i;const{createDVT:n,createDV:r,updateDVT:o,updateDV:c}=this.model,l=t?n:o,h=t?r:c;if("RESET"!==l){if(!(this.value||k(l)&&k(h)))if(l||!h)switch(l){case"APPDATA":Object.prototype.hasOwnProperty.call(this.params,h)&&(a[this.name]=this.params[h]),Object.prototype.hasOwnProperty.call(this.context,h)&&(a[this.name]=this.context[h]);break;case"OPERATORNAME":a[this.name]=this.context.srfusername;break;case"OPERATOR":a[this.name]=this.context.srfuserid;break;case"CURTIME":a[this.name]=st().format(this.model.valueFormat);break;case"PARAM":a[this.name]=this.data[h];break;case"SESSION":case"APPLICATION":if(!(null==(i=ibiz.appData)?void 0:i.context))throw new e("appdata.context不存在");a[this.name]=ibiz.appData.context[h];break;case"CONTEXT":a[this.name]=this.params[h];break;case"UNIQUEID":a[this.name]=B();break;default:throw new s(this.model,"默认值类型[".concat(l,"]未支持"))}else a[this.name]=h}else a[this.name]=null}}),t("FormMDCtrlContentTypeController",class{constructor(t){this.parent=t,this.model=this.parent.model}get data(){return this.parent.state.contentCtrlData}async onInit(){}onDataChange(t){this.parent.state.contentCtrlData=t,this.parent.setFormDataValue()}onDataItemChange(t,e){this.parent.state.contentCtrlData[e]=t,this.parent.setFormDataValue()}onDataRemove(t){t<0||(this.parent.state.contentCtrlData.splice(t,1),this.parent.setFormDataValue())}onDataInsert(t){this.parent.state.contentCtrlData.push(t||{}),this.parent.setFormDataValue()}async initData(){const t=this.model.appDEFieldId||this.model.fieldName||this.model.id;t&&("REPEATER"===this.model.contentType&&"STYLE3"===this.model.detailStyle?this.parent.state.contentCtrlData=this.parent.data[t]||{}:this.parent.state.contentCtrlData=this.parent.data[t]||[])}async validate(){return!0}})),Hn=t("FormMDCtrlControlController",class extends Gn{async onInit(){const{model:t}=this.parent,{contentControl:a}=t;if(!a)throw new e("表单多数据部件未配置嵌入部件");this.controlModel=a;const s=await Ka(this.controlModel);s&&(this.provider=s)}}),Xn=t("FormMDCtrlDataViewController",class extends Hn{constructor(){super(...arguments),this.selectData=[],this.state={isSelect:!1}}onDataViewMounted(t){this.dataViewController=t.ctrl}onSelectionChange(t){this.state.isSelect=t.data.length>0}onDataRemove(){this.dataViewController.remove(),this.parent.state.contentCtrlData=this.dataViewController.state.items,this.parent.setFormDataValue()}onDataChange(t){this.parent.state.contentCtrlData=t,this.parent.setFormDataValue()}async initData(){this.dataViewController.load()}async onDataInsert(){}}),Kn=t("EditFormService",class extends di{async get(t,e={}){var a;let s=await this.exec((null==(a=this.model.getControlAction)?void 0:a.appDEMethodId)||"get",t,void 0,e);return s=this.handleResponse(s),s}async getDraft(t,e={}){var a;let s=await this.exec((null==(a=this.model.getDraftControlAction)?void 0:a.appDEMethodId)||"getdraft",t,void 0,e);return s=this.handleResponse(s),s}async remove(t,e={}){var a;return await this.exec((null==(a=this.model.removeControlAction)?void 0:a.appDEMethodId)||"remove",t,void 0,e)}async create(t,e){var a;const s=e instanceof hi?e.getOrigin():e,i=this.getFilteredData(s);let n=await this.exec((null==(a=this.model.createControlAction)?void 0:a.appDEMethodId)||"create",t,i);return n=this.handleResponse(n),n}async update(t,e){var a;const s=e instanceof hi?e.getOrigin():e,i=this.getFilteredData(s);let n=await this.exec((null==(a=this.model.updateControlAction)?void 0:a.appDEMethodId)||"update",t,i);return n=this.handleResponse(n),n}async goBack(t,e){var s;const i=null==(s=this.model.goBackControlAction)?void 0:s.appDEMethodId;if(!i)throw new a(this.model,"缺少返回操作实体行为");let n=await this.exec(i,t,e instanceof hi?e.getOrigin():e);return n=this.handleResponse(n),n}async updateFormItem(t,e,a={}){let s=await this.exec(t,e,a);return s=this.handleResponse(s),s}async wfStart(t,e,a){var s;const i=(null==(s=this.model.wfstartControlAction)?void 0:s.appDEMethodId)||"wfstart";return(await this.app.deService.getService(this.model.appDataEntityId)).wf.exec(i,t,e,a instanceof hi?a.getOrigin():a)}async wfSubmit(t,e,a){var s;const i=this.model;let n="";n=e.type?e.type:(null==(s=i.wfsubmitControlAction)?void 0:s.appDEMethodId)||"wfsubmit";return(await this.app.deService.getService(this.model.appDataEntityId)).wf.exec(n,t,e,a instanceof hi?a.getOrigin():a)}initUIDataMap(){super.initUIDataMap();const t=["srfwfmemo","srfwftransferor","srfactionparam","srffrontuf","srfnextform"];m(this.model,(e=>{if("FORMITEM"===e.detailType||"MDCTRL"===e.detailType){const a=e,s=a.fieldName||a.id.toLowerCase(),i=a.fieldName||e.appDEFieldId;let n;n=i?new yi(s,i,{isOriginField:!0}):new yi(s,s,{isOriginField:t.includes(s)}),this.dataUIMap.set(s,n)}}),{childrenFields:["deformPages","deformDetails"]})}handleResponse(t){const e=super.handleResponse(t);return e.ok&&e.data&&(e.data=this.toUIData(e.data)),e}getFilteredData(t){const e={};return this.dataUIMap.forEach((a=>{void 0!==t[a.dataKey]&&(e[a.dataKey]=t[a.dataKey])})),e}}),Yn=t("EditFormController",class extends Mn{async onCreated(){await super.onCreated(),this.service=new Kn(this.model),await this.service.init(this.context),this.autoSave=C(this.autoSave.bind(this),500,{trailing:!0})}async loadDraft(){const t={...this.params},e=await this.getDraftParams();let a;Object.assign(t,e);try{await this.startLoading(),await this.evt.emit("onBeforeLoadDraft",{params:t}),a=await this.service.getDraft(this.context,t)}catch(t){throw await this.evt.emit("onLoadDraftError",void 0),this.actionNotification("GETDRAFTERROR",{error:t}),t}finally{await this.endLoading()}return this.state.data=a.data,g(this.data,e),this.formStateNotify("DRAFT"),await this.evt.emit("onLoadDraftSuccess",void 0),this.actionNotification("GETDRAFTSUCCESS"),this.state.isLoaded=!0,this.data}async load(){if(!Ge(this.context,this.model.appDataEntityId))return this.loadDraft();const t={...this.params};let e;try{await this.startLoading(),await this.evt.emit("onBeforeLoad",void 0),e=await this.service.get(this.context,t)}catch(t){throw await this.evt.emit("onLoadError",void 0),this.actionNotification("GETERROR",{error:t}),t}finally{await this.endLoading()}return this.state.modified=!1,this.state.data=e.data,this.formStateNotify("LOAD"),await this.evt.emit("onLoadSuccess",void 0),this.actionNotification("GETSUCCESS"),this.state.isLoaded=!0,this.data}async save(){if(this.state.processing){return await w(500,this.save.bind(this))}if(!await this.validate())throw new e("请检查表单填写!");await this.startLoading(),await this.evt.emit("onBeforeSave",void 0);const t=0===this.data.srfuf;let a;try{a=t?await this.service.create(this.context,this.data):await this.service.update(this.context,this.data)}catch(e){throw await this.evt.emit("onSaveError",void 0),this.actionNotification("".concat(t?"CREATE":"UPDATE","ERROR"),{error:e}),e}finally{await this.endLoading()}return a.data&&v(this.data,a.data),this.state.modified=!1,await this.evt.emit("onSaveSuccess",void 0),this.formStateNotify("SAVE"),this.actionNotification("".concat(t?"CREATE":"UPDATE","SUCCESS"),{default:"".concat(this.data.srfmajortext||"","保存成功")}),this.data}async remove(){let t,e=!1;if(await this.evt.emit("onBeforeRemove",void 0),1===this.data.srfuf){if(e=await ibiz.modal.confirm({title:"提示",desc:"确认删除吗?"}),!e)return!1;await this.startLoading();try{t=await this.service.remove(this.context,this.params)}catch(t){throw await this.evt.emit("onRemoveError",void 0),this.actionNotification("REMOVEERROR",{error:t}),t}finally{await this.endLoading()}e=t.ok}return this.state.data=new hi,this.state.modified=!1,await this.evt.emit("onRemoveSuccess",void 0),this.actionNotification("REMOVESUCCESS"),e}async goBack(){let t;await this.startLoading();try{t=await this.service.goBack(this.context,this.data)}finally{await this.endLoading()}t.data&&v(this.data,t.data)}async updateFormItem(t){var a;const s=null==(a=this.model.deformItemUpdates)?void 0:a.find((e=>e.id===t));if(!s)throw new e("没找到".concat(t,"表单项更新"));const{appDEMethodId:i,defiupdateDetails:n,customCode:r,scriptCode:o}=s,c=n.map((t=>t.id));let l;if(r&&o)l=pa.execScriptFn({...this.getEventArgs(),data:this.data},o,{isAsync:!1});else{const t={...this.params,...this.data.getOrigin()},e=await this.service.updateFormItem(i,this.context,t);l=e.data}l&&(null==c?void 0:c.length)&&await Promise.all(c.map((t=>this.setDataValue(t,l[t]))))}async wfStart(t={}){if(!await this.validate())throw new e("请检查表单填写!");await this.startLoading();try{await this.service.wfStart(this.context,{...this.params,...t},this.data)}catch(t){throw this.actionNotification("WFSTARTERROR",{error:t}),t}finally{await this.endLoading()}this.actionNotification("WFSTARTSUCCESS",{default:"流程启动成功"})}async wfSubmit(t={}){if(!await this.validate())throw new e("请检查表单填写!");await this.startLoading();try{await this.service.wfSubmit(this.context,{...this.params,...t},this.data)}catch(t){throw this.actionNotification("WFSUBMITERROR",{error:t}),t}finally{await this.endLoading()}this.actionNotification("WFSUBMITSUCCESS",{default:"流程提交成功"})}async dataChangeNotify(t){await super.dataChangeNotify(t),this.autoSave()}async autoSave(){if(this.model.enableAutoSave)try{await this.save()}catch(t){ibiz.log.error(t)}}}),$n=t("FormMDCtrlFormController",class extends Hn{constructor(){super(...arguments),this.controlControllerArray=[],this.state={data:[]}}onControlMounted(t,e){const a=t.ctrl;this.controlControllerArray[e]=a,a.load()}async onInit(){super.onInit(),this.service=new Kn(this.model.contentControl),await this.service.init(this.parent.form.context)}async fetch(t,e={}){let a=await this.service.exec("fetchdefault",t,e);return a=this.handleResponse(a),a}handleResponse(t){const e=t;return e.ok&&(b(e.data)?e.data=e.data.map((t=>this.service.toUIData(t))):e.data=this.service.toUIData(e.data)),e}async initData(){const t=await this.fetch(this.parent.form.context,this.parent.form.params);this.state.data=t.data}onDataRemove(t){const e=this.controlControllerArray[t];e&&e.remove()}onFormChange(t,e){const a=this.controlControllerArray[e];a&&(a.save(),this.state.data[e]&&v(this.state.data[e],t[0]),this.parent.state.contentCtrlData=this.state.data,this.parent.setFormDataValue())}onFormRemoveSuccess(t){this.state.data.splice(t,1),this.controlControllerArray.splice(t,1),this.parent.state.contentCtrlData=this.state.data,this.parent.setFormDataValue()}async onDataInsert(){const t=await this.service.getDraft(this.parent.form.context,this.parent.form.params);if(t.data){const e=await this.service.create(this.parent.form.context,t.data);this.state.data.push(e.data),this.parent.state.contentCtrlData=this.state.data,this.parent.setFormDataValue()}}async validate(){return-1===(await Promise.all(this.controlControllerArray.map((t=>t.validate())))).findIndex((t=>!t))}}),qn=t("FormMDCtrlGridController",class extends Hn{constructor(){super(...arguments),this.selectData=[],this.state={isSelect:!1}}onGridMounted(t){this.gridController=t.ctrl}onSelectionChange(t){this.state.isSelect=t.data.length>0}onDataRemove(){this.gridController.remove(),this.parent.state.contentCtrlData=this.gridController.state.items,this.parent.setFormDataValue()}onDataChange(t){this.parent.state.contentCtrlData=t,this.parent.setFormDataValue()}async initData(){this.gridController.load()}async onDataInsert(){await this.gridController.newRow(),this.parent.state.contentCtrlData=this.gridController.state.items,this.parent.setFormDataValue()}async onInit(){const{model:t}=this.parent,{contentControl:a}=t;if(!a)throw new e("表单多数据部件未配置嵌入部件");v(a,{enableRowEdit:!0,enableRowNew:!0}),this.controlModel=a;const s=await Ka(this.controlModel);s&&(this.provider=s)}async validate(){const{rows:t}=this.gridController.state;return-1===(await Promise.all(t.map((t=>this.gridController.validate(t))))).findIndex((t=>!t))}}),Qn=t("FormMDCtrlListController",class extends Hn{constructor(){super(...arguments),this.selectData=[],this.state={isSelect:!1}}onListMounted(t){this.listController=t.ctrl}onSelectionChange(t){this.state.isSelect=t.data.length>0}onDataRemove(){this.listController.remove(),this.parent.state.contentCtrlData=this.listController.state.items,this.parent.setFormDataValue()}onDataChange(t){this.parent.state.contentCtrlData=t,this.parent.setFormDataValue()}async initData(){this.listController.load()}async onDataInsert(){}}),Jn=t("FormMDCtrlRepeaterFormController",class extends Gn{constructor(){super(...arguments),this.formControllerArray=[]}async onDataInsert(){super.onDataInsert({})}onDataRemove(t){t<0||super.onDataRemove(t)}async validate(){const t=this.formControllerArray.map((t=>t.validate()));return-1===(await Promise.all(t)).findIndex((t=>!t))}setFromController(t){this.formControllerArray.push(t)}}),Zn=t("FormMDCtrlRepeaterFormOneController",class extends Jn{get data(){return this.parent.state.contentCtrlData}onDataItemChange(t){this.parent.state.contentCtrlData=t,this.parent.setFormDataValue()}}),tr=t("FormMDCtrlRepeaterGridController",class extends Gn{constructor(){super(...arguments),this.columns=[],this.editorMap={}}async onInit(){this.initColumns(this.model.deformDetails||[])}initColumns(t){t.forEach((async t=>{if("FORMITEM"===t.detailType){const{editor:e,dataType:a}=t,s=await qa(e);if(s){const i=await s.createController(e,{unitName:e.unitName,valueFormat:e.valueFormat,context:this.parent.form.context,params:this.parent.form.params,dataType:a});this.editorMap[t.codeName]={provider:s,controller:i}}this.columns.push({codeName:t.codeName,caption:t.caption})}const e=ta(t);e.length&&this.initColumns(e)}))}rowDataChange(t,e,a){const s=this.data[a];Object.prototype.hasOwnProperty.call(s,e)&&!Vi(s[e],t)||(s[e]=t,this.onDataItemChange(s,a))}}),er=t("FormMDCtrlState",class extends kn{constructor(){super(...arguments),this.contentCtrlData=[]}}),ar=(t("FormMDCtrlController",class extends Fn{createState(){var t;return new er(null==(t=this.parent)?void 0:t.state)}async onInit(){switch(await super.onInit(),this.model.contentType){case"FORM":this.mdCtrlContentController=new $n(this);break;case"GRID":this.mdCtrlContentController=new qn(this);break;case"LIST":this.mdCtrlContentController=new Qn(this);break;case"DATAVIEW":this.mdCtrlContentController=new Xn(this);break;case"REPEATER":"DEFAULT"===this.model.detailStyle&&(this.mdCtrlContentController=new Jn(this)),"STYLE3"===this.model.detailStyle&&(this.mdCtrlContentController=new Zn(this)),"STYLE2"===this.model.detailStyle&&(this.mdCtrlContentController=new tr(this))}this.mdCtrlContentController&&await this.mdCtrlContentController.onInit()}setFormDataValue(){const t=this.model.appDEFieldId||this.model.fieldName||this.model.id;t&&this.form.setDataValue(t,this.state.contentCtrlData)}async loadData(){await this.mdCtrlContentController.initData()}async validate(){return this.mdCtrlContentController.validate()}setDefaultValue(){}}),t("FormMDCtrlItemController",class extends Yn{constructor(t,e,a,s,i){super(t,e,a,s),this.state.data=i,this.state.isSimple=!0}async initDetailControllers(t=this.model.deformDetails,e=this,a=void 0){await Promise.all(t.map((async t=>{const s=await Za(t);if(!s)return;e.providers[t.id]=s;const i=await s.createController(t,e,a);e.details[t.id]=i,"FORMITEM"!==t.detailType&&"MDCTRL"!==t.detailType||e.formItems.push(i);const n=ta(t);n.length&&await this.initDetailControllers(n,e,i)})))}}),t("FormPageState",class extends Un{})),sr=(t("FormPageController",class extends jn{createState(){var t;return new ar(null==(t=this.parent)?void 0:t.state)}}),t("FormRawItemState",class extends kn{})),ir=(t("FormRawItemController",class extends Fn{createState(){var t;return new sr(null==(t=this.parent)?void 0:t.state)}}),t("FormTabPageState",class extends kn{})),nr=(t("FormTabPageController",class extends Fn{createState(){var t;return new ir(null==(t=this.parent)?void 0:t.state)}}),t("FormTabPanelState",class extends kn{})),rr=(t("FormTabPanelController",class extends Fn{createState(){var t;return new nr(null==(t=this.parent)?void 0:t.state)}}),t("GridColumnController",class{constructor(t,e){var a;this.isAdaptiveColumn=!1,this.isCustomCode=!1,this.model=t,this.grid=e,this.isAdaptiveColumn="STAR"===t.widthUnit,this.isAdaptiveColumn&&(this.grid.hasAdaptiveColumn=!0),(null==(a=this.deGridDataItem)?void 0:a.customCode)&&(this.isCustomCode=!0)}get context(){return this.grid.context}get params(){return this.grid.params}get enableRowEdit(){return!(!this.grid.model.enableRowEdit||!this.model.enableRowEdit)}get deGridDataItem(){var t;return null==(t=this.grid.model.degridDataItems)?void 0:t.find((t=>t.id===this.model.id))}get valueFormat(){var t;return null==(t=this.deGridDataItem)?void 0:t.format}get dataType(){var t;return null==(t=this.deGridDataItem)?void 0:t.dataType}async init(){await this.onInit()}async onInit(){}getCustomHtml(t){var e;if(null==(e=this.deGridDataItem)?void 0:e.scriptCode)return pa.execScriptFn({data:t.data},this.deGridDataItem.scriptCode,{singleRowReturn:!0,isAsync:!1})}})),or=t("GridRowState",class{constructor(t,e){this.errors={},this.uaColStates={},this.editColStates={},this.showRowEdit=!1,this.modified=!1,this.processing=!1,this.data=t,Object.keys(this.data).forEach((t=>{void 0===this.errors[t]&&(this.errors[t]=null)})),Object.values(e.uaColumns).forEach((t=>{t.initActionStates(this)})),Object.values(e.editColumns).forEach((t=>{this.editColStates[t.fieldName]={disabled:!1,readonly:!1,editable:"all"===ibiz.config.grid.editShowMode,required:!1}}))}}),cr=t("GridService",class extends ui{initUIDataMap(){var t;super.initUIDataMap(),null==(t=this.model.degridDataItems)||t.forEach((t=>{const e=t.id.toLowerCase(),a=t.appDEFieldId;let s;if(a){const t=a.toLowerCase();s=new yi(e,t,{isOriginField:!0})}else s=new yi(e,e);this.dataUIMap.set(e,s)}))}async updateGridEditItem(t,e,a={}){const s=await this.app.deService.getService(this.model.appDataEntityId);let i=await s.exec(t,e,a);return i=this.handleResponse(i),i}}),lr=(t("GridController",class extends Hi{constructor(){super(...arguments),this.hasAdaptiveColumn=!1,this.isMultistageHeader=!1,this.columns={},this.fieldColumns={},this.uaColumns={},this.editColumns={},this.providers={},this.aggTitle="合计"}get groupCodeListItems(){var t;return null==(t=this.groupFieldColumn)?void 0:t.codeListItems}get enableAgg(){return"NONE"!==this.model.aggMode}get allowRowEdit(){return!!this.model.enableRowEdit&&this.state.rowEditOpen}initState(){super.initState(),this.state.rows=[],this.state.noSort=!0===this.model.noSort,this.state.size=this.model.pagingSize||20,this.state.singleSelect=!0===this.model.singleSelect,this.state.columnStates=[],this.state.aggResult={},this.state.rowEditOpen=!1}async onCreated(){await super.onCreated(),this.service=new cr(this.model),await this.service.init(this.context),this.initColumnStates(),await this.initGridColumns(),this.dataChangeNotify=f(this.dataChangeNotify.bind(this),((t,e)=>[t[0],Array.from(new Set([...t[1],...e[1]]))]),200),await this.initGroup()}async initGroup(){if(!this.model.enableGroup)return;const{groupAppDEFieldId:t,groupCodeListId:e,groupMode:s}=this.model;if(this.groupFieldColumn=Object.values(this.fieldColumns).find((e=>e.model.appDEFieldId===t)),!this.groupFieldColumn)throw new a(this.model,"没有配置分组属性的属性列");const i=this.groupFieldColumn.model.id;if(!this.groupFieldColumn.model.appCodeListId)throw new a(this.groupFieldColumn.model,"分组属性的属性列".concat(i,"没有配置代码表"));const n=this.state.columnStates.findIndex((t=>t.key===this.groupFieldColumn.model.codeName));if(-1!==n&&0!==n){if(this.isMultistageHeader)throw new a(this.model,"请将分组属性列".concat(i,"配置为第一列"));const t=this.state.columnStates.splice(n,1);this.state.columnStates.unshift(...t)}if("CODELIST"===s){if(!e)throw new a(this.model,"代码表分组模式需要配置代码表");if(this.groupFieldColumn.model.appCodeListId!==e)throw new a(this.model,"分组代码表与属性列".concat(i,"的代码表不一致"))}}async afterLoad(t,e){return await super.afterLoad(t,e),await Promise.allSettled(Object.values(this.fieldColumns).map((async t=>{await t.loadCodeList()}))),this.state.rows=e.map((t=>{const e=new or(t,this);return this.gridStateNotify(e,"LOAD"),e})),this.state.rows.forEach((t=>{Object.values(t.uaColStates).forEach((e=>{e.update(t.data.getOrigin(),this.model.appDataEntityId)}))})),this.calcGroupData(e),this.calcAggResult(e),e}calcGroupData(t){const{enableGroup:e,groupMode:a}=this.model;if(e){const e=new Map,s="CODELIST"===a,i=this.groupFieldColumn.model.id;s&&this.groupCodeListItems.forEach((t=>{e.set(t.value,[])})),t.forEach((t=>{const a=t[i];s||e.has(a)||e.set(a,[]),e.has(a)&&e.get(a).push(t)})),this.state.groups=[],e.forEach(((t,e)=>{const a=this.groupCodeListItems.find((t=>t.value===e));this.state.groups.push({caption:(null==a?void 0:a.text)||"".concat(e),children:t})}))}}async loadRemoteAgg(){const{aggMode:t,aggAppDataEntityId:e,aggAppDEDataSetId:s}=this.model;if("ALL"!==t)return;if(!s||!e)throw new a(this.model,"缺少配置聚合实体或聚合数据集");const i=await this.getFetchParams(),n=ibiz.hub.getApp(this.context.srfappid),r=await n.deService.exec(e,s,this.context,void 0,i);r.data.length&&([this.state.remoteAggResult]=r.data)}calcAggResult(t){Object.values(this.fieldColumns).forEach((e=>{const a=e.calcFieldAgg(t);a&&(this.state.aggResult[e.model.id]=a)}))}afterRemove(t){super.afterRemove(t);const e=this.state.rows.findIndex((e=>e.data.srfkey===t.srfkey));this.state.rows.splice(e,1),this.state.groups.forEach((e=>{if(e.children.length){const a=e.children.findIndex((e=>e.srfkey===t.srfkey));-1!==a&&e.children.splice(a,1)}}))}async newRow(){const{enableRowEdit:t,enableRowNew:a}=this.model;if(!t||!a||"row"!==ibiz.config.grid.editShowMode)return void ibiz.log.error("不支持新建行");if(this.state.rows.find((t=>t.showRowEdit)))throw new e("请先完成当前行编辑中的行的操作");let s;try{s=await this.service.getDraft(this.context,this.params)}catch(t){throw this.actionNotification("GETDRAFTERROR",{error:t}),t}this.state.items.unshift(s.data);const i=new or(s.data,this);this.state.rows.unshift(i),this.gridStateNotify(i,"DRAFT"),this.switchRowEdit(this.state.rows[0],!0),this.actionNotification("GETDRAFTSUCCESS",{data:s.data})}async save(t){if(this.state.isSimple)return;const a=this.state.rows.find((e=>e.data.srfkey===t.srfkey));if(!a)throw new e("行数据不存在");if(!a.modified)return void ibiz.log.debug("值没有发生改变");if(a.processing)return void await w(500,this.save.bind(this),[t]);if(!await this.validate(a))throw new e("行数据校验不通过,保存取消");let s;await this.startLoading();const i=0===t.srfuf,n=ze(this.model.appDataEntityId),r=this.context.clone();r[n]=t.srfkey;try{s=i?await this.service.create(r,t):await this.service.update(r,t)}catch(t){throw await this.evt.emit("onSaveError",void 0),this.actionNotification("".concat(i?"CREATE":"UPDATE","ERROR"),{error:t,data:a.data}),t}finally{await this.endLoading()}const o=this.state.items.findIndex((e=>e.srfkey===t.srfkey));this.state.items.splice(o,1,s.data),a.data=s.data,a.modified=!1,ibiz.message.success("".concat(s.data.srfmajortext||"","保存成功")),this.actionNotification("".concat(i?"CREATE":"UPDATE","SUCCESS"),{default:"".concat(s.data.srfmajortext||"","保存成功"),data:s.data}),this.gridStateNotify(a,"SAVE"),await this.evt.emit("onSaveSuccess",void 0)}async saveAll(){const t=this.state.rows.filter((t=>t.modified)).map((t=>t.data));t.length&&Promise.allSettled(t.map((t=>this.save(t))))}async initColumnsController(t){var e;const a=await as(t);if(!a)return;this.providers[t.codeName]=a;const s=await a.createController(t,this);this.columns[t.codeName]=s,"DEFGRIDCOLUMN"===t.columnType?(this.fieldColumns[t.codeName]=s,t.enableRowEdit&&(this.editColumns[t.codeName]=s)):"UAGRIDCOLUMN"===t.columnType?this.uaColumns[t.codeName]=s:"GROUPGRIDCOLUMN"===t.columnType&&(this.isMultistageHeader=!0,await Promise.all((null==(e=t.degridColumns)?void 0:e.map((async t=>{await this.initColumnsController(t)})))||[]))}initColumnStates(){m(this.model,(t=>{"GROUPGRIDCOLUMN"!==t.columnType&&this.state.columnStates.push({key:t.codeName,caption:t.caption,hidden:!!t.hideDefault,uaColumn:"UAGRIDCOLUMN"===t.columnType})}),{childrenFields:["degridColumns"]}),this.calcColumnFixed()}calcColumnFixed(){const t=this.state.columnStates.filter((t=>!t.hidden)),e=t.length,{frozenFirstColumn:a,frozenLastColumn:s}=this.model;t.forEach(((t,i)=>{t.uaColumn?t.fixed=i+1<=Math.floor(e/2)?"left":"right":a&&i<a?t.fixed="left":s&&i>=e-s&&(t.fixed="right")}))}async initGridColumns(){this.model.degridColumns&&await Promise.all(this.model.degridColumns.map((async t=>this.initColumnsController(t))))}async setRowValue(t,e,a){if(!Object.prototype.hasOwnProperty.call(t.data,e)||Vi(t.data[e],a)){t.data[e]=a,t.modified=!0,t.processing=!0;try{await this.dataChangeNotify(t,[e]),await this.evt.emit("onGridDataChange",{data:this.state.rows.map((t=>t.data))})}finally{t.processing=!1}}}async dataChangeNotify(t,e){const a=await Promise.allSettled(Object.values(this.editColumns).map((async a=>a.dataChangeNotify(t,e)))),s=a.find((t=>"rejected"===t.status));if(s)throw ibiz.log.error("dataChangeNotify报错",a),s.reason}gridStateNotify(t,e){Object.values(this.editColumns).forEach((a=>{a.gridStateNotify(t,e)}))}async validate(t){return-1===(await Promise.all(Object.values(this.editColumns).map((e=>e.validate(t))))).findIndex((t=>!t))}async toggleRowEdit(){if(!this.model.enableRowNew)throw new e("当前表格不支持行编辑,无法切换开启行编辑");this.state.rowEditOpen=!this.state.rowEditOpen}async switchRowEdit(t,a,s=!0){if(!this.allowRowEdit)return;const i=void 0===a?!t.showRowEdit:a;if(t.showRowEdit!==i){if(!1===i)if(s)await this.save(t.data);else if(0===t.data.srfuf)return t.showRowEdit=!1,this.evt.emit("onRowEditChange",{row:t}),this.remove({data:[t.data],silent:!0});if(!0===i){if(this.state.rows.find((t=>t.showRowEdit)))throw new e("同时只能有一行开启行编辑")}t.showRowEdit=i,Object.values(this.editColumns).forEach((e=>{t.editColStates[e.fieldName].editable=i})),this.evt.emit("onRowEditChange",{row:t})}}setSort(t,e){if(t&&e){const a=this.fieldIdNameMap.get(t).toLowerCase();super.setSort(a,e)}else{const{minorSortAppDEFieldId:t,minorSortDir:e}=this.model;if(t&&e){const a=this.fieldIdNameMap.get(t);this.state.sortQuery="".concat(a.toLowerCase(),",").concat(e.toLowerCase())}else this.state.sortQuery=""}}async updateGridEditItem(t,a){var s;const i=null==(s=this.model.degridEditItemUpdates)?void 0:s.find((t=>t.id===a));if(!i)throw new e("没找到".concat(a,"编辑列更新"));const{appDEMethodId:n,degeiupdateDetails:r,customCode:o,scriptCode:c}=i,l=r.map((t=>t.id));let h;if(o&&c)h=pa.execScriptFn({...this.getEventArgs(),data:t.data},c,{isAsync:!1});else{const e={...this.params,...t.data.getOrigin()},a=await this.service.updateGridEditItem(n,this.context,e);h=a.data}h&&(null==l?void 0:l.length)&&await Promise.all(l.map((e=>this.setRowValue(t,e,h[e]))))}async loadData(t){const{context:e}=this.handlerAbilityParams(t),a=await this.getFetchParams(null==t?void 0:t.params);let s;await this.startLoading();try{s=await this.service.fetch(e,a)}finally{await this.endLoading()}return s.data}async exportData(t){const a=this.fieldColumns,s=Object.keys(a).map((t=>a[t].model.id)),i=Object.keys(a).map((t=>a[t].model.caption)),n=(r=s,(await(async()=>{var s;const i=null==(s=t.params)?void 0:s.type;let n=[];if("activatedPage"===i&&(n=this.state.rows.map((t=>t.data))),"maxRowCount"===i||"customPage"===i){const{size:e}=this.state,{startPage:a,endPage:s}=t.params,r="customPage"===i?{page:0,offset:(a-1)*e,size:(s-a+1)*e}:{size:1e3,page:0};n=await this.loadData({params:r})}if("selectedRows"===i&&(n=this.getData()),0===n.length)throw new e("无导出数据");return(t=>{const e=new Map;Object.keys(a).forEach((t=>{a[t].codeList&&e.set(t,a[t].codeListItems)}));const s=J(t.map((t=>t.getOrigin())));return s.forEach((t=>{Object.keys(t).forEach((a=>{var s;e.get(a)&&(t[a]=(null==(s=e.get(a).find((e=>e.value===t[a])))?void 0:s.text)||t[a])}))})),s})(n)})()).map((t=>r.map((e=>t[e])))));var r;if(!ibiz.util.getExportExcel)throw new e("ibiz.util.getExportExcel不存在");const o=await ibiz.util.getExportExcel();if(!o)throw new e("导出模块加载错误");o.exportJsonToExcel({header:i,data:n,filename:this.model.logicName,autoWidth:!0})}}),t("GridFieldColumnController",class extends rr{constructor(){super(...arguments),this.codeList=void 0}get isLinkColumn(){return!!this.model.enableLinkView&&!!this.model.linkAppViewId}get hasAction(){return!!this.model.deuiactionId}clickable(t){const e=t.data[this.model.codeName];return(this.isLinkColumn||this.hasAction)&&e}handlePublicParams(t,e,a){const{userParam:s}=this.model;if(!s)return{context:e,params:a};const{navigateContexts:i,navigateParams:n}=Fe(s);let r={};i&&t&&(r=Le(i,e,a,t));const o=Object.assign(e.clone(),r);let c={};n&&t&&(c=Le(n,e,a,t));return{context:o,params:{...a,...c}}}async openLinkView(t,e){if(!t.data[this.model.codeName])return;const a=this.model.linkValueItem||"srfkey",i=t.data[a];if(null==i)throw new s(this.model,"未在行数据中取到 ".concat(a," 的值"));const{linkAppViewId:n}=this.model;if(!n)return;const r=va(t.data),o=Object.assign(this.context.clone(),{srfkey:i,...r}),c=J(this.params),{context:l,params:h}=this.handlePublicParams(t.data,o,c),d=await ibiz.commands.execute(Oa.TAG,n,l,h,{event:e});(null==d?void 0:d.ok)&&this.grid.load()}async triggerAction(t,e){const a=this.model.deuiactionId;await Dn.execAndResolved(a,{context:this.context,params:this.params,data:[t.data],view:this.grid.view,event:e})}async loadCodeList(){const t=this.model.appCodeListId;if(!t)return;const e=ibiz.hub.getApp(this.context.srfappid);this.codeList||(this.codeList=e.codeList.getCodeList(t));const a=await e.codeList.get(t,this.context,this.params);return this.codeListItems=a,a}calcFieldAgg(t){const{aggField:e,aggMode:a,aggValueFormat:i,unitName:n}=this.model;if("NONE"===a)return;const r=e||this.model.id;let o;if("PAGE"!==this.grid.model.aggMode)throw"ALL"===this.grid.model.aggMode?new s(this.model,"远程聚合暂未支持"):new s(this.grid.model,"暂未支持聚合模式".concat(this.grid.model.aggMode));switch(a){case"SUM":o=t.map((t=>t[r])).reduce(((t,e)=>t+e),0);break;case"AVG":o=t.map((t=>t[r])).reduce(((t,e)=>t+e),0)/t.length;break;case"MAX":o=Math.max(...t.map((t=>t[r])));break;case"MIN":o=Math.min(...t.map((t=>t[r])));break;default:throw new s(this.model,"暂未支持属性列聚合模式".concat(a))}let c="".concat(o);if(i)try{c=ibiz.util.text.format("".concat(o),i)}catch(t){ibiz.log.error("".concat(o," 值格式化错误"))}return c&&n&&(c+=n),c}formatValue(t=""){if("SIMPLE"!==this.model.valueType)return Wi.toText(this.model,t);const e="".concat(t);if(!this.valueFormat)return e;return y.isDate(this.dataType)?st(e).format(this.valueFormat):ibiz.util.text.format(e,this.valueFormat)}})),hr=(t("GridUAColumnController",class extends rr{initActionStates(t){var e;const{deuiactionGroup:s}=this.model;if(!s)throw new a(this.model,"操作列没有配置界面行为组");if(!(null==(e=s.uiactionGroupDetails)?void 0:e.length))return void ibiz.log.debug("操作列界面行为组没有配置界面行为");const i=new Ni;s.uiactionGroupDetails.forEach((t=>{const e=t.uiactionId;if(e){const a=new Oi(t.id,this.grid.context.srfappid,e);i.addState(t.id,a)}})),t.uaColStates[this.model.codeName]=i}async onActionClick(t,e,a){const s=t.uiactionId;await Dn.execAndResolved(s,{context:this.context,params:this.params,data:[e.data],view:this.grid.view,event:a})}}),t("GridFieldEditColumnController",class extends lr{constructor(){super(...arguments),this.rules=[]}get unitName(){return this.editItem.unitName}get valueFormat(){return this.model.valueFormat}get valueItemName(){if(this.editItem.editor)return this.editItem.editor.valueItemName}get fieldName(){return this.model.dataItemName}async onInit(){await super.onInit();const t=Ze(this.grid.model,this.model.codeName);t&&(this.editItem=t,this.editItem.editor&&"HIDDEN"!==this.editItem.editor.editorType&&(this.editorProvider=await qa(this.editItem.editor),this.editorProvider&&(this.editor=await this.editorProvider.createController(this.editItem.editor,this),await this.initRules())))}async initRules(){const t=xa(this.grid.model.degridEditItemVRs||[],this.fieldName);t&&(this.rules=Fi(t,this.fieldName,this.valueItemName),this.validator=new lt({[this.fieldName]:this.rules}))}async setRowValue(t,e,a){a=a||this.fieldName,await this.grid.setRowValue(t,a,e)}async dataChangeNotify(t,a){this.calcColumnDisabled(t);const s=t.editColStates[this.fieldName].required;this.calcColumnRequired(t);if(s!==t.editColStates[this.fieldName].required||a.includes(this.fieldName)||a.includes(this.valueItemName)){if(!await this.validate(t))throw new e("".concat(this.editItem.codeName,"校验报错,").concat(t.errors[this.fieldName]))}a.includes(this.fieldName)&&this.editItem.degridEditItemUpdateId&&await this.grid.updateGridEditItem(t,this.editItem.degridEditItemUpdateId)}gridStateNotify(t,e){this.calcColumnDisabled(t),this.calcColumnReadonly(t),this.calcColumnRequired(t)}calcColumnDisabled(t){let e=this.calcEnableCond(t);if(e&&this.grid.scheduler){const a=this.grid.scheduler.triggerItemEnable(this.fieldName,{data:[t.data]});void 0!==a&&(e=a)}t.editColStates[this.fieldName].disabled=!e}calcColumnRequired(t){let e=!1!==this.editItem.allowEmpty;if(e&&this.grid.scheduler){const a=this.grid.scheduler.triggerItemBlank(this.fieldName,{data:[t.data]});void 0!==a&&(e=a)}t.editColStates[this.fieldName].required=!e}calcColumnReadonly(t){var e;const a=!!(null==(e=this.editItem.editor)?void 0:e.readOnly);t.editColStates[this.fieldName].readonly=a}calcEnableCond(t){const{enableCond:e}=this.editItem,a=0===t.data.srfuf;switch(e){case 0:return!1;case 1:return a;case 2:return!a;default:return!0}}async validate(t){const e=this.fieldName;if("cell"!==ibiz.config.grid.editShowMode&&t.editColStates[e].required&&k(t.data[e]))return t.errors[e]="请填写".concat(this.model.caption||""),!1;if(this.rules.length&&this.validator)try{await this.validator.validate(t.data)}catch(a){const{errors:s}=a;return t.errors[e]=s[0].message,!1}return t.errors[e]=null,!0}}),t("GridGroupColumnController",class extends rr{}),t("ListService",class extends ui{initUIDataMap(){var t;super.initUIDataMap(),null==(t=this.model.delistDataItems)||t.forEach((t=>{const e=t.id.toLowerCase(),a=t.appDEFieldId;let s;if(a){const t=a.toLowerCase();s=new yi(e,t,{isOriginField:!0})}else s=new yi(e,e);this.dataUIMap.set(e,s)}))}})),dr=(t("ListController",class extends Hi{initState(){super.initState(),this.state.noSort=!0===this.model.noSort}async onCreated(){await super.onCreated(),this.state.size=this.model.pagingSize||20,this.service=new hr(this.model),await this.service.init(this.context)}setSort(t,e){if(t&&e)super.setSort(t,e);else{const{minorSortAppDEFieldId:t,minorSortDir:e}=this.model;if(t&&e){const a=this.fieldIdNameMap.get(t);this.state.sortQuery="".concat(a.toLowerCase(),",").concat(e.toLowerCase())}else this.state.sortQuery=""}}get batchToolbarController(){return this.view.getController("".concat(this.model.name,"_batchtoolbar"))}get quickToolbarController(){return this.view.getController("".concat(this.model.name,"_quicktoolbar"))}setSelection(t){var e,a;super.setSelection(t);const s=null==t?void 0:t[0];null==(e=this.batchToolbarController)||e.calcButtonState(s,this.model.appDataEntityId),null==(a=this.quickToolbarController)||a.calcButtonState(s,this.model.appDataEntityId)}async loadMore(){this.state.total>this.state.items.length&&await this.load({isLoadMore:!0})}async afterLoad(t,e){return await this.handleDataGroup(),e}setData(t){this.state.items=t}getAllData(){return this.state.items}async handleDataGroup(){const{enableGroup:t,groupMode:e}=this.model;t&&e&&("AUTO"===e?this.handleAutoGroup():"CODELIST"===e&&await this.handleCodeListGroup())}handleAutoGroup(){const{groupAppDEFieldId:t}=this.model;if(t){const{items:e}=this.state,a=new Map;e.forEach((e=>{const s=a.get(e[t])||[];s.push(e),a.set(e[t],s)}));const s=[];a.forEach(((t,e)=>{s.push({caption:e,children:[...t]})})),this.state.groups=s}}async handleCodeListGroup(){const{groupAppDEFieldId:t,groupCodeListId:e}=this.model;if(t&&e){const{items:a}=this.state,s=[],i=ibiz.hub.getApp(this.context.srfappid),n=await i.codeList.get(e,this.context,this.params),r=[];n.forEach((e=>{const i=a.filter((a=>a[t]===e.value));s.push({caption:e.text,children:[...i]}),r.push(e.value)}));const o=a.filter((e=>-1===r.indexOf(e[t])));o.length>0&&s.push({caption:"其他",children:[...o]}),this.state.groups=s}}}),t("PanelController",class extends Gi{constructor(){super(...arguments),this.panelItems={},this.providers={}}get data(){return this.state.data}initState(){super.initState(),this.state.data={}}setInputData(t){this.inputData=t}async onCreated(){await super.onCreated(),await this.initPanelItemControllers()}async onMounted(){this.load()}async initPanelItemControllers(t=this.model.rootPanelItems,e=this,a=void 0){t&&await Promise.all(t.map((async t=>{var s,i;const n=await ns(t);if(!n)return;e.providers[t.id]=n;const r=await n.createController(t,e,a);e.panelItems[t.id]=r,(null==(s=t.panelItems)?void 0:s.length)&&!r.isDataContainer&&await this.initPanelItemControllers(t.panelItems,e,r),(null==(i=t.panelTabPages)?void 0:i.length)&&await this.initPanelItemControllers(t.panelTabPages,e,r)})))}async load(){const t=await this.prepareData();if(!t)throw new e("未获取到面板数据");const a=this.convertData(t);this.state.data=a,this.panelStateNotify("LOAD")}async prepareData(){let t;if(1===this.model.dataMode)this.inputData&&(t=this.inputData);else t=this.inputData||{};return t}convertData(t){return t}dataChangeNotify(t){Object.values(this.panelItems).forEach((e=>{e.dataChangeNotify(t)}))}panelStateNotify(t){Object.values(this.panelItems).forEach((e=>{e.panelStateNotify(t)}))}async setDataValue(t,e){Object.prototype.hasOwnProperty.call(this.state.data,t)&&this.state.data[t]===e||(this.state.data[t]=e,this.dataChangeNotify([t]))}})),ur=(t("ViewLayoutPanelController",class extends dr{async onCreated(){this.preprocessModel(),await super.onCreated()}registerToCtx(){}preprocessModel(t){var e;const a=t=>{const e=[];return t.forEach((t=>{"CONTAINER"===t.itemType&&"PANELPART"===t.predefinedType?e.push(...t.panelItems||[]):e.push(t)})),e.forEach((t=>{"CONTAINER"===t.itemType&&this.preprocessModel(t)})),e};t?t.panelItems=a(t.panelItems||[]):(null==(e=this.model.rootPanelItems)?void 0:e.length)&&(this.model.rootPanelItems=a(this.model.rootPanelItems||[]))}}),t("PanelItemState",class{constructor(t){this.parent=t,this.disabled=!1,this.layout={width:"",height:"",extraStyle:{},extraClass:[],contentStyle:{}},this.class={container:[],containerDyna:[],label:[],labelDyna:[]},this.required=!1;let e,a=!0;Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,get(){var t;return!1!==(null==(t=this.parent)?void 0:t.visible)&&a},set:t=>(a=t,!0)}),Object.defineProperty(this,"keepAlive",{enumerable:!0,configurable:!0,get(){return void 0!==e?e:!!this.parent&&this.parent.keepAlive},set:t=>(e=t,!0)})}})),pr=(t("PanelItemController",class{constructor(t,e,a){this.model=t,this.panel=e,this.parent=a,this.state=this.createState()}get dataParent(){return this.findDataParent(this)}get data(){return this.dataParent.data}get containerClass(){return[...this.state.class.container,...this.state.class.containerDyna]}get labelClass(){return[...this.state.class.label,...this.state.class.labelDyna]}async init(){await this.onInit()}async onInit(){const{layoutPos:t,sysCss:e,labelSysCss:a}=this.model;if(t){const{width:e,height:a}=We(t);this.state.layout.width="".concat(e),this.state.layout.height="".concat(a)}(null==e?void 0:e.cssName)&&this.state.class.container.push(e.cssName),(null==a?void 0:a.cssName)&&this.state.class.label.push(a.cssName)}createState(){var t;return new ur(null==(t=this.parent)?void 0:t.state)}dataChangeNotify(t){this.calcDynamicLogic(t),this.calcDynaClass(this.data)}panelStateNotify(t){this.calcDynamicLogic([],!0),this.calcDynaClass(this.data)}calcDynamicLogic(t,e=!1){var a;this.parent&&!this.parent.state.visible||null==(a=this.model.panelItemGroupLogics)||a.forEach((a=>{const s=a.relatedItemNames||[];if(e||E(s,t))try{const t=Ea(this.data,a);switch(a.logicCat){case"ITEMBLANK":this.state.required=!t;break;case"ITEMENABLE":this.state.disabled=!t;break;case"PANELVISIBLE":this.state.visible=t}}catch(t){ibiz.log.error(t)}}))}findDataParent(t){const{parent:e}=t;return e?e.isDataContainer?e:this.findDataParent(e):t.panel}calcDynaClass(t){if(this.model.dynaClass){const e=Be(this.model.dynaClass,t);e.length&&(this.state.class.containerDyna=e)}if(this.model.labelDynaClass){const e=Be(this.model.labelDynaClass,t);e.length&&(this.state.class.labelDyna=e)}}}),t("PickupViewPanelController",class extends Gi{async onCreated(){await super.onCreated(),this.mountCounter.enroll(this.model.embeddedAppDEViewId),this.initNavParam()}initNavParam(){const{navigateContexts:t,navigateParams:e}=this.model,a=this.context.clone(),s={...this.params};t&&Object.assign(a,Le(t,this.context,this.params)),e&&Object.assign(s,Le(e,this.context,this.params)),this.state.context=a,this.state.params=s}setEmbedView(t){this.embedView=t,this.embedView.state.isMounted?this.mountCounter.attend(this.model.embeddedAppDEViewId):this.embedView.evt.on("onMounted",(()=>{this.mountCounter.attend(this.model.embeddedAppDEViewId)})),this.embedView.evt.on("onSelectionChange",(t=>{this.evt.emit("onSelectionChange",t)})),this.embedView.evt.on("onDataActive",(t=>{this.evt.emit("onDataActive",{data:t.data})}))}async getSelectedData(){return await this.embedView.call("GetData")}async getAllData(){return await this.embedView.call("GetAllData")}}),t("SearchBarController",class extends Gi{constructor(){super(...arguments),this.placeHolder=""}initState(){super.initState(),this.state.query="",this.state.selectedGroupItem=null,this.state.visible=!!(this.model.enableQuickSearch||this.model.enableGroup||this.model.enableFilter)}async onCreated(){var t;await super.onCreated();const e=await ibiz.hub.getAppDataEntity(this.model.appDataEntityId,this.context.srfappid);if(e){const a=null==(t=e.appDEFields)?void 0:t.filter((t=>t.enableQuickSearch)),s=[];null==a||a.forEach((t=>{(null==t?void 0:t.lnlanguageRes)&&t.lnlanguageRes.lanResTag?s.push(ibiz.i18n.t(t.lnlanguageRes.lanResTag,t.logicName)):(null==t?void 0:t.logicName)&&s.push(t.logicName)})),s.length>0&&(this.placeHolder=s.join("、"))}}handleInput(t){this.state.query=t}handleSearch(){this.evt.emit("onSearch",void 0)}}),t("TabExpPanelController",class extends Gi{initState(){super.initState(),this.state.tabPages=[],this.state.activeName=""}async onCreated(){await super.onCreated(),this.layoutPanel=this.view.layoutPanel,this.initTabPages()}initTabPages(){const t=this.model.controls,e=[];t.forEach((t=>{e.push({caption:t.caption,tabTag:t.id,class:t.sysCss?[t.sysCss.cssName]:[]})})),this.state.tabPages=e,e.length>0&&this.initDefaultPage()}initDefaultPage(){const t=()=>{this.state.activeName=this.state.tabPages[0].tabTag,this.handleTabChange()};if(this.state.defaultTabName){const e=this.state.tabPages.find((t=>t.tabTag===this.state.defaultTabName));e?(this.state.activeName=e.tabTag,this.changeToTab()):t()}else t()}changeToTab(t=this.activeTabViewPanelModel){const e=this.getNavViewMsg(t);this.evt.emit("onNavViewChange",{navViewMsg:e})}get activeTabViewPanelModel(){const{activeName:t}=this.state;return this.model.controls.find((e=>e.id===t))}async handleTabChange(){this.activeTabViewPanelModel&&this.changeToTab()}prepareParams(t){const{navDER:e,navFilter:a,navigateContexts:s,navigateParams:i,appDataEntityId:n}=t,r={deName:ze(n),navFilter:a,pickupDEFName:null==e?void 0:e.pickupDEFName,navContexts:s,navParams:i},o={context:this.context,params:this.params,data:{}},{resultContext:c,resultParams:l}=Ve(r,o);return{context:Object.assign(this.context.clone(),c,{currentSrfNav:this.state.activeName}),params:{...this.params,...l}}}getNavViewMsg(t){const{context:e,params:a}=this.prepareParams(t);return{key:t.codeName.toLowerCase(),context:e,params:a,viewId:t.embeddedAppDEViewId}}}),t("TreeService",class extends ui{async fetchChildNodes(t,e){const{hasQuery:a}=e;let s=[];if(t){const i=Je(this.model,{parentId:null==t?void 0:t.nodeId,hasQuery:a});if(0===i.length)return;(await Promise.allSettled(i.map((async a=>{const s=Qe(this.model,a.childDETreeNodeId);return this.fetchNodeDatasByType(s,a,t,e)})))).forEach((t=>{"fulfilled"===t.status&&t.value?s.push(...t.value):"rejected"===t.status&&ibiz.log.error(t.reason)}))}else{const t=qe(this.model);s=await this.fetchNodeDatasByType(t,void 0,void 0,e)}return s}async fetchNodeDatasByType(t,e,a,i){const n=0===Je(this.model,{parentId:t.id,hasQuery:i.hasQuery}).length,r={...i,leaf:n};let o=[];switch(t.treeNodeType){case"STATIC":o=[await this.getStaticNodeData(t,e,a,r)];break;case"DE":o=await this.getDENodeDatas(t,e,a,r);break;case"CODELIST":o=await this.getCodeListNodeDatas(t,e,a,r);break;default:throw new s(t,"".concat(t.treeNodeType,"节点类型未支持"))}const{expandFirstOnly:c,expanded:l,rootNode:h}=t,d=h&&!this.model.rootVisible;return n||await Promise.all(o.map((async(t,e)=>{var a;if(l&&(!c||c&&0===e)||(null==(a=i.defaultExpandedKeys)?void 0:a.length)&&i.defaultExpandedKeys.includes(t.id)||d){const e=await this.fetchChildNodes(t,i);t.children=e}}))),o}async getStaticNodeData(t,e,a,s){return new vi(t,a,{parentValueLevel:null==e?void 0:e.parentValueLevel,leaf:!!s.leaf})}getNodeRSFilterParams(t,e,a){const{parentValueLevel:s,navigateContexts:i,navigateParams:n,parentFilter:r,parentDER1N:o}=t,c=null==o?void 0:o.pickupDEFName,l={...a.params},h={...a.context,...(null==e?void 0:e.context)||{}};let d,u,p,m={};if(e){d=e;for(let t=1;t<s;t++)d=null==d?void 0:d.parent}if(d){m=d.deData||{};const t=Qe(this.model,d.nodeId);t.appDataEntityId&&(p=ze(t.appDataEntityId)),u=d.value}const{resultContext:f,resultParams:g}=Ve({deName:p,navFilter:r?"n_".concat(r,"_eq"):void 0,pickupDEFName:c,navParams:n,navContexts:i},{derValue:u,context:h,params:l,data:m});return Object.assign(h,f),Object.assign(l,g),{context:h,params:l,navContext:f,navParams:g}}async getDENodeDatas(t,e,a,s){const{appDEDataSetId:i,appDataEntityId:n}=t,{context:r,params:o,navContext:c,navParams:l}=e?this.getNodeRSFilterParams(e,a,s):{context:s.context,params:s.params,navContext:{},navParams:{}};o.size=t.maxSize||1e3,t.sortAppDEFieldId&&t.sortDir&&Object.assign(o,{sort:"".concat(t.sortAppDEFieldId.toLowerCase(),",").concat(t.sortDir.toLowerCase())});const h=await this.app.deService.exec(n,i,r,o);if(h.data.length){return h.data.map((e=>new wi(t,a,{data:e,leaf:!!s.leaf,navContext:c,navParams:l})))}return[]}async getCodeListNodeDatas(t,e,a,s){const{context:i,params:n,navContext:r,navParams:o}=e?this.getNodeRSFilterParams(e,a,s):{context:s.context,params:s.params,navContext:{},navParams:{}},c=await this.app.codeList.get(t.codeListId,i,n);if(c.length){return c.map((e=>new Ei(t,a,{data:e,leaf:!!s.leaf,navContext:r,navParams:o})))}return[]}})),mr=(t("TreeController",class extends Hi{constructor(){super(...arguments),this.contextMenus={}}initState(){super.initState(),this.state.defaultExpandedKeys=[],this.state.size=0}async onCreated(){await super.onCreated(),this.service=new pr(this.model),await this.service.init(this.context),this.model.detreeNodes.forEach((t=>{var e,a;(null==(a=null==(e=t.decontextMenu)?void 0:e.detoolbarItems)?void 0:a.length)&&(this.contextMenus[t.decontextMenu.id]=new Tn(t.decontextMenu,this.context,this.params,this.ctx))})),await Promise.all(Object.values(this.contextMenus).map((t=>t.created())))}async load(t={}){const e=!0===t.isInitialLoad,a=await this.loadNodes();return this.state.expandedKeys=this.calcExpandedKeys(a),await this.afterLoad(t,a),this.state.isLoaded=!0,await this.evt.emit("onLoadSuccess",{isInitialLoad:e}),a}async loadNodes(t){const e=await this.getFetchParams(),a=!!e.query,s=t?void 0:this.state.defaultExpandedKeys;let i;await this.startLoading();try{i=await this.service.fetchChildNodes(t,{context:this.context.clone(),params:e,hasQuery:a,defaultExpandedKeys:s})||[]}finally{await this.endLoading()}return t?t.children=i:this.state.rootNodes=i,this.state.items=[],m({children:this.state.rootNodes},(t=>{this.state.items.push(t)})),i}async onTreeNodeClick(t){if(this.state.singleSelect){const{selectedData:e}=this.state,a=e.filter((e=>e.id!==t.id));a.length===e.length?this.setSelection(this.state.singleSelect?[t]:e.concat([t])):this.setSelection(a)}1===this.state.mdctrlActiveMode&&await this.setActive(t)}async onDbTreeNodeClick(t){2===this.state.mdctrlActiveMode&&await this.setActive(t)}setActive(t){const e=this.parseTreeNodeData(t);return this.evt.emit("onActive",{...e,nodeData:t})}setSelection(t){const e=t.map((t=>t.id)),a=this.state.items.filter((t=>e.includes(t.id)));super.setSelection(a)}getNodeModel(t){var e;return null==(e=this.model.detreeNodes)?void 0:e.find((e=>e.id===t))}async doUIAction(t,e,a){const s=this.getEventArgs(),i=this.parseTreeNodeData(e),n=await Dn.exec(t,{...s,...i,event:a});if(n.closeView)this.view.closeView();else if(n.refresh)switch(n.refreshMode){case 1:this.refreshNodeChildren(e);break;case 2:this.refreshNodeChildren(e,!0);break;case 3:this.refresh()}}parseTreeNodeData(t){return{data:[{...t,...t.deData||{}}],context:Object.assign(this.context.clone(),t.context||{}),params:{...this.params,...t.params||{}}}}calcExpandedKeys(t){let e=[];return m({children:t},(t=>{var a;(null==(a=t.children)?void 0:a.length)&&e.push(t.id)})),this.state.defaultExpandedKeys.length&&(e.push(...this.state.defaultExpandedKeys),e=Array.from(new Set(e))),e}async refreshNodeChildren(t,e=!1){const a=t.srfkey?"srfkey":"id",s=this.state.items.find((e=>e[a]===t[a]));if(!s)return void ibiz.log.error("找不到对应的树节点数据",t);if(e){const{parent:t}=s;if(!t||!this.model.rootVisible&&this.state.rootNodes.includes(t))return void this.refresh()}const i=e?s.parent:s,n=await this.loadNodes(i);this.evt.emit("onAfterRefreshParent",{parentNode:i,children:n})}}),t("WizardPanelService",class extends di{async initialize(t,e={},a={}){var s;const i=null==(s=this.model.initControlAction)?void 0:s.appDEMethodId;let n=await this.exec(i,t,e,a);return n=this.handleResponse(n),n}async finish(t,e={},a={}){var s;const i=null==(s=this.model.finishControlAction)?void 0:s.appDEMethodId;let n=await this.exec(i,t,e,a);return n=this.handleResponse(n),n}})),fr=(t("WizardPanelController",class extends Gi{constructor(){super(...arguments),this.tagHistory=[],this.providers={},this.firstForm=void 0,this.formControllers=new Map,this.steps=[],this.stepTags={}}initState(){super.initState()}async onCreated(){var t,e;await super.onCreated(),this.model.dewizard.dewizardForms.forEach((t=>{var e,a,s;t.firstForm&&(this.firstForm=t);const i="".concat(this.model.name,"_form_").concat(null==(e=t.formTag)?void 0:e.toLowerCase()),n=null==(s=null==(a=this.model.dewizard)?void 0:a.dewizardSteps)?void 0:s.find((e=>e.id===t.dewizardStepId)),r=null==n?void 0:n.stepTag;this.stepTags[i]=r})),null==(e=null==(t=this.model.dewizard)?void 0:t.dewizardSteps)||e.forEach((t=>{this.steps.push(t.stepTag)})),this.service=new mr(this.model),await this.service.init(this.context);const{deeditForms:a}=this.model;a&&a.length>0&&await Promise.all(a.map((async t=>{const{formTag:e}=t.dewizardForm;if(e){const a=await Ka(t);a&&(this.providers[e]=a)}})))}get activeWizardForm(){const{activeFormTag:t}=this.state,e=this.model.dewizard.dewizardForms.find((e=>e.formTag===t));return e||ibiz.log.debug("找不到".concat(t,"的向导表单")),e}get activeFormController(){const{activeFormTag:t}=this.state,a=this.formControllers.get(t);if(!a)throw new e("找不到".concat(t,"的表单控制器"));return a}onFormMounted(t,e){const a=e.ctrl;this.formControllers.set(t,a),a.load()}onFormSaved(t){const e=t.data[0],a=ze(this.model.appDataEntityId);!this.context[a]&&e&&e.srfkey&&(this.context[a]=e.srfkey)}async initialize(){var t;if(null==(t=this.model.initControlAction)?void 0:t.appDEMethodId){const t=await this.service.initialize(this.context,this.params),e=ze(this.model.appDataEntityId);t.data&&t.data.srfkey&&(this.context[e]=t.data.srfkey)}this.firstForm&&(this.state.activeFormTag=this.firstForm.formTag,this.tagHistory.push(this.firstForm.formTag))}async finish(){await this.service.finish(this.context,this.params),this.evt.emit("onFinishSuccess",void 0)}async onPrevClick(){await this.activeFormController.goBack(),this.tagHistory.pop();const t=this.tagHistory[this.tagHistory.length-1];if(!t)throw new e("没有上一个表单");this.state.activeFormTag=t}async onNextClick(){const t=await this.activeFormController.save();let a;if(t.srfnextform){if(!this.model.dewizard.dewizardForms.find((e=>e.formTag===t.srfnextform)))throw new e("找不到标识为".concat(t.srfnextform,"的向导表单"));a=t.srfnextform}else{const{formTag:t}=this.activeWizardForm,s=this.model.dewizard.dewizardSteps;if(s&&t){const i=s.findIndex((e=>e.stepTag===t)),n=s[i+1];if(!n)throw new e("找不到下一个向导步骤");const r=this.model.dewizard.dewizardForms.find((t=>t.formTag===n.stepTag));r&&(a=r.formTag)}}if(!a)throw new e("找不到下一个向导表单");this.state.activeFormTag=a,this.tagHistory.push(a)}async onFinishClick(){await this.activeFormController.save(),await this.finish()}}),t("MDCtrlService",class extends ui{initUIDataMap(){var t;super.initUIDataMap(),null==(t=this.model.delistDataItems)||t.forEach((t=>{const e=t.id.toLowerCase(),a=t.appDEFieldId;let s;if(a){const t=a.toLowerCase();s=new yi(e,t,{isOriginField:!0})}else s=new yi(e,e);this.dataUIMap.set(e,s)}))}})),gr=t("MobMDCtrlRowState",class{constructor(t,e){this.data=t,this.controller=e,this.uaColStates={},this.data=t}}),Er=(t("MDCtrlController",class extends Hi{initState(){super.initState(),this.state.rows=[],this.state.noSort=!0===this.model.noSort,this.state.mdctrlActiveMode=1}async onCreated(){await super.onCreated(),this.service=new fr(this.model),await this.service.init(this.context),this.setSort()}setSort(t,e){if(t&&e)super.setSort(t,e);else{const{minorSortAppDEFieldId:t,minorSortDir:e}=this.model;this.state.sortQuery=t&&e?"".concat(t.toLowerCase(),",").concat(e.toLowerCase()):""}}async loadMore(){this.state.total>this.state.items.length&&!this.state.isLoading&&await this.load({isLoadMore:!0})}async refresh(){await this.load({isInitialLoad:!0})}afterLoad(t,e){return t.isInitialLoad&&(this.state.rows=[]),e&&e.length>0&&this.state.rows.push(...e.map((t=>{const e=new gr(t,this);return this.initActionStates(e),e}))),super.afterLoad(t,e)}setData(t){const e=t.map((t=>new gr(t,this)));this.state.rows=e}getAllData(){return this.state.rows.map((t=>t.data))}async onActionClick(t,e,a){const s=t.uiactionId;await Dn.execAndResolved(s,{context:this.context,params:this.params,data:[e.data],view:this.view,event:a})}initActionStates(t){const{deuiactionGroup:e,deuiactionGroup2:a}=this.model;e&&this.initUIActionGroup(t,e),a&&this.initUIActionGroup(t,a)}initUIActionGroup(t,e){var a;(null==(a=e.uiactionGroupDetails)?void 0:a.length)||ibiz.log.debug("操作列界面行为组没有配置界面行为");const s=new Ni;(e.uiactionGroupDetails||[]).forEach((t=>{const e=t.uiactionId;if(e){const a=new Oi(t.id,this.context.srfappid,e);s.addState(t.id,a)}})),s.update(t.data.getOrigin()),t.uaColStates[e.id]=s}}),t("HubController",class{constructor(){this.session={}}login(t,e){return ibiz.auth.login(t,e)}logout(){return ibiz.auth.logout()}})),wr=class{constructor(){this.convert=new class{constructor(){this.appMenu=new class{parse(t){return t}}}},this.controller=new Er,this.appMap=new Map,this.apps=new Map,this.view2appMap=new Map,this.views=new Map,this.dataEntities=new Map,this.config=new class{constructor(){this.view=new class{constructor(){this.viewConfigs=new Map}set(t,e){this.viewConfigs.set(t,e)}async get(t){if(!this.viewConfigs.has(t)){const a=await ibiz.hub.getAppView(t);if(!a)throw new e("视图[".concat(t,"]不存在"));this.set(a.id,{id:a.id,codeName:a.codeName,openMode:a.openMode,viewType:a.viewType,width:a.width,height:a.height,appDataEntityId:a.appDataEntityId,redirectView:a.redirectView})}return this.viewConfigs.get(t)}}}},this.defaultAppIndexViewName="Index"}calcAppViewId(t){let e="";if(-1!==t.indexOf(".")){const a=t.split(".");e=a[a.length-1]}else e=t.toLowerCase();return e}registerModelLoaderProvider(t){this.modelLoaderProvider=t}registerApp(t){this.apps.set(t.codeName,t)}registerAppView(t){this.views.set(t.codeName,t)}registerAppDataEntity(t,e=ibiz.env.appId){this.dataEntities.has(e)||this.dataEntities.set(e,new Map);this.dataEntities.get(e).set(t.id,t)}setAppView(t,e=ibiz.env.appId){const a=this.calcAppViewId(t);this.view2appMap.set(a,e)}hasAppView(t){const e=this.calcAppViewId(t);return this.view2appMap.has(e)}async getAppStyle(t){return this.modelLoaderProvider?this.modelLoaderProvider.getAppStyle(t):null}async getAppView(t){const a=this.calcAppViewId(t),s=this.view2appMap.get(a)||ibiz.env.appId;if(this.appMap.has(s)||await this.createApp(s),this.views.has(a))return this.views.get(a);if(this.modelLoaderProvider){const t=await this.modelLoaderProvider.getAppView(s,a);return this.registerAppView(t),t}throw new e("视图[".concat(a,"]不存在"))}async getAppDataEntity(t,a=ibiz.env.appId){if(this.dataEntities.has(a)){const e=this.dataEntities.get(a);if(e.has(t))return e.get(t)}if(this.modelLoaderProvider){let e;return e=-1!==t.indexOf(".")?await this.modelLoaderProvider.getAppDataEntity(a,t):await this.modelLoaderProvider.getAppDataEntityByCodeName(a,t),this.registerAppDataEntity(e,a),e}throw new e("未找到应用实体[".concat(t,"]"))}async createApp(t){if(this.appMap.has(t))return this.appMap.get(t);let a;if(this.apps.has(t))a=this.apps.get(t);else{if(!this.modelLoaderProvider)throw new e("未找到应用[".concat(t,"]模型"));a=await this.modelLoaderProvider.getApp(t),this.registerApp(a)}const s=new Ci(a);return this.appMap.set(t,s),await s.init(),s}async getAppAsync(t=ibiz.env.appId){return this.createApp(t)}getApp(t){let e=null;return e=t?t instanceof Object?t.id:t:ibiz.env.appId,this.appMap.get(e)}},vr=t("EngineFactory",class{constructor(){this.viewEngines=new Map}register(t,e){this.viewEngines.set(t,e)}unRegister(t){this.viewEngines.delete(t)}getEngine(t,...e){const{engineType:a,engineCat:s}=t,i="".concat(s,"_").concat(a),n=this.viewEngines.get(i);if(n)return n(...e);ibiz.log.error("没有".concat(i,"对应的引擎"),t)}}),yr=t("ViewEngineBase",class{constructor(t){this.view=t,this.initViewState()}get toolbar(){return this.view.getController("toolbar")}get leftToolbar(){return this.view.getController("lefttoolbar")}get rightToolbar(){return this.view.getController("righttoolbar")}get footerToolbar(){return this.view.getController("footertoolbar")}get viewLayoutPanel(){return this.view.layoutPanel}async onCreated(){const{childNames:t}=this.view;t.push("captionbar","toolbar")}async onMounted(){var t,e;const{model:a,childNames:s}=this.view;ibiz.log.debug("".concat(a.id,"的子组件:").concat(s.join(";"),"都已mounted"));if(!this.calcViewHeaderVisible()){const e=null==(t=this.viewLayoutPanel)?void 0:t.panelItems.view_header;e&&(e.state.visible=!1)}if(ibiz.env.isMob){if(!this.calcViewFooterVisible()){const t=null==(e=this.viewLayoutPanel)?void 0:e.panelItems.view_footer;t&&(t.state.visible=!1)}}}async onDestroyed(){}async call(t,e){if("GetData"===t)return this.getData()}initViewState(){}getData(){return[]}calcViewHeaderVisible(){var t,e,a,s;let i=!1;const{model:n}=this.view;if(!1===n.showCaptionBar){const e=null==(t=this.viewLayoutPanel)?void 0:t.panelItems.view_captionbar;e&&(e.state.visible=!1)}else i=!0;if(ibiz.env.isMob){if(this.leftToolbar)i=!0;else{const t=null==(e=this.viewLayoutPanel)?void 0:e.panelItems.lefttoolbar;t&&(t.state.visible=!1)}if(this.rightToolbar)i=!0;else{const t=null==(a=this.viewLayoutPanel)?void 0:a.panelItems.righttoolbar;t&&(t.state.visible=!1)}}else if(this.toolbar)i=!0;else{const t=null==(s=this.viewLayoutPanel)?void 0:s.panelItems.view_toolbar;t&&(t.state.visible=!1)}return i}calcViewFooterVisible(){let t=!1;return this.footerToolbar&&(t=!0),t}async loadEntityData(){const{appDataEntityId:t}=this.view.model,{evt:a,context:s,params:i}=this.view;if(!t)throw new e("该视图没有实体,无法加载实体数据");const n=ibiz.hub.getApp(s.srfappid),r=await n.deService.exec(t,"get",s,i),{data:o}=r;o&&(this.view.state.srfactiveviewdata=o,a.emit("onDataChange",{actionType:"LOAD",data:[o]}),o.srfkey&&a.emit("onViewInfoChange",{dataInfo:o.srfmajortext||""}))}}),Ir=(t("MDViewEngine",class extends yr{get xdataControlName(){return this.view.model.xdataControlName}get searchForm(){return this.view.getController("searchform")}get searchBar(){return this.view.getController("searchbar")}get xdataControl(){return this.view.getController(this.xdataControlName)}async onCreated(){await super.onCreated();const{childNames:t}=this.view;t.push(this.xdataControlName,"searchform","searchbar")}async onMounted(){await super.onMounted();const{model:t}=this.view;this.xdataControl.evt.on("onActive",this.onXDataActive.bind(this)),this.xdataControl.evt.on("onSelectionChange",(async t=>{var e;null==(e=this.toolbar)||e.calcButtonState(t.data[0],this.xdataControl.model.appDataEntityId)})),this.xdataControl.evt.on("onBeforeLoad",(()=>{this.xdataControl.state.searchParams=this.getSearchParams()})),this.xdataControl.evt.on("onLoadSuccess",(t=>{this.view.evt.emit("onDataChange",{...t,actionType:"LOAD"})})),this.xdataControl.evt.on("onRemoveSuccess",(t=>{this.view.evt.emit("onDataChange",{...t,actionType:"REMOVE"})})),this.xdataControl.evt.on("onSaveSuccess",(t=>{this.view.evt.emit("onDataChange",{...t,actionType:"SAVE"})}));const e=this.viewLayoutPanel.panelItems.view_searchform;if(e){const a=!!this.searchForm;e.state.keepAlive=a,e.state.visible=a&&!!t.expandSearchForm}this.searchForm&&this.searchForm.evt.on("onSearch",(()=>{this.reLoad()})),this.searchBar&&this.searchBar.evt.on("onSearch",(()=>{this.reLoad()})),!this.view.state.noLoadDefault&&t.loadDefault&&this.load()}async onXDataActive(t){await this.openData(t)}async call(t,e){return"ToggleFilter"===t?(this.toggleFilter(),null):"Edit"===t||"View"===t?(await this.openData(e),null):"New"===t?(await this.newData(e),null):"Remove"===t?(await this.remove(e),null):"Import"===t?(await this.importData(),null):"Refresh"===t?(await this.refresh(),null):"ExportExcel"===t?(await this.exportData(e),null):"Copy"===t?(this.copy(e),null):"Load"===t?(this.load(e),null):super.call(t,e)}getData(){return this.xdataControl.getData()}async openData(t){var e,a;const{data:s,event:i}=t,n=(t.context||this.view.context).clone(),r=t.params||this.view.params;n[((null==(e=s[0].srfdecodename)?void 0:e.toLowerCase())||ze(this.xdataControl.model.appDataEntityId)).toLowerCase()]=s[0].srfkey;const o=await(null==(a=this.view.scheduler)?void 0:a.triggerCustom("opendata",{context:n,params:r,data:s,event:i,view:this.view}));o instanceof Object&&o.ok?this.refresh():-1===o&&ibiz.log.warn("视图[".concat(this.view.model.codeName,"],未配置编辑打开视图"))}async newData(t){var e,s,i;const{data:n,event:r,copyMode:o}=t;if(!(null==(s=null==(e=this.view.model.viewLayoutPanel)?void 0:e.appViewLogics)?void 0:s.find((t=>"newdata"===t.id))))throw new a(this.view.model,"缺少newdata的视图逻辑");const c=this.view.context.clone();o&&(c.srfcopymode=!0);const l=await(null==(i=this.view.scheduler)?void 0:i.triggerCustom("newdata",{context:c,params:this.view.params,data:n,event:r,view:this.view}));if(l instanceof Object&&l.ok)this.refresh();else if(-1===l)throw new a(this.view.model,"缺少newdata的视图逻辑")}async remove(t){await this.xdataControl.remove(t)}async load(t={}){await this.xdataControl.load({isInitialLoad:!0,...t})}async refresh(){await this.xdataControl.refresh()}async reLoad(){await this.xdataControl.load({isInitialLoad:!0})}getSearchParams(){var t;const e={};if(this.searchForm){const t=this.searchForm.getData()[0],a=Object.entries(t).reduce(((t,[e,a])=>(null!=a&&""!==a&&(t[e]=a),t)),{});Object.assign(e,a)}if(this.searchBar){if(this.searchBar.state.query){const t={query:this.searchBar.state.query};Object.assign(e,t)}if(null==(t=this.searchBar.state.selectedGroupItem)?void 0:t.data){const t=new Function("return (".concat(this.searchBar.state.selectedGroupItem.data,");"))();Object.assign(e,t)}}return e}async importData(){await this.xdataControl.importData()}async exportData(t){await this.xdataControl.exportData(t)}async copy(t){this.newData(Object.assign(t,{copyMode:!0}))}calcViewHeaderVisible(){let t=super.calcViewHeaderVisible();if(this.searchBar&&this.searchBar.state.visible)t=!0;else{const t=this.viewLayoutPanel.panelItems.view_searchbar;t&&(t.state.visible=!1)}return t}toggleFilter(){if(this.searchForm){const t=this.viewLayoutPanel.panelItems.view_searchform;t&&(t.state.visible=!t.state.visible)}}}),class{constructor(){this.layoutPanel=new wa,this.text=new Ta,this.hbs=new Te}showAppLoading(){const t=document.getElementById("app-loading-x");t&&(t.style.display="none")}hiddenAppLoading(){setTimeout((()=>{const t=document.getElementById("app-loading-x");t&&(t.style.display="none")}),300)}}),Dr=class{constructor(t,e){this.logic=t,this.scheduler=e,this.type=t.logicType}execute(t){throw new e("Method not implemented.")}destroy(){}},Cr=class extends Dr{constructor(){super(...arguments),this.initialized=!1}convertScriptArgs(t){return t}init(t,e,a){this.convertScriptArgs=e;const s=this.logic.scriptCode;this.scriptFn=pa.createScriptFn(t,s,a),this.initialized=!0}execute(t){const e=this.convertScriptArgs(t);return this.scriptFn.exec(e)}},br=class extends Dr{execute(t){const{appDEUILogicId:e,appDataEntityId:s}=this.logic;if(!e)throw new a(this.logic,"没有配置实体界面逻辑");In(e,s,t)}},Ar=class{constructor(t){this.triggers=new Map,this.executors=new Map,this.hasViewEventTrigger=!1,this.hasControlEventTrigger=!1,this.logics=t,t.forEach((t=>{try{const e=this.createExecutor(t);this.executors.set(t.id,e);const a=this.createTrigger(t);this.triggers.set(t.id,a),a.bindExecutor(e)}catch(t){ibiz.log.error(t.message)}}))}destroy(){this.triggers.forEach((t=>t.destroy())),this.executors.forEach((t=>t.destroy()))}getExecuteParams(t){let e={};return this.defaultParamsCb&&(e=this.defaultParamsCb()),et(t,e)}createTrigger(t){switch(t.triggerType){case"VIEWEVENT":this.hasViewEventTrigger=!0;break;case"CTRLEVENT":this.hasControlEventTrigger=!0}return ibiz.scheduler.triggerFactory.createTrigger(t,this)}createExecutor(t){return ibiz.scheduler.executorFactory.createExecutor(t,this)}getMatchTriggers(t){const e=[];return this.triggers.forEach((a=>{a.match(t)&&e.push(a)})),e}triggerAndExecute(t,e={}){const a=this.getMatchTriggers(t);if(a.length>0){const t=this.getExecuteParams(e);return a.map((e=>e.execute(t)))}}triggerItemDynaLogic(t,e,a){const s={itemName:t,triggerType:e},i=this.triggerAndExecute(s,a);if(null==i?void 0:i.length)return i.pop()}triggerItemVisible(t,e){return this.triggerItemDynaLogic(t,"ITEMVISIBLE",e)}triggerItemEnable(t,e){return this.triggerItemDynaLogic(t,"ITEMENABLE",e)}triggerItemBlank(t,e){return this.triggerItemDynaLogic(t,"ITEMBLANK",e)}startTimerTrigger(){this.getMatchTriggers({triggerType:"TIMER"}).forEach((t=>t.start()))}triggerCustom(t,e){const a=this.triggers.get(t);if(!a)return-1;const s=this.getExecuteParams(e);return a.execute(s)}triggerControlEvent(t,e){const a={ctrlName:t,eventName:e.eventName,triggerType:"CTRLEVENT"};this.triggerAndExecute(a,e)}},Pr=class extends Ar{constructor(t){super(t.filter((t=>"APPVIEWENGINE"!==t.triggerType)))}},_r=class extends Ar{constructor(t){t.forEach((t=>{t.triggerType=t.logicTrigger})),super(t)}triggerViewEvent(t){const e={eventName:t.eventName,triggerType:"VIEWEVENT"};this.triggerAndExecute(e,t)}},Sr=class{constructor(){this.executorFactory=new class{constructor(){this.constructorMap=new Map}register(t,e){this.constructorMap.set(t,e)}createExecutor(t,e){const a=this.constructorMap.get(t.logicType);if(!a)throw new s(t,"逻辑类型 ".concat(t.logicType," 暂未支持!"));return a(t,e)}},this.triggerFactory=new class{constructor(){this.constructorMap=new Map}register(t,e){this.constructorMap.set(t,e)}createTrigger(t,e){const a=this.constructorMap.get(t.triggerType);if(!a)throw new s(t,"触发器类型 ".concat(t.triggerType," 暂未支持!"));return a(t,e)}}}createViewScheduler(t){return new _r(t)}createControlScheduler(t){return new Pr(t)}},xr=class{constructor(t,e){this.logic=t,this.scheduler=e,this.type=t.triggerType}bindExecutor(t){this.executor=t,"SCRIPT"===this.executor.type&&this.bindScriptExecutor(t)}bindScriptExecutor(t){t.initialized||t.init([],(t=>t),{isAsync:!0,singleRowReturn:!1})}match(t){return t.triggerType===this.type}execute(t){if(this.executor)return this.executor.execute(t);throw new e("".concat(this.logic.id,"没有绑定executor"))}destroy(){this.executor=void 0}},Tr=class extends xr{},Lr=class extends xr{bindExecutor(t){if(super.bindExecutor(t),"SCRIPT"!==this.executor.type)throw new e("预定义逻辑类型".concat(this.type,"的触发器类型只能是脚本"))}bindScriptExecutor(t){t.init(["context","viewparams","data","env"],(t=>{const{context:e,params:a,data:s}=t;return{context:e,params:a,data:(null==s?void 0:s[0])||{},env:ibiz.env}}),{singleRowReturn:!0,isAsync:!1})}match(t){return super.match(t)&&t.itemName===this.logic.itemName}execute(t){const a=this.executor.execute(t);if("boolean"==typeof a)return a;throw new e("".concat(this.logic.id,"逻辑返回值不是布尔值"))}},Or=class extends xr{constructor(){super(...arguments),this.timer=null}start(){this.timer=setInterval((()=>{if(!this.scheduler.defaultParamsCb)throw new e("定时器缺少默认参数回调");const t=this.scheduler.defaultParamsCb();this.executor.execute(t)}),this.logic.timer)}destroy(){super.destroy(),this.timer&&clearInterval(this.timer)}},Nr=class extends Dr{execute(t){return"opendata"===this.logic.id&&this.logic.builtinAppUILogic?this.executeOpenDataAppUILogic(this.logic.builtinAppUILogic,t):"newdata"===this.logic.id&&this.logic.builtinAppUILogic?this.executeNewDataAppUILogic(this.logic.builtinAppUILogic,t):void 0}async executeOpenDataAppUILogic(t,s){const{context:i,params:n,...r}=s,{data:o}=s;if(!(null==o?void 0:o[0]))throw new e("opendata没有可操作数据!");let c;if(t.openDataAppViews)c=await this.calcOpenViewRef(t,s);else if(c=t.openDataAppView,!c)throw new a(t,"opendata视图逻辑没有配置默认打开视图");const l=c.refAppViewId;if(!l)throw new a(t,"opendata视图逻辑的默认打开视图没有实际引用视图");const h=c.navigateContexts||[],d=Object.assign(i,Le(h,i,n,o[0]));let u={};const p=c.navigateParams;return V(p)&&(u=Le(p,n,i,o[0])),ibiz.commands.execute(Oa.TAG,l,d,u,r)}async executeNewDataAppUILogic(t,e){const{context:i,params:n,...r}=e,{data:o}=e,{enableWizardAdd:c,enableBatchAdd:l,batchAddOnly:h,newDataAppView:d}=t;let u;if(c){if(u=await this.getWizardNewViewRef(t,e),!u)return{ok:!1}}else{if(l)throw new s(t,"enableBatchAdd暂未支持");if(h)throw new s(t,"batchAddOnly暂未支持");if(u=d,!u||!u.refAppViewId)throw new a(t,"newdata视图逻辑没有配置默认新建数据视图")}let p={},m={};const f=(null==o?void 0:o[0])||{},g=u.navigateContexts;V(g)&&(p=Le(g,i,n,f)),p=Object.assign(i,p);const E=u.navigateParams;return V(E)&&(m=Le(E,n,i,f)),i.srfcopymode&&(f.srfkey=void 0,m=Object.assign(m,f.$origin)),ibiz.commands.execute(Oa.TAG,u.refAppViewId,p,m,r)}async getWizardNewViewRef(t,s){var i;const{wizardAppView:n,newDataAppViews:r}=t,{context:o,params:c,...l}=s;if(!n||!n.refAppViewId)throw new a(t,"缺少默认索引实体选择视图");const h=await ibiz.commands.execute(Oa.TAG,n.refAppViewId,o,c,{...l,openMode:"POPUPMODAL"});if(!h.ok)return;const d=null==(i=h.data)?void 0:i[0];if(!d)throw new e("请选中一条数据");const u=d.srfkey,p=null==r?void 0:r.find((t=>t.refMode===u));if(!p)throw new e("没有找到与索引类型".concat(u,"相关的实体的编辑视图"));return p}async calcOpenViewRef(t,s){const i=s.view.model.appDataEntityId,n=await He(i);if(!n)throw new a(t,"".concat(i,"实体缺少表单类型应用实体属性"));const{data:r}=s,o=r[0][n];if(!o)throw new a(t,"数据源无表单类型应用实体属性值");const c=t.openDataAppViews,l=null==c?void 0:c.find((t=>t.refMode===o));if(!l)throw new e("没有找到与表单类型".concat(o,"相关的实体的编辑视图"));return l}},Rr=class extends xr{constructor(t,e){super(t,e),this.logic=t,this.scheduler=e,this.listenEventNames=[];const a=t.eventNames.split(";");this.listenEventNames=a.map((t=>Aa[t]||t))}match(t){return super.match(t)&&this.listenEventNames.includes(t.eventName)}},Mr=class extends xr{constructor(t,e){super(t,e),this.logic=t,this.scheduler=e,this.listenEventNames=[];const a=t.eventNames.split(";");this.listenEventNames=a.map((t=>_a[t]||t))}match(t){return super.match(t)&&t.ctrlName===this.logic.ctrlName&&this.listenEventNames.includes(t.eventName)}};var Vr=Et(re(),1);t("PluginStaticResource",class{constructor(t){this.styleElementMap=new Map,this.url=new URL(t);const e=Vr.default.dirname(this.url.pathname);this.baseDir=e}dir(t){return Vr.default.resolve(this.baseDir,t)}async loadStyle(t){const e=t.map((t=>{const e=this.dir(t);return!this.styleElementMap.has(e)&&(this.styleElementMap.set(e,null),new Promise(((t,a)=>{const s=document.createElement("link");s.setAttribute("type","text/css"),s.setAttribute("rel","stylesheet"),s.setAttribute("href",e),s.onload=t,s.onerror=a,document.head.appendChild(s)})))}));try{await Promise.all(e)}catch(t){ibiz.log.error(t)}}}),t("RemotePluginItem",class{constructor(t,e,a){this.tag=t,this.repo=e,this.config=a}})}}}));
|
|
1
|
+
System.register(["@ibiz-template/core","lodash-es","qx-util","qs","ramda","dayjs","dayjs/plugin/minMax","dayjs/plugin/isSameOrBefore","dayjs/plugin/quarterOfYear","dayjs/plugin/weekOfYear","dayjs/plugin/isoWeek","async-validator"],(function(t){"use strict";var e,a,s,i,n,r,o,c,l,h,d,u,p,m,f,g,w,E,v,y,I,D,C,A,b,P,_,S,x,T,L,N,O,R,M,k,V,F,W,B,U,j,z,G,H,X,K,Y,$,q,Q,J,Z,tt,et,at,st,it,nt,rt,ot,ct,lt;return{setters:[function(t){e=t.RuntimeError,a=t.RuntimeModelError,s=t.ModelError,i=t.IBizContext,n=t.HttpResponse,r=t.HttpError,o=t.DataTypes,c=t.CoreConst,l=t.Net,h=t.NOOP,d=t.NoticeError,u=t.isElementSame,p=t.findRecursiveChild,m=t.StringUtil,f=t.recursiveIterate,g=t.debounceAndAsyncMerge,w=t.mergeDefaultInLeft,E=t.isOverlap,v=t.awaitTimeout,y=t.mergeInLeft,I=t.toNumberOrNil},function(t){D=t.isEmpty,C=t.debounce,A=t.isArray,b=t.camelCase,P=t.eq,_=t.gt,S=t.gte,x=t.findIndex,T=t.lt,L=t.lte,N=t.upperFirst,O=t.snakeCase,R=t.kebabCase,M=t.isFunction},function(t){k=t.notNilEmpty,V=t.isNilOrEmpty,F=t.AsyncSeriesHook,W=t.QXEvent,B=t.createUUID,U=t.isArray,j=t.setCookie,z=t.clearCookie,G=t.clearAll,H=t.ascSort,X=t.descSort},function(t){K=t.default},function(t){Y=t.isNotNil,$=t.isNil,q=t.mergeRight,Q=t.isEmpty,J=t.clone,Z=t.equals,tt=t.where,et=t.mergeLeft,at=t.mergeDeepRight},function(t){st=t.default},function(t){it=t.default},function(t){nt=t.default},function(t){rt=t.default},function(t){ot=t.default},function(t){ct=t.default},function(t){lt=t.default}],execute:function(){t({calcContentAlignStyle:function(t){const{valignSelf:e,halignSelf:a}=t;let s;if(e||a){switch(s={display:"flex"},e){case"TOP":Object.assign(s,{"align-items":"flex-start"});break;case"MIDDLE":Object.assign(s,{"align-items":"center"});break;case"BOTTOM":Object.assign(s,{"align-items":"flex-end"})}switch(a){case"LEFT":Object.assign(s,{"justify-content":"flex-start"});break;case"CENTER":Object.assign(s,{"justify-content":"center"});break;case"RIGHT":Object.assign(s,{"justify-content":"flex-end"});break;case"JUSTIFY":Object.assign(s,{"justify-content":"space-between"})}}return s},calcDeCodeNameById:ze,calcDynaClass:Be,calcGridLayoutPos:function(t){const{layout:e,colXS:a,colXSOffset:s,colSM:i,colSMOffset:n,colMD:r,colMDOffset:o,colLG:c,colLGOffset:l}=t,h=(t,a)=>({span:(t&&-1!==t?t:"TABLE_24COL"===e?24:12)*("TABLE_24COL"===e?1:2),offset:a&&-1!==a?a:void 0});return{xs:h(a,s),sm:h(i,n),md:h(r,o),lg:h(c,l)}},calcLayoutHeightWidth:We,calcMainStateOPPrivsStrs:je,calcNavParams:ke,calcResPath:xs,compare:oa,compareNumber:ca,contains:la,convertNavData:Le,convertNavDataByArray:Ne,convertNavDataByObject:Oe,convertObjectToNavParams:Re,execDELogic:ii,execDELogicAction:ri,execDELogicById:ni,execFieldLogics:oi,execUILogic:Ln,filterFieldLogics:Ke,filterValueRules:xa,findChildFormDetails:ta,findDELogic:Xe,findEditItem:Ze,findFieldById:Ye,findModelChild:Ve,formatMultiData:Me,generateRules:Wi,getAppCounterProvider:Es,getAppViewRef:function(t,e){var a,s;let i=t.appViewRefs||[];(null==(s=null==(a=t.viewLayoutPanel)?void 0:a.appViewRefs)?void 0:s.length)&&(i=i.concat(t.viewLayoutPanel.appViewRefs));return i.find((t=>t.name===e||t.id===e))},getChildNodeRSs:Je,getControl:function(t,e){var a,s;let i=t.controls||[];(null==(s=null==(a=t.viewLayoutPanel)?void 0:a.controls)?void 0:s.length)&&(i=i.concat(t.viewLayoutPanel.controls));return i.find((t=>t.name===e||t.codeName===e||t.id===e))},getControlProvider:Ka,getControlsByView:ea,getDeACMode:async function(t,e,a){var s;const i=await ibiz.hub.getAppDataEntity(e,a);return null==(s=i.appDEACModes)?void 0:s.find((e=>e.id===t))},getEditorProvider:qa,getFormDetailProvider:Za,getFormTypeFieldName:He,getGridColumnProvider:as,getMatchResPath:Ss,getOriginData:Fi,getPanelItemProvider:ns,getPortletProvider:ms,getRootNode:qe,getTreeNode:Qe,getUIActionById:$e,getUIActionProvider:ls,getViewEngines:sa,getViewLogics:aa,getViewProvider:async function(t){let e;const{viewType:a,viewStyle:s,sysPFPluginId:i,appId:n}=t;if(i){const t=await Ga(i,n);if(t&&(e=ds(t)),e)return e;ibiz.log.error("找不到视图插件".concat(t,"对应的适配器"))}if(s&&"DEFAULT"!==s){if(e=ds("".concat(a,"_").concat(s)),e)return e;ibiz.log.error("找不到视图类型:[".concat(a,"]的视图样式:[").concat(s,"]对应的适配器"),t)}e||(e=ds(a));e||(e=ds("DEFAULT"));return e},getWFContext:va,getWFSubmitViewId:function(t,e){var a;const{type:s,sequenceflowview:i,sequenceflowmobview:n}=e,r=(null==(a=t.viewLayoutPanel)?void 0:a.appViewRefs)||t.appViewRefs,o=s?"WFUTILACTION@".concat(s.toUpperCase()):"WFACTION@".concat(ibiz.env.isMob?n:i),c=r.find((t=>t.name===o));return null==c?void 0:c.refAppViewId},hasDeCodeName:Ge,install:function(){const{ibiz:t}=window;t.util=new Or,t.hub=new Tr,t.register=new ce,t.config=new oe,t.auth=new gi,t.engine=new Lr,Ma(),Fn(),Ds(),ibiz.scheduler=new Br,ibiz.scheduler.triggerFactory.register("ITEMVISIBLE",((t,e)=>new zr(t,e))),ibiz.scheduler.triggerFactory.register("ITEMENABLE",((t,e)=>new zr(t,e))),ibiz.scheduler.triggerFactory.register("ITEMBLANK",((t,e)=>new zr(t,e))),ibiz.scheduler.triggerFactory.register("TIMER",((t,e)=>new Gr(t,e))),ibiz.scheduler.triggerFactory.register("CUSTOM",((t,e)=>new jr(t,e))),ibiz.scheduler.triggerFactory.register("VIEWEVENT",((t,e)=>new Xr(t,e))),ibiz.scheduler.triggerFactory.register("CTRLEVENT",((t,e)=>new Kr(t,e))),ibiz.scheduler.executorFactory.register("SCRIPT",((t,e)=>new Mr(t,e))),ibiz.scheduler.executorFactory.register("APPDEUILOGIC",((t,e)=>new kr(t,e))),ibiz.scheduler.executorFactory.register("DEUILOGIC",((t,e)=>new kr(t,e))),ibiz.scheduler.executorFactory.register("APPUILOGIC",((t,e)=>new Hr(t,e)))},installCommand:Ma,isDataContainer:function(t){return"CONTAINER"===t.itemType&&["CONTAINER_MULTIDATA","CONTAINER_SINGLEDATA"].includes(t.predefinedType)},isValueChange:Vi,matchMainState:Ue,openRedirectView:ia,parseUserParams:Fe,presetAppCounterProvider:Ds,presetUIActionProvider:Fn,registerAppCounterProvider:gs,registerControlProvider:function(t,e){ibiz.register.register("".concat(Ha,"_").concat(t),e)},registerEditorProvider:function(t,e){ibiz.register.register("".concat(Ya,"_").concat(t),e)},registerFormDetailProvider:function(t,e){ibiz.register.register("".concat(Qa,"_").concat(t),e)},registerGridColumnProvider:function(t,e){ibiz.register.register("".concat(ts,"_").concat(t),e)},registerPanelItemProvider:function(t,e){ibiz.register.register("".concat(ss,"_").concat(t.toUpperCase()),e)},registerPortletProvider:function(t,e){ibiz.register.register("".concat(us,"_").concat(t),e)},registerUIActionProvider:os,registerViewProvider:function(t,e){ibiz.register.register("".concat(hs,"_").concat(t),e)},strContain:ha,testCond:ra,toLocalOpenWFRedirectView:na,verifyDeRules:ma,verifyFormGroupLogic:ga,verifyPanelGroupLogic:wa});var ht=Object.create,dt=Object.defineProperty,ut=Object.getOwnPropertyDescriptor,pt=Object.getOwnPropertyNames,mt=Object.getPrototypeOf,ft=Object.prototype.hasOwnProperty,gt=(t,e)=>function(){return e||(0,t[pt(t)[0]])((e={exports:{}}).exports,e),e.exports},wt=(t,e,a)=>(a=null!=t?ht(mt(t)):{},((t,e,a,s)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let i of pt(e))ft.call(t,i)||i===a||dt(t,i,{get:()=>e[i],enumerable:!(s=ut(e,i))||s.enumerable});return t})(!e&&t&&t.__esModule?a:dt(a,"default",{value:t,enumerable:!0}),t)),Et=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/utils.js"(t){t.__esModule=!0,t.extend=n,t.indexOf=function(t,e){for(var a=0,s=t.length;a<s;a++)if(t[a]===e)return a;return-1},t.escapeExpression=function(t){if("string"!=typeof t){if(t&&t.toHTML)return t.toHTML();if(null==t)return"";if(!t)return t+"";t=""+t}if(!s.test(t))return t;return t.replace(a,i)},t.isEmpty=function(t){return!t&&0!==t||!(!c(t)||0!==t.length)},t.createFrame=function(t){var e=n({},t);return e._parent=t,e},t.blockParams=function(t,e){return t.path=e,t},t.appendContextPath=function(t,e){return(t?t+".":"")+e};var e={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},a=/[&<>"'`=]/g,s=/[&<>"'`=]/;function i(t){return e[t]}function n(t){for(var e=1;e<arguments.length;e++)for(var a in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],a)&&(t[a]=arguments[e][a]);return t}var r=Object.prototype.toString;t.toString=r;var o=function(t){return"function"==typeof t};o(/x/)&&(t.isFunction=o=function(t){return"function"==typeof t&&"[object Function]"===r.call(t)}),t.isFunction=o;var c=Array.isArray||function(t){return!(!t||"object"!=typeof t)&&"[object Array]"===r.call(t)};t.isArray=c}}),vt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/exception.js"(t,e){t.__esModule=!0;var a=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function s(t,e){var i=e&&e.loc,n=void 0,r=void 0,o=void 0,c=void 0;i&&(n=i.start.line,r=i.end.line,o=i.start.column,c=i.end.column,t+=" - "+n+":"+o);for(var l=Error.prototype.constructor.call(this,t),h=0;h<a.length;h++)this[a[h]]=l[a[h]];Error.captureStackTrace&&Error.captureStackTrace(this,s);try{i&&(this.lineNumber=n,this.endLineNumber=r,Object.defineProperty?(Object.defineProperty(this,"column",{value:o,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:c,enumerable:!0})):(this.column=o,this.endColumn=c))}catch(t){}}s.prototype=new Error,t.default=s,e.exports=t.default}}),yt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers/block-helper-missing.js"(t,e){t.__esModule=!0;var a=Et();t.default=function(t){t.registerHelper("blockHelperMissing",(function(e,s){var i=s.inverse,n=s.fn;if(!0===e)return n(this);if(!1===e||null==e)return i(this);if(a.isArray(e))return e.length>0?(s.ids&&(s.ids=[s.name]),t.helpers.each(e,s)):i(this);if(s.data&&s.ids){var r=a.createFrame(s.data);r.contextPath=a.appendContextPath(s.data.contextPath,s.name),s={data:r}}return n(e,s)}))},e.exports=t.default}}),It=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers/each.js"(t,e){t.__esModule=!0;var a,s=Et(),i=vt(),n=(a=i)&&a.__esModule?a:{default:a};t.default=function(t){t.registerHelper("each",(function(t,e){if(!e)throw new n.default("Must pass iterator to #each");var a,i=e.fn,r=e.inverse,o=0,c="",l=void 0,h=void 0;function d(e,a,n){l&&(l.key=e,l.index=a,l.first=0===a,l.last=!!n,h&&(l.contextPath=h+e)),c+=i(t[e],{data:l,blockParams:s.blockParams([t[e],e],[h+e,null])})}if(e.data&&e.ids&&(h=s.appendContextPath(e.data.contextPath,e.ids[0])+"."),s.isFunction(t)&&(t=t.call(this)),e.data&&(l=s.createFrame(e.data)),t&&"object"==typeof t)if(s.isArray(t))for(var u=t.length;o<u;o++)o in t&&d(o,o,o===t.length-1);else if("function"==typeof Symbol&&t[Symbol.iterator]){for(var p=[],m=t[Symbol.iterator](),f=m.next();!f.done;f=m.next())p.push(f.value);for(u=(t=p).length;o<u;o++)d(o,o,o===t.length-1)}else a=void 0,Object.keys(t).forEach((function(t){void 0!==a&&d(a,o-1),a=t,o++})),void 0!==a&&d(a,o-1,!0);return 0===o&&(c=r(this)),c}))},e.exports=t.default}}),Dt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js"(t,e){t.__esModule=!0;var a,s=vt(),i=(a=s)&&a.__esModule?a:{default:a};t.default=function(t){t.registerHelper("helperMissing",(function(){if(1!==arguments.length)throw new i.default('Missing helper: "'+arguments[arguments.length-1].name+'"')}))},e.exports=t.default}}),Ct=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers/if.js"(t,e){t.__esModule=!0;var a,s=Et(),i=vt(),n=(a=i)&&a.__esModule?a:{default:a};t.default=function(t){t.registerHelper("if",(function(t,e){if(2!=arguments.length)throw new n.default("#if requires exactly one argument");return s.isFunction(t)&&(t=t.call(this)),!e.hash.includeZero&&!t||s.isEmpty(t)?e.inverse(this):e.fn(this)})),t.registerHelper("unless",(function(e,a){if(2!=arguments.length)throw new n.default("#unless requires exactly one argument");return t.helpers.if.call(this,e,{fn:a.inverse,inverse:a.fn,hash:a.hash})}))},e.exports=t.default}}),At=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers/log.js"(t,e){t.__esModule=!0,t.default=function(t){t.registerHelper("log",(function(){for(var e=[void 0],a=arguments[arguments.length-1],s=0;s<arguments.length-1;s++)e.push(arguments[s]);var i=1;null!=a.hash.level?i=a.hash.level:a.data&&null!=a.data.level&&(i=a.data.level),e[0]=i,t.log.apply(t,e)}))},e.exports=t.default}}),bt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers/lookup.js"(t,e){t.__esModule=!0,t.default=function(t){t.registerHelper("lookup",(function(t,e,a){return t?a.lookupProperty(t,e):t}))},e.exports=t.default}}),Pt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers/with.js"(t,e){t.__esModule=!0;var a,s=Et(),i=vt(),n=(a=i)&&a.__esModule?a:{default:a};t.default=function(t){t.registerHelper("with",(function(t,e){if(2!=arguments.length)throw new n.default("#with requires exactly one argument");s.isFunction(t)&&(t=t.call(this));var a=e.fn;if(s.isEmpty(t))return e.inverse(this);var i=e.data;return e.data&&e.ids&&((i=s.createFrame(e.data)).contextPath=s.appendContextPath(e.data.contextPath,e.ids[0])),a(t,{data:i,blockParams:s.blockParams([t],[i&&i.contextPath])})}))},e.exports=t.default}}),_t=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers.js"(t){function e(t){return t&&t.__esModule?t:{default:t}}t.__esModule=!0,t.registerDefaultHelpers=function(t){a.default(t),s.default(t),i.default(t),n.default(t),r.default(t),o.default(t),c.default(t)},t.moveHelperToHooks=function(t,e,a){t.helpers[e]&&(t.hooks[e]=t.helpers[e],a||delete t.helpers[e])};var a=e(yt()),s=e(It()),i=e(Dt()),n=e(Ct()),r=e(At()),o=e(bt()),c=e(Pt())}}),St=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/decorators/inline.js"(t,e){t.__esModule=!0;var a=Et();t.default=function(t){t.registerDecorator("inline",(function(t,e,s,i){var n=t;return e.partials||(e.partials={},n=function(i,n){var r=s.partials;s.partials=a.extend({},r,e.partials);var o=t(i,n);return s.partials=r,o}),e.partials[i.args[0]]=i.fn,n}))},e.exports=t.default}}),xt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/decorators.js"(t){t.__esModule=!0,t.registerDefaultDecorators=function(t){s.default(t)};var e,a=St(),s=(e=a)&&e.__esModule?e:{default:e}}}),Tt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/logger.js"(t,e){t.__esModule=!0;var a=Et(),s={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(t){if("string"==typeof t){var e=a.indexOf(s.methodMap,t.toLowerCase());t=e>=0?e:parseInt(t,10)}return t},log:function(t){if(t=s.lookupLevel(t),"undefined"!=typeof console&&s.lookupLevel(s.level)<=t){var e=s.methodMap[t];console[e]||(e="log");for(var a=arguments.length,i=Array(a>1?a-1:0),n=1;n<a;n++)i[n-1]=arguments[n];console[e].apply(console,i)}}};t.default=s,e.exports=t.default}}),Lt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/internal/create-new-lookup-object.js"(t){t.__esModule=!0,t.createNewLookupObject=function(){for(var t=arguments.length,a=Array(t),s=0;s<t;s++)a[s]=arguments[s];return e.extend.apply(void 0,[Object.create(null)].concat(a))};var e=Et()}}),Nt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/internal/proto-access.js"(t){t.__esModule=!0,t.createProtoAccessControl=function(t){var e=Object.create(null);e.constructor=!1,e.__defineGetter__=!1,e.__defineSetter__=!1,e.__lookupGetter__=!1;var s=Object.create(null);return s.__proto__=!1,{properties:{whitelist:a.createNewLookupObject(s,t.allowedProtoProperties),defaultValue:t.allowProtoPropertiesByDefault},methods:{whitelist:a.createNewLookupObject(e,t.allowedProtoMethods),defaultValue:t.allowProtoMethodsByDefault}}},t.resultIsAllowed=function(t,e,a){return r("function"==typeof t?e.methods:e.properties,a)},t.resetLoggedProperties=function(){Object.keys(n).forEach((function(t){delete n[t]}))};var e,a=Lt(),s=Tt(),i=(e=s)&&e.__esModule?e:{default:e},n=Object.create(null);function r(t,e){return void 0!==t.whitelist[e]?!0===t.whitelist[e]:void 0!==t.defaultValue?t.defaultValue:(function(t){!0!==n[t]&&(n[t]=!0,i.default.log("error",'Handlebars: Access has been denied to resolve the property "'+t+'" because it is not an "own property" of its parent.\nYou can add a runtime option to disable the check or this warning:\nSee https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details'))}(e),!1)}}}),Ot=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/base.js"(t){function e(t){return t&&t.__esModule?t:{default:t}}t.__esModule=!0,t.HandlebarsEnvironment=l;var a=Et(),s=e(vt()),i=_t(),n=xt(),r=e(Tt()),o=Nt();t.VERSION="4.7.8";t.COMPILER_REVISION=8;t.LAST_COMPATIBLE_COMPILER_REVISION=7;t.REVISION_CHANGES={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};var c="[object Object]";function l(t,e,a){this.helpers=t||{},this.partials=e||{},this.decorators=a||{},i.registerDefaultHelpers(this),n.registerDefaultDecorators(this)}l.prototype={constructor:l,logger:r.default,log:r.default.log,registerHelper:function(t,e){if(a.toString.call(t)===c){if(e)throw new s.default("Arg not supported with multiple helpers");a.extend(this.helpers,t)}else this.helpers[t]=e},unregisterHelper:function(t){delete this.helpers[t]},registerPartial:function(t,e){if(a.toString.call(t)===c)a.extend(this.partials,t);else{if(void 0===e)throw new s.default('Attempting to register a partial called "'+t+'" as undefined');this.partials[t]=e}},unregisterPartial:function(t){delete this.partials[t]},registerDecorator:function(t,e){if(a.toString.call(t)===c){if(e)throw new s.default("Arg not supported with multiple decorators");a.extend(this.decorators,t)}else this.decorators[t]=e},unregisterDecorator:function(t){delete this.decorators[t]},resetLoggedPropertyAccesses:function(){o.resetLoggedProperties()}};var h=r.default.log;t.log=h,t.createFrame=a.createFrame,t.logger=r.default}}),Rt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/safe-string.js"(t,e){function a(t){this.string=t}t.__esModule=!0,a.prototype.toString=a.prototype.toHTML=function(){return""+this.string},t.default=a,e.exports=t.default}}),Mt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js"(t){t.__esModule=!0,t.wrapHelper=function(t,e){if("function"!=typeof t)return t;return function(){return arguments[arguments.length-1]=e(arguments[arguments.length-1]),t.apply(this,arguments)}}}}),kt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/runtime.js"(t){t.__esModule=!0,t.checkRevision=function(t){var e=t&&t[0]||1,a=n.COMPILER_REVISION;if(e>=n.LAST_COMPATIBLE_COMPILER_REVISION&&e<=n.COMPILER_REVISION)return;if(e<n.LAST_COMPATIBLE_COMPILER_REVISION){var s=n.REVISION_CHANGES[a],r=n.REVISION_CHANGES[e];throw new i.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+s+") or downgrade your runtime to an older version ("+r+").")}throw new i.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+t[1]+").")},t.template=function(t,e){if(!e)throw new i.default("No environment passed to template");if(!t||!t.main)throw new i.default("Unknown template object: "+typeof t);t.main.decorator=t.main_d,e.VM.checkRevision(t.compiler);var s=t.compiler&&7===t.compiler[0];var h={strict:function(t,e,a){if(!t||!(e in t))throw new i.default('"'+e+'" not defined in '+t,{loc:a});return h.lookupProperty(t,e)},lookupProperty:function(t,e){var a=t[e];return null==a||Object.prototype.hasOwnProperty.call(t,e)||c.resultIsAllowed(a,h.protoAccessControl,e)?a:void 0},lookup:function(t,e){for(var a=t.length,s=0;s<a;s++){if(null!=(t[s]&&h.lookupProperty(t[s],e)))return t[s][e]}},lambda:function(t,e){return"function"==typeof t?t.call(e):t},escapeExpression:a.escapeExpression,invokePartial:function(s,n,r){r.hash&&(n=a.extend({},n,r.hash),r.ids&&(r.ids[0]=!0)),s=e.VM.resolvePartial.call(this,s,n,r);var o=a.extend({},r,{hooks:this.hooks,protoAccessControl:this.protoAccessControl}),c=e.VM.invokePartial.call(this,s,n,o);if(null==c&&e.compile&&(r.partials[r.name]=e.compile(s,t.compilerOptions,e),c=r.partials[r.name](n,o)),null!=c){if(r.indent){for(var l=c.split("\n"),h=0,d=l.length;h<d&&(l[h]||h+1!==d);h++)l[h]=r.indent+l[h];c=l.join("\n")}return c}throw new i.default("The partial "+r.name+" could not be compiled when running in runtime-only mode")},fn:function(e){var a=t[e];return a.decorator=t[e+"_d"],a},programs:[],program:function(t,e,a,s,i){var n=this.programs[t],r=this.fn(t);return e||i||s||a?n=l(this,t,r,e,a,s,i):n||(n=this.programs[t]=l(this,t,r)),n},data:function(t,e){for(;t&&e--;)t=t._parent;return t},mergeIfNeeded:function(t,e){var s=t||e;return t&&e&&t!==e&&(s=a.extend({},e,t)),s},nullContext:Object.seal({}),noop:e.VM.noop,compilerInfo:t.compiler};function u(e){var a=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],s=a.data;u._setup(a),!a.partial&&t.useData&&(s=function(t,e){e&&"root"in e||((e=e?n.createFrame(e):{}).root=t);return e}(e,s));var i=void 0,r=t.useBlockParams?[]:void 0;function o(e){return""+t.main(h,e,h.helpers,h.partials,s,r,i)}return t.useDepths&&(i=a.depths?e!=a.depths[0]?[e].concat(a.depths):a.depths:[e]),(o=d(t.main,o,h,a.depths||[],s,r))(e,a)}return u.isTop=!0,u._setup=function(i){if(i.partial)h.protoAccessControl=i.protoAccessControl,h.helpers=i.helpers,h.partials=i.partials,h.decorators=i.decorators,h.hooks=i.hooks;else{var n=a.extend({},e.helpers,i.helpers);!function(t,e){Object.keys(t).forEach((function(s){var i=t[s];t[s]=function(t,e){var s=e.lookupProperty;return o.wrapHelper(t,(function(t){return a.extend({lookupProperty:s},t)}))}(i,e)}))}(n,h),h.helpers=n,t.usePartial&&(h.partials=h.mergeIfNeeded(i.partials,e.partials)),(t.usePartial||t.useDecorators)&&(h.decorators=a.extend({},e.decorators,i.decorators)),h.hooks={},h.protoAccessControl=c.createProtoAccessControl(i);var l=i.allowCallsToHelperMissing||s;r.moveHelperToHooks(h,"helperMissing",l),r.moveHelperToHooks(h,"blockHelperMissing",l)}},u._child=function(e,a,s,n){if(t.useBlockParams&&!s)throw new i.default("must pass block params");if(t.useDepths&&!n)throw new i.default("must pass parent depths");return l(h,e,t[e],a,0,s,n)},u},t.wrapProgram=l,t.resolvePartial=function(t,e,a){t?t.call||a.name||(a.name=t,t=a.partials[t]):t="@partial-block"===a.name?a.data["partial-block"]:a.partials[a.name];return t},t.invokePartial=function(t,e,s){var r=s.data&&s.data["partial-block"];s.partial=!0,s.ids&&(s.data.contextPath=s.ids[0]||s.data.contextPath);var o=void 0;s.fn&&s.fn!==h&&function(){s.data=n.createFrame(s.data);var t=s.fn;o=s.data["partial-block"]=function(e){var a=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return a.data=n.createFrame(a.data),a.data["partial-block"]=r,t(e,a)},t.partials&&(s.partials=a.extend({},s.partials,t.partials))}();void 0===t&&o&&(t=o);if(void 0===t)throw new i.default("The partial "+s.name+" could not be found");if(t instanceof Function)return t(e,s)},t.noop=h;var e,a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e.default=t,e}(Et()),s=vt(),i=(e=s)&&e.__esModule?e:{default:e},n=Ot(),r=_t(),o=Mt(),c=Nt();function l(t,e,a,s,i,n,r){function o(e){var i=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],o=r;return!r||e==r[0]||e===t.nullContext&&null===r[0]||(o=[e].concat(r)),a(t,e,t.helpers,t.partials,i.data||s,n&&[i.blockParams].concat(n),o)}return(o=d(a,o,t,r,s,n)).program=e,o.depth=r?r.length:0,o.blockParams=i||0,o}function h(){return""}function d(t,e,s,i,n,r){if(t.decorator){var o={};e=t.decorator(e,o,s,i&&i[0],n,r,i),a.extend(e,o)}return e}}}),Vt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/no-conflict.js"(t,e){t.__esModule=!0,t.default=function(t){"object"!=typeof globalThis&&(Object.prototype.__defineGetter__("__magic__",(function(){return this})),__magic__.globalThis=__magic__,delete Object.prototype.__magic__);var e=globalThis.Handlebars;t.noConflict=function(){return globalThis.Handlebars===t&&(globalThis.Handlebars=e),t}},e.exports=t.default}}),Ft=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars.runtime.js"(t,e){function a(t){return t&&t.__esModule?t:{default:t}}function s(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e.default=t,e}t.__esModule=!0;var i=s(Ot()),n=a(Rt()),r=a(vt()),o=s(Et()),c=s(kt()),l=a(Vt());function h(){var t=new i.HandlebarsEnvironment;return o.extend(t,i),t.SafeString=n.default,t.Exception=r.default,t.Utils=o,t.escapeExpression=o.escapeExpression,t.VM=c,t.template=function(e){return c.template(e,t)},t}var d=h();d.create=h,l.default(d),d.default=d,t.default=d,e.exports=t.default}}),Wt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/ast.js"(t,e){t.__esModule=!0;var a={helpers:{helperExpression:function(t){return"SubExpression"===t.type||("MustacheStatement"===t.type||"BlockStatement"===t.type)&&!!(t.params&&t.params.length||t.hash)},scopedId:function(t){return/^\.|this\b/.test(t.original)},simpleId:function(t){return 1===t.parts.length&&!a.helpers.scopedId(t)&&!t.depth}}};t.default=a,e.exports=t.default}}),Bt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/parser.js"(t,e){t.__esModule=!0;var a=function(){var t={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(t,e,a,s,i,n,r){var o=n.length-1;switch(i){case 1:return n[o-1];case 2:this.$=s.prepareProgram(n[o]);break;case 3:case 4:case 5:case 6:case 7:case 8:case 20:case 27:case 28:case 33:case 34:case 40:case 41:this.$=n[o];break;case 9:this.$={type:"CommentStatement",value:s.stripComment(n[o]),strip:s.stripFlags(n[o],n[o]),loc:s.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:n[o],value:n[o],loc:s.locInfo(this._$)};break;case 11:this.$=s.prepareRawBlock(n[o-2],n[o-1],n[o],this._$);break;case 12:this.$={path:n[o-3],params:n[o-2],hash:n[o-1]};break;case 13:this.$=s.prepareBlock(n[o-3],n[o-2],n[o-1],n[o],!1,this._$);break;case 14:this.$=s.prepareBlock(n[o-3],n[o-2],n[o-1],n[o],!0,this._$);break;case 15:this.$={open:n[o-5],path:n[o-4],params:n[o-3],hash:n[o-2],blockParams:n[o-1],strip:s.stripFlags(n[o-5],n[o])};break;case 16:case 17:this.$={path:n[o-4],params:n[o-3],hash:n[o-2],blockParams:n[o-1],strip:s.stripFlags(n[o-5],n[o])};break;case 18:this.$={strip:s.stripFlags(n[o-1],n[o-1]),program:n[o]};break;case 19:var c=s.prepareBlock(n[o-2],n[o-1],n[o],n[o],!1,this._$),l=s.prepareProgram([c],n[o-1].loc);l.chained=!0,this.$={strip:n[o-2].strip,program:l,chain:!0};break;case 21:this.$={path:n[o-1],strip:s.stripFlags(n[o-2],n[o])};break;case 22:case 23:this.$=s.prepareMustache(n[o-3],n[o-2],n[o-1],n[o-4],s.stripFlags(n[o-4],n[o]),this._$);break;case 24:this.$={type:"PartialStatement",name:n[o-3],params:n[o-2],hash:n[o-1],indent:"",strip:s.stripFlags(n[o-4],n[o]),loc:s.locInfo(this._$)};break;case 25:this.$=s.preparePartialBlock(n[o-2],n[o-1],n[o],this._$);break;case 26:this.$={path:n[o-3],params:n[o-2],hash:n[o-1],strip:s.stripFlags(n[o-4],n[o])};break;case 29:this.$={type:"SubExpression",path:n[o-3],params:n[o-2],hash:n[o-1],loc:s.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:n[o],loc:s.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:s.id(n[o-2]),value:n[o],loc:s.locInfo(this._$)};break;case 32:this.$=s.id(n[o-1]);break;case 35:this.$={type:"StringLiteral",value:n[o],original:n[o],loc:s.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(n[o]),original:Number(n[o]),loc:s.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:"true"===n[o],original:"true"===n[o],loc:s.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:s.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:s.locInfo(this._$)};break;case 42:this.$=s.preparePath(!0,n[o],this._$);break;case 43:this.$=s.preparePath(!1,n[o],this._$);break;case 44:n[o-2].push({part:s.id(n[o]),original:n[o],separator:n[o-1]}),this.$=n[o-2];break;case 45:this.$=[{part:s.id(n[o]),original:n[o]}];break;case 46:case 48:case 50:case 58:case 64:case 70:case 78:case 82:case 86:case 90:case 94:this.$=[];break;case 47:case 49:case 51:case 59:case 65:case 71:case 79:case 83:case 87:case 91:case 95:case 99:case 101:n[o-1].push(n[o]);break;case 98:case 100:this.$=[n[o]]}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function(t,e){throw new Error(t)},parse:function(t){var e=this,a=[0],s=[null],i=[],n=this.table,r="",o=0,c=0;this.lexer.setInput(t),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,void 0===this.lexer.yylloc&&(this.lexer.yylloc={});var l=this.lexer.yylloc;i.push(l);var h=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var d,u,p,m,f,g,w,E,v,y={};;){if(u=a[a.length-1],this.defaultActions[u]?p=this.defaultActions[u]:(null==d&&(v=void 0,"number"!=typeof(v=e.lexer.lex()||1)&&(v=e.symbols_[v]||v),d=v),p=n[u]&&n[u][d]),void 0===p||!p.length||!p[0]){var I="";for(f in E=[],n[u])this.terminals_[f]&&f>2&&E.push("'"+this.terminals_[f]+"'");I=this.lexer.showPosition?"Parse error on line "+(o+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+E.join(", ")+", got '"+(this.terminals_[d]||d)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==d?"end of input":"'"+(this.terminals_[d]||d)+"'"),this.parseError(I,{text:this.lexer.match,token:this.terminals_[d]||d,line:this.lexer.yylineno,loc:l,expected:E})}if(p[0]instanceof Array&&p.length>1)throw new Error("Parse Error: multiple actions possible at state: "+u+", token: "+d);switch(p[0]){case 1:a.push(d),s.push(this.lexer.yytext),i.push(this.lexer.yylloc),a.push(p[1]),d=null,c=this.lexer.yyleng,r=this.lexer.yytext,o=this.lexer.yylineno,l=this.lexer.yylloc;break;case 2:if(g=this.productions_[p[1]][1],y.$=s[s.length-g],y._$={first_line:i[i.length-(g||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(g||1)].first_column,last_column:i[i.length-1].last_column},h&&(y._$.range=[i[i.length-(g||1)].range[0],i[i.length-1].range[1]]),void 0!==(m=this.performAction.call(y,r,c,o,this.yy,p[1],s,i)))return m;g&&(a=a.slice(0,-1*g*2),s=s.slice(0,-1*g),i=i.slice(0,-1*g)),a.push(this.productions_[p[1]][0]),s.push(y.$),i.push(y._$),w=n[a[a.length-2]][a[a.length-1]],a.push(w);break;case 3:return!0}}return!0}},e={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t){return this._input=t,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,a=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e-1),this.offset-=e;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===s.length?this.yylloc.first_column:0)+s[s.length-a.length].length-a[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this},more:function(){return this._more=!0,this},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},next:function(){if(this.done)return this.EOF;var t,e,a,s,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),r=0;r<n.length&&(!(a=this._input.match(this.rules[n[r]]))||e&&!(a[0].length>e[0].length)||(e=a,s=r,this.options.flex));r++);return e?((i=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],t=this.performAction.call(this,this.yy,this,n[s],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),t||void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return void 0!==t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(t){this.begin(t)},options:{},performAction:function(t,e,a,s){function i(t,a){return e.yytext=e.yytext.substring(t,e.yyleng-a+t)}switch(a){case 0:if("\\\\"===e.yytext.slice(-2)?(i(0,1),this.begin("mu")):"\\"===e.yytext.slice(-1)?(i(0,1),this.begin("emu")):this.begin("mu"),e.yytext)return 15;break;case 1:case 5:return 15;case 2:return this.popState(),15;case 3:return this.begin("raw"),15;case 4:return this.popState(),"raw"===this.conditionStack[this.conditionStack.length-1]?15:(i(5,9),"END_RAW_BLOCK");case 6:case 22:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:case 23:return 48;case 21:this.unput(e.yytext),this.popState(),this.begin("com");break;case 24:return 73;case 25:case 26:case 41:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return e.yytext=i(1,2).replace(/\\"/g,'"'),80;case 32:return e.yytext=i(1,2).replace(/\\'/g,"'"),80;case 33:return 85;case 34:case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 42:return e.yytext=e.yytext.replace(/\\([\\\]])/g,"$1"),72;case 43:return"INVALID";case 44:return 5}},rules:[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],conditions:{mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}}};function a(){this.yy={}}return t.lexer=e,a.prototype=t,t.Parser=a,new a}();t.default=a,e.exports=t.default}}),Ut=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/visitor.js"(t,e){t.__esModule=!0;var a,s=vt(),i=(a=s)&&a.__esModule?a:{default:a};function n(){this.parents=[]}function r(t){this.acceptRequired(t,"path"),this.acceptArray(t.params),this.acceptKey(t,"hash")}function o(t){r.call(this,t),this.acceptKey(t,"program"),this.acceptKey(t,"inverse")}function c(t){this.acceptRequired(t,"name"),this.acceptArray(t.params),this.acceptKey(t,"hash")}n.prototype={constructor:n,mutating:!1,acceptKey:function(t,e){var a=this.accept(t[e]);if(this.mutating){if(a&&!n.prototype[a.type])throw new i.default('Unexpected node type "'+a.type+'" found when accepting '+e+" on "+t.type);t[e]=a}},acceptRequired:function(t,e){if(this.acceptKey(t,e),!t[e])throw new i.default(t.type+" requires "+e)},acceptArray:function(t){for(var e=0,a=t.length;e<a;e++)this.acceptKey(t,e),t[e]||(t.splice(e,1),e--,a--)},accept:function(t){if(t){if(!this[t.type])throw new i.default("Unknown type: "+t.type,t);this.current&&this.parents.unshift(this.current),this.current=t;var e=this[t.type](t);return this.current=this.parents.shift(),!this.mutating||e?e:!1!==e?t:void 0}},Program:function(t){this.acceptArray(t.body)},MustacheStatement:r,Decorator:r,BlockStatement:o,DecoratorBlock:o,PartialStatement:c,PartialBlockStatement:function(t){c.call(this,t),this.acceptKey(t,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:r,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(t){this.acceptArray(t.pairs)},HashPair:function(t){this.acceptRequired(t,"value")}},t.default=n,e.exports=t.default}}),jt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/whitespace-control.js"(t,e){t.__esModule=!0;var a,s=Ut(),i=(a=s)&&a.__esModule?a:{default:a};function n(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.options=t}function r(t,e,a){void 0===e&&(e=t.length);var s=t[e-1],i=t[e-2];return s?"ContentStatement"===s.type?(i||!a?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(s.original):void 0:a}function o(t,e,a){void 0===e&&(e=-1);var s=t[e+1],i=t[e+2];return s?"ContentStatement"===s.type?(i||!a?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(s.original):void 0:a}function c(t,e,a){var s=t[null==e?0:e+1];if(s&&"ContentStatement"===s.type&&(a||!s.rightStripped)){var i=s.value;s.value=s.value.replace(a?/^\s+/:/^[ \t]*\r?\n?/,""),s.rightStripped=s.value!==i}}function l(t,e,a){var s=t[null==e?t.length-1:e-1];if(s&&"ContentStatement"===s.type&&(a||!s.leftStripped)){var i=s.value;return s.value=s.value.replace(a?/\s+$/:/[ \t]+$/,""),s.leftStripped=s.value!==i,s.leftStripped}}n.prototype=new i.default,n.prototype.Program=function(t){var e=!this.options.ignoreStandalone,a=!this.isRootSeen;this.isRootSeen=!0;for(var s=t.body,i=0,n=s.length;i<n;i++){var h=s[i],d=this.accept(h);if(d){var u=r(s,i,a),p=o(s,i,a),m=d.openStandalone&&u,f=d.closeStandalone&&p,g=d.inlineStandalone&&u&&p;d.close&&c(s,i,!0),d.open&&l(s,i,!0),e&&g&&(c(s,i),l(s,i)&&"PartialStatement"===h.type&&(h.indent=/([ \t]+$)/.exec(s[i-1].original)[1])),e&&m&&(c((h.program||h.inverse).body),l(s,i)),e&&f&&(c(s,i),l((h.inverse||h.program).body))}}return t},n.prototype.BlockStatement=n.prototype.DecoratorBlock=n.prototype.PartialBlockStatement=function(t){this.accept(t.program),this.accept(t.inverse);var e=t.program||t.inverse,a=t.program&&t.inverse,s=a,i=a;if(a&&a.chained)for(s=a.body[0].program;i.chained;)i=i.body[i.body.length-1].program;var n={open:t.openStrip.open,close:t.closeStrip.close,openStandalone:o(e.body),closeStandalone:r((s||e).body)};if(t.openStrip.close&&c(e.body,null,!0),a){var h=t.inverseStrip;h.open&&l(e.body,null,!0),h.close&&c(s.body,null,!0),t.closeStrip.open&&l(i.body,null,!0),!this.options.ignoreStandalone&&r(e.body)&&o(s.body)&&(l(e.body),c(s.body))}else t.closeStrip.open&&l(e.body,null,!0);return n},n.prototype.Decorator=n.prototype.MustacheStatement=function(t){return t.strip},n.prototype.PartialStatement=n.prototype.CommentStatement=function(t){var e=t.strip||{};return{inlineStandalone:!0,open:e.open,close:e.close}},t.default=n,e.exports=t.default}}),zt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/helpers.js"(t){t.__esModule=!0,t.SourceLocation=function(t,e){this.source=t,this.start={line:e.first_line,column:e.first_column},this.end={line:e.last_line,column:e.last_column}},t.id=function(t){return/^\[.*\]$/.test(t)?t.substring(1,t.length-1):t},t.stripFlags=function(t,e){return{open:"~"===t.charAt(2),close:"~"===e.charAt(e.length-3)}},t.stripComment=function(t){return t.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")},t.preparePath=function(t,e,a){a=this.locInfo(a);for(var i=t?"@":"",n=[],r=0,o=0,c=e.length;o<c;o++){var l=e[o].part,h=e[o].original!==l;if(i+=(e[o].separator||"")+l,h||".."!==l&&"."!==l&&"this"!==l)n.push(l);else{if(n.length>0)throw new s.default("Invalid path: "+i,{loc:a});".."===l&&r++}}return{type:"PathExpression",data:t,depth:r,parts:n,original:i,loc:a}},t.prepareMustache=function(t,e,a,s,i,n){var r=s.charAt(3)||s.charAt(2),o="{"!==r&&"&"!==r;return{type:/\*/.test(s)?"Decorator":"MustacheStatement",path:t,params:e,hash:a,escaped:o,strip:i,loc:this.locInfo(n)}},t.prepareRawBlock=function(t,e,a,s){i(t,a),s=this.locInfo(s);var n={type:"Program",body:e,strip:{},loc:s};return{type:"BlockStatement",path:t.path,params:t.params,hash:t.hash,program:n,openStrip:{},inverseStrip:{},closeStrip:{},loc:s}},t.prepareBlock=function(t,e,a,n,r,o){n&&n.path&&i(t,n);var c=/\*/.test(t.open);e.blockParams=t.blockParams;var l=void 0,h=void 0;if(a){if(c)throw new s.default("Unexpected inverse block on decorator",a);a.chain&&(a.program.body[0].closeStrip=n.strip),h=a.strip,l=a.program}r&&(r=l,l=e,e=r);return{type:c?"DecoratorBlock":"BlockStatement",path:t.path,params:t.params,hash:t.hash,program:e,inverse:l,openStrip:t.strip,inverseStrip:h,closeStrip:n&&n.strip,loc:this.locInfo(o)}},t.prepareProgram=function(t,e){if(!e&&t.length){var a=t[0].loc,s=t[t.length-1].loc;a&&s&&(e={source:a.source,start:{line:a.start.line,column:a.start.column},end:{line:s.end.line,column:s.end.column}})}return{type:"Program",body:t,strip:{},loc:e}},t.preparePartialBlock=function(t,e,a,s){return i(t,a),{type:"PartialBlockStatement",name:t.path,params:t.params,hash:t.hash,program:e,openStrip:t.strip,closeStrip:a&&a.strip,loc:this.locInfo(s)}};var e,a=vt(),s=(e=a)&&e.__esModule?e:{default:e};function i(t,e){if(e=e.path?e.path.original:e,t.path.original!==e){var a={loc:t.path.loc};throw new s.default(t.path.original+" doesn't match "+e,a)}}}}),Gt=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/base.js"(t){function e(t){return t&&t.__esModule?t:{default:t}}t.__esModule=!0,t.parseWithoutProcessing=o,t.parse=function(t,e){var a=o(t,e);return new s.default(e).accept(a)};var a=e(Bt()),s=e(jt()),i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e.default=t,e}(zt()),n=Et();t.parser=a.default;var r={};function o(t,e){return"Program"===t.type?t:(a.default.yy=r,r.locInfo=function(t){return new r.SourceLocation(e&&e.srcName,t)},a.default.parse(t))}n.extend(r,i)}}),Ht=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js"(t){function e(t){return t&&t.__esModule?t:{default:t}}t.__esModule=!0,t.Compiler=r,t.precompile=function(t,e,s){if(null==t||"string"!=typeof t&&"Program"!==t.type)throw new a.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+t);"data"in(e=e||{})||(e.data=!0);e.compat&&(e.useDepths=!0);var i=s.parse(t,e),n=(new s.Compiler).compile(i,e);return(new s.JavaScriptCompiler).compile(n,e)},t.compile=function(t,e,i){void 0===e&&(e={});if(null==t||"string"!=typeof t&&"Program"!==t.type)throw new a.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+t);"data"in(e=s.extend({},e))||(e.data=!0);e.compat&&(e.useDepths=!0);var n=void 0;function r(){var a=i.parse(t,e),s=(new i.Compiler).compile(a,e),n=(new i.JavaScriptCompiler).compile(s,e,void 0,!0);return i.template(n)}function o(t,e){return n||(n=r()),n.call(this,t,e)}return o._setup=function(t){return n||(n=r()),n._setup(t)},o._child=function(t,e,a,s){return n||(n=r()),n._child(t,e,a,s)},o};var a=e(vt()),s=Et(),i=e(Wt()),n=[].slice;function r(){}function o(t,e){if(t===e)return!0;if(s.isArray(t)&&s.isArray(e)&&t.length===e.length){for(var a=0;a<t.length;a++)if(!o(t[a],e[a]))return!1;return!0}}function c(t){if(!t.path.parts){var e=t.path;t.path={type:"PathExpression",data:!1,depth:0,parts:[e.original+""],original:e.original+"",loc:e.loc}}}r.prototype={compiler:r,equals:function(t){var e=this.opcodes.length;if(t.opcodes.length!==e)return!1;for(var a=0;a<e;a++){var s=this.opcodes[a],i=t.opcodes[a];if(s.opcode!==i.opcode||!o(s.args,i.args))return!1}e=this.children.length;for(a=0;a<e;a++)if(!this.children[a].equals(t.children[a]))return!1;return!0},guid:0,compile:function(t,e){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=e,this.stringParams=e.stringParams,this.trackIds=e.trackIds,e.blockParams=e.blockParams||[],e.knownHelpers=s.extend(Object.create(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,if:!0,unless:!0,with:!0,log:!0,lookup:!0},e.knownHelpers),this.accept(t)},compileProgram:function(t){var e=(new this.compiler).compile(t,this.options),a=this.guid++;return this.usePartial=this.usePartial||e.usePartial,this.children[a]=e,this.useDepths=this.useDepths||e.useDepths,a},accept:function(t){if(!this[t.type])throw new a.default("Unknown type: "+t.type,t);this.sourceNode.unshift(t);var e=this[t.type](t);return this.sourceNode.shift(),e},Program:function(t){this.options.blockParams.unshift(t.blockParams);for(var e=t.body,a=e.length,s=0;s<a;s++)this.accept(e[s]);return this.options.blockParams.shift(),this.isSimple=1===a,this.blockParams=t.blockParams?t.blockParams.length:0,this},BlockStatement:function(t){c(t);var e=t.program,a=t.inverse;e=e&&this.compileProgram(e),a=a&&this.compileProgram(a);var s=this.classifySexpr(t);"helper"===s?this.helperSexpr(t,e,a):"simple"===s?(this.simpleSexpr(t),this.opcode("pushProgram",e),this.opcode("pushProgram",a),this.opcode("emptyHash"),this.opcode("blockValue",t.path.original)):(this.ambiguousSexpr(t,e,a),this.opcode("pushProgram",e),this.opcode("pushProgram",a),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},DecoratorBlock:function(t){var e=t.program&&this.compileProgram(t.program),a=this.setupFullMustacheParams(t,e,void 0),s=t.path;this.useDecorators=!0,this.opcode("registerDecorator",a.length,s.original)},PartialStatement:function(t){this.usePartial=!0;var e=t.program;e&&(e=this.compileProgram(t.program));var s=t.params;if(s.length>1)throw new a.default("Unsupported number of partial arguments: "+s.length,t);s.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):s.push({type:"PathExpression",parts:[],depth:0}));var i=t.name.original,n="SubExpression"===t.name.type;n&&this.accept(t.name),this.setupFullMustacheParams(t,e,void 0,!0);var r=t.indent||"";this.options.preventIndent&&r&&(this.opcode("appendContent",r),r=""),this.opcode("invokePartial",n,i,r),this.opcode("append")},PartialBlockStatement:function(t){this.PartialStatement(t)},MustacheStatement:function(t){this.SubExpression(t),t.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(t){this.DecoratorBlock(t)},ContentStatement:function(t){t.value&&this.opcode("appendContent",t.value)},CommentStatement:function(){},SubExpression:function(t){c(t);var e=this.classifySexpr(t);"simple"===e?this.simpleSexpr(t):"helper"===e?this.helperSexpr(t):this.ambiguousSexpr(t)},ambiguousSexpr:function(t,e,a){var s=t.path,i=s.parts[0],n=null!=e||null!=a;this.opcode("getContext",s.depth),this.opcode("pushProgram",e),this.opcode("pushProgram",a),s.strict=!0,this.accept(s),this.opcode("invokeAmbiguous",i,n)},simpleSexpr:function(t){var e=t.path;e.strict=!0,this.accept(e),this.opcode("resolvePossibleLambda")},helperSexpr:function(t,e,s){var n=this.setupFullMustacheParams(t,e,s),r=t.path,o=r.parts[0];if(this.options.knownHelpers[o])this.opcode("invokeKnownHelper",n.length,o);else{if(this.options.knownHelpersOnly)throw new a.default("You specified knownHelpersOnly, but used the unknown helper "+o,t);r.strict=!0,r.falsy=!0,this.accept(r),this.opcode("invokeHelper",n.length,r.original,i.default.helpers.simpleId(r))}},PathExpression:function(t){this.addDepth(t.depth),this.opcode("getContext",t.depth);var e=t.parts[0],a=i.default.helpers.scopedId(t),s=!t.depth&&!a&&this.blockParamIndex(e);s?this.opcode("lookupBlockParam",s,t.parts):e?t.data?(this.options.data=!0,this.opcode("lookupData",t.depth,t.parts,t.strict)):this.opcode("lookupOnContext",t.parts,t.falsy,t.strict,a):this.opcode("pushContext")},StringLiteral:function(t){this.opcode("pushString",t.value)},NumberLiteral:function(t){this.opcode("pushLiteral",t.value)},BooleanLiteral:function(t){this.opcode("pushLiteral",t.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(t){var e=t.pairs,a=0,s=e.length;for(this.opcode("pushHash");a<s;a++)this.pushParam(e[a].value);for(;a--;)this.opcode("assignToHash",e[a].key);this.opcode("popHash")},opcode:function(t){this.opcodes.push({opcode:t,args:n.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(t){t&&(this.useDepths=!0)},classifySexpr:function(t){var e=i.default.helpers.simpleId(t.path),a=e&&!!this.blockParamIndex(t.path.parts[0]),s=!a&&i.default.helpers.helperExpression(t),n=!a&&(s||e);if(n&&!s){var r=t.path.parts[0],o=this.options;o.knownHelpers[r]?s=!0:o.knownHelpersOnly&&(n=!1)}return s?"helper":n?"ambiguous":"simple"},pushParams:function(t){for(var e=0,a=t.length;e<a;e++)this.pushParam(t[e])},pushParam:function(t){var e=null!=t.value?t.value:t.original||"";if(this.stringParams)e.replace&&(e=e.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".")),t.depth&&this.addDepth(t.depth),this.opcode("getContext",t.depth||0),this.opcode("pushStringParam",e,t.type),"SubExpression"===t.type&&this.accept(t);else{if(this.trackIds){var a=void 0;if(!t.parts||i.default.helpers.scopedId(t)||t.depth||(a=this.blockParamIndex(t.parts[0])),a){var s=t.parts.slice(1).join(".");this.opcode("pushId","BlockParam",a,s)}else(e=t.original||e).replace&&(e=e.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"")),this.opcode("pushId",t.type,e)}this.accept(t)}},setupFullMustacheParams:function(t,e,a,s){var i=t.params;return this.pushParams(i),this.opcode("pushProgram",e),this.opcode("pushProgram",a),t.hash?this.accept(t.hash):this.opcode("emptyHash",s),i},blockParamIndex:function(t){for(var e=0,a=this.options.blockParams.length;e<a;e++){var i=this.options.blockParams[e],n=i&&s.indexOf(i,t);if(i&&n>=0)return[e,n]}}}}}),Xt=gt({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64.js"(t){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");t.encode=function(t){if(0<=t&&t<e.length)return e[t];throw new TypeError("Must be between 0 and 63: "+t)},t.decode=function(t){return 65<=t&&t<=90?t-65:97<=t&&t<=122?t-97+26:48<=t&&t<=57?t-48+52:43==t?62:47==t?63:-1}}}),Kt=gt({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64-vlq.js"(t){var e=Xt();t.encode=function(t){var a,s="",i=function(t){return t<0?1+(-t<<1):0+(t<<1)}(t);do{a=31&i,(i>>>=5)>0&&(a|=32),s+=e.encode(a)}while(i>0);return s},t.decode=function(t,a,s){var i,n,r,o,c=t.length,l=0,h=0;do{if(a>=c)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(n=e.decode(t.charCodeAt(a++))))throw new Error("Invalid base64 digit: "+t.charAt(a-1));i=!!(32&n),l+=(n&=31)<<h,h+=5}while(i);s.value=(o=(r=l)>>1,1==(1&r)?-o:o),s.rest=a}}}),Yt=gt({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/util.js"(t){t.getArg=function(t,e,a){if(e in t)return t[e];if(3===arguments.length)return a;throw new Error('"'+e+'" is a required argument.')};var e=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,a=/^data:.+\,.+$/;function s(t){var a=t.match(e);return a?{scheme:a[1],auth:a[2],host:a[3],port:a[4],path:a[5]}:null}function i(t){var e="";return t.scheme&&(e+=t.scheme+":"),e+="//",t.auth&&(e+=t.auth+"@"),t.host&&(e+=t.host),t.port&&(e+=":"+t.port),t.path&&(e+=t.path),e}function n(e){var a=e,n=s(e);if(n){if(!n.path)return e;a=n.path}for(var r,o=t.isAbsolute(a),c=a.split(/\/+/),l=0,h=c.length-1;h>=0;h--)"."===(r=c[h])?c.splice(h,1):".."===r?l++:l>0&&(""===r?(c.splice(h+1,l),l=0):(c.splice(h,2),l--));return""===(a=c.join("/"))&&(a=o?"/":"."),n?(n.path=a,i(n)):a}function r(t,e){""===t&&(t="."),""===e&&(e=".");var r=s(e),o=s(t);if(o&&(t=o.path||"/"),r&&!r.scheme)return o&&(r.scheme=o.scheme),i(r);if(r||e.match(a))return e;if(o&&!o.host&&!o.path)return o.host=e,i(o);var c="/"===e.charAt(0)?e:n(t.replace(/\/+$/,"")+"/"+e);return o?(o.path=c,i(o)):c}t.urlParse=s,t.urlGenerate=i,t.normalize=n,t.join=r,t.isAbsolute=function(t){return"/"===t.charAt(0)||e.test(t)},t.relative=function(t,e){""===t&&(t="."),t=t.replace(/\/$/,"");for(var a=0;0!==e.indexOf(t+"/");){var s=t.lastIndexOf("/");if(s<0)return e;if((t=t.slice(0,s)).match(/^([^\/]+:\/)?\/*$/))return e;++a}return Array(a+1).join("../")+e.substr(t.length+1)};var o=!("__proto__"in Object.create(null));function c(t){return t}function l(t){if(!t)return!1;var e=t.length;if(e<9)return!1;if(95!==t.charCodeAt(e-1)||95!==t.charCodeAt(e-2)||111!==t.charCodeAt(e-3)||116!==t.charCodeAt(e-4)||111!==t.charCodeAt(e-5)||114!==t.charCodeAt(e-6)||112!==t.charCodeAt(e-7)||95!==t.charCodeAt(e-8)||95!==t.charCodeAt(e-9))return!1;for(var a=e-10;a>=0;a--)if(36!==t.charCodeAt(a))return!1;return!0}function h(t,e){return t===e?0:null===t?1:null===e?-1:t>e?1:-1}t.toSetString=o?c:function(t){return l(t)?"$"+t:t},t.fromSetString=o?c:function(t){return l(t)?t.slice(1):t},t.compareByOriginalPositions=function(t,e,a){var s=h(t.source,e.source);return 0!==s||0!==(s=t.originalLine-e.originalLine)||0!==(s=t.originalColumn-e.originalColumn)||a||0!==(s=t.generatedColumn-e.generatedColumn)||0!==(s=t.generatedLine-e.generatedLine)?s:h(t.name,e.name)},t.compareByGeneratedPositionsDeflated=function(t,e,a){var s=t.generatedLine-e.generatedLine;return 0!==s||0!==(s=t.generatedColumn-e.generatedColumn)||a||0!==(s=h(t.source,e.source))||0!==(s=t.originalLine-e.originalLine)||0!==(s=t.originalColumn-e.originalColumn)?s:h(t.name,e.name)},t.compareByGeneratedPositionsInflated=function(t,e){var a=t.generatedLine-e.generatedLine;return 0!==a||0!==(a=t.generatedColumn-e.generatedColumn)||0!==(a=h(t.source,e.source))||0!==(a=t.originalLine-e.originalLine)||0!==(a=t.originalColumn-e.originalColumn)?a:h(t.name,e.name)},t.parseSourceMapInput=function(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))},t.computeSourceURL=function(t,e,a){if(e=e||"",t&&("/"!==t[t.length-1]&&"/"!==e[0]&&(t+="/"),e=t+e),a){var o=s(a);if(!o)throw new Error("sourceMapURL could not be parsed");if(o.path){var c=o.path.lastIndexOf("/");c>=0&&(o.path=o.path.substring(0,c+1))}e=r(i(o),e)}return n(e)}}}),$t=gt({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/array-set.js"(t){var e=Yt(),a=Object.prototype.hasOwnProperty,s="undefined"!=typeof Map;function i(){this._array=[],this._set=s?new Map:Object.create(null)}i.fromArray=function(t,e){for(var a=new i,s=0,n=t.length;s<n;s++)a.add(t[s],e);return a},i.prototype.size=function(){return s?this._set.size:Object.getOwnPropertyNames(this._set).length},i.prototype.add=function(t,i){var n=s?t:e.toSetString(t),r=s?this.has(t):a.call(this._set,n),o=this._array.length;r&&!i||this._array.push(t),r||(s?this._set.set(t,o):this._set[n]=o)},i.prototype.has=function(t){if(s)return this._set.has(t);var i=e.toSetString(t);return a.call(this._set,i)},i.prototype.indexOf=function(t){if(s){var i=this._set.get(t);if(i>=0)return i}else{var n=e.toSetString(t);if(a.call(this._set,n))return this._set[n]}throw new Error('"'+t+'" is not in the set.')},i.prototype.at=function(t){if(t>=0&&t<this._array.length)return this._array[t];throw new Error("No element indexed by "+t)},i.prototype.toArray=function(){return this._array.slice()},t.ArraySet=i}}),qt=gt({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/mapping-list.js"(t){var e=Yt();function a(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}a.prototype.unsortedForEach=function(t,e){this._array.forEach(t,e)},a.prototype.add=function(t){var a,s,i,n,r,o;a=this._last,s=t,i=a.generatedLine,n=s.generatedLine,r=a.generatedColumn,o=s.generatedColumn,n>i||n==i&&o>=r||e.compareByGeneratedPositionsInflated(a,s)<=0?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))},a.prototype.toArray=function(){return this._sorted||(this._array.sort(e.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},t.MappingList=a}}),Qt=gt({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-map-generator.js"(t){var e=Kt(),a=Yt(),s=$t().ArraySet,i=qt().MappingList;function n(t){t||(t={}),this._file=a.getArg(t,"file",null),this._sourceRoot=a.getArg(t,"sourceRoot",null),this._skipValidation=a.getArg(t,"skipValidation",!1),this._sources=new s,this._names=new s,this._mappings=new i,this._sourcesContents=null}n.prototype._version=3,n.fromSourceMap=function(t){var e=t.sourceRoot,s=new n({file:t.file,sourceRoot:e});return t.eachMapping((function(t){var i={generated:{line:t.generatedLine,column:t.generatedColumn}};null!=t.source&&(i.source=t.source,null!=e&&(i.source=a.relative(e,i.source)),i.original={line:t.originalLine,column:t.originalColumn},null!=t.name&&(i.name=t.name)),s.addMapping(i)})),t.sources.forEach((function(i){var n=i;null!==e&&(n=a.relative(e,i)),s._sources.has(n)||s._sources.add(n);var r=t.sourceContentFor(i);null!=r&&s.setSourceContent(i,r)})),s},n.prototype.addMapping=function(t){var e=a.getArg(t,"generated"),s=a.getArg(t,"original",null),i=a.getArg(t,"source",null),n=a.getArg(t,"name",null);this._skipValidation||this._validateMapping(e,s,i,n),null!=i&&(i=String(i),this._sources.has(i)||this._sources.add(i)),null!=n&&(n=String(n),this._names.has(n)||this._names.add(n)),this._mappings.add({generatedLine:e.line,generatedColumn:e.column,originalLine:null!=s&&s.line,originalColumn:null!=s&&s.column,source:i,name:n})},n.prototype.setSourceContent=function(t,e){var s=t;null!=this._sourceRoot&&(s=a.relative(this._sourceRoot,s)),null!=e?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[a.toSetString(s)]=e):this._sourcesContents&&(delete this._sourcesContents[a.toSetString(s)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},n.prototype.applySourceMap=function(t,e,i){var n=e;if(null==e){if(null==t.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');n=t.file}var r=this._sourceRoot;null!=r&&(n=a.relative(r,n));var o=new s,c=new s;this._mappings.unsortedForEach((function(e){if(e.source===n&&null!=e.originalLine){var s=t.originalPositionFor({line:e.originalLine,column:e.originalColumn});null!=s.source&&(e.source=s.source,null!=i&&(e.source=a.join(i,e.source)),null!=r&&(e.source=a.relative(r,e.source)),e.originalLine=s.line,e.originalColumn=s.column,null!=s.name&&(e.name=s.name))}var l=e.source;null==l||o.has(l)||o.add(l);var h=e.name;null==h||c.has(h)||c.add(h)}),this),this._sources=o,this._names=c,t.sources.forEach((function(e){var s=t.sourceContentFor(e);null!=s&&(null!=i&&(e=a.join(i,e)),null!=r&&(e=a.relative(r,e)),this.setSourceContent(e,s))}),this)},n.prototype._validateMapping=function(t,e,a,s){if(e&&"number"!=typeof e.line&&"number"!=typeof e.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if((!(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0)||e||a||s)&&!(t&&"line"in t&&"column"in t&&e&&"line"in e&&"column"in e&&t.line>0&&t.column>=0&&e.line>0&&e.column>=0&&a))throw new Error("Invalid mapping: "+JSON.stringify({generated:t,source:a,original:e,name:s}))},n.prototype._serializeMappings=function(){for(var t,s,i,n,r=0,o=1,c=0,l=0,h=0,d=0,u="",p=this._mappings.toArray(),m=0,f=p.length;m<f;m++){if(t="",(s=p[m]).generatedLine!==o)for(r=0;s.generatedLine!==o;)t+=";",o++;else if(m>0){if(!a.compareByGeneratedPositionsInflated(s,p[m-1]))continue;t+=","}t+=e.encode(s.generatedColumn-r),r=s.generatedColumn,null!=s.source&&(n=this._sources.indexOf(s.source),t+=e.encode(n-d),d=n,t+=e.encode(s.originalLine-1-l),l=s.originalLine-1,t+=e.encode(s.originalColumn-c),c=s.originalColumn,null!=s.name&&(i=this._names.indexOf(s.name),t+=e.encode(i-h),h=i)),u+=t}return u},n.prototype._generateSourcesContent=function(t,e){return t.map((function(t){if(!this._sourcesContents)return null;null!=e&&(t=a.relative(e,t));var s=a.toSetString(t);return Object.prototype.hasOwnProperty.call(this._sourcesContents,s)?this._sourcesContents[s]:null}),this)},n.prototype.toJSON=function(){var t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(t.file=this._file),null!=this._sourceRoot&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t},n.prototype.toString=function(){return JSON.stringify(this.toJSON())},t.SourceMapGenerator=n}}),Jt=gt({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/binary-search.js"(t){function e(a,s,i,n,r,o){var c=Math.floor((s-a)/2)+a,l=r(i,n[c],!0);return 0===l?c:l>0?s-c>1?e(c,s,i,n,r,o):o==t.LEAST_UPPER_BOUND?s<n.length?s:-1:c:c-a>1?e(a,c,i,n,r,o):o==t.LEAST_UPPER_BOUND?c:a<0?-1:a}t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2,t.search=function(a,s,i,n){if(0===s.length)return-1;var r=e(-1,s.length,a,s,i,n||t.GREATEST_LOWER_BOUND);if(r<0)return-1;for(;r-1>=0&&0===i(s[r],s[r-1],!0);)--r;return r}}}),Zt=gt({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/quick-sort.js"(t){function e(t,e,a){var s=t[e];t[e]=t[a],t[a]=s}function a(t,s,i,n){if(i<n){var r=i-1;e(t,(h=i,d=n,Math.round(h+Math.random()*(d-h))),n);for(var o=t[n],c=i;c<n;c++)s(t[c],o)<=0&&e(t,r+=1,c);e(t,r+1,c);var l=r+1;a(t,s,i,l-1),a(t,s,l+1,n)}var h,d}t.quickSort=function(t,e){a(t,e,0,t.length-1)}}}),te=gt({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-map-consumer.js"(t){var e=Yt(),a=Jt(),s=$t().ArraySet,i=Kt(),n=Zt().quickSort;function r(t,a){var s=t;return"string"==typeof t&&(s=e.parseSourceMapInput(t)),null!=s.sections?new l(s,a):new o(s,a)}function o(t,a){var i=t;"string"==typeof t&&(i=e.parseSourceMapInput(t));var n=e.getArg(i,"version"),r=e.getArg(i,"sources"),o=e.getArg(i,"names",[]),c=e.getArg(i,"sourceRoot",null),l=e.getArg(i,"sourcesContent",null),h=e.getArg(i,"mappings"),d=e.getArg(i,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);c&&(c=e.normalize(c)),r=r.map(String).map(e.normalize).map((function(t){return c&&e.isAbsolute(c)&&e.isAbsolute(t)?e.relative(c,t):t})),this._names=s.fromArray(o.map(String),!0),this._sources=s.fromArray(r,!0),this._absoluteSources=this._sources.toArray().map((function(t){return e.computeSourceURL(c,t,a)})),this.sourceRoot=c,this.sourcesContent=l,this._mappings=h,this._sourceMapURL=a,this.file=d}function c(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function l(t,a){var i=t;"string"==typeof t&&(i=e.parseSourceMapInput(t));var n=e.getArg(i,"version"),o=e.getArg(i,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new s,this._names=new s;var c={line:-1,column:0};this._sections=o.map((function(t){if(t.url)throw new Error("Support for url field in sections not implemented.");var s=e.getArg(t,"offset"),i=e.getArg(s,"line"),n=e.getArg(s,"column");if(i<c.line||i===c.line&&n<c.column)throw new Error("Section offsets must be ordered and non-overlapping.");return c=s,{generatedOffset:{generatedLine:i+1,generatedColumn:n+1},consumer:new r(e.getArg(t,"map"),a)}}))}r.fromSourceMap=function(t,e){return o.fromSourceMap(t,e)},r.prototype._version=3,r.prototype.__generatedMappings=null,Object.defineProperty(r.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),r.prototype.__originalMappings=null,Object.defineProperty(r.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),r.prototype._charIsMappingSeparator=function(t,e){var a=t.charAt(e);return";"===a||","===a},r.prototype._parseMappings=function(t,e){throw new Error("Subclasses must implement _parseMappings")},r.GENERATED_ORDER=1,r.ORIGINAL_ORDER=2,r.GREATEST_LOWER_BOUND=1,r.LEAST_UPPER_BOUND=2,r.prototype.eachMapping=function(t,a,s){var i,n=a||null;switch(s||r.GENERATED_ORDER){case r.GENERATED_ORDER:i=this._generatedMappings;break;case r.ORIGINAL_ORDER:i=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var o=this.sourceRoot;i.map((function(t){var a=null===t.source?null:this._sources.at(t.source);return{source:a=e.computeSourceURL(o,a,this._sourceMapURL),generatedLine:t.generatedLine,generatedColumn:t.generatedColumn,originalLine:t.originalLine,originalColumn:t.originalColumn,name:null===t.name?null:this._names.at(t.name)}}),this).forEach(t,n)},r.prototype.allGeneratedPositionsFor=function(t){var s=e.getArg(t,"line"),i={source:e.getArg(t,"source"),originalLine:s,originalColumn:e.getArg(t,"column",0)};if(i.source=this._findSourceIndex(i.source),i.source<0)return[];var n=[],r=this._findMapping(i,this._originalMappings,"originalLine","originalColumn",e.compareByOriginalPositions,a.LEAST_UPPER_BOUND);if(r>=0){var o=this._originalMappings[r];if(void 0===t.column)for(var c=o.originalLine;o&&o.originalLine===c;)n.push({line:e.getArg(o,"generatedLine",null),column:e.getArg(o,"generatedColumn",null),lastColumn:e.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++r];else for(var l=o.originalColumn;o&&o.originalLine===s&&o.originalColumn==l;)n.push({line:e.getArg(o,"generatedLine",null),column:e.getArg(o,"generatedColumn",null),lastColumn:e.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++r]}return n},t.SourceMapConsumer=r,o.prototype=Object.create(r.prototype),o.prototype.consumer=r,o.prototype._findSourceIndex=function(t){var a,s=t;if(null!=this.sourceRoot&&(s=e.relative(this.sourceRoot,s)),this._sources.has(s))return this._sources.indexOf(s);for(a=0;a<this._absoluteSources.length;++a)if(this._absoluteSources[a]==t)return a;return-1},o.fromSourceMap=function(t,a){var i=Object.create(o.prototype),r=i._names=s.fromArray(t._names.toArray(),!0),l=i._sources=s.fromArray(t._sources.toArray(),!0);i.sourceRoot=t._sourceRoot,i.sourcesContent=t._generateSourcesContent(i._sources.toArray(),i.sourceRoot),i.file=t._file,i._sourceMapURL=a,i._absoluteSources=i._sources.toArray().map((function(t){return e.computeSourceURL(i.sourceRoot,t,a)}));for(var h=t._mappings.toArray().slice(),d=i.__generatedMappings=[],u=i.__originalMappings=[],p=0,m=h.length;p<m;p++){var f=h[p],g=new c;g.generatedLine=f.generatedLine,g.generatedColumn=f.generatedColumn,f.source&&(g.source=l.indexOf(f.source),g.originalLine=f.originalLine,g.originalColumn=f.originalColumn,f.name&&(g.name=r.indexOf(f.name)),u.push(g)),d.push(g)}return n(i.__originalMappings,e.compareByOriginalPositions),i},o.prototype._version=3,Object.defineProperty(o.prototype,"sources",{get:function(){return this._absoluteSources.slice()}}),o.prototype._parseMappings=function(t,a){for(var s,r,o,l,h,d=1,u=0,p=0,m=0,f=0,g=0,w=t.length,E=0,v={},y={},I=[],D=[];E<w;)if(";"===t.charAt(E))d++,E++,u=0;else if(","===t.charAt(E))E++;else{for((s=new c).generatedLine=d,l=E;l<w&&!this._charIsMappingSeparator(t,l);l++);if(o=v[r=t.slice(E,l)])E+=r.length;else{for(o=[];E<l;)i.decode(t,E,y),h=y.value,E=y.rest,o.push(h);if(2===o.length)throw new Error("Found a source, but no line and column");if(3===o.length)throw new Error("Found a source and line, but no column");v[r]=o}s.generatedColumn=u+o[0],u=s.generatedColumn,o.length>1&&(s.source=f+o[1],f+=o[1],s.originalLine=p+o[2],p=s.originalLine,s.originalLine+=1,s.originalColumn=m+o[3],m=s.originalColumn,o.length>4&&(s.name=g+o[4],g+=o[4])),D.push(s),"number"==typeof s.originalLine&&I.push(s)}n(D,e.compareByGeneratedPositionsDeflated),this.__generatedMappings=D,n(I,e.compareByOriginalPositions),this.__originalMappings=I},o.prototype._findMapping=function(t,e,s,i,n,r){if(t[s]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+t[s]);if(t[i]<0)throw new TypeError("Column must be greater than or equal to 0, got "+t[i]);return a.search(t,e,n,r)},o.prototype.computeColumnSpans=function(){for(var t=0;t<this._generatedMappings.length;++t){var e=this._generatedMappings[t];if(t+1<this._generatedMappings.length){var a=this._generatedMappings[t+1];if(e.generatedLine===a.generatedLine){e.lastGeneratedColumn=a.generatedColumn-1;continue}}e.lastGeneratedColumn=1/0}},o.prototype.originalPositionFor=function(t){var a={generatedLine:e.getArg(t,"line"),generatedColumn:e.getArg(t,"column")},s=this._findMapping(a,this._generatedMappings,"generatedLine","generatedColumn",e.compareByGeneratedPositionsDeflated,e.getArg(t,"bias",r.GREATEST_LOWER_BOUND));if(s>=0){var i=this._generatedMappings[s];if(i.generatedLine===a.generatedLine){var n=e.getArg(i,"source",null);null!==n&&(n=this._sources.at(n),n=e.computeSourceURL(this.sourceRoot,n,this._sourceMapURL));var o=e.getArg(i,"name",null);return null!==o&&(o=this._names.at(o)),{source:n,line:e.getArg(i,"originalLine",null),column:e.getArg(i,"originalColumn",null),name:o}}}return{source:null,line:null,column:null,name:null}},o.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some((function(t){return null==t})))},o.prototype.sourceContentFor=function(t,a){if(!this.sourcesContent)return null;var s=this._findSourceIndex(t);if(s>=0)return this.sourcesContent[s];var i,n=t;if(null!=this.sourceRoot&&(n=e.relative(this.sourceRoot,n)),null!=this.sourceRoot&&(i=e.urlParse(this.sourceRoot))){var r=n.replace(/^file:\/\//,"");if("file"==i.scheme&&this._sources.has(r))return this.sourcesContent[this._sources.indexOf(r)];if((!i.path||"/"==i.path)&&this._sources.has("/"+n))return this.sourcesContent[this._sources.indexOf("/"+n)]}if(a)return null;throw new Error('"'+n+'" is not in the SourceMap.')},o.prototype.generatedPositionFor=function(t){var a=e.getArg(t,"source");if((a=this._findSourceIndex(a))<0)return{line:null,column:null,lastColumn:null};var s={source:a,originalLine:e.getArg(t,"line"),originalColumn:e.getArg(t,"column")},i=this._findMapping(s,this._originalMappings,"originalLine","originalColumn",e.compareByOriginalPositions,e.getArg(t,"bias",r.GREATEST_LOWER_BOUND));if(i>=0){var n=this._originalMappings[i];if(n.source===s.source)return{line:e.getArg(n,"generatedLine",null),column:e.getArg(n,"generatedColumn",null),lastColumn:e.getArg(n,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},t.BasicSourceMapConsumer=o,l.prototype=Object.create(r.prototype),l.prototype.constructor=r,l.prototype._version=3,Object.defineProperty(l.prototype,"sources",{get:function(){for(var t=[],e=0;e<this._sections.length;e++)for(var a=0;a<this._sections[e].consumer.sources.length;a++)t.push(this._sections[e].consumer.sources[a]);return t}}),l.prototype.originalPositionFor=function(t){var s={generatedLine:e.getArg(t,"line"),generatedColumn:e.getArg(t,"column")},i=a.search(s,this._sections,(function(t,e){var a=t.generatedLine-e.generatedOffset.generatedLine;return a||t.generatedColumn-e.generatedOffset.generatedColumn})),n=this._sections[i];return n?n.consumer.originalPositionFor({line:s.generatedLine-(n.generatedOffset.generatedLine-1),column:s.generatedColumn-(n.generatedOffset.generatedLine===s.generatedLine?n.generatedOffset.generatedColumn-1:0),bias:t.bias}):{source:null,line:null,column:null,name:null}},l.prototype.hasContentsOfAllSources=function(){return this._sections.every((function(t){return t.consumer.hasContentsOfAllSources()}))},l.prototype.sourceContentFor=function(t,e){for(var a=0;a<this._sections.length;a++){var s=this._sections[a].consumer.sourceContentFor(t,!0);if(s)return s}if(e)return null;throw new Error('"'+t+'" is not in the SourceMap.')},l.prototype.generatedPositionFor=function(t){for(var a=0;a<this._sections.length;a++){var s=this._sections[a];if(-1!==s.consumer._findSourceIndex(e.getArg(t,"source"))){var i=s.consumer.generatedPositionFor(t);if(i)return{line:i.line+(s.generatedOffset.generatedLine-1),column:i.column+(s.generatedOffset.generatedLine===i.line?s.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},l.prototype._parseMappings=function(t,a){this.__generatedMappings=[],this.__originalMappings=[];for(var s=0;s<this._sections.length;s++)for(var i=this._sections[s],r=i.consumer._generatedMappings,o=0;o<r.length;o++){var c=r[o],l=i.consumer._sources.at(c.source);l=e.computeSourceURL(i.consumer.sourceRoot,l,this._sourceMapURL),this._sources.add(l),l=this._sources.indexOf(l);var h=null;c.name&&(h=i.consumer._names.at(c.name),this._names.add(h),h=this._names.indexOf(h));var d={source:l,generatedLine:c.generatedLine+(i.generatedOffset.generatedLine-1),generatedColumn:c.generatedColumn+(i.generatedOffset.generatedLine===c.generatedLine?i.generatedOffset.generatedColumn-1:0),originalLine:c.originalLine,originalColumn:c.originalColumn,name:h};this.__generatedMappings.push(d),"number"==typeof d.originalLine&&this.__originalMappings.push(d)}n(this.__generatedMappings,e.compareByGeneratedPositionsDeflated),n(this.__originalMappings,e.compareByOriginalPositions)},t.IndexedSourceMapConsumer=l}}),ee=gt({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-node.js"(t){var e=Qt().SourceMapGenerator,a=Yt(),s=/(\r?\n)/,i="$$$isSourceNode$$$";function n(t,e,a,s,n){this.children=[],this.sourceContents={},this.line=null==t?null:t,this.column=null==e?null:e,this.source=null==a?null:a,this.name=null==n?null:n,this[i]=!0,null!=s&&this.add(s)}n.fromStringWithSourceMap=function(t,e,i){var r=new n,o=t.split(s),c=0,l=function(){return t()+(t()||"");function t(){return c<o.length?o[c++]:void 0}},h=1,d=0,u=null;return e.eachMapping((function(t){if(null!==u){if(!(h<t.generatedLine)){var e=(a=o[c]||"").substr(0,t.generatedColumn-d);return o[c]=a.substr(t.generatedColumn-d),d=t.generatedColumn,p(u,e),void(u=t)}p(u,l()),h++,d=0}for(;h<t.generatedLine;)r.add(l()),h++;if(d<t.generatedColumn){var a=o[c]||"";r.add(a.substr(0,t.generatedColumn)),o[c]=a.substr(t.generatedColumn),d=t.generatedColumn}u=t}),this),c<o.length&&(u&&p(u,l()),r.add(o.splice(c).join(""))),e.sources.forEach((function(t){var s=e.sourceContentFor(t);null!=s&&(null!=i&&(t=a.join(i,t)),r.setSourceContent(t,s))})),r;function p(t,e){if(null===t||void 0===t.source)r.add(e);else{var s=i?a.join(i,t.source):t.source;r.add(new n(t.originalLine,t.originalColumn,s,e,t.name))}}},n.prototype.add=function(t){if(Array.isArray(t))t.forEach((function(t){this.add(t)}),this);else{if(!t[i]&&"string"!=typeof t)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);t&&this.children.push(t)}return this},n.prototype.prepend=function(t){if(Array.isArray(t))for(var e=t.length-1;e>=0;e--)this.prepend(t[e]);else{if(!t[i]&&"string"!=typeof t)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);this.children.unshift(t)}return this},n.prototype.walk=function(t){for(var e,a=0,s=this.children.length;a<s;a++)(e=this.children[a])[i]?e.walk(t):""!==e&&t(e,{source:this.source,line:this.line,column:this.column,name:this.name})},n.prototype.join=function(t){var e,a,s=this.children.length;if(s>0){for(e=[],a=0;a<s-1;a++)e.push(this.children[a]),e.push(t);e.push(this.children[a]),this.children=e}return this},n.prototype.replaceRight=function(t,e){var a=this.children[this.children.length-1];return a[i]?a.replaceRight(t,e):"string"==typeof a?this.children[this.children.length-1]=a.replace(t,e):this.children.push("".replace(t,e)),this},n.prototype.setSourceContent=function(t,e){this.sourceContents[a.toSetString(t)]=e},n.prototype.walkSourceContents=function(t){for(var e=0,s=this.children.length;e<s;e++)this.children[e][i]&&this.children[e].walkSourceContents(t);var n=Object.keys(this.sourceContents);for(e=0,s=n.length;e<s;e++)t(a.fromSetString(n[e]),this.sourceContents[n[e]])},n.prototype.toString=function(){var t="";return this.walk((function(e){t+=e})),t},n.prototype.toStringWithSourceMap=function(t){var a={code:"",line:1,column:0},s=new e(t),i=!1,n=null,r=null,o=null,c=null;return this.walk((function(t,e){a.code+=t,null!==e.source&&null!==e.line&&null!==e.column?(n===e.source&&r===e.line&&o===e.column&&c===e.name||s.addMapping({source:e.source,original:{line:e.line,column:e.column},generated:{line:a.line,column:a.column},name:e.name}),n=e.source,r=e.line,o=e.column,c=e.name,i=!0):i&&(s.addMapping({generated:{line:a.line,column:a.column}}),n=null,i=!1);for(var l=0,h=t.length;l<h;l++)10===t.charCodeAt(l)?(a.line++,a.column=0,l+1===h?(n=null,i=!1):i&&s.addMapping({source:e.source,original:{line:e.line,column:e.column},generated:{line:a.line,column:a.column},name:e.name})):a.column++})),this.walkSourceContents((function(t,e){s.setSourceContent(t,e)})),{code:a.code,map:s}},t.SourceNode=n}}),ae=gt({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/source-map.js"(t){t.SourceMapGenerator=Qt().SourceMapGenerator,t.SourceMapConsumer=te().SourceMapConsumer,t.SourceNode=ee().SourceNode}}),se=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/code-gen.js"(t,e){t.__esModule=!0;var a,s=Et(),i=void 0;try{"function"==typeof define&&define.amd||(a=ae(),i=a.SourceNode)}catch(t){}function n(t,e,a){if(s.isArray(t)){for(var i=[],n=0,r=t.length;n<r;n++)i.push(e.wrap(t[n],a));return i}return"boolean"==typeof t||"number"==typeof t?t+"":t}function r(t){this.srcFile=t,this.source=[]}i||((i=function(t,e,a,s){this.src="",s&&this.add(s)}).prototype={add:function(t){s.isArray(t)&&(t=t.join("")),this.src+=t},prepend:function(t){s.isArray(t)&&(t=t.join("")),this.src=t+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}}),r.prototype={isEmpty:function(){return!this.source.length},prepend:function(t,e){this.source.unshift(this.wrap(t,e))},push:function(t,e){this.source.push(this.wrap(t,e))},merge:function(){var t=this.empty();return this.each((function(e){t.add([" ",e,"\n"])})),t},each:function(t){for(var e=0,a=this.source.length;e<a;e++)t(this.source[e])},empty:function(){var t=this.currentLocation||{start:{}};return new i(t.start.line,t.start.column,this.srcFile)},wrap:function(t){var e=arguments.length<=1||void 0===arguments[1]?this.currentLocation||{start:{}}:arguments[1];return t instanceof i?t:(t=n(t,this,e),new i(e.start.line,e.start.column,this.srcFile,t))},functionCall:function(t,e,a){return a=this.generateList(a),this.wrap([t,e?"."+e+"(":"(",a,")"])},quotedString:function(t){return'"'+(t+"").replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(t){var e=this,a=[];Object.keys(t).forEach((function(s){var i=n(t[s],e);"undefined"!==i&&a.push([e.quotedString(s),":",i])}));var s=this.generateList(a);return s.prepend("{"),s.add("}"),s},generateList:function(t){for(var e=this.empty(),a=0,s=t.length;a<s;a++)a&&e.add(","),e.add(n(t[a],this));return e},generateArray:function(t){var e=this.generateList(t);return e.prepend("["),e.add("]"),e}},t.default=r,e.exports=t.default}}),ie=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js"(t,e){function a(t){return t&&t.__esModule?t:{default:t}}t.__esModule=!0;var s=Ot(),i=a(vt()),n=Et(),r=a(se());function o(t){this.value=t}function c(){}c.prototype={nameLookup:function(t,e){return this.internalNameLookup(t,e)},depthedLookup:function(t){return[this.aliasable("container.lookup"),"(depths, ",JSON.stringify(t),")"]},compilerInfo:function(){var t=s.COMPILER_REVISION;return[t,s.REVISION_CHANGES[t]]},appendToBuffer:function(t,e,a){return n.isArray(t)||(t=[t]),t=this.source.wrap(t,e),this.environment.isSimple?["return ",t,";"]:a?["buffer += ",t,";"]:(t.appendToBuffer=!0,t)},initializeBuffer:function(){return this.quotedString("")},internalNameLookup:function(t,e){return this.lookupPropertyFunctionIsUsed=!0,["lookupProperty(",t,",",JSON.stringify(e),")"]},lookupPropertyFunctionIsUsed:!1,compile:function(t,e,a,s){this.environment=t,this.options=e,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!s,this.name=this.environment.name,this.isChild=!!a,this.context=a||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(t,e),this.useDepths=this.useDepths||t.useDepths||t.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||t.useBlockParams;var n=t.opcodes,r=void 0,o=void 0,c=void 0,l=void 0;for(c=0,l=n.length;c<l;c++)r=n[c],this.source.currentLocation=r.loc,o=o||r.loc,this[r.opcode].apply(this,r.args);if(this.source.currentLocation=o,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new i.default("Compile completed with content left on stack");this.decorators.isEmpty()?this.decorators=void 0:(this.useDecorators=!0,this.decorators.prepend(["var decorators = container.decorators, ",this.lookupPropertyFunctionVarDeclaration(),";\n"]),this.decorators.push("return fn;"),s?this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]):(this.decorators.prepend("function(fn, props, container, depth0, data, blockParams, depths) {\n"),this.decorators.push("}\n"),this.decorators=this.decorators.merge()));var h=this.createFunctionContext(s);if(this.isChild)return h;var d={compiler:this.compilerInfo(),main:h};this.decorators&&(d.main_d=this.decorators,d.useDecorators=!0);var u=this.context,p=u.programs,m=u.decorators;for(c=0,l=p.length;c<l;c++)p[c]&&(d[c]=p[c],m[c]&&(d[c+"_d"]=m[c],d.useDecorators=!0));return this.environment.usePartial&&(d.usePartial=!0),this.options.data&&(d.useData=!0),this.useDepths&&(d.useDepths=!0),this.useBlockParams&&(d.useBlockParams=!0),this.options.compat&&(d.compat=!0),s?d.compilerOptions=this.options:(d.compiler=JSON.stringify(d.compiler),this.source.currentLocation={start:{line:1,column:0}},d=this.objectLiteral(d),e.srcName?(d=d.toStringWithSourceMap({file:e.destName})).map=d.map&&d.map.toString():d=d.toString()),d},preamble:function(){this.lastContext=0,this.source=new r.default(this.options.srcName),this.decorators=new r.default(this.options.srcName)},createFunctionContext:function(t){var e=this,a="",s=this.stackVars.concat(this.registers.list);s.length>0&&(a+=", "+s.join(", "));var i=0;Object.keys(this.aliases).forEach((function(t){var s=e.aliases[t];s.children&&s.referenceCount>1&&(a+=", alias"+ ++i+"="+t,s.children[0]="alias"+i)})),this.lookupPropertyFunctionIsUsed&&(a+=", "+this.lookupPropertyFunctionVarDeclaration());var n=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&n.push("blockParams"),this.useDepths&&n.push("depths");var r=this.mergeSource(a);return t?(n.push(r),Function.apply(this,n)):this.source.wrap(["function(",n.join(","),") {\n ",r,"}"])},mergeSource:function(t){var e=this.environment.isSimple,a=!this.forceBuffer,s=void 0,i=void 0,n=void 0,r=void 0;return this.source.each((function(t){t.appendToBuffer?(n?t.prepend(" + "):n=t,r=t):(n&&(i?n.prepend("buffer += "):s=!0,r.add(";"),n=r=void 0),i=!0,e||(a=!1))})),a?n?(n.prepend("return "),r.add(";")):i||this.source.push('return "";'):(t+=", buffer = "+(s?"":this.initializeBuffer()),n?(n.prepend("return buffer + "),r.add(";")):this.source.push("return buffer;")),t&&this.source.prepend("var "+t.substring(2)+(s?"":";\n")),this.source.merge()},lookupPropertyFunctionVarDeclaration:function(){return"\n lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n }\n ".trim()},blockValue:function(t){var e=this.aliasable("container.hooks.blockHelperMissing"),a=[this.contextName(0)];this.setupHelperArgs(t,0,a);var s=this.popStack();a.splice(1,0,s),this.push(this.source.functionCall(e,"call",a))},ambiguousBlockValue:function(){var t=this.aliasable("container.hooks.blockHelperMissing"),e=[this.contextName(0)];this.setupHelperArgs("",0,e,!0),this.flushInline();var a=this.topStack();e.splice(1,0,a),this.pushSource(["if (!",this.lastHelper,") { ",a," = ",this.source.functionCall(t,"call",e),"}"])},appendContent:function(t){this.pendingContent?t=this.pendingContent+t:this.pendingLocation=this.source.currentLocation,this.pendingContent=t},append:function(){if(this.isInline())this.replaceStack((function(t){return[" != null ? ",t,' : ""']})),this.pushSource(this.appendToBuffer(this.popStack()));else{var t=this.popStack();this.pushSource(["if (",t," != null) { ",this.appendToBuffer(t,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(t){this.lastContext=t},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(t,e,a,s){var i=0;s||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(t[i++])),this.resolvePath("context",t,i,e,a)},lookupBlockParam:function(t,e){this.useBlockParams=!0,this.push(["blockParams[",t[0],"][",t[1],"]"]),this.resolvePath("context",e,1)},lookupData:function(t,e,a){t?this.pushStackLiteral("container.data(data, "+t+")"):this.pushStackLiteral("data"),this.resolvePath("data",e,0,!0,a)},resolvePath:function(t,e,a,s,i){var n=this;if(this.options.strict||this.options.assumeObjects)this.push(function(t,e,a,s,i){var n=e.popStack(),r=a.length;t&&r--;for(;s<r;s++)n=e.nameLookup(n,a[s],i);return t?[e.aliasable("container.strict"),"(",n,", ",e.quotedString(a[s]),", ",JSON.stringify(e.source.currentLocation)," )"]:n}(this.options.strict&&i,this,e,a,t));else for(var r=e.length;a<r;a++)this.replaceStack((function(i){var r=n.nameLookup(i,e[a],t);return s?[" && ",r]:[" != null ? ",r," : ",i]}))},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(t,e){this.pushContext(),this.pushString(e),"SubExpression"!==e&&("string"==typeof t?this.pushString(t):this.pushStackLiteral(t))},emptyHash:function(t){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(t?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function(){var t=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(t.ids)),this.stringParams&&(this.push(this.objectLiteral(t.contexts)),this.push(this.objectLiteral(t.types))),this.push(this.objectLiteral(t.values))},pushString:function(t){this.pushStackLiteral(this.quotedString(t))},pushLiteral:function(t){this.pushStackLiteral(t)},pushProgram:function(t){null!=t?this.pushStackLiteral(this.programExpression(t)):this.pushStackLiteral(null)},registerDecorator:function(t,e){var a=this.nameLookup("decorators",e,"decorator"),s=this.setupHelperArgs(e,t);this.decorators.push(["fn = ",this.decorators.functionCall(a,"",["fn","props","container",s])," || fn;"])},invokeHelper:function(t,e,a){var s=this.popStack(),i=this.setupHelper(t,e),n=[];a&&n.push(i.name),n.push(s),this.options.strict||n.push(this.aliasable("container.hooks.helperMissing"));var r=["(",this.itemsSeparatedBy(n,"||"),")"],o=this.source.functionCall(r,"call",i.callParams);this.push(o)},itemsSeparatedBy:function(t,e){var a=[];a.push(t[0]);for(var s=1;s<t.length;s++)a.push(e,t[s]);return a},invokeKnownHelper:function(t,e){var a=this.setupHelper(t,e);this.push(this.source.functionCall(a.name,"call",a.callParams))},invokeAmbiguous:function(t,e){this.useRegister("helper");var a=this.popStack();this.emptyHash();var s=this.setupHelper(0,t,e),i=["(","(helper = ",this.lastHelper=this.nameLookup("helpers",t,"helper")," || ",a,")"];this.options.strict||(i[0]="(helper = ",i.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"))),this.push(["(",i,s.paramsInit?["),(",s.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",s.callParams)," : helper))"])},invokePartial:function(t,e,a){var s=[],i=this.setupParams(e,1,s);t&&(e=this.popStack(),delete i.name),a&&(i.indent=JSON.stringify(a)),i.helpers="helpers",i.partials="partials",i.decorators="container.decorators",t?s.unshift(e):s.unshift(this.nameLookup("partials",e,"partial")),this.options.compat&&(i.depths="depths"),i=this.objectLiteral(i),s.push(i),this.push(this.source.functionCall("container.invokePartial","",s))},assignToHash:function(t){var e=this.popStack(),a=void 0,s=void 0,i=void 0;this.trackIds&&(i=this.popStack()),this.stringParams&&(s=this.popStack(),a=this.popStack());var n=this.hash;a&&(n.contexts[t]=a),s&&(n.types[t]=s),i&&(n.ids[t]=i),n.values[t]=e},pushId:function(t,e,a){"BlockParam"===t?this.pushStackLiteral("blockParams["+e[0]+"].path["+e[1]+"]"+(a?" + "+JSON.stringify("."+a):"")):"PathExpression"===t?this.pushString(e):"SubExpression"===t?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:c,compileChildren:function(t,e){for(var a=t.children,s=void 0,i=void 0,n=0,r=a.length;n<r;n++){s=a[n],i=new this.compiler;var o=this.matchExistingProgram(s);if(null==o){this.context.programs.push("");var c=this.context.programs.length;s.index=c,s.name="program"+c,this.context.programs[c]=i.compile(s,e,this.context,!this.precompile),this.context.decorators[c]=i.decorators,this.context.environments[c]=s,this.useDepths=this.useDepths||i.useDepths,this.useBlockParams=this.useBlockParams||i.useBlockParams,s.useDepths=this.useDepths,s.useBlockParams=this.useBlockParams}else s.index=o.index,s.name="program"+o.index,this.useDepths=this.useDepths||o.useDepths,this.useBlockParams=this.useBlockParams||o.useBlockParams}},matchExistingProgram:function(t){for(var e=0,a=this.context.environments.length;e<a;e++){var s=this.context.environments[e];if(s&&s.equals(t))return s}},programExpression:function(t){var e=this.environment.children[t],a=[e.index,"data",e.blockParams];return(this.useBlockParams||this.useDepths)&&a.push("blockParams"),this.useDepths&&a.push("depths"),"container.program("+a.join(", ")+")"},useRegister:function(t){this.registers[t]||(this.registers[t]=!0,this.registers.list.push(t))},push:function(t){return t instanceof o||(t=this.source.wrap(t)),this.inlineStack.push(t),t},pushStackLiteral:function(t){this.push(new o(t))},pushSource:function(t){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),t&&this.source.push(t)},replaceStack:function(t){var e=["("],a=void 0,s=void 0,n=void 0;if(!this.isInline())throw new i.default("replaceStack on non-inline");var r=this.popStack(!0);if(r instanceof o)e=["(",a=[r.value]],n=!0;else{s=!0;var c=this.incrStack();e=["((",this.push(c)," = ",r,")"],a=this.topStack()}var l=t.call(this,a);n||this.popStack(),s&&this.stackSlot--,this.push(e.concat(l,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var t=this.inlineStack;this.inlineStack=[];for(var e=0,a=t.length;e<a;e++){var s=t[e];if(s instanceof o)this.compileStack.push(s);else{var i=this.incrStack();this.pushSource([i," = ",s,";"]),this.compileStack.push(i)}}},isInline:function(){return this.inlineStack.length},popStack:function(t){var e=this.isInline(),a=(e?this.inlineStack:this.compileStack).pop();if(!t&&a instanceof o)return a.value;if(!e){if(!this.stackSlot)throw new i.default("Invalid stack pop");this.stackSlot--}return a},topStack:function(){var t=this.isInline()?this.inlineStack:this.compileStack,e=t[t.length-1];return e instanceof o?e.value:e},contextName:function(t){return this.useDepths&&t?"depths["+t+"]":"depth"+t},quotedString:function(t){return this.source.quotedString(t)},objectLiteral:function(t){return this.source.objectLiteral(t)},aliasable:function(t){var e=this.aliases[t];return e?(e.referenceCount++,e):((e=this.aliases[t]=this.source.wrap(t)).aliasable=!0,e.referenceCount=1,e)},setupHelper:function(t,e,a){var s=[];return{params:s,paramsInit:this.setupHelperArgs(e,t,s,a),name:this.nameLookup("helpers",e,"helper"),callParams:[this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})")].concat(s)}},setupParams:function(t,e,a){var s={},i=[],n=[],r=[],o=!a,c=void 0;o&&(a=[]),s.name=this.quotedString(t),s.hash=this.popStack(),this.trackIds&&(s.hashIds=this.popStack()),this.stringParams&&(s.hashTypes=this.popStack(),s.hashContexts=this.popStack());var l=this.popStack(),h=this.popStack();(h||l)&&(s.fn=h||"container.noop",s.inverse=l||"container.noop");for(var d=e;d--;)c=this.popStack(),a[d]=c,this.trackIds&&(r[d]=this.popStack()),this.stringParams&&(n[d]=this.popStack(),i[d]=this.popStack());return o&&(s.args=this.source.generateArray(a)),this.trackIds&&(s.ids=this.source.generateArray(r)),this.stringParams&&(s.types=this.source.generateArray(n),s.contexts=this.source.generateArray(i)),this.options.data&&(s.data="data"),this.useBlockParams&&(s.blockParams="blockParams"),s},setupHelperArgs:function(t,e,a,s){var i=this.setupParams(t,e,a);return i.loc=JSON.stringify(this.source.currentLocation),i=this.objectLiteral(i),s?(this.useRegister("options"),a.push("options"),["options=",i]):a?(a.push(i),""):i}},function(){for(var t="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),e=c.RESERVED_WORDS={},a=0,s=t.length;a<s;a++)e[t[a]]=!0}(),c.isValidJavaScriptVariableName=function(t){return!c.RESERVED_WORDS[t]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(t)},t.default=c,e.exports=t.default}}),ne=gt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars.js"(t,e){function a(t){return t&&t.__esModule?t:{default:t}}t.__esModule=!0;var s=a(Ft()),i=a(Wt()),n=Gt(),r=Ht(),o=a(ie()),c=a(Ut()),l=a(Vt()),h=s.default.create;function d(){var t=h();return t.compile=function(e,a){return r.compile(e,a,t)},t.precompile=function(e,a){return r.precompile(e,a,t)},t.AST=i.default,t.Compiler=r.Compiler,t.JavaScriptCompiler=o.default,t.Parser=n.parser,t.parse=n.parse,t.parseWithoutProcessing=n.parseWithoutProcessing,t}var u=d();u.create=d,l.default(u),u.Visitor=c.default,u.default=u,t.default=u,e.exports=t.default}}),re=gt({"../../node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.js"(t,e){function a(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function s(t,e){for(var a,s="",i=0,n=-1,r=0,o=0;o<=t.length;++o){if(o<t.length)a=t.charCodeAt(o);else{if(47===a)break;a=47}if(47===a){if(n===o-1||1===r);else if(n!==o-1&&2===r){if(s.length<2||2!==i||46!==s.charCodeAt(s.length-1)||46!==s.charCodeAt(s.length-2))if(s.length>2){var c=s.lastIndexOf("/");if(c!==s.length-1){-1===c?(s="",i=0):i=(s=s.slice(0,c)).length-1-s.lastIndexOf("/"),n=o,r=0;continue}}else if(2===s.length||1===s.length){s="",i=0,n=o,r=0;continue}e&&(s.length>0?s+="/..":s="..",i=2)}else s.length>0?s+="/"+t.slice(n+1,o):s=t.slice(n+1,o),i=o-n-1;n=o,r=0}else 46===a&&-1!==r?++r:r=-1}return s}var i={resolve:function(){for(var t,e="",i=!1,n=arguments.length-1;n>=-1&&!i;n--){var r;n>=0?r=arguments[n]:(void 0===t&&(t=process.cwd()),r=t),a(r),0!==r.length&&(e=r+"/"+e,i=47===r.charCodeAt(0))}return e=s(e,!i),i?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(t){if(a(t),0===t.length)return".";var e=47===t.charCodeAt(0),i=47===t.charCodeAt(t.length-1);return 0!==(t=s(t,!e)).length||e||(t="."),t.length>0&&i&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return a(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e<arguments.length;++e){var s=arguments[e];a(s),s.length>0&&(void 0===t?t=s:t+="/"+s)}return void 0===t?".":i.normalize(t)},relative:function(t,e){if(a(t),a(e),t===e)return"";if((t=i.resolve(t))===(e=i.resolve(e)))return"";for(var s=1;s<t.length&&47===t.charCodeAt(s);++s);for(var n=t.length,r=n-s,o=1;o<e.length&&47===e.charCodeAt(o);++o);for(var c=e.length-o,l=r<c?r:c,h=-1,d=0;d<=l;++d){if(d===l){if(c>l){if(47===e.charCodeAt(o+d))return e.slice(o+d+1);if(0===d)return e.slice(o+d)}else r>l&&(47===t.charCodeAt(s+d)?h=d:0===d&&(h=0));break}var u=t.charCodeAt(s+d);if(u!==e.charCodeAt(o+d))break;47===u&&(h=d)}var p="";for(d=s+h+1;d<=n;++d)d!==n&&47!==t.charCodeAt(d)||(0===p.length?p+="..":p+="/..");return p.length>0?p+e.slice(o+h):(o+=h,47===e.charCodeAt(o)&&++o,e.slice(o))},_makeLong:function(t){return t},dirname:function(t){if(a(t),0===t.length)return".";for(var e=t.charCodeAt(0),s=47===e,i=-1,n=!0,r=t.length-1;r>=1;--r)if(47===(e=t.charCodeAt(r))){if(!n){i=r;break}}else n=!1;return-1===i?s?"/":".":s&&1===i?"//":t.slice(0,i)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');a(t);var s,i=0,n=-1,r=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var o=e.length-1,c=-1;for(s=t.length-1;s>=0;--s){var l=t.charCodeAt(s);if(47===l){if(!r){i=s+1;break}}else-1===c&&(r=!1,c=s+1),o>=0&&(l===e.charCodeAt(o)?-1==--o&&(n=s):(o=-1,n=c))}return i===n?n=c:-1===n&&(n=t.length),t.slice(i,n)}for(s=t.length-1;s>=0;--s)if(47===t.charCodeAt(s)){if(!r){i=s+1;break}}else-1===n&&(r=!1,n=s+1);return-1===n?"":t.slice(i,n)},extname:function(t){a(t);for(var e=-1,s=0,i=-1,n=!0,r=0,o=t.length-1;o>=0;--o){var c=t.charCodeAt(o);if(47!==c)-1===i&&(n=!1,i=o+1),46===c?-1===e?e=o:1!==r&&(r=1):-1!==e&&(r=-1);else if(!n){s=o+1;break}}return-1===e||-1===i||0===r||1===r&&e===i-1&&e===s+1?"":t.slice(e,i)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function(t,e){var a=e.dir||e.root,s=e.base||(e.name||"")+(e.ext||"");return a?a===e.root?a+s:a+t+s:s}("/",t)},parse:function(t){a(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var s,i=t.charCodeAt(0),n=47===i;n?(e.root="/",s=1):s=0;for(var r=-1,o=0,c=-1,l=!0,h=t.length-1,d=0;h>=s;--h)if(47!==(i=t.charCodeAt(h)))-1===c&&(l=!1,c=h+1),46===i?-1===r?r=h:1!==d&&(d=1):-1!==r&&(d=-1);else if(!l){o=h+1;break}return-1===r||-1===c||0===d||1===d&&r===c-1&&r===o+1?-1!==c&&(e.base=e.name=0===o&&n?t.slice(1,c):t.slice(o,c)):(0===o&&n?(e.name=t.slice(1,r),e.base=t.slice(1,c)):(e.name=t.slice(o,r),e.base=t.slice(o,c)),e.ext=t.slice(r,c)),o>0?e.dir=t.slice(0,o-1):n&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};i.posix=i,e.exports=i}}),oe=class{constructor(){this.view={enableDataInfoBar:!0},this.grid={editShowMode:"row",editSaveMode:"cell-blur"},this.appMenu={enableEcho:!0},this.codeList={timeout:36e5}}},ce=t("RegisterCenter",class{constructor(){this.providers=new Map}register(t,e){this.providers.set(t,e)}unRegister(t){this.providers.delete(t)}get(t,...e){const a=this.providers.get(t);if(a)return a(...e)}}),le=class{static isHelperName(t){return this.helperNames.includes(t)}static handleJudgmentExecute(t,e,a){return a.fn?e?a.fn(t):a.inverse(t):e?a.hash.yes=!0:a.hash.no=!1}};le.helperNames=["lookup","log","and","camelCase","concat","eq","gt","get","lowerCase","lt","lte","neq","not","or","pascalCase","pluralize","snakeCase","spinalCase","upperCase"];var he=class{constructor(t,e){t.registerHelper(e,this.onExecute)}},de=class extends he{constructor(t){super(t,"and")}onExecute(...t){const e=t[t.length-1];t.pop();const a=t.filter((t=>!!t)).length===t.length;return le.handleJudgmentExecute(this,a,e)}},ue=class extends he{constructor(t){super(t,"camelCase")}onExecute(t){return t?b(t):""}},pe=class extends he{constructor(t){super(t,"concat")}onExecute(...t){return t.pop(),t.join("")}},me=class extends he{constructor(t){super(t,"eq")}onExecute(t,e,a){const s=P(t,e);return le.handleJudgmentExecute(this,s,a)}},fe=class extends he{constructor(t){super(t,"gt")}onExecute(t,e,a){const s=_(t,e);return le.handleJudgmentExecute(this,s,a)}},ge=class extends he{constructor(t){super(t,"gte")}onExecute(t,e,a){const s=S(t,e);return le.handleJudgmentExecute(this,s,a)}},we=class extends he{constructor(t){super(t,"eqPropertyValue")}onExecute(t,e,a,s){let i=!1;return i=A(t)?!P(x(t,(t=>P(t[e],a))),-1):t.hasOwnProperty(e)&&(i=P(t[e],a)),le.handleJudgmentExecute(this,i,s)}},Ee=class extends he{constructor(t){super(t,"jsonParse")}onExecute(t){return JSON.parse(t)}},ve=class extends he{constructor(t){super(t,"jsonStringify")}onExecute(t,e){return JSON.stringify(t,null,"number"==typeof e?e:void 0)}},ye=class extends he{constructor(t){super(t,"lowerCase")}onExecute(t){return t?t.toLowerCase():""}},Ie=class extends he{constructor(t){super(t,"lt")}onExecute(t,e,a){const s=T(t,e);return le.handleJudgmentExecute(this,s,a)}},De=class extends he{constructor(t){super(t,"lte")}onExecute(t,e,a){const s=L(t,e);return le.handleJudgmentExecute(this,s,a)}},Ce=class extends he{constructor(t){super(t,"neq")}onExecute(t,e,a){const s=!P(t,e);return le.handleJudgmentExecute(this,s,a)}},Ae=class extends he{constructor(t){super(t,"not")}onExecute(t,e){const a=Handlebars.Utils.isEmpty(t);return le.handleJudgmentExecute(this,a,e)}},be=class extends he{constructor(t){super(t,"or")}onExecute(...t){var e;const a=t[t.length-1];t.pop();const s=t.find((t=>!!t));if(a.fn){const t=(null==(e=a.data)?void 0:e.root)||{};return s?a.fn(t):a.inverse(t)}return s||""}},Pe=class extends he{constructor(t){super(t,"pascalCase")}onExecute(t){return t?N(t):""}},_e=class extends he{constructor(t){super(t,"snakeCase")}onExecute(t){return t?O(t):""}},Se=class extends he{constructor(t){super(t,"spinalCase")}onExecute(t){return t?R(t):""}},xe=class extends he{constructor(t){super(t,"upperCase")}onExecute(t){return t?t.toUpperCase():""}};var Te=t("HandlebarsUtil",class{constructor(){this.p=null}get isInit(){return!!this.hsb}async init(){var t;if(!this.isInit)return this.p?this.p:(this.p=Promise.resolve().then((()=>wt(ne(),1))),this.hsb=await this.p,this.p=null,t=this.hsb,new de(t),new ue(t),new pe(t),new me(t),new fe(t),new ge(t),new Ee(t),new ve(t),new ye(t),new Ie(t),new De(t),new Ce(t),new Ae(t),new be(t),new Pe(t),new _e(t),new Se(t),new xe(t),new we(t),this.hsb)}async render(t,e){this.hsb||await this.init();return this.hsb.compile(t)(e)}syncRender(t,e){if(!this.hsb)throw new Error("handlebars not init");return this.hsb.compile(t)(e)}});function Le(t,...e){return!t||D(t)?{}:"[object Array]"===Object.prototype.toString.call(t)?Ne(t,...e):"[object Object]"===Object.prototype.toString.call(t)?Oe(t,...e):{}}function Ne(t,...e){const a={};for(const s of t)if(k(s.value)&&!s.rawValue){const t=e.find((t=>!V(t)&&(t[s.value]||Object.prototype.hasOwnProperty.call(t,s.value))));t&&(a[s.key.toLowerCase()]=t[s.value])}else a[s.key.toLowerCase()]=s.value||null;return a}function Oe(t,...e){const a={},s=/^%(.+)%$/;for(const i in t)if(k(t[i])&&s.test(t[i])){const s=t[i].substring(1,t[i].length-1),n=e.find((t=>Object.prototype.hasOwnProperty.call(t,s)));n&&(a[i.toLowerCase()]=n[s])}else a[i.toLowerCase()]=t[i]||null;return a}function Re(t){const e=[],a=/^%(.+)%$/;for(const s in t){let i=!0,n=t[s];k(t[s])&&a.test(t[s])&&(i=!1,n=t[s].substring(1,t[s].length-1)),e.push({key:s.toLowerCase(),rawValue:i,value:n})}return e}function Me(t,e){const a={};if(!t)return a;const s=Array.isArray(t)?t:Re(t),i=e[0];return s.forEach((t=>{const{rawValue:s,value:n}=t;!s&&n&&Object.prototype.hasOwnProperty.call(i,n)&&(a[n]=e.map((t=>t[n])).join(";"))})),a}function ke(t,e){const{deName:a,navFilter:s,pickupDEFName:i,navContexts:n,navParams:r}=t,{context:o,params:c,data:l,derValue:h}=e,d={},u={},p=h||l.srfkey;p&&(a&&(d[a]=p),s&&(u[s]=p),i&&(u["n_".concat(i.toLowerCase(),"_eq")]=p));const m=Le(n,o,c,l),f=Le(r,o,c,l);return Object.assign(d,m),Object.assign(u,f),{resultContext:d,resultParams:u}}function Ve(t,e){if(t){const a=t.find((t=>t.id===e));if(a)return a}return null}function Fe(t){const e={},a={},s={};for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)){const n=t[i];if(-1!==i.indexOf(".")){const t=i.split(".");switch(t[0]){case"SRFNAVPARAM":Object.assign(e,{[t[1]]:n});break;case"SRFNAVCTX":Object.assign(a,{[t[1]]:n});break;default:Object.assign(s,{key:n})}}}return{navigateContexts:e,navigateParams:a,other:s}}function We(t){const{width:e,height:a,widthMode:s,heightMode:i}=t,n={width:"",height:""};return"FULL"===s?n.width="100%":e&&e>0&&(n.width=e>0&&e<=1?"".concat(100*e,"%"):"".concat(e,"PERCENTAGE"===s?"%":"px")),"FULL"===i?n.height="100%":a&&a>0&&(n.height=a>0&&a<=1?"".concat(100*a,"%"):"".concat(a,"PERCENTAGE"===i?"%":"px")),n}function Be(t,e){return pa.execScriptFn({data:e},t,{singleRowReturn:!0,isAsync:!1})}function Ue(t,e){const{mainStateAppDEFieldIds:a,demainStates:s}=t;if(a&&s){const t=[];return a.forEach((a=>{t.push(e[a])})),s.find((e=>{const{stateValue:a,state2Value:s,state3Value:i}=e;let n=!0;const r=[a,s,i];for(let e=0;e<t.length;e++)if("".concat(t[e])!=="".concat(r[e])){n=!1;break}return n}))}}function je(t,e){const a=ibiz.hub.getApp().model,{demainStateOPPrivs:s,opprivAllowMode:i}=t,n=(null==s?void 0:s.map((t=>t.name)))||[];let r=[];if(i)r=n;else{r=[...a.deopprivs,...e.deopprivs].filter((t=>!n.includes(t.name))).map((t=>t.name))}return r}function ze(t){return t.split(".").pop()}function Ge(t,e){const a=ze(e);return Y(t[a])}async function He(t){return(await ibiz.hub.getAppDataEntity(t)).formTypeAppDEFieldId}function Xe(t,e){var a;return null==(a=e.appDELogics)?void 0:a.find((e=>e.id===t))}function Ke(t,e){var a,s;const i=[];return null==(a=t.appDEFields)||a.forEach((t=>{"compute"===e&&t.computeAppDEFLogicId?i.push(t.computeAppDEFLogicId):"change"===e&&t.onChangeAppDEFLogicId?i.push(t.onChangeAppDEFLogicId):"default"===e&&t.defaultValueAppDEFLogicId&&i.push(t.defaultValueAppDEFLogicId)})),(null==(s=t.appDELogics)?void 0:s.filter((t=>i.includes(t.id))))||[]}function Ye(t,e){var a;return null==(a=t.appDEFields)?void 0:a.find((t=>t.id===e))}async function $e(t){const[,,e]=t.split("@");return ibiz.hub.getApp(e).getUIAction(t)}function qe(t){return t.detreeNodes.find((t=>t.rootNode))}function Qe(t,e){return t.detreeNodes.find((t=>t.id===e))}function Je(t,e){const a=e.parentId||qe(t).id;return t.detreeNodeRSs.filter((t=>{return t.parentDETreeNodeId===a&&(s=t.searchMode,i=e.hasQuery,3===s||(i?1===s:2===s));var s,i}))}function Ze(t,e){var a;return null==(a=t.degridEditItems)?void 0:a.find((t=>t.codeName===e))}function ta(t){let e;switch(t.detailType){case"TABPANEL":e=t.deformTabPages;break;case"FORMPAGE":case"TABPAGE":case"GROUPPANEL":e=t.deformDetails}return e||[]}function ea(t){const{viewLayoutPanel:e}=t,a=t.controls||[];return e&&a.push(...e.controls||[]),a}function aa(t){const{viewLayoutPanel:e}=t,a=t.appViewLogics||[];return e&&a.push(...e.appViewLogics||[]),a}function sa(t){const{viewLayoutPanel:e}=t,a=t.appViewEngines||[];return e&&a.push(...e.appViewEngines||[]),a}async function ia(t,e,s={},i={}){return async function(t,e,s={},i={}){var n;const r=t.appViewNavContexts||[],o=Le(r,e,s);e=Object.assign(e.clone(),o);const c=t.appViewNavParams||[],l=Le(c,e,s);Object.assign(s,l);const h=t.appDataEntityId,d=ze(h);let u=(null==(n=i.data)?void 0:n[0])||{};e[d]=u[d]||e[d]||s[d];const p=t.getDataAppDEActionId,m=ibiz.hub.getApp(t.appId),f=await m.deService.getService(h);ibiz.loading.showRedirect();try{const t=await f.exec(p||"get",e,s);if(t.ok){u=t.data;let a=u.linkurl;if(a)return e.srfprocessinstanceid&&(a+=";srfprocessinstanceid=".concat(e.srfprocessinstanceid)),ibiz.env.dev&&-1!==a.indexOf("appredirectview?")&&(a=a.slice(a.indexOf("appredirectview?"))),a.startsWith("http://")||a.startsWith("https://")?new Promise((t=>{const e=window.open(a,"_blank");e&&(e.callback=()=>{t({ok:!0,data:[]})})})):a.startsWith("appredirectview?")?(await na(e,a,i),{ok:!0,data:[]}):{ok:!1,data:[]}}}finally{ibiz.loading.hideRedirect()}const g=await ibiz.hub.getAppDataEntity(h,t.appId),w=await async function(t,e,a,s){let i="";const n=e.typeAppDEFieldId;if(n){const{codeName:a}=Ye(t,n),i=s[a.toLowerCase()];if(k(i))return"".concat(i);ibiz.log.warn("重定向视图[".concat(e.name,"]自定义类别属性[").concat(n,"]值为空"),s)}const r="".concat(ibiz.env.isMob?"MOB":"","EDITVIEW"),o=a.srfwf;if(k(o))return k(a.wf)?"".concat(r,":").concat(o.toUpperCase(),":").concat(a.wf.toUpperCase()):"".concat(r,":").concat(o.toUpperCase());let c="";if(t.indexTypeAppDEFieldId){const{codeName:e}=Ye(t,t.indexTypeAppDEFieldId);c=s[e.toLowerCase()]}if(V(c)&&t.formTypeAppDEFieldId){const{codeName:e}=Ye(t,t.formTypeAppDEFieldId);c=s[e.toLowerCase()]}i=k(c)?"".concat(r,":").concat(c.toString().toUpperCase()):"".concat(r);return i}(g,t,s,u),E=w.split(":"),v=2===E.length?w:E.slice(0,2).join(":"),y="".concat(g.name.toUpperCase(),":").concat(w),I=t.redirectAppViewRefs,D=null==I?void 0:I.find((t=>{const e=t.name||t.id;return e===y||e===w||e===v}));if(!D)throw ibiz.log.error("重定向视图引用有:",null==I?void 0:I.map((({refAppViewId:t,name:e,realTitle:a})=>({viewId:t,tag:e,title:a})))),new a(t,"未找到重定向标识[".concat(w,"]或[").concat(y,"]或工作流[").concat(v,"]对应视图"));{const t=D.refAppViewId;if(!t)throw new a(D,"未配置实际引用视图");{const a=await ibiz.commands.execute(Na.TAG,t,e,s,{...i,data:[u]});if(a)return a}}return{ok:!0,data:[]}}(t,e,s,i)}async function na(t,a,s={}){const i=a.lastIndexOf("?"),n=decodeURIComponent(a.substring(i+1,a.length)),r=K.parse(n,{delimiter:";"}),o=r.srfdename||"";if(!o)throw new e("重定向参数缺少实体名称");const c=ibiz.hub.getApp(t.srfappid).deName2DeCodeName.get(o.toUpperCase());if(!c)throw new e("未找到指定实体的codeName: ".concat(o));r[c.toLowerCase()]=r[o.toLowerCase()];const l="".concat(c).concat(ibiz.env.isMob?"Mob":"","RedirectView"),h=await ibiz.hub.getAppView(l);if(delete r.srfdename,"undo"!==r.srfwf){const t=r.processDefinitionKey.split("-")[3],e=t.substring(0,t.lastIndexOf("v")),a=t.substring(t.lastIndexOf("v"));r.wf=e,r.wfVersion=a}r.srfprocessinstanceid&&(t.srfprocessinstanceid=r.srfprocessinstanceid,delete r.srfprocessinstanceid),await ibiz.commands.execute(Na.TAG,h.id,t,r,s)}function ra(t,a,s){if(Object.is(a,"IN"))return la(t,s);if(Object.is(a,"NOTIN"))return!la(t,s);switch(a){case"EQ":return"".concat(t)==="".concat(s);case"NOTEQ":return"".concat(t)!=="".concat(s);case"LT":return oa(t,s)<0;case"LTANDEQ":return oa(t,s)<=0;case"GT":return oa(t,s)>0;case"GTANDEQ":return oa(t,s)>=0;case"ISNULL":return V(t);case"ISNOTNULL":return k(t);case"TESTNULL":return $(t);case"IN":return la(t,s);case"NOTIN":return!la(t,s);case"LIKE":return ha(t,s);case"LEFTLIKE":return ha(t,s,"start");case"RIGHTLIKE":return ha(t,s,"end");default:throw new e("值操作:".concat(a,",暂未支持"))}}function oa(t,a){const s=Number(t),i=Number(a);if(!Number.isNaN(s)&&!Number.isNaN(i))return ca(s,i);const n=new Date(t).getTime(),r=new Date(a).getTime();if(!Number.isNaN(n)&&!Number.isNaN(r))return ca(n,r);throw new e("".concat(t," 和 ").concat(a," 无法比较大小"))}function ca(t,e){return Number.isNaN(t)&&(t=0),Number.isNaN(e)&&(e=0),t>e?1:t<e?-1:0}function la(t,a){if(!a||"string"!=typeof a)throw new e("范围比较的条件值不存或者不是字符串");if(t){return a.split(",").includes("".concat(t))}return!1}function ha(t,e,a){if(!t||!e)return!1;const s="".concat(t).toUpperCase(),i="".concat(e).toUpperCase(),n=s.indexOf(i);switch(a){case"start":return 0===n;case"end":return n+i.length===s.length;default:return-1!==n}}var da={singleRowReturn:!1,isAsync:!0},ua=t("ScriptFunction",class{constructor(t,e,a=da){this.argKeys=[],this.options=a;const s=this.formatCode(e,a);this.calcArgKeys(t,a);const i=new Function(...this.argKeys,s);this.scriptFn=function(...t){return i.apply({},t)}}formatCode(t,e){let a=t;return e.singleRowReturn&&(a="return (".concat(a,")")),e.isAsync&&(a="return (async function() { ".concat(a,"} )();")),a}calcArgKeys(t,e){const a=e.presetParams?Object.keys(e.presetParams):[];a.push(...t);a.push("document","el","selector","env","appSession","topViewSession","viewSession","context","viewParam","activeData","data","app","topView","parentView","view","parent","util"),this.argKeys=Array.from(new Set(a))}convertArgs(t){const{presetParams:e}=this.options,a=e?q(e,t):t;a.document=document,a.selector=t=>document.getElementsByClassName(t);const s=[];return this.argKeys.forEach((t=>{void 0===a[t]&&this.fillDefaultParams(t,a),s.push(a[t])})),s}fillDefaultParams(t,e){const a=e.view;switch(t){case"util":e.util={message:ibiz.message,notification:ibiz.notification,modal:ibiz.modal,confirm:ibiz.confirm,openView:ibiz.openView};break;case"viewParam":e.viewParam=e.params;break;case"env":e.env=ibiz.env;break;case"app":e.app=ibiz.hub.controller;break;case"parent":e.parent=null==a?void 0:a.parentView;break;case"topView":e.topView=null==a?void 0:a.getTopView();break;case"parentView":e.parentView=null==a?void 0:a.parentView;break;case"topViewSession":e.topViewSession=null==a?void 0:a.getTopView().session;break;case"viewSession":e.viewSession=null==a?void 0:a.session;break;case"appSession":e.appSession=ibiz.hub.controller.session}}exec(t){const e=this.convertArgs(t);return this.scriptFn(...e)}}),pa=t("ScriptFactory",class{static createScriptFn(t,e,a){return new ua(t,e,a)}static execScriptFn(t,e,a){return this.createScriptFn(Object.keys(t),e,a).exec(t)}});function ma(t,a,s){const i={isPast:!0,infoMessage:s.ruleInfo};if(function(t){return"GROUP"===t.condType}(s)){const e=s.conds;e&&e.length>0&&(i.isPast=function(t,e,a="AND",s=!1){if(!((null==t?void 0:t.length)>0))return!1;let i="AND"===a;for(let s=0,n=t.length;s<n;s++){const n=e(t[s],s);if("AND"===a){if(!n){i=!1;break}}else if("OR"===a&&n){i=!0;break}}return s?!i:i}(e,(e=>{const{isPast:s,infoMessage:n}=ma(t,a,e);return i.infoMessage=n,s}),s.condOp,!!s.notMode),!i.isPast&&("AND"===s.condOp&&s.notMode||"OR"===s.condOp&&!s.notMode)&&(i.infoMessage=s.ruleInfo))}else{t=(null==s?void 0:s.defname.toLowerCase())||t;try{if(function(t){return"SIMPLE"===t.condType}(s))i.isPast=!function(t,a,s,i,n,r,o){Object.is(n,"CURTIME")&&(s="".concat(new Date));if(Object.is(n,"ENTITYFIELD")){s=r[s=s?s.toLowerCase():""]?r[s]:s}($(i)||Q(i))&&(i="内容必须符合值规则");const c=ra(t,a,s);if(!c&&o)throw new e(i);return!c}(a[t],s.condOp,s.paramValue,s.ruleInfo,s.paramType,a,s.keyCond);else if(function(t){return"VALUERANGE2"===t.condType}(s))i.isPast=!function(t,a,s,i,n,r,o){V(r)&&(r="值必须符合值范围规则");if(V(t)){if(o)throw new e("值为空");return r="值为空",!0}if(fa(t,/^-?\d*\.?\d+$/,"",o))return!0;const c=Number.parseFloat(t);if(null!==a)if(s){if(c<a){if(o)throw new e(r);return!0}}else if(c<=a){if(o)throw new e(r);return!0}if(null!=i)if(n){if(c>i){if(o)throw new e(r);return!0}}else if(c>=i){if(o)throw new e(r);return!0}return r="",!1}(a[t],s.minValue,s.includeMinValue,s.maxValue,s.includeMaxValue,s.ruleInfo,s.keyCond);else if(function(t){return"REGEX"===t.condType}(s))i.isPast=!fa(a[t],s.regExCode,s.ruleInfo,s.keyCond);else if(function(t){return"STRINGLENGTH"===t.condType}(s))i.isPast=!function(t,a,s,i,n,r,o){V(r)&&(r="内容长度必须符合范围规则");if(V(t)){if(o)throw new e("值为空");return r="值为空",!0}const c=t.length;if(null!==a)if(s){if(c<a){if(o)throw new e(r);return!0}}else if(c<=a){if(o)throw new e(r);return!0}if(null!==i)if(n){if(c>i){if(o)throw new e(r);return!0}}else if(c>=i){if(o)throw new e(r);return!0}return r="",!1}(a[t],s.minValue,s.includeMinValue,s.maxValue,s.includeMaxValue,s.ruleInfo,s.keyCond);else if(function(t){return"SYSVALUERULE"===t.condType}(s)&&(null==s?void 0:s.sysValueRule)){const{ruleType:n,regExCode:r,scriptCode:o,ruleInfo:c}=s.sysValueRule;if(i.infoMessage=s.ruleInfo||c,"REG"===n)i.isPast=!fa(a[t],r,i.infoMessage,s.keyCond);else if("SCRIPT"===n){const{isPast:n,infoMessage:r}=function(t,a,s,i,n){V(i)&&(i="值必须符合脚本规则");const r=a;let o="",c=!0;const l=t=>{c=!1,(null==t?void 0:t.length)>0?t.forEach((t=>{(null==t?void 0:t.message)&&(o+=t.message)})):(null==t?void 0:t.message)&&(o=t.message)};try{const e=pa.execScriptFn({value:t,data:r},s,{isAsync:!1});"boolean"==typeof e&&(c=e)}catch(t){ibiz.log.error(t),l(t)}if(i="",!c&&n)throw new e(i);return{isPast:c,infoMessage:o||i}}(a[t],a,o,i.infoMessage,s.keyCond);i.isPast=n,i.infoMessage=r||i.infoMessage}}}catch(t){i.isPast=!1}i.isPast=s.notMode?!i.isPast:i.isPast}return i}function fa(t,a,s,i){V(s)&&(s="值必须符合正则规则");if(V(t)){if(i)throw new e("值为空");return s="值为空",!0}if(!new RegExp(a).test(t)){if(i)throw new e(s);return!0}return s="",!1}function ga(t,e){if(function(t){return"GROUP"===t.logicType}(e)){const s=e.defdlogics;if(!s||0===s.length)throw new a(e,"发现空逻辑组,逻辑无法正常执行!");let i=!0;if("AND"===e.groupOP){i=void 0===s.find((e=>!ga(t,e)))}else if("OR"===e.groupOP){i=void 0!==e.defdlogics.find((e=>ga(t,e)))}return e.notMode?!i:i}if(function(t){return"SINGLE"===t.logicType}(e))return ra(t[e.defdname.toLowerCase()],e.condOP,e.value);throw new s(e,"未支持的逻辑类型".concat(e.logicType))}function wa(t,e){if(function(t){return"GROUP"===t.logicType}(e)){const s=e.panelItemLogics;if(!s||0===s.length)throw new a(e,"发现空逻辑组,逻辑无法正常执行!");let i=!0;if("AND"===e.groupOP){i=void 0===s.find((e=>!wa(t,e)))}else if("OR"===e.groupOP){i=void 0!==e.panelItemLogics.find((e=>wa(t,e)))}return e.notMode?!i:i}if(function(t){return"SINGLE"===t.logicType}(e))return ra(t[e.dstModelField.toLowerCase()],e.condOp,e.value);throw new s(e,"未支持的逻辑类型".concat(e.logicType))}var Ea=t("LayoutPanelUtil",class{constructor(){this.cache=new Map}register(t,e){this.cache.set(t,e)}get(t){return this.cache.get(t)}fill(t){const{viewLayoutPanel:e}=t;if(!e||!0===e.useDefaultLayout){const e=this.calcLayoutTag(t);if(this.cache.has(e)){const a=J(this.cache.get(e));t.viewLayoutPanel=a,t.appCounterRefs&&(a.appCounterRefs=t.appCounterRefs,delete t.appCounterRefs),t.appViewEngines&&(a.appViewEngines=t.appViewEngines,delete t.appViewEngines),t.appViewLogics&&(a.appViewLogics=t.appViewLogics,delete t.appViewLogics),t.appViewRefs&&(a.appViewRefs=t.appViewRefs,delete t.appViewRefs),t.controls&&(a.controls=t.controls,delete t.controls)}}return t}calcLayoutTag(t){const{viewType:e,viewStyle:a}=t;return"APPINDEXVIEW"===e?this.calcIndexViewLayoutTag(t):"".concat(e,"_").concat(a)}calcIndexViewLayoutTag(t){const{viewType:e,viewStyle:a,blankMode:s,mainMenuAlign:i}=t;let n="";return s?n="BLANK_MODE":i&&(n=i.toUpperCase()),""!==n?"".concat(e,"_").concat(a,"_").concat(n):"".concat(e,"_").concat(a)}});function va(t){const e={};return t.param09&&(e.srfprocessinstanceid=t.param09),e}var ya=t("ControlType",(t=>(t.APP_MENU="APPMENU",t.GRID="GRID",t.FORM="FORM",t.SEARCHFORM="SEARCHFORM",t.TOOLBAR="TOOLBAR",t.DRBAR="DRBAR",t.VIEWPANEL="VIEWPANEL",t.PICKUP_VIEW_PANEL="PICKUPVIEWPANEL",t.DATAVIEW="DATAVIEW",t.TREEGRID="TREEGRID",t.WF_EXPBAR="WFEXPBAR",t.TREEVIEW="TREEVIEW",t.TREE_EXP_BAR="TREEEXPBAR",t.TAB_VIEWPANEL="TABVIEWPANEL",t.DRTAB="DRTAB",t.CHART="CHART",t.REPORT_PANEL="REPORTPANEL",t.LIST="LIST",t.MOB_MDCTRL="MOBMDCTRL",t.MULTI_EDIT_VIEWPANEL="MULTIEDITVIEWPANEL",t.WIZARD_PANEL="WIZARDPANEL",t.UPDATE_PANEL="UPDATEPANEL",t.SEARCHBAR="SEARCHBAR",t.DASHBOARD="DASHBOARD",t.CALENDAR="CALENDAR",t.PANEL="PANEL",t.VIEW_LAYOUT_PANEL="VIEWLAYOUTPANEL",t.MAP="MAP",t.GANTT="GANTT",t.TREE_GRIDEX="TREEGRIDEX",t.KANBAN="KANBAN",t.CALENDAR_EXPBAR="CALENDAREXPBAR",t.CHART_EXPBAR="CHARTEXPBAR",t.DATA_VIEW_EXPBAR="DATAVIEWEXPBAR",t.GANTT_EXPBAR="GANTTEXPBAR",t.GRID_EXPBAR="GRIDEXPBAR",t.LIST_EXPBAR="LISTEXPBAR",t.MAP_EXPBAR="MAPEXPBAR",t.STATE_WIZARD_PANEL="STATEWIZARDPANEL",t.TAB_EXP_PANEL="TABEXPPANEL",t.CUSTOM="CUSTOM",t.CAPTIONBAR="CAPTIONBAR",t))(ya||{})),Ia=t("ViewType",(t=>(t.APP_INDEX_VIEW="APPINDEXVIEW",t.DE_GRID_VIEW="DEGRIDVIEW",t.DE_EDIT_VIEW="DEEDITVIEW",t.APP_DATA_UPLOAD_VIEW="APPDATAUPLOADVIEW",t.APP_ERROR_VIEW="APPERRORVIEW",t.APP_FILE_UPLOAD_VIEW="APPFILEUPLOADVIEW",t.APP_FUN_PICKUP_VIEW="APPFUNCPICKUPVIEW",t.APP_LOGIN_VIEW="APPLOGINVIEW",t.APP_LOGOUT_VIEW="APPLOGOUTVIEW",t.APP_PANEL_VIEW="APPPANELVIEW",t.APP_PIC_UPLOAD_VIEW="APPPICUPLOADVIEW",t.APP_PORTAL_VIEW="APPPORTALVIEW",t.APP_REDIRECT_VIEW="APPREDIRECTVIEW",t.APP_START_VIEW="APPSTARTVIEW",t.APP_WELCOME_VIEW="APPWELCOMEVIEW",t.APP_WF_ADD_STEP_AFTER_VIEW="APPWFADDSTEPAFTERVIEW",t.APP_WF_ADD_STEP_BEFORE_VIEW="APPWFADDSTEPBEFOREVIEW",t.APP_WF_REDIRECT_VIEW="APPWFREDIRECTVIEW",t.APP_WF_SENDBAC_VIEW="APPWFSENDBACKVIEW",t.APP_WF_STEP_ACTOR_VIEW="APPWFSTEPACTORVIEW",t.APP_WF_STEP_DATA_VIEW="APPWFSTEPDATAVIEW",t.APP_WF_STEP_TRACE_VIEW="APPWFSTEPTRACEVIEW",t.APP_WF_SUPPLY_INFO_VIEW="APPWFSUPPLYINFOVIEW",t.APP_WF_TAKE_ADVICE_VIEW="APPWFTAKEADVICEVIEW",t.DE_CALENDAR_EXP_VIEW="DECALENDAREXPVIEW",t.DE_CALENDAR_VIEW="DECALENDARVIEW",t.DE_CHART_EXP_VIEW="DECHARTEXPVIEW",t.DE_CHART_VIEW="DECHARTVIEW",t.DE_CHART_VIEW9="DECHARTVIEW9",t.DE_CUSTOM_VIEW="DECUSTOMVIEW",t.DE_DATA_VIEW="DEDATAVIEW",t.DE_DATA_VIEW9="DEDATAVIEW9",t.DE_DATAVIEW_EXP_VIEW="DEDATAVIEWEXPVIEW",t.DE_EDIT_VIEW2="DEEDITVIEW2",t.DE_EDIT_VIEW3="DEEDITVIEW3",t.DE_EDIT_VIEW4="DEEDITVIEW4",t.DE_EDIT_VIEW9="DEEDITVIEW9",t.DE_FORM_PICKUP_DATA_VIEW="DEFORMPICKUPDATAVIEW",t.DE_GANTT_EXP_VIEW="DEGANTTEXPVIEW",t.DE_GANTT_VIEW="DEGANTTVIEW",t.DE_GANTT_VIEW9="DEGANTTVIEW9",t.DE_GRID_EXP_VIEW="DEGRIDEXPVIEW",t.DE_GRID_VIEW2="DEGRIDVIEW2",t.DE_GRID_VIEW4="DEGRIDVIEW4",t.DE_GRID_VIEW8="DEGRIDVIEW8",t.DE_GRID_VIEW9="DEGRIDVIEW9",t.DE_HTML_VIEW="DEHTMLVIEW",t.DE_INDEX_PICKUP_DATA_VIEW="DEINDEXPICKUPDATAVIEW",t.DE_INDEX_VIEW="DEINDEXVIEW",t.DE_KANBAN_VIEW="DEKANBANVIEW",t.DE_KANBAN_VIEW9="DEKANBANVIEW9",t.DE_LIST_EXP_VIEW="DELISTEXPVIEW",t.DE_LIST_VIEW="DELISTVIEW",t.DE_LIST_VIEW9="DELISTVIEW9",t.DE_MAP_EXP_VIEW="DEMAPEXPVIEW",t.DE_MAP_VIEW="DEMAPVIEW",t.DE_MAP_VIEW9="DEMAPVIEW9",t.DE_MD_CUSTOM_VIEW="DEMDCUSTOMVIEW",t.DE_MEDITVIEW9="DEMEDITVIEW9",t.DE_MOB_CALENDAR_EXP_VIEW="DEMOBCALENDAREXPVIEW",t.DE_MOB_CALENDAR_VIEW="DEMOBCALENDARVIEW",t.DE_MOB_CALENDAR_VIEW9="DEMOBCALENDARVIEW9",t.DE_MOB_CHART_EXP_VIEW="DEMOBCHARTEXPVIEW",t.DE_MO_BCHART_VIEW="DEMOBCHARTVIEW",t.D_EMOB_CHART_VIEW9="DEMOBCHARTVIEW9",t.DE_MOB_CUSTOM_VIEW="DEMOBCUSTOMVIEW",t.DE_MOB_DATA_VIEW="DEMOBDATAVIEW",t.DE_MOB_DATA_VIEW_EXP_VIEW="DEMOBDATAVIEWEXPVIEW",t.DE_MOB_EDIT_VIEW="DEMOBEDITVIEW",t.DE_MOB_EDIT_VIEW3="DEMOBEDITVIEW3",t.DE_MOB_EDITVIEW9="DEMOBEDITVIEW9",t.DE_MOB_FORM_PICKUP_MDVIEW="DEMOBFORMPICKUPMDVIEW",t.DE_MOB_GANTT_EXP_VIEW="DEMOBGANTTEXPVIEW",t.DE_MOB_GANTT_VIEW="DEMOBGANTTVIEW",t.DE_MOB_GANTT_VIEW9="DEMOBGANTTVIEW9",t.DE_MOB_HTML_VIEW="DEMOBHTMLVIEW",t.DE_MOB_INDEX_PICKUP_MDVIEW="DEMOBINDEXPICKUPMDVIEW",t.DE_MOB_LIST_EXP_VIEW="DEMOBLISTEXPVIEW",t.DE_MOB_LIST_VIEW="DEMOBLISTVIEW",t.DE_MOB_MAP_VIEW="DEMOBMAPVIEW",t.DE_MOB_MAP_VIEW9="DEMOBMAPVIEW9",t.DE_MOB_MDVIEW="DEMOBMDVIEW",t.DE_MOB_MDVIEW9="DEMOBMDVIEW9",t.DE_MOB_MEDIT_VIEW9="DEMOBMEDITVIEW9",t.DE_MOB_MPICKUP_VIEW="DEMOBMPICKUPVIEW",t.DE_MOB_OPT_VIEW="DEMOBOPTVIEW",t.DE_MOB_PANEL_VIEW="DEMOBPANELVIEW",t.DE_MOB_PANEL_VIEW9="DEMOBPANELVIEW9",t.DE_MOB_PICKUP_LIST_VIEW="DEMOBPICKUPLISTVIEW",t.DE_MOB_PICKUP_MDVIEW="DEMOBPICKUPMDVIEW",t.DE_MOB_PICKUP_TREE_VIEW="DEMOBPICKUPTREEVIEW",t.DE_MOB_PICKUP_VIEW="DEMOBPICKUPVIEW",t.DE_MOB_PORTAL_VIEW="DEMOBPORTALVIEW",t.DE_MOB_PORTAL_VIEW9="DEMOBPORTALVIEW9",t.DE_MOB_REDIRECT_VIEW="DEMOBREDIRECTVIEW",t.DE_MOB_REPORT_VIEW="DEMOBREPORTVIEW",t.DE_MOB_TAB_EXP_VIEW="DEMOBTABEXPVIEW",t.DE_MOB_TAB_EXP_VIEW9="DEMOBTABEXPVIEW9",t.DE_MOB_TAB_SEARCH_VIEW="DEMOBTABSEARCHVIEW",t.DE_MOB_TAB_SEARCH_VIEW9="DEMOBTABSEARCHVIEW9",t.DE_MOB_TREE_EXP_VIEW="DEMOBTREEEXPVIEW",t.DEMOBTREEEXPVIEW9="DEMOBTREEEXPVIEW9",t.DE_MOB_TREE_VIEW="DEMOBTREEVIEW",t.DE_MOB_WFACTION_VIEW="DEMOBWFACTIONVIEW",t.DE_MOB_WF_DATA_REDIRECT_VIEW="DEMOBWFDATAREDIRECTVIEW",t.DE_MOB_WF_DYNAACTIO_NVIEW="DEMOBWFDYNAACTIONVIEW",t.DE_MOB_WFDYNA_EDIT_VIEW="DEMOBWFDYNAEDITVIEW",t.DE_MOB_WF_DYNA_EDIT_VIEW3="DEMOBWFDYNAEDITVIEW3",t.DE_MOB_WF_DYNA_EXP_MDVIEW="DEMOBWFDYNAEXPMDVIEW",t.DE_MO_BWF_DYNA_START_VIEW="DEMOBWFDYNASTARTVIEW",t.DE_MOB_WF_EDIT_VIEW="DEMOBWFEDITVIEW",t.DE_MOB_WF_EDIT_VIEW3="DEMOBWFEDITVIEW3",t.DE_MOB_WF_MDVIEW="DEMOBWFMDVIEW",t.DE_MOB_WF_PROXY_RESULT_VIEW="DEMOBWFPROXYRESULTVIEW",t.DE_MOB_WF_PROXY_START_VIEW="DEMOBWFPROXYSTARTVIEW",t.DE_MOB_WF_START_VIEW="DEMOBWFSTARTVIEW",t.DE_MOB_WIZARD_VIEW="DEMOBWIZARDVIEW",t.DE_MPICKUP_VIEW="DEMPICKUPVIEW",t.DE_MPICKUP_VIEW2="DEMPICKUPVIEW2",t.DE_OPT_VIEW="DEOPTVIEW",t.DE_PANEL_VIEW="DEPANELVIEW",t.DE_PANEL_VIEW9="DEPANELVIEW9",t.DE_PICKUP_DATA_VIEW="DEPICKUPDATAVIEW",t.DE_PICKUP_GRID_VIEW="DEPICKUPGRIDVIEW",t.DE_PICKUP_TREE_VIEW="DEPICKUPTREEVIEW",t.DE_PICKUP_VIEW="DEPICKUPVIEW",t.DE_PICKUP_VIEW2="DEPICKUPVIEW2",t.DE_PICK_UP_VIEW3="DEPICKUPVIEW3",t.DE_PORTAL_VIEW="DEPORTALVIEW",t.DE_PORTAL_VIEW9="DEPORTALVIEW9",t.DE_REDIRECT_VIEW="DEREDIRECTVIEW",t.DE_REPORT_VIEW="DEREPORTVIEW",t.DE_TAB_EXP_VIEW="DETABEXPVIEW",t.DE_TAB_EXP_VIEW9="DETABEXPVIEW9",t.DE_TAB_SEARCH_VIEW="DETABSEARCHVIEW",t.DE_TAB_SEARCH_VIEW9="DETABSEARCHVIEW9",t.DE_TREE_EXP_VIEW="DETREEEXPVIEW",t.DE_TREE_EXP_VIEW2="DETREEEXPVIEW2",t.DE_TREE_EXP_VIEW3="DETREEEXPVIEW3",t.DE_TREE_GRID_EXVIEW="DETREEGRIDEXVIEW",t.DE_TREE_GRID_EXVIEW9="DETREEGRIDEXVIEW9",t.DE_TREE_GRID_VIEW="DETREEGRIDVIEW",t.DE_TREE_GRID_VIEW9="DETREEGRIDVIEW9",t.DE_TREE_VIEW="DETREEVIEW",t.DE_TREE_VIEW9="DETREEVIEW9",t.DE_WF_ACTION_VIEW="DEWFACTIONVIEW",t.DE_WF_DATA_REDIRECT_VIEW="DEWFDATAREDIRECTVIEW",t.DE_WF_DYNA_ACTION_VIEW="DEWFDYNAACTIONVIEW",t.DE_WF_DYNA_EDIT_VIEW="DEWFDYNAEDITVIEW",t.DE_WF_DYNA_EDIT_VIEW3="DEWFDYNAEDITVIEW3",t.DE_WF_DYNA_EXP_GRID_VIEW="DEWFDYNAEXPGRIDVIEW",t.DE_WF_DYNA_START_VIEW="DEWFDYNASTARTVIEW",t.DE_WF_EDIT_PROXY_DATA_VIEW="DEWFEDITPROXYDATAVIEW",t.DE_WF_EDIT_VIEW="DEWFEDITVIEW",t.DE_WF_EDIT_VIEW2="DEWFEDITVIEW2",t.DE_WF_EDIT_VIEW3="DEWFEDITVIEW3",t.DE_WF_EDIT_VIEW9="DEWFEDITVIEW9",t.DE_WF_EXP_VIEW="DEWFEXPVIEW",t.DE_WF_GRID_VIEW="DEWFGRIDVIEW",t.DE_WF_PROXY_DATA_VIEW="DEWFPROXYDATAVIEW",t.DE_WF_PROXY_RESULT_VIEW="DEWFPROXYRESULTVIEW",t.DE_WF_PROXY_START_VIEW="DEWFPROXYSTARTVIEW",t.DE_WF_START_VIEW="DEWFSTARTVIEW",t.DE_WIZARD_VIEW="DEWIZARDVIEW",t))(Ia||{})),Da=t("ViewMode",(t=>(t.ROUTE="ROUTE",t.MODAL="MODAL",t.DRAWER="DRAWER",t.EMBED="EMBED",t.POPOVER="POPOVER",t))(Da||{})),Ca=t("SysUIActionTag",(t=>(t.NEW="New",t.EDIT="Edit",t.REFRESH="Refresh",t.EXIT="Exit",t.SAVE_AND_EXIT="SaveAndExit",t.SAVE_AND_NEW="SaveAndNew",t.SAVE="Save",t.SAVE_ROW="SaveRow",t.REMOVE="Remove",t.REMOVE_AND_EXIT="RemoveAndExit",t.NEW_ROW="NewRow",t.TOGGLE_FILTER="ToggleFilter",t.IMPORT="Import",t.EXPORT_EXCEL="ExportExcel",t.SAVE_AND_START="SaveAndStart",t.VIEW_WF_STEP="ViewWFStep",t.NO="No",t.YES="Yes",t.CANCEL="Cancel",t.OK="Ok",t.SEARCH="Search",t.FINISH="Finish",t.NEXT_STEP="NextStep",t.PREV_STEP="PrevStep",t.ADD_SELECTION="AddSelection",t.REMOVE_SELECTION="RemoveSelection",t.REMOVE_ALL="RemoveAll",t.ADD_ALL="AddAll",t.LOGOUT="Logout",t.LOGIN="Login",t.CANCEL_CHANGES="CancelChanges",t.COPY="Copy",t.VIEW="View",t.TOGGLE_ROW_EDIT="ToggleRowEdit",t.REFRESH_ALL="RefreshAll",t.REFRESH_PARENT="RefreshParent",t.LOAD_MORE="LoadMore",t))(Ca||{})),Aa=t("ViewCallTag",(t=>(t.LOAD="Load",t.GET_DATA="GetData",t.GET_ALL_DATA="GetAllData",t))(Aa||{})),ba=t("StudioViewEvents",class{});ba.onViewMounted="onMounted",ba.onViewDestroyed="onDestroyed";var Pa=t("StudioPanelEvents",class{});Pa.onClick="onClick",Pa.onChange="onChange",Pa.onEnter="onEnter",Pa.onLeave="onLeave";var _a=t("StudioControlEvents",class{});_a.onBeforeLoad="onBeforeLoad",_a.onLoadSuccess="onLoadSuccess",_a.onLoadError="onLoadError",_a.onBeforeLoadDraft="onBeforeLoadDraft",_a.onLoadDraftSuccess="onLoadDraftSuccess",_a.onLoadDraftError="onLoadDraftError",_a.onBeforeSave="onBeforeSave",_a.onSaveSuccess="onSaveSuccess",_a.onSaveError="onSaveError",_a.onBeforeRemove="onBeforeRemove",_a.onRemoveSuccess="onRemoveSuccess",_a.onRemoveError="onRemoveError",_a.CLICK="onClick";var Sa=t("Modal",class{constructor(t){this.mode="EMBED",this.viewUsage=4,this.ignoreDismissCheck=!1,this.hooks={shouldDismiss:new F,beforeDismiss:new F},this._dismiss=t=>{ibiz.log.error("外部关闭能力未注册",t)},t.mode&&(this.mode=t.mode),t.routeDepth&&(this.routeDepth=t.routeDepth),t.viewUsage&&(this.viewUsage=t.viewUsage),t.dismiss&&(this._dismiss=t.dismiss)}injectDismiss(t){this._dismiss=t}async dismiss(t={ok:!1,data:[]}){const e={allowClose:!0};return!0!==this.ignoreDismissCheck&&await this.hooks.shouldDismiss.call(e),e.allowClose?(await this.hooks.beforeDismiss.call(t),this._dismiss(t),this.destroy(),!0):(ibiz.log.debug("shouldDismiss结果为false,关闭中断。"),!1)}destroy(){this.hooks.shouldDismiss.clear(),this.hooks.beforeDismiss.clear()}});function xa(t,e){return t.filter((t=>{const{checkMode:a}=t,s=t.deformItemName||t.degridEditItemName;return 2!==a&&s===e}))}var Ta=t("TextUtil",class{constructor(){this.inputElement=null}format(t,e){return t}copy(t){return this.inputElement||(this.inputElement=document.createElement("input"),this.inputElement.style.position="absolute",this.inputElement.style.left="-9999px",document.body.appendChild(this.inputElement)),this.inputElement.value=t,this.inputElement.select(),document.execCommand("copy")}}),La=class t{constructor(){ibiz.commands.register(t.TAG,this.exec.bind(this))}async exec(t,a,i={},n={}){const r=await ibiz.hub.config.view.get(t);if(!r)throw new e("应用视图[".concat(t,"]不存在"));if(a.srfkey&&r.appDataEntityId){a[ze(r.appDataEntityId)]=a.srfkey,a.srfkey=void 0}if(r.redirectView){return ia(await ibiz.hub.getAppView(t),a,i,n)}const{openMode:o="INDEXVIEWTAB"}=r;switch(n.openMode||o){case"INDEXVIEWTAB":return n.noWaitRoute?(this.openIndexViewTab(r,a,i),{ok:!0}):this.openIndexViewTab(r,a,i);case"POPUP":throw new s(r,"未支持的视图打开模式: POPUP");case"POPUPMODAL":return this.openModal(r,a,i);case"POPUPAPP":throw new s(r,"未支持的视图打开模式: POPUPAPP");case"POPOVER":return this.openPopover(r,n.event,a,i);case"DRAWER_LEFT":case"DRAWER_RIGHT":case"DRAWER_TOP":case"DRAWER_BOTTOM":return this.openDrawer(r,a,i);case"USER":return this.openUserCustom(r,a,i);default:return this.openIndexViewTab(r,a,i)}}openIndexViewTab(t,e,a={}){return ibiz.openView.root(t.id,e,a)}async openModal(t,e,a={}){return ibiz.openView.modal(t.id,e,a)}async openPopover(t,a,s,i={}){if(!a)throw new e("气泡打开缺少event");return ibiz.openView.popover(t.id,a,s,i)}async openDrawer(t,e,a={}){return ibiz.openView.drawer(t.id,e,a)}async openUserCustom(t,e,a={}){return ibiz.openView.custom(t.id,e,a)}};La.TAG="ibiz.app-view.open";var Na=t("OpenAppViewCommand",La),Oa=class t{constructor(){ibiz.commands.register(t.TAG,this.exec.bind(this))}async exec(t,a,i={},n={}){const r=ibiz.hub.getApp(a.srfappid).getAppFunc(t);if(!r)throw new e("找不到叫".concat(t,"的应用功能"));const{navigateContexts:o,navigateParams:c,appFuncType:l}=r,h=a.clone();Object.assign(h,Le(o,a,i));const d=Le(c,a,i);switch(l){case"APPVIEW":return this.openAppView(r,h,d,n);case"OPENHTMLPAGE":return this.openHtmlPage(r);case"PDTAPPFUNC":return this.openPdAppFunc(r,h,d);case"JAVASCRIPT":return this.executeJavaScript(r,h,d);case"CUSTOM":return this.custom(r,h,d);default:throw new s(r,"未支持的应用功能类型: ".concat(l))}}async openAppView(t,a,s,i){if(!t.appViewId)throw new e("应用视图[".concat(t.appViewId,"]不存在"));return ibiz.commands.execute(Na.TAG,t.appViewId,a,s,i)}openHtmlPage(t){const e=t.htmlPageUrl;window.open(e,"_blank")}openPdAppFunc(t,a,s){throw ibiz.log.warn("openPdAppFunc",t,a,s),new e("未实现")}executeJavaScript(t,a,s){throw ibiz.log.warn("executeJavaScript",t,a,s),new e("未实现")}custom(t,a,s){throw ibiz.log.warn("custom",t,a,s),new e("未实现")}};Oa.TAG="ibiz.app-func.exec";var Ra=t("AppFuncCommand",Oa);function Ma(){new Ra,new Na}var ka=class{constructor(){this.psModelGroupCondBase=null}parse(t){if(t instanceof Array){const e=this.createPSModelGroupCond();e.parse(t),this.psModelGroupCondBase=e}}testSingleCond(t,e,a){try{if("ISNULL"===t)return null==e;if("ISNOTNULL"===t)return null!=e;if("EQ"===t||"ABSEQ"===t||"GT"===t||"GTANDEQ"===t||"LT"===t||"LTANDEQ"===t||"NOTEQ"===t){let s=-1;if(e==a?s=0:e>a&&(s=1),"EQ"===t||"ABSEQ"===t)return 0===s;if("GT"===t)return s>0;if("GTANDEQ"===t)return s>=0;if("LT"===t)return s<0;if("LTANDEQ"===t)return s<=0;if("NOTEQ"===t)return 0!==s}if("LIKE"===t)return null!=e&&null!=a&&-1!==e.toString().toUpperCase().indexOf(a.toString().toUpperCase());if("LEFTLIKE"===t)return null!=e&&null!=a&&0===e.toString().toUpperCase().indexOf(a.toString().toUpperCase())}catch(t){ibiz.log.error(t)}return!1}getPSModelGroupCondBase(){return this.psModelGroupCondBase}},Va=class{constructor(){this.strCondOp=null}getCondOp(){return this.strCondOp}setCondOp(t){this.strCondOp=t}},Fa=class extends Va{parse(t){const e=t.length;let a=!0,s=!1,i=!1;for(let n=0;n<e;n++)if(a){const e=t[n];this.setCondOp(e),a=!1,s=!0}else if(s){const e=t[n];this.setParam(e),s=!1,i=!0}else if(i){const e=t[n];if(e instanceof Object&&!(e instanceof Array)){const t=e;null!=t.type&&this.setValueType(t.type.toString()),null!=t.value&&this.setValue(t.value.toString())}else this.setValue(e);break}}getValueType(){return this.strValueType}setValueType(t){this.strValueType=t}getValue(){return this.strValue}setValue(t){this.strValue=t}getParamType(){return this.strParamType}setParamType(t){this.strParamType=t}getParam(){return this.strParam}setParam(t){this.strParam=t}},Wa=class t extends Va{constructor(){super(...arguments),this.childCondList=[],this.bNotMode=!1}parse(a){const s=a.length;let i=!0,n=!0,r=!1;for(let o=0;o<s;o++){if(i&&n){if("!"===a[o]){this.setNotMode(!0),i=!1;continue}}if(n){const t=a[o];this.setCondOp(t),n=!1,i=!1,r=!0}else if(r){const s=a[o];if(!(s instanceof Array))throw new e("值必须为数组");s.forEach((e=>{if(e.length>0){const a=e[0].toString();if("!"===a||"OR"===a||"AND"===a){const a=new t;a.parse(e),this.childCondList.push(a)}else{const t=new Fa;t.parse(e),this.childCondList.push(t)}}}))}}}setNotMode(t){this.bNotMode=t}isNotMode(){return this.bNotMode}getChildPSModelCondBases(){return this.childCondList}},Ba=class extends Wa{},Ua=class extends Fa{},ja=class t extends ka{test(t,e){return this.testCond(this.getPSModelGroupCondBase(),t,e)}testCond(e,a,s){if(e instanceof Wa){const t=e.getChildPSModelCondBases();if(null==t||Q(t))return!e.isNotMode();const i="AND"===e.getCondOp();let n=i;for(let e=0;e<t.length;e++){const r=t[e];if(this.testCond(r,a,s)){if(!i){n=!0;break}}else if(i){n=!1;break}}return e.isNotMode()?!n:n}if(e instanceof Fa){Q(e.getParam())&&ibiz.log.warn("没有指定属性名称",e);const i=a[e.getParam().toLowerCase()];let n=null;const r=e.getValueType(),o=e.getValue();return null==r||Q(r)?n=e.getValue():(Q(o)&&ibiz.log.warn("没有指定上下文参数名称"),t.PARAMTYPE_WEBCONTEXT===r?n=s.data[o.toLowerCase()]:t.PARAMTYPE_DATACONTEXT===r&&(n=s.getValue(o.toLowerCase()))),this.testSingleCond(e.getCondOp(),i,n)}return ibiz.log.warn("无法识别的条件对象",e),!1}createPSModelSingleCond(){return new Ua}createPSModelGroupCond(){return new Ba}};ja.PARAMTYPE_DATACONTEXT="DATACONTEXT",ja.PARAMTYPE_WEBCONTEXT="WEBCONTEXT";var za=t("PSDEDQCondEngine",ja);async function Ga(t,e){var a;const s=null==(a=ibiz.hub.getApp(e).model.appPFPluginRefs)?void 0:a.find((e=>e.pluginCode.toLowerCase()===t));if(s)return await ibiz.plugin.loadPlugin(s),"".concat(s.pluginType,"_").concat(s.pluginCode);ibiz.log.error("找不到".concat(t,"的插件模型"))}var Ha=t("CONTROL_PROVIDER_PREFIX","CONTROL");function Xa(t){return ibiz.register.get("".concat(Ha,"_").concat(t))}async function Ka(t){let e;const{controlType:a,controlStyle:s,sysPFPluginId:i,appId:n}=t;if(i){const t=await Ga(i,n);if(t&&(e=Xa(t)),e)return e;ibiz.log.error("找不到部件插件".concat(t,"对应的适配器"))}if(s&&"DEFAULT"!==s){if(e=Xa("".concat(a,"_").concat(s)),e)return e;ibiz.log.error("找不到部件类型:[".concat(a,"]的部件样式:[").concat(s,"]对应的适配器"),t)}if(e=Xa(a),e)return e;ibiz.log.error("找不到部件类型".concat(a,"对应的适配器"))}var Ya=t("EDITOR_PROVIDER_PREFIX","EDITOR");function $a(t){return ibiz.register.get("".concat(Ya,"_").concat(t))}async function qa(t){let e;const{editorType:a,editorStyle:s,predefinedType:i,sysPFPluginId:n,appId:r}=t;if(n){const t=await Ga(n,r);if(t&&(e=$a(t)),e)return e;ibiz.log.error("找不到编辑器插件".concat(t,"对应的适配器"))}if(s&&"DEFAULT"!==s){if(e=$a("".concat(a,"_").concat(s)),e)return e;ibiz.log.error("找不到编辑器类型:[".concat(a,"]的编辑器样式:[").concat(s,"]对应的适配器"),t)}if(i){let n="".concat(i,"_").concat(a);if(s&&"DEFAULT"!==s&&(n+="_".concat(s)),e=$a(n),e)return e;ibiz.log.error("找不到编辑器类型:[".concat(a,"]的预置类型:[").concat(i,"]对应的适配器"),t)}if(e=$a(a),e)return e;ibiz.log.error("找不到编辑器类型".concat(a,"对应的适配器"))}var Qa=t("FORMDETAIL_PROVIDER_PREFIX","FORMDETAIL");function Ja(t){return ibiz.register.get("".concat(Qa,"_").concat(t))}async function Za(t){let e;const{detailType:a,sysPFPluginId:s,appId:i}=t;if(s){const t=await Ga(s,i);if(t&&(e=Ja(t)),e)return e;ibiz.log.error("找不到表单成员插件".concat(t,"对应的适配器"))}if(e=Ja(a),e)return e;ibiz.log.error("找不到表单成员类型".concat(a,"对应的适配器"))}var ts=t("GRIDCOLUMN_PROVIDER_PREFIX","GRIDCOLUMN");function es(t){return ibiz.register.get("".concat(ts,"_").concat(t))}async function as(t){let e;const{columnType:a,enableRowEdit:s,sysPFPluginId:i,appId:n}=t;if(i){const t=await Ga(i,n);if(t&&(e=es(t)),e)return e;ibiz.log.error("找不到表格列插件".concat(t,"对应的适配器"))}const r=s?"".concat(a,"_EDIT"):a;if(e=es(r),e)return e;ibiz.log.error("找不到表格列类型".concat(r,"对应的适配器"))}var ss=t("PANELITEM_PROVIDER_PREFIX","PANELITEM");function is(t){return ibiz.register.get("".concat(ss,"_").concat(t.toUpperCase()))}async function ns(t){var e;let a;const{itemType:s,sysPFPluginId:i,appId:n}=t;if(i){const t=await Ga(i,n);if(t&&(a=is(t)),a)return a;ibiz.log.error("找不到面板成员插件".concat(t,"对应的适配器"))}if("CONTAINER"===s){const e=t.predefinedType||"DEFAULT";if(a=is("CONTAINER_".concat(e)),a)return a;ibiz.log.error("找不到面板容器预置类型为".concat(e,"的适配器"))}if("RAWITEM"===s){const s=(null==(e=t.rawItem)?void 0:e.predefinedType)||"DEFAULT";if(a=is("RAWITEM_".concat(s)),a)return a;ibiz.log.error("找不到面板成员直接内容预置类型为".concat(s,"的适配器"))}if(a=is(s),a)return a;ibiz.log.error("找不到面板成员类型".concat(s,"对应的适配器"))}var rs=t("UIACTION_PROVIDER_PREFIX","UIACTION");function os(t,e){ibiz.register.register("".concat(rs,"_").concat(t),e)}function cs(t){return ibiz.register.get("".concat(rs,"_").concat(t))}async function ls(t){let a;const{uiactionMode:s,sysPFPluginId:i,appId:n}=t;if(i){const t=await Ga(i,n);if(t&&(a=cs(t)),a)return a;ibiz.log.error("找不到界面行为插件".concat(t,"对应的适配器"))}if(a=cs(s),a)return a;throw new e("找不界面行为模式".concat(s,"对应的适配器"))}var hs=t("VIEW_PROVIDER_PREFIX","VIEW");function ds(t){return ibiz.register.get("".concat(hs,"_").concat(t))}var us=t("PORTLET_PROVIDER_PREFIX","PORTLET");function ps(t){return ibiz.register.get("".concat(us,"_").concat(t))}async function ms(t){let e;const{portletType:a,sysPFPluginId:s,appId:i}=t;if(s){const t=await Ga(s,i);if(t&&(e=ps(t)),e)return e;ibiz.log.error("找不到门户部件插件".concat(t,"对应的适配器"))}if(e=ps(a),e)return e;ibiz.log.error("找不到门户部件成员类型".concat(a,"对应的适配器"))}var fs=t("APP_COUNTER_PROVIDER_PREFIX","APPCOUNTER");function gs(t,e){ibiz.register.register("".concat(fs,"_").concat(t),e)}function ws(t){return ibiz.register.get("".concat(fs,"_").concat(t))}async function Es(t){let a;const{codeName:s,counterType:i,sysPFPluginId:n,appId:r}=t;if(n){const t=await Ga(n,r);if(t&&(a=ws(t)),a)return a;ibiz.log.error("找不到系统计数器插件".concat(t,"对应的适配器"))}if("CUSTOM"===i){if(a=ws(s),a)return a;throw new e("找不到自定义系统计数器".concat(s,"对应的适配器"))}if(a=ws(i),a)return a;throw new e("找不系统计数器类型".concat(i,"对应的适配器"))}var vs=t("AppCounter",class{constructor(t){this.model=t,this.destroyed=!1,this.context=i.create(),this.params={},this.evt=new W,this.data={}}get isDestroyed(){return this.destroyed}async init(t,e){this.setParams(t,e),this.interval(),await this.load()}setParams(t,e){t&&(this.context=J(t)),e&&(this.params=J(e))}interval(){this.destroyInterval(),this.intervalTimer=setInterval((()=>{this.evt.getSize("change")>0&&this.load()}),this.model.timer||6e3)}destroyInterval(){this.intervalTimer&&(clearInterval(this.intervalTimer),this.intervalTimer=null)}async load(){throw new e("未实现计数器加载方法")}refresh(t,e){return this.setParams(t,e),this.load()}onChange(t,e=!0){this.evt.on("change",t),e&&k(this.data)&&t(this.data)}offChange(t){this.evt.off("change",t)}getCounter(t){return this.data[t.toLowerCase()]||0}destroy(){this.destroyed=!0,this.context.destroy(),this.destroyInterval(),this.evt.reset()}}),ys=t("AppDECounter",class extends vs{async init(t,e){this.appDataEntityId=this.model.appDataEntityId;const s=this.model.getAppDEActionId;if(!s)throw new a(this.model,"未找到获取计数器行为!");this.action=s,await super.init(t,e)}async load(){const t=ibiz.hub.getApp(this.context.srfappid),e=await t.deService.exec(this.appDataEntityId,this.action,this.context,this.params);return e.ok&&(this.data=e.data,this.evt.emit("change",this.data)),this.data}}),Is=t("AppDECounterProvider",class{createCounter(t){return new ys(t)}});function Ds(){gs("DEDR",(()=>new Is))}t("DEDQCondUtil",class{static getCond(t){if(this.map.has(t))return this.map.get(t);const e=t.dedqgroupConditions;if(e){const a=new za;return a.parse(["OR",this.calcCond(e)]),this.map.set(t,a),a}return null}static calcCond(t){const e=[];return t.forEach((t=>{const a=[];if("GROUP"===t.condType){const e=t;e.notMode&&a.push("!"),a.push(t.condOp);const s=e.dedqconditions;if(s){const t=this.calcCond(s);a.push(t)}}else{if("SINGLE"!==t.condType)throw new s(t,"暂未支持的查询条件类型: ".concat(t.condType));{const e=t;a.push(e.fieldName),e.condValue||a.push("")}}e.push(a)})),e}}).map=new WeakMap;var Cs=t("DynamicCodeListCache",class{constructor(t){this.cache=new Map,this.isPredefined=!1,this.codeList=t}async init(){return this.initPromise=(async()=>{const{predefinedType:t}=this.codeList;if(t){if(this.isPredefined=!0,!["OPERATOR","RUNTIME"].includes(t))throw new s(this.codeList,"预定义类型".concat(t,"暂不支持"))}else this.initPromise=void 0})(),this.initPromise}convertData(t){const e={},{valueAppDEFieldId:a,textAppDEFieldId:s}=this.codeList,i=a?t[a]:t.srfkey;return e.id=i,e.value=i,e.text=s?t[s]:t.srfmajortext,Object.freeze(e)}async load(t={},e={}){const s=ibiz.hub.getApp(t.srfappid);if(this.isPredefined){e.size||(e={...e,size:1e4});const t=await s.net.get("/dictionaries/codelist/".concat(this.codeList.codeName),e);return Object.freeze(t.data.items)}const{appDataEntityId:i,appDEDataSetId:n}=this.codeList;if(!i)throw new a(this.codeList,"未配置应用实体");if(!n)throw new a(this.codeList,"未配置数据集");const r=await s.deService.exec(i,n,t,{},e);let o=[];return r.data.length&&(o=r.data.map((t=>this.convertData(t)))),o}async get(t={},e={}){if(this.initPromise&&await this.initPromise,!this.codeList.enableCache)return this.load(t,e);const a=JSON.stringify(t)+JSON.stringify(e);if(this.cache.has(a)){const t=this.cache.get(a);if(t.expirationTime>(new Date).getTime())return t.promise?t.promise:t.items;this.cache.delete(a)}const s=this.load(t,e),{cacheTimeout:i}=this.codeList,n=-1===i||$(i)?ibiz.config.codeList.timeout:this.codeList.cacheTimeout,r={expirationTime:(new Date).getTime()+n,promise:s};this.cache.set(a,r);const o=await s;return r.items=o,delete r.promise,o}});function As(t,a){if(null!=a){const{srfkey:t}=a;if(!$(t)&&!Q(t))return!0}throw new e("执行「".concat(t,"」不存在「srfkey」无法处理"))}function bs(t,a){const{srfsessionid:s}=a;if(!$(s)&&!Q(s))return!0;throw new e("执行「".concat(t,"」不存在「srfsessionid」无法处理"))}var Ps=t("DECache",class{constructor(){this.cacheMap=new Map}forceAdd(t,e){const a=this.getCacheByTag(t).get(e.srfkey);a&&(a.assign(e),ibiz.log.warn("forceAdd",e.srfkey,e))}forceUpdate(t,e){this.getCacheByTag(t).set(e.srfkey,J(e)),ibiz.log.warn("forceUpdate",e.srfkey,e)}forceDelete(t,e){this.getCacheByTag(t).delete(e),ibiz.log.warn("forceDelete",e)}add(t,e){try{bs("add",t),($(e.srfkey)||Q(e.srfkey))&&(e.srfkey=B()),e.srftempdate=(new Date).getTime();return this.getCacheByTag(t).set(e.srfkey,J(e)),ibiz.log.warn("add",e.srfkey,e),e}catch(t){return ibiz.log.error(t),null}}get(t,e){try{bs("get",t);const a=this.getCacheByTag(t).get(e);return ibiz.log.warn("get",e,a),J(a)}catch(t){return ibiz.log.error(t),null}}update(t,e){try{bs("update",t),As("update",e),e.srftempdate=(new Date).getTime();const a=this.getCacheByTag(t),s=a.get(e.srfkey);if(s)return s.assign(e),a.set(e.srfkey,s),ibiz.log.warn("update",e.srfkey,e),J(s);throw new Error("数据不存在,无法更新!")}catch(t){return ibiz.log.error(t),null}}delete(t,e){try{bs("delete",t);const a=this.getCacheByTag(t),s=e;if(a.has(s)){const t=a.get(s);return t.srftempdate=(new Date).getTime(),a.delete(s),ibiz.log.warn("delete",s),t}return null}catch(t){return ibiz.log.error(t),null}}createBatch(t,e){try{bs("add",t);const a=this.getCacheByTag(t);for(let t=0;t<e.length;t++){const s=e[t];($(s.srfkey)||Q(s.srfkey))&&(s.srfkey=B()),s.srftempdate=(new Date).getTime();const i=J(s);a.set(s.srfkey,i),e[t]=i,ibiz.log.warn("add",s.srfkey,s)}return e}catch(t){ibiz.log.error(t)}return[]}updateBatch(t,e){try{bs("update",t);const a=this.getCacheByTag(t);for(let t=0;t<e.length;t++){const s=e[t];As("update",s),s.srftempdate=(new Date).getTime();const i=a.get(s.srfkey);if(!i)throw new Error("数据[".concat(s.srfdename,"-").concat(s.srfmajortext,"(").concat(s.srfkey,")]不存在,无法更新!"));i.assign(s),a.set(s.srfkey,i),ibiz.log.warn("update",s.srfkey,s),e[t]=J(i)}return e}catch(t){return ibiz.log.error(t),null}}deleteBatch(t,e){try{bs("delete",t)}catch(t){return ibiz.log.error(t),e}const a=this.getCacheByTag(t),s=[];for(let t=0;t<e.length;t++){const i=e[t];a.has(i)||s.push(i)}if(s.length>0)throw new Error("未找到以下数据「".concat(s.join("、"),"」,无法删除!"));for(let t=0;t<e.length;t++){const s=e[t];a.delete(s),ibiz.log.warn("delete",s)}return[]}checkData(t,e){return-1!==this.getList(t).findIndex((t=>t.srfkey===e))}getList(t){try{bs("getList",t);const e=this.getCacheByTag(t);if(!e)return[];const a=e.values();return Array.from(a)}catch(t){return ibiz.log.error(t),[]}}generatePred(t={}){const e={};t.srfkey&&(e.srfkey=Z(t.srfkey)),delete t.srfkey;for(const a in t)if(Object.prototype.hasOwnProperty.call(t,a)){const s=t[a];e[a]=Z(s)}return tt(e)}clear(t){const e=t.srfsessionid;this.cacheMap.size>0&&this.cacheMap.delete(e)}getCacheByTag(t){const e=t.srfsessionid;return this.cacheMap.has(e)||this.cacheMap.set(e,new Map),this.cacheMap.get(e)}}),_s=new RegExp("(?<=\\$\\{)(.*?)(?=\\})","g");function Ss(t,e){const a=(e.requestPaths||[]).map((t=>({path:t,keys:t.match(_s)||[]}))).filter((e=>{const{keys:a}=e;return 0===a.length||a.every(((e,s)=>s===a.length-1||null!=t[e]))})).sort(((t,e)=>e.keys.length-t.keys.length));if(a.length>0)return a[0]}function xs(t,e){const a=Ss(t,e);if(a){if(a.keys.length>0){let{path:e}=a;return a.keys.forEach(((s,i)=>{e=i===a.keys.length-1?e.replace(new RegExp("/[^/]+/\\$\\{".concat(s,"\\}")),""):e.replace("${".concat(s,"}"),t[s])})),e}return a.path}return""}var Ts=t("SearchFilter",class{constructor(t,e){if(this.page=0,this.size=1e3,this.data={},this.sortField="srfordervalue",this.sortMode="ASC",this.context=t,e){if($(e.page)||Q(e.page)||(this.page=e.page),$(e.size)||Q(e.size)||(this.size=e.size),$(e.query)||Q(e.query)||(this.query=e.query),!$(e.sort)&&!Q(e.sort)){const t=e.sort.split(",");t.length>=1&&([this.sortField]=t),t.length>=2&&(this.sortMode=t[1].toUpperCase())}$(e.srfparentkey)||Q(e.srfparentkey)||(this.srfparentkey=e.srfparentkey),$(e.srfparentdename)||Q(e.srfparentdename)||(this.srfparentdename=e.srfparentdename),this.data={...e},delete this.data.page,delete this.data.size,delete this.data.query,delete this.data.sort,delete this.data.srfparentkey,delete this.data.srfparentdename}}getValue(t){return this.data[t]?this.data[t]:this.context[t]}}),Ls=t("CodeListService",class{constructor(t){this.appModel=t,this.allCodeLists=new Map,this.cache=new Map}getStatic(t){const e=t.codeName;if(this.cache.has(e))return this.cache.get(e);const a=t.codeItems;let s=[];return(null==a?void 0:a.length)&&(s=this.formatStaticItems(a,t.codeItemValueNumber)),this.cache.set(e,Object.freeze(s)),s}setCodeList(t){const{id:e,codeName:a}=t;this.allCodeLists.set(e,t),this.allCodeLists.set(a,t)}getCodeList(t){return this.allCodeLists.get(t)}formatStaticItems(t,e){return t.map((t=>{var a;let s=t.text;t.textLanguageRes&&(s=ibiz.i18n.t(t.textLanguageRes.lanResTag,t.text));const i={text:s,value:e?Number(t.value):t.value,color:t.color,id:t.codeName,textCls:t.textCls};return(null==(a=t.codeItems)?void 0:a.length)&&(i.children=this.formatStaticItems(t.codeItems,e)),Object.freeze(i)}))}async getDynamicCodeList(t,e={},a={}){let s;const i=t.codeName;return this.cache.has(i)?s=this.cache.get(i):(s=new Cs(t),this.cache.set(i,s),await s.init()),s.get(e,a)}async get(t,a,s){const i=this.allCodeLists.get(t);if(!i)throw new e("找不到".concat(t,"代码表"));return"STATIC"===i.codeListType?this.getStatic(i):"DYNAMIC"===i.codeListType?this.getDynamicCodeList(i,a,s):[]}}),Ns=t("CounterService",class{static async getCounter(t,e,a){const s=t.id;if(this.counterMap.has(s)){const t=this.counterMap.get(s);if(!1===t.isDestroyed)return t;this.counterMap.delete(s)}const i=(await Es(t)).createCounter(t);return await i.init(e,a),this.counterMap.set(s,i),i}static async getCounterByRef(t,e,s){const{appCounter:i}=t;if(!i)throw new a(t,"未配置应用计数器!");return this.getCounter(i,e,s)}});Ns.counterMap=new Map;var Os=t("WorkFlowService",class{constructor(t){this.model=t,this.commonBaseUrl="",this.app=ibiz.hub.getApp(t.appId);const e=ibiz.appData.context;this.commonBaseUrl="/wfcore/".concat(e.srfsystemid,"-app-").concat(this.app.model.codeName.toLowerCase(),"/").concat(this.model.name.toLowerCase())}getBaseUrl(){return this.commonBaseUrl}getActiveData(t,e){return e.srfprocessinstanceid&&(t.srfprocessinstanceid=e.srfprocessinstanceid),t}async getWFStep(t){const{processDefinitionKey:e,taskDefinitionKey:a}=t;return this.app.net.get("".concat(this.getBaseUrl(),"/process-definitions/").concat(e,"/usertasks/").concat(a))}async getWFLink(t,e){const a=t[this.model.codeName.toLowerCase()],{taskDefinitionKey:s}=t;return this.app.net.post("".concat(this.getBaseUrl(),"/").concat(a,"/usertasks/").concat(s,"/ways"),{activedata:this.getActiveData(e,t)})}async getWFHistory(t){const e=t[this.model.codeName.toLowerCase()];return this.app.net.get("".concat(this.getBaseUrl(),"/").concat(e,"/process-instances/alls/history"))}async getWFProcessDiagram(t){const e=t[this.model.codeName.toLowerCase()];return this.app.net.request("".concat(this.getBaseUrl(),"/").concat(e,"/process-instances/alls/processdiagram"),{method:"post",data:{},responseType:"blob"})}async getWFVersion(){return this.app.net.get("".concat(this.getBaseUrl(),"/process-definitions2"))}async wfStart(t,e,a){return this.app.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/process-instances"),{...e,activedata:this.getActiveData(a,t)})}async wfSubmit(t,e,a){return this.app.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId),{...e,activedata:this.getActiveData(a,t)})}async wfWithdraw(t,e,a){return this.app.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/withdraw"),{...e,activedata:this.getActiveData(a,t)})}async wfReassign(t,e,a){return ibiz.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/transfer"),{...e,activedata:this.getActiveData(a,t)})}async wfAddStepBefore(t,e,a){return ibiz.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/beforesign"),{...e,activedata:this.getActiveData(a,t)})}async wfAddStepAfter(t,e,a){return ibiz.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/aftersign"),{...e,activedata:this.getActiveData(a,t)})}async wfSendBack(t,e,a){return ibiz.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/sendback"),{...e,activedata:this.getActiveData(a,t)})}async wfSendCopy(t,e,a){return ibiz.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/sendcopy"),{...e,activedata:this.getActiveData(a,t)})}async exec(t,a,s={},i={}){switch(t){case"wfstart":return this.wfStart(a,s,i);case"wfsubmit":return this.wfSubmit(a,s,i);case"reassign":return this.wfReassign(a,s,i);case"addstepbefore":return this.wfAddStepBefore(a,s,i);case"addstepafter":return this.wfAddStepAfter(a,s,i);case"sendback":return this.wfSendBack(a,s,i);case"sendcopy":return this.wfSendCopy(a,s,i);default:throw new e("「".concat(t,"」未实现"))}}}),Rs=t("Srfuf",(t=>(t[t.CREATE=0]="CREATE",t[t.UPDATE=1]="UPDATE",t))(Rs||{})),Ms=t("AppDataEntity",class t{get srfuf(){return this.srfkey?1:0}constructor(e,a){let s;Object.defineProperty(this,"_entity",{enumerable:!1,configurable:!0,value:e}),Object.defineProperty(this,"_data",{enumerable:!1,configurable:!0,value:J(a instanceof t?a._data:a)}),Object.defineProperty(this,"srfdeid",{get:()=>e.id}),Object.defineProperty(this,"srfdecodename",{get:()=>e.codeName});const i=Ve(e.appDEFields||[],e.keyAppDEFieldId);if(i){const t=i.codeName.toLowerCase();Object.defineProperty(this,"srfkeyfile",{get:()=>t}),Object.defineProperty(this,"srfkey",{set(t){s=t},get(){return this._data[t]||s}}),Object.defineProperty(this,"srfsourcekey",{set(e){this._data[t]=e},get(){return this._data[t]}})}else ibiz.log.warn("实体[".concat(e.codeName,"]未配置主键字段"));const n=Ve(e.appDEFields||[],e.majorAppDEFieldId);if(n){const t=n.codeName.toLowerCase();Object.defineProperty(this,"srfmajorfile",{get:()=>t}),Object.defineProperty(this,"srfmajortext",{set(e){this._data[t]=e},get(){return this._data[t]}})}else ibiz.log.warn("实体[".concat(e.codeName,"]未配置主文本字段"));this.defineProperties()}defineProperties(){var t;const{_data:e}=this,a={},s=Object.keys(e);s.forEach((t=>{a[t]={enumerable:!0,set(a){e[t]=a},get:()=>e[t]}})),null==(t=this._entity.appDEFields)||t.forEach((t=>{const i=t.codeName.toLowerCase();s.includes(i)||(a[i]={enumerable:!0,set(t){e[i]=t},get:()=>e[i]})})),Object.defineProperties(this,a)}clone(){const e=new t(this._entity,this._data);return e.srfkey=this.srfkey,e}assign(e){return e instanceof t?Object.assign(this._data,e._data):Object.assign(this._data,e),this}}),ks=t("MethodDto",class t{constructor(t,e,a){this.entity=t,this.isLocalMode=e,this.dto=a,this.dtoMap=new Map,a?(this.app=ibiz.hub.getApp(t.appId),this.fields=a.appDEMethodDTOFields||[]):this.fields=[]}async get(t,e){const a={};for(let i=0;i<this.fields.length;i++){const n=this.fields[i],r=n.codeName.toLowerCase();switch(n.type){case"SIMPLE":break;case"DTOS":{if(void 0!==e[r])break;if(!n.refAppDataEntityId)break;const s=await this.getFieldDto(n),i=(await this.app.deService.getService(n.refAppDataEntityId)).local.getList(t);if(i){const e=[];for(let a=0;a<i.length;a++)e.push(await s.get(t,i[a]));e.length>0&&(a[r]=e)}break}default:throw new s(n,"未支持的应用实体方法输入属性类型: ".concat(n.type))}}return{...e,...a}}async sets(t,e){const a=await this.app.deService.getService(this.entity.id);return this.isLocalMode&&a.local.clear(t),Promise.all(e.map((async e=>{const s=this.fields.filter((t=>"DTOS"===t.type)).map((async a=>{if(!a.refAppDataEntityId)return;const s=a.codeName.toLowerCase(),i=await this.getFieldDto(a),n=e[s];n&&await i.sets(t,n)}));for(let t=0;t<s.length;t++)await s[t];const i=new Ms(this.entity,e);return this.isLocalMode&&await a.local.add(t,i),i})))}async getFieldDto(e){if(this.dtoMap.has(e.codeName))return this.dtoMap.get(e.codeName);const a=await ibiz.hub.getAppDataEntity(e.refAppDataEntityId,this.entity.appId),s=Ve(a.appDEMethodDTOs||[],e.refAppDEMethodDTOId),i=new t(a,!0,s);return this.dtoMap.set(e.codeName,i),i}});function Vs(t){return"BUILTIN"===t.actionType||"DATAQUERY"===t.dataSetType}var Fs=class{constructor(t,e){this.entity=t,this.method=e,this.app=ibiz.hub.getApp(t.appId),this.input=new class{constructor(t,e){this.entity=t,this.method=e;const a=e.appDEMethodInput;if(a){const e=Ve(t.appDEMethodDTOs||[],a.appDEMethodDTOId);e&&(this.dto=new ks(t,this.isLocalMode,e))}}get isLocalMode(){return Vs(this.method)}async handle(t,e){return this.dto?this.dto.get(t,e):e}}(t,e),this.result=new class{constructor(t,e){this.entity=t,this.method=e;const a=e.appDEMethodReturn;if(a){const e=Ve(t.appDEMethodDTOs||[],a.appDEMethodDTOId);e&&(this.dto=new ks(t,this.isLocalMode,e))}}get isLocalMode(){return Vs(this.method)}async handle(t,e){return this.dto?(await this.dto.sets(t,[e]))[0]:new Ms(this.entity,e)}}(t,e)}async request(t,e,s,i){const{actionType:n,requestMethod:r}=this.method;if("REMOTE"===n){const e=this.method.codeName.toLowerCase();let n=null;switch(r){case"POST":n=await this.app.net.post("".concat(t,"/").concat(e),k(s)?s:i);break;case"GET":n=await this.app.net.get("".concat(t,"/").concat(e),s);break;case"PUT":n=await this.app.net.put("".concat(t,"/").concat(e),k(s)?s:i),this.createEntity(s);break;case"DELETE":n=await this.app.net.delete("".concat(t,"/").concat(e),s);break;default:throw new a(this.method,r?"未支持的请求方式: ".concat(r):"未配置请求方式")}return n}throw new a(this.method,"未支持的行为类型[".concat(n,"]"))}calcPath(t){const e="/".concat(this.entity.codeName2.toLowerCase());return xs(t,this.entity)+e}async getService(){return this.service||(this.service=await this.app.deService.getService(this.entity.id)),this.service}createEntity(t){return t instanceof Ms?t.clone():new Ms(this.entity,t)}},Ws=class{},Bs=class extends Ws{constructor(t){super(),this.model=t,this.srcParam=t.srcLogicParamId,this.dstParam=t.dstLogicParamId}get dstField(){return this.model.dstFieldName.toLowerCase()}get op(){return this.model.condOP}get type(){return this.model.paramType}get value(){return this.model.paramValue}test(t,e,i){const n=t.params[this.dstParam];switch(this.type){case"ENTITYFIELD":{if(!this.value)throw new a(this.model,"当前条件值类型为[数据对象属性],缺少配置条件值");const t=null!=i[this.value]?i[this.value]:e[this.value];return ra(n[this.dstField],this.op,t)}case"SRCENTITYFIELD":{if(!this.value)throw new a(this.model,"当前条件值类型为[源数据对象属性],缺少配置条件值");const e=t.params[this.srcParam];return ra(n[this.dstField],this.op,e[this.value])}case"CURTIME":throw new s(this.model,"暂未支持条件值类型为[当前时间]");default:return ra(n[this.dstField],this.op,this.value)}}},Us=class t extends Ws{constructor(e){super(),this.model=e;const a=e.conds||[];this.conds=a.map((e=>"SINGLE"===e.logicType?new Bs(e):new t(e)))}get op(){return this.model.groupOP}get notMode(){return!0===this.model.notMode}test(t,e,s){let i=!0;if(0===this.conds.length)throw new a(this.model,"界面连接条件逻辑组未配置逻辑项");for(let a=0;a<this.conds.length;a++){const n=this.conds[a].test(t,e,s);if("AND"===this.op&&!1===n){i=!1;break}if("OR"===this.op&&!0===n){i=!0;break}}return this.notMode?!i:i}},js=class{constructor(t){var e;this.model=t,this.links=null==(e=t.links||[])?void 0:e.map((t=>new class{constructor(t){this.model=t,this.srcNode=null,this.dstNode=null,this.groupCond=null;const e=this.model.delogicLinkGroupCond;e&&(this.groupCond=new Us(e))}async exec(t){const{defaultLink:e}=this.model;return!(!e&&this.groupCond)||this.groupCond.test(t,t.context,t.data||{})}}(t)))}},zs=class extends js{async exec(t){const{dstAppDataEntityId:e,dstAppDEActionId:s,dstDELogicParamId:i,retDELogicParamId:n}=this.model;if(!e)throw new a(this.model,"未指定应用实体");if(!s)throw new a(this.model,"未指定实体行为");const r=t.params[i],o=ibiz.hub.getApp(t.context.srfappid),c=await o.deService.exec(e,s,t.context,r,t.viewParams);c.ok&&(t.params[n]=c.data)}},Gs=class extends js{async exec(t){}},Hs=class extends js{async exec(t){t.isEndNode=!0;const{returnParamId:e,returnType:a,rawValue:i}=this.model;switch(a){case"NONEVALUE":t.result=void 0;break;case"NULLVALUE":t.result=null;break;case"SRCVALUE":t.result=i;break;case"LOGICPARAM":t.result=t.params[e];break;default:throw new s(this.model,"暂未支持的结束节点返回值类型: ".concat(a))}}};function Xs(t,e){const{srcDELogicParamId:a,srcValueType:i,srcFieldName:n,srcValue:r}=e;let o;switch(e.srcValueType||(e.srcValueType="SRCDLPARAM"),i){case"SRCDLPARAM":o=t.params[a];break;case"NULLVALUE":return null;case"NONEVALUE":return;case"SRCVALUE":return r;case"WEBCONTEXT":case"VIEWPARAM":o=t.viewParams;break;case"APPLICATION":case"SESSION":case"APPDATA":case"DATACONTEXT":o=t.context;break;case"ENVPARAM":o=J(ibiz.env);break;default:throw new s(e,"暂未支持源值类型".concat(i))}const c=null==n?void 0:n.toLowerCase();return o&&c&&(o=o[c]),o}var Ks=class extends js{async exec(t){const e=this.model.delogicNodeParams;(null==e?void 0:e.length)&&await Promise.all(e.map((e=>{switch(e.paramAction){case"SETPARAMVALUE":return this.setParamValue(e,t);case"RESETPARAM":return this.resetParam(e,t);case"COPYPARAM":return this.copyParam(e,t);case"BINDPARAM":return this.bindParam(e,t);case"RENEWPARAM":return this.renewParam(e,t);case"APPENDPARAM":return this.appendParam(e,t);case"SORTPARAM":return this.sortParam(e,t);default:throw new s(e,"暂未支持逻辑处理参数操作".concat(e.paramAction))}})))}copyParam(t,e){const{dstDELogicParamId:a}=t,s=Xs(e,t);e.params[a]=J(s)}bindParam(t,e){const a=Xs(e,t);e.params[t.dstDELogicParamId]=a}setParamValue(t,e){const{dstFieldName:a,dstDELogicParamId:s}=t,i=null==a?void 0:a.toLowerCase(),n=Xs(e,t);i?e.params[s][i]=n:e.params[s]=n}resetParam(t,e){const{dstDELogicParamId:a}=t;e.resetParam(a)}renewParam(t,e){const{dstDELogicParamId:a}=t;e.renewParam(a)}appendParam(t,e){const{dstDELogicParamId:a,dstIndex:s,srcIndex:i,srcSize:n}=t,r=Xs(e,t),o=s||0,c=i||0,l=n||r.length;e.params[a].splice(o,0,...r.slice(c,l))}sortParam(t,e){const{dstDELogicParamId:a,dstFieldName:s,dstSortDir:i}=t,n=s.toLowerCase();e.params[a].sort(((t,e)=>"ASC"===i?t[n]-e[n]:e[n]-t[n]))}},Ys=class extends js{async exec(t){const{dstAppDEDataSetId:e,dstAppDataEntityId:a,dstDELogicParamId:s,retDELogicParamId:i}=this.model,n=t.params[s],r=ibiz.hub.getApp(t.context.srfappid),o=await r.deService.exec(a,e,t.context,n,t.viewParams);o.ok&&(t.params[i]=o.data)}},$s=class extends js{async exec(t){const{dstDELogicParamId:e,srcDELogicParamId:s}=this.model;if(!e||!s)throw new a(this.model,"缺少目标参数对象或者源参数对象配置");const i=Xs(t,this.model);t.params[e]=i}},qs=class extends js{async exec(t){const{dstDELogicParamId:e}=this.model;if(!e)throw new a(this.model,"缺少目标参数对象配置");t.resetParam(e)}},Qs=class extends js{async exec(t){const{dstDELogicParamId:e}=this.model;if(!e)throw new a(this.model,"缺少目标参数对象配置");t.renewParam(e)}},Js=class extends js{async exec(t){const{dstDELogicParamId:e,srcDELogicParamId:s}=this.model;if(!e||!s)throw new a(this.model,"缺少目标参数对象或者源参数对象配置");const i=Xs(t,this.model);t.params[e]=J(i)}},Zs=class extends js{async exec(t){const{dstDELogicParamId:e,dstSortDir:s,dstFieldName:i}=this.model;if(!e||!i)throw new a(this.model,"缺少目标参数对象或目标属性配置");const n=i.toLowerCase();t.params[e].sort(((t,e)=>"ASC"===s?t[n]-e[n]:e[n]-t[n]))}},ti=class extends js{async exec(t){const{dstDELogicParamId:e,srcDELogicParamId:s,dstIndex:i,srcIndex:n,srcSize:r}=this.model;if(!e||!s)throw new a(this.model,"缺少目标参数对象或者源参数对象配置");const o=Xs(t,this.model),c=i||0,l=n||0,h=r||o.length;t.params[e].splice(c,0,...o.slice(l,h))}},ei=class extends js{async exec(t){const{errorCode:e,errorInfo:a}=this.model;throw new r({response:{status:e,statusText:a}})}},ai=class{constructor(t){var e,i;if(this.model=t,this.nodes=new Map,this.params=new Map,!(null==(e=t.delogicNodes)?void 0:e.length))throw new a(t,"实体逻辑没有配置逻辑节点");t.delogicNodes.forEach((t=>{const{logicNodeType:e}=t;let a;switch(e){case"BEGIN":a=new Gs(t);break;case"END":a=new Hs(t);break;case"DEACTION":a=new zs(t);break;case"PREPAREPARAM":a=new Ks(t);break;case"DEDATASET":a=new Ys(t);break;case"THROWEXCEPTION":a=new ei(t);break;case"BINDPARAM":a=new $s(t);break;case"RESETPARAM":a=new qs(t);break;case"COPYPARAM":a=new Js(t);break;case"RENEWPARAM":a=new Qs(t);break;case"APPENDPARAM":a=new ti(t);break;case"SORTPARAM":a=new Zs(t);break;default:throw new s(t,"未支持的逻辑节点类型: ".concat(e))}this.nodes.set(t.id,a)})),null==(i=t.delogicParams)||i.forEach((t=>{this.params.set(t.id,new class{constructor(t){this.model=t}calc(t){const e=this.model.id,a=this.model;if(a.default)t.params[e]=t.data||{};else if(a.appGlobalParam)t.params[e]=J(ibiz.env);else if(a.entityListParam)t.params[e]=[];else{if(a.entityPageParam)throw new s(a,"未支持的逻辑参数类型: 分页查询结果");if(a.entityParam)t.params[e]={};else if(a.lastReturnParam)t.initLastReturnParam(e);else if(a.appContextParam)t.params[e]=t.context;else if(a.simpleListParam)t.params[e]=[];else if(a.simpleParam)t.params[e]={};else if(a.cloneParam)t.params[e]=J(t.data||{});else{if(a.envParam)throw new s(a,"未支持的逻辑参数类型: 系统环境变量");if(a.fileListParam)throw new s(a,"未支持的逻辑参数类型: 文件对象列表变量");if(a.fileParam)throw new s(a,"未支持的逻辑参数类型: 文件对象变量");if(a.filterParam)throw new s(a,"未支持的逻辑参数类型: 过滤器对象变量");if(a.lastParam)throw new s(a,"未支持的逻辑参数类型: 最后数据变量");if(a.originEntity)throw new s(a,"未支持的逻辑参数类型: 原始数据对象");if(a.sessionParam)throw new s(a,"未支持的逻辑参数类型: 操作会话变量")}}}renew(t){const e=this.model.id,a=this.model;if(a.entityListParam||a.simpleListParam||a.entityPageParam)t.params[e]=[];else{if(!a.simpleParam&&!a.entityParam)throw new s(a,"未支持的逻辑参数类型重新建立变量");t.params[e]={}}}}(t))})),this.nodes.forEach((t=>{t.links.forEach((e=>{e.srcNode=t,this.nodes.has(e.model.thenId)&&(e.dstNode=this.nodes.get(e.model.thenId))}))}))}initLogicParams(t){this.params.forEach((e=>{e.model.default&&(t.defaultParamName=e.model.id),e.calc(t)}))}async exec(t,e,s){const i=new class{constructor(t,e,a,s){this.deLogicParams=t,this.context=e,this.data=a,this.viewParams=s,this.params={},this.result=null,this.isEndNode=!1,this.defaultParamName="Default"}resetParam(t){var e;null==(e=this.deLogicParams.get(t))||e.calc(this)}renewParam(t){var e;null==(e=this.deLogicParams.get(t))||e.renew(this)}setLastReturn(t){this.lastReturn=t}initLastReturnParam(t){Object.defineProperty(this.params,t,{enumerable:!0,configurable:!0,get:()=>this.lastReturn})}}(this.params,t,e,s);this.initLogicParams(i);const{startDELogicNodeId:n}=this.model;if(!n||!this.nodes.has(n))throw new a(this.model,"未设置起始节点");{const t=this.nodes.get(n);await this.deepExec(t,i)}return i.isEndNode?i.result:i.params[i.defaultParamName]?i.params[i.defaultParamName]:null}async deepExec(t,e){await t.exec(e);const{links:a}=t;for(let s=0;s<a.length;s++){const i=a[s];if(await i.exec(e)&&i.dstNode&&(await this.deepExec(i.dstNode,e),!1===t.model.parallelOutput))break}}},si=new Map;async function ii(t,e,a,s){si.has(t)||si.set(t,new ai(t));return si.get(t).exec(e,a,s)}async function ni(t,a,s,i,n){const r=await async function(t,e,a){return Xe(t,await ibiz.hub.getAppDataEntity(e,a))}(t,a,s.srfappid);if(!r)throw new e("".concat(a,"找不到实体逻辑").concat(t));return ii(r,s,i,n)}async function ri(t,e,a,s){try{const i=await ii(t,e,a,s);return new n(i)}catch(t){if(t instanceof r)return new n(t,500);throw t}}async function oi(t,e,a,s,i){const n=Ke(t,e);if(n.length){(await Promise.all(n.map((t=>ii(t,a,s,i))))).forEach((t=>{Object.assign(s,t)}))}}var ci=class extends Fs{get isLocalMode(){return Vs(this.method)}async exec(t,e,s){if("DELOGIC"===this.method.actionType){const i=Xe(this.method.appDELogicId,this.entity);if(!i)throw new a(this.method,"缺少实体处理逻辑");return ri(i,t,e,s)}let i;switch(this.isLocalMode||(e=await this.input.handle(t,e)),["READ","GETDRAFT"].includes(this.method.actionMode)||await oi(this.entity,"change",t,e,s),this.method.codeName){case"Create":i=await this.create(t,e,s);break;case"Get":i=await this.get(t,s);break;case"GetDraft":i=await this.getDraft(t,s);break;case"Remove":i=await this.remove(t,s);break;case"Update":i=await this.update(t,e,s);break;case"CreateTemp":i=await this.createTemp(t,e);break;case"GetTemp":i=await this.getTemp(t,e);break;case"GetDraftTemp":i=await this.getDraftTemp(t,s);break;case"RemoveTemp":i=await this.removeTemp(t,e);break;case"UpdateTemp":i=await this.updateTemp(t,e);break;default:{let a=this.calcPath(t);this.method.needResourceKey&&(a="".concat(a,"/").concat(t[this.entity.codeName.toLowerCase()]||e[this.entity.keyAppDEFieldId]));const n=await this.request(a,t,e,s);n.data=await this.result.handle(t,n.data),i=n}}return await oi(this.entity,"compute",t,i.data,s),i}async create(t,e,a){if(this.isLocalMode)return this.createTemp(t,this.createEntity(e));const s=this.calcPath(t),i=await this.app.net.post(s,e,a);return i.data=await this.result.handle(t,i.data),i}async remove(t,e){if(this.isLocalMode)return this.removeTemp(t,e);const a=this.calcPath(t);return await this.app.net.delete("".concat(a,"/").concat(t[this.entity.codeName.toLowerCase()]),e)}async update(t,e,a={}){if(this.isLocalMode)return this.updateTemp(t,this.createEntity(e));const s=this.calcPath(t),i=await this.app.net.put("".concat(s,"/").concat(t[this.entity.codeName.toLowerCase()]),e,a);return i.data=await this.result.handle(t,i.data),i}async get(t,e={}){if(this.isLocalMode)return this.getTemp(t,e);const a=this.calcPath(t),s=await this.app.net.get("".concat(a,"/").concat(t[this.entity.codeName.toLowerCase()]),e);return s.data=await this.result.handle(t,s.data),s}async getDraft(t,e){if(this.isLocalMode)return this.getDraftTemp(t,e);const a=this.calcPath(t),s=await this.app.net.get("".concat(a,"/getdraft"),e);return s.data=await this.result.handle(t,s.data),s}async createTemp(t,e){try{const a=await this.getService(),s=await a.local.add(t,this.createEntity(e));return new n(s)}catch(t){return new n(t,500)}}async getDraftTemp(t,e){try{const t=this.createEntity({});return t?new n(t):new n(t,500)}catch(t){return new n(t,500)}}async removeTemp(t,e){try{let e=null;!e&&t&&(e=t[this.entity.codeName.toLowerCase()]);const a=(await this.getService()).local.delete(t,e);return a?new n(a):new n(a,500)}catch(t){return new n(t,500)}}async updateTemp(t,e){try{const a=(await this.getService()).local.update(t,this.createEntity(e));return a?new n(a):new n(a,500)}catch(t){return new n(t,500)}}async getTemp(t,e){try{let e=null;!e&&t&&(e=t[this.entity.codeName.toLowerCase()]);const a=(await this.getService()).local.get(t,e);return a?new n(a):new n(a,500)}catch(t){return new n(t,500)}}async removeBatchTemp(t,e){return new n(!0)}},li=class extends Fs{get isLocalMode(){return Vs(this.method)}async exec(t,e,a){if(this.isLocalMode){const a=await this.searchLocal(null,new Ts(t,e));return new n(a,200)}let i;switch(this.method.dataSetType){case"INDEXDE":case"CODELIST":case"MULTIFORM":i=await this.fetchCodeListSet(t,a);break;case"REMOTE":{const s=this.calcPath(t);i=await this.request(s,t,e,a)}break;default:throw new s(this.method,"数据来源类型".concat(this.method.dataSetType,"暂未支持"))}const r=i.data||[];return i.data=r.map((t=>this.createEntity(t))),i.data.length&&await Promise.all(i.data.map((e=>oi(this.entity,"compute",t,e,a)))),i}async selectLocal(t,e={}){let a=(await this.getService()).local.getList(t);a=H(a,"srfordervalue");const s={},i={},n={},r={};e.srfkey&&(s.srfkey=Z(e.srfkey),delete e.srfkey);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const a=e[t];null==a?(i[t]=Z(null),n[t]=Z(void 0),r[t]=Z("")):s[t]=Z(a)}if(!Q(s)){const t=tt(s),e=tt(i),o=tt(n),c=tt(r);a=a.filter((a=>{if(Q(i)){if(t(a))return!0}else if(t(a)&&(e(a)||o(a)||c(a)))return!0;return!1}))}return a.map((t=>t.clone()))}async searchLocal(t,e,a=this.entity.quickSearchAppDEFieldIds){const s=await this.getService();let i=[];t?(i=s.local.getList(e.context),i.length>0&&(i=i.filter((a=>t.test(a,e))))):(i=await this.selectLocal(e.context),i.length>0&&e.query&&""!==e.query&&a&&(i=i.filter((t=>{const s=new RegExp(e.query);for(let e=0;e<a.length;e+=1){const i=t[a[e]];if(s.test(i))return!0}return!1})))),$(e.sortField)||Q(e.sortField)||(i="DESC"===e.sortMode?X(i,e.sortField):H(i,e.sortField));const{page:n,size:r}=e,o=n*r,c=(n+1)*r-1;return i.slice(o,c).map((t=>J(t)))}async fetchCodeListSet(t,e){const{appCodeListId:s}=this.method;if(!s)throw new a(this.method,"没有指定数据来源代码表");const i=await this.app.codeList.get(s,t,e),{keyAppDEFieldId:r,majorAppDEFieldId:o}=this.entity,c=i.map((t=>({[r]:t.value,[o]:t.text})));return new n(c,200)}},hi=t("DEService",class{constructor(t){this.model=t,this.methodMap=new Map,this.local=new Ps,this.wf=new Os(t),this.file=new class{constructor(t){this.model=t}exportData(t,e,a,s){const i=xs(a,this.model),n="".concat(i,"/").concat(this.model.codeName2.toLowerCase(),"/exportdata/").concat(e.toLowerCase(),"/?srfexporttag=").concat(t.codeName);return ibiz.net.request(n,{method:"post",data:s,responseType:"blob"})}}(t)}getMethod(t){if(this.methodMap.has(t))return this.methodMap.get(t);const e=Ve(this.model.appDEMethods,t);let a=null;switch(e.methodType){case"DEACTION":a=new ci(this.model,e);break;case"FETCH":case"FETCHTEMP":a=new li(this.model,e);break;default:throw new s(e,"未支持的服务方法类型: ".concat(e.methodType))}return this.methodMap.set(t,a),a}exec(t,a,s={},i={}){const n=this.getMethod(t);if(n)return n.exec(a,s,i);throw new e("".concat(this.model.codeName,"未支持「").concat(t,"」方法"))}}),di=t("ControlVO",class t{get srfuf(){return $(this.$origin.srfuf)?this.srfkey?1:0:this.$origin.srfuf}get srfkey(){return this.$origin.srfkey}get srfmajortext(){return this.$origin.srfmajortext}get srfdeid(){return this.$origin.srfdeid}get srfdecodename(){return this.$origin.srfdecodename}get srfkeyfile(){return this.$origin.srfkeyfile}get srfmajorfile(){return this.$origin.srfmajorfile}constructor(t={},e=new Map){Object.defineProperty(this,"$origin",{enumerable:!1,configurable:!0,value:t||{}}),Object.defineProperty(this,"$dataUIMap",{enumerable:!1,configurable:!0,value:e||new Map}),this.$dataUIMap.forEach(((t,e)=>{const a=t.dataKey,s=void 0!==t.dataType&&o.isNumber(t.dataType);this.linkProperty(e,a,t.isOriginField,s)})),Object.keys(t).forEach((t=>{Object.prototype.hasOwnProperty.call(this,t)||this.linkProperty(t,t)}))}linkProperty(t,e,a=!0,s=!1){"srfuf"!==t&&(a||Object.prototype.hasOwnProperty.call(this.$origin,t)?Object.defineProperty(this,t,{enumerable:!0,configurable:!0,get(){return"srfkey"===t?this.$origin[e]||this.$origin[t]:this.$origin[e]},set(t){let a=s&&!$(t)?Number(t):t;Number.isNaN(a)&&(a=t,ibiz.log.error("".concat(t,"不能转换成数字"))),this.$origin[e]=a}}):Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:null}))}getOrigin(){return this.$origin}setOrigin(e){this.$origin=e instanceof t?e.getOrigin():e}clone(){const e=J(this.$origin),a=new t(e,this.$dataUIMap);return Object.keys(this).forEach((t=>{a[t]=this[t]})),a}}),ui=t("ControlService",class{constructor(t){this.dataUIMap=new Map,this.model=t}async init(t){this.app=ibiz.hub.getApp(null==t?void 0:t.srfappid),this.initUIDataMap()}initUIDataMap(){}async exec(t,e,a={},s={}){return await this.app.deService.exec(this.model.appDataEntityId,t,e,a,s)}handleResponse(t){return t}toUIData(t){return new di(t,this.dataUIMap)}}),pi=t("MDControlService",class extends ui{async fetch(t,e={}){var a;const s=(null==(a=this.model.fetchControlAction)?void 0:a.appDEMethodId)||"fetchdefault";let i=await this.exec(s,t,e);return i=this.handleResponse(i),i}async get(t,e={}){var a;const s=(null==(a=this.model.getControlAction)?void 0:a.appDEMethodId)||"get";let i=await this.exec(s,t,void 0,e);return i=this.handleResponse(i),i}async getDraft(t,e={}){var a;const s=(null==(a=this.model.getDraftControlAction)?void 0:a.appDEMethodId)||"getdraft";let i=await this.exec(s,t,void 0,e);return i=this.handleResponse(i),i}async remove(t,e={}){var a;const s=(null==(a=this.model.removeControlAction)?void 0:a.appDEMethodId)||"remove";return await this.exec(s,t,void 0,e)}async create(t,e){var a;const s=(null==(a=this.model.createControlAction)?void 0:a.appDEMethodId)||"create";let i=await this.exec(s,t,e.getOrigin());return i=this.handleResponse(i),i}async update(t,e){var a;const s=(null==(a=this.model.updateControlAction)?void 0:a.appDEMethodId)||"update";let i=await this.exec(s,t,e.getOrigin());return i=this.handleResponse(i),i}async exportData(t,a,s={}){throw new e("未实现")}handleResponse(t){const e=super.handleResponse(t);return e.headers&&(e.headers["x-page"]&&(e.page=Number(e.headers["x-page"])),e.headers["x-per-page"]&&(e.size=Number(e.headers["x-per-page"])),e.headers["x-total"]&&(e.total=Number(e.headers["x-total"]))),e.ok&&(U(e.data)?e.data=e.data.map((t=>this.toUIData(t))):e.data=this.toUIData(e.data)),e}}),mi=t("DeAuthorityService",class{constructor(t){this.entityModel=t}async calcByDataAccessAction(t,e){if(e.srfopprivs&&!e.srfopprivs.includes(t))return!1;return!!await this.calcByDeMainState(t,e)}async calcByDeMainState(t,e){let a=!0;const s=this.entityModel;if(!s.enableDEMainState)return ibiz.log.debug("".concat(s.codeName,"实体不存在或者为启用主状态,返回true")),a;ibiz.log.debug("操作标识".concat(t,"主状态计算开始"),e,s);const i=Ue(s,e);if(i){ibiz.log.debug("匹配主状态",i);const e=je(i,s);ibiz.log.debug("允许的主状态权限集合",e),a=e.includes(t)}else ibiz.log.debug("没匹配主状态,返回false"),a=!1;return ibiz.log.debug("操作标识".concat(t,"权限计算结束:").concat(a)),a}}),fi=t("AuthorityService",class{constructor(t){this.appModel=t,this.cache=new Map,this.constructorCache=new Map,this.resCodes=[],this.enablePermission=!1}register(t,e){this.constructorCache.set(t,e)}async getService(t){if(!this.cache.has(t)){const a=await ibiz.hub.getAppDataEntity(t,this.appModel.appId);if(!a)throw new e("未找到应用实体[".concat(t,"]"));const s=this.constructorCache.get(t);let i;i=s?await s(a):new mi(a),this.cache.set(t,i)}return this.cache.get(t)}async init(t=ibiz.appData){t&&(t.unires&&(this.resCodes=t.unires),!0===t.enablepermissionvalid&&ibiz.env.enablePermission&&(this.enablePermission=!0))}calcByResCode(t){return!this.enablePermission||this.resCodes.includes(t)}async calcByDataAccessAction(t,e,a){if(this.enablePermission){const e=await ibiz.hub.getApp(this.appModel.appId),s=await e.getOPPriv(t,a);if(this.enablePermission&&(null==s?void 0:s.mapSysUniResCode)&&!this.calcByResCode(s.mapSysUniResCode))return!1}if(e&&a){return(await this.getService(a)).calcByDataAccessAction(t,e)}return!0}}),gi=t("V7AuthService",class{async login(t,e){try{const a=await ibiz.net.post("/v7/login",{loginname:t,password:e}),{data:s}=a;if(s&&s.token){j(c.TOKEN,s.token,0,!0);const t=(new Date).getTime()+1e3*(s.expirein||7199);j(c.TOKEN_EXPIRES,"".concat(t),0,!0)}return!0}catch(t){ibiz.notification.error({title:"登录失败",desc:t.message||""})}return!1}async logout(){try{return await ibiz.net.get("/v7/logout"),z(c.TOKEN),z(c.TOKEN_EXPIRES),!0}catch(t){ibiz.notification.error({title:"登出失败",desc:t.message||""})}return!1}}),wi=t("TreeNodeData",class{constructor(t,e,a){this.leaf=!1,this.leaf=!0===a.leaf,this.parent=e,this.parent&&(this.context={...this.parent.context}),a.navContext&&(this.context=Object.assign(this.context||{},a.navContext)),a.navParams&&(this.params={...a.navParams}),this.nodeId=t.id}calcIcon(t){const{sysImage:e}=t,a={};return e&&(e.cssClass&&(a.cssClass=e.cssClass),e.imagePath&&(a.imagePath=e.imagePath)),Object.values(a).length>0?a:void 0}}),Ei=t("TreeCodeListNodeData",class extends wi{constructor(t,e,a){super(t,e,a);const{data:s}=a;if(this.deData=s,this.text=s.text,this.value=s.value,this.id=e?"".concat(e.id,":").concat(t.id,"@").concat(this.value):t.id+this.value,this.id=this.id.toLowerCase(),t.appDataEntityId){const e=ze(t.appDataEntityId);this.context=Object.assign(this.context||{},{[e]:this.value})}this.srfkey=this.value,this.srfmajortext=this.text,this.icon=this.calcIcon(t)}}),vi=t("TreeDataSetNodeData",class extends wi{constructor(t,e,a){super(t,e,a);const{data:s}=a;if(this.deData=s,this.text=s.srfmajortext,this.value=s.srfkey,this.id=e?"".concat(e.id,":").concat(t.id,"@").concat(s.srfkey):t.id+s.srfkey,this.id=this.id.toLowerCase(),t.appDataEntityId){const e=ze(t.appDataEntityId);this.context=Object.assign(this.context||{},{[e]:s.srfkey})}this.srfkey=this.deData.srfkey,this.srfmajortext=this.deData.srfmajortext,this.icon=this.calcIcon(t),this.textHtml=this.calcTextHtml(t)}calcIcon(t){const e=super.calcIcon(t)||{},{iconAppDEFieldId:a,detreeNodeDataItems:s}=t;a&&this.deData[a]&&(e.imagePath=this.deData[a]),e&&(this.icon=e);const i=null==s?void 0:s.find((t=>"icon"===t.id));return i&&(e.htmlStr=this.calcDataItemScript(i)),Object.values(e).length>0?e:void 0}calcDataItemScript(t){if(t.customCode&&t.scriptCode)return pa.execScriptFn({data:this.deData},t.scriptCode,{isAsync:!1})}calcTextHtml(t){let e;const{detreeNodeDataItems:a}=t,s=null==a?void 0:a.find((t=>"text"===t.id));return s&&(e=this.calcDataItemScript(s)),e}}),yi=t("TreeStaticNodeData",class extends wi{constructor(t,e,a){var s,i;super(t,e,a);const n="root"===t.nodeValue?void 0:t.nodeValue;if(this.id=e?"".concat(e.id,":").concat(t.id):t.id,this.id=this.id.toLowerCase(),this.text=t.text,this.value=n,e&&a.parentValueLevel){let t=e;for(let e=1;e<a.parentValueLevel;e++)t=null==t?void 0:t.parent;(null==t?void 0:t.deData)&&(this.deData=t.deData),this.value=n||(null==t?void 0:t.value)}this.srfkey=(null==(s=this.deData)?void 0:s.srfkey)||this.value,this.srfmajortext=(null==(i=this.deData)?void 0:i.srfmajortext)||this.text,this.icon=this.calcIcon(t)}}),Ii=t("UIMapField",class{constructor(t,e,a={}){this.isOriginField=!1,this.isRequestNeed=!0,this.uiKey=t,this.dataKey=e,$(a.isOriginField)||(this.isOriginField=a.isOriginField),$(a.dataType)||(this.dataType=a.dataType)}}),Di=t("CalendarItemData",class{constructor(t,e){this.model=t,this.data=e}get deData(){return this.data}get navId(){return"".concat(this.itemType,"@").concat(this.id)}get itemType(){return this.model.itemType}get bkColor(){const t=this.model.bkcolorAppDEFieldId;return t&&this.data[t]?this.data[t]:this.model.bkcolor}get beginTime(){const t=this.model.beginTimeAppDEFieldId;return t?this.data[t]:void 0}get color(){const t=this.model.colorAppDEFieldId;return t&&this.data[t]?this.data[t]:this.model.color}get content(){const t=this.model.contentAppDEFieldId;return t?this.data[t]:void 0}get endTime(){const t=this.model.endTimeAppDEFieldId;return t?this.data[t]:void 0}get icon(){const t=this.model.iconAppDEFieldId;return t?this.data[t]:void 0}get id(){const t=this.model.idAppDEFieldId;return t&&this.data[t]?this.data[t]:this.data.srfkey}get level(){const t=this.model.levelAppDEFieldId;return t?this.data[t]:void 0}get tag2(){const t=this.model.tag2AppDEFieldId;return t?this.data[t]:void 0}get tag(){const t=this.model.tagAppDEFieldId;return t?this.data[t]:void 0}get text(){const t=this.model.textAppDEFieldId;return t?this.data[t]:void 0}get tips(){const t=this.model.tipsAppDEFieldId;return t?this.data[t]:void 0}}),Ci=t("DEServiceUtil",class{constructor(t){this.appModel=t,this.cache=new Map,this.constructorCache=new Map}register(t,e){this.constructorCache.set(t,e)}async getService(t){if(!this.cache.has(t)){const a=await ibiz.hub.getAppDataEntity(t,this.appModel.appId);if(!a)throw new e("未找到应用实体[".concat(t,"]"));const s=this.constructorCache.get(t);let i;i=s?await s(a):new hi(a),this.cache.set(t,i)}return this.cache.get(t)}clearTempCache(t){this.cache.forEach((e=>{e.local.clear(t)}))}async exec(t,e,a,s,i){return(await this.getService(t)).exec(e,a,s,i)}}),Ai=t("Application",class{constructor(t){this.model=t,this.deName2DeCodeName=new Map,this.net=new l({baseURL:"".concat(ibiz.env.baseUrl,"/").concat(t.appId)}),this.deService=new Ci(t),this.codeList=new Ls(t),this.authority=new fi(t)}get appId(){return this.model.appId}async init(){await this.authority.init(),await this.loadAppModelStyle()}async loadAppModelStyle(){const t=await ibiz.hub.getAppStyle(this.appId);if(t){const e=document.createElement("style");e.setAttribute("type","text/css"),e.id=this.appId,e.innerHTML=t,document.head.appendChild(e)}}getAppFunc(t){return(this.model.appFuncs||[]).find((e=>e.id===t))||null}async getUIAction(t){const[,e]=t.split("@");if(e){const a=(await ibiz.hub.getAppDataEntity(e,this.model.appId)).appDEUIActions.find((e=>e.id===t));if(a)return a}return this.model.appDEUIActions.find((e=>e.id===t))}async getOPPriv(t,e){var a,s;let i=null==(a=this.model.deopprivs)?void 0:a.find((e=>e.name===t));if(!i&&e){i=null==(s=(await ibiz.hub.getAppDataEntity(e,this.model.appId)).deopprivs)?void 0:s.find((e=>e.name===t))}return i}async getDEUILogic(t,e){return(await ibiz.hub.getAppDataEntity(e,this.model.appId)).appDEUILogics.find((e=>e.id===t))}}),bi=t("FormNotifyState",(t=>(t.LOAD="LOAD",t.DRAFT="DRAFT",t.SAVE="SAVE",t))(bi||{})),Pi=t("GridNotifyState",(t=>(t.LOAD="LOAD",t.DRAFT="DRAFT",t.SAVE="SAVE",t))(Pi||{})),_i=t("PanelNotifyState",(t=>(t.LOAD="LOAD",t.DRAFT="DRAFT",t.SAVE="SAVE",t))(_i||{})),Si=t("Counter",class{constructor(t){this.callback=t,this.count=0,this.state="Unused",this.reusable=!0}increment(){return"Used"===this.state||(this.count+=1),this.count}decrement(t){if("Used"!==this.state){if(0===this.count)throw new e("错误的调用!decrement不能对count为0调用");this.count-=1,0===this.count&&(t?t():this.callback&&this.callback(),this.reusable||(this.state="Used"))}}destroy(){this.callback=void 0}}),xi=t("LoadingState",class{constructor(){this.isLoading=!1,this.counter=new Si(h)}begin(){this.isLoading=!0,this.counter.increment()}end(){this.counter.decrement((()=>{this.isLoading=!1}))}}),Ti=t("CTXState",class{}),Li=t("CTX",class{constructor(t){this.parent=t,this.isDestroyed=!1,this.evt=new W(3e3),this.controllersMap=new Map,this.state=new Ti}async init(t){this.view=t,this.registerController(t.model.name,t)}destroy(){this.controllersMap.clear(),this.view=null,this.state=null,this.isDestroyed=!0}async setState(t){Object.assign(this.state,t)}startLoading(){this.view.startLoading()}endLoading(){this.isDestroyed||this.view.endLoading()}registerController(t,e){this.controllersMap.set(t,e),this.evt.emit("onRegister",t,e)}getController(t,e=!1){return this.controllersMap.has(t)?this.controllersMap.get(t):this.parent&&e?this.parent.getController(t):void 0}getTopView(){return this.parent?2===this.view.modal.routeDepth?this.view:this.parent.getTopView():this.view}}),Ni=t("ActivityCounter",class extends Si{constructor(){super(...arguments),this.reusable=!1,this.registration=new Map}enroll(t){"Unused"!==this.state||this.registration.has(t)||(this.registration.set(t,!1),this.increment())}attend(t){this.registration.has(t)&&!1===this.registration.get(t)&&(this.registration.set(t,!0),this.decrement())}}),Oi=t("UIActionButtonState",class{constructor(t,e,a){this.disabled=!1,this.visible=!0,this.loading=!1,this.permitted=!0,this.noPermissionHidden=!0,this.noDataDisabled=!1,this.isInit=!1,this.name=t,this.uiActionId=a,this.appId=e}async init(){if(!this.uiActionId)return void(this.isInit=!0);const t=await $e(this.uiActionId);if([,this.appDeName]=this.uiActionId.split("@"),!t)return;const{dataAccessAction:e,noPrivDisplayMode:a,actionTarget:s,uiactionMode:i,uiactionTag:n}=t;this.dataAccessAction=e,1===a?this.noPermissionHidden=!1:6===a&&(this.visible=!1),(s&&"NONE"!==s||"SYS"===i&&["Save","SaveAndExit","SaveAndNew","Edit","Remove","RemoveAndExit"].includes(n))&&(this.noDataDisabled=!0),this.isInit=!0}async calcPermission(t,e){if(!this.dataAccessAction)return;const a=await ibiz.hub.getApp(this.appId);this.appDeName&&e&&!e.includes(this.appDeName)&&ibiz.log.warn("".concat(this.uiActionId,"界面行为的实体").concat(this.appDeName,"和数据的实体").concat(e,"不一致")),this.permitted=await a.authority.calcByDataAccessAction(this.dataAccessAction,t,e)}async update(t,e){this.isInit||await this.init(),await this.calcPermission(t,e),this.permitted?(this.visible=!0,this.disabled=this.noDataDisabled&&!t):(this.disabled=!0,this.visible=!this.noPermissionHidden)}}),Ri=t("ButtonContainerState",class{constructor(){Object.defineProperty(this,"children",{enumerable:!1,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,get:()=>0!==this.children.length&&!!this.children.find((t=>t.visible))})}addState(t,e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e}),this.children.push(e)}setLoading(t){this.children.forEach((e=>{e.setLoading?e.setLoading(t):e.loading=!!t&&e.name===t}))}async update(t,e){await Promise.all(this.children.map((a=>a.update(t,e))))}}),Mi=t("QXEventEx",class extends W{constructor(){super(...arguments),this.anyEventFns=[]}onAll(t){this.anyEventFns.includes(t)||this.anyEventFns.push(t)}emit(t,...e){super.emit(t,...e),this.anyEventFns.forEach((a=>{a(t,...e)}))}async asyncEmit(t,...e){const a=super.asyncEmit(t,...e),s=this.anyEventFns.map((a=>a(t,...e))),i=Promise.all(s),n=await a,r=await i;return n.concat(...r)}reset(){super.reset(),G(this.anyEventFns)}}),ki=t("ControllerEvent",class{constructor(t){this.getBaseArgs=t,this.isDestroyed=!1,this.evt=new Mi}async emit(t,e){this.isDestroyed||await this.evt.asyncEmit(t,{...this.getBaseArgs(),eventName:t,...e||{}})}on(t,e){this.isDestroyed||this.evt.on(t,e)}onAll(t){this.isDestroyed||this.evt.onAll(t)}destroy(){this.getBaseArgs=void 0,this.evt.reset(),this.isDestroyed=!0}});function Vi(t,e){return(!$(t)&&""!==t||!$(e)&&""!==e)&&t!==e}function Fi(t){let e=Array.isArray(t)?t[0]:t;return e&&e instanceof di&&(e=e.getOrigin()),e}function Wi(t,a,s){const i=[];return t.forEach((t=>{const{valueRuleType:n}=t,r=t.sysValueRule,o=t.defvalueRule;if("SYSVALUERULE"===n&&r)"REG"===r.ruleType?i.push({pattern:new RegExp(r.regExCode),message:r.ruleInfo,trigger:"change blur"}):"SCRIPT"===r.ruleType&&i.push({validator:(t,e,a,s)=>{if(!e)return!0;try{pa.execScriptFn({rule:t,value:e,callback:a,source:s},r.scriptCode,{isAsync:!1})}catch(t){return console.error(t),!1}return!0},trigger:"change blur"});else if("DEFVALUERULE"===n&&o){const t=s||a;i.push({validator:(a,s,i,n)=>{if(V(n[t]))return!0;const{isPast:r,infoMessage:c}=ma(t,n,o.groupCond);return r||i(new e(c||o.ruleInfo)),!0},trigger:"change blur"})}})),i}var Bi=t("ValueExUtil",class{static mergeDefault(t){return et(t,{textSeparator:",",valueSeparator:","})}static toText(t,a){if($(a)||""===a)return"";const{valueType:s,objectNameField:i,textSeparator:n}=this.mergeDefault(t);if(["OBJECTS","OBJECT"].includes(s)){if(!i)throw new e("缺少objectNameField");const t=i.toLowerCase();return"OBJECTS"===s?a.map((e=>e[t]||"---")).join(n):a[t]}return"SIMPLES"===s?a.join(n):"".concat(a)}}),Ui="__self",ji=t("BaseController",class{constructor(t,e,a,s){this.model=t,this.context=e,this.params=a,this.ctx=s,this.state={},this.name="",this.evt=new ki(this.getEventArgs.bind(this)),this.mountCounter=new Ni(this.mounted.bind(this)),this.childNames=[],this.name=t.name||t.id,this.initState()}get _evt(){return this.evt}initState(){this.state.isCreated=!1,this.state.isMounted=!1,this.state.isDestroyed=!1}getEventArgs(){return{context:this.context,params:this.params,data:[],targetName:this.model.name,view:this.ctx.view}}async created(){this.mountCounter.enroll(Ui),await this.onCreated(),this.state.isCreated=!0,this.force((()=>{this.mountSelf()})),ibiz.log.debug("".concat(this.constructor.name,":").concat(this.name," onCreated")),this._evt.emit("onCreated",void 0)}async onCreated(){this.ctx.evt.on("onForecast",(t=>{this.childNames.includes(t)&&this.mountCounter.enroll(t)})),this.ctx.evt.on("onRegister",((t,e)=>{this.childNames.includes(t)&&e.evt.on("onMounted",(()=>{this.mountCounter.attend(t)}))}))}async mountSelf(){this.mountCounter.registration.get(Ui)||this.mountCounter.attend(Ui)}async mounted(){await this.onMounted(),this.state.isMounted=!0,ibiz.log.debug("".concat(this.constructor.name,":").concat(this.name," onMounted")),this._evt.emit("onMounted",void 0)}async onMounted(){}async destroyed(){await this.onDestroyed(),this.state.isDestroyed=!0,ibiz.log.debug("".concat(this.constructor.name,":").concat(this.name," onDestroyed")),await this._evt.emit("onDestroyed",void 0),this.evt.destroy()}async onDestroyed(){}force(t){}getController(t,e=!1){return this.ctx.getController(t,e)}getTopView(){return this.ctx.getTopView()}listenNewController(t){this.ctx.evt.on("onRegister",t)}}),zi=t("ViewController",class extends ji{constructor(t,e,a,s){super(ibiz.util.layoutPanel.fill(t),i.create({},e),a||{},new Li(s)),this.session={},this.modal=new Sa({}),this.providers={},this.engines=[],this.slotProps={},this.counters={},this.viewLoading=new xi,this.isCloseView=!1,this._isActive=!0,s&&s.registerController(this.model.name,this),this.ctx.init(this),this.initEngines()}get _evt(){return this.evt}get parentView(){var t;return null==(t=this.ctx.parent)?void 0:t.view}get isActive(){return this._isActive}onActivated(){this._isActive=!0,ibiz.log.debug("视图[".concat(this.model.name,"](").concat(this.model.id,")激活"))}onDeactivated(){this._isActive=!1,ibiz.log.debug("视图[".concat(this.model.name,"](").concat(this.model.id,")暂停"))}initEngines(){const t=sa(this.model);if(t.length)t.forEach((t=>{const e=ibiz.engine.getEngine(t,this);e&&this.engines.push(e)}));else{const t=ibiz.engine.getEngine({engineCat:"VIEW",engineType:this.model.viewType},this);t&&this.engines.push(t)}}async initCounters(){const t=this.model.viewLayoutPanel,{appCounterRefs:e}=t;if(e&&e.length>0)try{await Promise.all(e.map((async t=>{const e=await Ns.getCounterByRef(t,this.context);this.counters[t.id]=e})))}catch(t){console.error(t)}}initState(){super.initState(),this.state.isLoading=!1,this.state.caption=this.model.caption,this.state.srfactiveviewdata=null}async onCreated(){await super.onCreated(),this.modal.hooks.beforeDismiss.tapPromise((async t=>{Y(this.state.closeOK)&&(t.ok=this.state.closeOK),await this._evt.emit("onCloseView",{...t})})),this._evt.emit("onViewInfoChange",{caption:this.model.caption,title:this.model.title}),this.handleContextParams();const t=this.model.viewLayoutPanel;this.childNames.push(t.name);const e=await Ka(t);this.providers[t.name]=e;const a=ea(this.model);a&&await Promise.all(a.map((async t=>{const e=await Ka(t);this.providers[t.name||t.id]=e}))),await this.initCounters();const s=aa(this.model);s.length&&(this.scheduler=ibiz.scheduler.createViewScheduler(s),this.scheduler.defaultParamsCb=()=>this.getEventArgs(),this.scheduler.hasViewEventTrigger&&this.evt.onAll(((t,e)=>{this.scheduler.triggerViewEvent(e)}))),this.engines.length&&await Promise.all(this.engines.map((t=>t.onCreated())))}async onMounted(){var t;await super.onMounted(),this.engines.length&&await Promise.all(this.engines.map((t=>t.onMounted()))),null==(t=this.scheduler)||t.startTimerTrigger()}async onDestroyed(){await super.onDestroyed(),this.engines.length&&await Promise.all(this.engines.map((t=>t.onDestroyed()))),this.ctx.destroy(),this.context.destroy(),this.engines=[],this.scheduler&&this.scheduler.destroy(),ibiz.log.debug("视图[".concat(this.model.name,"](").concat(this.model.id,")销毁"))}handleContextParams(){this.context.srfappid=this.model.appId,($(this.context.srfsessionid)||Q(this.context.srfsessionid))&&(this.context.srfsessionid=B());const t=this.model.appViewNavContexts;let e={};k(t)&&(e=Le(t,this.context,this.params)),Object.assign(this.context,e);const a=this.model.appViewNavParams;let s={};k(a)&&(s=Le(a,this.context,this.params)),Object.assign(this.params,s),this.state.isMounted&&this.callUIAction("Refresh")}async call(t,e){let a;for(const s of this.engines)if(a=await s.call(t,e),void 0!==a)break;return a}async callUIAction(t,a){const s=this.call(t,a);if(void 0===s)throw new e("没有引擎支持预置界面行为".concat(t));return s}async closeView(t={ok:!1,data:[]}){await this.modal.dismiss(t)}startLoading(){this.viewLoading.begin(),this.state.isLoading=this.viewLoading.isLoading}endLoading(){this.viewLoading.end(),this.state.isLoading=this.viewLoading.isLoading}setLayoutPanel(t){var e;this.layoutPanel=t,this.layoutPanel.state.isMounted?this.mountCounter.attend(this.layoutPanel.model.name):this.layoutPanel.evt.on("onMounted",(()=>{this.mountCounter.attend(this.layoutPanel.model.name)})),(null==(e=this.scheduler)?void 0:e.hasControlEventTrigger)&&t.evt.on("onControlEvent",(t=>{this.scheduler.triggerControlEvent(t.triggerControlName,t.triggerEvent)}))}}),Gi=(t("MobViewController",class extends zi{}),t("WFStepTraceViewController",class extends zi{initState(){super.initState(),this.state.historyData=null}async onCreated(){var t;await super.onCreated();const e=ibiz.hub.getApp(this.context.srfappid);if(null==(t=this.ctx.parent)?void 0:t.view.model.appDataEntityId){const t=await e.deService.getService(this.ctx.parent.view.model.appDataEntityId),a=Object.assign(this.context.clone(),this.params),s=await t.wf.getWFHistory(a);s.data&&(this.state.historyData=s.data)}}}),t("EditorController",class{constructor(t,e){this.placeHolder="",this.editorParams={},this.model=t,this.parent=e,this.context=e.context,this.params=e.params}get readonly(){return!!this.model.readOnly}async init(){await this.onInit()}async onInit(){this.model.placeHolder&&(this.placeHolder=this.model.placeHolder),this.model.editorParams&&Object.keys(this.model.editorParams).forEach((t=>{this.editorParams[t]=this.model.editorParams[t]}))}handlePublicParams(t,e,a){const{navigateContexts:s,navigateParams:i}=this.model;let n={};s&&t&&(n=Le(s,e,a,t));const r=Object.assign(e.clone(),n);let o={};i&&t&&(o=Le(i,e,a,t));return{context:r,params:{...a,...o}}}toObj(t){if(!t)return;return new Function("return (".concat(t,");"))()}toBoolean(t){return Object.is("true",t)}})),Hi=(t("CodeListEditorController",class extends Gi{async loadCodeList(t){const{context:e,params:s}=this.handlePublicParams(t,this.context,this.params);if(this.model.appCodeListId){const t=await ibiz.hub.getApp(this.context.srfappid);let a=[];return a=await t.codeList.get(this.model.appCodeListId,e,s),a}throw new a(this.model,"请配置代码表")}}),t("ControlController",class extends ji{constructor(t,e,a,s){super(t,e,a,s),this.providers={},this.registerToCtx();const i=ibiz.util.layoutPanel.get("".concat(t.controlType,"_DEFAULT"));i&&(this.controlPanel=i)}get _evt(){return this.evt}get view(){return this.ctx.view}registerToCtx(){this.ctx.registerController(this.model.name||this.model.id,this)}getEventArgs(){return{...super.getEventArgs(),data:this.getData()||[],ctrl:this}}initState(){super.initState(),this.state.isLoading=!1}async onCreated(){if(await super.onCreated(),this.controlPanel){this.childNames.push(this.controlPanel.name);const t=await Ka(this.controlPanel);this.providers[this.controlPanel.name]=t}this.initControlScheduler(this.model.controlLogics)}async onDestroyed(){await super.onDestroyed(),this.scheduler&&this.scheduler.destroy()}getControlType(){return this.model.controlType}getData(){return null}async startLoading(){this.state.isLoading=!0,this.ctx.startLoading()}async endLoading(){this.state.isLoading=!1,this.ctx.endLoading()}handlerAbilityParams(t){return{context:this.context.clone(),params:{...this.params},data:(null==t?void 0:t.data)||this.getData()||[]}}setLayoutPanel(t){this.layoutPanel=t,this.layoutPanel.state.isMounted?this.mountCounter.attend(this.layoutPanel.model.name):this.layoutPanel.evt.on("onMounted",(()=>{this.mountCounter.attend(this.layoutPanel.model.name)}))}initControlScheduler(t=[]){0!==t.length&&(this.scheduler=ibiz.scheduler.createControlScheduler(t),this.scheduler.defaultParamsCb=()=>this.getEventArgs())}actionNotification(t,e){var a;const{ctrlMsg:s}=this.model,i=null==(a=null==s?void 0:s.ctrlMsgItems)?void 0:a.find((e=>e.name===t));let n,r;if(i&&i.content){r=$(i.timeout)?void 0:i.timeout/1e3;const t={...this.getEventArgs()};(null==e?void 0:e.data)&&(t.data=e.data),n=pa.execScriptFn(t,"`".concat(i.content,"`"),{isAsync:!1,singleRowReturn:!0})}else{const e="CONTROL.".concat(this.model.controlType,".").concat(t).toUpperCase();n=ibiz.i18n.t(e,""),n===e&&(n="")}if(!n&&(null==e?void 0:e.default)&&(n=e.default),!n&&(null==e?void 0:e.error)&&(n=n||e.error.message),n){if(null==e?void 0:e.error)throw new d(n,r);ibiz.message.success(n,r,0===r)}}})),Xi=t("MDControlController",class extends Hi{constructor(){super(...arguments),this.fieldIdNameMap=new Map}get _evt(){return this.evt}initState(){super.initState(),this.state.items=[],this.state.selectedData=[],this.state.searchParams={},this.state.noSort=!1,this.state.sortQuery="",this.state.curPage=1,this.state.size=20,this.state.total=0,this.state.isLoaded=!1,this.state.singleSelect=!0,this.state.mdctrlActiveMode=0,this.state.groups=[]}async onCreated(){var t;await super.onCreated();null==(t=(await ibiz.hub.getAppDataEntity(this.model.appDataEntityId)).appDEFields)||t.forEach((t=>{this.fieldIdNameMap.set(t.id,t.name)})),this.setSort()}setSort(t,e){t&&e&&(this.state.sortQuery="".concat(t,",").concat(e))}async getFetchParams(t){const{curPage:e,size:a,sortQuery:s,noSort:i}=this.state,n={...this.params};return a&&(n.page=e-1,n.size=a),!i&&s&&(n.sort=s),await this._evt.emit("onBeforeLoad",void 0),Object.assign(n,{...this.state.searchParams}),t&&Object.assign(n,t),n}async load(t={}){await this.startLoading();try{const e=!0===t.isInitialLoad,a=!0===t.isLoadMore;e?this.state.curPage=1:a&&(this.state.curPage+=1);const{context:s}=this.handlerAbilityParams(t),i=await this.getFetchParams(null==t?void 0:t.params),n=await this.service.fetch(s,i);"number"==typeof n.total&&(this.state.total=n.total),a?this.state.items.push(...n.data):this.state.items=n.data,await this.afterLoad(t,n.data),this.state.isLoaded=!0,await this._evt.emit("onLoadSuccess",{isInitialLoad:e})}catch(t){throw await this._evt.emit("onLoadError",void 0),this.actionNotification("FETCHERROR",{error:t}),t}finally{await this.endLoading()}return this.actionNotification("FETCHSUCCESS"),this.state.items}async afterLoad(t,e){return e}async refresh(){await this.load({isInitialLoad:!1})}async remove(t){const{context:a,params:s,data:i}=this.handlerAbilityParams(t);if(!(null==i?void 0:i.length))throw new e("未选中数据");if(!0!==(null==t?void 0:t.silent)){if(!await ibiz.confirm.error({title:"数据删除",desc:"确认删除数据?"}))return}await this._evt.emit("onBeforeRemove",void 0),await this.startLoading();let n=!1;try{const e=ze(this.model.appDataEntityId);await Promise.allSettled(i.map((async t=>{if(0!==t.srfuf){const i=a.clone();i[e]=t.srfkey,await this.service.remove(i,s),n=!0}this.afterRemove(t)}))),!0!==(null==t?void 0:t.silent)&&this.actionNotification("REMOVESUCCESS",{data:i,default:"数据[".concat(i.map((t=>t.srfmajortext)).join("、"),"]删除成功!")}),n&&this.refresh()}catch(t){throw await this._evt.emit("onRemoveError",void 0),this.actionNotification("REMOVEERROR",{error:t,data:i}),t}finally{await this.endLoading()}this.state.selectedData=[],await this._evt.emit("onRemoveSuccess",void 0)}afterRemove(t){const e=this.state.items.findIndex((e=>e.srfkey===t.srfkey));-1!==e&&this.state.items.splice(e,1)}getData(){return this.state.selectedData||[]}setActive(t){return this._evt.emit("onActive",{data:[t]})}setSelection(t){const{selectedData:e}=this.state;u(e,t)||(this.state.selectedData=t,this._evt.emit("onSelectionChange",{data:t}))}async onRowClick(t){const{selectedData:e}=this.state,a=e.filter((e=>e.srfkey!==t.srfkey));a.length===e.length?this.setSelection(this.state.singleSelect?[t]:e.concat([t])):this.setSelection(a),1===this.state.mdctrlActiveMode&&await this.setActive(t)}async onDbRowClick(t){2===this.state.mdctrlActiveMode&&await this.setActive(t)}async importData(){}async exportData(t){}}),Ki=t("AppMenuController",class extends Hi{initState(){super.initState(),this.state.menuItemsState={}}get routeDepth(){return this.view.modal.routeDepth}async onCreated(){var t;await super.onCreated(),this.app=await ibiz.hub.getApp(this.context.srfappid),null==(t=this.model.appMenuItems)||t.forEach((t=>{this.initMenuItemState(t)}))}async onClickMenuItem(t,s,i=!0){const n=p(this.model,t,{compareField:"id",childrenFields:["appMenuItems"]});if(!n)throw new e("找不到名为".concat(t,"的菜单项"));if(this.evt.emit("onClick",{eventArg:t,event:s}),!n.appFuncId)throw new a(n,"没有配置应用功能");const r=this.context.clone();this.routeDepth&&i&&Object.assign(r,{toRouteDepth:this.routeDepth+1}),await ibiz.commands.execute(Ra.TAG,n.appFuncId,r,this.params)}initMenuItemState(t){var e;const a={permitted:!0,visible:!0};if(t.hidden)a.visible=!1;else{let s=!0;t.accessKey&&(s=this.app.authority.calcByResCode(t.accessKey));let i=s;if(null==(e=t.appMenuItems)?void 0:e.length){const e=t.appMenuItems.map((t=>this.initMenuItemState(t).visible));i=i&&e.includes(!0)}a.permitted=s,a.visible=i}return this.state.menuItemsState[t.id]=a,a}getAllItems(){const t=[],e=a=>{a.forEach((a=>{t.push(a),a.appMenuItems&&a.appMenuItems.length>0&&e(a.appMenuItems)}))};return e(this.model.appMenuItems),t}getCounter(t){const{counters:e}=this.ctx.view;return e[t]?e[t]:null}}),Yi=(t("AppMenuIconViewController",class extends Ki{async onClickMenuItem(t,s){const i=p(this.model,t,{compareField:"id",childrenFields:["appMenuItems"]});if(!i)throw new e("找不到名为".concat(t,"的菜单项"));if(this.evt.emit("onClick",{eventArg:t,event:s}),!i.appFuncId)throw new a(i,"没有配置应用功能");const n=this.context.clone();1===this.routeDepth&&Object.assign(n,{toRouteDepth:1}),await ibiz.commands.execute(Ra.TAG,i.appFuncId,n,this.params)}}),t("CalendarService",class extends pi{async search(t,e={}){const{sysCalendarItems:a}=this.model;if(!a)return[];const s=a.map((async a=>{const s=a.appDEDataSetId||"fetchdefault";return this.exec2(s,t,e,void 0,a.appDataEntityId)}));return(await Promise.all(s)).map(((t,e)=>this.setCalendarConfigData(t.data,e))).flat()}setCalendarConfigData(t,a){const{sysCalendarItems:s}=this.model;if(!s)throw new e("未找到日历项模型");const i=s[a];if(!i)throw new e("未找到日历项模型");return t.map((t=>new Di(i,t)))}async exec2(t,e,a={},s={},i=this.model.appDataEntityId){return await this.app.deService.exec(i,t,e,a,s)}}));t("CalendarController",class extends Xi{initState(){super.initState(),this.state.selectedDate=new Date,this.state.size=1e3}async onCreated(){await super.onCreated(),this.service=new Yi(this.model),await this.service.init(this.context)}async load(t={}){const e=!0===t.isInitialLoad,{context:a}=this.handlerAbilityParams(t),s=await this.getFetchParams(null==t?void 0:t.params);let i;await this.startLoading();try{i=await this.service.search(a,s)}finally{await this.endLoading()}return await this.afterLoad(t,i),this.state.isLoaded=!0,this.state.items=i,await this.evt.emit("onLoadSuccess",{isInitialLoad:e}),i}getCurSelectDate(t){const{selectedDate:e}=this.state,{start:a,end:s}=t;if(!a||!s){const t=new Date(e.getFullYear(),e.getMonth(),1),a=new Date(e.getFullYear(),e.getMonth()+1,1);return{start:st(t).format("YYYY-MM-DD HH:mm:ss"),end:st(a).format("YYYY-MM-DD HH:mm:ss")}}return{start:a,end:s}}async getFetchParams(t={}){const{curPage:e,size:a,sortQuery:s,noSort:i}=this.state,n={...this.params};!i&&s&&(n.sort=s),await this._evt.emit("onBeforeLoad",void 0),Object.assign(n,{...this.state.searchParams}),a&&(n.page=e-1,n.size=a),t&&Object.assign(n,t);const r=this.getCurSelectDate(n);return Object.assign(n,r),n}async onRowClick(t){const{selectedData:e}=this.state,a=e.filter((e=>e.deData.srfkey!==t.deData.srfkey));a.length===e.length?this.setSelection(this.state.singleSelect?[t]:e.concat([t])):this.setSelection(a),1===this.state.mdctrlActiveMode&&await this.setActive(t)}setSelectDate(t){this.state.selectedDate=t}});st.extend(it),st.extend(nt),st.extend(rt),st.extend(ot),st.extend(ct);var $i="$default_group",qi=class{constructor(t,e){this.model=t,this.chartGenerator=e,this.staticOptions={},this.autoCompleteCategory=!0,this.model=t,this.chartGenerator=e;const{chartSeriesEncode:s,caption:i,id:n,userParam:r}=t;if(!t.catalogField)throw new a(t,"缺少分类属性配置");if(!t.valueField)throw new a(t,"缺少值属性配置");this.catalogField=e.getFieldKey(t.catalogField),this.valueField=e.getFieldKey(t.valueField),this.groupField=t.seriesField?e.getFieldKey(t.seriesField):void 0;const{chartXAxisId:o,chartYAxisId:c}=s||{};this.xAxisIndex=I(o),this.yAxisIndex=I(c),this.seriesName=i||n,this.staticOptions=this.calcStaticOptions(),r&&(this.seriesUserParam=sn(r))}calcStaticOptions(){return{type:this.model.seriesType,name:this.seriesName,emphasis:{label:{fontSize:20,show:!0}},label:{position:"top",show:!0}}}translateVal(t,e,a=!1){if($(e))return;if($(t))return e;const s=this.chartGenerator.codeListMap.get(t);if(null==s?void 0:s.length){const t=s.find((t=>t.value===e));if(t)return t.text}return a?void 0:e}calcGroupData(t){this.groupData={};const e=this.groupData,{seriesCodeListId:a,catalogCodeListId:s}=this.model;return t.forEach((t=>{let i=$i;if(this.groupField){const e=this.translateVal(a,t[this.groupField]);if($(e))return;i=e}if(!e[i]&&(e[i]=new Map,s&&this.autoCompleteCategory)){this.chartGenerator.codeListMap.get(s).forEach((t=>{e[i].set(t.text,{value:0})}))}const n=this.translateVal(s,t[this.catalogField],!0);n&&(e[i].get(n)||e[i].set(n,{value:0}),e[i].get(n).value+=t[this.valueField],e[i].get(n).deData=t)})),e}calcGroupSeries(t){return Object.keys(t).map((e=>{const a=t[e],s=this.calcSeriesData(a);let i={...this.staticOptions,data:s};return e!==$i&&(i.name=e),this.seriesUserParam&&(i=at(i,this.seriesUserParam)),i}))}calcSeriesData(t){const e=[];return t.forEach(((t,a)=>{var s;e.push([a,t.value,null==(s=t.deData)?void 0:s.srfkey])})),e}calcByData(t){const e=this.dataPreprocess(t),a=this.calcGroupData(e);return this.addTimeData(a),this.calcGroupSeries(a)}getSrfkeyByParams(t){return t.value[2]}dataPreprocess(t){const e=[];t.forEach((t=>{e.push(J(t))}));const{groupMode:a}=this.model;return a&&e.forEach((t=>{let e="";if("DAY"===a||"YEAR"===a||"MONTH"===a){if("DAY"===a?e="YYYY-MM-DD":"YEAR"===a?e="YYYY":"MONTH"===a&&(e="YYYY-MM"),t[this.catalogField]){const a=st(t[this.catalogField]).format(e);t[this.catalogField]=a}}else if("QUARTER"===a){if(t[this.catalogField]){const e="".concat(st(t[this.catalogField]).format("YYYY"),"-").concat(st(t[this.catalogField]).quarter());t[this.catalogField]=e}}else if("YEARWEEK"===a&&t[this.catalogField]){const e="".concat(st(t[this.catalogField]).format("YYYY"),"-").concat(st(t[this.catalogField]).week());t[this.catalogField]=e}})),e}sortTimeData(t){const{groupMode:e}=this.model;Object.keys(t).forEach((a=>{const s=t[a];let i=[];"DAY"===e||"YEAR"===e||"MONTH"===e?i=Array.from(s.keys()).sort(((t,e)=>st(t).diff(st(e)))):"QUARTER"!==e&&"YEARWEEK"!==e||(i=Array.from(s.keys()).sort(((t,e)=>{const[a,s]=t.split("-"),[i,n]=e.split("-");return a!==i?parseInt(a,10)-parseInt(i,10):parseInt(s,10)-parseInt(n,10)})));const n=new Map;i.forEach((t=>{n.set(t,s.get(t))})),t[a]=n}))}addTimeData(t){const{groupMode:e}=this.model;if(!e||"CODELIST"===e)return;const a=[];Object.keys(t).forEach((e=>{t[e].forEach(((t,e)=>{a.push(st(e))}))}));const s=st.max(a),i=st.min(a);if("DAY"===e){let e=i;const a=s;for(;null==e?void 0:e.isSameOrBefore(a,"day");){const a=e.format("YYYY-MM-DD");Object.keys(t).forEach((e=>{t[e].get(a)||t[e].set(a,{value:0})})),e=e.add(1,"day")}}else if("YEAR"===e){let e=i.year();const a=s.year();for(;e<=a;){const a=e.toString();Object.keys(t).forEach((e=>{t[e].get(a)||t[e].set(a,{value:0})})),e+=1}}else if("MONTH"===e){let e=i.clone().startOf("month");const a=s.clone().startOf("month");for(;e.isSameOrBefore(a);){const a=e.format("YYYY-MM");Object.keys(t).forEach((e=>{t[e].get(a)||t[e].set(a,{value:0})})),e=e.add(1,"month")}}else if("QUARTER"===e){const e=[];Object.keys(t).forEach((a=>{t[a].forEach(((t,a)=>{e.push(a)}))}));const a=e.reduce(((t,e)=>e<t?e:t),e[0]),s=e.reduce(((t,e)=>e>t?e:t),e[0]),[i]=a.split("-"),[n]=s.split("-");for(let e=parseInt(i,10);e<=parseInt(n,10);e++)for(let a=1;a<=4;a++){const s="".concat(e,"-").concat(a);Object.keys(t).forEach((e=>{t[e].get(s)||t[e].set(s,{value:0})}))}}else if("YEARWEEK"===e){const e=[];Object.keys(t).forEach((a=>{t[a].forEach(((t,a)=>{e.push(a)}))}));const a=e.reduce(((t,e)=>e<t?e:t),e[0]),s=e.reduce(((t,e)=>e>t?e:t),e[0]),[i]=a.split("-"),[n]=s.split("-");for(let e=parseInt(i,10);e<=parseInt(n,10);e++){const a=st("".concat(e,"-12-31")).isoWeek();for(let s=1;s<=a;s++){const a="".concat(e,"-").concat(s);Object.keys(t).forEach((e=>{t[e].get(a)||t[e].set(a,{value:0})}))}}}this.sortTimeData(t)}},Qi=class extends qi{calcStaticOptions(){if(void 0===this.xAxisIndex)throw new a(this.model,"序列没有配置X坐标轴");if(void 0===this.yAxisIndex)throw new a(this.model,"序列没有配置Y坐标轴");const t=super.calcStaticOptions();t.xAxisIndex=this.xAxisIndex,t.yAxisIndex=this.yAxisIndex;const{stack:e,step:s}=this.model;return s&&(t.step="middle"),t}},Ji=class extends qi{calcStaticOptions(){if(void 0===this.xAxisIndex)throw new a(this.model,"序列没有配置X坐标轴");if(void 0===this.yAxisIndex)throw new a(this.model,"序列没有配置Y坐标轴");const t=super.calcStaticOptions();return t.xAxisIndex=this.xAxisIndex,t.yAxisIndex=this.yAxisIndex,this.model,t}},Zi=class extends qi{calcStaticOptions(){const t=super.calcStaticOptions();return t.label.formatter="{b}: {d}%({c})",t.label.position="outer",t}calcSeriesData(t){return Object.keys(t).map((e=>{var a;const s=t.get(e);return{name:e,value:[s.value,null==(a=s.deData)?void 0:a.srfkey]}}))}getSrfkeyByParams(t){return t.value[1]}},tn=class extends qi{calcStaticOptions(){const t=super.calcStaticOptions();return t.label.formatter="{b}: {d}%({c})",t.label.position="outside",t}calcSeriesData(t){return Object.keys(t).map((e=>{var a;const s=t.get(e);return{name:e,value:[s.value,null==(a=s.deData)?void 0:a.srfkey]}}))}getSrfkeyByParams(t){return t.value[1]}},en=class extends qi{calcStaticOptions(){if(void 0===this.xAxisIndex)throw new a(this.model,"序列没有配置X坐标轴");if(void 0===this.yAxisIndex)throw new a(this.model,"序列没有配置Y坐标轴");const t=super.calcStaticOptions();return t.xAxisIndex=this.xAxisIndex,t.yAxisIndex=this.yAxisIndex,t}},an=class extends qi{calcStaticOptions(){return super.calcStaticOptions()}calcRadarCoordSystem(t){const e=this.calcGroupData(t);this.chartGenerator.radarMap.has(this.catalogField)||this.chartGenerator.radarMap.set(this.catalogField,new class{constructor(t){this.indicator={},this.index=t}get indicatorKeys(){return this._indicatorKeys&&this._indicatorKeys.length===Object.keys(this.indicator).length||(this._indicatorKeys=Object.keys(this.indicator).sort()),this._indicatorKeys}updateIndicator(t,e){const a=this.indicator[t];(!a||a.max<e)&&(this.indicator[t]={max:e})}toOptions(){const t=Math.max(...Object.values(this.indicator).map((t=>t.max)));return{indicator:this.indicatorKeys.map((e=>({name:e,max:t})))}}}(this.chartGenerator.radarMap.size));const a=this.chartGenerator.radarMap.get(this.catalogField);Object.values(e).forEach((t=>{Object.keys(t).forEach((e=>{a.updateIndicator(e,t.get(e).value)}))}))}calcByData(t){const e=this.groupData,a=this.chartGenerator.radarMap.get(this.catalogField),s=Object.keys(e).map((t=>{const s=e[t],i=a.indicatorKeys.map((t=>s.has(t)?s.get(t):0));return{name:t===$i?this.seriesName:t,value:i}}));let i={...this.staticOptions,data:s};return this.seriesUserParam&&(i=at(i,this.seriesUserParam)),i}getSrfkeyByParams(t){return t.value[1]}};function sn(t){const e={};return t&&Object.keys(t).forEach((a=>{const s=a.indexOf(".");if(-1===s)return;const i=a.slice(s+1);if(i)try{e[i]=JSON.parse(t[a])}catch(s){e[i]=t[a]}})),e}var nn=t("ChartService",class extends pi{}),rn=(t("ChartController",class extends Xi{initState(){super.initState(),this.state.size=1e3}async onCreated(){await super.onCreated(),this.service=new nn(this.model),await this.service.init(this.context),this.generator=new class{constructor(t){this.model=t,this.staticOptions={tooltip:{show:!0}},this.options={},this.seriesGenerators=[],this.radarMap=new Map,this.codeListMap=new Map;const{dechartTitle:e,dechartLegend:a,chartXAxises:s,chartYAxises:i,userParam:n}=t;e&&(this.staticOptions.title=this.calcTitleOption(e)),a&&(this.staticOptions.legend=this.calcLegendOption(a)),(null==s?void 0:s.length)&&(this.staticOptions.xAxis=this.calcXYAxisOption(s)),(null==i?void 0:i.length)&&(this.staticOptions.yAxis=this.calcXYAxisOption(i)),n&&(this.chartUserParam=sn(n))}initSeriesGenerators(){var t;null==(t=this.model.dechartSerieses)||t.forEach((t=>{let e;switch(t.seriesType){case"line":e=new Qi(t,this);break;case"bar":e=new Ji(t,this);break;case"scatter":e=new en(t,this);break;case"pie":e=new tn(t,this);break;case"funnel":e=new Zi(t,this);break;case"radar":e=new an(t,this);break;default:ibiz.log.error("图表暂未支持序列类型".concat(t.seriesType))}e&&this.seriesGenerators.push(e)}))}calcTitleOption(t){const{showTitle:e,title:a,subTitle:s,titlePos:i}=t,n={show:e,text:a,subtext:s,left:"center"},r=null==i?void 0:i.toLowerCase();return"left"===r||"right"===r?n.left=r:"bottom"!==r&&"top"!==r||(n.top=r),n}calcLegendOption(t){var e;const{showLegend:a,legendPos:s}=t,i={};i.show=a,1===(null==(e=this.model.dechartSerieses)?void 0:e.length)&&(i.show=!1);const n=null==s?void 0:s.toLowerCase();return"left"===n||"right"===n?(i.left=n,i.top="middle",i.orient="vertical"):"bottom"===n&&(i.top=n),i}calcXYAxisOption(t){const e=[];return t.forEach((t=>{const{position:a,dataShowMode:s,userParam:i}=t;let n={type:t.echartsType,name:t.caption,max:t.maxValue,min:t.minValue,position:a,axisLabel:{formatter:t=>1===s?t.length>4?"".concat(t.slice(0,4).split("").join("\n"),"\n..."):t.split("").join("\n"):2===s&&t.length>4?"".concat(t.slice(0,4),"..."):t,rotate:3===s?45:0}};i&&(n=at(n,sn(i))),e.push(n)})),e}async init(t,e){await this.loadCodeList(t,e),this.entity=await ibiz.hub.getAppDataEntity(this.model.appDataEntityId),this.initSeriesGenerators()}getFieldKey(t){const e=this.entity.appDEFields.find((e=>e.name===t));return e?e.codeName.toLowerCase():t.toLowerCase()}async loadCodeList(t,e){var a;if(this.codeListMap.clear(),!(null==(a=this.model.dechartSerieses)?void 0:a.length))return;const s=ibiz.hub.getApp(t.srfappid),i=async a=>{if(!a||this.codeListMap.has(a))return;const i=await s.codeList.get(a,t,e);this.codeListMap.set(a,i)};await Promise.all(this.model.dechartSerieses.map((async t=>{const{seriesCodeListId:e,catalogCodeListId:a}=t;await i(e),await i(a)})))}calcOptionsByData(t){this.radarMap.clear(),this.options={series:[],radar:[]},this.seriesGenerators.forEach((e=>{"radar"===e.model.seriesType&&e.calcRadarCoordSystem(t)})),this.radarMap.size&&(this.options.radar=[...this.radarMap.values()].map((t=>t.toOptions())));const e=[];return this.seriesGenerators.forEach((a=>{const s=a.calcByData(t);s instanceof Array?e.push(...s):e.push(s)})),this.options.series=e,this.options=at(this.staticOptions,this.options),this.chartUserParam&&(this.options=at(this.options,this.chartUserParam)),this.options}getSrfkeyByParams(t){const a=this.seriesGenerators[t.seriesIndex];if(!a)throw new e("找不到".concat(t.seriesIndex,"序列的generator!"));return a.getSrfkeyByParams(t)}}(this.model),await this.generator.init(this.context,this.params),window.addEventListener("resize",this.resizeChart)}async afterLoad(t,e){const a=await super.afterLoad(t,e);return e.forEach((t=>{Object.assign(t,{srfcount:1})})),this.calcOptions(),a}initChart(t){this.chart=t,this.chart.on("click",(t=>{const e=this.generator.getSrfkeyByParams(t),a=this.state.items.find((t=>t.srfkey===e));console.log("实体数据",a)}))}calcOptions(t=this.state.items){this.options=this.generator.calcOptionsByData(t),this.updateChart()}updateChart(){if(!this.chart)throw new e("chart对象没有正确初始化");if(!this.options)throw new e("options还没计算");this.chart.setOption(this.options),this.resizeChart()}resizeChart(){this.chart&&this.chart.resize()}async onDestroyed(){var t;window.removeEventListener("resize",this.resizeChart),await super.onDestroyed(),null==(t=this.chart)||t.dispose()}}),t("CaptionBarController",class extends Hi{initState(){super.initState(),this.view.model.capLanguageRes?this.state.caption=ibiz.i18n.t(this.view.model.capLanguageRes.lanResTag,this.view.model.caption):this.state.caption=this.view.model.caption}async onCreated(){await super.onCreated(),this.view.evt.on("onViewInfoChange",(({caption:t,dataInfo:e})=>{this.state.caption="".concat(this.view.model.caption).concat(e?"-".concat(e):"")}))}}),class{}),on=class extends rn{constructor(t){super(),this.model=t,this.srcParam=t.srcLogicParamId,this.dstParam=t.dstLogicParamId}get dstField(){return this.model.dstFieldName}get op(){return this.model.condOP}get type(){return this.model.paramType}get value(){return this.model.paramValue}test(t,e,i){const n=t.params[this.dstParam];switch(this.type){case"ENTITYFIELD":{if(!this.value)throw new a(this.model,"当前条件值类型为[数据对象属性],缺少配置条件值");const t=null!=i[this.value]?i[this.value]:e[this.value];return ra(n[this.dstField],this.op,t)}case"SRCENTITYFIELD":{if(!this.value)throw new a(this.model,"当前条件值类型为[源数据对象属性],缺少配置条件值");const e=t.params[this.srcParam];return ra(n[this.dstField],this.op,e[this.value])}case"CURTIME":throw new s(this.model,"暂未支持条件值类型为[当前时间]");default:return ra(n[this.dstField],this.op,this.value)}}},cn=class t extends rn{constructor(e){super(),this.model=e;const a=e.deuilogicLinkConds||[];this.conds=a.map((e=>"SINGLE"===e.logicType?new on(e):new t(e)))}get op(){return this.model.groupOP}get notMode(){return!0===this.model.notMode}test(t,e,s){let i=!0;if(0===this.conds.length)throw new a(this.model,"界面连接条件逻辑组未配置逻辑项");for(let a=0;a<this.conds.length;a++){const n=this.conds[a].test(t,e,s);if("AND"===this.op&&!1===n){i=!1;break}if("OR"===this.op&&!0===n){i=!0;break}}return this.notMode?!i:i}},ln=class{constructor(t){this.model=t,this.links=(t.deuilogicLinks||[]).map((t=>new class{constructor(t){this.model=t,this.srcNode=null,this.dstNode=null,this.groupCond=null;const{linkMode:e,deuilogicLinkGroupCond:a}=this.model;0===e&&a&&(this.groupCond=new cn(a))}async exec(t){const{linkMode:e}=this.model,{context:a,data:i}=t;switch(e||0){case 0:return!this.groupCond||this.groupCond.test(t,a,i&&i.length>0?i[0]:{});case 1:return!0;case 2:throw new s(this.model,"未支持的逻辑连接类型: 异步结束");case 3:throw new s(this.model,"未支持的逻辑连接类型: 异步拒绝");case 9:throw new s(this.model,"未支持的逻辑连接类型: 异常处理");default:throw new s(this.model,"未支持的逻辑连接类型:".concat(e))}}}(t)))}},hn=class extends ln{async exec(t){const{dstAppDataEntityId:e,dstAppDEActionId:s,dstDEUILogicParamId:i,retDEUILogicParamId:n}=this.model;if(!e)throw new a(this.model,"未指定应用实体");if(!s)throw new a(this.model,"未指定实体行为");const r=t.params[i],o=ibiz.hub.getApp(t.context.srfappid),c=await o.deService.exec(e,s,t.context,r,t.viewParams);c.ok&&(t.params[n]=c.data)}},dn=class extends ln{async exec(t){const{dstAppDEUIActionId:e,dstDEUILogicParamId:s}=this.model,{data:i,parameters:n}=t;if(!e)throw new a(this.model,"未配置界面行为");let r=[i];if(s){const e=t.params[s];r=e instanceof Array?e:[e]}await Nn.execAndResolved(e,{...n,data:r})}},un=class extends ln{async exec(t){}},pn=class extends ln{async exec(t){t.isEndNode=!0;const{returnType:e,rawValue:a,returnParamId:i}=this.model;switch(e){case"NONEVALUE":t.result=void 0;break;case"NULLVALUE":t.result=null;break;case"SRCVALUE":t.result=a;break;case"LOGICPARAM":t.result=t.params[i];break;default:throw new s(this.model,"暂未支持的结束节点返回值类型: ".concat(e))}}};function mn(t,e){const{srcDEUILogicParamId:a,srcFieldName:i,srcValue:n}=e,r=e.srcValueType||"SRCDLPARAM";let o;switch(r){case"SRCDLPARAM":o=t.params[a];break;case"NULLVALUE":return null;case"NONEVALUE":return;case"SRCVALUE":return n;case"WEBCONTEXT":case"VIEWPARAM":o=t.viewParams;break;case"APPLICATION":case"SESSION":case"APPDATA":case"DATACONTEXT":o=t.context;break;case"ENVPARAM":o=J(ibiz.env);break;default:throw new s(e,"暂未支持源值类型".concat(r))}return o&&i&&(o=o[i]),o}var fn=class extends ln{async exec(t){const e=this.model.deuilogicNodeParams;if(null==e?void 0:e.length)for(const a of e)switch(a.paramAction){case"SETPARAMVALUE":await this.setParamValue(a,t);break;case"RESETPARAM":await this.resetParam(a,t);break;case"COPYPARAM":await this.copyParam(a,t);break;case"BINDPARAM":await this.bindParam(a,t);break;case"RENEWPARAM":await this.renewParam(a,t);break;case"APPENDPARAM":await this.appendParam(a,t);break;case"SORTPARAM":await this.sortParam(a,t);break;default:throw new s(a,"暂未支持逻辑处理参数操作".concat(a.paramAction))}}setParamValue(t,e){const{dstFieldName:a,dstDEUILogicParamId:s}=t,i=a,n=mn(e,t);i?e.params[s][i]=n:e.params[s]=n}copyParam(t,e){const{dstDEUILogicParamId:a}=t,s=mn(e,t);e.params[a]=J(s)}bindParam(t,e){const a=mn(e,t);e.params[t.dstDEUILogicParamId]=a}resetParam(t,e){const{dstDEUILogicParamId:a}=t;e.resetParam(a)}renewParam(t,e){const{dstDEUILogicParamId:a}=t;e.renewParam(a)}appendParam(t,e){const{dstDEUILogicParamId:a,dstIndex:s,srcIndex:i,srcSize:n}=t,r=mn(e,t),o=s||0,c=i||0,l=n||r.length;e.params[a].splice(o,0,...r.slice(c,l))}sortParam(t,e){const{dstDEUILogicParamId:a,dstFieldName:s,dstSortDir:i}=t,n=s;e.params[a].sort(((t,e)=>"ASC"===i?t[n]-e[n]:e[n]-t[n]))}},gn=class extends ln{async exec(t){t.isEndNode=!0;const{invokeMethod:s,invokeCtrlId:i,invokeParamId:n}=this.model;if(!i)throw new a(this.model,"没有配置界面对象");if(!n)throw new a(this.model,"没有配置操作参数");if(!s)throw new a(this.model,"没有配置调用方法");const r=t.params[n];if(!r)throw new e("没有找到操作参数".concat(n));const o=t.params[i];if(!o)throw new e("没有找到界面对象".concat(i));if(!o[s]||!M(o[s]))throw new e("没有找到调用方法".concat(s));await o[s](r)}},wn=class extends ln{async exec(t){const{dstDEUILogicParamId:e,srcDEUILogicParamId:s}=this.model;if(!e||!s)throw new a(this.model,"缺少目标参数对象或者源参数对象配置");const i=mn(t,this.model);t.params[e]=i}},En=class extends ln{constructor(){super(...arguments),this.typeMap={INFO:"info",QUESTION:"success",WARNING:"warning",ERROR:"error"}}async exec(t){const{msgBoxType:e,buttonsType:i,msgBoxParamId:n}=this.model;if(!e)throw new a(this.model,"缺少消息类型的配置");if(!i)throw new a(this.model,"缺少按钮类型的配置");let{title:r}=this.model,{message:o}=this.model;if(n){const e=t.params[n];e.title&&(r=e.title),e.message&&(o=e.message)}const c={type:this.typeMap[e],title:r||"消息",desc:o};let l=[];switch(i){case"YESNO":c.confirmButtonText="是",c.cancelButtonText="否",c.showConfirmButton=!0,c.showCancelButton=!0,l=["yes","no"];break;case"OK":c.confirmButtonText="确定",c.showConfirmButton=!0,c.showCancelButton=!1,l=["ok"];break;case"OKCANCEL":c.confirmButtonText="确定",c.cancelButtonText="取消",c.showConfirmButton=!0,c.showCancelButton=!0,l=["ok","cancel"];break;default:throw new s(this.model,"".concat(i,"暂未支持"))}const h=await ibiz.modal.confirm(c);t.setLastReturn(l[h?0:1])}},vn=class extends ln{async exec(t){const{dstDEUILogicParamId:e,name:s}=this.model;if(!e)throw new a(this.model,"缺少目标参数对象配置");const i=t.params[e];console.log("逻辑节点".concat(s,"操作参数值:"),i)}},yn=class extends ln{async exec(t){const{dstDEUILogicParamId:e}=this.model;if(!e)throw new a(this.model,"缺少目标参数对象配置");t.resetParam(e)}},In=class extends ln{async exec(t){const{dstDEUILogicParamId:e,srcDEUILogicParamId:s}=this.model;if(!e||!s)throw new a(this.model,"缺少目标参数对象或者源参数对象配置");const i=mn(t,this.model);t.params[e]=J(i)}},Dn=class extends ln{async exec(t){const{dstDEUILogicParamId:e,srcDEUILogicParamId:s,dstIndex:i,srcIndex:n,srcSize:r}=this.model;if(!e||!s)throw new a(this.model,"缺少目标参数对象或者源参数对象配置");const o=mn(t,this.model),c=i||0,l=n||0,h=r||o.length;t.params[e].splice(c,0,...o.slice(l,h))}},Cn=class extends ln{async exec(t){const{dstDEUILogicParamId:e,dstSortDir:s,dstFieldName:i}=this.model;if(!e||!i)throw new a(this.model,"缺少目标参数对象或目标属性配置");const n=i;t.params[e].sort(((t,e)=>"ASC"===s?t[n]-e[n]:e[n]-t[n]))}},An=class extends ln{async exec(t){const{dstDEUILogicParamId:e}=this.model;if(!e)throw new a(this.model,"缺少目标参数对象配置");t.renewParam(e)}},bn=class extends ln{async exec(t){const{dstAppDEDataSetId:e,dstAppDataEntityId:a,dstDEUILogicParamId:s,retDEUILogicParamId:i}=this.model,n=t.params[s],r=ibiz.hub.getApp(t.context.srfappid),o=await r.deService.exec(a,e,t.context,n,t.viewParams);o.ok&&(t.params[i]=o.data)}},Pn=class extends ln{async exec(t){const{errorInfo:a}=this.model;throw new e(a)}},_n=class extends ln{async exec(t){t.isEndNode=!0;const{eventName:s,eventParamId:i,fireCtrlId:n}=this.model;if(!n)throw new a(this.model,"没有配置触发对象");if(!s)throw new a(this.model,"没有配置事件名称参数");if(!i)throw new a(this.model,"没有配置事件参数");const r=t.params[n];if(!r)throw new e("没有找到触发对象".concat(n));const o=t.params[i];if(!o)throw new e("没有找到事件参数对象".concat(i));await r.evt.emit(s,o)}},Sn=class extends ln{async exec(t){const{dstAppDELogicId:s,dstAppDataEntityId:i,dstDEUILogicParamId:n,retDEUILogicParamId:r}=this.model;if(!i)throw new a(this.model,"没有配置实体");if(!s)throw new a(this.model,"没有配置实体逻辑");if(!n)throw new a(this.model,"没有配置传入逻辑参数");const o=t.params[n];if(!o)throw new e("没有找到传入参数".concat(n));const c=await ni(s,i,o.context,o.data,o.params);r&&(t.params[r]=c)}},xn=class{constructor(t){var e;if(this.model=t,this.nodes=new Map,this.params=new Map,!(null==(e=t.deuilogicNodes)?void 0:e.length))throw new a(t,"界面逻辑没有配置逻辑节点");t.deuilogicNodes.forEach((t=>{const{logicNodeType:e}=t;let a;switch(e){case"BEGIN":a=new un(t);break;case"END":a=new pn(t);break;case"DEACTION":a=new hn(t);break;case"DEUIACTION":a=new dn(t);break;case"PREPAREJSPARAM":a=new fn(t);break;case"RESETPARAM":a=new yn(t);break;case"COPYPARAM":a=new In(t);break;case"BINDPARAM":a=new wn(t);break;case"VIEWCTRLINVOKE":a=new gn(t);break;case"MSGBOX":a=new En(t);break;case"DEBUGPARAM":a=new vn(t);break;case"APPENDPARAM":a=new Dn(t);break;case"SORTPARAM":a=new Cn(t);break;case"RENEWPARAM":a=new An(t);break;case"DEDATASET":a=new bn(t);break;case"THROWEXCEPTION":a=new Pn(t);break;case"VIEWCTRLFIREEVENT":a=new _n(t);break;case"DELOGIC":a=new Sn(t);break;default:throw new s(t,"未支持的逻辑节点类型: ".concat(e))}this.nodes.set(t.id,a)})),t.deuilogicParams.forEach((t=>{this.params.set(t.id,new class{constructor(t){this.model=t}calc(t){const e=this.model.id,a=this.model,{context:i,viewParams:n,data:r,parameters:o}=t,c=ibiz.hub.getApp(i.srfappid);if(a.default)t.params[e]=r&&r.length>0?r[0]:{};else if(a.activeContainerParam)t.params[e]=o.ctrl||o.view;else if(a.activeCtrlParam)t.params[e]=o.ctrl;else if(a.ctrlParam){const s=o.view.getController(a.codeName.toLowerCase());s?t.params[e]=s:ibiz.log.error("视图逻辑初始化参数,未找到".concat(a.codeName,"指定部件对象"))}else if(a.activeViewParam)t.params[e]=o.view;else if(a.appGlobalParam)t.params[e]=ibiz.env;else if(a.applicationParam)t.params[e]=c;else if(a.entityListParam)t.params[e]=[];else{if(a.entityPageParam)throw new s(a,"未支持的逻辑参数类型: 分页查询结果");if(a.entityParam)t.params[e]={};else if(a.lastReturnParam)t.initLastReturnParam(e);else if(a.navContextParam)t.params[e]=i;else{if(a.navViewParamParam)throw new s(a,"未支持的逻辑参数类型: 视图路由参数");if(a.routeViewSessionParam)throw new s(a,"未支持的逻辑参数类型: 路由视图会话");if(a.simpleListParam)t.params[e]=[];else if(a.simpleParam)t.params[e]={};else if(a.viewNavDataParam)t.params[e]=n;else if(a.viewSessionParam)throw new s(a,"未支持的逻辑参数类型: 当前视图会话")}}}renew(t){const e=this.model.id,a=this.model;if(a.entityListParam||a.simpleListParam||a.entityPageParam)t.params[e]=[];else{if(!a.simpleParam&&!a.entityParam)throw new s(a,"未支持的逻辑参数类型重新建立变量");t.params[e]={}}}}(t))})),this.nodes.forEach((t=>{t.links.forEach((e=>{e.srcNode=t,this.nodes.has(e.model.dstDEUILogicNodeId)&&(e.dstNode=this.nodes.get(e.model.dstDEUILogicNodeId))}))}))}initLogicParams(t){this.params.forEach((e=>{e.model.default&&(t.defaultParamName=e.model.id),e.calc(t)}))}async exec(t){const e=new class{constructor(t,e){this.deLogicParams=t,this.parameters=e,this.params={},this.result=null,this.isEndNode=!1,this.defaultParamName="Default"}get context(){return this.parameters.context}get data(){return this.parameters.data}get viewParams(){return this.parameters.params}resetParam(t){var e;null==(e=this.deLogicParams.get(t))||e.calc(this)}renewParam(t){var e;null==(e=this.deLogicParams.get(t))||e.renew(this)}setLastReturn(t){this.lastReturn=t}initLastReturnParam(t){Object.defineProperty(this.params,t,{enumerable:!0,configurable:!0,get:()=>this.lastReturn})}}(this.params,t);this.initLogicParams(e);const{startDEUILogicNodeId:s}=this.model;if(!s||!this.nodes.has(s))throw new a(this.model,"未设置起始节点");{const t=this.nodes.get(s);await this.deepExec(t,e)}return e.isEndNode?e.result:e.params[e.defaultParamName]?e.params[e.defaultParamName]:null}async deepExec(t,e){await t.exec(e);const{links:a}=t;for(let s=0;s<a.length;s++){const i=a[s];if(await i.exec(e)&&i.dstNode&&(await this.deepExec(i.dstNode,e),!1===t.model.parallelOutput))break}}},Tn=new Map;async function Ln(t,a,s){const i=ibiz.hub.getApp(s.context.srfappid),n=await i.getDEUILogic(t,a);if(!n)throw new e("找不到实体".concat(a,"的界面逻辑").concat(t));Tn.has(n)||Tn.set(n,new xn(n));const r=Tn.get(n);return await r.exec(s),null}var Nn=t("UIActionUtil",class{static async exec(t,a){const s=await $e(t);if(!s)throw new e("没找到".concat(t,"的界面行为模型"));return(await ls(s)).exec(s,a)}static async execAndResolved(t,e){var a,s;const i=await this.exec(t,e);if(i.closeView)e.view.modal.ignoreDismissCheck=!0,e.view.closeView({ok:!0});else if(i.refresh)switch(i.refreshMode){case 1:await e.view.callUIAction("Refresh");break;case 2:await(null==(a=e.view.parentView)?void 0:a.callUIAction("Refresh"));break;case 3:await(null==(s=e.view.getTopView())?void 0:s.callUIAction("Refresh"))}}}),On=class{async exec(t,e){const{context:s,params:i,data:n}=e,r={refresh:t.reloadData,refreshMode:t.refreshMode,closeView:t.closeEditView},{appDEUILogicId:o,appDataEntityId:c,uilogicAttachMode:l}=t;if("REPLACE"===l){if(!o)throw new a(t,"没有配置实体界面逻辑");return await Ln(o,c,e),r}if(!await this.isConfirm(t))return this.returnError(r);const h=await this.execAction(t,e);if(Object.assign(r,h),!0===r.cancel)return this.returnError(r);const d=await this.doNextAction(t,{...e,context:r.nextContext||s,data:r.data||n,params:r.nextParams||i});if(d&&(Object.assign(r,d),!0===d.cancel))return this.returnError(r);if("AFTER"===t.uilogicAttachMode){if(!o)throw new a(t,"没有配置实体界面逻辑");await Ln(o,c,e)}return r}returnError(t){return Object.assign(t,{refresh:!1,closeView:!1})}async isConfirm(t){return!t.enableConfirm||!t.confirmMsg||ibiz.modal.confirm({title:t.confirmMsg})}async doNextAction(t,e){const a=t.nextId;if(a)return Nn.exec(a,e)}async handleParams(t,e,a,s){let i=[];const n=ze(t.appDataEntityId);switch(t.actionTarget){case"NONE":i=[];break;case"SINGLEDATA":i=[a[0]];break;case"MULTIDATA":i=a;break;case"MULTIKEY":i=n&&a.length>0?a.map((t=>({[n]:t.srfkey||t[n]}))):[{}];break;case"SINGLEKEY":{const t=a[0]||{};i=n?[{[n]:t.srfkey||t[n]}]:[{}]}}const r=e.clone(),o=[...t.navigateContexts||[]];if(n&&"NONE"!==t.actionTarget){const{valueItem:e,paramItem:a}=t,s=a||n,i=e||"srfkey";o.unshift({key:s,value:i,rawValue:!1})}const c=["MULTIKEY","MULTIDATA"].includes(t.actionTarget)&&a.length>0,l=Le(o,e,s,c?Me(o,a):a[0]||{});Object.assign(r,l);const h=t.navigateParams;return{resultContext:r,resultData:i,resultParams:Le(h,r,s,c?Me(h,a):a[0]||{})}}},Rn=t("BackendUIActionProvider",class extends On{async execAction(t,e){const{context:s,params:i,data:n,event:r}=e,o={},c=t.appDataEntityId,l=t.appDEMethodId;if(!c||!l)throw new a(t,"未配置实体或实体行为");const{resultContext:h,resultParams:d,resultData:u}=await this.handleParams(t,s,n,i),p={...d},m=t.frontAppViewId;if(m){const t=await ibiz.commands.execute(Na.TAG,m,h,d,{event:r});if(!(null==t?void 0:t.ok))return o.cancel=!0,o;(null==t?void 0:t.ok)&&t.data&&(0===u.length&&u.push({}),u.forEach((e=>{e.srfactionparam=t.data})))}const f=ibiz.hub.getApp(null==s?void 0:s.srfappid),g=u.map((t=>{var e;return(null==(e=t.getOrigin)?void 0:e.call(t))||t||{}})).map((t=>Object.assign(t,p))),w=["MULTIKEY","MULTIDATA"].includes(t.actionTarget),E=await f.deService.exec(c,l,h,w?g:g[0],p);return E.ok&&t.successMsg&&ibiz.message.success(t.successMsg),Object.assign(o,{data:U(E.data)?E.data:[E.data],nextContext:h,nextParams:p}),o}}),Mn=t("SysUIActionProvider",class extends On{constructor(){super(...arguments),this.predefinedActionMap=new Map([["EDITVIEW_EXITACTION","Exit"],["EDITVIEW_SAVEANDEXITACTION","SaveAndExit"],["TREEVIEW_REFRESHPARENTACTION","RefreshParent"],["GRIDVIEW_EXPORTXMLACTION","ExportModel"],["GRIDVIEW_EXPORTACTION","ExportExcel"],["EDITVIEW_REMOVEANDEXITACTION","RemoveAndExit"],["GRIDVIEW_PRINTACTION","Print"],["EDITVIEW_NEXTRECORDACTION","NextRecord"],["GRIDVIEW_NEWROWACTION","NewRow"],["EDITVIEW_LASTRECORDACTION","LastRecord"],["EDITVIEW_PREVRECORDACTION","PrevRecord"],["GRIDVIEW_SEARCHBAR","ToggleFilter"],["EDITVIEW_SAVEANDSTARTWFACTION","SaveAndStart"],["EDITVIEW_NEWACTION","New"],["EDITVIEW_PRINTACTION","Print"],["EDITVIEW_COPYACTION","Copy"],["EDITVIEW_HELPACTION","Help"],["EDITVIEW_FIRSTRECORDACTION","FirstRecord"],["GRIDVIEW_REFRESHACTION","Refresh"],["EDITVIEW_SAVEANDNEWACTION","SaveAndNew"],["EDITVIEW_VIEWWFSTEPACTORACTION","ViewWFStep"],["EDITVIEW_SAVEACTION","Save"],["TREEVIEW_REFRESHALLACTION","RefreshAll"],["GRIDVIEW_IMPORTBAR","Import"],["GRIDVIEW_ROWEDITACTION","ToggleRowEdit"],["GRIDVIEW_NEWACTION","New"],["GRIDVIEW_EDITACTION","Edit"],["GRIDVIEW_HELPACTION","Help"],["EDITVIEW_REFRESHACTION","Refresh"],["GRIDVIEW_REMOVEACTION","Remove"],["GRIDVIEW_COPYACTION","Copy"],["GRIDVIEW_VIEWACTION","View"],["GRIDVIEW_SAVEROWACTION","SaveRow"],["APP_LOGIN","login"],["APP_LOGOUT","logout"]])}async execAction(t,e){const{view:a}=e,s=this.predefinedActionMap.get(t.predefinedType)||t.uiactionTag;if("Exit"===s)return{closeView:!0};return await a.callUIAction(s,e)||{}}}),kn=t("FrontUIActionProvider",class extends On{async execAction(t,e){const{context:i,params:n,data:r,event:o,noWaitRoute:c}=e;let l={};switch(t.frontProcessType){case"OPENHTMLPAGE":{const e=m.fill(t.htmlPageUrl,i,null==r?void 0:r[0]);window.open(e,"_blank");break}case"TOP":case"WIZARD":{const e=t.frontAppViewId;if(!e)throw new a(t,"未配置打开视图");const{resultContext:s,resultParams:h}=await this.handleParams(t,i,r,n),d=await ibiz.commands.execute(Na.TAG,e,s,h,{event:o,noWaitRoute:c});(null==d?void 0:d.ok)||(l.cancel=!0),(null==d?void 0:d.ok)&&d.data&&(l.data=d.data,l.nextContext=s,l.nextParams={...n,...h});break}case"OTHER":l=this.doOther(t,e);break;default:throw new s(t,"未支持的前台处理模式[".concat(t.frontProcessType,"]"))}return l}doOther(t,e){const{scriptCode:s}=t,{context:i,params:n,data:r,event:o}=e;if(s){return pa.execScriptFn({context:i,params:n,data:r,el:null==o?void 0:o.target},s)||{}}throw new a(t,"自定义类型缺少配置脚本代码")}}),Vn=t("WFWithdrawUIActionProvider",class extends On{async execAction(t,e){const{view:a}=e;let s=!1;return await ibiz.modal.confirm({title:"提示",desc:"是否确认执行撤回操作?"})&&a&&(await a.call("WFWithdraw",e),s=!0),{refresh:!1,closeView:s}}});function Fn(){const t=new kn;os("FRONT",(()=>t));const e=new Rn;os("BACKEND",(()=>e));const a=new Mn;os("SYS",(()=>a));const s=new Vn;os("DEUIACTION_WFWithdraw",(()=>s))}var Wn=t("ToolbarController",class extends Hi{get _evt(){return this.evt}initState(){super.initState(),this.state.buttonsState=new Ri,this.state.viewMode="EMBED",this.state.extraButtons={}}async doUIAction(t,e,a={}){if("DEUIACTION"===t.itemType){const s=t.uiactionId,i=await this.ctx.view.call("GetData")||[],n=this.getEventArgs();n.params=Object.assign(a,n.params),await Nn.execAndResolved(s,{...n,data:i,event:e})}}async onCreated(){await super.onCreated(),this.state.viewMode=this.ctx.view.modal.mode,f(this.model,(t=>{if("DEUIACTION"===t.itemType){const e=t,a=new Oi(e.id,this.context.srfappid,e.uiactionId);this.state.buttonsState.addState(e.id,a)}}),{childrenFields:["detoolbarItems"]}),await this.state.buttonsState.update()}async onItemClick(t,e,a){this.state.buttonsState.setLoading(t.id);const s="extra"===t.buttonType;try{await this._evt.emit("onClick",{event:e,eventArg:t.id,buttonType:s?"extra":"deuiaction"}),s||await this.doUIAction(t,e,a)}finally{this.state.buttonsState.setLoading("")}}async calcButtonState(t,e){let a=t;t&&t instanceof di&&(a=t.getOrigin()),await this.state.buttonsState.update(a,e),this.scheduler&&a&&f(this.model,(t=>{const e=this.state.buttonsState[t.id];if(e.visible){const s=this.scheduler.triggerItemVisible(t.id,{data:[a]});void 0!==s&&(e.visible=s)}if(!e.disabled){const s=this.scheduler.triggerItemEnable(t.id,{data:[a]});void 0!==s&&(e.disabled=!s)}}),{childrenFields:["detoolbarItems"]})}setExtraButtons(t,e){this.state.extraButtons[t]||(this.state.extraButtons[t]=[]),this.state.extraButtons[t].push(...e)}clearExtraButtons(t){void 0===t?this.state.extraButtons={}:this.state.extraButtons[t]=[]}initControlScheduler(t=[]){const e=[...t];f(this.model,(t=>{t.controlLogics&&e.push(...t.controlLogics)}),{childrenFields:["detoolbarItems"]}),super.initControlScheduler(e)}}),Bn=t("ContextMenuController",class extends Wn{}),Un=(t("DashboardController",class extends Hi{constructor(){super(...arguments),this.providers={},this.portlets={}}initState(){super.initState()}async onCreated(){await super.onCreated(),await this.initPortlets(this.model.controls);const{appDataEntityId:t}=this.view.model;t&&this.view.evt.on("onDataChange",(t=>{const e=Fi(t.data);e&&this.dataChangeNotify(e)}))}async initPortlets(t,e){(null==t?void 0:t.length)&&await Promise.all(t.map((async t=>{var a;const s=await ms(t);if(s){this.providers[t.id]=s;const i=await s.createController(t,this,e);this.portlets[t.id]=i,(null==(a=t.controls)?void 0:a.length)&&await this.initPortlets(t.controls,i)}})))}async dataChangeNotify(t){const e=await Promise.allSettled(Object.values(this.portlets).map((async e=>e.dataChangeNotify(t)))),a=e.find((t=>"rejected"===t.status));if(a)throw ibiz.log.error("dataChangeNotify报错",e),a.reason}}),t("PortletPartState",class{constructor(){this.visible=!0,this.keepAlive=!1,this.layout={width:"",height:"",extraStyle:{},extraClass:[],contentStyle:{}},this.class={container:[],containerDyna:[]},this.actionGroupState=null}})),jn=t("PortletPartController",class{get context(){return this.dashboard.context}get params(){return this.dashboard.params}get containerClass(){return[...this.state.class.container,...this.state.class.containerDyna]}constructor(t,e,a){this.model=t,this.dashboard=e,this.parent=a,this.state=this.createState()}async init(){await this.onInit()}async onInit(){const{layoutPos:t,sysCss:e}=this.model;if(t){const{width:t,height:e}=We(this.model);this.state.layout.width="".concat(t),this.state.layout.height="".concat(e)}(null==e?void 0:e.cssName)&&this.state.class.container.push(e.cssName),await this.initActionStates()}createState(){return new Un}async initActionStates(){var t;const{uiactionGroup:e}=this.model;if(!(null==(t=null==e?void 0:e.uiactionGroupDetails)?void 0:t.length))return;const a=new Ri;e.uiactionGroupDetails.forEach((t=>{const e=t.uiactionId;if(e){const s=new Oi(t.id,this.dashboard.context.srfappid,e);a.addState(t.id,s)}})),await a.update(),this.state.actionGroupState=a;const{appDataEntityId:s}=this.dashboard.view.model;s&&this.dashboard.view.evt.on("onDataChange",(t=>{let e=t.data[0];e&&e instanceof di&&(e=e.getOrigin()),e&&this.state.actionGroupState.update(e,s)}))}async onActionClick(t,e,a=[]){const s=t.uiactionId;await Nn.execAndResolved(s,{context:this.dashboard.context,params:this.dashboard.params,data:a,view:this.dashboard.view,event:e})}async dataChangeNotify(t){if(this.state.actionGroupState){const{appDataEntityId:e}=this.dashboard.view.model;this.state.actionGroupState.update(t,e)}this.calcDynaClass(t)}calcDynaClass(t){if(this.model.dynaClass){const e=Be(this.model.dynaClass,t);e.length&&(this.state.class.containerDyna=e)}}}),zn=(t("ContainerPortletController",class extends jn{}),t("ViewPortletController",class extends jn{}),t("DataViewControlService",class extends pi{initUIDataMap(){var t;super.initUIDataMap(),null==(t=this.model.dedataViewDataItems)||t.forEach((t=>{const e=t.id.toLowerCase(),a=t.appDEFieldId;let s;if(a){const i=a.toLowerCase();s=new Ii(e,i,{isOriginField:!0,dataType:t.dataType})}else s=new Ii(e,e);this.dataUIMap.set(e,s)}))}})),Gn=t("DataViewControlController",class extends Xi{initState(){super.initState(),this.state.noSort=!0===this.model.noSort,this.state.size=this.model.pagingSize||20}async onCreated(){await super.onCreated(),await this.initControlService()}async initControlService(){this.service=new zn(this.model),await this.service.init(this.context)}async loadMore(){this.state.total>this.state.items.length&&await this.load({isLoadMore:!0})}async afterLoad(t,e){return await this.handleDataGroup(),e}getOptItemModel(){let t=null;const{dedataViewItems:e}=this.model;if(e)for(let a=0;a<e.length;a++)"ACTIONITEM"===e[a].itemType&&(t=e[a]);return t}getOptItemAction(t){var e;const s=new Ri,i=this.getOptItemModel();if(i){if(!i.deuiactionGroup)throw new a(this.model,"操作项没有配置界面行为组");if(!(null==(e=i.deuiactionGroup.uiactionGroupDetails)?void 0:e.length))return ibiz.log.debug("操作项界面行为组没有配置界面行为"),s;i.deuiactionGroup.uiactionGroupDetails.forEach((t=>{const e=t.uiactionId;if(e){const a=new Oi(t.id,this.context.srfappid,e);s.addState(t.id,a)}})),s.update(t.getOrigin())}return s}async onActionClick(t,e,a){const s=t.uiactionId;await Nn.execAndResolved(s,{context:this.context,params:this.params,data:[e],view:this.view,event:a})}async handleDataGroup(){const{enableGroup:t,groupMode:e,groupAppDEFieldId:s}=this.model;if(t&&e){if(!s)throw new a(this.model,"分组属性没有配置");"AUTO"===e?this.handleAutoGroup():"CODELIST"===e&&await this.handleCodeListGroup()}}handleAutoGroup(){const{groupAppDEFieldId:t}=this.model;if(t){const{items:e}=this.state,a=new Map;e.forEach((e=>{const s=e[t];$(s)||(a.has(s)||a.set(s,[]),a.get(s).push(e))}));const s=[];a.forEach(((t,e)=>{s.push({caption:e,key:e,children:[...t]})})),this.state.groups=s}}async initGroupCodeListItems(){const{groupCodeListId:t}=this.model;if(!t)throw new a(this.model,"分组代码表没有配置");const e=ibiz.hub.getApp(this.context.srfappid);this.groupCodeListItems=await e.codeList.get(t,this.context,this.params)}async handleCodeListGroup(){const{groupAppDEFieldId:t}=this.model;this.groupCodeListItems||await this.initGroupCodeListItems();const{items:e}=this.state,a=new Map;this.groupCodeListItems.forEach((t=>{a.set(t.value,[])})),e.forEach((e=>{const s=e[t],i=a.get(s);i&&i.push(e)}));const s=[];a.forEach(((t,e)=>{const a=this.groupCodeListItems.find((t=>t.value===e));s.push({caption:a.text,key:a.value,children:t})})),this.state.groups=s}setSort(t,e){if(t&&e)super.setSort(t,e);else{const{minorSortAppDEFieldId:t,minorSortDir:e}=this.model;if(t&&e){const a=this.fieldIdNameMap.get(t);this.state.sortQuery="".concat(a.toLowerCase(),",").concat(e.toLowerCase())}else this.state.sortQuery=""}}}),Hn=t("ExpBarControlController",class extends Hi{constructor(){super(...arguments),this.navKeyName="srfkey"}get _evt(){return this.evt}get routeDepth(){return this.view.modal.routeDepth}initState(){super.initState(),this.state.query=""}load(){return this.xDataController.load({isInitialLoad:!0})}get xDataController(){const t=this.view.getController(this.model.xdataControlName);if(!t)throw new a(this.model,"无法获取多数据部件[".concat(this.model.xdataControlName,"]控制器"));return t}get toolbarController(){return this.view.getController("".concat(this.model.xdataControlName.split("_")[0],"_toolbar"))}get XDataModel(){var t;return null==(t=this.model.controls)?void 0:t.find((t=>t.name===this.model.xdataControlName))}async onCreated(){var t;await super.onCreated(),this.childNames.push(this.model.xdataControlName);const e=await ibiz.hub.getAppDataEntity(this.model.appDataEntityId,this.context.srfappid);if(e){const a=null==(t=e.appDEFields)?void 0:t.filter((t=>t.enableQuickSearch)),s=[];null==a||a.forEach((t=>{(null==t?void 0:t.lnlanguageRes)&&t.lnlanguageRes.lanResTag?s.push(ibiz.i18n.t(t.lnlanguageRes.lanResTag,t.logicName)):(null==t?void 0:t.logicName)&&s.push(t.logicName)})),s.length>0&&(this.state.placeHolder=s.join("、"))}}async onMounted(){super.onMounted(),this.xDataController&&(this.xDataController.evt.on("onActive",(t=>{this.xDataActive(t)})),this.xDataController.evt.on("onLoadSuccess",(t=>{this.xDataLoadSuccess(t)})),this.xDataController.evt.on("onRemoveSuccess",(()=>{this.defaultNavByFirstItem()}))),this.toolbarController&&this.xDataController.evt.on("onSelectionChange",(async t=>{this.toolbarController.calcButtonState(t.data[0],this.model.appDataEntityId)}))}xDataLoadSuccess(t){t.isInitialLoad&&(this.state.srfnav&&this.routeDepth?this.defaultNavBySrfnav():this.defaultNavByFirstItem())}defaultNavBySrfnav(){var t;const e=null==(t=this.xDataController)?void 0:t.state.items.find((t=>t[this.navKeyName]===this.state.srfnav));e&&this.xDataController.setSelection([e]),this._evt.emit("onNavViewChange",{navViewMsg:{key:this.state.srfnav},context:this.context})}defaultNavByFirstItem(){const t=this.xDataController.state.items[0];t?(this.xDataController.setActive(t),this.xDataController.setSelection([t])):this._evt.emit("onNavViewChange",{navViewMsg:{key:""}})}xDataActive(t){const{data:e,context:a,params:s}=t,i=this.getNavViewMsg(e[0],a,s);this._evt.emit("onNavViewChange",{navViewMsg:i})}prepareParams(t,e,a,s){const{navDER:i,navFilter:n,navigateContexts:r,navigateParams:o,appDataEntityId:c}=t,l={deName:c?ze(c):void 0,navFilter:n,pickupDEFName:null==i?void 0:i.pickupDEFName,navContexts:r,navParams:o},h={context:a,params:s,data:e},{resultContext:d,resultParams:u}=ke(l,h);return{context:Object.assign(a.clone(),d,{currentSrfNav:e[this.navKeyName]}),params:{...u}}}calcViewModelId(){var t;if(["GRID","DATAVIEW","LIST"].includes((null==(t=this.XDataModel)?void 0:t.controlType)||""))return this.XDataModel.navAppViewId;throw new e("多节点视图由子类实现")}getNavViewMsg(t,e,a){const s=this.calcViewModelId(),i=this.prepareParams(this.XDataModel,t,e,a);return{key:t[this.navKeyName],context:i.context,params:i.params,viewId:s}}calcControlHeaderVisible(){const t=!!this.toolbarController;if(!t&&this.layoutPanel){const t=this.layoutPanel.panelItems.control_toolbar;t&&(t.state.visible=!1)}return t||!(!this.model.showTitleBar||!this.model.title)||!!this.model.enableSearch}setLayoutPanel(t){super.setLayoutPanel(t),t.evt.on("onMounted",(()=>{if(!this.calcControlHeaderVisible()){const t=this.layoutPanel.panelItems.control_header;t&&(t.state.visible=!1)}}))}}),Xn=(t("CalendarExpBarController",class extends Hn{constructor(){super(...arguments),this.navKeyName="navId"}getCalendarItemModel(t){const{sysCalendarItems:e}=this.XDataModel;if(e)return e.find((e=>e.itemType===t))}get xDataController(){const t=this.view.getController(this.model.xdataControlName);if(!t)throw new a(this.model,"无法获取多数据部件[".concat(this.model.xdataControlName,"]控制器"));return t}defaultNavBySrfnav(){var t;const e=null==(t=this.xDataController)?void 0:t.state.items.find((t=>t.navId===this.state.srfnav));if(super.defaultNavBySrfnav(),!e)return;const a=new Date(e.beginTime);this.xDataController.setSelectDate(a)}getNavViewMsg(t){const e=this.getCalendarItemModel(t.itemType);if(e){const{context:a,params:s}=this.prepareParams(e,t.deData?t.deData:t,this.context,this.params);return a.currentSrfNav=t.navId,{key:t.navId,context:a,params:s,viewId:e.navAppViewId}}return{key:t.navId,context:this.context,params:this.params}}}),t("TreeExpBarController",class extends Hn{constructor(){super(...arguments),this.navKeyName="id",this.navNodeModelIds=[]}get xDataController(){const t=this.view.getController(this.model.xdataControlName);if(!t)throw new a(this.model,"无法获取多数据部件[".concat(this.model.xdataControlName,"]控制器"));return t}getNodeModel(t){const{detreeNodes:e}=this.XDataModel;let a;return e&&e.forEach((e=>{e.id===t&&(a=e)})),a}xDataActive(t){const{nodeData:e}=t;super.xDataActive({...t,data:[e]})}getNavViewMsg(t,a,s){const i=t.id,n=t.deData||t,r=this.getNodeModel(t.nodeId);if(!r)throw new e("找不到".concat(t.nodeId,"的节点模型"));const o=this.prepareParams(r,n,a,s);return o.context.currentSrfNav=i,{key:i,viewId:r.navAppViewId,...o}}defaultNavByFirstItem(){const t=this.xDataController.state.items.find((t=>!(!this.xDataController.model.rootVisible&&this.xDataController.state.rootNodes.includes(t))&&(!!this.state.noNeedNavView||this.navNodeModelIds.includes(t.nodeId))));t&&(this.xDataController.setActive(t),this.xDataController.setSelection([t]))}async onCreated(){await super.onCreated();const{detreeNodes:t}=this.XDataModel;if(null==t||t.forEach((t=>{t.navAppViewId&&this.navNodeModelIds.push(t.id)})),this.state.srfnav){const t=[];this.state.srfnav.split(":").forEach(((e,a)=>{0===a?t.push(e):t.push("".concat(t[a-1],":").concat(e))})),t.pop(),this.defaultExpandedKeys=t}}}),t("FormController",class extends Hi{constructor(){super(...arguments),this.details={},this.providers={},this.formItems=[]}get _evt(){return this.evt}get data(){return this.state.data}initState(){super.initState(),this.state.data=new di,this.state.isLoaded=!1,this.state.processing=!1,this.state.modified=!1}async dataChangeNotify(t){const e=await Promise.allSettled(Object.values(this.details).map((async e=>e.dataChangeNotify(t)))),a=e.find((t=>"rejected"===t.status));if(a)throw ibiz.log.error("dataChangeNotify报错",e),a.reason}formStateNotify(t){Object.values(this.details).forEach((e=>{e.formStateNotify(t)}))}async onCreated(){await super.onCreated(),await this.initDetailControllers(),this.dataChangeNotify=g(this.dataChangeNotify.bind(this),((t,e)=>[Array.from(new Set([...t[0],...e[0]]))]),200)}async getDraftParams(){const t={};return await Promise.all(this.formItems.map((e=>e.setDefaultValue(!0,t)))),t}async initDetailControllers(t=this.model.deformPages,e=this,a=void 0){await Promise.all(t.map((async t=>{const s=await Za(t);if(!s)return;e.providers[t.id]=s;const i=await s.createController(t,e,a);e.details[t.id]=i,"FORMITEM"!==t.detailType&&"MDCTRL"!==t.detailType||e.formItems.push(i);const n=ta(t);n.length&&await this.initDetailControllers(n,e,i)})))}getData(){return[this.state.data]}async setDataValue(t,e){if(!Object.prototype.hasOwnProperty.call(this.state.data,t)||Vi(this.state.data[t],e)){this.state.data[t]=e,this.state.processing=!0,this.state.modified=!0,await this._evt.emit("onFormDataChange",void 0);try{await this.dataChangeNotify([t])}finally{this.state.processing=!1}}}async validate(){return-1===(await Promise.all(this.formItems.map((t=>t.validate())))).findIndex((t=>!t))}actionNotification(t,e){super.actionNotification(t,{data:this.data,...e||{}})}})),Kn=t("SearchFormService",class extends ui{async getDraft(t,e={}){let a={ok:!0,status:200,data:{...e}};return a=this.handleResponse(a),a}initUIDataMap(){f(this.model,(t=>{if("FORMITEM"===t.detailType){const e=t.id.toLowerCase();this.dataUIMap.set(e,new Ii(e,e))}}),{childrenFields:["deformPages","deformDetails"]})}handleResponse(t){const e=super.handleResponse(t);return e.ok&&e.data&&(e.data=this.toUIData(e.data)),e}}),Yn=(t("SearchFormController",class extends Xn{async onCreated(){await super.onCreated(),this.service=new Kn(this.model),await this.service.init(this.context),await this.load()}async load(){const t={...this.params},e=await this.getDraftParams();let a;Object.assign(t,e),await this.evt.emit("onBeforeLoadDraft",{params:t});try{a=await this.service.getDraft(this.context,t)}catch(t){throw this.actionNotification("GETDRAFTERROR",{error:t}),t}return this.state.data=a.data,w(this.data,e),this.state.isLoaded=!0,this.formStateNotify("DRAFT"),this.actionNotification("GETDRAFTSUCCESS"),this.data}getParams(){return{...this.data.getOrigin()}}async search(){await this.evt.emit("onSearch",void 0)}async onSearchButtonClick(){await this.search()}async reset(){await this.load(),await this.search()}async dataChangeNotify(t){await super.dataChangeNotify(t),this.model.enableAutoSearch&&this.search()}async onKeyUp(t){const e=t||window.event;e&&"Enter"===e.code&&await this.onSearchButtonClick()}}),t("FormDetailState",class{constructor(t){this.parent=t,this.disabled=!1,this.layout={width:"",height:"",extraStyle:{},extraClass:[],contentStyle:{}},this.class={container:[],containerDyna:[],label:[],labelDyna:[]},this.required=!1,this.showMoreMode=0;let e,a=!0;Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,get(){if(this.parent){if(!1===this.parent.visible)return!1;if(1===this.showMoreMode&&!1===this.parent.isShowMore)return!1}return a},set:t=>(a=t,!0)}),Object.defineProperty(this,"keepAlive",{enumerable:!0,configurable:!0,get(){return void 0!==e?e:!!this.parent&&this.parent.keepAlive},set:t=>(e=t,!0)})}})),$n=t("FormDetailController",class{get data(){return this.form.data}get containerClass(){return[...this.state.class.container,...this.state.class.containerDyna]}get labelClass(){return[...this.state.class.label,...this.state.class.labelDyna]}constructor(t,e,a){this.model=t,this.form=e,this.parent=a,this.state=this.createState()}async init(){await this.onInit()}async onInit(){this.state.showMoreMode=this.model.showMoreMode;const{layoutPos:t,sysCss:e,labelSysCss:a}=this.model;if(t){const{width:e,height:a}=We(t);this.state.layout.width="".concat(e),this.state.layout.height="".concat(a)}(null==e?void 0:e.cssName)&&this.state.class.container.push(e.cssName),(null==a?void 0:a.cssName)&&this.state.class.label.push(a.cssName)}createState(){var t;return new Yn(null==(t=this.parent)?void 0:t.state)}async dataChangeNotify(t){this.calcDynamicLogic(t),this.calcDynaClass(this.data)}async formStateNotify(t){this.calcDynamicLogic([],t),this.calcDynaClass(this.data)}calcDynamicLogic(t,e){var a;this.parent&&!this.parent.state.visible||null==(a=this.model.defdgroupLogics)||a.forEach((a=>{const s=a.relatedDetailNames||[];if(e||E(s,t))try{const t=ga(this.form.data,a);switch(a.logicCat){case"ITEMBLANK":this.state.required=!t;break;case"ITEMENABLE":this.state.disabled=!t;break;case"PANELVISIBLE":this.state.visible=t}}catch(t){ibiz.log.error(t)}}))}force(t){}calcDynaClass(t){if(this.model.dynaClass){const e=Be(this.model.dynaClass,t);e.length&&(this.state.class.containerDyna=e)}if(this.model.labelDynaClass){const e=Be(this.model.labelDynaClass,t);e.length&&(this.state.class.labelDyna=e)}}}),qn=t("FormButtonState",class extends Yn{constructor(){super(...arguments),this.loading=!1}}),Qn=(t("FormButtonController",class extends $n{createState(){var t;return new qn(null==(t=this.parent)?void 0:t.state)}get data(){return this.form.data}async onClick(t){this.state.loading=!0;try{"UIACTION"===this.model.actionType&&await this.doUIAction(t),await this.doFormItemUpdate()}finally{this.state.loading=!1}}async doUIAction(t){const e=this.model.uiactionId;await Nn.execAndResolved(e,{context:this.form.context,params:this.form.params,data:[this.data],view:this.form.view,event:t,noWaitRoute:!0})}async doFormItemUpdate(){this.model.deformItemUpdateId&&await this.form.updateFormItem(this.model.deformItemUpdateId)}}),t("FormDruipartState",class extends Yn{constructor(){super(...arguments),this.showMask=!1}})),Jn=(t("FormDRUIPartController",class extends $n{constructor(){super(...arguments),this.refreshItems=["srfkey"],this.paramItem="srfkey",this.isNewData=!1}createState(){var t;return new Qn(null==(t=this.parent)?void 0:t.state)}async onInit(){if(await super.onInit(),Object.assign(this.state.layout.extraStyle,{overflow:"auto"}),this.model.refreshItems){let t=this.model.refreshItems.split(";");t=t.filter((t=>!!t)),this.refreshItems.push(...t)}this.model.paramItem&&(this.paramItem=this.model.paramItem)}async dataChangeNotify(t){await super.dataChangeNotify(t),E(this.refreshItems,t)&&this.calcViewParams()}async formStateNotify(t){await super.formStateNotify(t),this.isNewData="DRAFT"===t,0!==this.model.maskMode&&(this.state.showMask=this.isNewData),"LOAD"!==t&&"DRAFT"!==t&&"SAVE"!==t||this.calcViewParams()}calcViewParams(){let t=this.form.context.clone();const e=this.model.navigateContexts;k(e)&&(t=Object.assign(t,Le(e,this.form.context,this.form.params,this.form.data)));const a=Le(this.model.navigateParams,this.form.params,this.form.context,this.form.data);if(this.state.viewComponentKey){if(JSON.stringify(this.navContext)!==JSON.stringify(t)||JSON.stringify(this.navParams)!==JSON.stringify(a))this.navContext=t,this.navParams=a,this.force();else if(this.embedView){if(this.isNewData)return;this.embedView.callUIAction("Refresh")}}else this.state.viewComponentKey=B(),this.navContext=t,this.navParams=a}setEmbedView(t){this.embedView=t,this.embedView.evt.on("onMounted",(()=>{this.isNewData||this.embedView.call("Load")})),this.embedView.evt.on("onDataChange",(t=>{["LOAD","LOADDRAFT"].includes(t.actionType)||(ibiz.log.debug("接收到关系界面的数据变更事件",t),this.model.deformItemUpdateId&&this.form.updateFormItem(this.model.deformItemUpdateId))}))}}),t("FormGroupPanelState",class extends Yn{constructor(){super(...arguments),this.isShowMore=!1,this.actionGroupState=null}})),Zn=t("FormGroupPanelController",class extends $n{get disableClose(){const{titleBarCloseMode:t}=this.model;return 0===t||void 0===t}get defaultExpansion(){const{titleBarCloseMode:t}=this.model;return this.disableClose||1===t}createState(){var t;return new Jn(null==(t=this.parent)?void 0:t.state)}async onInit(){super.onInit(),await this.initActionStates()}async formStateNotify(t){super.calcDynamicLogic([],t),this.state.actionGroupState&&this.state.actionGroupState.update(this.form.data.getOrigin())}async initActionStates(){var t;const{uiactionGroup:e}=this.model;if(!(null==(t=null==e?void 0:e.uiactionGroupDetails)?void 0:t.length))return;const a=new Ri;e.uiactionGroupDetails.forEach((t=>{const e=t.uiactionId;if(e){const s=new Oi(t.id,this.form.context.srfappid,e);a.addState(t.id,s)}})),await a.update(),this.state.actionGroupState=a}async onActionClick(t,e){const a=t.uiactionId;await Nn.execAndResolved(a,{context:this.form.context,params:this.form.params,data:[this.data],view:this.form.view,event:e})}}),tr=t("FormItemState",class extends Yn{constructor(t){super(t),this.parent=t,this.error=null,this.enableCondDisabled=!1;let e=!1;Object.defineProperty(this,"disabled",{enumerable:!0,configurable:!0,get(){return!!this.enableCondDisabled||e},set:t=>(e=t,!0)})}}),er=(t("FormItemController",class extends $n{constructor(t,e,a){super(t,e,a),this.rules=[],this.context=e.context,this.params=e.params}createState(){var t;return new tr(null==(t=this.parent)?void 0:t.state)}get name(){return this.model.fieldName||this.model.id}get value(){return this.form.data[this.name]}get valueItemName(){if(this.model.editor)return this.model.editor.valueItemName}get unitName(){return this.model.unitName}get valueFormat(){return this.model.valueFormat}get dataType(){return this.model.dataType}async onInit(){await super.onInit(),this.state.required=!this.model.allowEmpty,this.model.editor&&"HIDDEN"!==this.model.editor.editorType&&(this.editorProvider=await qa(this.model.editor),this.editorProvider&&(this.editor=await this.editorProvider.createController(this.model.editor,this),await this.initRules()))}async initRules(){const t=xa(this.form.model.deformItemVRs||[],this.name);t&&(this.rules=Wi(t,this.name,this.valueItemName),this.validator=new lt({[this.name]:this.rules}))}calcEnableCond(){const{enableCond:t}=this.model,e=0===this.data.srfuf;t?(e&&2===t||!e&&1===t)&&(this.state.enableCondDisabled=!0):this.state.enableCondDisabled=!0}async dataChangeNotify(t){await super.dataChangeNotify(t);const{resetItemNames:e}=this.model;let a=!1;e&&e.length>0&&e.forEach((e=>{t.includes(e)&&(a=!0)})),a&&this.setDataValue(null,this.name),(t.includes(this.name)||t.includes(this.valueItemName))&&this.validate(),t.includes(this.name)&&this.model.deformItemUpdateId&&await this.form.updateFormItem(this.model.deformItemUpdateId)}async formStateNotify(t){super.formStateNotify(t),this.calcEnableCond(),"LOAD"===t&&this.setDefaultValue(!1)}calcDynamicLogic(t,e){this.model.hidden||super.calcDynamicLogic(t,e)}async validate(){if(!this.state.visible)return this.state.error=null,!0;if(this.state.required&&V(this.data[this.name]))return this.state.error="请填写".concat(this.model.caption||""),!1;if(this.validator)try{await this.validator.validate(this.data)}catch({errors:t,_fields:e}){return this.state.error=t[0].message,!1}return this.state.error=null,!0}async setDataValue(t,e){e=e||this.name,await this.form.setDataValue(e,t)}setDefaultValue(t,a=this.data){var i;const{createDVT:n,createDV:r,updateDVT:o,updateDV:c}=this.model,l=t?n:o,h=t?r:c;if("RESET"!==l){if(!(this.value||V(l)&&V(h)))if(l||!h)switch(l){case"APPDATA":Object.prototype.hasOwnProperty.call(this.params,h)&&(a[this.name]=this.params[h]),Object.prototype.hasOwnProperty.call(this.context,h)&&(a[this.name]=this.context[h]);break;case"OPERATORNAME":a[this.name]=this.context.srfusername;break;case"OPERATOR":a[this.name]=this.context.srfuserid;break;case"CURTIME":a[this.name]=st().format(this.model.valueFormat);break;case"PARAM":a[this.name]=this.data[h];break;case"SESSION":case"APPLICATION":if(!(null==(i=ibiz.appData)?void 0:i.context))throw new e("appdata.context不存在");a[this.name]=ibiz.appData.context[h];break;case"CONTEXT":a[this.name]=this.params[h];break;case"UNIQUEID":a[this.name]=B();break;default:throw new s(this.model,"默认值类型[".concat(l,"]未支持"))}else a[this.name]=h}else a[this.name]=null}}),t("FormMDCtrlContentTypeController",class{constructor(t){this.parent=t,this.model=this.parent.model}get data(){return this.parent.state.contentCtrlData}async onInit(){}onDataChange(t){this.parent.state.contentCtrlData=t,this.parent.setFormDataValue()}onDataItemChange(t,e){this.parent.state.contentCtrlData[e]=t,this.parent.setFormDataValue()}onDataRemove(t){t<0||(this.parent.state.contentCtrlData.splice(t,1),this.parent.setFormDataValue())}onDataInsert(t){this.parent.state.contentCtrlData.push(t||{}),this.parent.setFormDataValue()}async initData(){const t=this.model.appDEFieldId||this.model.fieldName||this.model.id;t&&("REPEATER"===this.model.contentType&&"STYLE3"===this.model.detailStyle?this.parent.state.contentCtrlData=this.parent.data[t]||{}:this.parent.state.contentCtrlData=this.parent.data[t]||[])}async validate(){return!0}})),ar=t("FormMDCtrlControlController",class extends er{async onInit(){const{model:t}=this.parent,{contentControl:a}=t;if(!a)throw new e("表单多数据部件未配置嵌入部件");this.controlModel=a;const s=await Ka(this.controlModel);s&&(this.provider=s)}}),sr=t("FormMDCtrlDataViewController",class extends ar{constructor(){super(...arguments),this.selectData=[],this.state={isSelect:!1}}onDataViewMounted(t){this.dataViewController=t.ctrl}onSelectionChange(t){this.state.isSelect=t.data.length>0}onDataRemove(){this.dataViewController.remove(),this.parent.state.contentCtrlData=this.dataViewController.state.items,this.parent.setFormDataValue()}onDataChange(t){this.parent.state.contentCtrlData=t,this.parent.setFormDataValue()}async initData(){this.dataViewController.load()}async onDataInsert(){}}),ir=t("EditFormService",class extends ui{async get(t,e={}){var a;let s=await this.exec((null==(a=this.model.getControlAction)?void 0:a.appDEMethodId)||"get",t,void 0,e);return s=this.handleResponse(s),s}async getDraft(t,e={}){var a;let s=await this.exec((null==(a=this.model.getDraftControlAction)?void 0:a.appDEMethodId)||"getdraft",t,void 0,e);return s=this.handleResponse(s),s}async remove(t,e={}){var a;return await this.exec((null==(a=this.model.removeControlAction)?void 0:a.appDEMethodId)||"remove",t,void 0,e)}async create(t,e){var a;const s=e instanceof di?e.getOrigin():e,i=this.getFilteredData(s);let n=await this.exec((null==(a=this.model.createControlAction)?void 0:a.appDEMethodId)||"create",t,i);return n=this.handleResponse(n),n}async update(t,e){var a;const s=e instanceof di?e.getOrigin():e,i=this.getFilteredData(s);let n=await this.exec((null==(a=this.model.updateControlAction)?void 0:a.appDEMethodId)||"update",t,i);return n=this.handleResponse(n),n}async goBack(t,e){var s;const i=null==(s=this.model.goBackControlAction)?void 0:s.appDEMethodId;if(!i)throw new a(this.model,"缺少返回操作实体行为");let n=await this.exec(i,t,e instanceof di?e.getOrigin():e);return n=this.handleResponse(n),n}async updateFormItem(t,e,a={}){let s=await this.exec(t,e,a);return s=this.handleResponse(s),s}async wfStart(t,e,a){var s;const i=(null==(s=this.model.wfstartControlAction)?void 0:s.appDEMethodId)||"wfstart";return(await this.app.deService.getService(this.model.appDataEntityId)).wf.exec(i,t,e,a instanceof di?a.getOrigin():a)}async wfSubmit(t,e,a){var s;const i=this.model;let n="";n=e.type?e.type:(null==(s=i.wfsubmitControlAction)?void 0:s.appDEMethodId)||"wfsubmit";return(await this.app.deService.getService(this.model.appDataEntityId)).wf.exec(n,t,e,a instanceof di?a.getOrigin():a)}initUIDataMap(){super.initUIDataMap();const t=["srfwfmemo","srfwftransferor","srfactionparam","srffrontuf","srfnextform"];f(this.model,(e=>{if("FORMITEM"===e.detailType||"MDCTRL"===e.detailType){const a=e,s=a.fieldName||a.id.toLowerCase(),i=a.fieldName||e.appDEFieldId;let n;n=i?new Ii(s,i,{isOriginField:!0,dataType:a.dataType}):new Ii(s,s,{isOriginField:t.includes(s)}),this.dataUIMap.set(s,n)}}),{childrenFields:["deformPages","deformDetails"]})}handleResponse(t){const e=super.handleResponse(t);return e.ok&&e.data&&(e.data=this.toUIData(e.data)),e}getFilteredData(t){const e={};return this.dataUIMap.forEach((a=>{void 0!==t[a.dataKey]&&(e[a.dataKey]=t[a.dataKey])})),e}}),nr=t("EditFormController",class extends Xn{async onCreated(){await super.onCreated(),this.service=new ir(this.model),await this.service.init(this.context),this.autoSave=C(this.autoSave.bind(this),500,{trailing:!0})}async loadDraft(){const t={...this.params},e=await this.getDraftParams();let a;Object.assign(t,e);try{await this.startLoading(),await this.evt.emit("onBeforeLoadDraft",{params:t}),a=await this.service.getDraft(this.context,t)}catch(t){throw await this.evt.emit("onLoadDraftError",void 0),this.actionNotification("GETDRAFTERROR",{error:t}),t}finally{await this.endLoading()}return this.state.data=a.data,w(this.data,e),this.formStateNotify("DRAFT"),await this.evt.emit("onLoadDraftSuccess",void 0),this.actionNotification("GETDRAFTSUCCESS"),this.state.isLoaded=!0,this.data}async load(){if(!Ge(this.context,this.model.appDataEntityId))return this.loadDraft();const t={...this.params};let e;try{await this.startLoading(),await this.evt.emit("onBeforeLoad",void 0),e=await this.service.get(this.context,t)}catch(t){throw await this.evt.emit("onLoadError",void 0),this.actionNotification("GETERROR",{error:t}),t}finally{await this.endLoading()}return this.state.modified=!1,this.state.data=e.data,this.formStateNotify("LOAD"),await this.evt.emit("onLoadSuccess",void 0),this.actionNotification("GETSUCCESS"),this.state.isLoaded=!0,this.data}async save(){if(this.state.processing){return await v(500,this.save.bind(this))}if(!await this.validate())throw new e("请检查表单填写!");await this.startLoading(),await this.evt.emit("onBeforeSave",void 0);const t=0===this.data.srfuf;let a;try{a=t?await this.service.create(this.context,this.data):await this.service.update(this.context,this.data)}catch(e){throw await this.evt.emit("onSaveError",void 0),this.actionNotification("".concat(t?"CREATE":"UPDATE","ERROR"),{error:e}),e}finally{await this.endLoading()}return a.data&&y(this.data,a.data),this.state.modified=!1,await this.evt.emit("onSaveSuccess",void 0),this.formStateNotify("SAVE"),this.actionNotification("".concat(t?"CREATE":"UPDATE","SUCCESS"),{default:"".concat(this.data.srfmajortext||"","保存成功")}),this.data}async remove(){let t,e=!1;if(await this.evt.emit("onBeforeRemove",void 0),1===this.data.srfuf){if(e=await ibiz.modal.confirm({title:"提示",desc:"确认删除吗?"}),!e)return!1;await this.startLoading();try{t=await this.service.remove(this.context,this.params)}catch(t){throw await this.evt.emit("onRemoveError",void 0),this.actionNotification("REMOVEERROR",{error:t}),t}finally{await this.endLoading()}e=t.ok}return this.state.data=new di,this.state.modified=!1,await this.evt.emit("onRemoveSuccess",void 0),this.actionNotification("REMOVESUCCESS"),e}async goBack(){let t;await this.startLoading();try{t=await this.service.goBack(this.context,this.data)}finally{await this.endLoading()}t.data&&y(this.data,t.data)}async updateFormItem(t){var a;const s=null==(a=this.model.deformItemUpdates)?void 0:a.find((e=>e.id===t));if(!s)throw new e("没找到".concat(t,"表单项更新"));const{appDEMethodId:i,defiupdateDetails:n,customCode:r,scriptCode:o}=s,c=n.map((t=>t.id));let l;if(r&&o)l=pa.execScriptFn({...this.getEventArgs(),data:this.data},o,{isAsync:!1});else{const t={...this.params,...this.data.getOrigin()},e=await this.service.updateFormItem(i,this.context,t);l=e.data}l&&(null==c?void 0:c.length)&&await Promise.all(c.map((t=>this.setDataValue(t,l[t]))))}async wfStart(t={}){if(!await this.validate())throw new e("请检查表单填写!");await this.startLoading();try{await this.service.wfStart(this.context,{...this.params,...t},this.data)}catch(t){throw this.actionNotification("WFSTARTERROR",{error:t}),t}finally{await this.endLoading()}this.actionNotification("WFSTARTSUCCESS",{default:"流程启动成功"})}async wfSubmit(t={}){if(!await this.validate())throw new e("请检查表单填写!");await this.startLoading();try{await this.service.wfSubmit(this.context,{...this.params,...t},this.data)}catch(t){throw this.actionNotification("WFSUBMITERROR",{error:t}),t}finally{await this.endLoading()}this.actionNotification("WFSUBMITSUCCESS",{default:"流程提交成功"})}async dataChangeNotify(t){await super.dataChangeNotify(t),this.autoSave()}async autoSave(){if(this.model.enableAutoSave)try{await this.save()}catch(t){ibiz.log.error(t)}}}),rr=t("FormMDCtrlFormController",class extends ar{constructor(){super(...arguments),this.controlControllerArray=[],this.state={data:[]}}onControlMounted(t,e){const a=t.ctrl;this.controlControllerArray[e]=a,a.load()}async onInit(){super.onInit(),this.service=new ir(this.model.contentControl),await this.service.init(this.parent.form.context)}async fetch(t,e={}){let a=await this.service.exec("fetchdefault",t,e);return a=this.handleResponse(a),a}handleResponse(t){const e=t;return e.ok&&(A(e.data)?e.data=e.data.map((t=>this.service.toUIData(t))):e.data=this.service.toUIData(e.data)),e}async initData(){const t=await this.fetch(this.parent.form.context,this.parent.form.params);this.state.data=t.data}onDataRemove(t){const e=this.controlControllerArray[t];e&&e.remove()}onFormChange(t,e){const a=this.controlControllerArray[e];a&&(a.save(),this.state.data[e]&&y(this.state.data[e],t[0]),this.parent.state.contentCtrlData=this.state.data,this.parent.setFormDataValue())}onFormRemoveSuccess(t){this.state.data.splice(t,1),this.controlControllerArray.splice(t,1),this.parent.state.contentCtrlData=this.state.data,this.parent.setFormDataValue()}async onDataInsert(){const t=await this.service.getDraft(this.parent.form.context,this.parent.form.params);if(t.data){const e=await this.service.create(this.parent.form.context,t.data);this.state.data.push(e.data),this.parent.state.contentCtrlData=this.state.data,this.parent.setFormDataValue()}}async validate(){return-1===(await Promise.all(this.controlControllerArray.map((t=>t.validate())))).findIndex((t=>!t))}}),or=t("FormMDCtrlGridController",class extends ar{constructor(){super(...arguments),this.selectData=[],this.state={isSelect:!1}}onGridMounted(t){this.gridController=t.ctrl}onSelectionChange(t){this.state.isSelect=t.data.length>0}onDataRemove(){this.gridController.remove(),this.parent.state.contentCtrlData=this.gridController.state.items,this.parent.setFormDataValue()}onDataChange(t){this.parent.state.contentCtrlData=t,this.parent.setFormDataValue()}async initData(){this.gridController.load()}async onDataInsert(){await this.gridController.newRow(),this.parent.state.contentCtrlData=this.gridController.state.items,this.parent.setFormDataValue()}async onInit(){const{model:t}=this.parent,{contentControl:a}=t;if(!a)throw new e("表单多数据部件未配置嵌入部件");y(a,{enableRowEdit:!0,enableRowNew:!0}),this.controlModel=a;const s=await Ka(this.controlModel);s&&(this.provider=s)}async validate(){const{rows:t}=this.gridController.state;return-1===(await Promise.all(t.map((t=>this.gridController.validate(t))))).findIndex((t=>!t))}}),cr=t("FormMDCtrlListController",class extends ar{constructor(){super(...arguments),this.selectData=[],this.state={isSelect:!1}}onListMounted(t){this.listController=t.ctrl}onSelectionChange(t){this.state.isSelect=t.data.length>0}onDataRemove(){this.listController.remove(),this.parent.state.contentCtrlData=this.listController.state.items,this.parent.setFormDataValue()}onDataChange(t){this.parent.state.contentCtrlData=t,this.parent.setFormDataValue()}async initData(){this.listController.load()}async onDataInsert(){}}),lr=t("FormMDCtrlRepeaterFormController",class extends er{constructor(){super(...arguments),this.formControllerArray=[]}async onDataInsert(){super.onDataInsert({})}onDataRemove(t){t<0||super.onDataRemove(t)}async validate(){const t=this.formControllerArray.map((t=>t.validate()));return-1===(await Promise.all(t)).findIndex((t=>!t))}setFromController(t){this.formControllerArray.push(t)}}),hr=t("FormMDCtrlRepeaterFormOneController",class extends lr{get data(){return this.parent.state.contentCtrlData}onDataItemChange(t){this.parent.state.contentCtrlData=t,this.parent.setFormDataValue()}}),dr=t("FormMDCtrlRepeaterGridController",class extends er{constructor(){super(...arguments),this.columns=[],this.editorMap={}}async onInit(){this.initColumns(this.model.deformDetails||[])}initColumns(t){t.forEach((async t=>{if("FORMITEM"===t.detailType){const{editor:e,dataType:a}=t,s=await qa(e);if(s){const i=await s.createController(e,{unitName:e.unitName,valueFormat:e.valueFormat,context:this.parent.form.context,params:this.parent.form.params,dataType:a});this.editorMap[t.codeName]={provider:s,controller:i}}this.columns.push({codeName:t.codeName,caption:t.caption})}const e=ta(t);e.length&&this.initColumns(e)}))}rowDataChange(t,e,a){const s=this.data[a];Object.prototype.hasOwnProperty.call(s,e)&&!Vi(s[e],t)||(s[e]=t,this.onDataItemChange(s,a))}}),ur=t("FormMDCtrlState",class extends Yn{constructor(){super(...arguments),this.contentCtrlData=[]}}),pr=(t("FormMDCtrlController",class extends $n{createState(){var t;return new ur(null==(t=this.parent)?void 0:t.state)}async onInit(){switch(await super.onInit(),this.model.contentType){case"FORM":this.mdCtrlContentController=new rr(this);break;case"GRID":this.mdCtrlContentController=new or(this);break;case"LIST":this.mdCtrlContentController=new cr(this);break;case"DATAVIEW":this.mdCtrlContentController=new sr(this);break;case"REPEATER":"DEFAULT"===this.model.detailStyle&&(this.mdCtrlContentController=new lr(this)),"STYLE3"===this.model.detailStyle&&(this.mdCtrlContentController=new hr(this)),"STYLE2"===this.model.detailStyle&&(this.mdCtrlContentController=new dr(this))}this.mdCtrlContentController&&await this.mdCtrlContentController.onInit()}setFormDataValue(){const t=this.model.appDEFieldId||this.model.fieldName||this.model.id;t&&this.form.setDataValue(t,this.state.contentCtrlData)}async loadData(){await this.mdCtrlContentController.initData()}async validate(){return this.mdCtrlContentController.validate()}setDefaultValue(){}}),t("FormMDCtrlItemController",class extends nr{constructor(t,e,a,s,i){super(t,e,a,s),this.state.data=i,this.state.isSimple=!0}async initDetailControllers(t=this.model.deformDetails,e=this,a=void 0){await Promise.all(t.map((async t=>{const s=await Za(t);if(!s)return;e.providers[t.id]=s;const i=await s.createController(t,e,a);e.details[t.id]=i,"FORMITEM"!==t.detailType&&"MDCTRL"!==t.detailType||e.formItems.push(i);const n=ta(t);n.length&&await this.initDetailControllers(n,e,i)})))}}),t("FormPageState",class extends Jn{})),mr=(t("FormPageController",class extends Zn{createState(){var t;return new pr(null==(t=this.parent)?void 0:t.state)}}),t("FormRawItemState",class extends Yn{})),fr=(t("FormRawItemController",class extends $n{createState(){var t;return new mr(null==(t=this.parent)?void 0:t.state)}}),t("FormTabPageState",class extends Yn{})),gr=(t("FormTabPageController",class extends $n{createState(){var t;return new fr(null==(t=this.parent)?void 0:t.state)}}),t("FormTabPanelState",class extends Yn{})),wr=(t("FormTabPanelController",class extends $n{createState(){var t;return new gr(null==(t=this.parent)?void 0:t.state)}}),t("GridColumnController",class{constructor(t,e){var a;this.isAdaptiveColumn=!1,this.isCustomCode=!1,this.model=t,this.grid=e,this.isAdaptiveColumn="STAR"===t.widthUnit,this.isAdaptiveColumn&&(this.grid.hasAdaptiveColumn=!0),(null==(a=this.deGridDataItem)?void 0:a.customCode)&&(this.isCustomCode=!0)}get context(){return this.grid.context}get params(){return this.grid.params}get enableRowEdit(){return!(!this.grid.model.enableRowEdit||!this.model.enableRowEdit)}get deGridDataItem(){var t;return null==(t=this.grid.model.degridDataItems)?void 0:t.find((t=>t.id===this.model.id))}get valueFormat(){var t;return null==(t=this.deGridDataItem)?void 0:t.format}get dataType(){var t;return null==(t=this.deGridDataItem)?void 0:t.dataType}async init(){await this.onInit()}async onInit(){}getCustomHtml(t){var e;if(null==(e=this.deGridDataItem)?void 0:e.scriptCode)return pa.execScriptFn({data:t.data},this.deGridDataItem.scriptCode,{singleRowReturn:!0,isAsync:!1})}})),Er=t("GridRowState",class{constructor(t,e){this.errors={},this.uaColStates={},this.editColStates={},this.showRowEdit=!1,this.modified=!1,this.processing=!1,this.data=t,Object.keys(this.data).forEach((t=>{void 0===this.errors[t]&&(this.errors[t]=null)})),Object.values(e.uaColumns).forEach((t=>{t.initActionStates(this)})),Object.values(e.editColumns).forEach((t=>{this.editColStates[t.fieldName]={disabled:!1,readonly:!1,editable:"all"===ibiz.config.grid.editShowMode,required:!1}}))}}),vr=t("GridService",class extends pi{initUIDataMap(){var t;super.initUIDataMap(),null==(t=this.model.degridDataItems)||t.forEach((t=>{const e=t.id.toLowerCase(),a=t.appDEFieldId;let s;if(a){const i=a.toLowerCase();s=new Ii(e,i,{isOriginField:!0,dataType:t.dataType})}else s=new Ii(e,e);this.dataUIMap.set(e,s)}))}async updateGridEditItem(t,e,a={}){const s=await this.app.deService.getService(this.model.appDataEntityId);let i=await s.exec(t,e,a);return i=this.handleResponse(i),i}}),yr=(t("GridController",class extends Xi{constructor(){super(...arguments),this.hasAdaptiveColumn=!1,this.isMultistageHeader=!1,this.columns={},this.fieldColumns={},this.uaColumns={},this.editColumns={},this.providers={},this.aggTitle="合计"}get groupCodeListItems(){var t;return null==(t=this.groupFieldColumn)?void 0:t.codeListItems}get enableAgg(){return"NONE"!==this.model.aggMode}get allowRowEdit(){return!!this.model.enableRowEdit&&this.state.rowEditOpen}initState(){super.initState(),this.state.rows=[],this.state.noSort=!0===this.model.noSort,this.state.size=this.model.pagingSize||20,this.state.singleSelect=!0===this.model.singleSelect,this.state.columnStates=[],this.state.aggResult={},this.state.rowEditOpen=!1}async onCreated(){await super.onCreated(),this.service=new vr(this.model),await this.service.init(this.context),this.initColumnStates(),await this.initGridColumns(),this.dataChangeNotify=g(this.dataChangeNotify.bind(this),((t,e)=>[t[0],Array.from(new Set([...t[1],...e[1]]))]),200),await this.initGroup()}async initGroup(){if(!this.model.enableGroup)return;const{groupAppDEFieldId:t,groupCodeListId:e,groupMode:s}=this.model;if(this.groupFieldColumn=Object.values(this.fieldColumns).find((e=>e.model.appDEFieldId===t)),!this.groupFieldColumn)throw new a(this.model,"没有配置分组属性的属性列");const i=this.groupFieldColumn.model.id;if(!this.groupFieldColumn.model.appCodeListId)throw new a(this.groupFieldColumn.model,"分组属性的属性列".concat(i,"没有配置代码表"));const n=this.state.columnStates.findIndex((t=>t.key===this.groupFieldColumn.model.codeName));if(-1!==n&&0!==n){if(this.isMultistageHeader)throw new a(this.model,"请将分组属性列".concat(i,"配置为第一列"));const t=this.state.columnStates.splice(n,1);this.state.columnStates.unshift(...t)}if("CODELIST"===s){if(!e)throw new a(this.model,"代码表分组模式需要配置代码表");if(this.groupFieldColumn.model.appCodeListId!==e)throw new a(this.model,"分组代码表与属性列".concat(i,"的代码表不一致"))}}async afterLoad(t,e){return await super.afterLoad(t,e),await Promise.allSettled(Object.values(this.fieldColumns).map((async t=>{await t.loadCodeList()}))),this.state.rows=e.map((t=>{const e=new Er(t,this);return this.gridStateNotify(e,"LOAD"),e})),this.state.rows.forEach((t=>{Object.values(t.uaColStates).forEach((e=>{e.update(t.data.getOrigin(),this.model.appDataEntityId)}))})),this.calcGroupData(e),this.calcAggResult(e),e}calcGroupData(t){const{enableGroup:e,groupMode:a}=this.model;if(e){const e=new Map,s="CODELIST"===a,i=this.groupFieldColumn.model.id;s&&this.groupCodeListItems.forEach((t=>{e.set(t.value,[])})),t.forEach((t=>{const a=t[i];s||e.has(a)||e.set(a,[]),e.has(a)&&e.get(a).push(t)})),this.state.groups=[],e.forEach(((t,e)=>{const a=this.groupCodeListItems.find((t=>t.value===e));this.state.groups.push({caption:(null==a?void 0:a.text)||"".concat(e),key:e,children:t})}))}}async loadRemoteAgg(){const{aggMode:t,aggAppDataEntityId:e,aggAppDEDataSetId:s}=this.model;if("ALL"!==t)return;if(!s||!e)throw new a(this.model,"缺少配置聚合实体或聚合数据集");const i=await this.getFetchParams(),n=ibiz.hub.getApp(this.context.srfappid),r=await n.deService.exec(e,s,this.context,void 0,i);r.data.length&&([this.state.remoteAggResult]=r.data)}calcAggResult(t){Object.values(this.fieldColumns).forEach((e=>{const a=e.calcFieldAgg(t);a&&(this.state.aggResult[e.model.id]=a)}))}afterRemove(t){super.afterRemove(t);const e=this.state.rows.findIndex((e=>e.data.srfkey===t.srfkey));this.state.rows.splice(e,1),this.state.groups.forEach((e=>{if(e.children.length){const a=e.children.findIndex((e=>e.srfkey===t.srfkey));-1!==a&&e.children.splice(a,1)}}))}async newRow(){const{enableRowEdit:t,enableRowNew:a}=this.model;if(!t||!a||"row"!==ibiz.config.grid.editShowMode)return void ibiz.log.error("不支持新建行");if(this.state.rows.find((t=>t.showRowEdit)))throw new e("请先完成当前行编辑中的行的操作");let s;try{s=await this.service.getDraft(this.context,this.params)}catch(t){throw this.actionNotification("GETDRAFTERROR",{error:t}),t}this.state.items.unshift(s.data);const i=new Er(s.data,this);this.state.rows.unshift(i),this.gridStateNotify(i,"DRAFT"),this.switchRowEdit(this.state.rows[0],!0),this.actionNotification("GETDRAFTSUCCESS",{data:s.data})}async save(t){if(this.state.isSimple)return;const a=this.state.rows.find((e=>e.data.srfkey===t.srfkey));if(!a)throw new e("行数据不存在");if(!a.modified)return void ibiz.log.debug("值没有发生改变");if(a.processing)return void await v(500,this.save.bind(this),[t]);if(!await this.validate(a))throw new e("行数据校验不通过,保存取消");let s;await this.startLoading();const i=0===t.srfuf,n=ze(this.model.appDataEntityId),r=this.context.clone();r[n]=t.srfkey;try{s=i?await this.service.create(r,t):await this.service.update(r,t)}catch(t){throw await this.evt.emit("onSaveError",void 0),this.actionNotification("".concat(i?"CREATE":"UPDATE","ERROR"),{error:t,data:a.data}),t}finally{await this.endLoading()}const o=this.state.items.findIndex((e=>e.srfkey===t.srfkey));this.state.items.splice(o,1,s.data),a.data=s.data,a.modified=!1,this.actionNotification("".concat(i?"CREATE":"UPDATE","SUCCESS"),{default:"".concat(s.data.srfmajortext||"","保存成功"),data:s.data}),this.gridStateNotify(a,"SAVE"),await this.evt.emit("onSaveSuccess",void 0)}async saveAll(){const t=this.state.rows.filter((t=>t.modified)).map((t=>t.data));t.length&&Promise.allSettled(t.map((t=>this.save(t))))}async initColumnsController(t){var e;const a=await as(t);if(!a)return;this.providers[t.codeName]=a;const s=await a.createController(t,this);this.columns[t.codeName]=s,"DEFGRIDCOLUMN"===t.columnType?(this.fieldColumns[t.codeName]=s,t.enableRowEdit&&(this.editColumns[t.codeName]=s)):"UAGRIDCOLUMN"===t.columnType?this.uaColumns[t.codeName]=s:"GROUPGRIDCOLUMN"===t.columnType&&(this.isMultistageHeader=!0,await Promise.all((null==(e=t.degridColumns)?void 0:e.map((async t=>{await this.initColumnsController(t)})))||[]))}initColumnStates(){f(this.model,(t=>{"GROUPGRIDCOLUMN"!==t.columnType&&this.state.columnStates.push({key:t.codeName,caption:t.caption,hidden:!!t.hideDefault,uaColumn:"UAGRIDCOLUMN"===t.columnType})}),{childrenFields:["degridColumns"]}),this.calcColumnFixed()}calcColumnFixed(){const t=this.state.columnStates.filter((t=>!t.hidden)),e=t.length,{frozenFirstColumn:a,frozenLastColumn:s}=this.model;t.forEach(((t,i)=>{t.uaColumn?t.fixed=i+1<=Math.floor(e/2)?"left":"right":a&&i<a?t.fixed="left":s&&i>=e-s&&(t.fixed="right")}))}async initGridColumns(){this.model.degridColumns&&await Promise.all(this.model.degridColumns.map((async t=>this.initColumnsController(t))))}async setRowValue(t,e,a){if(!Object.prototype.hasOwnProperty.call(t.data,e)||Vi(t.data[e],a)){t.data[e]=a,t.modified=!0,t.processing=!0;try{await this.dataChangeNotify(t,[e]),await this.evt.emit("onGridDataChange",{data:this.state.rows.map((t=>t.data))})}finally{t.processing=!1}}}async dataChangeNotify(t,e){const a=await Promise.allSettled(Object.values(this.editColumns).map((async a=>a.dataChangeNotify(t,e)))),s=a.find((t=>"rejected"===t.status));if(s)throw ibiz.log.error("dataChangeNotify报错",a),s.reason}gridStateNotify(t,e){Object.values(this.editColumns).forEach((a=>{a.gridStateNotify(t,e)}))}async validate(t){return-1===(await Promise.all(Object.values(this.editColumns).map((e=>e.validate(t))))).findIndex((t=>!t))}async toggleRowEdit(){if(!this.model.enableRowNew)throw new e("当前表格不支持行编辑,无法切换开启行编辑");this.state.rowEditOpen=!this.state.rowEditOpen}async switchRowEdit(t,a,s=!0){if(!this.allowRowEdit)return;const i=void 0===a?!t.showRowEdit:a;if(t.showRowEdit!==i){if(!1===i)if(s)await this.save(t.data);else if(0===t.data.srfuf)return t.showRowEdit=!1,this.evt.emit("onRowEditChange",{row:t}),this.remove({data:[t.data],silent:!0});if(!0===i){if(this.state.rows.find((t=>t.showRowEdit)))throw new e("同时只能有一行开启行编辑")}t.showRowEdit=i,Object.values(this.editColumns).forEach((e=>{t.editColStates[e.fieldName].editable=i})),this.evt.emit("onRowEditChange",{row:t})}}setSort(t,e){if(t&&e){const a=this.fieldIdNameMap.get(t).toLowerCase();super.setSort(a,e)}else{const{minorSortAppDEFieldId:t,minorSortDir:e}=this.model;if(t&&e){const a=this.fieldIdNameMap.get(t);this.state.sortQuery="".concat(a.toLowerCase(),",").concat(e.toLowerCase())}else this.state.sortQuery=""}}async updateGridEditItem(t,a){var s;const i=null==(s=this.model.degridEditItemUpdates)?void 0:s.find((t=>t.id===a));if(!i)throw new e("没找到".concat(a,"编辑列更新"));const{appDEMethodId:n,degeiupdateDetails:r,customCode:o,scriptCode:c}=i,l=r.map((t=>t.id));let h;if(o&&c)h=pa.execScriptFn({...this.getEventArgs(),data:t.data},c,{isAsync:!1});else{const e={...this.params,...t.data.getOrigin()},a=await this.service.updateGridEditItem(n,this.context,e);h=a.data}h&&(null==l?void 0:l.length)&&await Promise.all(l.map((e=>this.setRowValue(t,e,h[e]))))}async loadData(t){const{context:e}=this.handlerAbilityParams(t),a=await this.getFetchParams(null==t?void 0:t.params);let s;await this.startLoading();try{s=await this.service.fetch(e,a)}finally{await this.endLoading()}return s.data}async exportData(t){const a=this.fieldColumns,s=Object.keys(a).map((t=>a[t].model.id)),i=Object.keys(a).map((t=>a[t].model.caption)),n=(r=s,(await(async()=>{var s;const i=null==(s=t.params)?void 0:s.type;let n=[];if("activatedPage"===i&&(n=this.state.rows.map((t=>t.data))),"maxRowCount"===i||"customPage"===i){const{size:e}=this.state,{startPage:a,endPage:s}=t.params,r="customPage"===i?{page:0,offset:(a-1)*e,size:(s-a+1)*e}:{size:1e3,page:0};n=await this.loadData({params:r})}if("selectedRows"===i&&(n=this.getData()),0===n.length)throw new e("无导出数据");return(t=>{const e=new Map;Object.keys(a).forEach((t=>{a[t].codeList&&e.set(t,a[t].codeListItems)}));const s=J(t.map((t=>t.getOrigin())));return s.forEach((t=>{Object.keys(t).forEach((a=>{var s;e.get(a)&&(t[a]=(null==(s=e.get(a).find((e=>e.value===t[a])))?void 0:s.text)||t[a])}))})),s})(n)})()).map((t=>r.map((e=>t[e])))));var r;if(!ibiz.util.getExportExcel)throw new e("ibiz.util.getExportExcel不存在");const o=await ibiz.util.getExportExcel();if(!o)throw new e("导出模块加载错误");o.exportJsonToExcel({header:i,data:n,filename:this.model.logicName,autoWidth:!0})}}),t("GridFieldColumnController",class extends wr{constructor(){super(...arguments),this.codeList=void 0}get isLinkColumn(){return!!this.model.enableLinkView&&!!this.model.linkAppViewId}get hasAction(){return!!this.model.deuiactionId}clickable(t){const e=t.data[this.model.codeName];return(this.isLinkColumn||this.hasAction)&&e}handlePublicParams(t,e,a){const{userParam:s}=this.model;if(!s)return{context:e,params:a};const{navigateContexts:i,navigateParams:n}=Fe(s);let r={};i&&t&&(r=Le(i,e,a,t));const o=Object.assign(e.clone(),r);let c={};n&&t&&(c=Le(n,e,a,t));return{context:o,params:{...a,...c}}}async openLinkView(t,e){if(!t.data[this.model.codeName])return;const a=this.model.linkValueItem||"srfkey",i=t.data[a];if(null==i)throw new s(this.model,"未在行数据中取到 ".concat(a," 的值"));const{linkAppViewId:n}=this.model;if(!n)return;const r=va(t.data),o=Object.assign(this.context.clone(),{srfkey:i,...r}),c=J(this.params),{context:l,params:h}=this.handlePublicParams(t.data,o,c),d=await ibiz.commands.execute(Na.TAG,n,l,h,{event:e});(null==d?void 0:d.ok)&&this.grid.load()}async triggerAction(t,e){const a=this.model.deuiactionId;await Nn.execAndResolved(a,{context:this.context,params:this.params,data:[t.data],view:this.grid.view,event:e})}async loadCodeList(){const t=this.model.appCodeListId;if(!t)return;const e=ibiz.hub.getApp(this.context.srfappid);this.codeList||(this.codeList=e.codeList.getCodeList(t));const a=await e.codeList.get(t,this.context,this.params);return this.codeListItems=a,a}calcFieldAgg(t){const{aggField:e,aggMode:a,aggValueFormat:i,unitName:n}=this.model;if("NONE"===a)return;const r=e||this.model.id;let o;if("PAGE"!==this.grid.model.aggMode)throw"ALL"===this.grid.model.aggMode?new s(this.model,"远程聚合暂未支持"):new s(this.grid.model,"暂未支持聚合模式".concat(this.grid.model.aggMode));switch(a){case"SUM":o=t.map((t=>t[r])).reduce(((t,e)=>t+e),0);break;case"AVG":o=t.map((t=>t[r])).reduce(((t,e)=>t+e),0)/t.length;break;case"MAX":o=Math.max(...t.map((t=>t[r])));break;case"MIN":o=Math.min(...t.map((t=>t[r])));break;default:throw new s(this.model,"暂未支持属性列聚合模式".concat(a))}let c="".concat(o);if(i)try{c=ibiz.util.text.format("".concat(o),i)}catch(t){ibiz.log.error("".concat(o," 值格式化错误"))}return c&&n&&(c+=n),c}formatValue(t=""){if("SIMPLE"!==this.model.valueType)return Bi.toText(this.model,t);const e="".concat(t);if(!this.valueFormat)return e;return o.isDate(this.dataType)?st(e).format(this.valueFormat):ibiz.util.text.format(e,this.valueFormat)}})),Ir=(t("GridUAColumnController",class extends wr{initActionStates(t){var e;const{deuiactionGroup:s}=this.model;if(!s)throw new a(this.model,"操作列没有配置界面行为组");if(!(null==(e=s.uiactionGroupDetails)?void 0:e.length))return void ibiz.log.debug("操作列界面行为组没有配置界面行为");const i=new Ri;s.uiactionGroupDetails.forEach((t=>{const e=t.uiactionId;if(e){const a=new Oi(t.id,this.grid.context.srfappid,e);i.addState(t.id,a)}})),t.uaColStates[this.model.codeName]=i}async onActionClick(t,e,a){const s=t.uiactionId;await Nn.execAndResolved(s,{context:this.context,params:this.params,data:[e.data],view:this.grid.view,event:a})}}),t("GridFieldEditColumnController",class extends yr{constructor(){super(...arguments),this.rules=[]}get unitName(){return this.editItem.unitName}get valueFormat(){return this.model.valueFormat}get valueItemName(){if(this.editItem.editor)return this.editItem.editor.valueItemName}get fieldName(){return this.model.dataItemName}async onInit(){await super.onInit();const t=Ze(this.grid.model,this.model.codeName);t&&(this.editItem=t,this.editItem.editor&&"HIDDEN"!==this.editItem.editor.editorType&&(this.editorProvider=await qa(this.editItem.editor),this.editorProvider&&(this.editor=await this.editorProvider.createController(this.editItem.editor,this),await this.initRules())))}async initRules(){const t=xa(this.grid.model.degridEditItemVRs||[],this.fieldName);t&&(this.rules=Wi(t,this.fieldName,this.valueItemName),this.validator=new lt({[this.fieldName]:this.rules}))}async setRowValue(t,e,a){a=a||this.fieldName,await this.grid.setRowValue(t,a,e)}async dataChangeNotify(t,a){this.calcColumnDisabled(t);const s=t.editColStates[this.fieldName].required;this.calcColumnRequired(t);if(s!==t.editColStates[this.fieldName].required||a.includes(this.fieldName)||a.includes(this.valueItemName)){if(!await this.validate(t))throw new e("".concat(this.editItem.codeName,"校验报错,").concat(t.errors[this.fieldName]))}a.includes(this.fieldName)&&this.editItem.degridEditItemUpdateId&&await this.grid.updateGridEditItem(t,this.editItem.degridEditItemUpdateId)}gridStateNotify(t,e){this.calcColumnDisabled(t),this.calcColumnReadonly(t),this.calcColumnRequired(t)}calcColumnDisabled(t){let e=this.calcEnableCond(t);if(e&&this.grid.scheduler){const a=this.grid.scheduler.triggerItemEnable(this.fieldName,{data:[t.data]});void 0!==a&&(e=a)}t.editColStates[this.fieldName].disabled=!e}calcColumnRequired(t){let e=!1!==this.editItem.allowEmpty;if(e&&this.grid.scheduler){const a=this.grid.scheduler.triggerItemBlank(this.fieldName,{data:[t.data]});void 0!==a&&(e=a)}t.editColStates[this.fieldName].required=!e}calcColumnReadonly(t){var e;const a=!!(null==(e=this.editItem.editor)?void 0:e.readOnly);t.editColStates[this.fieldName].readonly=a}calcEnableCond(t){const{enableCond:e}=this.editItem,a=0===t.data.srfuf;switch(e){case 0:return!1;case 1:return a;case 2:return!a;default:return!0}}async validate(t){const e=this.fieldName;if("cell"!==ibiz.config.grid.editShowMode&&t.editColStates[e].required&&V(t.data[e]))return t.errors[e]="请填写".concat(this.model.caption||""),!1;if(this.rules.length&&this.validator)try{await this.validator.validate(t.data)}catch(a){const{errors:s}=a;return t.errors[e]=s[0].message,!1}return t.errors[e]=null,!0}}),t("GridGroupColumnController",class extends wr{}),t("ListService",class extends pi{initUIDataMap(){var t;super.initUIDataMap(),null==(t=this.model.delistDataItems)||t.forEach((t=>{const e=t.id.toLowerCase(),a=t.appDEFieldId;let s;if(a){const i=a.toLowerCase();s=new Ii(e,i,{isOriginField:!0,dataType:t.dataType})}else s=new Ii(e,e);this.dataUIMap.set(e,s)}))}})),Dr=(t("ListController",class extends Xi{initState(){super.initState(),this.state.noSort=!0===this.model.noSort}async onCreated(){await super.onCreated(),this.state.size=this.model.pagingSize||20,this.service=new Ir(this.model),await this.service.init(this.context)}setSort(t,e){if(t&&e)super.setSort(t,e);else{const{minorSortAppDEFieldId:t,minorSortDir:e}=this.model;if(t&&e){const a=this.fieldIdNameMap.get(t);this.state.sortQuery="".concat(a.toLowerCase(),",").concat(e.toLowerCase())}else this.state.sortQuery=""}}get batchToolbarController(){return this.view.getController("".concat(this.model.name,"_batchtoolbar"))}get quickToolbarController(){return this.view.getController("".concat(this.model.name,"_quicktoolbar"))}setSelection(t){var e,a;super.setSelection(t);const s=null==t?void 0:t[0];null==(e=this.batchToolbarController)||e.calcButtonState(s,this.model.appDataEntityId),null==(a=this.quickToolbarController)||a.calcButtonState(s,this.model.appDataEntityId)}async loadMore(){this.state.total>this.state.items.length&&await this.load({isLoadMore:!0})}async afterLoad(t,e){return await this.handleDataGroup(),e}setData(t){this.state.items=t}getAllData(){return this.state.items}async handleDataGroup(){const{enableGroup:t,groupMode:e}=this.model;t&&e&&("AUTO"===e?this.handleAutoGroup():"CODELIST"===e&&await this.handleCodeListGroup())}handleAutoGroup(){const{groupAppDEFieldId:t}=this.model;if(t){const{items:e}=this.state,a=new Map;e.forEach((e=>{const s=a.get(e[t])||[];s.push(e),a.set(e[t],s)}));const s=[];a.forEach(((t,e)=>{s.push({caption:e,key:e,children:[...t]})})),this.state.groups=s}}async handleCodeListGroup(){const{groupAppDEFieldId:t,groupCodeListId:e}=this.model;if(t&&e){const{items:a}=this.state,s=[],i=ibiz.hub.getApp(this.context.srfappid),n=await i.codeList.get(e,this.context,this.params),r=[];n.forEach((e=>{const i=a.filter((a=>a[t]===e.value));s.push({caption:e.text,key:e.value,children:[...i]}),r.push(e.value)}));const o=a.filter((e=>-1===r.indexOf(e[t])));o.length>0&&s.push({caption:"其他",key:"其他",children:[...o]}),this.state.groups=s}}}),t("PanelController",class extends Hi{constructor(){super(...arguments),this.panelItems={},this.providers={}}get data(){return this.state.data}initState(){super.initState(),this.state.data={}}setInputData(t){this.inputData=t}async onCreated(){await super.onCreated(),await this.initPanelItemControllers()}async onMounted(){this.load()}async initPanelItemControllers(t=this.model.rootPanelItems,e=this,a=void 0){t&&await Promise.all(t.map((async t=>{var s,i;const n=await ns(t);if(!n)return;e.providers[t.id]=n;const r=await n.createController(t,e,a);e.panelItems[t.id]=r,(null==(s=t.panelItems)?void 0:s.length)&&!r.isDataContainer&&await this.initPanelItemControllers(t.panelItems,e,r),(null==(i=t.panelTabPages)?void 0:i.length)&&await this.initPanelItemControllers(t.panelTabPages,e,r)})))}async load(){const t=await this.prepareData();if(!t)throw new e("未获取到面板数据");const a=this.convertData(t);this.state.data=a,this.panelStateNotify("LOAD")}async prepareData(){let t;if(1===this.model.dataMode)this.inputData&&(t=this.inputData);else t=this.inputData||{};return t}convertData(t){return t}dataChangeNotify(t){Object.values(this.panelItems).forEach((e=>{e.dataChangeNotify(t)}))}panelStateNotify(t){Object.values(this.panelItems).forEach((e=>{e.panelStateNotify(t)}))}async setDataValue(t,e){Object.prototype.hasOwnProperty.call(this.state.data,t)&&this.state.data[t]===e||(this.state.data[t]=e,this.dataChangeNotify([t]))}})),Cr=(t("ViewLayoutPanelController",class extends Dr{async onCreated(){this.preprocessModel(),await super.onCreated()}registerToCtx(){}preprocessModel(t){var e;const a=t=>{const e=[];return t.forEach((t=>{"CONTAINER"===t.itemType&&"PANELPART"===t.predefinedType?e.push(...t.panelItems||[]):e.push(t)})),e.forEach((t=>{"CONTAINER"===t.itemType&&this.preprocessModel(t)})),e};t?t.panelItems=a(t.panelItems||[]):(null==(e=this.model.rootPanelItems)?void 0:e.length)&&(this.model.rootPanelItems=a(this.model.rootPanelItems||[]))}}),t("PanelItemState",class{constructor(t){this.parent=t,this.disabled=!1,this.layout={width:"",height:"",extraStyle:{},extraClass:[],contentStyle:{}},this.class={container:[],containerDyna:[],label:[],labelDyna:[]},this.required=!1;let e,a=!0;Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,get(){var t;return!1!==(null==(t=this.parent)?void 0:t.visible)&&a},set:t=>(a=t,!0)}),Object.defineProperty(this,"keepAlive",{enumerable:!0,configurable:!0,get(){return void 0!==e?e:!!this.parent&&this.parent.keepAlive},set:t=>(e=t,!0)})}})),Ar=(t("PanelItemController",class{constructor(t,e,a){this.model=t,this.panel=e,this.parent=a,this.state=this.createState()}get dataParent(){return this.findDataParent(this)}get data(){return this.dataParent.data}get containerClass(){return[...this.state.class.container,...this.state.class.containerDyna]}get labelClass(){return[...this.state.class.label,...this.state.class.labelDyna]}async init(){await this.onInit()}async onInit(){const{layoutPos:t,sysCss:e,labelSysCss:a}=this.model;if(t){const{width:e,height:a}=We(t);this.state.layout.width="".concat(e),this.state.layout.height="".concat(a)}(null==e?void 0:e.cssName)&&this.state.class.container.push(e.cssName),(null==a?void 0:a.cssName)&&this.state.class.label.push(a.cssName)}createState(){var t;return new Cr(null==(t=this.parent)?void 0:t.state)}dataChangeNotify(t){this.calcDynamicLogic(t),this.calcDynaClass(this.data)}panelStateNotify(t){this.calcDynamicLogic([],!0),this.calcDynaClass(this.data)}calcDynamicLogic(t,e=!1){var a;this.parent&&!this.parent.state.visible||null==(a=this.model.panelItemGroupLogics)||a.forEach((a=>{const s=a.relatedItemNames||[];if(e||E(s,t))try{const t=wa(this.data,a);switch(a.logicCat){case"ITEMBLANK":this.state.required=!t;break;case"ITEMENABLE":this.state.disabled=!t;break;case"PANELVISIBLE":this.state.visible=t}}catch(t){ibiz.log.error(t)}}))}findDataParent(t){const{parent:e}=t;return e?e.isDataContainer?e:this.findDataParent(e):t.panel}calcDynaClass(t){if(this.model.dynaClass){const e=Be(this.model.dynaClass,t);e.length&&(this.state.class.containerDyna=e)}if(this.model.labelDynaClass){const e=Be(this.model.labelDynaClass,t);e.length&&(this.state.class.labelDyna=e)}}}),t("PickupViewPanelController",class extends Hi{async onCreated(){await super.onCreated(),this.mountCounter.enroll(this.model.embeddedAppDEViewId),this.initNavParam()}initNavParam(){const{navigateContexts:t,navigateParams:e}=this.model,a=this.context.clone(),s={...this.params};t&&Object.assign(a,Le(t,this.context,this.params)),e&&Object.assign(s,Le(e,this.context,this.params)),this.state.context=a,this.state.params=s}setEmbedView(t){this.embedView=t,this.embedView.state.isMounted?this.mountCounter.attend(this.model.embeddedAppDEViewId):this.embedView.evt.on("onMounted",(()=>{this.mountCounter.attend(this.model.embeddedAppDEViewId)})),this.embedView.evt.on("onSelectionChange",(t=>{this.evt.emit("onSelectionChange",t)})),this.embedView.evt.on("onDataActive",(t=>{this.evt.emit("onDataActive",{data:t.data})}))}async getSelectedData(){return await this.embedView.call("GetData")}async getAllData(){return await this.embedView.call("GetAllData")}}),t("SearchBarController",class extends Hi{constructor(){super(...arguments),this.placeHolder=""}initState(){super.initState(),this.state.query="",this.state.selectedGroupItem=null,this.state.visible=!!(this.model.enableQuickSearch||this.model.enableGroup||this.model.enableFilter)}async onCreated(){var t;await super.onCreated();const e=await ibiz.hub.getAppDataEntity(this.model.appDataEntityId,this.context.srfappid);if(e){const a=null==(t=e.appDEFields)?void 0:t.filter((t=>t.enableQuickSearch)),s=[];null==a||a.forEach((t=>{(null==t?void 0:t.lnlanguageRes)&&t.lnlanguageRes.lanResTag?s.push(ibiz.i18n.t(t.lnlanguageRes.lanResTag,t.logicName)):(null==t?void 0:t.logicName)&&s.push(t.logicName)})),s.length>0&&(this.placeHolder=s.join("、"))}}handleInput(t){this.state.query=t}handleSearch(){this.evt.emit("onSearch",void 0)}}),t("TabExpPanelController",class extends Hi{initState(){super.initState(),this.state.tabPages=[],this.state.activeName=""}async onCreated(){await super.onCreated(),this.layoutPanel=this.view.layoutPanel,this.initTabPages()}initTabPages(){const t=this.model.controls,e=[];t.forEach((t=>{e.push({caption:t.caption,tabTag:t.id,class:t.sysCss?[t.sysCss.cssName]:[]})})),this.state.tabPages=e,e.length>0&&this.initDefaultPage()}initDefaultPage(){const t=()=>{this.state.activeName=this.state.tabPages[0].tabTag,this.handleTabChange()};if(this.state.defaultTabName){const e=this.state.tabPages.find((t=>t.tabTag===this.state.defaultTabName));e?(this.state.activeName=e.tabTag,this.changeToTab()):t()}else t()}changeToTab(t=this.activeTabViewPanelModel){const e=this.getNavViewMsg(t);this.evt.emit("onNavViewChange",{navViewMsg:e})}get activeTabViewPanelModel(){const{activeName:t}=this.state;return this.model.controls.find((e=>e.id===t))}async handleTabChange(){this.activeTabViewPanelModel&&this.changeToTab()}prepareParams(t){const{navDER:e,navFilter:a,navigateContexts:s,navigateParams:i,appDataEntityId:n}=t,r={deName:ze(n),navFilter:a,pickupDEFName:null==e?void 0:e.pickupDEFName,navContexts:s,navParams:i},o={context:this.context,params:this.params,data:{}},{resultContext:c,resultParams:l}=ke(r,o);return{context:Object.assign(this.context.clone(),c,{currentSrfNav:this.state.activeName}),params:{...this.params,...l}}}getNavViewMsg(t){const{context:e,params:a}=this.prepareParams(t);return{key:t.codeName.toLowerCase(),context:e,params:a,viewId:t.embeddedAppDEViewId}}}),t("TreeService",class extends pi{async fetchChildNodes(t,e){const{hasQuery:a}=e;let s=[];if(t){const i=Je(this.model,{parentId:null==t?void 0:t.nodeId,hasQuery:a});if(0===i.length)return;(await Promise.allSettled(i.map((async a=>{const s=Qe(this.model,a.childDETreeNodeId);return this.fetchNodeDatasByType(s,a,t,e)})))).forEach((t=>{"fulfilled"===t.status&&t.value?s.push(...t.value):"rejected"===t.status&&ibiz.log.error(t.reason)}))}else{const t=qe(this.model);s=await this.fetchNodeDatasByType(t,void 0,void 0,e)}return s}async fetchNodeDatasByType(t,e,a,i){const n=0===Je(this.model,{parentId:t.id,hasQuery:i.hasQuery}).length,r={...i,leaf:n};let o=[];switch(t.treeNodeType){case"STATIC":o=[await this.getStaticNodeData(t,e,a,r)];break;case"DE":o=await this.getDENodeDatas(t,e,a,r);break;case"CODELIST":o=await this.getCodeListNodeDatas(t,e,a,r);break;default:throw new s(t,"".concat(t.treeNodeType,"节点类型未支持"))}const{expandFirstOnly:c,expanded:l,rootNode:h}=t,d=h&&!this.model.rootVisible;return n||await Promise.all(o.map((async(t,e)=>{var a;if(l&&(!c||c&&0===e)||(null==(a=i.defaultExpandedKeys)?void 0:a.length)&&i.defaultExpandedKeys.includes(t.id)||d){const e=await this.fetchChildNodes(t,i);t.children=e}}))),o}async getStaticNodeData(t,e,a,s){return new yi(t,a,{parentValueLevel:null==e?void 0:e.parentValueLevel,leaf:!!s.leaf})}getNodeRSFilterParams(t,e,a){const{parentValueLevel:s,navigateContexts:i,navigateParams:n,parentFilter:r,parentDER1N:o}=t,c=null==o?void 0:o.pickupDEFName,l={...a.params},h={...a.context,...(null==e?void 0:e.context)||{}};let d,u,p,m={};if(e){d=e;for(let t=1;t<s;t++)d=null==d?void 0:d.parent}if(d){m=d.deData||{};const t=Qe(this.model,d.nodeId);t.appDataEntityId&&(p=ze(t.appDataEntityId)),u=d.value}const{resultContext:f,resultParams:g}=ke({deName:p,navFilter:r?"n_".concat(r,"_eq"):void 0,pickupDEFName:c,navParams:n,navContexts:i},{derValue:u,context:h,params:l,data:m});return Object.assign(h,f),Object.assign(l,g),{context:h,params:l,navContext:f,navParams:g}}async getDENodeDatas(t,e,a,s){const{appDEDataSetId:i,appDataEntityId:n}=t,{context:r,params:o,navContext:c,navParams:l}=e?this.getNodeRSFilterParams(e,a,s):{context:s.context,params:s.params,navContext:{},navParams:{}};o.size=t.maxSize||1e3,t.sortAppDEFieldId&&t.sortDir&&Object.assign(o,{sort:"".concat(t.sortAppDEFieldId.toLowerCase(),",").concat(t.sortDir.toLowerCase())});const h=await this.app.deService.exec(n,i,r,o);if(h.data.length){return h.data.map((e=>new vi(t,a,{data:e,leaf:!!s.leaf,navContext:c,navParams:l})))}return[]}async getCodeListNodeDatas(t,e,a,s){const{context:i,params:n,navContext:r,navParams:o}=e?this.getNodeRSFilterParams(e,a,s):{context:s.context,params:s.params,navContext:{},navParams:{}},c=await this.app.codeList.get(t.codeListId,i,n);if(c.length){return c.map((e=>new Ei(t,a,{data:e,leaf:!!s.leaf,navContext:r,navParams:o})))}return[]}})),br=(t("TreeController",class extends Xi{constructor(){super(...arguments),this.contextMenus={}}initState(){super.initState(),this.state.defaultExpandedKeys=[],this.state.size=0}async onCreated(){await super.onCreated(),this.service=new Ar(this.model),await this.service.init(this.context),this.model.detreeNodes.forEach((t=>{var e,a;(null==(a=null==(e=t.decontextMenu)?void 0:e.detoolbarItems)?void 0:a.length)&&(this.contextMenus[t.decontextMenu.id]=new Bn(t.decontextMenu,this.context,this.params,this.ctx))})),await Promise.all(Object.values(this.contextMenus).map((t=>t.created())))}async load(t={}){const e=!0===t.isInitialLoad,a=await this.loadNodes();return this.state.expandedKeys=this.calcExpandedKeys(a),await this.afterLoad(t,a),this.state.isLoaded=!0,await this.evt.emit("onLoadSuccess",{isInitialLoad:e}),a}async loadNodes(t){const e=await this.getFetchParams(),a=!!e.query,s=t?void 0:this.state.defaultExpandedKeys;let i;await this.startLoading();try{i=await this.service.fetchChildNodes(t,{context:this.context.clone(),params:e,hasQuery:a,defaultExpandedKeys:s})||[]}finally{await this.endLoading()}return t?t.children=i:this.state.rootNodes=i,this.state.items=[],f({children:this.state.rootNodes},(t=>{this.state.items.push(t)})),i}async onTreeNodeClick(t){if(this.state.singleSelect){const{selectedData:e}=this.state,a=e.filter((e=>e.id!==t.id));a.length===e.length?this.setSelection(this.state.singleSelect?[t]:e.concat([t])):this.setSelection(a)}1===this.state.mdctrlActiveMode&&await this.setActive(t)}async onDbTreeNodeClick(t){2===this.state.mdctrlActiveMode&&await this.setActive(t)}setActive(t){const e=this.parseTreeNodeData(t);return this.evt.emit("onActive",{...e,nodeData:t})}setSelection(t){const e=t.map((t=>t.id)),a=this.state.items.filter((t=>e.includes(t.id)));super.setSelection(a)}getNodeModel(t){var e;return null==(e=this.model.detreeNodes)?void 0:e.find((e=>e.id===t))}async doUIAction(t,e,a){const s=this.getEventArgs(),i=this.parseTreeNodeData(e),n=await Nn.exec(t,{...s,...i,event:a});if(n.closeView)this.view.closeView();else if(n.refresh)switch(n.refreshMode){case 1:this.refreshNodeChildren(e);break;case 2:this.refreshNodeChildren(e,!0);break;case 3:this.refresh()}}parseTreeNodeData(t){return{data:[{...t,...t.deData||{}}],context:Object.assign(this.context.clone(),t.context||{}),params:{...this.params,...t.params||{}}}}calcExpandedKeys(t){let e=[];return f({children:t},(t=>{var a;(null==(a=t.children)?void 0:a.length)&&e.push(t.id)})),this.state.defaultExpandedKeys.length&&(e.push(...this.state.defaultExpandedKeys),e=Array.from(new Set(e))),e}async refreshNodeChildren(t,e=!1){const a=t.srfkey?"srfkey":"id",s=this.state.items.find((e=>e[a]===t[a]));if(!s)return void ibiz.log.error("找不到对应的树节点数据",t);if(e){const{parent:t}=s;if(!t||!this.model.rootVisible&&this.state.rootNodes.includes(t))return void this.refresh()}const i=e?s.parent:s,n=await this.loadNodes(i);this.evt.emit("onAfterRefreshParent",{parentNode:i,children:n})}}),t("WizardPanelService",class extends ui{async initialize(t,e={},a={}){var s;const i=null==(s=this.model.initControlAction)?void 0:s.appDEMethodId;let n=await this.exec(i,t,e,a);return n=this.handleResponse(n),n}async finish(t,e={},a={}){var s;const i=null==(s=this.model.finishControlAction)?void 0:s.appDEMethodId;let n=await this.exec(i,t,e,a);return n=this.handleResponse(n),n}})),Pr=(t("WizardPanelController",class extends Hi{constructor(){super(...arguments),this.tagHistory=[],this.providers={},this.firstForm=void 0,this.formControllers=new Map,this.steps=[],this.stepTags={}}initState(){super.initState()}async onCreated(){var t,e;await super.onCreated(),this.model.dewizard.dewizardForms.forEach((t=>{var e,a,s;t.firstForm&&(this.firstForm=t);const i="".concat(this.model.name,"_form_").concat(null==(e=t.formTag)?void 0:e.toLowerCase()),n=null==(s=null==(a=this.model.dewizard)?void 0:a.dewizardSteps)?void 0:s.find((e=>e.id===t.dewizardStepId)),r=null==n?void 0:n.stepTag;this.stepTags[i]=r})),null==(e=null==(t=this.model.dewizard)?void 0:t.dewizardSteps)||e.forEach((t=>{this.steps.push(t.stepTag)})),this.service=new br(this.model),await this.service.init(this.context);const{deeditForms:a}=this.model;a&&a.length>0&&await Promise.all(a.map((async t=>{const{formTag:e}=t.dewizardForm;if(e){const a=await Ka(t);a&&(this.providers[e]=a)}})))}get activeWizardForm(){const{activeFormTag:t}=this.state,e=this.model.dewizard.dewizardForms.find((e=>e.formTag===t));return e||ibiz.log.debug("找不到".concat(t,"的向导表单")),e}get activeFormController(){const{activeFormTag:t}=this.state,a=this.formControllers.get(t);if(!a)throw new e("找不到".concat(t,"的表单控制器"));return a}onFormMounted(t,e){const a=e.ctrl;this.formControllers.set(t,a),a.load()}onFormSaved(t){const e=t.data[0],a=ze(this.model.appDataEntityId);!this.context[a]&&e&&e.srfkey&&(this.context[a]=e.srfkey)}async initialize(){var t;if(null==(t=this.model.initControlAction)?void 0:t.appDEMethodId){const t=await this.service.initialize(this.context,this.params),e=ze(this.model.appDataEntityId);t.data&&t.data.srfkey&&(this.context[e]=t.data.srfkey)}this.firstForm&&(this.state.activeFormTag=this.firstForm.formTag,this.tagHistory.push(this.firstForm.formTag))}async finish(){await this.service.finish(this.context,this.params),this.evt.emit("onFinishSuccess",void 0)}async onPrevClick(){await this.activeFormController.goBack(),this.tagHistory.pop();const t=this.tagHistory[this.tagHistory.length-1];if(!t)throw new e("没有上一个表单");this.state.activeFormTag=t}async onNextClick(){const t=await this.activeFormController.save();let a;if(t.srfnextform){if(!this.model.dewizard.dewizardForms.find((e=>e.formTag===t.srfnextform)))throw new e("找不到标识为".concat(t.srfnextform,"的向导表单"));a=t.srfnextform}else{const{formTag:t}=this.activeWizardForm,s=this.model.dewizard.dewizardSteps;if(s&&t){const i=s.findIndex((e=>e.stepTag===t)),n=s[i+1];if(!n)throw new e("找不到下一个向导步骤");const r=this.model.dewizard.dewizardForms.find((t=>t.formTag===n.stepTag));r&&(a=r.formTag)}}if(!a)throw new e("找不到下一个向导表单");this.state.activeFormTag=a,this.tagHistory.push(a)}async onFinishClick(){await this.activeFormController.save(),await this.finish()}}),t("MDCtrlService",class extends pi{initUIDataMap(){var t;super.initUIDataMap(),null==(t=this.model.delistDataItems)||t.forEach((t=>{const e=t.id.toLowerCase(),a=t.appDEFieldId;let s;if(a){const i=a.toLowerCase();s=new Ii(e,i,{isOriginField:!0,dataType:t.dataType})}else s=new Ii(e,e);this.dataUIMap.set(e,s)}))}})),_r=t("MobMDCtrlRowState",class{constructor(t,e){this.data=t,this.controller=e,this.uaColStates={},this.data=t}}),Sr=(t("MDCtrlController",class extends Xi{initState(){super.initState(),this.state.rows=[],this.state.noSort=!0===this.model.noSort,this.state.mdctrlActiveMode=1}async onCreated(){await super.onCreated(),this.service=new Pr(this.model),await this.service.init(this.context),this.setSort()}setSort(t,e){if(t&&e)super.setSort(t,e);else{const{minorSortAppDEFieldId:t,minorSortDir:e}=this.model;this.state.sortQuery=t&&e?"".concat(t.toLowerCase(),",").concat(e.toLowerCase()):""}}async loadMore(){this.state.total>this.state.items.length&&!this.state.isLoading&&await this.load({isLoadMore:!0})}async refresh(){await this.load({isInitialLoad:!0})}afterLoad(t,e){return t.isInitialLoad&&(this.state.rows=[]),e&&e.length>0&&this.state.rows.push(...e.map((t=>{const e=new _r(t,this);return this.initActionStates(e),e}))),super.afterLoad(t,e)}setData(t){const e=t.map((t=>new _r(t,this)));this.state.rows=e}getAllData(){return this.state.rows.map((t=>t.data))}async onActionClick(t,e,a){const s=t.uiactionId;await Nn.execAndResolved(s,{context:this.context,params:this.params,data:[e.data],view:this.view,event:a})}initActionStates(t){const{deuiactionGroup:e,deuiactionGroup2:a}=this.model;e&&this.initUIActionGroup(t,e),a&&this.initUIActionGroup(t,a)}initUIActionGroup(t,e){var a;(null==(a=e.uiactionGroupDetails)?void 0:a.length)||ibiz.log.debug("操作列界面行为组没有配置界面行为");const s=new Ri;(e.uiactionGroupDetails||[]).forEach((t=>{const e=t.uiactionId;if(e){const a=new Oi(t.id,this.context.srfappid,e);s.addState(t.id,a)}})),s.update(t.data.getOrigin()),t.uaColStates[e.id]=s}}),t("KanbanService",class extends zn{async updateGroup(t,e){var a;const s=(null==(a=this.model.updateGroupControlAction)?void 0:a.appDEMethodId)||"update";let i=await this.exec(s,t,e.getOrigin());return i=this.handleResponse(i),i}})),xr=(t("KanbanController",class extends Gn{get enableEditOrder(){return!0===this.model.enableCardEditOrder}get enableEditGroup(){return!0===this.model.enableCardEditGroup}get enableNew(){return!0===this.model.enableCardNew}async initControlService(){this.service=new Sr(this.model),await this.service.init(this.context)}initState(){super.initState(),this.state.size=this.model.pagingSize||1e3,this.state.updating=!1,this.state.draggable=this.enableEditOrder||this.enableEditGroup}async onCreated(){await super.onCreated(),await this.initGroupActionStates()}async initGroupActionStates(){var t;const{groupUIActionGroup:e}=this.model;if(!(null==(t=null==e?void 0:e.uiactionGroupDetails)?void 0:t.length))return;const a=new Ri;e.uiactionGroupDetails.forEach((t=>{const e=t.uiactionId;if(e){const s=new Oi(t.id,this.context.srfappid,e);a.addState(t.id,s)}})),await a.update(),this.state.groupActionGroupState=a,this.evt.on("onSelectionChange",(t=>{let e=t.data[0];e&&e instanceof di&&(e=e.getOrigin()),e&&this.state.groupActionGroupState.update(e,this.model.appDataEntityId)}))}sortItems(t){const s=this.model.minorSortAppDEFieldId,{minorSortDir:i}=this.model;if(!s)throw new a(this.model,"排序属性没配置");if(!i)throw new a(this.model,"排序方向没配置");const n="ASC"===i;t.forEach((t=>{const a=t[s];if($(a))t[s]=0;else{const s=Number(a);if(Number.isNaN(s))throw new e("".concat(t.srfmajortext,"的排序属性无法转换成数值"))}})),t.sort(((t,e)=>n?t[s]-e[s]:e[s]-t[s]))}async afterLoad(t,e){return this.sortItems(this.state.items),super.afterLoad(t,e)}handleDataGroup(){if(!this.model.enableGroup||"NONE"===this.model.groupMode)throw new e("看板部件必须开启分组");return super.handleDataGroup()}async onDragChange(t){if(!this.enableEditGroup&&t.from!==t.to)return void ibiz.message.warning("当前看板不允许调整分组!");const e="ASC"===this.model.minorSortDir,{from:a,to:s,fromIndex:i,toIndex:n}=t,r=this.model.groupAppDEFieldId,o=this.model.minorSortAppDEFieldId,c=[],l=this.state.groups.find((t=>t.key===a)),h=this.state.groups.find((t=>t.key===s));if(!this.enableEditOrder){if(t.from===t.to)return void ibiz.message.warning("当前看板不允许调整次序");const e=l.children[i];return e[r]=t.to,this.updateChangedItems([e])}const d=t=>t+(100-t%100),u=[...h.children],p=[...h.children],m=l.children[i];t.from!==t.to?(m[r]=t.to,p.splice(n,0,m)):(p.splice(i,1),p.splice(n,0,m));const f=l.children.splice(i,1);let g;h.children.splice(n,0,...f),e||(u.reverse(),p.reverse());let w,E=[];p.forEach(((t,e)=>{void 0===g?t!==u[e]&&(g=u[e]?u[e][o]||100:0===e?100:d(u[e-1][o]),t[o]=g,c.push(t)):(g>=t[o]?(E.length>0&&(E.forEach((t=>{t[o]=d(w),c.push(t),w=t[o]})),g=w,w=0,E=[]),t[o]=d(g),c.push(t)):(0===E.length&&(w=g),E.push(t)),g=t[o])})),this.updateChangedItems(c)}async updateChangedItems(t){try{this.state.updating=!0,await Promise.all(t.map((async t=>{const e=ze(this.model.appDataEntityId),a=this.context.clone();a[e]=t.srfkey;const s=await this.service.updateGroup(a,t);if(s.data){const e=this.state.items.findIndex((e=>e.srfkey===t.srfkey));this.state.items.splice(e,1,s.data)}})))}finally{this.state.updating=!1,await this.afterLoad({},this.state.items)}}onClickNew(t,e){const a={...this.params,srfgroup:e};Nn.execAndResolved("new",{context:this.context,params:a,data:[],view:this.view,event:t})}async onGroupToolbarClick(t,e,a){const s=t.uiactionId,i={...this.params,srfgroup:a};await Nn.execAndResolved(s,{context:this.context,params:i,data:this.state.selectedData,view:this.view,event:e})}}),t("HubController",class{constructor(){this.session={}}login(t,e){return ibiz.auth.login(t,e)}logout(){return ibiz.auth.logout()}})),Tr=class{constructor(){this.convert=new class{constructor(){this.appMenu=new class{parse(t){return t}}}},this.controller=new xr,this.appMap=new Map,this.apps=new Map,this.view2appMap=new Map,this.views=new Map,this.dataEntities=new Map,this.config=new class{constructor(){this.view=new class{constructor(){this.viewConfigs=new Map}set(t,e){this.viewConfigs.set(t,e)}async get(t){if(!this.viewConfigs.has(t)){const a=await ibiz.hub.getAppView(t);if(!a)throw new e("视图[".concat(t,"]不存在"));this.set(a.id,{id:a.id,codeName:a.codeName,openMode:a.openMode,viewType:a.viewType,width:a.width,height:a.height,appDataEntityId:a.appDataEntityId,redirectView:a.redirectView})}return this.viewConfigs.get(t)}}}},this.defaultAppIndexViewName="Index"}calcAppViewId(t){let e="";if(-1!==t.indexOf(".")){const a=t.split(".");e=a[a.length-1]}else e=t.toLowerCase();return e}registerModelLoaderProvider(t){this.modelLoaderProvider=t}registerApp(t){this.apps.set(t.codeName,t)}registerAppView(t){this.views.set(t.codeName,t)}registerAppDataEntity(t,e=ibiz.env.appId){this.dataEntities.has(e)||this.dataEntities.set(e,new Map);this.dataEntities.get(e).set(t.id,t)}setAppView(t,e=ibiz.env.appId){const a=this.calcAppViewId(t);this.view2appMap.set(a,e)}hasAppView(t){const e=this.calcAppViewId(t);return this.view2appMap.has(e)}async getAppStyle(t){return this.modelLoaderProvider?this.modelLoaderProvider.getAppStyle(t):null}async getAppView(t){const a=this.calcAppViewId(t),s=this.view2appMap.get(a)||ibiz.env.appId;if(this.appMap.has(s)||await this.createApp(s),this.views.has(a))return this.views.get(a);if(this.modelLoaderProvider){const t=await this.modelLoaderProvider.getAppView(s,a);return this.registerAppView(t),t}throw new e("视图[".concat(a,"]不存在"))}async getAppDataEntity(t,a=ibiz.env.appId){if(this.dataEntities.has(a)){const e=this.dataEntities.get(a);if(e.has(t))return e.get(t)}if(this.modelLoaderProvider){let e;return e=-1!==t.indexOf(".")?await this.modelLoaderProvider.getAppDataEntity(a,t):await this.modelLoaderProvider.getAppDataEntityByCodeName(a,t),this.registerAppDataEntity(e,a),e}throw new e("未找到应用实体[".concat(t,"]"))}async createApp(t){if(this.appMap.has(t))return this.appMap.get(t);let a;if(this.apps.has(t))a=this.apps.get(t);else{if(!this.modelLoaderProvider)throw new e("未找到应用[".concat(t,"]模型"));a=await this.modelLoaderProvider.getApp(t),this.registerApp(a)}const s=new Ai(a);return this.appMap.set(t,s),await s.init(),s}async getAppAsync(t=ibiz.env.appId){return this.createApp(t)}getApp(t){let e=null;return e=t?t instanceof Object?t.id:t:ibiz.env.appId,this.appMap.get(e)}},Lr=t("EngineFactory",class{constructor(){this.viewEngines=new Map}register(t,e){this.viewEngines.set(t,e)}unRegister(t){this.viewEngines.delete(t)}getEngine(t,...e){const{engineType:a,engineCat:s}=t,i="".concat(s,"_").concat(a),n=this.viewEngines.get(i);if(n)return n(...e);ibiz.log.error("没有".concat(i,"对应的引擎"),t)}}),Nr=t("ViewEngineBase",class{constructor(t){this.view=t,this.initViewState()}get toolbar(){return this.view.getController("toolbar")}get leftToolbar(){return this.view.getController("lefttoolbar")}get rightToolbar(){return this.view.getController("righttoolbar")}get footerToolbar(){return this.view.getController("footertoolbar")}get viewLayoutPanel(){return this.view.layoutPanel}async onCreated(){const{childNames:t}=this.view;t.push("captionbar","toolbar")}async onMounted(){var t,e;const{model:a,childNames:s}=this.view;ibiz.log.debug("".concat(a.id,"的子组件:").concat(s.join(";"),"都已mounted"));if(!this.calcViewHeaderVisible()){const e=null==(t=this.viewLayoutPanel)?void 0:t.panelItems.view_header;e&&(e.state.visible=!1)}if(ibiz.env.isMob){if(!this.calcViewFooterVisible()){const t=null==(e=this.viewLayoutPanel)?void 0:e.panelItems.view_footer;t&&(t.state.visible=!1)}}}async onDestroyed(){}async call(t,e){if("GetData"===t)return this.getData()}initViewState(){}getData(){return[]}calcViewHeaderVisible(){var t,e,a,s;let i=!1;const{model:n}=this.view;if(!1===n.showCaptionBar){const e=null==(t=this.viewLayoutPanel)?void 0:t.panelItems.view_captionbar;e&&(e.state.visible=!1)}else i=!0;if(ibiz.env.isMob){if(this.leftToolbar)i=!0;else{const t=null==(e=this.viewLayoutPanel)?void 0:e.panelItems.lefttoolbar;t&&(t.state.visible=!1)}if(this.rightToolbar)i=!0;else{const t=null==(a=this.viewLayoutPanel)?void 0:a.panelItems.righttoolbar;t&&(t.state.visible=!1)}}else if(this.toolbar)i=!0;else{const t=null==(s=this.viewLayoutPanel)?void 0:s.panelItems.view_toolbar;t&&(t.state.visible=!1)}return i}calcViewFooterVisible(){let t=!1;return this.footerToolbar&&(t=!0),t}async loadEntityData(){const{appDataEntityId:t}=this.view.model,{evt:a,context:s,params:i}=this.view;if(!t)throw new e("该视图没有实体,无法加载实体数据");const n=ibiz.hub.getApp(s.srfappid),r=await n.deService.exec(t,"get",s,i),{data:o}=r;o&&(this.view.state.srfactiveviewdata=o,a.emit("onDataChange",{actionType:"LOAD",data:[o]}),o.srfkey&&a.emit("onViewInfoChange",{dataInfo:o.srfmajortext||""}))}}),Or=(t("MDViewEngine",class extends Nr{get xdataControlName(){return this.view.model.xdataControlName}get searchForm(){return this.view.getController("searchform")}get searchBar(){return this.view.getController("searchbar")}get xdataControl(){return this.view.getController(this.xdataControlName)}async onCreated(){await super.onCreated();const{childNames:t}=this.view;t.push(this.xdataControlName,"searchform","searchbar")}async onMounted(){await super.onMounted();const{model:t}=this.view;this.xdataControl.evt.on("onActive",this.onXDataActive.bind(this)),this.xdataControl.evt.on("onSelectionChange",(async t=>{var e;null==(e=this.toolbar)||e.calcButtonState(t.data[0],this.xdataControl.model.appDataEntityId)})),this.xdataControl.evt.on("onBeforeLoad",(()=>{this.xdataControl.state.searchParams=this.getSearchParams()})),this.xdataControl.evt.on("onLoadSuccess",(t=>{this.view.evt.emit("onDataChange",{...t,actionType:"LOAD"})})),this.xdataControl.evt.on("onRemoveSuccess",(t=>{this.view.evt.emit("onDataChange",{...t,actionType:"REMOVE"})})),this.xdataControl.evt.on("onSaveSuccess",(t=>{this.view.evt.emit("onDataChange",{...t,actionType:"SAVE"})}));const e=this.viewLayoutPanel.panelItems.view_searchform;if(e){const a=!!this.searchForm;e.state.keepAlive=a,e.state.visible=a&&!!t.expandSearchForm}this.searchForm&&this.searchForm.evt.on("onSearch",(()=>{this.reLoad()})),this.searchBar&&this.searchBar.evt.on("onSearch",(()=>{this.reLoad()})),!this.view.state.noLoadDefault&&t.loadDefault&&this.load()}async onXDataActive(t){await this.openData(t)}async call(t,e){return"ToggleFilter"===t?(this.toggleFilter(),null):"Edit"===t||"View"===t?(await this.openData(e),null):"New"===t?(await this.newData(e),null):"Remove"===t?(await this.remove(e),null):"Import"===t?(await this.importData(),null):"Refresh"===t?(await this.refresh(),null):"ExportExcel"===t?(await this.exportData(e),null):"Copy"===t?(this.copy(e),null):"Load"===t?(this.load(e),null):super.call(t,e)}getData(){return this.xdataControl.getData()}async openData(t){var e,a;const{data:s,event:i}=t,n=(t.context||this.view.context).clone(),r=t.params||this.view.params;n[((null==(e=s[0].srfdecodename)?void 0:e.toLowerCase())||ze(this.xdataControl.model.appDataEntityId)).toLowerCase()]=s[0].srfkey;const o=await(null==(a=this.view.scheduler)?void 0:a.triggerCustom("opendata",{context:n,params:r,data:s,event:i,view:this.view}));o instanceof Object&&o.ok?this.refresh():-1===o&&ibiz.log.warn("视图[".concat(this.view.model.codeName,"],未配置编辑打开视图"))}async newData(t){var e,s,i;const{data:n,event:r,copyMode:o}=t;if(!(null==(s=null==(e=this.view.model.viewLayoutPanel)?void 0:e.appViewLogics)?void 0:s.find((t=>"newdata"===t.id))))throw new a(this.view.model,"缺少newdata的视图逻辑");const c=this.view.context.clone();o&&(c.srfcopymode=!0);const l=await(null==(i=this.view.scheduler)?void 0:i.triggerCustom("newdata",{context:c,params:this.view.params,data:n,event:r,view:this.view}));if(l instanceof Object&&l.ok)this.refresh();else if(-1===l)throw new a(this.view.model,"缺少newdata的视图逻辑")}async remove(t){await this.xdataControl.remove(t)}async load(t={}){await this.xdataControl.load({isInitialLoad:!0,...t})}async refresh(){await this.xdataControl.refresh()}async reLoad(){await this.xdataControl.load({isInitialLoad:!0})}getSearchParams(){var t;const e={};if(this.searchForm){const t=this.searchForm.getData()[0],a=Object.entries(t).reduce(((t,[e,a])=>(null!=a&&""!==a&&(t[e]=a),t)),{});Object.assign(e,a)}if(this.searchBar){if(this.searchBar.state.query){const t={query:this.searchBar.state.query};Object.assign(e,t)}if(null==(t=this.searchBar.state.selectedGroupItem)?void 0:t.data){const t=new Function("return (".concat(this.searchBar.state.selectedGroupItem.data,");"))();Object.assign(e,t)}}return e}async importData(){await this.xdataControl.importData()}async exportData(t){await this.xdataControl.exportData(t)}async copy(t){this.newData(Object.assign(t,{copyMode:!0}))}calcViewHeaderVisible(){let t=super.calcViewHeaderVisible();if(this.searchBar&&this.searchBar.state.visible)t=!0;else{const t=this.viewLayoutPanel.panelItems.view_searchbar;t&&(t.state.visible=!1)}return t}toggleFilter(){if(this.searchForm){const t=this.viewLayoutPanel.panelItems.view_searchform;t&&(t.state.visible=!t.state.visible)}}}),class{constructor(){this.layoutPanel=new Ea,this.text=new Ta,this.hbs=new Te}showAppLoading(){const t=document.getElementById("app-loading-x");t&&(t.style.display="none")}hiddenAppLoading(){setTimeout((()=>{const t=document.getElementById("app-loading-x");t&&(t.style.display="none")}),300)}}),Rr=class{constructor(t,e){this.logic=t,this.scheduler=e,this.type=t.logicType}execute(t){throw new e("Method not implemented.")}destroy(){}},Mr=class extends Rr{constructor(){super(...arguments),this.initialized=!1}convertScriptArgs(t){return t}init(t,e,a){this.convertScriptArgs=e;const s=this.logic.scriptCode;this.scriptFn=pa.createScriptFn(t,s,a),this.initialized=!0}execute(t){const e=this.convertScriptArgs(t);return this.scriptFn.exec(e)}},kr=class extends Rr{execute(t){const{appDEUILogicId:e,appDataEntityId:s}=this.logic;if(!e)throw new a(this.logic,"没有配置实体界面逻辑");Ln(e,s,t)}},Vr=class{constructor(t){this.triggers=new Map,this.executors=new Map,this.hasViewEventTrigger=!1,this.hasControlEventTrigger=!1,this.logics=t,t.forEach((t=>{try{const e=this.createExecutor(t);this.executors.set(t.id,e);const a=this.createTrigger(t);this.triggers.set(t.id,a),a.bindExecutor(e)}catch(t){ibiz.log.error(t.message)}}))}destroy(){this.triggers.forEach((t=>t.destroy())),this.executors.forEach((t=>t.destroy()))}getExecuteParams(t){let e={};return this.defaultParamsCb&&(e=this.defaultParamsCb()),et(t,e)}createTrigger(t){switch(t.triggerType){case"VIEWEVENT":this.hasViewEventTrigger=!0;break;case"CTRLEVENT":this.hasControlEventTrigger=!0}return ibiz.scheduler.triggerFactory.createTrigger(t,this)}createExecutor(t){return ibiz.scheduler.executorFactory.createExecutor(t,this)}getMatchTriggers(t){const e=[];return this.triggers.forEach((a=>{a.match(t)&&e.push(a)})),e}triggerAndExecute(t,e={}){const a=this.getMatchTriggers(t);if(a.length>0){const t=this.getExecuteParams(e);return a.map((e=>e.execute(t)))}}triggerItemDynaLogic(t,e,a){const s={itemName:t,triggerType:e},i=this.triggerAndExecute(s,a);if(null==i?void 0:i.length)return i.pop()}triggerItemVisible(t,e){return this.triggerItemDynaLogic(t,"ITEMVISIBLE",e)}triggerItemEnable(t,e){return this.triggerItemDynaLogic(t,"ITEMENABLE",e)}triggerItemBlank(t,e){return this.triggerItemDynaLogic(t,"ITEMBLANK",e)}startTimerTrigger(){this.getMatchTriggers({triggerType:"TIMER"}).forEach((t=>t.start()))}triggerCustom(t,e){const a=this.triggers.get(t);if(!a)return-1;const s=this.getExecuteParams(e);return a.execute(s)}triggerControlEvent(t,e){const a={ctrlName:t,eventName:e.eventName,triggerType:"CTRLEVENT"};this.triggerAndExecute(a,e)}},Fr=class extends Vr{constructor(t){super(t.filter((t=>"APPVIEWENGINE"!==t.triggerType)))}},Wr=class extends Vr{constructor(t){t.forEach((t=>{t.triggerType=t.logicTrigger})),super(t)}triggerViewEvent(t){const e={eventName:t.eventName,triggerType:"VIEWEVENT"};this.triggerAndExecute(e,t)}},Br=class{constructor(){this.executorFactory=new class{constructor(){this.constructorMap=new Map}register(t,e){this.constructorMap.set(t,e)}createExecutor(t,e){const a=this.constructorMap.get(t.logicType);if(!a)throw new s(t,"逻辑类型 ".concat(t.logicType," 暂未支持!"));return a(t,e)}},this.triggerFactory=new class{constructor(){this.constructorMap=new Map}register(t,e){this.constructorMap.set(t,e)}createTrigger(t,e){const a=this.constructorMap.get(t.triggerType);if(!a)throw new s(t,"触发器类型 ".concat(t.triggerType," 暂未支持!"));return a(t,e)}}}createViewScheduler(t){return new Wr(t)}createControlScheduler(t){return new Fr(t)}},Ur=class{constructor(t,e){this.logic=t,this.scheduler=e,this.type=t.triggerType}bindExecutor(t){this.executor=t,"SCRIPT"===this.executor.type&&this.bindScriptExecutor(t)}bindScriptExecutor(t){t.initialized||t.init([],(t=>t),{isAsync:!0,singleRowReturn:!1})}match(t){return t.triggerType===this.type}execute(t){if(this.executor)return this.executor.execute(t);throw new e("".concat(this.logic.id,"没有绑定executor"))}destroy(){this.executor=void 0}},jr=class extends Ur{},zr=class extends Ur{bindExecutor(t){if(super.bindExecutor(t),"SCRIPT"!==this.executor.type)throw new e("预定义逻辑类型".concat(this.type,"的触发器类型只能是脚本"))}bindScriptExecutor(t){t.init(["context","viewparams","data","env"],(t=>{const{context:e,params:a,data:s}=t;return{context:e,params:a,data:(null==s?void 0:s[0])||{},env:ibiz.env}}),{singleRowReturn:!0,isAsync:!1})}match(t){return super.match(t)&&t.itemName===this.logic.itemName}execute(t){const a=this.executor.execute(t);if("boolean"==typeof a)return a;throw new e("".concat(this.logic.id,"逻辑返回值不是布尔值"))}},Gr=class extends Ur{constructor(){super(...arguments),this.timer=null}start(){this.timer=setInterval((()=>{if(!this.scheduler.defaultParamsCb)throw new e("定时器缺少默认参数回调");const t=this.scheduler.defaultParamsCb();this.executor.execute(t)}),this.logic.timer)}destroy(){super.destroy(),this.timer&&clearInterval(this.timer)}},Hr=class extends Rr{execute(t){return"opendata"===this.logic.id&&this.logic.builtinAppUILogic?this.executeOpenDataAppUILogic(this.logic.builtinAppUILogic,t):"newdata"===this.logic.id&&this.logic.builtinAppUILogic?this.executeNewDataAppUILogic(this.logic.builtinAppUILogic,t):void 0}async executeOpenDataAppUILogic(t,s){const{context:i,params:n,...r}=s,{data:o}=s;if(!(null==o?void 0:o[0]))throw new e("opendata没有可操作数据!");let c;if(t.openDataAppViews)c=await this.calcOpenViewRef(t,s);else if(c=t.openDataAppView,!c)throw new a(t,"opendata视图逻辑没有配置默认打开视图");const l=c.refAppViewId;if(!l)throw new a(t,"opendata视图逻辑的默认打开视图没有实际引用视图");const h=c.navigateContexts||[],d=Object.assign(i,Le(h,i,n,o[0]));let u={};const p=c.navigateParams;return k(p)&&(u=Le(p,n,i,o[0])),ibiz.commands.execute(Na.TAG,l,d,u,r)}async executeNewDataAppUILogic(t,e){const{context:i,params:n,...r}=e,{data:o}=e,{enableWizardAdd:c,enableBatchAdd:l,batchAddOnly:h,newDataAppView:d}=t;let u;if(c){if(u=await this.getWizardNewViewRef(t,e),!u)return{ok:!1}}else{if(l)throw new s(t,"enableBatchAdd暂未支持");if(h)throw new s(t,"batchAddOnly暂未支持");if(u=d,!u||!u.refAppViewId)throw new a(t,"newdata视图逻辑没有配置默认新建数据视图")}let p={},m={};const f=(null==o?void 0:o[0])||{},g=u.navigateContexts;k(g)&&(p=Le(g,i,n,f)),p=Object.assign(i,p);const w=u.navigateParams;return k(w)&&(m=Le(w,n,i,f)),i.srfcopymode&&(f.srfkey=void 0,m=Object.assign(m,f.$origin)),ibiz.commands.execute(Na.TAG,u.refAppViewId,p,m,r)}async getWizardNewViewRef(t,s){var i;const{wizardAppView:n,newDataAppViews:r}=t,{context:o,params:c,...l}=s;if(!n||!n.refAppViewId)throw new a(t,"缺少默认索引实体选择视图");const h=await ibiz.commands.execute(Na.TAG,n.refAppViewId,o,c,{...l,openMode:"POPUPMODAL"});if(!h.ok)return;const d=null==(i=h.data)?void 0:i[0];if(!d)throw new e("请选中一条数据");const u=d.srfkey,p=null==r?void 0:r.find((t=>t.refMode===u));if(!p)throw new e("没有找到与索引类型".concat(u,"相关的实体的编辑视图"));return p}async calcOpenViewRef(t,s){const i=s.view.model.appDataEntityId,n=await He(i);if(!n)throw new a(t,"".concat(i,"实体缺少表单类型应用实体属性"));const{data:r}=s,o=r[0][n];if(!o)throw new a(t,"数据源无表单类型应用实体属性值");const c=t.openDataAppViews,l=null==c?void 0:c.find((t=>t.refMode===o));if(!l)throw new e("没有找到与表单类型".concat(o,"相关的实体的编辑视图"));return l}},Xr=class extends Ur{constructor(t,e){super(t,e),this.logic=t,this.scheduler=e,this.listenEventNames=[];const a=t.eventNames.split(";");this.listenEventNames=a.map((t=>ba[t]||t))}match(t){return super.match(t)&&this.listenEventNames.includes(t.eventName)}},Kr=class extends Ur{constructor(t,e){super(t,e),this.logic=t,this.scheduler=e,this.listenEventNames=[];const a=t.eventNames.split(";");this.listenEventNames=a.map((t=>_a[t]||t))}match(t){return super.match(t)&&t.ctrlName===this.logic.ctrlName&&this.listenEventNames.includes(t.eventName)}};var Yr=wt(re(),1);t("PluginStaticResource",class{constructor(t){this.styleElementMap=new Map,this.url=new URL(t);const e=Yr.default.dirname(this.url.pathname);this.baseDir=e}dir(t){return Yr.default.resolve(this.baseDir,t)}async loadStyle(t){const e=t.map((t=>{const e=this.dir(t);return!this.styleElementMap.has(e)&&(this.styleElementMap.set(e,null),new Promise(((t,a)=>{const s=document.createElement("link");s.setAttribute("type","text/css"),s.setAttribute("rel","stylesheet"),s.setAttribute("href",e),s.onload=t,s.onerror=a,document.head.appendChild(s)})))}));try{await Promise.all(e)}catch(t){ibiz.log.error(t)}}}),t("RemotePluginItem",class{constructor(t,e,a){this.tag=t,this.repo=e,this.config=a}})}}}));
|
|
2
2
|
//# sourceMappingURL=index.system.min.js.map
|