{"version":3,"file":"save.cjs","names":["getDimensionsClassesAndStyles","getShadowClassesAndStyles","useBlockProps","Tracks","RichText","__experimentalGetElementClassName"],"sources":["../../src/video/save.jsx"],"sourcesContent":["import {\n\tRichText,\n\tuseBlockProps,\n\t__experimentalGetElementClassName,\n\t__experimentalGetDimensionsClassesAndStyles as getDimensionsClassesAndStyles,\n\t__experimentalGetShadowClassesAndStyles as getShadowClassesAndStyles,\n} from '@wordpress/block-editor';\nimport Tracks from './tracks';\n\nexport default function save( { attributes } ) {\n\tconst {\n\t\tautoplay,\n\t\tcaption,\n\t\tcontrols,\n\t\tloop,\n\t\tmuted,\n\t\tposter,\n\t\tpreload,\n\t\tsrc,\n\t\tplaysInline,\n\t\ttracks,\n\t\twidth,\n\t\theight,\n\t} = attributes;\n\t// Match the editor: an explicit (non-`auto`) aspect ratio keeps the\n\t// converted GIF video from briefly blowing up to a runaway height while the\n\t// poster/metadata load, which would otherwise flash on the front end and\n\t// cause layout shift. The width/height attributes only yield\n\t// `aspect-ratio: auto W/H`, whose `auto` keyword is unreliable during load.\n\tconst aspectRatio =\n\t\twidth && height ? `${ width } / ${ height }` : undefined;\n\tconst videoStyle = {\n\t\t...( aspectRatio && { aspectRatio } ),\n\t\t...getDimensionsClassesAndStyles( attributes ).style,\n\t\t...getShadowClassesAndStyles( attributes ).style,\n\t};\n\treturn (\n\t\t<figure { ...useBlockProps.save() }>\n\t\t\t{ src && (\n\t\t\t\t<video\n\t\t\t\t\tautoPlay={ autoplay }\n\t\t\t\t\tcontrols={ controls }\n\t\t\t\t\tloop={ loop }\n\t\t\t\t\tmuted={ muted }\n\t\t\t\t\tposter={ poster }\n\t\t\t\t\tpreload={ preload !== 'metadata' ? preload : undefined }\n\t\t\t\t\tsrc={ src }\n\t\t\t\t\tplaysInline={ playsInline }\n\t\t\t\t\twidth={ width }\n\t\t\t\t\theight={ height }\n\t\t\t\t\tstyle={\n\t\t\t\t\t\tObject.keys( videoStyle ).length\n\t\t\t\t\t\t\t? videoStyle\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<Tracks tracks={ tracks } />\n\t\t\t\t</video>\n\t\t\t) }\n\t\t\t{ ! RichText.isEmpty( caption ) && (\n\t\t\t\t<RichText.Content\n\t\t\t\t\tclassName={ __experimentalGetElementClassName( 'caption' ) }\n\t\t\t\t\ttagName=\"figcaption\"\n\t\t\t\t\tvalue={ caption }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</figure>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,SAAwB,KAAM,EAAE,cAAe;CAC9C,MAAM,EACL,UACA,SACA,UACA,MACA,OACA,QACA,SACA,KACA,aACA,QACA,OACA,WACG;CAMJ,MAAM,cACL,SAAS,SAAS,GAAI,MAAO,KAAM,WAAY,KAAA;CAChD,MAAM,aAAa;EAClB,GAAK,eAAe,EAAE,YAAY;EAClC,IAAA,GAAGA,wBAAAA,4CAAAA,CAA+B,UAAW,CAAC,CAAC;EAC/C,IAAA,GAAGC,wBAAAA,wCAAAA,CAA2B,UAAW,CAAC,CAAC;CAC5C;CACA,OACC,iBAAA,GAAA,kBAAA,KAAA,CAAC,UAAD;EAAQ,GAAKC,wBAAAA,cAAc,KAAK;EAAhC,UAAA,CACG,OACD,iBAAA,GAAA,kBAAA,IAAA,CAAC,SAAD;GACC,UAAW;GACA;GACJ;GACC;GACC;GACT,SAAU,YAAY,aAAa,UAAU,KAAA;GACvC;GACQ;GACN;GACC;GACT,OACC,OAAO,KAAM,UAAW,CAAC,CAAC,SACvB,aACA,KAAA;GAGJ,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,aAAAA,SAAD,EAAiB,OAAU,CAAA;EACrB,CAAA,GAEN,CAAEC,wBAAAA,SAAS,QAAS,OAAQ,KAC7B,iBAAA,GAAA,kBAAA,IAAA,CAACA,wBAAAA,SAAS,SAAV;GACC,YAAA,GAAYC,wBAAAA,kCAAAA,CAAmC,SAAU;GACzD,SAAQ;GACR,OAAQ;EACR,CAAA,CAEK;;AAEV"}