(()=>{"use strict";const e=window.React,{__}=wp.i18n,{addFilter:t}=wp.hooks,{PanelBody:a,TextControl:n,SelectControl:r}=wp.components,{Fragment:c}=wp.element,{createHigherOrderComponent:s}=wp.compose,{InspectorControls:l}=wp.editor;t("editor.BlockEdit","uncanny-learndash-codes/uo-code-registration",s((t=>r=>"uncanny-learndash-codes/uo-code-registration"==r.name&&r.isSelected?(0,e.createElement)(c,null,(0,e.createElement)(t,{...r}),(0,e.createElement)(l,null,(0,e.createElement)(a,{title:__("User Registration Settings","uncanny-learndash-codes")},(0,e.createElement)(n,{label:__("redirect"),value:r.attributes.redirect,type:"text",onChange:e=>{r.setAttributes({redirect:e})}}),(0,e.createElement)(n,{label:__("code_optional"),value:r.attributes.code_optional,type:"text",onChange:e=>{r.setAttributes({code_optional:e})}}),(0,e.createElement)(n,{label:__("auto_login"),value:r.attributes.auto_login,type:"text",onChange:e=>{r.setAttributes({auto_login:e})}}),(0,e.createElement)(n,{label:__("role"),value:r.attributes.role,type:"text",onChange:e=>{r.setAttributes({role:e})}})))):(0,e.createElement)(t,{...r})),"addUncannyUoCodeRegistrationSettings")),(0,e.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,e.createElement)("path",{d:"M21.9,0c0,0.2,0,0.4,0.1,0.6c0,0.4,0,0.9,0,1.3c0,0.5,0,1-0.1,1.4c-0.1,1.1-0.3,2.2-0.7,3.3c-0.3,0.9-0.7,1.8-1.3,2.5 c-0.5,0.7-1.1,1.4-1.8,1.9c-0.7,0.5-1.5,1-2.4,1.3c-1.1,0.4-2.2,0.5-3.3,0.6c3,1.1,4.5,4.3,3.4,7.3c-0.8,2.2-2.9,3.7-5.2,3.8h-0.3 C10,24,9.5,23.9,9,23.8c-1.2-0.3-2.3-1.1-3.1-2.1c-1.2-1.7-1.4-3.9-0.5-5.8c-1,1.1-1.9,2.3-2.5,3.7c-0.4,0.8-0.7,1.7-0.9,2.6 c-0.1-0.6,0-1.2,0-1.8c0.1-1.1,0.2-2.2,0.5-3.3c0.2-0.9,0.6-1.8,1-2.6c0.5-0.8,1-1.5,1.7-2.2c0.7-0.7,1.6-1.2,2.5-1.5 c1-0.4,2.1-0.6,3.2-0.7c0.6,0,1.1,0,1.7-0.1c1-0.1,2-0.4,3-0.8c0.9-0.4,1.7-0.9,2.4-1.6c0.7-0.6,1.3-1.3,1.8-2.1 c0.5-0.9,1-1.8,1.3-2.7C21.5,1.9,21.8,0.9,21.9,0z M10.2,13.8c-0.8,0.1-1.5,0.4-2.1,0.9c-0.7,0.6-1.2,1.4-1.5,2.2 c-0.3,1-0.3,2.1,0.1,3.1c0.3,0.8,0.8,1.6,1.5,2.1c0.6,0.4,1.3,0.7,2,0.8c0.7,0.1,1.5-0.1,2.1-0.4c0.6-0.3,1.1-0.7,1.5-1.2 c0.4-0.6,0.8-1.2,0.9-1.9c0.2-0.9,0.1-1.9-0.2-2.8c-0.3-0.8-0.9-1.6-1.7-2.1C12,14,11.1,13.8,10.2,13.8z"}),(0,e.createElement)("path",{d:"M10,15.5c0.3-0.1,0.5-0.1,0.8-0.1c-0.5,0.5-0.5,1.2-0.1,1.8c0.5,0.6,1.3,0.6,1.9,0.2c0.2-0.2,0.4-0.4,0.4-0.7 c0.5,0.7,0.7,1.7,0.5,2.5c-0.2,0.8-0.8,1.5-1.5,1.8c-1.4,0.8-3.2,0.2-4-1.2c0-0.1-0.1-0.2-0.1-0.3c-0.3-0.8-0.3-1.8,0.2-2.6 C8.5,16.2,9.2,15.6,10,15.5z"}));const o=(0,e.createElement)("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 19.98 24"},(0,e.createElement)("path",{fill:"#2b2b2b",d:"M21.9,0c0,.21,0,.42.05.63,0,.44.05.87,0,1.3s0,1-.09,1.45a14.91,14.91,0,0,1-.69,3.3A10.38,10.38,0,0,1,20,9.22a8.34,8.34,0,0,1-1.83,1.92,8.89,8.89,0,0,1-2.4,1.26,11.69,11.69,0,0,1-3.27.57,5.68,5.68,0,0,1-1.78,11h-.26A5.9,5.9,0,0,1,9,23.8a5.68,5.68,0,0,1-3.62-7.93,12.6,12.6,0,0,0-2.49,3.67,13.65,13.65,0,0,0-.87,2.57,13.52,13.52,0,0,1,0-1.8A14.81,14.81,0,0,1,2.54,17a11.15,11.15,0,0,1,1-2.56,8.72,8.72,0,0,1,1.71-2.15,8.42,8.42,0,0,1,2.48-1.55A11.13,11.13,0,0,1,11,10c.56,0,1.12,0,1.68-.1a9.89,9.89,0,0,0,3-.76,9,9,0,0,0,2.42-1.57,10.43,10.43,0,0,0,1.79-2.13A13.71,13.71,0,0,0,21.2,2.74,14.31,14.31,0,0,0,21.9,0ZM10.17,13.83A4.2,4.2,0,0,0,8,14.69a4.52,4.52,0,0,0-1.52,2.22A4.82,4.82,0,0,0,6.59,20a4.49,4.49,0,0,0,1.54,2.08,4,4,0,0,0,4.18.39,4.39,4.39,0,0,0,1.45-1.19,4.57,4.57,0,0,0,.91-1.91,4.82,4.82,0,0,0-.25-2.81,4.46,4.46,0,0,0-1.69-2.07A4.06,4.06,0,0,0,10.17,13.83Z",transform:"translate(-2.01)"}),(0,e.createElement)("path",{fill:"#f9ba0f",d:"M10.17,13.83a4.06,4.06,0,0,1,2.56.64,4.46,4.46,0,0,1,1.69,2.07,4.82,4.82,0,0,1,.25,2.81,4.57,4.57,0,0,1-.91,1.91,4.39,4.39,0,0,1-1.45,1.19,4,4,0,0,1-4.18-.39A4.56,4.56,0,0,1,6.59,20a4.82,4.82,0,0,1-.07-3.07A4.52,4.52,0,0,1,8,14.69,4.13,4.13,0,0,1,10.17,13.83Zm.61,1.58h0A3,3,0,0,0,8,16.88a2.94,2.94,0,0,0,3.7,4.18,1.51,1.51,0,0,0,.26-.12,2.93,2.93,0,0,0,1-4.32h0a1.29,1.29,0,0,0-.32-1.16,1.33,1.33,0,0,0-1.88-.07Z",transform:"translate(-2.01)"}),(0,e.createElement)("path",{fill:"#fef4d8",d:"M10.78,15.41a1.33,1.33,0,0,1,1.88,0l0,0A1.29,1.29,0,0,1,13,16.61a3.42,3.42,0,0,0-.7-.67A2.91,2.91,0,0,0,10.78,15.41Z",transform:"translate(-2.01)"}),(0,e.createElement)("path",{fill:"#000000",d:"M10,15.47a2.68,2.68,0,0,1,.8-.06,1.3,1.3,0,0,0-.08,1.76,1.32,1.32,0,0,0,1.86.17,1.27,1.27,0,0,0,.44-.72,2.92,2.92,0,0,1-1,4.32,3,3,0,0,1-4-1.23l-.12-.26A2.94,2.94,0,0,1,8,16.88,3,3,0,0,1,10,15.47Z",transform:"translate(-2.01)"}),(0,e.createElement)("path",{fill:"#d6d6d6",d:"M10.78,15.41h0a3,3,0,0,1,1.53.54,3.42,3.42,0,0,1,.7.67h0a1.32,1.32,0,1,1-2.58-.56A1.35,1.35,0,0,1,10.78,15.41Z",transform:"translate(-2.01)"})),d=({children:t})=>(0,e.createElement)("div",{className:"uo-learndash-codes-content"},t),{__:i}=wp.i18n,{registerBlockType:u}=wp.blocks;u("uncanny-learndash-codes/uo-code-registration",{title:i("User Code Registration","uncanny-learndash-codes"),description:i("This will add a very basic registration form to the page that includes a code redemption field.","uncanny-learndash-codes"),icon:o,category:"uncanny-learndash-codes",keywords:[i("Uncanny Owl")],supports:{html:!1},attributes:{redirect:{type:"string",default:""},code_optional:{type:"string",default:"no"},auto_login:{type:"string",default:"yes"},role:{type:"string",default:"subscriber"}},edit:({className:t,attributes:a,setAttributes:n})=>(0,e.createElement)("div",{className:t},(0,e.createElement)(d,null,i("User Code Registration","uncanny-learndash-codes"))),save:({className:e,attributes:t})=>null});const{__:m}=wp.i18n,{addFilter:p}=wp.hooks,{PanelBody:h,TextControl:g,SelectControl:y}=wp.components,{Fragment:w}=wp.element,{createHigherOrderComponent:b}=wp.compose,{InspectorControls:E}=wp.editor;p("editor.BlockEdit","uncanny-learndash-codes/uo-user-redeem-code",b((t=>a=>"uncanny-learndash-codes/uo-user-redeem-code"==a.name&&a.isSelected?(0,e.createElement)(w,null,(0,e.createElement)(t,{...a}),(0,e.createElement)(E,null,(0,e.createElement)(h,{title:m("User Registration Settings","uncanny-learndash-codes")},(0,e.createElement)(g,{label:m("redirect"),value:a.attributes.redirect,type:"text",onChange:e=>{a.setAttributes({redirect:e})}})))):(0,e.createElement)(t,{...a})),"addUncannyUoCodeRedeemSettings"));const{__:C}=wp.i18n,{registerBlockType:f}=wp.blocks;f("uncanny-learndash-codes/uo-user-redeem-code",{title:C("User Redeem Code","uncanny-learndash-codes"),description:C("Signed in users can redeem group or course codes from anywhere on a LearnDash site by using this.","uncanny-learndash-codes"),icon:o,category:"uncanny-learndash-codes",keywords:[C("Uncanny Owl")],supports:{html:!1},attributes:{redirect:{type:"string",default:""}},edit:({className:t,attributes:a,setAttributes:n})=>(0,e.createElement)("div",{className:t},(0,e.createElement)(d,null,C("User Redeem Code","uncanny-learndash-codes"))),save:({className:e,attributes:t})=>null})})();