@blocklet/pages-kit-inner-components 0.4.110 → 0.4.112

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.
@@ -1,4 +1,4 @@
1
- "use strict";var XI=Object.create;var II=Object.defineProperty;var TI=Object.getOwnPropertyDescriptor;var WI=Object.getOwnPropertyNames;var xI=Object.getPrototypeOf,YI=Object.prototype.hasOwnProperty;var rI=(C,s,w,A)=>{if(s&&typeof s=="object"||typeof s=="function")for(let o of WI(s))!YI.call(C,o)&&o!==w&&II(C,o,{get:()=>s[o],enumerable:!(A=TI(s,o))||A.enumerable});return C};var hI=(C,s,w)=>(w=C!=null?XI(xI(C)):{},rI(s||!C||!C.__esModule?II(w,"default",{value:C,enumerable:!0}):w,C));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const I=require("react/jsx-runtime"),H=require("./chunks/state-DDwYX2mu.js"),ZI=require("@arcblock/ux/lib/Empty"),X=require("@arcblock/ux/lib/Locale/context"),R=require("@iconify-icon/react"),QI=require("@mui/icons-material/Check"),i=require("@mui/material"),u=require("ahooks"),m=require("react"),r=require("./chunks/array-COVLO-B9.js"),U=require("./chunks/config-color-BBSht7j-.js"),kI=require("lodash/cloneDeep"),Y=require("@mui/icons-material"),CI=require("react-dnd");require("@arcblock/ux/lib/Tabs");require("@blocklet/pages-kit/utils/style");require("lodash/pick");const f=require("@arcblock/ux/lib/Theme"),RI=require("@mui/lab"),a=require("immer"),pI=require("./theme.js"),v=require("react-use"),JI=require("@arcblock/ux/lib/Toast"),UI=require("@mui/material/Tooltip"),fI=require("@mui/icons-material/KeyboardArrowLeft"),GI=require("@mui/material/Box"),VI=require("@mui/material/DialogTitle"),vI=require("@mui/material/IconButton"),PI=require("@mui/material/Dialog"),_I=require("@mui/material/useMediaQuery"),OI=require("@emotion/react"),qI=require("@mui/material/Alert"),$I=require("@mui/material/AlertTitle"),IC=require("react-error-boundary"),CC=require("ufo"),gC=require("@emotion/styled"),AC=require("@mui/material/Typography"),iC=require("joi"),mI=require("@blocklet/ai-kit/api"),sC=require("@blocklet/js-sdk"),SI=require("@mui/x-date-pickers"),oC=require("@mui/x-date-pickers/AdapterDayjs"),wC=require("@mui/x-date-pickers/LocalizationProvider"),gI=require("circular-natal-horoscope-js/dist"),MC=require("dayjs"),LC=require("dayjs/plugin/timezone"),jC=require("dayjs/plugin/utc"),JC=require("fast-deep-equal"),OC=require("lodash/isNil"),mC=require("tz-lookup"),SC=require("@mui/icons-material/CheckCircleOutline"),BC=require("lodash/uniq"),yC=require("@emotion/css"),DC=require("lodash/get"),eC=require("lodash/set"),bC=require("@blocklet/pages-kit/components"),F=C=>C&&C.__esModule?C:{default:C},BI=F(ZI),NC=F(QI),yI=F(m),KC=F(kI),DI=F(JI),dC=F(UI),P=F(fI),x=F(GI),_=F(VI),q=F(vI),cC=F(PI),zC=F(_I),FC=F(qI),aC=F($I),Z=F(gC),AI=F(AC),E=F(iC),h=F(MC),lC=F(LC),tC=F(jC),HC=F(JC),EC=F(OC),eI=F(mC),uC=F(SC),iI=F(BC),nC=F(DC),XC=F(eC);function TC({htmlId:C,dragType:s,dropType:w=s,index:A,id:o,title:g,move:M,actions:j,...O}){const[{isDragging:L},e,y]=CI.useDrag(()=>({type:s,item:{id:o,index:A},options:{dropEffect:"move"},collect:b=>({isDragging:b.isDragging()}),end:(b,N)=>{const{id:S,index:B}=b;N.didDrop()||M(S,B)}}),[s,o,A,M]),[,J]=CI.useDrop(()=>({accept:w,hover(b){b.id!==o&&M(b.id,A)}}),[w,o,A,M]),D=L?.3:1;return I.jsxs(WC,{...O,id:C,ref:b=>J(y(b)),sx:{...O.sx,opacity:D},children:[I.jsx("div",{className:"drag",ref:b=>e(b),children:I.jsx(Y.DragIndicator,{})}),I.jsx("div",{className:"name",children:g}),I.jsx("div",{className:"actions",onClick:b=>b.stopPropagation(),children:j})]})}const WC=i.styled(i.Box)`
1
+ "use strict";var XI=Object.create;var II=Object.defineProperty;var TI=Object.getOwnPropertyDescriptor;var WI=Object.getOwnPropertyNames;var xI=Object.getPrototypeOf,YI=Object.prototype.hasOwnProperty;var rI=(C,s,w,A)=>{if(s&&typeof s=="object"||typeof s=="function")for(let o of WI(s))!YI.call(C,o)&&o!==w&&II(C,o,{get:()=>s[o],enumerable:!(A=TI(s,o))||A.enumerable});return C};var hI=(C,s,w)=>(w=C!=null?XI(xI(C)):{},rI(s||!C||!C.__esModule?II(w,"default",{value:C,enumerable:!0}):w,C));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const I=require("react/jsx-runtime"),H=require("./chunks/state-DDwYX2mu.js"),ZI=require("@arcblock/ux/lib/Empty"),X=require("@arcblock/ux/lib/Locale/context"),R=require("@iconify-icon/react"),QI=require("@mui/icons-material/Check"),i=require("@mui/material"),u=require("ahooks"),m=require("react"),r=require("./chunks/array-CnXbKOG_.js"),U=require("./chunks/config-color-BBSht7j-.js"),kI=require("lodash/cloneDeep"),Y=require("@mui/icons-material"),CI=require("react-dnd");require("@arcblock/ux/lib/Tabs");require("@blocklet/pages-kit/utils/style");require("lodash/pick");const f=require("@arcblock/ux/lib/Theme"),RI=require("@mui/lab"),a=require("immer"),pI=require("./theme.js"),v=require("react-use"),JI=require("@arcblock/ux/lib/Toast"),UI=require("@mui/material/Tooltip"),fI=require("@mui/icons-material/KeyboardArrowLeft"),GI=require("@mui/material/Box"),VI=require("@mui/material/DialogTitle"),vI=require("@mui/material/IconButton"),PI=require("@mui/material/Dialog"),_I=require("@mui/material/useMediaQuery"),OI=require("@emotion/react"),qI=require("@mui/material/Alert"),$I=require("@mui/material/AlertTitle"),IC=require("react-error-boundary"),CC=require("ufo"),gC=require("@emotion/styled"),AC=require("@mui/material/Typography"),iC=require("joi"),mI=require("@blocklet/ai-kit/api"),sC=require("@blocklet/js-sdk"),SI=require("@mui/x-date-pickers"),oC=require("@mui/x-date-pickers/AdapterDayjs"),wC=require("@mui/x-date-pickers/LocalizationProvider"),gI=require("circular-natal-horoscope-js/dist"),MC=require("dayjs"),LC=require("dayjs/plugin/timezone"),jC=require("dayjs/plugin/utc"),JC=require("fast-deep-equal"),OC=require("lodash/isNil"),mC=require("tz-lookup"),SC=require("@mui/icons-material/CheckCircleOutline"),BC=require("lodash/uniq"),yC=require("@emotion/css"),DC=require("lodash/get"),eC=require("lodash/set"),bC=require("@blocklet/pages-kit/components"),F=C=>C&&C.__esModule?C:{default:C},BI=F(ZI),NC=F(QI),yI=F(m),KC=F(kI),DI=F(JI),dC=F(UI),P=F(fI),x=F(GI),_=F(VI),q=F(vI),cC=F(PI),zC=F(_I),FC=F(qI),aC=F($I),Z=F(gC),AI=F(AC),E=F(iC),h=F(MC),lC=F(LC),tC=F(jC),HC=F(JC),EC=F(OC),eI=F(mC),uC=F(SC),iI=F(BC),nC=F(DC),XC=F(eC);function TC({htmlId:C,dragType:s,dropType:w=s,index:A,id:o,title:g,move:M,actions:j,...O}){const[{isDragging:L},e,y]=CI.useDrag(()=>({type:s,item:{id:o,index:A},options:{dropEffect:"move"},collect:b=>({isDragging:b.isDragging()}),end:(b,N)=>{const{id:S,index:B}=b;N.didDrop()||M(S,B)}}),[s,o,A,M]),[,J]=CI.useDrop(()=>({accept:w,hover(b){b.id!==o&&M(b.id,A)}}),[w,o,A,M]),D=L?.3:1;return I.jsxs(WC,{...O,id:C,ref:b=>J(y(b)),sx:{...O.sx,opacity:D},children:[I.jsx("div",{className:"drag",ref:b=>e(b),children:I.jsx(Y.DragIndicator,{})}),I.jsx("div",{className:"name",children:g}),I.jsx("div",{className:"actions",onClick:b=>b.stopPropagation(),children:j})]})}const WC=i.styled(i.Box)`
2
2
  display: flex;
3
3
  align-items: center;
4
4
  padding: 8px;
@@ -1,4 +1,4 @@
1
- "use strict";var St=Object.create;var nt=Object.defineProperty;var Bt=Object.getOwnPropertyDescriptor;var Ct=Object.getOwnPropertyNames;var Nt=Object.getPrototypeOf,It=Object.prototype.hasOwnProperty;var Pt=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ct(e))!It.call(t,r)&&r!==n&&nt(t,r,{get:()=>e[r],enumerable:!(i=Bt(e,r))||i.enumerable});return t};var rt=(t,e,n)=>(n=t!=null?St(Nt(t)):{},Pt(e||!t||!t.__esModule?nt(n,"default",{value:t,enumerable:!0}):n,t));const o=require("react/jsx-runtime");require("@mui/icons-material");const u=require("@mui/material"),f=require("react"),Rt=require("lodash/keyBy"),w=require("./state-DDwYX2mu.js"),U=require("@blocklet/ai-runtime/components"),Tt=require("@mui/utils"),Wt=require("lodash/pick"),zt=require("react-error-boundary"),pt=require("@blocklet/pages-kit/contexts/color"),y=require("@emotion/css"),H=require("@iconify/react"),qt=require("react-markdown"),Et=require("remark-gfm"),Lt=require("@mui/lab"),_=require("@arcblock/ux/lib/Theme"),At=require("@arcblock/react-hooks/lib/useBrowser"),Ft=require("@arcblock/ux/lib/Colors"),J=require("@blocklet/pages-kit/components"),it=require("@blocklet/pages-kit/utils/style"),Ut=require("@mui/material/useMediaQuery"),Ot=require("lodash/omit"),ht=require("@iconify-icon/react"),Dt=require("@arcblock/ux/lib/Screenshot"),X=require("react-router-dom"),Mt=require("@arcblock/ux/lib/Button"),Ht=require("is-uri"),O=require("pathe"),T=require("ufo"),Vt=require("@blocklet/embed/message"),Yt=require("ahooks"),Gt=require("lodash/isEqual"),Jt=require("@blocklet/embed/react"),Xt=require("react-twitter-embed"),st=require("react-use"),$=t=>t&&t.__esModule?t:{default:t},ft=$(f),M=$(Rt),K=$(Wt),Kt=$(qt),Qt=$(Et),Zt=$(At),at=$(Ft),gt=$(Ut),C=$(Ot),te=$(Dt),ee=$(Mt),V=$(Ht),oe=$(Gt),ne=[{title:"None",value:"none",sx:{py:0}},{title:"Small",value:"small",sx:{py:{xs:2.5,md:4,lg:4,xl:6}}},{title:"Normal",value:"normal",sx:{py:{xs:5,md:7.5,lg:10,xl:12.5}}},{title:"Large",value:"large",sx:{py:{xs:7.5,md:10,lg:12.5,xl:15}}}],re=[{title:"None",value:"none",sx:{py:0}},{title:"Small",value:"small",sx:{py:{xs:2.5,md:4,lg:4,xl:6}}},{title:"Normal",value:"normal",sx:{py:{xs:5,md:7,lg:7,xl:9}}},{title:"Large",value:"large",sx:{py:{xs:6,md:9,lg:9,xl:11}}}],ie=[{title:"None",value:"none",sx:{px:0}},{title:"Small",value:"small",sx:{px:{xs:2.5,md:4,lg:4,xl:6}}},{title:"Normal",value:"normal",sx:{px:{xs:5,md:7.5,lg:10,xl:12.5}}},{title:"Large",value:"large",sx:{px:{xs:7.5,md:10,lg:12.5,xl:15}}}],D=(t,e,n)=>{const i=t.breakpoints.values[n];return`${e}${i?` (${i}px)`:""}`},se=[{title:"100%",value:"full",sx:{maxWidth:"100%"}},{title:t=>D(t,"Small","sm"),value:"sm",sx:{maxWidth:t=>t.breakpoints.values.sm,width:"100%",mx:"auto"}},{title:t=>D(t,"Normal","md"),value:"md",sx:{maxWidth:t=>t.breakpoints.values.md,width:"100%",mx:"auto"}},{title:t=>D(t,"Large","lg"),value:"lg",sx:{maxWidth:t=>t.breakpoints.values.lg,width:"100%",mx:"auto"}},{title:t=>D(t,"Extra Large","xl"),value:"xl",sx:{maxWidth:t=>t.breakpoints.values.xl,width:"100%",mx:"auto"}}],ae=M.default(ne,"value"),le=M.default(re,"value"),ce=M.default(ie,"value"),de=M.default(se,"value"),ue=new Map([["baseSectionPaddingY",ae],["maxWidth",de],["paddingY",le],["paddingX",ce]]);function bt(t){var c;const{type:e,value:n,format:i="sx",defaultValue:r=null}=t,s=ue.get(e);return s&&s!=null&&s[n]&&(c=s==null?void 0:s[n])!=null&&c[i]?s[n][i]:r}const yt=f.createContext({page:null,getPageMeta:()=>({}),getPageMetaStyle:()=>({})});function me(){return f.useContext(yt)}function xe({page:t,children:e,defaultLocale:n="en",currentLocale:i}){const r=f.useMemo(()=>t?JSON.parse(JSON.stringify(t)):null,[JSON.stringify(t)]),s=f.useCallback(()=>{var d;if(!r)return{};const l=i||n;return((d=r.locales)==null?void 0:d[l])??{}},[r,n,i]),c=f.useCallback((l="sx")=>{const d=s();return!d||!d.style?{}:Object.entries(d.style||{}).reduce((x,[h,p])=>{if(!p)return x;const g=bt({type:h,value:p,format:l});return g?{...x,...g}:x},{})},[s]),a=f.useMemo(()=>({page:r,getPageMeta:s,getPageMetaStyle:c}),[r,s,c]);return o.jsx(yt.Provider,{value:a,children:e})}const pe=f.forwardRef(({onClick:t,...e},n)=>{const[i,r]=f.useState(!1),s=f.useCallback(async c=>{try{r(!0),await(t==null?void 0:t(c))}finally{r(!1)}},[t]);return o.jsx(Lt.LoadingButton,{ref:n,...e,loading:e.loading||i,onClick:s})});function he({tip:t,tipSucceed:e,title:n,titleSucceed:i,icon:r,iconSucceed:s,autoReset:c,placement:a="top",...l}){const[d,m]=f.useState(!1),[x,h]=f.useState(),p=f.useRef(),g=()=>{h(void 0),c&&(p.current=window.setTimeout(()=>{m(!1)},3e3))},j=()=>{clearTimeout(p.current)},b=d?s:r,k=x?o.jsx(u.Box,{color:"error",children:x.message}):d&&e||t,v=d?i:n;return o.jsx(u.Tooltip,{title:k,disableInteractive:!0,placement:a,onClose:g,onOpen:j,children:o.jsx("span",{children:o.jsx(pe,{startIcon:b&&(typeof b=="string"?o.jsx(H.Icon,{icon:b}):b),loadingPosition:b?"start":void 0,...l,onClick:async B=>{if(l.onClick)try{await l.onClick(B),m(!0)}catch(N){h(N)}},children:v})})})}const fe=ft.default.lazy(()=>import("react-syntax-highlighter").then(t=>({default:t.Prism}))),ge=u.styled(t=>o.jsx(Kt.default,{...t,remarkPlugins:[Qt.default],components:{pre:be,code:({node:e,inline:n,className:i,children:r,...s})=>{if(!r)return null;const c=/language-(\w+)/.exec(i||"");return n?o.jsx(u.Box,{component:"code",className:i,...s,children:r}):o.jsx(u.Box,{component:fe,language:c==null?void 0:c[1],...s,sx:{borderRadius:1},children:String(r).replace(/\n$/,"")})},table:({className:e,children:n})=>o.jsx(u.Box,{sx:{overflow:"auto",my:1},children:o.jsx("table",{className:e,children:n})})}}))`
1
+ "use strict";var Bt=Object.create;var nt=Object.defineProperty;var Ct=Object.getOwnPropertyDescriptor;var Nt=Object.getOwnPropertyNames;var It=Object.getPrototypeOf,Pt=Object.prototype.hasOwnProperty;var Rt=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Nt(e))!Pt.call(t,r)&&r!==n&&nt(t,r,{get:()=>e[r],enumerable:!(i=Ct(e,r))||i.enumerable});return t};var rt=(t,e,n)=>(n=t!=null?Bt(It(t)):{},Rt(e||!t||!t.__esModule?nt(n,"default",{value:t,enumerable:!0}):n,t));const o=require("react/jsx-runtime");require("@mui/icons-material");const m=require("@mui/material"),f=require("react"),Tt=require("lodash/keyBy"),j=require("./state-DDwYX2mu.js"),U=require("@blocklet/ai-runtime/components"),Wt=require("@mui/utils"),zt=require("lodash/pick"),qt=require("react-error-boundary"),pt=require("@blocklet/pages-kit/contexts/color"),b=require("@emotion/css"),V=require("@iconify/react"),Et=require("react-markdown"),Lt=require("remark-gfm"),At=require("@mui/lab"),_=require("@arcblock/ux/lib/Theme"),Ot=require("@arcblock/react-hooks/lib/useBrowser"),Ut=require("@arcblock/ux/lib/Colors"),G=require("@blocklet/pages-kit/components"),it=require("@blocklet/pages-kit/utils/style"),Ft=require("@mui/material/useMediaQuery"),Mt=require("lodash/omit"),ht=require("@iconify-icon/react"),Dt=require("@arcblock/ux/lib/Screenshot"),K=require("react-router-dom"),Vt=require("@arcblock/ux/lib/Button"),Ht=require("is-uri"),F=require("pathe"),T=require("ufo"),Yt=require("@blocklet/embed/message"),Jt=require("ahooks"),Gt=require("lodash/isEqual"),Kt=require("@blocklet/embed/react"),Xt=require("react-twitter-embed"),st=require("react-use"),$=t=>t&&t.__esModule?t:{default:t},ft=$(f),D=$(Tt),X=$(zt),Qt=$(Et),Zt=$(Lt),te=$(Ot),at=$(Ut),gt=$(Ft),C=$(Mt),ee=$(Dt),oe=$(Vt),H=$(Ht),ne=$(Gt),yt="{{CUSTOM_VALUE}}",re=[{title:"None",value:"none",sx:{py:0}},{title:"Small",value:"small",sx:{py:{xs:2.5,md:4,lg:4,xl:6}}},{title:"Normal",value:"normal",sx:{py:{xs:5,md:7.5,lg:10,xl:12.5}}},{title:"Large",value:"large",sx:{py:{xs:7.5,md:10,lg:12.5,xl:15}}}],ie=[{title:"None",value:"none",sx:{py:0}},{title:"Small",value:"small",sx:{py:{xs:2.5,md:4,lg:4,xl:6}}},{title:"Normal",value:"normal",sx:{py:{xs:5,md:7,lg:7,xl:9}}},{title:"Large",value:"large",sx:{py:{xs:6,md:9,lg:9,xl:11}}}],se=[{title:"None",value:"none",sx:{px:0}},{title:"Small",value:"small",sx:{px:{xs:2.5,md:4,lg:4,xl:6}}},{title:"Normal",value:"normal",sx:{px:{xs:5,md:7.5,lg:10,xl:12.5}}},{title:"Large",value:"large",sx:{px:{xs:7.5,md:10,lg:12.5,xl:15}}}],M=(t,e,n)=>{const i=t.breakpoints.values[n];return`${e}${i?` (${i}px)`:""}`},ae=[{title:"100%",value:"full",sx:{maxWidth:"100%"}},{title:t=>M(t,"Small","sm"),value:"sm",sx:{maxWidth:t=>t.breakpoints.values.sm,width:"100%",mx:"auto"}},{title:t=>M(t,"Normal","md"),value:"md",sx:{maxWidth:t=>t.breakpoints.values.md,width:"100%",mx:"auto"}},{title:t=>M(t,"Large","lg"),value:"lg",sx:{maxWidth:t=>t.breakpoints.values.lg,width:"100%",mx:"auto"}},{title:t=>M(t,"Extra Large","xl"),value:"xl",sx:{maxWidth:t=>t.breakpoints.values.xl,width:"100%",mx:"auto"}},{title:"Custom",value:"custom",sx:{maxWidth:yt,width:"100%",mx:"auto"}}],le=D.default(re,"value"),ce=D.default(ie,"value"),de=D.default(se,"value"),ue=D.default(ae,"value"),me=new Map([["baseSectionPaddingY",le],["maxWidth",ue],["paddingY",ce],["paddingX",de]]);function bt(t){var l;const{type:e,value:n,format:i="sx",defaultValue:r=null}=t,s=me.get(e);if(!s)return r;const c=n.startsWith("custom:"),a=c?"custom":n;if(s!=null&&s[a]&&((l=s==null?void 0:s[a])!=null&&l[i])){const d=s[a][i];if(c){const u=n.replace("custom:","");try{return JSON.parse(JSON.stringify(d||{}).replaceAll(yt,u))}catch{}}return d}return r}const wt=f.createContext({page:null,getPageMeta:()=>({}),getPageMetaStyle:()=>({})});function xe(){return f.useContext(wt)}function pe({page:t,children:e,defaultLocale:n="en",currentLocale:i}){const r=f.useMemo(()=>t?JSON.parse(JSON.stringify(t)):null,[JSON.stringify(t)]),s=f.useCallback(()=>{var d;if(!r)return{};const l=i||n;return((d=r.locales)==null?void 0:d[l])??{}},[r,n,i]),c=f.useCallback((l="sx")=>{const d=s();return!d||!d.style?{}:Object.entries(d.style||{}).reduce((x,[h,p])=>{if(!p)return x;const y=`${h}Custom`;d.style[y];const w=bt({type:h,value:p,format:l});return w?{...x,...w}:x},{})},[s]),a=f.useMemo(()=>({page:r,getPageMeta:s,getPageMetaStyle:c}),[r,s,c]);return o.jsx(wt.Provider,{value:a,children:e})}const he=f.forwardRef(({onClick:t,...e},n)=>{const[i,r]=f.useState(!1),s=f.useCallback(async c=>{try{r(!0),await(t==null?void 0:t(c))}finally{r(!1)}},[t]);return o.jsx(At.LoadingButton,{ref:n,...e,loading:e.loading||i,onClick:s})});function fe({tip:t,tipSucceed:e,title:n,titleSucceed:i,icon:r,iconSucceed:s,autoReset:c,placement:a="top",...l}){const[d,u]=f.useState(!1),[x,h]=f.useState(),p=f.useRef(),y=()=>{h(void 0),c&&(p.current=window.setTimeout(()=>{u(!1)},3e3))},w=()=>{clearTimeout(p.current)},g=d?s:r,k=x?o.jsx(m.Box,{color:"error",children:x.message}):d&&e||t,v=d?i:n;return o.jsx(m.Tooltip,{title:k,disableInteractive:!0,placement:a,onClose:y,onOpen:w,children:o.jsx("span",{children:o.jsx(he,{startIcon:g&&(typeof g=="string"?o.jsx(V.Icon,{icon:g}):g),loadingPosition:g?"start":void 0,...l,onClick:async B=>{if(l.onClick)try{await l.onClick(B),u(!0)}catch(N){h(N)}},children:v})})})}const ge=ft.default.lazy(()=>import("react-syntax-highlighter").then(t=>({default:t.Prism}))),ye=m.styled(t=>o.jsx(Qt.default,{...t,remarkPlugins:[Zt.default],components:{pre:be,code:({node:e,inline:n,className:i,children:r,...s})=>{if(!r)return null;const c=/language-(\w+)/.exec(i||"");return n?o.jsx(m.Box,{component:"code",className:i,...s,children:r}):o.jsx(m.Box,{component:ge,language:c==null?void 0:c[1],...s,sx:{borderRadius:1},children:String(r).replace(/\n$/,"")})},table:({className:e,children:n})=>o.jsx(m.Box,{sx:{overflow:"auto",my:1},children:o.jsx("table",{className:e,children:n})})}}))`
2
2
  width: 100%;
3
3
  overflow: hidden;
4
4
  word-break: break-word;
@@ -70,7 +70,7 @@
70
70
  }
71
71
  }
72
72
  }
73
- `;function be({children:t}){const e=t==null?void 0:t.props;if(!(e!=null&&e.children))return null;const n=/language-(\w+)/.exec(e.className||""),i=n==null?void 0:n[1];return o.jsxs(u.Box,{component:"div",sx:{fontSize:14,borderRadius:1,bgcolor:"rgb(245, 242, 240)","> pre":{mt:"0 !important"}},children:[o.jsxs(u.Stack,{direction:"row",alignItems:"center",p:.5,pl:1.5,borderBottom:1,borderColor:"grey.200",children:[o.jsx(u.Box,{children:i}),o.jsx(u.Box,{flex:1}),o.jsx(he,{autoReset:!0,title:o.jsx(H.Icon,{icon:"tabler:copy"}),titleSucceed:o.jsx(H.Icon,{icon:"tabler:copy-check"}),sx:{minWidth:32,minHeight:32,p:0,fontSize:18},onClick:()=>{window.navigator.clipboard.writeText(e.children)}})]}),t]})}function R({actions:t,center:e,className:n,align:i}){return t&&(t!=null&&t.length)?o.jsx(u.Box,{className:y.cx("flex gap-4 flex-wrap","lg:flex-row lg:gap-8",(e||i==="center")&&"justify-center",!e&&i==="right"&&"justify-end",!e&&i==="left"&&"justify-start",n),sx:{alignItems:"center"},children:t}):null}const ye="section",we=u.styled(u.Box)`
73
+ `;function be({children:t}){const e=t==null?void 0:t.props;if(!(e!=null&&e.children))return null;const n=/language-(\w+)/.exec(e.className||""),i=n==null?void 0:n[1];return o.jsxs(m.Box,{component:"div",sx:{fontSize:14,borderRadius:1,bgcolor:"rgb(245, 242, 240)","> pre":{mt:"0 !important"}},children:[o.jsxs(m.Stack,{direction:"row",alignItems:"center",p:.5,pl:1.5,borderBottom:1,borderColor:"grey.200",children:[o.jsx(m.Box,{children:i}),o.jsx(m.Box,{flex:1}),o.jsx(fe,{autoReset:!0,title:o.jsx(V.Icon,{icon:"tabler:copy"}),titleSucceed:o.jsx(V.Icon,{icon:"tabler:copy-check"}),sx:{minWidth:32,minHeight:32,p:0,fontSize:18},onClick:()=>{window.navigator.clipboard.writeText(e.children)}})]}),t]})}function R({actions:t,center:e,className:n,align:i}){return t&&(t!=null&&t.length)?o.jsx(m.Box,{className:b.cx("flex gap-4 flex-wrap","lg:flex-row lg:gap-8",(e||i==="center")&&"justify-center",!e&&i==="right"&&"justify-end",!e&&i==="left"&&"justify-start",n),sx:{alignItems:"center"},children:t}):null}const we="section",je=m.styled(m.Box)`
74
74
  overflow: hidden;
75
75
 
76
76
  .section__title {
@@ -119,7 +119,7 @@
119
119
  margin-bottom: 0.5rem;
120
120
  }
121
121
  }
122
- @media (min-width: ${({theme:t})=>t.breakpoints.values[ye]}px) {
122
+ @media (min-width: ${({theme:t})=>t.breakpoints.values[we]}px) {
123
123
  .section__tag {
124
124
  margin-bottom: 32px;
125
125
  }
@@ -130,7 +130,7 @@
130
130
  margin-bottom: 40px;
131
131
  }
132
132
  }
133
- `;function z({title:t,description:e,descriptionMarkdown:n,actions:i,className:r="",classes:s={},prepend:c,append:a,level:l=2,tag:d,badge:m,center:x,logo:h,titleAppearance:p,descriptionAppearance:g,...j}){const b=pt.useColorConvert();if(!t&&!e&&!i&&!m&&!d&&!c&&!a&&!h)return null;const k=Math.max(Math.min(5,l+1),1),v={1:"xl:!text-3xl lg:!text-2xl md:!text-xl",2:"xl:!text-2xl lg:!text-xl md:!text-lg",3:"xl:!text-2xl lg:!text-xl md:!text-lg",4:"xl:!text-xl lg:!text-lg md:!text-md",5:"xl:!text-lg md:!text-md sm:!text-sm",6:"!text-sm"},B=l===0?"big":`h${k}`,N=l===0;return o.jsxs(we,{className:y.cx("base-info","lg:text-left",x&&"!text-center",r),...j,children:[c&&o.jsx("div",{children:c}),(d||m)&&o.jsx("div",{className:y.cx("section__tag",(s==null?void 0:s.tag)||(s==null?void 0:s.badge)),children:d||m}),h&&o.jsx("img",{className:"w-[120px] m-auto mb-8",src:h,alt:"info",loading:"lazy"}),t&&o.jsx(u.Typography,{sx:{whiteSpace:"pre-wrap",mb:e?"2vw":0,...(p==null?void 0:p.color)&&{color:`${b(p.color)} !important`}},className:y.cx("section__title","text-gray-800","dark:text-gray-50",s.title,"page-kit-section__title",N?"":"section__title_non_big"),component:`h${Math.max(l,1)}`,variant:B,children:t}),e&&(n?o.jsx(u.Box,{sx:{...(g==null?void 0:g.color)&&{color:`${b(g.color)} !important`}},component:ge,className:y.cx("section__description","text-gray-800","dark:text-gray-100",v[k],s.description,"page-kit-section__description"),children:e}):o.jsx(u.Typography,{sx:{whiteSpace:"pre-wrap",...(g==null?void 0:g.color)&&{color:`${b(g.color)} !important`}},className:y.cx("section__description","text-gray-800","dark:text-gray-100",v[k],s.description,"page-kit-section__description"),component:"div",variant:"body1",gutterBottom:!0,children:e})),o.jsx(R,{actions:i,center:x,className:"mt-8"}),a&&o.jsx("div",{children:a})]})}const q=["actions","append","badge","tag","center","description","descriptionMarkdown","level","logo","prepend","title","titleAppearance","descriptionAppearance"];function wt(t){if(t.type===f.Fragment){const n=(t.props.children||[]).filter(i=>f.isValidElement(i));return n.length===1?wt(n[0]):n.length>1}return Array.isArray(t)}const I="&>*";function Q({children:t,col:e,gap:n,className:i,align:r,sx:s,type:c,...a}={children:null,className:"",col:3,gap:void 0,sx:{},align:"center",type:"default"}){const l=_.useTheme(),d=Number(Math.floor(100/e*100)/100),m={center:"justify-center items-center",left:"justify-start items-center",right:"justify-end items-center",top:"justify-center items-start",bottom:"justify-center items-end","top-left":"justify-start items-start","top-right":"justify-end items-start","bottom-left":"justify-start items-end","bottom-right":"justify-end items-end"},x=m[r]||m.center;let p=n??({2:6,3:4,4:4,5:3,6:3}[e]||0);wt(t)||(p=0);const j=(e-1)*p/e;let b={...s,gap:`${p}rem`};const k={[I]:{width:"100%"}},v={},B={},N={};switch(k.gap="1rem",v.gap=`${p/2}rem`,e){case 3:case 4:v[I]={width:`calc(50% - ${p/2}rem)`};break;case 5:case 6:k[I]={width:`calc(50% - ${p/2/2}rem)`},v[I]={width:`calc(50% - ${p/2/2}rem)`},B[I]={width:`calc(33.33% - ${p*2/3}rem)`};break}return b[I]={width:`calc(${d}% - ${j}rem)`},b[`@media (max-width: ${l.breakpoints.values.xl}px)`]=N,b[`@media (max-width: ${l.breakpoints.values.lg}px)`]=B,b[`@media (max-width: ${l.breakpoints.values.md}px)`]=v,b[`@media (max-width: ${l.breakpoints.values.sm}px)`]=k,c==="wall"&&(b={...s,gap:`${p}rem`},b[I]={width:`calc(${d}% - ${j}rem)`},k[I]={width:`calc(45% - ${p/2/2}rem)`},b[`@media (max-width: ${l.breakpoints.values.sm}px)`]=k),o.jsx(u.Box,{className:y.cx("flex flex-wrap flex-row h-full",x,i),sx:b,...a,children:t})}function je(){const t=navigator.userAgent.toLowerCase();return t.includes("safari")&&!t.includes("chrome")}function ve(t=""){if(t.startsWith("data:image/svg+xml,"))return!0;const e=/^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-]([^!@#$%^&*?.\s]{0,63}[^!@#$%^&*?.\s])?\.)+[a-z]{2,6}\/?/,n=/^(\/|\.\/|\.\.\/)(?:[^/]+\/)*[^/]+$/;return e.test(t)||n.test(t)}function Y(t){return(t==null?void 0:t.endsWith(".mp4"))||(t==null?void 0:t.endsWith(".m4v"))||(t==null?void 0:t.endsWith(".webm"))}function ke(t){return t!=null&&t.endsWith(".mp4")||t!=null&&t.endsWith(".m4v")?"video/mp4":t!=null&&t.endsWith(".webm")?"video/webm":void 0}function _e(t){let e={};return typeof t=="string"?it.isGradient(t)?e.image=t:(e.image=w.getImageAbsoluteUrl(t),it.isColorString(t)&&(e.color=t,e.image="")):e=t,e}function $e(){const[t,e]=f.useState(Date.now());return f.useEffect(()=>{const n=()=>{e(Date.now())};return document.addEventListener("visibilitychange",n),()=>{document.removeEventListener("visibilitychange",n)}},[]),t}function lt(t,e,n,i,r){let s=null;const{color:c="",image:a}=_e(e);return a&&ve(a)?(delete n.backgroundColor,!(t.mobile.apple.device||je())&&Y(a)?s=o.jsx(u.Box,{component:"video",className:"section-bg",width:"100%",autoPlay:!0,loop:!0,muted:!0,controls:!1,playsInline:!0,poster:w.autoResizeImage(w.getImageAbsoluteUrl(i),1200,"quality"),src:Y(a)?a:w.autoResizeImage(a,1200,"quality"),sx:{position:"absolute",zIndex:-9999,right:0,left:0,top:0,width:"100%",height:"100%",objectFit:"cover"}},a):s=o.jsx(J.ResponsiveImage,{src:a,sizesAttr:{sm:600,md:900,lg:1200},className:"section-bg",alt:"",width:"100%",loading:"lazy",sx:{position:"absolute",zIndex:-9999,right:0,left:0,top:0,width:"100%",height:"100%",objectFit:"cover"}},r||a)):a?n.backgroundImage=`${a} !important`:c&&(n.backgroundColor=`${c} !important`),s}function Se({autoWidth:t,children:e,...n}){return t?o.jsx(u.Box,{display:"flex",...n,children:e}):o.jsx(u.Container,{...n,children:e})}function E({dark:t=!1,children:e,className:n,sx:i={},boxed:r={show:!1},padding:s="normal",boxProps:c,type:a,...l}){const d={...i},m=gt.default(p=>p.breakpoints.down("md"));t&&(d.color=at.default.common.white,d.backgroundColor=`${at.default.grey[900]} !important`),r.show&&(d.display="flex");const x=f.useMemo(()=>!Number(l.boxMaxWidth)||m?{width:"100%"}:a==="wall"&&l.boxMaxWidth?{maxWidth:`${l.boxMaxWidth}px !important`,width:"100%"}:{width:"100%"},[l.boxMaxWidth,m,a]),h=bt({type:"baseSectionPaddingY",value:s||"normal",defaultValue:""});return o.jsx(Be,{component:"section",styles:{...d,...h},className:y.cx("base-section","px-2 md:px-5 lg:px-5 xl:px-10",n,{dark:t}),...C.default(l,"hoverStyle","boxMaxWidth","embedUrl","autoWidth","paddingXY","iframeHeight","titleAppearance","descriptionAppearance"),children:o.jsx(Se,{autoWidth:l==null?void 0:l.autoWidth,className:y.cx("section-content h-full"),sx:x,children:r.show?o.jsx(jt,{...c,boxed:r,children:e}):e})})}function jt({background:t="",backgroundVideoPoster:e,children:n,sx:i={},boxed:r={show:!1},className:s="",styles:c={},...a}){const l={...c,...i},d=pt.useColorConvert();let m=null;const x=gt.default(g=>g.breakpoints.up("sm")),h=Zt.default(),p=$e();return t&&(m=lt(h,typeof t=="string"?d(t):t,l,e,p)),r.show&&(l.borderRadius="10px",l.padding===void 0&&(l.padding=x?"50px":"20px"),r!=null&&r.border&&(l.border="1px solid #c0c0c0"),r!=null&&r.background&&(m=lt(h,typeof(r==null?void 0:r.background)=="string"?d(r==null?void 0:r.background):r==null?void 0:r.background,l,r==null?void 0:r.backgroundVideoPoster,p))),o.jsxs(u.Box,{...a,sx:{...l,...m?{position:"relative",overflow:"hidden",zIndex:0}:{}},className:y.cx(s,(r==null?void 0:r.boxShadow)&&"shadow-xl"),children:[m,n]})}const Be=_.styled(jt)`
133
+ `;function z({title:t,description:e,descriptionMarkdown:n,actions:i,className:r="",classes:s={},prepend:c,append:a,level:l=2,tag:d,badge:u,center:x,logo:h,titleAppearance:p,descriptionAppearance:y,...w}){const g=pt.useColorConvert();if(!t&&!e&&!i&&!u&&!d&&!c&&!a&&!h)return null;const k=Math.max(Math.min(5,l+1),1),v={1:"xl:!text-3xl lg:!text-2xl md:!text-xl",2:"xl:!text-2xl lg:!text-xl md:!text-lg",3:"xl:!text-2xl lg:!text-xl md:!text-lg",4:"xl:!text-xl lg:!text-lg md:!text-md",5:"xl:!text-lg md:!text-md sm:!text-sm",6:"!text-sm"},B=l===0?"big":`h${k}`,N=l===0;return o.jsxs(je,{className:b.cx("base-info","lg:text-left",x&&"!text-center",r),...w,children:[c&&o.jsx("div",{children:c}),(d||u)&&o.jsx("div",{className:b.cx("section__tag",(s==null?void 0:s.tag)||(s==null?void 0:s.badge)),children:d||u}),h&&o.jsx("img",{className:"w-[120px] m-auto mb-8",src:h,alt:"info",loading:"lazy"}),t&&o.jsx(m.Typography,{sx:{whiteSpace:"pre-wrap",mb:e?"2vw":0,...(p==null?void 0:p.color)&&{color:`${g(p.color)} !important`}},className:b.cx("section__title","text-gray-800","dark:text-gray-50",s.title,"page-kit-section__title",N?"":"section__title_non_big"),component:`h${Math.max(l,1)}`,variant:B,children:t}),e&&(n?o.jsx(m.Box,{sx:{...(y==null?void 0:y.color)&&{color:`${g(y.color)} !important`}},component:ye,className:b.cx("section__description","text-gray-800","dark:text-gray-100",v[k],s.description,"page-kit-section__description"),children:e}):o.jsx(m.Typography,{sx:{whiteSpace:"pre-wrap",...(y==null?void 0:y.color)&&{color:`${g(y.color)} !important`}},className:b.cx("section__description","text-gray-800","dark:text-gray-100",v[k],s.description,"page-kit-section__description"),component:"div",variant:"body1",gutterBottom:!0,children:e})),o.jsx(R,{actions:i,center:x,className:"mt-8"}),a&&o.jsx("div",{children:a})]})}const q=["actions","append","badge","tag","center","description","descriptionMarkdown","level","logo","prepend","title","titleAppearance","descriptionAppearance"];function jt(t){if(t.type===f.Fragment){const n=(t.props.children||[]).filter(i=>f.isValidElement(i));return n.length===1?jt(n[0]):n.length>1}return Array.isArray(t)}const I="&>*";function Q({children:t,col:e,gap:n,className:i,align:r,sx:s,type:c,...a}={children:null,className:"",col:3,gap:void 0,sx:{},align:"center",type:"default"}){const l=_.useTheme(),d=Number(Math.floor(100/e*100)/100),u={center:"justify-center items-center",left:"justify-start items-center",right:"justify-end items-center",top:"justify-center items-start",bottom:"justify-center items-end","top-left":"justify-start items-start","top-right":"justify-end items-start","bottom-left":"justify-start items-end","bottom-right":"justify-end items-end"},x=u[r]||u.center;let p=n??({2:6,3:4,4:4,5:3,6:3}[e]||0);jt(t)||(p=0);const w=(e-1)*p/e;let g={...s,gap:`${p}rem`};const k={[I]:{width:"100%"}},v={},B={},N={};switch(k.gap="1rem",v.gap=`${p/2}rem`,e){case 3:case 4:v[I]={width:`calc(50% - ${p/2}rem)`};break;case 5:case 6:k[I]={width:`calc(50% - ${p/2/2}rem)`},v[I]={width:`calc(50% - ${p/2/2}rem)`},B[I]={width:`calc(33.33% - ${p*2/3}rem)`};break}return g[I]={width:`calc(${d}% - ${w}rem)`},g[`@media (max-width: ${l.breakpoints.values.xl}px)`]=N,g[`@media (max-width: ${l.breakpoints.values.lg}px)`]=B,g[`@media (max-width: ${l.breakpoints.values.md}px)`]=v,g[`@media (max-width: ${l.breakpoints.values.sm}px)`]=k,c==="wall"&&(g={...s,gap:`${p}rem`},g[I]={width:`calc(${d}% - ${w}rem)`},k[I]={width:`calc(45% - ${p/2/2}rem)`},g[`@media (max-width: ${l.breakpoints.values.sm}px)`]=k),o.jsx(m.Box,{className:b.cx("flex flex-wrap flex-row h-full",x,i),sx:g,...a,children:t})}function ve(){const t=navigator.userAgent.toLowerCase();return t.includes("safari")&&!t.includes("chrome")}function ke(t=""){if(t.startsWith("data:image/svg+xml,"))return!0;const e=/^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-]([^!@#$%^&*?.\s]{0,63}[^!@#$%^&*?.\s])?\.)+[a-z]{2,6}\/?/,n=/^(\/|\.\/|\.\.\/)(?:[^/]+\/)*[^/]+$/;return e.test(t)||n.test(t)}function Y(t){return(t==null?void 0:t.endsWith(".mp4"))||(t==null?void 0:t.endsWith(".m4v"))||(t==null?void 0:t.endsWith(".webm"))}function _e(t){return t!=null&&t.endsWith(".mp4")||t!=null&&t.endsWith(".m4v")?"video/mp4":t!=null&&t.endsWith(".webm")?"video/webm":void 0}function $e(t){let e={};return typeof t=="string"?it.isGradient(t)?e.image=t:(e.image=j.getImageAbsoluteUrl(t),it.isColorString(t)&&(e.color=t,e.image="")):e=t,e}function Se(){const[t,e]=f.useState(Date.now());return f.useEffect(()=>{const n=()=>{e(Date.now())};return document.addEventListener("visibilitychange",n),()=>{document.removeEventListener("visibilitychange",n)}},[]),t}function lt(t,e,n,i,r){let s=null;const{color:c="",image:a}=$e(e);return a&&ke(a)?(delete n.backgroundColor,!(t.mobile.apple.device||ve())&&Y(a)?s=o.jsx(m.Box,{component:"video",className:"section-bg",width:"100%",autoPlay:!0,loop:!0,muted:!0,controls:!1,playsInline:!0,poster:j.autoResizeImage(j.getImageAbsoluteUrl(i),1200,"quality"),src:Y(a)?a:j.autoResizeImage(a,1200,"quality"),sx:{position:"absolute",zIndex:-9999,right:0,left:0,top:0,width:"100%",height:"100%",objectFit:"cover"}},a):s=o.jsx(G.ResponsiveImage,{src:a,sizesAttr:{sm:600,md:900,lg:1200},className:"section-bg",alt:"",width:"100%",loading:"lazy",sx:{position:"absolute",zIndex:-9999,right:0,left:0,top:0,width:"100%",height:"100%",objectFit:"cover"}},r||a)):a?n.backgroundImage=`${a} !important`:c&&(n.backgroundColor=`${c} !important`),s}function Be({autoWidth:t,children:e,...n}){return t?o.jsx(m.Box,{display:"flex",...n,children:e}):o.jsx(m.Container,{...n,children:e})}function E({dark:t=!1,children:e,className:n,sx:i={},boxed:r={show:!1},padding:s="normal",boxProps:c,type:a,...l}){const d={...i},u=gt.default(p=>p.breakpoints.down("md"));t&&(d.color=at.default.common.white,d.backgroundColor=`${at.default.grey[900]} !important`),r.show&&(d.display="flex");const x=f.useMemo(()=>!Number(l.boxMaxWidth)||u?{width:"100%"}:a==="wall"&&l.boxMaxWidth?{maxWidth:`${l.boxMaxWidth}px !important`,width:"100%"}:{width:"100%"},[l.boxMaxWidth,u,a]),h=bt({type:"baseSectionPaddingY",value:s||"normal",defaultValue:""});return o.jsx(Ce,{component:"section",styles:{...d,...h},className:b.cx("base-section","px-2 md:px-5 lg:px-5 xl:px-10",n,{dark:t}),...C.default(l,"hoverStyle","boxMaxWidth","embedUrl","autoWidth","paddingXY","iframeHeight","titleAppearance","descriptionAppearance"),children:o.jsx(Be,{autoWidth:l==null?void 0:l.autoWidth,className:b.cx("section-content h-full"),sx:x,children:r.show?o.jsx(vt,{...c,boxed:r,children:e}):e})})}function vt({background:t="",backgroundVideoPoster:e,children:n,sx:i={},boxed:r={show:!1},className:s="",styles:c={},...a}){const l={...c,...i},d=pt.useColorConvert();let u=null;const x=gt.default(y=>y.breakpoints.up("sm")),h=te.default(),p=Se();return t&&(u=lt(h,typeof t=="string"?d(t):t,l,e,p)),r.show&&(l.borderRadius="10px",l.padding===void 0&&(l.padding=x?"50px":"20px"),r!=null&&r.border&&(l.border="1px solid #c0c0c0"),r!=null&&r.background&&(u=lt(h,typeof(r==null?void 0:r.background)=="string"?d(r==null?void 0:r.background):r==null?void 0:r.background,l,r==null?void 0:r.backgroundVideoPoster,p))),o.jsxs(m.Box,{...a,sx:{...l,...u?{position:"relative",overflow:"hidden",zIndex:0}:{}},className:b.cx(s,(r==null?void 0:r.boxShadow)&&"shadow-xl"),children:[u,n]})}const Ce=_.styled(vt)`
134
134
  &:nth-of-type(even) {
135
135
  background: #f8f8f8;
136
136
  }
@@ -146,11 +146,11 @@
146
146
  }
147
147
  }
148
148
  }
149
- `;function Z({icon:t,...e}){return o.jsx(ht.Icon,{icon:t,...e,ref:null})}function S(t,e){const n=K.default(t,e),i=C.default(t,e);return[n,i]}const vt=["title","description","actions","badge","tag","prepend","append","logo"];function Ce({image:t,imageBorder:e,imageShadow:n,className:i,reverse:r=!1,fullSizeImage:s,...c}){const[a,l]=S(c,q),d=Object.keys(a).length>0&&Object.values(K.default(a,vt)).filter(Boolean).length>0&&o.jsx(z,{...a}),m=f.isValidElement(t)?t:o.jsx(u.Box,{component:"img",src:t,alt:"",className:"block"}),x=["phone","macbook"].includes(e),h=t&&o.jsx(u.Box,{className:y.cx("section__image","m-auto, leading-[1] text-center",n&&"shadow-xl",a!=null&&a.center?"flex justify-center items-center":""),sx:{border:e===!0?"1px solid #c0c0c0":void 0,borderRadius:2,overflow:"hidden","> div":x?{width:"100%",video:{borderRadius:"0 !important"}}:void 0},children:x?o.jsx(te.default,{type:e,sx:{width:"100%"},children:m}):m});return o.jsx(E,{className:y.cx("section--block",i,s&&!r&&y.css`
149
+ `;function Z({icon:t,...e}){return o.jsx(ht.Icon,{icon:t,...e,ref:null})}function S(t,e){const n=X.default(t,e),i=C.default(t,e);return[n,i]}const kt=["title","description","actions","badge","tag","prepend","append","logo"];function Ne({image:t,imageBorder:e,imageShadow:n,className:i,reverse:r=!1,fullSizeImage:s,...c}){const[a,l]=S(c,q),d=Object.keys(a).length>0&&Object.values(X.default(a,kt)).filter(Boolean).length>0&&o.jsx(z,{...a}),u=f.isValidElement(t)?t:o.jsx(m.Box,{component:"img",src:t,alt:"",className:"block"}),x=["phone","macbook"].includes(e),h=t&&o.jsx(m.Box,{className:b.cx("section__image","m-auto, leading-[1] text-center",n&&"shadow-xl",a!=null&&a.center?"flex justify-center items-center":""),sx:{border:e===!0?"1px solid #c0c0c0":void 0,borderRadius:2,overflow:"hidden","> div":x?{width:"100%",video:{borderRadius:"0 !important"}}:void 0},children:x?o.jsx(ee.default,{type:e,sx:{width:"100%"},children:u}):u});return o.jsx(E,{className:b.cx("section--block",i,s&&!r&&b.css`
150
150
  .section-bg {
151
151
  height: 80%;
152
152
  }
153
- `),...l,boxProps:s?{sx:{padding:0,overflow:"hidden"}}:void 0,children:o.jsx(Q,{col:t?2:1,className:s?y.css`
153
+ `),...l,boxProps:s?{sx:{padding:0,overflow:"hidden"}}:void 0,children:o.jsx(Q,{col:t?2:1,className:s?b.css`
154
154
  display: flex;
155
155
  flex-direction: column;
156
156
 
@@ -163,15 +163,15 @@
163
163
  width: 100%;
164
164
  }
165
165
  }
166
- `:void 0,children:r?o.jsxs(o.Fragment,{children:[h,d]}):o.jsxs(o.Fragment,{children:[d,h]})})})}const L=["editing","height","locale","dev","sx"];function Ne(t){const{className:e,...n}=t;return o.jsx(Ie,{...n,className:y.cx("BlockBase-root",e)})}const Ie=_.styled(u.Box)`
166
+ `:void 0,children:r?o.jsxs(o.Fragment,{children:[h,d]}):o.jsxs(o.Fragment,{children:[d,h]})})})}const L=["editing","height","locale","dev","sx"];function Ie(t){const{className:e,...n}=t;return o.jsx(Pe,{...n,className:b.cx("BlockBase-root",e)})}const Pe=_.styled(m.Box)`
167
167
  position: relative;
168
- `;function Pe({widget:t,reverse:e,projectId:n,assistantId:i,working:r,submitTitle:s,submitIcon:c,submitColor:a,placeholder:l,loadingIndicator:d,section:m,...x}){const[{editing:h},p]=S(x,L),[g,j]=S(p,q),b=n&&i?{projectId:n,gitRef:"main",assistantId:i,working:!0}:void 0,k={children:s,endIcon:c?o.jsx(Z,{icon:c}):void 0,sx:{background:a||void 0,":hover":{background:a||void 0,opacity:.8}}},v=[],B=l&&o.jsx(u.Typography,{variant:"caption",color:"text.disabled",children:l}),N=d&&o.jsx(u.Typography,{variant:"caption",color:"text.disabled",children:d});Object.keys(g).length>0&&Object.values(K.default(g,vt)).filter(Boolean).length>0&&v.push(o.jsx(z,{...g},"base-info")),b&&(t==="form"?v.push(o.jsx(U.AIForm,{identifier:b,SubmitProps:k},"form")):t==="result"?v.push(o.jsx(U.AIFormResult,{identifier:b,placeholder:B,loadingIndicator:N},"result")):v.push(o.jsxs(u.Stack,{width:"100%",gap:2,direction:"row",children:[o.jsx(U.AIForm,{identifier:b,BoxProps:{flex:1},SubmitProps:k}),o.jsx(U.AIFormResult,{identifier:b,BoxProps:{flex:1},placeholder:B,loadingIndicator:N})]},"form-result"))),e&&v.reverse();const ot=u.useTheme(),$t=f.useMemo(()=>u.createTheme(Tt.deepmerge(ot,{palette:{primary:a?{main:a}:void 0}})),[a,ot]);return o.jsx(zt.ErrorBoundary,{fallbackRender:w.ErrorView,children:o.jsx(u.ThemeProvider,{theme:$t,children:o.jsx(E,{...j,sx:h?{pointerEvents:"none"}:{},children:o.jsx(Q,{col:v.length,children:v})})})})}const kt=f.createContext({pages:[],project:void 0}),{Provider:Re,Consumer:Io}=kt;function _t(){return f.useContext(kt)}function Te({icon:t,className:e="",size:n="1rem",...i}){return o.jsx(We,{component:Z,className:y.cx("css-icon",e),size:n,...i,icon:t})}const We=_.styled(u.Box)`
168
+ `;function Re({widget:t,reverse:e,projectId:n,assistantId:i,working:r,submitTitle:s,submitIcon:c,submitColor:a,placeholder:l,loadingIndicator:d,section:u,...x}){const[{editing:h},p]=S(x,L),[y,w]=S(p,q),g=n&&i?{projectId:n,gitRef:"main",assistantId:i,working:!0}:void 0,k={children:s,endIcon:c?o.jsx(Z,{icon:c}):void 0,sx:{background:a||void 0,":hover":{background:a||void 0,opacity:.8}}},v=[],B=l&&o.jsx(m.Typography,{variant:"caption",color:"text.disabled",children:l}),N=d&&o.jsx(m.Typography,{variant:"caption",color:"text.disabled",children:d});Object.keys(y).length>0&&Object.values(X.default(y,kt)).filter(Boolean).length>0&&v.push(o.jsx(z,{...y},"base-info")),g&&(t==="form"?v.push(o.jsx(U.AIForm,{identifier:g,SubmitProps:k},"form")):t==="result"?v.push(o.jsx(U.AIFormResult,{identifier:g,placeholder:B,loadingIndicator:N},"result")):v.push(o.jsxs(m.Stack,{width:"100%",gap:2,direction:"row",children:[o.jsx(U.AIForm,{identifier:g,BoxProps:{flex:1},SubmitProps:k}),o.jsx(U.AIFormResult,{identifier:g,BoxProps:{flex:1},placeholder:B,loadingIndicator:N})]},"form-result"))),e&&v.reverse();const ot=m.useTheme(),St=f.useMemo(()=>m.createTheme(Wt.deepmerge(ot,{palette:{primary:a?{main:a}:void 0}})),[a,ot]);return o.jsx(qt.ErrorBoundary,{fallbackRender:j.ErrorView,children:o.jsx(m.ThemeProvider,{theme:St,children:o.jsx(E,{...w,sx:h?{pointerEvents:"none"}:{},children:o.jsx(Q,{col:v.length,children:v})})})})}const _t=f.createContext({pages:[],project:void 0}),{Provider:Te,Consumer:Po}=_t;function $t(){return f.useContext(_t)}function We({icon:t,className:e="",size:n="1rem",...i}){return o.jsx(ze,{component:Z,className:b.cx("css-icon",e),size:n,...i,icon:t})}const ze=_.styled(m.Box)`
169
169
  &.css-icon {
170
170
  display: inline-block;
171
171
  width: ${({size:t})=>t};
172
172
  height: ${({size:t})=>t};
173
173
  }
174
- `;function ze({icon:t,className:e="",size:n="1rem",imageMeta:i,...r}){const s=w.autoResizeImage(w.getImageAbsoluteUrl(t),540),[c,a]=f.useState(!1),l=_.useTheme();return c?o.jsx(Te,{icon:"i-mdi:image",color:l.palette.grey[500],size:n,className:e,...r}):o.jsx(qe,{className:y.cx("image-icon",e),size:n,...r,children:o.jsx("img",{className:"image-icon__image",src:s,onError:()=>a(!0),width:i==null?void 0:i.naturalWidth,height:i==null?void 0:i.naturalHeight,alt:(i==null?void 0:i.filename)||"card-icon",loading:"lazy"})})}const qe=_.styled(u.Box)`
174
+ `;function qe({icon:t,className:e="",size:n="1rem",imageMeta:i,...r}){const s=j.autoResizeImage(j.getImageAbsoluteUrl(t),540),[c,a]=f.useState(!1),l=_.useTheme();return c?o.jsx(We,{icon:"i-mdi:image",color:l.palette.grey[500],size:n,className:e,...r}):o.jsx(Ee,{className:b.cx("image-icon",e),size:n,...r,children:o.jsx("img",{className:"image-icon__image",src:s,onError:()=>a(!0),width:i==null?void 0:i.naturalWidth,height:i==null?void 0:i.naturalHeight,alt:(i==null?void 0:i.filename)||"card-icon",loading:"lazy"})})}const Ee=_.styled(m.Box)`
175
175
  display: inline-block;
176
176
  width: ${({size:t})=>t};
177
177
  height: ${({size:t})=>t};
@@ -180,9 +180,9 @@
180
180
  height: 100%;
181
181
  width: 100%;
182
182
  }
183
- `,tt=t=>typeof t=="string"&&/^[\w-_]+:[\w-_]+$/.test(t);function G({icon:t,size:e="1rem",imageMeta:n,...i}){const r=window.isNaN(e)?e:`${e}px`;return tt(t)?o.jsx(ht.Icon,{icon:t}):o.jsx(Ee,{component:ze,imageMeta:n,className:"base-icon",icon:t,size:r,...i})}const Ee=_.styled(u.Box)`
183
+ `,tt=t=>typeof t=="string"&&/^[\w-_]+:[\w-_]+$/.test(t);function J({icon:t,size:e="1rem",imageMeta:n,...i}){const r=window.isNaN(e)?e:`${e}px`;return tt(t)?o.jsx(ht.Icon,{icon:t}):o.jsx(Le,{component:qe,imageMeta:n,className:"base-icon",icon:t,size:r,...i})}const Le=_.styled(m.Box)`
184
184
  flex-shrink: 0;
185
- `;function W({text:t,children:e,icon:n="",endIcon:i,color:r="primary",link:s="",href:c="",...a}){const l=n?o.jsx(G,{icon:n}):null,d=i?o.jsx(G,{icon:i}):null,m=s||c,x={...a};return m&&(x.href=m,V.default(m)&&(x.target=x.target||"_blank")),o.jsx(ee.default,{startIcon:l,endIcon:d,color:r,...x,children:t||e})}function et({editing:t,text:e,...n}){const{pages:i=[]}=_t(),r=i.find(s=>s.id===(n.link||n.linkId));if(t)return o.jsx(W,{...C.default(n,["link","linkId"]),children:e});if(r){const s=r.path||"/";return o.jsx(X.Link,{to:s,children:o.jsx(W,{...C.default(n,["link","linkId"]),children:e})})}return o.jsx(W,{...C.default(n,"linkId"),children:e})}function P({type:t="",icon:e="",size:n="3rem",className:i="",...r}){return o.jsx(G,{icon:e||t,size:n,className:y.cx("content-icon",i),...r})}P.propTypes={};P.defaultProps={type:"",icon:"",size:"3rem",color:"inherit",className:""};function Le({to:t,base:e,children:n,className:i,activeClassName:r="active",target:s="auto",autoExternalMark:c=!1,useRouterLink:a,...l}){const{pages:d=[],locale:m=""}={},x=e?O.join("/",e):e||"";let h=s==="auto"?"_self":s,p=O.join(x,t);const g=c?V.default(p):!1;if(e)return p=O.join(x,m,t),o.jsx("a",{className:`no-underline ${i}`,href:T.withoutTrailingSlash(p),rel:"noreferrer noopener",target:h,...l,children:n});if(V.default(t))s==="auto"&&(h="_blank"),p=t;else{T.isRelative(p)&&(p=O.join(window.location.pathname,p));const j=T.parseURL(`${window.location.origin}${p}`),b=d.some(k=>k.pathname===j.pathname);if(a||b)return o.jsx(X.NavLink,{end:!0,to:T.withoutTrailingSlash(p),className:({isActive:k})=>y.cx(i,k?r:""),...l,children:n})}return o.jsxs("a",{className:`no-underline ${i}`,href:T.withoutTrailingSlash(p),rel:"noreferrer noopener",target:h,...l,children:[n,g&&o.jsx(P,{icon:"i-mdi:arrow-top-right",size:"0.9em",className:"smart-link__mark",style:{marginLeft:5}})]})}function A({prepend:t,append:e,children:n,className:i="",dark:r=!1,border:s=!0,...c}){let a={};const{pages:l=[]}=_t(),d=l.find(h=>h.id===c.link),m=!n||ft.default.Children.toArray(n).every(h=>h===null);c.link&&(a={component:Le,to:(d==null?void 0:d.path)||c.link,useRouterLink:!0});const x=r&&s;return o.jsxs(Ae,{className:y.cx("base-card card",{"border-gray-200":s},{"dark:border-gray-500":x},{dark:r,"border-transparent":!s},i),...a,...C.default(c,["listType","dark","iconColor","link","hoverStyle","imageSize"]),children:[t,!m&&o.jsx("div",{className:"card__body",children:n}),e]})}const Ae=_.styled(u.Box)`
185
+ `;function W({text:t,children:e,icon:n="",endIcon:i,color:r="primary",link:s="",href:c="",...a}){const l=n?o.jsx(J,{icon:n}):null,d=i?o.jsx(J,{icon:i}):null,u=s||c,x={...a};return u&&(x.href=u,H.default(u)&&(x.target=x.target||"_blank")),o.jsx(oe.default,{startIcon:l,endIcon:d,color:r,...x,children:t||e})}function et({editing:t,text:e,...n}){const{pages:i=[]}=$t(),r=i.find(s=>s.id===(n.link||n.linkId));if(t)return o.jsx(W,{...C.default(n,["link","linkId"]),children:e});if(r){const s=r.path||"/";return o.jsx(K.Link,{to:s,children:o.jsx(W,{...C.default(n,["link","linkId"]),children:e})})}return o.jsx(W,{...C.default(n,"linkId"),children:e})}function P({type:t="",icon:e="",size:n="3rem",className:i="",...r}){return o.jsx(J,{icon:e||t,size:n,className:b.cx("content-icon",i),...r})}P.propTypes={};P.defaultProps={type:"",icon:"",size:"3rem",color:"inherit",className:""};function Ae({to:t,base:e,children:n,className:i,activeClassName:r="active",target:s="auto",autoExternalMark:c=!1,useRouterLink:a,...l}){const{pages:d=[],locale:u=""}={},x=e?F.join("/",e):e||"";let h=s==="auto"?"_self":s,p=F.join(x,t);const y=c?H.default(p):!1;if(e)return p=F.join(x,u,t),o.jsx("a",{className:`no-underline ${i}`,href:T.withoutTrailingSlash(p),rel:"noreferrer noopener",target:h,...l,children:n});if(H.default(t))s==="auto"&&(h="_blank"),p=t;else{T.isRelative(p)&&(p=F.join(window.location.pathname,p));const w=T.parseURL(`${window.location.origin}${p}`),g=d.some(k=>k.pathname===w.pathname);if(a||g)return o.jsx(K.NavLink,{end:!0,to:T.withoutTrailingSlash(p),className:({isActive:k})=>b.cx(i,k?r:""),...l,children:n})}return o.jsxs("a",{className:`no-underline ${i}`,href:T.withoutTrailingSlash(p),rel:"noreferrer noopener",target:h,...l,children:[n,y&&o.jsx(P,{icon:"i-mdi:arrow-top-right",size:"0.9em",className:"smart-link__mark",style:{marginLeft:5}})]})}function A({prepend:t,append:e,children:n,className:i="",dark:r=!1,border:s=!0,...c}){let a={};const{pages:l=[]}=$t(),d=l.find(h=>h.id===c.link),u=!n||ft.default.Children.toArray(n).every(h=>h===null);c.link&&(a={component:Ae,to:(d==null?void 0:d.path)||c.link,useRouterLink:!0});const x=r&&s;return o.jsxs(Oe,{className:b.cx("base-card card",{"border-gray-200":s},{"dark:border-gray-500":x},{dark:r,"border-transparent":!s},i),...a,...C.default(c,["listType","dark","iconColor","link","hoverStyle","imageSize"]),children:[t,!u&&o.jsx("div",{className:"card__body",children:n}),e]})}const Oe=_.styled(m.Box)`
186
186
  &.base-card {
187
187
  text-align: left;
188
188
  border-width: 1px;
@@ -197,7 +197,7 @@
197
197
  .card__body {
198
198
  padding: 15px 15px;
199
199
  }
200
- `;function F({align:t="left",title:e,titleProps:n={},description:i,descriptionProps:r={}}){return o.jsxs(o.Fragment,{children:[e&&o.jsx(u.Typography,{className:y.cx("card__title text-gray-800","dark:text-gray-50"),component:"h5",variant:"h5",gutterBottom:!0,align:t,...n,children:e}),i&&o.jsx(u.Typography,{className:y.cx("card__description","text-gray-500","dark:text-gray-400"),component:"div",variant:"body1",gutterBottom:!0,align:t,...r,children:i})]})}function Fe({image:t,title:e,description:n,imageProps:i={},imageMeta:r,imageSize:s,titleProps:c={},descriptionProps:a={},actions:l,align:d,...m}){const x=tt(t),h=w.autoResizeImage(w.getImageAbsoluteUrl(t),540);return o.jsxs(Ue,{className:"card-article",...m,prepend:o.jsx("div",{className:"card__image__wrap",children:x&&t?o.jsx(u.Box,{sx:{position:"absolute",left:0,top:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"},children:o.jsx(P,{icon:t,color:"primary.main"})}):h&&o.jsx("img",{className:"card__image",src:h,...i,alt:i.alt||(r==null?void 0:r.filename)||"card-image",width:r==null?void 0:r.naturalWidth,height:r==null?void 0:r.naturalHeight,style:{width:"100%",height:"100%",objectFit:s||"cover",objectPosition:"center"},loading:"lazy"})}),children:[e||n?o.jsx(F,{align:d,title:e,titleProps:c,description:n,descriptionProps:a}):null,l!=null&&l.length?o.jsx(R,{align:d,actions:l,className:"mt-4"}):null]})}const Ue=_.styled(A)`
200
+ `;function O({align:t="left",title:e,titleProps:n={},description:i,descriptionProps:r={}}){return o.jsxs(o.Fragment,{children:[e&&o.jsx(m.Typography,{className:b.cx("card__title text-gray-800","dark:text-gray-50"),component:"h5",variant:"h5",gutterBottom:!0,align:t,...n,children:e}),i&&o.jsx(m.Typography,{className:b.cx("card__description","text-gray-500","dark:text-gray-400"),component:"div",variant:"body1",gutterBottom:!0,align:t,...r,children:i})]})}function Ue({image:t,title:e,description:n,imageProps:i={},imageMeta:r,imageSize:s,titleProps:c={},descriptionProps:a={},actions:l,align:d,...u}){const x=tt(t),h=j.autoResizeImage(j.getImageAbsoluteUrl(t),540);return o.jsxs(Fe,{className:"card-article",...u,prepend:o.jsx("div",{className:"card__image__wrap",children:x&&t?o.jsx(m.Box,{sx:{position:"absolute",left:0,top:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"},children:o.jsx(P,{icon:t,color:"primary.main"})}):h&&o.jsx("img",{className:"card__image",src:h,...i,alt:i.alt||(r==null?void 0:r.filename)||"card-image",width:r==null?void 0:r.naturalWidth,height:r==null?void 0:r.naturalHeight,style:{width:"100%",height:"100%",objectFit:s||"cover",objectPosition:"center"},loading:"lazy"})}),children:[e||n?o.jsx(O,{align:d,title:e,titleProps:c,description:n,descriptionProps:a}):null,l!=null&&l.length?o.jsx(R,{align:d,actions:l,className:"mt-4"}):null]})}const Fe=_.styled(A)`
201
201
  ${t=>t.hoverStyle==="none"?"":t.link?`transition: box-shadow ease .3s;
202
202
  &:hover {
203
203
  box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
@@ -218,7 +218,7 @@
218
218
  height: 100%;
219
219
  object-position: top center;
220
220
  }
221
- `,ct="section";function dt({title:t,image:e,imageMeta:n,description:i,actions:r,align:s,listType:c="",className:a="",...l}){return o.jsxs(Oe,{className:y.cx("card",`list-type-${c}`,a),align:s,...l,children:[e&&o.jsx(P,{icon:e,color:"primary.main",size:c==="icon-title"?"1.2rem":"3rem",imageMeta:n}),t||i?o.jsx(F,{align:s,title:t,description:i}):null,r!=null&&r.length?o.jsx(R,{align:s,actions:r,className:"mt-4"}):null]})}const Oe=_.styled(A)`
221
+ `,ct="section";function dt({title:t,image:e,imageMeta:n,description:i,actions:r,align:s,listType:c="",className:a="",...l}){return o.jsxs(Me,{className:b.cx("card",`list-type-${c}`,a),align:s,...l,children:[e&&o.jsx(P,{icon:e,color:"primary.main",size:c==="icon-title"?"1.2rem":"3rem",imageMeta:n}),t||i?o.jsx(O,{align:s,title:t,description:i}):null,r!=null&&r.length?o.jsx(R,{align:s,actions:r,className:"mt-4"}):null]})}const Me=_.styled(A)`
222
222
  padding: 5vw 4vw;
223
223
  box-sizing: border-box;
224
224
  /* min-height: 320px; */
@@ -275,7 +275,7 @@
275
275
  text-align: left;
276
276
  box-sizing: border-box;
277
277
  }
278
- `;function De({image:t,title:e,description:n,imageProps:i={},imageMeta:r,imageSize:s,titleProps:c={},descriptionProps:a={},actions:l,align:d,...m}){const x=tt(t),h=w.autoResizeImage(w.getImageAbsoluteUrl(t),540);return o.jsxs(Me,{className:"card-article",...m,prepend:o.jsx("div",{className:"card__image__wrap",children:x&&t?o.jsx(u.Box,{sx:{position:"absolute",left:0,top:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"},children:o.jsx(P,{icon:t,color:"primary.main"})}):h&&o.jsx(u.Box,{component:"img",className:"card__image",src:h,...i,alt:i.alt||(r==null?void 0:r.filename)||"card-image",width:r==null?void 0:r.naturalWidth,height:r==null?void 0:r.naturalHeight,style:{width:"100%",height:"100%",objectFit:s||"contain",objectPosition:"center"},loading:"lazy"})}),children:[e||n?o.jsx(F,{align:d,title:e,titleProps:c,description:n,descriptionProps:a}):null,l!=null&&l.length?o.jsx(R,{align:d,actions:l,className:"mt-4"}):null]})}const Me=_.styled(A)`
278
+ `;function De({image:t,title:e,description:n,imageProps:i={},imageMeta:r,imageSize:s,titleProps:c={},descriptionProps:a={},actions:l,align:d,...u}){const x=tt(t),h=j.autoResizeImage(j.getImageAbsoluteUrl(t),540);return o.jsxs(Ve,{className:"card-article",...u,prepend:o.jsx("div",{className:"card__image__wrap",children:x&&t?o.jsx(m.Box,{sx:{position:"absolute",left:0,top:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"},children:o.jsx(P,{icon:t,color:"primary.main"})}):h&&o.jsx(m.Box,{component:"img",className:"card__image",src:h,...i,alt:i.alt||(r==null?void 0:r.filename)||"card-image",width:r==null?void 0:r.naturalWidth,height:r==null?void 0:r.naturalHeight,style:{width:"100%",height:"100%",objectFit:s||"contain",objectPosition:"center"},loading:"lazy"})}),children:[e||n?o.jsx(O,{align:d,title:e,titleProps:c,description:n,descriptionProps:a}):null,l!=null&&l.length?o.jsx(R,{align:d,actions:l,className:"mt-4"}):null]})}const Ve=_.styled(A)`
279
279
  ${t=>t.hoverStyle==="none"?"":t.link?`transition: box-shadow ease .3s;
280
280
  &:hover {
281
281
  box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
@@ -299,7 +299,7 @@
299
299
  .card__image {
300
300
  max-height: 60px;
301
301
  }
302
- `,ut="section";function He({title:t,image:e,imageMeta:n,iconSize:i=100,description:r,actions:s,align:c,className:a="",...l}){return o.jsx(Ve,{className:y.cx("card",a),...l,children:o.jsxs(u.Box,{className:"flex items-center",children:[e&&o.jsx(P,{icon:e,color:"primary.main",size:i,imageMeta:n}),o.jsxs(u.Box,{className:"flex-1 ml-4",children:[o.jsx(F,{align:c,title:t,description:r}),o.jsx(R,{align:c,actions:s,className:"mt-4"})]})]})})}const Ve=_.styled(A)`
302
+ `,ut="section";function He({title:t,image:e,imageMeta:n,iconSize:i=100,description:r,actions:s,align:c,className:a="",...l}){return o.jsx(Ye,{className:b.cx("card",a),...l,children:o.jsxs(m.Box,{className:"flex items-center",children:[e&&o.jsx(P,{icon:e,color:"primary.main",size:i,imageMeta:n}),o.jsxs(m.Box,{className:"flex-1 ml-4",children:[o.jsx(O,{align:c,title:t,description:r}),o.jsx(R,{align:c,actions:s,className:"mt-4"})]})]})})}const Ye=_.styled(A)`
303
303
  padding: 5vw 4vw;
304
304
  text-align: left;
305
305
  box-sizing: border-box;
@@ -355,7 +355,7 @@
355
355
  text-align: left;
356
356
  box-sizing: border-box;
357
357
  }
358
- `;function Ye({title:t,titleProps:e={},description:n,descriptionProps:i={},image:r,imageMeta:s,className:c="",align:a,hoverStyle:l,...d}){return o.jsxs(Ge,{className:y.cx("card-simple",c,`hover-style__${l}`),align:a,...d,children:[r&&o.jsx(P,{icon:r,color:"primary.main",imageMeta:s}),t||n?o.jsx(F,{align:a,title:t,titleProps:e,description:n,descriptionProps:i}):null]})}const Ge=_.styled(A)`
358
+ `;function Je({title:t,titleProps:e={},description:n,descriptionProps:i={},image:r,imageMeta:s,className:c="",align:a,hoverStyle:l,...d}){return o.jsxs(Ge,{className:b.cx("card-simple",c,`hover-style__${l}`),align:a,...d,children:[r&&o.jsx(P,{icon:r,color:"primary.main",imageMeta:s}),t||n?o.jsx(O,{align:a,title:t,titleProps:e,description:n,descriptionProps:i}):null]})}const Ge=_.styled(A)`
359
359
  ${({dark:t,theme:e})=>`background-color:${t?e.palette.grey[900]:e.palette.common.white};`}
360
360
 
361
361
  &.hover-style__default {
@@ -440,7 +440,7 @@
440
440
  }
441
441
  }
442
442
  }
443
- `;function Je({type:t="default",...e}){const i={article:Fe,simple:Ye,news:He,default:dt,wall:De}[t]||dt;return o.jsx(i,{...t==="news"?e:C.default(e,"iconSize")})}function Xe({list:t=[],align:e="top",cards:n,listBorder:i=!0,listType:r="",col:s=3,gap:c,iconColor:a,className:l="",type:d="default",dark:m=!1,textAlign:x="left",hoverStyle:h,...p}){return o.jsx(Q,{type:d,className:y.cx("card-list py-1",l,"items-stretch"),col:s,gap:c,align:e,...p,children:n||t.map(g=>o.jsx(Je,{borderColor:i,iconColor:a,type:d,listType:r,dark:m,...g,align:x,sx:{bgcolor:d==="wall"?void 0:m?"grey.900":"common.white"},style:c===0&&t.length>1?{borderRadius:0,marginRight:"-1px",marginBottom:"-1px"}:{}},g.id))})}const Ke=["align","cards","list","listBorder","listType","col","gap","iconColor","type","textAlign"],Qe=_.styled(E)`
443
+ `;function Ke({type:t="default",...e}){const i={article:Ue,simple:Je,news:He,default:dt,wall:De}[t]||dt;return o.jsx(i,{...t==="news"?e:C.default(e,"iconSize")})}function Xe({list:t=[],align:e="top",cards:n,listBorder:i=!0,listType:r="",col:s=3,gap:c,iconColor:a,className:l="",type:d="default",dark:u=!1,textAlign:x="left",hoverStyle:h,...p}){return o.jsx(Q,{type:d,className:b.cx("card-list py-1",l,"items-stretch"),col:s,gap:c,align:e,...p,children:n||t.map(y=>o.jsx(Ke,{borderColor:i,iconColor:a,type:d,listType:r,dark:u,...y,align:x,sx:{bgcolor:d==="wall"?void 0:u?"grey.900":"common.white"},style:c===0&&t.length>1?{borderRadius:0,marginRight:"-1px",marginBottom:"-1px"}:{}},y.id))})}const Qe=["align","cards","list","listBorder","listType","col","gap","iconColor","type","textAlign"],Ze=_.styled(E)`
444
444
  a .card {
445
445
  color: #404040;
446
446
  cursor: pointer;
@@ -455,7 +455,7 @@
455
455
  a:hover .card {
456
456
  color: #404040;
457
457
  }
458
- `;function Ze({className:t,...e}){const[n,i]=S(e,q),[r,s]=S(i,Ke);return o.jsxs(Qe,{className:y.cx("section--card-list",t),type:e.type,...s,children:[Object.keys(n).length>0&&o.jsx(z,{center:!0,...n,className:"mb-[2.5vw]"}),o.jsx(Xe,{...r,dark:!!e.dark})]})}const to=_.styled(Ze)`
458
+ `;function to({className:t,...e}){const[n,i]=S(e,q),[r,s]=S(i,Qe);return o.jsxs(Ze,{className:b.cx("section--card-list",t),type:e.type,...s,children:[Object.keys(n).length>0&&o.jsx(z,{center:!0,...n,className:"mb-[2.5vw]"}),o.jsx(Xe,{...r,dark:!!e.dark})]})}const eo=_.styled(to)`
459
459
  .card__description {
460
460
  white-space: pre-wrap;
461
461
  }
@@ -470,21 +470,21 @@
470
470
  .card-simple .card__body::after {
471
471
  background: inherit !important;
472
472
  }
473
- `;function eo({section:t,...e}){const[{editing:n},i]=S(e,L),r=f.useMemo(()=>{var s;return{...C.default(i,["listBorder","list","iconSize","imageSize"]),list:(s=i.list)==null?void 0:s.map(c=>{var a,l;return{...C.default(c,"icon","iconColor"),image:["news","simple","default"].includes(i.type)&&c.icon?c.icon:c.image,actions:(l=(a=c.actions)==null?void 0:a.map)==null?void 0:l.call(a,d=>o.jsx(et,{...d,editing:n},d.id)),border:i.listBorder,iconSize:i.iconSize,imageSize:i.imageSize,hoverStyle:i.hoverStyle}})}},[i]);return o.jsx(to,{style:n?{pointerEvents:"none"}:{},...r})}function oo({properties:t,section:e,locale:n,dev:i}){var r;return(r=e==null?void 0:e.config)!=null&&r.componentId?o.jsx(J.CustomComponentRenderer,{instanceId:e.id,componentId:e.config.componentId,blockletId:e.config.blockletId,blockletTitle:e.config.blockletTitle,componentName:e.config.componentName,locale:n,properties:t,dev:i}):o.jsx(u.Box,{textAlign:"center",py:2,children:o.jsx(u.Typography,{variant:"caption",color:"text.secondary",children:"Please select component to render"})})}function no({src:t,dataId:e,isEdit:n=!1,height:i="100%",onLoad:r=()=>{}}){return o.jsx(Jt.EmbedIframe,{isEdit:n,embedId:e,src:t,height:i,onLoad:()=>{r()}})}function ro({dataId:t,src:e,actions:n,center:i,onLoad:r,...s}){const[c,a]=S(s,q);return o.jsxs(E,{...a,children:[Object.keys(c).length>0&&o.jsx(z,{center:i,...c}),o.jsx(no,{dataId:t,src:e,onLoad:r,height:s.iframeHeight?`${s.iframeHeight}px`:"100%"}),o.jsx(R,{actions:n,center:i})]})}const io={src:"",embedUrl:"",title:"",description:"",dark:!1,background:"",center:!0,config:{},id:""};function so({section:t,id:e,src:n,...i}){const r=`${e}-${i.locale}`,[{editing:s},c]=S(i,L),a=f.useRef({}),l=JSON.parse(JSON.stringify(c)),{message:d}=Vt.useMessage(r,"server"),m=Yt.useLatest(JSON.parse(JSON.stringify(c.config)||"{}"));return f.useEffect(()=>{d&&d.onInit(()=>m.current)},[d]),f.useEffect(()=>{const x=JSON.parse(JSON.stringify(c.config)||"{}");oe.default(a.current,x)||(a.current=x,d==null||d.send("config-set",x))},[d,c.config]),n?o.jsx(ro,{...l,dataId:r,src:n,style:s?{pointerEvents:"none"}:{}}):o.jsx(ao,{children:'Please set the "src" attribute for this block'})}const ao=_.styled("div")`
473
+ `;function oo({section:t,...e}){const[{editing:n},i]=S(e,L),r=f.useMemo(()=>{var s;return{...C.default(i,["listBorder","list","iconSize","imageSize"]),list:(s=i.list)==null?void 0:s.map(c=>{var a,l;return{...C.default(c,"icon","iconColor"),image:["news","simple","default"].includes(i.type)&&c.icon?c.icon:c.image,actions:(l=(a=c.actions)==null?void 0:a.map)==null?void 0:l.call(a,d=>o.jsx(et,{...d,editing:n},d.id)),border:i.listBorder,iconSize:i.iconSize,imageSize:i.imageSize,hoverStyle:i.hoverStyle}})}},[i]);return o.jsx(eo,{style:n?{pointerEvents:"none"}:{},...r})}function no({properties:t,section:e,locale:n,dev:i}){var r;return(r=e==null?void 0:e.config)!=null&&r.componentId?o.jsx(G.CustomComponentRenderer,{instanceId:e.id,componentId:e.config.componentId,blockletId:e.config.blockletId,blockletTitle:e.config.blockletTitle,componentName:e.config.componentName,locale:n,properties:t,dev:i}):o.jsx(m.Box,{textAlign:"center",py:2,children:o.jsx(m.Typography,{variant:"caption",color:"text.secondary",children:"Please select component to render"})})}function ro({src:t,dataId:e,isEdit:n=!1,height:i="100%",onLoad:r=()=>{}}){return o.jsx(Kt.EmbedIframe,{isEdit:n,embedId:e,src:t,height:i,onLoad:()=>{r()}})}function io({dataId:t,src:e,actions:n,center:i,onLoad:r,...s}){const[c,a]=S(s,q);return o.jsxs(E,{...a,children:[Object.keys(c).length>0&&o.jsx(z,{center:i,...c}),o.jsx(ro,{dataId:t,src:e,onLoad:r,height:s.iframeHeight?`${s.iframeHeight}px`:"100%"}),o.jsx(R,{actions:n,center:i})]})}const so={src:"",embedUrl:"",title:"",description:"",dark:!1,background:"",center:!0,config:{},id:""};function ao({section:t,id:e,src:n,...i}){const r=`${e}-${i.locale}`,[{editing:s},c]=S(i,L),a=f.useRef({}),l=JSON.parse(JSON.stringify(c)),{message:d}=Yt.useMessage(r,"server"),u=Jt.useLatest(JSON.parse(JSON.stringify(c.config)||"{}"));return f.useEffect(()=>{d&&d.onInit(()=>u.current)},[d]),f.useEffect(()=>{const x=JSON.parse(JSON.stringify(c.config)||"{}");ne.default(a.current,x)||(a.current=x,d==null||d.send("config-set",x))},[d,c.config]),n?o.jsx(io,{...l,dataId:r,src:n,style:s?{pointerEvents:"none"}:{}}):o.jsx(lo,{children:'Please set the "src" attribute for this block'})}const lo=_.styled("div")`
474
474
  user-select: none;
475
475
  color: #999;
476
476
  padding: 8px;
477
477
  height: 200px;
478
- `,lo=[/youtu\.be\/([^#&?]{11})/,/\?v=([^#&?]{11})/,/&v=([^#&?]{11})/,/embed\/([^#&?]{11})/,/\/v\/([^#&?]{11})/];function co(t){var e;if(/youtu\.?be/.test(t))for(const n of lo){const i=(e=n.exec(t))==null?void 0:e[1];if(i)return i}}function uo(t){const e=co(t);if(e)return`https://youtube.com/embed/${e}`}function mo({src:t}){return f.useEffect(()=>{import("@lottiefiles/lottie-player")},[]),o.jsx("lottie-player",{autoplay:!0,loop:!0,mode:"normal",src:t})}function xo(t){return o.jsx(u.Box,{maxHeight:400,overflow:"hidden auto",children:o.jsx(Xt.TwitterTimelineEmbed,{...t})})}function po({url:t}){const e=f.useRef(null),n=495,[i,r]=f.useState(e.current?e.current.offsetWidth*.5625:n),s=f.useCallback(()=>{const c=window.innerWidth>990?1:window.innerWidth>522?1.2:window.innerWidth>400?1.45:1.85,a=e.current?e.current.offsetWidth*.5625:n;return r(Math.floor(a*c))},[]);return f.useEffect(()=>{window.addEventListener("resize",s);const c=window.innerWidth>990?1:window.innerWidth>522?1.2:window.innerWidth>400?1.45:1.85,a=e.current?e.current.offsetWidth*.5625:n;return r(Math.floor(a*c)),function(){window.removeEventListener("resize",s)}},[i,s]),o.jsx(u.Box,{component:"iframe",ref:e,title:"youtube",width:"100%",height:`${i}px`,src:t,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,sx:{display:"block"}})}const ho={image:"https://www.arcblock.io/static/ead0cabde7f2b7ff34db8f3e8ceca271/afc4b/builder.png",badge:"Develop · Deploy · Run",title:"The Future is Here: Blockchain and Decentralized Application Development",description:"ArcBlock, your exclusive new decentralized development platform, makes developing decentralized applications, blockchain, and distributed ledger technology straightforward.",reverse:!1,dark:!1,background:"",actions:void 0,hasImage:!0,center:!1},fo=_.styled(Ce)`
478
+ `,co=[/youtu\.be\/([^#&?]{11})/,/\?v=([^#&?]{11})/,/&v=([^#&?]{11})/,/embed\/([^#&?]{11})/,/\/v\/([^#&?]{11})/];function uo(t){var e;if(/youtu\.?be/.test(t))for(const n of co){const i=(e=n.exec(t))==null?void 0:e[1];if(i)return i}}function mo(t){const e=uo(t);if(e)return`https://youtube.com/embed/${e}`}function xo({src:t}){return f.useEffect(()=>{import("@lottiefiles/lottie-player")},[]),o.jsx("lottie-player",{autoplay:!0,loop:!0,mode:"normal",src:t})}function po(t){return o.jsx(m.Box,{maxHeight:400,overflow:"hidden auto",children:o.jsx(Xt.TwitterTimelineEmbed,{...t})})}function ho({url:t}){const e=f.useRef(null),n=495,[i,r]=f.useState(e.current?e.current.offsetWidth*.5625:n),s=f.useCallback(()=>{const c=window.innerWidth>990?1:window.innerWidth>522?1.2:window.innerWidth>400?1.45:1.85,a=e.current?e.current.offsetWidth*.5625:n;return r(Math.floor(a*c))},[]);return f.useEffect(()=>{window.addEventListener("resize",s);const c=window.innerWidth>990?1:window.innerWidth>522?1.2:window.innerWidth>400?1.45:1.85,a=e.current?e.current.offsetWidth*.5625:n;return r(Math.floor(a*c)),function(){window.removeEventListener("resize",s)}},[i,s]),o.jsx(m.Box,{component:"iframe",ref:e,title:"youtube",width:"100%",height:`${i}px`,src:t,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,sx:{display:"block"}})}const fo={image:"https://www.arcblock.io/static/ead0cabde7f2b7ff34db8f3e8ceca271/afc4b/builder.png",badge:"Develop · Deploy · Run",title:"The Future is Here: Blockchain and Decentralized Application Development",description:"ArcBlock, your exclusive new decentralized development platform, makes developing decentralized applications, blockchain, and distributed ledger technology straightforward.",reverse:!1,dark:!1,background:"",actions:void 0,hasImage:!0,center:!1},go=_.styled(Ne)`
479
479
  .section__description {
480
480
  }
481
- `;function go({hasImage:t,fullSizeImage:e,boxed:n,videoPoster:i,imageMeta:r,imageOptimization:s,imageSize:c,section:a,...l}){var p,g;const[{editing:d},m]=S({...l,boxed:e?void 0:n},L);let x=bo(m.image,i,e,r,s,c);t||(x=null);let h=null;return m.actions&&(h=(g=(p=m.actions)==null?void 0:p.map)==null?void 0:g.call(p,(j,b)=>o.jsx(et,{...j,editing:d},b))),o.jsx(fo,{...m,style:d?{pointerEvents:"none"}:{},image:x,fullSizeImage:t&&e,actions:h})}function bo(t,e,n,i,r,s){if(t){if(t.endsWith(".json"))return o.jsx(mo,{src:t});if(t.indexOf("twitter.com")!==-1)return o.jsx(xo,{sourceType:"url",url:t});const c=uo(t);if(c)return o.jsx(po,{url:c});const{naturalWidth:a,naturalHeight:l,filename:d}=i||{};if(Y(t))return o.jsx("video",{width:a&&`${a}px`,height:l&&`${l}px`,controls:!0,autoPlay:!0,muted:!0,style:{display:"block",objectFit:s||"contain",borderRadius:"8px",width:"100%",height:"100%"},poster:w.autoResizeImage(w.getImageAbsoluteUrl(e),n?1200:540,r),children:o.jsx("source",{src:w.getImageAbsoluteUrl(t),type:ke(t)})},t);const m=r==="quality"?1:.6;return o.jsx(J.ResponsiveImage,{src:w.getImageAbsoluteUrl(t),sizesAttr:{sm:600*m,md:450*m,lg:540*m,...n&&{md:900*m,lg:1200*m}},width:a&&`${a}px`,height:l&&`${l}px`,alt:d??t,style:{objectFit:s||"contain",display:"block",width:"100%",height:"100%"},loading:"lazy"})}return null}const yo=["production","draft"];function wo({mode:t,version:e}={}){const n=e&&typeof e=="number"?{mode:t,version:e}:{mode:t};return w.api.get(`/api/${w.getProjectIdFromPathnameOrWindow()}/pages`,{params:n}).then(i=>i.data)}function jo({mode:t,pages:e}){return w.api.post(`/api/${w.getProjectIdFromPathnameOrWindow()}/pages/publish`,{mode:t,pages:e}).then(n=>n.data)}function vo({locale:t,sort:e,page:n,limit:i,mode:r}={}){return w.api.get(`/api/${w.getProjectIdFromPathnameOrWindow()}/pages/toc`,{params:{locale:t,sort:e,page:n,limit:i,mode:r}}).then(s=>s.data)}const ko={style:"list",sort:"-updatedAt"},mt=20;function _o({style:t,sort:e,section:n,...i}){const[{editing:r,locale:s},c]=S(i,L),[a,l]=S(c,q),[d,m]=f.useState(),x=f.useRef(!1),h=st.useUpdate(),p=X.useNavigate(),g=f.useCallback(async()=>{if(!x.current){x.current=!0,h();try{const j=d?Math.floor(d.list.length/mt)+1:1,{list:b,total:k}=await vo({locale:s,sort:e,page:j,limit:mt});m(v=>({list:((v==null?void 0:v.list)??[]).concat(b),total:k}))}finally{x.current=!1,h()}}},[d,s,e,h]);return st.useMount(()=>{g()}),o.jsxs(E,{...l,sx:r?{pointerEvents:"none"}:{},children:[Object.keys(a).length>0&&o.jsx(z,{...a}),d?o.jsxs(o.Fragment,{children:[o.jsx(u.Grid,{container:!0,spacing:2,justifyContent:"center",children:d==null?void 0:d.list.map(j=>o.jsx(u.Grid,{item:!0,xs:12,sm:t==="card"?6:12,md:t==="card"?3:12,children:o.jsxs($o,{elevation:0,className:y.cx(t==="card"&&"style-card"),onClick:r?void 0:()=>p(j.slug),children:[!!j.image&&o.jsx(u.CardMedia,{component:"img",alt:"",image:w.autoResizeImage(w.getImageAbsoluteUrl(j.image),540),loading:"lazy"}),o.jsxs(u.CardContent,{children:[o.jsx(u.Typography,{variant:"h6",component:"div",className:xt,children:j.title||j.id}),o.jsx(u.Typography,{variant:"body2",className:xt,children:j.description})]})]})},j.id))}),o.jsx(u.Box,{textAlign:"center",mt:2,children:d.total>d.list.length?o.jsx(W,{variant:"outlined",color:"secondary",onClick:g,loading:x.current,children:"More"}):o.jsx(W,{variant:"outlined",color:"secondary",disabled:!0,children:"No More"})})]}):o.jsx(u.Box,{p:2,textAlign:"center",children:o.jsx(u.CircularProgress,{size:24})})]})}const xt=y.css`
481
+ `;function yo({hasImage:t,fullSizeImage:e,boxed:n,videoPoster:i,imageMeta:r,imageOptimization:s,imageSize:c,section:a,...l}){var p,y;const[{editing:d},u]=S({...l,boxed:e?void 0:n},L);let x=bo(u.image,i,e,r,s,c);t||(x=null);let h=null;return u.actions&&(h=(y=(p=u.actions)==null?void 0:p.map)==null?void 0:y.call(p,(w,g)=>o.jsx(et,{...w,editing:d},g))),o.jsx(go,{...u,style:d?{pointerEvents:"none"}:{},image:x,fullSizeImage:t&&e,actions:h})}function bo(t,e,n,i,r,s){if(t){if(t.endsWith(".json"))return o.jsx(xo,{src:t});if(t.indexOf("twitter.com")!==-1)return o.jsx(po,{sourceType:"url",url:t});const c=mo(t);if(c)return o.jsx(ho,{url:c});const{naturalWidth:a,naturalHeight:l,filename:d}=i||{};if(Y(t))return o.jsx("video",{width:a&&`${a}px`,height:l&&`${l}px`,controls:!0,autoPlay:!0,muted:!0,style:{display:"block",objectFit:s||"contain",borderRadius:"8px",width:"100%",height:"100%"},poster:j.autoResizeImage(j.getImageAbsoluteUrl(e),n?1200:540,r),children:o.jsx("source",{src:j.getImageAbsoluteUrl(t),type:_e(t)})},t);const u=r==="quality"?1:.6;return o.jsx(G.ResponsiveImage,{src:j.getImageAbsoluteUrl(t),sizesAttr:{sm:600*u,md:450*u,lg:540*u,...n&&{md:900*u,lg:1200*u}},width:a&&`${a}px`,height:l&&`${l}px`,alt:d??t,style:{objectFit:s||"contain",display:"block",width:"100%",height:"100%"},loading:"lazy"})}return null}const wo=["production","draft"];function jo({mode:t,version:e}={}){const n=e&&typeof e=="number"?{mode:t,version:e}:{mode:t};return j.api.get(`/api/${j.getProjectIdFromPathnameOrWindow()}/pages`,{params:n}).then(i=>i.data)}function vo({mode:t,pages:e}){return j.api.post(`/api/${j.getProjectIdFromPathnameOrWindow()}/pages/publish`,{mode:t,pages:e}).then(n=>n.data)}function ko({locale:t,sort:e,page:n,limit:i,mode:r}={}){return j.api.get(`/api/${j.getProjectIdFromPathnameOrWindow()}/pages/toc`,{params:{locale:t,sort:e,page:n,limit:i,mode:r}}).then(s=>s.data)}const _o={style:"list",sort:"-updatedAt"},mt=20;function $o({style:t,sort:e,section:n,...i}){const[{editing:r,locale:s},c]=S(i,L),[a,l]=S(c,q),[d,u]=f.useState(),x=f.useRef(!1),h=st.useUpdate(),p=K.useNavigate(),y=f.useCallback(async()=>{if(!x.current){x.current=!0,h();try{const w=d?Math.floor(d.list.length/mt)+1:1,{list:g,total:k}=await ko({locale:s,sort:e,page:w,limit:mt});u(v=>({list:((v==null?void 0:v.list)??[]).concat(g),total:k}))}finally{x.current=!1,h()}}},[d,s,e,h]);return st.useMount(()=>{y()}),o.jsxs(E,{...l,sx:r?{pointerEvents:"none"}:{},children:[Object.keys(a).length>0&&o.jsx(z,{...a}),d?o.jsxs(o.Fragment,{children:[o.jsx(m.Grid,{container:!0,spacing:2,justifyContent:"center",children:d==null?void 0:d.list.map(w=>o.jsx(m.Grid,{item:!0,xs:12,sm:t==="card"?6:12,md:t==="card"?3:12,children:o.jsxs(So,{elevation:0,className:b.cx(t==="card"&&"style-card"),onClick:r?void 0:()=>p(w.slug),children:[!!w.image&&o.jsx(m.CardMedia,{component:"img",alt:"",image:j.autoResizeImage(j.getImageAbsoluteUrl(w.image),540),loading:"lazy"}),o.jsxs(m.CardContent,{children:[o.jsx(m.Typography,{variant:"h6",component:"div",className:xt,children:w.title||w.id}),o.jsx(m.Typography,{variant:"body2",className:xt,children:w.description})]})]})},w.id))}),o.jsx(m.Box,{textAlign:"center",mt:2,children:d.total>d.list.length?o.jsx(W,{variant:"outlined",color:"secondary",onClick:y,loading:x.current,children:"More"}):o.jsx(W,{variant:"outlined",color:"secondary",disabled:!0,children:"No More"})})]}):o.jsx(m.Box,{p:2,textAlign:"center",children:o.jsx(m.CircularProgress,{size:24})})]})}const xt=b.css`
482
482
  display: -webkit-box;
483
483
  -webkit-box-orient: vertical;
484
484
  -webkit-line-clamp: 2;
485
485
  overflow: hidden;
486
486
  text-overflow: ellipsis;
487
- `,$o=_.styled(u.Card)`
487
+ `,So=_.styled(m.Card)`
488
488
  border: 1px solid #e0e0e0;
489
489
  background-color: transparent;
490
490
  cursor: pointer;
@@ -504,4 +504,4 @@
504
504
  max-height: 50vw;
505
505
  }
506
506
  }
507
- `,So={iframe:so,section:go,"section-card-list":eo,toc:_o,"ai-runtime":Pe,"custom-component":oo};function Bo({id:t,type:e,mode:n,config:i,section:r,...s}){const c=So[e],{getPageMetaStyle:a}=me(),l=f.useMemo(()=>{const{height:x,...h}=i;return h},[i]),d=f.useMemo(()=>{const x={};return e!=="custom-component"&&(x.height=i.height),x.sx=a("sx"),x},[i.height,e,a]),m=c&&o.jsx(c,{mode:n,...l,id:t,section:r});return o.jsx(Ne,{...s,...d,children:m})}function Co(t){return t!=null}exports.Action=et;exports.BlockRenderer=Bo;exports.IFrameBlockDefaultProps=io;exports.Icon=Z;exports.PageProvider=xe;exports.Provider=Re;exports.STATE_MODES=yo;exports.SectionBlockDefaultProps=ho;exports.TocDefaultProps=ko;exports.getPages=wo;exports.nonNullable=Co;exports.publishPages=jo;
507
+ `,Bo={iframe:ao,section:yo,"section-card-list":oo,toc:$o,"ai-runtime":Re,"custom-component":no};function Co({id:t,type:e,mode:n,config:i,section:r,...s}){const c=Bo[e],{getPageMetaStyle:a}=xe(),l=f.useMemo(()=>{const{height:x,...h}=i;return h},[i]),d=f.useMemo(()=>{const x={};return e!=="custom-component"&&(x.height=i.height),x.sx=a("sx"),x},[i.height,e,a]),u=c&&o.jsx(c,{mode:n,...l,id:t,section:r});return o.jsx(Ie,{...s,...d,children:u})}function No(t){return t!=null}exports.Action=et;exports.BlockRenderer=Co;exports.IFrameBlockDefaultProps=so;exports.Icon=Z;exports.PageProvider=pe;exports.Provider=Te;exports.STATE_MODES=wo;exports.SectionBlockDefaultProps=fo;exports.TocDefaultProps=_o;exports.getPages=jo;exports.nonNullable=No;exports.publishPages=vo;
@@ -1,4 +1,4 @@
1
- "use strict";const t=require("react/jsx-runtime"),k=require("./state-DDwYX2mu.js"),C=require("lodash"),X=require("@arcblock/ux/lib/Locale/context"),re=require("@arcblock/ux/lib/Result"),ie=require("@blocklet/pages-kit/builtin/page/header"),ce=require("@blocklet/pages-kit/contexts/color"),le=require("@blocklet/ui-react/lib/Header"),Y=require("@emotion/css"),T=require("@emotion/react"),ae=require("@emotion/styled"),y=require("@mui/material"),ue=require("ahooks"),de=require("isomorphic-dompurify"),fe=require("lodash/cloneDeep"),me=require("lodash/isEmpty"),ge=require("lodash/isEqual"),x=require("react"),pe=require("react-helmet"),w=require("react-router-dom"),H=require("react-use"),E=require("ufo"),P=require("./array-COVLO-B9.js"),N=require("@arcblock/ux/lib/Theme"),he=require("@blocklet/ui-react/lib/Footer"),xe=require("webfontloader"),je=require("@arcblock/did-connect/lib/Session"),v=e=>e&&e.__esModule?e:{default:e},F=v(re),be=v(le),Z=v(ae),ye=v(de),J=v(fe),ve=v(me),we=v(ge),Se=v(he),ke=v(xe);function Pe(e,s,o,r){e.locales||(e.locales={}),e.locales[o]=C.cloneDeep(e.locales[o]||{}),e.locales[o].title=r.title??e.locales[o].title,e.locales[o].image=r.image??e.locales[o].image,e.locales[o].description=r.description??e.locales[o].description,Object.entries(r.sectionsData).forEach(([c,n])=>{var l,m,j,d;const i=Object.values(e.sections).find(a=>a.id===c||a.name===c);if(i&&i.isTemplateSection)if(i.locales=C.cloneDeep(i.locales||{}),i.locales[o]=C.cloneDeep(i.locales[o]||{}),i.component==="custom-component"){const a=(l=i.config)==null?void 0:l.componentId;if(!a)return;const g=((m=s.components[a])==null?void 0:m.data)||((d=(j=s.resources.components)==null?void 0:j[a])==null?void 0:d.component);if(!g)return;i.locales[o].properties=C.cloneDeep(i.locales[o].properties||{}),Object.entries(n||{}).forEach(([p,u])=>{var h,_;const f=((h=g==null?void 0:g.properties)==null?void 0:h[p])||Object.values((g==null?void 0:g.properties)||{}).find(M=>{var q;return((q=M.data)==null?void 0:q.key)===p});f&&(i.locales[o].properties[(_=f.data)==null?void 0:_.id]={value:u})})}else i.locales[o]={...C.cloneDeep(i.locales[o]),...n||{}}})}const _e=N.styled(Se.default,{shouldForwardProp:e=>!!e})`
1
+ "use strict";const t=require("react/jsx-runtime"),k=require("./state-DDwYX2mu.js"),C=require("lodash"),X=require("@arcblock/ux/lib/Locale/context"),re=require("@arcblock/ux/lib/Result"),ie=require("@blocklet/pages-kit/builtin/page/header"),ce=require("@blocklet/pages-kit/contexts/color"),le=require("@blocklet/ui-react/lib/Header"),Y=require("@emotion/css"),T=require("@emotion/react"),ae=require("@emotion/styled"),y=require("@mui/material"),ue=require("ahooks"),de=require("isomorphic-dompurify"),fe=require("lodash/cloneDeep"),me=require("lodash/isEmpty"),ge=require("lodash/isEqual"),x=require("react"),pe=require("react-helmet"),w=require("react-router-dom"),H=require("react-use"),E=require("ufo"),P=require("./array-CnXbKOG_.js"),N=require("@arcblock/ux/lib/Theme"),he=require("@blocklet/ui-react/lib/Footer"),xe=require("webfontloader"),je=require("@arcblock/did-connect/lib/Session"),v=e=>e&&e.__esModule?e:{default:e},F=v(re),be=v(le),Z=v(ae),ye=v(de),J=v(fe),ve=v(me),we=v(ge),Se=v(he),ke=v(xe);function Pe(e,s,o,r){e.locales||(e.locales={}),e.locales[o]=C.cloneDeep(e.locales[o]||{}),e.locales[o].title=r.title??e.locales[o].title,e.locales[o].image=r.image??e.locales[o].image,e.locales[o].description=r.description??e.locales[o].description,Object.entries(r.sectionsData).forEach(([c,n])=>{var l,m,j,d;const i=Object.values(e.sections).find(a=>a.id===c||a.name===c);if(i&&i.isTemplateSection)if(i.locales=C.cloneDeep(i.locales||{}),i.locales[o]=C.cloneDeep(i.locales[o]||{}),i.component==="custom-component"){const a=(l=i.config)==null?void 0:l.componentId;if(!a)return;const g=((m=s.components[a])==null?void 0:m.data)||((d=(j=s.resources.components)==null?void 0:j[a])==null?void 0:d.component);if(!g)return;i.locales[o].properties=C.cloneDeep(i.locales[o].properties||{}),Object.entries(n||{}).forEach(([p,u])=>{var h,_;const f=((h=g==null?void 0:g.properties)==null?void 0:h[p])||Object.values((g==null?void 0:g.properties)||{}).find(M=>{var q;return((q=M.data)==null?void 0:q.key)===p});f&&(i.locales[o].properties[(_=f.data)==null?void 0:_.id]={value:u})})}else i.locales[o]={...C.cloneDeep(i.locales[o]),...n||{}}})}const _e=N.styled(Se.default,{shouldForwardProp:e=>!!e})`
2
2
  & > div > .MuiContainer-root {
3
3
  max-width: unset;
4
4
  }
@@ -30,7 +30,7 @@
30
30
  body {
31
31
  background-color: ${i(l.backgroundColor)} !important;
32
32
  }
33
- `}),t.jsx(h,{hideNavMenu:!!((D=l.header)!=null&&D.hideNavMenus),translucentTextColor:($=l.header)==null?void 0:$.translucentTextColor,...a?{logo:a}:{},...g?{brand:g}:{},...p?{description:p}:{},className:Y.cx(((V=l.header)==null?void 0:V.sticky)&&"sticky","page-header"),maxWidth:!1,addons:f}),t.jsx(w.ScrollRestoration,{}),t.jsxs(pe.Helmet,{children:[t.jsx("title",{children:m}),t.jsx("meta",{name:"og:title",content:m}),t.jsx("meta",{name:"og:description",content:j}),t.jsx("meta",{name:"og:image",content:d}),t.jsx("meta",{name:"twitter:image:src",content:d}),t.jsx("meta",{name:"twitter:image",content:d}),t.jsx("meta",{property:"twitter:description",content:j}),t.jsx("meta",{property:"twitter:title",content:m}),t.jsx("meta",{name:"description",content:j})]}),t.jsx(y.Stack,{flexGrow:1,className:"PageView-root",sx:{"& .BlockBase-root:first-child":{pt:"0 !important"}},children:o.sectionIds.map(S=>{var G,W;const b=o.sections[S];if(!b||b.visibility==="hidden")return null;const R=(G=b.locales)==null?void 0:G[r],se=((W=b.locales)==null?void 0:W[c])??{};return t.jsx(P.BlockRenderer,{id:S,type:b.component,mode:e,section:b,config:{...ve.default(R)?se:R,locale:r,dev:e==="draft"?{mode:e,components:s,defaultLocale:c}:{mode:e}}},S)})}),!((z=l.footer)!=null&&z.hidden)&&t.jsx(qe,{})]})}const Le=x.lazy(()=>Promise.resolve().then(()=>require("./publish-button-CK-OfgnP.js"))),te=Z.default(be.default)`
33
+ `}),t.jsx(h,{hideNavMenu:!!((D=l.header)!=null&&D.hideNavMenus),translucentTextColor:($=l.header)==null?void 0:$.translucentTextColor,...a?{logo:a}:{},...g?{brand:g}:{},...p?{description:p}:{},className:Y.cx(((V=l.header)==null?void 0:V.sticky)&&"sticky","page-header"),maxWidth:!1,addons:f}),t.jsx(w.ScrollRestoration,{}),t.jsxs(pe.Helmet,{children:[t.jsx("title",{children:m}),t.jsx("meta",{name:"og:title",content:m}),t.jsx("meta",{name:"og:description",content:j}),t.jsx("meta",{name:"og:image",content:d}),t.jsx("meta",{name:"twitter:image:src",content:d}),t.jsx("meta",{name:"twitter:image",content:d}),t.jsx("meta",{property:"twitter:description",content:j}),t.jsx("meta",{property:"twitter:title",content:m}),t.jsx("meta",{name:"description",content:j})]}),t.jsx(y.Stack,{flexGrow:1,className:"PageView-root",sx:{"& .BlockBase-root:first-child":{pt:"0 !important"}},children:o.sectionIds.map(S=>{var G,W;const b=o.sections[S];if(!b||b.visibility==="hidden")return null;const R=(G=b.locales)==null?void 0:G[r],se=((W=b.locales)==null?void 0:W[c])??{};return t.jsx(P.BlockRenderer,{id:S,type:b.component,mode:e,section:b,config:{...ve.default(R)?se:R,locale:r,dev:e==="draft"?{mode:e,components:s,defaultLocale:c}:{mode:e}}},S)})}),!((z=l.footer)!=null&&z.hidden)&&t.jsx(qe,{})]})}const Le=x.lazy(()=>Promise.resolve().then(()=>require("./publish-button-B7nhzpwi.js"))),te=Z.default(be.default)`
34
34
  &.sticky {
35
35
  position: sticky;
36
36
  top: 0;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),v=require("./state-DDwYX2mu.js"),D=require("@arcblock/ux/lib/Locale/context"),O=require("@arcblock/ux/lib/Toast"),S=require("@mui/icons-material"),q=require("@mui/lab"),s=require("@mui/material"),W=require("immer"),z=require("lodash/difference"),c=require("react"),_=require("react-use"),N=require("./home-DWk31ISZ.js"),E=require("./array-COVLO-B9.js"),M=t=>t&&t.__esModule?t:{default:t},A=M(O),C=M(z);function R(t){const[d,b]=c.useState(!1);return e.jsx(q.LoadingButton,{...t,loading:t.loading||d,onClick:i=>{var h;const m=(h=t.onClick)==null?void 0:h.call(t,i);m instanceof Promise&&(b(!0),m.finally(()=>{b(!1)}))}})}const F=s.createSvgIcon(e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M7.75732 16.2426L16.2426 7.75736",stroke:"#4B5563",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M16.2426 16.2426L7.75732 7.75735",stroke:"#4B5563",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),"Close");function H(){const[t,d]=c.useState(),b=c.useMemo(()=>t?e.jsx(s.Dialog,{...t}):null,[t]),i=c.useCallback(()=>{d(void 0)},[]),m=c.useCallback(({title:h,content:g,cancelText:T="Cancel",okText:p="Ok",onOk:f,onClose:k,okIcon:L,okColor:n="primary",cancelColor:y="primary",DialogContentProps:u,form:x,...I})=>{d({...I,open:!0,children:e.jsxs("form",{onSubmit:P=>P.preventDefault(),children:[h&&e.jsxs(s.DialogTitle,{className:"between",zIndex:"appBar",bgcolor:"background.paper",sx:{borderBottom:"1px solid #E5E7EB"},children:[e.jsx(s.Box,{children:h}),e.jsx(s.IconButton,{size:"small",onClick:async()=>{i(),k==null||k()},children:e.jsx(F,{})})]}),g&&e.jsx(s.DialogContent,{...u,sx:{mt:-3,...u==null?void 0:u.sx},children:e.jsx(s.Box,{pt:3,children:g})}),e.jsxs(s.DialogActions,{children:[e.jsx(s.Button,{variant:"outlined",color:y||"primary",onClick:k??i,children:T}),e.jsx(R,{variant:"contained",color:n||"primary",startIcon:L,loadingPosition:L?"start":"center",onClick:async()=>{await(f==null?void 0:f()),i()},type:"submit",children:p})]})]}),onClose:k??i})},[i]);return{dialog:b,showDialog:m,closeDialog:i}}const J=c.forwardRef(({mode:t,state:d},b)=>{const{t:i}=D.useLocaleContext(),[m,h]=c.useState(!1),{dialog:g,showDialog:T}=H(),p=v.useProjectId(),f=c.useCallback(L=>{let n=[];T({title:i("maker.publishToProduction"),content:e.jsxs(s.Box,{sx:{minWidth:300},children:[e.jsx(s.Alert,{color:"warning",icon:e.jsx(S.Warning,{}),children:i("maker.publishToProductionTip")}),e.jsx(s.Box,{maxHeight:"50vh",overflow:"auto",mt:2,children:e.jsx(V,{state:d,toMode:t,onChange:y=>n=y,defaultPageIds:L})})]}),okText:i("maker.publish"),cancelText:i("common.cancel"),onOk:async()=>{var y,u;if((n==null?void 0:n.length)===0){const x=i("maker.publishSelectPagesMessage");throw A.default.error(x),new Error(x)}for(const x of n??d.pageIds){const I=d.pages[x];if(I){const P=(u=(y=v.checkPage(i,I,d))==null?void 0:y[0])==null?void 0:u.message;if(P)throw A.default.error(P),new Error(P)}}localStorage.setItem(v.getProjectPageVersionKey(p??""),String(new Date().getTime())),h(!0);try{await E.publishPages({mode:t,pages:n}),A.default.success(i("maker.publishSuccessMessage"))}catch(x){throw A.default.error(x.message),x}finally{h(!1)}}})},[t,d,i,p,T]);c.useImperativeHandle(b,()=>({openPublishDialog:f}));const k=c.useCallback(()=>{f()},[f]);return e.jsxs(e.Fragment,{children:[e.jsx(q.LoadingButton,{color:"primary",variant:"contained",size:"small",sx:{mr:1},onClick:k,loading:m,disabled:m,children:i("maker.publishToProduction")}),g]})});function V({state:t,toMode:d,onChange:b,defaultPageIds:i}){const{t:m,locale:h}=D.useLocaleContext(),[g,T]=c.useState(!1),[p,f]=c.useState(()=>i?Object.fromEntries(i.map(r=>[r,!0])):{}),{loading:k,error:L,value:n}=_.useAsync(()=>E.getPages({mode:d}),[d]);if(L)throw L;const y=c.useMemo(()=>JSON.parse(JSON.stringify(t.pageIds)).sort((a,j)=>{const o=t.pages[a],l=t.pages[j];return o!=null&&o.publishedAt&&new Date(o.publishedAt).getTime()<new Date(o.updatedAt).getTime()?-1:l!=null&&l.publishedAt&&new Date(l.publishedAt).getTime()<new Date(l.updatedAt).getTime()?1:new Date((o==null?void 0:o.updatedAt)??"").getTime()-new Date((l==null?void 0:l.updatedAt)??"").getTime()}),[t]),u=c.useMemo(()=>n?C.default(n.pageIds,t.pageIds):[],[t,n]),x=c.useMemo(()=>[...t.pageIds].concat(u),[t,u]),I=c.useCallback(r=>{f(a=>{const j=W.produce(a,o=>{g?(Object.assign(o,Object.fromEntries(x.map(l=>[l,!0]))),delete o[r]):o[r]?(delete o[r],u.includes(r)&&t.pageIds.filter(l=>{var w,B;return((w=t.pages[l])==null?void 0:w.slug)===((B=n==null?void 0:n.pages[r])==null?void 0:B.slug)}).forEach(l=>{delete o[l]})):(o[r]=!0,t.pageIds.includes(r)&&u.filter(l=>{var w,B;return((w=n==null?void 0:n.pages[l])==null?void 0:w.slug)===((B=t.pages[r])==null?void 0:B.slug)}).forEach(l=>{o[l]=!0}))});return T(C.default(x,Object.keys(j)).length===0),j})},[g,x,u,t,n]),P=c.useCallback(()=>{T(r=>(r&&f({}),!r))},[p]);return c.useEffect(()=>{b(g?null:Object.keys(p))},[g,p,b]),k?e.jsx(N.Loading,{sx:{my:4}}):e.jsxs(s.List,{disablePadding:!0,sx:{maxWidth:500},children:[e.jsx(s.ListItem,{sx:{position:"sticky",top:0,bgcolor:"background.paper",zIndex:1},disablePadding:!0,children:e.jsxs(s.ListItemButton,{onClick:P,dense:!0,children:[e.jsx(s.ListItemIcon,{children:e.jsx(s.Checkbox,{edge:"start",checked:g,tabIndex:-1})}),e.jsx(s.ListItemText,{primary:m("common.all")})]})}),y.map(r=>{var l,w;const a=t.pages[r];if(!a)return null;const j=v.checkPage(m,a,t),o=!a.publishedAt||a.updatedAt&&new Date(a.updatedAt).getTime()>new Date(a.publishedAt).getTime();return e.jsx(s.ListItem,{disablePadding:!0,secondaryAction:e.jsxs(e.Fragment,{children:[o&&e.jsx(s.Tooltip,{title:m("maker.pages.needPublish"),children:e.jsx(S.Sync,{fontSize:"small",sx:{color:"warning.main",fontSize:16,mr:.35}})}),!a.isPublic&&e.jsx(s.Tooltip,{title:m("maker.pages.notPublic"),children:e.jsx(S.VisibilityOff,{fontSize:"small",sx:{color:"warning.main",fontSize:16,mr:.35}})}),j&&e.jsx(v.PageErrorTip,{errors:j,children:e.jsx(S.Warning,{sx:{color:"error.dark",mr:.35}})})]}),children:e.jsxs(s.ListItemButton,{onClick:()=>I(r),dense:!0,children:[e.jsx(s.ListItemIcon,{children:e.jsx(s.Checkbox,{edge:"start",checked:g||!!p[r],tabIndex:-1})}),e.jsx(s.ListItemText,{primary:a.slug,secondary:(w=(l=a.locales)==null?void 0:l[h])==null?void 0:w.title,primaryTypographyProps:{noWrap:!0,textOverflow:"ellipsis"},secondaryTypographyProps:{noWrap:!0,textOverflow:"ellipsis"}})]})},r)}),u.map(r=>{var j,o;const a=n==null?void 0:n.pages[r];return a?e.jsx(s.ListItem,{disablePadding:!0,secondaryAction:e.jsx(s.Chip,{color:"warning",label:"deleted",size:"small"}),children:e.jsxs(s.ListItemButton,{onClick:()=>I(r),dense:!0,children:[e.jsx(s.ListItemIcon,{children:e.jsx(s.Checkbox,{edge:"start",checked:g||!!p[r],tabIndex:-1})}),e.jsx(s.ListItemText,{primary:a.slug,secondary:(o=(j=a.locales)==null?void 0:j[h])==null?void 0:o.title,primaryTypographyProps:{noWrap:!0,textOverflow:"ellipsis"},secondaryTypographyProps:{noWrap:!0,textOverflow:"ellipsis"}})]})},r):null})]})}exports.default=J;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),v=require("./state-DDwYX2mu.js"),D=require("@arcblock/ux/lib/Locale/context"),O=require("@arcblock/ux/lib/Toast"),S=require("@mui/icons-material"),q=require("@mui/lab"),s=require("@mui/material"),W=require("immer"),z=require("lodash/difference"),c=require("react"),_=require("react-use"),N=require("./home-BXkUy2B8.js"),E=require("./array-CnXbKOG_.js"),M=t=>t&&t.__esModule?t:{default:t},A=M(O),C=M(z);function R(t){const[d,b]=c.useState(!1);return e.jsx(q.LoadingButton,{...t,loading:t.loading||d,onClick:i=>{var h;const m=(h=t.onClick)==null?void 0:h.call(t,i);m instanceof Promise&&(b(!0),m.finally(()=>{b(!1)}))}})}const F=s.createSvgIcon(e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M7.75732 16.2426L16.2426 7.75736",stroke:"#4B5563",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M16.2426 16.2426L7.75732 7.75735",stroke:"#4B5563",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),"Close");function H(){const[t,d]=c.useState(),b=c.useMemo(()=>t?e.jsx(s.Dialog,{...t}):null,[t]),i=c.useCallback(()=>{d(void 0)},[]),m=c.useCallback(({title:h,content:g,cancelText:T="Cancel",okText:p="Ok",onOk:f,onClose:k,okIcon:L,okColor:n="primary",cancelColor:y="primary",DialogContentProps:u,form:x,...I})=>{d({...I,open:!0,children:e.jsxs("form",{onSubmit:P=>P.preventDefault(),children:[h&&e.jsxs(s.DialogTitle,{className:"between",zIndex:"appBar",bgcolor:"background.paper",sx:{borderBottom:"1px solid #E5E7EB"},children:[e.jsx(s.Box,{children:h}),e.jsx(s.IconButton,{size:"small",onClick:async()=>{i(),k==null||k()},children:e.jsx(F,{})})]}),g&&e.jsx(s.DialogContent,{...u,sx:{mt:-3,...u==null?void 0:u.sx},children:e.jsx(s.Box,{pt:3,children:g})}),e.jsxs(s.DialogActions,{children:[e.jsx(s.Button,{variant:"outlined",color:y||"primary",onClick:k??i,children:T}),e.jsx(R,{variant:"contained",color:n||"primary",startIcon:L,loadingPosition:L?"start":"center",onClick:async()=>{await(f==null?void 0:f()),i()},type:"submit",children:p})]})]}),onClose:k??i})},[i]);return{dialog:b,showDialog:m,closeDialog:i}}const J=c.forwardRef(({mode:t,state:d},b)=>{const{t:i}=D.useLocaleContext(),[m,h]=c.useState(!1),{dialog:g,showDialog:T}=H(),p=v.useProjectId(),f=c.useCallback(L=>{let n=[];T({title:i("maker.publishToProduction"),content:e.jsxs(s.Box,{sx:{minWidth:300},children:[e.jsx(s.Alert,{color:"warning",icon:e.jsx(S.Warning,{}),children:i("maker.publishToProductionTip")}),e.jsx(s.Box,{maxHeight:"50vh",overflow:"auto",mt:2,children:e.jsx(V,{state:d,toMode:t,onChange:y=>n=y,defaultPageIds:L})})]}),okText:i("maker.publish"),cancelText:i("common.cancel"),onOk:async()=>{var y,u;if((n==null?void 0:n.length)===0){const x=i("maker.publishSelectPagesMessage");throw A.default.error(x),new Error(x)}for(const x of n??d.pageIds){const I=d.pages[x];if(I){const P=(u=(y=v.checkPage(i,I,d))==null?void 0:y[0])==null?void 0:u.message;if(P)throw A.default.error(P),new Error(P)}}localStorage.setItem(v.getProjectPageVersionKey(p??""),String(new Date().getTime())),h(!0);try{await E.publishPages({mode:t,pages:n}),A.default.success(i("maker.publishSuccessMessage"))}catch(x){throw A.default.error(x.message),x}finally{h(!1)}}})},[t,d,i,p,T]);c.useImperativeHandle(b,()=>({openPublishDialog:f}));const k=c.useCallback(()=>{f()},[f]);return e.jsxs(e.Fragment,{children:[e.jsx(q.LoadingButton,{color:"primary",variant:"contained",size:"small",sx:{mr:1},onClick:k,loading:m,disabled:m,children:i("maker.publishToProduction")}),g]})});function V({state:t,toMode:d,onChange:b,defaultPageIds:i}){const{t:m,locale:h}=D.useLocaleContext(),[g,T]=c.useState(!1),[p,f]=c.useState(()=>i?Object.fromEntries(i.map(r=>[r,!0])):{}),{loading:k,error:L,value:n}=_.useAsync(()=>E.getPages({mode:d}),[d]);if(L)throw L;const y=c.useMemo(()=>JSON.parse(JSON.stringify(t.pageIds)).sort((a,j)=>{const o=t.pages[a],l=t.pages[j];return o!=null&&o.publishedAt&&new Date(o.publishedAt).getTime()<new Date(o.updatedAt).getTime()?-1:l!=null&&l.publishedAt&&new Date(l.publishedAt).getTime()<new Date(l.updatedAt).getTime()?1:new Date((o==null?void 0:o.updatedAt)??"").getTime()-new Date((l==null?void 0:l.updatedAt)??"").getTime()}),[t]),u=c.useMemo(()=>n?C.default(n.pageIds,t.pageIds):[],[t,n]),x=c.useMemo(()=>[...t.pageIds].concat(u),[t,u]),I=c.useCallback(r=>{f(a=>{const j=W.produce(a,o=>{g?(Object.assign(o,Object.fromEntries(x.map(l=>[l,!0]))),delete o[r]):o[r]?(delete o[r],u.includes(r)&&t.pageIds.filter(l=>{var w,B;return((w=t.pages[l])==null?void 0:w.slug)===((B=n==null?void 0:n.pages[r])==null?void 0:B.slug)}).forEach(l=>{delete o[l]})):(o[r]=!0,t.pageIds.includes(r)&&u.filter(l=>{var w,B;return((w=n==null?void 0:n.pages[l])==null?void 0:w.slug)===((B=t.pages[r])==null?void 0:B.slug)}).forEach(l=>{o[l]=!0}))});return T(C.default(x,Object.keys(j)).length===0),j})},[g,x,u,t,n]),P=c.useCallback(()=>{T(r=>(r&&f({}),!r))},[p]);return c.useEffect(()=>{b(g?null:Object.keys(p))},[g,p,b]),k?e.jsx(N.Loading,{sx:{my:4}}):e.jsxs(s.List,{disablePadding:!0,sx:{maxWidth:500},children:[e.jsx(s.ListItem,{sx:{position:"sticky",top:0,bgcolor:"background.paper",zIndex:1},disablePadding:!0,children:e.jsxs(s.ListItemButton,{onClick:P,dense:!0,children:[e.jsx(s.ListItemIcon,{children:e.jsx(s.Checkbox,{edge:"start",checked:g,tabIndex:-1})}),e.jsx(s.ListItemText,{primary:m("common.all")})]})}),y.map(r=>{var l,w;const a=t.pages[r];if(!a)return null;const j=v.checkPage(m,a,t),o=!a.publishedAt||a.updatedAt&&new Date(a.updatedAt).getTime()>new Date(a.publishedAt).getTime();return e.jsx(s.ListItem,{disablePadding:!0,secondaryAction:e.jsxs(e.Fragment,{children:[o&&e.jsx(s.Tooltip,{title:m("maker.pages.needPublish"),children:e.jsx(S.Sync,{fontSize:"small",sx:{color:"warning.main",fontSize:16,mr:.35}})}),!a.isPublic&&e.jsx(s.Tooltip,{title:m("maker.pages.notPublic"),children:e.jsx(S.VisibilityOff,{fontSize:"small",sx:{color:"warning.main",fontSize:16,mr:.35}})}),j&&e.jsx(v.PageErrorTip,{errors:j,children:e.jsx(S.Warning,{sx:{color:"error.dark",mr:.35}})})]}),children:e.jsxs(s.ListItemButton,{onClick:()=>I(r),dense:!0,children:[e.jsx(s.ListItemIcon,{children:e.jsx(s.Checkbox,{edge:"start",checked:g||!!p[r],tabIndex:-1})}),e.jsx(s.ListItemText,{primary:a.slug,secondary:(w=(l=a.locales)==null?void 0:l[h])==null?void 0:w.title,primaryTypographyProps:{noWrap:!0,textOverflow:"ellipsis"},secondaryTypographyProps:{noWrap:!0,textOverflow:"ellipsis"}})]})},r)}),u.map(r=>{var j,o;const a=n==null?void 0:n.pages[r];return a?e.jsx(s.ListItem,{disablePadding:!0,secondaryAction:e.jsx(s.Chip,{color:"warning",label:"deleted",size:"small"}),children:e.jsxs(s.ListItemButton,{onClick:()=>I(r),dense:!0,children:[e.jsx(s.ListItemIcon,{children:e.jsx(s.Checkbox,{edge:"start",checked:g||!!p[r],tabIndex:-1})}),e.jsx(s.ListItemText,{primary:a.slug,secondary:(o=(j=a.locales)==null?void 0:j[h])==null?void 0:o.title,primaryTypographyProps:{noWrap:!0,textOverflow:"ellipsis"},secondaryTypographyProps:{noWrap:!0,textOverflow:"ellipsis"}})]})},r):null})]})}exports.default=J;
package/lib/cjs/home.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("react/jsx-runtime");require("./chunks/state-DDwYX2mu.js");const e=require("./chunks/home-DWk31ISZ.js");require("@arcblock/ux/lib/Locale/context");require("@arcblock/ux/lib/Result");require("@blocklet/pages-kit/builtin/page/header");require("@blocklet/pages-kit/contexts/color");require("@blocklet/ui-react/lib/Header");require("@emotion/css");require("@emotion/react");require("@emotion/styled");require("@mui/material");require("ahooks");require("isomorphic-dompurify");require("lodash/cloneDeep");require("lodash/isEmpty");require("lodash/isEqual");require("react");require("react-helmet");require("react-router-dom");require("react-use");require("ufo");require("./chunks/array-COVLO-B9.js");exports.HomeView=e.HomeView;exports.PageRoutes=e.PageRoutes;exports.PageView=e.PageView;exports.PageViewByPath=e.PageViewByPath;exports.TranslucentHeader=e.TranslucentHeader;exports.default=e.Home;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("react/jsx-runtime");require("./chunks/state-DDwYX2mu.js");const e=require("./chunks/home-BXkUy2B8.js");require("@arcblock/ux/lib/Locale/context");require("@arcblock/ux/lib/Result");require("@blocklet/pages-kit/builtin/page/header");require("@blocklet/pages-kit/contexts/color");require("@blocklet/ui-react/lib/Header");require("@emotion/css");require("@emotion/react");require("@emotion/styled");require("@mui/material");require("ahooks");require("isomorphic-dompurify");require("lodash/cloneDeep");require("lodash/isEmpty");require("lodash/isEqual");require("react");require("react-helmet");require("react-router-dom");require("react-use");require("ufo");require("./chunks/array-CnXbKOG_.js");exports.HomeView=e.HomeView;exports.PageRoutes=e.PageRoutes;exports.PageView=e.PageView;exports.PageViewByPath=e.PageViewByPath;exports.TranslucentHeader=e.TranslucentHeader;exports.default=e.Home;