(()=>{"use strict";const e=window.wp.blocks,o=window.wp.blockEditor,s=window.wp.components,t=window.wp.i18n,a=window.ReactJSXRuntime,l=JSON.parse('{"UU":"suredash/identity"}');(0,e.registerBlockType)(l.UU,{icon:(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-signature",style:{fill:"none",width:"16px"},children:[(0,a.jsx)("path",{d:"m21 17-2.156-1.868A.5.5 0 0 0 18 15.5v.5a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1c0-2.545-3.991-3.97-8.5-4a1 1 0 0 0 0 5c4.153 0 4.745-11.295 5.708-13.5a2.5 2.5 0 1 1 3.31 3.284"}),(0,a.jsx)("path",{d:"M3 21h18"})]}),edit:({attributes:{elements:e,logo:l,width:i,stacked:n,responsivesidenavigation:r},setAttributes:d})=>{const c=(0,o.useBlockProps)({style:{fontFamily:"var(--portal-font-family)"},className:"suredash-portal__editor-identity portal-content"}),p=n?"portal-site-identity portal-logo-title-stacked":"portal-site-identity";return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.InspectorControls,{children:(0,a.jsxs)(s.PanelBody,{children:[(0,a.jsxs)(s.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,t.__)("Elements Visibility","suredash"),value:e,onChange:e=>d({elements:e}),isBlock:!0,children:[(0,a.jsx)(s.__experimentalToggleGroupControlOption,{value:"logo",label:(0,t._x)("Logo","Showcase only logo","suredash")}),(0,a.jsx)(s.__experimentalToggleGroupControlOption,{value:"title",label:(0,t._x)("Title","Showcase only title","suredash")}),(0,a.jsx)(s.__experimentalToggleGroupControlOption,{value:"both",label:(0,t._x)("Both","Showcase both logo and title","suredash")})]}),"title"!==e&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.MediaUpload,{onSelect:e=>{d({logo:e?.url||""})},allowedTypes:["image"],value:l,render:({open:e})=>(0,a.jsx)("div",{className:"portal-logo-upload",style:{marginTop:"12px",marginBottom:"12px"},children:l?(0,a.jsxs)("div",{className:"portal-logo-wrapper",children:[(0,a.jsx)("img",{src:l,alt:(0,t.__)("SureDash Portal Logo","suredash"),style:{width:"100%",height:"auto",display:"block",borderRadius:"3px",boxShadow:"0 1px 3px rgba(0,0,0,0.1)"},onClick:e}),(0,a.jsxs)("div",{style:{marginTop:"12px",display:"flex",gap:"8px"},children:[(0,a.jsx)("button",{type:"button",className:"components-button is-primary",onClick:e,children:(0,t.__)("Change Logo","suredash")}),(0,a.jsx)("button",{type:"button",className:"components-button is-secondary",onClick:()=>d({logo:""}),children:(0,t.__)("Remove","suredash")})]})]}):(0,a.jsx)("button",{type:"button",className:"components-button button button-primary",onClick:e,children:(0,t.__)("Upload Logo","suredash")})})}),(0,a.jsx)(o.__experimentalUnitControl,{label:(0,t.__)("Logo Size","suredash"),__unstableInputWidth:"100px",value:i,onChange:e=>d({width:e})})]}),"both"===e&&(0,a.jsx)(s.ToggleControl,{label:(0,t.__)("Stack Logo & Title","suredash"),checked:n,onChange:e=>d({stacked:e})}),(0,a.jsx)(s.ToggleControl,{label:(0,t.__)("Responsive: Aside Navigation Trigger","suredash"),checked:r,onChange:e=>d({responsivesidenavigation:e})}),(0,a.jsxs)(s.Notice,{status:"info",className:"spectra-sidebar-settings-notice",isDismissible:!1,children:[(0,t.__)("In responsive mode, the side navigation trigger appears aside to Identity block.","suredash"),(0,a.jsx)("br",{}),(0,a.jsx)("br",{}),(0,t.__)("You also have other option to keep is aside of Title block.","suredash")]})]})}),(0,a.jsx)("div",{...c,children:(0,a.jsx)("div",{className:"portal-branding-section",children:(0,a.jsx)("div",{className:"portal-banner-heading sd-no-space",children:(0,a.jsxs)("a",{href:"javascript:void(0)",className:p,children:[" ",("both"===e||"logo"===e)&&l&&(0,a.jsx)("img",{src:l,className:"portal-logo",style:{maxWidth:i,width:"100%"},alt:"SureDash Portal Logo"}),("both"===e||"title"===e)&&(0,a.jsxs)("span",{children:[" ",portal_blocks.blocks_required_configs.portal_name," "]})]})})})})]})},save:function(){return(0,a.jsx)(o.InnerBlocks.Content,{})}})})();