1"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([["fields-CodeEditorTextarea","fields-MarkdownEditor"],{71123(e,o,n){n.d(o,{A:()=>ButtonGroup});var r=n(79400),t=n.n(r),s=n(19363),i=n(14202);function ButtonGroup(e){const{pill:o,className:n,...r}=e;return(0,i.jsx)(s.h,{role:"group",display:"inline-flex",className:t()({"btn-group--pill":o},"btn-group",n),...r})}},94609(e,o,n){n.r(o),n.d(o,{default:()=>CodeEditorTextarea_CodeEditorTextarea});var r=n(34084),t=n(19363),s=n(19107),i=n(18579),a=n(41125);const d="kOjhoy";var l=n(14202);const c=(0,r.Ay)({resolved:{},chunkName:()=>"components-CodeMirror",isReady(e){const o=this.resolve(e);return!0===this.resolved[o]&&!!n.m[o]},importAsync:()=>n.e("components-CodeMirror").then(()=>n(23942)),requireAsync(e){const o=this.resolve(e);return this.resolved[o]=!1,this.importAsync(e).then(e=>(this.resolved[o]=!0,e))},requireSync(e){const o=this.resolve(e);return n(o)},resolve:()=>23942},{ssr:!1,fallback:(0,l.jsx)(s.A,{})});function CodeEditorTextarea_CodeEditorTextarea(e){const{onClickEdit:o,...n}=e.componentProps||{};return e.wrap((0,l.jsx)(i.A,{testId:"code-editor-textarea",children:r=>(0,l.jsxs)(t.h,{position:"relative",children:[(0,l.jsx)(c,{...r,value:e.input.value||"",onChange:o=>e.input.onChange(void 0,o),onFocus:()=>e.input.onFocus(),onBlur:()=>e.input.onBlur(),options:{theme:"monokai",indentWithTabs:!1,tabSize:2,lineNumbers:!0,keyMap:"sublime",lineWrapping:!0,...n}}),n.readOnly&&o&&(0,l.jsx)(a.A,{level:2,fake:!0,onClick:o,alignItems:"center",cursor:"pointer",display:"flex",elevation:1,justifyContent:"center",position:"absolute-center",textAlign:"center",textStyle:"white",className:d,id:e.meta.htmlId,children:"Click to open editor"})]})}),{labelPointsToCustomElement:!0})}},63668(e,o,n){n.r(o),n.d(o,{default:()=>MarkdownEditor});var r=n(85906),t=n(19363),s=n(95453),i=n(45919),a=n(71123),d=n(42891),l=n(99737),c=n(77637),p=n(16990),u=n(28625),h=n(2063),m=n(3633);var x=n(57280),f=n(94609),v=n(22073),A=n(49329),w=n(74954),j=n(14202);function MarkdownSupportedHelpMessage(){(0,w.tz)();return(0,j.jsx)(A.A,{source:"You can use [markdown format](https://support.productreview.com.au/hc/en-us/articles/360001440795-What-is-Markdown-and-where-do-I-need-it-) here.",initialParser:"inline"})}function MarkdownEditorFullscreenModal(e){const[o,n]=(0,r.useState)(["editor","preview"]),[t]=function(e,o=100){const[n,t]=(0,r.useState)(e),s=(0,r.useMemo)(()=>(0,m.A)(e=>{t(e)},o),[t]);return(0,r.useEffect)(()=>(s(e),()=>{s.cancel()}),[e]),[n,s]}(e.input.value||"",200),A=e.renderPreview(t);(0,r.useEffect)(()=>{e.isOpen?x.A.on():x.A.off()},[e.isOpen]);const w=o.includes("editor"),C=o.includes("preview");return(0,j.jsx)(u.A,{isOpen:e.isOpen,onClose:e.onClose,closeOnEsc:!0,children:({portal:o,closePortal:r,appContext:t})=>o((0,j.jsxs)(p.A.Dialog,{appContext:t,size:"fullscreen",backgroundColor:"white",elevation:10,position:"fixed-center",children:[(0,j.jsxs)(p.A.Header,{children:[(0,j.jsxs)(a.A,{marginX:"auto",children:[(0,j.jsx)(i.A,{onClick:()=>n(["editor"]),buttonStyle:w&&!C?"info":"secondary",isActive:w&&!C,children:"Editor"}),(0,j.jsx)(i.A,{onClick:()=>n(["editor","preview"]),buttonStyle:C&&w?"info":"secondary",isActive:C&&w,children:"Both"}),(0,j.jsx)(i.A,{onClick:()=>n(["preview"]),buttonStyle:C&&!w?"info":"secondary",isActive:C&&!w,children:"Preview"})]}),(0,j.jsx)(p.A.CloseButton,{onClick:r,display:"flex",marginLeft:void 0,children:"Close editor"})]}),(0,j.jsx)(p.A.Body,{display:"flex",overflowY:"hidden",paddingBottom:4,paddingX:4,children:(0,j.jsxs)(c.A,{gutter:4,numberOfColumns:C&&w?2:1,flexGrow:1,children:[w&&(0,j.jsxs)(d.A,{size:1,overflowY:"auto","data-has-error":e.meta.invalid,children:[e.prependedMessage,(0,j.jsx)(f.default,{input:e.input,meta:e.meta,componentProps:{...e.options,autofocus:!0,mode:"markdown"},wrap:e=>e}),e.meta.touched&&e.meta.errors&&(0,j.jsx)(v.A,{children:(0,j.jsx)(h.vS,{errors:e.meta.errors})}),(0,j.jsx)(s.A,{children:(0,j.jsx)(MarkdownSupportedHelpMessage,{})})]}),C&&(0,j.jsx)(d.A,{size:1,overflowY:"auto",trimY:!0,children:w?A:(0,j.jsx)(l.A,{children:A})})]})})]}))})}function MarkdownEditor(e){const{renderPreview:o,prependedMessage:n,...i}=e.componentProps,[a,d]=(0,r.useState)(!1),l=(0,r.useCallback)(()=>{d(!0)},[d]),c=(0,r.useCallback)(()=>{d(!1)},[d]);return(0,j.jsxs)(t.h,{keep:!0,children:[(0,j.jsx)(f.default,{input
1:e.input,meta:e.meta,wrap:e.wrap,componentProps:{...i.options,onClickEdit:l,mode:"markdown",readOnly:!0}}),(0,j.jsx)(s.A,{children:(0,j.jsx)(MarkdownSupportedHelpMessage,{})}),(0,j.jsx)(MarkdownEditorFullscreenModal,{isOpen:a,onClose:c,input:e.input,meta:e.meta,options:e.componentProps.options,renderPreview:e.componentProps.renderPreview,prependedMessage:e.componentProps.prependedMessage})]})}}}]); 2//# sourceMappingURL=fields-MarkdownEditor_0ec8563a.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.