(()=>{"use strict";const e=window.React,t=window.wp.blocks,r=window.wp.blockEditor,i=window.wp.components,s=window.wp.i18n,l=(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},(0,e.createElement)("path",{fill:"currentColor",d:"M4 4h4v4H4V4zm6 1v2h10V5H10zm-6 5h4v4H4v-4zm6 1v2h10v-2H10zm-6 5h4v4H4v-4zm6 1v2h10v-2H10z"}));(0,t.registerBlockType)("pressprimer-quiz/my-attempts",{icon:l,edit:function(t){const{attributes:n,setAttributes:o}=t,{showScore:p,showDate:a,perPage:m}=n,c=(0,r.useBlockProps)();return(0,e.createElement)("div",{...c},(0,e.createElement)(r.InspectorControls,null,(0,e.createElement)(i.PanelBody,{title:(0,s.__)("Display Settings","pressprimer-quiz"),initialOpen:!0},(0,e.createElement)(i.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,s.__)("Show Score","pressprimer-quiz"),help:(0,s.__)("Display the score percentage for each attempt","pressprimer-quiz"),checked:p,onChange:e=>o({showScore:e})}),(0,e.createElement)(i.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,s.__)("Show Date","pressprimer-quiz"),help:(0,s.__)("Display the date when each quiz was completed","pressprimer-quiz"),checked:a,onChange:e=>o({showDate:e})}),(0,e.createElement)(i.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,s.__)("Attempts Per Page","pressprimer-quiz"),help:(0,s.__)("Number of attempts to show per page","pressprimer-quiz"),value:m,onChange:e=>o({perPage:e}),min:5,max:100,step:5}))),(0,e.createElement)(i.Placeholder,{icon:l,label:(0,s.__)("PPQ Quiz Attempts","pressprimer-quiz"),instructions:(0,s.__)("This block displays the current user's quiz attempts. Configure display options in the sidebar.","pressprimer-quiz")},(0,e.createElement)("div",{style:{textAlign:"left",width:"100%",padding:"20px"}},(0,e.createElement)("p",{style:{margin:"0 0 10px",color:"#666",fontSize:"14px"}},(0,e.createElement)("strong",null,(0,s.__)("Settings:","pressprimer-quiz"))),(0,e.createElement)("ul",{style:{margin:0,paddingLeft:"20px",color:"#666",fontSize:"13px"}},(0,e.createElement)("li",null,(0,s.__)("Show Score:","pressprimer-quiz")," ",(0,e.createElement)("strong",null,p?(0,s.__)("Yes","pressprimer-quiz"):(0,s.__)("No","pressprimer-quiz"))),(0,e.createElement)("li",null,(0,s.__)("Show Date:","pressprimer-quiz")," ",(0,e.createElement)("strong",null,a?(0,s.__)("Yes","pressprimer-quiz"):(0,s.__)("No","pressprimer-quiz"))),(0,e.createElement)("li",null,(0,s.__)("Per Page:","pressprimer-quiz")," ",(0,e.createElement)("strong",null,m))),(0,e.createElement)("p",{style:{marginTop:"15px",color:"#999",fontSize:"12px",fontStyle:"italic"}},(0,s.__)("Preview not available in editor. The list will display on the frontend for logged-in users.","pressprimer-quiz")))))},save:()=>null})})();