@blocklet/pages-kit-inner-components 0.5.30 → 0.5.32

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.
Files changed (37) hide show
  1. package/lib/cjs/add-component.js +47 -23
  2. package/lib/cjs/chunks/array-DxhrK2d5.js +475 -0
  3. package/lib/cjs/chunks/{config-string-C4Q0hgG0.js → config-string-DqWgB7yO.js} +1 -1
  4. package/lib/cjs/chunks/{draft-data-Cu9gua-P.js → draft-data-DzN2u_NT.js} +1 -1
  5. package/lib/cjs/chunks/home-0fezWT4S.js +38 -0
  6. package/lib/cjs/chunks/{publish-button-DvwoFH1F.js → publish-button-D2jaaXXn.js} +1 -1
  7. package/lib/cjs/chunks/site-state-D5jk8eJT.js +57 -0
  8. package/lib/cjs/chunks/state-DoGBMTzI.js +1 -0
  9. package/lib/cjs/components.js +1 -1
  10. package/lib/cjs/home.js +1 -1
  11. package/lib/cjs/locales.js +3 -1
  12. package/lib/cjs/project-html.js +2 -2
  13. package/lib/cjs/resources.js +1 -1
  14. package/lib/cjs/setting.js +1 -1
  15. package/lib/cjs/site-state.js +1 -1
  16. package/lib/es/add-component.js +795 -749
  17. package/lib/es/chunks/array-D6qyZucY.js +2224 -0
  18. package/lib/es/chunks/{config-string-CNLg1EYu.js → config-string-Btybe5Rd.js} +1 -1
  19. package/lib/es/chunks/{draft-data-hSHLdxKp.js → draft-data-DQ7_JyJX.js} +1 -1
  20. package/lib/es/chunks/{home-CNk6U8FU.js → home-Dox9JwvF.js} +112 -96
  21. package/lib/es/chunks/{publish-button-BftBlabj.js → publish-button-T2YJBoty.js} +3 -3
  22. package/lib/es/chunks/{site-state-DJ3JcBMm.js → site-state-DEduMTrY.js} +505 -473
  23. package/lib/es/chunks/state-NhsHvaKm.js +605 -0
  24. package/lib/es/components.js +1 -1
  25. package/lib/es/home.js +3 -3
  26. package/lib/es/locales.js +46 -6
  27. package/lib/es/project-html.js +43 -42
  28. package/lib/es/resources.js +1 -1
  29. package/lib/es/setting.js +2 -2
  30. package/lib/es/site-state.js +1 -1
  31. package/package.json +10 -10
  32. package/lib/cjs/chunks/array-CJC7ex3i.js +0 -467
  33. package/lib/cjs/chunks/home-CimGvyT9.js +0 -38
  34. package/lib/cjs/chunks/site-state-DvIWP0pO.js +0 -57
  35. package/lib/cjs/chunks/state-jCG5gSUJ.js +0 -1
  36. package/lib/es/chunks/array-9j8tOSbO.js +0 -1993
  37. package/lib/es/chunks/state-D5BnGunt.js +0 -483
@@ -1,467 +0,0 @@
1
- "use strict";var kt=Object.create;var ot=Object.defineProperty;var $t=Object.getOwnPropertyDescriptor;var St=Object.getOwnPropertyNames;var Ct=Object.getPrototypeOf,Nt=Object.prototype.hasOwnProperty;var Bt=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of St(e))!Nt.call(t,r)&&r!==n&&ot(t,r,{get:()=>e[r],enumerable:!(i=$t(e,r))||i.enumerable});return t};var Pt=(t,e,n)=>(n=t!=null?kt(Ct(t)):{},Bt(e||!t||!t.__esModule?ot(n,"default",{value:t,enumerable:!0}):n,t));const o=require("react/jsx-runtime");require("@mui/icons-material");const p=require("@mui/material"),f=require("react"),It=require("lodash/keyBy"),j=require("./state-jCG5gSUJ.js"),F=require("@blocklet/ai-runtime/components"),Rt=require("@mui/utils"),Tt=require("lodash/pick"),Wt=require("react-error-boundary"),zt=require("@blocklet/pages-kit/builtin/markdown/markdown-renderer"),mt=require("@blocklet/pages-kit/contexts/color"),g=require("@emotion/css"),Et=require("react-syntax-highlighter/dist/esm/styles/prism"),k=require("@arcblock/ux/lib/Theme"),qt=require("@arcblock/react-hooks/lib/useBrowser"),Lt=require("@arcblock/ux/lib/Colors"),J=require("@blocklet/pages-kit/components"),rt=require("@blocklet/pages-kit/utils/style"),At=require("@mui/material/useMediaQuery"),Ot=require("lodash/omit"),pt=require("@iconify-icon/react"),Ut=require("@arcblock/ux/lib/Screenshot"),G=require("react-router-dom"),Ft=require("@arcblock/ux/lib/Button"),Dt=require("is-uri"),D=require("pathe"),T=require("ufo"),Mt=require("@blocklet/embed/message"),Vt=require("ahooks"),Ht=require("lodash/isEqual"),Yt=require("@blocklet/embed/react"),Jt=require("react-twitter-embed"),nt=require("react-use"),$=t=>t&&t.__esModule?t:{default:t},Gt=$(f),V=$(It),K=$(Tt),Kt=$(zt),Xt=$(qt),it=$(Lt),xt=$(At),C=$(Ot),Qt=$(Ut),Zt=$(Ft),H=$(Dt),te=$(Ht),ht="{{CUSTOM_VALUE}}",ee=[{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}}}],oe=[{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}}}],re=[{title:"None",value:"none",sx:{px:0}},{title:"Small",value:"small",sx:{px:{xs:2,md:4,lg:4,xl:6}}},{title:"Normal",value:"normal",sx:{px:{xs:2.5,md:7.5,lg:10,xl:12.5}}},{title:"Large",value:"large",sx:{px:{xs:2.5,md:10,lg:12.5,xl:15}}}],M=(t,e,n)=>{const i=t.breakpoints.values[n];return`${e}${i?` (${i}px)`:""}`},ne=[{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:ht,width:"100%",mx:"auto"}}],ie=V.default(ee,"value"),se=V.default(oe,"value"),ae=V.default(re,"value"),le=V.default(ne,"value"),ce=new Map([["baseSectionPaddingY",ie],["maxWidth",le],["paddingY",se],["paddingX",ae]]);function ft(t){var l;const{type:e,value:n,format:i="sx",defaultValue:r=null}=t,s=ce.get(e);if(!s)return r;const d=n.startsWith("custom:"),a=d?"custom":n;if(s!=null&&s[a]&&((l=s==null?void 0:s[a])!=null&&l[i])){const c=s[a][i];if(d){const u=n.replace("custom:","");try{return JSON.parse(JSON.stringify(c||{}).replaceAll(ht,u))}catch{}}return c}return r}const gt=f.createContext({page:null,getPageMeta:()=>({}),getPageMetaStyle:()=>({})});function de(){return f.useContext(gt)}function ue({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 c;if(!r)return{};const l=i||n;return((c=r.locales)==null?void 0:c[l])??{}},[r,n,i]),d=f.useCallback((l="sx")=>{const c=s();return!c||!c.style?{}:Object.entries(c.style||{}).reduce((m,[h,x])=>{if(!x)return m;const y=`${h}Custom`;c.style[y];const w=ft({type:h,value:x,format:l});return w?{...m,...w}:m},{})},[s]),a=f.useMemo(()=>({page:r,getPageMeta:s,getPageMetaStyle:d}),[r,s,d]);return o.jsx(gt.Provider,{value:a,children:e})}function R({actions:t,center:e,className:n,align:i}){return t&&(t!=null&&t.length)?o.jsx(p.Box,{className:g.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 me="section",pe=p.styled(p.Box)`
2
- overflow: hidden;
3
-
4
- .section__title {
5
- margin-top: 0;
6
- font-weight: 700;
7
- }
8
- .section__title_non_big {
9
- font-size: 32px;
10
- @media (max-width: 600px) {
11
- font-size: 24px;
12
- }
13
- }
14
- &.base-info .section__tag {
15
- margin-top: 0;
16
- margin-bottom: 2vw;
17
- background-color: ${({theme:t})=>t.palette.primary.main};
18
- white-space: nowrap;
19
- max-width: 100%;
20
- display: inline-block;
21
- padding: 0 10px;
22
- justify-content: flex-start;
23
- overflow: hidden;
24
- text-overflow: ellipsis;
25
- font-size: 12px;
26
- color: #fff;
27
- border-radius: 4px;
28
- line-height: 20px;
29
- }
30
- .section__title {
31
- color: ${({theme:t})=>t.palette.text.primary};
32
- a {
33
- color: ${({theme:t})=>t.palette.primary.main};
34
- }
35
- p {
36
- margin-top: 0;
37
- margin-bottom: 0;
38
- }
39
- }
40
- .section__description {
41
- color: ${({theme:t})=>t.palette.text.primary};
42
- margin-bottom: 4vw;
43
- margin-top: 0;
44
- a {
45
- color: ${({theme:t})=>t.palette.primary.main};
46
- }
47
- p {
48
- margin-top: 0;
49
- margin-bottom: 0.5rem;
50
- }
51
- }
52
- @media (min-width: ${({theme:t})=>t.breakpoints.values[me]}px) {
53
- .section__tag {
54
- margin-bottom: 32px;
55
- }
56
- .section__title {
57
- margin-bottom: 32px;
58
- }
59
- .section__description {
60
- margin-bottom: 40px;
61
- }
62
- }
63
- `;function E({title:t,description:e,descriptionMarkdown:n,actions:i,className:r="",classes:s={},prepend:d,append:a,level:l=2,tag:c,badge:u,center:m,logo:h,titleAppearance:x,descriptionAppearance:y,...w}){const b=mt.useColorConvert();if(!t&&!e&&!i&&!u&&!c&&!d&&!a&&!h)return null;const v=Math.max(Math.min(5,l+1),1),_={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"},P=l===0?"big":`h${v}`,I=l===0;return o.jsxs(pe,{className:g.cx("base-info","lg:text-left",m&&"!text-center",r),...w,children:[d&&o.jsx("div",{children:d}),(c||u)&&o.jsx("div",{className:g.cx("section__tag",(s==null?void 0:s.tag)||(s==null?void 0:s.badge)),children:c||u}),h&&o.jsx("img",{className:"w-[120px] m-auto mb-8",src:h,alt:"info",loading:"lazy"}),t&&o.jsx(p.Typography,{sx:{whiteSpace:"pre-wrap",mb:e?"2vw":0,...(x==null?void 0:x.color)&&{color:`${b(x.color)} !important`}},className:g.cx("section__title","text-gray-800","dark:text-gray-50",s.title,"page-kit-section__title",I?"":"section__title_non_big"),component:`h${Math.max(l,1)}`,variant:P,children:t}),e&&(n?o.jsx(p.Box,{sx:{...(y==null?void 0:y.color)&&{color:`${b(y.color)} !important`}},className:g.cx("section__description","text-gray-800","dark:text-gray-100",_[v],s.description,"page-kit-section__description"),children:o.jsx(Kt.default,{codeOptions:{showActionButton:!1,theme:Et.materialDark},children:e})}):o.jsx(p.Typography,{sx:{whiteSpace:"pre-wrap",...(y==null?void 0:y.color)&&{color:`${b(y.color)} !important`}},className:g.cx("section__description","text-gray-800","dark:text-gray-100",_[v],s.description,"page-kit-section__description"),component:"div",variant:"body1",gutterBottom:!0,children:e})),o.jsx(R,{actions:i,center:m,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 yt(t){if(t.type===f.Fragment){const n=(t.props.children||[]).filter(i=>f.isValidElement(i));return n.length===1?yt(n[0]):n.length>1}return Array.isArray(t)}const N="&>*";function X({children:t,col:e,gap:n,className:i,align:r,sx:s,type:d,...a}={children:null,className:"",col:3,gap:void 0,sx:{},align:"center",type:"default"}){const l=k.useTheme(),c=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"},m=u[r]||u.center;let x=n??({2:6,3:4,4:4,5:3,6:3}[e]||0);yt(t)||(x=0);const w=(e-1)*x/e;let b={...s,gap:`${x}rem`};const v={[N]:{width:"100%"}},_={},P={},I={};switch(v.gap="1rem",_.gap=`${x/2}rem`,e){case 3:case 4:_[N]={width:`calc(50% - ${x/2}rem)`};break;case 5:case 6:v[N]={width:`calc(50% - ${x/2/2}rem)`},_[N]={width:`calc(50% - ${x/2/2}rem)`},P[N]={width:`calc(33.33% - ${x*2/3}rem)`};break}return b[N]={width:`calc(${c}% - ${w}rem)`},b[`@media (max-width: ${l.breakpoints.values.xl}px)`]=I,b[`@media (max-width: ${l.breakpoints.values.lg}px)`]=P,b[`@media (max-width: ${l.breakpoints.values.md}px)`]=_,b[`@media (max-width: ${l.breakpoints.values.sm}px)`]=v,d==="wall"&&(b={...s,gap:`${x}rem`},b[N]={width:`calc(${c}% - ${w}rem)`},v[N]={width:`calc(45% - ${x/2/2}rem)`},b[`@media (max-width: ${l.breakpoints.values.sm}px)`]=v),o.jsx(p.Box,{className:g.cx("flex flex-wrap flex-row h-full",m,i),sx:b,...a,children:t})}function xe(){const t=navigator.userAgent.toLowerCase();return t.includes("safari")&&!t.includes("chrome")}function he(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 W(t){return(t==null?void 0:t.endsWith(".mp4"))||(t==null?void 0:t.endsWith(".m4v"))||(t==null?void 0:t.endsWith(".webm"))}function fe(t){return t!=null&&t.endsWith(".mp4")||t!=null&&t.endsWith(".m4v")?"video/mp4":t!=null&&t.endsWith(".webm")?"video/webm":void 0}function ge(t){let e={};return typeof t=="string"?rt.isGradient(t)?e.image=t:(e.image=j.getImageAbsoluteUrl(t),rt.isColorString(t)&&(e.color=t,e.image="")):e=t,e}function ye(){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 st(t,e,n,i,r){let s=null;const{color:d="",image:a}=ge(e);if(a&&he(a)){delete n.backgroundColor;const l=!(t.mobile.apple.device||xe())&&W(a),c=W(a)&&i?j.autoResizeImage(j.getImageAbsoluteUrl(i),1200,"quality"):"";l?s=o.jsx(p.Box,{component:"video",className:"section-bg",width:"100%",autoPlay:!0,loop:!0,muted:!0,controls:!1,playsInline:!0,poster:c,src:W(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(J.ResponsiveImage,{src:W(a)&&i?c: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)}else a?n.backgroundImage=`${a} !important`:d&&(n.backgroundColor=`${d} !important`);return s}function be({autoWidth:t,children:e,...n}){return t?o.jsx(p.Box,{display:"flex",...n,children:e}):o.jsx(p.Container,{...n,children:e})}function L({dark:t=!1,children:e,className:n,sx:i={},boxed:r={show:!1},padding:s="normal",boxProps:d,type:a,...l}){const c={...i},u=xt.default(x=>x.breakpoints.down("md"));t&&(c.color=it.default.common.white,c.backgroundColor=`${it.default.grey[900]} !important`),r.show&&(c.display="flex");const m=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=ft({type:"baseSectionPaddingY",value:s||"normal",defaultValue:""});return o.jsx(we,{component:"section",styles:{...c,...h},className:g.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:g.cx("section-content h-full"),sx:m,children:r.show?o.jsx(bt,{...d,boxed:r,children:e}):e})})}function bt({background:t="",backgroundVideoPoster:e,children:n,sx:i={},boxed:r={show:!1},className:s="",styles:d={},...a}){const l={...d,...i},c=mt.useColorConvert();let u=null;const m=xt.default(y=>y.breakpoints.up("sm")),h=Xt.default(),x=ye();return t&&(u=st(h,typeof t=="string"?c(t):t,l,e,x)),r.show&&(l.borderRadius="10px",l.padding===void 0&&(l.padding=m?"50px":"20px"),r!=null&&r.border&&(l.border="1px solid #c0c0c0"),r!=null&&r.background&&(u=st(h,typeof(r==null?void 0:r.background)=="string"?c(r==null?void 0:r.background):r==null?void 0:r.background,l,r==null?void 0:r.backgroundVideoPoster,x))),o.jsxs(p.Box,{...a,sx:{...l,...u?{position:"relative",overflow:"hidden",zIndex:0}:{}},className:g.cx(s,(r==null?void 0:r.boxShadow)&&"shadow-xl"),children:[u,n]})}const we=k.styled(bt)`
64
- &:nth-of-type(even) {
65
- background: #f8f8f8;
66
- }
67
-
68
- @media (max-width: 600px) {
69
- .section__title {
70
- font-size: 24px;
71
- }
72
-
73
- .base-info {
74
- > *:last-child {
75
- margin-bottom: 0;
76
- }
77
- }
78
- }
79
- `;function Q({icon:t,...e}){return o.jsx(pt.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 wt=["title","description","actions","badge","tag","prepend","append","logo"];function je({image:t,imageBorder:e,imageShadow:n,className:i,reverse:r=!1,fullSizeImage:s,...d}){const[a,l]=S(d,q),c=Object.keys(a).length>0&&Object.values(K.default(a,wt)).filter(Boolean).length>0&&o.jsx(E,{...a}),u=f.isValidElement(t)?t:o.jsx(p.Box,{component:"img",src:t,alt:"",className:"block"}),m=["phone","macbook"].includes(e),h=t&&o.jsx(p.Box,{className:g.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":m?{width:"100%",video:{borderRadius:"0 !important"}}:void 0},children:m?o.jsx(Qt.default,{type:e,sx:{width:"100%"},children:u}):u});return o.jsx(L,{className:g.cx("section--block",i,s&&!r&&g.css`
80
- .section-bg {
81
- height: 80%;
82
- }
83
- `),...l,boxProps:s?{sx:{padding:0,overflow:"hidden"}}:void 0,children:o.jsx(X,{col:t?2:1,className:s?g.css`
84
- display: flex;
85
- flex-direction: column;
86
-
87
- > .base-info,
88
- > .section__image {
89
- width: 100%;
90
-
91
- > img,
92
- > video {
93
- width: 100%;
94
- }
95
- }
96
- `:void 0,children:r?o.jsxs(o.Fragment,{children:[h,c]}):o.jsxs(o.Fragment,{children:[c,h]})})})}const A=["editing","height","locale","dev","sx"];function _e(t){const{className:e,...n}=t;return o.jsx(ve,{...n,className:g.cx("BlockBase-root",e)})}const ve=k.styled(p.Box)`
97
- position: relative;
98
- color: ${({theme:t})=>t.palette.text.primary};
99
- `;function ke({widget:t,reverse:e,projectId:n,assistantId:i,working:r,submitTitle:s,submitIcon:d,submitColor:a,placeholder:l,loadingIndicator:c,section:u,...m}){const[{editing:h},x]=S(m,A),[y,w]=S(x,q),b=n&&i?{projectId:n,gitRef:"main",assistantId:i,working:!0}:void 0,v={children:s,endIcon:d?o.jsx(Q,{icon:d}):void 0,sx:{background:a||void 0,":hover":{background:a||void 0,opacity:.8}}},_=[],P=l&&o.jsx(p.Typography,{variant:"caption",color:"text.disabled",children:l}),I=c&&o.jsx(p.Typography,{variant:"caption",color:"text.disabled",children:c});Object.keys(y).length>0&&Object.values(K.default(y,wt)).filter(Boolean).length>0&&_.push(o.jsx(E,{...y},"base-info")),b&&(t==="form"?_.push(o.jsx(F.AIForm,{identifier:b,SubmitProps:v},"form")):t==="result"?_.push(o.jsx(F.AIFormResult,{identifier:b,placeholder:P,loadingIndicator:I},"result")):_.push(o.jsxs(p.Stack,{width:"100%",gap:2,direction:"row",children:[o.jsx(F.AIForm,{identifier:b,BoxProps:{flex:1},SubmitProps:v}),o.jsx(F.AIFormResult,{identifier:b,BoxProps:{flex:1},placeholder:P,loadingIndicator:I})]},"form-result"))),e&&_.reverse();const et=p.useTheme(),vt=f.useMemo(()=>p.createTheme(Rt.deepmerge(et,{palette:{primary:a?{main:a}:void 0}})),[a,et]);return o.jsx(Wt.ErrorBoundary,{fallbackRender:j.ErrorView,children:o.jsx(p.ThemeProvider,{theme:vt,children:o.jsx(L,{...w,sx:h?{pointerEvents:"none"}:{},children:o.jsx(X,{col:_.length,children:_})})})})}const jt=f.createContext({pages:[],project:void 0}),{Provider:$e,Consumer:vo}=jt;function _t(){return f.useContext(jt)}function Se({icon:t,className:e="",size:n="1rem",...i}){return o.jsx(Ce,{component:Q,className:g.cx("css-icon",e),size:n,...i,icon:t})}const Ce=k.styled(p.Box)`
100
- &.css-icon {
101
- display: inline-block;
102
- width: ${({size:t})=>t};
103
- height: ${({size:t})=>t};
104
- }
105
- `;function Ne({icon:t,className:e="",size:n="1rem",imageMeta:i,...r}){const s=j.autoResizeImage(j.getImageAbsoluteUrl(t),540),[d,a]=f.useState(!1),l=k.useTheme();return d?o.jsx(Se,{icon:"i-mdi:image",color:l.palette.grey[500],size:n,className:e,...r}):o.jsx(Be,{className:g.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 Be=k.styled(p.Box)`
106
- display: inline-block;
107
- width: ${({size:t})=>t};
108
- height: ${({size:t})=>t};
109
- .image-icon__image {
110
- object-fit: contain;
111
- height: 100%;
112
- width: 100%;
113
- }
114
- `,Z=t=>typeof t=="string"&&/^[\w-_]+:[\w-_]+$/.test(t);function Y({icon:t,size:e="1rem",imageMeta:n,...i}){const r=window.isNaN(e)?e:`${e}px`;return Z(t)?o.jsx(pt.Icon,{icon:t}):o.jsx(Pe,{component:Ne,imageMeta:n,className:"base-icon",icon:t,size:r,...i})}const Pe=k.styled(p.Box)`
115
- flex-shrink: 0;
116
- `;function z({text:t,children:e,icon:n="",endIcon:i,color:r="primary",link:s="",href:d="",...a}){const l=n?o.jsx(Y,{icon:n}):null,c=i?o.jsx(Y,{icon:i}):null,u=s||d,m={...a};return u&&(m.href=u,H.default(u)&&(m.target=m.target||"_blank")),o.jsx(Zt.default,{startIcon:l,endIcon:c,color:r,...m,children:t||e})}function tt({editing:t,text:e,...n}){const{pages:i=[]}=_t(),r=i.find(s=>s.id===(n.link||n.linkId));if(t)return o.jsx(z,{...C.default(n,["link","linkId"]),children:e});if(r){const s=r.path||"/";return o.jsx(G.Link,{to:s,children:o.jsx(z,{...C.default(n,["link","linkId"]),children:e})})}return o.jsx(z,{...C.default(n,"linkId"),children:e})}function B({type:t="",icon:e="",size:n="3rem",className:i="",...r}){return o.jsx(Y,{icon:e||t,size:n,className:g.cx("content-icon",i),...r})}B.propTypes={};B.defaultProps={type:"",icon:"",size:"3rem",color:"inherit",className:""};function Ie({to:t,base:e,children:n,className:i,activeClassName:r="active",target:s="auto",autoExternalMark:d=!1,useRouterLink:a,...l}){const{pages:c=[],locale:u=""}={},m=e?D.join("/",e):e||"";let h=s==="auto"?"_self":s,x=D.join(m,t);const y=d?H.default(x):!1;if(e)return x=D.join(m,u,t),o.jsx("a",{className:`no-underline ${i}`,href:T.withoutTrailingSlash(x),rel:"noreferrer noopener",target:h,...l,children:n});if(H.default(t))s==="auto"&&(h="_blank"),x=t;else{T.isRelative(x)&&(x=D.join(window.location.pathname,x));const w=T.parseURL(`${window.location.origin}${x}`),b=c.some(v=>v.pathname===w.pathname);if(a||b)return o.jsx(G.NavLink,{end:!0,to:T.withoutTrailingSlash(x),className:({isActive:v})=>g.cx(i,v?r:""),...l,children:n})}return o.jsxs("a",{className:`no-underline ${i}`,href:T.withoutTrailingSlash(x),rel:"noreferrer noopener",target:h,...l,children:[n,y&&o.jsx(B,{icon:"i-mdi:arrow-top-right",size:"0.9em",className:"smart-link__mark",style:{marginLeft:5}})]})}function O({prepend:t,append:e,children:n,className:i="",dark:r=!1,border:s=!0,...d}){let a={};const{pages:l=[]}=_t(),c=l.find(h=>h.id===d.link),u=!n||Gt.default.Children.toArray(n).every(h=>h===null);d.link&&(a={component:Ie,to:(c==null?void 0:c.path)||d.link,useRouterLink:!0});const m=p.useTheme();return o.jsxs(Re,{className:g.cx("base-card card",{dark:r,"border-transparent":!s},i),sx:{borderColor:m.palette.divider},...a,...C.default(d,["listType","dark","iconColor","link","hoverStyle","imageSize"]),children:[t,!u&&o.jsx("div",{className:"card__body",children:n}),e]})}const Re=k.styled(p.Box)`
117
- &.base-card {
118
- text-align: left;
119
- border-width: 1px;
120
- border-style: solid;
121
- border-radius: 12px;
122
- overflow: hidden;
123
- &,
124
- &:hover {
125
- text-decoration: none;
126
- }
127
- }
128
- .card__body {
129
- padding: 15px 15px;
130
- }
131
- `;function U({align:t="left",title:e,titleProps:n={},description:i,descriptionProps:r={}}){return o.jsxs(o.Fragment,{children:[e&&o.jsx(p.Typography,{className:g.cx("card__title text-gray-800","dark:text-gray-50"),component:"h5",variant:"h5",gutterBottom:!0,align:t,...n,children:e}),i&&o.jsx(p.Typography,{className:g.cx("card__description","text-gray-500","dark:text-gray-400"),component:"div",variant:"body1",gutterBottom:!0,align:t,...r,children:i})]})}function Te({image:t,title:e,description:n,imageProps:i={},imageMeta:r,imageSize:s,titleProps:d={},descriptionProps:a={},actions:l,align:c,...u}){const m=Z(t),h=j.autoResizeImage(j.getImageAbsoluteUrl(t),540);return o.jsxs(We,{className:"card-article",...u,prepend:o.jsx("div",{className:"card__image__wrap",children:m&&t?o.jsx(p.Box,{sx:{position:"absolute",left:0,top:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"},children:o.jsx(B,{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(U,{align:c,title:e,titleProps:d,description:n,descriptionProps:a}):null,l!=null&&l.length?o.jsx(R,{align:c,actions:l,className:"mt-4"}):null]})}const We=k.styled(O)`
132
- ${t=>t.hoverStyle==="none"?"":t.link?`transition: box-shadow ease .3s;
133
- &:hover {
134
- box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
135
- }`:""}
136
-
137
- .card__title {
138
- color: ${({theme:t})=>t.palette.text.primary};
139
- a {
140
- color: ${({theme:t})=>t.palette.primary.main};
141
- }
142
- }
143
- .card__description {
144
- color: ${({theme:t})=>t.palette.text.primary};
145
- a {
146
- color: ${({theme:t})=>t.palette.primary.main};
147
- }
148
- }
149
-
150
- .card__image__wrap {
151
- padding-top: 61.8%;
152
- width: 100%;
153
- position: relative;
154
- }
155
- .card__image {
156
- position: absolute;
157
- top: 0;
158
- left: 0;
159
- bottom: 0;
160
- right: 0;
161
- width: 100%;
162
- height: 100%;
163
- object-position: top center;
164
- }
165
- `,at="section";function lt({title:t,image:e,imageMeta:n,description:i,actions:r,align:s,listType:d="",className:a="",...l}){return o.jsxs(ze,{className:g.cx("card",`list-type-${d}`,a),align:s,...l,children:[e&&o.jsx(B,{icon:e,color:"primary.main",size:d==="icon-title"?"1.2rem":"3rem",imageMeta:n}),t||i?o.jsx(U,{align:s,title:t,description:i}):null,r!=null&&r.length?o.jsx(R,{align:s,actions:r,className:"mt-4"}):null]})}const ze=k.styled(O)`
166
- padding: 5vw 4vw;
167
- box-sizing: border-box;
168
- /* min-height: 320px; */
169
- color: inherit !important;
170
- border-radius: 0.5rem;
171
- /* ${({dark:t,theme:e})=>`background-color:${t?e.palette.grey[900]:e.palette.common.white};`} */
172
- @media (max-width: ${({theme:t})=>t.breakpoints.values[at]}px) {
173
- padding: 1.5rem 2rem;
174
- }
175
- @media (max-width: ${({theme:t})=>t.breakpoints.values.sm}px) {
176
- height: auto;
177
- min-height: unset;
178
- }
179
-
180
- ${t=>t.hoverStyle==="none"?"":t.link?`transition: box-shadow ease .3s;
181
- &:hover {
182
- box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
183
- }`:""}
184
-
185
- .card__title {
186
- font-weight: 700;
187
- margin-top: 24px;
188
- margin-bottom: 12px;
189
- color: ${({theme:t})=>t.palette.text.primary};
190
- a {
191
- color: ${({theme:t})=>t.palette.primary.main};
192
- }
193
- }
194
- .card__description {
195
- color: ${({theme:t})=>t.palette.text.primary};
196
- a {
197
- color: ${({theme:t})=>t.palette.primary.main};
198
- }
199
- }
200
- .card__body {
201
- color: ${({theme:t})=>t.palette.text.primary};
202
- padding: 0;
203
- ${({align:t})=>`text-align:${t||"left"};`}
204
- }
205
-
206
- &.list-type-icon-title {
207
- padding: 1.2rem;
208
- .title-line {
209
- display: flex;
210
- }
211
- .card__title {
212
- margin: 0;
213
- font-size: 1em;
214
- }
215
- .css-icon {
216
- margin-right: 0.5rem;
217
- }
218
- }
219
-
220
- @media (min-width: ${({theme:t})=>t.breakpoints.values[at]}px) {
221
- padding: 2rem 2rem;
222
- text-align: left;
223
- box-sizing: border-box;
224
- }
225
- `;function Ee({image:t,title:e,description:n,imageProps:i={},imageMeta:r,imageSize:s,titleProps:d={},descriptionProps:a={},actions:l,align:c,...u}){const m=Z(t),h=j.autoResizeImage(j.getImageAbsoluteUrl(t),540);return o.jsxs(qe,{className:"card-article",...u,prepend:o.jsx("div",{className:"card__image__wrap",children:m&&t?o.jsx(p.Box,{sx:{position:"absolute",left:0,top:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"},children:o.jsx(B,{icon:t,color:"primary.main"})}):h&&o.jsx(p.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(U,{align:c,title:e,titleProps:d,description:n,descriptionProps:a}):null,l!=null&&l.length?o.jsx(R,{align:c,actions:l,className:"mt-4"}):null]})}const qe=k.styled(O)`
226
- ${t=>t.hoverStyle==="none"?"":t.link?`transition: box-shadow ease .3s;
227
- &:hover {
228
- box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
229
- }`:""}
230
-
231
- border-radius: 0 !important;
232
-
233
- .card__body {
234
- ${({align:t})=>`text-align:${t||"left"};`}
235
- }
236
-
237
- .card__image__wrap {
238
- width: 100%;
239
- height: 100%;
240
- position: relative;
241
- display: flex;
242
- justify-content: center;
243
- align-items: center;
244
- }
245
-
246
- .card__image {
247
- max-height: 60px;
248
- }
249
- `,ct="section";function Le({title:t,image:e,imageMeta:n,iconSize:i=100,description:r,actions:s,align:d,className:a="",...l}){return o.jsx(Ae,{className:g.cx("card",a),...l,children:o.jsxs(p.Box,{className:"flex items-center",children:[e&&o.jsx(B,{icon:e,color:"primary.main",size:i,imageMeta:n}),o.jsxs(p.Box,{className:"flex-1 ml-4",children:[o.jsx(U,{align:d,title:t,description:r}),o.jsx(R,{align:d,actions:s,className:"mt-4"})]})]})})}const Ae=k.styled(O)`
250
- padding: 5vw 4vw;
251
- text-align: left;
252
- box-sizing: border-box;
253
- /* min-height: 320px; */
254
- color: inherit !important;
255
- border-radius: 0.5rem;
256
- /* ${({dark:t,theme:e})=>`background-color:${t?e.palette.grey[900]:e.palette.common.white};`} */
257
- @media (max-width: ${({theme:t})=>t.breakpoints.values[ct]}px) {
258
- padding: 1.5rem 2rem;
259
- }
260
- @media (max-width: ${({theme:t})=>t.breakpoints.values.sm}px) {
261
- height: auto;
262
- min-height: unset;
263
- }
264
-
265
- ${t=>t.hoverStyle==="none"?"":t.link?`transition: box-shadow ease .3s;
266
- &:hover {
267
- box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
268
- }`:""}
269
-
270
- .card__title {
271
- font-weight: 700;
272
- margin-bottom: 12px;
273
- color: ${({theme:t})=>t.palette.text.primary};
274
- a {
275
- color: ${({theme:t})=>t.palette.primary.main};
276
- }
277
- }
278
- .card__description {
279
- color: ${({theme:t})=>t.palette.text.primary};
280
- a {
281
- color: ${({theme:t})=>t.palette.primary.main};
282
- }
283
- }
284
- .card__body {
285
- padding: 0;
286
- }
287
-
288
- &.list-type-icon-title {
289
- padding: 1.2rem;
290
- .title-line {
291
- display: flex;
292
- }
293
- .card__title {
294
- margin: 0;
295
- font-size: 1em;
296
- }
297
- .css-icon {
298
- margin-right: 0.5rem;
299
- }
300
- }
301
-
302
- @media (min-width: ${({theme:t})=>t.breakpoints.values[ct]}px) {
303
- padding: 2rem 2rem;
304
- text-align: left;
305
- box-sizing: border-box;
306
- }
307
- `;function Oe({title:t,titleProps:e={},description:n,descriptionProps:i={},image:r,imageMeta:s,className:d="",align:a,hoverStyle:l,...c}){return o.jsxs(Ue,{className:g.cx("card-simple",d,`hover-style__${l}`),align:a,...c,children:[r&&o.jsx(B,{icon:r,color:"primary.main",imageMeta:s}),t||n?o.jsx(U,{align:a,title:t,titleProps:e,description:n,descriptionProps:i}):null]})}const Ue=k.styled(O)`
308
- .card__title {
309
- color: ${({theme:t})=>t.palette.text.primary};
310
- a {
311
- color: ${({theme:t})=>t.palette.primary.main};
312
- }
313
- }
314
- .card__description {
315
- color: ${({theme:t})=>t.palette.text.primary};
316
- a {
317
- color: ${({theme:t})=>t.palette.primary.main};
318
- }
319
- }
320
-
321
- &.hover-style__default {
322
- &.card-simple {
323
- &:hover {
324
- border-top-right-radius: 36px;
325
- }
326
- }
327
- .card__body {
328
- &:hover {
329
- &::before {
330
- width: 42px;
331
- height: 42px;
332
- transform: translate(50%, -50%) rotate(45deg);
333
- }
334
- &::after {
335
- transform: none;
336
- }
337
- }
338
- }
339
- }
340
-
341
- &.card-simple {
342
- border-radius: 8px;
343
- border-top-right-radius: 26px;
344
-
345
- .card__body {
346
- ${({align:t})=>`text-align:${t||"left"};`}
347
- }
348
-
349
- ${t=>t.link?`
350
- cursor: pointer;
351
- `:""}
352
- /* cursor: pointer; */
353
- /* &:hover {
354
- border-top-right-radius: 36px;
355
- } */
356
- transition: all 180ms ease 0s;
357
- overflow: visible;
358
- .card__title {
359
- margin: 12px 0;
360
- }
361
- .card__body {
362
- position: relative;
363
- padding: 20px 16px 18px;
364
- overflow: hidden;
365
- transition: all 180ms ease 0s;
366
- /* &:hover {
367
- &::before {
368
- width: 42px;
369
- height: 42px;
370
- transform: translate(50%, -50%) rotate(45deg);
371
- }
372
- &::after {
373
- transform: none;
374
- }
375
- } */
376
- &::before,
377
- &::after {
378
- content: ${({border:t})=>t?'""':""};
379
- transition: inherit;
380
- position: absolute;
381
- top: 0px;
382
- right: 0px;
383
- }
384
- &::before {
385
- z-index: 3;
386
- background: #fff;
387
- width: 30px;
388
- height: 30px;
389
- transform: translate(50%, -50%) rotate(45deg);
390
- box-shadow: 0 1px 0 0 #e9eaec;
391
- }
392
- &::after {
393
- z-index: 2;
394
- width: 28px;
395
- height: 28px;
396
- border-bottom-left-radius: 6px;
397
- background: #fcfcfd;
398
- box-shadow: -1px 1px 0 0 #e9eaec;
399
- transform: translate(8px, -8px);
400
- }
401
- }
402
- }
403
- `;function Fe({type:t="default",...e}){const i={article:Te,simple:Oe,news:Le,default:lt,wall:Ee}[t]||lt;return o.jsx(i,{...t==="news"?e:C.default(e,"iconSize")})}function De({list:t=[],align:e="top",cards:n,listBorder:i=!0,listType:r="",col:s=3,gap:d,iconColor:a,className:l="",type:c="default",dark:u=!1,textAlign:m="left",hoverStyle:h,...x}){return o.jsx(X,{type:c,className:g.cx("card-list py-1",l,"items-stretch"),col:s,gap:d,align:e,...x,children:n||t.map(y=>o.jsx(Fe,{borderColor:i,iconColor:a,type:c,listType:r,dark:u,...y,align:m,style:d===0&&t.length>1?{borderRadius:0,marginRight:"-1px",marginBottom:"-1px"}:{}},y.id))})}const Me=["align","cards","list","listBorder","listType","col","gap","iconColor","type","textAlign"],Ve=k.styled(L)`
404
- a .card {
405
- color: #404040;
406
- cursor: pointer;
407
- }
408
- a:not(.MuiButton-root) {
409
- color: ${({theme:t})=>t.palette.primary.main};
410
- &:hover,
411
- &:active {
412
- color: ${({theme:t})=>t.palette.primary.main};
413
- }
414
- }
415
- a:hover .card {
416
- color: #404040;
417
- }
418
- `;function He({className:t,...e}){const[n,i]=S(e,q),[r,s]=S(i,Me);return o.jsxs(Ve,{className:g.cx("section--card-list",t),type:e.type,...s,children:[Object.keys(n).length>0&&o.jsx(E,{center:!0,...n,className:"mb-[2.5vw]"}),o.jsx(De,{...r,dark:!!e.dark})]})}const Ye=k.styled(He)`
419
- .card__description {
420
- white-space: pre-wrap;
421
- }
422
- .section__description {
423
- }
424
- .card {
425
- /* background: inherit !important; */
426
- }
427
- &.dark .card-simple .card__body::before {
428
- background: #212121 !important;
429
- }
430
- .card-simple .card__body::after {
431
- background: inherit !important;
432
- }
433
- `;function Je({section:t,...e}){const[{editing:n},i]=S(e,A),r=f.useMemo(()=>{var s;return{...C.default(i,["listBorder","list","iconSize","imageSize"]),list:(s=i.list)==null?void 0:s.map(d=>{var a,l;return{...C.default(d,"icon","iconColor"),image:["news","simple","default"].includes(i.type)&&d.icon?d.icon:d.image,actions:(l=(a=d.actions)==null?void 0:a.map)==null?void 0:l.call(a,c=>o.jsx(tt,{...c,editing:n},c.id)),border:i.listBorder,iconSize:i.iconSize,imageSize:i.imageSize,hoverStyle:i.hoverStyle}})}},[i]);return o.jsx(Ye,{style:n?{pointerEvents:"none"}:{},...r})}function Ge({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(p.Box,{textAlign:"center",py:2,children:o.jsx(p.Typography,{variant:"caption",color:"text.secondary",children:"Please select component to render"})})}function Ke({src:t,dataId:e,isEdit:n=!1,height:i="100%",onLoad:r=()=>{}}){return o.jsx(Yt.EmbedIframe,{isEdit:n,embedId:e,src:t,height:i,onLoad:()=>{r()}})}function Xe({dataId:t,src:e,actions:n,center:i,onLoad:r,...s}){const[d,a]=S(s,q);return o.jsxs(L,{...a,children:[Object.keys(d).length>0&&o.jsx(E,{center:i,...d}),o.jsx(Ke,{dataId:t,src:e,onLoad:r,height:s.iframeHeight?`${s.iframeHeight}px`:"100%"}),o.jsx(R,{actions:n,center:i})]})}const Qe={src:"",embedUrl:"",title:"",description:"",dark:!1,background:"",center:!0,config:{},id:""};function Ze({section:t,id:e,src:n,...i}){const r=`${e}-${i.locale}`,[{editing:s},d]=S(i,A),a=f.useRef({}),l=JSON.parse(JSON.stringify(d)),{message:c}=Mt.useMessage(r,"server"),u=Vt.useLatest(JSON.parse(JSON.stringify(d.config)||"{}"));return f.useEffect(()=>{c&&c.onInit(()=>u.current)},[c]),f.useEffect(()=>{const m=JSON.parse(JSON.stringify(d.config)||"{}");te.default(a.current,m)||(a.current=m,c==null||c.send("config-set",m))},[c,d.config]),n?o.jsx(Xe,{...l,dataId:r,src:n,style:s?{pointerEvents:"none"}:{}}):o.jsx(to,{children:'Please set the "src" attribute for this block'})}const to=k.styled("div")`
434
- user-select: none;
435
- color: #999;
436
- padding: 8px;
437
- height: 200px;
438
- `,eo=[/youtu\.be\/([^#&?]{11})/,/\?v=([^#&?]{11})/,/&v=([^#&?]{11})/,/embed\/([^#&?]{11})/,/\/v\/([^#&?]{11})/];function oo(t){var e;if(/youtu\.?be/.test(t))for(const n of eo){const i=(e=n.exec(t))==null?void 0:e[1];if(i)return i}}function ro(t){const e=oo(t);if(e)return`https://youtube.com/embed/${e}`}function no({src:t}){return f.useEffect(()=>{import("@lottiefiles/lottie-player")},[]),o.jsx("lottie-player",{autoplay:!0,loop:!0,mode:"normal",src:t})}function io(t){return o.jsx(p.Box,{maxHeight:400,overflow:"hidden auto",children:o.jsx(Jt.TwitterTimelineEmbed,{...t})})}function so({url:t}){const e=f.useRef(null),n=495,[i,r]=f.useState(e.current?e.current.offsetWidth*.5625:n),s=f.useCallback(()=>{const d=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*d))},[]);return f.useEffect(()=>{window.addEventListener("resize",s);const d=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*d)),function(){window.removeEventListener("resize",s)}},[i,s]),o.jsx(p.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 ao={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},lo=k.styled(je)`
439
- .section__description {
440
- }
441
- `;function co({hasImage:t,fullSizeImage:e,boxed:n,videoPoster:i,imageMeta:r,imageOptimization:s,imageSize:d,section:a,...l}){var x,y;const[{editing:c},u]=S({...l,boxed:e?void 0:n},A);let m=uo(u.image,i,e,r,s,d);t||(m=null);let h=null;return u.actions&&(h=(y=(x=u.actions)==null?void 0:x.map)==null?void 0:y.call(x,(w,b)=>o.jsx(tt,{...w,editing:c},b))),o.jsx(lo,{...u,style:c?{pointerEvents:"none"}:{},image:m,fullSizeImage:t&&e,actions:h})}function uo(t,e,n,i,r,s){if(t){if(t.endsWith(".json"))return o.jsx(no,{src:t});if(t.indexOf("twitter.com")!==-1)return o.jsx(io,{sourceType:"url",url:t});const d=ro(t);if(d)return o.jsx(so,{url:d});const{naturalWidth:a,naturalHeight:l,filename:c}=i||{};if(W(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:fe(t)})},t);const u=r==="quality"?1:.6;return o.jsx(J.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:c??t,style:{objectFit:s||"contain",display:"block",width:"100%",height:"100%"},loading:"lazy"})}return null}const mo=["production","draft"];function po({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 xo({mode:t,routes:e}){return j.api.post(`/api/${j.getProjectIdFromPathnameOrWindow()}/pages/publish`,{mode:t,routes:e}).then(n=>n.data)}function ho({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 fo={style:"list",sort:"-updatedAt"},dt=20;function go({style:t,sort:e,section:n,...i}){const[{editing:r,locale:s},d]=S(i,A),[a,l]=S(d,q),[c,u]=f.useState(),m=f.useRef(!1),h=nt.useUpdate(),x=G.useNavigate(),y=f.useCallback(async()=>{if(!m.current){m.current=!0,h();try{const w=c?Math.floor(c.list.length/dt)+1:1,{list:b,total:v}=await ho({locale:s,sort:e,page:w,limit:dt});u(_=>({list:((_==null?void 0:_.list)??[]).concat(b),total:v}))}finally{m.current=!1,h()}}},[c,s,e,h]);return nt.useMount(()=>{y()}),o.jsxs(L,{...l,sx:r?{pointerEvents:"none"}:{},children:[Object.keys(a).length>0&&o.jsx(E,{...a}),c?o.jsxs(o.Fragment,{children:[o.jsx(p.Grid,{container:!0,spacing:2,justifyContent:"center",children:c==null?void 0:c.list.map(w=>o.jsx(p.Grid,{item:!0,xs:12,sm:t==="card"?6:12,md:t==="card"?3:12,children:o.jsxs(yo,{elevation:0,className:g.cx(t==="card"&&"style-card"),onClick:r?void 0:()=>x(w.slug),children:[!!w.image&&o.jsx(p.CardMedia,{component:"img",alt:"",image:j.autoResizeImage(j.getImageAbsoluteUrl(w.image),540),loading:"lazy"}),o.jsxs(p.CardContent,{children:[o.jsx(p.Typography,{variant:"h6",component:"div",className:ut,children:w.title||w.id}),o.jsx(p.Typography,{variant:"body2",className:ut,children:w.description})]})]})},w.id))}),o.jsx(p.Box,{textAlign:"center",mt:2,children:c.total>c.list.length?o.jsx(z,{variant:"outlined",color:"secondary",onClick:y,loading:m.current,children:"More"}):o.jsx(z,{variant:"outlined",color:"secondary",disabled:!0,children:"No More"})})]}):o.jsx(p.Box,{p:2,textAlign:"center",children:o.jsx(p.CircularProgress,{size:24})})]})}const ut=g.css`
442
- display: -webkit-box;
443
- -webkit-box-orient: vertical;
444
- -webkit-line-clamp: 2;
445
- overflow: hidden;
446
- text-overflow: ellipsis;
447
- `,yo=k.styled(p.Card)`
448
- border: 1px solid #e0e0e0;
449
- background-color: transparent;
450
- cursor: pointer;
451
- display: flex;
452
- color: inherit;
453
-
454
- > .MuiCardMedia-root {
455
- width: 30vw;
456
- max-height: 50vw;
457
- }
458
-
459
- &.style-card {
460
- display: block;
461
-
462
- > .MuiCardMedia-root {
463
- width: 100%;
464
- max-height: 50vw;
465
- }
466
- }
467
- `,bo={iframe:Ze,section:co,"section-card-list":Je,toc:go,"ai-runtime":ke,"custom-component":Ge};function wo({id:t,type:e,mode:n,config:i,section:r,...s}){const d=bo[e],{getPageMetaStyle:a}=de(),l=f.useMemo(()=>{const{height:m,...h}=i;return h},[i]),c=f.useMemo(()=>{const m={};return e!=="custom-component"&&(m.height=i.height),m.sx=a("sx"),m},[i.height,e,a]),u=d&&o.jsx(d,{mode:n,...l,id:t,section:r});return o.jsx(_e,{...s,...c,children:u})}function jo(t){return t!=null}exports.Action=tt;exports.BlockRenderer=wo;exports.IFrameBlockDefaultProps=Qe;exports.Icon=Q;exports.PageProvider=ue;exports.Provider=$e;exports.STATE_MODES=mo;exports.SectionBlockDefaultProps=ao;exports.TocDefaultProps=fo;exports.getPages=po;exports.nonNullable=jo;exports.publishPages=xo;
@@ -1,38 +0,0 @@
1
- "use strict";const e=require("react/jsx-runtime"),S=require("./state-jCG5gSUJ.js"),Z=require("@arcblock/ux/lib/Locale/context"),de=require("@arcblock/ux/lib/Result"),pe=require("@blocklet/pages-kit/builtin/page/header"),ge=require("@blocklet/pages-kit/contexts/color"),ee=require("@blocklet/pages-kit/utils/data-source"),me=require("@blocklet/pages-kit/utils/route"),fe=require("@blocklet/ui-react/lib/Header"),te=require("@emotion/css"),A=require("@emotion/react"),he=require("@emotion/styled"),v=require("@mui/material"),G=require("ahooks"),xe=require("isomorphic-dompurify"),je=require("lodash/cloneDeep"),ye=require("lodash/isEmpty"),be=require("lodash/isEqual"),f=require("react"),ve=require("react-helmet"),P=require("react-router-dom"),ne=require("react-use"),C=require("ufo"),E=require("./array-CJC7ex3i.js"),W=require("@arcblock/ux/lib/Theme"),Pe=require("@blocklet/ui-react/lib/Footer");require("webfontloader");const J=require("./session-BA7Qrcia.js"),q=t=>t&&t.__esModule?t:{default:t},oe=q(de),we=q(fe),re=q(he),Re=q(xe),N=q(je),ke=q(ye),se=q(be),Se=q(Pe),qe=W.styled(Se.default,{shouldForwardProp:t=>!!t})`
2
- & > div > .MuiContainer-root {
3
- max-width: unset;
4
- }
5
- `;function _e({meta:t,...o}){const a=W.useTheme();return e.jsx(qe,{...o,meta:t,theme:a||{}})}function ae(t){return e.jsx(v.Box,{display:"flex",flex:1,height:"100%",alignItems:"center",justifyContent:"center",...t,children:e.jsx(v.CircularProgress,{size:30})})}function Ce(t){return e.jsx(Ee,{...t})}const Ee=W.styled(v.Box)`
6
- position: fixed;
7
- left: 0;
8
- top: 0;
9
- z-index: 999999999999;
10
- width: 80px;
11
- font-size: 12px;
12
- text-align: center;
13
- opacity: 0.7;
14
- transform: translateX(-23%) translateY(70%) rotate(-45deg);
15
- pointer-events: none;
16
- `,Ie=`Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
17
- sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'`;function Me({titleFontFamily:t,descriptionFontFamily:o}){var n;const a=v.useTheme(),s=(n=a==null?void 0:a.typography)==null?void 0:n.fontFamily;f.useEffect(()=>{},[t,o]);const c=`${s}, ${Ie}`;return e.jsx(A.Global,{styles:A.css`
18
- #app {
19
- font-family: ${c};
20
-
21
- .page-kit-section__title {
22
- font-family: ${c};
23
- }
24
-
25
- .page-kit-section__description {
26
- font-family: ${c};
27
- }
28
- }
29
- `})}function Be(){const[t]=P.useSearchParams(),{session:o}=J.useSessionContext(),a=J.useIsRoleOrMultiTenant("owner","admin","pagesEditor","member"),s=f.useMemo(()=>{const n=t.get("mode");return E.STATE_MODES.includes(n)?n:"production"},[t]),c=s==="production"?s:o.user?a?s:"production":null;return c?e.jsx(ce,{mode:c}):null}function ce({mode:t}){if(t!=="draft"){const o=window.__PAGE_STATE__;return o?e.jsx(H,{mode:t,state:o}):e.jsx(Te,{mode:t,children:({state:a})=>e.jsx(H,{mode:t,state:a})})}return e.jsx(Le,{children:({state:o})=>e.jsx(H,{mode:t,state:o})})}const Le=f.lazy(()=>Promise.resolve().then(()=>require("./draft-data-Cu9gua-P.js")));function Te({mode:t,children:o}){const a=document.querySelector('meta[property="pages:version"]'),s=a==null?void 0:a.content,c=S.useProjectId(),n=f.useMemo(()=>{if(s==="{{pagesPublishedAt}}"){const u=localStorage.getItem(S.getProjectPageVersionKey(c??""));return Number(u)?Number(u):new Date().getTime()}return Number(s)},[s]),{loading:p,value:i}=ne.useAsync(()=>E.getPages({mode:t,version:n}),[t,n]);return p?e.jsx(ae,{}):i?o({state:i}):null}function H({mode:t,state:o}){const{t:a,locale:s}=Z.useLocaleContext(),[c]=P.useSearchParams(),n=S.useProjectId(),p=S.useProjectSlug(),i=c.get("hiddenBadge")==="true",u=c.get("showPublish")==="true",{pageIds:h,pages:d,routeIds:g,routes:x,supportedLocales:j,config:{defaultLocale:y},resources:I}=o,m=S.getAllComponents(o),w=f.useMemo(()=>j!=null&&j.some(l=>l.locale===s)?s:void 0,[s,j]),T=Object.values(x||{}).find(l=>(l==null?void 0:l.path)==="/")||Object.values(d).find(l=>(l==null?void 0:l.slug)==="/")?void 0:Object.values(d)[0],F=f.useMemo(()=>t==="production"?h.map(l=>{const r=d[l];return r&&{id:r.id,path:C.joinURL("/",p||n||"",r.slug)}}).filter(E.nonNullable):g.map(l=>{const r=x[l];return r?{id:r.id,path:C.joinURL("/",p||n||"",r.path,`?mode=${t}&showPublish=true`)}:null}).filter(E.nonNullable),[h,d,t,x,g,n,p]),_=([...l])=>(t!=="production"&&u&&l.unshift(e.jsx(f.Suspense,{fallback:e.jsx("div",{}),children:e.jsx(Oe,{mode:"production",state:o})})),l);return e.jsxs(E.Provider,{value:{pages:F},children:[e.jsxs(P.Routes,{children:[T&&e.jsx(P.Route,{index:!0,element:e.jsx(P.Navigate,{to:C.joinURL("/",w||"",T.slug)})}),g==null?void 0:g.map(l=>{var R,b,k,U;const r=x==null?void 0:x[l];if(!r||!r.displayTemplateId)return null;const M=d[r.displayTemplateId];if(!M)return null;let B=[];if(r.params&&r.params.length>0){const L=me.generateParamCombinations({basePath:r.path,params:r.params,routeId:r.id,paramsOptions:r.paramsOptions,currentIndex:0,currentParams:[],currentOptionIds:[],result:[]});B=L==null?void 0:L.map(D=>{var K,Q,X,Y;const $=D.paramOptionIds.join("-");return e.jsx(P.Route,{path:C.joinURL(":projectIdOrSlug?",D.path),element:e.jsx(z,{mode:t,components:m,page:M,locale:w,defaultLocale:y,headerAddons:_,state:o,pageData:(Y=(X=(Q=(K=r.dataSource)==null?void 0:K.pathDataMappings)==null?void 0:Q[$])==null?void 0:X.dataCache)==null?void 0:Y[w||y||"en"]})},$)})}return B.push(e.jsx(P.Route,{path:C.joinURL(":projectIdOrSlug?",r.path),element:e.jsx(z,{mode:t,components:m,page:M,locale:w,defaultLocale:y,headerAddons:_,state:o,pageData:(U=(k=(b=(R=r.dataSource)==null?void 0:R.pathDataMappings)==null?void 0:b[r.id])==null?void 0:k.dataCache)==null?void 0:U[w||y||"en"]})},r.id)),B}),h.map(l=>{const r=d[l];return r?e.jsx(P.Route,{path:C.joinURL(":projectIdOrSlug?",r.slug),element:e.jsx(O,{mode:t,components:m,page:r,locale:w,defaultLocale:y,headerAddons:_})},r.id):null}),I.pages&&Object.values(I.pages).map(({blockletId:l,page:r})=>e.jsx(P.Route,{path:C.joinURL("/",`@${l}`,r.slug),element:e.jsx(O,{mode:t,components:m,page:r,locale:w,defaultLocale:y,headerAddons:_})},r.id)),e.jsx(P.Route,{path:"*",element:e.jsx(v.Box,{width:"100vw",height:"100vh",display:"flex",justifyContent:"center",alignItems:"center",children:e.jsx(oe.default,{status:404,extra:e.jsx(ue,{href:"/",children:a("common.back")})})})})]}),t!=="production"&&!i&&e.jsx(Ce,{sx:{bgcolor:"info.light"},children:t}),e.jsx(Me,{})]})}function z({mode:t,pageData:o,components:a,page:s,locale:c,defaultLocale:n,headerAddons:p,state:i}){const u=G.useReactive({page:null});f.useEffect(()=>{const d=s||null;d?u.page=N.default(d):u.page=null},[s,u]);const h=f.useRef();return f.useEffect(()=>{se.default(o,h.current)||o&&u.page&&(ee.setPageDataSource(u.page,i,c,o),h.current=N.default(o))},[u.page,o,c,i]),u.page?e.jsx(O,{mode:t,components:a,page:u.page,locale:c,defaultLocale:n,headerAddons:p}):null}function De({mode:t,state:o,path:a,pageData:s}){const{t:c,locale:n}=Z.useLocaleContext(),{pages:p,supportedLocales:i,config:{defaultLocale:u},resources:h}=o,d=Object.values(p).find(m=>(m==null?void 0:m.slug)===a),g=Object.values(h.pages||{}).find(m=>m.page.slug===a),x=f.useMemo(()=>i!=null&&i.some(m=>m.locale===n)?n:void 0,[n,i]),j=G.useReactive({page:null});f.useEffect(()=>{const m=d||(g==null?void 0:g.page)||null;m?j.page=N.default(m):j.page=null},[d,g]);const y=f.useRef();if(f.useEffect(()=>{se.default(s,y.current)||s&&j.page&&(ee.setPageDataSource(j.page,o,x,s),y.current=N.default(s))},[{}]),!d&&!(g!=null&&g.page))return e.jsx(v.Box,{width:"100vw",height:"100vh",display:"flex",justifyContent:"center",alignItems:"center",children:e.jsx(oe.default,{style:{background:"inherit"},status:404,extra:e.jsx(ue,{href:"/",children:c("common.back")})})});const I=S.getAllComponents(o);return j.page?e.jsx(O,{mode:t,components:I,page:j.page,locale:x,defaultLocale:u}):null}function O({mode:t,components:o,page:a,locale:s,defaultLocale:c,headerAddons:n}){var w,V,T,F,_,l,r,M,B;const p=ge.useColorConvert(),i=((w=a.locales)==null?void 0:w[s])??((V=a.locales)==null?void 0:V[c])??{},u=i.title||((T=window.blocklet)==null?void 0:T.appName),h=i.description||((F=window.blocklet)==null?void 0:F.appDescription),d=S.autoResizeImage(S.getImageAbsoluteUrl(i.image),540),{logo:g,brand:x,description:j,...y}=pe.useHeaderState(),I=f.useMemo(()=>R=>{var k;let b=(n==null?void 0:n(R))??R;return b=((k=y.addons)==null?void 0:k.call(y,b))??b,b},[y.addons,n]),m=(_=i.header)!=null&&_.translucent?le:ie;return e.jsxs(E.PageProvider,{page:a,defaultLocale:c,currentLocale:s,children:[e.jsx(A.Global,{styles:A.css`
30
- body {
31
- background-color: ${p(!i.backgroundColor||i.backgroundColor==="transparent"?"background.default":i.backgroundColor)} !important;
32
- }
33
- `}),e.jsx(m,{hideNavMenu:!!((l=i.header)!=null&&l.hideNavMenus),translucentTextColor:(r=i.header)==null?void 0:r.translucentTextColor,...g?{logo:g}:{},...x?{brand:x}:{},...j?{description:j}:{},className:te.cx(((M=i.header)==null?void 0:M.sticky)&&"sticky","page-header"),maxWidth:!1,addons:I}),e.jsx(P.ScrollRestoration,{}),e.jsxs(ve.Helmet,{children:[e.jsx("title",{children:u}),e.jsx("meta",{name:"og:title",content:u}),e.jsx("meta",{name:"og:description",content:h}),e.jsx("meta",{name:"og:image",content:d}),e.jsx("meta",{name:"twitter:image:src",content:d}),e.jsx("meta",{name:"twitter:image",content:d}),e.jsx("meta",{property:"twitter:description",content:h}),e.jsx("meta",{property:"twitter:title",content:u}),e.jsx("meta",{name:"description",content:h})]}),e.jsx(v.Stack,{flexGrow:1,className:"PageView-root",sx:{"& .BlockBase-root:first-child":{pt:"0 !important"}},children:a.sectionIds.map(R=>{var L,D;const b=a.sections[R];if(!b||b.visibility==="hidden")return null;const k=(L=b.locales)==null?void 0:L[s],U=((D=b.locales)==null?void 0:D[c])??{};return e.jsx(E.BlockRenderer,{id:R,type:b.component,mode:t,section:b,config:{...ke.default(k)?U:k,locale:s,dev:t==="draft"?{mode:t,components:o,defaultLocale:c}:{mode:t}}},R)})}),!((B=i.footer)!=null&&B.hidden)&&e.jsx(_e,{})]})}const Oe=f.lazy(()=>Promise.resolve().then(()=>require("./publish-button-DvwoFH1F.js"))),ie=re.default(we.default)`
34
- &.sticky {
35
- position: sticky;
36
- top: 0;
37
- }
38
- `;function Fe({logo:t}){const[o,a]=f.useState(),s=v.useMediaQuery(n=>n.breakpoints.down("sm")),{value:c}=ne.useAsync(()=>{var i,u;const n=new URL(s?((i=window==null?void 0:window.blocklet)==null?void 0:i.appLogo)||"/.well-known/service/blocklet/logo":((u=window==null?void 0:window.blocklet)==null?void 0:u.appLogoRect)||"/.well-known/service/blocklet/logo-rect",window.location.origin);n.searchParams.delete("imageFilter"),n.searchParams.delete("f");const p=n.toString();return new Promise(h=>{fetch(p).then(d=>{const g=d.headers.get("content-type");g!=null&&g.includes("svg")&&d.text().then(x=>{a(x),h(null)}),h(d.url)})})},[s]);if(t)return t;if(o)return e.jsx(v.Box,{sx:{filter:"initial !important"},dangerouslySetInnerHTML:{__html:Re.default.sanitize(o)}});if(c){const n=new URL(c);n.searchParams.set("imageFilter","convert"),n.searchParams.set("f","png"),n.searchParams.set("h","80");const p=n.toString();return e.jsx("img",{src:p,alt:"logo"})}return null}function le({logo:t,translucentTextColor:o,...a}){const{top:s=0}=G.useScroll(()=>document.getElementById("app"))||{},c=v.useTheme();let n=Math.min(s/800,1),p="";return n>.1?(n=Math.max(n,.6),p=v.alpha(c.palette.text.primary,n)):p=o||"#EEEEEE",e.jsx(ie,{logo:e.jsx(Fe,{logo:t}),...a,className:te.cx(n<=.7&&"reverse-color"),style:{backgroundColor:v.alpha(c.palette.background.default,n),"--logo-invert":n<=.7?1-n/6:1-n},sx:{backdropFilter:n>=.6?"blur(10px)":"blur(0px)",transition:"all 0.3s ease",position:"fixed !important",left:0,top:0,right:0,bgcolor:"transparent","&.reverse-color":{".navmenu-root>.navmenu-sub>span,\n .navmenu-root>.navmenu-item,\n .header-addons>button,\n .header-addons>a,\n .header-addons>div>button":{color:`${p} !important`}},"& .navmenu--horizontal":{bgcolor:"transparent !important"},".header-logo > div":{filter:"invert(var(--logo-invert))"},".header-logo":{color:p}}})}const ue=re.default(v.Button)``;exports.Home=Be;exports.HomeView=ce;exports.Loading=ae;exports.PageRoutes=H;exports.PageView=O;exports.PageViewByPath=De;exports.PageViewWithDataSource=z;exports.TranslucentHeader=le;