ss-component-new 1.3.337 → 1.3.339
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/{MTLLoader-jmy4E_Nq.js → MTLLoader-C-XJYnXR.js} +1 -1
- package/dist/{MTLLoader-DeO6Um2T.cjs → MTLLoader-Dx_OCevv.cjs} +1 -1
- package/dist/{OrbitControls-OI4S8Ss9.cjs → OrbitControls-B55yzIKX.cjs} +1 -1
- package/dist/{OrbitControls-d0EKaole.js → OrbitControls-BB87FyuR.js} +1 -1
- package/dist/{URDFLoader-C9U3YLE3.js → URDFLoader-DgP2bMhH.js} +2 -2
- package/dist/{URDFLoader-BAvkWmPl.cjs → URDFLoader-Uh4bBb-n.cjs} +1 -1
- package/dist/{animationData-cDYkVSEQ.cjs → animationData-BfEyrEkb.cjs} +1 -1
- package/dist/{animationData-DoAZHpIw.js → animationData-CF6benhM.js} +3 -3
- package/dist/{array-CrTLC209.cjs → array-Dk18oefG.cjs} +1 -1
- package/dist/{array-DPIbkzAq.js → array-Dz0LlM28.js} +5 -5
- package/dist/clone-BDBSWARv.cjs +1 -0
- package/dist/{clone-Cq3E8M0n.js → clone-BqeCvECh.js} +1 -1
- package/dist/{dayjs.min-CgL8CUmE.cjs → dayjs.min-CSW85jLQ.cjs} +1 -1
- package/dist/{dayjs.min-D82Omxyk.js → dayjs.min-bC5IyY3C.js} +1 -1
- package/dist/{iconfont-3EHR8Y8T.js → iconfont-DV-mBuRs.js} +2 -2
- package/dist/{iconfont-BpiJ_H_8.cjs → iconfont-rvMUQHIL.cjs} +1 -1
- package/dist/{index-B0HtXP3c.cjs → index--E8u7lHy.cjs} +6 -6
- package/dist/{index-CVW6ocwE.js → index-0VkKesv_.js} +5 -5
- package/dist/{index-CWlkZnzj.js → index-9nQLsFiY.js} +2 -2
- package/dist/{index-Bt71db9N.cjs → index-B38fQMRk.cjs} +1 -1
- package/dist/{index-CZxLvSoF.cjs → index-BIg-Nt0x.cjs} +1 -1
- package/dist/{index-FT4cWo_D.cjs → index-BPpYDffY.cjs} +1 -1
- package/dist/{index-AtuQrqdk.cjs → index-BQO25T-T.cjs} +1 -1
- package/dist/{index-Cv459e1t.js → index-BSCoLGXF.js} +13 -13
- package/dist/{index-BjjRSikL.cjs → index-BTgJ9oD-.cjs} +1 -1
- package/dist/{index-Di2dGeYC.cjs → index-BWpqDCVF.cjs} +1 -1
- package/dist/{index-Dzhe1GDF.cjs → index-BchGbZ1v.cjs} +1 -1
- package/dist/{index-C9n2IdSF.js → index-Bdh2uHRO.js} +10 -10
- package/dist/{index-B2RpeENU.cjs → index-Bio1_C_H.cjs} +1 -1
- package/dist/{index-CZpCRnrF.js → index-BmJV5eVh.js} +551 -546
- package/dist/{index-BTQEQOOd.cjs → index-BtyugMgY.cjs} +1 -1
- package/dist/{index-Cp4UcGm_.cjs → index-BzeH13wt.cjs} +1 -1
- package/dist/{index-W1ODg0JF.js → index-C3-1AlM-.js} +3 -3
- package/dist/{index-D3oujbd2.cjs → index-C3lScvOV.cjs} +1 -1
- package/dist/{index-dIJsWS9o.js → index-C4NN-IA4.js} +2 -2
- package/dist/{index-o-_gdA1W.js → index-C6gCT4vd.js} +2 -2
- package/dist/{index-C_E9-O0A.js → index-C9baGOvW.js} +19 -19
- package/dist/{index-D_of08gn.js → index-CHAqLCtD.js} +5 -5
- package/dist/{index-DjIpVN-y.js → index-CHIMUYG3.js} +5 -5
- package/dist/{index-BBtYvFuT.js → index-CHnN0kSC.js} +5 -5
- package/dist/{index-DjRwNdm-.cjs → index-CMsGT7Tl.cjs} +1 -1
- package/dist/{index-TFngW3Jj.cjs → index-COTur3RT.cjs} +1 -1
- package/dist/{index-DZixAZ5c.cjs → index-COowXWF7.cjs} +1 -1
- package/dist/{index-BnAtvyG2.cjs → index-CUp0Z80f.cjs} +1 -1
- package/dist/{index-CEdinvEs.js → index-CYgpY06q.js} +1 -1
- package/dist/{index-ui9KJMHx.cjs → index-Ca3THBbJ.cjs} +1 -1
- package/dist/{index-Dpvc_TgG.js → index-CbBP02RV.js} +2 -2
- package/dist/{index-CcJVmCWc.js → index-CgjHHxqY.js} +3 -3
- package/dist/{index-B6GI7AFJ.cjs → index-CoX9mofW.cjs} +1 -1
- package/dist/{index-D3_5DC2L.cjs → index-CyQV3nI9.cjs} +1 -1
- package/dist/{index-WmmA2Paa.js → index-D0gKkud0.js} +9 -9
- package/dist/{index-u2jKa3pH.js → index-D6Zkrpou.js} +7 -7
- package/dist/{index-DAuI8IMG.cjs → index-DBhc2SoQ.cjs} +1 -1
- package/dist/{index-B8EYYLlD.cjs → index-DBrXonf1.cjs} +1 -1
- package/dist/{index-xNjjdlF1.cjs → index-DEfKSijb.cjs} +1 -1
- package/dist/{index-Cu_-IwFX.js → index-DGwbEHLN.js} +4 -4
- package/dist/{index-Dd5C_JQx.js → index-DLLST1Nd.js} +7 -7
- package/dist/{index-DoC7uXaP.js → index-DMt7y2yA.js} +4 -4
- package/dist/{index-DsRHbJ39.js → index-DN4OcDlg.js} +1 -1
- package/dist/{index-DmzyoBIH.cjs → index-DNyLSjIf.cjs} +1 -1
- package/dist/{index-CDPJ1gZw.cjs → index-DOQApax-.cjs} +1 -1
- package/dist/{index-DTKxjGXg.js → index-DWP-FYxV.js} +3 -3
- package/dist/{index-CbXxScp7.js → index-Dcp8sI4C.js} +2 -2
- package/dist/{index-BTVJs4Qn.cjs → index-DtlQjI5L.cjs} +1 -1
- package/dist/{index-CJ_USvr0.js → index-DyJCopUt.js} +2 -2
- package/dist/{index-NVJooHQp.cjs → index-FJ_oMfF3.cjs} +1 -1
- package/dist/{index-b2PDK9e_.js → index-Ijbw1FIL.js} +5 -5
- package/dist/{index-q0enUFL5.cjs → index-L9DruvvE.cjs} +1 -1
- package/dist/{index-DgWNadGn.js → index-S2ChvJMP.js} +1 -1
- package/dist/{index-CzRpNRv3.cjs → index-T25jN7df.cjs} +1 -1
- package/dist/{index-bu5APbi2.cjs → index-W6w3oiQ2.cjs} +1 -1
- package/dist/{index-DRfdKEbY.cjs → index-Zvul3j_r.cjs} +1 -1
- package/dist/{index-CrCre0RI.js → index-c1EWDQO1.js} +1 -1
- package/dist/{index-DRUJiyUd.js → index-ipcwULw-.js} +4 -4
- package/dist/{index-BuYL2ZYa.js → index-rW-jQkgq.js} +2 -2
- package/dist/{index-DlQupXnC.js → index-voXPz7Hq.js} +4 -4
- package/dist/{index.vue_vue_type_style_index_0_scoped_6b92e250_lang-COY3eZh7.js → index.vue_vue_type_style_index_0_scoped_6b92e250_lang-CHrvpoVb.js} +5 -5
- package/dist/{index.vue_vue_type_style_index_0_scoped_6b92e250_lang-CIyM7NyQ.cjs → index.vue_vue_type_style_index_0_scoped_6b92e250_lang-Dyd5heHe.cjs} +1 -1
- package/dist/{main-CMdjbpzI.js → main-Cd_mObtH.js} +5 -5
- package/dist/{main-1pdse-uA.cjs → main-FOjt8u8O.cjs} +1 -1
- package/dist/{menu-CHtFM8LT.cjs → menu-7kw8Lwp_.cjs} +1 -1
- package/dist/{menu-k8p_Kdpk.js → menu-CK0ndSHP.js} +1 -1
- package/dist/{menuIndex-Cau478sA.cjs → menuIndex-Ba-9R5jd.cjs} +1 -1
- package/dist/{menuIndex-3I7Xt7_d.js → menuIndex-DiNvd_FY.js} +1 -1
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.js +13 -13
- package/dist/ss-component3.cjs +1 -1
- package/dist/ss-component3.js +4 -2
- package/dist/{threeModel-DBMZIQsl.js → threeModel-CIZ5D8Df.js} +4 -4
- package/dist/{threeModel-CZohvZSN.cjs → threeModel-Dekl17Re.cjs} +1 -1
- package/dist/{threePreview-C_ih9l2A.js → threePreview-B46ButBi.js} +5 -5
- package/dist/{threePreview-BrP77wyF.cjs → threePreview-DcCfaIpB.cjs} +1 -1
- package/dist/{threeSceneView-CsCpqJn1.cjs → threeSceneView-CoQQCgZ3.cjs} +1 -1
- package/dist/{threeSceneView-m6iHbW0N.js → threeSceneView-D4mxD9hv.js} +14 -14
- package/dist/{threeSceneViewForCPMPIP-Be_dLUq4.cjs → threeSceneViewForCPMPIP-BR01ytzC.cjs} +1 -1
- package/dist/{threeSceneViewForCPMPIP-CK6-DmN-.js → threeSceneViewForCPMPIP-DTtZGOcw.js} +9 -9
- package/dist/{threeTrackPathView-yvtGNcEt.js → threeTrackPathView-BQPS8ajS.js} +5 -5
- package/dist/{threeTrackPathView-Cj9mNa55.cjs → threeTrackPathView-C6IiddAw.cjs} +1 -1
- package/dist/{threeViewerHost-BWEyUxa2.cjs → threeViewerHost-B3elQtpE.cjs} +1 -1
- package/dist/{threeViewerHost-BkjF_ww-.js → threeViewerHost-CsMI9jbX.js} +4 -4
- package/dist/{urdfTree-D4K4drgJ.js → urdfTree-B118FC_3.js} +1 -1
- package/dist/{urdfTree-CoPu1q80.cjs → urdfTree-umPKeRFh.cjs} +1 -1
- package/dist/{workpieceTreePanel-DnESRp3P.cjs → workpieceTreePanel-CwUXRyn3.cjs} +1 -1
- package/dist/{workpieceTreePanel-B_9YGrGN.js → workpieceTreePanel-D9TnLdIy.js} +4 -4
- package/package.json +1 -1
- package/dist/clone-mhlV-uEo.cjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const la=require("./index-CW4qJdP8.cjs"),Q=require("./menu-CHtFM8LT.cjs"),Ae=require("./index-B0HtXP3c.cjs"),z0=require("./request-BC2w2vGr.cjs"),zr=require("vue");require("./JSEncrypt-IYbV4kRj.cjs");const Ah=[{key:"FormName",value:"Form"},{key:"TableName",value:"Table"},{key:"MenuName",value:"Menu"},{key:"GroupName",value:"Group"},{key:"SystemKey",value:"System"}],Fh=[{key:"FormDirect",value:"formFlex"},{key:"Form",value:"formContent"},{key:"FormButton",value:"formButton"},{key:"FormFlex",value:"formWrap"},{key:"TableColumns",value:"header"},{key:"TableButton",value:"extraButton"},{key:"TableLineButton",value:"rowButton"},{key:"Table",value:"tableContents"},{key:"TableIndex",value:"tableIndex"},{key:"Menus",value:"menuContents"},{key:"GroupContents",value:"groupContents"}],Dh=e=>{var i;let a=e;const r=[];let n="",t=0;for(const s of a)t++,s.includes("(")||n.includes("(")||s.includes(")")||n.includes(")")||s.includes("&")||n.includes("&")||s.includes("|")||n.includes("|")?(n+=s.trim(),(((i=Q.cloneDeep(n))==null?void 0:i[(n==null?void 0:n.length)-1])===")"||(a==null?void 0:a[t])==="|"||(a==null?void 0:a[t])==="&")&&!(n!=null&&n.includes("&"))&&!(n!=null&&n.includes("|"))?(r.push(n.replace(/\/\*[\s\S]*?\*\//g,"")),n=""):n==="&&"||n==="||"?(r.push(n.replace(/\/\*[\s\S]*?\*\//g,"")),n=""):t===(e==null?void 0:e.length)&&(r.push(n.replace(/\/\*[\s\S]*?\*\//g,"")),n="")):n+=s.trim();return(n==null?void 0:n.length)!==0&&r.push(n.replace(/\/\*[\s\S]*?\*\//g,"")),r},ql=(e,a,r,n,t,i)=>{let s=e;return s=s==null?void 0:s.map(f=>{var c,l,o,u,x;if(r!=null&&r.find(h=>{var d,p,m,g,y;return(h===(f==null?void 0:f.prop)||((d=f==null?void 0:f.prop)==null?void 0:d.includes("."+h)))&&((y=(p=f==null?void 0:f.prop)==null?void 0:p.split("."))==null?void 0:y[((g=(m=f==null?void 0:f.prop)==null?void 0:m.split("."))==null?void 0:g.length)-1])===(f==null?void 0:f.label)})&&(f.label=(c=a==null?void 0:a[r==null?void 0:r.findIndex(h=>{var d;return h===(f==null?void 0:f.prop)||((d=f==null?void 0:f.prop)==null?void 0:d.includes("."+h))})])==null?void 0:c.replaceAll('"',""),n!=null&&n.methodContent)){let h=(o=(l=n==null?void 0:n.methodContent)==null?void 0:l.replaceAll('"',""))==null?void 0:o.replaceAll("'","");h!=null&&h.includes("@")?(h=h==null?void 0:h.slice(0,(h==null?void 0:h.length)-1),h!=null&&h.includes("@Type")||(h=h+",@Type=Auto"),h!=null&&h.includes("@Button")||(h=h+",@Button=Prop"),h!=null&&h.includes("@Extent")||(h=h+",@Extent=Row"),h=h+")"):h=h+"(@Type=Auto,@Button=Prop,@Extent=Row)",f.methodContent=h,f.prop=(f==null?void 0:f.prop)+(n==null?void 0:n.columnPathIndex),(u=i==null?void 0:i.find(d=>d==null?void 0:d.includes("@SonSync")))!=null&&u.includes("Yes")&&(f.methodId=t)}return f!=null&&f.children&&((x=f==null?void 0:f.children)==null?void 0:x.length)>0&&(f.children=ql(f.children,a,r,n,t,i)),f}),s},Zl=e=>{var i;let a=e==null?void 0:e.replaceAll("=","#"),r=(i=Dh(a))==null?void 0:i.map(s=>(s!=null&&s.includes("(")&&(s="("+(s==null?void 0:s.replaceAll("(",""))),s)),n=[],t={};return r==null||r.forEach((s,f)=>{var c,l,o,u,x;if(!(s!=null&&s.includes("&&"))&&!(s!=null&&s.includes("||"))){let h=s;(s==null?void 0:s[(s==null?void 0:s.length)-1])===")"&&(h=s.slice(0,(s==null?void 0:s.length)-1)),(h==null?void 0:h[0])==="("&&(h=h.slice(1,h==null?void 0:h.length)),h!=null&&h.includes("[")&&(h!=null&&h.includes("]")||(h=(u=(c=h==null?void 0:h.slice(1,h==null?void 0:h.length))==null?void 0:c.split(":"))==null?void 0:u[((o=(l=h==null?void 0:h.slice(1,h==null?void 0:h.length))==null?void 0:l.split(":"))==null?void 0:o.length)-1])),h=h==null?void 0:h.split("#");let d=h[0].replaceAll("'","").replaceAll("]","");d!=null&&d.includes(":")&&(d=d==null?void 0:d.replaceAll(":","."));let p=(x=h[1])==null?void 0:x.replaceAll("'","");(d==null?void 0:d[(d==null?void 0:d.length)-1])!=="!"?t[d]=p:t[d==null?void 0:d.slice(0,(d==null?void 0:d.length)-1)]="!"+p}else s==="&&"||s==="||"&&(n.push(t),t={});f===r.length-1&&(n.push(t),t={})}),n},Ih=(e,a)=>{const r=new Map;let n=[];a.forEach(i=>{for(const[s,f]of Object.entries(i))try{r.set(s.replaceAll("'",""),JSON.parse(f))}catch{r.set(s,[])}});const t=i=>i.map(s=>{var l,o;const f={label:s==null?void 0:s.replaceAll("'","")},c=r.get(s==null?void 0:s.replaceAll("'",""));if(c!=null&&c.length){const u=c.map(x=>e.find(h=>(h==null?void 0:h.replaceAll("'",""))===x)).filter(Boolean);f.children=(f.children||[]).concat(u),f.children=(l=f.children)==null?void 0:l.map(x=>(f==null?void 0:f.label)+"."+(x==null?void 0:x.replaceAll("'",""))),n=[...n,...f.children]}return(o=f.children)!=null&&o.length&&(f.children=t(f.children)),f});return t(e),n},bh=(e,a)=>{const r=(n,t)=>{let i;return i=t==null?void 0:t.map(s=>{var f,c,l,o,u,x,h;if(n!=null&&n.find(d=>{var p;return(d==null?void 0:d.label)===(s==null?void 0:s.prop)||((p=s==null?void 0:s.prop)==null?void 0:p.includes("."+(d==null?void 0:d.prop)))})){let d=n==null?void 0:n.find(p=>{var m;return(p==null?void 0:p.label)===(s==null?void 0:s.prop)||((m=s==null?void 0:s.prop)==null?void 0:m.includes("."+(p==null?void 0:p.prop)))});d!=null&&d.relatedValueId&&(s.relatedValueId=d==null?void 0:d.relatedValueId),d!=null&&d.menuId&&(s.menuId=d==null?void 0:d.menuId,s.directiveLabel="#isMain")}else if(Array.isArray(n==null?void 0:n[0])&&((f=n==null?void 0:n[0])!=null&&f.find(d=>{var p;return(d==null?void 0:d.label)===(s==null?void 0:s.prop)||(d==null?void 0:d.prop)===(s==null?void 0:s.prop)||((p=s==null?void 0:s.prop)==null?void 0:p.includes("."+(d==null?void 0:d.prop)))}))){let d=(c=n==null?void 0:n[0])==null?void 0:c.find(p=>{var m;return(p==null?void 0:p.label)===(s==null?void 0:s.prop)||(p==null?void 0:p.prop)===(s==null?void 0:s.prop)||((m=s==null?void 0:s.prop)==null?void 0:m.includes("."+(p==null?void 0:p.prop)))});d!=null&&d.relatedValueId&&(s.relatedValueId=d==null?void 0:d.relatedValueId),d!=null&&d.menuId&&(s.menuId=d==null?void 0:d.menuId,s.directiveLabel="#isMain"),s.label=(x=(l=s.label)==null?void 0:l.split("."))==null?void 0:x[((u=(o=s.label)==null?void 0:o.split("."))==null?void 0:u.length)-1]}return s!=null&&s.children&&((h=s==null?void 0:s.children)==null?void 0:h.length)>0&&(s.children=r(n,s.children)),s}),i};return r(e,a)},Ws=Ae.defineStore("modelTableComp",{state:()=>({tableIndex:0,tableShowThree:"",multipleTableConst:"."}),actions:{setTableIndex(e){this.tableIndex=e},setTableShowThree(e){this.tableShowThree=e}}}),Ch=Ws(Ae.pinia),{multipleTableConst:lt}=Ae.storeToRefs(Ch),ws=e=>{let a=[];function r(t,i=""){Array.isArray(t)&&(t==null||t.forEach(s=>{Array.isArray(s)||(s=[s]),s==null||s.forEach(f=>{var c,l,o,u,x,h,d,p,m,g,y,v;if(!(f!=null&&f.children)||f.children.length===0)f.prop=i===""?f==null?void 0:f.prop:i+lt.value+((u=(c=f==null?void 0:f.prop)==null?void 0:c.split(lt.value))==null?void 0:u[((o=(l=f==null?void 0:f.prop)==null?void 0:l.split(lt.value))==null?void 0:o.length)-1]),a.push(f.prop);else{let E=i===""?i+((p=(x=f==null?void 0:f.prop)==null?void 0:x.split(lt.value))==null?void 0:p[((d=(h=f==null?void 0:f.prop)==null?void 0:h.split(lt.value))==null?void 0:d.length)-1]):i+lt.value+((v=(m=f==null?void 0:f.prop)==null?void 0:m.split(lt.value))==null?void 0:v[((y=(g=f==null?void 0:f.prop)==null?void 0:g.split(lt.value))==null?void 0:y.length)-1]);n(f.children,E)}})}))}function n(t,i=""){t==null||t.forEach(s=>{var f,c,l,o,u,x,h,d,p,m,g,y;if(!(s!=null&&s.children)||s.children.length===0)s.prop=i===""?s==null?void 0:s.prop:i+lt.value+((o=(f=s==null?void 0:s.prop)==null?void 0:f.split(lt.value))==null?void 0:o[((l=(c=s==null?void 0:s.prop)==null?void 0:c.split(lt.value))==null?void 0:l.length)-1]),a.push(s.prop);else{let v=i===""?i+((d=(u=s==null?void 0:s.prop)==null?void 0:u.split(lt.value))==null?void 0:d[((h=(x=s==null?void 0:s.prop)==null?void 0:x.split(lt.value))==null?void 0:h.length)-1]):i+lt.value+((y=(p=s==null?void 0:s.prop)==null?void 0:p.split(lt.value))==null?void 0:y[((g=(m=s==null?void 0:s.prop)==null?void 0:m.split(lt.value))==null?void 0:g.length)-1]);n(s.children,v)}})}return r(e),a},Oh=(e,a,r)=>{var t;let n=(t=Q.cloneDeep(e))==null?void 0:t.map(i=>(i=i.filter(s=>!(s!=null&&s.id)),i));return n=n==null?void 0:n.map(i=>{var s;return i=(s=i.map((f,c)=>{let l={};if(r!=null&&r.find(o=>o===a[c]))return l[a[c]]=f,l}))==null?void 0:s.filter(f=>f),i}),n},Rh=(e,a)=>{var s,f;const r=Q.cloneDeep(e),n=(s=r==null?void 0:r.find(c=>(c==null?void 0:c.key)==="header"))==null?void 0:s.contents,t=(f=r==null?void 0:r.find(c=>(c==null?void 0:c.key)==="tableContents"))==null?void 0:f.contents;return Oh(t,ws(n).slice(0,ws(n).length-1),a)},Nh=e=>{let a={};return e==null||e.forEach(r=>{a[r.key]=r.value}),a},mf=(e,a)=>{const r=a;return e==null?void 0:e.map(n=>{var i;let t=n;if(!Array.isArray(t)){let s=[];for(let f in t)s.push({key:f,value:t==null?void 0:t[f]});return s}return n=(i=t==null?void 0:t.map((s,f)=>{var c,l;return s!=null&&s.id?{key:"id",value:s==null?void 0:s.id}:r!=null&&r.find(o=>o==null?void 0:o.id)||t!=null&&t.find(o=>o==null?void 0:o.id)?{key:(c=r[f-1])==null?void 0:c.label,value:s}:{key:(l=r[f])==null?void 0:l.label,value:s}}))==null?void 0:i.filter(s=>s.key!=="操作"),n})},Ph=async e=>{var r,n,t,i;let a="";if((n=(r=Q.cloneDeep(e))==null?void 0:r.split("/"))==null||n.forEach((s,f)=>{var c,l;f!==((l=(c=Q.cloneDeep(e))==null?void 0:c.split("/"))==null?void 0:l.length)-1&&(a=a===""?a+s:a+"/"+s)}),a!==""){let s="";const f=await wn(a,sessionStorage.getItem("systemKey"),"");(i=(t=f==null?void 0:f[0])==null?void 0:t.compData)==null||i.forEach(c=>{var l;(c==null?void 0:c.key)==="tableContents"&&((l=c==null?void 0:c.contents)==null||l.forEach((o,u)=>{if(u===0){let x=o==null?void 0:o.filter(h=>!(h!=null&&h.id));s=a+"/"+(x==null?void 0:x[0])}}))}),await Pf(s,e)}},$t=e=>{try{return JSON.parse(e),!0}catch{return!1}},Mh=Q.useLoginState(Ae.pinia),{loginUserInfo:os}=Ae.storeToRefs(Mh),Lh=Q.useUnit(Ae.pinia),{chooseTitle:Ic}=Ae.storeToRefs(Lh),Bh=Q.useMenuState(),{activeMenuPath:jt}=Ae.storeToRefs(Bh),j0=[{key:"@MaxRowNum",value:"onNumSlice",order:1},{key:"@Type",value:"onRandomContents",order:2},{key:"@Filter",value:"onConditionContents",order:4},{key:"@FatherSync",value:"onFatherPaceContents",order:1},{key:"@SonSync",value:"onPaceContents",order:1},{key:"@MultiLead",value:"onMainTagContents",order:3},{key:"@ProButton",value:"onButtonContents",order:1},{key:"@PamButton",value:"onPamButtonContents",order:1},{key:"@RowButton",value:"onRowButtonContents",order:1}],Uh=(e,a,r)=>{var t,i,s,f;let n;return $t(e)?n=JSON.parse(e):n=JSON.parse((f=(s=(i=(t=e==null?void 0:e.replaceAll('"',"“"))==null?void 0:t.replaceAll("““","“"))==null?void 0:i.replaceAll("“",'"'))==null?void 0:s.replaceAll(':",',':"",'))==null?void 0:f.replaceAll(':"}',':""}')),n},Wh=(e,a,r)=>{var t,i,s,f;let n;return $t(e)?n=JSON.parse(e):n=JSON.parse((f=(s=(i=(t=e==null?void 0:e.replaceAll('"',"“"))==null?void 0:t.replaceAll("““","“"))==null?void 0:i.replaceAll("“",'"'))==null?void 0:s.replaceAll(':",',':"",'))==null?void 0:f.replaceAll(':"}',':""}')),n},Hh=(e,a,r)=>{var t,i,s,f;let n;return $t(e)?n=JSON.parse(e):n=JSON.parse((f=(s=(i=(t=e==null?void 0:e.replaceAll('"',"“"))==null?void 0:t.replaceAll("““","“"))==null?void 0:i.replaceAll("“",'"'))==null?void 0:s.replaceAll(':",',':"",'))==null?void 0:f.replaceAll(':"}',':""}')),n},Ql=(e,a,r)=>{let n;return n=e==null?void 0:e.map(t=>{var i;return a!=null&&a.find(s=>{var f;return((f=t==null?void 0:t.prop)==null?void 0:f.includes("."+s))||(t==null?void 0:t.prop)===s})&&(t.menuId=r),t.relatedValueId=!0,t!=null&&t.children&&((i=t==null?void 0:t.children)==null?void 0:i.length)>0&&(t.children=Ql(t.children,a,r)),t}),n},Gh=(e,a,r)=>{var i,s,f,c,l;let n;$t(e)?n=JSON.parse(e):n=JSON.parse((c=(f=(s=(i=e==null?void 0:e.replaceAll('"',"“"))==null?void 0:i.replaceAll("““","“"))==null?void 0:s.replaceAll("“",'"'))==null?void 0:f.replaceAll(':",',':"",'))==null?void 0:c.replaceAll(':"}',':""}'));let t;return(a==null?void 0:a[0])==="["?t=(l=a==null?void 0:a.slice(1,(a==null?void 0:a.length)-1))==null?void 0:l.split(","):t=a==null?void 0:a.split(","),n=n==null?void 0:n.map(o=>(o=o==null?void 0:o.map(u=>{var x;return(u==null?void 0:u.key)==="header"&&(u.contents=(x=u.contents)==null?void 0:x.map((h,d)=>{var p,m,g,y,v,E;if(Array.isArray(h)){let w=(g=(m=o==null?void 0:o.filter(S=>(S==null?void 0:S.key)==="contentTableId"))==null?void 0:m[((p=o==null?void 0:o.filter(S=>(S==null?void 0:S.key)==="contentTableId"))==null?void 0:p.length)-1])==null?void 0:g.contents;h=Ql(h,t,w)}else t!=null&&t.find(w=>w===(h==null?void 0:h.prop))&&(h.menuId=(E=(v=o==null?void 0:o.filter(w=>(w==null?void 0:w.key)==="contentTableId"))==null?void 0:v[((y=o==null?void 0:o.filter(w=>(w==null?void 0:w.key)==="contentTableId"))==null?void 0:y.length)-1])==null?void 0:E.contents,h.directiveLabel="#isMain"),h.relatedValueId=!0;return h})),u}),o)),n},gf=e=>{let a=e;if(a!=null&&a.every(r=>Array.isArray(r))){let r=[];const n=t=>{t==null||t.forEach(i=>{var s;i!=null&&i.children&&((s=i==null?void 0:i.children)==null?void 0:s.length)>0?n(i==null?void 0:i.children):r.push(i)})};return n(a==null?void 0:a[0]),r}else return a},Xh=(e,a,r)=>{var t,i,s,f;let n;return $t(e)?n=JSON.parse(e):n=JSON.parse((f=(s=(i=(t=e==null?void 0:e.replaceAll('"',"“"))==null?void 0:t.replaceAll("““","“"))==null?void 0:i.replaceAll("“",'"'))==null?void 0:s.replaceAll(':",',':"",'))==null?void 0:f.replaceAll(':"}',':""}')),n},$h=(e,a,r)=>{var t,i,s,f;let n;return $t(e)?n=JSON.parse(e):n=JSON.parse((f=(s=(i=(t=e==null?void 0:e.replaceAll('"',"“"))==null?void 0:t.replaceAll("““","“"))==null?void 0:i.replaceAll("“",'"'))==null?void 0:s.replaceAll(':",',':"",'))==null?void 0:f.replaceAll(':"}',':""}')),n},Kh=(e,a,r)=>{let n;$t(e)?n=JSON.parse(e):n=e;let t=a;if((a==null?void 0:a[0])!=="("&&(t="("+a+")"),t.slice(1,(t==null?void 0:t.length)-1)==="undefined")return n;let i=Zl(t);if((i==null?void 0:i.length)>0){let s=[];i==null||i.forEach(f=>{var l,o,u,x,h,d;let c={};for(let p in f){let m=Q.cloneDeep(p);if(!(m!=null&&m.includes("[")))if(((l=f[p])==null?void 0:l.toUpperCase())==="@LOGINUSER")c[m]=(o=os.value)!=null&&o.account?(u=os.value)==null?void 0:u.account:((x=os.value)==null?void 0:x.姓名)??((h=os.value)==null?void 0:h.账号);else if(!((d=f[p])!=null&&d.includes("[")))c[m]=f[p];else{let g="";n==null||n.forEach(y=>{var E,w;let v=(E=y==null?void 0:y.find(S=>(S==null?void 0:S.key)==="header"))==null?void 0:E.contents;v=(w=gf(v))==null?void 0:w.filter(S=>(S==null?void 0:S.label)!=="操作"),y=y==null?void 0:y.map(S=>{if((S==null?void 0:S.key)==="tableContents"){let B=mf(S==null?void 0:S.contents,v),I=B==null?void 0:B.map(U=>{var L;return(L=U==null?void 0:U.find(W=>(W==null?void 0:W.key)===p))==null?void 0:L.value});I=[...new Set(I)],g=I}})}),c[m]=g}}s.push(c)}),n=n==null?void 0:n.map(f=>{var l,o;let c=(l=f==null?void 0:f.find(u=>(u==null?void 0:u.key)==="header"))==null?void 0:l.contents;return c=(o=gf(c))==null?void 0:o.filter(u=>(u==null?void 0:u.label)!=="操作"),f=f==null?void 0:f.map(u=>{if((u==null?void 0:u.key)==="tableContents"){let h=mf(u==null?void 0:u.contents,c);s==null||s.forEach(d=>{var p,m;for(let g in d)!((p=h==null?void 0:h[0])!=null&&p.find(y=>{var v;return(y==null?void 0:y.key)===g||((v=y==null?void 0:y.key)==null?void 0:v.includes(g))}))&&!(h!=null&&h.find(y=>{var v;return(y==null?void 0:y.key)===g||((v=y==null?void 0:y.key)==null?void 0:v.includes(g))}))||(((m=d[g])==null?void 0:m[0])!=="!"?h=h==null?void 0:h.filter(y=>{var v,E;return((v=y==null?void 0:y.find(w=>{var S;return(w==null?void 0:w.key)===g||((S=w==null?void 0:w.key)==null?void 0:S.includes(g))}))==null?void 0:v.value)===d[g]&&!Array.isArray(d==null?void 0:d[g])||Array.isArray(d==null?void 0:d[g])&&((E=d==null?void 0:d[g])==null?void 0:E.find(w=>{var S;return((S=y==null?void 0:y.find(T=>{var B;return(T==null?void 0:T.key)===g||((B=T==null?void 0:T.key)==null?void 0:B.includes(g))}))==null?void 0:S.value)===w}))}):h=h==null?void 0:h.filter(y=>{var v;return((v=y==null?void 0:y.find(E=>{var w;return(E==null?void 0:E.key)===g||((w=E==null?void 0:E.key)==null?void 0:w.includes(g))}))==null?void 0:v.value)!==d[g]}))}),(h==null?void 0:h.length)===0?u.contents=[]:u.contents=h==null?void 0:h.map(d=>{let p={};return d==null||d.forEach(m=>{p[m==null?void 0:m.key]=m==null?void 0:m.value}),p})}return u}),f})}return n},zh=(e,a,r)=>{var t,i,s,f;let n=[];return $t(e)?n=JSON.parse(e):n=JSON.parse((f=(s=(i=(t=e==null?void 0:e.replaceAll('"',"“"))==null?void 0:t.replaceAll("““","“"))==null?void 0:i.replaceAll("“",'"'))==null?void 0:s.replaceAll(':",',':"",'))==null?void 0:f.replaceAll(':"}',':""}')),a.toUpperCase()==="ALL"||a.toUpperCase()==="NONE"||(n=n==null?void 0:n.map(c=>(c=c==null?void 0:c.map(l=>{var o;return(l==null?void 0:l.key)==="tableContents"&&(l.contents=(o=l.contents)==null?void 0:o.slice(0,parseInt(a))),l}),c))),n},Vh=e=>{for(let a=e.length-1;a>0;a--){const r=Math.floor(Math.random()*(a+1));[e[a],e[r]]=[e[r],e[a]]}return e},jh=(e,a,r=0)=>{let n=r;const t=(i,s,f)=>{let c;return c=i==null?void 0:i.map(l=>{var o;return!(l!=null&&l.children)&&n===0?(n=n+1,l.menuId=s):l.relatedValueId=!0,l.relatedValueId=!0,l!=null&&l.children&&((o=l==null?void 0:l.children)==null?void 0:o.length)>0&&(l.children=t(l.children,s)),l}),c};return t(e,a)},Yh=async(e,a,r)=>{var n,t,i,s,f,c,l,o,u,x,h,d,p,m,g,y,v,E,w,S,T,B,I,U,L,W,M,se,ne,he,ce,Ce,K,Te,Fe,_;if(a==="Sequence")return JSON.parse((s=(i=(t=(n=e==null?void 0:e.replaceAll('"',"“"))==null?void 0:n.replaceAll("““","“"))==null?void 0:t.replaceAll("“",'"'))==null?void 0:i.replaceAll(':",',':"",'))==null?void 0:s.replaceAll(':"}',':""}'));if(a==="Auto"){let A=[];$t(e)?A=JSON.parse(e):A=JSON.parse((o=(l=(c=(f=e==null?void 0:e.replaceAll('"',"“"))==null?void 0:f.replaceAll("““","“"))==null?void 0:c.replaceAll("“",'"'))==null?void 0:l.replaceAll(':",',':"",'))==null?void 0:o.replaceAll(':"}',':""}'));const D=await la.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:((h=(x=(u=jt==null?void 0:jt.value)==null?void 0:u.split("/"))==null?void 0:x.filter((G,re)=>{var ee,Z;return re!==((Z=(ee=jt==null?void 0:jt.value)==null?void 0:ee.split("/"))==null?void 0:Z.length)-1}))==null?void 0:h.join(""))+"/"}});let b;return(g=(d=r==null?void 0:r.split("["))==null?void 0:d[0])!=null&&g.includes((m=(p=Ic.value)==null?void 0:p[0])==null?void 0:m.parentContent)&&(b=(v=(y=Ic.value)==null?void 0:y[0])==null?void 0:v.value),!b&&((w=(E=D==null?void 0:D.data)==null?void 0:E.result)==null?void 0:w.length)>0&&(b=(I=(S=jt==null?void 0:jt.value)==null?void 0:S.split("/"))==null?void 0:I[((B=(T=jt==null?void 0:jt.value)==null?void 0:T.split("/"))==null?void 0:B.length)-1]),A=A==null?void 0:A.map(G=>(G=G==null?void 0:G.map(re=>{var Z,J,we,P,Me,be,Ye,Be;let ee=(J=(Z=G==null?void 0:G.find(ie=>(ie==null?void 0:ie.key)==="header"))==null?void 0:Z.contents)==null?void 0:J.filter(ie=>(ie==null?void 0:ie.directiveLabel)==="#isMain");return(ee==null?void 0:ee.length)===0&&Array.isArray((P=(we=G==null?void 0:G.find(ie=>(ie==null?void 0:ie.key)==="header"))==null?void 0:we.contents)==null?void 0:P[0])&&(ee=(Ye=(be=(Me=G==null?void 0:G.find(ie=>(ie==null?void 0:ie.key)==="header"))==null?void 0:Me.contents)==null?void 0:be[0])==null?void 0:Ye.filter(ie=>(ie==null?void 0:ie.directiveLabel)==="#isMain")),(re==null?void 0:re.key)==="tableContents"&&b&&b!==""&&(re.contents=(Be=re.contents)==null?void 0:Be.filter(ie=>ee==null?void 0:ee.some(hr=>(ie==null?void 0:ie[hr==null?void 0:hr.label])===b))),re}),G)),A}else{let A=[];if($t(e)?A=JSON.parse(e):A=JSON.parse((M=(W=(L=(U=e==null?void 0:e.replaceAll('"',"“"))==null?void 0:U.replaceAll("““","“"))==null?void 0:L.replaceAll("“",'"'))==null?void 0:W.replaceAll(':",',':"",'))==null?void 0:M.replaceAll(':"}',':""}')),a.toUpperCase()==="MANUAL"){if(!((ne=(se=A==null?void 0:A[0])==null?void 0:se.find(b=>(b==null?void 0:b.key)==="contentTableId"))!=null&&ne.contents))return A;let D=await la.getInsofDataApi({id:(Te=(K=(he=A==null?void 0:A[0])==null?void 0:he.filter(b=>(b==null?void 0:b.key)==="contentTableId"))==null?void 0:K[((Ce=(ce=A==null?void 0:A[0])==null?void 0:ce.filter(b=>(b==null?void 0:b.key)==="contentTableId"))==null?void 0:Ce.length)-1])==null?void 0:Te.contents});D=(_=(Fe=D==null?void 0:D.data)==null?void 0:Fe.result)==null?void 0:_[0],A=A==null?void 0:A.map(b=>(b=b==null?void 0:b.map(G=>{var re,ee;return(G==null?void 0:G.key)==="header"&&(re=G.contents)!=null&&re.some(Z=>!(Z!=null&&Z.menuId))&&(G.contents=(ee=G.contents)==null?void 0:ee.map((Z,J)=>{var P,Me,be,Ye,Be,ie,hr;let we=(be=(Me=b==null?void 0:b.filter(sr=>(sr==null?void 0:sr.key)==="contentTableId"))==null?void 0:Me[((P=b==null?void 0:b.filter(sr=>(sr==null?void 0:sr.key)==="contentTableId"))==null?void 0:P.length)-1])==null?void 0:be.contents;return Array.isArray(Z)&&((Ye=_n(Z==null?void 0:Z[0]))!=null&&Ye.every(sr=>!(sr!=null&&sr.menuId)))?Z=jh(Z,we):((Z==null?void 0:Z.directiveLabel)==="#isMain"&&(Z.menuId=(hr=(ie=b==null?void 0:b.filter(sr=>(sr==null?void 0:sr.key)==="contentTableId"))==null?void 0:ie[((Be=b==null?void 0:b.filter(sr=>(sr==null?void 0:sr.key)==="contentTableId"))==null?void 0:Be.length)-1])==null?void 0:hr.contents),Z.relatedValueId=!0),Z})),G}),b))}else A=A==null?void 0:A.map(D=>(D=D==null?void 0:D.map(b=>((b==null?void 0:b.key)==="tableContents"&&(b.contents=Vh(b.contents)),b)),D));return A}},Oi=(e,a)=>Array.isArray(e)?e==null?void 0:e.map(n=>{var t,i,s,f,c,l,o;if(Array.isArray(n)?n=n:n=[n],(t=n==null?void 0:n.filter(u=>!(u!=null&&u.id)||typeof(u==null?void 0:u.id)=="string"))!=null&&t.every(u=>typeof u!="object"||u===null))return n;if((i=n==null?void 0:n.filter(u=>!(u!=null&&u.id)||typeof(u==null?void 0:u.id)=="string"))!=null&&i.some(u=>Array.isArray(u)))return n;{let u=[],x=(n==null?void 0:n.find(h=>(h==null?void 0:h.id)&&typeof(h==null?void 0:h.id)=="number"))??{id:(s=n==null?void 0:n[0])==null?void 0:s.id};if(u.push(x),Array.isArray(a==null?void 0:a[0])){const h=(f=n==null?void 0:n.filter(d=>!(d!=null&&d.id)||typeof(d==null?void 0:d.id)=="string"))==null?void 0:f[0];(c=_n(Q.cloneDeep(a==null?void 0:a[0])))==null||c.forEach(d=>{u.push(h==null?void 0:h[(d==null?void 0:d.prop)??(d==null?void 0:d.label)??d])})}else{const h=(l=n==null?void 0:n.filter(d=>!(d!=null&&d.id)||typeof(d==null?void 0:d.id)=="string"))==null?void 0:l[0];(o=_n(Q.cloneDeep(a)))==null||o.forEach(d=>{u.push(h==null?void 0:h[(d==null?void 0:d.prop)??(d==null?void 0:d.label)??d])})}return u}}):void 0,m0=(e,a)=>{let r={};return Array.isArray(e)?e!=null&&e.find(n=>n==null?void 0:n.id)?(e==null?void 0:e.length)>1?e==null||e.forEach((n,t)=>{a!=null&&a[t-1]&&!(n!=null&&n.id)?r[a[t-1]]=n:n!=null&&n.id&&(r.id=n==null?void 0:n.id)}):r=e==null?void 0:e[0]:e==null||e.forEach((n,t)=>{a!=null&&a[t]&&(r[a[t]]=n)}):(a==null||a.forEach(n=>{r[n]=e==null?void 0:e[n]}),r.id=e==null?void 0:e.id),r},eo=Ae.defineStore("authorityState",{state:()=>({routerPageStructures:[]}),actions:{setRouterPageStructure(e){this.routerPageStructures=e}}}),Jh=Q.useMenuState(Ae.pinia),{activeMenuPath:Lw}=Ae.storeToRefs(Jh),qh=Q.useLoginState(Ae.pinia),{structureData:Zh,loginUserInfo:Bw}=Ae.storeToRefs(qh),Qh=eo(Ae.pinia),{routerPageStructures:e1}=Ae.storeToRefs(Qh);Ae.useModelComp(Ae.pinia);zr.ref([{label:"角色名称",value:"",name:"roleName"}]);zr.ref([{label:"查询"},{label:"重置"}]);zr.reactive({isFilter:!1,filterForm:{}});zr.ref(!1);const r1=zr.ref([]),a1=zr.ref([]),t1=zr.ref("");zr.computed(()=>{var a,r,n,t,i;const e=(a=e1.value)==null?void 0:a.find(s=>{var f;return((f=s==null?void 0:s.comp)==null?void 0:f.toUpperCase())==="TABLE"});if(e){t1.value=e.name,a1.value=(t=(n=(r=e==null?void 0:e.compData)==null?void 0:r.find(f=>(f==null?void 0:f.key)==="header"))==null?void 0:n.contents)==null?void 0:t.filter(f=>(f==null?void 0:f.label)!=="操作");const s=(i=e==null?void 0:e.compData)==null?void 0:i.map(f=>{var c;if((f==null?void 0:f.key)==="rowButton"){let l=[];return g1.value?l=[...f==null?void 0:f.contents,{label:"授权"}]:l=f==null?void 0:f.contents,{...f,contents:l}}return(f==null?void 0:f.key)==="header"?{...f,contents:(c=f==null?void 0:f.contents)==null?void 0:c.map(l=>{var o,u;return{...l,isTableColHidden:(o=l==null?void 0:l.prop)==null?void 0:o.includes("授权"),isFormColHidden:(u=l==null?void 0:l.prop)==null?void 0:u.includes("授权")}})}:f});return l1(s),s}return[]});zr.ref({});const n1=zr.ref(),ro=e=>e==null?void 0:e.map(a=>{var n;const r={...a,checkedButtons:[]};return r.children&&((n=r.children)==null?void 0:n.length)>0&&(r.children=ro(r.children)),r}),i1=e=>{for(const a in e)if(Array.isArray(e[a]))return a;return""},s1=e=>Object.prototype.toString.call(e)==="[object Object]"&&e!==null,f1=(e,a)=>{const r={},n=Array.isArray(e)?e==null?void 0:e.filter(t=>{var i;return!(s1(t)&&((i=Object.keys(t))!=null&&i.includes("id")))}):null;return n&&(n==null||n.forEach((t,i)=>{var s;r[(s=a[i])==null?void 0:s.prop]=t})),r},c1=zr.ref(""),l1=e=>{var i;const a=e==null?void 0:e.find(s=>(s==null?void 0:s.key)==="tableContents"),r=e==null?void 0:e.find(s=>(s==null?void 0:s.key)==="header");if(!a||!r)return"";const n=(i=a==null?void 0:a.contents)==null?void 0:i[0],t=f1(n,r==null?void 0:r.contents);c1.value=i1(t)};zr.ref();const o1=zr.reactive({show:!1,title:"角色授权",width:"30%",draggable:!0});zr.ref(0);const bc=zr.ref([]);zr.ref([{path:"资源管理",buttons:["查询","新增","编辑","删除"]},{path:"资源管理/人员",buttons:["查询","新增","编辑","删除"]}]);const Cc=zr.ref([]);zr.watch(()=>Cc.value.length,()=>{var e;(e=n1.value)==null||e.setCheckedKeys([...Cc.value])});zr.watch(()=>o1.show,e=>{e||(bc.value=ro(bc.value))});zr.computed(()=>{var r;const e=(r=Q.cloneDeep(Zh.value))==null?void 0:r.filter(n=>{var t,i;return((i=(t=n==null?void 0:n.key)==null?void 0:t.pageKey)==null?void 0:i.toUpperCase())!=="MENU"});return[...e==null?void 0:e.map(n=>{var s,f,c,l,o,u,x,h;const t=/button/i;let i=(c=(f=(s=n==null?void 0:n.value)==null?void 0:s.pageData)==null?void 0:f.compData)==null?void 0:c.filter(d=>t.test(d==null?void 0:d.key));return i=Array.from(new Set(i==null?void 0:i.flatMap(d=>d.contents.map(p=>p.label)))),{path:(o=(l=n==null?void 0:n.key)==null?void 0:l.pageKey)!=null&&o.startsWith("/")?(x=(u=n==null?void 0:n.key)==null?void 0:u.pageKey)==null?void 0:x.substring(1):(h=n==null?void 0:n.key)==null?void 0:h.pageKey,buttons:i}}),...u1.value]});const u1=zr.ref([]);r1.value;const ao=Q.useLoginState(Ae.pinia),{superAdminInfo:Uw,cryptoInfo:Ww,loginUserInfo:Hw}=Ae.storeToRefs(ao),h1=Q.useMenuState(Ae.pinia),{activeMenuPath:x1}=Ae.storeToRefs(h1),Oc=Ae.useModelComp(Ae.pinia),d1="123456",p1=eo(Ae.pinia),{routerPageStructures:m1}=Ae.storeToRefs(p1);zr.ref(0);zr.ref([{label:"用户名称",value:"",name:"userName"}]);const g1=zr.computed(()=>{const e=sessionStorage.getItem("isSuperAdmin");return e?JSON.parse(e):!1}),v1=zr.ref([]),_1=zr.ref(""),y1=zr.computed(()=>{var a,r,n,t,i;const e=(a=m1.value)==null?void 0:a.find(s=>{var f;return((f=s==null?void 0:s.comp)==null?void 0:f.toUpperCase())==="TABLE"});return e?(_1.value=e.name,v1.value=(t=(n=(r=e==null?void 0:e.compData)==null?void 0:r.find(f=>(f==null?void 0:f.key)==="header"))==null?void 0:n.contents)==null?void 0:t.filter(f=>(f==null?void 0:f.label)!=="操作"),(i=e==null?void 0:e.compData)==null?void 0:i.map(f=>{var c;if((f==null?void 0:f.key)==="rowButton"){const l=[...f==null?void 0:f.contents,{label:"重置密码"}];return{...f,contents:l}}return(f==null?void 0:f.key)==="header"?{...f,contents:(c=f==null?void 0:f.contents)==null?void 0:c.map(l=>{var o,u,x,h;return{...l,isTableColHidden:((o=l==null?void 0:l.prop)==null?void 0:o.includes("头像"))||((u=l==null?void 0:l.prop)==null?void 0:u.includes("签名")),isFormColHidden:((x=l==null?void 0:l.prop)==null?void 0:x.includes("头像"))||((h=l==null?void 0:l.prop)==null?void 0:h.includes("签名"))}})}:f})):[]});zr.ref();const k1=async(e,a,r)=>{var n,t;try{const i=await e(a);return((n=i==null?void 0:i.data)==null?void 0:n.code)===200?(r!=="查询"&&await ao.setLogRecordAsync({type:r,data:a},x1.value),z0.ElMessage.success("保存成功"),Oc.setRefreshCurStructure(!0),i.data.result||((t=i==null?void 0:i.data)==null?void 0:t.code)===200):null}catch(i){z0.ElMessage.error(i)}finally{Oc.setCacheUpdatingData(null)}};y1.value;const l0=Ae.defineStore("originalState",{state:()=>({originalPath:"^"}),actions:{}}),E1=Ae.useModelComp(Ae.pinia),{routeToChildPath:Rc}=Ae.storeToRefs(E1),T1=Q.useLoginState(Ae.pinia),{loginUserInfo:Nc,cryptoInfo:Gw}=Ae.storeToRefs(T1),w1=l0(Ae.pinia),{originalPath:Pc}=Ae.storeToRefs(w1),S1=async(e,a)=>{const r=sessionStorage.getItem("authority"),n=JSON.parse(r||"");if(Array.isArray(n)){let t;Rc.value?t=Array.isArray(n)&&(n==null?void 0:n.filter(f=>(f==null?void 0:f.includes(e))||(f==null?void 0:f.includes(Rc.value)))):t=Array.isArray(n)&&(n==null?void 0:n.filter(f=>f==null?void 0:f.includes(e)));const i=t==null?void 0:t.map(f=>{var c;return((c=f==null?void 0:f.split("/"))==null?void 0:c.pop())||""});return a==null?void 0:a.map(f=>{var c;return{...f,compData:(c=f==null?void 0:f.compData)==null?void 0:c.map(l=>{var o;return(l==null?void 0:l.key)==="rowButton"||(l==null?void 0:l.key)==="extraButton"?{...l,contents:(o=l==null?void 0:l.contents)==null?void 0:o.filter(u=>i==null?void 0:i.includes(u==null?void 0:u.label))}:l})}})}else return typeof n=="string"&&(n==null?void 0:n.toUpperCase())==="SUPERADMIN"?a:[]},A1=(e,a)=>{var i,s,f,c;const r=(s=(i=a["系统管理/角色管理"])==null?void 0:i.filter(l=>{var o;return((o=l==null?void 0:l.key)==null?void 0:o.type)==="data"}))==null?void 0:s.map(l=>l.value.tableData),n=(c=(f=e==null?void 0:e.value)==null?void 0:f.tableData)==null?void 0:c.角色名称,t=r==null?void 0:r.find(l=>(l==null?void 0:l.角色名称)===n);return t==null?void 0:t.数据范围};var Ts=(e=>(e[e.全部数据权限=0]="全部数据权限",e[e.本部门数据权限=1]="本部门数据权限",e[e.本部门及以下数据权限=2]="本部门及以下数据权限",e[e.仅本人数据权限=3]="仅本人数据权限",e[e.自定义数据权限=4]="自定义数据权限",e))(Ts||{});const to=(e,a,r)=>{var s,f,c,l;if(((c=(f=(s=Nc.value)==null?void 0:s.key)==null?void 0:f.layer)==null?void 0:c.toUpperCase())==="SUPERADMIN"||!r)return e;const n=(l=r==null?void 0:r["系统管理/用户管理"])==null?void 0:l.find(o=>{var u;return(o==null?void 0:o.id)===((u=Nc.value)==null?void 0:u.id)}),t=A1(n,r);if(!t)return e;switch(Ts==null?void 0:Ts[t]){case 0:return e;case 1:return a?e===null&&typeof e!="object"?e:Object.fromEntries(Object.entries(e).filter(([u,x])=>{var p,m,g,y,v,E,w,S,T;const h=x==null?void 0:x[1],d=u[(u==null?void 0:u.length)-1]===Pc.value;return((m=(p=h==null?void 0:h.key)==null?void 0:p.createUserLayer)==null?void 0:m.toUpperCase())==="SUPERADMIN"||((g=h==null?void 0:h.key)==null?void 0:g.createUserOrg)===((v=(y=n==null?void 0:n.value)==null?void 0:y.tableData)==null?void 0:v.部门名称)||((E=h==null?void 0:h.key)==null?void 0:E.createUserOrg)===((S=(w=n==null?void 0:n.value)==null?void 0:w.tableData)==null?void 0:S.部门名称)&&((T=h==null?void 0:h.key)==null?void 0:T.createUserId)===(n==null?void 0:n.id)||d})):e==null?void 0:e.filter(o=>{var u,x,h,d,p,m,g,y,v;return((x=(u=o==null?void 0:o.key)==null?void 0:u.createUserLayer)==null?void 0:x.toUpperCase())==="SUPERADMIN"||((h=o==null?void 0:o.key)==null?void 0:h.createUserOrg)===((p=(d=n==null?void 0:n.value)==null?void 0:d.tableData)==null?void 0:p.部门名称)||((m=o==null?void 0:o.key)==null?void 0:m.createUserOrg)===((y=(g=n==null?void 0:n.value)==null?void 0:g.tableData)==null?void 0:y.部门名称)&&((v=o==null?void 0:o.key)==null?void 0:v.createUserId)===(n==null?void 0:n.id)});case 2:break;case 3:return a?e===null&&typeof e!="object"?e:Object.fromEntries(Object.entries(e).filter(([u,x])=>{var p;const h=x==null?void 0:x[1],d=u[(u==null?void 0:u.length)-1]===Pc.value;return((p=h==null?void 0:h.key)==null?void 0:p.createUserId)===(n==null?void 0:n.id)||d})):e==null?void 0:e.filter(o=>{var u;return((u=o==null?void 0:o.key)==null?void 0:u.createUserId)===(n==null?void 0:n.id)})}},F1=Ae.useModelComp(Ae.pinia),{routeToChildPath:mn}=Ae.storeToRefs(F1),In=Q.useMenuState(Ae.pinia),{activeMenuPath:a0}=Ae.storeToRefs(In),Di=Q.useLoginState(),{loginUserInfo:Pa}=Ae.storeToRefs(Di),D1=l0(Ae.pinia),{originalPath:I1}=Ae.storeToRefs(D1),ot=I1.value,b1=e=>{const a=/^name(\d+)$/,r=e==null?void 0:e.map(t=>{const i=[];for(const s in t){const f=s.match(a);f&&i.push({idx:Number(f[1]),value:t[s]})}return!i.length&&t.name&&i.push({idx:-1,value:t.name}),i.sort((s,f)=>s.idx-f.idx),{item:t,names:i}});function n(t,i){if(!t)return[];let s=[];const f=[];t.forEach(x=>{var h;return(((h=x.names)==null?void 0:h.length)>i?s:f).push(x)});const c=f.map(x=>x.item),l=new Map;s=s==null?void 0:s.sort((x,h)=>{var d,p;return((d=x==null?void 0:x.item)==null?void 0:d.orderId)-((p=h==null?void 0:h.item)==null?void 0:p.orderId)});for(const x of s){const h=x.names[x.names.length-i-1].value;l.has(h)||l.set(h,[]),l.get(h).push(x)}return[...Array.from(l.keys()).map(x=>{var m,g,y,v;const h=l.get(x);if(h[0].names.length===1&&(h!=null&&h.every(E=>{var w,S;return((S=(w=E==null?void 0:E.names)==null?void 0:w[0])==null?void 0:S.idx)===-1})))return h[0].item;let d=h==null?void 0:h.filter(E=>{var w,S;return((S=(w=E==null?void 0:E.names)==null?void 0:w[0])==null?void 0:S.idx)!==-1}),p=new Map;return d==null||d.forEach(E=>{let w=E==null?void 0:E.item,S="";for(let T in w)T!=null&&T.includes("name")&&(S=S===""?w==null?void 0:w[T]:S+"/"+(w==null?void 0:w[T]));for(const[T,B]of p.entries())(T.includes(S)||S!=null&&S.includes(T))&&(S=T);p.set(S,E)}),d=Array.from(p.values()),{name:x,isShow:!0,comp:"ParentItem",children:(m=n(d,i+1))==null?void 0:m.sort((E,w)=>(E==null?void 0:E.orderId)-(w==null?void 0:w.orderId)),orderId:(v=(y=(g=n(d,i+1))==null?void 0:g.sort((E,w)=>((E==null?void 0:E.orderId)??0)-((w==null?void 0:w.orderId)??0)))==null?void 0:y[0])==null?void 0:v.orderId}}),...c]}if(r)return n(r,0)},C1=async e=>{let a=new WeakMap,r=e;return a!=null&&a[a0.value+"/"]||(r=e==null?void 0:e.map(n=>{var t;return Array.isArray(n==null?void 0:n.compData)&&(n.compData=(t=n.compData)==null?void 0:t.map(i=>{var s;return(i==null?void 0:i.key)==="header"&&(i.contents=(s=i.contents)==null?void 0:s.map(f=>((f==null?void 0:f.directiveLabel)==="#isMain"&&(f.directiveColor=!0),f))),i})),n})),r},O1=e=>{var n;let a=[],r=[];if(e!=null&&e.find(t=>t==null?void 0:t.choice)){let t=e==null?void 0:e.filter(f=>f==null?void 0:f.choice),i="";for(let f in t==null?void 0:t[0])f!=null&&f.includes("name")&&(i=(n=t==null?void 0:t[0])==null?void 0:n[f]);let s=t==null?void 0:t.map(f=>f!=null&&f.name1?f==null?void 0:f.name0:f==null?void 0:f.name);s=[...new Set(s)],s=s==null?void 0:s.map(f=>({label:f,value:f})),r=[{comp:"Radio",compData:s,name:i,isShow:!0}]}if(e!=null&&e.find(t=>t==null?void 0:t.tab)&&(e==null||e.forEach(t=>{if(!(t!=null&&t.tab))a.push(t);else if(a!=null&&a.find(i=>(i==null?void 0:i.tabInform)===(t==null?void 0:t.tab)))a=a==null?void 0:a.map(i=>{if((i==null?void 0:i.comp)==="Tabs"&&(i==null?void 0:i.tabInform)===(t==null?void 0:t.tab)){let s=i.compData,{tab:f,...c}=t;c.label=c==null?void 0:c.name,c.name="",s.push(c),i.compData=s}return i});else{let{tab:i,...s}=t,f=s==null?void 0:s.name0;s.label=s==null?void 0:s.name,s.name="";let c={comp:"Tabs",name:f,tabInform:t==null?void 0:t.tab,compData:[s],choices:t==null?void 0:t.choice};a.push(c)}})),(a==null?void 0:a.length)===0&&(r==null?void 0:r.length)===0)return e;if((r==null?void 0:r.length)===0)return a;if((a==null?void 0:a.length)===0){let t=e==null?void 0:e.findIndex(i=>(i==null?void 0:i.choice)??(i==null?void 0:i.choices));return e.splice(t,0,r==null?void 0:r[0]),e=e==null?void 0:e.map((i,s)=>{if(s>t){let f={};for(let c in i)c!=null&&c.includes("name")||(f[c]=i==null?void 0:i[c]);f.choiceName=i!=null&&i.name1?i==null?void 0:i.name0:i==null?void 0:i.name,i=f}return i}),e}else{let t=a==null?void 0:a.findIndex(i=>(i==null?void 0:i.choice)??(i==null?void 0:i.choices));return a.splice(t,0,r==null?void 0:r[0]),a=a==null?void 0:a.map((i,s)=>{if(s>t){let f={};for(let c in i)c!=null&&c.includes("name")||(f[c]=i==null?void 0:i[c]);f.choiceName=i!=null&&i.name1?i==null?void 0:i.name0:i==null?void 0:i.name,i=f}return i}),a}},R1=async e=>{let a=e;return a=a==null?void 0:a.filter(r=>r),a=O1(a),a!=null&&a.every(r=>{var n,t;return((t=(n=Object.keys(r))==null?void 0:n.filter(i=>i==null?void 0:i.includes("name")))==null?void 0:t.length)===1})?a:b1(a)},N1=async()=>{var i,s,f,c,l,o,u,x,h,d,p,m,g,y,v,E,w,S,T,B,I,U,L,W,M,se,ne,he,ce,Ce,K,Te,Fe,_,A,D,b,G,re,ee,Z,J,we,P,Me,be,Ye,Be,ie,hr,sr,Ea,Ia,wt,Za,Ta,za,Se,Pe,Ue,wa,er,Cr,me,Dr,Rr,xr;In.setImportLoading(!0);let e="";const a=await la.getInsofDataApi({key:{type:"structure",pageKey:Q.cloneDeep(mn).value,systemKey:sessionStorage.getItem("systemKey")}});if(((s=(i=a==null?void 0:a.data)==null?void 0:i.result)==null?void 0:s.length)>0){let Er=(h=(x=(u=(o=(l=(c=(f=a==null?void 0:a.data)==null?void 0:f.result)==null?void 0:c[0])==null?void 0:l.value)==null?void 0:o.pageData)==null?void 0:u.compData)==null?void 0:x.find(da=>(da==null?void 0:da.key)==="header"))==null?void 0:h.contents;e=(p=(d=Q.cloneDeep(Er))==null?void 0:d[0])==null?void 0:p.label}let r=a0.value;(y=a0.value)!=null&&y.includes(`updateLoading${((m=Pa.value)==null?void 0:m.account)||((g=Pa.value)==null?void 0:g.账号)}`)?r=Q.cloneDeep(a0).value:(w=a0.value)!=null&&w.includes(`loading${((v=Pa.value)==null?void 0:v.account)||((E=Pa.value)==null?void 0:E.账号)}`)&&(r=Q.cloneDeep(mn).value+ot+`loading${((S=Pa.value)==null?void 0:S.account)||((T=Pa.value)==null?void 0:T.账号)}`);const n=await la.getInsofDataApi({key:{pageKey:r,systemKey:sessionStorage.getItem("systemKey")}});let t=[];if(((I=(B=n==null?void 0:n.data)==null?void 0:B.result)==null?void 0:I.length)>0){let Er="",da=[];(L=(U=n==null?void 0:n.data)==null?void 0:U.result)==null||L.forEach(He=>{var Vr,ia,Sa,xa,cr;((ia=(Vr=He==null?void 0:He.value)==null?void 0:Vr.pageData)==null?void 0:ia.comp)==="Form"&&((cr=(xa=(Sa=He==null?void 0:He.value)==null?void 0:Sa.pageData)==null?void 0:xa.compData)==null||cr.forEach(Sr=>{(Sr==null?void 0:Sr.key)==="formContent"&&(da=[...da,...Sr==null?void 0:Sr.contents])}))});let ta=da==null?void 0:da.find(He=>(He==null?void 0:He.isMain)===!0);if(ta?(Er=ta==null?void 0:ta.value,e=ta==null?void 0:ta.key):Er=(Te=(K=(Ce=(ce=(he=(ne=(se=(M=(W=n==null?void 0:n.data)==null?void 0:W.result)==null?void 0:M[0])==null?void 0:se.value)==null?void 0:ne.pageData)==null?void 0:he.compData)==null?void 0:ce.find(He=>(He==null?void 0:He.key)==="formContent"))==null?void 0:Ce.contents)==null?void 0:K.find(He=>{var Vr,ia;return(He==null?void 0:He.key)===e||((ia=(Vr=He==null?void 0:He.optionUrl)==null?void 0:Vr.groupSelect)==null?void 0:ia[1])===e}))==null?void 0:Te.value,(A=a0.value)!=null&&A.includes(`updateLoading${((Fe=Pa.value)==null?void 0:Fe.account)||((_=Pa.value)==null?void 0:_.账号)}`)){let He=[],Vr=[];const ia=await la.getInsofDataApi({key:{pageKey:(be=a0.value.split(ot+`updateLoading${((P=Pa.value)==null?void 0:P.account)||((Me=Pa.value)==null?void 0:Me.账号)}`))==null?void 0:be[0],systemKey:sessionStorage.getItem("systemKey")}});if(((Be=(Ye=ia==null?void 0:ia.data)==null?void 0:Ye.result)==null?void 0:Be.length)>0){let Sa=(ie=n==null?void 0:n.data)==null?void 0:ie.result,xa=(hr=Q.cloneDeep(Sa))==null?void 0:hr.map(async cr=>{var Sr,Ra,Ua,Wa,ft,Ot,Rt,yt,Nt,Pt,Mt,k,N,F;if(((Sr=cr==null?void 0:cr.key)==null?void 0:Sr.type)==="structure"){let C=(ft=(Wa=(Ua=(Ra=cr==null?void 0:cr.value)==null?void 0:Ra.pageData)==null?void 0:Ua.compData)==null?void 0:Wa.find(O=>(O==null?void 0:O.key)==="parentFormPath"))==null?void 0:ft.contents;if(C){let O=await wn(C,sessionStorage.getItem("systemKey"),""),R=(Nt=(yt=(Rt=(Ot=cr==null?void 0:cr.value)==null?void 0:Ot.pageData)==null?void 0:Rt.compData)==null?void 0:yt.find(j=>(j==null?void 0:j.key)==="formContent"))==null?void 0:Nt.contents,X=O==null?void 0:O.filter(j=>(j==null?void 0:j.comp)==="Form");X==null||X.forEach(j=>{var z;(z=j==null?void 0:j.compData)==null||z.forEach(V=>{var Y,le;if((V==null?void 0:V.key)==="formContent"&&((Y=V==null?void 0:V.contents)==null?void 0:Y.some(Ee=>R==null?void 0:R.find(ue=>(ue==null?void 0:ue.prop)===(Ee==null?void 0:Ee.prop))))){let Ee=j;Ee.compData=(le=Ee.compData)==null?void 0:le.map(ge=>{var Ze;return(ge==null?void 0:ge.key)==="formContent"&&(ge.contents=(Ze=ge.contents)==null?void 0:Ze.map(Tr=>{var Lr;return R!=null&&R.find(Kr=>(Kr==null?void 0:Kr.prop)===(Tr==null?void 0:Tr.prop))&&(Tr.value=(Lr=R==null?void 0:R.find(Kr=>(Kr==null?void 0:Kr.prop)===(Tr==null?void 0:Tr.prop)))==null?void 0:Lr.value),Tr})),ge});let ue={};for(let ge in Ee)ge!=="id"&&(ue[ge]=Ee[ge]);t.push({id:j==null?void 0:j.id,value:{pageData:ue}})}})})}else if((Mt=(Pt=ia==null?void 0:ia.data)==null?void 0:Pt.result)!=null&&Mt.find(O=>{var R,X,j,z;return((X=(R=O==null?void 0:O.value)==null?void 0:R.pageData)==null?void 0:X.name)===((z=(j=cr==null?void 0:cr.value)==null?void 0:j.pageData)==null?void 0:z.name)})){let O=cr==null?void 0:cr.key;O.pageKey=Q.cloneDeep(mn).value+ot+Er,t.push({id:(F=(N=(k=ia==null?void 0:ia.data)==null?void 0:k.result)==null?void 0:N.find(R=>{var X,j,z,V;return((j=(X=R==null?void 0:R.value)==null?void 0:X.pageData)==null?void 0:j.name)===((V=(z=cr==null?void 0:cr.value)==null?void 0:z.pageData)==null?void 0:V.name)}))==null?void 0:F.id,key:O,value:cr==null?void 0:cr.value})}else{let O=cr==null?void 0:cr.key;O.pageKey=Q.cloneDeep(mn).value+ot+Er,He.push({key:O,value:cr==null?void 0:cr.value})}}});await Promise.all(xa),(Ea=(sr=n==null?void 0:n.data)==null?void 0:sr.result)==null||Ea.forEach(cr=>{var Ra,Ua,Wa;let Sr=(Ra=Q.cloneDeep(cr))==null?void 0:Ra.key;Sr.pageKey=Q.cloneDeep(mn).value+ot+Er+ot+`updateLoading${((Ua=Pa.value)==null?void 0:Ua.account)||((Wa=Pa.value)==null?void 0:Wa.账号)}`,In.setChildMenu(Sr.pageKey),t.push({id:cr==null?void 0:cr.id,key:Sr})})}if(Er===""){z0.ElMessage.error(`保存失败,${e}的必填字段没有填写`),In.setImportLoading(!1);return}if((t==null?void 0:t.length)>0){await la.batchUpdateInsofDataApi({dataList:t}),(Ia=t==null?void 0:t[0])!=null&&Ia.key&&await Di.setLogRecordAsync({type:"保存",data:t},(wt=t==null?void 0:t[0])==null?void 0:wt.key),(He==null?void 0:He.length)>0&&(await la.batchAddInsofDataApi({dataList:He}),(Za=He==null?void 0:He[0])!=null&&Za.key&&await Di.setLogRecordAsync({type:"保存",data:He},(Ta=He==null?void 0:He[0])==null?void 0:Ta.key));const Sa=await la.getInsofDataApi({key:{pageKey:(Pe=a0.value.split(ot+`updateLoading${((za=Pa.value)==null?void 0:za.account)||((Se=Pa.value)==null?void 0:Se.账号)}`))==null?void 0:Pe[0],systemKey:sessionStorage.getItem("systemKey")}});if(((wa=(Ue=Sa==null?void 0:Sa.data)==null?void 0:Ue.result)==null?void 0:wa.length)>0){let xa=[],cr=(er=n==null?void 0:n.data)==null?void 0:er.result;(Cr=Q.cloneDeep(cr))==null||Cr.forEach(Sr=>{var Ra,Ua,Wa,ft,Ot,Rt,yt,Nt,Pt,Mt,k,N;if(((Ra=Sr==null?void 0:Sr.key)==null?void 0:Ra.type)!=="structure"){let F=(ft=(Wa=(Ua=Sa==null?void 0:Sa.data)==null?void 0:Ua.result)==null?void 0:Wa.filter(X=>{var j;return((j=X==null?void 0:X.key)==null?void 0:j.type)==="data"}))==null?void 0:ft.map(X=>X==null?void 0:X.id);xa=[...xa,...F];let C=(Nt=(yt=(Rt=(Ot=Q.cloneDeep(cr))==null?void 0:Ot.find(X=>{var j;return((j=Sr==null?void 0:Sr.key)==null?void 0:j.tableId)===(X==null?void 0:X.id)}))==null?void 0:Rt.value)==null?void 0:yt.pageData)==null?void 0:Nt.name,O=(k=(Mt=(Pt=Sa==null?void 0:Sa.data)==null?void 0:Pt.result)==null?void 0:Mt.find(X=>{var j,z;return((z=(j=X==null?void 0:X.value)==null?void 0:j.pageData)==null?void 0:z.name)===C}))==null?void 0:k.id,R=(N=Q.cloneDeep(Sr))==null?void 0:N.key;R.tableId=O,R.pageKey=Q.cloneDeep(mn).value+ot+Er,Vr.push({key:R,value:Sr==null?void 0:Sr.value})}}),(xa==null?void 0:xa.length)>0&&(xa=[...new Set(xa)],await la.batchDeleteInsofDataApi({ids:xa})),(Dr=(me=n==null?void 0:n.data)==null?void 0:me.result)==null||Dr.forEach(Sr=>{var Ua,Wa,ft;let Ra=(Ua=Q.cloneDeep(Sr))==null?void 0:Ua.key;Ra.pageKey=Q.cloneDeep(mn).value+ot+Er+ot+`updateLoading${((Wa=Pa.value)==null?void 0:Wa.account)||((ft=Pa.value)==null?void 0:ft.账号)}`,In.setChildMenu(Ra.pageKey),t.push({id:Sr==null?void 0:Sr.id,key:Ra})})}(Vr==null?void 0:Vr.length)>0&&(await la.batchAddInsofDataApi({dataList:Vr}),(Rr=He==null?void 0:He[0])!=null&&Rr.key&&await Di.setLogRecordAsync({type:"保存",data:Vr},(xr=Vr==null?void 0:Vr[0])==null?void 0:xr.key)),z0.ElMessage.success("保存成功")}}else{if((b=(D=n==null?void 0:n.data)==null?void 0:D.result)==null||b.forEach(He=>{var ia;let Vr=(ia=Q.cloneDeep(He))==null?void 0:ia.key;Vr.pageKey=Q.cloneDeep(mn).value+ot+Er,In.setChildMenu(Vr.pageKey),t.push({id:He==null?void 0:He.id,key:Vr})}),Er===""){z0.ElMessage.error(`保存失败,${e}的必填字段没有填写`),In.setImportLoading(!1),In.setChildMenu("");return}(G=t==null?void 0:t[0])!=null&&G.key&&(await la.batchUpdateInsofDataApi({dataList:t}),await Di.setLogRecordAsync({type:"保存",data:t},(re=t==null?void 0:t[0])==null?void 0:re.key)),await Pf(Q.cloneDeep(mn).value+ot+Er,Q.cloneDeep(mn).value+ot+Er+ot+`updateLoading${((ee=Pa.value)==null?void 0:ee.account)||((Z=Pa.value)==null?void 0:Z.账号)}`),In.setActiveMenuPath(Q.cloneDeep(mn).value+ot+Er+ot+`updateLoading${((J=Pa.value)==null?void 0:J.account)||((we=Pa.value)==null?void 0:we.账号)}`),z0.ElMessage.success("保存成功")}}In.setImportLoading(!1)},P1=(e,a)=>{let r=e;const n=[];let t="",i=0;for(const s of r)i++,s.includes("{")||t.includes("{")||s.includes("[")||t.includes("[")||s.includes("【")||t.includes("【")||s.includes("(")||t.includes("(")||s.includes("(")||t.includes("(")||s.includes("/*")||t.includes("/*")?(t+=s.trim(),Q.cloneDeep(t).split("{").length-1===Q.cloneDeep(t).split("}").length-1&&Q.cloneDeep(t).split("【").length-1===Q.cloneDeep(t).split("】").length-1&&Q.cloneDeep(t).split("[").length-1===Q.cloneDeep(t).split("]").length-1&&Q.cloneDeep(t).split("(").length-1===Q.cloneDeep(t).split(")").length-1&&Q.cloneDeep(t).split("(").length-1===Q.cloneDeep(t).split(")").length-1&&Q.cloneDeep(t).split("/*").length-1===Q.cloneDeep(t).split("*/").length-1&&t[t.length-1]!==","&&t[t.length-1]===a?(n.push(t.replace(/\/\*[\s\S]*?\*\//g,"")),t=""):i===(e==null?void 0:e.length)&&n.push(t.replace(/\/\*[\s\S]*?\*\//g,""))):(t+=s.trim(),(t==null?void 0:t[(t==null?void 0:t.length)-1])===a&&(n.push(t.replace(/\/\*[\s\S]*?\*\//g,"")),t=""));return n},Mc=(e,a)=>{let r=e;const n=[];let t="",i=0;for(const s of r)i++,s.includes("{")||t.includes("{")||s.includes("[")||t.includes("[")||s.includes("【")||t.includes("【")||s.includes("(")||t.includes("(")||s.includes("(")||t.includes("(")||s.includes("/*")||t.includes("/*")?(t+=s.trim(),Q.cloneDeep(t).split("{").length-1===Q.cloneDeep(t).split("}").length-1&&Q.cloneDeep(t).split("【").length-1===Q.cloneDeep(t).split("】").length-1&&Q.cloneDeep(t).split("[").length-1===Q.cloneDeep(t).split("]").length-1&&Q.cloneDeep(t).split("(").length-1===Q.cloneDeep(t).split(")").length-1&&Q.cloneDeep(t).split("(").length-1===Q.cloneDeep(t).split(")").length-1&&Q.cloneDeep(t).split("/*").length-1===Q.cloneDeep(t).split("*/").length-1&&(t[t.length-1]===":"&&t[t.length-2]!=="r"||t[t.length-1]===a)&&(t.match(/'/g)||[]).length%2===0?(n.push(t.replace(/\/\*[\s\S]*?\*\//g,"")),t=""):i===(e==null?void 0:e.length)&&(n.push(t.replace(/\/\*[\s\S]*?\*\//g,"")),t="")):(t+=s.trim(),((t==null?void 0:t[(t==null?void 0:t.length)-1])===a||t[t.length-1]===":"&&t[t.length-2]!=="r")&&(t.match(/'/g)||[]).length%2===0&&(n.push(t.replace(/\/\*[\s\S]*?\*\//g,"")),t=""));return(t==null?void 0:t.length)!==0&&n.push(t.replace(/\/\*[\s\S]*?\*\//g,"")),n},Lc=(e,a)=>{let r=0;for(let n=0;n<e.length;n++)e[n]===a&&r++;return r%2===0},p0=(e,a)=>{let r=e;const n=[];let t="",i=0;for(const s of r)i++,s.includes("{")||t.includes("{")||s.includes("[")||t.includes("[")||s.includes("【")||t.includes("【")||s.includes("(")||t.includes("(")||s.includes("(")||t.includes("(")||s.includes("/*")||t.includes("/*")?(t+=s.trim(),Q.cloneDeep(t).split("{").length-1===Q.cloneDeep(t).split("}").length-1&&Q.cloneDeep(t).split("【").length-1===Q.cloneDeep(t).split("】").length-1&&Q.cloneDeep(t).split("[").length-1===Q.cloneDeep(t).split("]").length-1&&Q.cloneDeep(t).split("(").length-1===Q.cloneDeep(t).split(")").length-1&&Q.cloneDeep(t).split("(").length-1===Q.cloneDeep(t).split(")").length-1&&Q.cloneDeep(t).split("/*").length-1===Q.cloneDeep(t).split("*/").length-1&&t[t.length-1]===a&&Lc(t,"'")?(n.push(t.replace(/\/\*[\s\S]*?\*\//g,"")),t=""):i===(e==null?void 0:e.length)&&(n.push(t.replace(/\/\*[\s\S]*?\*\//g,"")),t="")):(t+=s.trim(),(t==null?void 0:t[(t==null?void 0:t.length)-1])===a&&Lc(t,"'")&&(n.push(t.replace(/\/\*[\s\S]*?\*\//g,"")),t=""));return(t==null?void 0:t.length)!==0&&n.push(t.replace(/\/\*[\s\S]*?\*\//g,"")),n},M1=l0(Ae.pinia),{originalPath:Xw}=Ae.storeToRefs(M1),L1=e=>{var r,n;let a=(n=(r=e==null?void 0:e.slice(1,(e==null?void 0:e.length)-1))==null?void 0:r.split(","))==null?void 0:n.map(t=>{var i,s,f,c,l;return(l=(c=(f=(s=(i=t==null?void 0:t.split("=="))==null?void 0:i[0])==null?void 0:s.replaceAll("'",""))==null?void 0:f.split("#"))==null?void 0:c[0])==null?void 0:l.trim()});return a=JSON.stringify(a),a},vf=e=>{let a=Q.cloneDeep(e),r=[],n="",t="",i=(a==null?void 0:a[0])==="["?Mc(a.slice(1,a.length-1),","):Mc(a,",");return i==null||i.forEach((s,f)=>{var l,o,u,x,h,d,p,m;let c=s;if(c[c.length-1]===","&&(c=c.slice(0,c.length-1)),c.slice(1,(c==null?void 0:c.length)-1).includes("[")&&(c==null?void 0:c[0])==="["){let g=vf(c);if((i==null?void 0:i.length)===2&&((o=i==null?void 0:i[0])==null?void 0:o[((l=i==null?void 0:i[0])==null?void 0:l.length)-1])===":"){let y=i[f-1].replaceAll(",","").trim();y[y.length-1]===":"&&(y=y.slice(0,y.length-1));let v=(u=vf(c))==null?void 0:u.parentStringContent;v="["+((x=v==null?void 0:v.slice(0,(v==null?void 0:v.length)-1))==null?void 0:x.replaceAll("'",'"'))+"]";let E={[y]:v};r.push(E)}else t=t+c+",";n=n+(g==null?void 0:g.stringContent),t=t+(g==null?void 0:g.parentStringContent),r=[...r,...g==null?void 0:g.parentColumns]}else if((c==null?void 0:c[0])!=="["&&c[c.length-1]===":")c=c.slice(0,c.length-1),n=n+c+",",t=t+((h=c==null?void 0:c.split("#"))==null?void 0:h[0])+",";else if((c==null?void 0:c[0])==="["&&i[f-1]){(p=(d=c==null?void 0:c.slice(1,(c==null?void 0:c.length)-1))==null?void 0:d.split(","))==null||p.forEach(v=>{n=n+v+","});let g=i[f-1].replaceAll(",","").trim();g[g.length-1]===":"&&(g=g.slice(0,g.length-1));let y={[g]:L1(c)};r.push(y)}else n=n+c+",",t=t+((m=c==null?void 0:c.split("#"))==null?void 0:m[0])+","}),{parentColumns:r,stringContent:n,parentStringContent:t}},_f=Q.useMenuState(Ae.pinia),{activeMenuPath:us}=Ae.storeToRefs(_f),B1=Q.useUnit(Ae.pinia),{chooseTitle:Ai}=Ae.storeToRefs(B1);let br="$R";const U1=Ws(Ae.pinia),{multipleTableConst:Bc}=Ae.storeToRefs(U1),W1=Q.useLoginState(Ae.pinia),{loginUserInfo:$w,systemInfo:Uc}=Ae.storeToRefs(W1),no=Ae.useModelComp(Ae.pinia),H1=l0(Ae.pinia),{originalPath:G1}=Ae.storeToRefs(H1),{payloadTypes:Kw}=Ae.storeToRefs(no),gn=(e,a)=>(a==null?void 0:a.split(",")).some(n=>Object.keys(e).some(t=>t.startsWith("name")&&e[t]===n)),Qs={onNumSlice:zh,onRandomContents:Yh,onConditionContents:Kh,onPaceContents:$h,onMainTagContents:Gh,onFatherPaceContents:Xh,onButtonContents:Hh,onPamButtonContents:Wh,onRowButtonContents:Uh},io=async e=>{const a=e.slice(0,e.indexOf("(")).trim(),r=Qs==null?void 0:Qs[a];if(typeof r!="function"){console.log(`找不到函数: ${a}`);return}const n=e.slice(e.indexOf("(")+1,e.lastIndexOf(")")),t=await new Function(`return [${n}]`)();return r(...Array.isArray(t)?t:[t])},yf=(e,a,r="children")=>{var f;let n=[],t=[],i=[],s=0;for(const c of e){const l=a.some(x=>{var d,p,m,g,y,v,E,w;const[h]=x.split(".");return h===c.prop||h===c.label||h===((g=(d=c.prop)==null?void 0:d.split("."))==null?void 0:g[((m=(p=c.prop)==null?void 0:p.split("."))==null?void 0:m.length)-1])||h===((w=(y=c.prop)==null?void 0:y.split("."))==null?void 0:w[((E=(v=c.prop)==null?void 0:v.split("."))==null?void 0:E.length)-1].replace(/\d+$/,""))}),o=a.filter(x=>x.includes(".")).map(x=>x.split(".").slice(1).join("."));s=s+1;let u;if(l&&(u={...c},t.push(s),i.push(u==null?void 0:u.prop),delete u[r]),c[r]){const x=(f=yf(c[r],(o==null?void 0:o.length)>0?o:a,r))==null?void 0:f.contents;x.length&&(t.push(s),i.push(u==null?void 0:u.prop),s=s+1,u=u||{...c},n=[...n,...x],u=x)}u&&!Array.isArray(u)&&n.push(u)}return{contents:n,ids:t,props:i}},X1=e=>{if(!$t(e))return[e];const a=new Function(`return ${e}`)(),r=[];return((t,i="")=>{for(const s of t)if(Array.isArray(s)){const[f,c]=s;Array.isArray(c)?c.forEach(l=>r.push(`"${f}:${l}"`)):r.push(i?`"${i}:${f}"`:'"'+f+'"')}else r.push('"'+s+'"')})(a),r},$1=async(e,a,r,n,t,i)=>{var l,o,u,x,h,d,p,m,g,y,v,E,w,S,T,B,I,U,L,W,M,se,ne,he,ce,Ce,K,Te,Fe,_,A,D,b,G,re,ee,Z,J,we,P,Me,be,Ye,Be,ie,hr,sr,Ea,Ia,wt,Za,Ta,za,Se,Pe,Ue,wa,er,Cr,me,Dr,Rr,xr,Er,da,ta,He,Vr,ia,Sa,xa,cr,Sr,Ra,Ua,Wa,ft,Ot,Rt,yt,Nt,Pt,Mt,k,N,F,C,O,R,X,j,z,V,Y,le,_e,Ee,ue,ge,Ze,Tr,Lr,Kr,sn,fn,cn,Lt,Pn;let s=[],f=(o=(l=e==null?void 0:e.find(rr=>(rr==null?void 0:rr.key)==="header"))==null?void 0:l.contents)==null?void 0:o.filter(rr=>!(rr!=null&&rr.columnPath)&&(rr==null?void 0:rr.label)!=="操作"),c=(x=(u=e==null?void 0:e.find(rr=>(rr==null?void 0:rr.key)==="header"))==null?void 0:u.contents)==null?void 0:x.filter(rr=>rr==null?void 0:rr.columnPath);if(Array.isArray((d=(h=e==null?void 0:e.find(rr=>(rr==null?void 0:rr.key)==="header"))==null?void 0:h.contents)==null?void 0:d[0])){let rr=(g=(m=(p=e==null?void 0:e.find(de=>(de==null?void 0:de.key)==="header"))==null?void 0:p.contents)==null?void 0:m[0])==null?void 0:g.filter(de=>de==null?void 0:de.columnPath);c=[...c,...rr]}for(let rr=0;rr<(c==null?void 0:c.length);rr++){let de=Q.cloneDeep(c==null?void 0:c[rr]);if(de.columnPath=(v=(y=de==null?void 0:de.columnPath)==null?void 0:y.replaceAll("{",""))==null?void 0:v.replaceAll("}",""),de||(de=(T=(S=_n((w=(E=e==null?void 0:e.find(Ne=>(Ne==null?void 0:Ne.key)==="header"))==null?void 0:E.contents)==null?void 0:w[0]))==null?void 0:S.filter(Ne=>Ne==null?void 0:Ne.columnPath))==null?void 0:T[rr]),de!=null&&de.columnPath&&(de==null?void 0:de.columnPath)!==""){let Ne="";if((B=de==null?void 0:de.columnPath)!=null&&B.includes("@Type")||(Ne=Ne===""?Ne+"@Type:Manual":Ne+",@Type:Manual"),(I=de==null?void 0:de.columnPath)!=null&&I.includes("@SonSync")||(Ne=Ne===""?Ne+"@SonSync:No":Ne+",@SonSync:No"),(U=de==null?void 0:de.columnPath)!=null&&U.includes("@FatherSync")||(Ne=Ne===""?Ne+"@FatherSync:Yes":Ne+",@FatherSync:Yes"),((W=de==null?void 0:de.columnPath)==null?void 0:W[((L=de==null?void 0:de.columnPath)==null?void 0:L.length)-1])===")"){let Br="";((se=(M=de.columnPath)==null?void 0:M.split("("))==null?void 0:se.length)!==((he=(ne=de.columnPath)==null?void 0:ne.split(")"))==null?void 0:he.length)?Br=((Ce=de.columnPath)==null?void 0:Ce.slice(0,(ce=de.columnPath)==null?void 0:ce.length))+","+Ne+")":Br=((Te=de.columnPath)==null?void 0:Te.slice(0,((K=de.columnPath)==null?void 0:K.length)-1))+","+Ne+")",de.columnPath=Ne===""?de.columnPath:Br}else(Fe=de==null?void 0:de.columnPath)!=null&&Fe.includes("@")?de.columnPath=de.columnPath+","+Ne+")":de.columnPath=de.columnPath+"("+Ne+")"}let Mn=(_=e==null?void 0:e.find(Ne=>(Ne==null?void 0:Ne.key)==="dictContents"))==null?void 0:_.contents,L0="",Ln=(b=(D=(A=c==null?void 0:c[rr])==null?void 0:A.columnPath)==null?void 0:D.replace("[",br))==null?void 0:b.split(br),jr=(ee=(re=(G=Ln==null?void 0:Ln[(Ln==null?void 0:Ln.length)-1])==null?void 0:G.replace("(",br))==null?void 0:re.split(br))==null?void 0:ee[0];jr=jr==null?void 0:jr.slice(0,(jr==null?void 0:jr.length)-1);let Xe=(Me=(P=(we=(J=Q.cloneDeep((Z=c==null?void 0:c[rr])==null?void 0:Z.columnPath))==null?void 0:J.split("["+jr+"]"))==null?void 0:we[0])==null?void 0:P.replaceAll("{",""))==null?void 0:Me.replaceAll("}","");(Xe==null?void 0:Xe[(Xe==null?void 0:Xe.length)-1])==="/"&&((Ye=(be=Ai.value)==null?void 0:be[0])!=null&&Ye.value)&&(Xe=Xe+((ie=(Be=Ai.value)==null?void 0:Be[0])==null?void 0:ie.value));let pa="",Bn="",lr="",Ha=Q.cloneDeep(jr);if(jr=(sr=(hr=jr==null?void 0:jr.split(":"))==null?void 0:hr[0])==null?void 0:sr.replaceAll("'",""),Xe===""&&((Ia=(Ea=Ai.value)==null?void 0:Ea[0])!=null&&Ia.value&&((Za=(wt=Ai.value)==null?void 0:wt[0])==null?void 0:Za.value)!==""?Xe=us.value+"/"+((za=(Ta=Ai.value)==null?void 0:Ta[0])==null?void 0:za.value):Xe=us.value),Xe!=null&&Xe.includes("[")){let Ne=(wa=(Ue=(Pe=(Se=Xe==null?void 0:Xe.split("["))==null?void 0:Se[1])==null?void 0:Pe.split("]"))==null?void 0:Ue[0])==null?void 0:wa.split("/");Bn=Xe,pa=(me=(Cr=(er=Xe==null?void 0:Xe.split("["))==null?void 0:er[1])==null?void 0:Cr.split("]"))==null?void 0:me[0];let Br="";r==null||r.forEach(na=>{var Ur,Le,B0,te,H;((Le=(Ur=na==null?void 0:na.value)==null?void 0:Ur.pageData)==null?void 0:Le.name)===(Ne==null?void 0:Ne[0])&&((H=(te=(B0=na==null?void 0:na.value)==null?void 0:B0.pageData)==null?void 0:te.compData)==null||H.forEach(q=>{var pe;(q==null?void 0:q.key)==="formContent"&&((pe=q==null?void 0:q.contents)==null||pe.forEach(xe=>{var Ar;if((xe==null?void 0:xe.prop)===(Ne==null?void 0:Ne[1])){let ea=xo((Ar=Q.cloneDeep(xe))==null?void 0:Ar.optionUrl,n);Br=(xe==null?void 0:xe.value)||ea||""}}))}))}),lr=Br,Xe=((Dr=Xe==null?void 0:Xe.split("["))==null?void 0:Dr[0])+Br}(Xe==null?void 0:Xe[(Xe==null?void 0:Xe.length)-1])==="/"&&(Xe=Xe.slice(0,(Xe==null?void 0:Xe.length)-1));let oe=[];s!=null&&s.every(Ne=>Array.isArray(Ne))&&(s==null?void 0:s.length)>0&&(oe=s==null?void 0:s[0]);let Ir=await la.getInsofDataApi({key:{pageKey:Xe,systemKey:sessionStorage.getItem("systemKey"),type:"structure"}});((xr=(Rr=Ir==null?void 0:Ir.data)==null?void 0:Rr.result)==null?void 0:xr.length)===0&&(Xe=(da=(Er=Xe==null?void 0:Xe.split("/"))==null?void 0:Er.filter((Ne,Br)=>{var na;return Br!==((na=Xe==null?void 0:Xe.split("/"))==null?void 0:na.length)-1}))==null?void 0:da.join("/"),Ir=await la.getInsofDataApi({key:{pageKey:Xe,systemKey:sessionStorage.getItem("systemKey"),type:"structure"}}));let Re=(ia=(Vr=(He=(ta=Ha==null?void 0:Ha.split("{"))==null?void 0:ta[0])==null?void 0:He.replace("[",br))==null?void 0:Vr.split(br))==null?void 0:ia[0];const Na=await la.getInsofDataApi({key:{pageKey:t??us.value,systemKey:sessionStorage.getItem("systemKey"),tableId:parseInt(a),type:"data"}}),Qa=[];if((xa=(Sa=Na==null?void 0:Na.data)==null?void 0:Sa.result)==null||xa.forEach(Ne=>{var Br;Qa.push({id:Ne==null?void 0:Ne.id,value:Ne.value.tableData,parentId:(Br=Ne==null?void 0:Ne.key)==null?void 0:Br.parentId})}),(Qa==null?void 0:Qa.length)===0){const Ne=await la.getInsofDataApi({key:{pageKey:Xe,systemKey:sessionStorage.getItem("systemKey"),tableId:parseInt(a),type:"data"}});(Sr=(cr=Ne==null?void 0:Ne.data)==null?void 0:cr.result)==null||Sr.forEach(Br=>{var na;Qa.push({id:Br==null?void 0:Br.id,value:Br.value.tableData,parentId:(na=Br==null?void 0:Br.key)==null?void 0:na.parentId})})}if(Array.isArray((Ra=Ir==null?void 0:Ir.data)==null?void 0:Ra.result)&&((Wa=(Ua=Ir==null?void 0:Ir.data)==null?void 0:Ua.result)==null?void 0:Wa.length)>0){let Ne;if((Re==null?void 0:Re[(Re==null?void 0:Re.length)-1])===":"&&(Re=Re==null?void 0:Re.slice(1,(Re==null?void 0:Re.length)-1)),Re=(Rt=(Ot=Re==null?void 0:Re.split(":"))==null?void 0:Ot[((ft=Re==null?void 0:Re.split(":"))==null?void 0:ft.length)-1])==null?void 0:Rt.replaceAll("'",""),((Nt=(yt=Ir==null?void 0:Ir.data)==null?void 0:yt.result)==null?void 0:Nt.find(te=>{var H;return gn((H=te==null?void 0:te.value)==null?void 0:H.pageData,Re)}))??((Mt=(Pt=Ir==null?void 0:Ir.data)==null?void 0:Pt.result)==null?void 0:Mt.find(te=>{var H;return gn((H=te==null?void 0:te.value)==null?void 0:H.pageData,jr)}))){let te=(N=(k=Ir==null?void 0:Ir.data)==null?void 0:k.result)==null?void 0:N.sort((H,q)=>H.id-q.id);Ne=await(te==null?void 0:te.map(async H=>{var pe,xe,Ar,ea,sa,vr,ma,Fr,Or,Wr,Yr,gr,Xr,dr,Jr,St,ln,on,un,hn,xn,dn,pn,Ge,Yn,Jn,qn,Zn,or,ur,$e,ca,Un,fi,ci,li,oi,ui,hi,xi,di,pi,mi,gi,vi,_i,yi,ki,Ei,ga,Ke,Ie,Je,va,ve,ct,_r,fr,et;let q;if(gn((pe=H==null?void 0:H.value)==null?void 0:pe.pageData,Re)||gn((xe=H==null?void 0:H.value)==null?void 0:xe.pageData,jr)&&((ea=(Ar=H==null?void 0:H.value)==null?void 0:Ar.pageData)==null?void 0:ea.name)===jr){q=Q.cloneDeep((vr=(sa=H==null?void 0:H.value)==null?void 0:sa.pageData)==null?void 0:vr.compData);let Va;gn((ma=H==null?void 0:H.value)==null?void 0:ma.pageData,Re)&&Re===jr?(Or=(Fr=H==null?void 0:H.value)==null?void 0:Fr.pageData)!=null&&Or.name1?Va={name:(Yr=(Wr=H==null?void 0:H.value)==null?void 0:Wr.pageData)==null?void 0:Yr.name,name0:(Xr=(gr=H==null?void 0:H.value)==null?void 0:gr.pageData)==null?void 0:Xr.name0,name1:(Jr=(dr=H==null?void 0:H.value)==null?void 0:dr.pageData)==null?void 0:Jr.name1}:Va={name:(ln=(St=H==null?void 0:H.value)==null?void 0:St.pageData)==null?void 0:ln.name,name0:(un=(on=H==null?void 0:H.value)==null?void 0:on.pageData)==null?void 0:un.name0}:Va={name:((xn=(hn=H==null?void 0:H.value)==null?void 0:hn.pageData)==null?void 0:xn.name0)||((pn=(dn=H==null?void 0:H.value)==null?void 0:dn.pageData)==null?void 0:pn.name)},q.push({key:"name",contents:Va});const zt=await la.getInsofDataApi({key:{pageKey:Xe,systemKey:sessionStorage.getItem("systemKey"),tableId:H==null?void 0:H.id,type:"data"}});let Sn;if(((Yn=(Ge=zt==null?void 0:zt.data)==null?void 0:Ge.result)==null?void 0:Yn.length)>0&&((qn=(Jn=q==null?void 0:q.find(De=>(De==null?void 0:De.key)==="header"))==null?void 0:Jn.contents)!=null&&qn.every(De=>!(De!=null&&De.columnPath))))if(Sn=(or=(Zn=zt==null?void 0:zt.data)==null?void 0:Zn.result)==null?void 0:or.map(De=>{var Oe;let We=[];return We.push({id:De==null?void 0:De.id}),We.push((Oe=De==null?void 0:De.value)==null?void 0:Oe.tableData),We}),q.push({key:"tableContents",contents:Oi(Sn,(Un=(ca=($e=(ur=H==null?void 0:H.value)==null?void 0:ur.pageData)==null?void 0:$e.compData)==null?void 0:ca.find(De=>(De==null?void 0:De.key)==="header"))==null?void 0:Un.contents)}),q.push({key:"contentTableId",contents:H==null?void 0:H.id}),q.push({key:"ownerId",contents:H==null?void 0:H.id}),pa!==""&&(q!=null&&q.find(De=>(De==null?void 0:De.key)==="pageColumn")&&(q=q==null?void 0:q.filter(De=>(De==null?void 0:De.key)!=="pageColumn")),q.push({key:"pageColumn",contents:Bn}),q!=null&&q.find(De=>(De==null?void 0:De.key)==="columnPath")&&(q=q==null?void 0:q.filter(De=>(De==null?void 0:De.key)!=="columnPath")),q.push({key:"columnPath",contents:pa}),q!=null&&q.find(De=>(De==null?void 0:De.key)==="columnUsingPath")&&(q=q==null?void 0:q.filter(De=>(De==null?void 0:De.key)!=="columnUsingPath")),q.push({key:"columnUsingPath",contents:lr}),q!=null&&q.find(De=>(De==null?void 0:De.key)==="pageGroup")&&(q=q==null?void 0:q.filter(De=>(De==null?void 0:De.key)!=="pageGroup")),q.push({key:"pageGroup",contents:jr})),(oe==null?void 0:oe.length)===0)oe.push(q);else{let De;Array.isArray((ci=(fi=q==null?void 0:q.find(We=>(We==null?void 0:We.key)==="header"))==null?void 0:fi.contents)==null?void 0:ci[0])?De=(ui=_n((oi=(li=q==null?void 0:q.find(We=>(We==null?void 0:We.key)==="header"))==null?void 0:li.contents)==null?void 0:oi[0]))==null?void 0:ui.map(We=>We==null?void 0:We.prop):De=(xi=(hi=q==null?void 0:q.find(We=>(We==null?void 0:We.key)==="header"))==null?void 0:hi.contents)==null?void 0:xi.map(We=>We==null?void 0:We.prop),q==null||q.forEach(We=>{var Oe,Vt;if(((We==null?void 0:We.key)==="contentTableId"||(We==null?void 0:We.key)==="ownerId")&&(oe==null||oe.push(We)),(We==null?void 0:We.key)==="header"&&(oe=oe==null?void 0:oe.map(yr=>{var ze,rt,at,At,Ft,Dt;return(yr==null?void 0:yr.key)==="header"&&(Array.isArray((ze=We==null?void 0:We.contents)==null?void 0:ze[0])&&(We.contents=(rt=We==null?void 0:We.contents)==null?void 0:rt[0]),Array.isArray((at=yr==null?void 0:yr.contents)==null?void 0:at[0])?(yr.contents=(At=yr.contents)==null?void 0:At[0],yr.contents=[...yr==null?void 0:yr.contents,...We==null?void 0:We.contents],yr.contents=[(Ft=yr.contents)==null?void 0:Ft.filter(Ga=>(Ga==null?void 0:Ga.prop)!=="")]):(yr.contents=[...yr==null?void 0:yr.contents,...We==null?void 0:We.contents],yr.contents=(Dt=yr.contents)==null?void 0:Dt.filter(Ga=>(Ga==null?void 0:Ga.prop)!==""))),yr})),(We==null?void 0:We.key)==="tableContents"){let yr=(Vt=(Oe=We==null?void 0:We.contents)==null?void 0:Oe.map(ze=>m0(ze,De)))==null?void 0:Vt.filter(ze=>{var rt,at;return!(((rt=Object.keys(ze))==null?void 0:rt.length)===1&&((at=Object.keys(ze))==null?void 0:at[0])==="id")});oe=oe==null?void 0:oe.map(ze=>{var rt,at,At,Ft,Dt,Ga,ja,ar,Qe;if((ze==null?void 0:ze.key)==="tableContents"){let Bt=[];if((yr==null?void 0:yr.length)===0)Bt=ze==null?void 0:ze.contents;else{let fa=(At=(at=(rt=de==null?void 0:de.columnPath)==null?void 0:rt.replace("(",br))==null?void 0:at.split(br))==null?void 0:At[1],_a=(Ft=p0(fa,","))==null?void 0:Ft.map(Nr=>((Nr==null?void 0:Nr[(Nr==null?void 0:Nr.length)-1])===","&&(Nr=Nr==null?void 0:Nr.slice(0,(Nr==null?void 0:Nr.length)-1)),Nr));_a=(Ga=(Dt=_a==null?void 0:_a.find(Nr=>Nr==null?void 0:Nr.includes("@Filter")))==null?void 0:Dt.split("@Filter"))==null?void 0:Ga[1],_a=(ja=_a==null?void 0:_a.slice(1,(_a==null?void 0:_a.length)-1))==null?void 0:ja.replaceAll("'","");let Xa="";if(_a!=null&&_a.includes("[")){Xa=(ar=_a==null?void 0:_a.split("="))==null?void 0:ar[0];let Nr=(Qe=ze==null?void 0:ze.contents)==null?void 0:Qe.map(Ut=>Ut==null?void 0:Ut[Xa]);yr=yr==null?void 0:yr.filter(Ut=>Nr==null?void 0:Nr.find(x0=>(Ut==null?void 0:Ut[Xa])===x0))}yr==null||yr.forEach(Nr=>{var Ut,x0,d0;if(!(!(ze!=null&&ze.contents)||((Ut=ze==null?void 0:ze.contents)==null?void 0:Ut.length)===0))if(Xa==="")(x0=ze==null?void 0:ze.contents)==null||x0.forEach(Ve=>{let qe=Object.assign({},Nr,Ve);Bt.push(qe)});else{let Ve=(d0=ze==null?void 0:ze.contents)==null?void 0:d0.find(U0=>(U0==null?void 0:U0[Xa])===(Nr==null?void 0:Nr[Xa])),qe=Object.assign({},Nr,Ve);Bt.push(qe)}})}ze.contents=Bt}return ze})}})}else{let De,We=(ki=(yi=(_i=(vi=(gi=(mi=(pi=(di=H==null?void 0:H.value)==null?void 0:di.pageData)==null?void 0:pi.compData)==null?void 0:mi.find(Oe=>(Oe==null?void 0:Oe.key)==="header"))==null?void 0:gi.contents)==null?void 0:vi.find(Oe=>Oe==null?void 0:Oe.columnPath))==null?void 0:_i.columnPath)==null?void 0:yi.split("["))==null?void 0:ki[0];if(us.value!==Xe&&i!==Xe)De=await wn(Xe,sessionStorage.getItem("systemKey"),"",!1,[],!1,n,Xe);else{let Oe=await la.getInsofDataApi({key:{pageKey:Xe,systemKey:sessionStorage.getItem("systemKey"),type:"structure"}}),Vt=(Ie=(Ke=(ga=(Ei=Oe==null?void 0:Oe.data)==null?void 0:Ei.result)==null?void 0:ga.find(ze=>{var rt,at,At,Ft,Dt,Ga;return gn((rt=ze==null?void 0:ze.value)==null?void 0:rt.pageData,jr)&&((At=(at=H==null?void 0:H.value)==null?void 0:at.pageData)==null?void 0:At.name)===((Dt=(Ft=ze==null?void 0:ze.value)==null?void 0:Ft.pageData)==null?void 0:Dt.name)||gn((Ga=ze==null?void 0:ze.value)==null?void 0:Ga.pageData,Re)&&Re!==jr}))==null?void 0:Ke.value)==null?void 0:Ie.pageData;L0=(et=(fr=(_r=(ct=(ve=(va=(Je=Vt==null?void 0:Vt.compData)==null?void 0:Je.find(ze=>(ze==null?void 0:ze.key)==="header"))==null?void 0:va.contents)==null?void 0:ve.find(ze=>ze==null?void 0:ze.columnPath))==null?void 0:ct.columnPath)==null?void 0:_r.replace("(",br))==null?void 0:fr.split(br))==null?void 0:et[1],De=await wn(We,sessionStorage.getItem("systemKey"),""),(De==null?void 0:De.length)>0&&(De[0].name=Re)}De==null||De.forEach(Oe=>{var Vt,yr,ze,rt,at,At,Ft,Dt,Ga,ja,ar,Qe,Bt,fa,_a,Xa,Nr,Ut,x0;if(gn(Oe,jr)&&((yr=(Vt=H==null?void 0:H.value)==null?void 0:Vt.pageData)==null?void 0:yr.name)===(Oe==null?void 0:Oe.name)||gn(Oe,Re)&&Re!==jr){q=((ze=Oe==null?void 0:Oe.compData)==null?void 0:ze.filter(Ve=>(Ve==null?void 0:Ve.key)!=="tableContents"))||[],De=(at=(rt=Oe==null?void 0:Oe.compData)==null?void 0:rt.find(Ve=>(Ve==null?void 0:Ve.key)==="tableContents"))==null?void 0:at.contents,Sn=De;let d0;if((gn(Oe,jr)&&Re===jr||gn(Oe,Re)&&Re!==jr)&&((Ft=(At=e==null?void 0:e.find(Ve=>(Ve==null?void 0:Ve.key)==="header"))==null?void 0:At.contents)==null?void 0:Ft.length)===2?(Ga=(Dt=H==null?void 0:H.value)==null?void 0:Dt.pageData)!=null&&Ga.name1?d0={name:Oe==null?void 0:Oe.name,name0:Oe==null?void 0:Oe.name0,name1:Oe==null?void 0:Oe.name1}:d0={name:Oe==null?void 0:Oe.name,name0:Oe==null?void 0:Oe.name0}:d0={name:(Oe==null?void 0:Oe.name0)||(Oe==null?void 0:Oe.name)},q.push({key:"name",contents:d0}),q.push({key:"tableContents",contents:Oi(Sn,(ar=(ja=Oe==null?void 0:Oe.compData)==null?void 0:ja.find(Ve=>(Ve==null?void 0:Ve.key)==="header"))==null?void 0:ar.contents)}),q.push({key:"contentTableId",contents:(De==null?void 0:De.length)!==0?((Qe=Oe==null?void 0:Oe.compData)==null?void 0:Qe.id)??(Oe==null?void 0:Oe.id):H==null?void 0:H.id}),q.push({key:"ownerId",contents:Oe==null?void 0:Oe.id}),pa!==""&&(q!=null&&q.find(Ve=>(Ve==null?void 0:Ve.key)==="pageColumn")&&(q=q==null?void 0:q.filter(Ve=>(Ve==null?void 0:Ve.key)!=="pageColumn")),q.push({key:"pageColumn",contents:Bn}),q!=null&&q.find(Ve=>(Ve==null?void 0:Ve.key)==="columnPath")&&(q=q==null?void 0:q.filter(Ve=>(Ve==null?void 0:Ve.key)!=="columnPath")),q.push({key:"columnPath",contents:pa}),q!=null&&q.find(Ve=>(Ve==null?void 0:Ve.key)==="columnUsingPath")&&(q=q==null?void 0:q.filter(Ve=>(Ve==null?void 0:Ve.key)!=="columnUsingPath")),q.push({key:"columnUsingPath",contents:lr}),q!=null&&q.find(Ve=>(Ve==null?void 0:Ve.key)==="pageGroup")&&(q=q==null?void 0:q.filter(Ve=>(Ve==null?void 0:Ve.key)!=="pageGroup")),q.push({key:"pageGroup",contents:jr})),(oe==null?void 0:oe.length)===0)oe.push(q);else{let Ve;Array.isArray((fa=(Bt=q==null?void 0:q.find(qe=>(qe==null?void 0:qe.key)==="header"))==null?void 0:Bt.contents)==null?void 0:fa[0])?Ve=(Nr=_n((Xa=(_a=q==null?void 0:q.find(qe=>(qe==null?void 0:qe.key)==="header"))==null?void 0:_a.contents)==null?void 0:Xa[0]))==null?void 0:Nr.map(qe=>qe==null?void 0:qe.prop):Ve=(x0=(Ut=q==null?void 0:q.find(qe=>(qe==null?void 0:qe.key)==="header"))==null?void 0:Ut.contents)==null?void 0:x0.map(qe=>qe==null?void 0:qe.prop),q==null||q.forEach(qe=>{var U0,wc;if(((qe==null?void 0:qe.key)==="contentTableId"||(qe==null?void 0:qe.key)==="ownerId")&&(oe==null||oe.push(qe)),(qe==null?void 0:qe.key)==="header"&&(oe=oe==null?void 0:oe.map(Hr=>{var $r,Qn,e0,Ti,wi,Si;return(Hr==null?void 0:Hr.key)==="header"&&(Array.isArray(($r=qe==null?void 0:qe.contents)==null?void 0:$r[0])&&(qe.contents=(Qn=qe==null?void 0:qe.contents)==null?void 0:Qn[0]),Array.isArray((e0=Hr==null?void 0:Hr.contents)==null?void 0:e0[0])?(Hr.contents=(Ti=Hr.contents)==null?void 0:Ti[0],Hr.contents=[...Hr==null?void 0:Hr.contents,...qe==null?void 0:qe.contents],Hr.contents=[(wi=Hr.contents)==null?void 0:wi.filter(An=>(An==null?void 0:An.prop)!=="")]):(Hr.contents=[...Hr==null?void 0:Hr.contents,...qe==null?void 0:qe.contents],Hr.contents=(Si=Hr.contents)==null?void 0:Si.filter(An=>(An==null?void 0:An.prop)!==""))),Hr})),(qe==null?void 0:qe.key)==="tableContents"){let Hr=(wc=(U0=qe==null?void 0:qe.contents)==null?void 0:U0.map($r=>m0($r,Ve)))==null?void 0:wc.filter($r=>{var Qn,e0;return!(((Qn=Object.keys($r))==null?void 0:Qn.length)===1&&((e0=Object.keys($r))==null?void 0:e0[0])==="id")});oe=oe==null?void 0:oe.map($r=>{var Qn,e0,Ti,wi,Si,An,Sc,Ac,Fc;if(($r==null?void 0:$r.key)==="tableContents"){let cs=[];if((Hr==null?void 0:Hr.length)===0)cs=$r==null?void 0:$r.contents;else{let Sh=(Ti=(e0=(Qn=de==null?void 0:de.columnPath)==null?void 0:Qn.replace("(",br))==null?void 0:e0.split(br))==null?void 0:Ti[1],tt=(wi=p0(Sh,","))==null?void 0:wi.map(ra=>((ra==null?void 0:ra[(ra==null?void 0:ra.length)-1])===","&&(ra=ra==null?void 0:ra.slice(0,(ra==null?void 0:ra.length)-1)),ra));tt=(An=(Si=tt==null?void 0:tt.find(ra=>ra==null?void 0:ra.includes("@Filter")))==null?void 0:Si.split("@Filter"))==null?void 0:An[1],tt=(Sc=tt==null?void 0:tt.slice(1,(tt==null?void 0:tt.length)-1))==null?void 0:Sc.replaceAll("'","");let W0="";if(tt!=null&&tt.includes("[")){W0=(Ac=tt==null?void 0:tt.split("="))==null?void 0:Ac[0];let ra=(Fc=$r==null?void 0:$r.contents)==null?void 0:Fc.map(Fn=>Fn==null?void 0:Fn[W0]);Hr=Hr==null?void 0:Hr.filter(Fn=>ra==null?void 0:ra.find(ls=>(Fn==null?void 0:Fn[W0])===ls))}Hr==null||Hr.forEach(ra=>{var Fn,ls,Dc;if(!(!($r!=null&&$r.contents)||((Fn=$r==null?void 0:$r.contents)==null?void 0:Fn.length)===0))if(W0==="")(ls=$r==null?void 0:$r.contents)==null||ls.forEach(Js=>{let qs=Object.assign({},ra,Js);cs.push(qs)});else{let Js=(Dc=$r==null?void 0:$r.contents)==null?void 0:Dc.find(Zs=>(Zs==null?void 0:Zs[W0])===(ra==null?void 0:ra[W0])),qs=Object.assign({},ra,Js);cs.push(qs)}})}$r.contents=cs}return $r})}})}}})}}})),await Promise.all(Ne)}let Br=[];oe!=null&&oe.every(te=>Array.isArray(te))||(oe=[oe]),oe==null||oe.forEach(te=>{Br!=null&&Br.find(H=>{var q,pe,xe,Ar,ea,sa,vr,ma,Fr,Or,Wr,Yr,gr,Xr,dr,Jr,St,ln,on,un,hn,xn,dn,pn;return((Ar=(xe=(pe=H==null?void 0:H.filter(Ge=>(Ge==null?void 0:Ge.key)==="name"))==null?void 0:pe[((q=H==null?void 0:H.filter(Ge=>(Ge==null?void 0:Ge.key)==="name"))==null?void 0:q.length)-1])==null?void 0:xe.contents)==null?void 0:Ar.name)===((ma=(vr=(sa=te==null?void 0:te.filter(Ge=>(Ge==null?void 0:Ge.key)==="name"))==null?void 0:sa[((ea=te==null?void 0:te.filter(Ge=>(Ge==null?void 0:Ge.key)==="name"))==null?void 0:ea.length)-1])==null?void 0:vr.contents)==null?void 0:ma.name)&&((Yr=(Wr=(Or=H==null?void 0:H.filter(Ge=>(Ge==null?void 0:Ge.key)==="name"))==null?void 0:Or[((Fr=H==null?void 0:H.filter(Ge=>(Ge==null?void 0:Ge.key)==="name"))==null?void 0:Fr.length)-1])==null?void 0:Wr.contents)==null?void 0:Yr.name0)===((Jr=(dr=(Xr=te==null?void 0:te.filter(Ge=>(Ge==null?void 0:Ge.key)==="name"))==null?void 0:Xr[((gr=te==null?void 0:te.filter(Ge=>(Ge==null?void 0:Ge.key)==="name"))==null?void 0:gr.length)-1])==null?void 0:dr.contents)==null?void 0:Jr.name0)&&((un=(on=(ln=H==null?void 0:H.filter(Ge=>(Ge==null?void 0:Ge.key)==="name"))==null?void 0:ln[((St=H==null?void 0:H.filter(Ge=>(Ge==null?void 0:Ge.key)==="name"))==null?void 0:St.length)-1])==null?void 0:on.contents)==null?void 0:un.name1)===((pn=(dn=(xn=te==null?void 0:te.filter(Ge=>(Ge==null?void 0:Ge.key)==="name"))==null?void 0:xn[((hn=te==null?void 0:te.filter(Ge=>(Ge==null?void 0:Ge.key)==="name"))==null?void 0:hn.length)-1])==null?void 0:dn.contents)==null?void 0:pn.name1)})||Br.push(te)}),Br=Br==null?void 0:Br.map(te=>{var q,pe;let H=[];return te==null||te.forEach(xe=>{(xe==null?void 0:xe.key)!=="name"&&H.push(xe)}),H.push((pe=te==null?void 0:te.filter(xe=>(xe==null?void 0:xe.key)==="name"))==null?void 0:pe[((q=te==null?void 0:te.filter(xe=>(xe==null?void 0:xe.key)==="name"))==null?void 0:q.length)-1]),H}),oe=Br==null?void 0:Br.sort((te,H)=>{var q,pe,xe,Ar,ea,sa;return((xe=(pe=te==null?void 0:te.filter(vr=>(vr==null?void 0:vr.key)==="ownerId"))==null?void 0:pe[((q=te==null?void 0:te.filter(vr=>(vr==null?void 0:vr.key)==="ownerId"))==null?void 0:q.length)-1])==null?void 0:xe.contents)-((sa=(ea=H==null?void 0:H.filter(vr=>(vr==null?void 0:vr.key)==="ownerId"))==null?void 0:ea[((Ar=H==null?void 0:H.filter(vr=>(vr==null?void 0:vr.key)==="ownerId"))==null?void 0:Ar.length)-1])==null?void 0:sa.contents)}),oe=oe==null?void 0:oe.filter(te=>te!==void 0),oe=oe==null?void 0:oe.map(te=>{var q,pe;let H=(pe=ws((q=te==null?void 0:te.find(xe=>(xe==null?void 0:xe.key)==="header"))==null?void 0:q.contents))==null?void 0:pe.filter(xe=>xe!=="操作"&&xe);return te=te==null?void 0:te.map(xe=>{var Ar,ea,sa,vr,ma,Fr,Or,Wr,Yr,gr,Xr,dr,Jr,St,ln,on,un,hn,xn,dn,pn,Ge,Yn,Jn,qn,Zn,or,ur,$e,ca,Un,fi,ci,li,oi,ui,hi,xi,di,pi,mi,gi,vi,_i,yi,ki,Ei;if((xe==null?void 0:xe.key)==="tableContents"){let ga=[];if((vr=(sa=(ea=(Ar=de==null?void 0:de.columnPath)==null?void 0:Ar.split("@Type"))==null?void 0:ea[1])==null?void 0:sa.toUpperCase())!=null&&vr.includes("MANUAL")){Qa==null||Qa.forEach(Je=>{Je.value.id=Je==null?void 0:Je.id,ga.push(Je==null?void 0:Je.value)});let Ke=[];((Fr=(ma=te==null?void 0:te.find(Je=>(Je==null?void 0:Je.key)==="header"))==null?void 0:ma.contents)==null?void 0:Fr.length)<=2&&!Array.isArray((Wr=(Or=te==null?void 0:te.find(Je=>(Je==null?void 0:Je.key)==="header"))==null?void 0:Or.contents)==null?void 0:Wr[0])&&((Yr=xe.contents)==null||Yr.forEach(Je=>{let va=(Je==null?void 0:Je.length)!==1?m0(Je,H):Je==null?void 0:Je[0];Ke.push(va)}));let Ie=H==null?void 0:H[0];Ke==null||Ke.forEach(Je=>{ga!=null&&ga.find(va=>(va==null?void 0:va[Ie])===(Je==null?void 0:Je[Ie]))||ga.push(Je)})}else(ln=(St=(Jr=p0((dr=(Xr=(gr=de==null?void 0:de.columnPath)==null?void 0:gr.replace("(",br))==null?void 0:Xr.split(br))==null?void 0:dr[1],","))==null?void 0:Jr.find(Ke=>Ke==null?void 0:Ke.includes("@FatherSync")))==null?void 0:St.toUpperCase())!=null&&ln.includes("YES")?(on=xe.contents)==null||on.forEach(Ke=>{var va,ve,ct;let Ie=(Ke==null?void 0:Ke.length)!==1?m0(Ke,H):Ke==null?void 0:Ke[0],Je=Qa==null?void 0:Qa.filter(_r=>(_r==null?void 0:_r.parentId)===(Ie==null?void 0:Ie.id));if((Je==null?void 0:Je.length)>0)Je==null||Je.forEach(_r=>{let fr=Object.assign({},Ie,_r==null?void 0:_r.value),et={};for(let Va in fr)(fr==null?void 0:fr[Va])!==void 0&&(et[Va]=fr==null?void 0:fr[Va]);Je=et,fr.id=_r==null?void 0:_r.id,ga.push(fr)});else{Ie.id=((ve=(va=e==null?void 0:e.find(fr=>(fr==null?void 0:fr.key)==="header"))==null?void 0:va.contents)==null?void 0:ve.length)===2?parseInt(Ie==null?void 0:Ie.id):((ct=Ie==null?void 0:Ie.id)==null?void 0:ct.toString())??"undefined";let _r={};for(let fr in Ie)(Ie==null?void 0:Ie[fr])!==void 0&&(_r[fr]=Ie==null?void 0:Ie[fr]);Ie=_r,ga.push(Ie)}}):(un=xe.contents)==null||un.forEach(Ke=>{var va,ve,ct;let Ie=(Ke==null?void 0:Ke.length)!==1?m0(Ke,H):Ke==null?void 0:Ke[0],Je=Qa==null?void 0:Qa.filter(_r=>{var fr,et;return(_r==null?void 0:_r.parentId)===(Ie==null?void 0:Ie.id)||((fr=_r==null?void 0:_r.id)==null?void 0:fr.toString())===((et=Ie==null?void 0:Ie.id)==null?void 0:et.toString())});if((Je==null?void 0:Je.length)>0)Je==null||Je.forEach(_r=>{let fr=Object.assign({},Ie,_r==null?void 0:_r.value),et={};for(let Va in fr)(fr==null?void 0:fr[Va])!==void 0&&(et[Va]=fr==null?void 0:fr[Va]);Je=et,fr.id=_r==null?void 0:_r.id,ga.push(fr)});else{Ie.id=((ve=(va=e==null?void 0:e.find(fr=>(fr==null?void 0:fr.key)==="header"))==null?void 0:va.contents)==null?void 0:ve.length)===2?parseInt(Ie==null?void 0:Ie.id):((ct=Ie==null?void 0:Ie.id)==null?void 0:ct.toString())??"undefined";let _r={};for(let fr in Ie)(Ie==null?void 0:Ie[fr])!==void 0&&(_r[fr]=Ie==null?void 0:Ie[fr]);Ie=_r,ga.push(Ie)}});xe.contents=ga}if((xe==null?void 0:xe.key)==="header"){let ga=Mn==null?void 0:Mn.find(ve=>{var ct,_r,fr,et,Va,zt,Sn;return(Sn=de==null?void 0:de.columnPath)==null?void 0:Sn.includes((zt=(_r=(ct=ve==null?void 0:ve.value)==null?void 0:ct.split("%$%"))==null?void 0:_r[0])==null?void 0:zt.slice(0,((Va=(et=(fr=ve==null?void 0:ve.value)==null?void 0:fr.split("%$%"))==null?void 0:et[0])==null?void 0:Va.length)-1))}),Ke=ga==null?void 0:ga.key;if(((hn=Ke==null?void 0:Ke.split("["))==null?void 0:hn.length)>2){let ve=vf(Ke);Ke=Ih((dn=(xn=ve==null?void 0:ve.stringContent)==null?void 0:xn.split(","))==null?void 0:dn.filter(ct=>ct!==""),ve==null?void 0:ve.parentColumns)}else Ke=(Yn=(Ge=(pn=Ke==null?void 0:Ke.replaceAll("'",""))==null?void 0:pn.replaceAll("[",""))==null?void 0:Ge.replaceAll("]",""))==null?void 0:Yn.split(",");let Ie=(ci=(fi=(Un=(Zn=(qn=(Jn=ga==null?void 0:ga.value)==null?void 0:Jn.split("("))==null?void 0:qn[0])==null?void 0:Zn.split("["))==null?void 0:Un[((ca=($e=(ur=(or=ga==null?void 0:ga.value)==null?void 0:or.split("("))==null?void 0:ur[0])==null?void 0:$e.split("["))==null?void 0:ca.length)-1])==null?void 0:fi.split("]"))==null?void 0:ci[0],Je=(ui=(oi=(li=Ie==null?void 0:Ie.replaceAll("'",""))==null?void 0:li.split(","))==null?void 0:oi.filter(ve=>ve==null?void 0:ve.includes('"')))==null?void 0:ui.map(ve=>ve==null?void 0:ve.replaceAll('"',""));Ie=(xi=(hi=Ie==null?void 0:Ie.replaceAll("'",""))==null?void 0:hi.replaceAll('"',""))==null?void 0:xi.split(","),Array.isArray(Ke)||(Ke=(mi=(pi=(di=Ke==null?void 0:Ke.replaceAll("'",""))==null?void 0:di.replaceAll("[",""))==null?void 0:pi.replaceAll("]",""))==null?void 0:mi.split(","));let va=((vi=(gi=xe.contents)==null?void 0:gi.find(ve=>ve==null?void 0:ve.menuId))==null?void 0:vi.menuId)??((ki=(yi=te==null?void 0:te.filter(ve=>(ve==null?void 0:ve.key)==="contentTableId"))==null?void 0:yi[((_i=te==null?void 0:te.filter(ve=>(ve==null?void 0:ve.key)==="contentTableId"))==null?void 0:_i.length)-1])==null?void 0:ki.contents);xe.contents=(Ei=xe.contents)==null?void 0:Ei.map(ve=>{var ct,_r,fr,et,Va,zt,Sn,De,We,Oe,Vt,yr,ze,rt,at,At,Ft,Dt,Ga;if(Array.isArray(ve)){(ct=_n(ve))!=null&&ct.every(Qe=>!(Qe!=null&&Qe.menuId))&&(va=((fr=(_r=_n(ve))==null?void 0:_r.find(Qe=>Qe==null?void 0:Qe.menuId))==null?void 0:fr.menuId)??va,ve=ve==null?void 0:ve.map((Qe,Bt)=>{var fa,_a;return Bt===0?Qe!=null&&Qe.children?Qe.children=(fa=Qe.children)==null?void 0:fa.map((Xa,Nr)=>(Nr===0?(Xa.directiveLabel="#isMain",Xa.menuId=va):(Xa.directiveLabel="",delete Xa.menuId),Xa.relatedValueId=!0,Xa)):(Qe.directiveLabel="#isMain",Qe.menuId=va):(Qe.directiveLabel="",delete Qe.menuId,Qe.children=(_a=Qe.children)==null?void 0:_a.map(Xa=>(Xa.relatedValueId=!0,Xa))),Qe.relatedValueId=!0,Qe}));let ja=(zt=(Va=(et=de==null?void 0:de.columnPath)==null?void 0:et.replace("(",br))==null?void 0:Va.split(br))==null?void 0:zt[1];ja=ja==null?void 0:ja.slice(0,(ja==null?void 0:ja.length)-1);let ar=(Sn=p0(ja,","))==null?void 0:Sn.map(Qe=>((Qe==null?void 0:Qe[(Qe==null?void 0:Qe.length)-1])===","&&(Qe=Qe==null?void 0:Qe.slice(0,(Qe==null?void 0:Qe.length)-1)),Qe));return ve=ql(ve,Ke,Ie,de,va,ar),ve}else if(Ie!=null&&Ie.find(ja=>ja===(ve==null?void 0:ve.prop))){let ja=Ie==null?void 0:Ie.findIndex(ar=>ar===(ve==null?void 0:ve.prop));if(Ke!=null&&Ke.find(ar=>ar==null?void 0:ar.includes('"'))?((De=Ke==null?void 0:Ke[ja])!=null&&De.includes('"')?(ve.directiveLabel="#isMain",ve.menuId=va):(ve.directiveLabel="",delete ve.menuId),ve.relatedValueId=!0):(Je==null?void 0:Je.length)>0&&(Je!=null&&Je.find(ar=>ar===(ve==null?void 0:ve.prop))?(ve.directiveLabel="#isMain",ve.menuId=va):(ve.directiveLabel="",delete ve.menuId),ve.relatedValueId=!0),de!=null&&de.methodContent){let ar=(Oe=(We=de==null?void 0:de.methodContent)==null?void 0:We.replaceAll('"',""))==null?void 0:Oe.replaceAll("'","");ar!=null&&ar.includes("@")?(ar=ar==null?void 0:ar.slice(0,(ar==null?void 0:ar.length)-1),ar!=null&&ar.includes("@Type")||(ar=ar+",@Type=Auto"),ar!=null&&ar.includes("@Button")||(ar=ar+",@Button=Prop"),ar!=null&&ar.includes("@Extent")||(ar=ar+",@Extent=Row"),ar=ar+")"):ar=ar+"(@Type=Auto,@Button=Prop,@Extent=Row)",ve.methodContent=ar,ve.prop=(ve==null?void 0:ve.prop)+(de==null?void 0:de.columnPathIndex);let Qe=(ze=(yr=(Vt=de==null?void 0:de.columnPath)==null?void 0:Vt.replace("(",br))==null?void 0:yr.split(br))==null?void 0:ze[1];Qe=Qe==null?void 0:Qe.slice(0,(Qe==null?void 0:Qe.length)-1);let Bt=(rt=p0(Qe,","))==null?void 0:rt.map(fa=>((fa==null?void 0:fa[(fa==null?void 0:fa.length)-1])===","&&(fa=fa==null?void 0:fa.slice(0,(fa==null?void 0:fa.length)-1)),fa));(at=Bt==null?void 0:Bt.find(fa=>fa==null?void 0:fa.includes("@SonSync")))!=null&&at.includes("Yes")&&(ve.methodId=va)}ve.label=(Ga=(At=Ke==null?void 0:Ke[Ie==null?void 0:Ie.findIndex(ar=>ar===(ve==null?void 0:ve.prop.replace(/\d+$/,"")))])==null?void 0:At.split("."))==null?void 0:Ga[((Dt=(Ft=Ke==null?void 0:Ke[Ie==null?void 0:Ie.findIndex(ar=>ar===(ve==null?void 0:ve.prop.replace(/\d+$/,"")))])==null?void 0:Ft.split("."))==null?void 0:Dt.length)-1]}return ve})}return xe}),te});let na=(O=(C=(F=de==null?void 0:de.columnPath)==null?void 0:F.replace("(",br))==null?void 0:C.split(br))==null?void 0:O[1];if(L0!==""&&(na=(na==null?void 0:na.replaceAll(")",""))+","+L0),na&&(na==null?void 0:na.length)>0){na=(R=na.slice(0,(na==null?void 0:na.length)-1))==null?void 0:R.replaceAll("'","");let te=(X=p0(na,","))==null?void 0:X.map(pe=>((pe==null?void 0:pe[(pe==null?void 0:pe.length)-1])===","&&(pe=pe==null?void 0:pe.slice(0,(pe==null?void 0:pe.length)-1)),pe));te=te==null?void 0:te.map(pe=>{let xe=j0==null?void 0:j0.find(Ar=>pe==null?void 0:pe.includes(Ar==null?void 0:Ar.key));if(xe)return{order:xe==null?void 0:xe.order,value:xe==null?void 0:xe.value,content:pe}}),te=te==null?void 0:te.sort((pe,xe)=>(xe==null?void 0:xe.order)-(pe==null?void 0:pe.order));let H=[];oe=oe==null?void 0:oe.map(pe=>(pe=pe==null?void 0:pe.map((xe,Ar)=>{var ea,sa,vr,ma;return(xe==null?void 0:xe.key)==="header"&&((ea=xe==null?void 0:xe.contents)!=null&&ea.every(Fr=>Array.isArray(Fr))?xe.contents=(sa=xe.contents)==null?void 0:sa.map(Fr=>{var Or;return H.push({index:Ar,content:(Or=Q.cloneDeep(Fr))==null?void 0:Or.filter(Wr=>Wr==null?void 0:Wr.columnPath)}),Fr=Fr==null?void 0:Fr.filter(Wr=>!(Wr!=null&&Wr.columnPath)),Fr}):(H.push({index:Ar,content:(vr=Q.cloneDeep(xe.contents))==null?void 0:vr.filter(Fr=>Fr==null?void 0:Fr.columnPath)}),xe.contents=(ma=xe.contents)==null?void 0:ma.filter(Fr=>!(Fr!=null&&Fr.columnPath)))),xe}),pe)),await(async()=>{var pe,xe,Ar,ea,sa,vr,ma,Fr;for(const Or of te??[])if(Or){const Wr=(pe=Or==null?void 0:Or.content)!=null&&pe.includes("@Filter")?"("+((ea=(Ar=(xe=Or==null?void 0:Or.content)==null?void 0:xe.replace("(",br))==null?void 0:Ar.split(br))==null?void 0:ea[1]):(ma=(vr=(sa=Or==null?void 0:Or.content)==null?void 0:sa.replace(":",br))==null?void 0:vr.split(br))==null?void 0:ma[1];oe=await io((Or==null?void 0:Or.value)+"('"+JSON.stringify(Q.cloneDeep(oe)).replaceAll("'",'"')+"','"+Wr+"','"+((Fr=de==null?void 0:de.columnPath)==null?void 0:Fr.replaceAll("'",""))+"')")??[]}})(),oe=oe==null?void 0:oe.map(pe=>(pe.push({key:"filterAllType",value:te}),pe)),oe=oe==null?void 0:oe.map(pe=>(pe=pe==null?void 0:pe.map((xe,Ar)=>{var ea,sa,vr,ma,Fr,Or;if((xe==null?void 0:xe.key)==="header")if((ea=xe==null?void 0:xe.contents)!=null&&ea.every(Wr=>Array.isArray(Wr)))xe.contents=(sa=xe.contents)==null?void 0:sa.map(Wr=>{var Yr,gr,Xr,dr;return H!=null&&H.find(Jr=>(Jr==null?void 0:Jr.index)===Ar)&&((gr=(Yr=H==null?void 0:H.find(Jr=>(Jr==null?void 0:Jr.index)===Ar))==null?void 0:Yr.content)==null?void 0:gr.length)>0&&Wr.push((dr=(Xr=H==null?void 0:H.find(Jr=>(Jr==null?void 0:Jr.index)===Ar))==null?void 0:Xr.content)==null?void 0:dr[0]),Wr});else{let Wr=xe.contents;H!=null&&H.find(Yr=>(Yr==null?void 0:Yr.index)===Ar)&&((ma=(vr=H==null?void 0:H.find(Yr=>(Yr==null?void 0:Yr.index)===Ar))==null?void 0:vr.content)==null?void 0:ma.length)>0&&Wr.push((Or=(Fr=H==null?void 0:H.find(Yr=>(Yr==null?void 0:Yr.index)===Ar))==null?void 0:Fr.content)==null?void 0:Or[0]),xe.contents=Wr}return xe}),pe))}let Ur=(Y=(V=(z=(j=Ha==null?void 0:Ha.replaceAll("{",""))==null?void 0:j.replaceAll("}",""))==null?void 0:z.replace(":",br))==null?void 0:V.split(br))==null?void 0:Y[1];Ur!=null&&Ur.includes("[")&&(Ur=(le=Ur==null?void 0:Ur.replaceAll("'",'"'))==null?void 0:le.replaceAll(":",","),Ur=(_e=X1(Ur))==null?void 0:_e.join(","),Ur="["+((ge=(ue=(Ee=Ur==null?void 0:Ur.replaceAll('":"',Bc.value))==null?void 0:Ee.replaceAll(":",Bc.value))==null?void 0:ue.replaceAll("[",""))==null?void 0:ge.replaceAll("]",""))+"]",$t(Ur==null?void 0:Ur.replaceAll("'",'"'))&&(Ur=JSON.parse(Ur==null?void 0:Ur.replaceAll("'",'"')),Ur!=null&&Ur.find(te=>te==="操作")||Ur.push("操作")),oe=oe==null?void 0:oe.map(te=>{let H=[],q=[];return te=te==null?void 0:te.map(pe=>{var xe,Ar,ea,sa,vr,ma,Fr,Or,Wr,Yr;if((pe==null?void 0:pe.key)==="header")if((xe=pe.contents)!=null&&xe.every(gr=>Array.isArray(gr)))pe.contents=(ea=(Ar=pe.contents)==null?void 0:Ar.map(gr=>{let Xr=yf(gr,Ur);return gr=Xr==null?void 0:Xr.contents,H=[...new Set(Xr.ids)],q=[...new Set(Xr.props)],gr}))==null?void 0:ea.filter(gr=>!((gr==null?void 0:gr.label)==="操作"&&(gr!=null&&gr.relatedValueId)));else{let gr=(vr=(sa=pe.contents)==null?void 0:sa[0])==null?void 0:vr.menuId,Xr=yf(pe.contents,Ur);H=[...new Set(Xr.ids)],q=[...new Set(Xr.props)],(ma=pe.contents)!=null&&ma.some(dr=>dr==null?void 0:dr.columnPath)||(pe.contents=(Fr=pe.contents)==null?void 0:Fr.filter(dr=>(Ur==null?void 0:Ur.find(Jr=>{var St;return Jr===(((St=dr==null?void 0:dr.prop)==null?void 0:St.replace(/\d+$/,""))||(dr==null?void 0:dr.label))}))&&!((dr==null?void 0:dr.label)==="操作"&&(dr!=null&&dr.relatedValueId))),(Or=pe.contents)!=null&&Or.every(dr=>!(dr!=null&&dr.menuId))&&(pe.contents=(Wr=pe.contents)==null?void 0:Wr.map((dr,Jr)=>(Jr===0&&(dr.menuId=gr),dr))))}return(pe==null?void 0:pe.key)==="tableContents"&&(H==null?void 0:H.length)>0&&(pe.contents=(Yr=pe.contents)==null?void 0:Yr.map(gr=>{if(Array.isArray(gr))gr=gr==null?void 0:gr.filter((Xr,dr)=>(H==null?void 0:H.find(Jr=>Jr===dr))||(Xr==null?void 0:Xr.id));else for(let Xr in gr)(Xr==="id"||q!=null&&q.find(dr=>dr===Xr))&&(gr==null||gr[Xr]);return gr})),pe}),te}));let Le=[];(Tr=(Ze=e==null?void 0:e.find(te=>(te==null?void 0:te.key)==="header"))==null?void 0:Ze.contents)!=null&&Tr.every(te=>Array.isArray(te))?Le=(sn=(Kr=(Lr=e==null?void 0:e.find(te=>(te==null?void 0:te.key)==="header"))==null?void 0:Lr.contents)==null?void 0:Kr[0])==null?void 0:sn.filter(te=>!(te!=null&&te.columnPath)&&(te==null?void 0:te.label)!=="操作"):Le=f;let B0=Mn==null?void 0:Mn.find(te=>{var H,q,pe;return(pe=de==null?void 0:de.columnPath)==null?void 0:pe.includes((q=(H=te==null?void 0:te.value)==null?void 0:H.split("%$%"))==null?void 0:q[0])});Le&&(Le==null?void 0:Le.length)>0&&(oe=oe==null?void 0:oe.map(te=>(te=te==null?void 0:te.map(H=>{var xe,Ar,ea,sa,vr,ma,Fr,Or,Wr,Yr,gr,Xr,dr,Jr,St,ln,on,un,hn,xn,dn,pn,Ge,Yn,Jn,qn,Zn;let q=(Ar=(xe=e==null?void 0:e.find(or=>(or==null?void 0:or.key)==="header"))==null?void 0:xe.contents)==null?void 0:Ar.filter(or=>or==null?void 0:or.columnPath),pe=(ea=q==null?void 0:q[rr])!=null&&ea.columnPathIndex&&((sa=q==null?void 0:q[rr])==null?void 0:sa.columnPathIndex)!==""?parseInt((vr=q==null?void 0:q[rr])==null?void 0:vr.columnPathIndex):0;if((H==null?void 0:H.key)==="header"){if(((ma=H==null?void 0:H.contents)==null?void 0:ma.length)===0)return H==null?void 0:H.contents;if((((Or=(Fr=B0==null?void 0:B0.key)==null?void 0:Fr.split("["))==null?void 0:Or.length)??0)<=2){if((Wr=H==null?void 0:H.contents)!=null&&Wr.every(or=>Array.isArray(or))){if(pe===0)Array.isArray(Le==null?void 0:Le[0])?H.contents=[...(Yr=H.contents)==null?void 0:Yr[0],...Le==null?void 0:Le[0]]:H.contents=[...(gr=H.contents)==null?void 0:gr[0],...Le];else if(Array.isArray(Le==null?void 0:Le[0])){let or=((St=(Xr=Le==null?void 0:Le[0])==null?void 0:Xr.filter($e=>($e==null?void 0:$e.label)!=="操作"))==null?void 0:St.slice(pe,(Jr=(dr=Le==null?void 0:Le[0])==null?void 0:dr.filter($e=>($e==null?void 0:$e.label)!=="操作"))==null?void 0:Jr.length))??[],ur=[...(ln=Le==null?void 0:Le[0])==null?void 0:ln.filter($e=>($e==null?void 0:$e.label)!=="操作").slice(0,pe),...(on=H.contents)==null?void 0:on[0]];ur=[...ur,...or],Array.isArray((un=ur==null?void 0:ur.filter($e=>($e==null?void 0:$e.prop)!==""))==null?void 0:un[0])?H.contents=ur==null?void 0:ur.filter($e=>($e==null?void 0:$e.prop)!==""):H.contents=[ur==null?void 0:ur.filter($e=>($e==null?void 0:$e.prop)!=="")]}else{let or=(Le==null?void 0:Le.slice(pe,Le==null?void 0:Le.length))??[],ur=[...Le.slice(0,pe),...H.contents];ur=[...ur,...or],H.contents=ur==null?void 0:ur.filter($e=>($e==null?void 0:$e.prop)!=="")}H.contents=(hn=H.contents)==null?void 0:hn.filter(or=>(or==null?void 0:or.prop)!==""),Array.isArray((xn=H.contents)==null?void 0:xn[0])||(H.contents=[H.contents])}else if(H.contents=(dn=H.contents)==null?void 0:dn.map((or,ur)=>or),(q==null?void 0:q[rr])===0)Array.isArray(Le==null?void 0:Le[0])?H.contents=[...H.contents,...Le==null?void 0:Le[0]]:H.contents=[...H.contents,...Le];else{let or=pe;if(Array.isArray(Le==null?void 0:Le[0])){let ur=((Ge=Le==null?void 0:Le[0])==null?void 0:Ge.slice(or,(pn=Le==null?void 0:Le[0])==null?void 0:pn.length))??[],$e=[...Le==null?void 0:Le[0].slice(0,or),...H.contents];$e=[...$e,...ur],Array.isArray((Yn=$e==null?void 0:$e.filter(ca=>(ca==null?void 0:ca.prop)!==""))==null?void 0:Yn[0])?H.contents=$e==null?void 0:$e.filter(ca=>(ca==null?void 0:ca.prop)!==""):H.contents=[$e==null?void 0:$e.filter(ca=>(ca==null?void 0:ca.prop)!=="")]}else{let ur=(Le==null?void 0:Le.slice(or,Le==null?void 0:Le.length))??[],$e=[...Le.slice(0,or),...H.contents];$e=[...$e,...ur],H.contents=$e==null?void 0:$e.filter(ca=>(ca==null?void 0:ca.prop)!=="")}}if(Array.isArray((Jn=H.contents)==null?void 0:Jn[0])){const or=new Map;(qn=H.contents)==null||qn[0].forEach(ur=>{or.has(ur.label)||or.set(ur.label,ur)}),H.contents=[...or.values()],H.contents=[H.contents],H.contents=[(Zn=H.contents)==null?void 0:Zn[0].filter((ur,$e,ca)=>ur.label!=="操作"||ca.findIndex(Un=>Un.label==="操作")===$e)]}else{const or=new Map;H.contents.forEach(ur=>{or.has(ur.label)||or.set(ur.label,ur)}),H.contents=[...or.values()],H.contents=H.contents.filter((ur,$e,ca)=>ur.label!=="操作"||ca.findIndex(Un=>Un.label==="操作")===$e)}}else{let or=bh(H.contents,Le);or!=null&&or.find(ur=>(ur==null?void 0:ur.label)==="操作")||or.push({label:"操作"}),H.contents=[or]}}return(H==null?void 0:H.key)==="relatedFilter"&&(H.index=pe),H}),te)))}f=(Pn=(Lt=(cn=(fn=Q.cloneDeep(oe))==null?void 0:fn[0])==null?void 0:cn.find(Ne=>(Ne==null?void 0:Ne.key)==="header"))==null?void 0:Lt.contents)==null?void 0:Pn.filter(Ne=>!(Ne!=null&&Ne.columnPath)&&(Ne==null?void 0:Ne.label)!=="操作"),s=oe}return s==null?void 0:s.filter(rr=>rr!==void 0)},wn=async(e,a,r="",n=!1,t,i,s,f)=>{var v,E,w,S,T,B;let c,l=new WeakMap;s&&(l=s),(!n||!t)&&(c=(v=l[e])==null?void 0:v.filter(I=>{var U,L;return((U=I==null?void 0:I.key)==null?void 0:U.parentTable)===r||((L=I==null?void 0:I.key)==null?void 0:L.type)==="related"})),no.setPageMapState(l);const o=(E=l[e])==null?void 0:E.filter(I=>{var U;return((U=I==null?void 0:I.key)==null?void 0:U.type)==="structureMethod"}),u=c==null?void 0:c.map(I=>I.id);if(!u)return;let x=(w=l[e])==null?void 0:w.filter(I=>{var U,L,W,M;return((U=I==null?void 0:I.key)==null?void 0:U.type)==="data"&&(u.includes((L=I==null?void 0:I.key)==null?void 0:L.tableId)||u.includes((M=(W=I==null?void 0:I.key)==null?void 0:W.tableId)==null?void 0:M.toString()))});const h=JSON.parse(sessionStorage.getItem("ocr_last_saved_table")||"null"),d=JSON.parse(sessionStorage.getItem("ocr_last_saved_ids")||"null");h&&Array.isArray(d)&&d.length>0&&(e!=null&&e.startsWith("/")&&e.substring(1),(S=h==null?void 0:h.pageKey)!=null&&S.startsWith("/")?h.pageKey.substring(1):h==null||h.pageKey);const p=l[e+G1.value]??[];(p==null?void 0:p.length)===0&&(x=to(x,!1,l));let m=[];x==null||x.forEach(I=>{var W;const U=Array.isArray(I.value.tableData)?I.value.tableData:[I.value.tableData];U.unshift({id:I.id});const L=(W=I==null?void 0:I.key)==null?void 0:W.tableId;m!=null&&m.find(M=>(M==null?void 0:M.key)===L)?m=m==null?void 0:m.map(M=>((M==null?void 0:M.key)===L&&(M.contents=[...M.contents,U]),M)):m.push({key:L,contents:[U]})});let g=[];const y=await(c==null?void 0:c.map(async(I,U)=>{var se,ne,he,ce,Ce,K,Te,Fe,_,A,D,b,G,re,ee,Z,J,we,P,Me,be,Ye,Be,ie,hr,sr,Ea,Ia,wt,Za,Ta,za;let L=I.value.pageData;const W=I==null?void 0:I.id;let M=(se=Q.cloneDeep(L==null?void 0:L.compData))==null?void 0:se.filter(Se=>(Se==null?void 0:Se.key)!=="tableContents");if(!(L!=null&&L.orderId)&&typeof L!="string"&&(L.orderId=U),M&&(M!=null&&M.find(Se=>(Se==null?void 0:Se.key)==="header"))&&(!Array.isArray((he=(ne=M==null?void 0:M.find(Se=>(Se==null?void 0:Se.key)==="header"))==null?void 0:ne.contents)==null?void 0:he[0])&&((Ce=(ce=M==null?void 0:M.find(Se=>(Se==null?void 0:Se.key)==="header"))==null?void 0:ce.contents)!=null&&Ce.every(Se=>!(Se!=null&&Se.columnPath)))||Array.isArray((Te=(K=M==null?void 0:M.find(Se=>(Se==null?void 0:Se.key)==="header"))==null?void 0:K.contents)==null?void 0:Te[0])&&((A=_n((_=(Fe=M==null?void 0:M.find(Se=>(Se==null?void 0:Se.key)==="header"))==null?void 0:Fe.contents)==null?void 0:_[0]))!=null&&A.every(Se=>!(Se!=null&&Se.columnPath))))){M=await(M==null?void 0:M.map(async me=>{var Dr,Rr,xr,Er,da,ta,He,Vr,ia,Sa,xa,cr,Sr,Ra,Ua,Wa,ft,Ot,Rt,yt,Nt,Pt,Mt,k,N,F,C,O,R,X,j,z,V,Y,le,_e,Ee,ue,ge,Ze,Tr,Lr,Kr,sn,fn,cn,Lt,Pn,rr,de,Mn,L0,Ln,jr,Xe;if((me==null?void 0:me.key)==="header"){if(((Dr=me.contents)==null?void 0:Dr.length)===0){let pa=(Rr=M==null?void 0:M.find(oe=>(oe==null?void 0:oe.key)==="relatedFilter"))==null?void 0:Rr.contents,Bn=(xr=pa==null?void 0:pa.split("["))==null?void 0:xr[0],lr=(Vr=(He=(ta=(da=(Er=pa==null?void 0:pa.replace("[",br))==null?void 0:Er.split(br))==null?void 0:da[1])==null?void 0:ta.replace("]",br))==null?void 0:He.split(br))==null?void 0:Vr[0];lr=(ia=lr==null?void 0:lr.split("["))==null?void 0:ia[0],lr=(cr=(xa=lr==null?void 0:lr.split(":"))==null?void 0:xa[((Sa=lr==null?void 0:lr.split(":"))==null?void 0:Sa.length)-1])==null?void 0:cr.replaceAll("'","");let Ha=((Ot=(ft=(Wa=(Ua=(Ra=(Sr=l==null?void 0:l[Bn])==null?void 0:Sr.find(oe=>{var Ir,Re;return((Re=(Ir=oe==null?void 0:oe.value)==null?void 0:Ir.pageData)==null?void 0:Re.name)===lr}))==null?void 0:Ra.value)==null?void 0:Ua.pageData)==null?void 0:Wa.compData)==null?void 0:ft.find(oe=>(oe==null?void 0:oe.key)==="header"))==null?void 0:Ot.contents)??[];if(Ha!=null&&Ha.some(oe=>oe==null?void 0:oe.columnPath)){let oe=await wn(Bn,a,r,n,t,i,l);Ha=(Nt=(yt=(Rt=oe==null?void 0:oe.find(Ir=>(Ir==null?void 0:Ir.name)===lr))==null?void 0:Rt.compData)==null?void 0:yt.find(Ir=>(Ir==null?void 0:Ir.key)==="header"))==null?void 0:Nt.contents}me.contents=Ha}else if((Mt=(Pt=M==null?void 0:M.find(pa=>(pa==null?void 0:pa.key)==="relatedFilter"))==null?void 0:Pt.contents)!=null&&Mt.length){let pa=(k=M==null?void 0:M.find(Re=>(Re==null?void 0:Re.key)==="relatedFilter"))==null?void 0:k.contents,Bn=(N=pa==null?void 0:pa.split("["))==null?void 0:N[0],lr=(X=(R=(O=(C=(F=pa==null?void 0:pa.replace("[",br))==null?void 0:F.split(br))==null?void 0:C[1])==null?void 0:O.replace("]",br))==null?void 0:R.split(br))==null?void 0:X[0],Ha=(V=(z=(j=lr==null?void 0:lr.split("["))==null?void 0:j[1])==null?void 0:z.replaceAll("'",""))==null?void 0:V.split(",");lr=(Y=lr==null?void 0:lr.split("["))==null?void 0:Y[0],lr=((Ee=(_e=lr==null?void 0:lr.split(":"))==null?void 0:_e[((le=lr==null?void 0:lr.split(":"))==null?void 0:le.length)-1])==null?void 0:Ee.replaceAll("'",""))===""?(Ze=(ge=lr==null?void 0:lr.split(":"))==null?void 0:ge[((ue=lr==null?void 0:lr.split(":"))==null?void 0:ue.length)-2])==null?void 0:Ze.replaceAll("'",""):(Kr=(Lr=lr==null?void 0:lr.split(":"))==null?void 0:Lr[((Tr=lr==null?void 0:lr.split(":"))==null?void 0:Tr.length)-1])==null?void 0:Kr.replaceAll("'","");let oe=((rr=(Pn=(Lt=(cn=(fn=(sn=l==null?void 0:l[Bn])==null?void 0:sn.find(Re=>{var Na,Qa;return((Qa=(Na=Re==null?void 0:Re.value)==null?void 0:Na.pageData)==null?void 0:Qa.name)===lr}))==null?void 0:fn.value)==null?void 0:cn.pageData)==null?void 0:Lt.compData)==null?void 0:Pn.find(Re=>(Re==null?void 0:Re.key)==="header"))==null?void 0:rr.contents)??[];if(oe!=null&&oe.some(Re=>Re==null?void 0:Re.columnPath)){let Re=await wn(Bn,a,r,n,t,i,l);oe=(L0=(Mn=(de=Re==null?void 0:Re.find(Na=>(Na==null?void 0:Na.name)===lr))==null?void 0:de.compData)==null?void 0:Mn.find(Na=>(Na==null?void 0:Na.key)==="header"))==null?void 0:L0.contents}(Ha==null?void 0:Ha.length)>0&&(oe=oe==null?void 0:oe.filter(Re=>Ha==null?void 0:Ha.find(Na=>Na===(Re==null?void 0:Re.prop))));let Ir=(Ln=M==null?void 0:M.find(Re=>(Re==null?void 0:Re.key)==="relatedFilter"))==null?void 0:Ln.index;if(Ir!==""){Ir=parseInt(Ir);let Re=((jr=me.contents)==null?void 0:jr.slice(Ir,me.contents.length))??[],Na=[...(Xe=me.contents)==null?void 0:Xe.slice(0,Ir),...oe];Na=[...Na,...Re],me.contents=Na}}}return me})),M=await Promise.all(M);const Se=((D=M==null?void 0:M.find(me=>(me==null?void 0:me.key)==="contentTableId"))==null?void 0:D.contents)??I.id;let Pe=Oi((b=m==null?void 0:m.find(me=>(me==null?void 0:me.key)===Se))==null?void 0:b.contents,(G=M==null?void 0:M.find(me=>(me==null?void 0:me.key)==="header"))==null?void 0:G.contents),Ue=await sx((re=M==null?void 0:M.find(me=>(me==null?void 0:me.key)==="header"))==null?void 0:re.contents,e,(ee=M==null?void 0:M.find(me=>(me==null?void 0:me.key)==="tableFilter"))==null?void 0:ee.contents,l);if((J=(Z=M==null?void 0:M.find(me=>(me==null?void 0:me.key)==="header"))==null?void 0:Z.contents)!=null&&J.find(me=>(me==null?void 0:me.filterContent)&&(me==null?void 0:me.filterContent)!=="")){let me=(Me=(P=(we=M==null?void 0:M.find(xr=>(xr==null?void 0:xr.key)==="header"))==null?void 0:we.contents)==null?void 0:P.find(xr=>(xr==null?void 0:xr.filterContent)&&(xr==null?void 0:xr.filterContent)!==""))==null?void 0:Me.filterContent;me=(be=me==null?void 0:me.slice(1,(me==null?void 0:me.length)-1))==null?void 0:be.split(",");let Dr=me==null?void 0:me.map(xr=>{var da,ta;let Er=j0==null?void 0:j0.find(He=>xr==null?void 0:xr.includes(He==null?void 0:He.key));if(Er)return{order:Er==null?void 0:Er.order,value:Er==null?void 0:Er.value,content:(ta=(da=xr==null?void 0:xr.replaceAll("/",":"))==null?void 0:da.replaceAll(":","="))==null?void 0:ta.replace("=",":")}});M!=null&&M.every(xr=>Array.isArray(xr))||(M=[M]),await(async()=>{var xr,Er,da;for(const ta of Dr??[])if(ta){const He=(da=(Er=(xr=ta==null?void 0:ta.content)==null?void 0:xr.replace(":",br))==null?void 0:Er.split(br))==null?void 0:da[1];M=await io((ta==null?void 0:ta.value)+"('"+JSON.stringify(M).replaceAll("'",'"')+"','"+He+"','')")??[]??M}})(),M=M==null?void 0:M[0]}Ue!=null&&Ue.mainKeys&&M.push({key:"mainRouters",contents:Ue==null?void 0:Ue.mainKeys});let wa=[],er=[];Array.isArray(Ue)&&(wa=Oi(Ue,(Ye=M==null?void 0:M.find(me=>(me==null?void 0:me.key)==="header"))==null?void 0:Ye.contents)),Array.isArray(Ue==null?void 0:Ue.tableContents)&&(er=Oi(Ue==null?void 0:Ue.tableContents,(Be=M==null?void 0:M.find(me=>(me==null?void 0:me.key)==="header"))==null?void 0:Be.contents));let Cr=[...wa,...er];Array.isArray(Pe)&&(Pe==null?void 0:Pe.length)>0&&(Cr=[...Cr,...Pe]),M.push({key:"tableContents",contents:Cr}),M=M==null?void 0:M.map(me=>{var Dr,Rr;return(me==null?void 0:me.key)==="header"&&((Dr=me.contents)==null?void 0:Dr.length)!==0&&(me.contents=(Rr=me.contents)==null?void 0:Rr.map(xr=>((xr==null?void 0:xr.prop)===(Ue==null?void 0:Ue.mainKey)&&(xr.isMainKey=!0),xr))),me})}else M&&((ie=M==null?void 0:M.find(Se=>(Se==null?void 0:Se.key)==="header"))!=null&&ie.contents)&&(M=await $1(Q.cloneDeep(M),W,c,l,e,f),M!=null&&M.every(Se=>Array.isArray(Se))||(M=[M]));if(typeof L!="string"&&(L.id=I==null?void 0:I.id,L.isShow=(sr=(hr=I==null?void 0:I.value)==null?void 0:hr.pageData)==null?void 0:sr.isShow),(M==null?void 0:M.length)>0&&M.every(Se=>Array.isArray(Se)))M==null||M.forEach(Se=>{var wa,er,Cr,me,Dr;let Pe=Q.cloneDeep(L);Pe.compData=Se,Pe.tableId=(wa=Se==null?void 0:Se.find(Rr=>(Rr==null?void 0:Rr.key)==="contentTableId"))==null?void 0:wa.contents;let Ue=(er=Se==null?void 0:Se.find(Rr=>(Rr==null?void 0:Rr.key)==="name"))==null?void 0:er.contents;Ue!=null&&Ue.name0&&(Ue==null?void 0:Ue.name0)===(Pe==null?void 0:Pe.name)?(Pe.name0=Pe.name,Pe.name=Ue==null?void 0:Ue.name):Ue!=null&&Ue.name0&&(Pe.name1=Pe.name,Pe.name0=Ue.name0,Pe.name=Ue==null?void 0:Ue.name),(Cr=Pe==null?void 0:Pe.compData)!=null&&Cr.every(Rr=>Array.isArray(Rr))?((me=Pe==null?void 0:Pe.compData)==null?void 0:me.length)===0?g.push(Pe):(Dr=Pe==null?void 0:Pe.compData)==null||Dr.forEach((Rr,xr)=>{let Er;xr===0?Er={comp:Pe==null?void 0:Pe.comp,compData:Rr,id:Pe==null?void 0:Pe.id,name:Pe==null?void 0:Pe.name,isShow:Pe==null?void 0:Pe.isShow}:Er={comp:Pe==null?void 0:Pe.comp,compData:Rr,id:Pe==null?void 0:Pe.id,name:"",isShow:Pe==null?void 0:Pe.isShow},g.push(Er)}):g.push(Pe)});else if(((Ea=I.key)==null?void 0:Ea.type)==="structure")L.compData=M,(Ia=L==null?void 0:L.compData)!=null&&Ia.every(Se=>Array.isArray(Se))?((wt=L==null?void 0:L.compData)==null?void 0:wt.length)===0?g.push(L):(Za=L==null?void 0:L.compData)==null||Za.forEach((Se,Pe)=>{let Ue;Pe===0?Ue={comp:L==null?void 0:L.comp,compData:Se,id:L==null?void 0:L.id,name:L==null?void 0:L.name,isShow:L==null?void 0:L.isShow}:Ue={comp:L==null?void 0:L.comp,compData:Se,id:L==null?void 0:L.id,name:"",isShow:L==null?void 0:L.isShow},g.push(Ue)}):g.push(L);else if(((Ta=I.key)==null?void 0:Ta.type)==="method"){let Se;Se={name:"",compData:[L],comp:"calculator"},g.push(Se)}else if(((za=I==null?void 0:I.key)==null?void 0:za.type)==="related"){let Se;Se={name:"",compData:L,comp:""},g.push(Se)}}));return await Promise.all(y),((T=o==null?void 0:o.map(I=>I.value.pageData))==null?void 0:T.filter(I=>Object.values(I).length>0).length)>0&&g.push({comp:"methodButton",name:"",compData:(B=o==null?void 0:o.map(I=>I.value.pageData))==null?void 0:B.filter(I=>Object.values(I).length>0)}),g=g.sort((I,U)=>I.orderId-U.orderId),g=await C1(g),i?g:await S1(e,g)},K1=async()=>{var e,a;try{let r=((e=Uc.value)==null?void 0:e.platform)||"browser";const n=((a=Uc.value)==null?void 0:a.chineseName)||"工业软件建模与开发系统";r!=="browser"&&r!=="client"&&r!=="three"&&(r="browser"),_f.setPlatform(r),_f.setPlatName(n)}catch(r){return Promise.reject(r)}},Y0=zr.ref(0),z1=Q.useMenuState(Ae.pinia),V1=l0(Ae.pinia),{originalPath:kf}=Ae.storeToRefs(V1),j1=Q.useLoginState(Ae.pinia),Y1=Ws(Ae.pinia),{multipleTableConst:ht}=Ae.storeToRefs(Y1),{loginUserInfo:v0}=Ae.storeToRefs(j1),{activeMenuPath:J1}=Ae.storeToRefs(z1),q1=Ae.useModelComp(Ae.pinia),{pageMapState:Ss}=Ae.storeToRefs(q1),rn=kf.value,H0="/",As=(e,a,r)=>e==null?void 0:e.map(t=>{var i;return Y0.value++,Array.isArray(t)?As(t,a):{label:(t==null?void 0:t.label)==="操作"?a?"操作":"":(t==null?void 0:t.label)??"",prop:(t==null?void 0:t.label)==="操作"?"operate":(t==null?void 0:t.prop)??"a"+Y0.value,width:(t==null?void 0:t.label)==="操作"?"200":t!=null&&t.width?parseInt(t.width):"",fixed:(t==null?void 0:t.fixed)??void 0,sortable:(t==null?void 0:t.sortable)??!1,align:(t==null?void 0:t.align)??"left",showOverflowTooltip:(t==null?void 0:t.showOverflowTooltip)??!1,isNotDrag:(t==null?void 0:t.isNotDrag)??!1,isEditCol:(t==null?void 0:t.isEditCol)??!1,isOperate:(t==null?void 0:t.isOperate)??!1,id:(t==null?void 0:t.id)??Y0.value,type:(t==null?void 0:t.label)==="操作"?"operate":void 0,formType:(t==null?void 0:t.formType)??(t!=null&&t.groupSelect?"Select":""),isHidden:t==null?void 0:t.isHidden,options:(t==null?void 0:t.options)??[],children:As(t.children,a)??void 0,formMenuSelect:(t==null?void 0:t.formMenuSelect)??[],groupSelect:t!=null&&t.groupSelect?(i=t==null?void 0:t.groupSelect)==null?void 0:i.replaceAll('"',"").split(":"):[],isMainKey:(t==null?void 0:t.isMainKey)||!!(t!=null&&t.directiveLabel),allSelectionContents:(t==null?void 0:t.allContents)??[],selectFilter:t==null?void 0:t.selectFilter,menuId:t==null?void 0:t.menuId,relatedValueId:t==null?void 0:t.relatedValueId,filterContent:t==null?void 0:t.filterContents,menus:t==null?void 0:t.menus,groups:t==null?void 0:t.groups,words:t==null?void 0:t.words,isExistChild:(t==null?void 0:t.isExistChild)??!1,mainKey:(t==null?void 0:t.mainKey)??!1,filter:t==null?void 0:t.filter,bindMenus:t==null?void 0:t.bindMenus,fatherPath:t==null?void 0:t.fatherPath,isMainPath:t==null?void 0:t.isMainPath,required:(t==null?void 0:t.required)??!1,functionName:t==null?void 0:t.functionName,functionRelatedWords:t==null?void 0:t.functionRelatedWords,calculatorFilter:t==null?void 0:t.calculatorFilter}}),Z1=e=>{const a=[];function r(n){if(Array.isArray(n))for(const t of n)!t.children||t.children.length===0?a.push(t):r(t.children)}return r(e),a},Q1=(e,a,r)=>Q.cloneDeep(e).map(t=>(Array.isArray(t)&&(t=t.map(i=>{var s,f,c;return(f=(s=J1.value)==null?void 0:s.split("/"))==null||f.forEach(l=>{var o,u,x;l!==""&&((x=(u=(o=l==null?void 0:l.split(kf+"updateLoading"))==null?void 0:o[0])==null?void 0:u.split(kf+"loading"))==null||x[0])}),Array.isArray(i)?i=As(i,a):(i={label:(i==null?void 0:i.label)==="操作"?a?"操作":"":(i==null?void 0:i.label)??"",prop:(i==null?void 0:i.label)==="操作"?"operate":(i==null?void 0:i.prop)??"a"+Y0.value,width:(i==null?void 0:i.label)==="操作"?"200":i!=null&&i.width?parseInt(i.width):"",fixed:(i==null?void 0:i.fixed)??void 0,sortable:(i==null?void 0:i.sortable)??!1,align:(i==null?void 0:i.align)??"left",showOverflowTooltip:(i==null?void 0:i.showOverflowTooltip)??!0,isNotDrag:(i==null?void 0:i.isNotDrag)??!1,isEditCol:(i==null?void 0:i.isEditCol)??!1,isOperate:(i==null?void 0:i.isOperate)??!1,id:(i==null?void 0:i.id)??Y0.value,type:(i==null?void 0:i.label)==="操作"?"operate":void 0,formType:(i==null?void 0:i.formType)??(i!=null&&i.groupSelect?"Select":""),isHidden:i==null?void 0:i.isHidden,options:(i==null?void 0:i.options)??[],children:As(i.children,a),formMenuSelect:(i==null?void 0:i.formMenuSelect)??[],groupSelect:i!=null&&i.groupSelect?(c=i==null?void 0:i.groupSelect)==null?void 0:c.replaceAll('"',"").split(":"):[],isMainKey:(i==null?void 0:i.isMainKey)||!!(i!=null&&i.directiveLabel),allSelectionContents:(i==null?void 0:i.allContents)??[],selectFilter:i==null?void 0:i.selectFilter,menuId:i==null?void 0:i.menuId,relatedValueId:i==null?void 0:i.relatedValueId,filterContent:i==null?void 0:i.filterContents,menus:i==null?void 0:i.menus,groups:i==null?void 0:i.groups,words:i==null?void 0:i.words,isExistChild:(i==null?void 0:i.isExistChild)??!1,mainKey:(i==null?void 0:i.mainKey)??!1,filter:i==null?void 0:i.filter,bindMenus:i==null?void 0:i.bindMenus,fatherPath:i==null?void 0:i.fatherPath,isMainPath:i==null?void 0:i.isMainPath,required:(i==null?void 0:i.required)??!1,functionName:i==null?void 0:i.functionName,functionRelatedWords:i==null?void 0:i.functionRelatedWords,calculatorFilter:i==null?void 0:i.calculatorFilter},Y0.value++),i})),t)),_n=e=>{function a(r,n=[],t=""){if(!r||r.length===0)return[];let i=n;return Array.isArray(r)&&(r==null||r.forEach(s=>{var f,c,l,o,u,x,h,d,p,m,g,y,v;if(s!=null&&s.children&&((f=s.children)==null?void 0:f.length)>0){let E=t===""?t+((u=(c=s==null?void 0:s.prop)==null?void 0:c.split(ht.value))==null?void 0:u[((o=(l=s==null?void 0:s.prop)==null?void 0:l.split(ht.value))==null?void 0:o.length)-1]):t+ht.value+((p=(x=s==null?void 0:s.prop)==null?void 0:x.split(ht.value))==null?void 0:p[((d=(h=s==null?void 0:s.prop)==null?void 0:h.split(ht.value))==null?void 0:d.length)-1]);i=a(s==null?void 0:s.children,i,E)}else t!==""&&(s.prop=t+ht.value+((v=(m=s==null?void 0:s.prop)==null?void 0:m.split(ht.value))==null?void 0:v[((y=(g=s==null?void 0:s.prop)==null?void 0:g.split(ht.value))==null?void 0:y.length)-1])),i.push(s)})),i}return a(e)},ex=e=>{function a(r,n=[],t=""){if(!r||r.length===0)return[];let i=n;return Array.isArray(r)&&(i=r==null?void 0:r.map(s=>{var f,c,l,o,u,x,h,d,p,m,g,y,v;if(s!=null&&s.children&&((f=s.children)==null?void 0:f.length)>0){let E=t===""?t+((u=(c=s==null?void 0:s.prop)==null?void 0:c.split(ht.value))==null?void 0:u[((o=(l=s==null?void 0:s.prop)==null?void 0:l.split(ht.value))==null?void 0:o.length)-1]):t+ht.value+((p=(x=s==null?void 0:s.prop)==null?void 0:x.split(ht.value))==null?void 0:p[((d=(h=s==null?void 0:s.prop)==null?void 0:h.split(ht.value))==null?void 0:d.length)-1]);s.children=a(s==null?void 0:s.children,i,E)}else t!==""&&(s.prop=t+ht.value+((v=(m=s==null?void 0:s.prop)==null?void 0:m.split(ht.value))==null?void 0:v[((y=(g=s==null?void 0:s.prop)==null?void 0:g.split(ht.value))==null?void 0:y.length)-1]));return s})),i}return a(e)},rx=e=>{let a=Q.cloneDeep(e);return a=a==null?void 0:a.map(r=>((r==null?void 0:r.type)==="Select"?r={label:r==null?void 0:r.label,prop:r==null?void 0:r.prop,name:r==null?void 0:r.name,type:r==null?void 0:r.type,value:(r==null?void 0:r.value)??"",optionUrl:{groupSelect:r==null?void 0:r.groupSelect,menuSelect:r==null?void 0:r.menuSelect,type:"Select",selectRelateType:r==null?void 0:r.selectRelateType,multiple:r==null?void 0:r.multiple}}:(r==null?void 0:r.type)==="Date"&&(r.value=!(r!=null&&r.value)&&(r==null?void 0:r.isNewDate)!==!1?new Date:r==null?void 0:r.value),r.label=r.prop||r.label,r)),a},so=e=>{var a,r,n,t,i,s;if(((a=e==null?void 0:e.pageData)==null?void 0:a.comp)==="Form"){let f=(n=(r=e==null?void 0:e.pageData)==null?void 0:r.compData)==null?void 0:n.map(l=>{var o;return(l==null?void 0:l.key)==="formContent"&&(l.contents=(o=l.contents)==null?void 0:o.map(u=>((u==null?void 0:u.type)==="Date"&&(u.value=""),u))),l});return{pageData:{comp:(t=e==null?void 0:e.pageData)==null?void 0:t.comp,compData:f,name:(i=e==null?void 0:e.pageData)==null?void 0:i.name,isShow:(s=e==null?void 0:e.pageData)==null?void 0:s.isShow}}}else return e},fo=(e,a)=>{var n,t,i,s,f,c,l,o,u;let r=(i=(t=(n=a==null?void 0:a.pageData)==null?void 0:n.compData)==null?void 0:t.find(x=>(x==null?void 0:x.key)==="formContent"))==null?void 0:i.contents;if(((s=e==null?void 0:e.pageData)==null?void 0:s.comp)==="Form"){let x=(c=(f=e==null?void 0:e.pageData)==null?void 0:f.compData)==null?void 0:c.map(d=>{var p;return(d==null?void 0:d.key)==="formContent"&&(d.contents=(p=d.contents)==null?void 0:p.map(m=>{var g;return m.value=(g=r==null?void 0:r.find(y=>(y==null?void 0:y.key)===(m==null?void 0:m.key)))==null?void 0:g.value,m})),d});return{pageData:{comp:(l=e==null?void 0:e.pageData)==null?void 0:l.comp,compData:x,name:(o=e==null?void 0:e.pageData)==null?void 0:o.name,isShow:(u=e==null?void 0:e.pageData)==null?void 0:u.isShow}}}else return e},Pf=async(e,a,r,n,t)=>{var p,m,g,y,v,E,w,S,T,B,I,U,L,W,M,se,ne,he,ce,Ce,K,Te,Fe;let i=e;(i==null?void 0:i[(i==null?void 0:i.length)-1])!==rn&&(i="",(m=(p=Q.cloneDeep(e))==null?void 0:p.split(rn))==null||m.forEach((_,A)=>{var D,b;A!==((b=(D=Q.cloneDeep(e))==null?void 0:D.split(rn))==null?void 0:b.length)-1&&(i=i===""?i+_:i+"/"+_)}),i=i+rn);let s=[],f=await la.getInsofDataApi({key:{pageKey:e,systemKey:sessionStorage.getItem("systemKey")}});const c={data:{result:(y=(g=f==null?void 0:f.data)==null?void 0:g.result)==null?void 0:y.filter(_=>{var A;return((A=_==null?void 0:_.key)==null?void 0:A.type)==="structure"})}};let l;(e==null?void 0:e[(e==null?void 0:e.length)-1])!==rn&&(l={data:{result:(v=Ss.value[i])==null?void 0:v.filter(_=>{var A;return((A=_==null?void 0:_.key)==null?void 0:A.type)==="structure"})}},((w=(E=l==null?void 0:l.data)==null?void 0:E.result)==null?void 0:w.length)>0&&(l=(T=(S=Q.cloneDeep(l))==null?void 0:S.data)==null?void 0:T.result));const o={data:{result:(B=Ss.value[i])==null?void 0:B.filter(_=>{var A;return((A=_==null?void 0:_.key)==null?void 0:A.type)==="structureMethod"})}},u={data:{result:(U=(I=f==null?void 0:f.data)==null?void 0:I.result)==null?void 0:U.filter(_=>{var A;return((A=_==null?void 0:_.key)==null?void 0:A.type)==="data"})}};if((e==null?void 0:e[(e==null?void 0:e.length)-1])!==rn){let _=(L=c==null?void 0:c.data)==null?void 0:L.result;if(!Array.isArray(l))return;l==null||l.forEach(A=>{var b,G,re,ee,Z;let D=(b=_==null?void 0:_.find(J=>{var we,P,Me,be;return((P=(we=A==null?void 0:A.value)==null?void 0:we.pageData)==null?void 0:P.name)===((be=(Me=J==null?void 0:J.value)==null?void 0:Me.pageData)==null?void 0:be.name)}))==null?void 0:b.value;D?D=D:D=void 0,s.push({key:{pageKey:a,parentTable:((G=D==null?void 0:D.key)==null?void 0:G.parentTable)??"",systemKey:(re=A==null?void 0:A.key)==null?void 0:re.systemKey,type:((ee=D==null?void 0:D.key)==null?void 0:ee.type)??((Z=A==null?void 0:A.key)==null?void 0:Z.type),version:1},value:fo(A==null?void 0:A.value,D)})})}else(M=(W=c==null?void 0:c.data)==null?void 0:W.result)==null||M.forEach(_=>{var A,D,b;s.push({key:{pageKey:a,parentTable:(A=_==null?void 0:_.key)==null?void 0:A.parentTable,systemKey:(D=_==null?void 0:_.key)==null?void 0:D.systemKey,type:(b=_==null?void 0:_.key)==null?void 0:b.type,version:1},value:so(_==null?void 0:_.value)})});if((ne=(se=o==null?void 0:o.data)==null?void 0:se.result)==null||ne.forEach(_=>{var A,D;s.push({key:{pageKey:a,systemKey:(A=_==null?void 0:_.key)==null?void 0:A.systemKey,type:(D=_==null?void 0:_.key)==null?void 0:D.type,version:1},value:_==null?void 0:_.value})}),s=s==null?void 0:s.map(_=>{var A,D,b;return((D=(A=_==null?void 0:_.value)==null?void 0:A.pageData)==null?void 0:D.comp)==="Form"&&(_.value.pageData.compData=(b=_.value.pageData.compData)==null?void 0:b.map(G=>{var re;return(G==null?void 0:G.key)==="formContent"&&(G.contents=(re=G.contents)==null?void 0:re.map(ee=>(r!=null&&r[ee==null?void 0:ee.key]&&(ee==null?void 0:ee.type)!=="Date"&&(ee.value=r[ee.key]),ee))),G}),n&&_.value.pageData.compData.push({key:"parentFormPath",contents:n})),_}),(s==null?void 0:s.length)>0){let _;if(!t)_=s;else{const A=s==null?void 0:s.find(b=>{var G,re;return t==null?void 0:t.includes((re=(G=b==null?void 0:b.value)==null?void 0:G.pageData)==null?void 0:re.name)}),D=/^[A-Za-z]+$/;_=A?s==null?void 0:s.map(b=>{var G,re,ee,Z,J,we;return t!=null&&t.includes((re=(G=b==null?void 0:b.value)==null?void 0:G.pageData)==null?void 0:re.name)?{...b,value:{pageData:{...(ee=b==null?void 0:b.value)==null?void 0:ee.pageData,compData:(we=(J=(Z=b==null?void 0:b.value)==null?void 0:Z.pageData)==null?void 0:J.compData)==null?void 0:we.map(P=>{var Me;return(P==null?void 0:P.key)==="formContent"?{...P,contents:(Me=P==null?void 0:P.contents)==null?void 0:Me.map(be=>D.test(be==null?void 0:be.prop)?be:{...be,value:""})}:P})}}}:b}):s}await la.batchAddInsofDataApi({dataList:_})}let x={};const h=await la.getInsofDataApi({key:{pageKey:a,type:"structure",systemKey:sessionStorage.getItem("systemKey")}});((ce=(he=c==null?void 0:c.data)==null?void 0:he.result)==null?void 0:ce.length)>0&&((K=(Ce=c==null?void 0:c.data)==null?void 0:Ce.result)==null||K.forEach(_=>{var A,D,b;x[_.id]=(b=(D=(A=h==null?void 0:h.data)==null?void 0:A.result)==null?void 0:D.find(G=>{var re,ee,Z,J;return((ee=(re=G==null?void 0:G.value)==null?void 0:re.pageData)==null?void 0:ee.name)===((J=(Z=_==null?void 0:_.value)==null?void 0:Z.pageData)==null?void 0:J.name)}))==null?void 0:b.id}));let d=[];(Fe=(Te=u==null?void 0:u.data)==null?void 0:Te.result)==null||Fe.forEach(_=>{var A,D,b;d.push({key:{pageKey:a,tableId:x[(A=_==null?void 0:_.key)==null?void 0:A.tableId],systemKey:(D=_==null?void 0:_.key)==null?void 0:D.systemKey,type:(b=_==null?void 0:_.key)==null?void 0:b.type},value:_==null?void 0:_.value})}),(d==null?void 0:d.length)>0&&await la.batchAddInsofDataApi({dataList:d})},ax=async(e,a,r,n,t)=>{var p,m,g,y,v,E,w,S,T,B,I,U,L,W,M,se,ne,he,ce,Ce,K,Te,Fe;let i=e;(i==null?void 0:i[(i==null?void 0:i.length)-1])!==H0&&(i="",(m=(p=Q.cloneDeep(e))==null?void 0:p.split(H0))==null||m.forEach((_,A)=>{var D,b;A!==((b=(D=Q.cloneDeep(e))==null?void 0:D.split(H0))==null?void 0:b.length)-1&&(i=i===""?i+_:i+"/"+_)}),i=i+H0);let s=[],f=await la.getInsofDataApi({key:{pageKey:e,systemKey:sessionStorage.getItem("systemKey")}});const c={data:{result:(y=(g=f==null?void 0:f.data)==null?void 0:g.result)==null?void 0:y.filter(_=>{var A;return((A=_==null?void 0:_.key)==null?void 0:A.type)==="structure"})}};let l;(e==null?void 0:e[(e==null?void 0:e.length)-1])!==H0&&(l={data:{result:(v=Ss.value[e])==null?void 0:v.filter(_=>{var A;return((A=_==null?void 0:_.key)==null?void 0:A.type)==="structure"})}},((w=(E=l==null?void 0:l.data)==null?void 0:E.result)==null?void 0:w.length)>0&&(l=(T=(S=Q.cloneDeep(l))==null?void 0:S.data)==null?void 0:T.result));const o={data:{result:(B=Ss.value[i])==null?void 0:B.filter(_=>{var A;return((A=_==null?void 0:_.key)==null?void 0:A.type)==="structureMethod"})}},u={data:{result:(U=(I=f==null?void 0:f.data)==null?void 0:I.result)==null?void 0:U.filter(_=>{var A;return((A=_==null?void 0:_.key)==null?void 0:A.type)==="data"})}};if((e==null?void 0:e[(e==null?void 0:e.length)-1])!==H0){let _=(L=c==null?void 0:c.data)==null?void 0:L.result;if(!Array.isArray(l))return;l==null||l.forEach(A=>{var b,G,re,ee,Z,J,we,P;let D;(G=(b=A==null?void 0:A.value)==null?void 0:b.pageData)!=null&&G.name0?D=(re=_==null?void 0:_.find(Me=>{var be,Ye,Be,ie,hr,sr,Ea,Ia;return((Ye=(be=A==null?void 0:A.value)==null?void 0:be.pageData)==null?void 0:Ye.name)===((ie=(Be=Me==null?void 0:Me.value)==null?void 0:Be.pageData)==null?void 0:ie.name)&&((sr=(hr=A==null?void 0:A.value)==null?void 0:hr.pageData)==null?void 0:sr.name0)===((Ia=(Ea=Me==null?void 0:Me.value)==null?void 0:Ea.pageData)==null?void 0:Ia.name0)}))==null?void 0:re.value:D=(ee=_==null?void 0:_.find(Me=>{var be,Ye,Be,ie;return((Ye=(be=A==null?void 0:A.value)==null?void 0:be.pageData)==null?void 0:Ye.name)===((ie=(Be=Me==null?void 0:Me.value)==null?void 0:Be.pageData)==null?void 0:ie.name)}))==null?void 0:ee.value,D?D=D:D=void 0,s.push({key:{pageKey:a,parentTable:((Z=D==null?void 0:D.key)==null?void 0:Z.parentTable)??"",systemKey:(J=A==null?void 0:A.key)==null?void 0:J.systemKey,type:((we=D==null?void 0:D.key)==null?void 0:we.type)??((P=A==null?void 0:A.key)==null?void 0:P.type),version:1},value:fo(A==null?void 0:A.value,D)})})}else(M=(W=c==null?void 0:c.data)==null?void 0:W.result)==null||M.forEach(_=>{var A,D,b;s.push({key:{pageKey:a,parentTable:(A=_==null?void 0:_.key)==null?void 0:A.parentTable,systemKey:(D=_==null?void 0:_.key)==null?void 0:D.systemKey,type:(b=_==null?void 0:_.key)==null?void 0:b.type,version:1},value:so(_==null?void 0:_.value)})});if((ne=(se=o==null?void 0:o.data)==null?void 0:se.result)==null||ne.forEach(_=>{var A,D;s.push({key:{pageKey:a,systemKey:(A=_==null?void 0:_.key)==null?void 0:A.systemKey,type:(D=_==null?void 0:_.key)==null?void 0:D.type,version:1},value:_==null?void 0:_.value})}),s=s==null?void 0:s.map(_=>{var A,D;return(D=(A=_==null?void 0:_.value)==null?void 0:A.pageData)==null||D.comp,_}),(s==null?void 0:s.length)>0){let _;_=s,await la.batchAddInsofDataApi({dataList:_})}let x={};const h=await la.getInsofDataApi({key:{pageKey:a,type:"structure",systemKey:sessionStorage.getItem("systemKey")}});((ce=(he=c==null?void 0:c.data)==null?void 0:he.result)==null?void 0:ce.length)>0&&((K=(Ce=c==null?void 0:c.data)==null?void 0:Ce.result)==null||K.forEach(_=>{var A,D,b,G,re,ee,Z,J;(D=(A=_==null?void 0:_.value)==null?void 0:A.pageData)!=null&&D.name0?x[_.id]=(re=(G=(b=h==null?void 0:h.data)==null?void 0:b.result)==null?void 0:G.find(we=>{var P,Me,be,Ye,Be,ie,hr,sr;return((Me=(P=we==null?void 0:we.value)==null?void 0:P.pageData)==null?void 0:Me.name)===((Ye=(be=_==null?void 0:_.value)==null?void 0:be.pageData)==null?void 0:Ye.name)&&((ie=(Be=we==null?void 0:we.value)==null?void 0:Be.pageData)==null?void 0:ie.name0)===((sr=(hr=_==null?void 0:_.value)==null?void 0:hr.pageData)==null?void 0:sr.name0)}))==null?void 0:re.id:x[_.id]=(J=(Z=(ee=h==null?void 0:h.data)==null?void 0:ee.result)==null?void 0:Z.find(we=>{var P,Me,be,Ye;return((Me=(P=we==null?void 0:we.value)==null?void 0:P.pageData)==null?void 0:Me.name)===((Ye=(be=_==null?void 0:_.value)==null?void 0:be.pageData)==null?void 0:Ye.name)}))==null?void 0:J.id}));let d=[];(Fe=(Te=u==null?void 0:u.data)==null?void 0:Te.result)==null||Fe.forEach(_=>{var A,D,b;d.push({key:{pageKey:a,tableId:x[(A=_==null?void 0:_.key)==null?void 0:A.tableId],systemKey:(D=_==null?void 0:_.key)==null?void 0:D.systemKey,type:(b=_==null?void 0:_.key)==null?void 0:b.type},value:_==null?void 0:_.value})}),(d==null?void 0:d.length)>0&&await la.batchAddInsofDataApi({dataList:d})},co=(e,a)=>{let r=Q.cloneDeep(e);return r=r==null?void 0:r.map(t=>{var c,l,o;let i=[],s=[];for(let u in a)if(u!=null&&u.includes((l=(c=Q.cloneDeep(t))==null?void 0:c.key)==null?void 0:l.pageKey)){let x=(o=a[u])==null?void 0:o.filter(h=>{var d,p,m;return((d=h==null?void 0:h.key)==null?void 0:d.type)==="data"&&((p=h==null?void 0:h.key)==null?void 0:p.tableId)===((m=Q.cloneDeep(t))==null?void 0:m.id)});s=[...s,...x]}(s==null?void 0:s.length)>0&&(s==null||s.forEach(u=>{i.push(u.value.tableData)}));let f=Q.cloneDeep(t).value.pageData.compData;return f.push({key:"tableContents",contents:i}),t.value.pageData.compData=f,t}),r},lo=(e,a)=>{if(!(e!=null&&e.includes("[")))return e;let r=e==null?void 0:e.replaceAll("[","").replaceAll("]","").split(":"),n=a==null?void 0:a.map(i=>{var s;return(s=i==null?void 0:i.value)==null?void 0:s.pageData}),t="";return n==null||n.forEach(i=>{var s;(i==null?void 0:i.name)===(r==null?void 0:r[0])&&((s=i==null?void 0:i.compData)==null||s.forEach(f=>{var c;(f==null?void 0:f.key)==="header"&&((c=f==null?void 0:f.contents)==null||c.forEach((l,o)=>{(l==null?void 0:l.prop)===(r==null?void 0:r[1])&&(t=o)}))}))}),t},oo=(e,a)=>{if(!(e!=null&&e.includes("[")))return e;let r=e==null?void 0:e.replaceAll("[","").replaceAll("]","").split(":"),n=a==null?void 0:a.map(i=>{var s;return(s=i==null?void 0:i.value)==null?void 0:s.pageData}),t="";return n==null||n.forEach(i=>{var s;(i==null?void 0:i.name)===(r==null?void 0:r[0])&&((s=i==null?void 0:i.compData)==null||s.forEach(f=>{var c;(f==null?void 0:f.key)==="formContent"&&((c=f==null?void 0:f.contents)==null||c.forEach(l=>{(l==null?void 0:l.prop)===(r==null?void 0:r[1])&&(t=l==null?void 0:l.value)}))}))}),t},Wc=(e,a,r,n)=>{var c,l,o;let t=(c=e==null?void 0:e[0])==null?void 0:c.formMenuSelect,i=e==null?void 0:e.map(u=>{var x,h;return(h=(x=u.groupSelect)==null?void 0:x.split(":"))==null?void 0:h[1]}),s="";t==null||t.forEach((u,x)=>{(t==null?void 0:t.length)-1!==x?s=s===""?s+u:s+"/"+u:s=s+rn+u});let f=[];for(let u in a)if(u!=null&&u.includes(s)){let x=(l=a[u])==null?void 0:l.filter(h=>{var d,p;return((d=h==null?void 0:h.key)==null?void 0:d.type)==="structure"&&((p=h==null?void 0:h.key)==null?void 0:p.parentTable)===""});f=[...f,...x]}if((f==null?void 0:f.length)>0){let u=f==null?void 0:f.filter(m=>{var g,y,v;return((g=m==null?void 0:m.key)==null?void 0:g.pageKey)!==s&&((v=(y=m==null?void 0:m.value)==null?void 0:y.pageData)==null?void 0:v.comp)==="Form"}),x=f==null?void 0:f.filter(m=>{var g,y,v;return((g=m==null?void 0:m.key)==null?void 0:g.pageKey)!==s&&((v=(y=m==null?void 0:m.value)==null?void 0:y.pageData)==null?void 0:v.comp)==="Table"});x=co(Q.cloneDeep(x),a),u=[...Q.cloneDeep(u),...x],u=u==null?void 0:u.map(m=>({[m.key.pageKey]:m}));let h=0;u=u.reduce((m,g)=>(Object.keys(g).forEach(y=>{m[y]||(m[y]=[],m[y].push({index:h})),m[y].push(g[y])}),h++,m),{});let d=(o=Object.values(u))==null?void 0:o.sort((m,g)=>{var E,w;let y=(E=m==null?void 0:m.find(S=>S==null?void 0:S.index))==null?void 0:E.index,v=(w=g==null?void 0:g.find(S=>S==null?void 0:S.index))==null?void 0:w.index;return y-v});u=d==null?void 0:d.map(m=>m==null?void 0:m.filter(g=>{var y,v,E,w;return!(g!=null&&g.index)&&(g==null?void 0:g.index)!==0&&!((v=(y=g==null?void 0:g.key)==null?void 0:y.pageKey)!=null&&v.includes("updateLoading"))&&!((w=(E=g==null?void 0:g.key)==null?void 0:E.pageKey)!=null&&w.includes("loading"))}));let p=[];if(u==null||u.forEach(m=>{var v,E,w,S,T,B,I,U,L,W;const g=m==null?void 0:m.find(M=>{var se,ne,he,ce,Ce;return((ne=(se=M==null?void 0:M.value)==null?void 0:se.pageData)==null?void 0:ne.name)===((Ce=(ce=(he=e==null?void 0:e[0])==null?void 0:he.groupSelect)==null?void 0:ce.split(":"))==null?void 0:Ce[0])});let y=(T=(S=(w=(E=(v=Q.cloneDeep(g))==null?void 0:v.value)==null?void 0:E.pageData)==null?void 0:w.compData)==null?void 0:S.find(M=>(M==null?void 0:M.key)==="formContent"))==null?void 0:T.contents;if(y){let M=[];i==null||i.forEach((se,ne)=>{var Ce,K,Te,Fe,_,A;let he=m==null?void 0:m.find(D=>{var b,G,re,ee,Z;return((G=(b=D==null?void 0:D.value)==null?void 0:b.pageData)==null?void 0:G.name)===((Z=(ee=(re=e==null?void 0:e[ne])==null?void 0:re.groupSelect)==null?void 0:ee.split(":"))==null?void 0:Z[0])}),ce=(_=(Fe=(Te=(K=(Ce=Q.cloneDeep(he))==null?void 0:Ce.value)==null?void 0:K.pageData)==null?void 0:Te.compData)==null?void 0:Fe.find(D=>(D==null?void 0:D.key)==="formContent"))==null?void 0:_.contents;ce!=null&&ce.find(D=>(D==null?void 0:D.key)===se)?M.push((A=ce==null?void 0:ce.find(D=>(D==null?void 0:D.key)===se))==null?void 0:A.value):M.push("")}),p.push(M)}else y=(W=(L=(U=(I=(B=Q.cloneDeep(g))==null?void 0:B.value)==null?void 0:I.pageData)==null?void 0:U.compData)==null?void 0:L.find(M=>(M==null?void 0:M.key)==="tableContents"))==null?void 0:W.contents,y==null||y.forEach(M=>{let se=[];i==null||i.forEach(ne=>{M!=null&&M[ne]&&se.push(M==null?void 0:M[ne])}),p.push(se)})}),(r==null?void 0:r.length)>0){let m={};r==null||r.forEach(g=>{var y;for(let v in g){let E=Q.cloneDeep(v);if(!(E!=null&&E.includes("[")))(y=g[v])!=null&&y.includes("[")||(m[E]=g[v]);else{let w=oo(E,a[n]),S=lo(g[v],a[n]);m[w]=S}}});for(let g in m)p=p==null?void 0:p.filter(y=>y[m[g]]===g)}return p}},tx=(e,a,r,n)=>{var f,c,l,o,u;let t=Q.cloneDeep(e),i=a==null?void 0:a.map(x=>x==null?void 0:x.prop),s=[];for(let x in r)if(x!=null&&x.includes(t)){let h=(f=r[x])==null?void 0:f.filter(d=>{var p,m;return((p=d==null?void 0:d.key)==null?void 0:p.type)==="structure"&&((m=d==null?void 0:d.key)==null?void 0:m.parentTable)===""});s=[...s,...h]}if((s==null?void 0:s.length)>0){let x=s==null?void 0:s.filter(E=>{var w,S,T,B;return((w=E==null?void 0:E.key)==null?void 0:w.pageKey)!==t&&((T=(S=E==null?void 0:E.value)==null?void 0:S.pageData)==null?void 0:T.comp)==="Form"&&(E==null?void 0:E.key.pageKey.includes(t+rn))&&!((B=E==null?void 0:E.key.pageKey)!=null&&B.includes("@"))}),h=s==null?void 0:s.filter(E=>{var w,S,T,B;return((w=E==null?void 0:E.key)==null?void 0:w.pageKey)!==t&&((T=(S=E==null?void 0:E.value)==null?void 0:S.pageData)==null?void 0:T.comp)==="Table"&&(E==null?void 0:E.key.pageKey.includes(t+rn))&&!((B=E==null?void 0:E.key.pageKey)!=null&&B.includes("@"))});h=co(Q.cloneDeep(h),r),x=[...Q.cloneDeep(x),...h],x=x==null?void 0:x.map(E=>({[E.key.pageKey]:E}));let d=0;x=x.reduce((E,w)=>(Object.keys(w).forEach(S=>{E[S]||(E[S]=[],E[S].push({index:d})),E[S].push(w[S])}),d++,E),{}),x=to(x,!0,r);let p=(c=Object.values(x))==null?void 0:c.sort((E,w)=>{var B,I;let S=(B=E==null?void 0:E.find(U=>U==null?void 0:U.index))==null?void 0:B.index,T=(I=w==null?void 0:w.find(U=>U==null?void 0:U.index))==null?void 0:I.index;return S-T});x=p==null?void 0:p.map(E=>E==null?void 0:E.filter(w=>!(w!=null&&w.index)&&(w==null?void 0:w.index)!==0));let m=(l=Q.cloneDeep(x))==null?void 0:l.filter(E=>E==null?void 0:E.find(w=>{var S,T,B,I;return((I=(S=w==null?void 0:w.key)==null?void 0:S.pageKey)==null?void 0:I[((B=(T=w==null?void 0:w.key)==null?void 0:T.pageKey)==null?void 0:B.length)-1])===rn}));x=x==null?void 0:x.filter(E=>!(E!=null&&E.find(w=>{var S,T,B,I,U,L,W,M;return((I=(S=w==null?void 0:w.key)==null?void 0:S.pageKey)==null?void 0:I[((B=(T=w==null?void 0:w.key)==null?void 0:T.pageKey)==null?void 0:B.length)-1])===rn||((L=(U=w==null?void 0:w.key)==null?void 0:U.pageKey)==null?void 0:L.includes("updateLoading"))||((M=(W=w==null?void 0:w.key)==null?void 0:W.pageKey)==null?void 0:M.includes("loading"))})));let g=[],y=[];(o=m==null?void 0:m[0])==null||o.forEach(E=>{var w,S,T,B,I;((S=(w=E==null?void 0:E.value)==null?void 0:w.pageData)==null?void 0:S.comp)==="Form"&&((I=(B=(T=E==null?void 0:E.value)==null?void 0:T.pageData)==null?void 0:B.compData)==null||I.forEach(U=>{(U==null?void 0:U.key)==="formContent"&&(y=[...y,...U==null?void 0:U.contents])}))});let v=(u=y==null?void 0:y.find(E=>(E==null?void 0:E.isMain)===!0))==null?void 0:u.key;if(x==null||x.forEach(E=>{let w=[];E==null||E.forEach(T=>{var B,I,U,L,W;((I=(B=T==null?void 0:T.value)==null?void 0:B.pageData)==null?void 0:I.comp)==="Form"&&((W=(L=(U=T==null?void 0:T.value)==null?void 0:U.pageData)==null?void 0:L.compData)==null||W.forEach(M=>{(M==null?void 0:M.key)==="formContent"&&(w=[...w,...M==null?void 0:M.contents])}))});let S={};i==null||i.forEach(T=>{let B=w==null?void 0:w.find(I=>(I==null?void 0:I.key)===T);B!=null&&B.prop&&(S[B.prop]=(B==null?void 0:B.value)??"")}),g.push(S)}),(n==null?void 0:n.length)>0){let E=[];n==null||n.forEach(w=>{var I,U,L,W,M,se,ne,he,ce;let S={};for(let Ce in w){let K=Q.cloneDeep(Ce);if(!(K!=null&&K.includes("[")))((I=w[Ce])==null?void 0:I.toUpperCase())==="@LOGINUSER"?S[K]=((U=v0.value)==null?void 0:U.姓名)||((L=v0.value)==null?void 0:L.account)||((W=v0.value)==null?void 0:W.账号)||((M=v0.value)==null?void 0:M.姓名):(se=w[Ce])!=null&&se.includes("[")||(S[K]=w[Ce]);else{let Te=oo(K,r[e]),Fe=lo(w[Ce],r[e]);S[Te]=Fe}}let T=[],B=0;for(let Ce in S)((ne=S[Ce])==null?void 0:ne[0])!=="!"?T=(he=B>0?T:g)==null?void 0:he.filter(Te=>Te[Ce]===S[Ce]):T=(ce=B>0?T:g)==null?void 0:ce.filter(K=>{var Te;return K[Ce]!==((Te=S[Ce])==null?void 0:Te.replaceAll("!",""))}),B=1;E=[...E,...T]}),g=[...new Set(E)]}return g=g==null?void 0:g.map(E=>Object.values(E)),{mainKey:v,tableContents:g}}},nx=(e,a)=>{var t,i,s,f,c,l;let r=(i=(t=Q.cloneDeep(e))==null?void 0:t.split("/"))==null?void 0:i[0],n=[];for(let o in a)if(o!=null&&o.includes(r)){let u=(s=a[o])==null?void 0:s.filter(x=>{var h,d;return((h=x==null?void 0:x.key)==null?void 0:h.type)==="structure"&&((d=x==null?void 0:x.key)==null?void 0:d.parentTable)===""});n=[...n,...u]}return(n==null?void 0:n.length)>0?!!((l=(c=(f=n==null?void 0:n.filter(u=>{var x;return((x=u==null?void 0:u.key)==null?void 0:x.pageKey)===r}))==null?void 0:f[0])==null?void 0:c.key)==null?void 0:l.parentPageKey):!0},ix=async(e,a,r,n)=>{var s,f,c,l,o,u,x,h,d;let t=(f=(s=Q.cloneDeep(e))==null?void 0:s.split("/"))==null?void 0:f[0],i=[];for(let p in n)if(p!=null&&p.includes(t)){let m=(c=n[p])==null?void 0:c.filter(g=>{var y,v;return((y=g==null?void 0:g.key)==null?void 0:y.type)==="structure"&&((v=g==null?void 0:g.key)==null?void 0:v.parentTable)===""});i=[...i,...m]}if((i==null?void 0:i.length)>0){let p=(u=(o=(l=i==null?void 0:i.filter(y=>{var v;return((v=y==null?void 0:y.key)==null?void 0:v.pageKey)===t}))==null?void 0:l[0])==null?void 0:o.key)==null?void 0:u.parentPageKey,m=[];if(p){for(let y in n)if(y!=null&&y.includes(p)){let v=(x=n[y])==null?void 0:x.filter(E=>{var w,S;return((w=E==null?void 0:E.key)==null?void 0:w.type)==="structure"&&((S=E==null?void 0:E.key)==null?void 0:S.parentTable)===""});m=[...m,...v]}}else m=i;let g="";if((m==null?void 0:m.length)>0){let y=[],v;v=(h=m==null?void 0:m.filter(U=>{var L,W,M,se,ne,he;return((M=(W=(L=U==null?void 0:U.key)==null?void 0:L.pageKey)==null?void 0:W.split("/"))==null?void 0:M[0])===p&&((he=(ne=(se=U==null?void 0:U.key)==null?void 0:se.pageKey)==null?void 0:ne.split("/"))==null?void 0:he.length)===2}))==null?void 0:h.map(U=>{var L;return(L=U==null?void 0:U.key)==null?void 0:L.pageKey}),v=[...new Set(v)],v=v==null?void 0:v.filter(U=>!U.includes(rn));let E=(d=Q.cloneDeep(v))==null?void 0:d.map(async U=>{var ne,he,ce,Ce,K,Te,Fe,_,A,D,b,G,re,ee,Z;let L=await wn(U,sessionStorage.getItem("systemKey"),"",!1,[],!1,n),W=(Ce=(ce=(he=(ne=Q.cloneDeep(L))==null?void 0:ne[0])==null?void 0:he.compData)==null?void 0:ce.find(J=>(J==null?void 0:J.key)==="tableContents"))==null?void 0:Ce.contents,M=(D=(A=(_=(Fe=(Te=(K=Q.cloneDeep(L))==null?void 0:K[0])==null?void 0:Te.compData)==null?void 0:Fe.find(J=>(J==null?void 0:J.key)==="header"))==null?void 0:_.contents)==null?void 0:A.filter(J=>(J==null?void 0:J.label)!=="操作"))==null?void 0:D.map(J=>J==null?void 0:J.prop),se=[];return(Z=(ee=(re=(G=(b=Q.cloneDeep(L))==null?void 0:b[0])==null?void 0:G.compData)==null?void 0:re.find(J=>(J==null?void 0:J.key)==="header"))==null?void 0:ee.contents)==null||Z.forEach(J=>{(J==null?void 0:J.isMainKey)===!0&&(g=J==null?void 0:J.prop)}),W==null||W.forEach(J=>{let we=m0(J,M);se.push(we),y.push({key:we==null?void 0:we[g],routerContent:U})}),se}),w=await Promise.all(E),S=[];w==null||w.forEach(U=>{(U==null?void 0:U.length)>0&&(U==null||U.forEach(L=>{S.push(L)}))});let T=[];T=a==null?void 0:a.map(U=>{var W,M,se;let L={};for(let ne in U)U[ne].toUpperCase()==="@LOGINUSER"?L[ne]=((W=v0.value)==null?void 0:W.姓名)||((M=v0.value)==null?void 0:M.account)||((se=v0.value)==null?void 0:se.账号):L[ne]=U[ne];return L});let B=[];S==null||S.forEach(U=>{let L=[];T==null||T.forEach(W=>{let M=[];for(let se in W)M.push(U[se]===W[se]);L.push(M)}),L.find(W=>W==null?void 0:W.every(M=>M===!0))&&B.push(U)});let I=[];return B==null||B.forEach(U=>{let L={};r==null||r.forEach(W=>{L[W.prop]=U[W.prop]??""}),I.push(L)}),I=I==null?void 0:I.map(U=>Object.values(U)),{mainKey:g,tableContents:I,mainKeys:y}}else return}else return},sx=async(e,a,r,n)=>{var i,s,f,c;let t=(i=Q.cloneDeep(e))==null?void 0:i.filter(l=>(l==null?void 0:l.label)!=="操作");if((r==null?void 0:r.length)>0&&(t!=null&&t.every(l=>!(l!=null&&l.formMenuSelect)))&&nx(a,n)){let l=await ix(a,r,t,n);return l&&((s=l==null?void 0:l.tableContents)==null?void 0:s.length)>0?l:[]}if(!(t!=null&&t.every(l=>{var o,u,x,h;return((o=l==null?void 0:l.formMenuSelect)==null?void 0:o.length)>0&&((x=(u=l==null?void 0:l.groupSelect)==null?void 0:u.split(":"))==null?void 0:x.length)>0||((h=l==null?void 0:l.formMenuGroup)==null?void 0:h.length)>0})))return tx(a,t,n,r);if(t!=null&&t.every(l=>!(l!=null&&l.formMenuGroup)))return Wc(t,n,r,a);{let l=[];(c=(f=t==null?void 0:t[0])==null?void 0:f.formMenuGroup)==null||c.forEach((h,d)=>{let p=[];t==null||t.forEach(m=>{var g,y,v,E,w,S;p.push({columnPath:m==null?void 0:m.columnPath,formMenuSelect:(v=((g=m==null?void 0:m.formMenuGroup)==null?void 0:g[d])??((y=m==null?void 0:m.formMenuGroup)==null?void 0:y[0]))==null?void 0:v.formMenuSelect,groupSelect:(S=((E=m==null?void 0:m.formMenuGroup)==null?void 0:E[d])??((w=m==null?void 0:m.formMenuGroup)==null?void 0:w[0]))==null?void 0:S.groupSelect,isRoute:m==null?void 0:m.isRoute,label:m==null?void 0:m.label,prop:m==null?void 0:m.label})}),l.push(p)});let o=[],x=l==null?void 0:l.map(async h=>Wc(h,n,r,a));return x==null||x.forEach(h=>{h==null||h.forEach(d=>{o.push(d)})}),o}},fx=l0(Ae.pinia),{originalPath:uo}=Ae.storeToRefs(fx),cx=Q.useUnit(Ae.pinia),{chooseTitle:Wn}=Ae.storeToRefs(cx),lx=Q.useMenuState(Ae.pinia),{activeMenuPath:ef}=Ae.storeToRefs(lx),Mf=async()=>void 0,ox=e=>{var n,t,i;const a=(t=(n=e==null?void 0:e.compData)==null?void 0:n.find(s=>(s==null?void 0:s.key)==="header"))==null?void 0:t.contents;return{label:e==null?void 0:e.name,value:e==null?void 0:e.name,children:a!=null&&a.every(s=>!Array.isArray(s))?a==null?void 0:a.map(s=>({label:s==null?void 0:s.label,value:s==null?void 0:s.label})):(i=_n(a==null?void 0:a[0]))==null?void 0:i.map(s=>({label:s==null?void 0:s.label,value:s==null?void 0:s.label}))}},ho=async(e,a)=>{var i,s,f,c,l,o,u,x;let r="";(i=Q.cloneDeep(e))==null||i.forEach(h=>{var d;h!=null&&h.includes(":")?(d=h==null?void 0:h.split(":"))==null||d.forEach(p=>{r=r===""?r+p:r+"/"+p}):r=r===""?r+h:r+"/"+h}),(r===""||ef.value===r)&&((f=(s=Wn==null?void 0:Wn.value)==null?void 0:s[0])!=null&&f.value?r=ef.value+"/"+((l=(c=Wn==null?void 0:Wn.value)==null?void 0:c[0])==null?void 0:l.value):r=ef.value);let n="";(o=Q.cloneDeep(e))==null||o.forEach((h,d)=>{d!==(e==null?void 0:e.length)-1?n=n===""?n+h:n+"/"+h:n=h===""?n:n+uo.value+h}),(r==null?void 0:r[(r==null?void 0:r.length)-1])==="/"&&(r=r+((x=(u=Wn==null?void 0:Wn.value)==null?void 0:u[0])==null?void 0:x.value));const t=await wn(r,sessionStorage.getItem("systemKey"),"",!1,[],!1,void 0);return t||await wn(n,sessionStorage.getItem("systemKey"),"",!1,[],!1,void 0)},ux=e=>e.entries().next().done,hx=async e=>{var n,t,i;const a=await ho(e);let r=[];return((n=a==null?void 0:a.data)==null?void 0:n.type)==="success"&&(r=(i=(t=a.data.result)==null?void 0:t.map(s=>s.value.pageData))==null?void 0:i.filter(s=>(s==null?void 0:s.comp)==="Table"),r=r==null?void 0:r.map(s=>ox(s))),r},xx=[{key:"单选",value:"Select"},{key:"日期",value:"Date"},{key:"长文本",value:"TextArea"},{key:"上传",value:"Upload"},{key:"富文本",value:"Quill"}],b0=[{label:"输入框",value:"Input"},{label:"下拉框",value:"Select"},{label:"日期选择器",value:"Date"},{label:"长文本",value:"TextArea"},{label:"附件选择器",value:"Upload"},{label:"富文本",value:"Quill"},{label:"链接跳转",value:"Link"}],dx=[{key:"label",label:"标签名",type:"Input"},{key:"prop",label:"属性名",type:"Input"},{key:"type",label:"类型",type:"Select",options:b0},{key:"originalContent",label:"初始值",type:"Input"},{key:"value",label:"固定值",type:"Input"},{key:"isFormColHidden",label:"是否隐藏",name:"是否隐藏",type:"radio",options:[{label:"否",value:!1},{label:"是",value:!0}],value:!1}],px=async()=>{const e=await Mf();return[{key:"label",label:"标签名",type:"Input"},{key:"prop",label:"属性名",type:"Input"},{key:"type",label:"类型",type:"Select",options:b0},{key:"multiple",label:"多选",default:!1,type:"Switch"},{key:"originalContent",label:"初始值",type:"Select"},{key:"selectRelateType",label:"下拉绑定类型",type:"Select",options:[{label:"关联绑定列",value:"关联绑定列"},{label:"自定义绑定",value:"自定义绑定"}]},{key:"menuSelect",label:"菜单选项",type:"cascader",options:e},{key:"groupSelect",label:"组信息选项",type:"cascader",options:[]},{key:"contents",label:"选项值",type:"Input"}]},mx=async()=>[{value:"",id:"v1",label:"菜单选项",name:"菜单选项",type:"cascader",contents:await Mf()},{value:"",id:"v2",label:"组信息选项",name:"组信息选项",type:"cascader",contents:[]},{value:"",id:"v2",label:"选项值",name:"选项值",type:"Input",contents:[]}],gx=zr.computed(async()=>await px()),vx=[{key:"label",label:"标签名",type:"Input"},{key:"prop",label:"属性名",type:"Input"},{key:"type",label:"类型",type:"Select",options:b0},{key:"originalContent",label:"初始值",type:"Date"},{key:"isNewDate",label:"当前时间",type:"Switch",value:!1}],_x=[{key:"label",label:"标签名",type:"Input"},{key:"prop",label:"属性名",type:"Input"},{key:"type",label:"类型",type:"Select",options:b0},{key:"value",label:"固定值",type:"Input"}],yx=[{key:"label",label:"标签名",type:"Input"},{key:"prop",label:"属性名",type:"Input"},{key:"type",label:"类型",type:"Select",options:b0},{key:"originalContent",label:"初始值",type:"Input"}],Hc=[{key:"label",label:"标签名",type:"Input"},{key:"prop",label:"属性名",type:"Input"},{key:"type",label:"类型",type:"Select",options:b0}],kx=[{key:"label",label:"标签名",type:"Input"},{key:"prop",label:"属性名",type:"Input"},{key:"type",label:"类型",type:"Select",options:b0}],Ex=[{key:"Input",value:dx},{key:"Select",value:gx},{key:"Date",value:vx},{key:"TextArea",value:yx},{key:"Upload",value:Hc},{key:"DragUpload",value:Hc},{key:"Quill",value:kx},{key:"Link",value:_x}],Tx=[{value:"normal",label:"自定义"},{value:"add",label:"新增"},{value:"fix",label:"修改"},{value:"view",label:"查看"},{value:"delete",label:"删除"}],wx=[{key:"label",label:"按钮名",type:"Input"},{key:"type",label:"类型",type:"Select",options:Tx},{key:"background",label:"颜色",type:"Color"}],Sx=e=>{var r,n,t,i,s,f,c,l;let a=Q.cloneDeep(e);if(((r=a==null?void 0:a.find(o=>(o==null?void 0:o.name)==="类型"))==null?void 0:r.type)==="Select"&&((i=(t=(n=Q.cloneDeep(a))==null?void 0:n.find(o=>(o==null?void 0:o.name)==="选项值"))==null?void 0:t.value)==null?void 0:i.length)>0){const o=(l=(c=(f=(s=Q.cloneDeep(a))==null?void 0:s.find(u=>(u==null?void 0:u.name)==="选项值"))==null?void 0:f.value)==null?void 0:c.split(","))==null?void 0:l.map(u=>({label:u,value:u}));a=a==null?void 0:a.map(u=>((u==null?void 0:u.name)==="初始值"&&(u.contents=o,u.value=(u==null?void 0:u.value)??""),u))}return a},Ax=async e=>{var i,s,f,c;let a=Q.cloneDeep(e);const r=(i=e==null?void 0:e.find(l=>(l==null?void 0:l.name)==="下拉绑定类型"))==null?void 0:i.value,n=(s=e==null?void 0:e.find(l=>(l==null?void 0:l.name)==="类型"))==null?void 0:s.value,t=await mx();return n==="Select"&&r===""?a=a==null?void 0:a.filter(l=>(l==null?void 0:l.name)!=="菜单选项"&&(l==null?void 0:l.name)!=="组信息选项"&&(l==null?void 0:l.name)!=="选项值"):n==="Select"&&r==="关联绑定列"?a!=null&&a.find(l=>(l==null?void 0:l.name)==="菜单选项"||(l==null?void 0:l.name)==="组信息选项")?a=(f=Q.cloneDeep(a))==null?void 0:f.filter(l=>(l==null?void 0:l.name)!=="选项值"):a=[...Q.cloneDeep(a),...t].filter(l=>(l==null?void 0:l.name)!=="选项值"):n==="Select"&&r==="自定义绑定"&&(a!=null&&a.find(l=>(l==null?void 0:l.name)==="选项值")?a=(c=Q.cloneDeep(a))==null?void 0:c.filter(l=>(l==null?void 0:l.name)!=="菜单选项"&&(l==null?void 0:l.name)!=="组信息选项"):a=[...Q.cloneDeep(a),...t].filter(l=>(l==null?void 0:l.name)!=="菜单选项"&&(l==null?void 0:l.name)!=="组信息选项")),a},Fx=(e,a)=>{var n;let r=!1;return(n=Q.cloneDeep(e))==null||n.forEach(t=>{var i;(t==null?void 0:t.key)==="formContent"&&((i=t==null?void 0:t.contents)==null||i.forEach(s=>{(s==null?void 0:s.key)===a?r=!0:r=r}))}),r},xo=(e,a)=>{var s,f,c,l,o;const r=Q.cloneDeep(e);if(!r)return;let n="";(f=(s=Q.cloneDeep(r))==null?void 0:s.menuSelect)==null||f.forEach(u=>{u!=null&&u.includes("[")?n=n+uo.value:n=n===""?n+u:n+"/"+u});const t=(c=a==null?void 0:a[n])==null?void 0:c.map(u=>{var x;return(x=u==null?void 0:u.value)==null?void 0:x.pageData});let i=t==null?void 0:t.filter(u=>{var x,h;return(u==null?void 0:u.name)===((h=(x=Q.cloneDeep(r))==null?void 0:x.groupSelect)==null?void 0:h[0])});if((i==null?void 0:i.length)===1?i=i==null?void 0:i[0]:(l=Q.cloneDeep(i))==null||l.forEach(u=>{var x,h;(u==null?void 0:u.comp)==="Form"&&Fx(u==null?void 0:u.compData,(h=(x=Q.cloneDeep(r))==null?void 0:x.groupSelect)==null?void 0:h[1])&&(i=u)}),(i==null?void 0:i.comp)==="Form"){let u="";return(o=i==null?void 0:i.compData)==null||o.forEach(x=>{var h;(x==null?void 0:x.key)==="formContent"&&((h=x==null?void 0:x.contents)==null||h.forEach(d=>{var p,m;(d==null?void 0:d.key)===((m=(p=Q.cloneDeep(r))==null?void 0:p.groupSelect)==null?void 0:m[1])&&(d.type==="Select"&&!(d!=null&&d.value)?u=void 0:u=d==null?void 0:d.value)}))}),u}};/*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */var Fs={};Fs.version="0.18.5";var po=1252,Dx=[874,932,936,949,950,1250,1251,1252,1253,1254,1255,1256,1257,1258,1e4],Lf={0:1252,1:65001,2:65001,77:1e4,128:932,129:949,130:1361,134:936,136:950,161:1253,162:1254,163:1258,177:1255,178:1256,186:1257,204:1251,222:874,238:1250,255:1252,69:6969},Bf=function(e){Dx.indexOf(e)!=-1&&(po=Lf[0]=e)};function Ix(){Bf(1252)}var yn=function(e){Bf(e)};function Uf(){yn(1200),Ix()}function Gc(e){for(var a=[],r=0,n=e.length;r<n;++r)a[r]=e.charCodeAt(r);return a}function bx(e){for(var a=[],r=0;r<e.length>>1;++r)a[r]=String.fromCharCode(e.charCodeAt(2*r)+(e.charCodeAt(2*r+1)<<8));return a.join("")}function mo(e){for(var a=[],r=0;r<e.length>>1;++r)a[r]=String.fromCharCode(e.charCodeAt(2*r+1)+(e.charCodeAt(2*r)<<8));return a.join("")}var Ii=function(e){var a=e.charCodeAt(0),r=e.charCodeAt(1);return a==255&&r==254?bx(e.slice(2)):a==254&&r==255?mo(e.slice(2)):a==65279?e.slice(1):e},hs=function(a){return String.fromCharCode(a)},Xc=function(a){return String.fromCharCode(a)},Ef,t0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function Hi(e){for(var a="",r=0,n=0,t=0,i=0,s=0,f=0,c=0,l=0;l<e.length;)r=e.charCodeAt(l++),i=r>>2,n=e.charCodeAt(l++),s=(r&3)<<4|n>>4,t=e.charCodeAt(l++),f=(n&15)<<2|t>>6,c=t&63,isNaN(n)?f=c=64:isNaN(t)&&(c=64),a+=t0.charAt(i)+t0.charAt(s)+t0.charAt(f)+t0.charAt(c);return a}function Kt(e){var a="",r=0,n=0,t=0,i=0,s=0,f=0,c=0;e=e.replace(/[^\w\+\/\=]/g,"");for(var l=0;l<e.length;)i=t0.indexOf(e.charAt(l++)),s=t0.indexOf(e.charAt(l++)),r=i<<2|s>>4,a+=String.fromCharCode(r),f=t0.indexOf(e.charAt(l++)),n=(s&15)<<4|f>>2,f!==64&&(a+=String.fromCharCode(n)),c=t0.indexOf(e.charAt(l++)),t=(f&3)<<6|c,c!==64&&(a+=String.fromCharCode(t));return a}var kr=function(){return typeof Buffer<"u"&&typeof process<"u"&&typeof process.versions<"u"&&!!process.versions.node}(),zn=function(){if(typeof Buffer<"u"){var e=!Buffer.from;if(!e)try{Buffer.from("foo","utf8")}catch{e=!0}return e?function(a,r){return r?new Buffer(a,r):new Buffer(a)}:Buffer.from.bind(Buffer)}return function(){}}();function i0(e){return kr?Buffer.alloc?Buffer.alloc(e):new Buffer(e):typeof Uint8Array<"u"?new Uint8Array(e):new Array(e)}function $c(e){return kr?Buffer.allocUnsafe?Buffer.allocUnsafe(e):new Buffer(e):typeof Uint8Array<"u"?new Uint8Array(e):new Array(e)}var Gt=function(a){return kr?zn(a,"binary"):a.split("").map(function(r){return r.charCodeAt(0)&255})};function Hs(e){if(typeof ArrayBuffer>"u")return Gt(e);for(var a=new ArrayBuffer(e.length),r=new Uint8Array(a),n=0;n!=e.length;++n)r[n]=e.charCodeAt(n)&255;return a}function o0(e){if(Array.isArray(e))return e.map(function(n){return String.fromCharCode(n)}).join("");for(var a=[],r=0;r<e.length;++r)a[r]=String.fromCharCode(e[r]);return a.join("")}function Cx(e){if(typeof Uint8Array>"u")throw new Error("Unsupported");return new Uint8Array(e)}function Wf(e){if(typeof ArrayBuffer>"u")throw new Error("Unsupported");if(e instanceof ArrayBuffer)return Wf(new Uint8Array(e));for(var a=new Array(e.length),r=0;r<e.length;++r)a[r]=e[r];return a}var Ja=kr?function(e){return Buffer.concat(e.map(function(a){return Buffer.isBuffer(a)?a:zn(a)}))}:function(e){if(typeof Uint8Array<"u"){var a=0,r=0;for(a=0;a<e.length;++a)r+=e[a].length;var n=new Uint8Array(r),t=0;for(a=0,r=0;a<e.length;r+=t,++a)if(t=e[a].length,e[a]instanceof Uint8Array)n.set(e[a],r);else{if(typeof e[a]=="string")throw"wtf";n.set(new Uint8Array(e[a]),r)}return n}return[].concat.apply([],e.map(function(i){return Array.isArray(i)?i:[].slice.call(i)}))};function Ox(e){for(var a=[],r=0,n=e.length+250,t=i0(e.length+255),i=0;i<e.length;++i){var s=e.charCodeAt(i);if(s<128)t[r++]=s;else if(s<2048)t[r++]=192|s>>6&31,t[r++]=128|s&63;else if(s>=55296&&s<57344){s=(s&1023)+64;var f=e.charCodeAt(++i)&1023;t[r++]=240|s>>8&7,t[r++]=128|s>>2&63,t[r++]=128|f>>6&15|(s&3)<<4,t[r++]=128|f&63}else t[r++]=224|s>>12&15,t[r++]=128|s>>6&63,t[r++]=128|s&63;r>n&&(a.push(t.slice(0,r)),r=0,t=i0(65535),n=65530)}return a.push(t.slice(0,r)),Ja(a)}var Tt=/\u0000/g,bi=/[\u0001-\u0006]/g;function J0(e){for(var a="",r=e.length-1;r>=0;)a+=e.charAt(r--);return a}function kn(e,a){var r=""+e;return r.length>=a?r:Aa("0",a-r.length)+r}function Hf(e,a){var r=""+e;return r.length>=a?r:Aa(" ",a-r.length)+r}function Ds(e,a){var r=""+e;return r.length>=a?r:r+Aa(" ",a-r.length)}function Rx(e,a){var r=""+Math.round(e);return r.length>=a?r:Aa("0",a-r.length)+r}function Nx(e,a){var r=""+e;return r.length>=a?r:Aa("0",a-r.length)+r}var Kc=Math.pow(2,32);function G0(e,a){if(e>Kc||e<-Kc)return Rx(e,a);var r=Math.round(e);return Nx(r,a)}function Is(e,a){return a=a||0,e.length>=7+a&&(e.charCodeAt(a)|32)===103&&(e.charCodeAt(a+1)|32)===101&&(e.charCodeAt(a+2)|32)===110&&(e.charCodeAt(a+3)|32)===101&&(e.charCodeAt(a+4)|32)===114&&(e.charCodeAt(a+5)|32)===97&&(e.charCodeAt(a+6)|32)===108}var zc=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],rf=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]];function Px(e){return e||(e={}),e[0]="General",e[1]="0",e[2]="0.00",e[3]="#,##0",e[4]="#,##0.00",e[9]="0%",e[10]="0.00%",e[11]="0.00E+00",e[12]="# ?/?",e[13]="# ??/??",e[14]="m/d/yy",e[15]="d-mmm-yy",e[16]="d-mmm",e[17]="mmm-yy",e[18]="h:mm AM/PM",e[19]="h:mm:ss AM/PM",e[20]="h:mm",e[21]="h:mm:ss",e[22]="m/d/yy h:mm",e[37]="#,##0 ;(#,##0)",e[38]="#,##0 ;[Red](#,##0)",e[39]="#,##0.00;(#,##0.00)",e[40]="#,##0.00;[Red](#,##0.00)",e[45]="mm:ss",e[46]="[h]:mm:ss",e[47]="mmss.0",e[48]="##0.0E+0",e[49]="@",e[56]='"上午/下午 "hh"時"mm"分"ss"秒 "',e}var tr={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"m/d/yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@",56:'"上午/下午 "hh"時"mm"分"ss"秒 "'},Vc={5:37,6:38,7:39,8:40,23:0,24:0,25:0,26:0,27:14,28:14,29:14,30:14,31:14,50:14,51:14,52:14,53:14,54:14,55:14,56:14,57:14,58:14,59:1,60:2,61:3,62:4,67:9,68:10,69:12,70:13,71:14,72:14,73:15,74:16,75:17,76:20,77:21,78:22,79:45,80:46,81:47,82:0},Mx={5:'"$"#,##0_);\\("$"#,##0\\)',63:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',41:'_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)'};function bs(e,a,r){for(var n=e<0?-1:1,t=e*n,i=0,s=1,f=0,c=1,l=0,o=0,u=Math.floor(t);l<a&&(u=Math.floor(t),f=u*s+i,o=u*l+c,!(t-u<5e-8));)t=1/(t-u),i=s,s=f,c=l,l=o;if(o>a&&(l>a?(o=c,f=i):(o=l,f=s)),!r)return[0,n*f,o];var x=Math.floor(n*f/o);return[x,n*f-x*o,o]}function _0(e,a,r){if(e>2958465||e<0)return null;var n=e|0,t=Math.floor(86400*(e-n)),i=0,s=[],f={D:n,T:t,u:86400*(e-n)-t,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(Math.abs(f.u)<1e-6&&(f.u=0),a&&a.date1904&&(n+=1462),f.u>.9999&&(f.u=0,++t==86400&&(f.T=t=0,++n,++f.D)),n===60)s=r?[1317,10,29]:[1900,2,29],i=3;else if(n===0)s=r?[1317,8,29]:[1900,1,0],i=6;else{n>60&&--n;var c=new Date(1900,0,1);c.setDate(c.getDate()+n-1),s=[c.getFullYear(),c.getMonth()+1,c.getDate()],i=c.getDay(),n<60&&(i=(i+6)%7),r&&(i=Gx(c,s))}return f.y=s[0],f.m=s[1],f.d=s[2],f.S=t%60,t=Math.floor(t/60),f.M=t%60,t=Math.floor(t/60),f.H=t,f.q=i,f}var go=new Date(1899,11,31,0,0,0),Lx=go.getTime(),Bx=new Date(1900,2,1,0,0,0);function vo(e,a){var r=e.getTime();return a?r-=1461*24*60*60*1e3:e>=Bx&&(r+=24*60*60*1e3),(r-(Lx+(e.getTimezoneOffset()-go.getTimezoneOffset())*6e4))/(24*60*60*1e3)}function Gf(e){return e.indexOf(".")==-1?e:e.replace(/(?:\.0*|(\.\d*[1-9])0+)$/,"$1")}function Ux(e){return e.indexOf("E")==-1?e:e.replace(/(?:\.0*|(\.\d*[1-9])0+)[Ee]/,"$1E").replace(/(E[+-])(\d)$/,"$10$2")}function Wx(e){var a=e<0?12:11,r=Gf(e.toFixed(12));return r.length<=a||(r=e.toPrecision(10),r.length<=a)?r:e.toExponential(5)}function Hx(e){var a=Gf(e.toFixed(11));return a.length>(e<0?12:11)||a==="0"||a==="-0"?e.toPrecision(6):a}function Gi(e){var a=Math.floor(Math.log(Math.abs(e))*Math.LOG10E),r;return a>=-4&&a<=-1?r=e.toPrecision(10+a):Math.abs(a)<=9?r=Wx(e):a===10?r=e.toFixed(10).substr(0,12):r=Hx(e),Gf(Ux(r.toUpperCase()))}function w0(e,a){switch(typeof e){case"string":return e;case"boolean":return e?"TRUE":"FALSE";case"number":return(e|0)===e?e.toString(10):Gi(e);case"undefined":return"";case"object":if(e==null)return"";if(e instanceof Date)return tn(14,vo(e,a&&a.date1904),a)}throw new Error("unsupported value in General format: "+e)}function Gx(e,a){a[0]-=581;var r=e.getDay();return e<60&&(r=(r+6)%7),r}function Xx(e,a,r,n){var t="",i=0,s=0,f=r.y,c,l=0;switch(e){case 98:f=r.y+543;case 121:switch(a.length){case 1:case 2:c=f%100,l=2;break;default:c=f%1e4,l=4;break}break;case 109:switch(a.length){case 1:case 2:c=r.m,l=a.length;break;case 3:return rf[r.m-1][1];case 5:return rf[r.m-1][0];default:return rf[r.m-1][2]}break;case 100:switch(a.length){case 1:case 2:c=r.d,l=a.length;break;case 3:return zc[r.q][0];default:return zc[r.q][1]}break;case 104:switch(a.length){case 1:case 2:c=1+(r.H+11)%12,l=a.length;break;default:throw"bad hour format: "+a}break;case 72:switch(a.length){case 1:case 2:c=r.H,l=a.length;break;default:throw"bad hour format: "+a}break;case 77:switch(a.length){case 1:case 2:c=r.M,l=a.length;break;default:throw"bad minute format: "+a}break;case 115:if(a!="s"&&a!="ss"&&a!=".0"&&a!=".00"&&a!=".000")throw"bad second format: "+a;return r.u===0&&(a=="s"||a=="ss")?kn(r.S,a.length):(n>=2?s=n===3?1e3:100:s=n===1?10:1,i=Math.round(s*(r.S+r.u)),i>=60*s&&(i=0),a==="s"?i===0?"0":""+i/s:(t=kn(i,2+n),a==="ss"?t.substr(0,2):"."+t.substr(2,a.length-1)));case 90:switch(a){case"[h]":case"[hh]":c=r.D*24+r.H;break;case"[m]":case"[mm]":c=(r.D*24+r.H)*60+r.M;break;case"[s]":case"[ss]":c=((r.D*24+r.H)*60+r.M)*60+Math.round(r.S+r.u);break;default:throw"bad abstime format: "+a}l=a.length===3?1:2;break;case 101:c=f,l=1;break}var o=l>0?kn(c,l):"";return o}function n0(e){var a=3;if(e.length<=a)return e;for(var r=e.length%a,n=e.substr(0,r);r!=e.length;r+=a)n+=(n.length>0?",":"")+e.substr(r,a);return n}var _o=/%/g;function $x(e,a,r){var n=a.replace(_o,""),t=a.length-n.length;return Gn(e,n,r*Math.pow(10,2*t))+Aa("%",t)}function Kx(e,a,r){for(var n=a.length-1;a.charCodeAt(n-1)===44;)--n;return Gn(e,a.substr(0,n),r/Math.pow(10,3*(a.length-n)))}function yo(e,a){var r,n=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\+0$/)){if(a==0)return"0.0E+0";if(a<0)return"-"+yo(e,-a);var t=e.indexOf(".");t===-1&&(t=e.indexOf("E"));var i=Math.floor(Math.log(a)*Math.LOG10E)%t;if(i<0&&(i+=t),r=(a/Math.pow(10,i)).toPrecision(n+1+(t+i)%t),r.indexOf("e")===-1){var s=Math.floor(Math.log(a)*Math.LOG10E);for(r.indexOf(".")===-1?r=r.charAt(0)+"."+r.substr(1)+"E+"+(s-r.length+i):r+="E+"+(s-i);r.substr(0,2)==="0.";)r=r.charAt(0)+r.substr(2,t)+"."+r.substr(2+t),r=r.replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(f,c,l,o){return c+l+o.substr(0,(t+i)%t)+"."+o.substr(i)+"E"})}else r=a.toExponential(n);return e.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),e.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}var ko=/# (\?+)( ?)\/( ?)(\d+)/;function zx(e,a,r){var n=parseInt(e[4],10),t=Math.round(a*n),i=Math.floor(t/n),s=t-i*n,f=n;return r+(i===0?"":""+i)+" "+(s===0?Aa(" ",e[1].length+1+e[4].length):Hf(s,e[1].length)+e[2]+"/"+e[3]+kn(f,e[4].length))}function Vx(e,a,r){return r+(a===0?"":""+a)+Aa(" ",e[1].length+2+e[4].length)}var Eo=/^#*0*\.([0#]+)/,To=/\).*[0#]/,wo=/\(###\) ###\\?-####/;function kt(e){for(var a="",r,n=0;n!=e.length;++n)switch(r=e.charCodeAt(n)){case 35:break;case 63:a+=" ";break;case 48:a+="0";break;default:a+=String.fromCharCode(r)}return a}function jc(e,a){var r=Math.pow(10,a);return""+Math.round(e*r)/r}function Yc(e,a){var r=e-Math.floor(e),n=Math.pow(10,a);return a<(""+Math.round(r*n)).length?0:Math.round(r*n)}function jx(e,a){return a<(""+Math.round((e-Math.floor(e))*Math.pow(10,a))).length?1:0}function Yx(e){return e<2147483647&&e>-2147483648?""+(e>=0?e|0:e-1|0):""+Math.floor(e)}function Jt(e,a,r){if(e.charCodeAt(0)===40&&!a.match(To)){var n=a.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return r>=0?Jt("n",n,r):"("+Jt("n",n,-r)+")"}if(a.charCodeAt(a.length-1)===44)return Kx(e,a,r);if(a.indexOf("%")!==-1)return $x(e,a,r);if(a.indexOf("E")!==-1)return yo(a,r);if(a.charCodeAt(0)===36)return"$"+Jt(e,a.substr(a.charAt(1)==" "?2:1),r);var t,i,s,f,c=Math.abs(r),l=r<0?"-":"";if(a.match(/^00+$/))return l+G0(c,a.length);if(a.match(/^[#?]+$/))return t=G0(r,0),t==="0"&&(t=""),t.length>a.length?t:kt(a.substr(0,a.length-t.length))+t;if(i=a.match(ko))return zx(i,c,l);if(a.match(/^#+0+$/))return l+G0(c,a.length-a.indexOf("0"));if(i=a.match(Eo))return t=jc(r,i[1].length).replace(/^([^\.]+)$/,"$1."+kt(i[1])).replace(/\.$/,"."+kt(i[1])).replace(/\.(\d*)$/,function(d,p){return"."+p+Aa("0",kt(i[1]).length-p.length)}),a.indexOf("0.")!==-1?t:t.replace(/^0\./,".");if(a=a.replace(/^#+([0.])/,"$1"),i=a.match(/^(0*)\.(#*)$/))return l+jc(c,i[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,i[1].length?"0.":".");if(i=a.match(/^#{1,3},##0(\.?)$/))return l+n0(G0(c,0));if(i=a.match(/^#,##0\.([#0]*0)$/))return r<0?"-"+Jt(e,a,-r):n0(""+(Math.floor(r)+jx(r,i[1].length)))+"."+kn(Yc(r,i[1].length),i[1].length);if(i=a.match(/^#,#*,#0/))return Jt(e,a.replace(/^#,#*,/,""),r);if(i=a.match(/^([0#]+)(\\?-([0#]+))+$/))return t=J0(Jt(e,a.replace(/[\\-]/g,""),r)),s=0,J0(J0(a.replace(/\\/g,"")).replace(/[0#]/g,function(d){return s<t.length?t.charAt(s++):d==="0"?"0":""}));if(a.match(wo))return t=Jt(e,"##########",r),"("+t.substr(0,3)+") "+t.substr(3,3)+"-"+t.substr(6);var o="";if(i=a.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return s=Math.min(i[4].length,7),f=bs(c,Math.pow(10,s)-1,!1),t=""+l,o=Gn("n",i[1],f[1]),o.charAt(o.length-1)==" "&&(o=o.substr(0,o.length-1)+"0"),t+=o+i[2]+"/"+i[3],o=Ds(f[2],s),o.length<i[4].length&&(o=kt(i[4].substr(i[4].length-o.length))+o),t+=o,t;if(i=a.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return s=Math.min(Math.max(i[1].length,i[4].length),7),f=bs(c,Math.pow(10,s)-1,!0),l+(f[0]||(f[1]?"":"0"))+" "+(f[1]?Hf(f[1],s)+i[2]+"/"+i[3]+Ds(f[2],s):Aa(" ",2*s+1+i[2].length+i[3].length));if(i=a.match(/^[#0?]+$/))return t=G0(r,0),a.length<=t.length?t:kt(a.substr(0,a.length-t.length))+t;if(i=a.match(/^([#0?]+)\.([#0]+)$/)){t=""+r.toFixed(Math.min(i[2].length,10)).replace(/([^0])0+$/,"$1"),s=t.indexOf(".");var u=a.indexOf(".")-s,x=a.length-t.length-u;return kt(a.substr(0,u)+t+a.substr(a.length-x))}if(i=a.match(/^00,000\.([#0]*0)$/))return s=Yc(r,i[1].length),r<0?"-"+Jt(e,a,-r):n0(Yx(r)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(d){return"00,"+(d.length<3?kn(0,3-d.length):"")+d})+"."+kn(s,i[1].length);switch(a){case"###,##0.00":return Jt(e,"#,##0.00",r);case"###,###":case"##,###":case"#,###":var h=n0(G0(c,0));return h!=="0"?l+h:"";case"###,###.00":return Jt(e,"###,##0.00",r).replace(/^0\./,".");case"#,###.00":return Jt(e,"#,##0.00",r).replace(/^0\./,".")}throw new Error("unsupported format |"+a+"|")}function Jx(e,a,r){for(var n=a.length-1;a.charCodeAt(n-1)===44;)--n;return Gn(e,a.substr(0,n),r/Math.pow(10,3*(a.length-n)))}function qx(e,a,r){var n=a.replace(_o,""),t=a.length-n.length;return Gn(e,n,r*Math.pow(10,2*t))+Aa("%",t)}function So(e,a){var r,n=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\+0$/)){if(a==0)return"0.0E+0";if(a<0)return"-"+So(e,-a);var t=e.indexOf(".");t===-1&&(t=e.indexOf("E"));var i=Math.floor(Math.log(a)*Math.LOG10E)%t;if(i<0&&(i+=t),r=(a/Math.pow(10,i)).toPrecision(n+1+(t+i)%t),!r.match(/[Ee]/)){var s=Math.floor(Math.log(a)*Math.LOG10E);r.indexOf(".")===-1?r=r.charAt(0)+"."+r.substr(1)+"E+"+(s-r.length+i):r+="E+"+(s-i),r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(f,c,l,o){return c+l+o.substr(0,(t+i)%t)+"."+o.substr(i)+"E"})}else r=a.toExponential(n);return e.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),e.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}function bn(e,a,r){if(e.charCodeAt(0)===40&&!a.match(To)){var n=a.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return r>=0?bn("n",n,r):"("+bn("n",n,-r)+")"}if(a.charCodeAt(a.length-1)===44)return Jx(e,a,r);if(a.indexOf("%")!==-1)return qx(e,a,r);if(a.indexOf("E")!==-1)return So(a,r);if(a.charCodeAt(0)===36)return"$"+bn(e,a.substr(a.charAt(1)==" "?2:1),r);var t,i,s,f,c=Math.abs(r),l=r<0?"-":"";if(a.match(/^00+$/))return l+kn(c,a.length);if(a.match(/^[#?]+$/))return t=""+r,r===0&&(t=""),t.length>a.length?t:kt(a.substr(0,a.length-t.length))+t;if(i=a.match(ko))return Vx(i,c,l);if(a.match(/^#+0+$/))return l+kn(c,a.length-a.indexOf("0"));if(i=a.match(Eo))return t=(""+r).replace(/^([^\.]+)$/,"$1."+kt(i[1])).replace(/\.$/,"."+kt(i[1])),t=t.replace(/\.(\d*)$/,function(d,p){return"."+p+Aa("0",kt(i[1]).length-p.length)}),a.indexOf("0.")!==-1?t:t.replace(/^0\./,".");if(a=a.replace(/^#+([0.])/,"$1"),i=a.match(/^(0*)\.(#*)$/))return l+(""+c).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,i[1].length?"0.":".");if(i=a.match(/^#{1,3},##0(\.?)$/))return l+n0(""+c);if(i=a.match(/^#,##0\.([#0]*0)$/))return r<0?"-"+bn(e,a,-r):n0(""+r)+"."+Aa("0",i[1].length);if(i=a.match(/^#,#*,#0/))return bn(e,a.replace(/^#,#*,/,""),r);if(i=a.match(/^([0#]+)(\\?-([0#]+))+$/))return t=J0(bn(e,a.replace(/[\\-]/g,""),r)),s=0,J0(J0(a.replace(/\\/g,"")).replace(/[0#]/g,function(d){return s<t.length?t.charAt(s++):d==="0"?"0":""}));if(a.match(wo))return t=bn(e,"##########",r),"("+t.substr(0,3)+") "+t.substr(3,3)+"-"+t.substr(6);var o="";if(i=a.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return s=Math.min(i[4].length,7),f=bs(c,Math.pow(10,s)-1,!1),t=""+l,o=Gn("n",i[1],f[1]),o.charAt(o.length-1)==" "&&(o=o.substr(0,o.length-1)+"0"),t+=o+i[2]+"/"+i[3],o=Ds(f[2],s),o.length<i[4].length&&(o=kt(i[4].substr(i[4].length-o.length))+o),t+=o,t;if(i=a.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return s=Math.min(Math.max(i[1].length,i[4].length),7),f=bs(c,Math.pow(10,s)-1,!0),l+(f[0]||(f[1]?"":"0"))+" "+(f[1]?Hf(f[1],s)+i[2]+"/"+i[3]+Ds(f[2],s):Aa(" ",2*s+1+i[2].length+i[3].length));if(i=a.match(/^[#0?]+$/))return t=""+r,a.length<=t.length?t:kt(a.substr(0,a.length-t.length))+t;if(i=a.match(/^([#0]+)\.([#0]+)$/)){t=""+r.toFixed(Math.min(i[2].length,10)).replace(/([^0])0+$/,"$1"),s=t.indexOf(".");var u=a.indexOf(".")-s,x=a.length-t.length-u;return kt(a.substr(0,u)+t+a.substr(a.length-x))}if(i=a.match(/^00,000\.([#0]*0)$/))return r<0?"-"+bn(e,a,-r):n0(""+r).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(d){return"00,"+(d.length<3?kn(0,3-d.length):"")+d})+"."+kn(0,i[1].length);switch(a){case"###,###":case"##,###":case"#,###":var h=n0(""+c);return h!=="0"?l+h:"";default:if(a.match(/\.[0#?]*$/))return bn(e,a.slice(0,a.lastIndexOf(".")),r)+kt(a.slice(a.lastIndexOf(".")))}throw new Error("unsupported format |"+a+"|")}function Gn(e,a,r){return(r|0)===r?bn(e,a,r):Jt(e,a,r)}function Zx(e){for(var a=[],r=!1,n=0,t=0;n<e.length;++n)switch(e.charCodeAt(n)){case 34:r=!r;break;case 95:case 42:case 92:++n;break;case 59:a[a.length]=e.substr(t,n-t),t=n+1}if(a[a.length]=e.substr(t),r===!0)throw new Error("Format |"+e+"| unterminated string ");return a}var Ao=/\[[HhMmSs\u0E0A\u0E19\u0E17]*\]/;function ti(e){for(var a=0,r="",n="";a<e.length;)switch(r=e.charAt(a)){case"G":Is(e,a)&&(a+=6),a++;break;case'"':for(;e.charCodeAt(++a)!==34&&a<e.length;);++a;break;case"\\":a+=2;break;case"_":a+=2;break;case"@":++a;break;case"B":case"b":if(e.charAt(a+1)==="1"||e.charAt(a+1)==="2")return!0;case"M":case"D":case"Y":case"H":case"S":case"E":case"m":case"d":case"y":case"h":case"s":case"e":case"g":return!0;case"A":case"a":case"上":if(e.substr(a,3).toUpperCase()==="A/P"||e.substr(a,5).toUpperCase()==="AM/PM"||e.substr(a,5).toUpperCase()==="上午/下午")return!0;++a;break;case"[":for(n=r;e.charAt(a++)!=="]"&&a<e.length;)n+=e.charAt(a);if(n.match(Ao))return!0;break;case".":case"0":case"#":for(;a<e.length&&("0#?.,E+-%".indexOf(r=e.charAt(++a))>-1||r=="\\"&&e.charAt(a+1)=="-"&&"0#".indexOf(e.charAt(a+2))>-1););break;case"?":for(;e.charAt(++a)===r;);break;case"*":++a,(e.charAt(a)==" "||e.charAt(a)=="*")&&++a;break;case"(":case")":++a;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;a<e.length&&"0123456789".indexOf(e.charAt(++a))>-1;);break;case" ":++a;break;default:++a;break}return!1}function Qx(e,a,r,n){for(var t=[],i="",s=0,f="",c="t",l,o,u,x="H";s<e.length;)switch(f=e.charAt(s)){case"G":if(!Is(e,s))throw new Error("unrecognized character "+f+" in "+e);t[t.length]={t:"G",v:"General"},s+=7;break;case'"':for(i="";(u=e.charCodeAt(++s))!==34&&s<e.length;)i+=String.fromCharCode(u);t[t.length]={t:"t",v:i},++s;break;case"\\":var h=e.charAt(++s),d=h==="("||h===")"?h:"t";t[t.length]={t:d,v:h},++s;break;case"_":t[t.length]={t:"t",v:" "},s+=2;break;case"@":t[t.length]={t:"T",v:a},++s;break;case"B":case"b":if(e.charAt(s+1)==="1"||e.charAt(s+1)==="2"){if(l==null&&(l=_0(a,r,e.charAt(s+1)==="2"),l==null))return"";t[t.length]={t:"X",v:e.substr(s,2)},c=f,s+=2;break}case"M":case"D":case"Y":case"H":case"S":case"E":f=f.toLowerCase();case"m":case"d":case"y":case"h":case"s":case"e":case"g":if(a<0||l==null&&(l=_0(a,r),l==null))return"";for(i=f;++s<e.length&&e.charAt(s).toLowerCase()===f;)i+=f;f==="m"&&c.toLowerCase()==="h"&&(f="M"),f==="h"&&(f=x),t[t.length]={t:f,v:i},c=f;break;case"A":case"a":case"上":var p={t:f,v:f};if(l==null&&(l=_0(a,r)),e.substr(s,3).toUpperCase()==="A/P"?(l!=null&&(p.v=l.H>=12?"P":"A"),p.t="T",x="h",s+=3):e.substr(s,5).toUpperCase()==="AM/PM"?(l!=null&&(p.v=l.H>=12?"PM":"AM"),p.t="T",s+=5,x="h"):e.substr(s,5).toUpperCase()==="上午/下午"?(l!=null&&(p.v=l.H>=12?"下午":"上午"),p.t="T",s+=5,x="h"):(p.t="t",++s),l==null&&p.t==="T")return"";t[t.length]=p,c=f;break;case"[":for(i=f;e.charAt(s++)!=="]"&&s<e.length;)i+=e.charAt(s);if(i.slice(-1)!=="]")throw'unterminated "[" block: |'+i+"|";if(i.match(Ao)){if(l==null&&(l=_0(a,r),l==null))return"";t[t.length]={t:"Z",v:i.toLowerCase()},c=i.charAt(1)}else i.indexOf("$")>-1&&(i=(i.match(/\$([^-\[\]]*)/)||[])[1]||"$",ti(e)||(t[t.length]={t:"t",v:i}));break;case".":if(l!=null){for(i=f;++s<e.length&&(f=e.charAt(s))==="0";)i+=f;t[t.length]={t:"s",v:i};break}case"0":case"#":for(i=f;++s<e.length&&"0#?.,E+-%".indexOf(f=e.charAt(s))>-1;)i+=f;t[t.length]={t:"n",v:i};break;case"?":for(i=f;e.charAt(++s)===f;)i+=f;t[t.length]={t:f,v:i},c=f;break;case"*":++s,(e.charAt(s)==" "||e.charAt(s)=="*")&&++s;break;case"(":case")":t[t.length]={t:n===1?"t":f,v:f},++s;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(i=f;s<e.length&&"0123456789".indexOf(e.charAt(++s))>-1;)i+=e.charAt(s);t[t.length]={t:"D",v:i};break;case" ":t[t.length]={t:f,v:f},++s;break;case"$":t[t.length]={t:"t",v:"$"},++s;break;default:if(",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(f)===-1)throw new Error("unrecognized character "+f+" in "+e);t[t.length]={t:"t",v:f},++s;break}var m=0,g=0,y;for(s=t.length-1,c="t";s>=0;--s)switch(t[s].t){case"h":case"H":t[s].t=x,c="h",m<1&&(m=1);break;case"s":(y=t[s].v.match(/\.0+$/))&&(g=Math.max(g,y[0].length-1)),m<3&&(m=3);case"d":case"y":case"M":case"e":c=t[s].t;break;case"m":c==="s"&&(t[s].t="M",m<2&&(m=2));break;case"X":break;case"Z":m<1&&t[s].v.match(/[Hh]/)&&(m=1),m<2&&t[s].v.match(/[Mm]/)&&(m=2),m<3&&t[s].v.match(/[Ss]/)&&(m=3)}switch(m){case 0:break;case 1:l.u>=.5&&(l.u=0,++l.S),l.S>=60&&(l.S=0,++l.M),l.M>=60&&(l.M=0,++l.H);break;case 2:l.u>=.5&&(l.u=0,++l.S),l.S>=60&&(l.S=0,++l.M);break}var v="",E;for(s=0;s<t.length;++s)switch(t[s].t){case"t":case"T":case" ":case"D":break;case"X":t[s].v="",t[s].t=";";break;case"d":case"m":case"y":case"h":case"H":case"M":case"s":case"e":case"b":case"Z":t[s].v=Xx(t[s].t.charCodeAt(0),t[s].v,l,g),t[s].t="t";break;case"n":case"?":for(E=s+1;t[E]!=null&&((f=t[E].t)==="?"||f==="D"||(f===" "||f==="t")&&t[E+1]!=null&&(t[E+1].t==="?"||t[E+1].t==="t"&&t[E+1].v==="/")||t[s].t==="("&&(f===" "||f==="n"||f===")")||f==="t"&&(t[E].v==="/"||t[E].v===" "&&t[E+1]!=null&&t[E+1].t=="?"));)t[s].v+=t[E].v,t[E]={v:"",t:";"},++E;v+=t[s].v,s=E-1;break;case"G":t[s].t="t",t[s].v=w0(a,r);break}var w="",S,T;if(v.length>0){v.charCodeAt(0)==40?(S=a<0&&v.charCodeAt(0)===45?-a:a,T=Gn("n",v,S)):(S=a<0&&n>1?-a:a,T=Gn("n",v,S),S<0&&t[0]&&t[0].t=="t"&&(T=T.substr(1),t[0].v="-"+t[0].v)),E=T.length-1;var B=t.length;for(s=0;s<t.length;++s)if(t[s]!=null&&t[s].t!="t"&&t[s].v.indexOf(".")>-1){B=s;break}var I=t.length;if(B===t.length&&T.indexOf("E")===-1){for(s=t.length-1;s>=0;--s)t[s]==null||"n?".indexOf(t[s].t)===-1||(E>=t[s].v.length-1?(E-=t[s].v.length,t[s].v=T.substr(E+1,t[s].v.length)):E<0?t[s].v="":(t[s].v=T.substr(0,E+1),E=-1),t[s].t="t",I=s);E>=0&&I<t.length&&(t[I].v=T.substr(0,E+1)+t[I].v)}else if(B!==t.length&&T.indexOf("E")===-1){for(E=T.indexOf(".")-1,s=B;s>=0;--s)if(!(t[s]==null||"n?".indexOf(t[s].t)===-1)){for(o=t[s].v.indexOf(".")>-1&&s===B?t[s].v.indexOf(".")-1:t[s].v.length-1,w=t[s].v.substr(o+1);o>=0;--o)E>=0&&(t[s].v.charAt(o)==="0"||t[s].v.charAt(o)==="#")&&(w=T.charAt(E--)+w);t[s].v=w,t[s].t="t",I=s}for(E>=0&&I<t.length&&(t[I].v=T.substr(0,E+1)+t[I].v),E=T.indexOf(".")+1,s=B;s<t.length;++s)if(!(t[s]==null||"n?(".indexOf(t[s].t)===-1&&s!==B)){for(o=t[s].v.indexOf(".")>-1&&s===B?t[s].v.indexOf(".")+1:0,w=t[s].v.substr(0,o);o<t[s].v.length;++o)E<T.length&&(w+=T.charAt(E++));t[s].v=w,t[s].t="t",I=s}}}for(s=0;s<t.length;++s)t[s]!=null&&"n?".indexOf(t[s].t)>-1&&(S=n>1&&a<0&&s>0&&t[s-1].v==="-"?-a:a,t[s].v=Gn(t[s].t,t[s].v,S),t[s].t="t");var U="";for(s=0;s!==t.length;++s)t[s]!=null&&(U+=t[s].v);return U}var Jc=/\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;function qc(e,a){if(a==null)return!1;var r=parseFloat(a[2]);switch(a[1]){case"=":if(e==r)return!0;break;case">":if(e>r)return!0;break;case"<":if(e<r)return!0;break;case"<>":if(e!=r)return!0;break;case">=":if(e>=r)return!0;break;case"<=":if(e<=r)return!0;break}return!1}function ed(e,a){var r=Zx(e),n=r.length,t=r[n-1].indexOf("@");if(n<4&&t>-1&&--n,r.length>4)throw new Error("cannot find right format for |"+r.join("|")+"|");if(typeof a!="number")return[4,r.length===4||t>-1?r[r.length-1]:"@"];switch(r.length){case 1:r=t>-1?["General","General","General",r[0]]:[r[0],r[0],r[0],"@"];break;case 2:r=t>-1?[r[0],r[0],r[0],r[1]]:[r[0],r[1],r[0],"@"];break;case 3:r=t>-1?[r[0],r[1],r[0],r[2]]:[r[0],r[1],r[2],"@"];break}var i=a>0?r[0]:a<0?r[1]:r[2];if(r[0].indexOf("[")===-1&&r[1].indexOf("[")===-1)return[n,i];if(r[0].match(/\[[=<>]/)!=null||r[1].match(/\[[=<>]/)!=null){var s=r[0].match(Jc),f=r[1].match(Jc);return qc(a,s)?[n,r[0]]:qc(a,f)?[n,r[1]]:[n,r[s!=null&&f!=null?2:1]]}return[n,i]}function tn(e,a,r){r==null&&(r={});var n="";switch(typeof e){case"string":e=="m/d/yy"&&r.dateNF?n=r.dateNF:n=e;break;case"number":e==14&&r.dateNF?n=r.dateNF:n=(r.table!=null?r.table:tr)[e],n==null&&(n=r.table&&r.table[Vc[e]]||tr[Vc[e]]),n==null&&(n=Mx[e]||"General");break}if(Is(n,0))return w0(a,r);a instanceof Date&&(a=vo(a,r.date1904));var t=ed(n,a);if(Is(t[1]))return w0(a,r);if(a===!0)a="TRUE";else if(a===!1)a="FALSE";else if(a===""||a==null)return"";return Qx(t[1],a,r,t[0])}function Xn(e,a){if(typeof a!="number"){a=+a||-1;for(var r=0;r<392;++r){if(tr[r]==null){a<0&&(a=r);continue}if(tr[r]==e){a=r;break}}a<0&&(a=391)}return tr[a]=e,a}function Gs(e){for(var a=0;a!=392;++a)e[a]!==void 0&&Xn(e[a],a)}function ni(){tr=Px()}var rd={5:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',23:"General",24:"General",25:"General",26:"General",27:"m/d/yy",28:"m/d/yy",29:"m/d/yy",30:"m/d/yy",31:"m/d/yy",32:"h:mm:ss",33:"h:mm:ss",34:"h:mm:ss",35:"h:mm:ss",36:"m/d/yy",41:'_(* #,##0_);_(* (#,##0);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* (#,##0);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)',50:"m/d/yy",51:"m/d/yy",52:"m/d/yy",53:"m/d/yy",54:"m/d/yy",55:"m/d/yy",56:"m/d/yy",57:"m/d/yy",58:"m/d/yy",59:"0",60:"0.00",61:"#,##0",62:"#,##0.00",63:'"$"#,##0_);\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',67:"0%",68:"0.00%",69:"# ?/?",70:"# ??/??",71:"m/d/yy",72:"m/d/yy",73:"d-mmm-yy",74:"d-mmm",75:"mmm-yy",76:"h:mm",77:"h:mm:ss",78:"m/d/yy h:mm",79:"mm:ss",80:"[h]:mm:ss",81:"mmss.0"},Fo=/[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g;function ad(e){var a=typeof e=="number"?tr[e]:e;return a=a.replace(Fo,"(\\d+)"),new RegExp("^"+a+"$")}function td(e,a,r){var n=-1,t=-1,i=-1,s=-1,f=-1,c=-1;(a.match(Fo)||[]).forEach(function(u,x){var h=parseInt(r[x+1],10);switch(u.toLowerCase().charAt(0)){case"y":n=h;break;case"d":i=h;break;case"h":s=h;break;case"s":c=h;break;case"m":s>=0?f=h:t=h;break}}),c>=0&&f==-1&&t>=0&&(f=t,t=-1);var l=(""+(n>=0?n:new Date().getFullYear())).slice(-4)+"-"+("00"+(t>=1?t:1)).slice(-2)+"-"+("00"+(i>=1?i:1)).slice(-2);l.length==7&&(l="0"+l),l.length==8&&(l="20"+l);var o=("00"+(s>=0?s:0)).slice(-2)+":"+("00"+(f>=0?f:0)).slice(-2)+":"+("00"+(c>=0?c:0)).slice(-2);return s==-1&&f==-1&&c==-1?l:n==-1&&t==-1&&i==-1?o:l+"T"+o}var nd=function(){var e={};e.version="1.2.0";function a(){for(var T=0,B=new Array(256),I=0;I!=256;++I)T=I,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,B[I]=T;return typeof Int32Array<"u"?new Int32Array(B):B}var r=a();function n(T){var B=0,I=0,U=0,L=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(U=0;U!=256;++U)L[U]=T[U];for(U=0;U!=256;++U)for(I=T[U],B=256+U;B<4096;B+=256)I=L[B]=I>>>8^T[I&255];var W=[];for(U=1;U!=16;++U)W[U-1]=typeof Int32Array<"u"?L.subarray(U*256,U*256+256):L.slice(U*256,U*256+256);return W}var t=n(r),i=t[0],s=t[1],f=t[2],c=t[3],l=t[4],o=t[5],u=t[6],x=t[7],h=t[8],d=t[9],p=t[10],m=t[11],g=t[12],y=t[13],v=t[14];function E(T,B){for(var I=B^-1,U=0,L=T.length;U<L;)I=I>>>8^r[(I^T.charCodeAt(U++))&255];return~I}function w(T,B){for(var I=B^-1,U=T.length-15,L=0;L<U;)I=v[T[L++]^I&255]^y[T[L++]^I>>8&255]^g[T[L++]^I>>16&255]^m[T[L++]^I>>>24]^p[T[L++]]^d[T[L++]]^h[T[L++]]^x[T[L++]]^u[T[L++]]^o[T[L++]]^l[T[L++]]^c[T[L++]]^f[T[L++]]^s[T[L++]]^i[T[L++]]^r[T[L++]];for(U+=15;L<U;)I=I>>>8^r[(I^T[L++])&255];return~I}function S(T,B){for(var I=B^-1,U=0,L=T.length,W=0,M=0;U<L;)W=T.charCodeAt(U++),W<128?I=I>>>8^r[(I^W)&255]:W<2048?(I=I>>>8^r[(I^(192|W>>6&31))&255],I=I>>>8^r[(I^(128|W&63))&255]):W>=55296&&W<57344?(W=(W&1023)+64,M=T.charCodeAt(U++)&1023,I=I>>>8^r[(I^(240|W>>8&7))&255],I=I>>>8^r[(I^(128|W>>2&63))&255],I=I>>>8^r[(I^(128|M>>6&15|(W&3)<<4))&255],I=I>>>8^r[(I^(128|M&63))&255]):(I=I>>>8^r[(I^(224|W>>12&15))&255],I=I>>>8^r[(I^(128|W>>6&63))&255],I=I>>>8^r[(I^(128|W&63))&255]);return~I}return e.table=r,e.bstr=E,e.buf=w,e.str=S,e}(),je=function(){var a={};a.version="1.2.1";function r(k,N){for(var F=k.split("/"),C=N.split("/"),O=0,R=0,X=Math.min(F.length,C.length);O<X;++O){if(R=F[O].length-C[O].length)return R;if(F[O]!=C[O])return F[O]<C[O]?-1:1}return F.length-C.length}function n(k){if(k.charAt(k.length-1)=="/")return k.slice(0,-1).indexOf("/")===-1?k:n(k.slice(0,-1));var N=k.lastIndexOf("/");return N===-1?k:k.slice(0,N+1)}function t(k){if(k.charAt(k.length-1)=="/")return t(k.slice(0,-1));var N=k.lastIndexOf("/");return N===-1?k:k.slice(N+1)}function i(k,N){typeof N=="string"&&(N=new Date(N));var F=N.getHours();F=F<<6|N.getMinutes(),F=F<<5|N.getSeconds()>>>1,k.write_shift(2,F);var C=N.getFullYear()-1980;C=C<<4|N.getMonth()+1,C=C<<5|N.getDate(),k.write_shift(2,C)}function s(k){var N=k.read_shift(2)&65535,F=k.read_shift(2)&65535,C=new Date,O=F&31;F>>>=5;var R=F&15;F>>>=4,C.setMilliseconds(0),C.setFullYear(F+1980),C.setMonth(R-1),C.setDate(O);var X=N&31;N>>>=5;var j=N&63;return N>>>=6,C.setHours(N),C.setMinutes(j),C.setSeconds(X<<1),C}function f(k){it(k,0);for(var N={},F=0;k.l<=k.length-4;){var C=k.read_shift(2),O=k.read_shift(2),R=k.l+O,X={};switch(C){case 21589:F=k.read_shift(1),F&1&&(X.mtime=k.read_shift(4)),O>5&&(F&2&&(X.atime=k.read_shift(4)),F&4&&(X.ctime=k.read_shift(4))),X.mtime&&(X.mt=new Date(X.mtime*1e3));break}k.l=R,N[C]=X}return N}var c;function l(){return c||(c={})}function o(k,N){if(k[0]==80&&k[1]==75)return Vr(k,N);if((k[0]|32)==109&&(k[1]|32)==105)return ft(k,N);if(k.length<512)throw new Error("CFB file size "+k.length+" < 512");var F=3,C=512,O=0,R=0,X=0,j=0,z=0,V=[],Y=k.slice(0,512);it(Y,0);var le=u(Y);switch(F=le[0],F){case 3:C=512;break;case 4:C=4096;break;case 0:if(le[1]==0)return Vr(k,N);default:throw new Error("Major Version: Expected 3 or 4 saw "+F)}C!==512&&(Y=k.slice(0,C),it(Y,28));var _e=k.slice(0,C);x(Y,F);var Ee=Y.read_shift(4,"i");if(F===3&&Ee!==0)throw new Error("# Directory Sectors: Expected 0 saw "+Ee);Y.l+=4,X=Y.read_shift(4,"i"),Y.l+=4,Y.chk("00100000","Mini Stream Cutoff Size: "),j=Y.read_shift(4,"i"),O=Y.read_shift(4,"i"),z=Y.read_shift(4,"i"),R=Y.read_shift(4,"i");for(var ue=-1,ge=0;ge<109&&(ue=Y.read_shift(4,"i"),!(ue<0));++ge)V[ge]=ue;var Ze=h(k,C);m(z,R,Ze,C,V);var Tr=y(Ze,X,V,C);Tr[X].name="!Directory",O>0&&j!==M&&(Tr[j].name="!MiniFAT"),Tr[V[0]].name="!FAT",Tr.fat_addrs=V,Tr.ssz=C;var Lr={},Kr=[],sn=[],fn=[];v(X,Tr,Ze,Kr,O,Lr,sn,j),d(sn,fn,Kr),Kr.shift();var cn={FileIndex:sn,FullPaths:fn};return N&&N.raw&&(cn.raw={header:_e,sectors:Ze}),cn}function u(k){if(k[k.l]==80&&k[k.l+1]==75)return[0,0];k.chk(se,"Header Signature: "),k.l+=16;var N=k.read_shift(2,"u");return[k.read_shift(2,"u"),N]}function x(k,N){var F=9;switch(k.l+=2,F=k.read_shift(2)){case 9:if(N!=3)throw new Error("Sector Shift: Expected 9 saw "+F);break;case 12:if(N!=4)throw new Error("Sector Shift: Expected 12 saw "+F);break;default:throw new Error("Sector Shift: Expected 9 or 12 saw "+F)}k.chk("0600","Mini Sector Shift: "),k.chk("000000000000","Reserved: ")}function h(k,N){for(var F=Math.ceil(k.length/N)-1,C=[],O=1;O<F;++O)C[O-1]=k.slice(O*N,(O+1)*N);return C[F-1]=k.slice(F*N),C}function d(k,N,F){for(var C=0,O=0,R=0,X=0,j=0,z=F.length,V=[],Y=[];C<z;++C)V[C]=Y[C]=C,N[C]=F[C];for(;j<Y.length;++j)C=Y[j],O=k[C].L,R=k[C].R,X=k[C].C,V[C]===C&&(O!==-1&&V[O]!==O&&(V[C]=V[O]),R!==-1&&V[R]!==R&&(V[C]=V[R])),X!==-1&&(V[X]=C),O!==-1&&C!=V[C]&&(V[O]=V[C],Y.lastIndexOf(O)<j&&Y.push(O)),R!==-1&&C!=V[C]&&(V[R]=V[C],Y.lastIndexOf(R)<j&&Y.push(R));for(C=1;C<z;++C)V[C]===C&&(R!==-1&&V[R]!==R?V[C]=V[R]:O!==-1&&V[O]!==O&&(V[C]=V[O]));for(C=1;C<z;++C)if(k[C].type!==0){if(j=C,j!=V[j])do j=V[j],N[C]=N[j]+"/"+N[C];while(j!==0&&V[j]!==-1&&j!=V[j]);V[C]=-1}for(N[0]+="/",C=1;C<z;++C)k[C].type!==2&&(N[C]+="/")}function p(k,N,F){for(var C=k.start,O=k.size,R=[],X=C;F&&O>0&&X>=0;)R.push(N.slice(X*W,X*W+W)),O-=W,X=g0(F,X*4);return R.length===0?ae(0):Ja(R).slice(0,k.size)}function m(k,N,F,C,O){var R=M;if(k===M){if(N!==0)throw new Error("DIFAT chain shorter than expected")}else if(k!==-1){var X=F[k],j=(C>>>2)-1;if(!X)return;for(var z=0;z<j&&(R=g0(X,z*4))!==M;++z)O.push(R);m(g0(X,C-4),N-1,F,C,O)}}function g(k,N,F,C,O){var R=[],X=[];O||(O=[]);var j=C-1,z=0,V=0;for(z=N;z>=0;){O[z]=!0,R[R.length]=z,X.push(k[z]);var Y=F[Math.floor(z*4/C)];if(V=z*4&j,C<4+V)throw new Error("FAT boundary crossed: "+z+" 4 "+C);if(!k[Y])break;z=g0(k[Y],V)}return{nodes:R,data:ll([X])}}function y(k,N,F,C){var O=k.length,R=[],X=[],j=[],z=[],V=C-1,Y=0,le=0,_e=0,Ee=0;for(Y=0;Y<O;++Y)if(j=[],_e=Y+N,_e>=O&&(_e-=O),!X[_e]){z=[];var ue=[];for(le=_e;le>=0;){ue[le]=!0,X[le]=!0,j[j.length]=le,z.push(k[le]);var ge=F[Math.floor(le*4/C)];if(Ee=le*4&V,C<4+Ee)throw new Error("FAT boundary crossed: "+le+" 4 "+C);if(!k[ge]||(le=g0(k[ge],Ee),ue[le]))break}R[_e]={nodes:j,data:ll([z])}}return R}function v(k,N,F,C,O,R,X,j){for(var z=0,V=C.length?2:0,Y=N[k].data,le=0,_e=0,Ee;le<Y.length;le+=128){var ue=Y.slice(le,le+128);it(ue,64),_e=ue.read_shift(2),Ee=Yf(ue,0,_e-V),C.push(Ee);var ge={name:Ee,type:ue.read_shift(1),color:ue.read_shift(1),L:ue.read_shift(4,"i"),R:ue.read_shift(4,"i"),C:ue.read_shift(4,"i"),clsid:ue.read_shift(16),state:ue.read_shift(4,"i"),start:0,size:0},Ze=ue.read_shift(2)+ue.read_shift(2)+ue.read_shift(2)+ue.read_shift(2);Ze!==0&&(ge.ct=E(ue,ue.l-8));var Tr=ue.read_shift(2)+ue.read_shift(2)+ue.read_shift(2)+ue.read_shift(2);Tr!==0&&(ge.mt=E(ue,ue.l-8)),ge.start=ue.read_shift(4,"i"),ge.size=ue.read_shift(4,"i"),ge.size<0&&ge.start<0&&(ge.size=ge.type=0,ge.start=M,ge.name=""),ge.type===5?(z=ge.start,O>0&&z!==M&&(N[z].name="!StreamData")):ge.size>=4096?(ge.storage="fat",N[ge.start]===void 0&&(N[ge.start]=g(F,ge.start,N.fat_addrs,N.ssz)),N[ge.start].name=ge.name,ge.content=N[ge.start].data.slice(0,ge.size)):(ge.storage="minifat",ge.size<0?ge.size=0:z!==M&&ge.start!==M&&N[z]&&(ge.content=p(ge,N[z].data,(N[j]||{}).data))),ge.content&&it(ge.content,0),R[Ee]=ge,X.push(ge)}}function E(k,N){return new Date((Ht(k,N+4)/1e7*Math.pow(2,32)+Ht(k,N)/1e7-11644473600)*1e3)}function w(k,N){return l(),o(c.readFileSync(k),N)}function S(k,N){var F=N&&N.type;switch(F||kr&&Buffer.isBuffer(k)&&(F="buffer"),F||"base64"){case"file":return w(k,N);case"base64":return o(Gt(Kt(k)),N);case"binary":return o(Gt(k),N)}return o(k,N)}function T(k,N){var F=N||{},C=F.root||"Root Entry";if(k.FullPaths||(k.FullPaths=[]),k.FileIndex||(k.FileIndex=[]),k.FullPaths.length!==k.FileIndex.length)throw new Error("inconsistent CFB structure");k.FullPaths.length===0&&(k.FullPaths[0]=C+"/",k.FileIndex[0]={name:C,type:5}),F.CLSID&&(k.FileIndex[0].clsid=F.CLSID),B(k)}function B(k){var N="Sh33tJ5";if(!je.find(k,"/"+N)){var F=ae(4);F[0]=55,F[1]=F[3]=50,F[2]=54,k.FileIndex.push({name:N,type:2,content:F,size:4,L:69,R:69,C:69}),k.FullPaths.push(k.FullPaths[0]+N),I(k)}}function I(k,N){T(k);for(var F=!1,C=!1,O=k.FullPaths.length-1;O>=0;--O){var R=k.FileIndex[O];switch(R.type){case 0:C?F=!0:(k.FileIndex.pop(),k.FullPaths.pop());break;case 1:case 2:case 5:C=!0,isNaN(R.R*R.L*R.C)&&(F=!0),R.R>-1&&R.L>-1&&R.R==R.L&&(F=!0);break;default:F=!0;break}}if(!(!F&&!N)){var X=new Date(1987,1,19),j=0,z=Object.create?Object.create(null):{},V=[];for(O=0;O<k.FullPaths.length;++O)z[k.FullPaths[O]]=!0,k.FileIndex[O].type!==0&&V.push([k.FullPaths[O],k.FileIndex[O]]);for(O=0;O<V.length;++O){var Y=n(V[O][0]);C=z[Y],C||(V.push([Y,{name:t(Y).replace("/",""),type:1,clsid:he,ct:X,mt:X,content:null}]),z[Y]=!0)}for(V.sort(function(Ee,ue){return r(Ee[0],ue[0])}),k.FullPaths=[],k.FileIndex=[],O=0;O<V.length;++O)k.FullPaths[O]=V[O][0],k.FileIndex[O]=V[O][1];for(O=0;O<V.length;++O){var le=k.FileIndex[O],_e=k.FullPaths[O];if(le.name=t(_e).replace("/",""),le.L=le.R=le.C=-(le.color=1),le.size=le.content?le.content.length:0,le.start=0,le.clsid=le.clsid||he,O===0)le.C=V.length>1?1:-1,le.size=0,le.type=5;else if(_e.slice(-1)=="/"){for(j=O+1;j<V.length&&n(k.FullPaths[j])!=_e;++j);for(le.C=j>=V.length?-1:j,j=O+1;j<V.length&&n(k.FullPaths[j])!=n(_e);++j);le.R=j>=V.length?-1:j,le.type=1}else n(k.FullPaths[O+1]||"")==n(_e)&&(le.R=O+1),le.type=2}}}function U(k,N){var F=N||{};if(F.fileType=="mad")return Ot(k,F);switch(I(k),F.fileType){case"zip":return Sa(k,F)}var C=function(Ee){for(var ue=0,ge=0,Ze=0;Ze<Ee.FileIndex.length;++Ze){var Tr=Ee.FileIndex[Ze];if(Tr.content){var Lr=Tr.content.length;Lr>0&&(Lr<4096?ue+=Lr+63>>6:ge+=Lr+511>>9)}}for(var Kr=Ee.FullPaths.length+3>>2,sn=ue+7>>3,fn=ue+127>>7,cn=sn+ge+Kr+fn,Lt=cn+127>>7,Pn=Lt<=109?0:Math.ceil((Lt-109)/127);cn+Lt+Pn+127>>7>Lt;)Pn=++Lt<=109?0:Math.ceil((Lt-109)/127);var rr=[1,Pn,Lt,fn,Kr,ge,ue,0];return Ee.FileIndex[0].size=ue<<6,rr[7]=(Ee.FileIndex[0].start=rr[0]+rr[1]+rr[2]+rr[3]+rr[4]+rr[5])+(rr[6]+7>>3),rr}(k),O=ae(C[7]<<9),R=0,X=0;{for(R=0;R<8;++R)O.write_shift(1,ne[R]);for(R=0;R<8;++R)O.write_shift(2,0);for(O.write_shift(2,62),O.write_shift(2,3),O.write_shift(2,65534),O.write_shift(2,9),O.write_shift(2,6),R=0;R<3;++R)O.write_shift(2,0);for(O.write_shift(4,0),O.write_shift(4,C[2]),O.write_shift(4,C[0]+C[1]+C[2]+C[3]-1),O.write_shift(4,0),O.write_shift(4,4096),O.write_shift(4,C[3]?C[0]+C[1]+C[2]-1:M),O.write_shift(4,C[3]),O.write_shift(-4,C[1]?C[0]-1:M),O.write_shift(4,C[1]),R=0;R<109;++R)O.write_shift(-4,R<C[2]?C[1]+R:-1)}if(C[1])for(X=0;X<C[1];++X){for(;R<236+X*127;++R)O.write_shift(-4,R<C[2]?C[1]+R:-1);O.write_shift(-4,X===C[1]-1?M:X+1)}var j=function(Ee){for(X+=Ee;R<X-1;++R)O.write_shift(-4,R+1);Ee&&(++R,O.write_shift(-4,M))};for(X=R=0,X+=C[1];R<X;++R)O.write_shift(-4,ce.DIFSECT);for(X+=C[2];R<X;++R)O.write_shift(-4,ce.FATSECT);j(C[3]),j(C[4]);for(var z=0,V=0,Y=k.FileIndex[0];z<k.FileIndex.length;++z)Y=k.FileIndex[z],Y.content&&(V=Y.content.length,!(V<4096)&&(Y.start=X,j(V+511>>9)));for(j(C[6]+7>>3);O.l&511;)O.write_shift(-4,ce.ENDOFCHAIN);for(X=R=0,z=0;z<k.FileIndex.length;++z)Y=k.FileIndex[z],Y.content&&(V=Y.content.length,!(!V||V>=4096)&&(Y.start=X,j(V+63>>6)));for(;O.l&511;)O.write_shift(-4,ce.ENDOFCHAIN);for(R=0;R<C[4]<<2;++R){var le=k.FullPaths[R];if(!le||le.length===0){for(z=0;z<17;++z)O.write_shift(4,0);for(z=0;z<3;++z)O.write_shift(4,-1);for(z=0;z<12;++z)O.write_shift(4,0);continue}Y=k.FileIndex[R],R===0&&(Y.start=Y.size?Y.start-1:M);var _e=R===0&&F.root||Y.name;if(V=2*(_e.length+1),O.write_shift(64,_e,"utf16le"),O.write_shift(2,V),O.write_shift(1,Y.type),O.write_shift(1,Y.color),O.write_shift(-4,Y.L),O.write_shift(-4,Y.R),O.write_shift(-4,Y.C),Y.clsid)O.write_shift(16,Y.clsid,"hex");else for(z=0;z<4;++z)O.write_shift(4,0);O.write_shift(4,Y.state||0),O.write_shift(4,0),O.write_shift(4,0),O.write_shift(4,0),O.write_shift(4,0),O.write_shift(4,Y.start),O.write_shift(4,Y.size),O.write_shift(4,0)}for(R=1;R<k.FileIndex.length;++R)if(Y=k.FileIndex[R],Y.size>=4096)if(O.l=Y.start+1<<9,kr&&Buffer.isBuffer(Y.content))Y.content.copy(O,O.l,0,Y.size),O.l+=Y.size+511&-512;else{for(z=0;z<Y.size;++z)O.write_shift(1,Y.content[z]);for(;z&511;++z)O.write_shift(1,0)}for(R=1;R<k.FileIndex.length;++R)if(Y=k.FileIndex[R],Y.size>0&&Y.size<4096)if(kr&&Buffer.isBuffer(Y.content))Y.content.copy(O,O.l,0,Y.size),O.l+=Y.size+63&-64;else{for(z=0;z<Y.size;++z)O.write_shift(1,Y.content[z]);for(;z&63;++z)O.write_shift(1,0)}if(kr)O.l=O.length;else for(;O.l<O.length;)O.write_shift(1,0);return O}function L(k,N){var F=k.FullPaths.map(function(z){return z.toUpperCase()}),C=F.map(function(z){var V=z.split("/");return V[V.length-(z.slice(-1)=="/"?2:1)]}),O=!1;N.charCodeAt(0)===47?(O=!0,N=F[0].slice(0,-1)+N):O=N.indexOf("/")!==-1;var R=N.toUpperCase(),X=O===!0?F.indexOf(R):C.indexOf(R);if(X!==-1)return k.FileIndex[X];var j=!R.match(bi);for(R=R.replace(Tt,""),j&&(R=R.replace(bi,"!")),X=0;X<F.length;++X)if((j?F[X].replace(bi,"!"):F[X]).replace(Tt,"")==R||(j?C[X].replace(bi,"!"):C[X]).replace(Tt,"")==R)return k.FileIndex[X];return null}var W=64,M=-2,se="d0cf11e0a1b11ae1",ne=[208,207,17,224,161,177,26,225],he="00000000000000000000000000000000",ce={MAXREGSECT:-6,DIFSECT:-4,FATSECT:-3,ENDOFCHAIN:M,FREESECT:-1,HEADER_SIGNATURE:se,HEADER_MINOR_VERSION:"3e00",MAXREGSID:-6,NOSTREAM:-1,HEADER_CLSID:he,EntryTypes:["unknown","storage","stream","lockbytes","property","root"]};function Ce(k,N,F){l();var C=U(k,F);c.writeFileSync(N,C)}function K(k){for(var N=new Array(k.length),F=0;F<k.length;++F)N[F]=String.fromCharCode(k[F]);return N.join("")}function Te(k,N){var F=U(k,N);switch(N&&N.type||"buffer"){case"file":return l(),c.writeFileSync(N.filename,F),F;case"binary":return typeof F=="string"?F:K(F);case"base64":return Hi(typeof F=="string"?F:K(F));case"buffer":if(kr)return Buffer.isBuffer(F)?F:zn(F);case"array":return typeof F=="string"?Gt(F):F}return F}var Fe;function _(k){try{var N=k.InflateRaw,F=new N;if(F._processChunk(new Uint8Array([3,0]),F._finishFlushFlag),F.bytesRead)Fe=k;else throw new Error("zlib does not expose bytesRead")}catch(C){console.error("cannot use native zlib: "+(C.message||C))}}function A(k,N){if(!Fe)return ta(k,N);var F=Fe.InflateRaw,C=new F,O=C._processChunk(k.slice(k.l),C._finishFlushFlag);return k.l+=C.bytesRead,O}function D(k){return Fe?Fe.deflateRawSync(k):er(k)}var b=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],G=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],re=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577];function ee(k){var N=(k<<1|k<<11)&139536|(k<<5|k<<15)&558144;return(N>>16|N>>8|N)&255}for(var Z=typeof Uint8Array<"u",J=Z?new Uint8Array(256):[],we=0;we<256;++we)J[we]=ee(we);function P(k,N){var F=J[k&255];return N<=8?F>>>8-N:(F=F<<8|J[k>>8&255],N<=16?F>>>16-N:(F=F<<8|J[k>>16&255],F>>>24-N))}function Me(k,N){var F=N&7,C=N>>>3;return(k[C]|(F<=6?0:k[C+1]<<8))>>>F&3}function be(k,N){var F=N&7,C=N>>>3;return(k[C]|(F<=5?0:k[C+1]<<8))>>>F&7}function Ye(k,N){var F=N&7,C=N>>>3;return(k[C]|(F<=4?0:k[C+1]<<8))>>>F&15}function Be(k,N){var F=N&7,C=N>>>3;return(k[C]|(F<=3?0:k[C+1]<<8))>>>F&31}function ie(k,N){var F=N&7,C=N>>>3;return(k[C]|(F<=1?0:k[C+1]<<8))>>>F&127}function hr(k,N,F){var C=N&7,O=N>>>3,R=(1<<F)-1,X=k[O]>>>C;return F<8-C||(X|=k[O+1]<<8-C,F<16-C)||(X|=k[O+2]<<16-C,F<24-C)||(X|=k[O+3]<<24-C),X&R}function sr(k,N,F){var C=N&7,O=N>>>3;return C<=5?k[O]|=(F&7)<<C:(k[O]|=F<<C&255,k[O+1]=(F&7)>>8-C),N+3}function Ea(k,N,F){var C=N&7,O=N>>>3;return F=(F&1)<<C,k[O]|=F,N+1}function Ia(k,N,F){var C=N&7,O=N>>>3;return F<<=C,k[O]|=F&255,F>>>=8,k[O+1]=F,N+8}function wt(k,N,F){var C=N&7,O=N>>>3;return F<<=C,k[O]|=F&255,F>>>=8,k[O+1]=F&255,k[O+2]=F>>>8,N+16}function Za(k,N){var F=k.length,C=2*F>N?2*F:N+5,O=0;if(F>=N)return k;if(kr){var R=$c(C);if(k.copy)k.copy(R);else for(;O<k.length;++O)R[O]=k[O];return R}else if(Z){var X=new Uint8Array(C);if(X.set)X.set(k);else for(;O<F;++O)X[O]=k[O];return X}return k.length=C,k}function Ta(k){for(var N=new Array(k),F=0;F<k;++F)N[F]=0;return N}function za(k,N,F){var C=1,O=0,R=0,X=0,j=0,z=k.length,V=Z?new Uint16Array(32):Ta(32);for(R=0;R<32;++R)V[R]=0;for(R=z;R<F;++R)k[R]=0;z=k.length;var Y=Z?new Uint16Array(z):Ta(z);for(R=0;R<z;++R)V[O=k[R]]++,C<O&&(C=O),Y[R]=0;for(V[0]=0,R=1;R<=C;++R)V[R+16]=j=j+V[R-1]<<1;for(R=0;R<z;++R)j=k[R],j!=0&&(Y[R]=V[j+16]++);var le=0;for(R=0;R<z;++R)if(le=k[R],le!=0)for(j=P(Y[R],C)>>C-le,X=(1<<C+4-le)-1;X>=0;--X)N[j|X<<le]=le&15|R<<4;return C}var Se=Z?new Uint16Array(512):Ta(512),Pe=Z?new Uint16Array(32):Ta(32);if(!Z){for(var Ue=0;Ue<512;++Ue)Se[Ue]=0;for(Ue=0;Ue<32;++Ue)Pe[Ue]=0}(function(){for(var k=[],N=0;N<32;N++)k.push(5);za(k,Pe,32);var F=[];for(N=0;N<=143;N++)F.push(8);for(;N<=255;N++)F.push(9);for(;N<=279;N++)F.push(7);for(;N<=287;N++)F.push(8);za(F,Se,288)})();var wa=function(){for(var N=Z?new Uint8Array(32768):[],F=0,C=0;F<re.length-1;++F)for(;C<re[F+1];++C)N[C]=F;for(;C<32768;++C)N[C]=29;var O=Z?new Uint8Array(259):[];for(F=0,C=0;F<G.length-1;++F)for(;C<G[F+1];++C)O[C]=F;function R(j,z){for(var V=0;V<j.length;){var Y=Math.min(65535,j.length-V),le=V+Y==j.length;for(z.write_shift(1,+le),z.write_shift(2,Y),z.write_shift(2,~Y&65535);Y-- >0;)z[z.l++]=j[V++]}return z.l}function X(j,z){for(var V=0,Y=0,le=Z?new Uint16Array(32768):[];Y<j.length;){var _e=Math.min(65535,j.length-Y);if(_e<10){for(V=sr(z,V,+(Y+_e==j.length)),V&7&&(V+=8-(V&7)),z.l=V/8|0,z.write_shift(2,_e),z.write_shift(2,~_e&65535);_e-- >0;)z[z.l++]=j[Y++];V=z.l*8;continue}V=sr(z,V,+(Y+_e==j.length)+2);for(var Ee=0;_e-- >0;){var ue=j[Y];Ee=(Ee<<5^ue)&32767;var ge=-1,Ze=0;if((ge=le[Ee])&&(ge|=Y&-32768,ge>Y&&(ge-=32768),ge<Y))for(;j[ge+Ze]==j[Y+Ze]&&Ze<250;)++Ze;if(Ze>2){ue=O[Ze],ue<=22?V=Ia(z,V,J[ue+1]>>1)-1:(Ia(z,V,3),V+=5,Ia(z,V,J[ue-23]>>5),V+=3);var Tr=ue<8?0:ue-4>>2;Tr>0&&(wt(z,V,Ze-G[ue]),V+=Tr),ue=N[Y-ge],V=Ia(z,V,J[ue]>>3),V-=3;var Lr=ue<4?0:ue-2>>1;Lr>0&&(wt(z,V,Y-ge-re[ue]),V+=Lr);for(var Kr=0;Kr<Ze;++Kr)le[Ee]=Y&32767,Ee=(Ee<<5^j[Y])&32767,++Y;_e-=Ze-1}else ue<=143?ue=ue+48:V=Ea(z,V,1),V=Ia(z,V,J[ue]),le[Ee]=Y&32767,++Y}V=Ia(z,V,0)-1}return z.l=(V+7)/8|0,z.l}return function(z,V){return z.length<8?R(z,V):X(z,V)}}();function er(k){var N=ae(50+Math.floor(k.length*1.1)),F=wa(k,N);return N.slice(0,F)}var Cr=Z?new Uint16Array(32768):Ta(32768),me=Z?new Uint16Array(32768):Ta(32768),Dr=Z?new Uint16Array(128):Ta(128),Rr=1,xr=1;function Er(k,N){var F=Be(k,N)+257;N+=5;var C=Be(k,N)+1;N+=5;var O=Ye(k,N)+4;N+=4;for(var R=0,X=Z?new Uint8Array(19):Ta(19),j=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],z=1,V=Z?new Uint8Array(8):Ta(8),Y=Z?new Uint8Array(8):Ta(8),le=X.length,_e=0;_e<O;++_e)X[b[_e]]=R=be(k,N),z<R&&(z=R),V[R]++,N+=3;var Ee=0;for(V[0]=0,_e=1;_e<=z;++_e)Y[_e]=Ee=Ee+V[_e-1]<<1;for(_e=0;_e<le;++_e)(Ee=X[_e])!=0&&(j[_e]=Y[Ee]++);var ue=0;for(_e=0;_e<le;++_e)if(ue=X[_e],ue!=0){Ee=J[j[_e]]>>8-ue;for(var ge=(1<<7-ue)-1;ge>=0;--ge)Dr[Ee|ge<<ue]=ue&7|_e<<3}var Ze=[];for(z=1;Ze.length<F+C;)switch(Ee=Dr[ie(k,N)],N+=Ee&7,Ee>>>=3){case 16:for(R=3+Me(k,N),N+=2,Ee=Ze[Ze.length-1];R-- >0;)Ze.push(Ee);break;case 17:for(R=3+be(k,N),N+=3;R-- >0;)Ze.push(0);break;case 18:for(R=11+ie(k,N),N+=7;R-- >0;)Ze.push(0);break;default:Ze.push(Ee),z<Ee&&(z=Ee);break}var Tr=Ze.slice(0,F),Lr=Ze.slice(F);for(_e=F;_e<286;++_e)Tr[_e]=0;for(_e=C;_e<30;++_e)Lr[_e]=0;return Rr=za(Tr,Cr,286),xr=za(Lr,me,30),N}function da(k,N){if(k[0]==3&&!(k[1]&3))return[i0(N),2];for(var F=0,C=0,O=$c(N||1<<18),R=0,X=O.length>>>0,j=0,z=0;(C&1)==0;){if(C=be(k,F),F+=3,C>>>1)C>>1==1?(j=9,z=5):(F=Er(k,F),j=Rr,z=xr);else{F&7&&(F+=8-(F&7));var V=k[F>>>3]|k[(F>>>3)+1]<<8;if(F+=32,V>0)for(!N&&X<R+V&&(O=Za(O,R+V),X=O.length);V-- >0;)O[R++]=k[F>>>3],F+=8;continue}for(;;){!N&&X<R+32767&&(O=Za(O,R+32767),X=O.length);var Y=hr(k,F,j),le=C>>>1==1?Se[Y]:Cr[Y];if(F+=le&15,le>>>=4,(le>>>8&255)===0)O[R++]=le;else{if(le==256)break;le-=257;var _e=le<8?0:le-4>>2;_e>5&&(_e=0);var Ee=R+G[le];_e>0&&(Ee+=hr(k,F,_e),F+=_e),Y=hr(k,F,z),le=C>>>1==1?Pe[Y]:me[Y],F+=le&15,le>>>=4;var ue=le<4?0:le-2>>1,ge=re[le];for(ue>0&&(ge+=hr(k,F,ue),F+=ue),!N&&X<Ee&&(O=Za(O,Ee+100),X=O.length);R<Ee;)O[R]=O[R-ge],++R}}}return N?[O,F+7>>>3]:[O.slice(0,R),F+7>>>3]}function ta(k,N){var F=k.slice(k.l||0),C=da(F,N);return k.l+=C[1],C[0]}function He(k,N){if(k)typeof console<"u"&&console.error(N);else throw new Error(N)}function Vr(k,N){var F=k;it(F,0);var C=[],O=[],R={FileIndex:C,FullPaths:O};T(R,{root:N.root});for(var X=F.length-4;(F[X]!=80||F[X+1]!=75||F[X+2]!=5||F[X+3]!=6)&&X>=0;)--X;F.l=X+4,F.l+=4;var j=F.read_shift(2);F.l+=6;var z=F.read_shift(4);for(F.l=z,X=0;X<j;++X){F.l+=20;var V=F.read_shift(4),Y=F.read_shift(4),le=F.read_shift(2),_e=F.read_shift(2),Ee=F.read_shift(2);F.l+=8;var ue=F.read_shift(4),ge=f(F.slice(F.l+le,F.l+le+_e));F.l+=le+_e+Ee;var Ze=F.l;F.l=ue+4,ia(F,V,Y,R,ge),F.l=Ze}return R}function ia(k,N,F,C,O){k.l+=2;var R=k.read_shift(2),X=k.read_shift(2),j=s(k);if(R&8257)throw new Error("Unsupported ZIP encryption");for(var z=k.read_shift(4),V=k.read_shift(4),Y=k.read_shift(4),le=k.read_shift(2),_e=k.read_shift(2),Ee="",ue=0;ue<le;++ue)Ee+=String.fromCharCode(k[k.l++]);if(_e){var ge=f(k.slice(k.l,k.l+_e));(ge[21589]||{}).mt&&(j=ge[21589].mt),((O||{})[21589]||{}).mt&&(j=O[21589].mt)}k.l+=_e;var Ze=k.slice(k.l,k.l+V);switch(X){case 8:Ze=A(k,Y);break;case 0:break;default:throw new Error("Unsupported ZIP Compression method "+X)}var Tr=!1;R&8&&(z=k.read_shift(4),z==134695760&&(z=k.read_shift(4),Tr=!0),V=k.read_shift(4),Y=k.read_shift(4)),V!=N&&He(Tr,"Bad compressed size: "+N+" != "+V),Y!=F&&He(Tr,"Bad uncompressed size: "+F+" != "+Y),yt(C,Ee,Ze,{unsafe:!0,mt:j})}function Sa(k,N){var F=N||{},C=[],O=[],R=ae(1),X=F.compression?8:0,j=0,z=0,V=0,Y=0,le=0,_e=k.FullPaths[0],Ee=_e,ue=k.FileIndex[0],ge=[],Ze=0;for(z=1;z<k.FullPaths.length;++z)if(Ee=k.FullPaths[z].slice(_e.length),ue=k.FileIndex[z],!(!ue.size||!ue.content||Ee=="Sh33tJ5")){var Tr=Y,Lr=ae(Ee.length);for(V=0;V<Ee.length;++V)Lr.write_shift(1,Ee.charCodeAt(V)&127);Lr=Lr.slice(0,Lr.l),ge[le]=nd.buf(ue.content,0);var Kr=ue.content;X==8&&(Kr=D(Kr)),R=ae(30),R.write_shift(4,67324752),R.write_shift(2,20),R.write_shift(2,j),R.write_shift(2,X),ue.mt?i(R,ue.mt):R.write_shift(4,0),R.write_shift(-4,ge[le]),R.write_shift(4,Kr.length),R.write_shift(4,ue.content.length),R.write_shift(2,Lr.length),R.write_shift(2,0),Y+=R.length,C.push(R),Y+=Lr.length,C.push(Lr),Y+=Kr.length,C.push(Kr),R=ae(46),R.write_shift(4,33639248),R.write_shift(2,0),R.write_shift(2,20),R.write_shift(2,j),R.write_shift(2,X),R.write_shift(4,0),R.write_shift(-4,ge[le]),R.write_shift(4,Kr.length),R.write_shift(4,ue.content.length),R.write_shift(2,Lr.length),R.write_shift(2,0),R.write_shift(2,0),R.write_shift(2,0),R.write_shift(2,0),R.write_shift(4,0),R.write_shift(4,Tr),Ze+=R.l,O.push(R),Ze+=Lr.length,O.push(Lr),++le}return R=ae(22),R.write_shift(4,101010256),R.write_shift(2,0),R.write_shift(2,0),R.write_shift(2,le),R.write_shift(2,le),R.write_shift(4,Ze),R.write_shift(4,Y),R.write_shift(2,0),Ja([Ja(C),Ja(O),R])}var xa={htm:"text/html",xml:"text/xml",gif:"image/gif",jpg:"image/jpeg",png:"image/png",mso:"application/x-mso",thmx:"application/vnd.ms-officetheme",sh33tj5:"application/octet-stream"};function cr(k,N){if(k.ctype)return k.ctype;var F=k.name||"",C=F.match(/\.([^\.]+)$/);return C&&xa[C[1]]||N&&(C=(F=N).match(/[\.\\]([^\.\\])+$/),C&&xa[C[1]])?xa[C[1]]:"application/octet-stream"}function Sr(k){for(var N=Hi(k),F=[],C=0;C<N.length;C+=76)F.push(N.slice(C,C+76));return F.join(`\r
|
|
1
|
+
"use strict";const la=require("./index-CW4qJdP8.cjs"),Q=require("./menu-7kw8Lwp_.cjs"),Ae=require("./index--E8u7lHy.cjs"),z0=require("./request-BC2w2vGr.cjs"),zr=require("vue");require("./JSEncrypt-IYbV4kRj.cjs");const Ah=[{key:"FormName",value:"Form"},{key:"TableName",value:"Table"},{key:"MenuName",value:"Menu"},{key:"GroupName",value:"Group"},{key:"SystemKey",value:"System"}],Fh=[{key:"FormDirect",value:"formFlex"},{key:"Form",value:"formContent"},{key:"FormButton",value:"formButton"},{key:"FormFlex",value:"formWrap"},{key:"TableColumns",value:"header"},{key:"TableButton",value:"extraButton"},{key:"TableLineButton",value:"rowButton"},{key:"Table",value:"tableContents"},{key:"TableIndex",value:"tableIndex"},{key:"Menus",value:"menuContents"},{key:"GroupContents",value:"groupContents"}],Dh=e=>{var i;let a=e;const r=[];let n="",t=0;for(const s of a)t++,s.includes("(")||n.includes("(")||s.includes(")")||n.includes(")")||s.includes("&")||n.includes("&")||s.includes("|")||n.includes("|")?(n+=s.trim(),(((i=Q.cloneDeep(n))==null?void 0:i[(n==null?void 0:n.length)-1])===")"||(a==null?void 0:a[t])==="|"||(a==null?void 0:a[t])==="&")&&!(n!=null&&n.includes("&"))&&!(n!=null&&n.includes("|"))?(r.push(n.replace(/\/\*[\s\S]*?\*\//g,"")),n=""):n==="&&"||n==="||"?(r.push(n.replace(/\/\*[\s\S]*?\*\//g,"")),n=""):t===(e==null?void 0:e.length)&&(r.push(n.replace(/\/\*[\s\S]*?\*\//g,"")),n="")):n+=s.trim();return(n==null?void 0:n.length)!==0&&r.push(n.replace(/\/\*[\s\S]*?\*\//g,"")),r},ql=(e,a,r,n,t,i)=>{let s=e;return s=s==null?void 0:s.map(f=>{var c,l,o,u,x;if(r!=null&&r.find(h=>{var d,p,m,g,y;return(h===(f==null?void 0:f.prop)||((d=f==null?void 0:f.prop)==null?void 0:d.includes("."+h)))&&((y=(p=f==null?void 0:f.prop)==null?void 0:p.split("."))==null?void 0:y[((g=(m=f==null?void 0:f.prop)==null?void 0:m.split("."))==null?void 0:g.length)-1])===(f==null?void 0:f.label)})&&(f.label=(c=a==null?void 0:a[r==null?void 0:r.findIndex(h=>{var d;return h===(f==null?void 0:f.prop)||((d=f==null?void 0:f.prop)==null?void 0:d.includes("."+h))})])==null?void 0:c.replaceAll('"',""),n!=null&&n.methodContent)){let h=(o=(l=n==null?void 0:n.methodContent)==null?void 0:l.replaceAll('"',""))==null?void 0:o.replaceAll("'","");h!=null&&h.includes("@")?(h=h==null?void 0:h.slice(0,(h==null?void 0:h.length)-1),h!=null&&h.includes("@Type")||(h=h+",@Type=Auto"),h!=null&&h.includes("@Button")||(h=h+",@Button=Prop"),h!=null&&h.includes("@Extent")||(h=h+",@Extent=Row"),h=h+")"):h=h+"(@Type=Auto,@Button=Prop,@Extent=Row)",f.methodContent=h,f.prop=(f==null?void 0:f.prop)+(n==null?void 0:n.columnPathIndex),(u=i==null?void 0:i.find(d=>d==null?void 0:d.includes("@SonSync")))!=null&&u.includes("Yes")&&(f.methodId=t)}return f!=null&&f.children&&((x=f==null?void 0:f.children)==null?void 0:x.length)>0&&(f.children=ql(f.children,a,r,n,t,i)),f}),s},Zl=e=>{var i;let a=e==null?void 0:e.replaceAll("=","#"),r=(i=Dh(a))==null?void 0:i.map(s=>(s!=null&&s.includes("(")&&(s="("+(s==null?void 0:s.replaceAll("(",""))),s)),n=[],t={};return r==null||r.forEach((s,f)=>{var c,l,o,u,x;if(!(s!=null&&s.includes("&&"))&&!(s!=null&&s.includes("||"))){let h=s;(s==null?void 0:s[(s==null?void 0:s.length)-1])===")"&&(h=s.slice(0,(s==null?void 0:s.length)-1)),(h==null?void 0:h[0])==="("&&(h=h.slice(1,h==null?void 0:h.length)),h!=null&&h.includes("[")&&(h!=null&&h.includes("]")||(h=(u=(c=h==null?void 0:h.slice(1,h==null?void 0:h.length))==null?void 0:c.split(":"))==null?void 0:u[((o=(l=h==null?void 0:h.slice(1,h==null?void 0:h.length))==null?void 0:l.split(":"))==null?void 0:o.length)-1])),h=h==null?void 0:h.split("#");let d=h[0].replaceAll("'","").replaceAll("]","");d!=null&&d.includes(":")&&(d=d==null?void 0:d.replaceAll(":","."));let p=(x=h[1])==null?void 0:x.replaceAll("'","");(d==null?void 0:d[(d==null?void 0:d.length)-1])!=="!"?t[d]=p:t[d==null?void 0:d.slice(0,(d==null?void 0:d.length)-1)]="!"+p}else s==="&&"||s==="||"&&(n.push(t),t={});f===r.length-1&&(n.push(t),t={})}),n},Ih=(e,a)=>{const r=new Map;let n=[];a.forEach(i=>{for(const[s,f]of Object.entries(i))try{r.set(s.replaceAll("'",""),JSON.parse(f))}catch{r.set(s,[])}});const t=i=>i.map(s=>{var l,o;const f={label:s==null?void 0:s.replaceAll("'","")},c=r.get(s==null?void 0:s.replaceAll("'",""));if(c!=null&&c.length){const u=c.map(x=>e.find(h=>(h==null?void 0:h.replaceAll("'",""))===x)).filter(Boolean);f.children=(f.children||[]).concat(u),f.children=(l=f.children)==null?void 0:l.map(x=>(f==null?void 0:f.label)+"."+(x==null?void 0:x.replaceAll("'",""))),n=[...n,...f.children]}return(o=f.children)!=null&&o.length&&(f.children=t(f.children)),f});return t(e),n},bh=(e,a)=>{const r=(n,t)=>{let i;return i=t==null?void 0:t.map(s=>{var f,c,l,o,u,x,h;if(n!=null&&n.find(d=>{var p;return(d==null?void 0:d.label)===(s==null?void 0:s.prop)||((p=s==null?void 0:s.prop)==null?void 0:p.includes("."+(d==null?void 0:d.prop)))})){let d=n==null?void 0:n.find(p=>{var m;return(p==null?void 0:p.label)===(s==null?void 0:s.prop)||((m=s==null?void 0:s.prop)==null?void 0:m.includes("."+(p==null?void 0:p.prop)))});d!=null&&d.relatedValueId&&(s.relatedValueId=d==null?void 0:d.relatedValueId),d!=null&&d.menuId&&(s.menuId=d==null?void 0:d.menuId,s.directiveLabel="#isMain")}else if(Array.isArray(n==null?void 0:n[0])&&((f=n==null?void 0:n[0])!=null&&f.find(d=>{var p;return(d==null?void 0:d.label)===(s==null?void 0:s.prop)||(d==null?void 0:d.prop)===(s==null?void 0:s.prop)||((p=s==null?void 0:s.prop)==null?void 0:p.includes("."+(d==null?void 0:d.prop)))}))){let d=(c=n==null?void 0:n[0])==null?void 0:c.find(p=>{var m;return(p==null?void 0:p.label)===(s==null?void 0:s.prop)||(p==null?void 0:p.prop)===(s==null?void 0:s.prop)||((m=s==null?void 0:s.prop)==null?void 0:m.includes("."+(p==null?void 0:p.prop)))});d!=null&&d.relatedValueId&&(s.relatedValueId=d==null?void 0:d.relatedValueId),d!=null&&d.menuId&&(s.menuId=d==null?void 0:d.menuId,s.directiveLabel="#isMain"),s.label=(x=(l=s.label)==null?void 0:l.split("."))==null?void 0:x[((u=(o=s.label)==null?void 0:o.split("."))==null?void 0:u.length)-1]}return s!=null&&s.children&&((h=s==null?void 0:s.children)==null?void 0:h.length)>0&&(s.children=r(n,s.children)),s}),i};return r(e,a)},Ws=Ae.defineStore("modelTableComp",{state:()=>({tableIndex:0,tableShowThree:"",multipleTableConst:"."}),actions:{setTableIndex(e){this.tableIndex=e},setTableShowThree(e){this.tableShowThree=e}}}),Ch=Ws(Ae.pinia),{multipleTableConst:lt}=Ae.storeToRefs(Ch),ws=e=>{let a=[];function r(t,i=""){Array.isArray(t)&&(t==null||t.forEach(s=>{Array.isArray(s)||(s=[s]),s==null||s.forEach(f=>{var c,l,o,u,x,h,d,p,m,g,y,v;if(!(f!=null&&f.children)||f.children.length===0)f.prop=i===""?f==null?void 0:f.prop:i+lt.value+((u=(c=f==null?void 0:f.prop)==null?void 0:c.split(lt.value))==null?void 0:u[((o=(l=f==null?void 0:f.prop)==null?void 0:l.split(lt.value))==null?void 0:o.length)-1]),a.push(f.prop);else{let E=i===""?i+((p=(x=f==null?void 0:f.prop)==null?void 0:x.split(lt.value))==null?void 0:p[((d=(h=f==null?void 0:f.prop)==null?void 0:h.split(lt.value))==null?void 0:d.length)-1]):i+lt.value+((v=(m=f==null?void 0:f.prop)==null?void 0:m.split(lt.value))==null?void 0:v[((y=(g=f==null?void 0:f.prop)==null?void 0:g.split(lt.value))==null?void 0:y.length)-1]);n(f.children,E)}})}))}function n(t,i=""){t==null||t.forEach(s=>{var f,c,l,o,u,x,h,d,p,m,g,y;if(!(s!=null&&s.children)||s.children.length===0)s.prop=i===""?s==null?void 0:s.prop:i+lt.value+((o=(f=s==null?void 0:s.prop)==null?void 0:f.split(lt.value))==null?void 0:o[((l=(c=s==null?void 0:s.prop)==null?void 0:c.split(lt.value))==null?void 0:l.length)-1]),a.push(s.prop);else{let v=i===""?i+((d=(u=s==null?void 0:s.prop)==null?void 0:u.split(lt.value))==null?void 0:d[((h=(x=s==null?void 0:s.prop)==null?void 0:x.split(lt.value))==null?void 0:h.length)-1]):i+lt.value+((y=(p=s==null?void 0:s.prop)==null?void 0:p.split(lt.value))==null?void 0:y[((g=(m=s==null?void 0:s.prop)==null?void 0:m.split(lt.value))==null?void 0:g.length)-1]);n(s.children,v)}})}return r(e),a},Oh=(e,a,r)=>{var t;let n=(t=Q.cloneDeep(e))==null?void 0:t.map(i=>(i=i.filter(s=>!(s!=null&&s.id)),i));return n=n==null?void 0:n.map(i=>{var s;return i=(s=i.map((f,c)=>{let l={};if(r!=null&&r.find(o=>o===a[c]))return l[a[c]]=f,l}))==null?void 0:s.filter(f=>f),i}),n},Rh=(e,a)=>{var s,f;const r=Q.cloneDeep(e),n=(s=r==null?void 0:r.find(c=>(c==null?void 0:c.key)==="header"))==null?void 0:s.contents,t=(f=r==null?void 0:r.find(c=>(c==null?void 0:c.key)==="tableContents"))==null?void 0:f.contents;return Oh(t,ws(n).slice(0,ws(n).length-1),a)},Nh=e=>{let a={};return e==null||e.forEach(r=>{a[r.key]=r.value}),a},mf=(e,a)=>{const r=a;return e==null?void 0:e.map(n=>{var i;let t=n;if(!Array.isArray(t)){let s=[];for(let f in t)s.push({key:f,value:t==null?void 0:t[f]});return s}return n=(i=t==null?void 0:t.map((s,f)=>{var c,l;return s!=null&&s.id?{key:"id",value:s==null?void 0:s.id}:r!=null&&r.find(o=>o==null?void 0:o.id)||t!=null&&t.find(o=>o==null?void 0:o.id)?{key:(c=r[f-1])==null?void 0:c.label,value:s}:{key:(l=r[f])==null?void 0:l.label,value:s}}))==null?void 0:i.filter(s=>s.key!=="操作"),n})},Ph=async e=>{var r,n,t,i;let a="";if((n=(r=Q.cloneDeep(e))==null?void 0:r.split("/"))==null||n.forEach((s,f)=>{var c,l;f!==((l=(c=Q.cloneDeep(e))==null?void 0:c.split("/"))==null?void 0:l.length)-1&&(a=a===""?a+s:a+"/"+s)}),a!==""){let s="";const f=await wn(a,sessionStorage.getItem("systemKey"),"");(i=(t=f==null?void 0:f[0])==null?void 0:t.compData)==null||i.forEach(c=>{var l;(c==null?void 0:c.key)==="tableContents"&&((l=c==null?void 0:c.contents)==null||l.forEach((o,u)=>{if(u===0){let x=o==null?void 0:o.filter(h=>!(h!=null&&h.id));s=a+"/"+(x==null?void 0:x[0])}}))}),await Pf(s,e)}},$t=e=>{try{return JSON.parse(e),!0}catch{return!1}},Mh=Q.useLoginState(Ae.pinia),{loginUserInfo:os}=Ae.storeToRefs(Mh),Lh=Q.useUnit(Ae.pinia),{chooseTitle:Ic}=Ae.storeToRefs(Lh),Bh=Q.useMenuState(),{activeMenuPath:jt}=Ae.storeToRefs(Bh),j0=[{key:"@MaxRowNum",value:"onNumSlice",order:1},{key:"@Type",value:"onRandomContents",order:2},{key:"@Filter",value:"onConditionContents",order:4},{key:"@FatherSync",value:"onFatherPaceContents",order:1},{key:"@SonSync",value:"onPaceContents",order:1},{key:"@MultiLead",value:"onMainTagContents",order:3},{key:"@ProButton",value:"onButtonContents",order:1},{key:"@PamButton",value:"onPamButtonContents",order:1},{key:"@RowButton",value:"onRowButtonContents",order:1}],Uh=(e,a,r)=>{var t,i,s,f;let n;return $t(e)?n=JSON.parse(e):n=JSON.parse((f=(s=(i=(t=e==null?void 0:e.replaceAll('"',"“"))==null?void 0:t.replaceAll("““","“"))==null?void 0:i.replaceAll("“",'"'))==null?void 0:s.replaceAll(':",',':"",'))==null?void 0:f.replaceAll(':"}',':""}')),n},Wh=(e,a,r)=>{var t,i,s,f;let n;return $t(e)?n=JSON.parse(e):n=JSON.parse((f=(s=(i=(t=e==null?void 0:e.replaceAll('"',"“"))==null?void 0:t.replaceAll("““","“"))==null?void 0:i.replaceAll("“",'"'))==null?void 0:s.replaceAll(':",',':"",'))==null?void 0:f.replaceAll(':"}',':""}')),n},Hh=(e,a,r)=>{var t,i,s,f;let n;return $t(e)?n=JSON.parse(e):n=JSON.parse((f=(s=(i=(t=e==null?void 0:e.replaceAll('"',"“"))==null?void 0:t.replaceAll("““","“"))==null?void 0:i.replaceAll("“",'"'))==null?void 0:s.replaceAll(':",',':"",'))==null?void 0:f.replaceAll(':"}',':""}')),n},Ql=(e,a,r)=>{let n;return n=e==null?void 0:e.map(t=>{var i;return a!=null&&a.find(s=>{var f;return((f=t==null?void 0:t.prop)==null?void 0:f.includes("."+s))||(t==null?void 0:t.prop)===s})&&(t.menuId=r),t.relatedValueId=!0,t!=null&&t.children&&((i=t==null?void 0:t.children)==null?void 0:i.length)>0&&(t.children=Ql(t.children,a,r)),t}),n},Gh=(e,a,r)=>{var i,s,f,c,l;let n;$t(e)?n=JSON.parse(e):n=JSON.parse((c=(f=(s=(i=e==null?void 0:e.replaceAll('"',"“"))==null?void 0:i.replaceAll("““","“"))==null?void 0:s.replaceAll("“",'"'))==null?void 0:f.replaceAll(':",',':"",'))==null?void 0:c.replaceAll(':"}',':""}'));let t;return(a==null?void 0:a[0])==="["?t=(l=a==null?void 0:a.slice(1,(a==null?void 0:a.length)-1))==null?void 0:l.split(","):t=a==null?void 0:a.split(","),n=n==null?void 0:n.map(o=>(o=o==null?void 0:o.map(u=>{var x;return(u==null?void 0:u.key)==="header"&&(u.contents=(x=u.contents)==null?void 0:x.map((h,d)=>{var p,m,g,y,v,E;if(Array.isArray(h)){let w=(g=(m=o==null?void 0:o.filter(S=>(S==null?void 0:S.key)==="contentTableId"))==null?void 0:m[((p=o==null?void 0:o.filter(S=>(S==null?void 0:S.key)==="contentTableId"))==null?void 0:p.length)-1])==null?void 0:g.contents;h=Ql(h,t,w)}else t!=null&&t.find(w=>w===(h==null?void 0:h.prop))&&(h.menuId=(E=(v=o==null?void 0:o.filter(w=>(w==null?void 0:w.key)==="contentTableId"))==null?void 0:v[((y=o==null?void 0:o.filter(w=>(w==null?void 0:w.key)==="contentTableId"))==null?void 0:y.length)-1])==null?void 0:E.contents,h.directiveLabel="#isMain"),h.relatedValueId=!0;return h})),u}),o)),n},gf=e=>{let a=e;if(a!=null&&a.every(r=>Array.isArray(r))){let r=[];const n=t=>{t==null||t.forEach(i=>{var s;i!=null&&i.children&&((s=i==null?void 0:i.children)==null?void 0:s.length)>0?n(i==null?void 0:i.children):r.push(i)})};return n(a==null?void 0:a[0]),r}else return a},Xh=(e,a,r)=>{var t,i,s,f;let n;return $t(e)?n=JSON.parse(e):n=JSON.parse((f=(s=(i=(t=e==null?void 0:e.replaceAll('"',"“"))==null?void 0:t.replaceAll("““","“"))==null?void 0:i.replaceAll("“",'"'))==null?void 0:s.replaceAll(':",',':"",'))==null?void 0:f.replaceAll(':"}',':""}')),n},$h=(e,a,r)=>{var t,i,s,f;let n;return $t(e)?n=JSON.parse(e):n=JSON.parse((f=(s=(i=(t=e==null?void 0:e.replaceAll('"',"“"))==null?void 0:t.replaceAll("““","“"))==null?void 0:i.replaceAll("“",'"'))==null?void 0:s.replaceAll(':",',':"",'))==null?void 0:f.replaceAll(':"}',':""}')),n},Kh=(e,a,r)=>{let n;$t(e)?n=JSON.parse(e):n=e;let t=a;if((a==null?void 0:a[0])!=="("&&(t="("+a+")"),t.slice(1,(t==null?void 0:t.length)-1)==="undefined")return n;let i=Zl(t);if((i==null?void 0:i.length)>0){let s=[];i==null||i.forEach(f=>{var l,o,u,x,h,d;let c={};for(let p in f){let m=Q.cloneDeep(p);if(!(m!=null&&m.includes("[")))if(((l=f[p])==null?void 0:l.toUpperCase())==="@LOGINUSER")c[m]=(o=os.value)!=null&&o.account?(u=os.value)==null?void 0:u.account:((x=os.value)==null?void 0:x.姓名)??((h=os.value)==null?void 0:h.账号);else if(!((d=f[p])!=null&&d.includes("[")))c[m]=f[p];else{let g="";n==null||n.forEach(y=>{var E,w;let v=(E=y==null?void 0:y.find(S=>(S==null?void 0:S.key)==="header"))==null?void 0:E.contents;v=(w=gf(v))==null?void 0:w.filter(S=>(S==null?void 0:S.label)!=="操作"),y=y==null?void 0:y.map(S=>{if((S==null?void 0:S.key)==="tableContents"){let B=mf(S==null?void 0:S.contents,v),I=B==null?void 0:B.map(U=>{var L;return(L=U==null?void 0:U.find(W=>(W==null?void 0:W.key)===p))==null?void 0:L.value});I=[...new Set(I)],g=I}})}),c[m]=g}}s.push(c)}),n=n==null?void 0:n.map(f=>{var l,o;let c=(l=f==null?void 0:f.find(u=>(u==null?void 0:u.key)==="header"))==null?void 0:l.contents;return c=(o=gf(c))==null?void 0:o.filter(u=>(u==null?void 0:u.label)!=="操作"),f=f==null?void 0:f.map(u=>{if((u==null?void 0:u.key)==="tableContents"){let h=mf(u==null?void 0:u.contents,c);s==null||s.forEach(d=>{var p,m;for(let g in d)!((p=h==null?void 0:h[0])!=null&&p.find(y=>{var v;return(y==null?void 0:y.key)===g||((v=y==null?void 0:y.key)==null?void 0:v.includes(g))}))&&!(h!=null&&h.find(y=>{var v;return(y==null?void 0:y.key)===g||((v=y==null?void 0:y.key)==null?void 0:v.includes(g))}))||(((m=d[g])==null?void 0:m[0])!=="!"?h=h==null?void 0:h.filter(y=>{var v,E;return((v=y==null?void 0:y.find(w=>{var S;return(w==null?void 0:w.key)===g||((S=w==null?void 0:w.key)==null?void 0:S.includes(g))}))==null?void 0:v.value)===d[g]&&!Array.isArray(d==null?void 0:d[g])||Array.isArray(d==null?void 0:d[g])&&((E=d==null?void 0:d[g])==null?void 0:E.find(w=>{var S;return((S=y==null?void 0:y.find(T=>{var B;return(T==null?void 0:T.key)===g||((B=T==null?void 0:T.key)==null?void 0:B.includes(g))}))==null?void 0:S.value)===w}))}):h=h==null?void 0:h.filter(y=>{var v;return((v=y==null?void 0:y.find(E=>{var w;return(E==null?void 0:E.key)===g||((w=E==null?void 0:E.key)==null?void 0:w.includes(g))}))==null?void 0:v.value)!==d[g]}))}),(h==null?void 0:h.length)===0?u.contents=[]:u.contents=h==null?void 0:h.map(d=>{let p={};return d==null||d.forEach(m=>{p[m==null?void 0:m.key]=m==null?void 0:m.value}),p})}return u}),f})}return n},zh=(e,a,r)=>{var t,i,s,f;let n=[];return $t(e)?n=JSON.parse(e):n=JSON.parse((f=(s=(i=(t=e==null?void 0:e.replaceAll('"',"“"))==null?void 0:t.replaceAll("““","“"))==null?void 0:i.replaceAll("“",'"'))==null?void 0:s.replaceAll(':",',':"",'))==null?void 0:f.replaceAll(':"}',':""}')),a.toUpperCase()==="ALL"||a.toUpperCase()==="NONE"||(n=n==null?void 0:n.map(c=>(c=c==null?void 0:c.map(l=>{var o;return(l==null?void 0:l.key)==="tableContents"&&(l.contents=(o=l.contents)==null?void 0:o.slice(0,parseInt(a))),l}),c))),n},Vh=e=>{for(let a=e.length-1;a>0;a--){const r=Math.floor(Math.random()*(a+1));[e[a],e[r]]=[e[r],e[a]]}return e},jh=(e,a,r=0)=>{let n=r;const t=(i,s,f)=>{let c;return c=i==null?void 0:i.map(l=>{var o;return!(l!=null&&l.children)&&n===0?(n=n+1,l.menuId=s):l.relatedValueId=!0,l.relatedValueId=!0,l!=null&&l.children&&((o=l==null?void 0:l.children)==null?void 0:o.length)>0&&(l.children=t(l.children,s)),l}),c};return t(e,a)},Yh=async(e,a,r)=>{var n,t,i,s,f,c,l,o,u,x,h,d,p,m,g,y,v,E,w,S,T,B,I,U,L,W,M,se,ne,he,ce,Ce,K,Te,Fe,_;if(a==="Sequence")return JSON.parse((s=(i=(t=(n=e==null?void 0:e.replaceAll('"',"“"))==null?void 0:n.replaceAll("““","“"))==null?void 0:t.replaceAll("“",'"'))==null?void 0:i.replaceAll(':",',':"",'))==null?void 0:s.replaceAll(':"}',':""}'));if(a==="Auto"){let A=[];$t(e)?A=JSON.parse(e):A=JSON.parse((o=(l=(c=(f=e==null?void 0:e.replaceAll('"',"“"))==null?void 0:f.replaceAll("““","“"))==null?void 0:c.replaceAll("“",'"'))==null?void 0:l.replaceAll(':",',':"",'))==null?void 0:o.replaceAll(':"}',':""}'));const D=await la.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:((h=(x=(u=jt==null?void 0:jt.value)==null?void 0:u.split("/"))==null?void 0:x.filter((G,re)=>{var ee,Z;return re!==((Z=(ee=jt==null?void 0:jt.value)==null?void 0:ee.split("/"))==null?void 0:Z.length)-1}))==null?void 0:h.join(""))+"/"}});let b;return(g=(d=r==null?void 0:r.split("["))==null?void 0:d[0])!=null&&g.includes((m=(p=Ic.value)==null?void 0:p[0])==null?void 0:m.parentContent)&&(b=(v=(y=Ic.value)==null?void 0:y[0])==null?void 0:v.value),!b&&((w=(E=D==null?void 0:D.data)==null?void 0:E.result)==null?void 0:w.length)>0&&(b=(I=(S=jt==null?void 0:jt.value)==null?void 0:S.split("/"))==null?void 0:I[((B=(T=jt==null?void 0:jt.value)==null?void 0:T.split("/"))==null?void 0:B.length)-1]),A=A==null?void 0:A.map(G=>(G=G==null?void 0:G.map(re=>{var Z,J,we,P,Me,be,Ye,Be;let ee=(J=(Z=G==null?void 0:G.find(ie=>(ie==null?void 0:ie.key)==="header"))==null?void 0:Z.contents)==null?void 0:J.filter(ie=>(ie==null?void 0:ie.directiveLabel)==="#isMain");return(ee==null?void 0:ee.length)===0&&Array.isArray((P=(we=G==null?void 0:G.find(ie=>(ie==null?void 0:ie.key)==="header"))==null?void 0:we.contents)==null?void 0:P[0])&&(ee=(Ye=(be=(Me=G==null?void 0:G.find(ie=>(ie==null?void 0:ie.key)==="header"))==null?void 0:Me.contents)==null?void 0:be[0])==null?void 0:Ye.filter(ie=>(ie==null?void 0:ie.directiveLabel)==="#isMain")),(re==null?void 0:re.key)==="tableContents"&&b&&b!==""&&(re.contents=(Be=re.contents)==null?void 0:Be.filter(ie=>ee==null?void 0:ee.some(hr=>(ie==null?void 0:ie[hr==null?void 0:hr.label])===b))),re}),G)),A}else{let A=[];if($t(e)?A=JSON.parse(e):A=JSON.parse((M=(W=(L=(U=e==null?void 0:e.replaceAll('"',"“"))==null?void 0:U.replaceAll("““","“"))==null?void 0:L.replaceAll("“",'"'))==null?void 0:W.replaceAll(':",',':"",'))==null?void 0:M.replaceAll(':"}',':""}')),a.toUpperCase()==="MANUAL"){if(!((ne=(se=A==null?void 0:A[0])==null?void 0:se.find(b=>(b==null?void 0:b.key)==="contentTableId"))!=null&&ne.contents))return A;let D=await la.getInsofDataApi({id:(Te=(K=(he=A==null?void 0:A[0])==null?void 0:he.filter(b=>(b==null?void 0:b.key)==="contentTableId"))==null?void 0:K[((Ce=(ce=A==null?void 0:A[0])==null?void 0:ce.filter(b=>(b==null?void 0:b.key)==="contentTableId"))==null?void 0:Ce.length)-1])==null?void 0:Te.contents});D=(_=(Fe=D==null?void 0:D.data)==null?void 0:Fe.result)==null?void 0:_[0],A=A==null?void 0:A.map(b=>(b=b==null?void 0:b.map(G=>{var re,ee;return(G==null?void 0:G.key)==="header"&&(re=G.contents)!=null&&re.some(Z=>!(Z!=null&&Z.menuId))&&(G.contents=(ee=G.contents)==null?void 0:ee.map((Z,J)=>{var P,Me,be,Ye,Be,ie,hr;let we=(be=(Me=b==null?void 0:b.filter(sr=>(sr==null?void 0:sr.key)==="contentTableId"))==null?void 0:Me[((P=b==null?void 0:b.filter(sr=>(sr==null?void 0:sr.key)==="contentTableId"))==null?void 0:P.length)-1])==null?void 0:be.contents;return Array.isArray(Z)&&((Ye=_n(Z==null?void 0:Z[0]))!=null&&Ye.every(sr=>!(sr!=null&&sr.menuId)))?Z=jh(Z,we):((Z==null?void 0:Z.directiveLabel)==="#isMain"&&(Z.menuId=(hr=(ie=b==null?void 0:b.filter(sr=>(sr==null?void 0:sr.key)==="contentTableId"))==null?void 0:ie[((Be=b==null?void 0:b.filter(sr=>(sr==null?void 0:sr.key)==="contentTableId"))==null?void 0:Be.length)-1])==null?void 0:hr.contents),Z.relatedValueId=!0),Z})),G}),b))}else A=A==null?void 0:A.map(D=>(D=D==null?void 0:D.map(b=>((b==null?void 0:b.key)==="tableContents"&&(b.contents=Vh(b.contents)),b)),D));return A}},Oi=(e,a)=>Array.isArray(e)?e==null?void 0:e.map(n=>{var t,i,s,f,c,l,o;if(Array.isArray(n)?n=n:n=[n],(t=n==null?void 0:n.filter(u=>!(u!=null&&u.id)||typeof(u==null?void 0:u.id)=="string"))!=null&&t.every(u=>typeof u!="object"||u===null))return n;if((i=n==null?void 0:n.filter(u=>!(u!=null&&u.id)||typeof(u==null?void 0:u.id)=="string"))!=null&&i.some(u=>Array.isArray(u)))return n;{let u=[],x=(n==null?void 0:n.find(h=>(h==null?void 0:h.id)&&typeof(h==null?void 0:h.id)=="number"))??{id:(s=n==null?void 0:n[0])==null?void 0:s.id};if(u.push(x),Array.isArray(a==null?void 0:a[0])){const h=(f=n==null?void 0:n.filter(d=>!(d!=null&&d.id)||typeof(d==null?void 0:d.id)=="string"))==null?void 0:f[0];(c=_n(Q.cloneDeep(a==null?void 0:a[0])))==null||c.forEach(d=>{u.push(h==null?void 0:h[(d==null?void 0:d.prop)??(d==null?void 0:d.label)??d])})}else{const h=(l=n==null?void 0:n.filter(d=>!(d!=null&&d.id)||typeof(d==null?void 0:d.id)=="string"))==null?void 0:l[0];(o=_n(Q.cloneDeep(a)))==null||o.forEach(d=>{u.push(h==null?void 0:h[(d==null?void 0:d.prop)??(d==null?void 0:d.label)??d])})}return u}}):void 0,m0=(e,a)=>{let r={};return Array.isArray(e)?e!=null&&e.find(n=>n==null?void 0:n.id)?(e==null?void 0:e.length)>1?e==null||e.forEach((n,t)=>{a!=null&&a[t-1]&&!(n!=null&&n.id)?r[a[t-1]]=n:n!=null&&n.id&&(r.id=n==null?void 0:n.id)}):r=e==null?void 0:e[0]:e==null||e.forEach((n,t)=>{a!=null&&a[t]&&(r[a[t]]=n)}):(a==null||a.forEach(n=>{r[n]=e==null?void 0:e[n]}),r.id=e==null?void 0:e.id),r},eo=Ae.defineStore("authorityState",{state:()=>({routerPageStructures:[]}),actions:{setRouterPageStructure(e){this.routerPageStructures=e}}}),Jh=Q.useMenuState(Ae.pinia),{activeMenuPath:Lw}=Ae.storeToRefs(Jh),qh=Q.useLoginState(Ae.pinia),{structureData:Zh,loginUserInfo:Bw}=Ae.storeToRefs(qh),Qh=eo(Ae.pinia),{routerPageStructures:e1}=Ae.storeToRefs(Qh);Ae.useModelComp(Ae.pinia);zr.ref([{label:"角色名称",value:"",name:"roleName"}]);zr.ref([{label:"查询"},{label:"重置"}]);zr.reactive({isFilter:!1,filterForm:{}});zr.ref(!1);const r1=zr.ref([]),a1=zr.ref([]),t1=zr.ref("");zr.computed(()=>{var a,r,n,t,i;const e=(a=e1.value)==null?void 0:a.find(s=>{var f;return((f=s==null?void 0:s.comp)==null?void 0:f.toUpperCase())==="TABLE"});if(e){t1.value=e.name,a1.value=(t=(n=(r=e==null?void 0:e.compData)==null?void 0:r.find(f=>(f==null?void 0:f.key)==="header"))==null?void 0:n.contents)==null?void 0:t.filter(f=>(f==null?void 0:f.label)!=="操作");const s=(i=e==null?void 0:e.compData)==null?void 0:i.map(f=>{var c;if((f==null?void 0:f.key)==="rowButton"){let l=[];return g1.value?l=[...f==null?void 0:f.contents,{label:"授权"}]:l=f==null?void 0:f.contents,{...f,contents:l}}return(f==null?void 0:f.key)==="header"?{...f,contents:(c=f==null?void 0:f.contents)==null?void 0:c.map(l=>{var o,u;return{...l,isTableColHidden:(o=l==null?void 0:l.prop)==null?void 0:o.includes("授权"),isFormColHidden:(u=l==null?void 0:l.prop)==null?void 0:u.includes("授权")}})}:f});return l1(s),s}return[]});zr.ref({});const n1=zr.ref(),ro=e=>e==null?void 0:e.map(a=>{var n;const r={...a,checkedButtons:[]};return r.children&&((n=r.children)==null?void 0:n.length)>0&&(r.children=ro(r.children)),r}),i1=e=>{for(const a in e)if(Array.isArray(e[a]))return a;return""},s1=e=>Object.prototype.toString.call(e)==="[object Object]"&&e!==null,f1=(e,a)=>{const r={},n=Array.isArray(e)?e==null?void 0:e.filter(t=>{var i;return!(s1(t)&&((i=Object.keys(t))!=null&&i.includes("id")))}):null;return n&&(n==null||n.forEach((t,i)=>{var s;r[(s=a[i])==null?void 0:s.prop]=t})),r},c1=zr.ref(""),l1=e=>{var i;const a=e==null?void 0:e.find(s=>(s==null?void 0:s.key)==="tableContents"),r=e==null?void 0:e.find(s=>(s==null?void 0:s.key)==="header");if(!a||!r)return"";const n=(i=a==null?void 0:a.contents)==null?void 0:i[0],t=f1(n,r==null?void 0:r.contents);c1.value=i1(t)};zr.ref();const o1=zr.reactive({show:!1,title:"角色授权",width:"30%",draggable:!0});zr.ref(0);const bc=zr.ref([]);zr.ref([{path:"资源管理",buttons:["查询","新增","编辑","删除"]},{path:"资源管理/人员",buttons:["查询","新增","编辑","删除"]}]);const Cc=zr.ref([]);zr.watch(()=>Cc.value.length,()=>{var e;(e=n1.value)==null||e.setCheckedKeys([...Cc.value])});zr.watch(()=>o1.show,e=>{e||(bc.value=ro(bc.value))});zr.computed(()=>{var r;const e=(r=Q.cloneDeep(Zh.value))==null?void 0:r.filter(n=>{var t,i;return((i=(t=n==null?void 0:n.key)==null?void 0:t.pageKey)==null?void 0:i.toUpperCase())!=="MENU"});return[...e==null?void 0:e.map(n=>{var s,f,c,l,o,u,x,h;const t=/button/i;let i=(c=(f=(s=n==null?void 0:n.value)==null?void 0:s.pageData)==null?void 0:f.compData)==null?void 0:c.filter(d=>t.test(d==null?void 0:d.key));return i=Array.from(new Set(i==null?void 0:i.flatMap(d=>d.contents.map(p=>p.label)))),{path:(o=(l=n==null?void 0:n.key)==null?void 0:l.pageKey)!=null&&o.startsWith("/")?(x=(u=n==null?void 0:n.key)==null?void 0:u.pageKey)==null?void 0:x.substring(1):(h=n==null?void 0:n.key)==null?void 0:h.pageKey,buttons:i}}),...u1.value]});const u1=zr.ref([]);r1.value;const ao=Q.useLoginState(Ae.pinia),{superAdminInfo:Uw,cryptoInfo:Ww,loginUserInfo:Hw}=Ae.storeToRefs(ao),h1=Q.useMenuState(Ae.pinia),{activeMenuPath:x1}=Ae.storeToRefs(h1),Oc=Ae.useModelComp(Ae.pinia),d1="123456",p1=eo(Ae.pinia),{routerPageStructures:m1}=Ae.storeToRefs(p1);zr.ref(0);zr.ref([{label:"用户名称",value:"",name:"userName"}]);const g1=zr.computed(()=>{const e=sessionStorage.getItem("isSuperAdmin");return e?JSON.parse(e):!1}),v1=zr.ref([]),_1=zr.ref(""),y1=zr.computed(()=>{var a,r,n,t,i;const e=(a=m1.value)==null?void 0:a.find(s=>{var f;return((f=s==null?void 0:s.comp)==null?void 0:f.toUpperCase())==="TABLE"});return e?(_1.value=e.name,v1.value=(t=(n=(r=e==null?void 0:e.compData)==null?void 0:r.find(f=>(f==null?void 0:f.key)==="header"))==null?void 0:n.contents)==null?void 0:t.filter(f=>(f==null?void 0:f.label)!=="操作"),(i=e==null?void 0:e.compData)==null?void 0:i.map(f=>{var c;if((f==null?void 0:f.key)==="rowButton"){const l=[...f==null?void 0:f.contents,{label:"重置密码"}];return{...f,contents:l}}return(f==null?void 0:f.key)==="header"?{...f,contents:(c=f==null?void 0:f.contents)==null?void 0:c.map(l=>{var o,u,x,h;return{...l,isTableColHidden:((o=l==null?void 0:l.prop)==null?void 0:o.includes("头像"))||((u=l==null?void 0:l.prop)==null?void 0:u.includes("签名")),isFormColHidden:((x=l==null?void 0:l.prop)==null?void 0:x.includes("头像"))||((h=l==null?void 0:l.prop)==null?void 0:h.includes("签名"))}})}:f})):[]});zr.ref();const k1=async(e,a,r)=>{var n,t;try{const i=await e(a);return((n=i==null?void 0:i.data)==null?void 0:n.code)===200?(r!=="查询"&&await ao.setLogRecordAsync({type:r,data:a},x1.value),z0.ElMessage.success("保存成功"),Oc.setRefreshCurStructure(!0),i.data.result||((t=i==null?void 0:i.data)==null?void 0:t.code)===200):null}catch(i){z0.ElMessage.error(i)}finally{Oc.setCacheUpdatingData(null)}};y1.value;const l0=Ae.defineStore("originalState",{state:()=>({originalPath:"^"}),actions:{}}),E1=Ae.useModelComp(Ae.pinia),{routeToChildPath:Rc}=Ae.storeToRefs(E1),T1=Q.useLoginState(Ae.pinia),{loginUserInfo:Nc,cryptoInfo:Gw}=Ae.storeToRefs(T1),w1=l0(Ae.pinia),{originalPath:Pc}=Ae.storeToRefs(w1),S1=async(e,a)=>{const r=sessionStorage.getItem("authority"),n=JSON.parse(r||"");if(Array.isArray(n)){let t;Rc.value?t=Array.isArray(n)&&(n==null?void 0:n.filter(f=>(f==null?void 0:f.includes(e))||(f==null?void 0:f.includes(Rc.value)))):t=Array.isArray(n)&&(n==null?void 0:n.filter(f=>f==null?void 0:f.includes(e)));const i=t==null?void 0:t.map(f=>{var c;return((c=f==null?void 0:f.split("/"))==null?void 0:c.pop())||""});return a==null?void 0:a.map(f=>{var c;return{...f,compData:(c=f==null?void 0:f.compData)==null?void 0:c.map(l=>{var o;return(l==null?void 0:l.key)==="rowButton"||(l==null?void 0:l.key)==="extraButton"?{...l,contents:(o=l==null?void 0:l.contents)==null?void 0:o.filter(u=>i==null?void 0:i.includes(u==null?void 0:u.label))}:l})}})}else return typeof n=="string"&&(n==null?void 0:n.toUpperCase())==="SUPERADMIN"?a:[]},A1=(e,a)=>{var i,s,f,c;const r=(s=(i=a["系统管理/角色管理"])==null?void 0:i.filter(l=>{var o;return((o=l==null?void 0:l.key)==null?void 0:o.type)==="data"}))==null?void 0:s.map(l=>l.value.tableData),n=(c=(f=e==null?void 0:e.value)==null?void 0:f.tableData)==null?void 0:c.角色名称,t=r==null?void 0:r.find(l=>(l==null?void 0:l.角色名称)===n);return t==null?void 0:t.数据范围};var Ts=(e=>(e[e.全部数据权限=0]="全部数据权限",e[e.本部门数据权限=1]="本部门数据权限",e[e.本部门及以下数据权限=2]="本部门及以下数据权限",e[e.仅本人数据权限=3]="仅本人数据权限",e[e.自定义数据权限=4]="自定义数据权限",e))(Ts||{});const to=(e,a,r)=>{var s,f,c,l;if(((c=(f=(s=Nc.value)==null?void 0:s.key)==null?void 0:f.layer)==null?void 0:c.toUpperCase())==="SUPERADMIN"||!r)return e;const n=(l=r==null?void 0:r["系统管理/用户管理"])==null?void 0:l.find(o=>{var u;return(o==null?void 0:o.id)===((u=Nc.value)==null?void 0:u.id)}),t=A1(n,r);if(!t)return e;switch(Ts==null?void 0:Ts[t]){case 0:return e;case 1:return a?e===null&&typeof e!="object"?e:Object.fromEntries(Object.entries(e).filter(([u,x])=>{var p,m,g,y,v,E,w,S,T;const h=x==null?void 0:x[1],d=u[(u==null?void 0:u.length)-1]===Pc.value;return((m=(p=h==null?void 0:h.key)==null?void 0:p.createUserLayer)==null?void 0:m.toUpperCase())==="SUPERADMIN"||((g=h==null?void 0:h.key)==null?void 0:g.createUserOrg)===((v=(y=n==null?void 0:n.value)==null?void 0:y.tableData)==null?void 0:v.部门名称)||((E=h==null?void 0:h.key)==null?void 0:E.createUserOrg)===((S=(w=n==null?void 0:n.value)==null?void 0:w.tableData)==null?void 0:S.部门名称)&&((T=h==null?void 0:h.key)==null?void 0:T.createUserId)===(n==null?void 0:n.id)||d})):e==null?void 0:e.filter(o=>{var u,x,h,d,p,m,g,y,v;return((x=(u=o==null?void 0:o.key)==null?void 0:u.createUserLayer)==null?void 0:x.toUpperCase())==="SUPERADMIN"||((h=o==null?void 0:o.key)==null?void 0:h.createUserOrg)===((p=(d=n==null?void 0:n.value)==null?void 0:d.tableData)==null?void 0:p.部门名称)||((m=o==null?void 0:o.key)==null?void 0:m.createUserOrg)===((y=(g=n==null?void 0:n.value)==null?void 0:g.tableData)==null?void 0:y.部门名称)&&((v=o==null?void 0:o.key)==null?void 0:v.createUserId)===(n==null?void 0:n.id)});case 2:break;case 3:return a?e===null&&typeof e!="object"?e:Object.fromEntries(Object.entries(e).filter(([u,x])=>{var p;const h=x==null?void 0:x[1],d=u[(u==null?void 0:u.length)-1]===Pc.value;return((p=h==null?void 0:h.key)==null?void 0:p.createUserId)===(n==null?void 0:n.id)||d})):e==null?void 0:e.filter(o=>{var u;return((u=o==null?void 0:o.key)==null?void 0:u.createUserId)===(n==null?void 0:n.id)})}},F1=Ae.useModelComp(Ae.pinia),{routeToChildPath:mn}=Ae.storeToRefs(F1),In=Q.useMenuState(Ae.pinia),{activeMenuPath:a0}=Ae.storeToRefs(In),Di=Q.useLoginState(),{loginUserInfo:Pa}=Ae.storeToRefs(Di),D1=l0(Ae.pinia),{originalPath:I1}=Ae.storeToRefs(D1),ot=I1.value,b1=e=>{const a=/^name(\d+)$/,r=e==null?void 0:e.map(t=>{const i=[];for(const s in t){const f=s.match(a);f&&i.push({idx:Number(f[1]),value:t[s]})}return!i.length&&t.name&&i.push({idx:-1,value:t.name}),i.sort((s,f)=>s.idx-f.idx),{item:t,names:i}});function n(t,i){if(!t)return[];let s=[];const f=[];t.forEach(x=>{var h;return(((h=x.names)==null?void 0:h.length)>i?s:f).push(x)});const c=f.map(x=>x.item),l=new Map;s=s==null?void 0:s.sort((x,h)=>{var d,p;return((d=x==null?void 0:x.item)==null?void 0:d.orderId)-((p=h==null?void 0:h.item)==null?void 0:p.orderId)});for(const x of s){const h=x.names[x.names.length-i-1].value;l.has(h)||l.set(h,[]),l.get(h).push(x)}return[...Array.from(l.keys()).map(x=>{var m,g,y,v;const h=l.get(x);if(h[0].names.length===1&&(h!=null&&h.every(E=>{var w,S;return((S=(w=E==null?void 0:E.names)==null?void 0:w[0])==null?void 0:S.idx)===-1})))return h[0].item;let d=h==null?void 0:h.filter(E=>{var w,S;return((S=(w=E==null?void 0:E.names)==null?void 0:w[0])==null?void 0:S.idx)!==-1}),p=new Map;return d==null||d.forEach(E=>{let w=E==null?void 0:E.item,S="";for(let T in w)T!=null&&T.includes("name")&&(S=S===""?w==null?void 0:w[T]:S+"/"+(w==null?void 0:w[T]));for(const[T,B]of p.entries())(T.includes(S)||S!=null&&S.includes(T))&&(S=T);p.set(S,E)}),d=Array.from(p.values()),{name:x,isShow:!0,comp:"ParentItem",children:(m=n(d,i+1))==null?void 0:m.sort((E,w)=>(E==null?void 0:E.orderId)-(w==null?void 0:w.orderId)),orderId:(v=(y=(g=n(d,i+1))==null?void 0:g.sort((E,w)=>((E==null?void 0:E.orderId)??0)-((w==null?void 0:w.orderId)??0)))==null?void 0:y[0])==null?void 0:v.orderId}}),...c]}if(r)return n(r,0)},C1=async e=>{let a=new WeakMap,r=e;return a!=null&&a[a0.value+"/"]||(r=e==null?void 0:e.map(n=>{var t;return Array.isArray(n==null?void 0:n.compData)&&(n.compData=(t=n.compData)==null?void 0:t.map(i=>{var s;return(i==null?void 0:i.key)==="header"&&(i.contents=(s=i.contents)==null?void 0:s.map(f=>((f==null?void 0:f.directiveLabel)==="#isMain"&&(f.directiveColor=!0),f))),i})),n})),r},O1=e=>{var n;let a=[],r=[];if(e!=null&&e.find(t=>t==null?void 0:t.choice)){let t=e==null?void 0:e.filter(f=>f==null?void 0:f.choice),i="";for(let f in t==null?void 0:t[0])f!=null&&f.includes("name")&&(i=(n=t==null?void 0:t[0])==null?void 0:n[f]);let s=t==null?void 0:t.map(f=>f!=null&&f.name1?f==null?void 0:f.name0:f==null?void 0:f.name);s=[...new Set(s)],s=s==null?void 0:s.map(f=>({label:f,value:f})),r=[{comp:"Radio",compData:s,name:i,isShow:!0}]}if(e!=null&&e.find(t=>t==null?void 0:t.tab)&&(e==null||e.forEach(t=>{if(!(t!=null&&t.tab))a.push(t);else if(a!=null&&a.find(i=>(i==null?void 0:i.tabInform)===(t==null?void 0:t.tab)))a=a==null?void 0:a.map(i=>{if((i==null?void 0:i.comp)==="Tabs"&&(i==null?void 0:i.tabInform)===(t==null?void 0:t.tab)){let s=i.compData,{tab:f,...c}=t;c.label=c==null?void 0:c.name,c.name="",s.push(c),i.compData=s}return i});else{let{tab:i,...s}=t,f=s==null?void 0:s.name0;s.label=s==null?void 0:s.name,s.name="";let c={comp:"Tabs",name:f,tabInform:t==null?void 0:t.tab,compData:[s],choices:t==null?void 0:t.choice};a.push(c)}})),(a==null?void 0:a.length)===0&&(r==null?void 0:r.length)===0)return e;if((r==null?void 0:r.length)===0)return a;if((a==null?void 0:a.length)===0){let t=e==null?void 0:e.findIndex(i=>(i==null?void 0:i.choice)??(i==null?void 0:i.choices));return e.splice(t,0,r==null?void 0:r[0]),e=e==null?void 0:e.map((i,s)=>{if(s>t){let f={};for(let c in i)c!=null&&c.includes("name")||(f[c]=i==null?void 0:i[c]);f.choiceName=i!=null&&i.name1?i==null?void 0:i.name0:i==null?void 0:i.name,i=f}return i}),e}else{let t=a==null?void 0:a.findIndex(i=>(i==null?void 0:i.choice)??(i==null?void 0:i.choices));return a.splice(t,0,r==null?void 0:r[0]),a=a==null?void 0:a.map((i,s)=>{if(s>t){let f={};for(let c in i)c!=null&&c.includes("name")||(f[c]=i==null?void 0:i[c]);f.choiceName=i!=null&&i.name1?i==null?void 0:i.name0:i==null?void 0:i.name,i=f}return i}),a}},R1=async e=>{let a=e;return a=a==null?void 0:a.filter(r=>r),a=O1(a),a!=null&&a.every(r=>{var n,t;return((t=(n=Object.keys(r))==null?void 0:n.filter(i=>i==null?void 0:i.includes("name")))==null?void 0:t.length)===1})?a:b1(a)},N1=async()=>{var i,s,f,c,l,o,u,x,h,d,p,m,g,y,v,E,w,S,T,B,I,U,L,W,M,se,ne,he,ce,Ce,K,Te,Fe,_,A,D,b,G,re,ee,Z,J,we,P,Me,be,Ye,Be,ie,hr,sr,Ea,Ia,wt,Za,Ta,za,Se,Pe,Ue,wa,er,Cr,me,Dr,Rr,xr;In.setImportLoading(!0);let e="";const a=await la.getInsofDataApi({key:{type:"structure",pageKey:Q.cloneDeep(mn).value,systemKey:sessionStorage.getItem("systemKey")}});if(((s=(i=a==null?void 0:a.data)==null?void 0:i.result)==null?void 0:s.length)>0){let Er=(h=(x=(u=(o=(l=(c=(f=a==null?void 0:a.data)==null?void 0:f.result)==null?void 0:c[0])==null?void 0:l.value)==null?void 0:o.pageData)==null?void 0:u.compData)==null?void 0:x.find(da=>(da==null?void 0:da.key)==="header"))==null?void 0:h.contents;e=(p=(d=Q.cloneDeep(Er))==null?void 0:d[0])==null?void 0:p.label}let r=a0.value;(y=a0.value)!=null&&y.includes(`updateLoading${((m=Pa.value)==null?void 0:m.account)||((g=Pa.value)==null?void 0:g.账号)}`)?r=Q.cloneDeep(a0).value:(w=a0.value)!=null&&w.includes(`loading${((v=Pa.value)==null?void 0:v.account)||((E=Pa.value)==null?void 0:E.账号)}`)&&(r=Q.cloneDeep(mn).value+ot+`loading${((S=Pa.value)==null?void 0:S.account)||((T=Pa.value)==null?void 0:T.账号)}`);const n=await la.getInsofDataApi({key:{pageKey:r,systemKey:sessionStorage.getItem("systemKey")}});let t=[];if(((I=(B=n==null?void 0:n.data)==null?void 0:B.result)==null?void 0:I.length)>0){let Er="",da=[];(L=(U=n==null?void 0:n.data)==null?void 0:U.result)==null||L.forEach(He=>{var Vr,ia,Sa,xa,cr;((ia=(Vr=He==null?void 0:He.value)==null?void 0:Vr.pageData)==null?void 0:ia.comp)==="Form"&&((cr=(xa=(Sa=He==null?void 0:He.value)==null?void 0:Sa.pageData)==null?void 0:xa.compData)==null||cr.forEach(Sr=>{(Sr==null?void 0:Sr.key)==="formContent"&&(da=[...da,...Sr==null?void 0:Sr.contents])}))});let ta=da==null?void 0:da.find(He=>(He==null?void 0:He.isMain)===!0);if(ta?(Er=ta==null?void 0:ta.value,e=ta==null?void 0:ta.key):Er=(Te=(K=(Ce=(ce=(he=(ne=(se=(M=(W=n==null?void 0:n.data)==null?void 0:W.result)==null?void 0:M[0])==null?void 0:se.value)==null?void 0:ne.pageData)==null?void 0:he.compData)==null?void 0:ce.find(He=>(He==null?void 0:He.key)==="formContent"))==null?void 0:Ce.contents)==null?void 0:K.find(He=>{var Vr,ia;return(He==null?void 0:He.key)===e||((ia=(Vr=He==null?void 0:He.optionUrl)==null?void 0:Vr.groupSelect)==null?void 0:ia[1])===e}))==null?void 0:Te.value,(A=a0.value)!=null&&A.includes(`updateLoading${((Fe=Pa.value)==null?void 0:Fe.account)||((_=Pa.value)==null?void 0:_.账号)}`)){let He=[],Vr=[];const ia=await la.getInsofDataApi({key:{pageKey:(be=a0.value.split(ot+`updateLoading${((P=Pa.value)==null?void 0:P.account)||((Me=Pa.value)==null?void 0:Me.账号)}`))==null?void 0:be[0],systemKey:sessionStorage.getItem("systemKey")}});if(((Be=(Ye=ia==null?void 0:ia.data)==null?void 0:Ye.result)==null?void 0:Be.length)>0){let Sa=(ie=n==null?void 0:n.data)==null?void 0:ie.result,xa=(hr=Q.cloneDeep(Sa))==null?void 0:hr.map(async cr=>{var Sr,Ra,Ua,Wa,ft,Ot,Rt,yt,Nt,Pt,Mt,k,N,F;if(((Sr=cr==null?void 0:cr.key)==null?void 0:Sr.type)==="structure"){let C=(ft=(Wa=(Ua=(Ra=cr==null?void 0:cr.value)==null?void 0:Ra.pageData)==null?void 0:Ua.compData)==null?void 0:Wa.find(O=>(O==null?void 0:O.key)==="parentFormPath"))==null?void 0:ft.contents;if(C){let O=await wn(C,sessionStorage.getItem("systemKey"),""),R=(Nt=(yt=(Rt=(Ot=cr==null?void 0:cr.value)==null?void 0:Ot.pageData)==null?void 0:Rt.compData)==null?void 0:yt.find(j=>(j==null?void 0:j.key)==="formContent"))==null?void 0:Nt.contents,X=O==null?void 0:O.filter(j=>(j==null?void 0:j.comp)==="Form");X==null||X.forEach(j=>{var z;(z=j==null?void 0:j.compData)==null||z.forEach(V=>{var Y,le;if((V==null?void 0:V.key)==="formContent"&&((Y=V==null?void 0:V.contents)==null?void 0:Y.some(Ee=>R==null?void 0:R.find(ue=>(ue==null?void 0:ue.prop)===(Ee==null?void 0:Ee.prop))))){let Ee=j;Ee.compData=(le=Ee.compData)==null?void 0:le.map(ge=>{var Ze;return(ge==null?void 0:ge.key)==="formContent"&&(ge.contents=(Ze=ge.contents)==null?void 0:Ze.map(Tr=>{var Lr;return R!=null&&R.find(Kr=>(Kr==null?void 0:Kr.prop)===(Tr==null?void 0:Tr.prop))&&(Tr.value=(Lr=R==null?void 0:R.find(Kr=>(Kr==null?void 0:Kr.prop)===(Tr==null?void 0:Tr.prop)))==null?void 0:Lr.value),Tr})),ge});let ue={};for(let ge in Ee)ge!=="id"&&(ue[ge]=Ee[ge]);t.push({id:j==null?void 0:j.id,value:{pageData:ue}})}})})}else if((Mt=(Pt=ia==null?void 0:ia.data)==null?void 0:Pt.result)!=null&&Mt.find(O=>{var R,X,j,z;return((X=(R=O==null?void 0:O.value)==null?void 0:R.pageData)==null?void 0:X.name)===((z=(j=cr==null?void 0:cr.value)==null?void 0:j.pageData)==null?void 0:z.name)})){let O=cr==null?void 0:cr.key;O.pageKey=Q.cloneDeep(mn).value+ot+Er,t.push({id:(F=(N=(k=ia==null?void 0:ia.data)==null?void 0:k.result)==null?void 0:N.find(R=>{var X,j,z,V;return((j=(X=R==null?void 0:R.value)==null?void 0:X.pageData)==null?void 0:j.name)===((V=(z=cr==null?void 0:cr.value)==null?void 0:z.pageData)==null?void 0:V.name)}))==null?void 0:F.id,key:O,value:cr==null?void 0:cr.value})}else{let O=cr==null?void 0:cr.key;O.pageKey=Q.cloneDeep(mn).value+ot+Er,He.push({key:O,value:cr==null?void 0:cr.value})}}});await Promise.all(xa),(Ea=(sr=n==null?void 0:n.data)==null?void 0:sr.result)==null||Ea.forEach(cr=>{var Ra,Ua,Wa;let Sr=(Ra=Q.cloneDeep(cr))==null?void 0:Ra.key;Sr.pageKey=Q.cloneDeep(mn).value+ot+Er+ot+`updateLoading${((Ua=Pa.value)==null?void 0:Ua.account)||((Wa=Pa.value)==null?void 0:Wa.账号)}`,In.setChildMenu(Sr.pageKey),t.push({id:cr==null?void 0:cr.id,key:Sr})})}if(Er===""){z0.ElMessage.error(`保存失败,${e}的必填字段没有填写`),In.setImportLoading(!1);return}if((t==null?void 0:t.length)>0){await la.batchUpdateInsofDataApi({dataList:t}),(Ia=t==null?void 0:t[0])!=null&&Ia.key&&await Di.setLogRecordAsync({type:"保存",data:t},(wt=t==null?void 0:t[0])==null?void 0:wt.key),(He==null?void 0:He.length)>0&&(await la.batchAddInsofDataApi({dataList:He}),(Za=He==null?void 0:He[0])!=null&&Za.key&&await Di.setLogRecordAsync({type:"保存",data:He},(Ta=He==null?void 0:He[0])==null?void 0:Ta.key));const Sa=await la.getInsofDataApi({key:{pageKey:(Pe=a0.value.split(ot+`updateLoading${((za=Pa.value)==null?void 0:za.account)||((Se=Pa.value)==null?void 0:Se.账号)}`))==null?void 0:Pe[0],systemKey:sessionStorage.getItem("systemKey")}});if(((wa=(Ue=Sa==null?void 0:Sa.data)==null?void 0:Ue.result)==null?void 0:wa.length)>0){let xa=[],cr=(er=n==null?void 0:n.data)==null?void 0:er.result;(Cr=Q.cloneDeep(cr))==null||Cr.forEach(Sr=>{var Ra,Ua,Wa,ft,Ot,Rt,yt,Nt,Pt,Mt,k,N;if(((Ra=Sr==null?void 0:Sr.key)==null?void 0:Ra.type)!=="structure"){let F=(ft=(Wa=(Ua=Sa==null?void 0:Sa.data)==null?void 0:Ua.result)==null?void 0:Wa.filter(X=>{var j;return((j=X==null?void 0:X.key)==null?void 0:j.type)==="data"}))==null?void 0:ft.map(X=>X==null?void 0:X.id);xa=[...xa,...F];let C=(Nt=(yt=(Rt=(Ot=Q.cloneDeep(cr))==null?void 0:Ot.find(X=>{var j;return((j=Sr==null?void 0:Sr.key)==null?void 0:j.tableId)===(X==null?void 0:X.id)}))==null?void 0:Rt.value)==null?void 0:yt.pageData)==null?void 0:Nt.name,O=(k=(Mt=(Pt=Sa==null?void 0:Sa.data)==null?void 0:Pt.result)==null?void 0:Mt.find(X=>{var j,z;return((z=(j=X==null?void 0:X.value)==null?void 0:j.pageData)==null?void 0:z.name)===C}))==null?void 0:k.id,R=(N=Q.cloneDeep(Sr))==null?void 0:N.key;R.tableId=O,R.pageKey=Q.cloneDeep(mn).value+ot+Er,Vr.push({key:R,value:Sr==null?void 0:Sr.value})}}),(xa==null?void 0:xa.length)>0&&(xa=[...new Set(xa)],await la.batchDeleteInsofDataApi({ids:xa})),(Dr=(me=n==null?void 0:n.data)==null?void 0:me.result)==null||Dr.forEach(Sr=>{var Ua,Wa,ft;let Ra=(Ua=Q.cloneDeep(Sr))==null?void 0:Ua.key;Ra.pageKey=Q.cloneDeep(mn).value+ot+Er+ot+`updateLoading${((Wa=Pa.value)==null?void 0:Wa.account)||((ft=Pa.value)==null?void 0:ft.账号)}`,In.setChildMenu(Ra.pageKey),t.push({id:Sr==null?void 0:Sr.id,key:Ra})})}(Vr==null?void 0:Vr.length)>0&&(await la.batchAddInsofDataApi({dataList:Vr}),(Rr=He==null?void 0:He[0])!=null&&Rr.key&&await Di.setLogRecordAsync({type:"保存",data:Vr},(xr=Vr==null?void 0:Vr[0])==null?void 0:xr.key)),z0.ElMessage.success("保存成功")}}else{if((b=(D=n==null?void 0:n.data)==null?void 0:D.result)==null||b.forEach(He=>{var ia;let Vr=(ia=Q.cloneDeep(He))==null?void 0:ia.key;Vr.pageKey=Q.cloneDeep(mn).value+ot+Er,In.setChildMenu(Vr.pageKey),t.push({id:He==null?void 0:He.id,key:Vr})}),Er===""){z0.ElMessage.error(`保存失败,${e}的必填字段没有填写`),In.setImportLoading(!1),In.setChildMenu("");return}(G=t==null?void 0:t[0])!=null&&G.key&&(await la.batchUpdateInsofDataApi({dataList:t}),await Di.setLogRecordAsync({type:"保存",data:t},(re=t==null?void 0:t[0])==null?void 0:re.key)),await Pf(Q.cloneDeep(mn).value+ot+Er,Q.cloneDeep(mn).value+ot+Er+ot+`updateLoading${((ee=Pa.value)==null?void 0:ee.account)||((Z=Pa.value)==null?void 0:Z.账号)}`),In.setActiveMenuPath(Q.cloneDeep(mn).value+ot+Er+ot+`updateLoading${((J=Pa.value)==null?void 0:J.account)||((we=Pa.value)==null?void 0:we.账号)}`),z0.ElMessage.success("保存成功")}}In.setImportLoading(!1)},P1=(e,a)=>{let r=e;const n=[];let t="",i=0;for(const s of r)i++,s.includes("{")||t.includes("{")||s.includes("[")||t.includes("[")||s.includes("【")||t.includes("【")||s.includes("(")||t.includes("(")||s.includes("(")||t.includes("(")||s.includes("/*")||t.includes("/*")?(t+=s.trim(),Q.cloneDeep(t).split("{").length-1===Q.cloneDeep(t).split("}").length-1&&Q.cloneDeep(t).split("【").length-1===Q.cloneDeep(t).split("】").length-1&&Q.cloneDeep(t).split("[").length-1===Q.cloneDeep(t).split("]").length-1&&Q.cloneDeep(t).split("(").length-1===Q.cloneDeep(t).split(")").length-1&&Q.cloneDeep(t).split("(").length-1===Q.cloneDeep(t).split(")").length-1&&Q.cloneDeep(t).split("/*").length-1===Q.cloneDeep(t).split("*/").length-1&&t[t.length-1]!==","&&t[t.length-1]===a?(n.push(t.replace(/\/\*[\s\S]*?\*\//g,"")),t=""):i===(e==null?void 0:e.length)&&n.push(t.replace(/\/\*[\s\S]*?\*\//g,""))):(t+=s.trim(),(t==null?void 0:t[(t==null?void 0:t.length)-1])===a&&(n.push(t.replace(/\/\*[\s\S]*?\*\//g,"")),t=""));return n},Mc=(e,a)=>{let r=e;const n=[];let t="",i=0;for(const s of r)i++,s.includes("{")||t.includes("{")||s.includes("[")||t.includes("[")||s.includes("【")||t.includes("【")||s.includes("(")||t.includes("(")||s.includes("(")||t.includes("(")||s.includes("/*")||t.includes("/*")?(t+=s.trim(),Q.cloneDeep(t).split("{").length-1===Q.cloneDeep(t).split("}").length-1&&Q.cloneDeep(t).split("【").length-1===Q.cloneDeep(t).split("】").length-1&&Q.cloneDeep(t).split("[").length-1===Q.cloneDeep(t).split("]").length-1&&Q.cloneDeep(t).split("(").length-1===Q.cloneDeep(t).split(")").length-1&&Q.cloneDeep(t).split("(").length-1===Q.cloneDeep(t).split(")").length-1&&Q.cloneDeep(t).split("/*").length-1===Q.cloneDeep(t).split("*/").length-1&&(t[t.length-1]===":"&&t[t.length-2]!=="r"||t[t.length-1]===a)&&(t.match(/'/g)||[]).length%2===0?(n.push(t.replace(/\/\*[\s\S]*?\*\//g,"")),t=""):i===(e==null?void 0:e.length)&&(n.push(t.replace(/\/\*[\s\S]*?\*\//g,"")),t="")):(t+=s.trim(),((t==null?void 0:t[(t==null?void 0:t.length)-1])===a||t[t.length-1]===":"&&t[t.length-2]!=="r")&&(t.match(/'/g)||[]).length%2===0&&(n.push(t.replace(/\/\*[\s\S]*?\*\//g,"")),t=""));return(t==null?void 0:t.length)!==0&&n.push(t.replace(/\/\*[\s\S]*?\*\//g,"")),n},Lc=(e,a)=>{let r=0;for(let n=0;n<e.length;n++)e[n]===a&&r++;return r%2===0},p0=(e,a)=>{let r=e;const n=[];let t="",i=0;for(const s of r)i++,s.includes("{")||t.includes("{")||s.includes("[")||t.includes("[")||s.includes("【")||t.includes("【")||s.includes("(")||t.includes("(")||s.includes("(")||t.includes("(")||s.includes("/*")||t.includes("/*")?(t+=s.trim(),Q.cloneDeep(t).split("{").length-1===Q.cloneDeep(t).split("}").length-1&&Q.cloneDeep(t).split("【").length-1===Q.cloneDeep(t).split("】").length-1&&Q.cloneDeep(t).split("[").length-1===Q.cloneDeep(t).split("]").length-1&&Q.cloneDeep(t).split("(").length-1===Q.cloneDeep(t).split(")").length-1&&Q.cloneDeep(t).split("(").length-1===Q.cloneDeep(t).split(")").length-1&&Q.cloneDeep(t).split("/*").length-1===Q.cloneDeep(t).split("*/").length-1&&t[t.length-1]===a&&Lc(t,"'")?(n.push(t.replace(/\/\*[\s\S]*?\*\//g,"")),t=""):i===(e==null?void 0:e.length)&&(n.push(t.replace(/\/\*[\s\S]*?\*\//g,"")),t="")):(t+=s.trim(),(t==null?void 0:t[(t==null?void 0:t.length)-1])===a&&Lc(t,"'")&&(n.push(t.replace(/\/\*[\s\S]*?\*\//g,"")),t=""));return(t==null?void 0:t.length)!==0&&n.push(t.replace(/\/\*[\s\S]*?\*\//g,"")),n},M1=l0(Ae.pinia),{originalPath:Xw}=Ae.storeToRefs(M1),L1=e=>{var r,n;let a=(n=(r=e==null?void 0:e.slice(1,(e==null?void 0:e.length)-1))==null?void 0:r.split(","))==null?void 0:n.map(t=>{var i,s,f,c,l;return(l=(c=(f=(s=(i=t==null?void 0:t.split("=="))==null?void 0:i[0])==null?void 0:s.replaceAll("'",""))==null?void 0:f.split("#"))==null?void 0:c[0])==null?void 0:l.trim()});return a=JSON.stringify(a),a},vf=e=>{let a=Q.cloneDeep(e),r=[],n="",t="",i=(a==null?void 0:a[0])==="["?Mc(a.slice(1,a.length-1),","):Mc(a,",");return i==null||i.forEach((s,f)=>{var l,o,u,x,h,d,p,m;let c=s;if(c[c.length-1]===","&&(c=c.slice(0,c.length-1)),c.slice(1,(c==null?void 0:c.length)-1).includes("[")&&(c==null?void 0:c[0])==="["){let g=vf(c);if((i==null?void 0:i.length)===2&&((o=i==null?void 0:i[0])==null?void 0:o[((l=i==null?void 0:i[0])==null?void 0:l.length)-1])===":"){let y=i[f-1].replaceAll(",","").trim();y[y.length-1]===":"&&(y=y.slice(0,y.length-1));let v=(u=vf(c))==null?void 0:u.parentStringContent;v="["+((x=v==null?void 0:v.slice(0,(v==null?void 0:v.length)-1))==null?void 0:x.replaceAll("'",'"'))+"]";let E={[y]:v};r.push(E)}else t=t+c+",";n=n+(g==null?void 0:g.stringContent),t=t+(g==null?void 0:g.parentStringContent),r=[...r,...g==null?void 0:g.parentColumns]}else if((c==null?void 0:c[0])!=="["&&c[c.length-1]===":")c=c.slice(0,c.length-1),n=n+c+",",t=t+((h=c==null?void 0:c.split("#"))==null?void 0:h[0])+",";else if((c==null?void 0:c[0])==="["&&i[f-1]){(p=(d=c==null?void 0:c.slice(1,(c==null?void 0:c.length)-1))==null?void 0:d.split(","))==null||p.forEach(v=>{n=n+v+","});let g=i[f-1].replaceAll(",","").trim();g[g.length-1]===":"&&(g=g.slice(0,g.length-1));let y={[g]:L1(c)};r.push(y)}else n=n+c+",",t=t+((m=c==null?void 0:c.split("#"))==null?void 0:m[0])+","}),{parentColumns:r,stringContent:n,parentStringContent:t}},_f=Q.useMenuState(Ae.pinia),{activeMenuPath:us}=Ae.storeToRefs(_f),B1=Q.useUnit(Ae.pinia),{chooseTitle:Ai}=Ae.storeToRefs(B1);let br="$R";const U1=Ws(Ae.pinia),{multipleTableConst:Bc}=Ae.storeToRefs(U1),W1=Q.useLoginState(Ae.pinia),{loginUserInfo:$w,systemInfo:Uc}=Ae.storeToRefs(W1),no=Ae.useModelComp(Ae.pinia),H1=l0(Ae.pinia),{originalPath:G1}=Ae.storeToRefs(H1),{payloadTypes:Kw}=Ae.storeToRefs(no),gn=(e,a)=>(a==null?void 0:a.split(",")).some(n=>Object.keys(e).some(t=>t.startsWith("name")&&e[t]===n)),Qs={onNumSlice:zh,onRandomContents:Yh,onConditionContents:Kh,onPaceContents:$h,onMainTagContents:Gh,onFatherPaceContents:Xh,onButtonContents:Hh,onPamButtonContents:Wh,onRowButtonContents:Uh},io=async e=>{const a=e.slice(0,e.indexOf("(")).trim(),r=Qs==null?void 0:Qs[a];if(typeof r!="function"){console.log(`找不到函数: ${a}`);return}const n=e.slice(e.indexOf("(")+1,e.lastIndexOf(")")),t=await new Function(`return [${n}]`)();return r(...Array.isArray(t)?t:[t])},yf=(e,a,r="children")=>{var f;let n=[],t=[],i=[],s=0;for(const c of e){const l=a.some(x=>{var d,p,m,g,y,v,E,w;const[h]=x.split(".");return h===c.prop||h===c.label||h===((g=(d=c.prop)==null?void 0:d.split("."))==null?void 0:g[((m=(p=c.prop)==null?void 0:p.split("."))==null?void 0:m.length)-1])||h===((w=(y=c.prop)==null?void 0:y.split("."))==null?void 0:w[((E=(v=c.prop)==null?void 0:v.split("."))==null?void 0:E.length)-1].replace(/\d+$/,""))}),o=a.filter(x=>x.includes(".")).map(x=>x.split(".").slice(1).join("."));s=s+1;let u;if(l&&(u={...c},t.push(s),i.push(u==null?void 0:u.prop),delete u[r]),c[r]){const x=(f=yf(c[r],(o==null?void 0:o.length)>0?o:a,r))==null?void 0:f.contents;x.length&&(t.push(s),i.push(u==null?void 0:u.prop),s=s+1,u=u||{...c},n=[...n,...x],u=x)}u&&!Array.isArray(u)&&n.push(u)}return{contents:n,ids:t,props:i}},X1=e=>{if(!$t(e))return[e];const a=new Function(`return ${e}`)(),r=[];return((t,i="")=>{for(const s of t)if(Array.isArray(s)){const[f,c]=s;Array.isArray(c)?c.forEach(l=>r.push(`"${f}:${l}"`)):r.push(i?`"${i}:${f}"`:'"'+f+'"')}else r.push('"'+s+'"')})(a),r},$1=async(e,a,r,n,t,i)=>{var l,o,u,x,h,d,p,m,g,y,v,E,w,S,T,B,I,U,L,W,M,se,ne,he,ce,Ce,K,Te,Fe,_,A,D,b,G,re,ee,Z,J,we,P,Me,be,Ye,Be,ie,hr,sr,Ea,Ia,wt,Za,Ta,za,Se,Pe,Ue,wa,er,Cr,me,Dr,Rr,xr,Er,da,ta,He,Vr,ia,Sa,xa,cr,Sr,Ra,Ua,Wa,ft,Ot,Rt,yt,Nt,Pt,Mt,k,N,F,C,O,R,X,j,z,V,Y,le,_e,Ee,ue,ge,Ze,Tr,Lr,Kr,sn,fn,cn,Lt,Pn;let s=[],f=(o=(l=e==null?void 0:e.find(rr=>(rr==null?void 0:rr.key)==="header"))==null?void 0:l.contents)==null?void 0:o.filter(rr=>!(rr!=null&&rr.columnPath)&&(rr==null?void 0:rr.label)!=="操作"),c=(x=(u=e==null?void 0:e.find(rr=>(rr==null?void 0:rr.key)==="header"))==null?void 0:u.contents)==null?void 0:x.filter(rr=>rr==null?void 0:rr.columnPath);if(Array.isArray((d=(h=e==null?void 0:e.find(rr=>(rr==null?void 0:rr.key)==="header"))==null?void 0:h.contents)==null?void 0:d[0])){let rr=(g=(m=(p=e==null?void 0:e.find(de=>(de==null?void 0:de.key)==="header"))==null?void 0:p.contents)==null?void 0:m[0])==null?void 0:g.filter(de=>de==null?void 0:de.columnPath);c=[...c,...rr]}for(let rr=0;rr<(c==null?void 0:c.length);rr++){let de=Q.cloneDeep(c==null?void 0:c[rr]);if(de.columnPath=(v=(y=de==null?void 0:de.columnPath)==null?void 0:y.replaceAll("{",""))==null?void 0:v.replaceAll("}",""),de||(de=(T=(S=_n((w=(E=e==null?void 0:e.find(Ne=>(Ne==null?void 0:Ne.key)==="header"))==null?void 0:E.contents)==null?void 0:w[0]))==null?void 0:S.filter(Ne=>Ne==null?void 0:Ne.columnPath))==null?void 0:T[rr]),de!=null&&de.columnPath&&(de==null?void 0:de.columnPath)!==""){let Ne="";if((B=de==null?void 0:de.columnPath)!=null&&B.includes("@Type")||(Ne=Ne===""?Ne+"@Type:Manual":Ne+",@Type:Manual"),(I=de==null?void 0:de.columnPath)!=null&&I.includes("@SonSync")||(Ne=Ne===""?Ne+"@SonSync:No":Ne+",@SonSync:No"),(U=de==null?void 0:de.columnPath)!=null&&U.includes("@FatherSync")||(Ne=Ne===""?Ne+"@FatherSync:Yes":Ne+",@FatherSync:Yes"),((W=de==null?void 0:de.columnPath)==null?void 0:W[((L=de==null?void 0:de.columnPath)==null?void 0:L.length)-1])===")"){let Br="";((se=(M=de.columnPath)==null?void 0:M.split("("))==null?void 0:se.length)!==((he=(ne=de.columnPath)==null?void 0:ne.split(")"))==null?void 0:he.length)?Br=((Ce=de.columnPath)==null?void 0:Ce.slice(0,(ce=de.columnPath)==null?void 0:ce.length))+","+Ne+")":Br=((Te=de.columnPath)==null?void 0:Te.slice(0,((K=de.columnPath)==null?void 0:K.length)-1))+","+Ne+")",de.columnPath=Ne===""?de.columnPath:Br}else(Fe=de==null?void 0:de.columnPath)!=null&&Fe.includes("@")?de.columnPath=de.columnPath+","+Ne+")":de.columnPath=de.columnPath+"("+Ne+")"}let Mn=(_=e==null?void 0:e.find(Ne=>(Ne==null?void 0:Ne.key)==="dictContents"))==null?void 0:_.contents,L0="",Ln=(b=(D=(A=c==null?void 0:c[rr])==null?void 0:A.columnPath)==null?void 0:D.replace("[",br))==null?void 0:b.split(br),jr=(ee=(re=(G=Ln==null?void 0:Ln[(Ln==null?void 0:Ln.length)-1])==null?void 0:G.replace("(",br))==null?void 0:re.split(br))==null?void 0:ee[0];jr=jr==null?void 0:jr.slice(0,(jr==null?void 0:jr.length)-1);let Xe=(Me=(P=(we=(J=Q.cloneDeep((Z=c==null?void 0:c[rr])==null?void 0:Z.columnPath))==null?void 0:J.split("["+jr+"]"))==null?void 0:we[0])==null?void 0:P.replaceAll("{",""))==null?void 0:Me.replaceAll("}","");(Xe==null?void 0:Xe[(Xe==null?void 0:Xe.length)-1])==="/"&&((Ye=(be=Ai.value)==null?void 0:be[0])!=null&&Ye.value)&&(Xe=Xe+((ie=(Be=Ai.value)==null?void 0:Be[0])==null?void 0:ie.value));let pa="",Bn="",lr="",Ha=Q.cloneDeep(jr);if(jr=(sr=(hr=jr==null?void 0:jr.split(":"))==null?void 0:hr[0])==null?void 0:sr.replaceAll("'",""),Xe===""&&((Ia=(Ea=Ai.value)==null?void 0:Ea[0])!=null&&Ia.value&&((Za=(wt=Ai.value)==null?void 0:wt[0])==null?void 0:Za.value)!==""?Xe=us.value+"/"+((za=(Ta=Ai.value)==null?void 0:Ta[0])==null?void 0:za.value):Xe=us.value),Xe!=null&&Xe.includes("[")){let Ne=(wa=(Ue=(Pe=(Se=Xe==null?void 0:Xe.split("["))==null?void 0:Se[1])==null?void 0:Pe.split("]"))==null?void 0:Ue[0])==null?void 0:wa.split("/");Bn=Xe,pa=(me=(Cr=(er=Xe==null?void 0:Xe.split("["))==null?void 0:er[1])==null?void 0:Cr.split("]"))==null?void 0:me[0];let Br="";r==null||r.forEach(na=>{var Ur,Le,B0,te,H;((Le=(Ur=na==null?void 0:na.value)==null?void 0:Ur.pageData)==null?void 0:Le.name)===(Ne==null?void 0:Ne[0])&&((H=(te=(B0=na==null?void 0:na.value)==null?void 0:B0.pageData)==null?void 0:te.compData)==null||H.forEach(q=>{var pe;(q==null?void 0:q.key)==="formContent"&&((pe=q==null?void 0:q.contents)==null||pe.forEach(xe=>{var Ar;if((xe==null?void 0:xe.prop)===(Ne==null?void 0:Ne[1])){let ea=xo((Ar=Q.cloneDeep(xe))==null?void 0:Ar.optionUrl,n);Br=(xe==null?void 0:xe.value)||ea||""}}))}))}),lr=Br,Xe=((Dr=Xe==null?void 0:Xe.split("["))==null?void 0:Dr[0])+Br}(Xe==null?void 0:Xe[(Xe==null?void 0:Xe.length)-1])==="/"&&(Xe=Xe.slice(0,(Xe==null?void 0:Xe.length)-1));let oe=[];s!=null&&s.every(Ne=>Array.isArray(Ne))&&(s==null?void 0:s.length)>0&&(oe=s==null?void 0:s[0]);let Ir=await la.getInsofDataApi({key:{pageKey:Xe,systemKey:sessionStorage.getItem("systemKey"),type:"structure"}});((xr=(Rr=Ir==null?void 0:Ir.data)==null?void 0:Rr.result)==null?void 0:xr.length)===0&&(Xe=(da=(Er=Xe==null?void 0:Xe.split("/"))==null?void 0:Er.filter((Ne,Br)=>{var na;return Br!==((na=Xe==null?void 0:Xe.split("/"))==null?void 0:na.length)-1}))==null?void 0:da.join("/"),Ir=await la.getInsofDataApi({key:{pageKey:Xe,systemKey:sessionStorage.getItem("systemKey"),type:"structure"}}));let Re=(ia=(Vr=(He=(ta=Ha==null?void 0:Ha.split("{"))==null?void 0:ta[0])==null?void 0:He.replace("[",br))==null?void 0:Vr.split(br))==null?void 0:ia[0];const Na=await la.getInsofDataApi({key:{pageKey:t??us.value,systemKey:sessionStorage.getItem("systemKey"),tableId:parseInt(a),type:"data"}}),Qa=[];if((xa=(Sa=Na==null?void 0:Na.data)==null?void 0:Sa.result)==null||xa.forEach(Ne=>{var Br;Qa.push({id:Ne==null?void 0:Ne.id,value:Ne.value.tableData,parentId:(Br=Ne==null?void 0:Ne.key)==null?void 0:Br.parentId})}),(Qa==null?void 0:Qa.length)===0){const Ne=await la.getInsofDataApi({key:{pageKey:Xe,systemKey:sessionStorage.getItem("systemKey"),tableId:parseInt(a),type:"data"}});(Sr=(cr=Ne==null?void 0:Ne.data)==null?void 0:cr.result)==null||Sr.forEach(Br=>{var na;Qa.push({id:Br==null?void 0:Br.id,value:Br.value.tableData,parentId:(na=Br==null?void 0:Br.key)==null?void 0:na.parentId})})}if(Array.isArray((Ra=Ir==null?void 0:Ir.data)==null?void 0:Ra.result)&&((Wa=(Ua=Ir==null?void 0:Ir.data)==null?void 0:Ua.result)==null?void 0:Wa.length)>0){let Ne;if((Re==null?void 0:Re[(Re==null?void 0:Re.length)-1])===":"&&(Re=Re==null?void 0:Re.slice(1,(Re==null?void 0:Re.length)-1)),Re=(Rt=(Ot=Re==null?void 0:Re.split(":"))==null?void 0:Ot[((ft=Re==null?void 0:Re.split(":"))==null?void 0:ft.length)-1])==null?void 0:Rt.replaceAll("'",""),((Nt=(yt=Ir==null?void 0:Ir.data)==null?void 0:yt.result)==null?void 0:Nt.find(te=>{var H;return gn((H=te==null?void 0:te.value)==null?void 0:H.pageData,Re)}))??((Mt=(Pt=Ir==null?void 0:Ir.data)==null?void 0:Pt.result)==null?void 0:Mt.find(te=>{var H;return gn((H=te==null?void 0:te.value)==null?void 0:H.pageData,jr)}))){let te=(N=(k=Ir==null?void 0:Ir.data)==null?void 0:k.result)==null?void 0:N.sort((H,q)=>H.id-q.id);Ne=await(te==null?void 0:te.map(async H=>{var pe,xe,Ar,ea,sa,vr,ma,Fr,Or,Wr,Yr,gr,Xr,dr,Jr,St,ln,on,un,hn,xn,dn,pn,Ge,Yn,Jn,qn,Zn,or,ur,$e,ca,Un,fi,ci,li,oi,ui,hi,xi,di,pi,mi,gi,vi,_i,yi,ki,Ei,ga,Ke,Ie,Je,va,ve,ct,_r,fr,et;let q;if(gn((pe=H==null?void 0:H.value)==null?void 0:pe.pageData,Re)||gn((xe=H==null?void 0:H.value)==null?void 0:xe.pageData,jr)&&((ea=(Ar=H==null?void 0:H.value)==null?void 0:Ar.pageData)==null?void 0:ea.name)===jr){q=Q.cloneDeep((vr=(sa=H==null?void 0:H.value)==null?void 0:sa.pageData)==null?void 0:vr.compData);let Va;gn((ma=H==null?void 0:H.value)==null?void 0:ma.pageData,Re)&&Re===jr?(Or=(Fr=H==null?void 0:H.value)==null?void 0:Fr.pageData)!=null&&Or.name1?Va={name:(Yr=(Wr=H==null?void 0:H.value)==null?void 0:Wr.pageData)==null?void 0:Yr.name,name0:(Xr=(gr=H==null?void 0:H.value)==null?void 0:gr.pageData)==null?void 0:Xr.name0,name1:(Jr=(dr=H==null?void 0:H.value)==null?void 0:dr.pageData)==null?void 0:Jr.name1}:Va={name:(ln=(St=H==null?void 0:H.value)==null?void 0:St.pageData)==null?void 0:ln.name,name0:(un=(on=H==null?void 0:H.value)==null?void 0:on.pageData)==null?void 0:un.name0}:Va={name:((xn=(hn=H==null?void 0:H.value)==null?void 0:hn.pageData)==null?void 0:xn.name0)||((pn=(dn=H==null?void 0:H.value)==null?void 0:dn.pageData)==null?void 0:pn.name)},q.push({key:"name",contents:Va});const zt=await la.getInsofDataApi({key:{pageKey:Xe,systemKey:sessionStorage.getItem("systemKey"),tableId:H==null?void 0:H.id,type:"data"}});let Sn;if(((Yn=(Ge=zt==null?void 0:zt.data)==null?void 0:Ge.result)==null?void 0:Yn.length)>0&&((qn=(Jn=q==null?void 0:q.find(De=>(De==null?void 0:De.key)==="header"))==null?void 0:Jn.contents)!=null&&qn.every(De=>!(De!=null&&De.columnPath))))if(Sn=(or=(Zn=zt==null?void 0:zt.data)==null?void 0:Zn.result)==null?void 0:or.map(De=>{var Oe;let We=[];return We.push({id:De==null?void 0:De.id}),We.push((Oe=De==null?void 0:De.value)==null?void 0:Oe.tableData),We}),q.push({key:"tableContents",contents:Oi(Sn,(Un=(ca=($e=(ur=H==null?void 0:H.value)==null?void 0:ur.pageData)==null?void 0:$e.compData)==null?void 0:ca.find(De=>(De==null?void 0:De.key)==="header"))==null?void 0:Un.contents)}),q.push({key:"contentTableId",contents:H==null?void 0:H.id}),q.push({key:"ownerId",contents:H==null?void 0:H.id}),pa!==""&&(q!=null&&q.find(De=>(De==null?void 0:De.key)==="pageColumn")&&(q=q==null?void 0:q.filter(De=>(De==null?void 0:De.key)!=="pageColumn")),q.push({key:"pageColumn",contents:Bn}),q!=null&&q.find(De=>(De==null?void 0:De.key)==="columnPath")&&(q=q==null?void 0:q.filter(De=>(De==null?void 0:De.key)!=="columnPath")),q.push({key:"columnPath",contents:pa}),q!=null&&q.find(De=>(De==null?void 0:De.key)==="columnUsingPath")&&(q=q==null?void 0:q.filter(De=>(De==null?void 0:De.key)!=="columnUsingPath")),q.push({key:"columnUsingPath",contents:lr}),q!=null&&q.find(De=>(De==null?void 0:De.key)==="pageGroup")&&(q=q==null?void 0:q.filter(De=>(De==null?void 0:De.key)!=="pageGroup")),q.push({key:"pageGroup",contents:jr})),(oe==null?void 0:oe.length)===0)oe.push(q);else{let De;Array.isArray((ci=(fi=q==null?void 0:q.find(We=>(We==null?void 0:We.key)==="header"))==null?void 0:fi.contents)==null?void 0:ci[0])?De=(ui=_n((oi=(li=q==null?void 0:q.find(We=>(We==null?void 0:We.key)==="header"))==null?void 0:li.contents)==null?void 0:oi[0]))==null?void 0:ui.map(We=>We==null?void 0:We.prop):De=(xi=(hi=q==null?void 0:q.find(We=>(We==null?void 0:We.key)==="header"))==null?void 0:hi.contents)==null?void 0:xi.map(We=>We==null?void 0:We.prop),q==null||q.forEach(We=>{var Oe,Vt;if(((We==null?void 0:We.key)==="contentTableId"||(We==null?void 0:We.key)==="ownerId")&&(oe==null||oe.push(We)),(We==null?void 0:We.key)==="header"&&(oe=oe==null?void 0:oe.map(yr=>{var ze,rt,at,At,Ft,Dt;return(yr==null?void 0:yr.key)==="header"&&(Array.isArray((ze=We==null?void 0:We.contents)==null?void 0:ze[0])&&(We.contents=(rt=We==null?void 0:We.contents)==null?void 0:rt[0]),Array.isArray((at=yr==null?void 0:yr.contents)==null?void 0:at[0])?(yr.contents=(At=yr.contents)==null?void 0:At[0],yr.contents=[...yr==null?void 0:yr.contents,...We==null?void 0:We.contents],yr.contents=[(Ft=yr.contents)==null?void 0:Ft.filter(Ga=>(Ga==null?void 0:Ga.prop)!=="")]):(yr.contents=[...yr==null?void 0:yr.contents,...We==null?void 0:We.contents],yr.contents=(Dt=yr.contents)==null?void 0:Dt.filter(Ga=>(Ga==null?void 0:Ga.prop)!==""))),yr})),(We==null?void 0:We.key)==="tableContents"){let yr=(Vt=(Oe=We==null?void 0:We.contents)==null?void 0:Oe.map(ze=>m0(ze,De)))==null?void 0:Vt.filter(ze=>{var rt,at;return!(((rt=Object.keys(ze))==null?void 0:rt.length)===1&&((at=Object.keys(ze))==null?void 0:at[0])==="id")});oe=oe==null?void 0:oe.map(ze=>{var rt,at,At,Ft,Dt,Ga,ja,ar,Qe;if((ze==null?void 0:ze.key)==="tableContents"){let Bt=[];if((yr==null?void 0:yr.length)===0)Bt=ze==null?void 0:ze.contents;else{let fa=(At=(at=(rt=de==null?void 0:de.columnPath)==null?void 0:rt.replace("(",br))==null?void 0:at.split(br))==null?void 0:At[1],_a=(Ft=p0(fa,","))==null?void 0:Ft.map(Nr=>((Nr==null?void 0:Nr[(Nr==null?void 0:Nr.length)-1])===","&&(Nr=Nr==null?void 0:Nr.slice(0,(Nr==null?void 0:Nr.length)-1)),Nr));_a=(Ga=(Dt=_a==null?void 0:_a.find(Nr=>Nr==null?void 0:Nr.includes("@Filter")))==null?void 0:Dt.split("@Filter"))==null?void 0:Ga[1],_a=(ja=_a==null?void 0:_a.slice(1,(_a==null?void 0:_a.length)-1))==null?void 0:ja.replaceAll("'","");let Xa="";if(_a!=null&&_a.includes("[")){Xa=(ar=_a==null?void 0:_a.split("="))==null?void 0:ar[0];let Nr=(Qe=ze==null?void 0:ze.contents)==null?void 0:Qe.map(Ut=>Ut==null?void 0:Ut[Xa]);yr=yr==null?void 0:yr.filter(Ut=>Nr==null?void 0:Nr.find(x0=>(Ut==null?void 0:Ut[Xa])===x0))}yr==null||yr.forEach(Nr=>{var Ut,x0,d0;if(!(!(ze!=null&&ze.contents)||((Ut=ze==null?void 0:ze.contents)==null?void 0:Ut.length)===0))if(Xa==="")(x0=ze==null?void 0:ze.contents)==null||x0.forEach(Ve=>{let qe=Object.assign({},Nr,Ve);Bt.push(qe)});else{let Ve=(d0=ze==null?void 0:ze.contents)==null?void 0:d0.find(U0=>(U0==null?void 0:U0[Xa])===(Nr==null?void 0:Nr[Xa])),qe=Object.assign({},Nr,Ve);Bt.push(qe)}})}ze.contents=Bt}return ze})}})}else{let De,We=(ki=(yi=(_i=(vi=(gi=(mi=(pi=(di=H==null?void 0:H.value)==null?void 0:di.pageData)==null?void 0:pi.compData)==null?void 0:mi.find(Oe=>(Oe==null?void 0:Oe.key)==="header"))==null?void 0:gi.contents)==null?void 0:vi.find(Oe=>Oe==null?void 0:Oe.columnPath))==null?void 0:_i.columnPath)==null?void 0:yi.split("["))==null?void 0:ki[0];if(us.value!==Xe&&i!==Xe)De=await wn(Xe,sessionStorage.getItem("systemKey"),"",!1,[],!1,n,Xe);else{let Oe=await la.getInsofDataApi({key:{pageKey:Xe,systemKey:sessionStorage.getItem("systemKey"),type:"structure"}}),Vt=(Ie=(Ke=(ga=(Ei=Oe==null?void 0:Oe.data)==null?void 0:Ei.result)==null?void 0:ga.find(ze=>{var rt,at,At,Ft,Dt,Ga;return gn((rt=ze==null?void 0:ze.value)==null?void 0:rt.pageData,jr)&&((At=(at=H==null?void 0:H.value)==null?void 0:at.pageData)==null?void 0:At.name)===((Dt=(Ft=ze==null?void 0:ze.value)==null?void 0:Ft.pageData)==null?void 0:Dt.name)||gn((Ga=ze==null?void 0:ze.value)==null?void 0:Ga.pageData,Re)&&Re!==jr}))==null?void 0:Ke.value)==null?void 0:Ie.pageData;L0=(et=(fr=(_r=(ct=(ve=(va=(Je=Vt==null?void 0:Vt.compData)==null?void 0:Je.find(ze=>(ze==null?void 0:ze.key)==="header"))==null?void 0:va.contents)==null?void 0:ve.find(ze=>ze==null?void 0:ze.columnPath))==null?void 0:ct.columnPath)==null?void 0:_r.replace("(",br))==null?void 0:fr.split(br))==null?void 0:et[1],De=await wn(We,sessionStorage.getItem("systemKey"),""),(De==null?void 0:De.length)>0&&(De[0].name=Re)}De==null||De.forEach(Oe=>{var Vt,yr,ze,rt,at,At,Ft,Dt,Ga,ja,ar,Qe,Bt,fa,_a,Xa,Nr,Ut,x0;if(gn(Oe,jr)&&((yr=(Vt=H==null?void 0:H.value)==null?void 0:Vt.pageData)==null?void 0:yr.name)===(Oe==null?void 0:Oe.name)||gn(Oe,Re)&&Re!==jr){q=((ze=Oe==null?void 0:Oe.compData)==null?void 0:ze.filter(Ve=>(Ve==null?void 0:Ve.key)!=="tableContents"))||[],De=(at=(rt=Oe==null?void 0:Oe.compData)==null?void 0:rt.find(Ve=>(Ve==null?void 0:Ve.key)==="tableContents"))==null?void 0:at.contents,Sn=De;let d0;if((gn(Oe,jr)&&Re===jr||gn(Oe,Re)&&Re!==jr)&&((Ft=(At=e==null?void 0:e.find(Ve=>(Ve==null?void 0:Ve.key)==="header"))==null?void 0:At.contents)==null?void 0:Ft.length)===2?(Ga=(Dt=H==null?void 0:H.value)==null?void 0:Dt.pageData)!=null&&Ga.name1?d0={name:Oe==null?void 0:Oe.name,name0:Oe==null?void 0:Oe.name0,name1:Oe==null?void 0:Oe.name1}:d0={name:Oe==null?void 0:Oe.name,name0:Oe==null?void 0:Oe.name0}:d0={name:(Oe==null?void 0:Oe.name0)||(Oe==null?void 0:Oe.name)},q.push({key:"name",contents:d0}),q.push({key:"tableContents",contents:Oi(Sn,(ar=(ja=Oe==null?void 0:Oe.compData)==null?void 0:ja.find(Ve=>(Ve==null?void 0:Ve.key)==="header"))==null?void 0:ar.contents)}),q.push({key:"contentTableId",contents:(De==null?void 0:De.length)!==0?((Qe=Oe==null?void 0:Oe.compData)==null?void 0:Qe.id)??(Oe==null?void 0:Oe.id):H==null?void 0:H.id}),q.push({key:"ownerId",contents:Oe==null?void 0:Oe.id}),pa!==""&&(q!=null&&q.find(Ve=>(Ve==null?void 0:Ve.key)==="pageColumn")&&(q=q==null?void 0:q.filter(Ve=>(Ve==null?void 0:Ve.key)!=="pageColumn")),q.push({key:"pageColumn",contents:Bn}),q!=null&&q.find(Ve=>(Ve==null?void 0:Ve.key)==="columnPath")&&(q=q==null?void 0:q.filter(Ve=>(Ve==null?void 0:Ve.key)!=="columnPath")),q.push({key:"columnPath",contents:pa}),q!=null&&q.find(Ve=>(Ve==null?void 0:Ve.key)==="columnUsingPath")&&(q=q==null?void 0:q.filter(Ve=>(Ve==null?void 0:Ve.key)!=="columnUsingPath")),q.push({key:"columnUsingPath",contents:lr}),q!=null&&q.find(Ve=>(Ve==null?void 0:Ve.key)==="pageGroup")&&(q=q==null?void 0:q.filter(Ve=>(Ve==null?void 0:Ve.key)!=="pageGroup")),q.push({key:"pageGroup",contents:jr})),(oe==null?void 0:oe.length)===0)oe.push(q);else{let Ve;Array.isArray((fa=(Bt=q==null?void 0:q.find(qe=>(qe==null?void 0:qe.key)==="header"))==null?void 0:Bt.contents)==null?void 0:fa[0])?Ve=(Nr=_n((Xa=(_a=q==null?void 0:q.find(qe=>(qe==null?void 0:qe.key)==="header"))==null?void 0:_a.contents)==null?void 0:Xa[0]))==null?void 0:Nr.map(qe=>qe==null?void 0:qe.prop):Ve=(x0=(Ut=q==null?void 0:q.find(qe=>(qe==null?void 0:qe.key)==="header"))==null?void 0:Ut.contents)==null?void 0:x0.map(qe=>qe==null?void 0:qe.prop),q==null||q.forEach(qe=>{var U0,wc;if(((qe==null?void 0:qe.key)==="contentTableId"||(qe==null?void 0:qe.key)==="ownerId")&&(oe==null||oe.push(qe)),(qe==null?void 0:qe.key)==="header"&&(oe=oe==null?void 0:oe.map(Hr=>{var $r,Qn,e0,Ti,wi,Si;return(Hr==null?void 0:Hr.key)==="header"&&(Array.isArray(($r=qe==null?void 0:qe.contents)==null?void 0:$r[0])&&(qe.contents=(Qn=qe==null?void 0:qe.contents)==null?void 0:Qn[0]),Array.isArray((e0=Hr==null?void 0:Hr.contents)==null?void 0:e0[0])?(Hr.contents=(Ti=Hr.contents)==null?void 0:Ti[0],Hr.contents=[...Hr==null?void 0:Hr.contents,...qe==null?void 0:qe.contents],Hr.contents=[(wi=Hr.contents)==null?void 0:wi.filter(An=>(An==null?void 0:An.prop)!=="")]):(Hr.contents=[...Hr==null?void 0:Hr.contents,...qe==null?void 0:qe.contents],Hr.contents=(Si=Hr.contents)==null?void 0:Si.filter(An=>(An==null?void 0:An.prop)!==""))),Hr})),(qe==null?void 0:qe.key)==="tableContents"){let Hr=(wc=(U0=qe==null?void 0:qe.contents)==null?void 0:U0.map($r=>m0($r,Ve)))==null?void 0:wc.filter($r=>{var Qn,e0;return!(((Qn=Object.keys($r))==null?void 0:Qn.length)===1&&((e0=Object.keys($r))==null?void 0:e0[0])==="id")});oe=oe==null?void 0:oe.map($r=>{var Qn,e0,Ti,wi,Si,An,Sc,Ac,Fc;if(($r==null?void 0:$r.key)==="tableContents"){let cs=[];if((Hr==null?void 0:Hr.length)===0)cs=$r==null?void 0:$r.contents;else{let Sh=(Ti=(e0=(Qn=de==null?void 0:de.columnPath)==null?void 0:Qn.replace("(",br))==null?void 0:e0.split(br))==null?void 0:Ti[1],tt=(wi=p0(Sh,","))==null?void 0:wi.map(ra=>((ra==null?void 0:ra[(ra==null?void 0:ra.length)-1])===","&&(ra=ra==null?void 0:ra.slice(0,(ra==null?void 0:ra.length)-1)),ra));tt=(An=(Si=tt==null?void 0:tt.find(ra=>ra==null?void 0:ra.includes("@Filter")))==null?void 0:Si.split("@Filter"))==null?void 0:An[1],tt=(Sc=tt==null?void 0:tt.slice(1,(tt==null?void 0:tt.length)-1))==null?void 0:Sc.replaceAll("'","");let W0="";if(tt!=null&&tt.includes("[")){W0=(Ac=tt==null?void 0:tt.split("="))==null?void 0:Ac[0];let ra=(Fc=$r==null?void 0:$r.contents)==null?void 0:Fc.map(Fn=>Fn==null?void 0:Fn[W0]);Hr=Hr==null?void 0:Hr.filter(Fn=>ra==null?void 0:ra.find(ls=>(Fn==null?void 0:Fn[W0])===ls))}Hr==null||Hr.forEach(ra=>{var Fn,ls,Dc;if(!(!($r!=null&&$r.contents)||((Fn=$r==null?void 0:$r.contents)==null?void 0:Fn.length)===0))if(W0==="")(ls=$r==null?void 0:$r.contents)==null||ls.forEach(Js=>{let qs=Object.assign({},ra,Js);cs.push(qs)});else{let Js=(Dc=$r==null?void 0:$r.contents)==null?void 0:Dc.find(Zs=>(Zs==null?void 0:Zs[W0])===(ra==null?void 0:ra[W0])),qs=Object.assign({},ra,Js);cs.push(qs)}})}$r.contents=cs}return $r})}})}}})}}})),await Promise.all(Ne)}let Br=[];oe!=null&&oe.every(te=>Array.isArray(te))||(oe=[oe]),oe==null||oe.forEach(te=>{Br!=null&&Br.find(H=>{var q,pe,xe,Ar,ea,sa,vr,ma,Fr,Or,Wr,Yr,gr,Xr,dr,Jr,St,ln,on,un,hn,xn,dn,pn;return((Ar=(xe=(pe=H==null?void 0:H.filter(Ge=>(Ge==null?void 0:Ge.key)==="name"))==null?void 0:pe[((q=H==null?void 0:H.filter(Ge=>(Ge==null?void 0:Ge.key)==="name"))==null?void 0:q.length)-1])==null?void 0:xe.contents)==null?void 0:Ar.name)===((ma=(vr=(sa=te==null?void 0:te.filter(Ge=>(Ge==null?void 0:Ge.key)==="name"))==null?void 0:sa[((ea=te==null?void 0:te.filter(Ge=>(Ge==null?void 0:Ge.key)==="name"))==null?void 0:ea.length)-1])==null?void 0:vr.contents)==null?void 0:ma.name)&&((Yr=(Wr=(Or=H==null?void 0:H.filter(Ge=>(Ge==null?void 0:Ge.key)==="name"))==null?void 0:Or[((Fr=H==null?void 0:H.filter(Ge=>(Ge==null?void 0:Ge.key)==="name"))==null?void 0:Fr.length)-1])==null?void 0:Wr.contents)==null?void 0:Yr.name0)===((Jr=(dr=(Xr=te==null?void 0:te.filter(Ge=>(Ge==null?void 0:Ge.key)==="name"))==null?void 0:Xr[((gr=te==null?void 0:te.filter(Ge=>(Ge==null?void 0:Ge.key)==="name"))==null?void 0:gr.length)-1])==null?void 0:dr.contents)==null?void 0:Jr.name0)&&((un=(on=(ln=H==null?void 0:H.filter(Ge=>(Ge==null?void 0:Ge.key)==="name"))==null?void 0:ln[((St=H==null?void 0:H.filter(Ge=>(Ge==null?void 0:Ge.key)==="name"))==null?void 0:St.length)-1])==null?void 0:on.contents)==null?void 0:un.name1)===((pn=(dn=(xn=te==null?void 0:te.filter(Ge=>(Ge==null?void 0:Ge.key)==="name"))==null?void 0:xn[((hn=te==null?void 0:te.filter(Ge=>(Ge==null?void 0:Ge.key)==="name"))==null?void 0:hn.length)-1])==null?void 0:dn.contents)==null?void 0:pn.name1)})||Br.push(te)}),Br=Br==null?void 0:Br.map(te=>{var q,pe;let H=[];return te==null||te.forEach(xe=>{(xe==null?void 0:xe.key)!=="name"&&H.push(xe)}),H.push((pe=te==null?void 0:te.filter(xe=>(xe==null?void 0:xe.key)==="name"))==null?void 0:pe[((q=te==null?void 0:te.filter(xe=>(xe==null?void 0:xe.key)==="name"))==null?void 0:q.length)-1]),H}),oe=Br==null?void 0:Br.sort((te,H)=>{var q,pe,xe,Ar,ea,sa;return((xe=(pe=te==null?void 0:te.filter(vr=>(vr==null?void 0:vr.key)==="ownerId"))==null?void 0:pe[((q=te==null?void 0:te.filter(vr=>(vr==null?void 0:vr.key)==="ownerId"))==null?void 0:q.length)-1])==null?void 0:xe.contents)-((sa=(ea=H==null?void 0:H.filter(vr=>(vr==null?void 0:vr.key)==="ownerId"))==null?void 0:ea[((Ar=H==null?void 0:H.filter(vr=>(vr==null?void 0:vr.key)==="ownerId"))==null?void 0:Ar.length)-1])==null?void 0:sa.contents)}),oe=oe==null?void 0:oe.filter(te=>te!==void 0),oe=oe==null?void 0:oe.map(te=>{var q,pe;let H=(pe=ws((q=te==null?void 0:te.find(xe=>(xe==null?void 0:xe.key)==="header"))==null?void 0:q.contents))==null?void 0:pe.filter(xe=>xe!=="操作"&&xe);return te=te==null?void 0:te.map(xe=>{var Ar,ea,sa,vr,ma,Fr,Or,Wr,Yr,gr,Xr,dr,Jr,St,ln,on,un,hn,xn,dn,pn,Ge,Yn,Jn,qn,Zn,or,ur,$e,ca,Un,fi,ci,li,oi,ui,hi,xi,di,pi,mi,gi,vi,_i,yi,ki,Ei;if((xe==null?void 0:xe.key)==="tableContents"){let ga=[];if((vr=(sa=(ea=(Ar=de==null?void 0:de.columnPath)==null?void 0:Ar.split("@Type"))==null?void 0:ea[1])==null?void 0:sa.toUpperCase())!=null&&vr.includes("MANUAL")){Qa==null||Qa.forEach(Je=>{Je.value.id=Je==null?void 0:Je.id,ga.push(Je==null?void 0:Je.value)});let Ke=[];((Fr=(ma=te==null?void 0:te.find(Je=>(Je==null?void 0:Je.key)==="header"))==null?void 0:ma.contents)==null?void 0:Fr.length)<=2&&!Array.isArray((Wr=(Or=te==null?void 0:te.find(Je=>(Je==null?void 0:Je.key)==="header"))==null?void 0:Or.contents)==null?void 0:Wr[0])&&((Yr=xe.contents)==null||Yr.forEach(Je=>{let va=(Je==null?void 0:Je.length)!==1?m0(Je,H):Je==null?void 0:Je[0];Ke.push(va)}));let Ie=H==null?void 0:H[0];Ke==null||Ke.forEach(Je=>{ga!=null&&ga.find(va=>(va==null?void 0:va[Ie])===(Je==null?void 0:Je[Ie]))||ga.push(Je)})}else(ln=(St=(Jr=p0((dr=(Xr=(gr=de==null?void 0:de.columnPath)==null?void 0:gr.replace("(",br))==null?void 0:Xr.split(br))==null?void 0:dr[1],","))==null?void 0:Jr.find(Ke=>Ke==null?void 0:Ke.includes("@FatherSync")))==null?void 0:St.toUpperCase())!=null&&ln.includes("YES")?(on=xe.contents)==null||on.forEach(Ke=>{var va,ve,ct;let Ie=(Ke==null?void 0:Ke.length)!==1?m0(Ke,H):Ke==null?void 0:Ke[0],Je=Qa==null?void 0:Qa.filter(_r=>(_r==null?void 0:_r.parentId)===(Ie==null?void 0:Ie.id));if((Je==null?void 0:Je.length)>0)Je==null||Je.forEach(_r=>{let fr=Object.assign({},Ie,_r==null?void 0:_r.value),et={};for(let Va in fr)(fr==null?void 0:fr[Va])!==void 0&&(et[Va]=fr==null?void 0:fr[Va]);Je=et,fr.id=_r==null?void 0:_r.id,ga.push(fr)});else{Ie.id=((ve=(va=e==null?void 0:e.find(fr=>(fr==null?void 0:fr.key)==="header"))==null?void 0:va.contents)==null?void 0:ve.length)===2?parseInt(Ie==null?void 0:Ie.id):((ct=Ie==null?void 0:Ie.id)==null?void 0:ct.toString())??"undefined";let _r={};for(let fr in Ie)(Ie==null?void 0:Ie[fr])!==void 0&&(_r[fr]=Ie==null?void 0:Ie[fr]);Ie=_r,ga.push(Ie)}}):(un=xe.contents)==null||un.forEach(Ke=>{var va,ve,ct;let Ie=(Ke==null?void 0:Ke.length)!==1?m0(Ke,H):Ke==null?void 0:Ke[0],Je=Qa==null?void 0:Qa.filter(_r=>{var fr,et;return(_r==null?void 0:_r.parentId)===(Ie==null?void 0:Ie.id)||((fr=_r==null?void 0:_r.id)==null?void 0:fr.toString())===((et=Ie==null?void 0:Ie.id)==null?void 0:et.toString())});if((Je==null?void 0:Je.length)>0)Je==null||Je.forEach(_r=>{let fr=Object.assign({},Ie,_r==null?void 0:_r.value),et={};for(let Va in fr)(fr==null?void 0:fr[Va])!==void 0&&(et[Va]=fr==null?void 0:fr[Va]);Je=et,fr.id=_r==null?void 0:_r.id,ga.push(fr)});else{Ie.id=((ve=(va=e==null?void 0:e.find(fr=>(fr==null?void 0:fr.key)==="header"))==null?void 0:va.contents)==null?void 0:ve.length)===2?parseInt(Ie==null?void 0:Ie.id):((ct=Ie==null?void 0:Ie.id)==null?void 0:ct.toString())??"undefined";let _r={};for(let fr in Ie)(Ie==null?void 0:Ie[fr])!==void 0&&(_r[fr]=Ie==null?void 0:Ie[fr]);Ie=_r,ga.push(Ie)}});xe.contents=ga}if((xe==null?void 0:xe.key)==="header"){let ga=Mn==null?void 0:Mn.find(ve=>{var ct,_r,fr,et,Va,zt,Sn;return(Sn=de==null?void 0:de.columnPath)==null?void 0:Sn.includes((zt=(_r=(ct=ve==null?void 0:ve.value)==null?void 0:ct.split("%$%"))==null?void 0:_r[0])==null?void 0:zt.slice(0,((Va=(et=(fr=ve==null?void 0:ve.value)==null?void 0:fr.split("%$%"))==null?void 0:et[0])==null?void 0:Va.length)-1))}),Ke=ga==null?void 0:ga.key;if(((hn=Ke==null?void 0:Ke.split("["))==null?void 0:hn.length)>2){let ve=vf(Ke);Ke=Ih((dn=(xn=ve==null?void 0:ve.stringContent)==null?void 0:xn.split(","))==null?void 0:dn.filter(ct=>ct!==""),ve==null?void 0:ve.parentColumns)}else Ke=(Yn=(Ge=(pn=Ke==null?void 0:Ke.replaceAll("'",""))==null?void 0:pn.replaceAll("[",""))==null?void 0:Ge.replaceAll("]",""))==null?void 0:Yn.split(",");let Ie=(ci=(fi=(Un=(Zn=(qn=(Jn=ga==null?void 0:ga.value)==null?void 0:Jn.split("("))==null?void 0:qn[0])==null?void 0:Zn.split("["))==null?void 0:Un[((ca=($e=(ur=(or=ga==null?void 0:ga.value)==null?void 0:or.split("("))==null?void 0:ur[0])==null?void 0:$e.split("["))==null?void 0:ca.length)-1])==null?void 0:fi.split("]"))==null?void 0:ci[0],Je=(ui=(oi=(li=Ie==null?void 0:Ie.replaceAll("'",""))==null?void 0:li.split(","))==null?void 0:oi.filter(ve=>ve==null?void 0:ve.includes('"')))==null?void 0:ui.map(ve=>ve==null?void 0:ve.replaceAll('"',""));Ie=(xi=(hi=Ie==null?void 0:Ie.replaceAll("'",""))==null?void 0:hi.replaceAll('"',""))==null?void 0:xi.split(","),Array.isArray(Ke)||(Ke=(mi=(pi=(di=Ke==null?void 0:Ke.replaceAll("'",""))==null?void 0:di.replaceAll("[",""))==null?void 0:pi.replaceAll("]",""))==null?void 0:mi.split(","));let va=((vi=(gi=xe.contents)==null?void 0:gi.find(ve=>ve==null?void 0:ve.menuId))==null?void 0:vi.menuId)??((ki=(yi=te==null?void 0:te.filter(ve=>(ve==null?void 0:ve.key)==="contentTableId"))==null?void 0:yi[((_i=te==null?void 0:te.filter(ve=>(ve==null?void 0:ve.key)==="contentTableId"))==null?void 0:_i.length)-1])==null?void 0:ki.contents);xe.contents=(Ei=xe.contents)==null?void 0:Ei.map(ve=>{var ct,_r,fr,et,Va,zt,Sn,De,We,Oe,Vt,yr,ze,rt,at,At,Ft,Dt,Ga;if(Array.isArray(ve)){(ct=_n(ve))!=null&&ct.every(Qe=>!(Qe!=null&&Qe.menuId))&&(va=((fr=(_r=_n(ve))==null?void 0:_r.find(Qe=>Qe==null?void 0:Qe.menuId))==null?void 0:fr.menuId)??va,ve=ve==null?void 0:ve.map((Qe,Bt)=>{var fa,_a;return Bt===0?Qe!=null&&Qe.children?Qe.children=(fa=Qe.children)==null?void 0:fa.map((Xa,Nr)=>(Nr===0?(Xa.directiveLabel="#isMain",Xa.menuId=va):(Xa.directiveLabel="",delete Xa.menuId),Xa.relatedValueId=!0,Xa)):(Qe.directiveLabel="#isMain",Qe.menuId=va):(Qe.directiveLabel="",delete Qe.menuId,Qe.children=(_a=Qe.children)==null?void 0:_a.map(Xa=>(Xa.relatedValueId=!0,Xa))),Qe.relatedValueId=!0,Qe}));let ja=(zt=(Va=(et=de==null?void 0:de.columnPath)==null?void 0:et.replace("(",br))==null?void 0:Va.split(br))==null?void 0:zt[1];ja=ja==null?void 0:ja.slice(0,(ja==null?void 0:ja.length)-1);let ar=(Sn=p0(ja,","))==null?void 0:Sn.map(Qe=>((Qe==null?void 0:Qe[(Qe==null?void 0:Qe.length)-1])===","&&(Qe=Qe==null?void 0:Qe.slice(0,(Qe==null?void 0:Qe.length)-1)),Qe));return ve=ql(ve,Ke,Ie,de,va,ar),ve}else if(Ie!=null&&Ie.find(ja=>ja===(ve==null?void 0:ve.prop))){let ja=Ie==null?void 0:Ie.findIndex(ar=>ar===(ve==null?void 0:ve.prop));if(Ke!=null&&Ke.find(ar=>ar==null?void 0:ar.includes('"'))?((De=Ke==null?void 0:Ke[ja])!=null&&De.includes('"')?(ve.directiveLabel="#isMain",ve.menuId=va):(ve.directiveLabel="",delete ve.menuId),ve.relatedValueId=!0):(Je==null?void 0:Je.length)>0&&(Je!=null&&Je.find(ar=>ar===(ve==null?void 0:ve.prop))?(ve.directiveLabel="#isMain",ve.menuId=va):(ve.directiveLabel="",delete ve.menuId),ve.relatedValueId=!0),de!=null&&de.methodContent){let ar=(Oe=(We=de==null?void 0:de.methodContent)==null?void 0:We.replaceAll('"',""))==null?void 0:Oe.replaceAll("'","");ar!=null&&ar.includes("@")?(ar=ar==null?void 0:ar.slice(0,(ar==null?void 0:ar.length)-1),ar!=null&&ar.includes("@Type")||(ar=ar+",@Type=Auto"),ar!=null&&ar.includes("@Button")||(ar=ar+",@Button=Prop"),ar!=null&&ar.includes("@Extent")||(ar=ar+",@Extent=Row"),ar=ar+")"):ar=ar+"(@Type=Auto,@Button=Prop,@Extent=Row)",ve.methodContent=ar,ve.prop=(ve==null?void 0:ve.prop)+(de==null?void 0:de.columnPathIndex);let Qe=(ze=(yr=(Vt=de==null?void 0:de.columnPath)==null?void 0:Vt.replace("(",br))==null?void 0:yr.split(br))==null?void 0:ze[1];Qe=Qe==null?void 0:Qe.slice(0,(Qe==null?void 0:Qe.length)-1);let Bt=(rt=p0(Qe,","))==null?void 0:rt.map(fa=>((fa==null?void 0:fa[(fa==null?void 0:fa.length)-1])===","&&(fa=fa==null?void 0:fa.slice(0,(fa==null?void 0:fa.length)-1)),fa));(at=Bt==null?void 0:Bt.find(fa=>fa==null?void 0:fa.includes("@SonSync")))!=null&&at.includes("Yes")&&(ve.methodId=va)}ve.label=(Ga=(At=Ke==null?void 0:Ke[Ie==null?void 0:Ie.findIndex(ar=>ar===(ve==null?void 0:ve.prop.replace(/\d+$/,"")))])==null?void 0:At.split("."))==null?void 0:Ga[((Dt=(Ft=Ke==null?void 0:Ke[Ie==null?void 0:Ie.findIndex(ar=>ar===(ve==null?void 0:ve.prop.replace(/\d+$/,"")))])==null?void 0:Ft.split("."))==null?void 0:Dt.length)-1]}return ve})}return xe}),te});let na=(O=(C=(F=de==null?void 0:de.columnPath)==null?void 0:F.replace("(",br))==null?void 0:C.split(br))==null?void 0:O[1];if(L0!==""&&(na=(na==null?void 0:na.replaceAll(")",""))+","+L0),na&&(na==null?void 0:na.length)>0){na=(R=na.slice(0,(na==null?void 0:na.length)-1))==null?void 0:R.replaceAll("'","");let te=(X=p0(na,","))==null?void 0:X.map(pe=>((pe==null?void 0:pe[(pe==null?void 0:pe.length)-1])===","&&(pe=pe==null?void 0:pe.slice(0,(pe==null?void 0:pe.length)-1)),pe));te=te==null?void 0:te.map(pe=>{let xe=j0==null?void 0:j0.find(Ar=>pe==null?void 0:pe.includes(Ar==null?void 0:Ar.key));if(xe)return{order:xe==null?void 0:xe.order,value:xe==null?void 0:xe.value,content:pe}}),te=te==null?void 0:te.sort((pe,xe)=>(xe==null?void 0:xe.order)-(pe==null?void 0:pe.order));let H=[];oe=oe==null?void 0:oe.map(pe=>(pe=pe==null?void 0:pe.map((xe,Ar)=>{var ea,sa,vr,ma;return(xe==null?void 0:xe.key)==="header"&&((ea=xe==null?void 0:xe.contents)!=null&&ea.every(Fr=>Array.isArray(Fr))?xe.contents=(sa=xe.contents)==null?void 0:sa.map(Fr=>{var Or;return H.push({index:Ar,content:(Or=Q.cloneDeep(Fr))==null?void 0:Or.filter(Wr=>Wr==null?void 0:Wr.columnPath)}),Fr=Fr==null?void 0:Fr.filter(Wr=>!(Wr!=null&&Wr.columnPath)),Fr}):(H.push({index:Ar,content:(vr=Q.cloneDeep(xe.contents))==null?void 0:vr.filter(Fr=>Fr==null?void 0:Fr.columnPath)}),xe.contents=(ma=xe.contents)==null?void 0:ma.filter(Fr=>!(Fr!=null&&Fr.columnPath)))),xe}),pe)),await(async()=>{var pe,xe,Ar,ea,sa,vr,ma,Fr;for(const Or of te??[])if(Or){const Wr=(pe=Or==null?void 0:Or.content)!=null&&pe.includes("@Filter")?"("+((ea=(Ar=(xe=Or==null?void 0:Or.content)==null?void 0:xe.replace("(",br))==null?void 0:Ar.split(br))==null?void 0:ea[1]):(ma=(vr=(sa=Or==null?void 0:Or.content)==null?void 0:sa.replace(":",br))==null?void 0:vr.split(br))==null?void 0:ma[1];oe=await io((Or==null?void 0:Or.value)+"('"+JSON.stringify(Q.cloneDeep(oe)).replaceAll("'",'"')+"','"+Wr+"','"+((Fr=de==null?void 0:de.columnPath)==null?void 0:Fr.replaceAll("'",""))+"')")??[]}})(),oe=oe==null?void 0:oe.map(pe=>(pe.push({key:"filterAllType",value:te}),pe)),oe=oe==null?void 0:oe.map(pe=>(pe=pe==null?void 0:pe.map((xe,Ar)=>{var ea,sa,vr,ma,Fr,Or;if((xe==null?void 0:xe.key)==="header")if((ea=xe==null?void 0:xe.contents)!=null&&ea.every(Wr=>Array.isArray(Wr)))xe.contents=(sa=xe.contents)==null?void 0:sa.map(Wr=>{var Yr,gr,Xr,dr;return H!=null&&H.find(Jr=>(Jr==null?void 0:Jr.index)===Ar)&&((gr=(Yr=H==null?void 0:H.find(Jr=>(Jr==null?void 0:Jr.index)===Ar))==null?void 0:Yr.content)==null?void 0:gr.length)>0&&Wr.push((dr=(Xr=H==null?void 0:H.find(Jr=>(Jr==null?void 0:Jr.index)===Ar))==null?void 0:Xr.content)==null?void 0:dr[0]),Wr});else{let Wr=xe.contents;H!=null&&H.find(Yr=>(Yr==null?void 0:Yr.index)===Ar)&&((ma=(vr=H==null?void 0:H.find(Yr=>(Yr==null?void 0:Yr.index)===Ar))==null?void 0:vr.content)==null?void 0:ma.length)>0&&Wr.push((Or=(Fr=H==null?void 0:H.find(Yr=>(Yr==null?void 0:Yr.index)===Ar))==null?void 0:Fr.content)==null?void 0:Or[0]),xe.contents=Wr}return xe}),pe))}let Ur=(Y=(V=(z=(j=Ha==null?void 0:Ha.replaceAll("{",""))==null?void 0:j.replaceAll("}",""))==null?void 0:z.replace(":",br))==null?void 0:V.split(br))==null?void 0:Y[1];Ur!=null&&Ur.includes("[")&&(Ur=(le=Ur==null?void 0:Ur.replaceAll("'",'"'))==null?void 0:le.replaceAll(":",","),Ur=(_e=X1(Ur))==null?void 0:_e.join(","),Ur="["+((ge=(ue=(Ee=Ur==null?void 0:Ur.replaceAll('":"',Bc.value))==null?void 0:Ee.replaceAll(":",Bc.value))==null?void 0:ue.replaceAll("[",""))==null?void 0:ge.replaceAll("]",""))+"]",$t(Ur==null?void 0:Ur.replaceAll("'",'"'))&&(Ur=JSON.parse(Ur==null?void 0:Ur.replaceAll("'",'"')),Ur!=null&&Ur.find(te=>te==="操作")||Ur.push("操作")),oe=oe==null?void 0:oe.map(te=>{let H=[],q=[];return te=te==null?void 0:te.map(pe=>{var xe,Ar,ea,sa,vr,ma,Fr,Or,Wr,Yr;if((pe==null?void 0:pe.key)==="header")if((xe=pe.contents)!=null&&xe.every(gr=>Array.isArray(gr)))pe.contents=(ea=(Ar=pe.contents)==null?void 0:Ar.map(gr=>{let Xr=yf(gr,Ur);return gr=Xr==null?void 0:Xr.contents,H=[...new Set(Xr.ids)],q=[...new Set(Xr.props)],gr}))==null?void 0:ea.filter(gr=>!((gr==null?void 0:gr.label)==="操作"&&(gr!=null&&gr.relatedValueId)));else{let gr=(vr=(sa=pe.contents)==null?void 0:sa[0])==null?void 0:vr.menuId,Xr=yf(pe.contents,Ur);H=[...new Set(Xr.ids)],q=[...new Set(Xr.props)],(ma=pe.contents)!=null&&ma.some(dr=>dr==null?void 0:dr.columnPath)||(pe.contents=(Fr=pe.contents)==null?void 0:Fr.filter(dr=>(Ur==null?void 0:Ur.find(Jr=>{var St;return Jr===(((St=dr==null?void 0:dr.prop)==null?void 0:St.replace(/\d+$/,""))||(dr==null?void 0:dr.label))}))&&!((dr==null?void 0:dr.label)==="操作"&&(dr!=null&&dr.relatedValueId))),(Or=pe.contents)!=null&&Or.every(dr=>!(dr!=null&&dr.menuId))&&(pe.contents=(Wr=pe.contents)==null?void 0:Wr.map((dr,Jr)=>(Jr===0&&(dr.menuId=gr),dr))))}return(pe==null?void 0:pe.key)==="tableContents"&&(H==null?void 0:H.length)>0&&(pe.contents=(Yr=pe.contents)==null?void 0:Yr.map(gr=>{if(Array.isArray(gr))gr=gr==null?void 0:gr.filter((Xr,dr)=>(H==null?void 0:H.find(Jr=>Jr===dr))||(Xr==null?void 0:Xr.id));else for(let Xr in gr)(Xr==="id"||q!=null&&q.find(dr=>dr===Xr))&&(gr==null||gr[Xr]);return gr})),pe}),te}));let Le=[];(Tr=(Ze=e==null?void 0:e.find(te=>(te==null?void 0:te.key)==="header"))==null?void 0:Ze.contents)!=null&&Tr.every(te=>Array.isArray(te))?Le=(sn=(Kr=(Lr=e==null?void 0:e.find(te=>(te==null?void 0:te.key)==="header"))==null?void 0:Lr.contents)==null?void 0:Kr[0])==null?void 0:sn.filter(te=>!(te!=null&&te.columnPath)&&(te==null?void 0:te.label)!=="操作"):Le=f;let B0=Mn==null?void 0:Mn.find(te=>{var H,q,pe;return(pe=de==null?void 0:de.columnPath)==null?void 0:pe.includes((q=(H=te==null?void 0:te.value)==null?void 0:H.split("%$%"))==null?void 0:q[0])});Le&&(Le==null?void 0:Le.length)>0&&(oe=oe==null?void 0:oe.map(te=>(te=te==null?void 0:te.map(H=>{var xe,Ar,ea,sa,vr,ma,Fr,Or,Wr,Yr,gr,Xr,dr,Jr,St,ln,on,un,hn,xn,dn,pn,Ge,Yn,Jn,qn,Zn;let q=(Ar=(xe=e==null?void 0:e.find(or=>(or==null?void 0:or.key)==="header"))==null?void 0:xe.contents)==null?void 0:Ar.filter(or=>or==null?void 0:or.columnPath),pe=(ea=q==null?void 0:q[rr])!=null&&ea.columnPathIndex&&((sa=q==null?void 0:q[rr])==null?void 0:sa.columnPathIndex)!==""?parseInt((vr=q==null?void 0:q[rr])==null?void 0:vr.columnPathIndex):0;if((H==null?void 0:H.key)==="header"){if(((ma=H==null?void 0:H.contents)==null?void 0:ma.length)===0)return H==null?void 0:H.contents;if((((Or=(Fr=B0==null?void 0:B0.key)==null?void 0:Fr.split("["))==null?void 0:Or.length)??0)<=2){if((Wr=H==null?void 0:H.contents)!=null&&Wr.every(or=>Array.isArray(or))){if(pe===0)Array.isArray(Le==null?void 0:Le[0])?H.contents=[...(Yr=H.contents)==null?void 0:Yr[0],...Le==null?void 0:Le[0]]:H.contents=[...(gr=H.contents)==null?void 0:gr[0],...Le];else if(Array.isArray(Le==null?void 0:Le[0])){let or=((St=(Xr=Le==null?void 0:Le[0])==null?void 0:Xr.filter($e=>($e==null?void 0:$e.label)!=="操作"))==null?void 0:St.slice(pe,(Jr=(dr=Le==null?void 0:Le[0])==null?void 0:dr.filter($e=>($e==null?void 0:$e.label)!=="操作"))==null?void 0:Jr.length))??[],ur=[...(ln=Le==null?void 0:Le[0])==null?void 0:ln.filter($e=>($e==null?void 0:$e.label)!=="操作").slice(0,pe),...(on=H.contents)==null?void 0:on[0]];ur=[...ur,...or],Array.isArray((un=ur==null?void 0:ur.filter($e=>($e==null?void 0:$e.prop)!==""))==null?void 0:un[0])?H.contents=ur==null?void 0:ur.filter($e=>($e==null?void 0:$e.prop)!==""):H.contents=[ur==null?void 0:ur.filter($e=>($e==null?void 0:$e.prop)!=="")]}else{let or=(Le==null?void 0:Le.slice(pe,Le==null?void 0:Le.length))??[],ur=[...Le.slice(0,pe),...H.contents];ur=[...ur,...or],H.contents=ur==null?void 0:ur.filter($e=>($e==null?void 0:$e.prop)!=="")}H.contents=(hn=H.contents)==null?void 0:hn.filter(or=>(or==null?void 0:or.prop)!==""),Array.isArray((xn=H.contents)==null?void 0:xn[0])||(H.contents=[H.contents])}else if(H.contents=(dn=H.contents)==null?void 0:dn.map((or,ur)=>or),(q==null?void 0:q[rr])===0)Array.isArray(Le==null?void 0:Le[0])?H.contents=[...H.contents,...Le==null?void 0:Le[0]]:H.contents=[...H.contents,...Le];else{let or=pe;if(Array.isArray(Le==null?void 0:Le[0])){let ur=((Ge=Le==null?void 0:Le[0])==null?void 0:Ge.slice(or,(pn=Le==null?void 0:Le[0])==null?void 0:pn.length))??[],$e=[...Le==null?void 0:Le[0].slice(0,or),...H.contents];$e=[...$e,...ur],Array.isArray((Yn=$e==null?void 0:$e.filter(ca=>(ca==null?void 0:ca.prop)!==""))==null?void 0:Yn[0])?H.contents=$e==null?void 0:$e.filter(ca=>(ca==null?void 0:ca.prop)!==""):H.contents=[$e==null?void 0:$e.filter(ca=>(ca==null?void 0:ca.prop)!=="")]}else{let ur=(Le==null?void 0:Le.slice(or,Le==null?void 0:Le.length))??[],$e=[...Le.slice(0,or),...H.contents];$e=[...$e,...ur],H.contents=$e==null?void 0:$e.filter(ca=>(ca==null?void 0:ca.prop)!=="")}}if(Array.isArray((Jn=H.contents)==null?void 0:Jn[0])){const or=new Map;(qn=H.contents)==null||qn[0].forEach(ur=>{or.has(ur.label)||or.set(ur.label,ur)}),H.contents=[...or.values()],H.contents=[H.contents],H.contents=[(Zn=H.contents)==null?void 0:Zn[0].filter((ur,$e,ca)=>ur.label!=="操作"||ca.findIndex(Un=>Un.label==="操作")===$e)]}else{const or=new Map;H.contents.forEach(ur=>{or.has(ur.label)||or.set(ur.label,ur)}),H.contents=[...or.values()],H.contents=H.contents.filter((ur,$e,ca)=>ur.label!=="操作"||ca.findIndex(Un=>Un.label==="操作")===$e)}}else{let or=bh(H.contents,Le);or!=null&&or.find(ur=>(ur==null?void 0:ur.label)==="操作")||or.push({label:"操作"}),H.contents=[or]}}return(H==null?void 0:H.key)==="relatedFilter"&&(H.index=pe),H}),te)))}f=(Pn=(Lt=(cn=(fn=Q.cloneDeep(oe))==null?void 0:fn[0])==null?void 0:cn.find(Ne=>(Ne==null?void 0:Ne.key)==="header"))==null?void 0:Lt.contents)==null?void 0:Pn.filter(Ne=>!(Ne!=null&&Ne.columnPath)&&(Ne==null?void 0:Ne.label)!=="操作"),s=oe}return s==null?void 0:s.filter(rr=>rr!==void 0)},wn=async(e,a,r="",n=!1,t,i,s,f)=>{var v,E,w,S,T,B;let c,l=new WeakMap;s&&(l=s),(!n||!t)&&(c=(v=l[e])==null?void 0:v.filter(I=>{var U,L;return((U=I==null?void 0:I.key)==null?void 0:U.parentTable)===r||((L=I==null?void 0:I.key)==null?void 0:L.type)==="related"})),no.setPageMapState(l);const o=(E=l[e])==null?void 0:E.filter(I=>{var U;return((U=I==null?void 0:I.key)==null?void 0:U.type)==="structureMethod"}),u=c==null?void 0:c.map(I=>I.id);if(!u)return;let x=(w=l[e])==null?void 0:w.filter(I=>{var U,L,W,M;return((U=I==null?void 0:I.key)==null?void 0:U.type)==="data"&&(u.includes((L=I==null?void 0:I.key)==null?void 0:L.tableId)||u.includes((M=(W=I==null?void 0:I.key)==null?void 0:W.tableId)==null?void 0:M.toString()))});const h=JSON.parse(sessionStorage.getItem("ocr_last_saved_table")||"null"),d=JSON.parse(sessionStorage.getItem("ocr_last_saved_ids")||"null");h&&Array.isArray(d)&&d.length>0&&(e!=null&&e.startsWith("/")&&e.substring(1),(S=h==null?void 0:h.pageKey)!=null&&S.startsWith("/")?h.pageKey.substring(1):h==null||h.pageKey);const p=l[e+G1.value]??[];(p==null?void 0:p.length)===0&&(x=to(x,!1,l));let m=[];x==null||x.forEach(I=>{var W;const U=Array.isArray(I.value.tableData)?I.value.tableData:[I.value.tableData];U.unshift({id:I.id});const L=(W=I==null?void 0:I.key)==null?void 0:W.tableId;m!=null&&m.find(M=>(M==null?void 0:M.key)===L)?m=m==null?void 0:m.map(M=>((M==null?void 0:M.key)===L&&(M.contents=[...M.contents,U]),M)):m.push({key:L,contents:[U]})});let g=[];const y=await(c==null?void 0:c.map(async(I,U)=>{var se,ne,he,ce,Ce,K,Te,Fe,_,A,D,b,G,re,ee,Z,J,we,P,Me,be,Ye,Be,ie,hr,sr,Ea,Ia,wt,Za,Ta,za;let L=I.value.pageData;const W=I==null?void 0:I.id;let M=(se=Q.cloneDeep(L==null?void 0:L.compData))==null?void 0:se.filter(Se=>(Se==null?void 0:Se.key)!=="tableContents");if(!(L!=null&&L.orderId)&&typeof L!="string"&&(L.orderId=U),M&&(M!=null&&M.find(Se=>(Se==null?void 0:Se.key)==="header"))&&(!Array.isArray((he=(ne=M==null?void 0:M.find(Se=>(Se==null?void 0:Se.key)==="header"))==null?void 0:ne.contents)==null?void 0:he[0])&&((Ce=(ce=M==null?void 0:M.find(Se=>(Se==null?void 0:Se.key)==="header"))==null?void 0:ce.contents)!=null&&Ce.every(Se=>!(Se!=null&&Se.columnPath)))||Array.isArray((Te=(K=M==null?void 0:M.find(Se=>(Se==null?void 0:Se.key)==="header"))==null?void 0:K.contents)==null?void 0:Te[0])&&((A=_n((_=(Fe=M==null?void 0:M.find(Se=>(Se==null?void 0:Se.key)==="header"))==null?void 0:Fe.contents)==null?void 0:_[0]))!=null&&A.every(Se=>!(Se!=null&&Se.columnPath))))){M=await(M==null?void 0:M.map(async me=>{var Dr,Rr,xr,Er,da,ta,He,Vr,ia,Sa,xa,cr,Sr,Ra,Ua,Wa,ft,Ot,Rt,yt,Nt,Pt,Mt,k,N,F,C,O,R,X,j,z,V,Y,le,_e,Ee,ue,ge,Ze,Tr,Lr,Kr,sn,fn,cn,Lt,Pn,rr,de,Mn,L0,Ln,jr,Xe;if((me==null?void 0:me.key)==="header"){if(((Dr=me.contents)==null?void 0:Dr.length)===0){let pa=(Rr=M==null?void 0:M.find(oe=>(oe==null?void 0:oe.key)==="relatedFilter"))==null?void 0:Rr.contents,Bn=(xr=pa==null?void 0:pa.split("["))==null?void 0:xr[0],lr=(Vr=(He=(ta=(da=(Er=pa==null?void 0:pa.replace("[",br))==null?void 0:Er.split(br))==null?void 0:da[1])==null?void 0:ta.replace("]",br))==null?void 0:He.split(br))==null?void 0:Vr[0];lr=(ia=lr==null?void 0:lr.split("["))==null?void 0:ia[0],lr=(cr=(xa=lr==null?void 0:lr.split(":"))==null?void 0:xa[((Sa=lr==null?void 0:lr.split(":"))==null?void 0:Sa.length)-1])==null?void 0:cr.replaceAll("'","");let Ha=((Ot=(ft=(Wa=(Ua=(Ra=(Sr=l==null?void 0:l[Bn])==null?void 0:Sr.find(oe=>{var Ir,Re;return((Re=(Ir=oe==null?void 0:oe.value)==null?void 0:Ir.pageData)==null?void 0:Re.name)===lr}))==null?void 0:Ra.value)==null?void 0:Ua.pageData)==null?void 0:Wa.compData)==null?void 0:ft.find(oe=>(oe==null?void 0:oe.key)==="header"))==null?void 0:Ot.contents)??[];if(Ha!=null&&Ha.some(oe=>oe==null?void 0:oe.columnPath)){let oe=await wn(Bn,a,r,n,t,i,l);Ha=(Nt=(yt=(Rt=oe==null?void 0:oe.find(Ir=>(Ir==null?void 0:Ir.name)===lr))==null?void 0:Rt.compData)==null?void 0:yt.find(Ir=>(Ir==null?void 0:Ir.key)==="header"))==null?void 0:Nt.contents}me.contents=Ha}else if((Mt=(Pt=M==null?void 0:M.find(pa=>(pa==null?void 0:pa.key)==="relatedFilter"))==null?void 0:Pt.contents)!=null&&Mt.length){let pa=(k=M==null?void 0:M.find(Re=>(Re==null?void 0:Re.key)==="relatedFilter"))==null?void 0:k.contents,Bn=(N=pa==null?void 0:pa.split("["))==null?void 0:N[0],lr=(X=(R=(O=(C=(F=pa==null?void 0:pa.replace("[",br))==null?void 0:F.split(br))==null?void 0:C[1])==null?void 0:O.replace("]",br))==null?void 0:R.split(br))==null?void 0:X[0],Ha=(V=(z=(j=lr==null?void 0:lr.split("["))==null?void 0:j[1])==null?void 0:z.replaceAll("'",""))==null?void 0:V.split(",");lr=(Y=lr==null?void 0:lr.split("["))==null?void 0:Y[0],lr=((Ee=(_e=lr==null?void 0:lr.split(":"))==null?void 0:_e[((le=lr==null?void 0:lr.split(":"))==null?void 0:le.length)-1])==null?void 0:Ee.replaceAll("'",""))===""?(Ze=(ge=lr==null?void 0:lr.split(":"))==null?void 0:ge[((ue=lr==null?void 0:lr.split(":"))==null?void 0:ue.length)-2])==null?void 0:Ze.replaceAll("'",""):(Kr=(Lr=lr==null?void 0:lr.split(":"))==null?void 0:Lr[((Tr=lr==null?void 0:lr.split(":"))==null?void 0:Tr.length)-1])==null?void 0:Kr.replaceAll("'","");let oe=((rr=(Pn=(Lt=(cn=(fn=(sn=l==null?void 0:l[Bn])==null?void 0:sn.find(Re=>{var Na,Qa;return((Qa=(Na=Re==null?void 0:Re.value)==null?void 0:Na.pageData)==null?void 0:Qa.name)===lr}))==null?void 0:fn.value)==null?void 0:cn.pageData)==null?void 0:Lt.compData)==null?void 0:Pn.find(Re=>(Re==null?void 0:Re.key)==="header"))==null?void 0:rr.contents)??[];if(oe!=null&&oe.some(Re=>Re==null?void 0:Re.columnPath)){let Re=await wn(Bn,a,r,n,t,i,l);oe=(L0=(Mn=(de=Re==null?void 0:Re.find(Na=>(Na==null?void 0:Na.name)===lr))==null?void 0:de.compData)==null?void 0:Mn.find(Na=>(Na==null?void 0:Na.key)==="header"))==null?void 0:L0.contents}(Ha==null?void 0:Ha.length)>0&&(oe=oe==null?void 0:oe.filter(Re=>Ha==null?void 0:Ha.find(Na=>Na===(Re==null?void 0:Re.prop))));let Ir=(Ln=M==null?void 0:M.find(Re=>(Re==null?void 0:Re.key)==="relatedFilter"))==null?void 0:Ln.index;if(Ir!==""){Ir=parseInt(Ir);let Re=((jr=me.contents)==null?void 0:jr.slice(Ir,me.contents.length))??[],Na=[...(Xe=me.contents)==null?void 0:Xe.slice(0,Ir),...oe];Na=[...Na,...Re],me.contents=Na}}}return me})),M=await Promise.all(M);const Se=((D=M==null?void 0:M.find(me=>(me==null?void 0:me.key)==="contentTableId"))==null?void 0:D.contents)??I.id;let Pe=Oi((b=m==null?void 0:m.find(me=>(me==null?void 0:me.key)===Se))==null?void 0:b.contents,(G=M==null?void 0:M.find(me=>(me==null?void 0:me.key)==="header"))==null?void 0:G.contents),Ue=await sx((re=M==null?void 0:M.find(me=>(me==null?void 0:me.key)==="header"))==null?void 0:re.contents,e,(ee=M==null?void 0:M.find(me=>(me==null?void 0:me.key)==="tableFilter"))==null?void 0:ee.contents,l);if((J=(Z=M==null?void 0:M.find(me=>(me==null?void 0:me.key)==="header"))==null?void 0:Z.contents)!=null&&J.find(me=>(me==null?void 0:me.filterContent)&&(me==null?void 0:me.filterContent)!=="")){let me=(Me=(P=(we=M==null?void 0:M.find(xr=>(xr==null?void 0:xr.key)==="header"))==null?void 0:we.contents)==null?void 0:P.find(xr=>(xr==null?void 0:xr.filterContent)&&(xr==null?void 0:xr.filterContent)!==""))==null?void 0:Me.filterContent;me=(be=me==null?void 0:me.slice(1,(me==null?void 0:me.length)-1))==null?void 0:be.split(",");let Dr=me==null?void 0:me.map(xr=>{var da,ta;let Er=j0==null?void 0:j0.find(He=>xr==null?void 0:xr.includes(He==null?void 0:He.key));if(Er)return{order:Er==null?void 0:Er.order,value:Er==null?void 0:Er.value,content:(ta=(da=xr==null?void 0:xr.replaceAll("/",":"))==null?void 0:da.replaceAll(":","="))==null?void 0:ta.replace("=",":")}});M!=null&&M.every(xr=>Array.isArray(xr))||(M=[M]),await(async()=>{var xr,Er,da;for(const ta of Dr??[])if(ta){const He=(da=(Er=(xr=ta==null?void 0:ta.content)==null?void 0:xr.replace(":",br))==null?void 0:Er.split(br))==null?void 0:da[1];M=await io((ta==null?void 0:ta.value)+"('"+JSON.stringify(M).replaceAll("'",'"')+"','"+He+"','')")??[]??M}})(),M=M==null?void 0:M[0]}Ue!=null&&Ue.mainKeys&&M.push({key:"mainRouters",contents:Ue==null?void 0:Ue.mainKeys});let wa=[],er=[];Array.isArray(Ue)&&(wa=Oi(Ue,(Ye=M==null?void 0:M.find(me=>(me==null?void 0:me.key)==="header"))==null?void 0:Ye.contents)),Array.isArray(Ue==null?void 0:Ue.tableContents)&&(er=Oi(Ue==null?void 0:Ue.tableContents,(Be=M==null?void 0:M.find(me=>(me==null?void 0:me.key)==="header"))==null?void 0:Be.contents));let Cr=[...wa,...er];Array.isArray(Pe)&&(Pe==null?void 0:Pe.length)>0&&(Cr=[...Cr,...Pe]),M.push({key:"tableContents",contents:Cr}),M=M==null?void 0:M.map(me=>{var Dr,Rr;return(me==null?void 0:me.key)==="header"&&((Dr=me.contents)==null?void 0:Dr.length)!==0&&(me.contents=(Rr=me.contents)==null?void 0:Rr.map(xr=>((xr==null?void 0:xr.prop)===(Ue==null?void 0:Ue.mainKey)&&(xr.isMainKey=!0),xr))),me})}else M&&((ie=M==null?void 0:M.find(Se=>(Se==null?void 0:Se.key)==="header"))!=null&&ie.contents)&&(M=await $1(Q.cloneDeep(M),W,c,l,e,f),M!=null&&M.every(Se=>Array.isArray(Se))||(M=[M]));if(typeof L!="string"&&(L.id=I==null?void 0:I.id,L.isShow=(sr=(hr=I==null?void 0:I.value)==null?void 0:hr.pageData)==null?void 0:sr.isShow),(M==null?void 0:M.length)>0&&M.every(Se=>Array.isArray(Se)))M==null||M.forEach(Se=>{var wa,er,Cr,me,Dr;let Pe=Q.cloneDeep(L);Pe.compData=Se,Pe.tableId=(wa=Se==null?void 0:Se.find(Rr=>(Rr==null?void 0:Rr.key)==="contentTableId"))==null?void 0:wa.contents;let Ue=(er=Se==null?void 0:Se.find(Rr=>(Rr==null?void 0:Rr.key)==="name"))==null?void 0:er.contents;Ue!=null&&Ue.name0&&(Ue==null?void 0:Ue.name0)===(Pe==null?void 0:Pe.name)?(Pe.name0=Pe.name,Pe.name=Ue==null?void 0:Ue.name):Ue!=null&&Ue.name0&&(Pe.name1=Pe.name,Pe.name0=Ue.name0,Pe.name=Ue==null?void 0:Ue.name),(Cr=Pe==null?void 0:Pe.compData)!=null&&Cr.every(Rr=>Array.isArray(Rr))?((me=Pe==null?void 0:Pe.compData)==null?void 0:me.length)===0?g.push(Pe):(Dr=Pe==null?void 0:Pe.compData)==null||Dr.forEach((Rr,xr)=>{let Er;xr===0?Er={comp:Pe==null?void 0:Pe.comp,compData:Rr,id:Pe==null?void 0:Pe.id,name:Pe==null?void 0:Pe.name,isShow:Pe==null?void 0:Pe.isShow}:Er={comp:Pe==null?void 0:Pe.comp,compData:Rr,id:Pe==null?void 0:Pe.id,name:"",isShow:Pe==null?void 0:Pe.isShow},g.push(Er)}):g.push(Pe)});else if(((Ea=I.key)==null?void 0:Ea.type)==="structure")L.compData=M,(Ia=L==null?void 0:L.compData)!=null&&Ia.every(Se=>Array.isArray(Se))?((wt=L==null?void 0:L.compData)==null?void 0:wt.length)===0?g.push(L):(Za=L==null?void 0:L.compData)==null||Za.forEach((Se,Pe)=>{let Ue;Pe===0?Ue={comp:L==null?void 0:L.comp,compData:Se,id:L==null?void 0:L.id,name:L==null?void 0:L.name,isShow:L==null?void 0:L.isShow}:Ue={comp:L==null?void 0:L.comp,compData:Se,id:L==null?void 0:L.id,name:"",isShow:L==null?void 0:L.isShow},g.push(Ue)}):g.push(L);else if(((Ta=I.key)==null?void 0:Ta.type)==="method"){let Se;Se={name:"",compData:[L],comp:"calculator"},g.push(Se)}else if(((za=I==null?void 0:I.key)==null?void 0:za.type)==="related"){let Se;Se={name:"",compData:L,comp:""},g.push(Se)}}));return await Promise.all(y),((T=o==null?void 0:o.map(I=>I.value.pageData))==null?void 0:T.filter(I=>Object.values(I).length>0).length)>0&&g.push({comp:"methodButton",name:"",compData:(B=o==null?void 0:o.map(I=>I.value.pageData))==null?void 0:B.filter(I=>Object.values(I).length>0)}),g=g.sort((I,U)=>I.orderId-U.orderId),g=await C1(g),i?g:await S1(e,g)},K1=async()=>{var e,a;try{let r=((e=Uc.value)==null?void 0:e.platform)||"browser";const n=((a=Uc.value)==null?void 0:a.chineseName)||"工业软件建模与开发系统";r!=="browser"&&r!=="client"&&r!=="three"&&(r="browser"),_f.setPlatform(r),_f.setPlatName(n)}catch(r){return Promise.reject(r)}},Y0=zr.ref(0),z1=Q.useMenuState(Ae.pinia),V1=l0(Ae.pinia),{originalPath:kf}=Ae.storeToRefs(V1),j1=Q.useLoginState(Ae.pinia),Y1=Ws(Ae.pinia),{multipleTableConst:ht}=Ae.storeToRefs(Y1),{loginUserInfo:v0}=Ae.storeToRefs(j1),{activeMenuPath:J1}=Ae.storeToRefs(z1),q1=Ae.useModelComp(Ae.pinia),{pageMapState:Ss}=Ae.storeToRefs(q1),rn=kf.value,H0="/",As=(e,a,r)=>e==null?void 0:e.map(t=>{var i;return Y0.value++,Array.isArray(t)?As(t,a):{label:(t==null?void 0:t.label)==="操作"?a?"操作":"":(t==null?void 0:t.label)??"",prop:(t==null?void 0:t.label)==="操作"?"operate":(t==null?void 0:t.prop)??"a"+Y0.value,width:(t==null?void 0:t.label)==="操作"?"200":t!=null&&t.width?parseInt(t.width):"",fixed:(t==null?void 0:t.fixed)??void 0,sortable:(t==null?void 0:t.sortable)??!1,align:(t==null?void 0:t.align)??"left",showOverflowTooltip:(t==null?void 0:t.showOverflowTooltip)??!1,isNotDrag:(t==null?void 0:t.isNotDrag)??!1,isEditCol:(t==null?void 0:t.isEditCol)??!1,isOperate:(t==null?void 0:t.isOperate)??!1,id:(t==null?void 0:t.id)??Y0.value,type:(t==null?void 0:t.label)==="操作"?"operate":void 0,formType:(t==null?void 0:t.formType)??(t!=null&&t.groupSelect?"Select":""),isHidden:t==null?void 0:t.isHidden,options:(t==null?void 0:t.options)??[],children:As(t.children,a)??void 0,formMenuSelect:(t==null?void 0:t.formMenuSelect)??[],groupSelect:t!=null&&t.groupSelect?(i=t==null?void 0:t.groupSelect)==null?void 0:i.replaceAll('"',"").split(":"):[],isMainKey:(t==null?void 0:t.isMainKey)||!!(t!=null&&t.directiveLabel),allSelectionContents:(t==null?void 0:t.allContents)??[],selectFilter:t==null?void 0:t.selectFilter,menuId:t==null?void 0:t.menuId,relatedValueId:t==null?void 0:t.relatedValueId,filterContent:t==null?void 0:t.filterContents,menus:t==null?void 0:t.menus,groups:t==null?void 0:t.groups,words:t==null?void 0:t.words,isExistChild:(t==null?void 0:t.isExistChild)??!1,mainKey:(t==null?void 0:t.mainKey)??!1,filter:t==null?void 0:t.filter,bindMenus:t==null?void 0:t.bindMenus,fatherPath:t==null?void 0:t.fatherPath,isMainPath:t==null?void 0:t.isMainPath,required:(t==null?void 0:t.required)??!1,functionName:t==null?void 0:t.functionName,functionRelatedWords:t==null?void 0:t.functionRelatedWords,calculatorFilter:t==null?void 0:t.calculatorFilter}}),Z1=e=>{const a=[];function r(n){if(Array.isArray(n))for(const t of n)!t.children||t.children.length===0?a.push(t):r(t.children)}return r(e),a},Q1=(e,a,r)=>Q.cloneDeep(e).map(t=>(Array.isArray(t)&&(t=t.map(i=>{var s,f,c;return(f=(s=J1.value)==null?void 0:s.split("/"))==null||f.forEach(l=>{var o,u,x;l!==""&&((x=(u=(o=l==null?void 0:l.split(kf+"updateLoading"))==null?void 0:o[0])==null?void 0:u.split(kf+"loading"))==null||x[0])}),Array.isArray(i)?i=As(i,a):(i={label:(i==null?void 0:i.label)==="操作"?a?"操作":"":(i==null?void 0:i.label)??"",prop:(i==null?void 0:i.label)==="操作"?"operate":(i==null?void 0:i.prop)??"a"+Y0.value,width:(i==null?void 0:i.label)==="操作"?"200":i!=null&&i.width?parseInt(i.width):"",fixed:(i==null?void 0:i.fixed)??void 0,sortable:(i==null?void 0:i.sortable)??!1,align:(i==null?void 0:i.align)??"left",showOverflowTooltip:(i==null?void 0:i.showOverflowTooltip)??!0,isNotDrag:(i==null?void 0:i.isNotDrag)??!1,isEditCol:(i==null?void 0:i.isEditCol)??!1,isOperate:(i==null?void 0:i.isOperate)??!1,id:(i==null?void 0:i.id)??Y0.value,type:(i==null?void 0:i.label)==="操作"?"operate":void 0,formType:(i==null?void 0:i.formType)??(i!=null&&i.groupSelect?"Select":""),isHidden:i==null?void 0:i.isHidden,options:(i==null?void 0:i.options)??[],children:As(i.children,a),formMenuSelect:(i==null?void 0:i.formMenuSelect)??[],groupSelect:i!=null&&i.groupSelect?(c=i==null?void 0:i.groupSelect)==null?void 0:c.replaceAll('"',"").split(":"):[],isMainKey:(i==null?void 0:i.isMainKey)||!!(i!=null&&i.directiveLabel),allSelectionContents:(i==null?void 0:i.allContents)??[],selectFilter:i==null?void 0:i.selectFilter,menuId:i==null?void 0:i.menuId,relatedValueId:i==null?void 0:i.relatedValueId,filterContent:i==null?void 0:i.filterContents,menus:i==null?void 0:i.menus,groups:i==null?void 0:i.groups,words:i==null?void 0:i.words,isExistChild:(i==null?void 0:i.isExistChild)??!1,mainKey:(i==null?void 0:i.mainKey)??!1,filter:i==null?void 0:i.filter,bindMenus:i==null?void 0:i.bindMenus,fatherPath:i==null?void 0:i.fatherPath,isMainPath:i==null?void 0:i.isMainPath,required:(i==null?void 0:i.required)??!1,functionName:i==null?void 0:i.functionName,functionRelatedWords:i==null?void 0:i.functionRelatedWords,calculatorFilter:i==null?void 0:i.calculatorFilter},Y0.value++),i})),t)),_n=e=>{function a(r,n=[],t=""){if(!r||r.length===0)return[];let i=n;return Array.isArray(r)&&(r==null||r.forEach(s=>{var f,c,l,o,u,x,h,d,p,m,g,y,v;if(s!=null&&s.children&&((f=s.children)==null?void 0:f.length)>0){let E=t===""?t+((u=(c=s==null?void 0:s.prop)==null?void 0:c.split(ht.value))==null?void 0:u[((o=(l=s==null?void 0:s.prop)==null?void 0:l.split(ht.value))==null?void 0:o.length)-1]):t+ht.value+((p=(x=s==null?void 0:s.prop)==null?void 0:x.split(ht.value))==null?void 0:p[((d=(h=s==null?void 0:s.prop)==null?void 0:h.split(ht.value))==null?void 0:d.length)-1]);i=a(s==null?void 0:s.children,i,E)}else t!==""&&(s.prop=t+ht.value+((v=(m=s==null?void 0:s.prop)==null?void 0:m.split(ht.value))==null?void 0:v[((y=(g=s==null?void 0:s.prop)==null?void 0:g.split(ht.value))==null?void 0:y.length)-1])),i.push(s)})),i}return a(e)},ex=e=>{function a(r,n=[],t=""){if(!r||r.length===0)return[];let i=n;return Array.isArray(r)&&(i=r==null?void 0:r.map(s=>{var f,c,l,o,u,x,h,d,p,m,g,y,v;if(s!=null&&s.children&&((f=s.children)==null?void 0:f.length)>0){let E=t===""?t+((u=(c=s==null?void 0:s.prop)==null?void 0:c.split(ht.value))==null?void 0:u[((o=(l=s==null?void 0:s.prop)==null?void 0:l.split(ht.value))==null?void 0:o.length)-1]):t+ht.value+((p=(x=s==null?void 0:s.prop)==null?void 0:x.split(ht.value))==null?void 0:p[((d=(h=s==null?void 0:s.prop)==null?void 0:h.split(ht.value))==null?void 0:d.length)-1]);s.children=a(s==null?void 0:s.children,i,E)}else t!==""&&(s.prop=t+ht.value+((v=(m=s==null?void 0:s.prop)==null?void 0:m.split(ht.value))==null?void 0:v[((y=(g=s==null?void 0:s.prop)==null?void 0:g.split(ht.value))==null?void 0:y.length)-1]));return s})),i}return a(e)},rx=e=>{let a=Q.cloneDeep(e);return a=a==null?void 0:a.map(r=>((r==null?void 0:r.type)==="Select"?r={label:r==null?void 0:r.label,prop:r==null?void 0:r.prop,name:r==null?void 0:r.name,type:r==null?void 0:r.type,value:(r==null?void 0:r.value)??"",optionUrl:{groupSelect:r==null?void 0:r.groupSelect,menuSelect:r==null?void 0:r.menuSelect,type:"Select",selectRelateType:r==null?void 0:r.selectRelateType,multiple:r==null?void 0:r.multiple}}:(r==null?void 0:r.type)==="Date"&&(r.value=!(r!=null&&r.value)&&(r==null?void 0:r.isNewDate)!==!1?new Date:r==null?void 0:r.value),r.label=r.prop||r.label,r)),a},so=e=>{var a,r,n,t,i,s;if(((a=e==null?void 0:e.pageData)==null?void 0:a.comp)==="Form"){let f=(n=(r=e==null?void 0:e.pageData)==null?void 0:r.compData)==null?void 0:n.map(l=>{var o;return(l==null?void 0:l.key)==="formContent"&&(l.contents=(o=l.contents)==null?void 0:o.map(u=>((u==null?void 0:u.type)==="Date"&&(u.value=""),u))),l});return{pageData:{comp:(t=e==null?void 0:e.pageData)==null?void 0:t.comp,compData:f,name:(i=e==null?void 0:e.pageData)==null?void 0:i.name,isShow:(s=e==null?void 0:e.pageData)==null?void 0:s.isShow}}}else return e},fo=(e,a)=>{var n,t,i,s,f,c,l,o,u;let r=(i=(t=(n=a==null?void 0:a.pageData)==null?void 0:n.compData)==null?void 0:t.find(x=>(x==null?void 0:x.key)==="formContent"))==null?void 0:i.contents;if(((s=e==null?void 0:e.pageData)==null?void 0:s.comp)==="Form"){let x=(c=(f=e==null?void 0:e.pageData)==null?void 0:f.compData)==null?void 0:c.map(d=>{var p;return(d==null?void 0:d.key)==="formContent"&&(d.contents=(p=d.contents)==null?void 0:p.map(m=>{var g;return m.value=(g=r==null?void 0:r.find(y=>(y==null?void 0:y.key)===(m==null?void 0:m.key)))==null?void 0:g.value,m})),d});return{pageData:{comp:(l=e==null?void 0:e.pageData)==null?void 0:l.comp,compData:x,name:(o=e==null?void 0:e.pageData)==null?void 0:o.name,isShow:(u=e==null?void 0:e.pageData)==null?void 0:u.isShow}}}else return e},Pf=async(e,a,r,n,t)=>{var p,m,g,y,v,E,w,S,T,B,I,U,L,W,M,se,ne,he,ce,Ce,K,Te,Fe;let i=e;(i==null?void 0:i[(i==null?void 0:i.length)-1])!==rn&&(i="",(m=(p=Q.cloneDeep(e))==null?void 0:p.split(rn))==null||m.forEach((_,A)=>{var D,b;A!==((b=(D=Q.cloneDeep(e))==null?void 0:D.split(rn))==null?void 0:b.length)-1&&(i=i===""?i+_:i+"/"+_)}),i=i+rn);let s=[],f=await la.getInsofDataApi({key:{pageKey:e,systemKey:sessionStorage.getItem("systemKey")}});const c={data:{result:(y=(g=f==null?void 0:f.data)==null?void 0:g.result)==null?void 0:y.filter(_=>{var A;return((A=_==null?void 0:_.key)==null?void 0:A.type)==="structure"})}};let l;(e==null?void 0:e[(e==null?void 0:e.length)-1])!==rn&&(l={data:{result:(v=Ss.value[i])==null?void 0:v.filter(_=>{var A;return((A=_==null?void 0:_.key)==null?void 0:A.type)==="structure"})}},((w=(E=l==null?void 0:l.data)==null?void 0:E.result)==null?void 0:w.length)>0&&(l=(T=(S=Q.cloneDeep(l))==null?void 0:S.data)==null?void 0:T.result));const o={data:{result:(B=Ss.value[i])==null?void 0:B.filter(_=>{var A;return((A=_==null?void 0:_.key)==null?void 0:A.type)==="structureMethod"})}},u={data:{result:(U=(I=f==null?void 0:f.data)==null?void 0:I.result)==null?void 0:U.filter(_=>{var A;return((A=_==null?void 0:_.key)==null?void 0:A.type)==="data"})}};if((e==null?void 0:e[(e==null?void 0:e.length)-1])!==rn){let _=(L=c==null?void 0:c.data)==null?void 0:L.result;if(!Array.isArray(l))return;l==null||l.forEach(A=>{var b,G,re,ee,Z;let D=(b=_==null?void 0:_.find(J=>{var we,P,Me,be;return((P=(we=A==null?void 0:A.value)==null?void 0:we.pageData)==null?void 0:P.name)===((be=(Me=J==null?void 0:J.value)==null?void 0:Me.pageData)==null?void 0:be.name)}))==null?void 0:b.value;D?D=D:D=void 0,s.push({key:{pageKey:a,parentTable:((G=D==null?void 0:D.key)==null?void 0:G.parentTable)??"",systemKey:(re=A==null?void 0:A.key)==null?void 0:re.systemKey,type:((ee=D==null?void 0:D.key)==null?void 0:ee.type)??((Z=A==null?void 0:A.key)==null?void 0:Z.type),version:1},value:fo(A==null?void 0:A.value,D)})})}else(M=(W=c==null?void 0:c.data)==null?void 0:W.result)==null||M.forEach(_=>{var A,D,b;s.push({key:{pageKey:a,parentTable:(A=_==null?void 0:_.key)==null?void 0:A.parentTable,systemKey:(D=_==null?void 0:_.key)==null?void 0:D.systemKey,type:(b=_==null?void 0:_.key)==null?void 0:b.type,version:1},value:so(_==null?void 0:_.value)})});if((ne=(se=o==null?void 0:o.data)==null?void 0:se.result)==null||ne.forEach(_=>{var A,D;s.push({key:{pageKey:a,systemKey:(A=_==null?void 0:_.key)==null?void 0:A.systemKey,type:(D=_==null?void 0:_.key)==null?void 0:D.type,version:1},value:_==null?void 0:_.value})}),s=s==null?void 0:s.map(_=>{var A,D,b;return((D=(A=_==null?void 0:_.value)==null?void 0:A.pageData)==null?void 0:D.comp)==="Form"&&(_.value.pageData.compData=(b=_.value.pageData.compData)==null?void 0:b.map(G=>{var re;return(G==null?void 0:G.key)==="formContent"&&(G.contents=(re=G.contents)==null?void 0:re.map(ee=>(r!=null&&r[ee==null?void 0:ee.key]&&(ee==null?void 0:ee.type)!=="Date"&&(ee.value=r[ee.key]),ee))),G}),n&&_.value.pageData.compData.push({key:"parentFormPath",contents:n})),_}),(s==null?void 0:s.length)>0){let _;if(!t)_=s;else{const A=s==null?void 0:s.find(b=>{var G,re;return t==null?void 0:t.includes((re=(G=b==null?void 0:b.value)==null?void 0:G.pageData)==null?void 0:re.name)}),D=/^[A-Za-z]+$/;_=A?s==null?void 0:s.map(b=>{var G,re,ee,Z,J,we;return t!=null&&t.includes((re=(G=b==null?void 0:b.value)==null?void 0:G.pageData)==null?void 0:re.name)?{...b,value:{pageData:{...(ee=b==null?void 0:b.value)==null?void 0:ee.pageData,compData:(we=(J=(Z=b==null?void 0:b.value)==null?void 0:Z.pageData)==null?void 0:J.compData)==null?void 0:we.map(P=>{var Me;return(P==null?void 0:P.key)==="formContent"?{...P,contents:(Me=P==null?void 0:P.contents)==null?void 0:Me.map(be=>D.test(be==null?void 0:be.prop)?be:{...be,value:""})}:P})}}}:b}):s}await la.batchAddInsofDataApi({dataList:_})}let x={};const h=await la.getInsofDataApi({key:{pageKey:a,type:"structure",systemKey:sessionStorage.getItem("systemKey")}});((ce=(he=c==null?void 0:c.data)==null?void 0:he.result)==null?void 0:ce.length)>0&&((K=(Ce=c==null?void 0:c.data)==null?void 0:Ce.result)==null||K.forEach(_=>{var A,D,b;x[_.id]=(b=(D=(A=h==null?void 0:h.data)==null?void 0:A.result)==null?void 0:D.find(G=>{var re,ee,Z,J;return((ee=(re=G==null?void 0:G.value)==null?void 0:re.pageData)==null?void 0:ee.name)===((J=(Z=_==null?void 0:_.value)==null?void 0:Z.pageData)==null?void 0:J.name)}))==null?void 0:b.id}));let d=[];(Fe=(Te=u==null?void 0:u.data)==null?void 0:Te.result)==null||Fe.forEach(_=>{var A,D,b;d.push({key:{pageKey:a,tableId:x[(A=_==null?void 0:_.key)==null?void 0:A.tableId],systemKey:(D=_==null?void 0:_.key)==null?void 0:D.systemKey,type:(b=_==null?void 0:_.key)==null?void 0:b.type},value:_==null?void 0:_.value})}),(d==null?void 0:d.length)>0&&await la.batchAddInsofDataApi({dataList:d})},ax=async(e,a,r,n,t)=>{var p,m,g,y,v,E,w,S,T,B,I,U,L,W,M,se,ne,he,ce,Ce,K,Te,Fe;let i=e;(i==null?void 0:i[(i==null?void 0:i.length)-1])!==H0&&(i="",(m=(p=Q.cloneDeep(e))==null?void 0:p.split(H0))==null||m.forEach((_,A)=>{var D,b;A!==((b=(D=Q.cloneDeep(e))==null?void 0:D.split(H0))==null?void 0:b.length)-1&&(i=i===""?i+_:i+"/"+_)}),i=i+H0);let s=[],f=await la.getInsofDataApi({key:{pageKey:e,systemKey:sessionStorage.getItem("systemKey")}});const c={data:{result:(y=(g=f==null?void 0:f.data)==null?void 0:g.result)==null?void 0:y.filter(_=>{var A;return((A=_==null?void 0:_.key)==null?void 0:A.type)==="structure"})}};let l;(e==null?void 0:e[(e==null?void 0:e.length)-1])!==H0&&(l={data:{result:(v=Ss.value[e])==null?void 0:v.filter(_=>{var A;return((A=_==null?void 0:_.key)==null?void 0:A.type)==="structure"})}},((w=(E=l==null?void 0:l.data)==null?void 0:E.result)==null?void 0:w.length)>0&&(l=(T=(S=Q.cloneDeep(l))==null?void 0:S.data)==null?void 0:T.result));const o={data:{result:(B=Ss.value[i])==null?void 0:B.filter(_=>{var A;return((A=_==null?void 0:_.key)==null?void 0:A.type)==="structureMethod"})}},u={data:{result:(U=(I=f==null?void 0:f.data)==null?void 0:I.result)==null?void 0:U.filter(_=>{var A;return((A=_==null?void 0:_.key)==null?void 0:A.type)==="data"})}};if((e==null?void 0:e[(e==null?void 0:e.length)-1])!==H0){let _=(L=c==null?void 0:c.data)==null?void 0:L.result;if(!Array.isArray(l))return;l==null||l.forEach(A=>{var b,G,re,ee,Z,J,we,P;let D;(G=(b=A==null?void 0:A.value)==null?void 0:b.pageData)!=null&&G.name0?D=(re=_==null?void 0:_.find(Me=>{var be,Ye,Be,ie,hr,sr,Ea,Ia;return((Ye=(be=A==null?void 0:A.value)==null?void 0:be.pageData)==null?void 0:Ye.name)===((ie=(Be=Me==null?void 0:Me.value)==null?void 0:Be.pageData)==null?void 0:ie.name)&&((sr=(hr=A==null?void 0:A.value)==null?void 0:hr.pageData)==null?void 0:sr.name0)===((Ia=(Ea=Me==null?void 0:Me.value)==null?void 0:Ea.pageData)==null?void 0:Ia.name0)}))==null?void 0:re.value:D=(ee=_==null?void 0:_.find(Me=>{var be,Ye,Be,ie;return((Ye=(be=A==null?void 0:A.value)==null?void 0:be.pageData)==null?void 0:Ye.name)===((ie=(Be=Me==null?void 0:Me.value)==null?void 0:Be.pageData)==null?void 0:ie.name)}))==null?void 0:ee.value,D?D=D:D=void 0,s.push({key:{pageKey:a,parentTable:((Z=D==null?void 0:D.key)==null?void 0:Z.parentTable)??"",systemKey:(J=A==null?void 0:A.key)==null?void 0:J.systemKey,type:((we=D==null?void 0:D.key)==null?void 0:we.type)??((P=A==null?void 0:A.key)==null?void 0:P.type),version:1},value:fo(A==null?void 0:A.value,D)})})}else(M=(W=c==null?void 0:c.data)==null?void 0:W.result)==null||M.forEach(_=>{var A,D,b;s.push({key:{pageKey:a,parentTable:(A=_==null?void 0:_.key)==null?void 0:A.parentTable,systemKey:(D=_==null?void 0:_.key)==null?void 0:D.systemKey,type:(b=_==null?void 0:_.key)==null?void 0:b.type,version:1},value:so(_==null?void 0:_.value)})});if((ne=(se=o==null?void 0:o.data)==null?void 0:se.result)==null||ne.forEach(_=>{var A,D;s.push({key:{pageKey:a,systemKey:(A=_==null?void 0:_.key)==null?void 0:A.systemKey,type:(D=_==null?void 0:_.key)==null?void 0:D.type,version:1},value:_==null?void 0:_.value})}),s=s==null?void 0:s.map(_=>{var A,D;return(D=(A=_==null?void 0:_.value)==null?void 0:A.pageData)==null||D.comp,_}),(s==null?void 0:s.length)>0){let _;_=s,await la.batchAddInsofDataApi({dataList:_})}let x={};const h=await la.getInsofDataApi({key:{pageKey:a,type:"structure",systemKey:sessionStorage.getItem("systemKey")}});((ce=(he=c==null?void 0:c.data)==null?void 0:he.result)==null?void 0:ce.length)>0&&((K=(Ce=c==null?void 0:c.data)==null?void 0:Ce.result)==null||K.forEach(_=>{var A,D,b,G,re,ee,Z,J;(D=(A=_==null?void 0:_.value)==null?void 0:A.pageData)!=null&&D.name0?x[_.id]=(re=(G=(b=h==null?void 0:h.data)==null?void 0:b.result)==null?void 0:G.find(we=>{var P,Me,be,Ye,Be,ie,hr,sr;return((Me=(P=we==null?void 0:we.value)==null?void 0:P.pageData)==null?void 0:Me.name)===((Ye=(be=_==null?void 0:_.value)==null?void 0:be.pageData)==null?void 0:Ye.name)&&((ie=(Be=we==null?void 0:we.value)==null?void 0:Be.pageData)==null?void 0:ie.name0)===((sr=(hr=_==null?void 0:_.value)==null?void 0:hr.pageData)==null?void 0:sr.name0)}))==null?void 0:re.id:x[_.id]=(J=(Z=(ee=h==null?void 0:h.data)==null?void 0:ee.result)==null?void 0:Z.find(we=>{var P,Me,be,Ye;return((Me=(P=we==null?void 0:we.value)==null?void 0:P.pageData)==null?void 0:Me.name)===((Ye=(be=_==null?void 0:_.value)==null?void 0:be.pageData)==null?void 0:Ye.name)}))==null?void 0:J.id}));let d=[];(Fe=(Te=u==null?void 0:u.data)==null?void 0:Te.result)==null||Fe.forEach(_=>{var A,D,b;d.push({key:{pageKey:a,tableId:x[(A=_==null?void 0:_.key)==null?void 0:A.tableId],systemKey:(D=_==null?void 0:_.key)==null?void 0:D.systemKey,type:(b=_==null?void 0:_.key)==null?void 0:b.type},value:_==null?void 0:_.value})}),(d==null?void 0:d.length)>0&&await la.batchAddInsofDataApi({dataList:d})},co=(e,a)=>{let r=Q.cloneDeep(e);return r=r==null?void 0:r.map(t=>{var c,l,o;let i=[],s=[];for(let u in a)if(u!=null&&u.includes((l=(c=Q.cloneDeep(t))==null?void 0:c.key)==null?void 0:l.pageKey)){let x=(o=a[u])==null?void 0:o.filter(h=>{var d,p,m;return((d=h==null?void 0:h.key)==null?void 0:d.type)==="data"&&((p=h==null?void 0:h.key)==null?void 0:p.tableId)===((m=Q.cloneDeep(t))==null?void 0:m.id)});s=[...s,...x]}(s==null?void 0:s.length)>0&&(s==null||s.forEach(u=>{i.push(u.value.tableData)}));let f=Q.cloneDeep(t).value.pageData.compData;return f.push({key:"tableContents",contents:i}),t.value.pageData.compData=f,t}),r},lo=(e,a)=>{if(!(e!=null&&e.includes("[")))return e;let r=e==null?void 0:e.replaceAll("[","").replaceAll("]","").split(":"),n=a==null?void 0:a.map(i=>{var s;return(s=i==null?void 0:i.value)==null?void 0:s.pageData}),t="";return n==null||n.forEach(i=>{var s;(i==null?void 0:i.name)===(r==null?void 0:r[0])&&((s=i==null?void 0:i.compData)==null||s.forEach(f=>{var c;(f==null?void 0:f.key)==="header"&&((c=f==null?void 0:f.contents)==null||c.forEach((l,o)=>{(l==null?void 0:l.prop)===(r==null?void 0:r[1])&&(t=o)}))}))}),t},oo=(e,a)=>{if(!(e!=null&&e.includes("[")))return e;let r=e==null?void 0:e.replaceAll("[","").replaceAll("]","").split(":"),n=a==null?void 0:a.map(i=>{var s;return(s=i==null?void 0:i.value)==null?void 0:s.pageData}),t="";return n==null||n.forEach(i=>{var s;(i==null?void 0:i.name)===(r==null?void 0:r[0])&&((s=i==null?void 0:i.compData)==null||s.forEach(f=>{var c;(f==null?void 0:f.key)==="formContent"&&((c=f==null?void 0:f.contents)==null||c.forEach(l=>{(l==null?void 0:l.prop)===(r==null?void 0:r[1])&&(t=l==null?void 0:l.value)}))}))}),t},Wc=(e,a,r,n)=>{var c,l,o;let t=(c=e==null?void 0:e[0])==null?void 0:c.formMenuSelect,i=e==null?void 0:e.map(u=>{var x,h;return(h=(x=u.groupSelect)==null?void 0:x.split(":"))==null?void 0:h[1]}),s="";t==null||t.forEach((u,x)=>{(t==null?void 0:t.length)-1!==x?s=s===""?s+u:s+"/"+u:s=s+rn+u});let f=[];for(let u in a)if(u!=null&&u.includes(s)){let x=(l=a[u])==null?void 0:l.filter(h=>{var d,p;return((d=h==null?void 0:h.key)==null?void 0:d.type)==="structure"&&((p=h==null?void 0:h.key)==null?void 0:p.parentTable)===""});f=[...f,...x]}if((f==null?void 0:f.length)>0){let u=f==null?void 0:f.filter(m=>{var g,y,v;return((g=m==null?void 0:m.key)==null?void 0:g.pageKey)!==s&&((v=(y=m==null?void 0:m.value)==null?void 0:y.pageData)==null?void 0:v.comp)==="Form"}),x=f==null?void 0:f.filter(m=>{var g,y,v;return((g=m==null?void 0:m.key)==null?void 0:g.pageKey)!==s&&((v=(y=m==null?void 0:m.value)==null?void 0:y.pageData)==null?void 0:v.comp)==="Table"});x=co(Q.cloneDeep(x),a),u=[...Q.cloneDeep(u),...x],u=u==null?void 0:u.map(m=>({[m.key.pageKey]:m}));let h=0;u=u.reduce((m,g)=>(Object.keys(g).forEach(y=>{m[y]||(m[y]=[],m[y].push({index:h})),m[y].push(g[y])}),h++,m),{});let d=(o=Object.values(u))==null?void 0:o.sort((m,g)=>{var E,w;let y=(E=m==null?void 0:m.find(S=>S==null?void 0:S.index))==null?void 0:E.index,v=(w=g==null?void 0:g.find(S=>S==null?void 0:S.index))==null?void 0:w.index;return y-v});u=d==null?void 0:d.map(m=>m==null?void 0:m.filter(g=>{var y,v,E,w;return!(g!=null&&g.index)&&(g==null?void 0:g.index)!==0&&!((v=(y=g==null?void 0:g.key)==null?void 0:y.pageKey)!=null&&v.includes("updateLoading"))&&!((w=(E=g==null?void 0:g.key)==null?void 0:E.pageKey)!=null&&w.includes("loading"))}));let p=[];if(u==null||u.forEach(m=>{var v,E,w,S,T,B,I,U,L,W;const g=m==null?void 0:m.find(M=>{var se,ne,he,ce,Ce;return((ne=(se=M==null?void 0:M.value)==null?void 0:se.pageData)==null?void 0:ne.name)===((Ce=(ce=(he=e==null?void 0:e[0])==null?void 0:he.groupSelect)==null?void 0:ce.split(":"))==null?void 0:Ce[0])});let y=(T=(S=(w=(E=(v=Q.cloneDeep(g))==null?void 0:v.value)==null?void 0:E.pageData)==null?void 0:w.compData)==null?void 0:S.find(M=>(M==null?void 0:M.key)==="formContent"))==null?void 0:T.contents;if(y){let M=[];i==null||i.forEach((se,ne)=>{var Ce,K,Te,Fe,_,A;let he=m==null?void 0:m.find(D=>{var b,G,re,ee,Z;return((G=(b=D==null?void 0:D.value)==null?void 0:b.pageData)==null?void 0:G.name)===((Z=(ee=(re=e==null?void 0:e[ne])==null?void 0:re.groupSelect)==null?void 0:ee.split(":"))==null?void 0:Z[0])}),ce=(_=(Fe=(Te=(K=(Ce=Q.cloneDeep(he))==null?void 0:Ce.value)==null?void 0:K.pageData)==null?void 0:Te.compData)==null?void 0:Fe.find(D=>(D==null?void 0:D.key)==="formContent"))==null?void 0:_.contents;ce!=null&&ce.find(D=>(D==null?void 0:D.key)===se)?M.push((A=ce==null?void 0:ce.find(D=>(D==null?void 0:D.key)===se))==null?void 0:A.value):M.push("")}),p.push(M)}else y=(W=(L=(U=(I=(B=Q.cloneDeep(g))==null?void 0:B.value)==null?void 0:I.pageData)==null?void 0:U.compData)==null?void 0:L.find(M=>(M==null?void 0:M.key)==="tableContents"))==null?void 0:W.contents,y==null||y.forEach(M=>{let se=[];i==null||i.forEach(ne=>{M!=null&&M[ne]&&se.push(M==null?void 0:M[ne])}),p.push(se)})}),(r==null?void 0:r.length)>0){let m={};r==null||r.forEach(g=>{var y;for(let v in g){let E=Q.cloneDeep(v);if(!(E!=null&&E.includes("[")))(y=g[v])!=null&&y.includes("[")||(m[E]=g[v]);else{let w=oo(E,a[n]),S=lo(g[v],a[n]);m[w]=S}}});for(let g in m)p=p==null?void 0:p.filter(y=>y[m[g]]===g)}return p}},tx=(e,a,r,n)=>{var f,c,l,o,u;let t=Q.cloneDeep(e),i=a==null?void 0:a.map(x=>x==null?void 0:x.prop),s=[];for(let x in r)if(x!=null&&x.includes(t)){let h=(f=r[x])==null?void 0:f.filter(d=>{var p,m;return((p=d==null?void 0:d.key)==null?void 0:p.type)==="structure"&&((m=d==null?void 0:d.key)==null?void 0:m.parentTable)===""});s=[...s,...h]}if((s==null?void 0:s.length)>0){let x=s==null?void 0:s.filter(E=>{var w,S,T,B;return((w=E==null?void 0:E.key)==null?void 0:w.pageKey)!==t&&((T=(S=E==null?void 0:E.value)==null?void 0:S.pageData)==null?void 0:T.comp)==="Form"&&(E==null?void 0:E.key.pageKey.includes(t+rn))&&!((B=E==null?void 0:E.key.pageKey)!=null&&B.includes("@"))}),h=s==null?void 0:s.filter(E=>{var w,S,T,B;return((w=E==null?void 0:E.key)==null?void 0:w.pageKey)!==t&&((T=(S=E==null?void 0:E.value)==null?void 0:S.pageData)==null?void 0:T.comp)==="Table"&&(E==null?void 0:E.key.pageKey.includes(t+rn))&&!((B=E==null?void 0:E.key.pageKey)!=null&&B.includes("@"))});h=co(Q.cloneDeep(h),r),x=[...Q.cloneDeep(x),...h],x=x==null?void 0:x.map(E=>({[E.key.pageKey]:E}));let d=0;x=x.reduce((E,w)=>(Object.keys(w).forEach(S=>{E[S]||(E[S]=[],E[S].push({index:d})),E[S].push(w[S])}),d++,E),{}),x=to(x,!0,r);let p=(c=Object.values(x))==null?void 0:c.sort((E,w)=>{var B,I;let S=(B=E==null?void 0:E.find(U=>U==null?void 0:U.index))==null?void 0:B.index,T=(I=w==null?void 0:w.find(U=>U==null?void 0:U.index))==null?void 0:I.index;return S-T});x=p==null?void 0:p.map(E=>E==null?void 0:E.filter(w=>!(w!=null&&w.index)&&(w==null?void 0:w.index)!==0));let m=(l=Q.cloneDeep(x))==null?void 0:l.filter(E=>E==null?void 0:E.find(w=>{var S,T,B,I;return((I=(S=w==null?void 0:w.key)==null?void 0:S.pageKey)==null?void 0:I[((B=(T=w==null?void 0:w.key)==null?void 0:T.pageKey)==null?void 0:B.length)-1])===rn}));x=x==null?void 0:x.filter(E=>!(E!=null&&E.find(w=>{var S,T,B,I,U,L,W,M;return((I=(S=w==null?void 0:w.key)==null?void 0:S.pageKey)==null?void 0:I[((B=(T=w==null?void 0:w.key)==null?void 0:T.pageKey)==null?void 0:B.length)-1])===rn||((L=(U=w==null?void 0:w.key)==null?void 0:U.pageKey)==null?void 0:L.includes("updateLoading"))||((M=(W=w==null?void 0:w.key)==null?void 0:W.pageKey)==null?void 0:M.includes("loading"))})));let g=[],y=[];(o=m==null?void 0:m[0])==null||o.forEach(E=>{var w,S,T,B,I;((S=(w=E==null?void 0:E.value)==null?void 0:w.pageData)==null?void 0:S.comp)==="Form"&&((I=(B=(T=E==null?void 0:E.value)==null?void 0:T.pageData)==null?void 0:B.compData)==null||I.forEach(U=>{(U==null?void 0:U.key)==="formContent"&&(y=[...y,...U==null?void 0:U.contents])}))});let v=(u=y==null?void 0:y.find(E=>(E==null?void 0:E.isMain)===!0))==null?void 0:u.key;if(x==null||x.forEach(E=>{let w=[];E==null||E.forEach(T=>{var B,I,U,L,W;((I=(B=T==null?void 0:T.value)==null?void 0:B.pageData)==null?void 0:I.comp)==="Form"&&((W=(L=(U=T==null?void 0:T.value)==null?void 0:U.pageData)==null?void 0:L.compData)==null||W.forEach(M=>{(M==null?void 0:M.key)==="formContent"&&(w=[...w,...M==null?void 0:M.contents])}))});let S={};i==null||i.forEach(T=>{let B=w==null?void 0:w.find(I=>(I==null?void 0:I.key)===T);B!=null&&B.prop&&(S[B.prop]=(B==null?void 0:B.value)??"")}),g.push(S)}),(n==null?void 0:n.length)>0){let E=[];n==null||n.forEach(w=>{var I,U,L,W,M,se,ne,he,ce;let S={};for(let Ce in w){let K=Q.cloneDeep(Ce);if(!(K!=null&&K.includes("[")))((I=w[Ce])==null?void 0:I.toUpperCase())==="@LOGINUSER"?S[K]=((U=v0.value)==null?void 0:U.姓名)||((L=v0.value)==null?void 0:L.account)||((W=v0.value)==null?void 0:W.账号)||((M=v0.value)==null?void 0:M.姓名):(se=w[Ce])!=null&&se.includes("[")||(S[K]=w[Ce]);else{let Te=oo(K,r[e]),Fe=lo(w[Ce],r[e]);S[Te]=Fe}}let T=[],B=0;for(let Ce in S)((ne=S[Ce])==null?void 0:ne[0])!=="!"?T=(he=B>0?T:g)==null?void 0:he.filter(Te=>Te[Ce]===S[Ce]):T=(ce=B>0?T:g)==null?void 0:ce.filter(K=>{var Te;return K[Ce]!==((Te=S[Ce])==null?void 0:Te.replaceAll("!",""))}),B=1;E=[...E,...T]}),g=[...new Set(E)]}return g=g==null?void 0:g.map(E=>Object.values(E)),{mainKey:v,tableContents:g}}},nx=(e,a)=>{var t,i,s,f,c,l;let r=(i=(t=Q.cloneDeep(e))==null?void 0:t.split("/"))==null?void 0:i[0],n=[];for(let o in a)if(o!=null&&o.includes(r)){let u=(s=a[o])==null?void 0:s.filter(x=>{var h,d;return((h=x==null?void 0:x.key)==null?void 0:h.type)==="structure"&&((d=x==null?void 0:x.key)==null?void 0:d.parentTable)===""});n=[...n,...u]}return(n==null?void 0:n.length)>0?!!((l=(c=(f=n==null?void 0:n.filter(u=>{var x;return((x=u==null?void 0:u.key)==null?void 0:x.pageKey)===r}))==null?void 0:f[0])==null?void 0:c.key)==null?void 0:l.parentPageKey):!0},ix=async(e,a,r,n)=>{var s,f,c,l,o,u,x,h,d;let t=(f=(s=Q.cloneDeep(e))==null?void 0:s.split("/"))==null?void 0:f[0],i=[];for(let p in n)if(p!=null&&p.includes(t)){let m=(c=n[p])==null?void 0:c.filter(g=>{var y,v;return((y=g==null?void 0:g.key)==null?void 0:y.type)==="structure"&&((v=g==null?void 0:g.key)==null?void 0:v.parentTable)===""});i=[...i,...m]}if((i==null?void 0:i.length)>0){let p=(u=(o=(l=i==null?void 0:i.filter(y=>{var v;return((v=y==null?void 0:y.key)==null?void 0:v.pageKey)===t}))==null?void 0:l[0])==null?void 0:o.key)==null?void 0:u.parentPageKey,m=[];if(p){for(let y in n)if(y!=null&&y.includes(p)){let v=(x=n[y])==null?void 0:x.filter(E=>{var w,S;return((w=E==null?void 0:E.key)==null?void 0:w.type)==="structure"&&((S=E==null?void 0:E.key)==null?void 0:S.parentTable)===""});m=[...m,...v]}}else m=i;let g="";if((m==null?void 0:m.length)>0){let y=[],v;v=(h=m==null?void 0:m.filter(U=>{var L,W,M,se,ne,he;return((M=(W=(L=U==null?void 0:U.key)==null?void 0:L.pageKey)==null?void 0:W.split("/"))==null?void 0:M[0])===p&&((he=(ne=(se=U==null?void 0:U.key)==null?void 0:se.pageKey)==null?void 0:ne.split("/"))==null?void 0:he.length)===2}))==null?void 0:h.map(U=>{var L;return(L=U==null?void 0:U.key)==null?void 0:L.pageKey}),v=[...new Set(v)],v=v==null?void 0:v.filter(U=>!U.includes(rn));let E=(d=Q.cloneDeep(v))==null?void 0:d.map(async U=>{var ne,he,ce,Ce,K,Te,Fe,_,A,D,b,G,re,ee,Z;let L=await wn(U,sessionStorage.getItem("systemKey"),"",!1,[],!1,n),W=(Ce=(ce=(he=(ne=Q.cloneDeep(L))==null?void 0:ne[0])==null?void 0:he.compData)==null?void 0:ce.find(J=>(J==null?void 0:J.key)==="tableContents"))==null?void 0:Ce.contents,M=(D=(A=(_=(Fe=(Te=(K=Q.cloneDeep(L))==null?void 0:K[0])==null?void 0:Te.compData)==null?void 0:Fe.find(J=>(J==null?void 0:J.key)==="header"))==null?void 0:_.contents)==null?void 0:A.filter(J=>(J==null?void 0:J.label)!=="操作"))==null?void 0:D.map(J=>J==null?void 0:J.prop),se=[];return(Z=(ee=(re=(G=(b=Q.cloneDeep(L))==null?void 0:b[0])==null?void 0:G.compData)==null?void 0:re.find(J=>(J==null?void 0:J.key)==="header"))==null?void 0:ee.contents)==null||Z.forEach(J=>{(J==null?void 0:J.isMainKey)===!0&&(g=J==null?void 0:J.prop)}),W==null||W.forEach(J=>{let we=m0(J,M);se.push(we),y.push({key:we==null?void 0:we[g],routerContent:U})}),se}),w=await Promise.all(E),S=[];w==null||w.forEach(U=>{(U==null?void 0:U.length)>0&&(U==null||U.forEach(L=>{S.push(L)}))});let T=[];T=a==null?void 0:a.map(U=>{var W,M,se;let L={};for(let ne in U)U[ne].toUpperCase()==="@LOGINUSER"?L[ne]=((W=v0.value)==null?void 0:W.姓名)||((M=v0.value)==null?void 0:M.account)||((se=v0.value)==null?void 0:se.账号):L[ne]=U[ne];return L});let B=[];S==null||S.forEach(U=>{let L=[];T==null||T.forEach(W=>{let M=[];for(let se in W)M.push(U[se]===W[se]);L.push(M)}),L.find(W=>W==null?void 0:W.every(M=>M===!0))&&B.push(U)});let I=[];return B==null||B.forEach(U=>{let L={};r==null||r.forEach(W=>{L[W.prop]=U[W.prop]??""}),I.push(L)}),I=I==null?void 0:I.map(U=>Object.values(U)),{mainKey:g,tableContents:I,mainKeys:y}}else return}else return},sx=async(e,a,r,n)=>{var i,s,f,c;let t=(i=Q.cloneDeep(e))==null?void 0:i.filter(l=>(l==null?void 0:l.label)!=="操作");if((r==null?void 0:r.length)>0&&(t!=null&&t.every(l=>!(l!=null&&l.formMenuSelect)))&&nx(a,n)){let l=await ix(a,r,t,n);return l&&((s=l==null?void 0:l.tableContents)==null?void 0:s.length)>0?l:[]}if(!(t!=null&&t.every(l=>{var o,u,x,h;return((o=l==null?void 0:l.formMenuSelect)==null?void 0:o.length)>0&&((x=(u=l==null?void 0:l.groupSelect)==null?void 0:u.split(":"))==null?void 0:x.length)>0||((h=l==null?void 0:l.formMenuGroup)==null?void 0:h.length)>0})))return tx(a,t,n,r);if(t!=null&&t.every(l=>!(l!=null&&l.formMenuGroup)))return Wc(t,n,r,a);{let l=[];(c=(f=t==null?void 0:t[0])==null?void 0:f.formMenuGroup)==null||c.forEach((h,d)=>{let p=[];t==null||t.forEach(m=>{var g,y,v,E,w,S;p.push({columnPath:m==null?void 0:m.columnPath,formMenuSelect:(v=((g=m==null?void 0:m.formMenuGroup)==null?void 0:g[d])??((y=m==null?void 0:m.formMenuGroup)==null?void 0:y[0]))==null?void 0:v.formMenuSelect,groupSelect:(S=((E=m==null?void 0:m.formMenuGroup)==null?void 0:E[d])??((w=m==null?void 0:m.formMenuGroup)==null?void 0:w[0]))==null?void 0:S.groupSelect,isRoute:m==null?void 0:m.isRoute,label:m==null?void 0:m.label,prop:m==null?void 0:m.label})}),l.push(p)});let o=[],x=l==null?void 0:l.map(async h=>Wc(h,n,r,a));return x==null||x.forEach(h=>{h==null||h.forEach(d=>{o.push(d)})}),o}},fx=l0(Ae.pinia),{originalPath:uo}=Ae.storeToRefs(fx),cx=Q.useUnit(Ae.pinia),{chooseTitle:Wn}=Ae.storeToRefs(cx),lx=Q.useMenuState(Ae.pinia),{activeMenuPath:ef}=Ae.storeToRefs(lx),Mf=async()=>void 0,ox=e=>{var n,t,i;const a=(t=(n=e==null?void 0:e.compData)==null?void 0:n.find(s=>(s==null?void 0:s.key)==="header"))==null?void 0:t.contents;return{label:e==null?void 0:e.name,value:e==null?void 0:e.name,children:a!=null&&a.every(s=>!Array.isArray(s))?a==null?void 0:a.map(s=>({label:s==null?void 0:s.label,value:s==null?void 0:s.label})):(i=_n(a==null?void 0:a[0]))==null?void 0:i.map(s=>({label:s==null?void 0:s.label,value:s==null?void 0:s.label}))}},ho=async(e,a)=>{var i,s,f,c,l,o,u,x;let r="";(i=Q.cloneDeep(e))==null||i.forEach(h=>{var d;h!=null&&h.includes(":")?(d=h==null?void 0:h.split(":"))==null||d.forEach(p=>{r=r===""?r+p:r+"/"+p}):r=r===""?r+h:r+"/"+h}),(r===""||ef.value===r)&&((f=(s=Wn==null?void 0:Wn.value)==null?void 0:s[0])!=null&&f.value?r=ef.value+"/"+((l=(c=Wn==null?void 0:Wn.value)==null?void 0:c[0])==null?void 0:l.value):r=ef.value);let n="";(o=Q.cloneDeep(e))==null||o.forEach((h,d)=>{d!==(e==null?void 0:e.length)-1?n=n===""?n+h:n+"/"+h:n=h===""?n:n+uo.value+h}),(r==null?void 0:r[(r==null?void 0:r.length)-1])==="/"&&(r=r+((x=(u=Wn==null?void 0:Wn.value)==null?void 0:u[0])==null?void 0:x.value));const t=await wn(r,sessionStorage.getItem("systemKey"),"",!1,[],!1,void 0);return t||await wn(n,sessionStorage.getItem("systemKey"),"",!1,[],!1,void 0)},ux=e=>e.entries().next().done,hx=async e=>{var n,t,i;const a=await ho(e);let r=[];return((n=a==null?void 0:a.data)==null?void 0:n.type)==="success"&&(r=(i=(t=a.data.result)==null?void 0:t.map(s=>s.value.pageData))==null?void 0:i.filter(s=>(s==null?void 0:s.comp)==="Table"),r=r==null?void 0:r.map(s=>ox(s))),r},xx=[{key:"单选",value:"Select"},{key:"日期",value:"Date"},{key:"长文本",value:"TextArea"},{key:"上传",value:"Upload"},{key:"富文本",value:"Quill"}],b0=[{label:"输入框",value:"Input"},{label:"下拉框",value:"Select"},{label:"日期选择器",value:"Date"},{label:"长文本",value:"TextArea"},{label:"附件选择器",value:"Upload"},{label:"富文本",value:"Quill"},{label:"链接跳转",value:"Link"}],dx=[{key:"label",label:"标签名",type:"Input"},{key:"prop",label:"属性名",type:"Input"},{key:"type",label:"类型",type:"Select",options:b0},{key:"originalContent",label:"初始值",type:"Input"},{key:"value",label:"固定值",type:"Input"},{key:"isFormColHidden",label:"是否隐藏",name:"是否隐藏",type:"radio",options:[{label:"否",value:!1},{label:"是",value:!0}],value:!1}],px=async()=>{const e=await Mf();return[{key:"label",label:"标签名",type:"Input"},{key:"prop",label:"属性名",type:"Input"},{key:"type",label:"类型",type:"Select",options:b0},{key:"multiple",label:"多选",default:!1,type:"Switch"},{key:"originalContent",label:"初始值",type:"Select"},{key:"selectRelateType",label:"下拉绑定类型",type:"Select",options:[{label:"关联绑定列",value:"关联绑定列"},{label:"自定义绑定",value:"自定义绑定"}]},{key:"menuSelect",label:"菜单选项",type:"cascader",options:e},{key:"groupSelect",label:"组信息选项",type:"cascader",options:[]},{key:"contents",label:"选项值",type:"Input"}]},mx=async()=>[{value:"",id:"v1",label:"菜单选项",name:"菜单选项",type:"cascader",contents:await Mf()},{value:"",id:"v2",label:"组信息选项",name:"组信息选项",type:"cascader",contents:[]},{value:"",id:"v2",label:"选项值",name:"选项值",type:"Input",contents:[]}],gx=zr.computed(async()=>await px()),vx=[{key:"label",label:"标签名",type:"Input"},{key:"prop",label:"属性名",type:"Input"},{key:"type",label:"类型",type:"Select",options:b0},{key:"originalContent",label:"初始值",type:"Date"},{key:"isNewDate",label:"当前时间",type:"Switch",value:!1}],_x=[{key:"label",label:"标签名",type:"Input"},{key:"prop",label:"属性名",type:"Input"},{key:"type",label:"类型",type:"Select",options:b0},{key:"value",label:"固定值",type:"Input"}],yx=[{key:"label",label:"标签名",type:"Input"},{key:"prop",label:"属性名",type:"Input"},{key:"type",label:"类型",type:"Select",options:b0},{key:"originalContent",label:"初始值",type:"Input"}],Hc=[{key:"label",label:"标签名",type:"Input"},{key:"prop",label:"属性名",type:"Input"},{key:"type",label:"类型",type:"Select",options:b0}],kx=[{key:"label",label:"标签名",type:"Input"},{key:"prop",label:"属性名",type:"Input"},{key:"type",label:"类型",type:"Select",options:b0}],Ex=[{key:"Input",value:dx},{key:"Select",value:gx},{key:"Date",value:vx},{key:"TextArea",value:yx},{key:"Upload",value:Hc},{key:"DragUpload",value:Hc},{key:"Quill",value:kx},{key:"Link",value:_x}],Tx=[{value:"normal",label:"自定义"},{value:"add",label:"新增"},{value:"fix",label:"修改"},{value:"view",label:"查看"},{value:"delete",label:"删除"}],wx=[{key:"label",label:"按钮名",type:"Input"},{key:"type",label:"类型",type:"Select",options:Tx},{key:"background",label:"颜色",type:"Color"}],Sx=e=>{var r,n,t,i,s,f,c,l;let a=Q.cloneDeep(e);if(((r=a==null?void 0:a.find(o=>(o==null?void 0:o.name)==="类型"))==null?void 0:r.type)==="Select"&&((i=(t=(n=Q.cloneDeep(a))==null?void 0:n.find(o=>(o==null?void 0:o.name)==="选项值"))==null?void 0:t.value)==null?void 0:i.length)>0){const o=(l=(c=(f=(s=Q.cloneDeep(a))==null?void 0:s.find(u=>(u==null?void 0:u.name)==="选项值"))==null?void 0:f.value)==null?void 0:c.split(","))==null?void 0:l.map(u=>({label:u,value:u}));a=a==null?void 0:a.map(u=>((u==null?void 0:u.name)==="初始值"&&(u.contents=o,u.value=(u==null?void 0:u.value)??""),u))}return a},Ax=async e=>{var i,s,f,c;let a=Q.cloneDeep(e);const r=(i=e==null?void 0:e.find(l=>(l==null?void 0:l.name)==="下拉绑定类型"))==null?void 0:i.value,n=(s=e==null?void 0:e.find(l=>(l==null?void 0:l.name)==="类型"))==null?void 0:s.value,t=await mx();return n==="Select"&&r===""?a=a==null?void 0:a.filter(l=>(l==null?void 0:l.name)!=="菜单选项"&&(l==null?void 0:l.name)!=="组信息选项"&&(l==null?void 0:l.name)!=="选项值"):n==="Select"&&r==="关联绑定列"?a!=null&&a.find(l=>(l==null?void 0:l.name)==="菜单选项"||(l==null?void 0:l.name)==="组信息选项")?a=(f=Q.cloneDeep(a))==null?void 0:f.filter(l=>(l==null?void 0:l.name)!=="选项值"):a=[...Q.cloneDeep(a),...t].filter(l=>(l==null?void 0:l.name)!=="选项值"):n==="Select"&&r==="自定义绑定"&&(a!=null&&a.find(l=>(l==null?void 0:l.name)==="选项值")?a=(c=Q.cloneDeep(a))==null?void 0:c.filter(l=>(l==null?void 0:l.name)!=="菜单选项"&&(l==null?void 0:l.name)!=="组信息选项"):a=[...Q.cloneDeep(a),...t].filter(l=>(l==null?void 0:l.name)!=="菜单选项"&&(l==null?void 0:l.name)!=="组信息选项")),a},Fx=(e,a)=>{var n;let r=!1;return(n=Q.cloneDeep(e))==null||n.forEach(t=>{var i;(t==null?void 0:t.key)==="formContent"&&((i=t==null?void 0:t.contents)==null||i.forEach(s=>{(s==null?void 0:s.key)===a?r=!0:r=r}))}),r},xo=(e,a)=>{var s,f,c,l,o;const r=Q.cloneDeep(e);if(!r)return;let n="";(f=(s=Q.cloneDeep(r))==null?void 0:s.menuSelect)==null||f.forEach(u=>{u!=null&&u.includes("[")?n=n+uo.value:n=n===""?n+u:n+"/"+u});const t=(c=a==null?void 0:a[n])==null?void 0:c.map(u=>{var x;return(x=u==null?void 0:u.value)==null?void 0:x.pageData});let i=t==null?void 0:t.filter(u=>{var x,h;return(u==null?void 0:u.name)===((h=(x=Q.cloneDeep(r))==null?void 0:x.groupSelect)==null?void 0:h[0])});if((i==null?void 0:i.length)===1?i=i==null?void 0:i[0]:(l=Q.cloneDeep(i))==null||l.forEach(u=>{var x,h;(u==null?void 0:u.comp)==="Form"&&Fx(u==null?void 0:u.compData,(h=(x=Q.cloneDeep(r))==null?void 0:x.groupSelect)==null?void 0:h[1])&&(i=u)}),(i==null?void 0:i.comp)==="Form"){let u="";return(o=i==null?void 0:i.compData)==null||o.forEach(x=>{var h;(x==null?void 0:x.key)==="formContent"&&((h=x==null?void 0:x.contents)==null||h.forEach(d=>{var p,m;(d==null?void 0:d.key)===((m=(p=Q.cloneDeep(r))==null?void 0:p.groupSelect)==null?void 0:m[1])&&(d.type==="Select"&&!(d!=null&&d.value)?u=void 0:u=d==null?void 0:d.value)}))}),u}};/*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */var Fs={};Fs.version="0.18.5";var po=1252,Dx=[874,932,936,949,950,1250,1251,1252,1253,1254,1255,1256,1257,1258,1e4],Lf={0:1252,1:65001,2:65001,77:1e4,128:932,129:949,130:1361,134:936,136:950,161:1253,162:1254,163:1258,177:1255,178:1256,186:1257,204:1251,222:874,238:1250,255:1252,69:6969},Bf=function(e){Dx.indexOf(e)!=-1&&(po=Lf[0]=e)};function Ix(){Bf(1252)}var yn=function(e){Bf(e)};function Uf(){yn(1200),Ix()}function Gc(e){for(var a=[],r=0,n=e.length;r<n;++r)a[r]=e.charCodeAt(r);return a}function bx(e){for(var a=[],r=0;r<e.length>>1;++r)a[r]=String.fromCharCode(e.charCodeAt(2*r)+(e.charCodeAt(2*r+1)<<8));return a.join("")}function mo(e){for(var a=[],r=0;r<e.length>>1;++r)a[r]=String.fromCharCode(e.charCodeAt(2*r+1)+(e.charCodeAt(2*r)<<8));return a.join("")}var Ii=function(e){var a=e.charCodeAt(0),r=e.charCodeAt(1);return a==255&&r==254?bx(e.slice(2)):a==254&&r==255?mo(e.slice(2)):a==65279?e.slice(1):e},hs=function(a){return String.fromCharCode(a)},Xc=function(a){return String.fromCharCode(a)},Ef,t0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function Hi(e){for(var a="",r=0,n=0,t=0,i=0,s=0,f=0,c=0,l=0;l<e.length;)r=e.charCodeAt(l++),i=r>>2,n=e.charCodeAt(l++),s=(r&3)<<4|n>>4,t=e.charCodeAt(l++),f=(n&15)<<2|t>>6,c=t&63,isNaN(n)?f=c=64:isNaN(t)&&(c=64),a+=t0.charAt(i)+t0.charAt(s)+t0.charAt(f)+t0.charAt(c);return a}function Kt(e){var a="",r=0,n=0,t=0,i=0,s=0,f=0,c=0;e=e.replace(/[^\w\+\/\=]/g,"");for(var l=0;l<e.length;)i=t0.indexOf(e.charAt(l++)),s=t0.indexOf(e.charAt(l++)),r=i<<2|s>>4,a+=String.fromCharCode(r),f=t0.indexOf(e.charAt(l++)),n=(s&15)<<4|f>>2,f!==64&&(a+=String.fromCharCode(n)),c=t0.indexOf(e.charAt(l++)),t=(f&3)<<6|c,c!==64&&(a+=String.fromCharCode(t));return a}var kr=function(){return typeof Buffer<"u"&&typeof process<"u"&&typeof process.versions<"u"&&!!process.versions.node}(),zn=function(){if(typeof Buffer<"u"){var e=!Buffer.from;if(!e)try{Buffer.from("foo","utf8")}catch{e=!0}return e?function(a,r){return r?new Buffer(a,r):new Buffer(a)}:Buffer.from.bind(Buffer)}return function(){}}();function i0(e){return kr?Buffer.alloc?Buffer.alloc(e):new Buffer(e):typeof Uint8Array<"u"?new Uint8Array(e):new Array(e)}function $c(e){return kr?Buffer.allocUnsafe?Buffer.allocUnsafe(e):new Buffer(e):typeof Uint8Array<"u"?new Uint8Array(e):new Array(e)}var Gt=function(a){return kr?zn(a,"binary"):a.split("").map(function(r){return r.charCodeAt(0)&255})};function Hs(e){if(typeof ArrayBuffer>"u")return Gt(e);for(var a=new ArrayBuffer(e.length),r=new Uint8Array(a),n=0;n!=e.length;++n)r[n]=e.charCodeAt(n)&255;return a}function o0(e){if(Array.isArray(e))return e.map(function(n){return String.fromCharCode(n)}).join("");for(var a=[],r=0;r<e.length;++r)a[r]=String.fromCharCode(e[r]);return a.join("")}function Cx(e){if(typeof Uint8Array>"u")throw new Error("Unsupported");return new Uint8Array(e)}function Wf(e){if(typeof ArrayBuffer>"u")throw new Error("Unsupported");if(e instanceof ArrayBuffer)return Wf(new Uint8Array(e));for(var a=new Array(e.length),r=0;r<e.length;++r)a[r]=e[r];return a}var Ja=kr?function(e){return Buffer.concat(e.map(function(a){return Buffer.isBuffer(a)?a:zn(a)}))}:function(e){if(typeof Uint8Array<"u"){var a=0,r=0;for(a=0;a<e.length;++a)r+=e[a].length;var n=new Uint8Array(r),t=0;for(a=0,r=0;a<e.length;r+=t,++a)if(t=e[a].length,e[a]instanceof Uint8Array)n.set(e[a],r);else{if(typeof e[a]=="string")throw"wtf";n.set(new Uint8Array(e[a]),r)}return n}return[].concat.apply([],e.map(function(i){return Array.isArray(i)?i:[].slice.call(i)}))};function Ox(e){for(var a=[],r=0,n=e.length+250,t=i0(e.length+255),i=0;i<e.length;++i){var s=e.charCodeAt(i);if(s<128)t[r++]=s;else if(s<2048)t[r++]=192|s>>6&31,t[r++]=128|s&63;else if(s>=55296&&s<57344){s=(s&1023)+64;var f=e.charCodeAt(++i)&1023;t[r++]=240|s>>8&7,t[r++]=128|s>>2&63,t[r++]=128|f>>6&15|(s&3)<<4,t[r++]=128|f&63}else t[r++]=224|s>>12&15,t[r++]=128|s>>6&63,t[r++]=128|s&63;r>n&&(a.push(t.slice(0,r)),r=0,t=i0(65535),n=65530)}return a.push(t.slice(0,r)),Ja(a)}var Tt=/\u0000/g,bi=/[\u0001-\u0006]/g;function J0(e){for(var a="",r=e.length-1;r>=0;)a+=e.charAt(r--);return a}function kn(e,a){var r=""+e;return r.length>=a?r:Aa("0",a-r.length)+r}function Hf(e,a){var r=""+e;return r.length>=a?r:Aa(" ",a-r.length)+r}function Ds(e,a){var r=""+e;return r.length>=a?r:r+Aa(" ",a-r.length)}function Rx(e,a){var r=""+Math.round(e);return r.length>=a?r:Aa("0",a-r.length)+r}function Nx(e,a){var r=""+e;return r.length>=a?r:Aa("0",a-r.length)+r}var Kc=Math.pow(2,32);function G0(e,a){if(e>Kc||e<-Kc)return Rx(e,a);var r=Math.round(e);return Nx(r,a)}function Is(e,a){return a=a||0,e.length>=7+a&&(e.charCodeAt(a)|32)===103&&(e.charCodeAt(a+1)|32)===101&&(e.charCodeAt(a+2)|32)===110&&(e.charCodeAt(a+3)|32)===101&&(e.charCodeAt(a+4)|32)===114&&(e.charCodeAt(a+5)|32)===97&&(e.charCodeAt(a+6)|32)===108}var zc=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],rf=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]];function Px(e){return e||(e={}),e[0]="General",e[1]="0",e[2]="0.00",e[3]="#,##0",e[4]="#,##0.00",e[9]="0%",e[10]="0.00%",e[11]="0.00E+00",e[12]="# ?/?",e[13]="# ??/??",e[14]="m/d/yy",e[15]="d-mmm-yy",e[16]="d-mmm",e[17]="mmm-yy",e[18]="h:mm AM/PM",e[19]="h:mm:ss AM/PM",e[20]="h:mm",e[21]="h:mm:ss",e[22]="m/d/yy h:mm",e[37]="#,##0 ;(#,##0)",e[38]="#,##0 ;[Red](#,##0)",e[39]="#,##0.00;(#,##0.00)",e[40]="#,##0.00;[Red](#,##0.00)",e[45]="mm:ss",e[46]="[h]:mm:ss",e[47]="mmss.0",e[48]="##0.0E+0",e[49]="@",e[56]='"上午/下午 "hh"時"mm"分"ss"秒 "',e}var tr={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"m/d/yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@",56:'"上午/下午 "hh"時"mm"分"ss"秒 "'},Vc={5:37,6:38,7:39,8:40,23:0,24:0,25:0,26:0,27:14,28:14,29:14,30:14,31:14,50:14,51:14,52:14,53:14,54:14,55:14,56:14,57:14,58:14,59:1,60:2,61:3,62:4,67:9,68:10,69:12,70:13,71:14,72:14,73:15,74:16,75:17,76:20,77:21,78:22,79:45,80:46,81:47,82:0},Mx={5:'"$"#,##0_);\\("$"#,##0\\)',63:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',41:'_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)'};function bs(e,a,r){for(var n=e<0?-1:1,t=e*n,i=0,s=1,f=0,c=1,l=0,o=0,u=Math.floor(t);l<a&&(u=Math.floor(t),f=u*s+i,o=u*l+c,!(t-u<5e-8));)t=1/(t-u),i=s,s=f,c=l,l=o;if(o>a&&(l>a?(o=c,f=i):(o=l,f=s)),!r)return[0,n*f,o];var x=Math.floor(n*f/o);return[x,n*f-x*o,o]}function _0(e,a,r){if(e>2958465||e<0)return null;var n=e|0,t=Math.floor(86400*(e-n)),i=0,s=[],f={D:n,T:t,u:86400*(e-n)-t,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(Math.abs(f.u)<1e-6&&(f.u=0),a&&a.date1904&&(n+=1462),f.u>.9999&&(f.u=0,++t==86400&&(f.T=t=0,++n,++f.D)),n===60)s=r?[1317,10,29]:[1900,2,29],i=3;else if(n===0)s=r?[1317,8,29]:[1900,1,0],i=6;else{n>60&&--n;var c=new Date(1900,0,1);c.setDate(c.getDate()+n-1),s=[c.getFullYear(),c.getMonth()+1,c.getDate()],i=c.getDay(),n<60&&(i=(i+6)%7),r&&(i=Gx(c,s))}return f.y=s[0],f.m=s[1],f.d=s[2],f.S=t%60,t=Math.floor(t/60),f.M=t%60,t=Math.floor(t/60),f.H=t,f.q=i,f}var go=new Date(1899,11,31,0,0,0),Lx=go.getTime(),Bx=new Date(1900,2,1,0,0,0);function vo(e,a){var r=e.getTime();return a?r-=1461*24*60*60*1e3:e>=Bx&&(r+=24*60*60*1e3),(r-(Lx+(e.getTimezoneOffset()-go.getTimezoneOffset())*6e4))/(24*60*60*1e3)}function Gf(e){return e.indexOf(".")==-1?e:e.replace(/(?:\.0*|(\.\d*[1-9])0+)$/,"$1")}function Ux(e){return e.indexOf("E")==-1?e:e.replace(/(?:\.0*|(\.\d*[1-9])0+)[Ee]/,"$1E").replace(/(E[+-])(\d)$/,"$10$2")}function Wx(e){var a=e<0?12:11,r=Gf(e.toFixed(12));return r.length<=a||(r=e.toPrecision(10),r.length<=a)?r:e.toExponential(5)}function Hx(e){var a=Gf(e.toFixed(11));return a.length>(e<0?12:11)||a==="0"||a==="-0"?e.toPrecision(6):a}function Gi(e){var a=Math.floor(Math.log(Math.abs(e))*Math.LOG10E),r;return a>=-4&&a<=-1?r=e.toPrecision(10+a):Math.abs(a)<=9?r=Wx(e):a===10?r=e.toFixed(10).substr(0,12):r=Hx(e),Gf(Ux(r.toUpperCase()))}function w0(e,a){switch(typeof e){case"string":return e;case"boolean":return e?"TRUE":"FALSE";case"number":return(e|0)===e?e.toString(10):Gi(e);case"undefined":return"";case"object":if(e==null)return"";if(e instanceof Date)return tn(14,vo(e,a&&a.date1904),a)}throw new Error("unsupported value in General format: "+e)}function Gx(e,a){a[0]-=581;var r=e.getDay();return e<60&&(r=(r+6)%7),r}function Xx(e,a,r,n){var t="",i=0,s=0,f=r.y,c,l=0;switch(e){case 98:f=r.y+543;case 121:switch(a.length){case 1:case 2:c=f%100,l=2;break;default:c=f%1e4,l=4;break}break;case 109:switch(a.length){case 1:case 2:c=r.m,l=a.length;break;case 3:return rf[r.m-1][1];case 5:return rf[r.m-1][0];default:return rf[r.m-1][2]}break;case 100:switch(a.length){case 1:case 2:c=r.d,l=a.length;break;case 3:return zc[r.q][0];default:return zc[r.q][1]}break;case 104:switch(a.length){case 1:case 2:c=1+(r.H+11)%12,l=a.length;break;default:throw"bad hour format: "+a}break;case 72:switch(a.length){case 1:case 2:c=r.H,l=a.length;break;default:throw"bad hour format: "+a}break;case 77:switch(a.length){case 1:case 2:c=r.M,l=a.length;break;default:throw"bad minute format: "+a}break;case 115:if(a!="s"&&a!="ss"&&a!=".0"&&a!=".00"&&a!=".000")throw"bad second format: "+a;return r.u===0&&(a=="s"||a=="ss")?kn(r.S,a.length):(n>=2?s=n===3?1e3:100:s=n===1?10:1,i=Math.round(s*(r.S+r.u)),i>=60*s&&(i=0),a==="s"?i===0?"0":""+i/s:(t=kn(i,2+n),a==="ss"?t.substr(0,2):"."+t.substr(2,a.length-1)));case 90:switch(a){case"[h]":case"[hh]":c=r.D*24+r.H;break;case"[m]":case"[mm]":c=(r.D*24+r.H)*60+r.M;break;case"[s]":case"[ss]":c=((r.D*24+r.H)*60+r.M)*60+Math.round(r.S+r.u);break;default:throw"bad abstime format: "+a}l=a.length===3?1:2;break;case 101:c=f,l=1;break}var o=l>0?kn(c,l):"";return o}function n0(e){var a=3;if(e.length<=a)return e;for(var r=e.length%a,n=e.substr(0,r);r!=e.length;r+=a)n+=(n.length>0?",":"")+e.substr(r,a);return n}var _o=/%/g;function $x(e,a,r){var n=a.replace(_o,""),t=a.length-n.length;return Gn(e,n,r*Math.pow(10,2*t))+Aa("%",t)}function Kx(e,a,r){for(var n=a.length-1;a.charCodeAt(n-1)===44;)--n;return Gn(e,a.substr(0,n),r/Math.pow(10,3*(a.length-n)))}function yo(e,a){var r,n=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\+0$/)){if(a==0)return"0.0E+0";if(a<0)return"-"+yo(e,-a);var t=e.indexOf(".");t===-1&&(t=e.indexOf("E"));var i=Math.floor(Math.log(a)*Math.LOG10E)%t;if(i<0&&(i+=t),r=(a/Math.pow(10,i)).toPrecision(n+1+(t+i)%t),r.indexOf("e")===-1){var s=Math.floor(Math.log(a)*Math.LOG10E);for(r.indexOf(".")===-1?r=r.charAt(0)+"."+r.substr(1)+"E+"+(s-r.length+i):r+="E+"+(s-i);r.substr(0,2)==="0.";)r=r.charAt(0)+r.substr(2,t)+"."+r.substr(2+t),r=r.replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(f,c,l,o){return c+l+o.substr(0,(t+i)%t)+"."+o.substr(i)+"E"})}else r=a.toExponential(n);return e.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),e.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}var ko=/# (\?+)( ?)\/( ?)(\d+)/;function zx(e,a,r){var n=parseInt(e[4],10),t=Math.round(a*n),i=Math.floor(t/n),s=t-i*n,f=n;return r+(i===0?"":""+i)+" "+(s===0?Aa(" ",e[1].length+1+e[4].length):Hf(s,e[1].length)+e[2]+"/"+e[3]+kn(f,e[4].length))}function Vx(e,a,r){return r+(a===0?"":""+a)+Aa(" ",e[1].length+2+e[4].length)}var Eo=/^#*0*\.([0#]+)/,To=/\).*[0#]/,wo=/\(###\) ###\\?-####/;function kt(e){for(var a="",r,n=0;n!=e.length;++n)switch(r=e.charCodeAt(n)){case 35:break;case 63:a+=" ";break;case 48:a+="0";break;default:a+=String.fromCharCode(r)}return a}function jc(e,a){var r=Math.pow(10,a);return""+Math.round(e*r)/r}function Yc(e,a){var r=e-Math.floor(e),n=Math.pow(10,a);return a<(""+Math.round(r*n)).length?0:Math.round(r*n)}function jx(e,a){return a<(""+Math.round((e-Math.floor(e))*Math.pow(10,a))).length?1:0}function Yx(e){return e<2147483647&&e>-2147483648?""+(e>=0?e|0:e-1|0):""+Math.floor(e)}function Jt(e,a,r){if(e.charCodeAt(0)===40&&!a.match(To)){var n=a.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return r>=0?Jt("n",n,r):"("+Jt("n",n,-r)+")"}if(a.charCodeAt(a.length-1)===44)return Kx(e,a,r);if(a.indexOf("%")!==-1)return $x(e,a,r);if(a.indexOf("E")!==-1)return yo(a,r);if(a.charCodeAt(0)===36)return"$"+Jt(e,a.substr(a.charAt(1)==" "?2:1),r);var t,i,s,f,c=Math.abs(r),l=r<0?"-":"";if(a.match(/^00+$/))return l+G0(c,a.length);if(a.match(/^[#?]+$/))return t=G0(r,0),t==="0"&&(t=""),t.length>a.length?t:kt(a.substr(0,a.length-t.length))+t;if(i=a.match(ko))return zx(i,c,l);if(a.match(/^#+0+$/))return l+G0(c,a.length-a.indexOf("0"));if(i=a.match(Eo))return t=jc(r,i[1].length).replace(/^([^\.]+)$/,"$1."+kt(i[1])).replace(/\.$/,"."+kt(i[1])).replace(/\.(\d*)$/,function(d,p){return"."+p+Aa("0",kt(i[1]).length-p.length)}),a.indexOf("0.")!==-1?t:t.replace(/^0\./,".");if(a=a.replace(/^#+([0.])/,"$1"),i=a.match(/^(0*)\.(#*)$/))return l+jc(c,i[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,i[1].length?"0.":".");if(i=a.match(/^#{1,3},##0(\.?)$/))return l+n0(G0(c,0));if(i=a.match(/^#,##0\.([#0]*0)$/))return r<0?"-"+Jt(e,a,-r):n0(""+(Math.floor(r)+jx(r,i[1].length)))+"."+kn(Yc(r,i[1].length),i[1].length);if(i=a.match(/^#,#*,#0/))return Jt(e,a.replace(/^#,#*,/,""),r);if(i=a.match(/^([0#]+)(\\?-([0#]+))+$/))return t=J0(Jt(e,a.replace(/[\\-]/g,""),r)),s=0,J0(J0(a.replace(/\\/g,"")).replace(/[0#]/g,function(d){return s<t.length?t.charAt(s++):d==="0"?"0":""}));if(a.match(wo))return t=Jt(e,"##########",r),"("+t.substr(0,3)+") "+t.substr(3,3)+"-"+t.substr(6);var o="";if(i=a.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return s=Math.min(i[4].length,7),f=bs(c,Math.pow(10,s)-1,!1),t=""+l,o=Gn("n",i[1],f[1]),o.charAt(o.length-1)==" "&&(o=o.substr(0,o.length-1)+"0"),t+=o+i[2]+"/"+i[3],o=Ds(f[2],s),o.length<i[4].length&&(o=kt(i[4].substr(i[4].length-o.length))+o),t+=o,t;if(i=a.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return s=Math.min(Math.max(i[1].length,i[4].length),7),f=bs(c,Math.pow(10,s)-1,!0),l+(f[0]||(f[1]?"":"0"))+" "+(f[1]?Hf(f[1],s)+i[2]+"/"+i[3]+Ds(f[2],s):Aa(" ",2*s+1+i[2].length+i[3].length));if(i=a.match(/^[#0?]+$/))return t=G0(r,0),a.length<=t.length?t:kt(a.substr(0,a.length-t.length))+t;if(i=a.match(/^([#0?]+)\.([#0]+)$/)){t=""+r.toFixed(Math.min(i[2].length,10)).replace(/([^0])0+$/,"$1"),s=t.indexOf(".");var u=a.indexOf(".")-s,x=a.length-t.length-u;return kt(a.substr(0,u)+t+a.substr(a.length-x))}if(i=a.match(/^00,000\.([#0]*0)$/))return s=Yc(r,i[1].length),r<0?"-"+Jt(e,a,-r):n0(Yx(r)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(d){return"00,"+(d.length<3?kn(0,3-d.length):"")+d})+"."+kn(s,i[1].length);switch(a){case"###,##0.00":return Jt(e,"#,##0.00",r);case"###,###":case"##,###":case"#,###":var h=n0(G0(c,0));return h!=="0"?l+h:"";case"###,###.00":return Jt(e,"###,##0.00",r).replace(/^0\./,".");case"#,###.00":return Jt(e,"#,##0.00",r).replace(/^0\./,".")}throw new Error("unsupported format |"+a+"|")}function Jx(e,a,r){for(var n=a.length-1;a.charCodeAt(n-1)===44;)--n;return Gn(e,a.substr(0,n),r/Math.pow(10,3*(a.length-n)))}function qx(e,a,r){var n=a.replace(_o,""),t=a.length-n.length;return Gn(e,n,r*Math.pow(10,2*t))+Aa("%",t)}function So(e,a){var r,n=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\+0$/)){if(a==0)return"0.0E+0";if(a<0)return"-"+So(e,-a);var t=e.indexOf(".");t===-1&&(t=e.indexOf("E"));var i=Math.floor(Math.log(a)*Math.LOG10E)%t;if(i<0&&(i+=t),r=(a/Math.pow(10,i)).toPrecision(n+1+(t+i)%t),!r.match(/[Ee]/)){var s=Math.floor(Math.log(a)*Math.LOG10E);r.indexOf(".")===-1?r=r.charAt(0)+"."+r.substr(1)+"E+"+(s-r.length+i):r+="E+"+(s-i),r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(f,c,l,o){return c+l+o.substr(0,(t+i)%t)+"."+o.substr(i)+"E"})}else r=a.toExponential(n);return e.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),e.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}function bn(e,a,r){if(e.charCodeAt(0)===40&&!a.match(To)){var n=a.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return r>=0?bn("n",n,r):"("+bn("n",n,-r)+")"}if(a.charCodeAt(a.length-1)===44)return Jx(e,a,r);if(a.indexOf("%")!==-1)return qx(e,a,r);if(a.indexOf("E")!==-1)return So(a,r);if(a.charCodeAt(0)===36)return"$"+bn(e,a.substr(a.charAt(1)==" "?2:1),r);var t,i,s,f,c=Math.abs(r),l=r<0?"-":"";if(a.match(/^00+$/))return l+kn(c,a.length);if(a.match(/^[#?]+$/))return t=""+r,r===0&&(t=""),t.length>a.length?t:kt(a.substr(0,a.length-t.length))+t;if(i=a.match(ko))return Vx(i,c,l);if(a.match(/^#+0+$/))return l+kn(c,a.length-a.indexOf("0"));if(i=a.match(Eo))return t=(""+r).replace(/^([^\.]+)$/,"$1."+kt(i[1])).replace(/\.$/,"."+kt(i[1])),t=t.replace(/\.(\d*)$/,function(d,p){return"."+p+Aa("0",kt(i[1]).length-p.length)}),a.indexOf("0.")!==-1?t:t.replace(/^0\./,".");if(a=a.replace(/^#+([0.])/,"$1"),i=a.match(/^(0*)\.(#*)$/))return l+(""+c).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,i[1].length?"0.":".");if(i=a.match(/^#{1,3},##0(\.?)$/))return l+n0(""+c);if(i=a.match(/^#,##0\.([#0]*0)$/))return r<0?"-"+bn(e,a,-r):n0(""+r)+"."+Aa("0",i[1].length);if(i=a.match(/^#,#*,#0/))return bn(e,a.replace(/^#,#*,/,""),r);if(i=a.match(/^([0#]+)(\\?-([0#]+))+$/))return t=J0(bn(e,a.replace(/[\\-]/g,""),r)),s=0,J0(J0(a.replace(/\\/g,"")).replace(/[0#]/g,function(d){return s<t.length?t.charAt(s++):d==="0"?"0":""}));if(a.match(wo))return t=bn(e,"##########",r),"("+t.substr(0,3)+") "+t.substr(3,3)+"-"+t.substr(6);var o="";if(i=a.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return s=Math.min(i[4].length,7),f=bs(c,Math.pow(10,s)-1,!1),t=""+l,o=Gn("n",i[1],f[1]),o.charAt(o.length-1)==" "&&(o=o.substr(0,o.length-1)+"0"),t+=o+i[2]+"/"+i[3],o=Ds(f[2],s),o.length<i[4].length&&(o=kt(i[4].substr(i[4].length-o.length))+o),t+=o,t;if(i=a.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return s=Math.min(Math.max(i[1].length,i[4].length),7),f=bs(c,Math.pow(10,s)-1,!0),l+(f[0]||(f[1]?"":"0"))+" "+(f[1]?Hf(f[1],s)+i[2]+"/"+i[3]+Ds(f[2],s):Aa(" ",2*s+1+i[2].length+i[3].length));if(i=a.match(/^[#0?]+$/))return t=""+r,a.length<=t.length?t:kt(a.substr(0,a.length-t.length))+t;if(i=a.match(/^([#0]+)\.([#0]+)$/)){t=""+r.toFixed(Math.min(i[2].length,10)).replace(/([^0])0+$/,"$1"),s=t.indexOf(".");var u=a.indexOf(".")-s,x=a.length-t.length-u;return kt(a.substr(0,u)+t+a.substr(a.length-x))}if(i=a.match(/^00,000\.([#0]*0)$/))return r<0?"-"+bn(e,a,-r):n0(""+r).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(d){return"00,"+(d.length<3?kn(0,3-d.length):"")+d})+"."+kn(0,i[1].length);switch(a){case"###,###":case"##,###":case"#,###":var h=n0(""+c);return h!=="0"?l+h:"";default:if(a.match(/\.[0#?]*$/))return bn(e,a.slice(0,a.lastIndexOf(".")),r)+kt(a.slice(a.lastIndexOf(".")))}throw new Error("unsupported format |"+a+"|")}function Gn(e,a,r){return(r|0)===r?bn(e,a,r):Jt(e,a,r)}function Zx(e){for(var a=[],r=!1,n=0,t=0;n<e.length;++n)switch(e.charCodeAt(n)){case 34:r=!r;break;case 95:case 42:case 92:++n;break;case 59:a[a.length]=e.substr(t,n-t),t=n+1}if(a[a.length]=e.substr(t),r===!0)throw new Error("Format |"+e+"| unterminated string ");return a}var Ao=/\[[HhMmSs\u0E0A\u0E19\u0E17]*\]/;function ti(e){for(var a=0,r="",n="";a<e.length;)switch(r=e.charAt(a)){case"G":Is(e,a)&&(a+=6),a++;break;case'"':for(;e.charCodeAt(++a)!==34&&a<e.length;);++a;break;case"\\":a+=2;break;case"_":a+=2;break;case"@":++a;break;case"B":case"b":if(e.charAt(a+1)==="1"||e.charAt(a+1)==="2")return!0;case"M":case"D":case"Y":case"H":case"S":case"E":case"m":case"d":case"y":case"h":case"s":case"e":case"g":return!0;case"A":case"a":case"上":if(e.substr(a,3).toUpperCase()==="A/P"||e.substr(a,5).toUpperCase()==="AM/PM"||e.substr(a,5).toUpperCase()==="上午/下午")return!0;++a;break;case"[":for(n=r;e.charAt(a++)!=="]"&&a<e.length;)n+=e.charAt(a);if(n.match(Ao))return!0;break;case".":case"0":case"#":for(;a<e.length&&("0#?.,E+-%".indexOf(r=e.charAt(++a))>-1||r=="\\"&&e.charAt(a+1)=="-"&&"0#".indexOf(e.charAt(a+2))>-1););break;case"?":for(;e.charAt(++a)===r;);break;case"*":++a,(e.charAt(a)==" "||e.charAt(a)=="*")&&++a;break;case"(":case")":++a;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;a<e.length&&"0123456789".indexOf(e.charAt(++a))>-1;);break;case" ":++a;break;default:++a;break}return!1}function Qx(e,a,r,n){for(var t=[],i="",s=0,f="",c="t",l,o,u,x="H";s<e.length;)switch(f=e.charAt(s)){case"G":if(!Is(e,s))throw new Error("unrecognized character "+f+" in "+e);t[t.length]={t:"G",v:"General"},s+=7;break;case'"':for(i="";(u=e.charCodeAt(++s))!==34&&s<e.length;)i+=String.fromCharCode(u);t[t.length]={t:"t",v:i},++s;break;case"\\":var h=e.charAt(++s),d=h==="("||h===")"?h:"t";t[t.length]={t:d,v:h},++s;break;case"_":t[t.length]={t:"t",v:" "},s+=2;break;case"@":t[t.length]={t:"T",v:a},++s;break;case"B":case"b":if(e.charAt(s+1)==="1"||e.charAt(s+1)==="2"){if(l==null&&(l=_0(a,r,e.charAt(s+1)==="2"),l==null))return"";t[t.length]={t:"X",v:e.substr(s,2)},c=f,s+=2;break}case"M":case"D":case"Y":case"H":case"S":case"E":f=f.toLowerCase();case"m":case"d":case"y":case"h":case"s":case"e":case"g":if(a<0||l==null&&(l=_0(a,r),l==null))return"";for(i=f;++s<e.length&&e.charAt(s).toLowerCase()===f;)i+=f;f==="m"&&c.toLowerCase()==="h"&&(f="M"),f==="h"&&(f=x),t[t.length]={t:f,v:i},c=f;break;case"A":case"a":case"上":var p={t:f,v:f};if(l==null&&(l=_0(a,r)),e.substr(s,3).toUpperCase()==="A/P"?(l!=null&&(p.v=l.H>=12?"P":"A"),p.t="T",x="h",s+=3):e.substr(s,5).toUpperCase()==="AM/PM"?(l!=null&&(p.v=l.H>=12?"PM":"AM"),p.t="T",s+=5,x="h"):e.substr(s,5).toUpperCase()==="上午/下午"?(l!=null&&(p.v=l.H>=12?"下午":"上午"),p.t="T",s+=5,x="h"):(p.t="t",++s),l==null&&p.t==="T")return"";t[t.length]=p,c=f;break;case"[":for(i=f;e.charAt(s++)!=="]"&&s<e.length;)i+=e.charAt(s);if(i.slice(-1)!=="]")throw'unterminated "[" block: |'+i+"|";if(i.match(Ao)){if(l==null&&(l=_0(a,r),l==null))return"";t[t.length]={t:"Z",v:i.toLowerCase()},c=i.charAt(1)}else i.indexOf("$")>-1&&(i=(i.match(/\$([^-\[\]]*)/)||[])[1]||"$",ti(e)||(t[t.length]={t:"t",v:i}));break;case".":if(l!=null){for(i=f;++s<e.length&&(f=e.charAt(s))==="0";)i+=f;t[t.length]={t:"s",v:i};break}case"0":case"#":for(i=f;++s<e.length&&"0#?.,E+-%".indexOf(f=e.charAt(s))>-1;)i+=f;t[t.length]={t:"n",v:i};break;case"?":for(i=f;e.charAt(++s)===f;)i+=f;t[t.length]={t:f,v:i},c=f;break;case"*":++s,(e.charAt(s)==" "||e.charAt(s)=="*")&&++s;break;case"(":case")":t[t.length]={t:n===1?"t":f,v:f},++s;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(i=f;s<e.length&&"0123456789".indexOf(e.charAt(++s))>-1;)i+=e.charAt(s);t[t.length]={t:"D",v:i};break;case" ":t[t.length]={t:f,v:f},++s;break;case"$":t[t.length]={t:"t",v:"$"},++s;break;default:if(",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(f)===-1)throw new Error("unrecognized character "+f+" in "+e);t[t.length]={t:"t",v:f},++s;break}var m=0,g=0,y;for(s=t.length-1,c="t";s>=0;--s)switch(t[s].t){case"h":case"H":t[s].t=x,c="h",m<1&&(m=1);break;case"s":(y=t[s].v.match(/\.0+$/))&&(g=Math.max(g,y[0].length-1)),m<3&&(m=3);case"d":case"y":case"M":case"e":c=t[s].t;break;case"m":c==="s"&&(t[s].t="M",m<2&&(m=2));break;case"X":break;case"Z":m<1&&t[s].v.match(/[Hh]/)&&(m=1),m<2&&t[s].v.match(/[Mm]/)&&(m=2),m<3&&t[s].v.match(/[Ss]/)&&(m=3)}switch(m){case 0:break;case 1:l.u>=.5&&(l.u=0,++l.S),l.S>=60&&(l.S=0,++l.M),l.M>=60&&(l.M=0,++l.H);break;case 2:l.u>=.5&&(l.u=0,++l.S),l.S>=60&&(l.S=0,++l.M);break}var v="",E;for(s=0;s<t.length;++s)switch(t[s].t){case"t":case"T":case" ":case"D":break;case"X":t[s].v="",t[s].t=";";break;case"d":case"m":case"y":case"h":case"H":case"M":case"s":case"e":case"b":case"Z":t[s].v=Xx(t[s].t.charCodeAt(0),t[s].v,l,g),t[s].t="t";break;case"n":case"?":for(E=s+1;t[E]!=null&&((f=t[E].t)==="?"||f==="D"||(f===" "||f==="t")&&t[E+1]!=null&&(t[E+1].t==="?"||t[E+1].t==="t"&&t[E+1].v==="/")||t[s].t==="("&&(f===" "||f==="n"||f===")")||f==="t"&&(t[E].v==="/"||t[E].v===" "&&t[E+1]!=null&&t[E+1].t=="?"));)t[s].v+=t[E].v,t[E]={v:"",t:";"},++E;v+=t[s].v,s=E-1;break;case"G":t[s].t="t",t[s].v=w0(a,r);break}var w="",S,T;if(v.length>0){v.charCodeAt(0)==40?(S=a<0&&v.charCodeAt(0)===45?-a:a,T=Gn("n",v,S)):(S=a<0&&n>1?-a:a,T=Gn("n",v,S),S<0&&t[0]&&t[0].t=="t"&&(T=T.substr(1),t[0].v="-"+t[0].v)),E=T.length-1;var B=t.length;for(s=0;s<t.length;++s)if(t[s]!=null&&t[s].t!="t"&&t[s].v.indexOf(".")>-1){B=s;break}var I=t.length;if(B===t.length&&T.indexOf("E")===-1){for(s=t.length-1;s>=0;--s)t[s]==null||"n?".indexOf(t[s].t)===-1||(E>=t[s].v.length-1?(E-=t[s].v.length,t[s].v=T.substr(E+1,t[s].v.length)):E<0?t[s].v="":(t[s].v=T.substr(0,E+1),E=-1),t[s].t="t",I=s);E>=0&&I<t.length&&(t[I].v=T.substr(0,E+1)+t[I].v)}else if(B!==t.length&&T.indexOf("E")===-1){for(E=T.indexOf(".")-1,s=B;s>=0;--s)if(!(t[s]==null||"n?".indexOf(t[s].t)===-1)){for(o=t[s].v.indexOf(".")>-1&&s===B?t[s].v.indexOf(".")-1:t[s].v.length-1,w=t[s].v.substr(o+1);o>=0;--o)E>=0&&(t[s].v.charAt(o)==="0"||t[s].v.charAt(o)==="#")&&(w=T.charAt(E--)+w);t[s].v=w,t[s].t="t",I=s}for(E>=0&&I<t.length&&(t[I].v=T.substr(0,E+1)+t[I].v),E=T.indexOf(".")+1,s=B;s<t.length;++s)if(!(t[s]==null||"n?(".indexOf(t[s].t)===-1&&s!==B)){for(o=t[s].v.indexOf(".")>-1&&s===B?t[s].v.indexOf(".")+1:0,w=t[s].v.substr(0,o);o<t[s].v.length;++o)E<T.length&&(w+=T.charAt(E++));t[s].v=w,t[s].t="t",I=s}}}for(s=0;s<t.length;++s)t[s]!=null&&"n?".indexOf(t[s].t)>-1&&(S=n>1&&a<0&&s>0&&t[s-1].v==="-"?-a:a,t[s].v=Gn(t[s].t,t[s].v,S),t[s].t="t");var U="";for(s=0;s!==t.length;++s)t[s]!=null&&(U+=t[s].v);return U}var Jc=/\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;function qc(e,a){if(a==null)return!1;var r=parseFloat(a[2]);switch(a[1]){case"=":if(e==r)return!0;break;case">":if(e>r)return!0;break;case"<":if(e<r)return!0;break;case"<>":if(e!=r)return!0;break;case">=":if(e>=r)return!0;break;case"<=":if(e<=r)return!0;break}return!1}function ed(e,a){var r=Zx(e),n=r.length,t=r[n-1].indexOf("@");if(n<4&&t>-1&&--n,r.length>4)throw new Error("cannot find right format for |"+r.join("|")+"|");if(typeof a!="number")return[4,r.length===4||t>-1?r[r.length-1]:"@"];switch(r.length){case 1:r=t>-1?["General","General","General",r[0]]:[r[0],r[0],r[0],"@"];break;case 2:r=t>-1?[r[0],r[0],r[0],r[1]]:[r[0],r[1],r[0],"@"];break;case 3:r=t>-1?[r[0],r[1],r[0],r[2]]:[r[0],r[1],r[2],"@"];break}var i=a>0?r[0]:a<0?r[1]:r[2];if(r[0].indexOf("[")===-1&&r[1].indexOf("[")===-1)return[n,i];if(r[0].match(/\[[=<>]/)!=null||r[1].match(/\[[=<>]/)!=null){var s=r[0].match(Jc),f=r[1].match(Jc);return qc(a,s)?[n,r[0]]:qc(a,f)?[n,r[1]]:[n,r[s!=null&&f!=null?2:1]]}return[n,i]}function tn(e,a,r){r==null&&(r={});var n="";switch(typeof e){case"string":e=="m/d/yy"&&r.dateNF?n=r.dateNF:n=e;break;case"number":e==14&&r.dateNF?n=r.dateNF:n=(r.table!=null?r.table:tr)[e],n==null&&(n=r.table&&r.table[Vc[e]]||tr[Vc[e]]),n==null&&(n=Mx[e]||"General");break}if(Is(n,0))return w0(a,r);a instanceof Date&&(a=vo(a,r.date1904));var t=ed(n,a);if(Is(t[1]))return w0(a,r);if(a===!0)a="TRUE";else if(a===!1)a="FALSE";else if(a===""||a==null)return"";return Qx(t[1],a,r,t[0])}function Xn(e,a){if(typeof a!="number"){a=+a||-1;for(var r=0;r<392;++r){if(tr[r]==null){a<0&&(a=r);continue}if(tr[r]==e){a=r;break}}a<0&&(a=391)}return tr[a]=e,a}function Gs(e){for(var a=0;a!=392;++a)e[a]!==void 0&&Xn(e[a],a)}function ni(){tr=Px()}var rd={5:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',23:"General",24:"General",25:"General",26:"General",27:"m/d/yy",28:"m/d/yy",29:"m/d/yy",30:"m/d/yy",31:"m/d/yy",32:"h:mm:ss",33:"h:mm:ss",34:"h:mm:ss",35:"h:mm:ss",36:"m/d/yy",41:'_(* #,##0_);_(* (#,##0);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* (#,##0);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)',50:"m/d/yy",51:"m/d/yy",52:"m/d/yy",53:"m/d/yy",54:"m/d/yy",55:"m/d/yy",56:"m/d/yy",57:"m/d/yy",58:"m/d/yy",59:"0",60:"0.00",61:"#,##0",62:"#,##0.00",63:'"$"#,##0_);\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',67:"0%",68:"0.00%",69:"# ?/?",70:"# ??/??",71:"m/d/yy",72:"m/d/yy",73:"d-mmm-yy",74:"d-mmm",75:"mmm-yy",76:"h:mm",77:"h:mm:ss",78:"m/d/yy h:mm",79:"mm:ss",80:"[h]:mm:ss",81:"mmss.0"},Fo=/[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g;function ad(e){var a=typeof e=="number"?tr[e]:e;return a=a.replace(Fo,"(\\d+)"),new RegExp("^"+a+"$")}function td(e,a,r){var n=-1,t=-1,i=-1,s=-1,f=-1,c=-1;(a.match(Fo)||[]).forEach(function(u,x){var h=parseInt(r[x+1],10);switch(u.toLowerCase().charAt(0)){case"y":n=h;break;case"d":i=h;break;case"h":s=h;break;case"s":c=h;break;case"m":s>=0?f=h:t=h;break}}),c>=0&&f==-1&&t>=0&&(f=t,t=-1);var l=(""+(n>=0?n:new Date().getFullYear())).slice(-4)+"-"+("00"+(t>=1?t:1)).slice(-2)+"-"+("00"+(i>=1?i:1)).slice(-2);l.length==7&&(l="0"+l),l.length==8&&(l="20"+l);var o=("00"+(s>=0?s:0)).slice(-2)+":"+("00"+(f>=0?f:0)).slice(-2)+":"+("00"+(c>=0?c:0)).slice(-2);return s==-1&&f==-1&&c==-1?l:n==-1&&t==-1&&i==-1?o:l+"T"+o}var nd=function(){var e={};e.version="1.2.0";function a(){for(var T=0,B=new Array(256),I=0;I!=256;++I)T=I,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,B[I]=T;return typeof Int32Array<"u"?new Int32Array(B):B}var r=a();function n(T){var B=0,I=0,U=0,L=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(U=0;U!=256;++U)L[U]=T[U];for(U=0;U!=256;++U)for(I=T[U],B=256+U;B<4096;B+=256)I=L[B]=I>>>8^T[I&255];var W=[];for(U=1;U!=16;++U)W[U-1]=typeof Int32Array<"u"?L.subarray(U*256,U*256+256):L.slice(U*256,U*256+256);return W}var t=n(r),i=t[0],s=t[1],f=t[2],c=t[3],l=t[4],o=t[5],u=t[6],x=t[7],h=t[8],d=t[9],p=t[10],m=t[11],g=t[12],y=t[13],v=t[14];function E(T,B){for(var I=B^-1,U=0,L=T.length;U<L;)I=I>>>8^r[(I^T.charCodeAt(U++))&255];return~I}function w(T,B){for(var I=B^-1,U=T.length-15,L=0;L<U;)I=v[T[L++]^I&255]^y[T[L++]^I>>8&255]^g[T[L++]^I>>16&255]^m[T[L++]^I>>>24]^p[T[L++]]^d[T[L++]]^h[T[L++]]^x[T[L++]]^u[T[L++]]^o[T[L++]]^l[T[L++]]^c[T[L++]]^f[T[L++]]^s[T[L++]]^i[T[L++]]^r[T[L++]];for(U+=15;L<U;)I=I>>>8^r[(I^T[L++])&255];return~I}function S(T,B){for(var I=B^-1,U=0,L=T.length,W=0,M=0;U<L;)W=T.charCodeAt(U++),W<128?I=I>>>8^r[(I^W)&255]:W<2048?(I=I>>>8^r[(I^(192|W>>6&31))&255],I=I>>>8^r[(I^(128|W&63))&255]):W>=55296&&W<57344?(W=(W&1023)+64,M=T.charCodeAt(U++)&1023,I=I>>>8^r[(I^(240|W>>8&7))&255],I=I>>>8^r[(I^(128|W>>2&63))&255],I=I>>>8^r[(I^(128|M>>6&15|(W&3)<<4))&255],I=I>>>8^r[(I^(128|M&63))&255]):(I=I>>>8^r[(I^(224|W>>12&15))&255],I=I>>>8^r[(I^(128|W>>6&63))&255],I=I>>>8^r[(I^(128|W&63))&255]);return~I}return e.table=r,e.bstr=E,e.buf=w,e.str=S,e}(),je=function(){var a={};a.version="1.2.1";function r(k,N){for(var F=k.split("/"),C=N.split("/"),O=0,R=0,X=Math.min(F.length,C.length);O<X;++O){if(R=F[O].length-C[O].length)return R;if(F[O]!=C[O])return F[O]<C[O]?-1:1}return F.length-C.length}function n(k){if(k.charAt(k.length-1)=="/")return k.slice(0,-1).indexOf("/")===-1?k:n(k.slice(0,-1));var N=k.lastIndexOf("/");return N===-1?k:k.slice(0,N+1)}function t(k){if(k.charAt(k.length-1)=="/")return t(k.slice(0,-1));var N=k.lastIndexOf("/");return N===-1?k:k.slice(N+1)}function i(k,N){typeof N=="string"&&(N=new Date(N));var F=N.getHours();F=F<<6|N.getMinutes(),F=F<<5|N.getSeconds()>>>1,k.write_shift(2,F);var C=N.getFullYear()-1980;C=C<<4|N.getMonth()+1,C=C<<5|N.getDate(),k.write_shift(2,C)}function s(k){var N=k.read_shift(2)&65535,F=k.read_shift(2)&65535,C=new Date,O=F&31;F>>>=5;var R=F&15;F>>>=4,C.setMilliseconds(0),C.setFullYear(F+1980),C.setMonth(R-1),C.setDate(O);var X=N&31;N>>>=5;var j=N&63;return N>>>=6,C.setHours(N),C.setMinutes(j),C.setSeconds(X<<1),C}function f(k){it(k,0);for(var N={},F=0;k.l<=k.length-4;){var C=k.read_shift(2),O=k.read_shift(2),R=k.l+O,X={};switch(C){case 21589:F=k.read_shift(1),F&1&&(X.mtime=k.read_shift(4)),O>5&&(F&2&&(X.atime=k.read_shift(4)),F&4&&(X.ctime=k.read_shift(4))),X.mtime&&(X.mt=new Date(X.mtime*1e3));break}k.l=R,N[C]=X}return N}var c;function l(){return c||(c={})}function o(k,N){if(k[0]==80&&k[1]==75)return Vr(k,N);if((k[0]|32)==109&&(k[1]|32)==105)return ft(k,N);if(k.length<512)throw new Error("CFB file size "+k.length+" < 512");var F=3,C=512,O=0,R=0,X=0,j=0,z=0,V=[],Y=k.slice(0,512);it(Y,0);var le=u(Y);switch(F=le[0],F){case 3:C=512;break;case 4:C=4096;break;case 0:if(le[1]==0)return Vr(k,N);default:throw new Error("Major Version: Expected 3 or 4 saw "+F)}C!==512&&(Y=k.slice(0,C),it(Y,28));var _e=k.slice(0,C);x(Y,F);var Ee=Y.read_shift(4,"i");if(F===3&&Ee!==0)throw new Error("# Directory Sectors: Expected 0 saw "+Ee);Y.l+=4,X=Y.read_shift(4,"i"),Y.l+=4,Y.chk("00100000","Mini Stream Cutoff Size: "),j=Y.read_shift(4,"i"),O=Y.read_shift(4,"i"),z=Y.read_shift(4,"i"),R=Y.read_shift(4,"i");for(var ue=-1,ge=0;ge<109&&(ue=Y.read_shift(4,"i"),!(ue<0));++ge)V[ge]=ue;var Ze=h(k,C);m(z,R,Ze,C,V);var Tr=y(Ze,X,V,C);Tr[X].name="!Directory",O>0&&j!==M&&(Tr[j].name="!MiniFAT"),Tr[V[0]].name="!FAT",Tr.fat_addrs=V,Tr.ssz=C;var Lr={},Kr=[],sn=[],fn=[];v(X,Tr,Ze,Kr,O,Lr,sn,j),d(sn,fn,Kr),Kr.shift();var cn={FileIndex:sn,FullPaths:fn};return N&&N.raw&&(cn.raw={header:_e,sectors:Ze}),cn}function u(k){if(k[k.l]==80&&k[k.l+1]==75)return[0,0];k.chk(se,"Header Signature: "),k.l+=16;var N=k.read_shift(2,"u");return[k.read_shift(2,"u"),N]}function x(k,N){var F=9;switch(k.l+=2,F=k.read_shift(2)){case 9:if(N!=3)throw new Error("Sector Shift: Expected 9 saw "+F);break;case 12:if(N!=4)throw new Error("Sector Shift: Expected 12 saw "+F);break;default:throw new Error("Sector Shift: Expected 9 or 12 saw "+F)}k.chk("0600","Mini Sector Shift: "),k.chk("000000000000","Reserved: ")}function h(k,N){for(var F=Math.ceil(k.length/N)-1,C=[],O=1;O<F;++O)C[O-1]=k.slice(O*N,(O+1)*N);return C[F-1]=k.slice(F*N),C}function d(k,N,F){for(var C=0,O=0,R=0,X=0,j=0,z=F.length,V=[],Y=[];C<z;++C)V[C]=Y[C]=C,N[C]=F[C];for(;j<Y.length;++j)C=Y[j],O=k[C].L,R=k[C].R,X=k[C].C,V[C]===C&&(O!==-1&&V[O]!==O&&(V[C]=V[O]),R!==-1&&V[R]!==R&&(V[C]=V[R])),X!==-1&&(V[X]=C),O!==-1&&C!=V[C]&&(V[O]=V[C],Y.lastIndexOf(O)<j&&Y.push(O)),R!==-1&&C!=V[C]&&(V[R]=V[C],Y.lastIndexOf(R)<j&&Y.push(R));for(C=1;C<z;++C)V[C]===C&&(R!==-1&&V[R]!==R?V[C]=V[R]:O!==-1&&V[O]!==O&&(V[C]=V[O]));for(C=1;C<z;++C)if(k[C].type!==0){if(j=C,j!=V[j])do j=V[j],N[C]=N[j]+"/"+N[C];while(j!==0&&V[j]!==-1&&j!=V[j]);V[C]=-1}for(N[0]+="/",C=1;C<z;++C)k[C].type!==2&&(N[C]+="/")}function p(k,N,F){for(var C=k.start,O=k.size,R=[],X=C;F&&O>0&&X>=0;)R.push(N.slice(X*W,X*W+W)),O-=W,X=g0(F,X*4);return R.length===0?ae(0):Ja(R).slice(0,k.size)}function m(k,N,F,C,O){var R=M;if(k===M){if(N!==0)throw new Error("DIFAT chain shorter than expected")}else if(k!==-1){var X=F[k],j=(C>>>2)-1;if(!X)return;for(var z=0;z<j&&(R=g0(X,z*4))!==M;++z)O.push(R);m(g0(X,C-4),N-1,F,C,O)}}function g(k,N,F,C,O){var R=[],X=[];O||(O=[]);var j=C-1,z=0,V=0;for(z=N;z>=0;){O[z]=!0,R[R.length]=z,X.push(k[z]);var Y=F[Math.floor(z*4/C)];if(V=z*4&j,C<4+V)throw new Error("FAT boundary crossed: "+z+" 4 "+C);if(!k[Y])break;z=g0(k[Y],V)}return{nodes:R,data:ll([X])}}function y(k,N,F,C){var O=k.length,R=[],X=[],j=[],z=[],V=C-1,Y=0,le=0,_e=0,Ee=0;for(Y=0;Y<O;++Y)if(j=[],_e=Y+N,_e>=O&&(_e-=O),!X[_e]){z=[];var ue=[];for(le=_e;le>=0;){ue[le]=!0,X[le]=!0,j[j.length]=le,z.push(k[le]);var ge=F[Math.floor(le*4/C)];if(Ee=le*4&V,C<4+Ee)throw new Error("FAT boundary crossed: "+le+" 4 "+C);if(!k[ge]||(le=g0(k[ge],Ee),ue[le]))break}R[_e]={nodes:j,data:ll([z])}}return R}function v(k,N,F,C,O,R,X,j){for(var z=0,V=C.length?2:0,Y=N[k].data,le=0,_e=0,Ee;le<Y.length;le+=128){var ue=Y.slice(le,le+128);it(ue,64),_e=ue.read_shift(2),Ee=Yf(ue,0,_e-V),C.push(Ee);var ge={name:Ee,type:ue.read_shift(1),color:ue.read_shift(1),L:ue.read_shift(4,"i"),R:ue.read_shift(4,"i"),C:ue.read_shift(4,"i"),clsid:ue.read_shift(16),state:ue.read_shift(4,"i"),start:0,size:0},Ze=ue.read_shift(2)+ue.read_shift(2)+ue.read_shift(2)+ue.read_shift(2);Ze!==0&&(ge.ct=E(ue,ue.l-8));var Tr=ue.read_shift(2)+ue.read_shift(2)+ue.read_shift(2)+ue.read_shift(2);Tr!==0&&(ge.mt=E(ue,ue.l-8)),ge.start=ue.read_shift(4,"i"),ge.size=ue.read_shift(4,"i"),ge.size<0&&ge.start<0&&(ge.size=ge.type=0,ge.start=M,ge.name=""),ge.type===5?(z=ge.start,O>0&&z!==M&&(N[z].name="!StreamData")):ge.size>=4096?(ge.storage="fat",N[ge.start]===void 0&&(N[ge.start]=g(F,ge.start,N.fat_addrs,N.ssz)),N[ge.start].name=ge.name,ge.content=N[ge.start].data.slice(0,ge.size)):(ge.storage="minifat",ge.size<0?ge.size=0:z!==M&&ge.start!==M&&N[z]&&(ge.content=p(ge,N[z].data,(N[j]||{}).data))),ge.content&&it(ge.content,0),R[Ee]=ge,X.push(ge)}}function E(k,N){return new Date((Ht(k,N+4)/1e7*Math.pow(2,32)+Ht(k,N)/1e7-11644473600)*1e3)}function w(k,N){return l(),o(c.readFileSync(k),N)}function S(k,N){var F=N&&N.type;switch(F||kr&&Buffer.isBuffer(k)&&(F="buffer"),F||"base64"){case"file":return w(k,N);case"base64":return o(Gt(Kt(k)),N);case"binary":return o(Gt(k),N)}return o(k,N)}function T(k,N){var F=N||{},C=F.root||"Root Entry";if(k.FullPaths||(k.FullPaths=[]),k.FileIndex||(k.FileIndex=[]),k.FullPaths.length!==k.FileIndex.length)throw new Error("inconsistent CFB structure");k.FullPaths.length===0&&(k.FullPaths[0]=C+"/",k.FileIndex[0]={name:C,type:5}),F.CLSID&&(k.FileIndex[0].clsid=F.CLSID),B(k)}function B(k){var N="Sh33tJ5";if(!je.find(k,"/"+N)){var F=ae(4);F[0]=55,F[1]=F[3]=50,F[2]=54,k.FileIndex.push({name:N,type:2,content:F,size:4,L:69,R:69,C:69}),k.FullPaths.push(k.FullPaths[0]+N),I(k)}}function I(k,N){T(k);for(var F=!1,C=!1,O=k.FullPaths.length-1;O>=0;--O){var R=k.FileIndex[O];switch(R.type){case 0:C?F=!0:(k.FileIndex.pop(),k.FullPaths.pop());break;case 1:case 2:case 5:C=!0,isNaN(R.R*R.L*R.C)&&(F=!0),R.R>-1&&R.L>-1&&R.R==R.L&&(F=!0);break;default:F=!0;break}}if(!(!F&&!N)){var X=new Date(1987,1,19),j=0,z=Object.create?Object.create(null):{},V=[];for(O=0;O<k.FullPaths.length;++O)z[k.FullPaths[O]]=!0,k.FileIndex[O].type!==0&&V.push([k.FullPaths[O],k.FileIndex[O]]);for(O=0;O<V.length;++O){var Y=n(V[O][0]);C=z[Y],C||(V.push([Y,{name:t(Y).replace("/",""),type:1,clsid:he,ct:X,mt:X,content:null}]),z[Y]=!0)}for(V.sort(function(Ee,ue){return r(Ee[0],ue[0])}),k.FullPaths=[],k.FileIndex=[],O=0;O<V.length;++O)k.FullPaths[O]=V[O][0],k.FileIndex[O]=V[O][1];for(O=0;O<V.length;++O){var le=k.FileIndex[O],_e=k.FullPaths[O];if(le.name=t(_e).replace("/",""),le.L=le.R=le.C=-(le.color=1),le.size=le.content?le.content.length:0,le.start=0,le.clsid=le.clsid||he,O===0)le.C=V.length>1?1:-1,le.size=0,le.type=5;else if(_e.slice(-1)=="/"){for(j=O+1;j<V.length&&n(k.FullPaths[j])!=_e;++j);for(le.C=j>=V.length?-1:j,j=O+1;j<V.length&&n(k.FullPaths[j])!=n(_e);++j);le.R=j>=V.length?-1:j,le.type=1}else n(k.FullPaths[O+1]||"")==n(_e)&&(le.R=O+1),le.type=2}}}function U(k,N){var F=N||{};if(F.fileType=="mad")return Ot(k,F);switch(I(k),F.fileType){case"zip":return Sa(k,F)}var C=function(Ee){for(var ue=0,ge=0,Ze=0;Ze<Ee.FileIndex.length;++Ze){var Tr=Ee.FileIndex[Ze];if(Tr.content){var Lr=Tr.content.length;Lr>0&&(Lr<4096?ue+=Lr+63>>6:ge+=Lr+511>>9)}}for(var Kr=Ee.FullPaths.length+3>>2,sn=ue+7>>3,fn=ue+127>>7,cn=sn+ge+Kr+fn,Lt=cn+127>>7,Pn=Lt<=109?0:Math.ceil((Lt-109)/127);cn+Lt+Pn+127>>7>Lt;)Pn=++Lt<=109?0:Math.ceil((Lt-109)/127);var rr=[1,Pn,Lt,fn,Kr,ge,ue,0];return Ee.FileIndex[0].size=ue<<6,rr[7]=(Ee.FileIndex[0].start=rr[0]+rr[1]+rr[2]+rr[3]+rr[4]+rr[5])+(rr[6]+7>>3),rr}(k),O=ae(C[7]<<9),R=0,X=0;{for(R=0;R<8;++R)O.write_shift(1,ne[R]);for(R=0;R<8;++R)O.write_shift(2,0);for(O.write_shift(2,62),O.write_shift(2,3),O.write_shift(2,65534),O.write_shift(2,9),O.write_shift(2,6),R=0;R<3;++R)O.write_shift(2,0);for(O.write_shift(4,0),O.write_shift(4,C[2]),O.write_shift(4,C[0]+C[1]+C[2]+C[3]-1),O.write_shift(4,0),O.write_shift(4,4096),O.write_shift(4,C[3]?C[0]+C[1]+C[2]-1:M),O.write_shift(4,C[3]),O.write_shift(-4,C[1]?C[0]-1:M),O.write_shift(4,C[1]),R=0;R<109;++R)O.write_shift(-4,R<C[2]?C[1]+R:-1)}if(C[1])for(X=0;X<C[1];++X){for(;R<236+X*127;++R)O.write_shift(-4,R<C[2]?C[1]+R:-1);O.write_shift(-4,X===C[1]-1?M:X+1)}var j=function(Ee){for(X+=Ee;R<X-1;++R)O.write_shift(-4,R+1);Ee&&(++R,O.write_shift(-4,M))};for(X=R=0,X+=C[1];R<X;++R)O.write_shift(-4,ce.DIFSECT);for(X+=C[2];R<X;++R)O.write_shift(-4,ce.FATSECT);j(C[3]),j(C[4]);for(var z=0,V=0,Y=k.FileIndex[0];z<k.FileIndex.length;++z)Y=k.FileIndex[z],Y.content&&(V=Y.content.length,!(V<4096)&&(Y.start=X,j(V+511>>9)));for(j(C[6]+7>>3);O.l&511;)O.write_shift(-4,ce.ENDOFCHAIN);for(X=R=0,z=0;z<k.FileIndex.length;++z)Y=k.FileIndex[z],Y.content&&(V=Y.content.length,!(!V||V>=4096)&&(Y.start=X,j(V+63>>6)));for(;O.l&511;)O.write_shift(-4,ce.ENDOFCHAIN);for(R=0;R<C[4]<<2;++R){var le=k.FullPaths[R];if(!le||le.length===0){for(z=0;z<17;++z)O.write_shift(4,0);for(z=0;z<3;++z)O.write_shift(4,-1);for(z=0;z<12;++z)O.write_shift(4,0);continue}Y=k.FileIndex[R],R===0&&(Y.start=Y.size?Y.start-1:M);var _e=R===0&&F.root||Y.name;if(V=2*(_e.length+1),O.write_shift(64,_e,"utf16le"),O.write_shift(2,V),O.write_shift(1,Y.type),O.write_shift(1,Y.color),O.write_shift(-4,Y.L),O.write_shift(-4,Y.R),O.write_shift(-4,Y.C),Y.clsid)O.write_shift(16,Y.clsid,"hex");else for(z=0;z<4;++z)O.write_shift(4,0);O.write_shift(4,Y.state||0),O.write_shift(4,0),O.write_shift(4,0),O.write_shift(4,0),O.write_shift(4,0),O.write_shift(4,Y.start),O.write_shift(4,Y.size),O.write_shift(4,0)}for(R=1;R<k.FileIndex.length;++R)if(Y=k.FileIndex[R],Y.size>=4096)if(O.l=Y.start+1<<9,kr&&Buffer.isBuffer(Y.content))Y.content.copy(O,O.l,0,Y.size),O.l+=Y.size+511&-512;else{for(z=0;z<Y.size;++z)O.write_shift(1,Y.content[z]);for(;z&511;++z)O.write_shift(1,0)}for(R=1;R<k.FileIndex.length;++R)if(Y=k.FileIndex[R],Y.size>0&&Y.size<4096)if(kr&&Buffer.isBuffer(Y.content))Y.content.copy(O,O.l,0,Y.size),O.l+=Y.size+63&-64;else{for(z=0;z<Y.size;++z)O.write_shift(1,Y.content[z]);for(;z&63;++z)O.write_shift(1,0)}if(kr)O.l=O.length;else for(;O.l<O.length;)O.write_shift(1,0);return O}function L(k,N){var F=k.FullPaths.map(function(z){return z.toUpperCase()}),C=F.map(function(z){var V=z.split("/");return V[V.length-(z.slice(-1)=="/"?2:1)]}),O=!1;N.charCodeAt(0)===47?(O=!0,N=F[0].slice(0,-1)+N):O=N.indexOf("/")!==-1;var R=N.toUpperCase(),X=O===!0?F.indexOf(R):C.indexOf(R);if(X!==-1)return k.FileIndex[X];var j=!R.match(bi);for(R=R.replace(Tt,""),j&&(R=R.replace(bi,"!")),X=0;X<F.length;++X)if((j?F[X].replace(bi,"!"):F[X]).replace(Tt,"")==R||(j?C[X].replace(bi,"!"):C[X]).replace(Tt,"")==R)return k.FileIndex[X];return null}var W=64,M=-2,se="d0cf11e0a1b11ae1",ne=[208,207,17,224,161,177,26,225],he="00000000000000000000000000000000",ce={MAXREGSECT:-6,DIFSECT:-4,FATSECT:-3,ENDOFCHAIN:M,FREESECT:-1,HEADER_SIGNATURE:se,HEADER_MINOR_VERSION:"3e00",MAXREGSID:-6,NOSTREAM:-1,HEADER_CLSID:he,EntryTypes:["unknown","storage","stream","lockbytes","property","root"]};function Ce(k,N,F){l();var C=U(k,F);c.writeFileSync(N,C)}function K(k){for(var N=new Array(k.length),F=0;F<k.length;++F)N[F]=String.fromCharCode(k[F]);return N.join("")}function Te(k,N){var F=U(k,N);switch(N&&N.type||"buffer"){case"file":return l(),c.writeFileSync(N.filename,F),F;case"binary":return typeof F=="string"?F:K(F);case"base64":return Hi(typeof F=="string"?F:K(F));case"buffer":if(kr)return Buffer.isBuffer(F)?F:zn(F);case"array":return typeof F=="string"?Gt(F):F}return F}var Fe;function _(k){try{var N=k.InflateRaw,F=new N;if(F._processChunk(new Uint8Array([3,0]),F._finishFlushFlag),F.bytesRead)Fe=k;else throw new Error("zlib does not expose bytesRead")}catch(C){console.error("cannot use native zlib: "+(C.message||C))}}function A(k,N){if(!Fe)return ta(k,N);var F=Fe.InflateRaw,C=new F,O=C._processChunk(k.slice(k.l),C._finishFlushFlag);return k.l+=C.bytesRead,O}function D(k){return Fe?Fe.deflateRawSync(k):er(k)}var b=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],G=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],re=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577];function ee(k){var N=(k<<1|k<<11)&139536|(k<<5|k<<15)&558144;return(N>>16|N>>8|N)&255}for(var Z=typeof Uint8Array<"u",J=Z?new Uint8Array(256):[],we=0;we<256;++we)J[we]=ee(we);function P(k,N){var F=J[k&255];return N<=8?F>>>8-N:(F=F<<8|J[k>>8&255],N<=16?F>>>16-N:(F=F<<8|J[k>>16&255],F>>>24-N))}function Me(k,N){var F=N&7,C=N>>>3;return(k[C]|(F<=6?0:k[C+1]<<8))>>>F&3}function be(k,N){var F=N&7,C=N>>>3;return(k[C]|(F<=5?0:k[C+1]<<8))>>>F&7}function Ye(k,N){var F=N&7,C=N>>>3;return(k[C]|(F<=4?0:k[C+1]<<8))>>>F&15}function Be(k,N){var F=N&7,C=N>>>3;return(k[C]|(F<=3?0:k[C+1]<<8))>>>F&31}function ie(k,N){var F=N&7,C=N>>>3;return(k[C]|(F<=1?0:k[C+1]<<8))>>>F&127}function hr(k,N,F){var C=N&7,O=N>>>3,R=(1<<F)-1,X=k[O]>>>C;return F<8-C||(X|=k[O+1]<<8-C,F<16-C)||(X|=k[O+2]<<16-C,F<24-C)||(X|=k[O+3]<<24-C),X&R}function sr(k,N,F){var C=N&7,O=N>>>3;return C<=5?k[O]|=(F&7)<<C:(k[O]|=F<<C&255,k[O+1]=(F&7)>>8-C),N+3}function Ea(k,N,F){var C=N&7,O=N>>>3;return F=(F&1)<<C,k[O]|=F,N+1}function Ia(k,N,F){var C=N&7,O=N>>>3;return F<<=C,k[O]|=F&255,F>>>=8,k[O+1]=F,N+8}function wt(k,N,F){var C=N&7,O=N>>>3;return F<<=C,k[O]|=F&255,F>>>=8,k[O+1]=F&255,k[O+2]=F>>>8,N+16}function Za(k,N){var F=k.length,C=2*F>N?2*F:N+5,O=0;if(F>=N)return k;if(kr){var R=$c(C);if(k.copy)k.copy(R);else for(;O<k.length;++O)R[O]=k[O];return R}else if(Z){var X=new Uint8Array(C);if(X.set)X.set(k);else for(;O<F;++O)X[O]=k[O];return X}return k.length=C,k}function Ta(k){for(var N=new Array(k),F=0;F<k;++F)N[F]=0;return N}function za(k,N,F){var C=1,O=0,R=0,X=0,j=0,z=k.length,V=Z?new Uint16Array(32):Ta(32);for(R=0;R<32;++R)V[R]=0;for(R=z;R<F;++R)k[R]=0;z=k.length;var Y=Z?new Uint16Array(z):Ta(z);for(R=0;R<z;++R)V[O=k[R]]++,C<O&&(C=O),Y[R]=0;for(V[0]=0,R=1;R<=C;++R)V[R+16]=j=j+V[R-1]<<1;for(R=0;R<z;++R)j=k[R],j!=0&&(Y[R]=V[j+16]++);var le=0;for(R=0;R<z;++R)if(le=k[R],le!=0)for(j=P(Y[R],C)>>C-le,X=(1<<C+4-le)-1;X>=0;--X)N[j|X<<le]=le&15|R<<4;return C}var Se=Z?new Uint16Array(512):Ta(512),Pe=Z?new Uint16Array(32):Ta(32);if(!Z){for(var Ue=0;Ue<512;++Ue)Se[Ue]=0;for(Ue=0;Ue<32;++Ue)Pe[Ue]=0}(function(){for(var k=[],N=0;N<32;N++)k.push(5);za(k,Pe,32);var F=[];for(N=0;N<=143;N++)F.push(8);for(;N<=255;N++)F.push(9);for(;N<=279;N++)F.push(7);for(;N<=287;N++)F.push(8);za(F,Se,288)})();var wa=function(){for(var N=Z?new Uint8Array(32768):[],F=0,C=0;F<re.length-1;++F)for(;C<re[F+1];++C)N[C]=F;for(;C<32768;++C)N[C]=29;var O=Z?new Uint8Array(259):[];for(F=0,C=0;F<G.length-1;++F)for(;C<G[F+1];++C)O[C]=F;function R(j,z){for(var V=0;V<j.length;){var Y=Math.min(65535,j.length-V),le=V+Y==j.length;for(z.write_shift(1,+le),z.write_shift(2,Y),z.write_shift(2,~Y&65535);Y-- >0;)z[z.l++]=j[V++]}return z.l}function X(j,z){for(var V=0,Y=0,le=Z?new Uint16Array(32768):[];Y<j.length;){var _e=Math.min(65535,j.length-Y);if(_e<10){for(V=sr(z,V,+(Y+_e==j.length)),V&7&&(V+=8-(V&7)),z.l=V/8|0,z.write_shift(2,_e),z.write_shift(2,~_e&65535);_e-- >0;)z[z.l++]=j[Y++];V=z.l*8;continue}V=sr(z,V,+(Y+_e==j.length)+2);for(var Ee=0;_e-- >0;){var ue=j[Y];Ee=(Ee<<5^ue)&32767;var ge=-1,Ze=0;if((ge=le[Ee])&&(ge|=Y&-32768,ge>Y&&(ge-=32768),ge<Y))for(;j[ge+Ze]==j[Y+Ze]&&Ze<250;)++Ze;if(Ze>2){ue=O[Ze],ue<=22?V=Ia(z,V,J[ue+1]>>1)-1:(Ia(z,V,3),V+=5,Ia(z,V,J[ue-23]>>5),V+=3);var Tr=ue<8?0:ue-4>>2;Tr>0&&(wt(z,V,Ze-G[ue]),V+=Tr),ue=N[Y-ge],V=Ia(z,V,J[ue]>>3),V-=3;var Lr=ue<4?0:ue-2>>1;Lr>0&&(wt(z,V,Y-ge-re[ue]),V+=Lr);for(var Kr=0;Kr<Ze;++Kr)le[Ee]=Y&32767,Ee=(Ee<<5^j[Y])&32767,++Y;_e-=Ze-1}else ue<=143?ue=ue+48:V=Ea(z,V,1),V=Ia(z,V,J[ue]),le[Ee]=Y&32767,++Y}V=Ia(z,V,0)-1}return z.l=(V+7)/8|0,z.l}return function(z,V){return z.length<8?R(z,V):X(z,V)}}();function er(k){var N=ae(50+Math.floor(k.length*1.1)),F=wa(k,N);return N.slice(0,F)}var Cr=Z?new Uint16Array(32768):Ta(32768),me=Z?new Uint16Array(32768):Ta(32768),Dr=Z?new Uint16Array(128):Ta(128),Rr=1,xr=1;function Er(k,N){var F=Be(k,N)+257;N+=5;var C=Be(k,N)+1;N+=5;var O=Ye(k,N)+4;N+=4;for(var R=0,X=Z?new Uint8Array(19):Ta(19),j=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],z=1,V=Z?new Uint8Array(8):Ta(8),Y=Z?new Uint8Array(8):Ta(8),le=X.length,_e=0;_e<O;++_e)X[b[_e]]=R=be(k,N),z<R&&(z=R),V[R]++,N+=3;var Ee=0;for(V[0]=0,_e=1;_e<=z;++_e)Y[_e]=Ee=Ee+V[_e-1]<<1;for(_e=0;_e<le;++_e)(Ee=X[_e])!=0&&(j[_e]=Y[Ee]++);var ue=0;for(_e=0;_e<le;++_e)if(ue=X[_e],ue!=0){Ee=J[j[_e]]>>8-ue;for(var ge=(1<<7-ue)-1;ge>=0;--ge)Dr[Ee|ge<<ue]=ue&7|_e<<3}var Ze=[];for(z=1;Ze.length<F+C;)switch(Ee=Dr[ie(k,N)],N+=Ee&7,Ee>>>=3){case 16:for(R=3+Me(k,N),N+=2,Ee=Ze[Ze.length-1];R-- >0;)Ze.push(Ee);break;case 17:for(R=3+be(k,N),N+=3;R-- >0;)Ze.push(0);break;case 18:for(R=11+ie(k,N),N+=7;R-- >0;)Ze.push(0);break;default:Ze.push(Ee),z<Ee&&(z=Ee);break}var Tr=Ze.slice(0,F),Lr=Ze.slice(F);for(_e=F;_e<286;++_e)Tr[_e]=0;for(_e=C;_e<30;++_e)Lr[_e]=0;return Rr=za(Tr,Cr,286),xr=za(Lr,me,30),N}function da(k,N){if(k[0]==3&&!(k[1]&3))return[i0(N),2];for(var F=0,C=0,O=$c(N||1<<18),R=0,X=O.length>>>0,j=0,z=0;(C&1)==0;){if(C=be(k,F),F+=3,C>>>1)C>>1==1?(j=9,z=5):(F=Er(k,F),j=Rr,z=xr);else{F&7&&(F+=8-(F&7));var V=k[F>>>3]|k[(F>>>3)+1]<<8;if(F+=32,V>0)for(!N&&X<R+V&&(O=Za(O,R+V),X=O.length);V-- >0;)O[R++]=k[F>>>3],F+=8;continue}for(;;){!N&&X<R+32767&&(O=Za(O,R+32767),X=O.length);var Y=hr(k,F,j),le=C>>>1==1?Se[Y]:Cr[Y];if(F+=le&15,le>>>=4,(le>>>8&255)===0)O[R++]=le;else{if(le==256)break;le-=257;var _e=le<8?0:le-4>>2;_e>5&&(_e=0);var Ee=R+G[le];_e>0&&(Ee+=hr(k,F,_e),F+=_e),Y=hr(k,F,z),le=C>>>1==1?Pe[Y]:me[Y],F+=le&15,le>>>=4;var ue=le<4?0:le-2>>1,ge=re[le];for(ue>0&&(ge+=hr(k,F,ue),F+=ue),!N&&X<Ee&&(O=Za(O,Ee+100),X=O.length);R<Ee;)O[R]=O[R-ge],++R}}}return N?[O,F+7>>>3]:[O.slice(0,R),F+7>>>3]}function ta(k,N){var F=k.slice(k.l||0),C=da(F,N);return k.l+=C[1],C[0]}function He(k,N){if(k)typeof console<"u"&&console.error(N);else throw new Error(N)}function Vr(k,N){var F=k;it(F,0);var C=[],O=[],R={FileIndex:C,FullPaths:O};T(R,{root:N.root});for(var X=F.length-4;(F[X]!=80||F[X+1]!=75||F[X+2]!=5||F[X+3]!=6)&&X>=0;)--X;F.l=X+4,F.l+=4;var j=F.read_shift(2);F.l+=6;var z=F.read_shift(4);for(F.l=z,X=0;X<j;++X){F.l+=20;var V=F.read_shift(4),Y=F.read_shift(4),le=F.read_shift(2),_e=F.read_shift(2),Ee=F.read_shift(2);F.l+=8;var ue=F.read_shift(4),ge=f(F.slice(F.l+le,F.l+le+_e));F.l+=le+_e+Ee;var Ze=F.l;F.l=ue+4,ia(F,V,Y,R,ge),F.l=Ze}return R}function ia(k,N,F,C,O){k.l+=2;var R=k.read_shift(2),X=k.read_shift(2),j=s(k);if(R&8257)throw new Error("Unsupported ZIP encryption");for(var z=k.read_shift(4),V=k.read_shift(4),Y=k.read_shift(4),le=k.read_shift(2),_e=k.read_shift(2),Ee="",ue=0;ue<le;++ue)Ee+=String.fromCharCode(k[k.l++]);if(_e){var ge=f(k.slice(k.l,k.l+_e));(ge[21589]||{}).mt&&(j=ge[21589].mt),((O||{})[21589]||{}).mt&&(j=O[21589].mt)}k.l+=_e;var Ze=k.slice(k.l,k.l+V);switch(X){case 8:Ze=A(k,Y);break;case 0:break;default:throw new Error("Unsupported ZIP Compression method "+X)}var Tr=!1;R&8&&(z=k.read_shift(4),z==134695760&&(z=k.read_shift(4),Tr=!0),V=k.read_shift(4),Y=k.read_shift(4)),V!=N&&He(Tr,"Bad compressed size: "+N+" != "+V),Y!=F&&He(Tr,"Bad uncompressed size: "+F+" != "+Y),yt(C,Ee,Ze,{unsafe:!0,mt:j})}function Sa(k,N){var F=N||{},C=[],O=[],R=ae(1),X=F.compression?8:0,j=0,z=0,V=0,Y=0,le=0,_e=k.FullPaths[0],Ee=_e,ue=k.FileIndex[0],ge=[],Ze=0;for(z=1;z<k.FullPaths.length;++z)if(Ee=k.FullPaths[z].slice(_e.length),ue=k.FileIndex[z],!(!ue.size||!ue.content||Ee=="Sh33tJ5")){var Tr=Y,Lr=ae(Ee.length);for(V=0;V<Ee.length;++V)Lr.write_shift(1,Ee.charCodeAt(V)&127);Lr=Lr.slice(0,Lr.l),ge[le]=nd.buf(ue.content,0);var Kr=ue.content;X==8&&(Kr=D(Kr)),R=ae(30),R.write_shift(4,67324752),R.write_shift(2,20),R.write_shift(2,j),R.write_shift(2,X),ue.mt?i(R,ue.mt):R.write_shift(4,0),R.write_shift(-4,ge[le]),R.write_shift(4,Kr.length),R.write_shift(4,ue.content.length),R.write_shift(2,Lr.length),R.write_shift(2,0),Y+=R.length,C.push(R),Y+=Lr.length,C.push(Lr),Y+=Kr.length,C.push(Kr),R=ae(46),R.write_shift(4,33639248),R.write_shift(2,0),R.write_shift(2,20),R.write_shift(2,j),R.write_shift(2,X),R.write_shift(4,0),R.write_shift(-4,ge[le]),R.write_shift(4,Kr.length),R.write_shift(4,ue.content.length),R.write_shift(2,Lr.length),R.write_shift(2,0),R.write_shift(2,0),R.write_shift(2,0),R.write_shift(2,0),R.write_shift(4,0),R.write_shift(4,Tr),Ze+=R.l,O.push(R),Ze+=Lr.length,O.push(Lr),++le}return R=ae(22),R.write_shift(4,101010256),R.write_shift(2,0),R.write_shift(2,0),R.write_shift(2,le),R.write_shift(2,le),R.write_shift(4,Ze),R.write_shift(4,Y),R.write_shift(2,0),Ja([Ja(C),Ja(O),R])}var xa={htm:"text/html",xml:"text/xml",gif:"image/gif",jpg:"image/jpeg",png:"image/png",mso:"application/x-mso",thmx:"application/vnd.ms-officetheme",sh33tj5:"application/octet-stream"};function cr(k,N){if(k.ctype)return k.ctype;var F=k.name||"",C=F.match(/\.([^\.]+)$/);return C&&xa[C[1]]||N&&(C=(F=N).match(/[\.\\]([^\.\\])+$/),C&&xa[C[1]])?xa[C[1]]:"application/octet-stream"}function Sr(k){for(var N=Hi(k),F=[],C=0;C<N.length;C+=76)F.push(N.slice(C,C+76));return F.join(`\r
|
|
2
2
|
`)+`\r
|
|
3
3
|
`}function Ra(k){var N=k.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF=]/g,function(V){var Y=V.charCodeAt(0).toString(16).toUpperCase();return"="+(Y.length==1?"0"+Y:Y)});N=N.replace(/ $/mg,"=20").replace(/\t$/mg,"=09"),N.charAt(0)==`
|
|
4
4
|
`&&(N="=0D"+N.slice(1)),N=N.replace(/\r(?!\n)/mg,"=0D").replace(/\n\n/mg,`
|