From 70dded0898c7f433a13cfd12f8d58aa40b77cd1a Mon Sep 17 00:00:00 2001 From: Brian Hogg Date: Fri, 13 Sep 2024 12:08:49 -0400 Subject: [PATCH 1/2] Avoid unsaved changes error when updating access plans (#237) * Avoid unsaved changes error when access plan is saved by not replacing the pricing table block with a new one. --- .../fix_avoid-unsaved-changes-error.yml | 5 + .gitignore | 2 + assets/js/llms-blocks.asset.php | 1 - assets/js/llms-blocks.js | 24 - i18n/lifterlms-blocks.pot | 1104 ----------------- src/js/blocks/pricing-table/index.js | 23 +- 6 files changed, 16 insertions(+), 1143 deletions(-) create mode 100644 .changelogs/fix_avoid-unsaved-changes-error.yml delete mode 100644 assets/js/llms-blocks.asset.php delete mode 100644 assets/js/llms-blocks.js delete mode 100644 i18n/lifterlms-blocks.pot diff --git a/.changelogs/fix_avoid-unsaved-changes-error.yml b/.changelogs/fix_avoid-unsaved-changes-error.yml new file mode 100644 index 00000000..98d81bfb --- /dev/null +++ b/.changelogs/fix_avoid-unsaved-changes-error.yml @@ -0,0 +1,5 @@ +significance: patch +type: fixed +links: + - "#232" +entry: Avoid an unsaved error prompt after saving the details of an access plan. diff --git a/.gitignore b/.gitignore index cd1815c6..4cda729c 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,7 @@ node_modules tmp vendor assets/**/*.map +assets/js/llms-blocks* +i18n/* composer.lock diff --git a/assets/js/llms-blocks.asset.php b/assets/js/llms-blocks.asset.php deleted file mode 100644 index f60fdcba..00000000 --- a/assets/js/llms-blocks.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('jquery', 'lodash', 'react', 'react-dom', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-server-side-render', 'wp-url'), 'version' => '3d0ac515c027ac702c56'); diff --git a/assets/js/llms-blocks.js b/assets/js/llms-blocks.js deleted file mode 100644 index a9f2a154..00000000 --- a/assets/js/llms-blocks.js +++ /dev/null @@ -1,24 +0,0 @@ -(()=>{var e={679:(e,t,n)=>{"use strict";var r=n(296),l={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},s={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},i={};function a(e){return r.isMemo(e)?o:i[e.$$typeof]||l}i[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},i[r.Memo]=o;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,m=Object.getPrototypeOf,f=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(f){var l=m(n);l&&l!==f&&e(t,l,r)}var o=u(n);d&&(o=o.concat(d(n)));for(var i=a(t),h=a(n),g=0;g{"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,l=n?Symbol.for("react.portal"):60106,s=n?Symbol.for("react.fragment"):60107,o=n?Symbol.for("react.strict_mode"):60108,i=n?Symbol.for("react.profiler"):60114,a=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,p=n?Symbol.for("react.forward_ref"):60112,m=n?Symbol.for("react.suspense"):60113,f=n?Symbol.for("react.suspense_list"):60120,h=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.block"):60121,b=n?Symbol.for("react.fundamental"):60117,_=n?Symbol.for("react.responder"):60118,y=n?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case d:case s:case i:case o:case m:return e;default:switch(e=e&&e.$$typeof){case c:case p:case g:case h:case a:return e;default:return t}}case l:return t}}}function E(e){return w(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=a,t.Element=r,t.ForwardRef=p,t.Fragment=s,t.Lazy=g,t.Memo=h,t.Portal=l,t.Profiler=i,t.StrictMode=o,t.Suspense=m,t.isAsyncMode=function(e){return E(e)||w(e)===u},t.isConcurrentMode=E,t.isContextConsumer=function(e){return w(e)===c},t.isContextProvider=function(e){return w(e)===a},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===p},t.isFragment=function(e){return w(e)===s},t.isLazy=function(e){return w(e)===g},t.isMemo=function(e){return w(e)===h},t.isPortal=function(e){return w(e)===l},t.isProfiler=function(e){return w(e)===i},t.isStrictMode=function(e){return w(e)===o},t.isSuspense=function(e){return w(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===s||e===d||e===i||e===o||e===m||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===h||e.$$typeof===a||e.$$typeof===c||e.$$typeof===p||e.$$typeof===b||e.$$typeof===_||e.$$typeof===y||e.$$typeof===v)},t.typeOf=w},296:(e,t,n)=>{"use strict";e.exports=n(103)},703:(e,t,n)=>{"use strict";var r=n(414);function l(){}function s(){}s.resetWarningCache=l,e.exports=function(){function e(e,t,n,l,s,o){if(o!==r){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:s,resetWarningCache:l};return n.PropTypes=n,n}},697:(e,t,n)=>{e.exports=n(703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},639:(e,t,n)=>{"use strict";var r=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(this.props,[]);return function(e){u.forEach((function(t){return delete e[t]}))}(l),l.className=this.props.inputClassName,l.id=this.state.inputId,l.style=n,o.default.createElement("div",{className:this.props.className,style:t},this.renderStyles(),o.default.createElement("input",r({},l,{ref:this.inputRef})),o.default.createElement("div",{ref:this.sizerRef,style:c},e),this.props.placeholder?o.default.createElement("div",{ref:this.placeHolderSizerRef,style:c},this.props.placeholder):null)}}]),t}(s.Component);f.propTypes={className:i.default.string,defaultValue:i.default.any,extraWidth:i.default.oneOfType([i.default.number,i.default.string]),id:i.default.string,injectStyles:i.default.bool,inputClassName:i.default.string,inputRef:i.default.func,inputStyle:i.default.object,minWidth:i.default.oneOfType([i.default.number,i.default.string]),onAutosize:i.default.func,onChange:i.default.func,placeholder:i.default.string,placeholderIsMinWidth:i.default.bool,style:i.default.object,value:i.default.any},f.defaultProps={minWidth:1,injectStyles:!0},t.Z=f},774:function(e,t){!function(e){"use strict";function t(e,t,n,r){var l,s=!1,o=0;function i(){l&&clearTimeout(l)}function a(){for(var a=arguments.length,c=new Array(a),u=0;ue?m():!0!==t&&(l=setTimeout(r?f:m,void 0===r?e-p:e)))}return"boolean"!=typeof t&&(r=n,n=t,t=void 0),a.cancel=function(){i(),s=!0},a}e.debounce=function(e,n,r){return void 0===r?t(e,n,!1):t(e,r,!1!==n)},e.throttle=t,Object.defineProperty(e,"__esModule",{value:!0})}(t)},196:e=>{"use strict";e.exports=window.React}},t={};function n(r){var l=t[r];if(void 0!==l)return l.exports;var s=t[r]={exports:{}};return e[r].call(s.exports,s,s.exports,n),s.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e={};n.r(e),n.d(e,{addField:()=>sl,deleteField:()=>ol,editField:()=>il,loadField:()=>al,receiveFields:()=>ul,renameField:()=>dl,resetFields:()=>pl,unloadField:()=>cl});var t={};n.r(t),n.d(t,{fieldExists:()=>ml,getField:()=>fl,getFieldBy:()=>hl,getFields:()=>gl,getLoadedFields:()=>vl,isDuplicate:()=>bl,isLoaded:()=>_l});var r={};n.r(r),n.d(r,{name:()=>Ol,postTypes:()=>Il,settings:()=>Tl});var l={};n.r(l),n.d(l,{name:()=>Ll,postTypes:()=>Rl,settings:()=>Vl});var s={};n.r(s),n.d(s,{name:()=>Fl,postTypes:()=>Al,settings:()=>Bl});var o={};n.r(o),n.d(o,{name:()=>ql,postTypes:()=>Gl,settings:()=>Wl});var i={};n.r(i),n.d(i,{name:()=>Yl,postTypes:()=>Xl,settings:()=>Ql});var a={};n.r(a),n.d(a,{name:()=>Jl,postTypes:()=>es,settings:()=>ts});var c={};n.r(c),n.d(c,{name:()=>os,postTypes:()=>is,settings:()=>as});var u={};n.r(u),n.d(u,{name:()=>cs,settings:()=>us});var d={};n.r(d),n.d(d,{Search:()=>Br,SearchPost:()=>Hr,SearchUser:()=>Cs,SortableDragHandle:()=>Ei,SortableList:()=>Ci});var p={};n.r(p),n.d(p,{composed:()=>ji,name:()=>$i,postTypes:()=>Ui,settings:()=>Qi});var m={};n.r(m),n.d(m,{composed:()=>ta,name:()=>Ji,postTypes:()=>ea,settings:()=>na});var f={};n.r(f),n.d(f,{composed:()=>oa,name:()=>la,postTypes:()=>sa,settings:()=>ia});var h={};n.r(h),n.d(h,{composed:()=>da,name:()=>ca,postTypes:()=>ua,settings:()=>pa});var g={};n.r(g),n.d(g,{composed:()=>Ea,name:()=>ya,postTypes:()=>wa,settings:()=>Ca});var v={};n.r(v),n.d(v,{composed:()=>Oa,name:()=>Sa,postTypes:()=>wa,settings:()=>Ia});var b={};n.r(b),n.d(b,{composed:()=>Ma,name:()=>Pa,postTypes:()=>wa,settings:()=>Da});var _={};n.r(_),n.d(_,{composed:()=>Va,name:()=>Ra,postTypes:()=>wa,settings:()=>Na});var y={};n.r(y),n.d(y,{composed:()=>Ba,name:()=>Fa,postTypes:()=>wa,settings:()=>Ha});var w={};n.r(w),n.d(w,{composed:()=>$a,name:()=>za,postTypes:()=>wa,settings:()=>Ua});var E={};n.r(E),n.d(E,{composed:()=>Ga,name:()=>qa,postTypes:()=>wa,settings:()=>Wa});var x={};n.r(x),n.d(x,{composed:()=>Ya,name:()=>Ka,postTypes:()=>wa,settings:()=>Xa});var C={};n.r(C),n.d(C,{composed:()=>Ja,name:()=>Qa,postTypes:()=>Za,settings:()=>ec});var k={};n.r(k),n.d(k,{composed:()=>nc,name:()=>tc,postTypes:()=>wa,settings:()=>lc});var S={};n.r(S),n.d(S,{composed:()=>ac,name:()=>oc,postTypes:()=>ic,settings:()=>cc});var O={};n.r(O),n.d(O,{composed:()=>pc,name:()=>uc,postTypes:()=>dc,settings:()=>mc});var I={};n.r(I),n.d(I,{composed:()=>gc,name:()=>hc,postTypes:()=>wa,settings:()=>vc});var T={};n.r(T),n.d(T,{composed:()=>_c,name:()=>bc,postTypes:()=>wa,settings:()=>yc});var P={};n.r(P),n.d(P,{composed:()=>xc,name:()=>Ec,postTypes:()=>wa,settings:()=>Cc});var M={};n.r(M),n.d(M,{composed:()=>Oc,name:()=>Sc,postTypes:()=>ua,settings:()=>Ic});var D={};n.r(D),n.d(D,{composed:()=>Mc,name:()=>Tc,postTypes:()=>Pc,settings:()=>Dc});var L={};n.r(L),n.d(L,{composed:()=>Vc,name:()=>Rc,postTypes:()=>ua,settings:()=>Nc});var R={};n.r(R),n.d(R,{composed:()=>Bc,name:()=>Fc,postTypes:()=>wa,settings:()=>Hc});var V={};n.r(V),n.d(V,{composed:()=>$c,name:()=>zc,postTypes:()=>wa,settings:()=>Uc});var N={};n.r(N),n.d(N,{checkboxes:()=>m,confirmGroup:()=>p,radio:()=>f,redeemVoucher:()=>b,select:()=>h,text:()=>g,textarea:()=>v,userAddress:()=>S,userAddressCity:()=>P,userAddressCountry:()=>M,userAddressPostalCode:()=>R,userAddressRegion:()=>D,userAddressState:()=>L,userAddressStreet:()=>O,userAddressStreetPrimary:()=>I,userAddressStreetSecondary:()=>T,userDisplayName:()=>_,userEmail:()=>w,userFirstName:()=>E,userLastName:()=>x,userLogin:()=>y,userNames:()=>C,userPassword:()=>k,userPhone:()=>V});const A=window.wp.element,F=window.wp.primitives,B=()=>(0,A.createElement)(A.Fragment,null,(0,A.createElement)(F.SVG,{width:"20px",height:"20px",viewBox:"0 0 85 85",version:"1.1",style:{fillRule:"evenodd",clipRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:1.41421}},(0,A.createElement)(F.G,{id:"lifterlms-icon"},(0,A.createElement)(F.Path,{d:"M29.061,50.631l-2.258,-1.29l-6.066,10.452c-5.483,-7.613 -6.58,-17.873 -2.322,-26.712l0.064,-0.065c0.258,-0.581 0.581,-1.097 0.839,-1.613c4.323,-7.485 11.873,-12.067 19.873,-12.905c1.42,-1.935 2.969,-3.614 4.711,-5.226c-11.421,-0.645 -22.843,5.032 -28.972,15.615c-7.872,13.679 -4.258,30.841 7.872,40.263l6.065,-18.003c0.065,-0.128 0.13,-0.323 0.194,-0.516m36.908,-16.712c3.227,7.421 3.033,16.195 -1.291,23.681c-0.257,0.516 -0.58,1.031 -0.903,1.548l-0.064,0.066c-5.549,8.129 -14.97,12.323 -24.326,11.355l6.066,-10.453l-2.259,-1.291c-0.129,0.13 -0.258,0.259 -0.387,0.389l-12.518,14.259c14.196,5.808 30.907,0.323 38.779,-13.357c6.13,-10.581 5.356,-23.293 -0.967,-32.842c-0.517,2.257 -1.162,4.516 -2.13,6.645"}),(0,A.createElement)(F.Path,{d:"M44.999,50.243c-1.614,2.13 -4.194,3.228 -6.968,3.485c-0.839,0.065 -1.614,-0.387 -2.001,-1.161c-1.162,-2.517 -1.548,-5.291 -0.451,-7.743l-12.648,-7.291c-0.838,-0.516 -1.225,-1.356 -0.967,-2.258c0.193,-0.904 0.967,-1.55 1.871,-1.55l12.84,-0.451c0.968,-3.936 2.581,-7.678 4.904,-11.163c3.678,-5.484 8.904,-9.549 15.034,-12.001c1.485,-0.581 2.968,-1.096 4.453,-1.484c1.096,-0.258 2.193,0.388 2.451,1.421c0.452,1.482 0.775,3.031 1.033,4.579c0.903,6.582 -0.065,13.163 -2.903,19.099c-1.807,3.743 -4.324,6.97 -7.228,9.808l6.001,11.292c0.452,0.839 0.323,1.807 -0.387,2.452c-0.645,0.645 -1.614,0.71 -2.387,0.258l-12.647,-7.292Zm9.549,-27.035c1.936,1.162 2.581,3.614 1.485,5.549c-1.098,1.936 -3.613,2.582 -5.55,1.485c-1.935,-1.098 -2.58,-3.614 -1.484,-5.55c1.162,-1.935 3.614,-2.581 5.549,-1.484"}),(0,A.createElement)(F.Path,{d:"M26.093,72.118l13.679,-15.551c-0.516,0.065 -1.032,0.129 -1.549,0.194c-2.064,0.129 -4,-0.968 -4.902,-2.903c-0.259,-0.452 -0.453,-0.904 -0.646,-1.42l-6.582,19.68Z"})))),H=window.wp.hooks;function z(e,t){let n=!0;return(-1!==window.llms.dynamic_blocks.indexOf(t)||e.supports&&!1===e.supports.llms_visibility||(0,H.applyFilters)("llms_block_visibility_disallowed_blocks",["core/freeform","llms/php-template"]).includes(t))&&(n=!1),(0,H.applyFilters)("llms_block_supports_visibility",n,e,t)}const $=window.wp.i18n,U=window.wp.compose,j=window.wp.blockEditor,q=window.wp.components,G={all:(0,$.__)("everyone","lifterlms"),enrolled:(0,$.__)("enrolled users","lifterlms"),not_enrolled:(0,$.__)("non-enrolled users or visitors","lifterlms"),logged_in:(0,$.__)("logged in users","lifterlms"),logged_out:(0,$.__)("logged out users","lifterlms")},W=Object.keys(G).map((e=>({label:G[e],value:e})));class K extends A.Component{render(){const{llms_visibility:e}=this.props.attributes,{children:t}=this.props;return"all"===e?t:(0,A.createElement)("div",{className:"llms-block-visibility"},t,(0,A.createElement)("div",{className:"llms-block-visibility--indicator"},(0,A.createElement)(q.Dashicon,{icon:"visibility"}),(0,A.createElement)("span",{className:"llms-block-visibility--msg"},(0,$.sprintf)(// Translators: %s = visibility setting label. -(0,$.__)("This block is only visible to %s","lifterlms"),G[n=e]||n))));var n}}function Y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var X=n(774);function Q(){return Q=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(l[n]=e[n]);return l}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(l[n]=e[n])}return l}var J=n(196),ee=n.n(J),te=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t0?ae(be,--ge):0,fe--,10===ve&&(fe=1,me--),ve}function Ee(){return ve=ge2||Se(ve)>3?"":" "}function Me(e,t){for(;--t&&Ee()&&!(ve<48||ve>102||ve>57&&ve<65||ve>70&&ve<97););return ke(e,Ce()+(t<6&&32==xe()&&32==Ee()))}function De(e){for(;Ee();)switch(ve){case e:return ge;case 34:case 39:34!==e&&39!==e&&De(ve);break;case 40:41===e&&De(e);break;case 92:Ee()}return ge}function Le(e,t){for(;Ee()&&e+ve!==57&&(e+ve!==84||47!==xe()););return"/*"+ke(t,ge-1)+"*"+re(47===e?e:Ee())}function Re(e){for(;!Se(xe());)Ee();return ke(e,ge)}var Ve="-ms-",Ne="-moz-",Ae="-webkit-",Fe="comm",Be="rule",He="decl",ze="@keyframes";function $e(e,t){for(var n="",r=de(e),l=0;l6)switch(ae(e,t+1)){case 109:if(45!==ae(e,t+4))break;case 102:return oe(e,/(.+:)(.+)-([^]+)/,"$1-webkit-$2-$3$1"+Ne+(108==ae(e,t+3)?"$3":"$2-$3"))+e;case 115:return~ie(e,"stretch")?je(oe(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==ae(e,t+1))break;case 6444:switch(ae(e,ue(e)-3-(~ie(e,"!important")&&10))){case 107:return oe(e,":",":"+Ae)+e;case 101:return oe(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ae+(45===ae(e,14)?"inline-":"")+"box$3$1"+Ae+"$2$3$1"+Ve+"$2box$3")+e}break;case 5936:switch(ae(e,t+11)){case 114:return Ae+e+Ve+oe(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ae+e+Ve+oe(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ae+e+Ve+oe(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Ae+e+Ve+e+e}return e}function qe(e){return Ie(Ge("",null,null,null,[""],e=Oe(e),0,[0],e))}function Ge(e,t,n,r,l,s,o,i,a){for(var c=0,u=0,d=o,p=0,m=0,f=0,h=1,g=1,v=1,b=0,_="",y=l,w=s,E=r,x=_;g;)switch(f=b,b=Ee()){case 40:if(108!=f&&58==x.charCodeAt(d-1)){-1!=ie(x+=oe(Te(b),"&","&\f"),"&\f")&&(v=-1);break}case 34:case 39:case 91:x+=Te(b);break;case 9:case 10:case 13:case 32:x+=Pe(f);break;case 92:x+=Me(Ce()-1,7);continue;case 47:switch(xe()){case 42:case 47:pe(Ke(Le(Ee(),Ce()),t,n),a);break;default:x+="/"}break;case 123*h:i[c++]=ue(x)*v;case 125*h:case 59:case 0:switch(b){case 0:case 125:g=0;case 59+u:m>0&&ue(x)-d&&pe(m>32?Ye(x+";",r,n,d-1):Ye(oe(x," ","")+";",r,n,d-2),a);break;case 59:x+=";";default:if(pe(E=We(x,t,n,c,u,l,i,_,y=[],w=[],d),s),123===b)if(0===u)Ge(x,t,E,E,y,s,d,i,w);else switch(p){case 100:case 109:case 115:Ge(e,E,E,r&&pe(We(e,E,E,0,0,l,i,_,l,y=[],d),w),l,w,d,i,r?y:w);break;default:Ge(x,E,E,E,[""],w,0,i,w)}}c=u=m=0,h=v=1,_=x="",d=o;break;case 58:d=1+ue(x),m=f;default:if(h<1)if(123==b)--h;else if(125==b&&0==h++&&125==we())continue;switch(x+=re(b),b*h){case 38:v=u>0?1:(x+="\f",-1);break;case 44:i[c++]=(ue(x)-1)*v,v=1;break;case 64:45===xe()&&(x+=Te(Ee())),p=xe(),u=d=ue(_=x+=Re(Ce())),b++;break;case 45:45===f&&2==ue(x)&&(h=0)}}return s}function We(e,t,n,r,l,s,o,i,a,c,u){for(var d=l-1,p=0===l?s:[""],m=de(p),f=0,h=0,g=0;f0?p[v]+" "+b:oe(b,/&\f/g,p[v])))&&(a[g++]=_);return _e(e,t,n,0===l?Be:i,a,c,u)}function Ke(e,t,n){return _e(e,t,n,Fe,re(ve),ce(e,2,-2),0)}function Ye(e,t,n,r){return _e(e,t,n,He,ce(e,0,r),ce(e,r+1,-1),r)}var Xe=function(e,t,n){for(var r=0,l=0;r=l,l=xe(),38===r&&12===l&&(t[n]=1),!Se(l);)Ee();return ke(e,ge)},Qe=new WeakMap,Ze=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||Qe.get(n))&&!r){Qe.set(e,!0);for(var l=[],s=function(e,t){return Ie(function(e,t){var n=-1,r=44;do{switch(Se(r)){case 0:38===r&&12===xe()&&(t[n]=1),e[n]+=Xe(ge-1,t,n);break;case 2:e[n]+=Te(r);break;case 4:if(44===r){e[++n]=58===xe()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=re(r)}}while(r=Ee());return e}(Oe(e),t))}(t,l),o=n.props,i=0,a=0;i-1&&!e.return)switch(e.type){case He:e.return=je(e.value,e.length);break;case ze:return $e([ye(e,{value:oe(e.value,"@","@"+Ae)})],r);case Be:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return $e([ye(e,{props:[oe(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return $e([ye(e,{props:[oe(t,/:(plac\w+)/,":-webkit-input-$1")]}),ye(e,{props:[oe(t,/:(plac\w+)/,":-moz-$1")]}),ye(e,{props:[oe(t,/:(plac\w+)/,Ve+"input-$1")]})],r)}return""}))}}];const tt=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var r,l,s=e.stylisPlugins||et,o={},i=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n=4;++r,l-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(l){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},ot={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var it=/[A-Z]|^ms/g,at=/_EMO_([^_]+?)_([^]*?)_EMO_/g,ct=function(e){return 45===e.charCodeAt(1)},ut=function(e){return null!=e&&"boolean"!=typeof e},dt=function(e){var t=Object.create(null);return function(e){return void 0===t[e]&&(t[e]=ct(n=e)?n:n.replace(it,"-$&").toLowerCase()),t[e];var n}}(),pt=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(at,(function(e,t,n){return ft={name:t,styles:n,next:ft},t}))}return 1===ot[e]||ct(e)||"number"!=typeof t||0===t?t:t+"px"};function mt(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return ft={name:n.name,styles:n.styles,next:ft},n.name;if(void 0!==n.styles){var r=n.next;if(void 0!==r)for(;void 0!==r;)ft={name:r.name,styles:r.styles,next:ft},r=r.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var l=0;l-1}function Jt(e){return Zt(e)?window.pageYOffset:e.scrollTop}function en(e,t){Zt(e)?window.scrollTo(0,t):e.scrollTop=t}function tn(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function nn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Wt,l=Jt(e),s=t-l,o=10,i=0;function a(){var t=tn(i+=o,l,s,n);en(e,t),i=m)return{placement:"bottom",maxHeight:t};if(x>=m&&!o)return s&&nn(a,C,S),{placement:"bottom",maxHeight:t};if(!o&&x>=r||o&&w>=r)return s&&nn(a,C,S),{placement:"bottom",maxHeight:o?w-b:x-b};if("auto"===l||o){var O=t,I=o?y:E;return I>=r&&(O=Math.min(I-b-i.controlHeight,t)),{placement:"top",maxHeight:O}}if("bottom"===l)return s&&en(a,C),{placement:"bottom",maxHeight:t};break;case"top":if(y>=m)return{placement:"top",maxHeight:t};if(E>=m&&!o)return s&&nn(a,k,S),{placement:"top",maxHeight:t};if(!o&&E>=r||o&&y>=r){var T=t;return(!o&&E>=r||o&&y>=r)&&(T=o?y-_:E-_),s&&nn(a,k,S),{placement:"top",maxHeight:T}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(l,'".'))}return c}var un=function(e){return"auto"===e?"bottom":e},dn=(0,J.createContext)({getPortalPlacement:null}),pn=function(e){Bt(n,e);var t=Gt(n);function n(){var e;Vt(this,n);for(var r=arguments.length,l=new Array(r),s=0;se.length)&&(t=e.length);for(var n=0,r=new Array(t);n0,h=d-p-u,g=!1;h>t&&o.current&&(r&&r(e),o.current=!1),f&&i.current&&(s&&s(e),i.current=!1),f&&t>h?(n&&!o.current&&n(e),m.scrollTop=d,g=!0,o.current=!0):!f&&-t>u&&(l&&!i.current&&l(e),m.scrollTop=0,g=!0,i.current=!0),g&&function(e){e.preventDefault(),e.stopPropagation()}(e)}}),[]),d=(0,J.useCallback)((function(e){u(e,e.deltaY)}),[u]),p=(0,J.useCallback)((function(e){a.current=e.changedTouches[0].clientY}),[]),m=(0,J.useCallback)((function(e){var t=a.current-e.changedTouches[0].clientY;u(e,t)}),[u]),f=(0,J.useCallback)((function(e){if(e){var t=!!an&&{passive:!1};"function"==typeof e.addEventListener&&e.addEventListener("wheel",d,t),"function"==typeof e.addEventListener&&e.addEventListener("touchstart",p,t),"function"==typeof e.addEventListener&&e.addEventListener("touchmove",m,t)}}),[m,p,d]),h=(0,J.useCallback)((function(e){e&&("function"==typeof e.removeEventListener&&e.removeEventListener("wheel",d,!1),"function"==typeof e.removeEventListener&&e.removeEventListener("touchstart",p,!1),"function"==typeof e.removeEventListener&&e.removeEventListener("touchmove",m,!1))}),[m,p,d]);return(0,J.useEffect)((function(){if(t){var e=c.current;return f(e),function(){h(e)}}}),[t,f,h]),function(e){c.current=e}}({isEnabled:void 0===r||r,onBottomArrive:e.onBottomArrive,onBottomLeave:e.onBottomLeave,onTopArrive:e.onTopArrive,onTopLeave:e.onTopLeave}),s=function(e){var t=e.isEnabled,n=e.accountForScrollbars,r=void 0===n||n,l=(0,J.useRef)({}),s=(0,J.useRef)(null),o=(0,J.useCallback)((function(e){if(ur){var t=document.body,n=t&&t.style;if(r&&lr.forEach((function(e){var t=n&&n[e];l.current[e]=t})),r&&dr<1){var s=parseInt(l.current.paddingRight,10)||0,o=document.body?document.body.clientWidth:0,i=window.innerWidth-o+s||0;Object.keys(sr).forEach((function(e){var t=sr[e];n&&(n[e]=t)})),n&&(n.paddingRight="".concat(i,"px"))}t&&cr()&&(t.addEventListener("touchmove",or,pr),e&&(e.addEventListener("touchstart",ar,pr),e.addEventListener("touchmove",ir,pr))),dr+=1}}),[]),i=(0,J.useCallback)((function(e){if(ur){var t=document.body,n=t&&t.style;dr=Math.max(dr-1,0),r&&dr<1&&lr.forEach((function(e){var t=l.current[e];n&&(n[e]=t)})),t&&cr()&&(t.removeEventListener("touchmove",or,pr),e&&(e.removeEventListener("touchstart",ar,pr),e.removeEventListener("touchmove",ir,pr)))}}),[]);return(0,J.useEffect)((function(){if(t){var e=s.current;return o(e),function(){i(e)}}}),[t,o,i]),function(e){s.current=e}}({isEnabled:n});return Ot(ee().Fragment,null,n&&Ot("div",{onClick:mr,css:fr}),t((function(e){l(e),s(e)})))}var gr={clearIndicator:Tn,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":null,pointerEvents:t?"none":null,position:"relative"}},control:function(e){var t=e.isDisabled,n=e.isFocused,r=e.theme,l=r.colors,s=r.borderRadius,o=r.spacing;return{label:"control",alignItems:"center",backgroundColor:t?l.neutral5:l.neutral0,borderColor:t?l.neutral10:n?l.primary:l.neutral20,borderRadius:s,borderStyle:"solid",borderWidth:1,boxShadow:n?"0 0 0 1px ".concat(l.primary):null,cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:o.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms","&:hover":{borderColor:n?l.primary:l.neutral30}}},dropdownIndicator:In,group:function(e){var t=e.theme.spacing;return{paddingBottom:2*t.baseUnit,paddingTop:2*t.baseUnit}},groupHeading:function(e){var t=e.theme.spacing;return{label:"group",color:"#999",cursor:"default",display:"block",fontSize:"75%",fontWeight:"500",marginBottom:"0.25em",paddingLeft:3*t.baseUnit,paddingRight:3*t.baseUnit,textTransform:"uppercase"}},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing.baseUnit,l=n.colors;return{label:"indicatorSeparator",alignSelf:"stretch",backgroundColor:t?l.neutral10:l.neutral20,marginBottom:2*r,marginTop:2*r,width:1}},input:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing,l=n.colors;return{margin:r.baseUnit/2,paddingBottom:r.baseUnit/2,paddingTop:r.baseUnit/2,visibility:t?"hidden":"visible",color:l.neutral80}},loadingIndicator:function(e){var t=e.isFocused,n=e.size,r=e.theme,l=r.colors,s=r.spacing.baseUnit;return{label:"loadingIndicator",color:t?l.neutral60:l.neutral20,display:"flex",padding:2*s,transition:"color 150ms",alignSelf:"center",fontSize:n,lineHeight:1,marginRight:n,textAlign:"center",verticalAlign:"middle"}},loadingMessage:hn,menu:function(e){var t,n=e.placement,r=e.theme,l=r.borderRadius,s=r.spacing,o=r.colors;return Y(t={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(n),"100%"),Y(t,"backgroundColor",o.neutral0),Y(t,"borderRadius",l),Y(t,"boxShadow","0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)"),Y(t,"marginBottom",s.menuGutter),Y(t,"marginTop",s.menuGutter),Y(t,"position","absolute"),Y(t,"width","100%"),Y(t,"zIndex",1),t},menuList:function(e){var t=e.maxHeight,n=e.theme.spacing.baseUnit;return{maxHeight:t,overflowY:"auto",paddingBottom:n,paddingTop:n,position:"relative",WebkitOverflowScrolling:"touch"}},menuPortal:function(e){var t=e.rect,n=e.offset,r=e.position;return{left:t.left,position:r,top:n,width:t.width,zIndex:1}},multiValue:function(e){var t=e.theme,n=t.spacing,r=t.borderRadius;return{label:"multiValue",backgroundColor:t.colors.neutral10,borderRadius:r/2,display:"flex",margin:n.baseUnit/2,minWidth:0}},multiValueLabel:function(e){var t=e.theme,n=t.borderRadius,r=t.colors,l=e.cropWithEllipsis;return{borderRadius:n/2,color:r.neutral80,fontSize:"85%",overflow:"hidden",padding:3,paddingLeft:6,textOverflow:l?"ellipsis":null,whiteSpace:"nowrap"}},multiValueRemove:function(e){var t=e.theme,n=t.spacing,r=t.borderRadius,l=t.colors;return{alignItems:"center",borderRadius:r/2,backgroundColor:e.isFocused&&l.dangerLight,display:"flex",paddingLeft:n.baseUnit,paddingRight:n.baseUnit,":hover":{backgroundColor:l.dangerLight,color:l.danger}}},noOptionsMessage:fn,option:function(e){var t=e.isDisabled,n=e.isFocused,r=e.isSelected,l=e.theme,s=l.spacing,o=l.colors;return{label:"option",backgroundColor:r?o.primary:n?o.primary25:"transparent",color:t?o.neutral20:r?o.neutral0:"inherit",cursor:"default",display:"block",fontSize:"inherit",padding:"".concat(2*s.baseUnit,"px ").concat(3*s.baseUnit,"px"),width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",":active":{backgroundColor:!t&&(r?o.primary:o.primary50)}}},placeholder:function(e){var t=e.theme,n=t.spacing;return{label:"placeholder",color:t.colors.neutral50,marginLeft:n.baseUnit/2,marginRight:n.baseUnit/2,position:"absolute",top:"50%",transform:"translateY(-50%)"}},singleValue:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing,l=n.colors;return{label:"singleValue",color:t?l.neutral40:l.neutral80,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2,maxWidth:"calc(100% - ".concat(2*r.baseUnit,"px)"),overflow:"hidden",position:"absolute",textOverflow:"ellipsis",whiteSpace:"nowrap",top:"50%",transform:"translateY(-50%)"}},valueContainer:function(e){var t=e.theme.spacing;return{alignItems:"center",display:"flex",flex:1,flexWrap:"wrap",padding:"".concat(t.baseUnit/2,"px ").concat(2*t.baseUnit,"px"),WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"}}},vr={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},br={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:rn(),captureMenuScroll:!rn(),closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){var n=Ut({ignoreCase:!0,ignoreAccents:!0,stringify:nr,trim:!0,matchFrom:"any"},undefined),r=n.ignoreCase,l=n.ignoreAccents,s=n.stringify,o=n.trim,i=n.matchFrom,a=o?tr(t):t,c=o?tr(s(e)):s(e);return r&&(a=a.toLowerCase(),c=c.toLowerCase()),l&&(a=er(a),c=Jn(c)),"start"===i?c.substr(0,a.length)===a:c.indexOf(a)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:"0",tabSelectsValue:!0};function _r(e,t,n,r){return{type:"option",data:t,isDisabled:kr(e,t,n),isSelected:Sr(e,t,n),label:xr(e,t),value:Cr(e,t),index:r}}function yr(e,t){return e.options.map((function(n,r){if(n.options){var l=n.options.map((function(n,r){return _r(e,n,t,r)})).filter((function(t){return Er(e,t)}));return l.length>0?{type:"group",data:n,options:l,index:r}:void 0}var s=_r(e,n,t,r);return Er(e,s)?s:void 0})).filter((function(e){return!!e}))}function wr(e){return e.reduce((function(e,t){return"group"===t.type?e.push.apply(e,Hn(t.options.map((function(e){return e.data})))):e.push(t.data),e}),[])}function Er(e,t){var n=e.inputValue,r=void 0===n?"":n,l=t.data,s=t.isSelected,o=t.label,i=t.value;return(!Ir(e)||!s)&&Or(e,{label:o,value:i,data:l},r)}var xr=function(e,t){return e.getOptionLabel(t)},Cr=function(e,t){return e.getOptionValue(t)};function kr(e,t,n){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,n)}function Sr(e,t,n){if(n.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,n);var r=Cr(e,t);return n.some((function(t){return Cr(e,t)===r}))}function Or(e,t,n){return!e.filterOption||e.filterOption(t,n)}var Ir=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},Tr=1,Pr=function(e){Bt(n,e);var t=Gt(n);function n(e){var r;return Vt(this,n),(r=t.call(this,e)).state={ariaSelection:null,focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0},r.blockOptionHover=!1,r.isComposing=!1,r.commonProps=void 0,r.initialTouchX=0,r.initialTouchY=0,r.instancePrefix="",r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.controlRef=null,r.getControlRef=function(e){r.controlRef=e},r.focusedOptionRef=null,r.getFocusedOptionRef=function(e){r.focusedOptionRef=e},r.menuListRef=null,r.getMenuListRef=function(e){r.menuListRef=e},r.inputRef=null,r.getInputRef=function(e){r.inputRef=e},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(e,t){var n=r.props,l=n.onChange,s=n.name;t.name=s,r.ariaOnChange(e,t),l(e,t)},r.setValue=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"set-value",n=arguments.length>2?arguments[2]:void 0,l=r.props,s=l.closeMenuOnSelect,o=l.isMulti;r.onInputChange("",{action:"set-value"}),s&&(r.setState({inputIsHiddenAfterUpdate:!o}),r.onMenuClose()),r.setState({clearFocusValueOnUpdate:!0}),r.onChange(e,{action:t,option:n})},r.selectOption=function(e){var t=r.props,n=t.blurInputOnSelect,l=t.isMulti,s=t.name,o=r.state.selectValue,i=l&&r.isOptionSelected(e,o),a=r.isOptionDisabled(e,o);if(i){var c=r.getOptionValue(e);r.setValue(o.filter((function(e){return r.getOptionValue(e)!==c})),"deselect-option",e)}else{if(a)return void r.ariaOnChange(e,{action:"select-option",name:s});l?r.setValue([].concat(Hn(o),[e]),"select-option",e):r.setValue(e,"select-option")}n&&r.blurInput()},r.removeValue=function(e){var t=r.props.isMulti,n=r.state.selectValue,l=r.getOptionValue(e),s=n.filter((function(e){return r.getOptionValue(e)!==l})),o=t?s:s[0]||null;r.onChange(o,{action:"remove-value",removedValue:e}),r.focusInput()},r.clearValue=function(){var e=r.state.selectValue;r.onChange(r.props.isMulti?[]:null,{action:"clear",removedValues:e})},r.popValue=function(){var e=r.props.isMulti,t=r.state.selectValue,n=t[t.length-1],l=t.slice(0,t.length-1),s=e?l:l[0]||null;r.onChange(s,{action:"pop-value",removedValue:n})},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var e=arguments.length,t=new Array(e),n=0;n5||s>5}},r.onTouchEnd=function(e){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(e.target)&&r.menuListRef&&!r.menuListRef.contains(e.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(e){r.userIsDragging||r.onControlMouseDown(e)},r.onClearIndicatorTouchEnd=function(e){r.userIsDragging||r.onClearIndicatorMouseDown(e)},r.onDropdownIndicatorTouchEnd=function(e){r.userIsDragging||r.onDropdownIndicatorMouseDown(e)},r.handleInputChange=function(e){var t=e.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(t,{action:"input-change"}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(e){r.props.onFocus&&r.props.onFocus(e),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(e){r.menuListRef&&r.menuListRef.contains(document.activeElement)?r.inputRef.focus():(r.props.onBlur&&r.props.onBlur(e),r.onInputChange("",{action:"input-blur"}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1}))},r.onOptionHover=function(e){r.blockOptionHover||r.state.focusedOption===e||r.setState({focusedOption:e})},r.shouldHideSelectedOptions=function(){return Ir(r.props)},r.onKeyDown=function(e){var t=r.props,n=t.isMulti,l=t.backspaceRemovesValue,s=t.escapeClearsValue,o=t.inputValue,i=t.isClearable,a=t.isDisabled,c=t.menuIsOpen,u=t.onKeyDown,d=t.tabSelectsValue,p=t.openMenuOnFocus,m=r.state,f=m.focusedOption,h=m.focusedValue,g=m.selectValue;if(!(a||"function"==typeof u&&(u(e),e.defaultPrevented))){switch(r.blockOptionHover=!0,e.key){case"ArrowLeft":if(!n||o)return;r.focusValue("previous");break;case"ArrowRight":if(!n||o)return;r.focusValue("next");break;case"Delete":case"Backspace":if(o)return;if(h)r.removeValue(h);else{if(!l)return;n?r.popValue():i&&r.clearValue()}break;case"Tab":if(r.isComposing)return;if(e.shiftKey||!c||!d||!f||p&&r.isOptionSelected(f,g))return;r.selectOption(f);break;case"Enter":if(229===e.keyCode)break;if(c){if(!f)return;if(r.isComposing)return;r.selectOption(f);break}return;case"Escape":c?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange("",{action:"menu-close"}),r.onMenuClose()):i&&s&&r.clearValue();break;case" ":if(o)return;if(!c){r.openMenu("first");break}if(!f)return;r.selectOption(f);break;case"ArrowUp":c?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":c?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!c)return;r.focusOption("pageup");break;case"PageDown":if(!c)return;r.focusOption("pagedown");break;case"Home":if(!c)return;r.focusOption("first");break;case"End":if(!c)return;r.focusOption("last");break;default:return}e.preventDefault()}},r.instancePrefix="react-select-"+(r.props.instanceId||++Tr),r.state.selectValue=Xt(e.value),r}return At(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput()}},{key:"componentDidUpdate",value:function(e){var t,n,r,l,s,o=this.props,i=o.isDisabled,a=o.menuIsOpen,c=this.state.isFocused;(c&&!i&&e.isDisabled||c&&a&&!e.menuIsOpen)&&this.focusInput(),c&&i&&!e.isDisabled&&this.setState({isFocused:!1},this.onMenuClose),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(t=this.menuListRef,n=this.focusedOptionRef,r=t.getBoundingClientRect(),l=n.getBoundingClientRect(),s=n.offsetHeight/3,l.bottom+s>r.bottom?en(t,Math.min(n.offsetTop+n.clientHeight-t.offsetHeight+s,t.scrollHeight)):l.top-s-1&&(o=i)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:s[o]},(function(){return t.onMenuOpen()}))}},{key:"focusValue",value:function(e){var t=this.state,n=t.selectValue,r=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=n.indexOf(r);r||(l=-1);var s=n.length-1,o=-1;if(n.length){switch(e){case"previous":o=0===l?0:-1===l?s:l-1;break;case"next":l>-1&&l0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state.focusedOption,r=this.getFocusableOptions();if(r.length){var l=0,s=r.indexOf(n);n||(s=-1),"up"===e?l=s>0?s-1:r.length-1:"down"===e?l=(s+1)%r.length:"pageup"===e?(l=s-t)<0&&(l=0):"pagedown"===e?(l=s+t)>r.length-1&&(l=r.length-1):"last"===e&&(l=r.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:r[l],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(vr):Ut(Ut({},vr),this.props.theme):vr}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,n=this.getStyles,r=this.getValue,l=this.selectOption,s=this.setValue,o=this.props,i=o.isMulti,a=o.isRtl,c=o.options;return{clearValue:e,cx:t,getStyles:n,getValue:r,hasValue:this.hasValue(),isMulti:i,isRtl:a,options:c,selectOption:l,selectProps:o,setValue:s,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return kr(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return Sr(this.props,e,t)}},{key:"filterOption",value:function(e,t){return Or(this.props,e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,r=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:r})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,r=e.inputId,l=e.inputValue,s=e.tabIndex,o=e.form,i=this.getComponents().Input,a=this.state.inputIsHidden,c=this.commonProps,u=r||this.getElementId("input"),d={"aria-autocomplete":"list","aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"]};return n?ee().createElement(i,Q({},c,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:u,innerRef:this.getInputRef,isDisabled:t,isHidden:a,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:s,form:o,type:"text",value:l},d)):ee().createElement(rr,Q({id:u,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Wt,onFocus:this.onInputFocus,readOnly:!0,disabled:t,tabIndex:s,form:o,value:""},d))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.getComponents(),n=t.MultiValue,r=t.MultiValueContainer,l=t.MultiValueLabel,s=t.MultiValueRemove,o=t.SingleValue,i=t.Placeholder,a=this.commonProps,c=this.props,u=c.controlShouldRenderValue,d=c.isDisabled,p=c.isMulti,m=c.inputValue,f=c.placeholder,h=this.state,g=h.selectValue,v=h.focusedValue,b=h.isFocused;if(!this.hasValue()||!u)return m?null:ee().createElement(i,Q({},a,{key:"placeholder",isDisabled:d,isFocused:b}),f);if(p)return g.map((function(t,o){var i=t===v;return ee().createElement(n,Q({},a,{components:{Container:r,Label:l,Remove:s},isFocused:i,isDisabled:d,key:"".concat(e.getOptionValue(t)).concat(o),index:o,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault(),e.stopPropagation()}},data:t}),e.formatOptionLabel(t,"value"))}));if(m)return null;var _=g[0];return ee().createElement(o,Q({},a,{data:_,isDisabled:d}),this.formatOptionLabel(_,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,l=n.isLoading,s=this.state.isFocused;if(!this.isClearable()||!e||r||!this.hasValue()||l)return null;var o={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return ee().createElement(e,Q({},t,{innerProps:o,isFocused:s}))}},{key:"renderLoadingIndicator",value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,l=n.isLoading,s=this.state.isFocused;return e&&l?ee().createElement(e,Q({},t,{innerProps:{"aria-hidden":"true"},isDisabled:r,isFocused:s})):null}},{key:"renderIndicatorSeparator",value:function(){var e=this.getComponents(),t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var r=this.commonProps,l=this.props.isDisabled,s=this.state.isFocused;return ee().createElement(n,Q({},r,{isDisabled:l,isFocused:s}))}},{key:"renderDropdownIndicator",value:function(){var e=this.getComponents().DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,r=this.state.isFocused,l={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return ee().createElement(e,Q({},t,{innerProps:l,isDisabled:n,isFocused:r}))}},{key:"renderMenu",value:function(){var e=this,t=this.getComponents(),n=t.Group,r=t.GroupHeading,l=t.Menu,s=t.MenuList,o=t.MenuPortal,i=t.LoadingMessage,a=t.NoOptionsMessage,c=t.Option,u=this.commonProps,d=this.state.focusedOption,p=this.props,m=p.captureMenuScroll,f=p.inputValue,h=p.isLoading,g=p.loadingMessage,v=p.minMenuHeight,b=p.maxMenuHeight,_=p.menuIsOpen,y=p.menuPlacement,w=p.menuPosition,E=p.menuPortalTarget,x=p.menuShouldBlockScroll,C=p.menuShouldScrollIntoView,k=p.noOptionsMessage,S=p.onMenuScrollToTop,O=p.onMenuScrollToBottom;if(!_)return null;var I,T=function(t,n){var r=t.type,l=t.data,s=t.isDisabled,o=t.isSelected,i=t.label,a=t.value,p=d===l,m=s?void 0:function(){return e.onOptionHover(l)},f=s?void 0:function(){return e.selectOption(l)},h="".concat(e.getElementId("option"),"-").concat(n),g={id:h,onClick:f,onMouseMove:m,onMouseOver:m,tabIndex:-1};return ee().createElement(c,Q({},u,{innerProps:g,data:l,isDisabled:s,isSelected:o,key:h,label:i,type:r,value:a,isFocused:p,innerRef:p?e.getFocusedOptionRef:void 0}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())I=this.getCategorizedOptions().map((function(t){if("group"===t.type){var l=t.data,s=t.options,o=t.index,i="".concat(e.getElementId("group"),"-").concat(o),a="".concat(i,"-heading");return ee().createElement(n,Q({},u,{key:i,data:l,options:s,Heading:r,headingProps:{id:a,data:t.data},label:e.formatGroupLabel(t.data)}),t.options.map((function(e){return T(e,"".concat(o,"-").concat(e.index))})))}if("option"===t.type)return T(t,"".concat(t.index))}));else if(h){var P=g({inputValue:f});if(null===P)return null;I=ee().createElement(i,u,P)}else{var M=k({inputValue:f});if(null===M)return null;I=ee().createElement(a,u,M)}var D={minMenuHeight:v,maxMenuHeight:b,menuPlacement:y,menuPosition:w,menuShouldScrollIntoView:C},L=ee().createElement(pn,Q({},u,D),(function(t){var n=t.ref,r=t.placerProps,o=r.placement,i=r.maxHeight;return ee().createElement(l,Q({},u,D,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove},isLoading:h,placement:o}),ee().createElement(hr,{captureEnabled:m,onTopArrive:S,onBottomArrive:O,lockEnabled:x},(function(t){return ee().createElement(s,Q({},u,{innerRef:function(n){e.getMenuListRef(n),t(n)},isLoading:h,maxHeight:i,focusedOption:d}),I)})))}));return E||"fixed"===w?ee().createElement(o,Q({},u,{appendTo:E,controlElement:this.controlRef,menuPlacement:y,menuPosition:w}),L):L}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,r=t.isDisabled,l=t.isMulti,s=t.name,o=this.state.selectValue;if(s&&!r){if(l){if(n){var i=o.map((function(t){return e.getOptionValue(t)})).join(n);return ee().createElement("input",{name:s,type:"hidden",value:i})}var a=o.length>0?o.map((function(t,n){return ee().createElement("input",{key:"i-".concat(n),name:s,type:"hidden",value:e.getOptionValue(t)})})):ee().createElement("input",{name:s,type:"hidden"});return ee().createElement("div",null,a)}var c=o[0]?this.getOptionValue(o[0]):"";return ee().createElement("input",{name:s,type:"hidden",value:c})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,t=this.state,n=t.ariaSelection,r=t.focusedOption,l=t.focusedValue,s=t.isFocused,o=t.selectValue,i=this.getFocusableOptions();return ee().createElement(Gn,Q({},e,{ariaSelection:n,focusedOption:r,focusedValue:l,isFocused:s,selectValue:o,focusableOptions:i}))}},{key:"render",value:function(){var e=this.getComponents(),t=e.Control,n=e.IndicatorsContainer,r=e.SelectContainer,l=e.ValueContainer,s=this.props,o=s.className,i=s.id,a=s.isDisabled,c=s.menuIsOpen,u=this.state.isFocused,d=this.commonProps=this.getCommonProps();return ee().createElement(r,Q({},d,{className:o,innerProps:{id:i,onKeyDown:this.onKeyDown},isDisabled:a,isFocused:u}),this.renderLiveRegion(),ee().createElement(t,Q({},d,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:a,isFocused:u,menuIsOpen:c}),ee().createElement(l,Q({},d,{isDisabled:a}),this.renderPlaceholderOrValue(),this.renderInput()),ee().createElement(n,Q({},d,{isDisabled:a}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,r=t.clearFocusValueOnUpdate,l=t.inputIsHiddenAfterUpdate,s=e.options,o=e.value,i=e.menuIsOpen,a=e.inputValue,c={};if(n&&(o!==n.value||s!==n.options||i!==n.menuIsOpen||a!==n.inputValue)){var u=Xt(o),d=i?function(e,t){return wr(yr(e,t))}(e,u):[],p=r?function(e,t){var n=e.focusedValue,r=e.selectValue.indexOf(n);if(r>-1){if(t.indexOf(n)>-1)return n;if(r-1?n:t[0]}(t,d);c={selectValue:u,focusedOption:m,focusedValue:p,clearFocusValueOnUpdate:!1}}var f=null!=l&&e!==n?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{};return Ut(Ut(Ut({},c),f),{},{prevProps:e})}}]),n}(J.Component);Pr.defaultProps=br;var Mr,Dr,Lr,Rr={cacheOptions:!1,defaultOptions:!1,filterOption:null,isLoading:!1},Vr=(Mr=Pr,Lr=Dr=function(e){Bt(n,e);var t=Gt(n);function n(){var e;Vt(this,n);for(var r=arguments.length,l=new Array(r),s=0;s1?n-1:0),l=1;l"llms-search")),Y(this,"getSearchPath",(()=>this.props.searchPath)),Y(this,"getSearchUrl",(e=>wp.url.addQueryArgs(this.getSearchPath(),this.getSearchArgs(e)))),Y(this,"formatSearchResultLabel",(e=>e.id)),Y(this,"formatSearchResultValue",(e=>e.id)),Y(this,"onSearch",(0,X.debounce)(300,((e,t)=>{wp.apiFetch({path:this.getSearchUrl(e)}).then((e=>{t(this.formatSearchResults(e))}))})))}getSearchArgs(e){return Object.assign({per_page:20,search:encodeURI(e)},this.props.searchArgs)}formatSearchResults(e){return e.map((e=>({...e,label:this.formatSearchResultLabel(e),value:this.formatSearchResultValue(e)})))}render(){const{label:e,isMulti:t,isDisabled:n,onChange:r,placeholder:l,selected:s}=this.props,o=this.props.className||this.getDefaultClassName();return(0,A.createElement)(q.BaseControl,{id:(0,Fr.uniqueId)(`${o}--`),label:e},(0,A.createElement)(Ar,{ref:e=>this.selectRef=e,className:o,classNamePrefix:"llms-search",isMulti:t,isDisabled:n,value:this.formatSearchResults(s||[]),defaultOptions:s,placeholder:l,loadOptions:this.onSearch,onChange:r,styles:{control:e=>({...e,borderColor:"#8d96a0","&:hover":{...e["&:hover"],borderColor:"#8d96a0"}})},theme:e=>({...e,colors:{...e.colors,primary:"#008dbe",primary25:"#ccf2ff",primary50:"#b3ecff",primary75:"#4dd2ff"},spacing:{...e.spacing,baseUnit:2,controlHeight:28,menuGutter:4}})}))}}class Hr extends Br{constructor(){super(...arguments),Y(this,"getDefaultClassName",(()=>`llms-search--${this.props.postType.replace("llms_","")}`)),Y(this,"getSearchPath",(()=>this.props.searchPath||`/wp/v2/${this.props.postType}`)),Y(this,"formatSearchResultLabel",(e=>(0,$.sprintf)(// Translators: %1$s = Post title; %2$ = post id. -(0,$._x)("%1$s (ID# %2$d)","Search result label","lifterlms"),e.title.rendered,e.id)))}}const zr=(0,U.createHigherOrderComponent)((e=>t=>{if(!z(wp.blocks.getBlockType(t.name),t.name))return(0,A.createElement)(e,t);const{attributes:{llms_visibility:n,llms_visibility_in:r},setAttributes:l}=t;if(!n||"off"===n)return(0,A.createElement)(e,t);let{llms_visibility_posts:s}=t.attributes;void 0===s&&(s="[]"),s=JSON.parse(s);const o=()=>{const e=wp.data.select("core/editor").getCurrentPost(),t=[];return-1!==["course","lesson"].indexOf(e.type)&&t.push({value:"this",label:(0,$.__)("in this course","lifterlms")}),t.push({value:"any_course",label:(0,$.__)("in any course","lifterlms")}),-1!==["llms_membership"].indexOf(e.type)&&t.push({value:"this",label:(0,$.__)("in this membership","lifterlms")}),t.push({value:"any_membership",label:(0,$.__)("in any membership","lifterlms")},{value:"any",label:(0,$.__)("in any course or membership","lifterlms")},{value:"list_all",label:(0,$.__)("in all of the selected courses or memberships","lifterlms")},{value:"list_any",label:(0,$.__)("in any of the selected courses or memberships","lifterlms")}),(0,H.applyFilters)("llms_blocks_block_visibility_in_options",t,e)},i=(e,t)=>{"select-option"===t.action?a(t.option):"remove-value"===t.action&&c(t.removedValue)},a=e=>{s.map((e=>{let{id:t}=e;return t})).includes(e.id)||s.push(e),u()},c=e=>{s.splice(s.map((e=>{let{id:t}=e;return t})).indexOf(e.id),1),u()},u=()=>{const e=s.map((e=>{const{id:t,title:n,type:r}=e,l={id:t,title:n,type:r};return(0,H.applyFilters)("llms_block_visibility_stored_post_props",l,e)}));l({llms_visibility_posts:JSON.stringify(e)})};return(0,A.createElement)(A.Fragment,null,(0,A.createElement)(K,t,(0,A.createElement)(e,t)),(0,A.createElement)(j.InspectorControls,null,(0,A.createElement)(q.PanelBody,{title:(0,$.__)("Enrollment Visibility","lifterlms")},(0,A.createElement)(q.SelectControl,{className:"llms-visibility-select",label:(0,$.__)("Display to","lifterlms"),value:n,onChange:e=>{l({llms_visibility:e,llms_visibility_in:o()[0].value})},options:(0,H.applyFilters)("llms_block_visibility_settings_options",W)}),-1===["all","logged_in","logged_out"].indexOf(n)&&(0,A.createElement)(A.Fragment,null,(0,A.createElement)(q.SelectControl,{className:"llms-visibility-select--in",label:(d=n,"enrolled"===d?(0,$.__)("Enrolled In","lifterlms"):(0,$.__)("Not Enrolled In","lifterlms")),value:r,onChange:e=>l({llms_visibility_in:e}),options:o()}),("list_all"===r||"list_any"===r)&&(0,A.createElement)("div",null,(0,A.createElement)(Hr,{isMulti:!0,postType:"course",label:(0,$.__)("Courses","lifterlms"),placeholder:(0,$.__)("Search by course title…","lifterlms"),onChange:i,selected:s.filter((e=>"course"===e.type))}),(0,A.createElement)(Hr,{isMulti:!0,postType:"llms_membership",label:(0,$.__)("Memberships","lifterlms"),placeholder:(0,$.__)("Search by membership title…","lifterlms"),onChange:i,selected:s.filter((e=>"llms_membership"===e.type))}))))));var d}),"withInspectorControl");(0,H.addFilter)("blocks.registerBlockType","llms/visibility-attributes",(function(e,t){if(!z(e,t))return e;e.attributes||(e.attributes={});const n={llms_visibility:{default:"all",type:"string"},llms_visibility_in:{default:"",type:"string"},llms_visibility_posts:{default:"[]",type:"string"}};return Object.keys(n).forEach((t=>{var r,l,s;e.attributes=(r=e.attributes,s=n[t],r[l=t]&&r[l].default?r[l].type=s.type:r[l]=s,r)})),e})),(0,H.addFilter)("editor.BlockEdit","llms/visibility-controls",zr);const $r=window.wp.domReady;var Ur=n.n($r);const jr=window.wp.data,qr=window.wp.editor,Gr=window.wp.blocks,Wr=e=>{let t=[];return e.forEach((e=>{if("core/block"===e.name){const{getBlocks:n}=(0,jr.select)(j.store);t=t.concat(Wr(n(e.clientId)))}else e.innerBlocks.length?t=t.concat(Wr(e.innerBlocks)):t.push(e)})),t},Kr=()=>{const{getBlocks:e}=(0,jr.select)(j.store);return Wr(e())},Yr=()=>!!(window.llms&&window.llms.post&&window.llms.post.post_type)&&window.llms.post.post_type;const Xr=()=>{!function(){const{_llms_form_location:e}=(0,jr.select)(qr.store).getEditedPostAttribute("meta");["registration","account"].includes(e)&&(0,H.addFilter)("llms_block_supports_visibility","llms/form-block-visibility",(()=>!1))}(),function(){const e={"llms/form-field-user-email":["all","logged_out"],"llms/form-field-user-password":["all","logged_out"],"llms/form-field-user-login":["logged_out"]},t=Object.keys(e);(0,H.addFilter)("llms_block_visibility_settings_options","llms/form-block-visibility-options",(n=>{const{getSelectedBlock:r}=(0,jr.select)(j.store),l=r();return l&&(e=>{let{name:n,innerBlocks:r}=e;return"llms/form-field-confirm-group"===n?(0,Fr.some)(r,(e=>t.includes(e.name))):t.includes(n)})(l)?n.filter((n=>{let{value:r}=n;return(n=>{let{name:r,innerBlocks:l}=n,s=r;if("llms/form-field-confirm-group"===r){const e=l.find((e=>t.includes(e.name)));s=e?e.name:s}return e[s]||[]})(l).includes(r)})):n}))}(),function(){const{_llms_form_is_core:e}=(0,jr.select)(qr.store).getEditedPostAttribute("meta"),t=[".edit-post-layout .components-panel__body.edit-post-post-status"];"yes"===e&&t.push(".edit-post-layout button.editor-post-switch-to-draft"),(0,jr.subscribe)((()=>{setTimeout((()=>{document.querySelectorAll(t.join(",")).forEach((e=>{e.style.display="none"}))}),1)}))}(),function(){const e="llms/form-field-user-email",t="llms-forms-no-email-error-notice",{getNotices:n}=(0,jr.select)("core/notices"),{createErrorNotice:r,removeNotice:l}=(0,jr.dispatch)("core/notices");(0,jr.subscribe)((0,Fr.debounce)((()=>{const s=(0,jr.select)("core/editor").getCurrentPost(),o=Kr().map((e=>e.name));if(!s.content.includes("\x3c!-- wp:")||!o.length)return;const i=n().map((e=>e.id)).includes(t),a=document.querySelector("button.editor-post-publish-button");o.includes(e)||i?o.includes(e)&&i&&(l(t),a.disabled=!1):(r((0,$.__)("User Email is a required field.","lifterlms"),{id:t,isDismissible:!1,actions:[{label:(0,$.__)("Restore user email field?","lifterlms"),onClick:()=>{((0,jr.dispatch)("core/block-editor")||(0,jr.dispatch)("core/editor")).insertBlock((0,Gr.createBlock)(e),0)}}]}),a.disabled=!0)}),500))}()};function Qr(e){return e.reduce(((e,t)=>({...e,[t.name]:t})),{})}function Zr(e){return Object.values(e)}const Jr=Qr(window.llms.userInfoFields.map((e=>({...e,isPersisted:!0}))));function el(e,t){return{...e,[t.name]:{...t}}}function tl(e,t){return e=Zr(e).filter((e=>{let{name:n}=e;return n!==t})),Qr(e)}function nl(e,t,n){return{...e,[t]:{...e[t],...n}}}function rl(e,t,n){const r={...e[t]};return el(e=tl(e,t),{...r,name:n})}function ll(){return Jr}function sl(e){return{type:"ADD_FIELD",field:e}}function ol(e){return{type:"DELETE_FIELD",name:e}}function il(e,t){return{type:"EDIT_FIELD",name:e,edits:t}}function al(e,t){return{type:"EDIT_FIELD",name:e,edits:{clientId:t}}}function cl(e){return{type:"EDIT_FIELD",name:e,edits:{clientId:null}}}function ul(e){return{type:"RECEIVE_FIELDS",fields:e}}function dl(e,t){return{type:"RENAME_FIELD",oldName:e,newName:t}}function pl(){return{type:"RESET_FIELDS"}}function ml(e,t){let{fields:n}=e;return!!n[t]}function fl(e,t){let{fields:n}=e;return n[t]||null}function hl(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"global";const l="global"===r?e.fields:vl(e);return Zr(l).find((e=>e[n]===t))||null}function gl(e){let{fields:t}=e;return t}function vl(e){let{fields:t}=e;return Qr(Zr(t).filter((e=>{let{clientId:t}=e;return t})))}function bl(e,t,n){const r=fl(e,t);return!(!r||!r.clientId||r.clientId===n)}function _l(e,t){return!!hl(e,t,"clientId","local")}const yl={reducer:(0,jr.combineReducers)({fields:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Jr,t=arguments.length>1?arguments[1]:void 0;const{type:n}=t;switch(n){case"ADD_FIELD":return el(e,t.field);case"DELETE_FIELD":return tl(e,t.name);case"EDIT_FIELD":return nl(e,t.name,t.edits);case"RECEIVE_FIELDS":return Qr(t.fields);case"RENAME_FIELD":return rl(e,t.oldName,t.newName);case"RESET_FIELDS":return ll();default:return e}}}),actions:{...e},selectors:{...t}},wl=(0,jr.createReduxStore)("llms/user-info-fields",yl);(0,jr.register)(wl);let El=[];const xl=(e,t)=>(0,Fr.differenceBy)(e,t,"clientId").filter((e=>{let{name:t}=e;return 0===t.indexOf("llms/form-")}));function Cl(){const e=Kr(),t=xl(El,e),n=xl(e,El);El=e,(e=>{e.forEach((e=>{let{attributes:t}=e;const{name:n}=t,{getField:r}=(0,jr.select)(wl),{deleteField:l,unloadField:s}=(0,jr.dispatch)(wl),o=r(n);o&&(o.isPersisted?s(n):l(n))}))})(t),setTimeout((()=>{(e=>{const{fieldExists:t}=(0,jr.select)(wl),{loadField:n,addField:r}=(0,jr.dispatch)(wl);e.forEach((e=>{let{attributes:l,clientId:s}=e;const{name:o}=l;t(o)?n(o,s):r({name:o,clientId:s,id:l.id,label:l.label,data_store:l.data_store,data_store_key:l.data_store_key})}))})(n)}),100)}function kl(){(0,jr.subscribe)(Cl)}const Sl=(0,A.createElement)(F.SVG,{className:"llms-block-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},(0,A.createElement)(F.Path,{d:"M52.5 440.6c-9.5 7.9-22.8 9.7-34.1 4.4S0 428.4 0 416V96C0 83.6 7.2 72.3 18.4 67s24.5-3.6 34.1 4.4L224 214.3V256v41.7L52.5 440.6zM256 352V256 128 96c0-12.4 7.2-23.7 18.4-29s24.5-3.6 34.1 4.4l192 160c7.3 6.1 11.5 15.1 11.5 24.6s-4.2 18.5-11.5 24.6l-192 160c-9.5 7.9-22.8 9.7-34.1 4.4s-18.4-16.6-18.4-29V352z"})),Ol="llms/course-continue-button",Il=["course"],Tl={title:(0,$.__)("Course Continue Button","lifterlms"),icon:Sl,category:"llms-blocks",keywords:[(0,$.__)("LifterLMS","lifterlms")],edit:e=>(0,A.createElement)("div",{className:e.className},(0,A.createElement)("p",{style:{textAlign:"center"}},(0,A.createElement)(q.Button,{isPrimary:!0,isLarge:!0},(0,$.__)("Continue","lifterlms")))),save:e=>(0,A.createElement)("div",{className:e.className,style:{textAlign:"center"}},"[lifterlms_course_continue_button]")};class Pl extends A.Component{render(){const{attributes:{length:e,show_cats:t,show_difficulty:n,show_length:r,show_tags:l,show_tracks:s,title_size:o},setAttributes:i}=this.props;return(0,A.createElement)(j.InspectorControls,null,(0,A.createElement)(q.PanelBody,{title:(0,$.__)("Course Information Options","lifterlms")},(0,A.createElement)(q.SelectControl,{label:(0,$.__)("Title Headline Size","lifterlms"),value:o,onChange:e=>i({title_size:e}),help:(0,$.__)("Headline size for the information title element.","lifterlms"),options:[{value:"h1",label:"h1"},{value:"h2",label:"h2"},{value:"h3",label:"h3"},{value:"h4",label:"h4"},{value:"h5",label:"h5"},{value:"h6",label:"h6"}]}),(0,A.createElement)(q.TextControl,{label:(0,$.__)("Estimated Completion Time","lifterlms"),value:e,onChange:e=>i({length:e}),help:(0,$.__)("How many hours, days, weeks, etc… should a student expect to spend in order to complete this course.","lifterlms")}),(0,A.createElement)(q.ToggleControl,{label:(0,$.__)("Display Estimated Time","lifterlms"),checked:!!r,onChange:()=>i({show_length:!r}),help:r?(0,$.__)("Displaying estimated time","lifterlms"):(0,$.__)("Hiding estimated time","lifterlms")}),(0,A.createElement)(q.ToggleControl,{label:(0,$.__)("Display Difficulty","lifterlms"),checked:!!n,onChange:()=>i({show_difficulty:!n}),help:n?(0,$.__)("Displaying difficulty","lifterlms"):(0,$.__)("Hiding difficulty","lifterlms")}),(0,A.createElement)(q.ToggleControl,{label:(0,$.__)("Display Tracks","lifterlms"),checked:!!s,onChange:()=>i({show_tracks:!s}),help:s?(0,$.__)("Displaying tracks list","lifterlms"):(0,$.__)("Hiding tracks list","lifterlms")}),(0,A.createElement)(q.ToggleControl,{label:(0,$.__)("Display Categories","lifterlms"),checked:!!t,onChange:()=>i({show_cats:!t}),help:t?(0,$.__)("Displaying categories list","lifterlms"):(0,$.__)("Hiding categories list","lifterlms")}),(0,A.createElement)(q.ToggleControl,{label:(0,$.__)("Display Tags","lifterlms"),checked:!!l,onChange:()=>i({show_tags:!l}),help:l?(0,$.__)("Displaying tags list","lifterlms"):(0,$.__)("Hiding tags list","lifterlms")})))}}class Ml extends A.Component{constructor(){super(...arguments),Y(this,"state",{terms:!1})}getTerms(){const{currentPost:e,taxonomy:t}=this.props,n=e._links["wp:term"].filter((e=>e.taxonomy===t))[0].href;wp.apiFetch({url:wp.url.addQueryArgs(n,{per_page:-1})}).then((e=>{this.setState({terms:e})}))}componentDidUpdate(e){e.currentPost[this.props.taxonomy]!==this.props.currentPost[this.props.taxonomy]&&this.getTerms()}componentWillMount(){this.getTerms()}renderTerms(e){const t=e.length-1;return(0,A.createElement)(A.Fragment,null,e?e.map(((e,n)=>this.renderTerm(e,t===n))):(0,$.__)("Loading…","lifterlms"))}renderTerm(e,t){return(0,A.createElement)(A.Fragment,null,(0,A.createElement)("a",{href:e.link,target:"_blank",rel:"noreferrer"},e.name),t?"":", ")}render(){const{terms:e}=this.state,{taxonomyName:t}=this.props;return Array.isArray(e)&&!e.length?"":(0,A.createElement)("li",null,(0,A.createElement)("strong",null,t),": ",this.renderTerms(e))}}const Dl=(0,A.createElement)(F.SVG,{className:"llms-block-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},(0,A.createElement)(F.Path,{d:"M0 96C0 60.7 28.7 32 64 32H448c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96zm64 0v64h64V96H64zm384 0H192v64H448V96zM64 224v64h64V224H64zm384 0H192v64H448V224zM64 352v64h64V352H64zm384 0H192v64H448V352z"})),Ll="llms/course-information",Rl=["course"],Vl={title:(0,$.__)("Course Information","lifterlms"),icon:Dl,category:"llms-blocks",keywords:[(0,$.__)("LifterLMS","lifterlms")],attributes:{title:{type:"string",default:(0,$.__)("Course Information","lifterlms")},title_size:{type:"string",default:"h3"},length:{type:"string",default:"",source:"meta",meta:"_llms_length"},show_cats:{type:"boolean",default:!0},show_difficulty:{type:"boolean",default:!0},show_length:{type:"boolean",default:!0},show_tags:{type:"boolean",default:!0},show_tracks:{type:"boolean",default:!0}},supports:{multiple:!1},edit:e=>{const{attributes:t,setAttributes:n}=e,{length:r,show_cats:l,show_difficulty:s,show_length:o,show_tags:i,show_tracks:a,title:c,title_size:u}=t,d=wp.data.select("core/editor").getCurrentPost(),p=o||s||a||l||i;return(0,A.createElement)(A.Fragment,null,(0,A.createElement)(Pl,{attributes:t,setAttributes:n}),(0,A.createElement)("div",{className:e.className},(0,A.createElement)(j.RichText,{tagName:u,value:c,onChange:e=>n({title:e})}),p&&(0,A.createElement)(A.Fragment,null,(0,A.createElement)("ul",null,o&&r&&(0,A.createElement)("li",null,(0,A.createElement)("strong",null,(0,$.__)("Estimated Time","lifterlms")),": ",r),s&&(0,A.createElement)(Ml,{currentPost:d,taxonomy:"course_difficulty",taxonomyName:(0,$.__)("Difficulty","lifterlms")}),a&&(0,A.createElement)(Ml,{currentPost:d,taxonomy:"course_track",taxonomyName:(0,$.__)("Tracks","lifterlms")}),l&&(0,A.createElement)(Ml,{currentPost:d,taxonomy:"course_cat",taxonomyName:(0,$.__)("Categories","lifterlms")}),i&&(0,A.createElement)(Ml,{currentPost:d,taxonomy:"course_tag",taxonomyName:(0,$.__)("Tags","lifterlms")})))))},save:()=>null},Nl=(0,A.createElement)(F.SVG,{className:"llms-block-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},(0,A.createElement)(F.Path,{d:"M64 64c0-17.7-14.3-32-32-32S0 46.3 0 64V400c0 44.2 35.8 80 80 80H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H80c-8.8 0-16-7.2-16-16V64zm406.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L320 210.7l-57.4-57.4c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L240 221.3l57.4 57.4c12.5 12.5 32.8 12.5 45.3 0l128-128z"})),Al=["course"],Fl="llms/course-progress",Bl={title:(0,$.__)("Course Progress","lifterlms"),icon:Nl,category:"llms-blocks",keywords:[(0,$.__)("LifterLMS","lifterlms")],supports:{llms_visibility:!1},edit:e=>(0,A.createElement)("div",{className:e.className},(0,A.createElement)("div",{className:"progress-bar",value:"50",max:"100"},(0,A.createElement)("div",{className:"progress--fill"})),(0,A.createElement)("span",null,"50%")),save:()=>null,deprecated:[{save:e=>(0,A.createElement)("div",{className:e.className},"[lifterlms_course_progress]")}]},Hl=(0,A.createElement)(F.SVG,{className:"llms-block-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 640 512"},(0,A.createElement)(F.Path,{d:"M192 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm-8 384V352h16V480c0 17.7 14.3 32 32 32s32-14.3 32-32V192h56 64 16c17.7 0 32-14.3 32-32s-14.3-32-32-32H384V64H576V256H384V224H320v48c0 26.5 21.5 48 48 48H592c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48H368c-26.5 0-48 21.5-48 48v80H243.1 177.1c-33.7 0-64.9 17.7-82.3 46.6l-58.3 97c-9.1 15.1-4.2 34.8 10.9 43.9s34.8 4.2 43.9-10.9L120 256.9V480c0 17.7 14.3 32 32 32s32-14.3 32-32z"})),zl=window.wp.serverSideRender;var $l=n.n(zl);class Ul extends A.Component{constructor(){super(...arguments),Y(this,"render",(()=>{const{name:e,attributes:t,post_id:n}=this.props;return(0,A.createElement)(A.Fragment,null,(0,A.createElement)($l(),{block:e,attributes:t,urlQueryArgs:{post_id:n}}))})),this.state={instructors:this.props.instructors}}}const jl=(0,U.compose)([(0,jr.withSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPostId:n}=e("core/editor");return{post_id:n(),instructors:t("instructors")}}))])(Ul),ql="llms/instructors",Gl=["course","llms_membership"],Wl={title:(0,$.__)("Instructors","lifterlms"),icon:Hl,category:"llms-blocks",keywords:[(0,$.__)("LifterLMS","lifterlms"),(0,$.__)("Course","lifterlms"),(0,$.__)("Memebership","lifterlms")],attributes:{post_id:{type:"int",default:0}},edit:jl,save:()=>null},Kl=(0,A.createElement)(F.SVG,{className:"llms-block-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 640 512"},(0,A.createElement)(F.Path,{d:"M32 64c17.7 0 32 14.3 32 32l0 320c0 17.7-14.3 32-32 32s-32-14.3-32-32V96C0 78.3 14.3 64 32 64zm214.6 73.4c12.5 12.5 12.5 32.8 0 45.3L205.3 224l229.5 0-41.4-41.4c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l96 96c12.5 12.5 12.5 32.8 0 45.3l-96 96c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L434.7 288l-229.5 0 41.4 41.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0l-96-96c-12.5-12.5-12.5-32.8 0-45.3l96-96c12.5-12.5 32.8-12.5 45.3 0zM640 96V416c0 17.7-14.3 32-32 32s-32-14.3-32-32V96c0-17.7 14.3-32 32-32s32 14.3 32 32z"})),Yl="llms/lesson-navigation",Xl=["lesson"],Ql={title:(0,$.__)("Lesson Navigation","lifterlms"),icon:Kl,category:"llms-blocks",keywords:[(0,$.__)("LifterLMS","lifterlms")],edit(e){const t=wp.data.select("core/editor").getCurrentPost(),{attributes:n}=e;return(0,A.createElement)(A.Fragment,null,(0,A.createElement)($l(),{block:Yl,attributes:n,urlQueryArgs:{post_id:t.id}}))},save:()=>null},Zl=(0,A.createElement)(F.SVG,{className:"llms-block-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},(0,A.createElement)(F.Path,{d:"M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"})),Jl="llms/lesson-progression",es=["lesson"],ts={title:(0,$.__)("Lesson Progression (Mark Complete)","lifterlms"),icon:Zl,category:"llms-blocks",keywords:[(0,$.__)("LifterLMS","lifterlms")],supports:{llms_visibility:!1},edit(){const e=1*(0,jr.select)("core/editor").getCurrentPost().meta._llms_quiz;let t=!e;return t=(0,H.applyFilters)("llms.lessonProgressBlock.showMainBtn",t),(0,A.createElement)(A.Fragment,null,(0,A.createElement)("div",{className:"llms-lesson-button-wrapper"},(0,A.createElement)(A.Fragment,null,!!e&&(0,A.createElement)(q.Button,{className:"llms-prog-btn--quiz llms-button-action auto button"},(0,$.__)("Take Quiz","lifterlms")),t&&(0,A.createElement)(q.Button,{className:"llms-prog-btn--complete llms-field-button llms-button-primary auto button"},(0,$.__)("Mark Complete","lifterlms")))))},save:()=>null},ns=window.jQuery;var rs=n.n(ns);const ls=(0,A.createElement)(F.SVG,{className:"llms-block-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512"},(0,A.createElement)(F.Path,{d:"M64 64C28.7 64 0 92.7 0 128V384c0 35.3 28.7 64 64 64H512c35.3 0 64-28.7 64-64V128c0-35.3-28.7-64-64-64H64zM272 192H496c8.8 0 16 7.2 16 16s-7.2 16-16 16H272c-8.8 0-16-7.2-16-16s7.2-16 16-16zM256 304c0-8.8 7.2-16 16-16H496c8.8 0 16 7.2 16 16s-7.2 16-16 16H272c-8.8 0-16-7.2-16-16zM164 152v13.9c7.5 1.2 14.6 2.9 21.1 4.7c10.7 2.8 17 13.8 14.2 24.5s-13.8 17-24.5 14.2c-11-2.9-21.6-5-31.2-5.2c-7.9-.1-16 1.8-21.5 5c-4.8 2.8-6.2 5.6-6.2 9.3c0 1.8 .1 3.5 5.3 6.7c6.3 3.8 15.5 6.7 28.3 10.5l.7 .2c11.2 3.4 25.6 7.7 37.1 15c12.9 8.1 24.3 21.3 24.6 41.6c.3 20.9-10.5 36.1-24.8 45c-7.2 4.5-15.2 7.3-23.2 9V360c0 11-9 20-20 20s-20-9-20-20V345.4c-10.3-2.2-20-5.5-28.2-8.4l0 0 0 0c-2.1-.7-4.1-1.4-6.1-2.1c-10.5-3.5-16.1-14.8-12.6-25.3s14.8-16.1 25.3-12.6c2.5 .8 4.9 1.7 7.2 2.4c13.6 4.6 24 8.1 35.1 8.5c8.6 .3 16.5-1.6 21.4-4.7c4.1-2.5 6-5.5 5.9-10.5c0-2.9-.8-5-5.9-8.2c-6.3-4-15.4-6.9-28-10.7l-1.7-.5c-10.9-3.3-24.6-7.4-35.6-14c-12.7-7.7-24.6-20.5-24.7-40.7c-.1-21.1 11.8-35.7 25.8-43.9c6.9-4.1 14.5-6.8 22.2-8.5V152c0-11 9-20 20-20s20 9 20 20z"}));let ss=null;(0,jr.subscribe)((()=>{const{getCurrentPostLastRevisionId:e,isCurrentPostPublished:t,isSavingPost:n,isPublishingPost:r}=(0,jr.select)("core/editor");if(!t())return;const l=rs()("#llms-save-access-plans");l.length&&ss!==e()&&"disabled"!==l.attr("disabled")&&(n()||r())&&(ss=e(),l.trigger("click"))})),rs()(document).on("llms-access-plan-validation-errors",(function(){(0,jr.dispatch)("core/notices").createErrorNotice((0,$.__)("Validation errors were encountered while attempting to save your access plans.","lifterlms"),{id:"llms-access-plan-error-notice"})}));const os="llms/pricing-table",is=["course","llms_membership"],as={title:(0,$.__)("LifterLMS Pricing Table","lifterlms"),icon:ls,category:"llms-blocks",keywords:[(0,$.__)("LifterLMS","lifterlms")],attributes:{post_id:{type:"int",default:0}},edit:e=>{const{attributes:t}=e;return rs()(document).one("llms-access-plans-updated",(function(){(0,jr.dispatch)("core/editor").replaceBlock(e.clientId,(0,Gr.createBlock)(os)),setTimeout((function(){(0,jr.dispatch)("core/editor").savePost()}),500)})),(0,A.createElement)(A.Fragment,null,(0,A.createElement)($l(),{block:os,attributes:t,urlQueryArgs:{post_id:(0,jr.select)("core/editor").getCurrentPostId()}}))},save:()=>null},cs="llms/php-template",us={title:(0,$.__)("LifterLMS PHP Template","lifterlms"),category:"llms-blocks",keywords:[(0,$.__)("LifterLMS","lifterlms")],attributes:{template:{type:"string",default:""},title:{type:"string",default:""}},supports:{html:!1,multiple:!1,reusable:!1,inserter:!1},edit:function(e){const{attributes:t}=e,{template:n}=t,r=(0,j.useBlockProps)();let{title:l}=t;if(!l){const e=window.llmsBlockTemplatesL10n;l=e&&e[n]?e[n]:n}return(0,A.createElement)("div",r,(0,A.createElement)(q.Placeholder,{label:l,className:"wp-block-liftelrms-php-template__placeholder"},(0,A.createElement)("div",{className:"wp-block-liftelrms-php-template__placeholder-copy"},(0,A.createElement)("p",{className:"wp-block-liftelrms-php-template__placeholder-warning"},(0,A.createElement)("strong",null,(0,$.__)("Attention: Do not remove this block!","lifterlms"))," ",(0,$.__)("Removal will cause unintended effects on your LMS site.","lifterlms")),(0,A.createElement)("p",null,(0,$.sprintf)( -/* translators: %s is the template title */ -(0,$.__)("This is an editor placeholder for the %s. On your site this will be replaced by the relevant template. You can move this placeholder around and add further blocks around it to extend the template.","lifterlms"),l)))))},save:()=>null};function ds(e){if(!e)return[e];if(e.innerBlocks.length)return ps(e.innerBlocks);if("core/block"===e.name){const{blocks:t}=(0,jr.select)("core").getEditedEntityRecord("postType","wp_block",e.attributes.ref);return ps(t)}return-1===e.name.indexOf("llms/form-field")?[]:[e]}function ps(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[];return(0,Fr.forEach)(e,(e=>{const n=ds(e);n.length&&(t=t.concat(n))})),t}const ms=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"global";const{getFieldBy:r}=(0,jr.select)(wl);return!r(t,e,n)};if("wp_block"===Yr()){let e="";(0,jr.subscribe)((()=>{const t=(0,jr.select)("core/editor").getEditedPostContent();if(void 0===t||t===e)return;e=t;const n=t.includes("\x3c!-- wp:llms/form-field")?"yes":"no";(0,jr.dispatch)("core/editor").editPost({is_llms_field:n})}))}(0,H.addFilter)("blocks.getSaveElement","llms/core-block/save",((e,t,n)=>{if("core/block"!==t.name)return e;const{ref:r}=n;if((0,jr.select)("core").hasFinishedResolution("getEntityRecord",["postType","wp_block",r])){const e=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Array.isArray(e)||(e=[e]),ps(e)}(function(e){let t=!1;return(0,Fr.some)((0,jr.select)("core/block-editor").getBlocks(),(n=>{const r=n.attributes.ref===e;return r&&(t=n),r})),t}(r));e.length&&setTimeout((()=>{(0,jr.dispatch)("core").editEntityRecord("postType","wp_block",n.ref,{is_llms_field:e.length>0?"yes":"no"})}))}return e}));const fs=(0,U.withInstanceId)((function(e){let{options:t,fieldType:n,instanceId:r}=e;return(0,A.createElement)(A.Fragment,null,t.map(((e,t)=>(0,A.createElement)("label",{htmlFor:`llms-${n}-${r}-${t}`,key:t,style:{display:"block",pointerEvents:"none"}},(0,A.createElement)("input",{id:`llms-${n}-${r}-${t}`,type:n,checked:"yes"===e.default,readOnly:!0})," ",e.text))))}));class hs extends A.Component{getFieldType(){const{attributes:{field:e}}=this.props;return-1!==["email","text","number","url","tel"].indexOf(e)?"input":e}render(){const{attributes:e,setAttributes:t,block:n,clientId:r}=this.props,{description:l,label:s,options:o,placeholder:i,required:a}=e,c=n.supports.llms_edit_fill,u=[];a&&u.push("llms-is-required");const d=this.getFieldType();return(0,A.createElement)(A.Fragment,null,(0,A.createElement)("div",{className:"llms-field"},"html"!==d&&(0,A.createElement)(j.RichText,{tagName:"label",className:u.join(" "),value:s,onChange:e=>{t({label:e})},allowedFormats:["bold","italic"],"aria-label":s?(0,$.__)("Field label"):(0,$.__)("Empty field label; start writing to add a label"),placeholder:(0,$.__)("Enter a label")}),"input"===d&&(0,A.createElement)("input",{onChange:e=>t({placeholder:e.target.value}),value:i,placeholder:(0,$.__)("Add optional placeholder text","lifterlms")}),"password"===d&&(0,A.createElement)("input",{disabled:"disabed",type:"password",value:"F4K3p4$50Rd"}),"textarea"===d&&(0,A.createElement)("textarea",{rows:this.props.attributes.html_attrs.rows,onChange:e=>t({placeholder:e.target.value}),value:i,placeholder:(0,$.__)("Add optional placeholder text","lifterlms")}),"select"===d&&(0,A.createElement)("select",null,(0,A.createElement)("option",null,(()=>{if(i)return i;if(!o.length)return"";let e=o[0].text;const t=o.filter((e=>"yes"===e.default));return t.length&&(e=t[0].text),e})())),(0,A.createElement)(j.RichText,{tagName:"span",value:l,onChange:e=>{t({description:e})},allowedFormats:["bold","strikethrough","link"],"aria-label":s?(0,$.__)("Optional field description"):(0,$.__)("Empty field description; start writing to add a description"),placeholder:(0,$.__)("Add optional description text"),style:{color:"#808285",fontStyle:"italic"}}),("radio"===d||"checkbox"===d)&&(0,A.createElement)(fs,{options:o,fieldType:d})),c.after&&(0,A.createElement)(q.Slot,{name:`llmsEditFill.after.${c.after}.${r}`}))}}var gs,vs=new Uint8Array(16);function bs(){if(!gs&&!(gs="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return gs(vs)}const _s=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,ys=function(e){return"string"==typeof e&&_s.test(e)};for(var ws=[],Es=0;Es<256;++Es)ws.push((Es+256).toString(16).substr(1));const xs=function(e,t,n){var r=(e=e||{}).random||(e.rng||bs)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var l=0;l<16;++l)t[n+l]=r[l];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(ws[e[t+0]]+ws[e[t+1]]+ws[e[t+2]]+ws[e[t+3]]+"-"+ws[e[t+4]]+ws[e[t+5]]+"-"+ws[e[t+6]]+ws[e[t+7]]+"-"+ws[e[t+8]]+ws[e[t+9]]+"-"+ws[e[t+10]]+ws[e[t+11]]+ws[e[t+12]]+ws[e[t+13]]+ws[e[t+14]]+ws[e[t+15]]).toLowerCase();if(!ys(n))throw TypeError("Stringified UUID is invalid");return n}(r)};class Cs extends Br{constructor(){super(...arguments),Y(this,"getDefaultClassName",(()=>"llms-search--user")),Y(this,"getSearchPath",(()=>this.props.searchPath||"/wp/v2/users")),Y(this,"formatSearchResultLabel",(e=>(0,$.sprintf)(// Translators: %1$s = User's name; %2$s = User's id. -(0,$._x)("%1$s (ID# %2$d)","User search result label","lifterlms"),e.name,e.id)))}getSearchArgs(e){const t=super.getSearchArgs(e),{roles:n}=this.props;return n&&(t.roles=Array.isArray(n)?n.join(","):n),t}}const ks="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Ss=ks?J.useLayoutEffect:J.useEffect;function Os(e,t){const n=(0,J.useRef)();return(0,J.useMemo)((()=>{const t=e(n.current);return n.current=t,t}),[...t])}function Is(){const e=(0,J.useRef)(null),t=(0,J.useCallback)((t=>{e.current=t}),[]);return[e,t]}let Ts={};function Ps(e,t){return(0,J.useMemo)((()=>{if(t)return t;const n=null==Ts[e]?0:Ts[e]+1;return Ts[e]=n,`${e}-${n}`}),[e,t])}function Ms(e){return(t,...n)=>n.reduce(((t,n)=>{const r=Object.entries(n);for(const[n,l]of r){const r=t[n];null!=r&&(t[n]=r+e*l)}return t}),{...t})}const Ds=Ms(1),Ls=Ms(-1),Rs=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return`translate3d(${t?Math.round(t):0}px, ${n?Math.round(n):0}px, 0)`}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return`scaleX(${t}) scaleY(${n})`}},Transform:{toString(e){if(e)return[Rs.Translate.toString(e),Rs.Scale.toString(e)].join(" ")}},Transition:{toString:({property:e,duration:t,easing:n})=>`${e} ${t}ms ${n}`}}),Vs={display:"none"};function Ns(e){let{id:t,value:n}=e;return ee().createElement("div",{id:t,style:Vs},n)}const As={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};function Fs(e){let{id:t,announcement:n}=e;return ee().createElement("div",{id:t,style:As,role:"status","aria-live":"assertive","aria-atomic":!0},n)}const Bs={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},Hs={onDragStart:e=>`Picked up draggable item ${e}.`,onDragOver:(e,t)=>t?`Draggable item ${e} was moved over droppable area ${t}.`:`Draggable item ${e} is no longer over a droppable area.`,onDragEnd:(e,t)=>t?`Draggable item ${e} was dropped over droppable area ${t}`:`Draggable item ${e} was dropped.`,onDragCancel:e=>`Dragging was cancelled. Draggable item ${e} was dropped.`};var zs;!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(zs||(zs={}));const $s=e=>Us(e,((e,t)=>e{const n=Xs(t,t.left,t.top),r=e.map((([e,t])=>Ks(Xs(t),n))),l=$s(r);return e[l]?e[l][0]:null};function Zs(e){return function(t,...n){return n.reduce(((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x,offsetLeft:t.offsetLeft+e*n.x,offsetTop:t.offsetTop+e*n.y})),{...t})}}const Js=Zs(1);function eo(e){const t=[];return e?function e(n){return n?n instanceof Document&&null!=n.scrollingElement?(t.push(n.scrollingElement),t):!(n instanceof HTMLElement)||n instanceof SVGElement?t:(function(e){const t=window.getComputedStyle(e),n=/(auto|scroll|overlay)/;return null!=["overflow","overflowX","overflowY"].find((e=>{const r=t[e];return"string"==typeof r&&n.test(r)}))}(n)&&t.push(n),e(n.parentNode)):t}(e.parentNode):t}function to(e){return ks?e===document.scrollingElement||e instanceof Document?window:e instanceof HTMLElement?e:null:null}function no(e){return e instanceof Window?{x:e.scrollX,y:e.scrollY}:{x:e.scrollLeft,y:e.scrollTop}}var ro;function lo(e){const t={x:0,y:0},n={x:e.scrollWidth-e.clientWidth,y:e.scrollHeight-e.clientHeight};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=n.y,isRight:e.scrollLeft>=n.x,maxScroll:n,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(ro||(ro={}));const so={x:.2,y:.2};function oo(e,t,{top:n,left:r,right:l,bottom:s},o=10,i=so){const{clientHeight:a,clientWidth:c}=e,u=(d=e,ks&&d&&d===document.scrollingElement?{top:0,left:0,right:c,bottom:a,width:c,height:a}:t);var d;const{isTop:p,isBottom:m,isLeft:f,isRight:h}=lo(e),g={x:0,y:0},v={x:0,y:0},b=u.height*i.y,_=u.width*i.x;return!p&&n<=u.top+b?(g.y=ro.Backward,v.y=o*Math.abs((u.top+b-n)/b)):!m&&s>=u.bottom-b&&(g.y=ro.Forward,v.y=o*Math.abs((u.bottom-b-s)/b)),!h&&l>=u.right-_?(g.x=ro.Forward,v.x=o*Math.abs((u.right-_-l)/_)):!f&&r<=u.left+_&&(g.x=ro.Backward,v.x=o*Math.abs((u.left+_-r)/_)),{direction:g,speed:v}}function io(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:l}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:l,width:e.clientWidth,height:e.clientHeight}}function ao(e){return e.reduce(((e,t)=>Ds(e,no(t))),Ws)}function co(e,t,n=Ws){if(!(e&&e instanceof HTMLElement))return n;const r={x:n.x+e.offsetLeft,y:n.y+e.offsetTop};return e.offsetParent===t?r:co(e.offsetParent,t,r)}function uo(e){const{offsetWidth:t,offsetHeight:n}=e,{x:r,y:l}=co(e,null);return{width:t,height:n,offsetTop:l,offsetLeft:r}}function po(e){if(e instanceof Window){const e=window.innerWidth,t=window.innerHeight;return{top:0,left:0,right:e,bottom:t,width:e,height:t,offsetTop:0,offsetLeft:0}}const{offsetTop:t,offsetLeft:n}=uo(e),{width:r,height:l,top:s,bottom:o,left:i,right:a}=e.getBoundingClientRect();return{width:r,height:l,top:s,bottom:o,right:a,left:i,offsetTop:t,offsetLeft:n}}function mo(e){const{width:t,height:n,offsetTop:r,offsetLeft:l}=uo(e),s=ao(eo(e)),o=r-s.y,i=l-s.x;return{width:t,height:n,top:o,bottom:o+n,right:i+t,left:i,offsetTop:r,offsetLeft:l}}function fo(e){return"top"in e}function ho(e,t=e.offsetLeft,n=e.offsetTop){return[{x:t,y:n},{x:t+e.width,y:n},{x:t,y:n+e.height},{x:t+e.width,y:n+e.height}]}const go=(e,t)=>{const n=e.map((([e,n])=>function(e,t){const n=Math.max(t.top,e.offsetTop),r=Math.max(t.left,e.offsetLeft),l=Math.min(t.left+t.width,e.offsetLeft+e.width),s=Math.min(t.top+t.height,e.offsetTop+e.height),o=l-r,i=s-n;if(re>t));return n[r]<=0?null:e[r]?e[r][0]:null};function vo(e){return e instanceof HTMLElement?e.ownerDocument:document}function bo(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:{},translate:{x:0,y:0}},droppable:{containers:{}}}}function _o(e,t){switch(t.type){case zs.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case zs.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case zs.DragEnd:case zs.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case zs.RegisterDroppable:{const{element:n}=t,{id:r}=n;return{...e,droppable:{...e.droppable,containers:{...e.droppable.containers,[r]:n}}}}case zs.SetDroppableDisabled:{const{id:n,disabled:r}=t,l=e.droppable.containers[n];return l?{...e,droppable:{...e.droppable,containers:{...e.droppable.containers,[n]:{...l,disabled:r}}}}:e}case zs.UnregisterDroppable:{const{id:n}=t;return{...e,droppable:{...e.droppable,containers:qs(n,e.droppable.containers)}}}default:return e}}const yo=(0,J.createContext)({type:null,event:null});function wo({announcements:e=Hs,hiddenTextDescribedById:t,screenReaderInstructions:n}){const{announce:r,announcement:l}=function(){const[e,t]=(0,J.useState)("");return{announce:(0,J.useCallback)((e=>{null!=e&&t(e)}),[]),announcement:e}}(),s=Ps("DndLiveRegion"),[o,i]=(0,J.useState)(!1);return(0,J.useEffect)((()=>{i(!0)}),[]),function({onDragStart:e,onDragMove:t,onDragOver:n,onDragEnd:r,onDragCancel:l}){const s=(0,J.useContext)(yo),o=(0,J.useRef)(s);(0,J.useEffect)((()=>{if(s!==o.current){const{type:i,event:a}=s;switch(i){case zs.DragStart:null==e||e(a);break;case zs.DragMove:null==t||t(a);break;case zs.DragOver:null==n||n(a);break;case zs.DragCancel:null==l||l(a);break;case zs.DragEnd:null==r||r(a)}o.current=s}}),[s,e,t,n,r,l])}((0,J.useMemo)((()=>({onDragStart({active:t}){r(e.onDragStart(t.id))},onDragMove({active:t,over:n}){e.onDragMove&&r(e.onDragMove(t.id,null==n?void 0:n.id))},onDragOver({active:t,over:n}){r(e.onDragOver(t.id,null==n?void 0:n.id))},onDragEnd({active:t,over:n}){r(e.onDragEnd(t.id,null==n?void 0:n.id))},onDragCancel({active:t}){r(e.onDragCancel(t.id))}})),[r,e])),o?(0,Ht.createPortal)(ee().createElement(ee().Fragment,null,ee().createElement(Ns,{id:t,value:n.draggable}),ee().createElement(Fs,{id:s,announcement:l})),document.body):null}var Eo,xo,Co,ko;function So(e){const t=(0,J.useRef)(e);return Ss((()=>{t.current!==e&&(t.current=e)}),[e]),t}!function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(Eo||(Eo={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(xo||(xo={})),function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(Co||(Co={})),function(e){e.Optimized="optimized"}(ko||(ko={}));const Oo=new Map;const Io={strategy:Co.WhileDragging,frequency:ko.Optimized},To=[],Po=Lo(po),Mo=Ro(po),Do=Lo(mo);function Lo(e){return function(t,n){const r=(0,J.useRef)(t);return Os((l=>t?n||!l&&t||t!==r.current?t instanceof HTMLElement&&null==t.parentNode?null:e(t):null!=l?l:null:null),[t,n])}}function Ro(e){const t=[];return function(n,r){const l=(0,J.useRef)(n);return Os((s=>n.length?r||!s&&n.length||n!==l.current?n.map((t=>e(t))):null!=s?s:t:t),[n,r])}}function Vo(e,t){return(0,J.useMemo)((()=>({sensor:e,options:null!=t?t:{}})),[e,t])}class No{constructor(e){this.target=e,this.listeners=[]}add(e,t,n){this.target.addEventListener(e,t,n),this.listeners.push({eventName:e,handler:t})}removeAll(){this.listeners.forEach((({eventName:e,handler:t})=>this.target.removeEventListener(e,t)))}}function Ao(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var Fo;!function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"}(Fo||(Fo={}));const Bo={start:[Fo.Space,Fo.Enter],cancel:[Fo.Esc],end:[Fo.Space,Fo.Enter]},Ho=(e,{currentCoordinates:t})=>{switch(e.code){case Fo.Right:return{...t,x:t.x+25};case Fo.Left:return{...t,x:t.x-25};case Fo.Down:return{...t,y:t.y+25};case Fo.Up:return{...t,y:t.y-25}}};class zo{constructor(e){this.props=e,this.autoScrollEnabled=!1,this.coordinates=Ws;const{event:{target:t}}=e;this.props=e,this.listeners=new No(vo(t)),this.windowListeners=new No(function(e){var t;return null!=(t=vo(e).defaultView)?t:window}(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),setTimeout((()=>{this.listeners.add("keydown",this.handleKeyDown),this.windowListeners.add("resize",this.handleCancel)}))}handleStart(){const{activeNode:e,onStart:t}=this.props;if(!e.node.current)throw new Error("Active draggable node is undefined");const n=po(e.node.current),r={x:n.left,y:n.top};this.coordinates=r,t(r)}handleKeyDown(e){if(e instanceof KeyboardEvent){const{coordinates:t}=this,{active:n,context:r,options:l}=this.props,{keyboardCodes:s=Bo,coordinateGetter:o=Ho,scrollBehavior:i="smooth"}=l,{code:a}=e;if(s.end.includes(a))return void this.handleEnd(e);if(s.cancel.includes(a))return void this.handleCancel(e);const c=o(e,{active:n,context:r.current,currentCoordinates:t});if(c){const n={x:0,y:0},{scrollableAncestors:l}=r.current;for(const r of l){const l=e.code,s=Ls(c,t),{isTop:o,isRight:a,isLeft:u,isBottom:d,maxScroll:p,minScroll:m}=lo(r),f=io(r),h={x:Math.min(l===Fo.Right?f.right-f.width/2:f.right,Math.max(l===Fo.Right?f.left:f.left+f.width/2,c.x)),y:Math.min(l===Fo.Down?f.bottom-f.height/2:f.bottom,Math.max(l===Fo.Down?f.top:f.top+f.height/2,c.y))},g=l===Fo.Right&&!a||l===Fo.Left&&!u,v=l===Fo.Down&&!d||l===Fo.Up&&!o;if(g&&h.x!==c.x){if(l===Fo.Right&&r.scrollLeft+s.x<=p.x||l===Fo.Left&&r.scrollLeft+s.x>=m.x)return void r.scrollBy({left:s.x,behavior:i});n.x=l===Fo.Right?r.scrollLeft-p.x:r.scrollLeft-m.x,r.scrollBy({left:-n.x,behavior:i});break}if(v&&h.y!==c.y){if(l===Fo.Down&&r.scrollTop+s.y<=p.y||l===Fo.Up&&r.scrollTop+s.y>=m.y)return void r.scrollBy({top:s.y,behavior:i});n.y=l===Fo.Down?r.scrollTop-p.y:r.scrollTop-m.y,r.scrollBy({top:-n.y,behavior:i});break}}this.handleMove(e,Ds(c,n))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t),this.coordinates=t}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function $o(e){return Boolean(e&&"distance"in e)}function Uo(e){return Boolean(e&&"delay"in e)}var jo;zo.activators=[{eventName:"onKeyDown",handler:(e,{keyboardCodes:t=Bo,onActivation:n})=>{const{code:r}=e.nativeEvent;return!!t.start.includes(r)&&(e.preventDefault(),null==n||n({event:e.nativeEvent}),!0)}}],function(e){e.Keydown="keydown"}(jo||(jo={}));class qo{constructor(e,t,n=function(e){return e instanceof EventTarget?e:vo(e)}(e.event.target)){this.props=e,this.events=t,this.autoScrollEnabled=!0,this.activated=!1,this.timeoutId=null;const{event:r}=e;this.props=e,this.events=t,this.ownerDocument=vo(r.target),this.listeners=new No(n),this.initialCoordinates=Ys(r),this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t}}}=this;if(this.listeners.add(e.move.name,this.handleMove,!1),this.listeners.add(e.end.name,this.handleEnd),this.ownerDocument.addEventListener(jo.Keydown,this.handleKeydown),t){if($o(t))return;if(Uo(t))return void(this.timeoutId=setTimeout(this.handleStart,t.delay))}this.handleStart()}detach(){this.listeners.removeAll(),this.ownerDocument.removeEventListener(jo.Keydown,this.handleKeydown),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,t(e))}handleMove(e){const{activated:t,initialCoordinates:n,props:r}=this,{onMove:l,options:{activationConstraint:s}}=r;if(!n)return;const o=Ys(e),i=Ls(n,o);if(!t&&s){if(Uo(s))return Ao(i,s.tolerance)?this.handleCancel():void 0;if($o(s))return Ao(i,s.distance)?this.handleStart():void 0}e.cancelable&&e.preventDefault(),l(o)}handleEnd(){const{onEnd:e}=this.props;this.detach(),e()}handleCancel(){const{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===Fo.Esc&&this.handleCancel()}}const Go={move:{name:"pointermove"},end:{name:"pointerup"}};class Wo extends qo{constructor(e){const{event:t}=e,n=vo(t.target);super(e,Go,n)}}Wo.activators=[{eventName:"onPointerDown",handler:({nativeEvent:e},{onActivation:t})=>!(!e.isPrimary||0!==e.button||(null==t||t({event:e}),0))}];const Ko={move:{name:"mousemove"},end:{name:"mouseup"}};var Yo;!function(e){e[e.RightClick=2]="RightClick"}(Yo||(Yo={})),class extends qo{constructor(e){super(e,Ko,vo(e.event.target))}}.activators=[{eventName:"onMouseDown",handler:({nativeEvent:e},{onActivation:t})=>e.button!==Yo.RightClick&&(null==t||t({event:e}),!0)}];const Xo={move:{name:"touchmove"},end:{name:"touchend"}};(class extends qo{constructor(e){super(e,Xo)}}).activators=[{eventName:"onTouchStart",handler:({nativeEvent:e},{onActivation:t})=>{const{touches:n}=e;return!(n.length>1||(null==t||t({event:e}),0))}}];const Qo=[{sensor:Wo,options:{}},{sensor:zo,options:{}}],Zo={current:{}},Jo=(0,J.createContext)({...Ws,scaleX:1,scaleY:1}),ei=(0,J.memo)((function({id:e,autoScroll:t=!0,announcements:n,children:r,sensors:l=Qo,collisionDetection:s=go,layoutMeasuring:o,modifiers:i,screenReaderInstructions:a=Bs,...c}){var u,d,p;const m=(0,J.useReducer)(_o,void 0,bo),[f,h]=m,[g,v]=(0,J.useState)((()=>({type:null,event:null}))),{draggable:{active:b,nodes:_,translate:y},droppable:{containers:w}}=f,E=b?_[b]:null,x=(0,J.useRef)({initial:null,translated:null}),C=(0,J.useMemo)((()=>{var e;return null!=b?{id:b,data:null!=(e=null==E?void 0:E.data)?e:Zo,rect:x}:null}),[b,E]),k=(0,J.useRef)(null),[S,O]=(0,J.useState)(null),[I,T]=(0,J.useState)(null),P=(0,J.useRef)(c),M=Ps("DndDescribedBy",e),{layoutRectMap:D,recomputeLayouts:L,willRecomputeLayouts:R}=function(e,{dragging:t,dependencies:n,config:r}){const[l,s]=(0,J.useState)(!1),{frequency:o,strategy:i}=(a=r)?{...Io,...a}:Io;var a;const c=(0,J.useRef)(e),u=(0,J.useCallback)((()=>s(!0)),[]),d=(0,J.useRef)(null),p=function(){switch(i){case Co.Always:return!1;case Co.BeforeDragging:return t;default:return!t}}(),m=Os((n=>{if(p&&!t)return Oo;if(!n||n===Oo||c.current!==e||l){for(let t of Object.values(e))t&&(t.rect.current=t.node.current?uo(t.node.current):null);return function(e){const t=new Map;if(e)for(const n of Object.values(e)){if(!n)continue;const{id:e,rect:r,disabled:l}=n;l||null==r.current||t.set(e,r.current)}return t}(e)}return n}),[e,t,p,l]);return(0,J.useEffect)((()=>{c.current=e}),[e]),(0,J.useEffect)((()=>{l&&s(!1)}),[l]),(0,J.useEffect)((function(){p||requestAnimationFrame(u)}),[t,p]),(0,J.useEffect)((function(){p||"number"!=typeof o||null!==d.current||(d.current=setTimeout((()=>{u(),d.current=null}),o))}),[o,p,u,...n]),{layoutRectMap:m,recomputeLayouts:u,willRecomputeLayouts:l}}(w,{dragging:null!=b,dependencies:[y.x,y.y],config:o}),V=function(e,t){const n=null!==t?e[t]:void 0,r=n?n.node.current:null;return Os((e=>{var n;return null===t?null:null!=(n=null!=r?r:e)?n:null}),[r,t])}(_,b),N=I?Ys(I):null,A=Do(V),F=Po(V),B=(0,J.useRef)(null),H=($=B.current,(z=A)&&$?{x:z.left-$.left,y:z.top-$.top}:Ws);var z,$;const U=(0,J.useRef)({active:null,activeNode:V,collisionRect:null,droppableRects:D,draggableNodes:_,draggingNodeRect:null,droppableContainers:w,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null,translatedRect:null}),j=function(e,t){var n,r;return e&&null!=(n=null==(r=t[e])?void 0:r.node.current)?n:null}(null!=(u=null==(d=U.current.over)?void 0:d.id)?u:null,w),q=Po(V?V.ownerDocument.defaultView:null),G=Po(V?V.parentElement:null),W=function(e){const t=(0,J.useRef)(e),n=Os((n=>e?n&&e&&t.current&&e.parentNode===t.current.parentNode?n:eo(e):To),[e]);return(0,J.useEffect)((()=>{t.current=e}),[e]),n}(b?null!=j?j:V:null),K=Mo(W),[Y,X]=Is(),Q=Po(b?Y.current:null,R),Z=null!=Q?Q:F,te=function(e,{transform:t,...n}){return(null==e?void 0:e.length)?e.reduce(((e,t)=>t({transform:e,...n})),t):t}(i,{transform:{x:y.x-H.x,y:y.y-H.y,scaleX:1,scaleY:1},active:C,over:U.current.over,activeNodeRect:F,draggingNodeRect:Z,containerNodeRect:G,overlayNodeRect:Q,scrollableAncestors:W,scrollableAncestorRects:K,windowRect:q}),ne=N?Ds(N,y):null,re=function(e){const[t,n]=(0,J.useState)(null),r=(0,J.useRef)(e),l=(0,J.useCallback)((e=>{const t=to(e.target);t&&n((e=>e?(e.set(t,no(t)),new Map(e)):null))}),[]);return(0,J.useEffect)((()=>{const t=r.current;if(e!==t){s(t);const o=e.map((e=>{const t=to(e);return t?(t.addEventListener("scroll",l,{passive:!0}),[t,no(t)]):null})).filter((e=>null!=e));n(o.length?new Map(o):null),r.current=e}return()=>{s(e),s(t)};function s(e){e.forEach((e=>{const t=to(e);null==t||t.removeEventListener("scroll",l)}))}}),[l,e]),(0,J.useMemo)((()=>e.length?t?Array.from(t.values()).reduce(((e,t)=>Ds(e,t)),Ws):ao(e):Ws),[e,t])}(W),le=Ds(te,re),se=A?Js(A,te):null,oe=se?Js(se,re):null,ie=function(e,t){var n;return e&&null!=(n=t[e])?n:null}(C&&oe?s(Array.from(D.entries()),oe):null,w),ae=(0,J.useMemo)((()=>ie&&ie.rect.current?{id:ie.id,rect:ie.rect.current,data:ie.data,disabled:ie.disabled}:null),[ie]),ce=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(te,null!=(p=null==ie?void 0:ie.rect.current)?p:null,A),ue=(0,J.useCallback)(((e,{sensor:t,options:n})=>{if(!k.current)return;const r=_[k.current];if(!r)return;const l=new t({active:k.current,activeNode:r,event:e.nativeEvent,options:n,context:U,onStart(e){const t=k.current;if(!t)return;const n=_[t];if(!n)return;const{onDragStart:r}=P.current,l={active:{id:t,data:n.data,rect:x}};h({type:zs.DragStart,initialCoordinates:e,active:t}),v({type:zs.DragStart,event:l}),null==r||r(l)},onMove(e){h({type:zs.DragMove,coordinates:e})},onEnd:s(zs.DragEnd),onCancel:s(zs.DragCancel)});function s(e){return async function(){const{active:t,over:n,scrollAdjustedTranslate:r}=U.current;let l=null;if(t&&r){const{cancelDrop:s}=P.current;l={active:t,delta:r,over:n},e===zs.DragEnd&&"function"==typeof s&&await Promise.resolve(s(l))&&(e=zs.DragCancel)}if(k.current=null,h({type:e}),O(null),T(null),l){const{onDragCancel:t,onDragEnd:n}=P.current,r=e===zs.DragEnd?n:t;v({type:e,event:l}),null==r||r(l)}}}O(l),T(e.nativeEvent)}),[h,_]),de=(0,J.useCallback)(((e,t)=>(n,r)=>{const l=n.nativeEvent;null!==k.current||l.dndKit||l.defaultPrevented||!0===e(n,t.options)&&(l.dndKit={capturedBy:t.sensor},k.current=r,ue(n,t))}),[ue]),pe=function(e,t){return(0,J.useMemo)((()=>e.reduce(((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map((e=>({eventName:e.eventName,handler:t(e.handler,n)})))]}),[])),[e,t])}(l,de);Ss((()=>{P.current=c}),Object.values(c)),(0,J.useEffect)((()=>{C||(B.current=null),C&&A&&!B.current&&(B.current=A)}),[A,C]),(0,J.useEffect)((()=>{const{onDragMove:e}=P.current,{active:t,over:n}=U.current;if(!t)return;const r={active:t,delta:{x:le.x,y:le.y},over:n};v({type:zs.DragMove,event:r}),null==e||e(r)}),[le.x,le.y]),(0,J.useEffect)((()=>{const{active:e,scrollAdjustedTranslate:t}=U.current;if(!e||!k.current||!t)return;const{onDragOver:n}=P.current,r={active:e,delta:{x:t.x,y:t.y},over:ae};v({type:zs.DragOver,event:r}),null==n||n(r)}),[null==ae?void 0:ae.id]),Ss((()=>{U.current={active:C,activeNode:V,collisionRect:oe,droppableRects:D,draggableNodes:_,draggingNodeRect:Z,droppableContainers:w,over:ae,scrollableAncestors:W,scrollAdjustedTranslate:le,translatedRect:se},x.current={initial:Z,translated:se}}),[C,V,oe,_,Z,D,w,ae,W,le,se]),function({acceleration:e,activator:t=Eo.Pointer,canScroll:n,draggingRect:r,enabled:l,interval:s=5,order:o=xo.TreeOrder,pointerCoordinates:i,scrollableAncestors:a,scrollableAncestorRects:c,threshold:u}){const[d,p]=function(){const e=(0,J.useRef)(null);return[(0,J.useCallback)(((t,n)=>{e.current=setInterval(t,n)}),[]),(0,J.useCallback)((()=>{null!==e.current&&(clearInterval(e.current),e.current=null)}),[])]}(),m=(0,J.useRef)({x:1,y:1}),f=(0,J.useMemo)((()=>{switch(t){case Eo.Pointer:return i?{top:i.y,bottom:i.y,left:i.x,right:i.x}:null;case Eo.DraggableRect:return r}return null}),[t,r,i]),h=(0,J.useRef)(Ws),g=(0,J.useRef)(null),v=(0,J.useCallback)((()=>{const e=g.current;if(!e)return;const t=m.current.x*h.current.x,n=m.current.y*h.current.y;e.scrollBy(t,n)}),[]),b=(0,J.useMemo)((()=>o===xo.TreeOrder?[...a].reverse():a),[o,a]);(0,J.useEffect)((()=>{if(l&&a.length&&f){for(const t of b){if(!1===(null==n?void 0:n(t)))continue;const r=a.indexOf(t),l=c[r];if(!l)continue;const{direction:o,speed:i}=oo(t,l,f,e,u);if(i.x>0||i.y>0)return p(),g.current=t,d(v,s),m.current=i,void(h.current=o)}m.current={x:0,y:0},h.current={x:0,y:0},p()}else p()}),[e,v,n,p,l,s,JSON.stringify(f),d,a,b,c,JSON.stringify(u)])}({...function(){const e=!1===(null==S?void 0:S.autoScrollEnabled),n="object"==typeof t?!1===t.enabled:!1===t,r=!e&&!n;return"object"==typeof t?{...t,enabled:r}:{enabled:r}}(),draggingRect:se,pointerCoordinates:ne,scrollableAncestors:W,scrollableAncestorRects:K});const me=(0,J.useMemo)((()=>({active:C,activeNode:V,activeNodeRect:A,activeNodeClientRect:F,activatorEvent:I,activators:pe,ariaDescribedById:{draggable:M},overlayNode:{nodeRef:Y,rect:Q,setRef:X},containerNodeRect:G,dispatch:h,draggableNodes:_,droppableContainers:w,droppableRects:D,over:ae,recomputeLayouts:L,scrollableAncestors:W,scrollableAncestorRects:K,willRecomputeLayouts:R,windowRect:q})),[C,V,F,A,I,pe,G,Q,Y,h,_,M,w,D,ae,L,W,K,X,R,q]);return ee().createElement(yo.Provider,{value:g},ee().createElement(Gs.Provider,{value:me},ee().createElement(Jo.Provider,{value:ce},r)),ee().createElement(wo,{announcements:n,hiddenTextDescribedById:M,screenReaderInstructions:a}))})),ti=(0,J.createContext)(null),ni="button";function ri(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function li(e){return null!==e&&e>=0}const si=({layoutRects:e,activeIndex:t,overIndex:n,index:r})=>{const l=ri(e,n,t),s=e[r],o=l[r];return o&&s?{x:o.offsetLeft-s.offsetLeft,y:o.offsetTop-s.offsetTop,scaleX:o.width/s.width,scaleY:o.height/s.height}:null},oi={scaleX:1,scaleY:1},ii=({activeIndex:e,activeNodeRect:t,index:n,layoutRects:r,overIndex:l})=>{var s;const o=null!=(s=r[e])?s:t;if(!o)return null;if(n===e){const t=r[l];return t?{x:0,y:ee&&n<=l?{x:0,y:-o.height-i,...oi}:n=l?{x:0,y:o.height+i,...oi}:{x:0,y:0,...oi}},ai="Sortable",ci=ee().createContext({activeIndex:-1,containerId:ai,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:si,wasSorting:{current:!1}});function ui({children:e,id:t,items:n,strategy:r=si}){const{active:l,overlayNode:s,droppableRects:o,over:i,recomputeLayouts:a,willRecomputeLayouts:c}=(0,J.useContext)(Gs),u=Ps(ai,t),d=Boolean(null!==s.rect),p=(0,J.useMemo)((()=>n.map((e=>"string"==typeof e?e:e.id))),[n]),m=l?p.indexOf(l.id):-1,f=-1!==m,h=(0,J.useRef)(f),g=i?p.indexOf(i.id):-1,v=(0,J.useRef)(p),b=function(e,t){return e.reduce(((e,n,r)=>{const l=t.get(n);return l&&(e[r]=l),e}),Array(e.length))}(p,o),_=(y=p,w=v.current,!(y.join()===w.join()));var y,w;const E=-1!==g&&-1===m||_;Ss((()=>{_&&f&&!c&&a()}),[_,f,a,c]),(0,J.useEffect)((()=>{v.current=p}),[p]),(0,J.useEffect)((()=>{requestAnimationFrame((()=>{h.current=f}))}),[f]);const x=(0,J.useMemo)((()=>({activeIndex:m,containerId:u,disableTransforms:E,items:p,overIndex:g,useDragOverlay:d,sortedRects:b,strategy:r,wasSorting:h})),[m,u,E,p,g,b,d,r,h]);return ee().createElement(ci.Provider,{value:x},e)}const di=({isSorting:e,index:t,newIndex:n,transition:r})=>!(!r||!e&&n===t),pi={duration:200,easing:"ease"},mi="transform",fi=Rs.Transition.toString({property:mi,duration:0,easing:"linear"}),hi={roleDescription:"sortable"};function gi({animateLayoutChanges:e=di,attributes:t,disabled:n,data:r,id:l,strategy:s,transition:o=pi}){const{items:i,containerId:a,activeIndex:c,disableTransforms:u,sortedRects:d,overIndex:p,useDragOverlay:m,strategy:f,wasSorting:h}=(0,J.useContext)(ci),g=i.indexOf(l),v=(0,J.useMemo)((()=>({sortable:{containerId:a,index:g,items:i},...r})),[a,r,g,i]),{rect:b,node:_,setNodeRef:y}=function({data:e,disabled:t=!1,id:n}){const{active:r,dispatch:l,over:s}=(0,J.useContext)(Gs),o=(0,J.useRef)(null),[i,a]=Is(),c=So(e);return Ss((()=>(l({type:zs.RegisterDroppable,element:{id:n,disabled:t,node:i,rect:o,data:c}}),()=>l({type:zs.UnregisterDroppable,id:n}))),[n]),(0,J.useEffect)((()=>{l({type:zs.SetDroppableDisabled,id:n,disabled:t})}),[t]),{active:r,rect:o,isOver:(null==s?void 0:s.id)===n,node:i,over:s,setNodeRef:a}}({id:l,data:v}),{active:w,activeNodeRect:E,activatorEvent:x,attributes:C,setNodeRef:k,listeners:S,isDragging:O,over:I,transform:T}=function({id:e,data:t,disabled:n=!1,attributes:r}){const{active:l,activeNodeRect:s,activatorEvent:o,ariaDescribedById:i,draggableNodes:a,droppableRects:c,activators:u,over:d}=(0,J.useContext)(Gs),{role:p=ni,roleDescription:m="draggable",tabIndex:f=0}=null!=r?r:{},h=(null==l?void 0:l.id)===e,g=(0,J.useContext)(h?Jo:ti),[v,b]=Is(),_=function(e,t){return(0,J.useMemo)((()=>e.reduce(((e,{eventName:n,handler:r})=>(e[n]=e=>{r(e,t)},e)),{})),[e,t])}(u,e),y=So(t);return(0,J.useEffect)((()=>(a[e]={node:v,data:y},()=>{delete a[e]})),[a,e]),{active:l,activeNodeRect:s,activatorEvent:o,attributes:(0,J.useMemo)((()=>({role:p,tabIndex:f,"aria-pressed":!(!h||p!==ni)||void 0,"aria-roledescription":m,"aria-describedby":i.draggable})),[p,f,h,m,i.draggable]),droppableRects:c,isDragging:h,listeners:n?void 0:_,node:v,over:d,setNodeRef:b,transform:g}}({id:l,data:v,attributes:{...hi,...t},disabled:n}),P=function(...e){return(0,J.useMemo)((()=>t=>{e.forEach((e=>e(t)))}),e)}(y,k),M=Boolean(w),D=M&&h.current&&!u&&li(c)&&li(p),L=!m&&O,R=L&&D?T:null,V=D?null!=R?R:(null!=s?s:f)({layoutRects:d,activeNodeRect:E,activeIndex:c,overIndex:p,index:g}):null,N=li(c)&&li(p)?ri(i,c,p).indexOf(l):g,A=(0,J.useRef)(N),F=e({active:w,isDragging:O,isSorting:M,id:l,index:g,items:i,newIndex:A.current,transition:o,wasSorting:h.current}),B=function({rect:e,disabled:t,index:n,node:r}){const[l,s]=(0,J.useState)(null),o=(0,J.useRef)(n);return(0,J.useEffect)((()=>{if(!t&&n!==o.current&&r.current){const t=e.current;if(t){const e=po(r.current),n={x:t.offsetLeft-e.offsetLeft,y:t.offsetTop-e.offsetTop,scaleX:t.width/e.width,scaleY:t.height/e.height};(n.x||n.y)&&s(n)}}n!==o.current&&(o.current=n)}),[t,n,r,e]),(0,J.useEffect)((()=>{l&&requestAnimationFrame((()=>{s(null)}))}),[l]),l}({disabled:!F,index:g,node:_,rect:b});return(0,J.useEffect)((()=>{M&&(A.current=N)}),[M,N]),{active:w,attributes:C,activatorEvent:x,rect:b,index:g,isSorting:M,isDragging:O,listeners:S,node:_,overIndex:p,over:I,setNodeRef:P,setDroppableNodeRef:y,setDraggableNodeRef:k,transform:null!=B?B:V,transition:B?fi:L||!o?null:M||F?Rs.Transition.toString({...o,property:mi}):null}}const vi=[Fo.Down,Fo.Right,Fo.Up,Fo.Left],bi=(e,{context:{droppableContainers:t,translatedRect:n,scrollableAncestors:r}})=>{if(vi.includes(e.code)){if(e.preventDefault(),!n)return;const s=[];Object.entries(t).forEach((([t,r])=>{if(null==r?void 0:r.disabled)return;const l=null==r?void 0:r.node.current;if(!l)return;const o=mo(l);switch(e.code){case Fo.Down:n.top+n.height<=o.top&&s.push([t,o]);break;case Fo.Up:n.top>=o.top+o.height&&s.push([t,o]);break;case Fo.Left:n.left>=o.left+o.width&&s.push([t,o]);break;case Fo.Right:n.left+n.width<=o.left&&s.push([t,o])}}));const o=((e,t)=>{const n=ho(t,t.left,t.top),r=e.map((([e,t])=>{const r=ho(t,fo(t)?t.left:void 0,fo(t)?t.top:void 0),l=n.reduce(((e,t,n)=>e+Ks(r[n],t)),0);return Number((l/4).toFixed(4))})),l=$s(r);return e[l]?e[l][0]:null})(s,n);if(o){var l;const e=null==(l=t[o])?void 0:l.node.current;if(e){const t=eo(e).some(((e,t)=>r[t]!==e)),l=mo(e),s=t?{x:0,y:0}:{x:n.width-l.width,y:n.height-l.height};return{x:l.left-s.x,y:l.top-s.y}}}}};const _i=({transform:e})=>({...e,x:0}),yi=({transform:e,activeNodeRect:t,windowRect:n})=>t&&n?function(e,t,n){const r={...e};return t.top+e.y<=n.top?r.y=n.top-t.top:t.bottom+e.y>=n.top+n.height&&(r.y=n.top+n.height-t.bottom),t.left+e.x<=n.left?r.x=n.left-t.left:t.right+e.x>=n.left+n.width&&(r.x=n.left+n.width-t.right),r}(e,t,n):e,wi=(0,A.createElement)("svg",{width:"18",height:"18",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18"},(0,A.createElement)("path",{d:"M5 4h2V2H5v2zm6-2v2h2V2h-2zm-6 8h2V8H5v2zm6 0h2V8h-2v2zm-6 6h2v-2H5v2zm6 0h2v-2h-2v2z"}));function Ei(e){let{label:t,setNodeRef:n,listeners:r}=e;return t=t||(0,$.__)("Reorder instructor","lifterlms"),(0,A.createElement)(q.Button,Q({isSmall:!0,showTooltip:!0,label:t,icon:wi,ref:n,className:"llms-drag-handle"},r))}function xi(e){let{id:t,index:n,item:r,isDragging:l,dragHandle:s,ListItem:o,itemClassName:i="",manageState:a,extraProps:c={}}=e;const{attributes:u,listeners:d,setNodeRef:p,transform:m,transition:f}=gi({id:t}),h={transform:Rs.Transform.toString(m),transition:f};return l&&m&&m.scaleX&&m.scaleY&&(m.scaleX=.9,m.scaleY=.9),l&&(i+=" llms-is-dragging"),(0,A.createElement)("div",Q({style:h,ref:s?void 0:p,className:`llms-sortable-list--item ${i}`},u,s?{}:d),(0,A.createElement)(o,{id:t,item:r,index:n,isDragging:l,setNodeRef:p,listeners:d,manageState:a,extraProps:c}))}function Ci(e){let{ListItem:t,manageState:n,items:r=[],sortableStrategy:l=ii,ctxModifiers:s=[_i,yi],dragHandle:o=!0,listClassName:i="",itemClassName:a="",extraProps:c={}}=e;const[u,d]=(0,A.useState)(!1),p=function(...e){return(0,J.useMemo)((()=>[...e].filter((e=>null!=e))),[...e])}(Vo(Wo),Vo(zo,{coordinateGetter:bi}));return(0,A.createElement)(ei,{sensors:p,collisionDetection:Qs,onDragStart:function(e){d(e.active.id)},onDragEnd:function(e){d(!1);const{active:t,over:l}=e;if(t.id!==l.id){const e=(0,Fr.findIndex)(r,{id:t.id}),s=(0,Fr.findIndex)(r,{id:l.id});n.updateItems(ri(r,e,s))}},modifiers:s},(0,A.createElement)("div",{className:`llms-sortable-list ${i}`},(0,A.createElement)(ui,{items:r,strategy:l},r.map(((e,r)=>(0,A.createElement)(xi,{id:e.id,key:e.id,index:r,item:e,isDragging:e.id===u,dragHandle:o,ListItem:t,itemClassName:a,manageState:n,extraProps:c}))))))}function ki(e){let{id:t,item:n,extraProps:r,manageState:l,listeners:s,setNodeRef:o}=e;const{showKeys:i,type:a,optionCount:c}=r,{updateItem:u,deleteItem:d}=l;return(0,A.createElement)(A.Fragment,null,(0,A.createElement)(Ei,{label:(0,$.__)("Reorder option","lifterlms"),setNodeRef:o,listeners:s}),(0,A.createElement)(q.Tooltip,{text:(0,$.__)("Make default","lifterlms")},(0,A.createElement)("div",{className:"llms-field-opt-default-wrap"},"checkbox"===a&&(0,A.createElement)((()=>(0,A.createElement)(q.CheckboxControl,{className:"llms-field-opt-default",checked:"yes"===n.default,onChange:e=>{u(t,{...n,default:!0===e?"yes":"no"})},tabIndex:"-1"})),null),"checkbox"!==a&&(0,A.createElement)((()=>(0,A.createElement)(q.RadioControl,{className:"llms-field-opt-default",selected:n.default,onChange:e=>{u(t,{...n,default:e})},options:[{label:"",value:"yes"}],tabIndex:"-1"})),null))),(0,A.createElement)("div",{className:"llms-field-opt-text-wrap"},(0,A.createElement)(q.TextControl,{className:"llms-field-opt-text",value:n.text,onChange:e=>u(t,{...n,text:e}),placeholder:(0,$.__)("Option label","lifterlms")}),i&&(0,A.createElement)("div",{className:"llms-field-opt-db-key"},(0,A.createElement)(q.Tooltip,{text:(0,$.__)("Database key value","lifterlms")},(0,A.createElement)(q.Dashicon,{icon:"database"})),(0,A.createElement)(q.TextControl,{className:"llms-field-opt-text ",value:n.key,onChange:e=>u(t,{...n,key:e}),placeholder:(0,$.__)("Database key value","lifterlms")}))),c>1&&(0,A.createElement)("div",{className:"llms-del-field-opt-wrap"},(0,A.createElement)(q.Button,{style:{flex:1},icon:"trash",label:(0,$.__)("Delete Option","lifterlms"),onClick:()=>d(t),tabIndex:"-1",isSmall:!0})))}class Si extends A.Component{constructor(){super(...arguments),Y(this,"addOption",(()=>{const{options:e}=this.state,{length:t}=e,[n,r]=this.getUniqueKeyNumber(t+1),l={key:n,id:xs(), -// Translators: %d = Option index in the list of options. -text:(0,$.sprintf)((0,$.__)("Option %d","lifterlms"),r),default:"no"};e.push(l),this.updateOptions(e)})),Y(this,"getManageState",(()=>({createItem:this.addOption,deleteItem:this.removeOption,updateItem:this.updateOption,updateItems:this.updateOptions}))),Y(this,"getUniqueKeyNumber",(e=>{const t=e=>{const{options:t}=this.state;return-1===t.findIndex((t=>{let{key:n}=t;return n===e}))};// Translators: %d = Option index in the list of options. -let n=(0,$.sprintf)((0,$.__)("option_%d","lifterlms"),e);for(;!t(n);)[n,e]=this.getUniqueKeyNumber(++e);return[n,e]})),Y(this,"updateOption",((e,t)=>{const{options:n}=this.state,{field:r}=this.props.attributes,l="yes"===t.default&&"checkbox"!==r,s=n.map((n=>(e===n.id?n={...n,...t}:l&&(n={...n,default:"no"}),n)));this.updateOptions(s)})),Y(this,"updateOptions",(e=>{const{setAttributes:t}=this.props;this.setState({options:e}),t({options:e.map((e=>{let{id:t,...n}=e;return n}))})})),Y(this,"removeOption",(e=>{const{options:t}=this.state,{field:n}=this.props.attributes;let r=null;if("checkbox"!==n){const n=t.find((t=>{let{id:n}=t;return n===e}));r="yes"===n.default}this.updateOptions(t.filter((t=>{let{id:n}=t;return n!==e})).map(((e,t)=>(r&&0===t&&(e={...e,default:"yes"}),e))))}));const{options:e}=this.props.attributes;this.state={showKeys:!1,options:e.map((e=>({...e,id:xs()})))}}render(){const{props:e,state:t}=this,{attributes:n}=e,{id:r,field:l}=n,{options:s,showKeys:o}=t,{length:i}=s;return(0,A.createElement)(q.BaseControl,{id:r,label:(0,$.__)("Options","lifterlms")},(0,A.createElement)(Ci,{ListItem:ki,items:s,itemClassName:"llms-field-option",manageState:this.getManageState(),extraProps:{type:l,showKeys:o,optionCount:i}}),(0,A.createElement)("div",{className:"llms-field-options--footer"},(0,A.createElement)(q.Button,{isSecondary:!0,onClick:this.addOption},(0,$.__)("Add option","lifterlms")),(0,A.createElement)(q.Button,{isTertiary:!0,onClick:()=>this.setState({showKeys:!o})},o?(0,$.__)("Hide keys","lifterlms"):(0,$.__)("Show keys","lifterlms"))))}}class Oi extends A.Component{constructor(e){super(e),this.state={validationErrors:{}}}getBlockByFieldId(e){const t=Kr().filter((t=>e===t.attributes.id));return!!t&&t[0]}getColumnsOptions(e){let t=[];return e&&(!e||e["llms/fieldGroup/fieldLayout"]&&"stacked"!==e["llms/fieldGroup/fieldLayout"])||t.push({value:12,label:(0,$.__)("100%","lifterlms")}),t=t.concat([{value:9,label:(0,$.__)("75%","lifterlms")},{value:8,label:(0,$.__)("66.66%","lifterlms")},{value:6,label:(0,$.__)("50%","lifterlms")},{value:4,label:(0,$.__)("33.33%","lifterlms")},{value:3,label:(0,$.__)("25%","lifterlms")}]),t}getMatchFieldOptions(){const{clientId:e,name:t}=this.props;return[{value:"",label:(0,$.__)("Select a field","lifterlms")}].concat(Kr().filter((n=>n.clientId!==e&&-1!==t.indexOf("llms/form-field-"))).map((e=>{const{id:t,label:n}=e.attributes;return{value:t,label:`${n} (${t})`}})))}hasInspectorSupport(){const{inspectorSupports:e}=this.props;return Object.keys(e).filter((t=>e[t])).length>=1}hasInspectorControlSupport(e){const{inspectorSupports:t}=this.props;return t[e]}canTransformToGroup(e){return!(!e||this.isInAConfirmGroup(e))&&(0,Gr.getPossibleBlockTransformations)([e]).map((e=>{let{name:t}=e;return t})).includes("llms/form-field-confirm-group")}isInAConfirmGroup(e){return!!this.getParentGroupClientId(e)}getParentGroupClientId(e){if(!e)return!1;const{clientId:t}=e,{getBlockParentsByBlockName:n}=(0,jr.select)(j.store),r=n(t,"llms/form-field-confirm-group");return!!r.length&&r[0]}getBlockSiblings(e){const t=this.getParentGroupClientId(e);if(!t)return[];const{getBlock:n}=(0,jr.select)(j.store);return n(t).innerBlocks.filter((t=>{let{clientId:n}=t;return n!==e.clientId}))}getValidationErrText(e){let t="";const n=this.state.validationErrors[e];if(n)if(this.containsInvalidCharacters(n)) -// Translators: %s = user-submitted value. -t=(0,$.__)('The value "%s" contains invalid characters. Only letters, numbers, underscores, and hyphens are allowed.',"lifterlms");else switch(e){case"data_store_key": -// Translators: %s = user-submitted value. -t=(0,$.__)('The user meta key "%s" is not unique. Please choose a unique value.',"lifterlms");break;case"id": -// Translators: %s = user-submitted value. -t=(0,$.__)('The ID "%s" is not unique. Please choose a unique field ID.',"lifterlms");break;case"name": -// Translators: %s = user-submitted value. -t=(0,$.__)('The name "%s" is not unique. Please choose a globally unique field name.',"lifterlms");break;default: -// Translators: %s = user-submitted value. -t=(0,$.__)('The chosen value "%s" is invalid.',"lifterlms")}else t=(0,$.__)("The value cannot be blank.","lifterlms");return(0,$.sprintf)(t,n)}containsInvalidCharacters(e){return!!e.match(/[^A-Za-z0-9\-\_]/g)}setValidationError(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.setState({validationErrors:{...this.state.validationErrors,[e]:t}})}hasValidationErr(e){return"string"==typeof this.state.validationErrors[e]}ValidatedTextControl(e){let{parent:t,attrKey:n,label:r,help:l}=e;const{attributes:s}=t.props,o=s[n],i=t.hasValidationErr(n),a=i?"llms-invalid-control":"";return(0,A.createElement)("div",{className:a},(0,A.createElement)(q.TextControl,{label:r,help:l,value:o,onChange:e=>t.updateValueWithValidation(n,e,"name"===n?"global":"local")}),i&&(0,A.createElement)("p",{className:"llms-invalid-control--msg"},t.getValidationErrText(n)))}updateValueWithValidation(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"local";const{clientId:r,attributes:l,setAttributes:s}=this.props,{name:o}=l,i=l[e],{editField:a,renameField:c}=(0,jr.dispatch)(wl),{lockPostSaving:u,unlockPostSaving:d}=(0,jr.dispatch)(qr.store),p=`llms-${e}-validation-err-${r}-${o}`;if(t===i)return;const m=!t,f=this.containsInvalidCharacters(t),h=ms(t,e,n),g=!m&&!f&&h;if(this.setValidationError(e),d(p),!g){if(this.setValidationError(e,t),m)return;u(p)}"name"===e?(h||(t=t.slice(0,-1)),c(l.name,t)):a(l.name,{[e]:t}),s({[e]:t})}render(){if(!this.hasInspectorSupport())return"";const{attributes:e,setAttributes:t,clientId:n,context:r}=this.props,l=(0,jr.select)(j.store).getBlock(n),{required:s,placeholder:o,columns:i,isConfirmationField:a,isConfirmationControlField:c}=e,u=this.canTransformToGroup(l),d=this.isInAConfirmGroup(l);return(0,A.createElement)(A.Fragment,null,(0,A.createElement)(j.InspectorControls,null,(0,A.createElement)(q.PanelBody,null,!a&&this.hasInspectorControlSupport("required")&&(0,A.createElement)(q.ToggleControl,{className:"llms-required-field-toggle",label:(0,$.__)("Required","lifterlms"),checked:!!s,onChange:()=>t({required:!s}),help:s?(0,$.__)("Field is required.","lifterlms"):(0,$.__)("Field is optional.","lifterlms")}),(0,A.createElement)(q.SelectControl,{className:"llms-field-width-select",label:(0,$.__)("Field Width","lifterlms"),onChange:e=>{e=parseInt(e,10),t({columns:e});const n=this.getBlockSiblings(l);if(n.length&&e+n[0].attributes.columns>12){const{updateBlockAttributes:t}=(0,jr.dispatch)(j.store);t(n[0].clientId,{columns:12-e})}},help:(0,$.__)("Determines the width of the form field.","lifterlms"),value:i,options:this.getColumnsOptions(r)}),this.hasInspectorControlSupport("options")&&(0,A.createElement)(Si,{attributes:e,setAttributes:t}),this.hasInspectorControlSupport("placeholder")&&(0,A.createElement)(q.TextControl,{label:(0,$.__)("Placeholder","lifterlms"),value:o,onChange:e=>t({placeholder:e}),help:(0,$.__)("Displays a placeholder option as the selected instead of a default value.","lifterlms")}),(u||c&&d)&&(0,A.createElement)(q.ToggleControl,{className:"llms-confirmation-field-toggle",label:(0,$.__)("Confirmation Field","lifterlms"),checked:d,onChange:()=>{const{replaceBlock:e,selectBlock:t}=(0,jr.dispatch)(j.store),{findControllerBlockIndex:r}=(0,Gr.getBlockType)("llms/form-field-confirm-group"),{getBlock:s}=(0,jr.select)(j.store);let o=n,i="llms/form-field-confirm-group",a=l,c=null;d&&(o=this.getParentGroupClientId(l),a=s(o),i=l.name);const u=(0,Gr.switchToBlockType)(a,i);if(e(o,u),d)c=u[0].clientId;else{const{innerBlocks:e}=u[0];c=e[r(e)].clientId}t(c)},help:d?(0,$.__)("A Confirmation field is active.","lifterlms"):(0,$.__)("No confirmation field.","lifterlms")}),this.hasInspectorControlSupport("customFill")&&(0,A.createElement)(q.Slot,{name:`llmsInspectorControlsFill.${this.hasInspectorControlSupport("customFill")}.${n}`})),!a&&this.hasInspectorControlSupport("storage")&&(0,A.createElement)(q.PanelBody,{title:(0,$.__)("Data Storage","lifterlms")},(0,A.createElement)(this.ValidatedTextControl,{parent:this,attrKey:"data_store_key",label:(0,$.__)("Usermeta Key","lifterlms"),help:(0,$.__)("Database field key name. Only accepts alphanumeric characters, hyphens, and underscores.","lifterlms")}))),(0,A.createElement)(j.InspectorAdvancedControls,null,!a&&this.hasInspectorControlSupport("name")&&(0,A.createElement)(this.ValidatedTextControl,{parent:this,attrKey:"name",label:(0,$.__)("Field Name","lifterlms"),help:(0,$.__)("The field's HTML name attribute.","lifterlms")}),!a&&this.hasInspectorControlSupport("id")&&(0,A.createElement)(this.ValidatedTextControl,{parent:this,attrKey:"id",label:(0,$.__)("Field ID","lifterlms"),help:(0,$.__)("The field's HTML id attribute.","lifterlms")})))}}function Ii(e){const t=function(e){const{getBlock:t,getBlockParentsByBlockName:n}=(0,jr.select)("core/block-editor");return t(n(e,function(){const{getBlockTypes:e,hasBlockSupport:t}=(0,jr.select)("core/blocks");return e().filter((e=>t(e,"llms_field_group")))}().map((e=>{let{name:t}=e;return t}))))}(e);return t&&t.innerBlocks.length?(0,Fr.find)(t.innerBlocks,(t=>t.clientId!==e)):null}function Ti(){let{setAttributes:e,currentUpdates:t,siblingClientId:n,siblingUpdates:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{updateBlockAttributes:l}=(0,jr.dispatch)("core/block-editor");setTimeout((()=>{(0,Fr.isEmpty)(t)||e(t),n&&!(0,Fr.isEmpty)(r)&&l(n,r)}))}function Pi(e,t){const n={};return e.required!==t.required&&(n.required=e.required),e.field!==t.field&&(n.field=e.field),{currentUpdates:{},siblingUpdates:n}}function Mi(e){const{attributes:t,block:n,setAttributes:r}=e,{fieldLayout:l}=t,{innerBlocks:s}=n;return(0,A.createElement)(q.RadioControl,{label:(0,$.__)("Field Layout","lifterlms"),selected:l,onChange:e=>function(e){let{fieldLayout:t,setAttributes:n,innerBlocks:r}=e;const{updateBlockAttributes:l}=(0,jr.dispatch)(j.store);n({fieldLayout:t});const s="columns"===t?6:12;r.forEach(((e,n)=>{let{clientId:r}=e,o=1===n;0===n&&"stacked"===t&&(o=!0),l(r,{columns:s,last_column:o})}))}({fieldLayout:e,setAttributes:r,innerBlocks:s}),options:[{value:"columns",label:(0,$.__)("Columns","lifterlms")},{value:"stacked",label:(0,$.__)("Stacked","lifterlms")}]})}const Di=e=>{const{getCurrentPostId:t}=(0,jr.select)("core/editor");return(0,Fr.snakeCase)((0,Fr.uniqueId)(`${e}_${t()}_`))},Li=e=>(0,Fr.kebabCase)(e),Ri={apiVersion:2,icon:{foreground:"currentColor"},category:"llms-user-info-fields",keywords:[(0,$.__)("LifterLMS","lifterlms"),"llms"],attributes:{},supports:{llms_visibility:!0},example:{},fillInspectorControls(e,t,n){},fillEditAfter(e,t,n){}},Vi={attributes:{description:{type:"string",__default:""},field:{type:"string",__default:"text"},required:{type:"boolean",__default:!1},label:{type:"string",__default:""},label_show_empty:{type:"string",__default:!1},match:{type:"string",__default:""},options:{type:"array",__default:[]},options_preset:{type:"string",__default:""},placeholder:{type:"string",__default:""},columns:{type:"integer",__default:12},last_column:{type:"boolean",__default:!0},name:{type:"string",__default:""},id:{type:"string",__default:""},data_store:{type:"string",__default:"usermeta"},data_store_key:{type:"string",__default:""},html_attrs:{type:"object",__default:{}},isConfirmationField:{type:"boolean",__default:!1},isConfirmationControlField:{type:"boolean",__default:!1}},supports:{llms_field_inspector:{id:!0,name:!0,options:!1,placeholder:!1,required:!0,customFill:!1,storage:!0},llms_edit_fill:{after:!1},llms_field_group:!1},edit:function(e){let{attributes:t}=e,n=!0;const{name:r}=e,l=(0,Gr.getBlockType)(r),{clientId:s,context:o,setAttributes:i}=e,a=l.supports.llms_field_inspector,c=l.supports.llms_edit_fill,{fillEditAfter:u,fillInspectorControls:d}=l,{getSelectedBlockClientId:p}=(0,jr.select)(j.store),{isDuplicate:m}=(0,jr.select)(wl),f=!!o["llms/fieldGroup/fieldLayout"],h=t.name&&m(t.name,s)&&0!==r.indexOf("llms/form-field-user-"),g=!f&&t.isConfirmationField;g&&(n=!1),t=n?((e,t,n)=>{if(Object.keys(t).forEach((n=>{const r=t[n].__default;void 0!==r&&void 0===e[n]&&(e[n]=r)})),!e.name||n&&!e.isConfirmationField){let t=Di(e.field);for(;!ms("name",t);)t=Di(e.field);e.name=t}if(!e.id||n&&!e.isConfirmationField){let t=Li(e.name);for(;!ms("id",t,"local");)t=Li((0,Fr.uniqueId)(`${e.field}-field-`));e.id=t}return(""===e.data_store_key||n&&!e.isConfirmationField)&&(e.data_store_key=e.name),e})(t,l.attributes,h):t,f&&n&&function(){let{attributes:e,clientId:t,setAttributes:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=Ii(t);let l={},s={};if(!r)return;const o=r.clientId;if(e.isConfirmationControlField||e.isConfirmationField){const t=Pi(e,r.attributes);l=(0,Fr.merge)(l,t.currentUpdates),s=(0,Fr.merge)(s,t.siblingUpdates)}Ti({setAttributes:n,currentUpdates:l,siblingClientId:o,siblingUpdates:s})}(e);const v=(0,j.useBlockProps)({className:`llms-fields llms-cols-${t.columns}`});return(0,A.useEffect)((()=>{if(l.variations&&l.variations.length&&s===p()){const e=setInterval((()=>{const n=document.querySelector(".block-editor-block-inspector .block-editor-block-variation-transforms");return n&&(n.style.display=t.isConfirmationField?"none":"inline-block",clearInterval(e)),()=>{clearInterval(e)}}),10)}})),g?(setTimeout((()=>{(0,jr.dispatch)(j.store).removeBlock(s)}),10),null):(0,A.createElement)("div",v,(0,A.createElement)(Oi,{attributes:t,clientId:s,name:r,setAttributes:i,inspectorSupports:a,context:o}),(0,A.createElement)(hs,{attributes:t,setAttributes:i,block:l,clientId:s,context:o}),a.customFill&&(0,A.createElement)(q.Fill,{name:`llmsInspectorControlsFill.${a.customFill}.${s}`},d(t,i,e)),c.after&&(0,A.createElement)(q.Fill,{name:`llmsEditFill.after.${c.after}.${s}`},u(t,i,e)))},save:function(e){const{attributes:t}=e;return t}},Ni={attributes:{fieldLayout:{type:"string",default:"columns"}},supports:{llms_field_group:!0,llms_field_inspector:!1},providesContext:{"llms/fieldGroup/fieldLayout":"fieldLayout"},llmsInnerBlocks:{template:[],allowed:[],lock:"insert"},edit:function(e){const{attributes:t,clientId:n,name:r,setAttributes:l}=e,{fieldLayout:s}=t,{getBlock:o}=(0,jr.select)(j.store),i=o(n),a=(0,Gr.getBlockType)(r),{allowed:c,template:u,lock:d}=a.llmsInnerBlocks,p=i&&i.innerBlocks.length&&"llms/form-field-confirm-group"===i.name?i.innerBlocks[a.findControllerBlockIndex(i.innerBlocks)]:null,m=p?(0,Gr.getBlockType)(p.name):null,f=m?m.supports.llms_edit_fill:{after:!1},h=a.supports.llms_field_inspector,g=a.providesContext&&a.providesContext["llms/fieldGroup/fieldLayout"];let v="columns"===s?"horizontal":"vertical";return g||(v="vertical"),(0,A.createElement)("div",(0,j.useBlockProps)(),(0,A.createElement)(j.InspectorControls,null,(0,A.createElement)(q.PanelBody,null,g&&(0,A.createElement)(Mi,Q({},e,{block:i})),h.customFill&&a.fillInspectorControls(t,l,e))),(0,A.createElement)("div",{className:"llms-field-group","data-field-layout":g?s:"stacked"},(0,A.createElement)(j.InnerBlocks,{allowedBlocks:c,template:"function"==typeof u?u({attributes:t,clientId:n,block:i,blockType:a}):u,templateLock:d,orientation:v})),f.after&&(0,A.createElement)(q.Slot,{name:`llmsEditFill.after.${f.after}.${p.clientId}`}))},save:function(){return(0,A.createElement)(j.InnerBlocks.Content,null)}},Ai=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"field";const t="field"===e?Vi:Ni;return(0,Fr.merge)({},(0,Fr.cloneDeep)(Ri),t)};function Fi(){return(0,Fr.cloneDeep)(["llms_form","wp_block"])}function Bi(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];e=(0,Fr.cloneDeep)(e);for(let t=0;t0&&void 0!==arguments[0]?arguments[0]:2,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const n=[];for(let r=1;r<=e;r++)n.push({default:t&&t>0?"yes":"no", -// Translators: %d = Option index in the list of options. -text:(0,$.sprintf)((0,$.__)("Option %d","lifterlms"),r), -// Translators: %d = Option index in the list of options. -key:(0,$.sprintf)((0,$.__)("option_%d","lifterlms"),r)}),t--;return n}const zi=(0,A.createElement)(q.SVG,{className:"llms-block-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512"},(0,A.createElement)(q.Path,{d:"M32 288c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 288zm0-128c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 160z"})),$i="llms/form-field-confirm-group",Ui=Fi(),ji=!0;function qi(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{id:t}=e;let{match:n}=e;return t&&!n&&(n=`${t}_confirm`),{...e,match:n,columns:6,last_column:!1,isConfirmationControlField:!0,llms_visibility:"off"}}function Gi(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{id:t,name:n,match:r}=e;return t&&!r&&(r=t,t=`${t}_confirm`,n=`${n}_confirm`),{...e,id:t,name:n,match:r,label:e.label?// Translators: %s label of the controller field. -(0,$.sprintf)((0,$.__)("Confirm %s","lifterlms"),e.label):"",columns:6,last_column:!0,data_store:!1,data_store_key:!1,isConfirmationField:!0,llms_visibility:"off"}}function Wi(e){const{unloadField:t}=(0,jr.dispatch)(wl);t(e)}const Ki=["llms/form-field-text","llms/form-field-user-email","llms/form-field-user-login","llms/form-field-user-password"],Yi={from:[],to:[]};Ki.forEach((e=>{Yi.from.push({type:"block",blocks:[e],transform:t=>{Wi(t.name);const{llms_visibility:n}=t,r=qi(t),l=Gi(t),s=[(0,Gr.createBlock)(e,r),(0,Gr.createBlock)("llms/form-field-text",l)];return(0,Gr.createBlock)($i,{llms_visibility:n},(0,$.isRTL)()?s.reverse():s)}}),Yi.to.push({type:"block",blocks:[e],isMatch:()=>{const{getSelectedBlock:t}=(0,jr.select)(j.store),{innerBlocks:n}=t(),r=n[Xi(n)],{name:l}=r||{};return l===e},transform:(e,t)=>{const{llms_visibility:n}=e,r=t[Xi(t)],{name:l,attributes:s}=r;return Wi(s.name),(0,Gr.createBlock)(l,{...s,columns:12,last_column:!0,isConfirmationControlField:!1,match:"",llms_visibility:n})}})}));const Xi=e=>e.findIndex((e=>{let{attributes:t}=e;return t.isConfirmationControlField})),Qi=Bi(Ai("group"),{title:(0,$.__)("Input Confirmation Group","lifterlms"),description:(0,$.__)("Adds a required confirmation field to an input field.","lifterlms"),icon:zi,category:"llms-custom-fields",transforms:Yi,fillInspectorControls:(e,t,n)=>{const{clientId:r}=n;return(0,A.createElement)(q.Button,{isDestructive:!0,onClick:()=>function(e){const{getBlock:t}=(0,jr.select)(j.store),{replaceBlock:n}=(0,jr.dispatch)(j.store),r=t(e),{innerBlocks:l}=r,{llms_visibility:s}=r.attributes,{name:o,attributes:i}=l[Xi(l)];Wi(i.name),n(e,(0,Gr.createBlock)(o,{...i,columns:12,last_column:!0,isConfirmationControlField:!1,match:"",llms_visibility:s}))}(r)},(0,$.__)("Remove confirmation field","lifterlms"))},findControllerBlockIndex:Xi,supports:{llms_field_inspector:{customFill:"confirmGroupAdditionalControls"},inserter:!1},llmsInnerBlocks:{allowed:Ki,template:e=>{let{block:t}=e,n=null;return t&&t.innerBlocks.length||(n=[["llms/form-field-text",qi()],["llms/form-field-text",Gi()]]),n}}}),Zi=(0,A.createElement)(F.SVG,{className:"llms-block-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512"},(0,A.createElement)(F.Path,{d:"M64 80c-8.8 0-16 7.2-16 16V416c0 8.8 7.2 16 16 16H384c8.8 0 16-7.2 16-16V96c0-8.8-7.2-16-16-16H64zM0 96C0 60.7 28.7 32 64 32H384c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96zM337 209L209 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L303 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"})),Ji="llms/form-field-checkboxes",ea=Fi(),ta=!1,na=Bi(Ai(),{title:(0,$.__)("Checkboxes","lifterlms"),description:(0,$.__)("A single checkbox toggle or a group of multiple checkboxes.","lifterlms"),icon:Zi,category:"llms-custom-fields",supports:{llms_field_inspector:{options:!0}},attributes:{field:{__default:"checkbox"},options:{__default:Hi(2,0)}},transforms:{from:[{type:"block",blocks:["llms/form-field-radio","llms/form-field-select"],transform:e=>(0,Gr.createBlock)(Ji,{...e,field:na.attributes.field.__default})}]}}),ra=(0,A.createElement)(F.SVG,{className:"llms-block-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},(0,A.createElement)(F.Path,{d:"M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm256-96a96 96 0 1 1 0 192 96 96 0 1 1 0-192z"})),la="llms/form-field-radio",sa=Fi(),oa=!1,ia=Bi(na,{title:(0,$.__)("Radio","lifterlms"),description:(0,$.__)("A group of radio inputs which can be populated with any number of options.","lifterlms"),icon:ra,attributes:{field:{__default:"radio"},options:{__default:Hi(2,1)}},transforms:{from:[{type:"block",blocks:["llms/form-field-checkboxes","llms/form-field-select"],transform:e=>(0,Gr.createBlock)(la,{...e,field:ia.attributes.field.__default})}]}}),aa=(0,A.createElement)(q.SVG,{className:"llms-block-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512"},(0,A.createElement)(q.Path,{d:"M384 432c8.8 0 16-7.2 16-16l0-320c0-8.8-7.2-16-16-16L64 80c-8.8 0-16 7.2-16 16l0 320c0 8.8 7.2 16 16 16l320 0zm64-16c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 320zM224 352c-6.7 0-13-2.8-17.6-7.7l-104-112c-6.5-7-8.2-17.2-4.4-25.9s12.5-14.4 22-14.4l208 0c9.5 0 18.2 5.7 22 14.4s2.1 18.9-4.4 25.9l-104 112c-4.5 4.9-10.9 7.7-17.6 7.7z"})),ca="llms/form-field-select",ua=Fi(),da=!1,pa=Bi(ia,{title:(0,$.__)("Dropdown","lifterlms"),description:(0,$.__)("A select field which can be populated with any number of options.","lifterlms"),icon:aa,attributes:{field:{__default:"select"}},supports:{llms_field_inspector:{placeholder:!0}},transforms:{from:[{type:"block",blocks:["llms/form-field-checkboxes","llms/form-field-radio"],transform:e=>(0,Gr.createBlock)(ca,{...e,field:pa.attributes.field.__default})}]}}),ma=(0,A.createElement)(q.SVG,{className:"llms-block-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},(0,A.createElement)(q.Path,{d:"M448 0h-384c-8.832 0-16 7.168-16 16v96c0 8.832 7.168 16 16 16h16c8.832 0 16-7.168 16-16l32-48h96v384l-80 32c-8.832 0-16 7.152-16 16s7.168 16 16 16h224c8.848 0 16-7.152 16-16s-7.152-16-16-16l-80-32v-384h96l32 48c0 8.832 7.152 16 16 16h16c8.848 0 16-7.168 16-16v-96c0-8.832-7.152-16-16-16z"})),fa=(0,A.createElement)(F.SVG,{className:"llms-block-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512"},(0,A.createElement)(F.Path,{d:"M181.3 32.4c17.4 2.9 29.2 19.4 26.3 36.8L197.8 128h95.1l11.5-69.3c2.9-17.4 19.4-29.2 36.8-26.3s29.2 19.4 26.3 36.8L357.8 128H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H347.1L325.8 320H384c17.7 0 32 14.3 32 32s-14.3 32-32 32H315.1l-11.5 69.3c-2.9 17.4-19.4 29.2-36.8 26.3s-29.2-19.4-26.3-36.8l9.8-58.7H155.1l-11.5 69.3c-2.9 17.4-19.4 29.2-36.8 26.3s-29.2-19.4-26.3-36.8L90.2 384H32c-17.7 0-32-14.3-32-32s14.3-32 32-32h68.9l21.3-128H64c-17.7 0-32-14.3-32-32s14.3-32 32-32h68.9l11.5-69.3c2.9-17.4 19.4-29.2 36.8-26.3zM187.1 192L165.8 320h95.1l21.3-128H187.1z"})),ha=(0,A.createElement)(q.SVG,{className:"llms-block-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},(0,A.createElement)(q.Path,{d:"M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48H48zM0 176V384c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V176L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"})),ga=(0,A.createElement)(F.SVG,{className:"llms-block-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512"},(0,A.createElement)(F.Path,{d:"M144 144v48H304V144c0-44.2-35.8-80-80-80s-80 35.8-80 80zM80 192V144C80 64.5 144.5 0 224 0s144 64.5 144 144v48h16c35.3 0 64 28.7 64 64V448c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V256c0-35.3 28.7-64 64-64H80z"})),va=(0,A.createElement)(F.SVG,{className:"llms-block-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},(0,A.createElement)(F.Path,{d:"M164.9 24.6c-7.7-18.6-28-28.5-47.4-23.2l-88 24C12.1 30.2 0 46 0 64C0 311.4 200.6 512 448 512c18 0 33.8-12.1 38.6-29.5l24-88c5.3-19.4-4.6-39.7-23.2-47.4l-96-40c-16.3-6.8-35.2-2.1-46.3 11.6L304.7 368C234.3 334.7 177.3 277.7 144 207.3L193.3 167c13.7-11.2 18.4-30 11.6-46.3l-40-96z"})),ba=(0,A.createElement)(q.SVG,{className:"llms-block-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 640 512"},(0,A.createElement)(q.Path,{d:"M579.8 267.7c56.5-56.5 56.5-148 0-204.5c-50-50-128.8-56.5-186.3-15.4l-1.6 1.1c-14.4 10.3-17.7 30.3-7.4 44.6s30.3 17.7 44.6 7.4l1.6-1.1c32.1-22.9 76-19.3 103.8 8.6c31.5 31.5 31.5 82.5 0 114L422.3 334.8c-31.5 31.5-82.5 31.5-114 0c-27.9-27.9-31.5-71.8-8.6-103.8l1.1-1.6c10.3-14.4 6.9-34.4-7.4-44.6s-34.4-6.9-44.6 7.4l-1.1 1.6C206.5 251.2 213 330 263 380c56.5 56.5 148 56.5 204.5 0L579.8 267.7zM60.2 244.3c-56.5 56.5-56.5 148 0 204.5c50 50 128.8 56.5 186.3 15.4l1.6-1.1c14.4-10.3 17.7-30.3 7.4-44.6s-30.3-17.7-44.6-7.4l-1.6 1.1c-32.1 22.9-76 19.3-103.8-8.6C74 372 74 321 105.5 289.5L217.7 177.2c31.5-31.5 82.5-31.5 114 0c27.9 27.9 31.5 71.8 8.6 103.9l-1.1 1.6c-10.3 14.4-6.9 34.4 7.4 44.6s34.4 6.9 44.6-7.4l1.1-1.6C433.5 260.8 427 182 377 132c-56.5-56.5-148-56.5-204.5 0L60.2 244.3z"})),_a=Ai(),ya="llms/form-field-text",wa=Fi(),Ea=!0,xa=[{name:"text",title:(0,$.__)("Text","lifterlms"),description:(0,$.__)("An input field which accepts any form of text.","lifterlms"),isDefault:!0,icon:ma},{name:"email",title:(0,$.__)("Email","lifterlms"),description:(0,$.__)("A text input field which only accepts an email address.","lifterlms"),icon:ha},{name:"password",title:(0,$.__)("Password","lifterlms"),description:(0,$.__)("User password confirmation field.","lifterlms"),icon:ga,scope:[]},{name:"number",title:(0,$.__)("Number","lifterlms"),description:(0,$.__)("An input field which only accepts numeric input.","lifterlms"),icon:fa,attributes:{html_attrs:{min:"",max:""}}},{name:"tel",title:(0,$.__)("Phone Number","lifterlms"),description:(0,$.__)("An input field which only accepts phone numbers.","lifterlms"),icon:va},{name:"url",title:(0,$.__)("Website Address / URL","lifterlms"),description:(0,$.__)("An input field which only accepts a website address or URL.","lifterlms"),icon:ba}];xa.forEach((e=>{e.scope=e.scope||["block","inserter","transform"],window.llmsBlocks.variationIconCanBeObject&&(e.icon={..._a.icon,src:e.icon}),e.attributes||(e.attributes={}),e.attributes.field=e.name,e.isActive=(e,t)=>e.field===t.field}));const Ca=Bi(_a,{title:(0,$.__)("Text","lifterlms"),description:(0,$.__)("A simple text input field.","lifterlms"),icon:ma,usesContext:["llms/fieldGroup/fieldLayout"],supports:{inserter:!1,llms_field_inspector:{customFill:"fieldTextAdditionalControls"}},variations:xa,fillInspectorControls:(e,t)=>{if(e.isConfirmationField||"number"!==e.field)return;const{html_attrs:n}=e,{min:r,max:l}=n;return(0,A.createElement)(A.Fragment,null,(0,A.createElement)(q.TextControl,{label:(0,$.__)("Minimum Value","lifterlms"),help:(0,$.__)("Specify the minimum allowed value. Leave blank for no minimum.","lifterlms"),value:r,type:"number",onChange:e=>t({html_attrs:{...n,min:e}})}),(0,A.createElement)(q.TextControl,{label:(0,$.__)("Maximum Value","lifterlms"),help:(0,$.__)("Specify the maximum allowed value. Leave blank for no maximum.","lifterlms"),value:l,type:"number",onChange:e=>t({html_attrs:{...n,max:e}})}))}}),ka=(0,A.createElement)(q.SVG,{className:"llms-block-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512"},(0,A.createElement)(q.Path,{d:"M192 32h64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H384l0 352c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-352H288V448c0 17.7-14.3 32-32 32s-32-14.3-32-32V352H192c-88.4 0-160-71.6-160-160s71.6-160 160-160z"})),Sa="llms/form-field-textarea",Oa=!1,Ia=Bi(Ca,{title:(0,$.__)("Textarea","lifterlms"),description:(0,$.__)("A text field accepting multiple lines of user information.","lifterlms"),icon:ka,category:"llms-custom-fields",supports:{inserter:!0,llms_field_inspector:{customFill:"fieldTextarea"}},attributes:{field:{__default:"textarea"},html_attrs:{__default:{rows:4}}},fillInspectorControls:(e,t)=>{const{html_attrs:n}=e,{rows:r}=n;return(0,A.createElement)(q.TextControl,{label:(0,$.__)("Rows","lifterlms"),help:(0,$.__)("Specify the number of text rows for the textarea input.","lifterlms"),value:r,type:"number",onChange:e=>t({html_attrs:{...n,rows:e}}),min:"2",step:"1"})},transforms:{from:[{type:"block",blocks:["llms/form-field-text"],transform:e=>(0,Gr.createBlock)(Sa,{...e,html_attrs:{...e.html_attrs,rows:4},field:"textarea"})}],to:[{type:"block",blocks:["llms/form-field-text"],transform:e=>(0,Gr.createBlock)("llms/form-field-text",{...e,field:"text"})}]}},["transforms","variations"]),Ta=(0,A.createElement)(F.SVG,{className:"llms-block-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512"},(0,A.createElement)(F.Path,{d:"M64 64C28.7 64 0 92.7 0 128v64c0 8.8 7.4 15.7 15.7 18.6C34.5 217.1 48 235 48 256s-13.5 38.9-32.3 45.4C7.4 304.3 0 311.2 0 320v64c0 35.3 28.7 64 64 64H512c35.3 0 64-28.7 64-64V320c0-8.8-7.4-15.7-15.7-18.6C541.5 294.9 528 277 528 256s13.5-38.9 32.3-45.4c8.3-2.9 15.7-9.8 15.7-18.6V128c0-35.3-28.7-64-64-64H64zm64 112l0 160c0 8.8 7.2 16 16 16H432c8.8 0 16-7.2 16-16V176c0-8.8-7.2-16-16-16H144c-8.8 0-16 7.2-16 16zM96 160c0-17.7 14.3-32 32-32H448c17.7 0 32 14.3 32 32V352c0 17.7-14.3 32-32 32H128c-17.7 0-32-14.3-32-32V160z"})),Pa="llms/form-field-redeem-voucher",Ma=!0,Da=Bi(Ca,{title:(0,$.__)("Voucher Code Redemption","lifterlms"),description:(0,$.__)("Allows user to redeem a voucher code during account registration.","lifterlms"),icon:Ta,supports:{inserter:!0,multiple:!1,llms_field_inspector:{id:!1,name:!1,storage:!1,customFill:"redeemVoucher"}},attributes:{id:{__default:"llms_voucher"},field:{__default:"text"},label:{__default:(0,$.__)("Have a voucher?","lifterlms")},name:{__default:"llms_voucher"},placeholder:{__default:(0,$.__)("Voucher Code","lifterlms")},data_store:{__default:!1},data_store_key:{__default:!1},toggleable:{__default:!1}},fillInspectorControls:(e,t)=>{const{toggleable:n,required:r}=e;return r?null:(0,A.createElement)(q.ToggleControl,{label:(0,$.__)("Toggleable","lifterlms"),checked:!!n,onChange:()=>t({toggleable:!n}),help:n?(0,$.__)("Field is revealed when the toggle is clicked.","lifterlms"):(0,$.__)("Field is always visible.","lifterlms")})}},["transforms","variations"]),La=(0,A.createElement)(F.SVG,{className:"llms-block-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512"},(0,A.createElement)(F.Path,{d:"M192 0c-41.8 0-77.4 26.7-90.5 64H64C28.7 64 0 92.7 0 128V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V128c0-35.3-28.7-64-64-64H282.5C269.4 26.7 233.8 0 192 0zm0 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM128 256a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM80 432c0-44.2 35.8-80 80-80h64c44.2 0 80 35.8 80 80c0 8.8-7.2 16-16 16H96c-8.8 0-16-7.2-16-16z"})),Ra="llms/form-field-user-display-name",Va=!0,Na=Bi(Ca,{title:(0,$.__)("User Display Name","lifterlms"),description:(0,$.__)("Allows a user to choose how their name will be displayed publicly on the site.","lifterlms"),icon:La,supports:{inserter:!0,multiple:!1,llms_field_inspector:{id:!1,name:!1,required:!1,storage:!1}},attributes:{id:{__default:"display_name"},field:{__default:"text"},label:{__default:(0,$.__)("Display Name","lifterlms")},name:{__default:"display_name"},required:{__default:!0},data_store:{__default:"users"},data_store_key:{__default:"display_name"}}},["transforms","variations"]),Aa=(0,A.createElement)(F.SVG,{className:"llms-block-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},(0,A.createElement)(F.Path,{d:"M399 384.2C376.9 345.8 335.4 320 288 320H224c-47.4 0-88.9 25.8-111 64.2c35.2 39.2 86.2 63.8 143 63.8s107.8-24.7 143-63.8zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm256 16a72 72 0 1 0 0-144 72 72 0 1 0 0 144z"})),Fa="llms/form-field-user-login",Ba=!0,Ha=Bi(Ca,{title:(0,$.__)("User Login","lifterlms"),description:(0,$.__)("Field used to collect a user's account username. If this field is omitted a username will be automatically generated based off their email address. Users can always login using either their email address or username.","lifterlms"),icon:Aa,supports:{inserter:!0,multiple:!1,llms_field_inspector:{id:!1,name:!1,required:!1,storage:!1}},attributes:{id:{__default:"user_login"},field:{__default:"text"},label:{__default:(0,$.__)("Username","lifterlms")},name:{__default:"user_login"},required:{__default:!0},data_store:{__default:"users"},data_store_key:{__default:"user_login"},llms_visibility:{default:"logged_out"}}},["transforms","variations"]),za="llms/form-field-user-email",$a=!0,Ua=Bi(Ca,{title:(0,$.__)("User Email","lifterlms"),description:(0,$.__)("A special field used to collect a user's account email address.","lifterlms"),icon:ha,supports:{inserter:!0,multiple:!1,llms_field_inspector:{id:!1,name:!1,required:!1,storage:!1}},attributes:{id:{__default:"email_address"},field:{__default:"email"},label:{__default:(0,$.__)("Email Address","lifterlms")},name:{__default:"email_address"},required:{__default:!0},data_store:{__default:"users"},data_store_key:{__default:"user_email"}}},["transforms","variations"]),ja=(0,A.createElement)(F.SVG,{className:"llms-block-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512"},(0,A.createElement)(F.Path,{d:"M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512H418.3c16.4 0 29.7-13.3 29.7-29.7C448 383.8 368.2 304 269.7 304H178.3z"})),qa="llms/form-field-user-first-name",Ga=!0,Wa=Bi(Ca,{title:(0,$.__)("First Name","lifterlms"),description:(0,$.__)("A special field used to collect a user's first name.","lifterlms"),icon:ja,supports:{multiple:!1,llms_field_inspector:{id:!1,name:!1,required:!0,storage:!1}},attributes:{id:{__default:"first_name"},field:{__default:"text"},label:{__default:(0,$.__)("First Name","lifterlms")},name:{__default:"first_name"},required:{__default:!0},data_store:{__default:"usermeta"},data_store_key:{__default:"first_name"}},parent:["llms/form-field-user-name"],usesContext:["llms/fieldGroup/fieldLayout"]},["transforms","variations"]),Ka="llms/form-field-user-last-name",Ya=!0,Xa=Bi(Wa,{title:(0,$.__)("Last Name","lifterlms"),description:(0,$.__)("A special field used to collect a user's last name.","lifterlms"),attributes:{id:{__default:"last_name"},label:{__default:(0,$.__)("Last Name","lifterlms")},name:{__default:"last_name"},data_store_key:{__default:"last_name"}}}),Qa="llms/form-field-user-name",Za=Fi(),Ja=!0,ec=Bi(Ai("group"),{title:(0,$.__)("User name","lifterlms"),description:(0,$.__)("A special field used to collect a user's first and last name.","lifterlms"),icon:ja,supports:{inserter:!0,multiple:!1},llmsInnerBlocks:{allowed:["llms/form-field-user-first-name","llms/form-field-user-last-name"],template:[["llms/form-field-user-first-name",{columns:6,last_column:!1}],["llms/form-field-user-last-name",{columns:6,last_column:!0}]]}}),tc="llms/form-field-user-password",nc=!0;function rc(e,t){return{html_attrs:{...e,minlength:t}}}const lc=Bi(Ca,{title:(0,$.__)("User Password","lifterlms"),description:(0,$.__)("A special field used to collect a user's account password.","lifterlms"),icon:ga,supports:{inserter:!0,multiple:!1,llms_field_inspector:{id:!1,name:!1,required:!1,storage:!1,customFill:"userPassAdditionalControls"},llms_edit_fill:{after:"userPassStrengthMeter"}},attributes:{id:{__default:"password"},field:{__default:"password"},label:{__default:(0,$.__)("Password","lifterlms")},name:{__default:"password"},required:{__default:!0},data_store:{__default:"users"},data_store_key:{__default:"user_pass"},meter:{type:"boolean",__default:!0},meter_description:{type:"string",__default:(0,$.__)("A strong password is required with at least 8 characters. To make it stronger, use both upper and lower case letters, numbers, and symbols.","lifterlms")},min_strength:{type:"string",__default:"strong"},html_attrs:{__default:{minlength:8}}},fillEditAfter:(e,t)=>{const{meter:n,meter_description:r}=e;return n?(0,A.createElement)(A.Fragment,null,(0,A.createElement)("div",{className:"llms-pwd-meter"},(0,A.createElement)("div",null,(0,$.__)("Very Weak","lifterlms"))),(0,A.createElement)(j.RichText,{style:{marginTop:0},tagName:"p",value:r,onChange:e=>t({meter_description:e}),allowedFormats:["core/bold","core/italic"],"aria-label":r?(0,$.__)("Password strength meter description","lifterlms"):(0,$.__)("Empty Password strength meter description; start writing to add a label"),placeholder:(0,$.__)("Enter a description for the password strength meter","lifterlms")})):null},fillInspectorControls:(e,t)=>{const{isConfirmationControlField:n,isConfirmationField:r,meter:l,min_strength:s,html_attrs:o}=e,{minlength:i}=o;if(r)return;return(0,A.createElement)(A.Fragment,null,(0,A.createElement)(q.ToggleControl,{label:(0,$.__)("Password strength meter","lifterlms"),help:l?(0,$.__)("Password strength meter is enabled.","lifterlms"):(0,$.__)("Password strength meter is disabled.","lifterlms"),checked:l,onChange:()=>t({meter:!l})}),l&&(0,A.createElement)(q.SelectControl,{label:(0,$.__)("Minimum Password Strength","lifterlms"),value:s,onChange:e=>t({min_strength:e}),options:[{value:"strong",label:(0,$.__)("Strong","lifterlms")},{value:"medium",label:(0,$.__)("Medium","lifterlms")},{value:"weak",label:(0,$.__)("Weak","lifterlms")}]}),(0,A.createElement)(q.TextControl,{label:(0,$.__)("Minimum Password Length","lifterlms"),value:i,type:"number",min:"6",onChange:e=>(e=>{t(rc(o,e)),n&&function(e){const{getSelectedBlockClientId:t}=(0,jr.select)(j.store),{updateBlockAttributes:n}=(0,jr.dispatch)(j.store),r=Ii(t()),{attributes:l,clientId:s}=r,{html_attrs:o}=l;n(s,rc(o,e))}(e)})(1*e)}))}},["transforms","variations"]),sc=(0,A.createElement)(q.SVG,{className:"llms-block-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512"},(0,A.createElement)(q.Path,{d:"M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H512c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zm80 256h64c44.2 0 80 35.8 80 80c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16c0-44.2 35.8-80 80-80zm-32-96a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zm256-32H496c8.8 0 16 7.2 16 16s-7.2 16-16 16H368c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64H496c8.8 0 16 7.2 16 16s-7.2 16-16 16H368c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64H496c8.8 0 16 7.2 16 16s-7.2 16-16 16H368c-8.8 0-16-7.2-16-16s7.2-16 16-16z"})),oc="llms/form-field-user-address",ic=Fi(),ac=!0,cc=Bi(Ai("group"),{title:(0,$.__)("User Address","lifterlms"),description:(0,$.__)("A group of fields used to collect a user's full address.","lifterlms"),icon:sc,supports:{inserter:!0,multiple:!1},llmsInnerBlocks:{allowed:["llms/form-field-user-address-street","llms/form-field-user-address-city","llms/form-field-user-address-country","llms/form-field-user-address-region"],template:[["llms/form-field-user-address-street"],["llms/form-field-user-address-city"],["llms/form-field-user-address-country"],["llms/form-field-user-address-region"]]}},["providesContext"]),uc="llms/form-field-user-address-street",dc=Fi(),pc=!0,mc=Bi(Ai("group"),{title:(0,$.__)("User Street Address","lifterlms"),description:(0,$.__)("Collect a user's street address.","lifterlms"),icon:sc,supports:{multiple:!1},llmsInnerBlocks:{allowed:["llms/form-field-user-address-street-primary","llms/form-field-user-address-street-secondary"],template:[["llms/form-field-user-address-street-primary",{columns:8,last_column:!1}],["llms/form-field-user-address-street-secondary",{columns:4,last_column:!0}]]},parent:["llms/form-field-user-name"]}),fc=(0,A.createElement)(q.SVG,{className:"llms-block-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512"},(0,A.createElement)(q.Path,{d:"M575.8 255.5c0 18-15 32.1-32 32.1h-32l.7 160.2c0 2.7-.2 5.4-.5 8.1V472c0 22.1-17.9 40-40 40H456c-1.1 0-2.2 0-3.3-.1c-1.4 .1-2.8 .1-4.2 .1H416 392c-22.1 0-40-17.9-40-40V448 384c0-17.7-14.3-32-32-32H256c-17.7 0-32 14.3-32 32v64 24c0 22.1-17.9 40-40 40H160 128.1c-1.5 0-3-.1-4.5-.2c-1.2 .1-2.4 .2-3.6 .2H104c-22.1 0-40-17.9-40-40V360c0-.9 0-1.9 .1-2.8V287.6H32c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L564.8 231.5c8 7 12 15 11 24z"})),hc="llms/form-field-user-address-street-primary",gc=!0,vc=Bi(Ca,{title:(0,$.__)("User Street Address","lifterlms"),description:(0,$.__)("A special field used to collect a user's street address.","lifterlms"),icon:fc,supports:{multiple:!1,llms_field_inspector:{id:!1,name:!1,required:!0,storage:!1}},attributes:{id:{__default:"llms_billing_address_1"},label:{__default:(0,$.__)("Address","lifterlms")},name:{__default:"llms_billing_address_1"},required:{__default:!0},data_store:{__default:"usermeta"},data_store_key:{__default:"llms_billing_address_1"}},parent:["llms/form-field-user-address-street"],usesContext:["llms/fieldGroup/fieldLayout"]},["transforms","variations"]),bc="llms/form-field-user-address-street-secondary",_c=!0,yc=Bi(vc,{title:(0,$.__)("User Street Address Additional Information","lifterlms"),description:(0,$.__)("A special field used to collect a user's street address.","lifterlms"),attributes:{id:{__default:"llms_billing_address_2"},label:{__default:""},placeholder:{__default:(0,$.__)("Apartment, suite, etc…","lifterlms")},name:{__default:"llms_billing_address_2"},required:{__default:!1},data_store_key:{__default:"llms_billing_address_2"},label_show_empty:{__default:!0}},usesContext:["llms/fieldGroup/fieldLayout"]},["transforms","variations"]),wc=(0,A.createElement)(q.SVG,{className:"llms-block-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512"},(0,A.createElement)(q.Path,{d:"M408 120c0 54.6-73.1 151.9-105.2 192c-7.7 9.6-22 9.6-29.6 0C241.1 271.9 168 174.6 168 120C168 53.7 221.7 0 288 0s120 53.7 120 120zm8 80.4c3.5-6.9 6.7-13.8 9.6-20.6c.5-1.2 1-2.5 1.5-3.7l116-46.4C558.9 123.4 576 135 576 152V422.8c0 9.8-6 18.6-15.1 22.3L416 503V200.4zM137.6 138.3c2.4 14.1 7.2 28.3 12.8 41.5c2.9 6.8 6.1 13.7 9.6 20.6V451.8L32.9 502.7C17.1 509 0 497.4 0 480.4V209.6c0-9.8 6-18.6 15.1-22.3l122.6-49zM327.8 332c13.9-17.4 35.7-45.7 56.2-77V504.3L192 449.4V255c20.5 31.3 42.3 59.6 56.2 77c20.5 25.6 59.1 25.6 79.6 0zM288 152a40 40 0 1 0 0-80 40 40 0 1 0 0 80z"})),Ec="llms/form-field-user-address-city",xc=!0,Cc=Bi(Ca,{title:(0,$.__)("User City","lifterlms"),description:(0,$.__)("A special field used to collect a user's billing city.","lifterlms"),icon:wc,supports:{multiple:!1,llms_field_inspector:{id:!1,name:!1,required:!0,match:!1,storage:!1}},attributes:{id:{__default:"llms_billing_city"},label:{__default:(0,$.__)("City","lifterlms")},name:{__default:"llms_billing_city"},required:{__default:!0},data_store:{__default:"usermeta"},data_store_key:{__default:"llms_billing_city"}},parent:["llms/form-field-user-address"]},["transforms","variations"]),kc=(0,A.createElement)(q.SVG,{className:"llms-block-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},(0,A.createElement)(q.Path,{d:"M57.7 193l9.4 16.4c8.3 14.5 21.9 25.2 38 29.8L163 255.7c17.2 4.9 29 20.6 29 38.5v39.9c0 11 6.2 21 16 25.9s16 14.9 16 25.9v39c0 15.6 14.9 26.9 29.9 22.6c16.1-4.6 28.6-17.5 32.7-33.8l2.8-11.2c4.2-16.9 15.2-31.4 30.3-40l8.1-4.6c15-8.5 24.2-24.5 24.2-41.7v-8.3c0-12.7-5.1-24.9-14.1-33.9l-3.9-3.9c-9-9-21.2-14.1-33.9-14.1H257c-11.1 0-22.1-2.9-31.8-8.4l-34.5-19.7c-4.3-2.5-7.6-6.5-9.2-11.2c-3.2-9.6 1.1-20 10.2-24.5l5.9-3c6.6-3.3 14.3-3.9 21.3-1.5l23.2 7.7c8.2 2.7 17.2-.4 21.9-7.5c4.7-7 4.2-16.3-1.2-22.8l-13.6-16.3c-10-12-9.9-29.5 .3-41.3l15.7-18.3c8.8-10.3 10.2-25 3.5-36.7l-2.4-4.2c-3.5-.2-6.9-.3-10.4-.3C163.1 48 84.4 108.9 57.7 193zM464 256c0-36.8-9.6-71.4-26.4-101.5L412 164.8c-15.7 6.3-23.8 23.8-18.5 39.8l16.9 50.7c3.5 10.4 12 18.3 22.6 20.9l29.1 7.3c1.2-9 1.8-18.2 1.8-27.5zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z"})),Sc="llms/form-field-user-address-country",Oc=!0,Ic=Bi(pa,{title:(0,$.__)("User Country","lifterlms"),description:(0,$.__)("A special field used to collect a user's billing country.","lifterlms"),icon:kc,supports:{multiple:!1,llms_field_inspector:{id:!1,name:!1,required:!0,match:!1,storage:!1,options:!1}},attributes:{id:{__default:"llms_billing_country"},label:{__default:(0,$.__)("Country","lifterlms")},name:{__default:"llms_billing_country"},required:{__default:!0},data_store:{__default:"usermeta"},data_store_key:{__default:"llms_billing_country"},options_preset:{__default:"countries"},placeholder:{__default:(0,$.__)("Select a Country","lifterlms")}},parent:["llms/form-field-user-address"]},["transforms"]),Tc="llms/form-field-user-address-region",Pc=Fi(),Mc=!0,Dc=Bi(Ai("group"),{title:(0,$.__)("User Street Address","lifterlms"),description:(0,$.__)("Collect a user's street address.","lifterlms"),icon:{src:sc},supports:{multiple:!1},parent:["llms/form-field-user-name"],llmsInnerBlocks:{allowed:["llms/form-field-user-address-state","llms/form-field-user-address-postal-code"],template:[["llms/form-field-user-address-state",{columns:6,last_column:!1}],["llms/form-field-user-address-postal-code",{columns:6,last_column:!0}]]}}),Lc=(0,A.createElement)(F.SVG,{className:"llms-block-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512"},(0,A.createElement)(F.Path,{d:"M215.7 499.2C267 435 384 279.4 384 192C384 86 298 0 192 0S0 86 0 192c0 87.4 117 243 168.3 307.2c12.3 15.3 35.1 15.3 47.4 0zM192 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"})),Rc="llms/form-field-user-address-state",Vc=!0,Nc=Bi(pa,{title:(0,$.__)("User Country","lifterlms"),description:(0,$.__)("A special field used to collect a user's billing country.","lifterlms"),icon:Lc,supports:{multiple:!1,llms_field_inspector:{id:!1,name:!1,required:!0,storage:!1,options:!1}},attributes:{id:{__default:"llms_billing_state"},label:{__default:(0,$.__)("State / Region","lifterlms")},name:{__default:"llms_billing_state"},required:{__default:!0},data_store:{__default:"usermeta"},data_store_key:{__default:"llms_billing_state"},options_preset:{__default:"states"},placeholder:{__default:(0,$.__)("Select a State / Region","lifterlms")}},parent:["llms/form-field-user-address-region"],usesContext:["llms/fieldGroup/fieldLayout"]},["transforms"]),Ac=(0,A.createElement)(q.SVG,{className:"llms-block-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512"},(0,A.createElement)(q.Path,{d:"M16 144a144 144 0 1 1 288 0A144 144 0 1 1 16 144zM160 80c8.8 0 16-7.2 16-16s-7.2-16-16-16c-53 0-96 43-96 96c0 8.8 7.2 16 16 16s16-7.2 16-16c0-35.3 28.7-64 64-64zM128 480V317.1c10.4 1.9 21.1 2.9 32 2.9s21.6-1 32-2.9V480c0 17.7-14.3 32-32 32s-32-14.3-32-32z"})),Fc="llms/form-field-user-address-postal-code",Bc=!0,Hc=Bi(Ca,{title:(0,$.__)("User Postal Code","lifterlms"),description:(0,$.__)("A special field used to collect a user's postal or zip code.","lifterlms"),icon:Ac,supports:{multiple:!1,llms_field_inspector:{id:!1,name:!1,required:!0,match:!1,storage:!1}},attributes:{id:{__default:"llms_billing_zip"},label:{__default:(0,$.__)("Postal / Zip Code","lifterlms")},name:{__default:"llms_billing_zip"},required:{__default:!0},data_store:{__default:"usermeta"},data_store_key:{__default:"llms_billing_zip"}},parent:["llms/form-field-user-address-region"],usesContext:["llms/fieldGroup/fieldLayout"]},["transforms","variations"]),zc="llms/form-field-user-phone",$c=!0,Uc=Bi(Ca,{title:(0,$.__)("User Phone","lifterlms"),description:(0,$.__)("A field used to collect a user's phone number.","lifterlms"),icon:va,supports:{inserter:!0,multiple:!1,llms_field_inspector:{id:!1,name:!1,storage:!1}},attributes:{id:{__default:"llms_phone"},field:{__default:"tel"},label:{__default:(0,$.__)("Phone Number","lifterlms")},name:{__default:"llms_phone"},data_store:{__default:"usermeta"},data_store_key:{__default:"llms_phone"}}},["transforms","variations"]),jc=()=>{const e=(0,H.applyFilters)("llms.formBlocksSafelist",["core/block","core/paragraph","core/heading","core/image","core/html","core/column","core/columns","core/group","core/separator","core/spacer"]),{getCurrentPost:t}=(0,jr.select)(qr.store),{meta:n={}}=t(),{_llms_form_location:r}=n;(0,Gr.getBlockTypes)().forEach((t=>{let{name:n}=t;(t=>-1===e.indexOf(t)&&(0===t.indexOf("llms/form-field-redeem-voucher")?"registration"!==r:0===t.indexOf("llms/form-field-user-login")?"account"===r:-1===t.indexOf("llms/form-field")))(n)&&(0,Gr.unregisterBlockType)(n)}))};Ur()((()=>{const{getCurrentPost:e}=(0,jr.select)(qr.store);let t=!1;const n=(0,jr.subscribe)((()=>{const r=e();if(!1===t&&0!==Object.keys(r).length){t=!0,n();const{type:e,is_llms_field:l}=r;"llms_form"===e?(Xr(),jc(),kl()):"wp_block"===e&&"yes"===l&&(jc(),kl())}}))}));const qc=window.wp.plugins,Gc=window.wp.editPost,Wc=(0,H.applyFilters)("llms_blocks_post_visibility_options",[{value:"catalog_search",label:(0,$.__)("Visible","lifterlms"),info:(0,$.__)("Visible in the catalog and search results.","lifterlms")},{value:"catalog",label:(0,$.__)("Catalog only","lifterlms"),info:(0,$.__)("Only visible in the catalog.","lifterlms")},{value:"search",label:(0,$.__)("Search only","lifterlms"),info:(0,$.__)("Only visible in search results.","lifterlms")},{value:"hidden",label:(0,$.__)("Hidden","lifterlms"),info:(0,$.__)("Hidden from catalog and search results.","lifterlms")}]),Kc=(0,jr.withSelect)((e=>({visibility:e("core/editor").getEditedPostAttribute("visibility")})))((function(e){let{visibility:t}=e;return Wc.find((e=>{let{value:n}=e;return n===t})).label}));class Yc extends A.Component{render(){const{onUpdateVisibility:e,instanceId:t,visibility:n}=this.props;return(0,A.createElement)(Gc.PluginPostStatusInfo,{className:"llms-post-visibility"},(0,A.createElement)("span",null,(0,$.__)("Catalog & Search Visibility","lifterlms")),(0,A.createElement)("div",null,(0,A.createElement)(q.Dropdown,{className:"llms-post-visibility-dropdown",contentClassName:"llms-post-visibility-content edit-post-post-visibility__dialog",renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,A.createElement)(q.Button,{onClick:n,"aria-expanded":t,isLink:!0},(0,A.createElement)(Kc,null))},renderContent:()=>(0,A.createElement)("fieldset",{key:"visibility-selector",className:"editor-post-visibility__dialog-fieldset"},(0,A.createElement)("legend",{className:"editor-post-visibility__dialog-legend"},(0,$.__)("Catalog Visibility","lifterlms")),Wc.map((r=>{let{value:l,label:s,info:o}=r;return(0,A.createElement)("div",{key:l,className:"editor-post-visibility__choice"},(0,A.createElement)("input",{type:"radio",name:`llms-editor-post-visibility__setting-${t}`,value:l,onChange:()=>e(l),checked:l===n,id:`editor-post-${l}-${t}`,"aria-describedby":`editor-post-${l}-${t}-description`,className:"editor-post-visibility__dialog-radio"}),(0,A.createElement)("label",{htmlFor:`editor-post-${l}-${t}`,className:"editor-post-visibility__dialog-label"},s),(0,A.createElement)("p",{id:`llms-editor-post-${l}-${t}-description`,className:"editor-post-visibility__dialog-info"},o))})))})))}}const Xc=(0,U.compose)([(0,jr.withSelect)((e=>{const{getCurrentPostType:t,getEditedPostAttribute:n}=e("core/editor");return{postType:t(),visibility:n("visibility")}})),(0,jr.withDispatch)((e=>{const{editPost:t}=e("core/editor");return{onUpdateVisibility(e){t({visibility:e})}}})),(0,U.ifCondition)((e=>{let{postType:t}=e;return-1!==["course","llms_membership"].indexOf(t)})),U.withInstanceId])(Yc);(0,qc.registerPlugin)("llms-post-visibility",{render:Xc});const Qc=window.wp.richText;function Zc(e){let{text:t,onSuccess:n}=e;const r=void 0!==U.useCopyToClipboard;return(0,A.createElement)(q.Tooltip,{text:(0,$.__)("Click to copy.","lifterlms")},r&&(0,A.createElement)((()=>{const e=(0,U.useCopyToClipboard)(t,n);return(0,A.createElement)(q.Button,{isLink:!0,ref:e},t)}),null),!r&&(0,A.createElement)((()=>(0,A.createElement)(q.ClipboardButton,{isLink:!0,text:t,onCopy:n},t)),null))}function Jc(e){let{closeModal:t,isActive:n,onChange:r,searchQuery:l,value:s,defaultValue:o}=e,{userInfoFields:i}=window.llms;l&&(i=i.filter((e=>function(e,t){let{label:n,name:r,id:l,data_store_key:s}=t;const o=[n,r,l,s],i=e.toLowerCase();return o.some((e=>e.toLowerCase().includes(i)))}(l,e))));const a=!i.length;a&&i.push({data_store_key:l,label:(0,$.__)("Custom User Information","lifterlms"),id:"custom",name:l});const c=(0,H.applyFilters)("llms/userInfoShortcodes/exclude",["password"]);return i=i.filter((e=>{let{id:t}=e;return!c.includes(t)})),(0,A.createElement)(A.Fragment,null,a&&(0,A.createElement)("p",{className:"llms-error"},(0,$.__)("No fields found matching your search but you can use the shortcode below if the meta information exists in the database.","lifterlms")),(0,A.createElement)("table",{className:"llms-table zebra"},(0,A.createElement)("thead",null,(0,A.createElement)("tr",null,(0,A.createElement)("th",null,(0,$.__)("Name","lifterlms")),(0,A.createElement)("th",null,(0,$.__)("Shortcode","lifterlms")),(0,A.createElement)("th",null,(0,$.__)("Insert","lifterlms")))),(0,A.createElement)("tbody",null,i.map((e=>function(e,t,n,r,l,s){let{label:o,name:i,data_store_key:a}=e;const c=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return`[llms-user ${e}${t?` or="${t}"`:""}]`}(a,s);return(0,A.createElement)("tr",{key:i},(0,A.createElement)("td",null,o),(0,A.createElement)("td",null,(0,A.createElement)(Zc,{text:c,onSuccess:n})),(0,A.createElement)("td",null,(0,A.createElement)(q.Button,{isSecondary:!0,isSmall:!0,onClick:()=>{const e=(0,Qc.create)({html:`${c}`});n(),r(t?(0,Qc.replace)(l,/\[user .+?\]/,e):(0,Qc.insert)(l,e))}},(0,$.__)("Insert","lifterlms"))))}(e,n,t,r,s,o))))))}(0,Qc.registerFormatType)("llms/user-info-shortcodes",{title:(0,$.__)("LifterLMS User Information Shortcodes","lifterlms"),tagName:"span",className:"llms-user-sc-wrap",edit:function(e){const[t,n]=(0,A.useState)(!1),[r,l]=(0,A.useState)(""),[s,o]=(0,A.useState)(""),i=()=>n(!1),{value:a,onChange:c,isActive:u}=e;return(0,A.createElement)(A.Fragment,null,(0,A.createElement)(j.RichTextToolbarButton,{icon:(0,A.createElement)(B,null),title:(0,$.__)("Shortcodes","lifterlms"),onClick:()=>n(!0)}),t&&(0,A.createElement)(q.Modal,{className:"llms-shortcodes-modal",title:(0,$.__)("LifterLMS User Information Shortcodes","lifterlms"),onRequestClose:i},(0,A.createElement)("div",{className:"llms-shortcodes-modal--main"},(0,A.createElement)("aside",null,(0,A.createElement)(q.TextControl,{type:"search",label:(0,$.__)("Filter by label, key, or ID…","lifterlms"),onChange:e=>l(e)}),(0,A.createElement)(q.TextControl,{label:(0,$.__)("Default value","lifterlms"),onChange:e=>o(e),help:(0,$.__)("Optional text displayed when no information exists or the user is logged out.","lifterlms")})),(0,A.createElement)("section",null,(0,A.createElement)(Jc,{closeModal:i,isActive:u,onChange:c,searchQuery:r,value:a,defaultValue:s})))))}});const eu=window.wp.url;function tu(e){const{id:t,item:n,index:r,setNodeRef:l,listeners:s,manageState:o}=e,{visibility:i,name:a,label:c}=n,{updateItem:u,deleteItem:d}=o,p="visible"===i,m=0===r,[f,h]=(0,A.useState)(!1);return(0,A.createElement)(A.Fragment,null,(0,A.createElement)("div",{className:"llms-instructor--header"},(0,A.createElement)("section",null,(0,A.createElement)("strong",null,a),(0,A.createElement)("small",null,"(#",t,")")),(0,A.createElement)("aside",null,m&&(0,A.createElement)(q.Tooltip,{text:(0,$.__)("Primary Instructor","lifterlms")},(0,A.createElement)(q.Dashicon,{icon:"star-filled"})),(0,A.createElement)(Ei,{label:(0,$.__)("Reorder instructor","lifterlms"),setNodeRef:l,listeners:s}),(0,A.createElement)(q.Button,{isSmall:!0,showTooltip:!0,label:(0,$.__)("Edit instructor","lifterlms"),icon:f?"arrow-up-alt2":"arrow-down-alt2",onClick:()=>h(!f)}))),f&&(0,A.createElement)("div",{className:"llms-instructor--settings"},(0,A.createElement)(q.ToggleControl,{label:(0,$.__)("Visibility","lifterlms"),help:p?(0,$.__)("Instructor is visible on frontend","lifterlms"):(0,$.__)("Instructor is hidden on frontend","lifterlms"),checked:p,onChange:e=>u(t,{visibility:e?"visible":"hidden"})}),p&&(0,A.createElement)(q.TextControl,{label:(0,$.__)("Label","lifterlms"),value:c,onChange:e=>u(t,{label:e})}),(0,A.createElement)(q.Button,{isSecondary:!0,iconPosition:"right",href:(0,eu.addQueryArgs)("/wp-admin/user-edit.php",{user_id:t}),target:"_blank",rel:"noreferrer",style:{marginRight:"5px"}},(0,$.__)("Edit","lifterlms"),(0,A.createElement)(q.Dashicon,{icon:"external"})),!m&&(0,A.createElement)(q.Button,{isDestructive:!0,onClick:()=>d(n)},(0,$.__)("Remove","lifterlms"))))}function nu(e){let{instructors:t,roles:n,addInstructor:r}=e;return(0,A.createElement)(Cs,{roles:n,placeholder:(0,$.__)("Search…","lifterlms"),searchArgs:{exclude:t.map((e=>{let{id:t}=e;return t}))},onChange:r})}class ru extends A.Component{constructor(){super(...arguments),Y(this,"onSearchChange",(e=>{this.setState({search:e})})),Y(this,"updateInstructor",((e,t)=>{const{instructors:n}=this.state,r=n.map((n=>(e===n.id&&(n={...n,...t}),n)));this.updateInstructors(r)})),Y(this,"updateInstructors",(e=>{this.setState({instructors:e}),this.props.updateInstructors(e)})),Y(this,"addInstructor",(e=>{let{id:t,name:n}=e;const{instructors:r}=this.state;r.push({...this.getInstructorDefaults(),id:t,name:n}),this.updateInstructors(r)})),Y(this,"removeInstructor",(e=>{let{instructors:t}=this.state;t=t.filter((t=>{let{id:n}=t;return e.id!==n})),this.updateInstructors(t)})),Y(this,"render",(()=>(0,A.createElement)(q.PanelBody,{title:(0,$.__)("Instructors","lifterlms")},(0,A.createElement)(nu,{roles:this.getRoles(),instructors:this.state.instructors,addInstructor:this.addInstructor}),(0,A.createElement)(Ci,{ListItem:tu,items:this.state.instructors,itemClassName:"llms-instructor",manageState:{createItem:this.addInstructor,deleteItem:this.removeInstructor,updateItem:this.updateInstructor,updateItems:this.updateInstructors}}))));let{instructors:e}=this.props;e="string"==typeof e?JSON.parse(e):e,this.state={instructors:e||[],search:""}}getRoles(){return(0,H.applyFilters)("llms_instructor_roles",["administrator","lms_manager","instructor","instructors_assistant"])}getInstructorDefaults(){return(0,H.applyFilters)("llms_instructor_defaults",{label:(0,$.__)("Author","lifterlms"),visibility:"visible"})}}const lu=(0,jr.withSelect)((e=>{const{getEditedPostAttribute:t}=e("core/editor");return{instructors:t("instructors")}})),su=(0,jr.withDispatch)((e=>{const{editPost:t}=e("core/editor");return{updateInstructors(e){t({instructors:JSON.stringify(e)})}}})),ou=(0,U.compose)([lu,su])(ru),iu=window.wp.notices,{Fill:au,Slot:cu}=(0,q.createSlotFill)("LLMSFormDocSettings"),uu=e=>{let{children:t}=e;return(0,A.createElement)(au,null,t)};uu.Slot=cu,window.llms.plugins=window.llms.plugins||{},window.llms.plugins.LLMSFormDocSettings=uu;const du=uu;class pu extends A.Component{constructor(){super(...arguments),Y(this,"render",(()=>{if(void 0===Gc.PluginDocumentSettingPanel)return null;if("llms_form"!==(0,jr.select)(qr.store).getCurrentPostType())return null;const{location:e,link:t,showTitle:n,freeApTitle:r,setFormMetas:l}=this.props,{formLocations:s}=window.llms,o=s[e];function i(e){(0,jr.dispatch)(j.store).replaceBlocks((0,jr.select)(j.store).getBlocks().map((e=>e.clientId)),(0,Gr.parse)(e))}function a(){const e="llms-form-restore-default",t=(0,jr.select)(qr.store).getEditedPostAttribute("content"),{createSuccessNotice:n,removeNotice:r}=(0,jr.dispatch)(iu.store),{resetFields:l}=(0,jr.dispatch)(wl);l(),i(o.template),n((0,$.__)("The form has been restored to the default template.","lifterlms"),{id:e,actions:[{label:(0,$.__)("Undo","lifterlms"),onClick:()=>{l(),i(t),r(e)}}]})}return""===n&&l({_llms_form_show_title:"yes"}),(0,A.createElement)(A.Fragment,null,(0,A.createElement)(Gc.PluginDocumentSettingPanel,{className:"llms-forms-doc-settings",name:"llms-forms-doc-settings",title:(0,$.__)("Form Settings","lifterlms"),opened:!0},(0,A.createElement)(du.Slot,null,(s=>(0,A.createElement)(A.Fragment,null,(0,A.createElement)(q.PanelRow,null,(0,A.createElement)("strong",null,(0,$.__)("Location","lifterlms")),!t&&(0,A.createElement)("strong",null,o.name),t&&(0,A.createElement)(q.ExternalLink,{href:t},o.name)),(0,A.createElement)("p",{style:{marginTop:"5px"}},(0,A.createElement)("em",null,o.description)),s,(0,A.createElement)("br",null),(0,A.createElement)(q.ToggleControl,{label:(0,$.__)("Display Form Title","lifterlms"),checked:"yes"===n,help:"yes"===n?(0,$.__)("Displaying form title.","lifterlms"):(0,$.__)("Not displaying form title.","lifterlms"),onChange:e=>l({_llms_form_show_title:e?"yes":"no"})}),"checkout"===e&&"yes"===n&&(0,A.createElement)(q.TextControl,{label:(0,$.__)("Free Access Plan Form Title","lifterlms"),value:r,onChange:e=>l({_llms_form_title_free_access_plans:e}),help:(0,$.__)("The form title to be shown for free access plans.","lifterlms")}),(0,A.createElement)("br",null),(0,A.createElement)(q.PanelRow,null,(0,A.createElement)(q.Button,{isDestructive:!0,onClick:a},(0,$.__)("Revert to Default","lifterlms"))),(0,A.createElement)("p",{style:{marginTop:"5px"}},(0,A.createElement)("em",null,(0,$.__)("Replace the existing content of the form with the original default content.","lifterlms"))))))))}))}}const mu=(0,jr.withSelect)((e=>{const{getCurrentPost:t,getCurrentPostType:n,getEditedPostAttribute:r}=e(qr.store);if("llms_form"!==n())return{};const l=r("meta");return{link:t().link,location:l._llms_form_location,showTitle:l._llms_form_show_title,freeApTitle:l._llms_form_title_free_access_plans}})),fu=(0,jr.withDispatch)((e=>{const{editPost:t}=e("core/editor");return{setFormMetas(e){t({meta:e})}}})),hu=(0,U.compose)([mu,fu])(pu),gu=()=>{const e=(0,A.useRef)(null);(0,A.useEffect)((()=>{const t=document.querySelectorAll(".llms-builder-launcher")[0];if(!t)return null;for(;e.current.firstChild;)e.current.removeChild(e.current.firstChild);const n=t.cloneNode(!0);e.current.appendChild(n)}),[]);const t="llms-course-builder-panel";return(0,A.createElement)(A.Fragment,null,(0,A.createElement)(q.PanelBody,{title:(0,$.__)("Course Builder","lifterlms"),className:t,opened:!0,onToggle:()=>{document.getElementsByClassName(t)[0].classList.toggle("llms-course-builder-panel--close")}},(0,A.createElement)("div",{ref:e})))},vu="llms-launch-course-builder-top-button",bu=()=>{var e,t;let n=document.getElementsByClassName("edit-post-header-toolbar__left")[0];if(n||(n=document.getElementsByClassName("editor-document-tools__left")[0]),!n)return;const r=null!==(e=null!==(t=window?.llmsBlocks?.courseId)&&void 0!==t?t:(0,jr.select)("core/editor")?.getCurrentPostId())&&void 0!==e?e:0;setTimeout((()=>{if(document.getElementById(vu))return;const e=document.createElement("a");e.id=vu,e.href=window.llms.admin_url+"admin.php?page=llms-course-builder&course_id="+r,e.className="llms-button-primary",e.style.marginLeft="16px",e.innerHTML=(0,$.__)("Launch Course Builder","lifterlms"),n.appendChild(e)}),1)};(0,qc.registerPlugin)("post-status-info-test",{render:()=>{var e,t,n;const r=null!==(e=(0,jr.select)("core/editor")?.getCurrentPostType())&&void 0!==e?e:"";if(!["course","lesson"].includes(r))return null;const l=null!==(t=null!==(n=window?.llmsBlocks?.courseId)&&void 0!==n?n:(0,jr.select)("core/editor")?.getCurrentPostId())&&void 0!==t?t:0;return(0,A.createElement)(Gc.PluginPostStatusInfo,{className:"llms-launch-course-builder"},(0,A.createElement)(q.Button,{href:window.llms.admin_url+"admin.php?page=llms-course-builder&course_id="+l,className:"llms-button-primary"},(0,$.__)("Launch Course Builder","lifterlms")))}}),(0,qc.registerPlugin)("llms",{render:()=>{const e=(0,jr.select)("core/editor").getCurrentPostType();return["course","lesson","llms_membership"].includes(e)?(["course","lesson"].includes(e)&&(0,jr.subscribe)(bu),(0,A.createElement)(A.Fragment,null,(0,A.createElement)(Gc.PluginSidebarMoreMenuItem,{target:"llms-sidebar",icon:(0,A.createElement)(B,null)},"LifterLMS"),(0,A.createElement)(Gc.PluginSidebar,{name:"llms-sidebar",title:"LifterLMS"},["course","lesson"].includes(e)&&(0,A.createElement)(gu,null),["course","llms_membership"].includes(e)&&(0,A.createElement)(ou,null)))):null},icon:(0,A.createElement)(B,null)}),(0,qc.registerPlugin)("llms-forms-doc-settings",{render:hu,icon:""}),(()=>{const e=Yr(),t=[r,l,s,o,i,a,c,u];Object.keys(N).forEach((e=>{N[e].composed&&t.push(N[e])})),["llms_form","wp_block"].includes(e)&&(0,H.doAction)("llms_form_fields_ready",N),t.forEach((t=>{const{name:n,postTypes:r,settings:l}=t;r&&-1===r.indexOf(e)||(0,Gr.registerBlockType)(n,l)}))})();const{components:_u={}}=window.llms;window.llms.components={..._u,...d},wp.blocks.updateCategory("llms-blocks",{icon:B})})()})(); \ No newline at end of file diff --git a/i18n/lifterlms-blocks.pot b/i18n/lifterlms-blocks.pot deleted file mode 100644 index 224a1dd1..00000000 --- a/i18n/lifterlms-blocks.pot +++ /dev/null @@ -1,1104 +0,0 @@ -# Copyright (C) 2018-2024 LifterLMS -# This file is distributed under the GPLv3. -msgid "" -msgstr "" -"Project-Id-Version: LifterLMS Blocks 2.5.7\n" -"Report-Msgid-Bugs-To: https://lifterlms.com/my-account/my-tickets\n" -"Last-Translator: Team LifterLMS \n" -"Language-Team: Team LifterLMS \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2024-08-09T17:36:31+00:00\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"X-Generator: llms/dev 0.0.4-alpha.0\n" -"X-Domain: lifterlms\n" - -#. Plugin Name of the plugin -#: includes/class-llms-blocks.php:58 -msgid "LifterLMS Blocks" -msgstr "" - -#. Plugin URI of the plugin -msgid "https://github.com/gocodebox/lifterlms-blocks" -msgstr "" - -#. Description of the plugin -msgid "WordPress Editor (Gutenberg) blocks for LifterLMS." -msgstr "" - -#. Author of the plugin -#: assets/js/llms-blocks.js:3 -#: assets/js/llms-blocks.js:19 -msgid "LifterLMS" -msgstr "" - -#. Author URI of the plugin -msgid "https://lifterlms.com/" -msgstr "" - -#: includes/blocks/class-llms-blocks-course-information-block.php:62 -#: assets/js/llms-blocks.js:3 -msgid "Course Information" -msgstr "" - -#: includes/blocks/class-llms-blocks-course-syllabus-block.php:104 -#: includes/class-llms-blocks-abstract-block.php:113 -msgid "No HTML was returned." -msgstr "" - -#: includes/blocks/class-llms-blocks-instructors-block.php:96 -msgid "No visible instructors were found." -msgstr "" - -#: includes/blocks/class-llms-blocks-pricing-table-block.php:93 -msgid "No access plans found." -msgstr "" - -#: includes/class-llms-blocks-post-instructors.php:137 -msgid "Sorry, you are not allowed to edit the object instructors." -msgstr "" - -#: includes/class-llms-blocks-post-types.php:87 -msgid "Add a short description of your course visible to all visitors..." -msgstr "" - -#: includes/class-llms-blocks-post-types.php:117 -msgid "Add a short description of your membership visible to all visitors..." -msgstr "" - -#: includes/class-llms-blocks-post-types.php:142 -msgid "Add your lesson content..." -msgstr "" - -#: includes/class-llms-blocks-post-visibility.php:82 -msgid "Sorry, you are not allowed to edit the object visibility." -msgstr "" - -#: includes/class-llms-blocks-post-visibility.php:116 -msgid "Post visibility." -msgstr "" - -#: includes/class-llms-blocks-status-tools.php:51 -msgid "Removes block editor code from all courses and lessons which were migrated to the block editor during an upgrade to WordPress 5.0 or later. If you installed the Classic Editor plugin after upgrading and see duplicate content items (such as the course syllabus or lesson mark complete button) this tool will remove the duplicates." -msgstr "" - -#. Translators: %d = number of affected courses/lessons. -#: includes/class-llms-blocks-status-tools.php:54 -msgid "Currently %d courses and/or lessons are affected." -msgstr "" - -#: includes/class-llms-blocks-status-tools.php:58 -msgid "Remove LifterLMS Block Code" -msgstr "" - -#: includes/class-llms-blocks-status-tools.php:59 -msgid "Remove Block Code" -msgstr "" - -#: includes/class-llms-blocks.php:65 -#: assets/js/llms-blocks.js:24 -msgid "Custom User Information" -msgstr "" - -#: includes/class-llms-blocks.php:73 -msgid "User Information" -msgstr "" - -#: assets/js/llms-blocks.js:1 -msgid "everyone" -msgstr "" - -#: assets/js/llms-blocks.js:1 -msgid "enrolled users" -msgstr "" - -#: assets/js/llms-blocks.js:1 -msgid "non-enrolled users or visitors" -msgstr "" - -#: assets/js/llms-blocks.js:1 -msgid "logged in users" -msgstr "" - -#: assets/js/llms-blocks.js:1 -msgid "logged out users" -msgstr "" - -#. Translators: %s = visibility setting label. -#: assets/js/llms-blocks.js:2 -msgid "This block is only visible to %s" -msgstr "" - -#. Translators: %1$s = Post title; %2$ = post id. -#: assets/js/llms-blocks.js:3 -msgctxt "Search result label" -msgid "%1$s (ID# %2$d)" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "in this course" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "in any course" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "in this membership" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "in any membership" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "in any course or membership" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "in all of the selected courses or memberships" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "in any of the selected courses or memberships" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Enrollment Visibility" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Display to" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Enrolled In" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Not Enrolled In" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Courses" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Search by course title…" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Memberships" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Search by membership title…" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "User Email is a required field." -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Restore user email field?" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Course Continue Button" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Continue" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Course Information Options" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Title Headline Size" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Headline size for the information title element." -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Estimated Completion Time" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "How many hours, days, weeks, etc… should a student expect to spend in order to complete this course." -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Display Estimated Time" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Displaying estimated time" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Hiding estimated time" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Display Difficulty" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Displaying difficulty" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Hiding difficulty" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Display Tracks" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Displaying tracks list" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Hiding tracks list" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Display Categories" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Displaying categories list" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Hiding categories list" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Display Tags" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Displaying tags list" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Hiding tags list" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Loading…" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Estimated Time" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Difficulty" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Tracks" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Categories" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Tags" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Course Progress" -msgstr "" - -#: assets/js/llms-blocks.js:3 -#: assets/js/llms-blocks.js:24 -msgid "Instructors" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Course" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Memebership" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Lesson Navigation" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Lesson Progression (Mark Complete)" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Take Quiz" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Mark Complete" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Validation errors were encountered while attempting to save your access plans." -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "LifterLMS Pricing Table" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "LifterLMS PHP Template" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Attention: Do not remove this block!" -msgstr "" - -#: assets/js/llms-blocks.js:3 -msgid "Removal will cause unintended effects on your LMS site." -msgstr "" - -#. translators: %s is the template title -#: assets/js/llms-blocks.js:5 -msgid "This is an editor placeholder for the %s. On your site this will be replaced by the relevant template. You can move this placeholder around and add further blocks around it to extend the template." -msgstr "" - -#: assets/js/llms-blocks.js:5 -msgid "Add optional placeholder text" -msgstr "" - -#. Translators: %1$s = User's name; %2$s = User's id. -#: assets/js/llms-blocks.js:6 -msgctxt "User search result label" -msgid "%1$s (ID# %2$d)" -msgstr "" - -#: assets/js/llms-blocks.js:6 -#: assets/js/llms-blocks.js:24 -msgid "Reorder instructor" -msgstr "" - -#: assets/js/llms-blocks.js:6 -msgid "Reorder option" -msgstr "" - -#: assets/js/llms-blocks.js:6 -msgid "Make default" -msgstr "" - -#: assets/js/llms-blocks.js:6 -msgid "Option label" -msgstr "" - -#: assets/js/llms-blocks.js:6 -msgid "Database key value" -msgstr "" - -#: assets/js/llms-blocks.js:6 -msgid "Delete Option" -msgstr "" - -#. Translators: %d = Option index in the list of options. -#: assets/js/llms-blocks.js:8 -#: assets/js/llms-blocks.js:21 -msgid "Option %d" -msgstr "" - -#. Translators: %d = Option index in the list of options. -#: assets/js/llms-blocks.js:9 -#: assets/js/llms-blocks.js:23 -msgid "option_%d" -msgstr "" - -#: assets/js/llms-blocks.js:9 -msgid "Options" -msgstr "" - -#: assets/js/llms-blocks.js:9 -msgid "Add option" -msgstr "" - -#: assets/js/llms-blocks.js:9 -msgid "Hide keys" -msgstr "" - -#: assets/js/llms-blocks.js:9 -msgid "Show keys" -msgstr "" - -#: assets/js/llms-blocks.js:9 -msgid "100%" -msgstr "" - -#: assets/js/llms-blocks.js:9 -msgid "75%" -msgstr "" - -#: assets/js/llms-blocks.js:9 -msgid "66.66%" -msgstr "" - -#: assets/js/llms-blocks.js:9 -msgid "50%" -msgstr "" - -#: assets/js/llms-blocks.js:9 -msgid "33.33%" -msgstr "" - -#: assets/js/llms-blocks.js:9 -msgid "25%" -msgstr "" - -#: assets/js/llms-blocks.js:9 -msgid "Select a field" -msgstr "" - -#. Translators: %s = user-submitted value. -#: assets/js/llms-blocks.js:11 -msgid "The value \"%s\" contains invalid characters. Only letters, numbers, underscores, and hyphens are allowed." -msgstr "" - -#. Translators: %s = user-submitted value. -#: assets/js/llms-blocks.js:13 -msgid "The user meta key \"%s\" is not unique. Please choose a unique value." -msgstr "" - -#. Translators: %s = user-submitted value. -#: assets/js/llms-blocks.js:15 -msgid "The ID \"%s\" is not unique. Please choose a unique field ID." -msgstr "" - -#. Translators: %s = user-submitted value. -#: assets/js/llms-blocks.js:17 -msgid "The name \"%s\" is not unique. Please choose a globally unique field name." -msgstr "" - -#. Translators: %s = user-submitted value. -#: assets/js/llms-blocks.js:19 -msgid "The chosen value \"%s\" is invalid." -msgstr "" - -#: assets/js/llms-blocks.js:19 -msgid "The value cannot be blank." -msgstr "" - -#: assets/js/llms-blocks.js:19 -msgid "Required" -msgstr "" - -#: assets/js/llms-blocks.js:19 -msgid "Field is required." -msgstr "" - -#: assets/js/llms-blocks.js:19 -msgid "Field is optional." -msgstr "" - -#: assets/js/llms-blocks.js:19 -msgid "Field Width" -msgstr "" - -#: assets/js/llms-blocks.js:19 -msgid "Determines the width of the form field." -msgstr "" - -#: assets/js/llms-blocks.js:19 -msgid "Placeholder" -msgstr "" - -#: assets/js/llms-blocks.js:19 -msgid "Displays a placeholder option as the selected instead of a default value." -msgstr "" - -#: assets/js/llms-blocks.js:19 -msgid "Confirmation Field" -msgstr "" - -#: assets/js/llms-blocks.js:19 -msgid "A Confirmation field is active." -msgstr "" - -#: assets/js/llms-blocks.js:19 -msgid "No confirmation field." -msgstr "" - -#: assets/js/llms-blocks.js:19 -msgid "Data Storage" -msgstr "" - -#: assets/js/llms-blocks.js:19 -msgid "Usermeta Key" -msgstr "" - -#: assets/js/llms-blocks.js:19 -msgid "Database field key name. Only accepts alphanumeric characters, hyphens, and underscores." -msgstr "" - -#: assets/js/llms-blocks.js:19 -msgid "Field Name" -msgstr "" - -#: assets/js/llms-blocks.js:19 -msgid "The field's HTML name attribute." -msgstr "" - -#: assets/js/llms-blocks.js:19 -msgid "Field ID" -msgstr "" - -#: assets/js/llms-blocks.js:19 -msgid "The field's HTML id attribute." -msgstr "" - -#: assets/js/llms-blocks.js:19 -msgid "Field Layout" -msgstr "" - -#: assets/js/llms-blocks.js:19 -msgid "Columns" -msgstr "" - -#: assets/js/llms-blocks.js:19 -msgid "Stacked" -msgstr "" - -#. Translators: %s label of the controller field. -#: assets/js/llms-blocks.js:24 -msgid "Confirm %s" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Input Confirmation Group" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Adds a required confirmation field to an input field." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Remove confirmation field" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Checkboxes" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "A single checkbox toggle or a group of multiple checkboxes." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Radio" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "A group of radio inputs which can be populated with any number of options." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Dropdown" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "A select field which can be populated with any number of options." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Text" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "An input field which accepts any form of text." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Email" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "A text input field which only accepts an email address." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Password" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "User password confirmation field." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Number" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "An input field which only accepts numeric input." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Phone Number" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "An input field which only accepts phone numbers." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Website Address / URL" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "An input field which only accepts a website address or URL." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "A simple text input field." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Minimum Value" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Specify the minimum allowed value. Leave blank for no minimum." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Maximum Value" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Specify the maximum allowed value. Leave blank for no maximum." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Textarea" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "A text field accepting multiple lines of user information." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Rows" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Specify the number of text rows for the textarea input." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Voucher Code Redemption" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Allows user to redeem a voucher code during account registration." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Have a voucher?" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Voucher Code" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Toggleable" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Field is revealed when the toggle is clicked." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Field is always visible." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "User Display Name" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Allows a user to choose how their name will be displayed publicly on the site." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Display Name" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "User Login" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Field used to collect a user's account username. If this field is omitted a username will be automatically generated based off their email address. Users can always login using either their email address or username." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Username" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "User Email" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "A special field used to collect a user's account email address." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Email Address" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "First Name" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "A special field used to collect a user's first name." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Last Name" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "A special field used to collect a user's last name." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "User name" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "A special field used to collect a user's first and last name." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "User Password" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "A special field used to collect a user's account password." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "A strong password is required with at least 8 characters. To make it stronger, use both upper and lower case letters, numbers, and symbols." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Very Weak" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Password strength meter description" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Enter a description for the password strength meter" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Password strength meter" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Password strength meter is enabled." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Password strength meter is disabled." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Minimum Password Strength" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Strong" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Medium" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Weak" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Minimum Password Length" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "User Address" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "A group of fields used to collect a user's full address." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "User Street Address" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Collect a user's street address." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "A special field used to collect a user's street address." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Address" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "User Street Address Additional Information" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Apartment, suite, etc…" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "User City" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "A special field used to collect a user's billing city." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "City" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "User Country" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "A special field used to collect a user's billing country." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Country" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Select a Country" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "State / Region" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Select a State / Region" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "User Postal Code" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "A special field used to collect a user's postal or zip code." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Postal / Zip Code" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "User Phone" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "A field used to collect a user's phone number." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Visible" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Visible in the catalog and search results." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Catalog only" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Only visible in the catalog." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Search only" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Only visible in search results." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Hidden" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Hidden from catalog and search results." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Catalog & Search Visibility" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Catalog Visibility" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Click to copy." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "No fields found matching your search but you can use the shortcode below if the meta information exists in the database." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Name" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Shortcode" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Insert" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "LifterLMS User Information Shortcodes" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Shortcodes" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Filter by label, key, or ID…" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Default value" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Optional text displayed when no information exists or the user is logged out." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Primary Instructor" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Edit instructor" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Visibility" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Instructor is visible on frontend" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Instructor is hidden on frontend" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Label" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Edit" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Remove" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Search…" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Author" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "The form has been restored to the default template." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Undo" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Form Settings" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Location" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Display Form Title" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Displaying form title." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Not displaying form title." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Free Access Plan Form Title" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "The form title to be shown for free access plans." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Revert to Default" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Replace the existing content of the form with the original default content." -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Course Builder" -msgstr "" - -#: assets/js/llms-blocks.js:24 -msgid "Launch Course Builder" -msgstr "" diff --git a/src/js/blocks/pricing-table/index.js b/src/js/blocks/pricing-table/index.js index c56e32a9..55b5c1ab 100644 --- a/src/js/blocks/pricing-table/index.js +++ b/src/js/blocks/pricing-table/index.js @@ -13,9 +13,8 @@ import $ from 'jquery'; // WP deps. -import { createBlock } from '@wordpress/blocks'; -import { dispatch, select } from '@wordpress/data'; -import { Fragment } from '@wordpress/element'; +import { select } from '@wordpress/data'; +import { Fragment, useState } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; import ServerSideRender from '@wordpress/server-side-render'; @@ -77,20 +76,15 @@ export const settings = { edit: ( props ) => { const { attributes } = props; + const [refreshKey, setRefreshKey] = useState(0); // Add useState here + + // Reload when changes are made to access plans. $( document ).one( 'llms-access-plans-updated', function () { - // Replacing the block with a duplicate of itself so we can reload the block from the server. - dispatch( 'core/editor' ).replaceBlock( - props.clientId, - createBlock( name ) - ); - // This will save the updates to the post content that appear as a result of the replacement. - // Since I can't seem to figure out how to prevent the change from being triggered we have to duplicate a save. - // which is gross. I know it's gross. It works though.... - setTimeout( function () { - dispatch( 'core/editor' ).savePost(); - }, 500 ); + // Update a key tracked internally (vs attributes) to force a re-render of the block without a save prompt on refresh. + setRefreshKey( ( prevKey ) => prevKey + 1 ); + } ); return ( @@ -101,6 +95,7 @@ export const settings = { urlQueryArgs={ { post_id: select( 'core/editor' ).getCurrentPostId(), } } + key={ refreshKey } /> ); From 7c2d73e787ce2876dcd5893feca6b001041a522d Mon Sep 17 00:00:00 2001 From: Brian Hogg Date: Fri, 13 Sep 2024 13:12:10 -0400 Subject: [PATCH 2/2] Build for 2.5.8. --- .changelogs/fix_avoid-unsaved-changes-error.yml | 5 ----- CHANGELOG.md | 8 ++++++++ lifterlms-blocks.php | 4 ++-- package-lock.json | 4 ++-- package.json | 2 +- 5 files changed, 13 insertions(+), 10 deletions(-) delete mode 100644 .changelogs/fix_avoid-unsaved-changes-error.yml diff --git a/.changelogs/fix_avoid-unsaved-changes-error.yml b/.changelogs/fix_avoid-unsaved-changes-error.yml deleted file mode 100644 index 98d81bfb..00000000 --- a/.changelogs/fix_avoid-unsaved-changes-error.yml +++ /dev/null @@ -1,5 +0,0 @@ -significance: patch -type: fixed -links: - - "#232" -entry: Avoid an unsaved error prompt after saving the details of an access plan. diff --git a/CHANGELOG.md b/CHANGELOG.md index a943ad24..286e1a88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ LifterLMS Blocks Changelog ========================== +v2.5.8 - 2024-09-13 +------------------- + +##### Bug Fixes + ++ Avoid an unsaved error prompt after saving the details of an access plan. [#232](https://github.com/gocodebox/lifterlms-blocks/issues/232) + + v2.5.7 - 2024-08-09 ------------------- diff --git a/lifterlms-blocks.php b/lifterlms-blocks.php index a635a7d9..9382626f 100644 --- a/lifterlms-blocks.php +++ b/lifterlms-blocks.php @@ -11,7 +11,7 @@ * Plugin Name: LifterLMS Blocks * Plugin URI: https://github.com/gocodebox/lifterlms-blocks * Description: WordPress Editor (Gutenberg) blocks for LifterLMS. - * Version: 2.5.7 + * Version: 2.5.8 * Author: LifterLMS * Author URI: https://lifterlms.com/ * Text Domain: lifterlms @@ -27,7 +27,7 @@ // Define Constants. if ( ! defined( 'LLMS_BLOCKS_VERSION' ) ) { - define( 'LLMS_BLOCKS_VERSION', '2.5.7' ); + define( 'LLMS_BLOCKS_VERSION', '2.5.8' ); } /** diff --git a/package-lock.json b/package-lock.json index ed815239..952c607a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "lifterlms-blocks", - "version": "2.5.7", + "version": "2.5.8", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "lifterlms-blocks", - "version": "2.5.7", + "version": "2.5.8", "dependencies": { "@dnd-kit/core": "^3.1.1", "@dnd-kit/modifiers": "^3.0.0", diff --git a/package.json b/package.json index c7e70447..2a65877a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lifterlms-blocks", - "version": "2.5.7", + "version": "2.5.8", "description": "blocks", "author": "LifterLMS", "homepage": "https://lifterlms.com/",