0&&S[d]==e[d];)d++,a--;for(c=c.slice(d),d=1;l>0&&S.length-d>E-1&&S[S.length-d]==e[e.length-d];)d++,l--;u-=d-1,h-=d-1;var p=c.length-d+1;if(p<0&&(a=-p,p=0),c=c.slice(0,p),!(o||c||u||a||l||h))return"";k=!0;var g=!1;return s.isAndroid&&". "==c&&(c=" ",g=!0),c&&!a&&!l&&!u&&!h||C?t.onTextInput(c):t.onTextInput(c,{extendLeft:a,extendRight:l,restoreStart:u,restoreEnd:h}),k=!1,S=e,E=r,A=i,T=h,g?"\n":c},F=function(e){if(w)return V();if(e&&e.inputType){if("historyUndo"==e.inputType)return t.execCommand("undo");if("historyRedo"==e.inputType)return t.execCommand("redo")}var o=n.value,r=D(o,!0);(o.length>500||v.test(r)||b&&E<1&&E==A)&&I()},z=function(e,t,n){var o=e.clipboardData||window.clipboardData;if(o&&!u){var r=h||n?"Text":"text/plain";try{return t?!1!==o.setData(r,t):o.getData(r)}catch(e){if(!n)return z(e,t,!0)}}},B=function(e,i){var s=t.getCopyText();if(!s)return r.preventDefault(e);z(e,s)?(m&&(I(s),o=s,setTimeout((function(){o=!1}),10)),i?t.onCut():t.onCopy(),r.preventDefault(e)):(o=!0,n.value=s,n.select(),setTimeout((function(){o=!1,I(),i?t.onCut():t.onCopy()})))},j=function(e){B(e,!0)},H=function(e){B(e,!1)},W=function(e){var o=z(e);c.pasteCancelled()||("string"==typeof o?(o&&t.onPaste(o,e),s.isIE&&setTimeout(I),r.preventDefault(e)):(n.value="",y=!0))};r.addCommandKeyListener(n,(function(e,n,o){if(!w)return t.onCommandKey(e,n,o)}),t),r.addListener(n,"select",(function(e){w||(o?o=!1:function(e){return 0===e.selectionStart&&e.selectionEnd>=S.length&&e.value===S&&S&&e.selectionEnd!==A}(n)?(t.selectAll(),I()):b&&n.selectionStart!=E&&I())}),t),r.addListener(n,"input",F,t),r.addListener(n,"cut",j,t),r.addListener(n,"copy",H,t),r.addListener(n,"paste",W,t),"oncut"in n&&"oncopy"in n&&"onpaste"in n||r.addListener(e,"keydown",(function(e){if((!s.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:H(e);break;case 86:W(e);break;case 88:j(e)}}),t);var V=function(){if(w&&t.onCompositionUpdate&&!t.$readOnly){if(C)return G();if(w.useTextareaForIME)t.onCompositionUpdate(n.value);else{var e=n.value;D(e),w.markerRange&&(w.context&&(w.markerRange.start.column=w.selectionStart=w.context.compositionStartOffset),w.markerRange.end.column=w.markerRange.start.column+A-w.selectionStart+T)}}},U=function(e){t.onCompositionEnd&&!t.$readOnly&&(w=!1,t.onCompositionEnd(),t.off("mousedown",G),e&&F())};function G(){x=!0,n.blur(),n.focus(),x=!1}var q,K=l.delayedCall(V,50).schedule.bind(null,null);function Y(){clearTimeout(q),q=setTimeout((function(){_&&(n.style.cssText=_,_=""),t.renderer.$isMousePressed=!1,t.renderer.$keepTextAreaAtCursor&&t.renderer.$moveTextAreaToCursor()}),0)}r.addListener(n,"compositionstart",(function(e){if(!w&&t.onCompositionStart&&!t.$readOnly&&(w={},!C)){e.data&&(w.useTextareaForIME=!1),setTimeout(V,0),t._signal("compositionStart"),t.on("mousedown",G);var o=t.getSelectionRange();o.end.row=o.start.row,o.end.column=o.start.column,w.markerRange=o,w.selectionStart=E,t.onCompositionStart(w),w.useTextareaForIME?(S=n.value="",E=0,A=0):(n.msGetInputContext&&(w.context=n.msGetInputContext()),n.getInputContext&&(w.context=n.getInputContext()))}}),t),r.addListener(n,"compositionupdate",V,t),r.addListener(n,"keyup",(function(e){27==e.keyCode&&n.value.length ".concat(e,"
");this.setHtml(f),this.$element.setAttribute("aria-live","polite"),this.isOpen||(this.setTheme(this.editor.renderer.theme),this.setClassName("ace_gutter-tooltip")),this.show(),this.editor._signal("showGutterTooltip",this)},t.prototype.hideTooltip=function(){this.$element.removeAttribute("aria-live"),this.hide(),this.editor._signal("hideGutterTooltip",this)},t.annotationsToSummaryString=function(e){var n,o,r=[];try{for(var s=i(["error","warning","info"]),a=s.next();!a.done;a=s.next()){var l=a.value;if(e[l].length){var c=1===e[l].length?t.annotationLabels[l].singular:t.annotationLabels[l].plural;r.push("".concat(e[l].length," ").concat(c))}}}catch(e){n={error:e}}finally{try{a&&!a.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}return r.join(", ")},t}(l);t.GutterTooltip=u})),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],(function(e,t,n){"use strict";var o=e("../lib/event"),r=e("../lib/useragent"),i=function(){function e(e,t){this.speed,this.wheelX,this.wheelY,this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1}return e.prototype.stopPropagation=function(){o.stopPropagation(this.domEvent),this.propagationStopped=!0},e.prototype.preventDefault=function(){o.preventDefault(this.domEvent),this.defaultPrevented=!0},e.prototype.stop=function(){this.stopPropagation(),this.preventDefault()},e.prototype.getDocumentPosition=function(){return this.$pos||(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY)),this.$pos},e.prototype.getGutterRow=function(){var e=this.getDocumentPosition().row;return this.editor.session.documentToScreenRow(e,0)-this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row,0)},e.prototype.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var e=this.editor.getSelectionRange();if(e.isEmpty())this.$inSelection=!1;else{var t=this.getDocumentPosition();this.$inSelection=e.contains(t.row,t.column)}return this.$inSelection},e.prototype.getButton=function(){return o.getButton(this.domEvent)},e.prototype.getShiftKey=function(){return this.domEvent.shiftKey},e.prototype.getAccelKey=function(){return r.isMac?this.domEvent.metaKey:this.domEvent.ctrlKey},e}();t.MouseEvent=i})),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],(function(e,t,n){"use strict";var o=e("../lib/dom"),r=e("../lib/event"),i=e("../lib/useragent");function s(e){var t=e.editor,n=o.createElement("div");n.style.cssText="top:-100px;position:absolute;z-index:2147483647;opacity:0.5",n.textContent=" ",["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach((function(t){e[t]=this[t]}),this),t.on("mousedown",this.onMouseDown.bind(e));var s,l,c,u,h,d,p,g,f,m,v,b=t.container,y=0;function w(){var e=d;(function(e,n){var o=Date.now(),r=!n||e.row!=n.row,i=!n||e.column!=n.column;!m||r||i?(t.moveCursorToPosition(e),m=o,v={x:l,y:c}):a(v.x,v.y,l,c)>5?m=null:o-m>=200&&(t.renderer.scrollCursorIntoView(),m=null)})(d=t.renderer.screenToTextCoordinates(l,c),e),function(e,n){var o=Date.now(),r=t.renderer.layerConfig.lineHeight,i=t.renderer.layerConfig.characterWidth,s=t.renderer.scroller.getBoundingClientRect(),a={x:{left:l-s.left,right:s.right-l},y:{top:c-s.top,bottom:s.bottom-c}},u=Math.min(a.x.left,a.x.right),h=Math.min(a.y.top,a.y.bottom),d={row:e.row,column:e.column};u/i<=2&&(d.column+=a.x.left=a&&i<=l&&(n=t,c.selection.clearSelection(),c.moveCursorTo(e,a+o),c.selection.selectTo(e,l+o)),a=l}));for(var u,h=this.$toggleWordPairs,d=0;d
"),g.appendChild(r.createElement("div"));var v=function(e,t,n){if(0===t&&("esc"===n||"return"===n))return p.destroy(),{command:"null"}};p.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(v),n.widgetManager.removeLineWidget(p),e.off("changeSelection",p.destroy),e.off("changeSession",p.destroy),e.off("mouseup",p.destroy),e.off("change",p.destroy))},e.keyBinding.addKeyboardHandler(v),e.on("changeSelection",p.destroy),e.on("changeSession",p.destroy),e.on("mouseup",p.destroy),e.on("change",p.destroy),e.session.widgetManager.addLineWidget(p),p.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:p.el.offsetHeight})},r.importCssString("\n .error_widget_wrapper {\n background: inherit;\n color: inherit;\n border:none\n }\n .error_widget {\n border-top: solid 2px;\n border-bottom: solid 2px;\n margin: 5px 0;\n padding: 10px 40px;\n white-space: pre-wrap;\n }\n .error_widget.ace_error, .error_widget_arrow.ace_error{\n border-color: #ff5a5a\n }\n .error_widget.ace_warning, .error_widget_arrow.ace_warning{\n border-color: #F1D817\n }\n .error_widget.ace_info, .error_widget_arrow.ace_info{\n border-color: #5a5a5a\n }\n .error_widget.ace_ok, .error_widget_arrow.ace_ok{\n border-color: #5aaa5a\n }\n .error_widget_arrow {\n position: absolute;\n border: solid 5px;\n border-top-color: transparent!important;\n border-right-color: transparent!important;\n border-left-color: transparent!important;\n top: -5px;\n }\n","error_marker.css",!1)})),ace.define("ace/ace",["require","exports","module","ace/lib/dom","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config","ace/loader_build"],(function(e,t,n){"use strict";e("./loader_build")(t);var o=e("./lib/dom"),r=e("./range").Range,i=e("./editor").Editor,s=e("./edit_session").EditSession,a=e("./undomanager").UndoManager,l=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./multi_select"),e("./mode/folding/fold_mode"),e("./theme/textmate"),e("./ext/error_marker"),t.config=e("./config"),t.edit=function(e,n){if("string"==typeof e){var r=e;if(!(e=document.getElementById(r)))throw new Error("ace.edit can't find div #"+r)}if(e&&e.env&&e.env.editor instanceof i)return e.env.editor;var s="";if(e&&/input|textarea/i.test(e.tagName)){var a=e;s=a.value,e=o.createElement("pre"),a.parentNode.replaceChild(e,a)}else e&&(s=e.textContent,e.innerHTML="");var c=t.createEditSession(s),u=new i(new l(e),c,n),h={document:c,editor:u,onResize:u.resize.bind(u,null)};return a&&(h.textarea=a),u.on("destroy",(function(){h.editor.container.env=null})),u.container.env=u.env=h,u},t.createEditSession=function(e,t){var n=new s(e,t);return n.setUndoManager(new a),n},t.Range=r,t.Editor=i,t.EditSession=s,t.UndoManager=a,t.VirtualRenderer=l,t.version=t.config.version})),ace.require(["ace/ace"],(function(t){t&&(t.config.init(!0),t.define=ace.define);var n=function(){return this}();for(var o in n||"undefined"==typeof window||(n=window),n||"undefined"==typeof self||(n=self),n.ace||(n.ace=t),t)t.hasOwnProperty(o)&&(n.ace[o]=t[o]);n.ace.default=n.ace,e&&(e.exports=n.ace)}))},7424:(e,t,n)=>{e=n.nmd(e),ace.define("ace/snippets",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/range_list","ace/keyboard/hash_handler","ace/tokenizer","ace/clipboard","ace/editor"],(function(e,t,n){"use strict";var o=e("./lib/dom"),r=e("./lib/oop"),i=e("./lib/event_emitter").EventEmitter,s=e("./lib/lang"),a=e("./range").Range,l=e("./range_list").RangeList,c=e("./keyboard/hash_handler").HashHandler,u=e("./tokenizer").Tokenizer,h=e("./clipboard"),d={CURRENT_WORD:function(e){return e.session.getTextRange(e.session.getWordRange())},SELECTION:function(e,t,n){var o=e.session.getTextRange();return n?o.replace(/\n\r?([ \t]*\S)/g,"\n"+n+"$1"):o},CURRENT_LINE:function(e){return e.session.getLine(e.getCursorPosition().row)},PREV_LINE:function(e){return e.session.getLine(e.getCursorPosition().row-1)},LINE_INDEX:function(e){return e.getCursorPosition().row},LINE_NUMBER:function(e){return e.getCursorPosition().row+1},SOFT_TABS:function(e){return e.session.getUseSoftTabs()?"YES":"NO"},TAB_SIZE:function(e){return e.session.getTabSize()},CLIPBOARD:function(e){return h.getText&&h.getText()},FILENAME:function(e){return/[^/\\]*$/.exec(this.FILEPATH(e))[0]},FILENAME_BASE:function(e){return/[^/\\]*$/.exec(this.FILEPATH(e))[0].replace(/\.[^.]*$/,"")},DIRECTORY:function(e){return this.FILEPATH(e).replace(/[^/\\]*$/,"")},FILEPATH:function(e){return"/not implemented.txt"},WORKSPACE_NAME:function(){return"Unknown"},FULLNAME:function(){return"Unknown"},BLOCK_COMMENT_START:function(e){var t=e.session.$mode||{};return t.blockComment&&t.blockComment.start||""},BLOCK_COMMENT_END:function(e){var t=e.session.$mode||{};return t.blockComment&&t.blockComment.end||""},LINE_COMMENT:function(e){return(e.session.$mode||{}).lineCommentStart||""},CURRENT_YEAR:p.bind(null,{year:"numeric"}),CURRENT_YEAR_SHORT:p.bind(null,{year:"2-digit"}),CURRENT_MONTH:p.bind(null,{month:"numeric"}),CURRENT_MONTH_NAME:p.bind(null,{month:"long"}),CURRENT_MONTH_NAME_SHORT:p.bind(null,{month:"short"}),CURRENT_DATE:p.bind(null,{day:"2-digit"}),CURRENT_DAY_NAME:p.bind(null,{weekday:"long"}),CURRENT_DAY_NAME_SHORT:p.bind(null,{weekday:"short"}),CURRENT_HOUR:p.bind(null,{hour:"2-digit",hour12:!1}),CURRENT_MINUTE:p.bind(null,{minute:"2-digit"}),CURRENT_SECOND:p.bind(null,{second:"2-digit"})};function p(e){var t=(new Date).toLocaleString("en-us",e);return 1==t.length?"0"+t:t}d.SELECTED_TEXT=d.SELECTION;var g=function(){function e(){this.snippetMap={},this.snippetNameMap={},this.variables=d}return e.prototype.getTokenizer=function(){return e.$tokenizer||this.createTokenizer()},e.prototype.createTokenizer=function(){function t(e){return e=e.substr(1),/^\d+$/.test(e)?[{tabstopId:parseInt(e,10)}]:[{text:e}]}function n(e){return"(?:[^\\\\"+e+"]|\\\\.)"}var o={regex:"/("+n("/")+"+)/",onMatch:function(e,t,n){var o=n[0];return o.fmtString=!0,o.guard=e.slice(1,-1),o.flag="",""},next:"formatString"};return e.$tokenizer=new u({start:[{regex:/\\./,onMatch:function(e,t,n){var o=e[1];return("}"==o&&n.length||-1!="`$\\".indexOf(o))&&(e=o),[e]}},{regex:/}/,onMatch:function(e,t,n){return[n.length?n.shift():e]}},{regex:/\$(?:\d+|\w+)/,onMatch:t},{regex:/\$\{[\dA-Z_a-z]+/,onMatch:function(e,n,o){var r=t(e.substr(1));return o.unshift(r[0]),r},next:"snippetVar"},{regex:/\n/,token:"newline",merge:!1}],snippetVar:[{regex:"\\|"+n("\\|")+"*\\|",onMatch:function(e,t,n){var o=e.slice(1,-1).replace(/\\[,|\\]|,/g,(function(e){return 2==e.length?e[1]:"\0"})).split("\0").map((function(e){return{value:e}}));return n[0].choices=o,[o[0]]},next:"start"},o,{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"start"}],formatString:[{regex:/:/,onMatch:function(e,t,n){return n.length&&n[0].expectElse?(n[0].expectElse=!1,n[0].ifEnd={elseEnd:n[0]},[n[0].ifEnd]):":"}},{regex:/\\./,onMatch:function(e,t,n){var o=e[1];return"}"==o&&n.length||-1!="`$\\".indexOf(o)?e=o:"n"==o?e="\n":"t"==o?e="\t":-1!="ulULE".indexOf(o)&&(e={changeCase:o,local:o>"a"}),[e]}},{regex:"/\\w*}",onMatch:function(e,t,n){var o=n.shift();return o&&(o.flag=e.slice(1,-1)),this.next=o&&o.tabstopId?"start":"",[o||e]},next:"start"},{regex:/\$(?:\d+|\w+)/,onMatch:function(e,t,n){return[{text:e.slice(1)}]}},{regex:/\${\w+/,onMatch:function(e,t,n){var o={text:e.slice(2)};return n.unshift(o),[o]},next:"formatStringVar"},{regex:/\n/,token:"newline",merge:!1},{regex:/}/,onMatch:function(e,t,n){var o=n.shift();return this.next=o&&o.tabstopId?"start":"",[o||e]},next:"start"}],formatStringVar:[{regex:/:\/\w+}/,onMatch:function(e,t,n){return n[0].formatFunction=e.slice(2,-1),[n.shift()]},next:"formatString"},o,{regex:/:[\?\-+]?/,onMatch:function(e,t,n){"+"==e[1]&&(n[0].ifEnd=n[0]),"?"==e[1]&&(n[0].expectElse=!0)},next:"formatString"},{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"formatString"}]}),e.$tokenizer},e.prototype.tokenizeTmSnippet=function(e,t){return this.getTokenizer().getLineTokens(e,t).tokens.map((function(e){return e.value||e}))},e.prototype.getVariableValue=function(e,t,n){if(/^\d+$/.test(t))return(this.variables.__||{})[t]||"";if(/^[A-Z]\d+$/.test(t))return(this.variables[t[0]+"__"]||{})[t.substr(1)]||"";if(t=t.replace(/^TM_/,""),!this.variables.hasOwnProperty(t))return"";var o=this.variables[t];return"function"==typeof o&&(o=this.variables[t](e,t,n)),null==o?"":o},e.prototype.tmStrFormat=function(e,t,n){if(!t.fmt)return e;var o=t.flag||"",r=t.guard;r=new RegExp(r,o.replace(/[^gim]/g,""));var i="string"==typeof t.fmt?this.tokenizeTmSnippet(t.fmt,"formatString"):t.fmt,s=this,a=e.replace(r,(function(){var e=s.variables.__;s.variables.__=[].slice.call(arguments);for(var t=s.resolveVariables(i,n),o="E",r=0;r
",s.escapeHTML((t=e.snippet,n={},t.replace(/\${(\d+)(:(.*?))?}/g,(function(e,t,o,r){return n[t]=r||""})).replace(/\$(\d+?)/g,(function(e,t){return n[t]}))))].join(""))},id:"snippetCompleter"},h=[u,l,c];t.setCompleters=function(e){h.length=0,e&&h.push.apply(h,e)},t.addCompleter=function(e){h.push(e)},t.textCompleter=l,t.keyWordCompleter=c,t.snippetCompleter=u;var d,p={name:"expandSnippet",exec:function(e){return o.expandWithTab(e)},bindKey:"Tab"},g=function(e,t){f(t.session.$mode)},f=function(e){"string"==typeof e&&(e=i.$modes[e]),e&&(o.files||(o.files={}),m(e.$id,e.snippetFileId),e.modes&&e.modes.forEach(f))},m=function(e,t){t&&e&&!o.files[e]&&(o.files[e]={},i.loadModule(t,(function(t){t&&(o.files[e]=t,!t.snippets&&t.snippetText&&(t.snippets=o.parseSnippetFile(t.snippetText)),o.register(t.snippets||[],t.scope),t.includeScopes&&(o.snippetMap[t.scope].includeScopes=t.includeScopes,t.includeScopes.forEach((function(e){f("ace/mode/"+e)}))))})))},v=function(e){var t=e.editor,n=t.completer&&t.completer.activated;if("backspace"===e.command.name)n&&!a.getCompletionPrefix(t)&&t.completer.detach();else if("insertstring"===e.command.name&&!n){d=e;var o=e.editor.$liveAutocompletionDelay;o?b.delay(o):y(e)}},b=s.delayedCall((function(){y(d)}),0),y=function(e){var t=e.editor,n=a.getCompletionPrefix(t),o=a.triggerAutocomplete(t);if(n&&n.length>=t.$liveAutocompletionThreshold||o){var i=r.for(t);i.autoShown=!0,i.showPopup(t)}},w=e("../editor").Editor;e("../config").defineOptions(w.prototype,"editor",{enableBasicAutocompletion:{set:function(e){e?(this.completers||(this.completers=Array.isArray(e)?e:h),this.commands.addCommand(r.startCommand)):this.commands.removeCommand(r.startCommand)},value:!1},enableLiveAutocompletion:{set:function(e){e?(this.completers||(this.completers=Array.isArray(e)?e:h),this.commands.on("afterExec",v)):this.commands.off("afterExec",v)},value:!1},liveAutocompletionDelay:{initialValue:0},liveAutocompletionThreshold:{initialValue:0},enableSnippets:{set:function(e){e?(this.commands.addCommand(p),this.on("changeMode",g),g(0,this)):(this.commands.removeCommand(p),this.off("changeMode",g))},value:!1}})})),ace.require(["ace/ext/language_tools"],(function(t){e&&(e.exports=t)}))},3224:(e,t,n)=>{e=n.nmd(e),ace.define("ace/split",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/editor","ace/virtual_renderer","ace/edit_session"],(function(e,t,n){"use strict";var o,r=e("./lib/oop"),i=(e("./lib/lang"),e("./lib/event_emitter").EventEmitter),s=e("./editor").Editor,a=e("./virtual_renderer").VirtualRenderer,l=e("./edit_session").EditSession;(function(){r.implement(this,i),this.$createEditor=function(){var e=document.createElement("div");e.className=this.$editorCSS,e.style.cssText="position: absolute; top:0px; bottom:0px",this.$container.appendChild(e);var t=new s(new a(e,this.$theme));return t.on("focus",function(){this._emit("focus",t)}.bind(this)),this.$editors.push(t),t.setFontSize(this.$fontSize),t},this.setSplits=function(e){var t;if(e<1)throw"The number of splits have to be > 0!";if(e!=this.$splits){if(e>this.$splits){for(;this.$splits'+c+"";break;case 0:t[a]=""+c+""}}return t.join("")},t.prototype.diff_text1=function(e){for(var t=[],n=0;n","ghostkit")},{value:"h2",label:(0,vs.__)("
","ghostkit")},{value:"h3",label:(0,vs.__)("
","ghostkit")},{value:"h4",label:(0,vs.__)("
`),i&&(e+=i),p=new window.google.maps.InfoWindow({content:e}),d.addListener("click",(()=>{p.open(t,d)}))}return{marker:d,infoWindow:p}}function Hy(e){const{apiUrl:t,options:n,markers:o,onChangeMarkers:r}=e,[i,s]=(0,ms.useState)(null),a=(0,ms.useRef)(null),l=(0,ms.useRef)(null);return(0,ms.useEffect)((()=>{a.current&&(i?i.setOptions(n):function(e,t,n){const{markers:o,apiUrl:r=`${By}&key=${zy}`,onZoomChange:i,onCenterChange:s,...a}=t;Dy()(r,(()=>{Fy.trigger(e,"prepare.googleMaps.gkt",{options:t});const r=new window.google.maps.Map(e,a),l=e.getAttribute("data-gesture-handling");r&&"cooperative"===l&&r.setOptions({gestureHandling:l,scrollwheel:t.scrollwheel?null:t.scrollwheel}),o&&o.length&&o.forEach((e=>{jy({map:r,lat:e.lat,lng:e.lng,title:e.title,description:e.infoWindowText,iconURL:e.iconUrl,iconWidth:e.iconWidth,iconHeight:e.iconHeight})})),i&&r.addListener("zoom_changed",(()=>{i(r.getZoom())})),s&&r.addListener("center_changed",(()=>{s(r.getCenter())})),Fy.trigger(e,"prepared.googleMaps.gkt",{options:t,instance:r}),n&&n(r)}))}(a.current,{apiUrl:t,...n},(e=>{s(e)})))}),[t,i,n]),(0,ms.useEffect)((()=>{i&&o&&o.length&&(l.current?.length&&l.current.forEach((e=>{e.setMap(null)})),l.current=[],o.forEach(((e,t)=>{let n=null,s=null,a=null;if(e.iconImageURL&&e.iconImageCustomWidth&&e.iconImageWidth&&e.iconImageHeight){const t=e.iconImageCustomWidth*(e.iconImageHeight/e.iconImageWidth);n=e.iconImageURL,s=e.iconImageCustomWidth,a=t}const{marker:c}=jy({map:i,lat:e.lat,lng:e.lng,title:e.title,description:e.infoWindowText,iconURL:n,iconWidth:s,iconHeight:a,draggable:!0});l.current.push(c),window.google.maps.event.addListener(c,"dragend",(e=>{const n=e.latLng.lat(),i=e.latLng.lng(),s=Object.assign([],o);s[t].lat=n,s[t].lng=i,r(s)}))})))}),[t,i,n,o,r]),(0,Ke.createElement)("div",{ref:a,className:"ghostkit-google-maps-wrap",style:{minHeight:"100%"}})}const Wy=n.p+"images/style-bright.b03a3ba1.png",Vy=n.p+"images/style-custom.69181fd3.png",Uy=n.p+"images/style-dark.9fb1c8ca.png",Gy=n.p+"images/style-default.d929fa91.png",qy=n.p+"images/style-light.49c19432.png",Ky=n.p+"images/style-pale-dawn.2dd7ae39.png",Yy=[{value:"default",label:(0,vs.__)("Default","ghostkit"),image:Gy,json:[]},{value:"bright",label:(0,vs.__)("Bright","ghostkit"),image:Wy,json:[{featureType:"all",elementType:"all",stylers:[{saturation:"32"},{lightness:"-3"},{visibility:"on"},{weight:"1.18"}]},{featureType:"administrative",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"landscape",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"landscape.man_made",elementType:"all",stylers:[{saturation:"-70"},{lightness:"14"}]},{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"transit",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"water",elementType:"all",stylers:[{saturation:"100"},{lightness:"-14"}]},{featureType:"water",elementType:"labels",stylers:[{visibility:"off"},{lightness:"12"}]}]},{value:"light",label:(0,vs.__)("Light","ghostkit"),image:qy,json:[{featureType:"administrative",elementType:"labels",stylers:[{visibility:"on"}]},{featureType:"administrative.country",elementType:"geometry.stroke",stylers:[{visibility:"off"}]},{featureType:"administrative.province",elementType:"geometry.stroke",stylers:[{visibility:"off"}]},{featureType:"landscape",elementType:"geometry",stylers:[{visibility:"on"},{color:"#e3e3e3"}]},{featureType:"landscape.natural",elementType:"labels",stylers:[{visibility:"on"}]},{featureType:"poi",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"all",stylers:[{color:"#cccccc"}]},{featureType:"road",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"transit",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"transit.line",elementType:"geometry",stylers:[{visibility:"off"}]},{featureType:"transit.line",elementType:"labels.text",stylers:[{visibility:"on"}]},{featureType:"transit.station.airport",elementType:"geometry",stylers:[{visibility:"off"}]},{featureType:"transit.station.airport",elementType:"labels",stylers:[{visibility:"on"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#FFFFFF"}]},{featureType:"water",elementType:"labels",stylers:[{visibility:"on"}]}]},{value:"dark",label:(0,vs.__)("Dark","ghostkit"),image:Uy,json:[{featureType:"all",elementType:"labels.text.fill",stylers:[{saturation:36},{color:"#707070"},{lightness:40}]},{featureType:"all",elementType:"labels.text.stroke",stylers:[{visibility:"on"},{color:"#000000"},{lightness:16}]},{featureType:"all",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"administrative",elementType:"geometry.fill",stylers:[{color:"#000000"},{lightness:20}]},{featureType:"administrative",elementType:"geometry.stroke",stylers:[{color:"#000000"},{lightness:17},{weight:1.2}]},{featureType:"landscape",elementType:"geometry",stylers:[{color:"#424242"}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#000000"},{lightness:21}]},{featureType:"poi",elementType:"labels",stylers:[{visibility:"on"}]},{featureType:"poi",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{lightness:17},{color:"#484848"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{lightness:29},{weight:.2},{color:"#ff0000"},{visibility:"off"}]},{featureType:"road.arterial",elementType:"geometry",stylers:[{color:"#000000"},{lightness:18}]},{featureType:"road.local",elementType:"geometry",stylers:[{color:"#000000"},{lightness:16}]},{featureType:"transit",elementType:"geometry",stylers:[{color:"#000000"},{lightness:19}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#000000"},{lightness:17}]}]},{value:"pale_dawn",label:(0,vs.__)("Pale Dawn","ghostkit"),image:Ky,json:[{featureType:"administrative",elementType:"all",stylers:[{visibility:"on"},{lightness:33}]},{featureType:"landscape",elementType:"all",stylers:[{color:"#f2e5d4"}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#c5dac6"}]},{featureType:"poi.park",elementType:"labels",stylers:[{visibility:"on"},{lightness:20}]},{featureType:"road",elementType:"all",stylers:[{lightness:20}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#c5c6c6"}]},{featureType:"road.arterial",elementType:"geometry",stylers:[{color:"#e4d7c6"}]},{featureType:"road.local",elementType:"geometry",stylers:[{color:"#fbfaf7"}]},{featureType:"water",elementType:"all",stylers:[{visibility:"on"},{color:"#acbcc9"}]}]},{value:"custom",label:(0,vs.__)("Custom","ghostkit"),image:Vy}];function Zy(e){const{label:t,placeholder:n,className:o,onChange:r}=e,i=(0,ms.useRef)(null),[s,a]=(0,ms.useState)("");return(0,ms.useEffect)((()=>{if(!i?.current||!window?.google?.maps?.places)return;const e=new window.google.maps.places.SearchBox(i.current);e.addListener("places_changed",(()=>{const t=e.getPlaces();r&&(r(t),t&&t[0]&&a(t[0].formatted_address))}))}),[i,r]),(0,Ke.createElement)("div",{className:o},(0,Ke.createElement)(us.TextControl,{ref:i,label:t,placeholder:n,value:s,onChange:e=>{a(e)}}))}const{GHOSTKIT:Jy}=window,Xy=`${Jy.googleMapsAPIUrl}&libraries=geometry,drawing,places`;let Qy=!1;function ew(e){let t=[];try{t=JSON.parse(gt(e))}catch(e){return[]}return t}function tw(e){const{googleMapURL:t,title:n,address:o,addresses:r,lat:i,lng:s,iconImageURL:a,iconImageCustomWidth:l,infoWindowText:c,onChange:u}=e,h=a?(0,Ke.createElement)("img",{src:a,width:l,alt:""}):(0,Ke.createElement)("img",{src:"https://maps.gstatic.com/mapfiles/api-3/images/spotlight-poi3_hdpi.png",width:"27",alt:""});return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(us.TextControl,{label:(0,vs.__)("Title","ghostkit"),value:n,onChange:e=>{u({title:e})}}),(0,Ke.createElement)(Zy,{googleMapURL:t,label:(0,vs.__)("Address","ghostkit"),value:o||r[i+s]||"",onChange:e=>{e&&e[0]&&u({address:e[0].formatted_address,lat:e[0].geometry.location.lat(),lng:e[0].geometry.location.lng()})},className:"ghostkit-google-maps-search-box"}),(0,Ke.createElement)("div",{className:"ghostkit-google-maps-marker-options-content-icon"},h,(0,Ke.createElement)(ds.MediaUpload,{onSelect:e=>{e&&e.url&&u({iconImageID:e.id,iconImageURL:e.url,iconImageCustomWidth:Math.min(100,e.width),iconImageWidth:e.width,iconImageHeight:e.height})},allowedTypes:["image"],value:a||!1,render:({open:e})=>(0,Ke.createElement)(us.Button,{variant:"secondary",onClick:e},(0,vs.__)("Change Icon","ghostkit"))})),l?(0,Ke.createElement)("div",null,(0,Ke.createElement)(us.Button,{className:"ghostkit-google-maps-icon-reset",isSmall:!0,onClick:()=>{u({iconImageID:"",iconImageURL:"",iconImageCustomWidth:"",iconImageWidth:"",iconImageHeight:""})}},(0,vs.__)("Reset Icon to Default","ghostkit"))):null,l?(0,Ke.createElement)("div",null,(0,Ke.createElement)(rg,{label:(0,vs.__)("Marker Width","ghostkit"),value:l,onChange:e=>u({iconImageCustomWidth:e}),min:10,max:100})):null,(0,Ke.createElement)(us.BaseControl,{label:(0,vs.__)("Info Window Text","ghostkit"),className:"ghostkit-google-maps-marker-options-content-info-window-text",id:"ghostkit-google-maps-marker-content-info-window-text"},(0,Ke.createElement)(ds.RichText,{value:c,multiline:!0,placeholder:(0,vs.__)("Write text…","ghostkit"),onChange:e=>{u({infoWindowText:e})},onRemove:()=>{u({infoWindowText:""})}})))}const{name:nw}=Ry,{name:ow}=Ry,rw={icon:xi("block-google-maps",!0),ghostkit:{previewUrl:"https://www.ghostkit.io/docs/blocks/google-maps/"},edit:function(e){const{attributes:t,setAttributes:n,isSelected:o,toggleSelection:r}=e;let{className:i=""}=e;const{height:s,zoom:a,lat:l,lng:c,showZoomButtons:u,showMapTypeButtons:h,showStreetViewButton:d,showFullscreenButton:p,optionScrollWheel:g,optionDraggable:f,gestureHandling:m,markers:v,fullHeight:b,style:y,styleCustom:w}=t,[k,_]=(0,ms.useState)(t.apiKey),[C,x]=(0,ms.useState)(Jy.googleMapsAPIKey),[S,E]=(0,ms.useState)({});function A(e,t){v&&v.length>0&&(v.forEach(((n,o)=>{n.address||e.lat!==n.lat||e.lng!==n.lng||(v[o].address=t,S[e.lat+e.lng]=t)})),E(S))}(0,ms.useEffect)((()=>{(Qy||window.google&&window.google.maps&&window.google.maps.Geocoder)&&(Qy=new window.google.maps.Geocoder),Qy&&v&&v.length>0&&v.forEach((e=>{e.address||(S[e.lat+e.lng]?A({lat:e.lat,lng:e.lng},S[e.lat+e.lng]):Qy.geocode({location:{lat:e.lat,lng:e.lng}},((t,n)=>{"OK"===n&&t.length&&A({lat:e.lat,lng:e.lng},t[0].formatted_address)})))}))}));const T=Ev(600,(e=>{Jy.googleMapsAPIKey=e,_(e)})),$=Ev(3e3,(e=>{Hg()({path:"/ghostkit/v1/update_google_maps_api_key",method:"POST",data:{key:e}})}));function M(){return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(tp,{value:gt(y),options:Yy,onChange:e=>{let t=w;"default"===e?t="":"custom"!==e&&Yy.forEach((n=>{e===n.value&&(t=JSON.stringify(n.json))})),n({style:e,styleCustom:pt(t)})}}),"custom"===y?(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(us.TextareaControl,{placeholder:(0,vs.__)("Enter Style JSON","ghostkit"),value:gt(w),onChange:e=>n({styleCustom:pt(e)})}),(0,Ke.createElement)("p",null,(0,Ke.createElement)("em",null,(0,vs.__)("You can use custom styles presets from the","ghostkit")," ",(0,Ke.createElement)(us.ExternalLink,{href:"https://snazzymaps.com/"},(0,vs.__)("Snazzy Maps","ghostkit")),"."))):null)}function R(){return(0,Ke.createElement)(Hy,{key:k+v.length,apiUrl:`${Xy}&key=${pt(C)}`,markers:v,onChangeMarkers:e=>{n({markers:e})},options:{styles:w?ew(w):[],zoom:a,center:{lat:l,lng:c},zoomControl:u,zoomControlOpt:{style:"DEFAULT",position:"RIGHT_BOTTOM"},mapTypeControl:h,streetViewControl:d,fullscreenControl:p,gestureHandling:"cooperative",scrollwheel:!1,draggable:f,onZoomChange:Ev(500,(e=>n({zoom:e}))),onCenterChange:Ev(500,(e=>n({lat:e.lat(),lng:e.lng()})))}})}i=cs()("ghostkit-google-maps",i),b&&(i=cs()(i,"ghostkit-google-maps-fullheight")),i=(0,os.applyFilters)("ghostkit.editor.className",i,e);const O=(0,ds.useBlockProps)({className:i});return(0,Ke.createElement)(Ke.Fragment,null,C?(0,Ke.createElement)(ds.BlockControls,null,(0,Ke.createElement)(us.ToolbarGroup,null,(0,Ke.createElement)(us.ToolbarButton,{icon:xi("icon-fullheight"),title:(0,vs.__)("Full Height","ghostkit"),onClick:()=>n({fullHeight:!b}),isActive:b})),(0,Ke.createElement)(us.ToolbarGroup,null,(0,Ke.createElement)(us.ToolbarButton,{icon:xi("icon-marker"),title:(0,vs.__)("Add Marker","ghostkit"),onClick:()=>{n({markers:[...v,{lat:l,lng:c}]})}}),(0,Ke.createElement)(us.Dropdown,{renderToggle:({onToggle:e})=>(0,Ke.createElement)(us.Button,{label:(0,vs.__)("Style","ghostkit"),icon:xi("icon-map"),className:"components-toolbar__control",onClick:e}),renderContent:()=>(0,Ke.createElement)("div",{style:{minWidth:260}},M())}))):null,(0,Ke.createElement)(ds.InspectorControls,{group:"styles"},(0,Ke.createElement)(us.PanelBody,{title:(0,vs.__)("Styles","ghostkit")},M())),(0,Ke.createElement)(ds.InspectorControls,null,C?(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(us.PanelBody,null,(0,Ke.createElement)(rg,{label:b?(0,vs.__)("Minimal Height","ghostkit"):(0,vs.__)("Height","ghostkit"),value:s,onChange:e=>n({height:e}),min:100,max:800,allowCustomMin:!0,allowCustomMax:!0}),(0,Ke.createElement)(rg,{label:(0,vs.__)("Zoom","ghostkit"),value:a,onChange:e=>n({zoom:e}),min:1,max:18,allowCustomMax:!0})),(0,Ke.createElement)(us.PanelBody,{title:(0,vs.__)("Markers","ghostkit")},v&&v.length>0?(0,Ke.createElement)("ul",{className:"ghostkit-google-maps-markers"},v.map(((e,t)=>(0,Ke.createElement)(ws,{key:t,label:e.title||(0,vs.__)("Marker","ghostkit"),contentClassName:"ghostkit-component-google-maps-markers"},(0,Ke.createElement)(tw,{index:t,googleMapURL:`${Xy}&key=${pt(C)}`,address:e.address,addresses:S,lat:e.lat,lng:e.lng,title:e.title,iconImageURL:e.iconImageURL,iconImageCustomWidth:e.iconImageCustomWidth,infoWindowText:e.infoWindowText,onChange:e=>{const o=Object.assign([],v);o[t]={...o[t],...e},n({markers:o})}}),(0,Ke.createElement)(us.Button,{onClick:()=>{const e=Object.assign([],v);e.splice(t,1),n({markers:e})},className:"ghostkit-google-maps-marker-remove"},(0,vs.__)("Remove Marker","ghostkit")))))):null,(0,Ke.createElement)(us.Button,{isSecondary:!0,onClick:()=>{n({markers:[...v,{lat:l,lng:c}]})}},(0,vs.__)("+ Add Marker","ghostkit"))),(0,Ke.createElement)(us.PanelBody,{title:(0,vs.__)("Options","ghostkit")},(0,Ke.createElement)(us.ToggleControl,{label:(0,vs.__)("Zoom Buttons","ghostkit"),checked:!!u,onChange:e=>n({showZoomButtons:e})}),(0,Ke.createElement)(us.ToggleControl,{label:(0,vs.__)("Map Type Buttons","ghostkit"),checked:!!h,onChange:e=>n({showMapTypeButtons:e})}),(0,Ke.createElement)(us.ToggleControl,{label:(0,vs.__)("Street View Button","ghostkit"),checked:!!d,onChange:e=>n({showStreetViewButton:e})}),(0,Ke.createElement)(us.ToggleControl,{label:(0,vs.__)("Fullscreen Button","ghostkit"),checked:!!p,onChange:e=>n({showFullscreenButton:e})}),(0,Ke.createElement)(us.ToggleControl,{label:(0,vs.__)("Scroll Wheel","ghostkit"),checked:!!g,onChange:e=>n({optionScrollWheel:e})}),(0,Ke.createElement)(us.ToggleControl,{label:(0,vs.__)("Draggable","ghostkit"),checked:!!f,onChange:e=>n({optionDraggable:e})}),g||f?(0,Ke.createElement)(us.ToggleControl,{label:g&&f?(0,vs.__)("Better Scroll & Draggable","ghostkit"):g?(0,vs.__)("Better Scroll","ghostkit"):f?(0,vs.__)("Better Draggable","ghostkit"):"",help:g&&f?(0,vs.__)("Scroll with pressed Ctrl or ⌘ key to zoom. Draggable with two fingers.","ghostkit"):g?(0,vs.__)("Scroll with pressed Ctrl or ⌘ key to zoom.","ghostkit"):f?(0,vs.__)("Draggable with two fingers.","ghostkit"):"",checked:"cooperative"===m,onChange:()=>{n({gestureHandling:"greedy"===m?"cooperative":"greedy"})}}):null)):null,(0,Ke.createElement)(us.PanelBody,{title:(0,vs.__)("API Key","ghostkit"),initialOpen:!C},(0,Ke.createElement)(us.TextControl,{placeholder:(0,vs.__)("Enter API Key","ghostkit"),value:C,onChange:e=>{x(e),T(e),$(e)}}),(0,Ke.createElement)("p",null,(0,Ke.createElement)("em",null,(0,vs.__)("A valid API key is required to use Google Maps. How to get API key","ghostkit")," ",(0,Ke.createElement)(us.ExternalLink,{href:"https://developers.google.com/maps/documentation/javascript/get-api-key"},(0,vs.__)("read here","ghostkit")),".")),(0,Ke.createElement)("p",null,(0,Ke.createElement)("em",null,(0,vs.__)("This key will be used in all Google Maps blocks on your site.","ghostkit"))))),(0,Ke.createElement)("div",{...O},C?(0,Ke.createElement)(Ke.Fragment,null,b?R():(0,Ke.createElement)(us.ResizableBox,{className:cs()({"is-selected":o}),size:{width:"100%",height:s},style:{minHeight:s},minHeight:"100",enable:{bottom:!0},onResizeStart:()=>{r(!1)},onResizeStop:(e,t,o,i)=>{n({height:parseInt(s+i.height,10)}),r(!0)}},R()),o?(0,Ke.createElement)("div",{className:"ghostkit-google-maps-search"},(0,Ke.createElement)(Zy,{googleMapURL:`${Xy}&key=${pt(C)}`,label:(0,vs.__)("Center Map","ghostkit"),placeholder:(0,vs.__)("Enter search query","ghostkit"),onChange:e=>{e&&e[0]&&n({lat:e[0].geometry.location.lat(),lng:e[0].geometry.location.lng()})},className:"ghostkit-google-maps-search-box"}),(0,Ke.createElement)("div",{className:"ghostkit-google-maps-search-note"},(0,Ke.createElement)("p",null,(0,Ke.createElement)("small",null,(0,vs.__)("You can also drag the map to change the center coordinates.","ghostkit"))))):null):(0,Ke.createElement)("div",{className:"ghostkit-google-maps-placeholder",style:{minHeight:s}},(0,Ke.createElement)(Py,null),(0,Ke.createElement)("div",{className:"ghostkit-google-maps-placeholder-key"},(0,Ke.createElement)("div",null,(0,Ke.createElement)("strong",null,(0,vs.__)("Google Maps API Key Required","ghostkit"))),(0,Ke.createElement)("div",null,(0,Ke.createElement)("small",null,(0,vs.__)("Add an API key in block settings.","ghostkit")))))))},save:function(e){const{height:t,zoom:n,lat:o,lng:r,showZoomButtons:i,showMapTypeButtons:s,showStreetViewButton:a,showFullscreenButton:l,optionScrollWheel:c,gestureHandling:u,optionDraggable:h,styleCustom:d,markers:p,fullHeight:g}=e.attributes;let f="ghostkit-google-maps";g&&(f=cs()(f,"ghostkit-google-maps-fullheight")),f=(0,os.applyFilters)("ghostkit.blocks.className",f,{name:nw,...e});const m={className:f,style:{minHeight:t},"data-lat":o,"data-lng":r,"data-zoom":n,"data-show-zoom-buttons":i?"true":"false","data-show-map-type-buttons":s?"true":"false","data-show-street-view-button":a?"true":"false","data-show-fullscreen-button":l?"true":"false","data-option-scroll-wheel":c?"true":"false","data-option-draggable":h?"true":"false","data-styles":gt(d)};"greedy"!==u&&(m["data-gesture-handling"]=u);const v=ds.useBlockProps.save(m);return(0,Ke.createElement)("div",{...v},p?p.map(((e,t)=>{const n=e.iconImageURL&&e.iconImageCustomWidth&&e.iconImageWidth&&e.iconImageHeight,o={"data-title":e.title,"data-lat":e.lat,"data-lng":e.lng,"data-address":e.address};if(n){const t=e.iconImageCustomWidth*(e.iconImageHeight/e.iconImageWidth);o["data-icon-url"]=e.iconImageURL,o["data-icon-width"]=e.iconImageCustomWidth,o["data-icon-height"]=t}e.infoWindowText&&!ds.RichText.isEmpty(e.infoWindowText)&&(o.children=(0,Ke.createElement)("div",{key:"ghostkit-pro-google-maps-marker-info-window-text",className:"ghostkit-pro-google-maps-marker-info-window-text",style:{display:"none"}},(0,Ke.createElement)(ds.RichText.Content,{value:e.infoWindowText})));const r=`marker-${t}`;return(0,Ke.createElement)("div",{key:r,className:"ghostkit-google-maps-marker",...o})})):"")}};function iw(e){const{attributes:t,setAttributes:n}=e,{awb_color:o,awb_type:r,awb_image:i,awb_imageTag:s,awb_imageSizes:a,awb_imageSize:l,awb_imageBackgroundSize:c,awb_imageBackgroundPosition:u}=t;function h(e){const t={};Object.keys(e).forEach((n=>{t[`awb_${n}`]=e[n]})),n(t)}const{fetchedImageTag:d}=(0,Ze.useSelect)((e=>{if(!i)return!1;const t={id:i,size:l,attr:{class:"jarallax-img"}};return"pattern"===c&&(t.div_tag=!0),{fetchedImageTag:e("ghostkit/base/images").getImageTagData(t)}}));return(0,ms.useEffect)((()=>{d&&pt(d)!==s&&h({imageTag:pt(d)})})),(0,Ke.createElement)(us.PanelBody,{title:(0,vs.__)("Background","ghostkit"),initialOpen:!1},(0,Ke.createElement)(ag,{value:"video"===r||"yt_vm_video"===r?"yt_vm_video":r,options:[{label:(0,vs.__)("Color","ghostkit"),value:"color"},{label:(0,vs.__)("Image","ghostkit"),value:"image"},{label:(0,vs.__)("Video","ghostkit"),value:"yt_vm_video"}],onChange:e=>{h({type:e})}}),"image"===r?(0,Ke.createElement)(us.PanelBody,{title:(0,vs.__)("Image","ghostkit"),initialOpen:"image"===r},i&&s?null:(0,Ke.createElement)(ds.MediaUpload,{onSelect:e=>{!function(e,t){t({image:"",imageSizes:""}),wp.media.attachment(e.id).fetch().then((n=>{if(n&&n.sizes){const{url:o}=n.sizes["post-thumbnail"]||n.sizes.medium||n.sizes.medium_large||n.sizes.full;o&&t({image:e.id,imageSizes:n.sizes})}}))}(e,h)},allowedTypes:["image"],value:i,render:({open:e})=>(0,Ke.createElement)(us.Button,{onClick:e,isPrimary:!0},(0,vs.__)("Select image","ghostkit"))}),i&&s?(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(Ss,{value:u,image:gt(s),onChange:e=>h({imageBackgroundPosition:e})}),a?(0,Ke.createElement)(us.SelectControl,{label:(0,vs.__)("Size","ghostkit"),value:l,options:(()=>{const e=[];return Object.keys(a).forEach((t=>{e.push({value:t,label:ut(t)})})),e})(),onChange:e=>h({imageSize:e})}):null,(0,Ke.createElement)(us.SelectControl,{label:(0,vs.__)("Background size","ghostkit"),value:c,options:[{label:(0,vs.__)("Cover","ghostkit"),value:"cover"},{label:(0,vs.__)("Contain","ghostkit"),value:"contain"},{label:(0,vs.__)("Pattern","ghostkit"),value:"pattern"}],onChange:e=>h({imageBackgroundSize:e})}),(0,Ke.createElement)(us.Button,{isLink:!0,onClick:e=>{h({image:"",imageTag:"",imageSizes:""}),e.preventDefault()}},(0,vs.__)("Remove image","ghostkit"))):null):null,"color"===r?(0,Ke.createElement)(gs,{label:(0,vs.__)("Background Color","ghostkit"),value:o,onChange:e=>h({color:e}),alpha:!0}):(0,Ke.createElement)(us.PanelBody,{title:(0,Ke.createElement)(Ke.Fragment,null,(0,vs.__)("Overlay","ghostkit"),(0,Ke.createElement)(hs,{colorValue:o})),initialOpen:"color"===r},(0,Ke.createElement)(gs,{label:(0,vs.__)("Background Color","ghostkit"),value:o,onChange:e=>h({color:e}),alpha:!0})),(0,Ke.createElement)("p",null,(0,vs.__)("Install AWB plugin to set video backgrounds and images with parallax support.","ghostkit")),(0,Ke.createElement)(us.ExternalLink,{className:"components-button is-button is-secondary is-small",href:"https://wordpress.org/plugins/advanced-backgrounds/"},(0,vs.__)("Install","ghostkit")))}function sw(e,t){if((0,cm.hasBlockSupport)(t.name,"awb",!1)){const{awb_color:e,awb_type:n,awb_imageTag:o}=t.attributes;let r=!1;return"color"===n&&e&&(r=!0),"image"===n&&(e||o)&&(r=!0),r?(0,Ke.createElement)("div",{className:"awb-gutenberg-preview-block"},e?(0,Ke.createElement)("div",{className:"nk-awb-overlay",style:{"background-color":e}}):null,"image"===n&&o?(0,Ke.createElement)("div",{className:"nk-awb-inner",dangerouslySetInnerHTML:{__html:gt(o)}}):null):null}return e}function aw(e,t){if((0,cm.hasBlockSupport)(t.name,"awb",!1)){const{awb_color:e,awb_type:n,awb_imageBackgroundSize:o,awb_imageBackgroundPosition:r}=t.attributes;let{awb_imageTag:i}=t.attributes,s=!1;if("color"===n&&e&&(s=!0),"image"===n&&(e||i)&&(s=!0),s){const t={"data-awb-type":n};return"image"===n&&(o&&(t["data-awb-image-background-size"]=o),r&&(t["data-awb-image-background-position"]=r)),"image"===n&&i&&(i=gt(i),i=i.replace("url("","url('"),i=i.replace("");","');")),(0,Ke.createElement)("div",{className:"nk-awb"},(0,Ke.createElement)("div",{className:"nk-awb-wrap",...t},e?(0,Ke.createElement)("div",{className:"nk-awb-overlay",style:{"background-color":e}}):null,"image"===n&&i?(0,Ke.createElement)("div",{className:"nk-awb-inner",dangerouslySetInnerHTML:{__html:i}}):null))}return null}return e}(0,os.addFilter)("blocks.registerBlockType","ghostkit/grid/awb/additional-attributes",(function(e){"ghostkit/grid"!==e.name&&"ghostkit/grid-column"!==e.name||(e.supports.awb=!0);let t=!1;return(0,cm.hasBlockSupport)(e,"awb",!1)&&(t=!0),t&&(e.attributes.awb_type={type:"string",default:"color"},e.attributes.awb_align={type:"string"},e.attributes.awb_color={type:"string",default:""},e.attributes.awb_image={type:"number",default:""},e.attributes.awb_imageTag={type:"string",default:""},e.attributes.awb_imageSizes={type:"object",default:""},e.attributes.awb_imageSize={type:"string",default:"full"},e.attributes.awb_imageBackgroundSize={type:"string",default:"cover"},e.attributes.awb_imageBackgroundPosition={type:"string",default:"50% 50%"}),e})),(0,os.addFilter)("ghostkit.editor.controls","ghostkit/grid/awb/addBackgroundControls",(function(e,t){return"background"===t.attribute&&(0,cm.hasBlockSupport)(t.props.name,"awb",!1)?(0,Ke.createElement)(iw,{...t.props}):e})),(0,os.addFilter)("ghostkit.editor.grid.background","ghostkit/grid/awb/addEditorBackground",sw),(0,os.addFilter)("ghostkit.editor.grid-column.background","ghostkit/grid-column/awb/addEditorBackground",sw),(0,os.addFilter)("ghostkit.blocks.grid.background","ghostkit/grid/addSaveBackground",aw),(0,os.addFilter)("ghostkit.blocks.grid-column.background","ghostkit/grid-column/addSaveBackground",aw);const lw=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"ghostkit/grid","category":"ghostkit","title":"Advanced Columns","description":"Responsive grid block to build layouts of all shapes and sizes thanks to a twelve column system. Visual columns size and order change.","keywords":["row","columns","section"],"supports":{"awb":true,"html":false,"className":false,"anchor":true,"align":["wide","full"],"spacing":{"padding":["vertical"],"margin":["vertical"],"__experimentalDefaultControls":{"padding":false,"margin":false}}},"attributes":{"isTemplatesModalOnly":{"type":"boolean"},"gap":{"type":"string","default":"md"},"gapCustom":{"type":"number"},"gapVerticalCustom":{"type":"number"},"verticalAlign":{"type":"string"},"horizontalAlign":{"type":"string"}}}');function cw(e){const{awb_image:t,awb_imageBackgroundSize:n,awb_imageBackgroundPosition:o}=e,r={"> .nk-awb .jarallax-img":{"object-fit":void 0,"object-position":void 0,"background-repeat":void 0,"background-position":void 0,"font-family":void 0}};return t&&("pattern"!==n?(n&&(r["> .nk-awb .jarallax-img"]["object-fit"]=n),o&&(r["> .nk-awb .jarallax-img"]["object-position"]=o)):(n&&(r["> .nk-awb .jarallax-img"]["background-repeat"]="repeat"),n&&(r["> .nk-awb .jarallax-img"]["background-position"]=o))),r}const{name:uw}=lw,hw={from:[{type:"block",blocks:["core/columns"],transform:(e,t)=>(0,cm.createBlock)("ghostkit/grid",{columns:e.columns},t.map((e=>(0,cm.createBlock)("ghostkit/grid-column",{},e.innerBlocks))))}]},{name:dw}=lw,pw={icon:xi("block-grid",!0),ghostkit:{previewUrl:"https://www.ghostkit.io/docs/blocks/advanced-columns/",customStylesCallback(e){const{gap:t,gapCustom:n,gapVerticalCustom:o}=e,r={"--gkt-grid__gap":void 0,"--gkt-grid__gap-vertical":void 0,...cw(e)};if("custom"===t){if(void 0!==n&&""!==n){const e=n?"px":"%";r["--gkt-grid__gap"]=`${n}${e}`}if(void 0!==o&&""!==o){const e=o?"px":"%";r["--gkt-grid__gap-vertical"]=`${o}${e}`}}return r},customStylesFilter:(e,t,n,o)=>(n&&o?.ghostkit?.id&&(e=e.replace(new RegExp("> .nk-awb .jarallax-img","g"),"> .awb-gutenberg-preview-block .jarallax-img")),e)},example:{attributes:{columns:2},innerBlocks:[{name:"ghostkit/grid-column",innerBlocks:[{name:"core/paragraph",attributes:{content:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis."}}]},{name:"ghostkit/grid-column",innerBlocks:[{name:"core/paragraph",attributes:{content:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis."}}]}]},edit:function(e){const{clientId:t,attributes:n,setAttributes:o}=e,{gap:r,gapCustom:i,gapVerticalCustom:s,verticalAlign:a,horizontalAlign:l}=n,{removeBlock:c,replaceInnerBlocks:u}=(0,Ze.useDispatch)("core/block-editor"),{getBlocks:h,columnsCount:d}=(0,Ze.useSelect)((e=>{const{getBlockCount:n}=e("core/block-editor");return{getBlocks:e("core/block-editor").getBlocks,columnsCount:n(t)}}),[]);function p(e){const t=[],n=e.split("-");return n.forEach((e=>{const o={size:e};"a"===e?o.size="auto":"g"===e&&(o.size="grow"),2===n.length&&(o.md_size="12"),3===n.length&&(o.lg_size="12"),4===n.length&&(o.md_size="12",o.lg_size="6"),5===n.length&&(o.sm_size="12",o.md_size="5",o.lg_size="4"),6===n.length&&(o.sm_size="6",o.md_size="4",o.lg_size="3"),t.push(o)})),t}let g=cs()("ghostkit-grid",`ghostkit-grid-gap-${r}`,!!a&&`ghostkit-grid-align-items-${a}`,!!l&&`ghostkit-grid-justify-content-${l}`);const f=(0,os.applyFilters)("ghostkit.editor.grid.background","",e);f&&(g=cs()(g,"ghostkit-grid-with-bg")),g=(0,os.applyFilters)("ghostkit.editor.className",g,e);const m=(0,ds.useBlockProps)({className:g}),{children:v,...b}=(0,ds.useInnerBlocksProps)(m,{allowedBlocks:["ghostkit/grid-column"],orientation:"horizontal",renderAppender:!1});return(0,Ke.createElement)("div",{...b},d>0?(0,Ke.createElement)(ds.BlockControls,null,(0,Ke.createElement)(us.ToolbarGroup,null,(0,Ke.createElement)(us.ToolbarButton,{icon:xi("icon-vertical-top"),title:(0,vs.__)("Content Vertical Start","ghostkit"),onClick:()=>o({verticalAlign:""}),isActive:""===a}),(0,Ke.createElement)(us.ToolbarButton,{icon:xi("icon-vertical-center"),title:(0,vs.__)("Content Vertical Center","ghostkit"),onClick:()=>o({verticalAlign:"center"}),isActive:"center"===a}),(0,Ke.createElement)(us.ToolbarButton,{icon:xi("icon-vertical-bottom"),title:(0,vs.__)("Content Vertical End","ghostkit"),onClick:()=>o({verticalAlign:"end"}),isActive:"end"===a}))):null,(0,Ke.createElement)(ds.InspectorControls,null,(0,Ke.createElement)(rs,{name:"ghostkit.editor.controls",attribute:"columns",props:e},(0,Ke.createElement)(us.PanelBody,null,(0,Ke.createElement)(rg,{label:(0,vs.__)("Columns","ghostkit"),value:d,onChange:e=>function(e){if(e<1)c(t);else if(e>d){const n=e-d,o=[...h(t)];for(let e=1;e<=n;e+=1)o.push((0,cm.createBlock)("ghostkit/grid-column",{size:3}));u(t,o,!1)}else if(e","ghostkit")},{value:"h5",label:(0,vs.__)("
","ghostkit")},{value:"h6",label:(0,vs.__)("
","ghostkit")}],onChange:e=>n({collapseTitleTag:e})}))),(0,Ke.createElement)("div",{...d}),l?(0,Ke.createElement)("div",{className:"ghostkit-accordion-add-item"},(0,Ke.createElement)(us.Button,{isSecondary:!0,icon:(0,Ke.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",role:"img",focusable:"false"},(0,Ke.createElement)("path",{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"})),onClick:()=>{u((0,cm.createBlock)(hm),void 0,o)}},(0,vs.__)("Add Accordion Item","ghostkit"))):null)},save:function(e){const{itemsCount:t,collapseOne:n}=e.attributes;let o=cs()("ghostkit-accordion",`ghostkit-accordion-${t}`,n&&"ghostkit-accordion-collapse-one");o=(0,os.applyFilters)("ghostkit.blocks.className",o,{name:dm,...e});const r=ds.useBlockProps.save({className:o}),i=ds.useInnerBlocksProps.save(r);return(0,Ke.createElement)("div",{...i})},transforms:pm},mm=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"ghostkit/accordion-item","parent":["ghostkit/accordion"],"category":"ghostkit","title":"Item","description":"A single item within a accordion block.","supports":{"html":false,"className":false,"anchor":true,"align":["wide","full"],"reusable":false,"spacing":{"blockGap":true,"__experimentalDefaultControls":{"blockGap":true}},"__experimentalLayout":true,"layout":true},"usesContext":["ghostkit/collapseTitleTag"],"attributes":{"heading":{"type":"string","source":"html","selector":".ghostkit-accordion-item-label","default":"Accordion Item"},"titleTag":{"type":"string","default":"div"},"slug":{"type":"string"},"active":{"type":"boolean","default":false}}}'),{name:vm}=mm,bm=[{...mm,save:function(e){const{attributes:t}=e,{heading:n,active:o,slug:r,titleTag:i}=t;let s=cs()("ghostkit-accordion-item",o&&"ghostkit-accordion-item-active");s=(0,os.applyFilters)("ghostkit.blocks.className",s,{name:vm,...e});const a=i||"div",l=ds.useBlockProps.save({className:s}),c=ds.useInnerBlocksProps.save({className:"ghostkit-accordion-item-content"});return(0,Ke.createElement)("div",{...l},(0,Ke.createElement)(a,{className:"ghostkit-accordion-item-heading"},(0,Ke.createElement)("a",{href:`#${r}`},(0,Ke.createElement)(ds.RichText.Content,{className:"ghostkit-accordion-item-label",tagName:"span",value:n}),(0,Ke.createElement)("span",{className:"ghostkit-accordion-item-collapse"},(0,Ke.createElement)("svg",{className:"ghostkit-svg-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,Ke.createElement)("path",{d:"M9.21967 6.2197C9.51256 5.9268 9.98744 5.9268 10.2803 6.2197L15.5303 11.4697C15.8232 11.7626 15.8232 12.2374 15.5303 12.5303L10.2803 17.7803C9.98744 18.0732 9.51256 18.0732 9.21967 17.7803C8.92678 17.4874 8.92678 17.0126 9.21967 16.7197L13.9393 12L9.21967 7.2803C8.92678 6.9874 8.92678 6.5126 9.21967 6.2197Z",fill:"currentColor"}))))),(0,Ke.createElement)("div",{...c}))}},{...mm,save:class extends ms.Component{render(){const{attributes:e}=this.props,{heading:t,active:n,slug:o}=e;let r=cs()("ghostkit-accordion-item",n&&"ghostkit-accordion-item-active");return r=(0,os.applyFilters)("ghostkit.blocks.className",r,{name:vm,...this.props}),(0,Ke.createElement)("div",{className:r},(0,Ke.createElement)("a",{href:`#${o}`,className:"ghostkit-accordion-item-heading"},(0,Ke.createElement)(ds.RichText.Content,{className:"ghostkit-accordion-item-label",tagName:"span",value:t}),(0,Ke.createElement)("span",{className:"ghostkit-accordion-item-collapse"},(0,Ke.createElement)("svg",{className:"ghostkit-svg-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,Ke.createElement)("path",{d:"M9.21967 6.2197C9.51256 5.9268 9.98744 5.9268 10.2803 6.2197L15.5303 11.4697C15.8232 11.7626 15.8232 12.2374 15.5303 12.5303L10.2803 17.7803C9.98744 18.0732 9.51256 18.0732 9.21967 17.7803C8.92678 17.4874 8.92678 17.0126 9.21967 16.7197L13.9393 12L9.21967 7.2803C8.92678 6.9874 8.92678 6.5126 9.21967 6.2197Z",fill:"currentColor"})))),(0,Ke.createElement)("div",{className:"ghostkit-accordion-item-content"},(0,Ke.createElement)(ds.InnerBlocks.Content,null)))}}}],{name:ym}=mm,{name:wm}=mm,km={icon:xi("block-accordion-item",!0),edit:function(e){const{attributes:t,setAttributes:n,context:o,clientId:r}=e,{heading:i,slug:s,active:a,titleTag:l}=t,c=(0,ms.useRef)(),u=o["ghostkit/collapseTitleTag"]||"div";(0,ms.useEffect)((()=>{if(c.current){const e=Pi(`accordion ${i}`,r);n({slug:e})}else c.current=!0}),[i,s]),(0,ms.useEffect)((()=>{l!==u&&n({titleTag:u})}),[u,n,l]);let h=cs()(t.className,"ghostkit-accordion-item",a&&"ghostkit-accordion-item-active");h=(0,os.applyFilters)("ghostkit.editor.className",h,e);const{hasChildBlocks:d}=(0,Ze.useSelect)((e=>{const t=e("core/block-editor");return{hasChildBlocks:!!t&&t.getBlockOrder(r).length>0}}),[r]),p=l||"div",g=(0,ds.useBlockProps)({className:h,"data-accordion":s}),f=(0,ds.useInnerBlocksProps)({id:`${s}-content`,className:"ghostkit-accordion-item-content"},{templateLock:!1,renderAppender:d?void 0:ds.InnerBlocks.ButtonBlockAppender});return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(ds.BlockControls,null,(0,Ke.createElement)(us.ToolbarGroup,null,(0,Ke.createElement)(us.ToolbarButton,{icon:xi("block-accordion-collapse"),label:(0,vs.__)("Collapse","ghostkit"),onClick:()=>n({active:!a}),isActive:a}))),(0,Ke.createElement)("div",{...g},(0,Ke.createElement)(p,{className:"ghostkit-accordion-item-heading"},(0,Ke.createElement)(ds.RichText,{tagName:"div",id:`${s}-button`,className:"ghostkit-accordion-item-label",placeholder:(0,vs.__)("Write label…","ghostkit"),value:i,onChange:e=>{n({heading:e})},withoutInteractiveFormatting:!0}),(0,Ke.createElement)("button",{className:"ghostkit-accordion-item-collapse",onClick:()=>n({active:!a})},(0,Ke.createElement)("svg",{className:"ghostkit-svg-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,Ke.createElement)("path",{d:"M9.21967 6.2197C9.51256 5.9268 9.98744 5.9268 10.2803 6.2197L15.5303 11.4697C15.8232 11.7626 15.8232 12.2374 15.5303 12.5303L10.2803 17.7803C9.98744 18.0732 9.51256 18.0732 9.21967 17.7803C8.92678 17.4874 8.92678 17.0126 9.21967 16.7197L13.9393 12L9.21967 7.2803C8.92678 6.9874 8.92678 6.5126 9.21967 6.2197Z",fill:"currentColor"})))),(0,Ke.createElement)("div",{...f})))},save:function(e){const{attributes:t}=e,{heading:n,active:o,slug:r,titleTag:i}=t;let s=cs()("ghostkit-accordion-item",o&&"ghostkit-accordion-item-active");s=(0,os.applyFilters)("ghostkit.blocks.className",s,{name:ym,...e});const a=i||"div",l=ds.useBlockProps.save({className:s,"data-accordion":r}),c=ds.useInnerBlocksProps.save({id:`${r}-content`,className:"ghostkit-accordion-item-content",role:"region","aria-labelledby":`${r}-button`});return(0,Ke.createElement)("div",{...l},(0,Ke.createElement)(a,{className:"ghostkit-accordion-item-heading"},(0,Ke.createElement)("button",{type:"button",id:`${r}-button`,"aria-expanded":o?"true":"false","aria-controls":`${r}-content`},(0,Ke.createElement)(ds.RichText.Content,{className:"ghostkit-accordion-item-label",tagName:"span",value:n}),(0,Ke.createElement)("span",{className:"ghostkit-accordion-item-collapse"},(0,Ke.createElement)("svg",{className:"ghostkit-svg-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,Ke.createElement)("path",{d:"M9.21967 6.2197C9.51256 5.9268 9.98744 5.9268 10.2803 6.2197L15.5303 11.4697C15.8232 11.7626 15.8232 12.2374 15.5303 12.5303L10.2803 17.7803C9.98744 18.0732 9.51256 18.0732 9.21967 17.7803C8.92678 17.4874 8.92678 17.0126 9.21967 16.7197L13.9393 12L9.21967 7.2803C8.92678 6.9874 8.92678 6.5126 9.21967 6.2197Z",fill:"currentColor"}))))),(0,Ke.createElement)("div",{...c}))},deprecated:bm},_m=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"ghostkit/alert","category":"ghostkit","title":"Alert","description":"Provide contextual feedback messages for user actions.","keywords":["alert","notification"],"supports":{"html":false,"className":false,"anchor":true,"align":["wide","full"],"spacing":{"blockGap":true,"__experimentalDefaultControls":{"blockGap":true}},"__experimentalLayout":true,"layout":true},"attributes":{"color":{"type":"string"},"hoverColor":{"type":"string"},"icon":{"type":"string","default":"%3Csvg%20class%3D%22ghostkit-svg-icon%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M12.8681%204.0311C12.7806%203.87815%2012.6542%203.75104%2012.5018%203.66263C12.3494%203.57422%2012.1763%203.52766%2012.0001%203.52766C11.8239%203.52766%2011.6508%203.57422%2011.4984%203.66263C11.346%203.75104%2011.2196%203.87815%2011.1321%204.0311L3.14706%2018.0041C3.06016%2018.1562%203.01475%2018.3285%203.01539%2018.5037C3.01602%2018.6789%203.06268%2018.8509%203.15068%2019.0024C3.23868%2019.1539%203.36494%2019.2796%203.51682%2019.367C3.66869%2019.4543%203.84085%2019.5002%204.01606%2019.5001H19.9841C20.1593%2019.5002%2020.3315%2019.4543%2020.4833%2019.367C20.6352%2019.2796%2020.7615%2019.1539%2020.8495%2019.0024C20.9375%2018.8509%2020.9841%2018.6789%2020.9848%2018.5037C20.9854%2018.3285%2020.94%2018.1562%2020.8531%2018.0041L12.8681%204.0301V4.0311ZM9.83006%203.2871C10.7901%201.6071%2013.2121%201.6071%2014.1721%203.2871L22.1561%2017.2601C23.1081%2018.9261%2021.9051%2021.0001%2019.9861%2021.0001H4.01406C2.09506%2021.0001%200.892055%2018.9261%201.84406%2017.2601L9.82906%203.2871H9.83006ZM12.0001%207.9631C12.199%207.9631%2012.3898%208.04212%2012.5304%208.18277C12.6711%208.32342%2012.7501%208.51419%2012.7501%208.7131V12.2501C12.7501%2012.449%2012.6711%2012.6398%2012.5304%2012.7804C12.3898%2012.9211%2012.199%2013.0001%2012.0001%2013.0001C11.8012%2013.0001%2011.6104%2012.9211%2011.4698%2012.7804C11.3291%2012.6398%2011.2501%2012.449%2011.2501%2012.2501V8.7131C11.2501%208.51419%2011.3291%208.32342%2011.4698%208.18277C11.6104%208.04212%2011.8012%207.9631%2012.0001%207.9631ZM12.0001%2015.0001C11.7349%2015.0001%2011.4805%2015.1055%2011.293%2015.293C11.1055%2015.4805%2011.0001%2015.7349%2011.0001%2016.0001C11.0001%2016.2653%2011.1055%2016.5197%2011.293%2016.7072C11.4805%2016.8948%2011.7349%2017.0001%2012.0001%2017.0001C12.2653%2017.0001%2012.5197%2016.8948%2012.7072%2016.7072C12.8947%2016.5197%2013.0001%2016.2653%2013.0001%2016.0001C13.0001%2015.7349%2012.8947%2015.4805%2012.7072%2015.293C12.5197%2015.1055%2012.2653%2015.0001%2012.0001%2015.0001Z%22%20fill%3D%22currentColor%22%2F%3E%3C%2Fsvg%3E"},"iconSize":{"type":"number"},"hideButton":{"type":"boolean","default":false}}}'),{name:Cm}=_m,xm={from:[{type:"block",blocks:["ghostkit/counter-box"],transform:(e,t)=>(0,cm.createBlock)("ghostkit/alert",{iconSize:e.numberSize,color:e.numberColor,hoverColor:e.hoverNumberColor},t)},{type:"block",blocks:["ghostkit/icon-box"],transform:(e,t)=>(0,cm.createBlock)("ghostkit/alert",{iconSize:e.iconSize,color:e.iconColor,hoverColor:e.hoverIconColor},t)}]},{name:Sm}=_m,Em={icon:xi("block-alert",!0),ghostkit:{previewUrl:"https://www.ghostkit.io/docs/blocks/alert/",customStylesCallback(e){const t={"--gkt-alert__border-color":e.color||void 0,"--gkt-alert--icon__font-size":void 0,"--gkt-alert--icon__color":e.color||void 0,"&:hover":{"--gkt-alert__border-color":e.hoverColor||void 0,"--gkt-alert--icon__color":e.hoverColor||void 0}};return void 0!==e.iconSize&&""!==e.iconSize&&(t["--gkt-alert--icon__font-size"]=`${e.iconSize}px`),t}},example:{attributes:{color:"#E47F3B",ghostkit:{id:"example-alert"},className:"ghostkit-custom-example-alert"},innerBlocks:[{name:"core/paragraph",attributes:{content:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis."}}]},edit:function(e){const{attributes:t,setAttributes:n}=e;let{className:o=""}=e;const{color:r,hoverColor:i,icon:s,iconSize:a,hideButton:l}=t,c=(0,Ze.useSelect)((t=>{const n=t("core/block-editor");return!!n&&n.getBlockOrder(e.clientId).length>0}),[e.clientId]);o=cs()("ghostkit-alert",o),o=(0,os.applyFilters)("ghostkit.editor.className",o,e);const u=(0,ds.useBlockProps)({className:o}),h=(0,ds.useInnerBlocksProps)({className:"ghostkit-alert-content"},{renderAppender:c?void 0:ds.InnerBlocks.ButtonBlockAppender,templateLock:!1});return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(ds.BlockControls,null,(0,Ke.createElement)(us.ToolbarGroup,null,(0,Ke.createElement)(us.ToolbarDropdownMenu,{icon:"info",label:(0,vs.__)("Type","ghostkit"),controls:[{title:(0,vs.__)("Primary","ghostkit"),icon:"editor-help",isActive:"#2E77C3"===r,onClick:()=>n({color:"#2E77C3"})},{title:(0,vs.__)("Success","ghostkit"),icon:"marker",isActive:"#22CF6E"===r,onClick:()=>n({color:"#22CF6E"})},{title:(0,vs.__)("Danger","ghostkit"),icon:"dismiss",isActive:"#DC3232"===r,onClick:()=>n({color:"#DC3232"})},{title:(0,vs.__)("Warning","ghostkit"),icon:"warning",isActive:"#E47F3B"===r,onClick:()=>n({color:"#E47F3B"})},{title:(0,vs.__)("Info","ghostkit"),icon:"info",isActive:"#2DC7E8"===r,onClick:()=>n({color:"#2DC7E8"})}]}))),(0,Ke.createElement)(ds.InspectorControls,null,(0,Ke.createElement)(us.PanelBody,null,(0,Ke.createElement)(ep,{label:(0,vs.__)("Icon","ghostkit"),value:s,onChange:e=>n({icon:e}),insideInspector:!0}),s?(0,Ke.createElement)(rg,{label:(0,vs.__)("Icon Size","ghostkit"),value:a,onChange:e=>n({iconSize:e}),min:20,max:100,beforeIcon:"editor-textcolor",afterIcon:"editor-textcolor",allowCustomMin:!0,allowCustomMax:!0}):null),(0,Ke.createElement)(us.PanelBody,null,(0,Ke.createElement)(us.ToggleControl,{label:(0,vs.__)("Dismiss button","ghostkit"),checked:!!l,onChange:e=>n({hideButton:e})})),(0,Ke.createElement)(us.PanelBody,{title:(0,Ke.createElement)(Ke.Fragment,null,(0,vs.__)("Colors","ghostkit"),(0,Ke.createElement)(hs,{colorValue:r})),initialOpen:!1},(0,Ke.createElement)(us.TabPanel,{className:"ghostkit-control-tabs ghostkit-control-tabs-wide",tabs:[{name:"normal",title:(0,vs.__)("Normal","ghostkit"),className:"ghostkit-control-tabs-tab"},{name:"hover",title:(0,vs.__)("Hover","ghostkit"),className:"ghostkit-control-tabs-tab"}]},(t=>{const o="hover"===t.name;return(0,Ke.createElement)(rs,{name:"ghostkit.editor.controls",attribute:o?"hoverColor":"color",props:e},(0,Ke.createElement)(gs,{label:(0,vs.__)("Color","ghostkit"),value:o?i:r,onChange:e=>n(o?{hoverColor:e}:{color:e}),alpha:!0}))})))),(0,Ke.createElement)("div",{...u},s?(0,Ke.createElement)("div",{className:"ghostkit-alert-icon"},(0,Ke.createElement)(ep.Dropdown,{onChange:e=>n({icon:e}),value:s,renderToggle:({onToggle:e})=>(0,Ke.createElement)(ep.Preview,{onClick:e,name:s})})):null,(0,Ke.createElement)("div",{...h}),l?(0,Ke.createElement)("div",{className:"ghostkit-alert-hide-button"},(0,Ke.createElement)("svg",{className:"ghostkit-svg-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,Ke.createElement)("path",{d:"M6.21967 6.21967C6.51256 5.92678 6.98744 5.92678 7.28033 6.21967L12 10.9393L16.7197 6.21967C17.0126 5.92678 17.4874 5.92678 17.7803 6.21967C18.0732 6.51256 18.0732 6.98744 17.7803 7.28033L13.0607 12L17.7803 16.7197C18.0732 17.0126 18.0732 17.4874 17.7803 17.7803C17.4874 18.0732 17.0126 18.0732 16.7197 17.7803L12 13.0607L7.28033 17.7803C6.98744 18.0732 6.51256 18.0732 6.21967 17.7803C5.92678 17.4874 5.92678 17.0126 6.21967 16.7197L10.9393 12L6.21967 7.28033C5.92678 6.98744 5.92678 6.51256 6.21967 6.21967Z",fill:"currentColor"}))):null))},save:function(e){const{icon:t,hideButton:n}=e.attributes;let o="ghostkit-alert";o=(0,os.applyFilters)("ghostkit.blocks.className",o,{name:Cm,...e});const r=ds.useBlockProps.save({className:o}),i=ds.useInnerBlocksProps.save({className:"ghostkit-alert-content"});return(0,Ke.createElement)("div",{...r},t?(0,Ke.createElement)(ep.Render,{name:t,tag:"div",className:"ghostkit-alert-icon"}):null,(0,Ke.createElement)("div",{...i}),n?(0,Ke.createElement)("div",{className:"ghostkit-alert-hide-button"},(0,Ke.createElement)("svg",{className:"ghostkit-svg-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,Ke.createElement)("path",{d:"M6.21967 6.21967C6.51256 5.92678 6.98744 5.92678 7.28033 6.21967L12 10.9393L16.7197 6.21967C17.0126 5.92678 17.4874 5.92678 17.7803 6.21967C18.0732 6.51256 18.0732 6.98744 17.7803 7.28033L13.0607 12L17.7803 16.7197C18.0732 17.0126 18.0732 17.4874 17.7803 17.7803C17.4874 18.0732 17.0126 18.0732 16.7197 17.7803L12 13.0607L7.28033 17.7803C6.98744 18.0732 6.51256 18.0732 6.21967 17.7803C5.92678 17.4874 5.92678 17.0126 6.21967 16.7197L10.9393 12L6.21967 7.28033C5.92678 6.98744 5.92678 6.51256 6.21967 6.21967Z",fill:"currentColor"}))):null)},transforms:xm},Am=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"ghostkit/button","category":"ghostkit","title":"Buttons","description":"Change important links to buttons to get more click rate.","keywords":["btn","button"],"supports":{"html":false,"className":false,"anchor":true},"attributes":{"align":{"type":"string","default":"none"},"count":{"type":"number","default":1},"gap":{"type":"string","default":"md"},"gapCustom":{"type":"number"},"gapCustomVertical":{"type":"number"}}}'),Tm={no:0,sm:15,md:30,lg:45};function $m(e){const{gap:t,gapCustom:n,gapVerticalCustom:o,allowVerticalGap:r,onChange:i}=e;return(0,Ke.createElement)(us.BaseControl,{id:(0,vs.__)("Gap","ghostkit"),label:(0,vs.__)("Gap","ghostkit"),className:"ghostkit-components-gap-settings"},(0,Ke.createElement)(ag,{value:t,options:[{label:(0,vs.__)("None","ghostkit"),value:"no"},{label:(0,vs.__)("S","ghostkit"),value:"sm"},{label:(0,vs.__)("M","ghostkit"),value:"md"},{label:(0,vs.__)("L","ghostkit"),value:"lg"},{label:(0,Ke.createElement)("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",role:"img","aria-hidden":"true",focusable:"false"},(0,Ke.createElement)("path",{d:"M14.5 13.8c-1.1 0-2.1.7-2.4 1.8H4V17h8.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20v-1.5h-3.1c-.3-1-1.3-1.7-2.4-1.7zM11.9 7c-.3-1-1.3-1.8-2.4-1.8S7.4 6 7.1 7H4v1.5h3.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20V7h-8.1z",fill:"currentColor"})),value:"custom"}],onChange:e=>{const n={gap:e};"custom"===e&&"custom"!==t&&void 0!==Tm[t]&&(n.gapCustom=Tm[t]),"custom"!==e&&(n.gapVerticalCustom=void 0),i(n)},isBlock:!0}),"custom"===t?(0,Ke.createElement)("div",{className:"ghostkit-components-gap-settings-custom"},(0,Ke.createElement)(us.TextControl,{type:"number",help:r?(0,vs.__)("Horizontal","ghostkit"):"",value:n,onChange:e=>i({gapCustom:""===e?void 0:parseFloat(e)}),min:0}),r?(0,Ke.createElement)(us.TextControl,{type:"number",help:(0,vs.__)("Vertical","ghostkit"),placeholder:n,value:o,onChange:e=>i({gapVerticalCustom:""===e?void 0:parseFloat(e)}),min:0}):null):null)}const Mm="ghostkit/button-single",{name:Rm}=Am,Om={from:[{type:"block",blocks:["core/button"],transform:e=>(0,cm.createBlock)("ghostkit/button",{align:e.align,count:1},[(0,cm.createBlock)("ghostkit/button-single",{url:e.url,text:e.text})])}]},{name:Lm}=Am,Im={icon:xi("block-buttons",!0),ghostkit:{previewUrl:"https://www.ghostkit.io/docs/blocks/button/",customStylesCallback(e){const{gap:t,gapCustom:n,gapVerticalCustom:o}=e,r={"--gkt-button__gap":void 0,"--gkt-button__gap-vertical":void 0};if("custom"===t){if(void 0!==n){const e=n?"px":"%";r["--gkt-button__gap"]=`${n}${e}`}if(void 0!==o){const e=o?"px":"%";r["--gkt-button__gap-vertical"]=`${o}${e}`}}return r}},example:{attributes:{count:2,align:"center",gap:"lg"},innerBlocks:[{name:"ghostkit/button-single",attributes:{text:"Button 1",size:"xl",color:"#0366d6",ghostkit:{id:"example-button-1"},className:"ghostkit-custom-example-button-1"}},{name:"ghostkit/button-single",attributes:{text:"Button 2",size:"xl",color:"#2F1747",icon:'',borderRadius:50,ghostkit:{id:"example-button-2"},className:"ghostkit-custom-example-button-2"}}]},edit:function(e){const{attributes:t,setAttributes:n,clientId:o}=e;let{className:r=""}=e;const{align:i,gap:s,gapCustom:a,gapVerticalCustom:l,count:c}=t,{block:u,isSelectedBlockInRoot:h}=(0,Ze.useSelect)((e=>{const{getBlock:t,isBlockSelected:n,hasSelectedInnerBlock:r}=e("core/block-editor");return{block:t(o),isSelectedBlockInRoot:n(o)||r(o,!0)}}),[]),{insertBlock:d}=(0,Ze.useDispatch)("core/block-editor");(0,ms.useEffect)((()=>{u&&u.innerBlocks&&c!==u.innerBlocks.length&&n({count:u.innerBlocks.length})}),[u,u?.innerBlocks?.length,c,n]),r=cs()("ghostkit-button-wrapper",!!s&&`ghostkit-button-wrapper-gap-${s}`,!(!i||"none"===i)&&`ghostkit-button-wrapper-align-${i}`,r),r=(0,os.applyFilters)("ghostkit.editor.className",r,e);const p=(0,ds.useBlockProps)({className:r}),{children:g,...f}=(0,ds.useInnerBlocksProps)({className:"ghostkit-button-wrapper-inner"},{allowedBlocks:[Mm],template:[[Mm]],orientation:"horizontal",directInsert:!0,templateInsertUpdatesSelection:!0,renderAppender:h?()=>(0,Ke.createElement)(us.Tooltip,{text:(0,vs.__)("Add Button","ghostkit")},(0,Ke.createElement)(us.Button,{className:"block-list-appender__toggle block-editor-button-block-appender",icon:(0,Ke.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",focusable:"false"},(0,Ke.createElement)("path",{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"})),onClick:()=>{d((0,cm.createBlock)(Mm),void 0,o)}})):void 0});return(0,Ke.createElement)("div",{...p},(0,Ke.createElement)(ds.BlockControls,null,(0,Ke.createElement)(ds.BlockAlignmentToolbar,{value:i,onChange:e=>n({align:e}),controls:["left","center","right"]})),(0,Ke.createElement)(ds.InspectorControls,null,(0,Ke.createElement)(us.PanelBody,null,(0,Ke.createElement)($m,{gap:s,gapCustom:a,gapVerticalCustom:l,onChange:e=>{n(e)},allowVerticalGap:!0}),(0,Ke.createElement)(us.BaseControl,{id:(0,vs.__)("Align","ghostkit"),label:(0,vs.__)("Align","ghostkit")},(0,Ke.createElement)("div",null,(0,Ke.createElement)(ds.BlockAlignmentToolbar,{value:i,onChange:e=>n({align:e}),controls:["left","center","right"],isCollapsed:!1}))))),(0,Ke.createElement)("div",{...f},g))},save:function(e){const{align:t,gap:n}=e.attributes;let o=cs()("ghostkit-button-wrapper",!!n&&`ghostkit-button-wrapper-gap-${n}`,!(!t||"none"===t)&&`ghostkit-button-wrapper-align-${t}`);o=(0,os.applyFilters)("ghostkit.blocks.className",o,{name:Rm,...e});const r=ds.useBlockProps.save({className:o}),{children:i,...s}=ds.useInnerBlocksProps.save({className:"ghostkit-button-wrapper-inner"});return(0,Ke.createElement)("div",{...r},(0,Ke.createElement)("div",{...s},i))},transforms:Om},Pm=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"ghostkit/button-single","parent":["ghostkit/button","ghostkit/form","ghostkit/form-submit-button"],"category":"ghostkit","title":"Button","description":"A single button within a buttons wrapper block.","supports":{"html":false,"className":false,"anchor":true,"reusable":false},"attributes":{"tagName":{"type":"string"},"url":{"type":"string","source":"attribute","selector":"a.ghostkit-button","attribute":"href"},"ariaLabel":{"type":"string","source":"attribute","selector":"a.ghostkit-button","attribute":"aria-label"},"target":{"type":"string","source":"attribute","selector":"a.ghostkit-button","attribute":"target"},"rel":{"type":"string","source":"attribute","selector":"a.ghostkit-button","attribute":"rel"},"text":{"type":"string","source":"html","selector":".ghostkit-button .ghostkit-button-text","default":"Button"},"hideText":{"type":"boolean","default":false},"icon":{"type":"string","default":""},"iconPosition":{"type":"string","default":"left"},"size":{"type":"string","default":"md"},"color":{"type":"string"},"textColor":{"type":"string"},"borderRadius":{"type":"number"},"borderWeight":{"type":"number"},"borderColor":{"type":"string"},"focusOutlineWeight":{"type":"number"},"hoverColor":{"type":"string"},"hoverTextColor":{"type":"string"},"hoverBorderColor":{"type":"string"},"focusOutlineColor":{"type":"string","default":"rgba(3, 102, 214, 0.5)"}}}'),{name:Nm}=Pm,Dm=[{...Pm,attributes:{tagName:{type:"string"},url:{type:"string",source:"attribute",selector:"a.ghostkit-button",attribute:"href"},target:{type:"string",source:"attribute",selector:"a.ghostkit-button",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a.ghostkit-button",attribute:"rel"},text:{type:"string",source:"html",selector:".ghostkit-button .ghostkit-button-text",default:"Button"},hideText:{type:"boolean",default:!1},icon:{type:"string",default:""},iconPosition:{type:"string",default:"left"},size:{type:"string",default:"md"},color:{type:"string"},textColor:{type:"string"},borderRadius:{type:"number"},borderWeight:{type:"number"},borderColor:{type:"string"},focusOutlineWeight:{type:"number"},hoverColor:{type:"string"},hoverTextColor:{type:"string"},hoverBorderColor:{type:"string"},focusOutlineColor:{type:"string",default:"rgba(3, 102, 214, 0.5)"}},save:function(e){const{tagName:t,text:n,icon:o,iconPosition:r,hideText:i,url:s,target:a,rel:l,size:c,focusOutlineWeight:u,focusOutlineColor:h}=e.attributes;let d=cs()("ghostkit-button",c&&`ghostkit-button-${c}`,i&&"ghostkit-button-icon-only");u&&h&&(d=cs()(d,"ghostkit-button-with-outline")),d=(0,os.applyFilters)("ghostkit.blocks.className",d,{name:Nm,...e});const p=[];i||p.push((0,Ke.createElement)(ds.RichText.Content,{tagName:"span",className:"ghostkit-button-text",value:n,key:"button-text"})),o&&p.unshift((0,Ke.createElement)(ep.Render,{name:o,tag:"span",className:"ghostkit-button-icon ghostkit-button-icon-"+("right"===r?"right":"left"),key:"button-icon"}));const g=t||(s?"a":"span"),f=ds.useBlockProps.save({className:d,..."a"===g?{href:s,target:a||!1,rel:l||!1}:{}});return(0,Ke.createElement)(g,{...f},p)}}],Fm=[{label:"XS",value:"xs"},{label:"S",value:"sm"},{label:"M",value:"md"},{label:"L",value:"lg"},{label:"XL",value:"xl"}],{name:zm}=Pm,{name:Bm}=Pm,jm={icon:xi("block-button",!0),ghostkit:{customStylesCallback(e){const t={"--gkt-button__background-color":e.color||void 0,"--gkt-button__color":e.textColor||void 0,"--gkt-button__border-radius":void 0,"--gkt-button__border-width":void 0,"--gkt-button__border-color":e.borderColor||void 0,"--gkt-button-hover__background-color":e.hoverColor||void 0,"--gkt-button-hover__color":e.hoverTextColor||void 0,"--gkt-button-hover__border-color":e.hoverBorderColor||void 0,"--gkt-button-focus__background-color":e.hoverColor||void 0,"--gkt-button-focus__color":e.hoverTextColor||void 0,"--gkt-button-focus__box-shadow":void 0};return void 0!==e.borderRadius&&""!==e.borderRadius&&(t["--gkt-button__border-radius"]=`${e.borderRadius}px`),void 0!==e.borderWeight&&""!==e.borderWeight&&(t["--gkt-button__border-width"]=`${e.borderWeight}px`),void 0!==e.focusOutlineWeight&&e.focusOutlineColor&&(t["--gkt-button-focus__box-shadow"]=`0 0 0 ${e.focusOutlineWeight}px ${e.focusOutlineColor}`),t}},edit:function(e){const{attributes:t,setAttributes:n,isSelected:o}=e,{tagName:r,text:i,icon:s,iconPosition:a,hideText:l,url:c,ariaLabel:u,target:h,rel:d,size:p,color:g,textColor:f,borderRadius:m,borderWeight:v,borderColor:b,focusOutlineWeight:y,focusOutlineColor:w,hoverColor:k,hoverTextColor:_,hoverBorderColor:C}=t;let{className:x=""}=t;const[S,E]=(0,ms.useState)("normal");(0,ms.useEffect)((()=>{o||E("normal")}),[o]);let A=!1,T=!1,$=!1;o&&(A=!0,"hover"===S?(A=!1,T=!0):"focus"===S&&(A=!1,$=!0)),x=cs()("ghostkit-button",p&&`ghostkit-button-${p}`,l&&"ghostkit-button-icon-only",A&&"ghostkit-button-is-normal-state",T&&"ghostkit-button-is-hover-state",$&&"ghostkit-button-is-focus-state",x),y&&w&&(x=cs()(x,"ghostkit-button-with-outline")),x=(0,os.applyFilters)("ghostkit.editor.className",x,e);const M=[{name:"normal",title:(0,vs.__)("Normal","ghostkit"),className:"ghostkit-control-tabs-tab"},{name:"hover",title:(0,vs.__)("Hover","ghostkit"),className:"ghostkit-control-tabs-tab"}];y&&w&&M.push({name:"focus",title:(0,vs.__)("Focus","ghostkit"),className:"ghostkit-control-tabs-tab"});const R=(0,ds.useBlockProps)({className:x});return(0,Ke.createElement)("div",{...R},(0,Ke.createElement)(ds.InspectorControls,null,(0,Ke.createElement)(us.PanelBody,null,(0,Ke.createElement)("div",{className:"blocks-size__main"},(0,Ke.createElement)(ag,{value:p,options:Fm,onChange:e=>{n({size:e})}}))),(0,Ke.createElement)(us.PanelBody,null,(0,Ke.createElement)(rg,{label:(0,vs.__)("Corner Radius","ghostkit"),value:m,min:0,max:50,onChange:e=>n({borderRadius:e}),allowCustomMax:!0}),(0,Ke.createElement)(rg,{label:(0,vs.__)("Border Size","ghostkit"),value:v,min:0,max:6,onChange:e=>n({borderWeight:e}),allowCustomMax:!0}),(0,Ke.createElement)(rg,{label:(0,vs.__)("Focus Outline Size","ghostkit"),value:y,min:0,max:6,onChange:e=>n({focusOutlineWeight:e}),allowCustomMax:!0})),(0,Ke.createElement)(us.PanelBody,null,(0,Ke.createElement)(ep,{label:(0,vs.__)("Icon","ghostkit"),value:s,onChange:e=>n({icon:e}),insideInspector:!0}),s?(0,Ke.createElement)(us.ToggleControl,{label:(0,vs.__)("Show Icon Only","ghostkit"),checked:!!l,onChange:e=>n({hideText:e})}):null,s&&!l?(0,Ke.createElement)(us.SelectControl,{label:(0,vs.__)("Icon Position","ghostkit"),value:a,options:[{value:"left",label:(0,vs.__)("Left","ghostkit")},{value:"right",label:(0,vs.__)("Right","ghostkit")}],onChange:e=>n({iconPosition:e})}):null),(0,Ke.createElement)(us.PanelBody,{title:(0,Ke.createElement)(Ke.Fragment,null,(0,vs.__)("Colors","ghostkit"),(0,Ke.createElement)(hs,{colorValue:g}),(0,Ke.createElement)(hs,{colorValue:f}),v?(0,Ke.createElement)(hs,{colorValue:b}):null,y&&w?(0,Ke.createElement)(hs,{colorValue:w}):null),initialOpen:!1},(0,Ke.createElement)(us.TabPanel,{className:"ghostkit-control-tabs ghostkit-control-tabs-wide",tabs:M,onSelect:e=>{E(e)}},(t=>{const o="hover"===t.name;return"focus"===t.name?(0,Ke.createElement)(rs,{name:"ghostkit.editor.controls",attribute:"focusOutlineColor",props:e},(0,Ke.createElement)(gs,{label:(0,vs.__)("Outline","ghostkit"),value:w,onChange:e=>n({focusOutlineColor:e}),alpha:!0})):(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(rs,{name:"ghostkit.editor.controls",attribute:o?"hoverColor":"color",props:e},(0,Ke.createElement)(gs,{label:(0,vs.__)("Background","ghostkit"),value:o?k:g,onChange:e=>n(o?{hoverColor:e}:{color:e}),alpha:!0,gradient:!0})),(0,Ke.createElement)(rs,{name:"ghostkit.editor.controls",attribute:o?"hoverTextColor":"textColor",props:e},(0,Ke.createElement)(gs,{label:(0,vs.__)("Text","ghostkit"),value:o?_:f,onChange:e=>n(o?{hoverTextColor:e}:{textColor:e}),alpha:!0})),v?(0,Ke.createElement)(rs,{name:"ghostkit.editor.controls",attribute:o?"hoverBorderColor":"borderColor",props:e},(0,Ke.createElement)(gs,{label:(0,vs.__)("Border","ghostkit"),value:o?C:b,onChange:e=>n(o?{hoverBorderColor:e}:{borderColor:e}),alpha:!0})):null)})))),r&&"a"!==r?null:(0,Ke.createElement)(Ng,{url:c,rel:d,ariaLabel:u,target:h,onChange:e=>{n(e)},isSelected:o,toolbarSettings:!0,inspectorSettings:!0}),s?(0,Ke.createElement)("div",{className:"ghostkit-button-icon ghostkit-button-icon-"+("right"===a?"right":"left")},(0,Ke.createElement)(ep.Dropdown,{onChange:e=>n({icon:e}),value:s,renderToggle:({onToggle:e})=>(0,Ke.createElement)(ep.Preview,{onClick:e,name:s})})):null,l?null:(0,Ke.createElement)(ds.RichText,{placeholder:(0,vs.__)("Write text…","ghostkit"),value:i,onChange:e=>n({text:e}),isSelected:o,withoutInteractiveFormatting:!0}))},save:function(e){const{tagName:t,text:n,icon:o,iconPosition:r,hideText:i,url:s,ariaLabel:a,target:l,rel:c,size:u,focusOutlineWeight:h,focusOutlineColor:d}=e.attributes;let p=cs()("ghostkit-button",u&&`ghostkit-button-${u}`,i&&"ghostkit-button-icon-only");h&&d&&(p=cs()(p,"ghostkit-button-with-outline")),p=(0,os.applyFilters)("ghostkit.blocks.className",p,{name:zm,...e});const g=[];i||g.push((0,Ke.createElement)(ds.RichText.Content,{tagName:"span",className:"ghostkit-button-text",value:n,key:"button-text"})),o&&g.unshift((0,Ke.createElement)(ep.Render,{name:o,tag:"span",className:"ghostkit-button-icon ghostkit-button-icon-"+("right"===r?"right":"left"),key:"button-icon"}));const f=t||(s?"a":"span"),m=ds.useBlockProps.save({className:p,..."a"===f?{href:s,target:l||null,rel:c||null,"aria-label":a||null}:{}});return(0,Ke.createElement)(f,{...m},g)},deprecated:Dm},Hm=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"ghostkit/carousel","category":"ghostkit","title":"Carousel","description":"Carousel for any type of content - images or other blocks.","keywords":["carousel","slider"],"supports":{"html":false,"className":false,"anchor":true,"align":["wide","full"]},"attributes":{"effect":{"type":"string","default":"slide"},"speed":{"type":"number","default":0.2},"autoplay":{"type":"number","default":4},"autoplayHoverPause":{"type":"boolean","default":false},"slidesPerView":{"type":"number","default":3},"centeredSlides":{"type":"boolean","default":true},"loop":{"type":"boolean","default":true},"freeScroll":{"type":"boolean","default":false},"fadeEdges":{"type":"boolean","default":false},"fadeEdgesSize":{"type":"number","default":12},"showArrows":{"type":"boolean","default":true},"arrowPrevIcon":{"type":"string","default":"%3Csvg%20class%3D%22ghostkit-svg-icon%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M14.7803%2017.7803C14.4874%2018.0732%2014.0126%2018.0732%2013.7197%2017.7803L8.4697%2012.5303C8.1768%2012.2374%208.1768%2011.7626%208.4697%2011.4697L13.7197%206.21967C14.0126%205.92678%2014.4874%205.92678%2014.7803%206.21967C15.0732%206.51256%2015.0732%206.98744%2014.7803%207.28033L10.0607%2012L14.7803%2016.7197C15.0732%2017.0126%2015.0732%2017.4874%2014.7803%2017.7803Z%22%20fill%3D%22currentColor%22%2F%3E%3C%2Fsvg%3E"},"arrowNextIcon":{"type":"string","default":"%3Csvg%20class%3D%22ghostkit-svg-icon%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M9.21967%206.2197C9.51256%205.9268%209.98744%205.9268%2010.2803%206.2197L15.5303%2011.4697C15.8232%2011.7626%2015.8232%2012.2374%2015.5303%2012.5303L10.2803%2017.7803C9.98744%2018.0732%209.51256%2018.0732%209.21967%2017.7803C8.92678%2017.4874%208.92678%2017.0126%209.21967%2016.7197L13.9393%2012L9.21967%207.2803C8.92678%206.9874%208.92678%206.5126%209.21967%206.2197Z%22%20fill%3D%22currentColor%22%2F%3E%3C%2Fsvg%3E"},"showBullets":{"type":"boolean","default":true},"dynamicBullets":{"type":"boolean","default":true},"gap":{"type":"number","default":15}}}'),Wm=us.NumberControl||us.__experimentalNumberControl,Vm="ghostkit/carousel-slide";var Um=n(2084),Gm=n.n(Um);const{name:qm}=Hm,{name:Km}=Hm,Ym={icon:xi("block-carousel",!0),ghostkit:{previewUrl:"https://www.ghostkit.io/docs/blocks/carousel/",customStylesCallback(e){const{fadeEdges:t,fadeEdgesSize:n}=e,o={"--gkt-carousel--fade-edges__size":void 0};return t&&void 0!==n&&""!==n&&(o["--gkt-carousel--fade-edges__size"]=`${n}%`),o}},example:{attributes:{slides:3},innerBlocks:[{name:"ghostkit/carousel-slide",innerBlocks:[{name:"core/image",attributes:{sizeSlug:"large",url:"https://s.w.org/images/core/5.3/MtBlanc1.jpg"}}]},{name:"ghostkit/carousel-slide",innerBlocks:[{name:"core/image",attributes:{sizeSlug:"large",url:"https://s.w.org/images/core/5.3/Windbuchencom.jpg"}}]},{name:"ghostkit/carousel-slide"}]},edit:function(e){const{attributes:t,setAttributes:n,clientId:o}=e;let{className:r=""}=e;const{effect:i,speed:s,autoplay:a,autoplayHoverPause:l,slidesPerView:c,centeredSlides:u,loop:h,freeScroll:d,fadeEdges:p,fadeEdgesSize:g,showArrows:f,arrowPrevIcon:m,arrowNextIcon:v,showBullets:b,dynamicBullets:y,gap:w}=t,{getBlocks:k,slidesCount:_,block:C}=(0,Ze.useSelect)((e=>{const t=e("core/block-editor");return{getBlocks:t.getBlocks,slidesCount:t.getBlockCount(o),block:t.getBlock(o)}})),{removeBlock:x,replaceInnerBlocks:S}=(0,Ze.useDispatch)("core/block-editor");r=cs()(r,"ghostkit-carousel",p&&"ghostkit-carousel-fade-edges"),r=(0,os.applyFilters)("ghostkit.editor.className",r,e);const E=(0,ds.useBlockProps)({className:r}),A=(0,ds.useInnerBlocksProps)({className:"ghostkit-carousel-items"},{template:[[Vm],[Vm],[Vm]],allowedBlocks:[Vm],templateLock:!1,orientation:"horizontal"});return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(ds.InspectorControls,null,(0,Ke.createElement)(us.PanelBody,{title:(0,vs.__)("Settings","ghostkit")},(0,Ke.createElement)(rg,{label:(0,vs.__)("Slides","ghostkit"),value:_,onChange:e=>{if(e<1)x(C.clientId);else if(e>_){const t=e-_,n=[...k(C.clientId)];for(let e=1;e<=t;e+=1)n.push((0,cm.createBlock)(Vm,{size:3}));S(C.clientId,n,!1)}else if(e<_){const t=[...k(C.clientId)];t.splice(e,_-e),S(C.clientId,t,!1)}},min:2,max:20,allowCustomMax:!0}),"fade"!==i?(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(rg,{label:(0,vs.__)("Slides per view","ghostkit"),value:c,onChange:e=>n({slidesPerView:e}),min:1,max:8,allowCustomMax:!0}),(0,Ke.createElement)(rg,{label:(0,vs.__)("Gap","ghostkit"),value:w,onChange:e=>n({gap:e}),min:0,max:60,allowCustomMax:!0})):null,(0,Ke.createElement)(ag,{label:(0,vs.__)("Effect","ghostkit"),value:i,options:[{value:"slide",label:(0,vs.__)("Slide","ghostkit")},{value:"coverflow",label:(0,vs.__)("Coverflow","ghostkit")},{value:"fade",label:(0,vs.__)("Fade","ghostkit")}],onChange:e=>{n({effect:e})},isBlock:!0}),(0,Ke.createElement)("div",{style:{borderTop:"1px solid #E0E0E0",marginBottom:"16px"}}),(0,Ke.createElement)(rg,{label:(0,vs.__)("Speed (seconds)","ghostkit"),suffix:"s ",value:s,onChange:e=>n({speed:e}),min:0,max:10,step:.1,allowCustomMax:!0}),(0,Ke.createElement)(rg,{label:(0,vs.__)("Autoplay (seconds)","ghostkit"),value:a,onChange:e=>n({autoplay:e}),min:0,max:20,step:.3,allowCustomMax:!0}),a?(0,Ke.createElement)(us.ToggleControl,{label:(0,vs.__)("Pause autoplay on mouse over","ghostkit"),checked:!!l,onChange:e=>n({autoplayHoverPause:e})}):null,(0,Ke.createElement)("div",{style:{borderTop:"1px solid #E0E0E0",marginBottom:"16px"}}),(0,Ke.createElement)(us.ToggleControl,{label:(0,vs.__)("Centered Slides","ghostkit"),checked:!!u,onChange:e=>n({centeredSlides:e})}),(0,Ke.createElement)(us.ToggleControl,{label:(0,vs.__)("Loop","ghostkit"),checked:!!h,onChange:e=>n({loop:e})}),(0,Ke.createElement)(us.ToggleControl,{label:(0,vs.__)("Free Scroll","ghostkit"),checked:!!d,onChange:e=>n({freeScroll:e})}),(0,Ke.createElement)(us.ToggleControl,{label:(0,vs.__)("Fade Edges","ghostkit"),checked:!!p,onChange:e=>n({fadeEdges:e})}),p&&(0,Ke.createElement)(Wm,{label:(0,vs.__)("Fade Edges Size","ghostkit"),suffix:"% ",value:g,onChange:e=>n({fadeEdgesSize:parseFloat(e)}),labelPosition:"edge",__unstableInputWidth:"100px",disableUnits:!0,min:0,max:50})),(0,Ke.createElement)(us.PanelBody,{title:(0,vs.__)("Arrow","ghostkit")},(0,Ke.createElement)(us.ToggleControl,{label:(0,vs.__)("Show","ghostkit"),checked:!!f,onChange:e=>n({showArrows:e})}),f?(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(ep,{label:(0,vs.__)("Prev icon","ghostkit"),value:m,onChange:e=>n({arrowPrevIcon:e}),insideInspector:!0}),(0,Ke.createElement)(ep,{label:(0,vs.__)("Next icon","ghostkit"),value:v,onChange:e=>n({arrowNextIcon:e}),insideInspector:!0})):null),(0,Ke.createElement)(us.PanelBody,{title:(0,vs.__)("Bullets","ghostkit")},(0,Ke.createElement)(us.ToggleControl,{label:(0,vs.__)("Show","ghostkit"),checked:!!b,onChange:e=>n({showBullets:e})}),b?(0,Ke.createElement)(us.ToggleControl,{label:(0,vs.__)("Dynamic","ghostkit"),checked:!!y,onChange:e=>n({dynamicBullets:e})}):null)),(0,Ke.createElement)("div",{...E},(0,Ke.createElement)("div",{className:"block-editor-inner-blocks"},(0,Ke.createElement)("div",{...A}))),(0,Ke.createElement)(_s,{styles:`\n [data-block="${e.clientId}"] > .ghostkit-carousel {\n --gkt-carousel-gap: ${w}px;\n --gkt-carousel-slides-per-view: ${"fade"===i?1:c};\n }\n `}))},save:function(e){const{effect:t,speed:n,autoplay:o,autoplayHoverPause:r,slidesPerView:i,centeredSlides:s,loop:a,freeScroll:l,fadeEdges:c,showArrows:u,arrowPrevIcon:h,arrowNextIcon:d,showBullets:p,dynamicBullets:g,gap:f}=e.attributes;let m=Gm()("ghostkit-carousel",c&&"ghostkit-carousel-fade-edges");m=(0,os.applyFilters)("ghostkit.blocks.className",m,{name:qm,...e});const v={"data-effect":t,"data-speed":n,"data-autoplay":o,"data-autoplay-hover-pause":o&&r?"true":null,"data-slides-per-view":i,"data-centered-slides":s?"true":"false","data-loop":a?"true":"false","data-free-scroll":l?"true":"false","data-show-arrows":u?"true":"false","data-show-bullets":p?"true":"false","data-dynamic-bullets":g?"true":"false","data-gap":f},b=ds.useBlockProps.save({className:m,...v}),y=ds.useInnerBlocksProps.save({className:"ghostkit-carousel-items"});return(0,Ke.createElement)("div",{...b},(0,Ke.createElement)("div",{...y}),h?(0,Ke.createElement)(ep.Render,{name:h,tag:"div",className:"ghostkit-carousel-arrow-prev-icon"}):null,d?(0,Ke.createElement)(ep.Render,{name:d,tag:"div",className:"ghostkit-carousel-arrow-next-icon"}):null)}},Zm=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"ghostkit/carousel-slide","parent":["ghostkit/carousel"],"category":"ghostkit","title":"Slide","description":"A single slide within a carousel block.","supports":{"html":false,"className":false,"anchor":true,"reusable":false,"spacing":{"blockGap":true,"__experimentalDefaultControls":{"blockGap":true}},"__experimentalLayout":true,"layout":true}}'),{name:Jm}=Zm,{name:Xm}=Zm,Qm={icon:xi("block-carousel-slide",!0),edit:function(e){const{attributes:t,clientId:n}=e;let{className:o}=t;const r=(0,Ze.useSelect)((e=>{const t=e("core/block-editor");return!!t&&t.getBlockOrder(n).length>0}),[n]);o=cs()(o,"ghostkit-carousel-slide"),o=(0,os.applyFilters)("ghostkit.editor.className",o,e);const i=(0,ds.useBlockProps)({className:o}),s=(0,ds.useInnerBlocksProps)(i,{renderAppender:r?void 0:ds.InnerBlocks.ButtonBlockAppender,templateLock:!1});return(0,Ke.createElement)("div",{...s})},save:function(e){let t="ghostkit-carousel-slide";t=(0,os.applyFilters)("ghostkit.blocks.className",t,{name:Jm,...e});const n=ds.useBlockProps.save({className:t}),o=ds.useInnerBlocksProps.save(n);return(0,Ke.createElement)("div",{...o})}},ev=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"ghostkit/changelog","category":"ghostkit","title":"Changelog","description":"Show the changes log of your product.","keywords":["changelog","log"],"supports":{"html":false,"className":false,"anchor":true,"align":["wide","full"],"spacing":{"blockGap":true,"__experimentalDefaultControls":{"blockGap":true}},"__experimentalLayout":true,"layout":true},"attributes":{"version":{"type":"string","default":""},"date":{"type":"string","default":""}}}'),{name:tv}=ev,{name:nv}=ev,ov={icon:xi("block-changelog",!0),ghostkit:{previewUrl:"https://www.ghostkit.io/docs/blocks/changelog/"},example:{attributes:{version:"1.0.0",date:(new Date).toLocaleDateString()},innerBlocks:[{name:"core/list",attributes:{className:"is-style-none"},innerBlocks:[{name:"core/list-item",attributes:{content:`${(0,vs.__)("Added","ghostkit")}${(0,vs.__)("Something","ghostkit")}`}},{name:"core/list-item",attributes:{content:`${(0,vs.__)("Fixed","ghostkit")}${(0,vs.__)("Something","ghostkit")}`}},{name:"core/list-item",attributes:{content:`${(0,vs.__)("Improved","ghostkit")}${(0,vs.__)("Something","ghostkit")}`}}]}]},edit:function(e){const{attributes:t,setAttributes:n}=e;let{className:o=""}=e;const{version:r,date:i}=t;o=cs()("ghostkit-changelog",o),o=(0,os.applyFilters)("ghostkit.editor.className",o,e);const s=(0,ds.useBlockProps)({className:o}),a=(0,ds.useInnerBlocksProps)({className:"ghostkit-changelog-inner"},{templateLock:!1,template:[["core/list",{className:"is-style-none"},[["core/list-item",{content:`${(0,vs.__)("Added","ghostkit")}${(0,vs.__)("Something","ghostkit")}`}],["core/list-item",{content:`${(0,vs.__)("Fixed","ghostkit")}${(0,vs.__)("Something","ghostkit")}`}],["core/list-item",{content:`${(0,vs.__)("Improved","ghostkit")}${(0,vs.__)("Something","ghostkit")}`}]]]]});return(0,Ke.createElement)("div",{...s},(0,Ke.createElement)("div",{className:"ghostkit-changelog-version"},(0,Ke.createElement)(ds.RichText,{inlineToolbar:!0,tagName:"span",placeholder:(0,vs.__)("1.0.0","ghostkit"),value:r,onChange:e=>n({version:e})})),(0,Ke.createElement)("div",{className:"ghostkit-changelog-date"},(0,Ke.createElement)(ds.RichText,{inlineToolbar:!0,tagName:"h2",placeholder:(new Date).toLocaleDateString(),value:i,onChange:e=>n({date:e}),style:{margin:0}})),(0,Ke.createElement)("div",{className:"ghostkit-changelog-more"},(0,Ke.createElement)("div",{...a})))},save:function(e){const{version:t,date:n}=e.attributes;let o="ghostkit-changelog";o=(0,os.applyFilters)("ghostkit.blocks.className",o,{name:tv,...e});const r=ds.useBlockProps.save({className:o}),i=ds.useInnerBlocksProps.save({className:"ghostkit-changelog-more"});return(0,Ke.createElement)("div",{...r},ds.RichText.isEmpty(t)?null:(0,Ke.createElement)(ds.RichText.Content,{tagName:"span",className:"ghostkit-changelog-version",value:t}),ds.RichText.isEmpty(n)?null:(0,Ke.createElement)(ds.RichText.Content,{tagName:"h2",className:"ghostkit-changelog-date",value:n}),(0,Ke.createElement)("div",{...i}))}},rv=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"ghostkit/countdown","category":"ghostkit","title":"Countdown","description":"Countdown timer for upcoming event.","keywords":["timer","count","number"],"supports":{"html":false,"className":false,"anchor":true,"align":["wide","full"]},"attributes":{"date":{"type":"string"},"units":{"type":"array","default":["days","hours","minutes","seconds"]},"unitsAlign":{"type":"string"},"numberFontSize":{"type":"number"},"labelFontSize":{"type":"number"},"numberColor":{"type":"string"},"labelColor":{"type":"string"}}}'),iv=(()=>{const e=1,t=2,n=4,o=8,r=16,i=32,s=64,a=128,l=a|s|r|o|n|t,c=a|s|i|r|o|n|t|e,u=1e3,h=60,d=60,p=24,g=p*d*h*u,f=7,m=12,{ceil:v}=Math,{floor:b}=Math;function y(e,t){const n=e.getTime();return e.setMonth(e.getMonth()+t),Math.round((e.getTime()-n)/g)}function w(e){const t=e.getTime(),n=new Date(t);return n.setMonth(e.getMonth()+1),Math.round((n.getTime()-t)/g)}function k(e,t){if(t=t instanceof Date||null!==t&&Number.isFinite(t)?new Date(+t):new Date,!e)return t;let n=+e.value||0;return n?(t.setTime(t.getTime()+n),t):(n=+e.milliseconds||0,n&&t.setMilliseconds(t.getMilliseconds()+n),n=+e.seconds||0,n&&t.setSeconds(t.getSeconds()+n),n=+e.minutes||0,n&&t.setMinutes(t.getMinutes()+n),n=+e.hours||0,n&&t.setHours(t.getHours()+n),n=+e.weeks||0,n&&(n*=f),n+=+e.days||0,n&&t.setDate(t.getDate()+n),n=+e.months||0,n&&t.setMonth(t.getMonth()+n),n+=+e.years||0,n&&t.setFullYear(t.getFullYear()+n),t)}function _(){}function C(e,t,n,o,r,i){return e[n]>=0&&(t+=e[n],delete e[n]),1+(t/=r)<=1?0:e[o]>=0?(e[o]=+(e[o]+t).toFixed(i),function(e,t){switch(t){case"seconds":if(e.seconds!==h||Number.isNaN(e.minutes))return;e.minutes+=1,e.seconds=0;case"minutes":if(e.minutes!==d||Number.isNaN(e.hours))return;e.hours+=1,e.minutes=0;case"hours":if(e.hours!==p||Number.isNaN(e.days))return;e.days+=1,e.hours=0;case"days":if(e.days!==f||Number.isNaN(e.weeks))return;e.weeks+=1,e.days=0;case"weeks":if(e.weeks!==w(e.refMonth)/f||Number.isNaN(e.months))return;e.months+=1,e.weeks=0;case"months":if(e.months!==m||Number.isNaN(e.years))return;e.years+=1,e.months=0}}(e,o),0):t}function x(l,c,k,_,x,S){const E=new Date;if(c=c||E,k=k||E,l.start=c,l.end=k,l.units=_,l.value=k.getTime()-c.getTime(),l.value<0){const e=k;k=c,c=e}l.refMonth=new Date(c.getFullYear(),c.getMonth(),15,12,0,0);try{l.years=k.getFullYear()-c.getFullYear(),l.months=k.getMonth()-c.getMonth(),l.weeks=0,l.days=k.getDate()-c.getDate(),l.hours=k.getHours()-c.getHours(),l.minutes=k.getMinutes()-c.getMinutes(),l.seconds=k.getSeconds()-c.getSeconds(),l.milliseconds=k.getMilliseconds()-c.getMilliseconds(),function(e){let t;for(e.milliseconds<0?(t=v(-e.milliseconds/u),e.seconds-=t,e.milliseconds+=t*u):e.milliseconds>=u&&(e.seconds+=b(e.milliseconds/u),e.milliseconds%=u),e.seconds<0?(t=v(-e.seconds/h),e.minutes-=t,e.seconds+=t*h):e.seconds>=h&&(e.minutes+=b(e.seconds/h),e.seconds%=h),e.minutes<0?(t=v(-e.minutes/d),e.hours-=t,e.minutes+=t*d):e.minutes>=d&&(e.hours+=b(e.minutes/d),e.minutes%=d),e.hours<0?(t=v(-e.hours/p),e.days-=t,e.hours+=t*p):e.hours>=p&&(e.days+=b(e.hours/p),e.hours%=p);e.days<0;)e.months-=1,e.days+=y(e.refMonth,1);e.days>=f&&(e.weeks+=b(e.days/f),e.days%=f),e.months<0?(t=v(-e.months/m),e.years-=t,e.months+=t*m):e.months>=m&&(e.years+=b(e.months/m),e.months%=m)}(l),function(l,c,v,k){let _=0;!(c&a)||_>=v?(l.months+=l.years*m,delete l.years):l.years&&(_+=1),!(c&s)||_>=v?(l.months&&(l.days+=y(l.refMonth,l.months)),delete l.months,l.days>=f&&(l.weeks+=b(l.days/f),l.days%=f)):l.months&&(_+=1),!(c&i)||_>=v?(l.days+=l.weeks*f,delete l.weeks):l.weeks&&(_+=1),!(c&r)||_>=v?(l.hours+=l.days*p,delete l.days):l.days&&(_+=1),!(c&o)||_>=v?(l.minutes+=l.hours*d,delete l.hours):l.hours&&(_+=1),!(c&n)||_>=v?(l.seconds+=l.minutes*h,delete l.minutes):l.minutes&&(_+=1),!(c&t)||_>=v?(l.milliseconds+=l.seconds*u,delete l.seconds):l.seconds&&(_+=1),c&e&&!(_>=v)||function(e,t){let n=C(e,0,"milliseconds","seconds",u,t);if(n&&(n=C(e,n,"seconds","minutes",h,t),n&&(n=C(e,n,"minutes","hours",d,t),n&&(n=C(e,n,"hours","days",p,t),n&&(n=C(e,n,"days","weeks",f,t),n&&(n=C(e,n,"weeks","months",w(e.refMonth)/f,t),n&&(n=C(e,n,"months","years",function(e){const t=e.getTime(),n=new Date(t);return n.setFullYear(e.getFullYear()+1),Math.round((n.getTime()-t)/g)}(e.refMonth)/w(e.refMonth),t),n&&n)))))))throw new Error("Fractional unit overflow")}(l,k)}(l,_,x,S)}finally{delete l.refMonth}return l}function S(e,t,n,o){const r=n.length>0?n.length:NaN;o=o>0?o<20?Math.round(o):20:0;let i=null;e instanceof Date||(null!==e&&Number.isFinite(e)?e=new Date(+e):("object"==typeof i&&(i=e),e=null));let s=null;if(t instanceof Date||(null!==t&&Number.isFinite(t)?t=new Date(+t):("object"==typeof t&&(s=t),t=null)),i&&(e=k(i,t)),s&&(t=k(s,e)),!e&&!t)return new _;const a=function(e){let t=~c;return e.forEach((e=>{S[e.toUpperCase()]&&(t|=S[e.toUpperCase()])})),t=+t||l,t}(n);return x(new _,e,t,a,r,o)}return S.MILLISECONDS=e,S.SECONDS=t,S.MINUTES=n,S.HOURS=o,S.DAYS=r,S.WEEKS=i,S.MONTHS=s,S.YEARS=a,S.DEFAULTS=l,S.ALL=c,S.getDelay=function(e=[]){return-1!==e.indexOf("milliseconds")?u/30:-1!==e.indexOf("seconds")?u:-1!==e.indexOf("minutes")?u*h:-1!==e.indexOf("hours")?u*h*d:-1!==e.indexOf("days")?u*h*d*p:u*h*d*p*f},S.formatUnit=(e,t)=>{switch(t){case"years":t=(0,vs._n)("Year","Years",e,"ghostkit");break;case"months":t=(0,vs._n)("Month","Months",e,"ghostkit");break;case"weeks":t=(0,vs._n)("Week","Weeks",e,"ghostkit");break;case"days":t=(0,vs._n)("Day","Days",e,"ghostkit");break;case"hours":t=(0,vs._n)("Hour","Hours",e,"ghostkit");break;case"minutes":t=(0,vs._n)("Minute","Minutes",e,"ghostkit");break;case"seconds":t=(0,vs._n)("Second","Seconds",e,"ghostkit")}return{number:e=`${e<10?"0":""}${e}`,label:t}},S})(),sv="yyyy-LL-dd'T'HH:mm:ss",{GHOSTKIT:av,luxon:lv}=window,{name:cv}=rv,{name:uv}=rv,hv={icon:xi("block-countdown",!0),ghostkit:{previewUrl:"https://www.ghostkit.io/docs/blocks/countdown/",customStylesCallback(e){const t={"--gkt-countdown--unit-number__font-size":void 0,"--gkt-countdown--unit-number__color":e.numberColor||void 0,"--gkt-countdown--unit-label__font-size":void 0,"--gkt-countdown--unit-label__color":e.labelColor||void 0};return void 0!==e.numberFontSize&&""!==e.numberFontSize&&(t["--gkt-countdown--unit-number__font-size"]=`${e.numberFontSize}px`),void 0!==e.labelFontSize&&""!==e.labelFontSize&&(t["--gkt-countdown--unit-label__font-size"]=`${e.labelFontSize}px`),t}},example:{attributes:{units:["hours","minutes","seconds"],unitsAlign:"center",ghostkit:{id:"example-countdown"},className:"ghostkit-custom-example-countdown"}},edit:function(e){const{attributes:t,setAttributes:n,clientId:o}=e,{date:r,units:i,unitsAlign:s,numberFontSize:a,labelFontSize:l,numberColor:c,labelColor:u}=t;let{className:h=""}=e;function d(e,t){const n=lv.DateTime.fromISO(e).toFormat(sv),o=new Date(lv.DateTime.now().setZone(av.timezone).toFormat(sv)),r=iv(new Date(n),o,t,0);return{formattedDate:n,delay:iv.getDelay(t),...r}}const[p,g]=(0,ms.useState)(!!r&&d(r,i)),f=(0,ms.useRef)(!1),{isSelectedBlockInRoot:m}=(0,Ze.useSelect)((e=>{const{isBlockSelected:t,hasSelectedInnerBlock:n}=e("core/block-editor");return{isSelectedBlockInRoot:t(o)||n(o,!0)}}),[o]);function v(e,t){const o=d(e,t);g(o),o.formattedDate!==r&&n({date:o.formattedDate})}(0,ms.useEffect)((()=>{if(r)v(r,i);else{const e=new Date,t=new Date;t.setDate(e.getDate()+1),v(lv.DateTime.fromJSDate(t).toFormat(sv),i)}}),[]),(0,ms.useEffect)((()=>{clearInterval(f.current),p&&(f.current=setInterval((()=>{if(!r||!i||!i.length)return;const e=d(r,i);g(e)}),p.delay))}),[p]),h=cs()("ghostkit-countdown",s&&`ghostkit-countdown-units-align-${s}`,h),h=(0,os.applyFilters)("ghostkit.editor.className",h,e);const b=(0,ds.useBlockProps)({className:h}),y=(0,ds.useInnerBlocksProps)({className:"ghostkit-countdown-expire-action-content"},{template:[["core/paragraph",{content:(0,vs.__)("This countdown has been ended already!","ghostkit")}]],templateLock:!1});return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(ds.InspectorControls,null,(0,Ke.createElement)(us.PanelBody,null,(0,Ke.createElement)(ys,{label:(0,vs.__)("End Date","ghostkit"),value:r,onChange:e=>v(e,i)}),(0,Ke.createElement)(us.SelectControl,{label:(0,vs.__)("Display Units","ghostkit"),value:i,onChange:e=>{n({units:e}),v(r,e)},multiple:!0,options:[{label:(0,vs.__)("Years","ghostkit"),value:"years"},{label:(0,vs.__)("Months","ghostkit"),value:"months"},{label:(0,vs.__)("Weeks","ghostkit"),value:"weeks"},{label:(0,vs.__)("Days","ghostkit"),value:"days"},{label:(0,vs.__)("Hours","ghostkit"),value:"hours"},{label:(0,vs.__)("Minutes","ghostkit"),value:"minutes"},{label:(0,vs.__)("Seconds","ghostkit"),value:"seconds"}]})),(0,Ke.createElement)(us.PanelBody,null,(0,Ke.createElement)(rg,{label:(0,vs.__)("Number Font Size","ghostkit"),value:a,onChange:e=>n({numberFontSize:e}),beforeIcon:"editor-textcolor",afterIcon:"editor-textcolor",allowCustomMax:!0}),(0,Ke.createElement)(rg,{label:(0,vs.__)("Label Font Size","ghostkit"),value:l,onChange:e=>n({labelFontSize:e}),beforeIcon:"editor-textcolor",afterIcon:"editor-textcolor",allowCustomMax:!0}),(0,Ke.createElement)(gs,{label:(0,vs.__)("Number Color","ghostkit"),value:c,onChange:e=>n({numberColor:e}),alpha:!0}),(0,Ke.createElement)(gs,{label:(0,vs.__)("Label Color","ghostkit"),value:u,onChange:e=>n({labelColor:e}),alpha:!0}))),(0,Ke.createElement)(ds.BlockControls,null,(0,Ke.createElement)(us.ToolbarGroup,null,(0,Ke.createElement)(us.ToolbarButton,{icon:"align-left",title:(0,vs.__)("Units Align Left","ghostkit"),onClick:()=>n({unitsAlign:"left"}),isActive:"left"===s}),(0,Ke.createElement)(us.ToolbarButton,{icon:"align-center",title:(0,vs.__)("Units Align Center","ghostkit"),onClick:()=>n({unitsAlign:"center"}),isActive:"center"===s}),(0,Ke.createElement)(us.ToolbarButton,{icon:"align-right",title:(0,vs.__)("Units Align Right","ghostkit"),onClick:()=>n({unitsAlign:"right"}),isActive:"right"===s}))),(0,Ke.createElement)("div",{...b},i.map((e=>{let t=!1;if(p&&void 0!==p[e]){const n=p.value>=0;t=iv.formatUnit(n?0:p[e],e)}return(0,Ke.createElement)("div",{key:e,className:cs()("ghostkit-countdown-unit",`ghostkit-countdown-unit-${e}`)},(0,Ke.createElement)("span",{className:"ghostkit-countdown-unit-number"},t?t.number:"00"),(0,Ke.createElement)("span",{className:"ghostkit-countdown-unit-label"},t?t.label:e))}))),m?(0,Ke.createElement)("div",{className:"ghostkit-countdown-expire-action"},(0,Ke.createElement)("div",{className:"ghostkit-countdown-expire-action-label"},(0,vs.__)("Display content after expiration:","ghostkit")),(0,Ke.createElement)("div",{...y})):null)},save:function(e){const{attributes:t}=e,{date:n,units:o,unitsAlign:r}=t;let i=cs()("ghostkit-countdown",r&&`ghostkit-countdown-units-align-${r}`);i=(0,os.applyFilters)("ghostkit.blocks.className",i,{name:cv,...e});const s=ds.useBlockProps.save({className:i,"data-date":n}),a=ds.useInnerBlocksProps.save({className:"ghostkit-countdown-expire-action"});return(0,Ke.createElement)("div",{...s},o.map((e=>(0,Ke.createElement)("div",{key:e,className:cs()("ghostkit-countdown-unit",`ghostkit-countdown-unit-${e}`)},(0,Ke.createElement)("span",{className:"ghostkit-countdown-unit-number"},"00"),(0,Ke.createElement)("span",{className:"ghostkit-countdown-unit-label"},e)))),(0,Ke.createElement)("div",{...a}))}},dv=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"ghostkit/counter-box","category":"ghostkit","title":"Number Box","description":"Show your progress and rewards using counting numbers.","keywords":["number","counter"],"supports":{"html":false,"className":false,"anchor":true,"align":["wide","full"],"spacing":{"blockGap":true,"__experimentalDefaultControls":{"blockGap":true}},"__experimentalLayout":true,"layout":true},"attributes":{"number":{"type":"string","source":"html","selector":".ghostkit-counter-box-number-wrap","default":"77"},"animateInViewport":{"type":"boolean","default":false},"animateInViewportFrom":{"type":"number","default":0},"numberPosition":{"type":"string","default":"top"},"numberAlign":{"type":"string"},"numberSize":{"type":"number"},"showContent":{"type":"boolean","default":true},"numberColor":{"type":"string"},"hoverNumberColor":{"type":"string"},"url":{"type":"string"},"ariaLabel":{"type":"string"},"target":{"type":"string"},"rel":{"type":"string"}}}'),{name:pv}=dv,gv=[{...dv,attributes:{number:{type:"string",source:"html",selector:".ghostkit-counter-box-number-wrap",default:"77"},animateInViewport:{type:"boolean",default:!1},animateInViewportFrom:{type:"number",default:0},numberPosition:{type:"string",default:"top"},numberSize:{type:"number"},showContent:{type:"boolean",default:!0},numberColor:{type:"string"},hoverNumberColor:{type:"string"},url:{type:"string"},target:{type:"string"},rel:{type:"string"}},save:class extends ms.Component{render(){const{number:e,animateInViewport:t,numberPosition:n,showContent:o,url:r,target:i,rel:s}=this.props.attributes;let{animateInViewportFrom:a}=this.props.attributes;a=parseFloat(a);let l=cs()("ghostkit-counter-box",r&&"ghostkit-counter-box-with-link");l=(0,os.applyFilters)("ghostkit.blocks.className",l,{name:pv,...this.props});const c=cs()("ghostkit-counter-box-number",`ghostkit-counter-box-number-align-${n||"left"}`);return(0,Ke.createElement)("div",{className:l},r?(0,Ke.createElement)("a",{className:"ghostkit-counter-box-link",href:r,target:i||!1,rel:s||!1},(0,Ke.createElement)("span",null)):null,(0,Ke.createElement)("div",{className:c},(0,Ke.createElement)(ds.RichText.Content,{tagName:"div",className:"ghostkit-counter-box-number-wrap"+(t?" ghostkit-count-up":""),value:e,"data-count-from":t&&a?a:null})),o?(0,Ke.createElement)("div",{className:"ghostkit-counter-box-content"},(0,Ke.createElement)(ds.InnerBlocks.Content,null)):null)}}}],{name:fv}=dv,mv={from:[{type:"block",blocks:["ghostkit/icon-box"],transform:(e,t)=>(0,cm.createBlock)("ghostkit/counter-box",{numberPosition:e.iconPosition,numberSize:e.iconSize,showContent:e.showContent,numberColor:e.iconColor,hoverNumberColor:e.hoverIconColoe},t)},{type:"block",blocks:["ghostkit/alert"],transform:(e,t)=>(0,cm.createBlock)("ghostkit/counter-box",{numberSize:e.iconSize,numberColor:e.color,hoverNumberColor:e.hoverColor},t)}]},{name:vv}=dv,bv={icon:xi("block-counter-box",!0),ghostkit:{previewUrl:"https://www.ghostkit.io/docs/blocks/number-box/",customStylesCallback(e){const t={"--gkt-counter-box--number__font-size":void 0,"--gkt-counter-box--number__color":e.numberColor||void 0,"&:hover":{"--gkt-counter-box--number__color":e.hoverNumberColor||void 0}};return void 0!==e.numberSize&&""!==e.numberSize&&(t["--gkt-counter-box--number__font-size"]=`${e.numberSize}px`),t}},example:{attributes:{number:"77",numberColor:"#0366d6",ghostkit:{id:"example-counter-box"},className:"ghostkit-custom-example-counter-box"},innerBlocks:[{name:"core/paragraph",attributes:{content:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis."}}]},edit:function(e){const{attributes:t,setAttributes:n,isSelected:o,clientId:r}=e;let{className:i=""}=e;const s=(0,Ze.useSelect)((e=>{const t=e("core/block-editor");return!!t&&t.getBlockOrder(r).length>0}),[r]),{number:a,animateInViewport:l,animateInViewportFrom:c,numberPosition:u,numberAlign:h,numberSize:d,showContent:p,numberColor:g,hoverNumberColor:f,url:m,ariaLabel:v,target:b,rel:y}=t;i=cs()("ghostkit-counter-box",i),i=(0,os.applyFilters)("ghostkit.editor.className",i,e);const w=cs()("ghostkit-counter-box-number",`ghostkit-counter-box-number-align-${u||"left"}`,"top"===u?`ghostkit-counter-box-number-top-align-${h||"center"}`:""),k=(0,ds.useBlockProps)({className:i}),_=(0,ds.useInnerBlocksProps)({className:"ghostkit-counter-box-content"},{renderAppender:s?void 0:ds.InnerBlocks.ButtonBlockAppender,templateLock:!1}),C=(0,vs.__)("Number Position","ghostkit");return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(ds.InspectorControls,null,(0,Ke.createElement)(us.PanelBody,null,(0,Ke.createElement)(rg,{label:(0,vs.__)("Number Size","ghostkit"),value:d,onChange:e=>n({numberSize:e}),beforeIcon:"editor-textcolor",afterIcon:"editor-textcolor",allowCustomMax:!0}),(0,Ke.createElement)(us.BaseControl,{id:C,label:C},(0,Ke.createElement)("div",null,(0,Ke.createElement)(us.Toolbar,{label:C},(0,Ke.createElement)(us.ToolbarButton,{icon:"align-center",title:(0,vs.__)("Top","ghostkit"),onClick:()=>n({numberPosition:"top"}),isActive:"top"===u}),(0,Ke.createElement)(us.ToolbarButton,{icon:"align-left",title:(0,vs.__)("Left","ghostkit"),onClick:()=>n({numberPosition:"left"}),isActive:"left"===u}),(0,Ke.createElement)(us.ToolbarButton,{icon:"align-right",title:(0,vs.__)("Right","ghostkit"),onClick:()=>n({numberPosition:"right"}),isActive:"right"===u})))),"top"===u?(0,Ke.createElement)(ag,{label:(0,vs.__)("Number Alignment","ghostkit"),value:h||"center",options:[{icon:xi("icon-horizontal-start"),label:(0,vs.__)("Start","ghostkit"),value:"left"},{icon:xi("icon-horizontal-center"),label:(0,vs.__)("Center","ghostkit"),value:"center"},{icon:xi("icon-horizontal-end"),label:(0,vs.__)("End","ghostkit"),value:"right"}],onChange:e=>{n({numberAlign:e})}}):null),(0,Ke.createElement)(us.PanelBody,null,(0,Ke.createElement)(us.ToggleControl,{label:(0,vs.__)("Show Content","ghostkit"),checked:!!p,onChange:e=>n({showContent:e})}),(0,Ke.createElement)(us.ToggleControl,{label:(0,vs.__)("Animate in viewport","ghostkit"),checked:!!l,onChange:e=>n({animateInViewport:e})}),l?(0,Ke.createElement)(us.TextControl,{label:(0,vs.__)("Animate from","ghostkit"),type:"number",value:c,onChange:e=>n({animateInViewportFrom:parseInt(e,10)})}):null),(0,Ke.createElement)(us.PanelBody,{title:(0,Ke.createElement)(Ke.Fragment,null,(0,vs.__)("Colors","ghostkit"),(0,Ke.createElement)(hs,{colorValue:g})),initialOpen:!1},(0,Ke.createElement)(us.TabPanel,{className:"ghostkit-control-tabs ghostkit-control-tabs-wide",tabs:[{name:"normal",title:(0,vs.__)("Normal","ghostkit"),className:"ghostkit-control-tabs-tab"},{name:"hover",title:(0,vs.__)("Hover","ghostkit"),className:"ghostkit-control-tabs-tab"}]},(t=>{const o="hover"===t.name;return(0,Ke.createElement)(rs,{name:"ghostkit.editor.controls",attribute:o?"hoverNumberColor":"numberColor",props:e},(0,Ke.createElement)(gs,{label:(0,vs.__)("Color","ghostkit"),value:o?f:g,onChange:e=>n(o?{hoverNumberColor:e}:{numberColor:e}),alpha:!0,gradient:!0}))})))),(0,Ke.createElement)(Ng,{url:m,rel:y,ariaLabel:v,target:b,onChange:e=>{n(e)},isSelected:o,toolbarSettings:!0,inspectorSettings:!0}),(0,Ke.createElement)(ds.BlockControls,null,(0,Ke.createElement)(us.ToolbarGroup,null,(0,Ke.createElement)(us.ToolbarButton,{icon:"align-center",title:(0,vs.__)("Top","ghostkit"),onClick:()=>n({numberPosition:"top"}),isActive:"top"===u}),(0,Ke.createElement)(us.ToolbarButton,{icon:"align-left",title:(0,vs.__)("Left","ghostkit"),onClick:()=>n({numberPosition:"left"}),isActive:"left"===u}),(0,Ke.createElement)(us.ToolbarButton,{icon:"align-right",title:(0,vs.__)("Right","ghostkit"),onClick:()=>n({numberPosition:"right"}),isActive:"right"===u}))),(0,Ke.createElement)("div",{...k},(0,Ke.createElement)("div",{className:w},(0,Ke.createElement)(ds.RichText,{inlineToolbar:!0,tagName:"div",className:"ghostkit-counter-box-number-wrap",placeholder:(0,vs.__)("Write number…","ghostkit"),value:a,onChange:e=>n({number:e}),withoutInteractiveFormatting:!0})),p?(0,Ke.createElement)("div",{..._}):null))},save:function(e){const{attributes:t}=e,{number:n,animateInViewport:o,numberPosition:r,numberAlign:i,showContent:s,url:a,ariaLabel:l,target:c,rel:u}=t;let{animateInViewportFrom:h}=t;h=parseFloat(h);let d=cs()("ghostkit-counter-box",a&&"ghostkit-counter-box-with-link");d=(0,os.applyFilters)("ghostkit.blocks.className",d,{name:fv,...e});const p=cs()("ghostkit-counter-box-number",`ghostkit-counter-box-number-align-${r||"left"}`,"top"===r?`ghostkit-counter-box-number-top-align-${i||"center"}`:""),g=ds.useBlockProps.save({className:d}),f=ds.useInnerBlocksProps.save({className:"ghostkit-counter-box-content"});return(0,Ke.createElement)("div",{...g},a?(0,Ke.createElement)("a",{className:"ghostkit-counter-box-link",href:a,target:c||null,rel:u||null,"aria-label":l||null},(0,Ke.createElement)("span",null)):null,(0,Ke.createElement)("div",{className:p},(0,Ke.createElement)(ds.RichText.Content,{tagName:"div",className:"ghostkit-counter-box-number-wrap"+(o?" ghostkit-count-up":""),value:n,"data-count-from":o&&h?h:null})),s?(0,Ke.createElement)("div",{...f}):null)},transforms:mv,deprecated:gv},yv=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"ghostkit/divider","category":"ghostkit","title":"Divider","description":"Divide your long texts and blocks.","keywords":["divider","spacer"],"supports":{"html":false,"className":false,"anchor":true,"align":["wide","full"]},"attributes":{"type":{"type":"string","default":"solid"},"size":{"type":"number","default":2},"icon":{"type":"string","default":""},"iconSize":{"type":"number"},"color":{"type":"string"},"iconColor":{"type":"string"},"hoverColor":{"type":"string"},"hoverIconColor":{"type":"string"}}}'),{name:wv}=yv,kv={from:[{type:"block",blocks:["core/separator"],transform:()=>(0,cm.createBlock)("ghostkit/divider")}],to:[{type:"block",blocks:["core/separator"],transform:()=>(0,cm.createBlock)("core/separator")}]},{name:_v}=yv,Cv={icon:xi("block-divider",!0),ghostkit:{previewUrl:"https://www.ghostkit.io/docs/blocks/divider/",customStylesCallback(e){const t={"--gkt-divider__border-width":void 0,"--gkt-divider__border-color":e.color,"--gkt-divider--icon__font-size":void 0,"--gkt-divider--icon__color":e.iconColor,"&:hover":{"--gkt-divider__border-color":e.hoverColor||void 0,"--gkt-divider--icon__color":e.hoverIconColor||void 0}};return void 0!==e.size&&""!==e.size&&(t["--gkt-divider__border-width"]=`${e.size}px`),void 0!==e.iconSize&&""!==e.iconSize&&(t["--gkt-divider--icon__font-size"]=`${e.iconSize}px`),t}},example:{attributes:{size:4,icon:'',iconSize:40,color:"#a7a9ab",iconColor:"#a7a9ab",ghostkit:{id:"example-divider"},className:"ghostkit-custom-example-divider"}},edit:function(e){const{attributes:t,setAttributes:n}=e;let{className:o=""}=e;const{type:r,size:i,icon:s,iconSize:a,color:l,iconColor:c,hoverColor:u,hoverIconColor:h}=t;o=cs()("ghostkit-divider",`ghostkit-divider-type-${r}`,o),s&&(o=cs()(o,"ghostkit-divider-with-icon")),o=(0,os.applyFilters)("ghostkit.editor.className",o,e);const d=(0,ds.useBlockProps)({className:o});return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(ds.BlockControls,null,(0,Ke.createElement)(us.ToolbarGroup,null,(0,Ke.createElement)(us.ToolbarDropdownMenu,{icon:xi("border-solid"),label:(0,vs.__)("Type","ghostkit"),controls:[{label:(0,vs.__)("Line","ghostkit"),icon:xi("border-solid"),isActive:"solid"===r,onClick:()=>n({type:"solid"})},{label:(0,vs.__)("Dashed","ghostkit"),icon:xi("border-dashed"),isActive:"dashed"===r,onClick:()=>n({type:"dashed"})},{label:(0,vs.__)("Dotted","ghostkit"),icon:xi("border-dotted"),isActive:"dotted"===r,onClick:()=>n({type:"dotted"})},{label:(0,vs.__)("Double","ghostkit"),icon:xi("border-double"),isActive:"double"===r,onClick:()=>n({type:"double"})}]}))),(0,Ke.createElement)(ds.InspectorControls,null,(0,Ke.createElement)(us.PanelBody,null,(0,Ke.createElement)(us.SelectControl,{label:(0,vs.__)("Type","ghostkit"),value:r,options:[{value:"solid",label:(0,vs.__)("Line","ghostkit")},{value:"dashed",label:(0,vs.__)("Dashed","ghostkit")},{value:"dotted",label:(0,vs.__)("Dotted","ghostkit")},{value:"double",label:(0,vs.__)("Double","ghostkit")}],onChange:e=>n({type:e})}),(0,Ke.createElement)(rg,{label:(0,vs.__)("Size","ghostkit"),value:i,onChange:e=>n({size:e}),min:1,max:7,beforeIcon:"editor-textcolor",afterIcon:"editor-textcolor",allowCustomMax:!0})),(0,Ke.createElement)(us.PanelBody,null,(0,Ke.createElement)(ep,{label:(0,vs.__)("Icon","ghostkit"),value:s,onChange:e=>n({icon:e}),insideInspector:!0}),s?(0,Ke.createElement)(rg,{label:(0,vs.__)("Icon Size","ghostkit"),value:a,onChange:e=>n({iconSize:e}),min:10,beforeIcon:"editor-textcolor",afterIcon:"editor-textcolor",allowCustomMin:!0,allowCustomMax:!0}):null),(0,Ke.createElement)(us.PanelBody,{title:(0,Ke.createElement)(Ke.Fragment,null,(0,vs.__)("Colors","ghostkit"),(0,Ke.createElement)(hs,{colorValue:l}),s?(0,Ke.createElement)(hs,{colorValue:c}):null),initialOpen:!1},(0,Ke.createElement)(us.TabPanel,{className:"ghostkit-control-tabs ghostkit-control-tabs-wide",tabs:[{name:"normal",title:(0,vs.__)("Normal","ghostkit"),className:"ghostkit-control-tabs-tab"},{name:"hover",title:(0,vs.__)("Hover","ghostkit"),className:"ghostkit-control-tabs-tab"}]},(t=>{const o="hover"===t.name;return(0,Ke.createElement)(Ke.Fragment,null,(0,Ke.createElement)(rs,{name:"ghostkit.editor.controls",attribute:o?"hoverColor":"color",props:e},(0,Ke.createElement)(gs,{label:(0,vs.__)("Divider","ghostkit"),value:o?u:l,onChange:e=>n(o?{hoverColor:e}:{color:e}),alpha:!0})),s?(0,Ke.createElement)(rs,{name:"ghostkit.editor.controls",attribute:o?"hoverIconColor":"iconColor",props:e},(0,Ke.createElement)(gs,{label:(0,vs.__)("Icon","ghostkit"),value:o?h:c,onChange:e=>n(o?{hoverIconColor:e}:{iconColor:e}),alpha:!0})):null)})))),(0,Ke.createElement)("div",{...d},s?(0,Ke.createElement)("div",{className:"ghostkit-divider-icon"},(0,Ke.createElement)(ep.Dropdown,{onChange:e=>n({icon:e}),value:s,renderToggle:({onToggle:e})=>(0,Ke.createElement)(ep.Preview,{onClick:e,name:s})})):null))},save:function(e){const{icon:t,type:n}=e.attributes;let o=`ghostkit-divider ghostkit-divider-type-${n}`;t&&(o=cs()(o,"ghostkit-divider-with-icon")),o=(0,os.applyFilters)("ghostkit.blocks.className",o,{name:wv,...e});const r=ds.useBlockProps.save({className:o});return(0,Ke.createElement)("div",{...r},t?(0,Ke.createElement)(ep.Render,{name:t,tag:"div",className:"ghostkit-divider-icon"}):null)},transforms:kv},xv=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"ghostkit/form","category":"ghostkit","title":"Form","description":"Add contact form to your page with reCaptcha.","keywords":["form","contact"],"supports":{"html":false,"className":false,"anchor":false,"align":["wide","full"],"spacing":{"blockGap":true,"__experimentalDefaultControls":{"blockGap":true}},"__experimentalLayout":true,"layout":true}}');function Sv(e,t,n){var o,r=n||{},i=r.noTrailing,s=void 0!==i&&i,a=r.noLeading,l=void 0!==a&&a,c=r.debounceMode,u=void 0===c?void 0:c,h=!1,d=0;function p(){o&&clearTimeout(o)}function g(){for(var n=arguments.length,r=new Array(n),i=0;i
\n"},y_.fence=function(e,t,n,o,r){const i=e[t],s=i.info?n_(i.info).trim():"";let a,l="",c="";if(s){const e=s.split(/(\s+)/g);l=e[0],c=e.slice(2).join("")}if(a=n.highlight&&n.highlight(i.content,l,c)||a_(i.content),0===a.indexOf(""+a_(e[t].content)+"
\n`}return`${a}
\n`},y_.image=function(e,t,n,o,r){const i=e[t];return i.attrs[i.attrIndex("alt")][1]=r.renderInlineAsText(i.children,n,o),r.renderToken(e,t,n)},y_.hardbreak=function(e,t,n){return n.xhtmlOut?"${a}
\n":"
\n"},y_.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?"
\n":"
\n":"\n"},y_.text=function(e,t){return a_(e[t].content)},y_.html_block=function(e,t){return e[t].content},y_.html_inline=function(e,t){return e[t].content},w_.prototype.renderAttrs=function(e){let t,n,o;if(!e.attrs)return"";for(o="",t=0,n=e.attrs.length;t=0&&(n=this.attrs[t][1]),n},S_.prototype.attrJoin=function(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=this.attrs[n][1]+" "+t};const E_=S_;function A_(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}A_.prototype.Token=E_;const T_=A_,$_=/\r\n?|\n/g,M_=/\0/g;function R_(e){return/^<\/a\s*>/i.test(e)}const O_=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,L_=/\((c|tm|r)\)/i,I_=/\((c|tm|r)\)/gi,P_={c:"©",r:"®",tm:"™"};function N_(e,t){return P_[t.toLowerCase()]}function D_(e){let t=0;for(let n=e.length-1;n>=0;n--){const o=e[n];"text"!==o.type||t||(o.content=o.content.replace(I_,N_)),"link_open"===o.type&&"auto"===o.info&&t--,"link_close"===o.type&&"auto"===o.info&&t++}}function F_(e){let t=0;for(let n=e.length-1;n>=0;n--){const o=e[n];"text"!==o.type||t||O_.test(o.content)&&(o.content=o.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),"link_open"===o.type&&"auto"===o.info&&t--,"link_close"===o.type&&"auto"===o.info&&t++}}const z_=/['"]/,B_=/['"]/g;function j_(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function H_(e,t){let n;const o=[];for(let r=0;r=0;s--){const a=r[s];if("link_close"!==a.type){if("html_inline"===a.type&&(n=a.content,/^\s]/i.test(n)&&i>0&&i--,R_(a.content)&&i++),!(i>0)&&"text"===a.type&&e.md.linkify.test(a.content)){const n=a.content;let i=e.md.linkify.match(n);const l=[];let c=a.level,u=0;i.length>0&&0===i[0].index&&s>0&&"text_special"===r[s-1].type&&(i=i.slice(1));for(let t=0;t