@blocklet/pages-kit-inner-components 0.6.20 → 0.6.22

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,5 +1,5 @@
1
1
  import "./chunks/components-BWQM8y6L.js";
2
- import { c as O, a as b, b as h, S as y, e as L, f as U, h as q, d as v, g as z, i as C, m as F, t as G, j as J, u as K } from "./chunks/site-state-Dt2__Byi.js";
2
+ import { c as O, a as b, b as h, S as y, e as L, f as U, h as q, d as v, g as z, i as C, m as F, t as G, j as J, u as K } from "./chunks/site-state-CqlS8v17.js";
3
3
  import { nextId as Q } from "@blocklet/pages-kit/utils/common";
4
4
  import "@blocklet/pages-kit/utils/page-model";
5
5
  import "@blocklet/pages-kit/utils/property";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/pages-kit-inner-components",
3
- "version": "0.6.20",
3
+ "version": "0.6.22",
4
4
  "description": "Pages Kit inner components library",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -74,7 +74,7 @@
74
74
  "@arcblock/did-connect": "^3.0.33",
75
75
  "@arcblock/react-hooks": "^3.0.33",
76
76
  "@arcblock/ux": "^3.0.33",
77
- "@blocklet/ai-kit": "^0.2.6",
77
+ "@blocklet/aigne-hub": "^0.2.18",
78
78
  "@blocklet/ai-runtime": "^0.4.276",
79
79
  "@blocklet/code-editor": "^0.4.276",
80
80
  "@blocklet/embed": "^0.2.5",
@@ -119,7 +119,7 @@
119
119
  "@types/tz-lookup": "^6.1.2",
120
120
  "ahooks": "^3.8.1",
121
121
  "autoprefixer": "^10.4.20",
122
- "axios": "^1.7.4",
122
+ "axios": "^1.11.0",
123
123
  "circular-natal-horoscope-js": "^1.1.0",
124
124
  "compression": "^1.8.0",
125
125
  "cookie-parser": "^1.4.6",
@@ -203,8 +203,8 @@
203
203
  "yaml": "^2.5.0",
204
204
  "yjs": "^13.6.18",
205
205
  "zustand": "^4.5.5",
206
- "@blocklet/pages-kit": "^0.6.20",
207
- "@blocklet/pages-kit-block-studio": "^0.6.20"
206
+ "@blocklet/pages-kit": "^0.6.22",
207
+ "@blocklet/pages-kit-block-studio": "^0.6.22"
208
208
  },
209
209
  "devDependencies": {
210
210
  "@trivago/prettier-plugin-sort-imports": "^5.2.1",
@@ -1,475 +0,0 @@
1
- "use strict";var Ae=Object.create;var ae=Object.defineProperty;var Re=Object.getOwnPropertyDescriptor;var We=Object.getOwnPropertyNames;var Ee=Object.getPrototypeOf,ze=Object.prototype.hasOwnProperty;var Le=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of We(t))!ze.call(e,i)&&i!==n&&ae(e,i,{get:()=>t[i],enumerable:!(r=Re(t,i))||r.enumerable});return e};var Te=(e,t,n)=>(n=e!=null?Ae(Ee(e)):{},Le(t||!e||!e.__esModule?ae(n,"default",{value:e,enumerable:!0}):n,e));const o=require("react/jsx-runtime"),qe=require("@mui/icons-material"),x=require("@mui/material"),Ue=require("lodash/isEmpty"),Oe=require("lodash/pick"),h=require("react"),Fe=require("lodash/keyBy"),_=require("@arcblock/ux/lib/Theme"),f=require("@emotion/css"),De=require("lodash/omit"),te=require("react-router-dom"),Ge=require("@arcblock/ux/lib/Button"),He=require("is-uri"),ye=require("@iconify-icon/react"),v=require("./state-tEydRMV8.js"),Ve=require("@blocklet/pages-kit/builtin/markdown/markdown-renderer"),be=require("@blocklet/pages-kit/contexts/color"),Ye=require("react-syntax-highlighter/dist/esm/styles/prism"),Je=require("@arcblock/react-hooks/lib/useBrowser"),Ke=require("@arcblock/ux/lib/Colors"),oe=require("@blocklet/pages-kit/components"),le=require("@blocklet/pages-kit/utils/style"),Xe=require("@mui/material/useMediaQuery"),V=require("pathe"),L=require("ufo"),Qe=require("@blocklet/embed/message"),Ze=require("ahooks"),et=require("lodash/isEqual"),tt=require("@blocklet/embed/react"),ot=require("@arcblock/ux/lib/Locale/context"),nt=require("@arcblock/ux/lib/Screenshot"),rt=require("react-twitter-embed"),ce=require("react-use"),C=e=>e&&e.__esModule?e:{default:e},it=C(Ue),ne=C(Oe),st=C(h),A=C(Fe),S=C(De),at=C(Ge),Z=C(He),lt=C(Ve),ct=C(Je),de=C(Ke),we=C(Xe),dt=C(et),ut=C(nt),ve="{{CUSTOM_VALUE}}",mt=[{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}}}],xt=[{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}}}],pt=[{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}}}],Y=(e,t,n)=>{const r=e.breakpoints.values[n];return`${t}${r?` (${r}px)`:""}`},gt=[{title:"100%",value:"full",sx:{maxWidth:"100%"}},{title:e=>Y(e,"Small","sm"),value:"sm",sx:{maxWidth:e=>e.breakpoints.values.sm,width:"100%",mx:"auto"}},{title:e=>Y(e,"Normal","md"),value:"md",sx:{maxWidth:e=>e.breakpoints.values.md,width:"100%",mx:"auto"}},{title:e=>Y(e,"Large","lg"),value:"lg",sx:{maxWidth:e=>e.breakpoints.values.lg,width:"100%",mx:"auto"}},{title:e=>Y(e,"Extra Large","xl"),value:"xl",sx:{maxWidth:e=>e.breakpoints.values.xl,width:"100%",mx:"auto"}},{title:"Custom",value:"custom",sx:{maxWidth:ve,width:"100%",mx:"auto"}}],ht=[{title:"None",value:"none",sx:{gap:0}},{title:"Small",value:"small",sx:{gap:{xs:1,md:2,lg:2,xl:3}}},{title:"Normal",value:"normal",sx:{gap:{xs:2,md:4,lg:4,xl:6}}},{title:"Large",value:"large",sx:{gap:{xs:3,md:5,lg:5,xl:7}}}],ft=[{title:"None",value:"none",sx:{p:0}},{title:"Small",value:"small",sx:{p:{xs:1,md:2,lg:2,xl:3}}},{title:"Normal",value:"normal",sx:{p:{xs:2.5,md:5,lg:5,xl:7.5}}},{title:"Large",value:"large",sx:{p:{xs:3,md:6,lg:6,xl:9}}}],yt=[{title:"Start",value:"start",sx:{alignContent:"start"}},{title:"End",value:"end",sx:{alignContent:"end"}},{title:"Center",value:"center",sx:{alignContent:"center"}},{title:"Space Between",value:"space-between",sx:{alignContent:"space-between"}},{title:"Space Around",value:"space-around",sx:{alignContent:"space-around"}},{title:"Space Evenly",value:"space-evenly",sx:{alignContent:"space-evenly"}}],bt=A.default(mt,"value"),wt=A.default(xt,"value"),vt=A.default(pt,"value"),jt=A.default(gt,"value"),kt=A.default(ht,"value"),_t=A.default(ft,"value"),$t=A.default(yt,"value"),Ct=new Map([["baseSectionPaddingY",bt],["maxWidth",jt],["paddingY",wt],["paddingX",vt],["layoutBlockGap",kt],["layoutBlockPadding",_t],["layoutBlockAlignContent",$t]]);function q(e){const{type:t,value:n,format:r="sx",defaultValue:i=null}=e,s=Ct.get(t);if(!s||typeof n!="string"||!n)return i;const c=n.startsWith("custom:"),a=c?"custom":n;if(s?.[a]&&s?.[a]?.[r]){const l=s[a][r];if(c){const d=n.replace("custom:","");try{return JSON.parse(JSON.stringify(l||{}).replaceAll(ve,d))}catch{}}return l}return i}const je=h.createContext({page:null,getPageMeta:()=>({}),getPageMetaStyle:()=>({})});function Bt(){return h.useContext(je)}function St({page:e,children:t,defaultLocale:n="en",currentLocale:r}){const i=h.useMemo(()=>e?JSON.parse(JSON.stringify(e)):null,[JSON.stringify(e)]),s=h.useCallback(()=>{if(!i)return{};const l=r||n;return i.locales?.[l]??{}},[i,n,r]),c=h.useCallback((l="sx")=>{const d=s();return!d||!d.style?{}:Object.entries(d.style||{}).reduce((u,[g,p])=>{if(!p)return u;const b=`${g}Custom`;d.style[b];const y=q({type:g,value:p,format:l});return y?{...u,...y}:u},{})},[s]),a=h.useMemo(()=>({page:i,getPageMeta:s,getPageMetaStyle:c}),[i,s,c]);return o.jsx(je.Provider,{value:a,children:t})}const J=["editing","height","locale","dev","sx"];function Nt(e){const{className:t,...n}=e;return o.jsx(Mt,{...n,className:f.cx("BlockBase-root",t)})}const Mt=_.styled(x.Box)`
2
- position: relative;
3
- color: ${({theme:e})=>e.palette.text.primary};
4
- `,ke=h.createContext({pages:[],project:void 0}),{Provider:It,Consumer:Yo}=ke;function _e(){return h.useContext(ke)}function Pt({icon:e,...t}){return o.jsx(ye.Icon,{icon:e,...t,ref:null})}function At({icon:e,className:t="",size:n="1rem",...r}){return o.jsx(Rt,{component:Pt,className:f.cx("css-icon",t),size:n,...r,icon:e})}const Rt=_.styled(x.Box)`
5
- &.css-icon {
6
- display: inline-block;
7
- width: ${({size:e})=>e};
8
- height: ${({size:e})=>e};
9
- }
10
- `;function Wt({icon:e,className:t="",size:n="1rem",imageMeta:r,...i}){const s=v.autoResizeImage(v.getImageAbsoluteUrl(e),540),[c,a]=h.useState(!1),l=_.useTheme();return c?o.jsx(At,{icon:"i-mdi:image",color:l.palette.grey[500],size:n,className:t,...i}):o.jsx(Et,{className:f.cx("image-icon",t),size:n,...i,children:o.jsx("img",{className:"image-icon__image",src:s,onError:()=>a(!0),width:r?.naturalWidth,height:r?.naturalHeight,alt:r?.filename||"card-icon",loading:"lazy"})})}const Et=_.styled(x.Box)`
11
- display: inline-block;
12
- width: ${({size:e})=>e};
13
- height: ${({size:e})=>e};
14
- .image-icon__image {
15
- object-fit: contain;
16
- height: 100%;
17
- width: 100%;
18
- }
19
- `,re=e=>typeof e=="string"&&/^[\w-_]+:[\w-_]+$/.test(e);function ee({icon:e,size:t="1rem",imageMeta:n,...r}){const i=window.isNaN(t)?t:`${t}px`;return re(e)?o.jsx(ye.Icon,{icon:e}):o.jsx(zt,{component:Wt,imageMeta:n,className:"base-icon",icon:e,size:i,...r})}const zt=_.styled(x.Box)`
20
- flex-shrink: 0;
21
- `;function U({text:e,children:t,icon:n="",endIcon:r,color:i="primary",link:s="",href:c="",...a}){const l=n?o.jsx(ee,{icon:n}):null,d=r?o.jsx(ee,{icon:r}):null,m=s||c,u={...a};return m&&(u.href=m,Z.default(m)&&(u.target=u.target||"_blank")),o.jsx(at.default,{startIcon:l,endIcon:d,color:i,...u,children:e||t})}function $e({editing:e,text:t,...n}){const{pages:r=[]}=_e(),i=r.find(s=>s.id===(n.link||n.linkId));if(e)return o.jsx(U,{...S.default(n,["link","linkId"]),children:t});if(i){const s=i.path||"/";return o.jsx(te.Link,{to:s,children:o.jsx(U,{...S.default(n,["link","linkId"]),children:t})})}return o.jsx(U,{...S.default(n,"linkId"),children:t})}function W({actions:e,center:t,className:n,align:r}){return e&&e?.length?o.jsx(x.Box,{className:f.cx("flex gap-4 flex-wrap","lg:flex-row lg:gap-8",(t||r==="center")&&"justify-center",!t&&r==="right"&&"justify-end",!t&&r==="left"&&"justify-start",n),sx:{alignItems:"center"},children:e}):null}const Lt="section",Tt=x.styled(x.Box)`
22
- overflow: hidden;
23
-
24
- .section__title {
25
- margin-top: 0;
26
- font-weight: 700;
27
- }
28
- .section__title_non_big {
29
- font-size: 32px;
30
- @media (max-width: 600px) {
31
- font-size: 24px;
32
- }
33
- }
34
- &.base-info .section__tag {
35
- margin-top: 0;
36
- margin-bottom: 2vw;
37
- background-color: ${({theme:e})=>e.palette.primary.main};
38
- white-space: nowrap;
39
- max-width: 100%;
40
- display: inline-block;
41
- padding: 0 10px;
42
- justify-content: flex-start;
43
- overflow: hidden;
44
- text-overflow: ellipsis;
45
- font-size: 12px;
46
- color: #fff;
47
- border-radius: 4px;
48
- line-height: 20px;
49
- }
50
- .section__title {
51
- color: ${({theme:e})=>e.palette.text.primary};
52
- a {
53
- color: ${({theme:e})=>e.palette.primary.main};
54
- }
55
- p {
56
- margin-top: 0;
57
- margin-bottom: 0;
58
- }
59
- }
60
- .section__description {
61
- color: ${({theme:e})=>e.palette.text.primary};
62
- margin-bottom: 4vw;
63
- margin-top: 0;
64
- a {
65
- color: ${({theme:e})=>e.palette.primary.main};
66
- }
67
- p {
68
- margin-top: 0;
69
- margin-bottom: 0.5rem;
70
- }
71
- }
72
- @media (min-width: ${({theme:e})=>e.breakpoints.values[Lt]}px) {
73
- .section__tag {
74
- margin-bottom: 32px;
75
- }
76
- .section__title {
77
- margin-bottom: 32px;
78
- }
79
- .section__description {
80
- margin-bottom: 40px;
81
- }
82
- }
83
- `;function K({title:e,description:t,descriptionMarkdown:n,actions:r,className:i="",classes:s={},prepend:c,append:a,level:l=2,tag:d,badge:m,center:u,logo:g,titleAppearance:p,descriptionAppearance:b,...y}){const w=be.useColorConvert();if(!e&&!t&&!r&&!m&&!d&&!c&&!a&&!g)return null;const k=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"},M=l===0?"big":`h${k}`,B=l===0;return o.jsxs(Tt,{className:f.cx("base-info","lg:text-left",u&&"!text-center",i),...y,children:[c&&o.jsx("div",{children:c}),(d||m)&&o.jsx("div",{className:f.cx("section__tag",s?.tag||s?.badge),children:d||m}),g&&o.jsx("img",{className:"w-[120px] m-auto mb-8",src:g,alt:"info",loading:"lazy"}),e&&o.jsx(x.Typography,{sx:{whiteSpace:"pre-wrap",mb:t?"2vw":0,...p?.color&&{color:`${w(p.color)} !important`}},className:f.cx("section__title","text-gray-800","dark:text-gray-50",s.title,"page-kit-section__title",B?"":"section__title_non_big"),component:`h${Math.max(l,1)}`,variant:M,children:e}),t&&(n?o.jsx(x.Box,{sx:{...b?.color&&{color:`${w(b.color)} !important`}},className:f.cx("section__description","text-gray-800","dark:text-gray-100",$[k],s.description,"page-kit-section__description"),children:o.jsx(lt.default,{codeOptions:{showActionButton:!1,theme:Ye.materialDark},children:t})}):o.jsx(x.Typography,{sx:{whiteSpace:"pre-wrap",...b?.color&&{color:`${w(b.color)} !important`}},className:f.cx("section__description","text-gray-800","dark:text-gray-100",$[k],s.description,"page-kit-section__description"),component:"div",variant:"body1",gutterBottom:!0,children:t})),o.jsx(W,{actions:r,center:u,className:"mt-8"}),a&&o.jsx("div",{children:a})]})}const X=["actions","append","badge","tag","center","description","descriptionMarkdown","level","logo","prepend","title","titleAppearance","descriptionAppearance"];function qt(){const e=navigator.userAgent.toLowerCase();return e.includes("safari")&&!e.includes("chrome")}function Ut(e=""){if(e.startsWith("data:image/svg+xml,"))return!0;const t=/^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-]([^!@#$%^&*?.\s]{0,63}[^!@#$%^&*?.\s])?\.)+[a-z]{2,6}\/?/,n=/^(\/|\.\/|\.\.\/)(?:[^/]+\/)*[^/]+$/;return t.test(e)||n.test(e)}function T(e){return e?.endsWith(".mp4")||e?.endsWith(".m4v")||e?.endsWith(".webm")}function Ot(e){return e?.endsWith(".mp4")||e?.endsWith(".m4v")?"video/mp4":e?.endsWith(".webm")?"video/webm":void 0}function Ft(e){let t={};return typeof e=="string"?le.isGradient(e)?t.image=e:(t.image=v.getImageAbsoluteUrl(e),le.isColorString(e)&&(t.color=e,t.image="")):t=e,t}function Dt(){const[e,t]=h.useState(Date.now());return h.useEffect(()=>{const n=()=>{t(Date.now())};return document.addEventListener("visibilitychange",n),()=>{document.removeEventListener("visibilitychange",n)}},[]),e}function ue(e,t,n,r,i){let s=null;const{color:c="",image:a}=Ft(t);if(a&&Ut(a)){delete n.backgroundColor;const l=!(e.mobile.apple.device||qt())&&T(a),d=T(a)&&r?v.autoResizeImage(v.getImageAbsoluteUrl(r),1200,"quality"):"";l?s=o.jsx(x.Box,{component:"video",className:"section-bg",autoPlay:!0,loop:!0,muted:!0,controls:!1,playsInline:!0,poster:d,src:T(a)?a:v.autoResizeImage(a,1200,"quality"),sx:{width:"100%",position:"absolute",zIndex:-9999,right:0,left:0,top:0,height:"100%",objectFit:"cover"}},a):s=o.jsx(oe.ResponsiveImage,{src:T(a)&&r?d: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"}},i||a)}else a?n.backgroundImage=`${a} !important`:c&&(n.backgroundColor=`${c} !important`);return s}function Gt({autoWidth:e,children:t,...n}){return e?o.jsx(x.Box,{...n,sx:[{display:"flex"},...Array.isArray(n.sx)?n.sx:[n.sx]],children:t}):o.jsx(x.Container,{...n,children:t})}function Q({dark:e=!1,children:t,className:n,sx:r={},boxed:i={show:!1},padding:s="normal",boxProps:c,type:a,...l}){const d={...r},m=we.default(p=>p.breakpoints.down("md"));e&&(d.color=de.default.common.white,d.backgroundColor=`${de.default.grey[900]} !important`),i.show&&(d.display="flex");const u=h.useMemo(()=>!Number(l.boxMaxWidth)||m?{width:"100%"}:a==="wall"&&l.boxMaxWidth?{maxWidth:`${l.boxMaxWidth}px !important`,width:"100%"}:{width:"100%"},[l.boxMaxWidth,m,a]),g=q({type:"baseSectionPaddingY",value:s||"normal",defaultValue:""});return o.jsx(Ht,{component:"section",styles:{...d,...g},className:f.cx("base-section","px-2 md:px-5 lg:px-5 xl:px-10",n,{dark:e}),...S.default(l,"hoverStyle","boxMaxWidth","embedUrl","autoWidth","paddingXY","iframeHeight","titleAppearance","descriptionAppearance"),children:o.jsx(Gt,{autoWidth:l?.autoWidth,className:f.cx("section-content h-full"),sx:u,children:i.show?o.jsx(Ce,{...c,boxed:i,children:t}):t})})}function Ce({background:e="",backgroundVideoPoster:t,children:n,sx:r={},boxed:i={show:!1},className:s="",styles:c={},...a}){const l={...c,...r},d=be.useColorConvert();let m=null;const u=we.default(b=>b.breakpoints.up("sm")),g=ct.default(),p=Dt();return e&&(m=ue(g,typeof e=="string"?d(e):e,l,t,p)),i.show&&(l.borderRadius="10px",l.padding===void 0&&(l.padding=u?"50px":"20px"),i?.border&&(l.border="1px solid #c0c0c0"),i?.background&&(m=ue(g,typeof i?.background=="string"?d(i?.background):i?.background,l,i?.backgroundVideoPoster,p))),o.jsxs(x.Box,{...a,sx:{...l,...m?{position:"relative",overflow:"hidden",zIndex:0}:{}},className:f.cx(s,i?.boxShadow&&"shadow-xl"),children:[m,n]})}const Ht=_.styled(Ce)`
84
- &:nth-of-type(even) {
85
- background: #f8f8f8;
86
- }
87
-
88
- @media (max-width: 600px) {
89
- .section__title {
90
- font-size: 24px;
91
- }
92
-
93
- .base-info {
94
- > *:last-child {
95
- margin-bottom: 0;
96
- }
97
- }
98
- }
99
- `;function Be(e){if(e.type===h.Fragment){const n=(e.props.children||[]).filter(r=>h.isValidElement(r));return n.length===1?Be(n[0]):n.length>1}return Array.isArray(e)}const I="&>*";function Se({children:e,col:t,gap:n,className:r,align:i,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/t*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"},u=m[i]||m.center;let p=n??({2:6,3:4,4:4,5:3,6:3}[t]||0);Be(e)||(p=0);const y=(t-1)*p/t;let w={...s,gap:`${p}rem`};const k={[I]:{width:"100%"}},$={},M={},B={};switch(k.gap="1rem",$.gap=`${p/2}rem`,t){case 3:case 4:$[I]={width:`calc(50% - ${p/2}rem)`};break;case 5:case 6:k[I]={width:`calc(50% - ${p/2/2}rem)`},$[I]={width:`calc(50% - ${p/2/2}rem)`},M[I]={width:`calc(33.33% - ${p*2/3}rem)`};break}return w[I]={width:`calc(${d}% - ${y}rem)`},w[`@media (max-width: ${l.breakpoints.values.xl}px)`]=B,w[`@media (max-width: ${l.breakpoints.values.lg}px)`]=M,w[`@media (max-width: ${l.breakpoints.values.md}px)`]=$,w[`@media (max-width: ${l.breakpoints.values.sm}px)`]=k,c==="wall"&&(w={...s,gap:`${p}rem`},w[I]={width:`calc(${d}% - ${y}rem)`},k[I]={width:`calc(45% - ${p/2/2}rem)`},w[`@media (max-width: ${l.breakpoints.values.sm}px)`]=k),o.jsx(x.Box,{className:f.cx("flex flex-wrap flex-row h-full",u,r),sx:w,...a,children:e})}function E({type:e="",icon:t="",size:n="3rem",className:r="",...i}){return o.jsx(ee,{icon:t||e,size:n,className:f.cx("content-icon",r),...i,color:typeof i.color>"u"?"inherit":i.color})}function Vt({to:e,base:t,children:n,className:r,activeClassName:i="active",target:s="auto",autoExternalMark:c=!1,useRouterLink:a,...l}){const{pages:d=[],locale:m=""}={},u=t?V.join("/",t):t||"";let g=s==="auto"?"_self":s,p=V.join(u,e);const b=c?Z.default(p):!1;if(t)return p=V.join(u,m,e),o.jsx("a",{className:`no-underline ${r}`,href:L.withoutTrailingSlash(p),rel:"noreferrer noopener",target:g,...l,children:n});if(Z.default(e))s==="auto"&&(g="_blank"),p=e;else{L.isRelative(p)&&(p=V.join(window.location.pathname,p));const y=L.parseURL(`${window.location.origin}${p}`),w=d.some(k=>k.pathname===y.pathname);if(a||w)return o.jsx(te.NavLink,{end:!0,to:L.withoutTrailingSlash(p),className:({isActive:k})=>f.cx(r,k?i:""),...l,children:n})}return o.jsxs("a",{className:`no-underline ${r}`,href:L.withoutTrailingSlash(p),rel:"noreferrer noopener",target:g,...l,children:[n,b&&o.jsx(E,{icon:"i-mdi:arrow-top-right",size:"0.9em",className:"smart-link__mark",style:{marginLeft:5}})]})}function O({prepend:e,append:t,children:n,className:r="",dark:i=!1,border:s=!0,...c}){let a={};const{pages:l=[]}=_e(),d=l.find(g=>g.id===c.link),m=!n||st.default.Children.toArray(n).every(g=>g===null);c.link&&(a={component:Vt,to:d?.path||c.link,useRouterLink:!0});const u=x.useTheme();return o.jsxs(Yt,{className:f.cx("base-card card",{dark:i,"border-transparent":!s},r),sx:{borderColor:u.palette.divider},...a,...S.default(c,["listType","dark","iconColor","link","hoverStyle","imageSize"]),children:[e,!m&&o.jsx("div",{className:"card__body",children:n}),t]})}const Yt=_.styled(x.Box)`
100
- &.base-card {
101
- text-align: left;
102
- border-width: 1px;
103
- border-style: solid;
104
- border-radius: 12px;
105
- overflow: hidden;
106
- &,
107
- &:hover {
108
- text-decoration: none;
109
- }
110
- }
111
- .card__body {
112
- padding: 15px 15px;
113
- }
114
- `;function F({align:e="left",title:t,titleProps:n={},description:r,descriptionProps:i={}}){return o.jsxs(o.Fragment,{children:[t&&o.jsx(x.Typography,{className:f.cx("card__title text-gray-800","dark:text-gray-50"),component:"h5",variant:"h5",gutterBottom:!0,align:e,...n,children:t}),r&&o.jsx(x.Typography,{className:f.cx("card__description","text-gray-500","dark:text-gray-400"),component:"div",variant:"body1",gutterBottom:!0,align:e,...i,children:r})]})}function Jt({image:e,title:t,description:n,imageProps:r={},imageMeta:i,imageSize:s,titleProps:c={},descriptionProps:a={},actions:l,align:d,...m}){const u=re(e),g=v.autoResizeImage(v.getImageAbsoluteUrl(e),540);return o.jsxs(Kt,{className:"card-article",...m,prepend:o.jsx("div",{className:"card__image__wrap",children:u&&e?o.jsx(x.Box,{sx:{position:"absolute",left:0,top:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"},children:o.jsx(E,{icon:e,color:"primary.main"})}):g&&o.jsx("img",{className:"card__image",src:g,...r,alt:r.alt||i?.filename||"card-image",width:i?.naturalWidth,height:i?.naturalHeight,style:{width:"100%",height:"100%",objectFit:s||"cover",objectPosition:"center"},loading:"lazy"})}),children:[t||n?o.jsx(F,{align:d,title:t,titleProps:c,description:n,descriptionProps:a}):null,l?.length?o.jsx(W,{align:d,actions:l,className:"mt-4"}):null]})}const Kt=_.styled(O)`
115
- ${e=>e.hoverStyle==="none"?"":e.link?`transition: box-shadow ease .3s;
116
- &:hover {
117
- box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
118
- }`:""}
119
-
120
- .card__title {
121
- color: ${({theme:e})=>e.palette.text.primary};
122
- a {
123
- color: ${({theme:e})=>e.palette.primary.main};
124
- }
125
- }
126
- .card__description {
127
- color: ${({theme:e})=>e.palette.text.primary};
128
- a {
129
- color: ${({theme:e})=>e.palette.primary.main};
130
- }
131
- }
132
-
133
- .card__image__wrap {
134
- padding-top: 61.8%;
135
- width: 100%;
136
- position: relative;
137
- }
138
- .card__image {
139
- position: absolute;
140
- top: 0;
141
- left: 0;
142
- bottom: 0;
143
- right: 0;
144
- width: 100%;
145
- height: 100%;
146
- object-position: top center;
147
- }
148
- `,me="section";function xe({title:e,image:t,imageMeta:n,description:r,actions:i,align:s,listType:c="",className:a="",...l}){return o.jsxs(Xt,{className:f.cx("card",`list-type-${c}`,a),align:s,...l,children:[t&&o.jsx(E,{icon:t,color:"primary.main",size:c==="icon-title"?"1.2rem":"3rem",imageMeta:n}),e||r?o.jsx(F,{align:s,title:e,description:r}):null,i?.length?o.jsx(W,{align:s,actions:i,className:"mt-4"}):null]})}const Xt=_.styled(O)`
149
- padding: 5vw 4vw;
150
- box-sizing: border-box;
151
- /* min-height: 320px; */
152
- color: inherit !important;
153
- border-radius: 0.5rem;
154
- /* ${({dark:e,theme:t})=>`background-color:${e?t.palette.grey[900]:t.palette.common.white};`} */
155
- @media (max-width: ${({theme:e})=>e.breakpoints.values[me]}px) {
156
- padding: 1.5rem 2rem;
157
- }
158
- @media (max-width: ${({theme:e})=>e.breakpoints.values.sm}px) {
159
- height: auto;
160
- min-height: unset;
161
- }
162
-
163
- ${e=>e.hoverStyle==="none"?"":e.link?`transition: box-shadow ease .3s;
164
- &:hover {
165
- box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
166
- }`:""}
167
-
168
- .card__title {
169
- font-weight: 700;
170
- margin-top: 24px;
171
- margin-bottom: 12px;
172
- color: ${({theme:e})=>e.palette.text.primary};
173
- a {
174
- color: ${({theme:e})=>e.palette.primary.main};
175
- }
176
- }
177
- .card__description {
178
- color: ${({theme:e})=>e.palette.text.primary};
179
- a {
180
- color: ${({theme:e})=>e.palette.primary.main};
181
- }
182
- }
183
- .card__body {
184
- color: ${({theme:e})=>e.palette.text.primary};
185
- padding: 0;
186
- ${({align:e})=>`text-align:${e||"left"};`}
187
- }
188
-
189
- &.list-type-icon-title {
190
- padding: 1.2rem;
191
- .title-line {
192
- display: flex;
193
- }
194
- .card__title {
195
- margin: 0;
196
- font-size: 1em;
197
- }
198
- .css-icon {
199
- margin-right: 0.5rem;
200
- }
201
- }
202
-
203
- @media (min-width: ${({theme:e})=>e.breakpoints.values[me]}px) {
204
- padding: 2rem 2rem;
205
- text-align: left;
206
- box-sizing: border-box;
207
- }
208
- `;function Qt({image:e,title:t,description:n,imageProps:r={},imageMeta:i,imageSize:s,titleProps:c={},descriptionProps:a={},actions:l,align:d,...m}){const u=re(e),g=v.autoResizeImage(v.getImageAbsoluteUrl(e),540);return o.jsxs(Zt,{className:"card-article",...m,prepend:o.jsx("div",{className:"card__image__wrap",children:u&&e?o.jsx(x.Box,{sx:{position:"absolute",left:0,top:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"},children:o.jsx(E,{icon:e,color:"primary.main"})}):g&&o.jsx(x.Box,{component:"img",className:"card__image",src:g,...r,alt:r.alt||i?.filename||"card-image",style:{width:"100%",height:"100%",objectFit:s||"contain",objectPosition:"center"},loading:"lazy",sx:[{width:i?.naturalWidth,height:i?.naturalHeight},...Array.isArray(r.sx)?r.sx:[r.sx]]})}),children:[t||n?o.jsx(F,{align:d,title:t,titleProps:c,description:n,descriptionProps:a}):null,l?.length?o.jsx(W,{align:d,actions:l,className:"mt-4"}):null]})}const Zt=_.styled(O)`
209
- ${e=>e.hoverStyle==="none"?"":e.link?`transition: box-shadow ease .3s;
210
- &:hover {
211
- box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
212
- }`:""}
213
-
214
- border-radius: 0 !important;
215
-
216
- .card__body {
217
- ${({align:e})=>`text-align:${e||"left"};`}
218
- }
219
-
220
- .card__image__wrap {
221
- width: 100%;
222
- height: 100%;
223
- position: relative;
224
- display: flex;
225
- justify-content: center;
226
- align-items: center;
227
- }
228
-
229
- .card__image {
230
- max-height: 60px;
231
- }
232
- `,pe="section";function eo({title:e,image:t,imageMeta:n,iconSize:r=100,description:i,actions:s,align:c,className:a="",...l}){return o.jsx(to,{className:f.cx("card",a),...l,children:o.jsxs(x.Box,{className:"flex items-center",children:[t&&o.jsx(E,{icon:t,color:"primary.main",size:r,imageMeta:n}),o.jsxs(x.Box,{className:"flex-1 ml-4",children:[o.jsx(F,{align:c,title:e,description:i}),o.jsx(W,{align:c,actions:s,className:"mt-4"})]})]})})}const to=_.styled(O)`
233
- padding: 5vw 4vw;
234
- text-align: left;
235
- box-sizing: border-box;
236
- /* min-height: 320px; */
237
- color: inherit !important;
238
- border-radius: 0.5rem;
239
- /* ${({dark:e,theme:t})=>`background-color:${e?t.palette.grey[900]:t.palette.common.white};`} */
240
- @media (max-width: ${({theme:e})=>e.breakpoints.values[pe]}px) {
241
- padding: 1.5rem 2rem;
242
- }
243
- @media (max-width: ${({theme:e})=>e.breakpoints.values.sm}px) {
244
- height: auto;
245
- min-height: unset;
246
- }
247
-
248
- ${e=>e.hoverStyle==="none"?"":e.link?`transition: box-shadow ease .3s;
249
- &:hover {
250
- box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
251
- }`:""}
252
-
253
- .card__title {
254
- font-weight: 700;
255
- margin-bottom: 12px;
256
- color: ${({theme:e})=>e.palette.text.primary};
257
- a {
258
- color: ${({theme:e})=>e.palette.primary.main};
259
- }
260
- }
261
- .card__description {
262
- color: ${({theme:e})=>e.palette.text.primary};
263
- a {
264
- color: ${({theme:e})=>e.palette.primary.main};
265
- }
266
- }
267
- .card__body {
268
- padding: 0;
269
- }
270
-
271
- &.list-type-icon-title {
272
- padding: 1.2rem;
273
- .title-line {
274
- display: flex;
275
- }
276
- .card__title {
277
- margin: 0;
278
- font-size: 1em;
279
- }
280
- .css-icon {
281
- margin-right: 0.5rem;
282
- }
283
- }
284
-
285
- @media (min-width: ${({theme:e})=>e.breakpoints.values[pe]}px) {
286
- padding: 2rem 2rem;
287
- text-align: left;
288
- box-sizing: border-box;
289
- }
290
- `;function oo({title:e,titleProps:t={},description:n,descriptionProps:r={},image:i,imageMeta:s,className:c="",align:a,hoverStyle:l,...d}){return o.jsxs(no,{className:f.cx("card-simple",c,`hover-style__${l}`),align:a,...d,children:[i&&o.jsx(E,{icon:i,color:"primary.main",imageMeta:s}),e||n?o.jsx(F,{align:a,title:e,titleProps:t,description:n,descriptionProps:r}):null]})}const no=_.styled(O)`
291
- .card__title {
292
- color: ${({theme:e})=>e.palette.text.primary};
293
- a {
294
- color: ${({theme:e})=>e.palette.primary.main};
295
- }
296
- }
297
- .card__description {
298
- color: ${({theme:e})=>e.palette.text.primary};
299
- a {
300
- color: ${({theme:e})=>e.palette.primary.main};
301
- }
302
- }
303
-
304
- &.hover-style__default {
305
- &.card-simple {
306
- &:hover {
307
- border-top-right-radius: 36px;
308
- }
309
- }
310
- .card__body {
311
- &:hover {
312
- &::before {
313
- width: 42px;
314
- height: 42px;
315
- transform: translate(50%, -50%) rotate(45deg);
316
- }
317
- &::after {
318
- transform: none;
319
- }
320
- }
321
- }
322
- }
323
-
324
- &.card-simple {
325
- border-radius: 8px;
326
- border-top-right-radius: 26px;
327
-
328
- .card__body {
329
- ${({align:e})=>`text-align:${e||"left"};`}
330
- }
331
-
332
- ${e=>e.link?`
333
- cursor: pointer;
334
- `:""}
335
- /* cursor: pointer; */
336
- /* &:hover {
337
- border-top-right-radius: 36px;
338
- } */
339
- transition: all 180ms ease 0s;
340
- overflow: visible;
341
- .card__title {
342
- margin: 12px 0;
343
- }
344
- .card__body {
345
- position: relative;
346
- padding: 20px 16px 18px;
347
- overflow: hidden;
348
- transition: all 180ms ease 0s;
349
- /* &:hover {
350
- &::before {
351
- width: 42px;
352
- height: 42px;
353
- transform: translate(50%, -50%) rotate(45deg);
354
- }
355
- &::after {
356
- transform: none;
357
- }
358
- } */
359
- &::before,
360
- &::after {
361
- content: ${({border:e})=>e?'""':""};
362
- transition: inherit;
363
- position: absolute;
364
- top: 0px;
365
- right: 0px;
366
- }
367
- &::before {
368
- z-index: 3;
369
- background: #fff;
370
- width: 30px;
371
- height: 30px;
372
- transform: translate(50%, -50%) rotate(45deg);
373
- box-shadow: 0 1px 0 0 #e9eaec;
374
- }
375
- &::after {
376
- z-index: 2;
377
- width: 28px;
378
- height: 28px;
379
- border-bottom-left-radius: 6px;
380
- background: #fcfcfd;
381
- box-shadow: -1px 1px 0 0 #e9eaec;
382
- transform: translate(8px, -8px);
383
- }
384
- }
385
- }
386
- `;function ro({type:e="default",...t}){const r={article:Jt,simple:oo,news:eo,default:xe,wall:Qt}[e]||xe;return o.jsx(r,{...e==="news"?t:S.default(t,"iconSize")})}function io({list:e=[],align:t="top",cards:n,listBorder:r=!0,listType:i="",col:s=3,gap:c,iconColor:a,className:l="",type:d="default",dark:m=!1,textAlign:u="left",hoverStyle:g,...p}){return o.jsx(Se,{type:d,className:f.cx("card-list py-1",l,"items-stretch"),col:s,gap:c,align:t,...p,children:n||e.map(b=>o.jsx(ro,{borderColor:r,iconColor:a,type:d,listType:i,dark:m,...b,align:u,style:c===0&&e.length>1?{borderRadius:0,marginRight:"-1px",marginBottom:"-1px"}:{}},b.id))})}const so=["align","cards","list","listBorder","listType","col","gap","iconColor","type","textAlign"];function N(e,t){const n=ne.default(e,t),r=S.default(e,t);return[n,r]}const ao=_.styled(Q)`
387
- a .card {
388
- color: #404040;
389
- cursor: pointer;
390
- }
391
- a:not(.MuiButton-root) {
392
- color: ${({theme:e})=>e.palette.primary.main};
393
- &:hover,
394
- &:active {
395
- color: ${({theme:e})=>e.palette.primary.main};
396
- }
397
- }
398
- a:hover .card {
399
- color: #404040;
400
- }
401
- `;function lo({className:e,...t}){const[n,r]=N(t,X),[i,s]=N(r,so);return o.jsxs(ao,{className:f.cx("section--card-list",e),type:t.type,...s,children:[Object.keys(n).length>0&&o.jsx(K,{center:!0,...n,className:"mb-[2.5vw]"}),o.jsx(io,{...i,dark:!!t.dark})]})}const co=_.styled(lo)`
402
- .card__description {
403
- white-space: pre-wrap;
404
- }
405
- .section__description {
406
- }
407
- .card {
408
- /* background: inherit !important; */
409
- }
410
- &.dark .card-simple .card__body::before {
411
- background: #212121 !important;
412
- }
413
- .card-simple .card__body::after {
414
- background: inherit !important;
415
- }
416
- `;function uo({section:e,...t}){const[{editing:n},r]=N(t,J),i=h.useMemo(()=>({...S.default(r,["listBorder","list","iconSize","imageSize"]),list:r.list?.map(s=>({...S.default(s,"icon","iconColor"),image:["news","simple","default"].includes(r.type)&&s.icon?s.icon:s.image,actions:s.actions?.map?.(c=>o.jsx($e,{...c,editing:n},c.id)),border:r.listBorder,iconSize:r.iconSize,imageSize:r.imageSize,hoverStyle:r.hoverStyle}))}),[r]);return o.jsx(co,{style:n?{pointerEvents:"none"}:{},...i})}function mo({properties:e,section:t,locale:n,dev:r}){return t?.config?.componentId?o.jsx(oe.CustomComponentRenderer,{instanceId:t.id,componentId:t.config.componentId,blockletId:t.config.blockletId,blockletTitle:t.config.blockletTitle,componentName:t.config.componentName,locale:n,properties:e,dev:r}):o.jsx(x.Box,{sx:{textAlign:"center",py:2},children:o.jsx(x.Typography,{variant:"caption",sx:{color:"text.secondary"},children:"Please select component to render"})})}function xo({src:e,dataId:t,isEdit:n=!1,height:r="100%",onLoad:i=()=>{}}){return o.jsx(tt.EmbedIframe,{isEdit:n,embedId:t,src:e,height:r,onLoad:()=>{i()}})}function po({dataId:e,src:t,actions:n,center:r,onLoad:i,...s}){const[c,a]=N(s,X);return o.jsxs(Q,{...a,children:[Object.keys(c).length>0&&o.jsx(K,{center:r,...c}),o.jsx(xo,{dataId:e,src:t,onLoad:i,height:s.iframeHeight?`${s.iframeHeight}px`:"100%"}),o.jsx(W,{actions:n,center:r})]})}const go={src:"",embedUrl:"",title:"",description:"",dark:!1,background:"",center:!0,config:{},id:""};function ho({section:e,id:t,src:n,...r}){const i=`${t}-${r.locale}`,[{editing:s},c]=N(r,J),a=h.useRef({}),l=JSON.parse(JSON.stringify(c)),{message:d}=Qe.useMessage(i,"server"),m=Ze.useLatest(JSON.parse(JSON.stringify(c.config)||"{}"));return h.useEffect(()=>{d&&d.onInit(()=>m.current)},[d]),h.useEffect(()=>{const u=JSON.parse(JSON.stringify(c.config)||"{}");dt.default(a.current,u)||(a.current=u,d?.send("config-set",u))},[d,c.config]),n?o.jsx(po,{...l,dataId:i,src:n,style:s?{pointerEvents:"none"}:{}}):o.jsx(fo,{children:'Please set the "src" attribute for this block'})}const fo=_.styled("div")`
417
- user-select: none;
418
- color: #999;
419
- padding: 8px;
420
- height: 200px;
421
- `,yo="none",bo="none",wo="transparent",ge="start",vo=12,jo=({gridSettings:e,section:t,index:n,columns:r,simulateMode:i="desktop",isBackground:s})=>{const c=e?.[i]??{},a=c[t.id],l=ko(c);return{i:t.id,static:t?.locked||s,...s?{x:0,y:0,w:r,h:1,isResizable:!1}:{x:a?.x??0,y:a?.y??n,w:a?.w??r,h:a?.h??1,isResizable:!0},minH:1,maxH:1,maxY:l}},ko=e=>Object.values(e).reduce((t,n)=>Math.max(t,n.y||0),0)||0,_o=e=>{const{dev:t,id:n,section:r,onBlockRender:i}=e,s=t?.mode,c=x.useMediaQuery(j=>j.breakpoints.down("sm")),{t:a}=ot.useLocaleContext(),{sections:l,sectionIds:d,config:m}=r,{columns:u=vo,gridSettings:g,gap:p,padding:b,background:y,alignContent:w}=m||{},k=h.useMemo(()=>q({type:"layoutBlockGap",value:p??yo,format:"sx"}),[p]),$=h.useMemo(()=>q({type:"layoutBlockPadding",value:b??bo,format:"sx"}),[b]),M=h.useMemo(()=>q({type:"layoutBlockAlignContent",value:w??ge,format:"sx"}),[w]),B=h.useCallback((j,R=!1,D=0)=>{if(!i||!j||!j.component||j.visibility==="hidden")return null;const P=jo({gridSettings:g,section:j,index:D,columns:u,simulateMode:c?"mobile":"desktop",isBackground:R}),G=P?.x??0,H=P?.y??0,z=P?.w??u,Me=P?.h??1,Ie=P?.maxY??0,Pe=!!r?.config?.backgroundSectionId;return o.jsx(x.Box,{className:R?"layout-block-background":"layout-block-section",sx:{...R?{gridColumn:"1 / -1",gridRow:`1 / ${Ie+1}`,zIndex:0,width:"100%",height:"100%","& .BlockBase-root":{width:"100%",height:"100%"}}:{position:"relative",gridColumn:`${G+1} / span ${z}`,gridRow:`${H+(Pe?0:1)} / span ${Me}`,zIndex:1,minWidth:0,minHeight:0,overflow:"hidden","& > .BlockBase-root":{height:"100%",width:"100%",boxSizing:"border-box"}}},children:i({id:j.id,type:j.component,config:{},section:{...j},mode:s})},j.id)},[n,s,i,g,u,c]),{backgroundElements:ie,contentElements:se}=h.useMemo(()=>{if(!d||!d.length||!l||!Object.keys(l).length)return{backgroundElements:[],contentElements:[]};const j=[],R=[];return d?.forEach((D,P)=>{const G=l[D];if(!G)return;const H=r?.config?.backgroundSectionId===D,z=B(G,H,P);z&&(H?j.push(z):R.push(z))}),{backgroundElements:j,contentElements:R}},[B,l,d]);return s==="draft"&&!ie?.length&&!se?.length?o.jsxs(x.Box,{sx:{gridColumn:"1 / -1",gridRow:"1",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,border:j=>`2px dashed ${j.palette.divider}`,borderRadius:2,padding:4,color:"text.secondary",textAlign:"center",minHeight:"160px"},children:[o.jsx(x.Box,{sx:{fontSize:"48px",opacity:.5},children:"📐"}),o.jsx(x.Box,{sx:{fontSize:"16px",fontWeight:500,marginBottom:1},children:"Section Layout"}),o.jsx(x.Box,{sx:{opacity:.7,whiteSpace:"pre-line"},children:a("maker.layoutBlock.draftPlaceholder")}),o.jsx(x.Box,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,pointerEvents:"none",opacity:.1,background:j=>`
422
- repeating-linear-gradient(
423
- 90deg,
424
- transparent,
425
- transparent calc(100% / ${u} - 1px),
426
- ${j.palette.grey[400]} calc(100% / ${u} - 1px),
427
- ${j.palette.grey[400]} calc(100% / ${u})
428
- )
429
- `}})]}):o.jsxs(x.Box,{sx:{position:"relative",display:"grid",gridTemplateColumns:`repeat(${u}, minmax(0, 1fr))`,alignItems:"stretch",width:"100%",height:"100%",minWidth:0,bgcolor:y??wo,boxSizing:"border-box",overflow:"hidden",...k,...$,alignContent:M?.alignContent??ge},children:[ie,se]})},$o=["title","description","actions","badge","tag","prepend","append","logo"];function Co({image:e,imageBorder:t,imageShadow:n,className:r,reverse:i=!1,fullSizeImage:s,...c}){const[a,l]=N(c,X),d=Object.keys(a).length>0&&Object.values(ne.default(a,$o)).filter(Boolean).length>0&&o.jsx(K,{...a}),m=h.isValidElement(e)?e:o.jsx(x.Box,{component:"img",src:e,alt:"",className:"block"}),u=["phone","macbook"].includes(t),g=e&&o.jsx(x.Box,{className:f.cx("section__image","m-auto, leading-[1] text-center",n&&"shadow-xl",a?.center?"flex justify-center items-center":""),sx:{border:t===!0?"1px solid #c0c0c0":void 0,borderRadius:2,overflow:"hidden","> div":u?{width:"100%",video:{borderRadius:"0 !important"}}:void 0},children:u?o.jsx(ut.default,{type:t,sx:{width:"100%"},children:m}):m});return o.jsx(Q,{className:f.cx("section--block",r,s&&!i&&f.css`
430
- .section-bg {
431
- height: 80%;
432
- }
433
- `),...l,boxProps:s?{sx:{padding:0,overflow:"hidden"}}:void 0,children:o.jsx(Se,{col:e?2:1,className:s?f.css`
434
- display: flex;
435
- flex-direction: column;
436
-
437
- > .base-info,
438
- > .section__image {
439
- width: 100%;
440
-
441
- > img,
442
- > video {
443
- width: 100%;
444
- }
445
- }
446
- `:void 0,children:i?o.jsxs(o.Fragment,{children:[g,d]}):o.jsxs(o.Fragment,{children:[d,g]})})})}const Bo=[/youtu\.be\/([^#&?]{11})/,/\?v=([^#&?]{11})/,/&v=([^#&?]{11})/,/embed\/([^#&?]{11})/,/\/v\/([^#&?]{11})/];function So(e){if(/youtu\.?be/.test(e))for(const t of Bo){const n=t.exec(e)?.[1];if(n)return n}}function No(e){const t=So(e);if(t)return`https://youtube.com/embed/${t}`}function Mo({src:e}){return h.useEffect(()=>{import("@lottiefiles/lottie-player")},[]),o.jsx("lottie-player",{autoplay:!0,loop:!0,mode:"normal",src:e})}function Io(e){return o.jsx(x.Box,{sx:{maxHeight:400,overflow:"hidden auto"},children:o.jsx(rt.TwitterTimelineEmbed,{...e})})}function Po({url:e}){const t=h.useRef(null),n=495,[r,i]=h.useState(t.current?t.current.offsetWidth*.5625:n),s=h.useCallback(()=>{const c=window.innerWidth>990?1:window.innerWidth>522?1.2:window.innerWidth>400?1.45:1.85,a=t.current?t.current.offsetWidth*.5625:n;return i(Math.floor(a*c))},[]);return h.useEffect(()=>{window.addEventListener("resize",s);const c=window.innerWidth>990?1:window.innerWidth>522?1.2:window.innerWidth>400?1.45:1.85,a=t.current?t.current.offsetWidth*.5625:n;return i(Math.floor(a*c)),function(){window.removeEventListener("resize",s)}},[r,s]),o.jsx(x.Box,{component:"iframe",ref:t,title:"youtube",src:e,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,sx:{width:"100%",height:`${r}px`,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},Ro=_.styled(Co)`
447
- .section__description {
448
- }
449
- `;function Wo({hasImage:e,fullSizeImage:t,boxed:n,videoPoster:r,imageMeta:i,imageOptimization:s,imageSize:c,section:a,...l}){const[{editing:d},m]=N({...l,boxed:t?void 0:n},J);let u=Eo(m.image,r,t,i,s,c);e||(u=null);let g=null;return m.actions&&(g=m.actions?.map?.((p,b)=>o.jsx($e,{...p,editing:d},b))),o.jsx(Ro,{...m,style:d?{pointerEvents:"none"}:{},image:u,fullSizeImage:e&&t,actions:g})}function Eo(e,t,n,r,i,s){if(e){if(e.endsWith(".json"))return o.jsx(Mo,{src:e});if(e.indexOf("twitter.com")!==-1)return o.jsx(Io,{sourceType:"url",url:e});const c=No(e);if(c)return o.jsx(Po,{url:c});const{naturalWidth:a,naturalHeight:l,filename:d}=r||{};if(T(e))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:v.autoResizeImage(v.getImageAbsoluteUrl(t),n?1200:540,i),children:o.jsx("source",{src:v.getImageAbsoluteUrl(e),type:Ot(e)})},e);const m=i==="quality"?1:.6;return o.jsx(oe.ResponsiveImage,{src:v.getImageAbsoluteUrl(e),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??e,style:{objectFit:s||"contain",display:"block",width:"100%",height:"100%"},loading:"lazy"})}return null}const zo=["production","draft"];function Lo({mode:e,version:t}={}){const n=t&&typeof t=="number"?{mode:e,version:t}:{mode:e};return v.api.get(`/api/${v.getProjectIdFromPathnameOrWindow()}/pages`,{params:n}).then(r=>r.data)}function To({mode:e,routes:t}){return v.api.post(`/api/${v.getProjectIdFromPathnameOrWindow()}/pages/publish`,{mode:e,routes:t}).then(n=>n.data)}function qo({locale:e,sort:t,page:n,limit:r,mode:i}={}){return v.api.get(`/api/${v.getProjectIdFromPathnameOrWindow()}/pages/toc`,{params:{locale:e,sort:t,page:n,limit:r,mode:i}}).then(s=>s.data)}const Uo={style:"list",sort:"-updatedAt"},he=20;function Oo({style:e,sort:t,section:n,...r}){const[{editing:i,locale:s},c]=N(r,J),[a,l]=N(c,X),[d,m]=h.useState(),u=h.useRef(!1),g=ce.useUpdate(),p=te.useNavigate(),b=h.useCallback(async()=>{if(!u.current){u.current=!0,g();try{const y=d?Math.floor(d.list.length/he)+1:1,{list:w,total:k}=await qo({locale:s,sort:t,page:y,limit:he});m($=>({list:($?.list??[]).concat(w),total:k}))}finally{u.current=!1,g()}}},[d,s,t,g]);return ce.useMount(()=>{b()}),o.jsxs(Q,{...l,sx:i?{pointerEvents:"none"}:{},children:[Object.keys(a).length>0&&o.jsx(K,{...a}),d?o.jsxs(o.Fragment,{children:[o.jsx(x.Grid,{container:!0,spacing:2,sx:{justifyContent:"center"},children:d?.list.map(y=>o.jsx(x.Grid,{size:{xs:12,sm:e==="card"?6:12,md:e==="card"?3:12},children:o.jsxs(Fo,{elevation:0,className:f.cx(e==="card"&&"style-card"),onClick:i?void 0:()=>p(y.slug),children:[!!y.image&&o.jsx(x.CardMedia,{component:"img",alt:"",image:v.autoResizeImage(v.getImageAbsoluteUrl(y.image),540),loading:"lazy"}),o.jsxs(x.CardContent,{children:[o.jsx(x.Typography,{variant:"h6",component:"div",className:fe,children:y.title||y.id}),o.jsx(x.Typography,{variant:"body2",className:fe,children:y.description})]})]})},y.id))}),o.jsx(x.Box,{sx:{textAlign:"center",mt:2},children:d.total>d.list.length?o.jsx(U,{variant:"outlined",color:"secondary",onClick:b,loading:u.current,children:"More"}):o.jsx(U,{variant:"outlined",color:"secondary",disabled:!0,children:"No More"})})]}):o.jsx(x.Box,{sx:{p:2,textAlign:"center"},children:o.jsx(x.CircularProgress,{size:24})})]})}const fe=f.css`
450
- display: -webkit-box;
451
- -webkit-box-orient: vertical;
452
- -webkit-line-clamp: 2;
453
- overflow: hidden;
454
- text-overflow: ellipsis;
455
- `,Fo=_.styled(x.Card)`
456
- border: 1px solid #e0e0e0;
457
- background-color: transparent;
458
- cursor: pointer;
459
- display: flex;
460
- color: inherit;
461
-
462
- > .MuiCardMedia-root {
463
- width: 30vw;
464
- max-height: 50vw;
465
- }
466
-
467
- &.style-card {
468
- display: block;
469
-
470
- > .MuiCardMedia-root {
471
- width: 100%;
472
- max-height: 50vw;
473
- }
474
- }
475
- `,Do={iframe:ho,section:Wo,"section-card-list":uo,toc:Oo,"custom-component":mo,"layout-block":_o};function Ne({id:e,type:t,mode:n,config:r,section:i,ignorePageMetaStyle:s,page:c,...a}){const l=Do[t],{getPageMetaStyle:d}=Bt(),m=h.useMemo(()=>{const{height:p,...b}=r;return t==="layout-block"&&(b.onBlockRender=y=>{const w={...r?.dev,...y?.config?.dev},{defaultLocale:k}=w,$={...ne.default(r,["locale","editing"]),...y?.config,dev:w},{locale:M}=$;let B=c?.dataSource?.[y?.id]?.[M];return it.default(B)&&(B=c?.dataSource?.[y?.id]?.[k??"en"]),o.jsx(Ne,{...y,config:{...y?.section?.properties,...B,...$},page:c,ignorePageMetaStyle:!0})}),b},[r,t]),u=h.useMemo(()=>{const p={};return t!=="custom-component"&&(p.height=r.height),p.sx=s?void 0:d("sx"),p.id=`BlockBase-${e}`,p},[r.height,s,t,d]),g=l&&o.jsx(l,{mode:n,...m,id:e,section:i});return g?o.jsx(Nt,{...a,...u,children:g}):o.jsx(Go,{type:t})}function Go({type:e}){return o.jsx(x.Box,{sx:{p:2},children:o.jsxs(x.Alert,{icon:o.jsx(qe.ErrorOutline,{}),color:"error",children:["Unsupported Block `",e,"`"]})})}exports.BlockRenderer=Ne;exports.IFrameBlockDefaultProps=go;exports.PageProvider=St;exports.Provider=It;exports.STATE_MODES=zo;exports.SectionBlockDefaultProps=Ao;exports.TocDefaultProps=Uo;exports.getPages=Lo;exports.publishPages=To;