{"version":3,"file":"PDFButton_1.DLU7IX86.mjs","names":["__esmMin","window","init_ssg_sandbox_shims","init_jsx_runtime","c","p","addPropertyControls","init_framer_BptO5W0R","ControlType","PDFButton","props","handleClick","pdfFile","viewerUrl","style","textColor","font","showIcon","hoverBackgroundColor","hoverTextColor","backgroundColor","iconPosition","icon","iconSize","buttonText","init_PDFButton_1"],"sources":["https:/framerusercontent.com/modules/JUTo7zwfXW6CBZJrC6EZ/0TERO8HWq4CVYr7i01Id/PDFButton_1.js"],"sourcesContent":["// PDF Button - Upload PDF in Framer editor and open in browser without downloading\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function PDFButton(props){const{pdfFile=\"https://framerusercontent.com/assets/example.pdf\",buttonText,showIcon,icon={src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Icon\"},iconPosition,iconSize,backgroundColor,textColor,hoverBackgroundColor,hoverTextColor,borderRadius,padding,font,style}=props;const handleClick=()=>{if(typeof window!==\"undefined\"&&pdfFile){// Use PDF.js viewer to force browser display instead of download\nconst viewerUrl=`https://mozilla.github.io/pdf.js/web/viewer.html?file=${encodeURIComponent(pdfFile)}`;window.open(viewerUrl,\"_blank\");}};return /*#__PURE__*/_jsx(\"div\",{style:{...style,position:\"relative\"},children:/*#__PURE__*/_jsxs(\"button\",{onClick:handleClick,style:{backgroundColor,color:textColor,borderRadius,padding,border:\"none\",cursor:\"pointer\",transition:\"all 0.2s ease\",...font,width:\"max-content\",display:\"flex\",alignItems:\"center\",gap:showIcon?\"8px\":\"0\"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=hoverBackgroundColor;e.currentTarget.style.color=hoverTextColor;},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=backgroundColor;e.currentTarget.style.color=textColor;},children:[showIcon&&iconPosition===\"before\"&&/*#__PURE__*/_jsx(\"img\",{src:icon.src,alt:icon.alt||\"Icon\",style:{width:iconSize,height:iconSize,objectFit:\"contain\"}}),buttonText,showIcon&&iconPosition===\"after\"&&/*#__PURE__*/_jsx(\"img\",{src:icon.src,alt:icon.alt||\"Icon\",style:{width:iconSize,height:iconSize,objectFit:\"contain\"}})]})});}addPropertyControls(PDFButton,{pdfFile:{type:ControlType.File,title:\"PDF File\",allowedFileTypes:[\"pdf\"]},buttonText:{type:ControlType.String,title:\"Button Text\",defaultValue:\"Open PDF\"},showIcon:{type:ControlType.Boolean,title:\"Show Icon\",defaultValue:false,enabledTitle:\"Show\",disabledTitle:\"Hide\"},icon:{type:ControlType.ResponsiveImage,title:\"Icon\",hidden:({showIcon})=>!showIcon},iconPosition:{type:ControlType.Enum,title:\"Icon Position\",options:[\"before\",\"after\"],optionTitles:[\"Before\",\"After\"],defaultValue:\"before\",displaySegmentedControl:true,hidden:({showIcon})=>!showIcon},iconSize:{type:ControlType.Number,title:\"Icon Size\",defaultValue:16,min:8,max:48,step:1,unit:\"px\",hidden:({showIcon})=>!showIcon},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#000000\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#FFFFFF\"},hoverBackgroundColor:{type:ControlType.Color,title:\"Hover Background\",defaultValue:\"#333333\"},hoverTextColor:{type:ControlType.Color,title:\"Hover Text\",defaultValue:\"#FFFFFF\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:8,min:0,max:50,step:1,unit:\"px\"},padding:{type:ControlType.Padding,title:\"Padding\",defaultValue:\"12px 24px\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"14px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PDFButton\",\"slots\":[],\"annotations\":{\"framerSupportedLay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