PageSourceSearch

https://www.allwayscabotransportation.com/build/assets/Form-812b7910.js

js allwayscabotransportation.com collected 2026-10-08 20:53:06 UTC 113,826 bytes, 6 lines download raw bytes

1var aa=Object.defineProperty;var ca=(ge,pe,O)=>pe in ge?aa(ge,pe,{enumerable:!0,configurable:!0,writable:!0,value:O}):ge[pe]=O;var dt=(ge,pe,O)=>(ca(ge,typeof pe!="symbol"?pe+"":pe,O),O);import{c as wo,T as ia,r as xo,z as Yn,o as Me,f as ua,w as qs,e as d,d as es,u as A,p as da,t as Ae,b as qe,g as Yo,F as No,j as Mo,n as ts,k as F,E as Po,h as X,v as W,A as Gs,i as Ks,l as os}from"./app-f7d7947b.js";import{_ as ma}from"./BlogAdminLayout-12ac4ee8.js";import{v as pa,p as ba,a as ga}from"./filepond.min-a1dd9889.js";import{E as fa,t as ha}from"./plugin-b41f0687.js";/* empty css            */(function(){var ge=tinymce.util.Tools.resolve("tinymce.PluginManager");const pe=(U,P)=>{U.focus(),U.undoManager.transact(()=>{U.setContent(P)}),U.selection.setCursorLocation(),U.nodeChanged()},O=U=>U.getContent({source_view:!0}),fe=U=>{const P=O(U);U.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code",spellcheck:!1}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{code:P},onSubmit:K=>{pe(U,K.getData().code),K.close()}})},h=U=>{U.addCommand("mceCodeEditor",()=>{fe(U)})},ie=U=>{const P=()=>U.execCommand("mceCodeEditor");U.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:P}),U.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:P})};var Xe=()=>{ge.add("code",U=>(h(U),ie(U),{}))};Xe()})();(function(){var ge=tinymce.util.Tools.resolve("tinymce.PluginManager");const pe=Object.getPrototypeOf,O=(o,l,r)=>{var m;return r(o,l.prototype)?!0:((m=o.constructor)==null?void 0:m.name)===l.name},fe=o=>{const l=typeof o;return o===null?"null":l==="object"&&Array.isArray(o)?"array":l==="object"&&O(o,String,(r,m)=>m.isPrototypeOf(r))?"string":l},h=o=>l=>fe(l)===o,ie=o=>l=>typeof l===o,Xe=o=>l=>o===l,U=(o,l)=>K(o)&&O(o,l,(r,m)=>pe(r)===m),P=h("string"),K=h("object"),st=o=>U(o,Object),te=h("array"),xe=Xe(null),Dt=ie("boolean"),lt=o=>o==null,Pe=o=>!lt(o),M=ie("function"),Je=ie("number"),Ut=(o,l)=>{if(te(o)){for(let r=0,m=o.length;r<m;++r)if(!l(o[r]))return!1;return!0}return!1},le=()=>{},Ne=class{constructor(l,r){dt(this,"tag");dt(this,"value");this.tag=l,this.value=r}static some(l){return new Ne(!0,l)}static none(){return Ne.singletonNone}fold(l,r){return this.tag?r(this.value):l()}isSome(){return this.tag}isNone(){return!this.tag}map(l){return this.tag?Ne.some(l(this.value)):Ne.none()}bind(l){return this.tag?l(this.value):Ne.none()}exists(l){return this.tag&&l(this.value)}forall(l){return!this.tag||l(this.value)}filter(l){return!this.tag||l(this.value)?this:Ne.none()}getOr(l){return this.tag?this.value:l}or(l){return this.tag?this:l}getOrThunk(l){return this.tag?this.value:l()}orThunk(l){return this.tag?this:l()}getOrDie(l){if(this.tag)return this.value;throw new Error(l??"Called getOrDie on None")}
1static from(l){return Pe(l)?Ne.some(l):Ne.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(l){this.tag&&l(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}};let Y=Ne;dt(Y,"singletonNone",new Ne(!1));const re=Array.prototype.push,he=o=>{const l=[];for(let r=0,m=o.length;r<m;++r){if(!te(o[r]))throw new Error("Arr.flatten item "+r+" was not an array, input: "+o);re.apply(l,o[r])}return l},v=(o,l)=>l>=0&&l<o.length?Y.some(o[l]):Y.none(),Bt=o=>v(o,0),Lt=(o,l)=>{for(let r=0;r<o.length;r++){const m=l(o[r],r);if(m.isSome())return m}return Y.none()},jt=Object.keys,ue=Object.hasOwnProperty,rt=(o,l)=>{const r=jt(o);for(let m=0,w=r.length;m<w;m++){const I=r[m],z=o[I];l(z,I)}},mt=o=>(l,r)=>{o[r]=l},q=(o,l,r,m)=>{rt(o,(w,I)=>{(l(w,I)?r:m)(w,I)})},J=(o,l)=>{const r={};return q(o,l,mt(r),le),r},_e=(o,l)=>ue.call(o,l),pt=(o,l)=>_e(o,l)&&o[l]!==void 0&&o[l]!==null,Ge=(o=>(...l)=>{if(l.length===0)throw new Error("Can't merge zero objects");const r={};for(let m=0;m<l.length;m++){const w=l[m];for(const I in w)_e(w,I)&&(r[I]=o(r[I],w[I]))}return r})((o,l)=>st(o)&&st(l)?Ge(o,l):l),bt=o=>o.length>0,Ee=(o,l)=>{const m=(l||document).createElement("div");if(m.innerHTML=o,!m.hasChildNodes()||m.childNodes.length>1){const w="HTML does not have a single root node";throw console.error(w,o),new Error(w)}return ve(m.childNodes[0])},gt=(o,l)=>{const m=(l||document).createElement(o);return ve(m)},ae=(o,l)=>{const m=(l||document).createTextNode(o);return ve(m)},ve=o=>{if(o==null)throw new Error("Node cannot be null or undefined");return{dom:o}},Ke={fromHtml:Ee,fromTag:gt,fromText:ae,fromDom:ve,fromPoint:(o,l,r)=>Y.from(o.dom.elementFromPoint(l,r)).map(ve)},ht=(o,l,r)=>{if(P(r)||Dt(r)||Je(r))o.setAttribute(l,r+"");else throw console.error("Invalid call to Attribute.set. Key ",l,":: Value ",r,":: Element ",o),new Error("Attribute value was not simple")},yt=(o,l,r)=>{ht(o.dom,l,r)},ke=(o,l)=>{o.dom.removeAttribute(l)};var Fe=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),wt=tinymce.util.Tools.resolve("tinymce.util.URI");const Z=o=>l=>l.options.get(o),It=o=>{const l=o.options.register;l("image_dimensions",{processor:"boolean",default:!0}),l("image_advtab",{processor:"boolean",default:!1}),l("image_uploadtab",{processor:"boolean",default:!0}),l("image_prepend_url",{processor:"string",default:""}),l("image_class_list",{processor:"object[]"}),l("image_description",{processor:"boolean",default:!0}),l("image_title",{processor:"boolean",default:!1}),l("image_caption",{processor:"boolean",default:!1}),l("image_list",{processor:r=>{const m=r===!1||P(r)||Ut(r,K)||M(r);return m?{value:r,valid:m}:{valid:!1,message:"Must be false, a string, an array or a function."}},default:!1})},at=Z("image_dimensions"),Ze=Z("image_advtab"),Ot=Z("image_uploadtab"),xt=Z("image_prepend_url"),De=Z("image_class_list"),k=Z("image_description"),p=Z("image_title"),x=Z("image_caption"),V=Z("image_list"),ce=Z("a11y_advanced_options"),ct=Z("automatic_uploads"),Ye=o=>bt(o.options.get("images_upload_url")),Ue=o=>Pe(o.options.get("images_upload_handler")),Qe=(o,l)=>Math.max(parseInt(o,10),parseInt(l,10)),Ie=o=>new Promise(l=>{const r=document.createElement("img"),m=I=>{r.parentNode&&r.parentNode.removeChild(r),l(I)};r.addEventListener("load",()=>{const I=Qe(r.width,r.clientWidth),z=Qe(r.height,r.clientHeight),Q={width:I,height:z};m(Promise.resolve(Q))}),r.addEventListener("error",()=>{m(Promise.reject(`Failed to get image dimensions for: ${o}`))});const w=r.style;w.visibility="hidden",w.position="fixed",w.bottom=w.left="0px",w.width=w.height="auto",document.body.appendChild(r),r.src=o}),et=o=>(o&&(o=o.replace(/px$/,"")),o),tt=o=>(o.length>0&&/^[0-9]+$/.test(o)&&(o+="px"),o),oe=o=>{if(o.margin){const l=String(o.margin).split(" ");switch(l.length){case 1:o["margin-top"]=o["margin-top"]||l[0],o["margin-right"]=o["margin-right"]||l[0],o["margin-bottom"]=o["margin-bottom"]||l[0],o["margin-left"]=o["margin-left"]||l[0];break;case 2:o["margin-top"]=o["margin-top"]||l[0],o["margin-right"]=o["margin-right"]||l[1],o["margin-bottom"]=o["margin-bottom"]||l[0],o["margin-left"]=o["margin-left"]||l[1];break;case 3:o["margin-top"]=o["margin-top"]||l[0],o["margin-right"]=o["margin-right"]||l[1],o["margin-bottom"]=o["margin-bottom"]||l[2],o["margin-left"]=o["margin-left"]||l[1];break;case 4:o["margin-top"]=o["margin-top"]||l[0],o["margin-right"]=o["margin-right"]||l[1],o["margin-bottom"]=o["margin-bottom"]||l[2],o["margin-left"]=o["margin-left"]||l[3]}delete o.margin}return o},Rt=(o,l)=>{const r=V(o);P(r)?fetch(r).then(m=>{m.ok&&m.json().then(l)}):M(r)?r(l):l(r)},to=(o,l,r)=>{const m=()=>{r.onload=r.onerror=null,o.selection&&(o.selection.select(r),o.nodeChanged())};r.onload=()=>{!l.width&&!l.height&&at(o)&&o.dom.setAttribs(r,{width:String(r.clientWidth),height:String(r.clientHeight)}),m()},r.onerror=m},oo=o=>new Promise((l,r)=>{const m=new FileReader;m.onload=()=>
1{l(m.result)},m.onerror=()=>{var w;r((w=m.error)==null?void 0:w.message)},m.readAsDataURL(o)}),no=o=>o.nodeName==="IMG"&&(o.hasAttribute("data-mce-object")||o.hasAttribute("data-mce-placeholder")),so=(o,l)=>{const r=o.options.get;return wt.isDomSafe(l,"img",{allow_html_data_urls:r("allow_html_data_urls"),allow_script_urls:r("allow_script_urls"),allow_svg_data_urls:r("allow_svg_data_urls")})},de=Fe.DOM,Ht=o=>o.style.marginLeft&&o.style.marginRight&&o.style.marginLeft===o.style.marginRight?et(o.style.marginLeft):"",Nt=o=>o.style.marginTop&&o.style.marginBottom&&o.style.marginTop===o.style.marginBottom?et(o.style.marginTop):"",lo=o=>o.style.borderWidth?et(o.style.borderWidth):"",ot=(o,l)=>o.hasAttribute(l)?o.getAttribute(l)??"":"",ro=o=>o.parentNode!==null&&o.parentNode.nodeName==="FIGURE",it=(o,l,r)=>{r===""||r===null?o.removeAttribute(l):o.setAttribute(l,r)},vo=o=>{const l=de.create("figure",{class:"image"});de.insertAfter(l,o),l.appendChild(o),l.appendChild(de.create("figcaption",{contentEditable:"true"},"Caption")),l.contentEditable="false"},vt=o=>{const l=o.parentNode;Pe(l)&&(de.insertAfter(o,l),de.remove(l))},So=o=>{ro(o)?vt(o):vo(o)},$=(o,l)=>{const r=o.getAttribute("style"),m=l(r!==null?r:"");m.length>0?(o.setAttribute("style",m),o.setAttribute("data-mce-style",m)):o.removeAttribute("style")},ao=(o,l)=>(r,m,w)=>{const I=r.style;I[m]?(I[m]=tt(w),$(r,l)):it(r,m,w)},zt=(o,l)=>o.style[l]?et(o.style[l]):ot(o,l),Wt=(o,l)=>{const r=tt(l);o.style.marginLeft=r,o.style.marginRight=r},St=(o,l)=>{const r=tt(l);o.style.marginTop=r,o.style.marginBottom=r},co=(o,l)=>{const r=tt(l);o.style.borderWidth=r},Oe=(o,l)=>{o.style.borderStyle=l},qt=o=>o.style.borderStyle??"",Gt=o=>Pe(o)&&o.nodeName==="FIGURE",Co=o=>o.nodeName==="IMG",Se=o=>{const l=de.getAttrib(o,"alt"),r=de.getAttrib(o,"role");return o.hasAttribute("alt")&&l.length===0||r==="presentation"||r==="none"},io=o=>Se(o)?"":ot(o,"alt"),be=()=>({src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}),uo=(o,l)=>{const r=document.createElement("img");return it(r,"style",l.style),(Ht(r)||l.hspace!=="")&&Wt(r,l.hspace),(Nt(r)||l.vspace!=="")&&St(r,l.vspace),(lo(r)||l.border!=="")&&co(r,l.border),(qt(r)||l.borderStyle!=="")&&Oe(r,l.borderStyle),o(r.getAttribute("style")??"")},me=(o,l)=>{const r=document.createElement("img");if(S(o,{...l,caption:!1},r),u(r,l.alt,l.isDecorative),l.caption){const m=de.create("figure",{class:"image"});return m.appendChild(r),m.appendChild(de.create("figcaption",{contentEditable:"true"},"Caption")),m.contentEditable="false",m}else return r},c=(o,l)=>({src:ot(l,"src"),alt:io(l),title:ot(l,"title"),width:zt(l,"width"),height:zt(l,"height"),class:ot(l,"class"),style:o(ot(l,"style")),caption:ro(l),hspace:Ht(l),vspace:Nt(l),border:lo(l),borderStyle:qt(l),isDecorative:Se(l)}),a=(o,l,r,m,w)=>{r[m]!==l[m]&&w(o,m,String(r[m]))},u=(o,l,r)=>{if(r){de.setAttrib(o,"role","presentation");const m=Ke.fromDom(o);yt(m,"alt","")}else{if(xe(l)){const m=Ke.fromDom(o);ke(m,"alt")}else{const m=Ke.fromDom(o);yt(m,"alt",l)}de.getAttrib(o,"role")==="presentation"&&de.setAttrib(o,"role","")}},g=(o,l,r)=>{(r.alt!==l.alt||r.isDecorative!==l.isDecorative)&&u(o,r.alt,r.isDecorative)},C=(o,l)=>(r,m,w)=>{o(r,w),$(r,l)},S=(o,l,r)=>{const m=c(o,r);a(r,m,l,"caption",(w,I,z)=>So(w)),a(r,m,l,"src",it),a(r,m,l,"title",it),a(r,m,l,"width",ao("width",o)),a(r,m,l,"height",ao("height",o)),a(r,m,l,"class",it),a(r,m,l,"style",C((w,I)=>it(w,"style",I),o)),a(r,m,l,"hspace",C(Wt,o)),a(r,m,l,"vspace",C(St,o)),a(r,m,l,"border",C(co,o)),a(r,m,l,"borderStyle",C(Oe,o)),g(r,m,l)},R=(o,l)=>{const r=o.dom.styles.parse(l),m=oe(r),w=o.dom.styles.parse(o.dom.styles.serialize(m));return o.dom.styles.serialize(w)},H=o=>{const l=o.selection.getNode(),r=o.dom.getParent(l,"figure.image");return r?o.dom.select("img",r)[0]:l&&(l.nodeName!=="IMG"||no(l))?null:l},T=(o,l)=>{const r=o.dom,m=J(o.schema.getTextBlockElements(),(I,z)=>!o.schema.isValidChild(z,"figure")),w=r.getParent(l.parentNode,I=>pt(m,I.nodeName),o.getBody());return w?r.split(w,l)??l:l},B=o=>{const l=H(o);return l?c(r=>R(o,r),l):be()},ye=(o,l)=>{const r=me(w=>R(o,w),l);o.dom.setAttrib(r,"data-mce-id","__mcenew"),o.focus(),o.insertContent(r.outerHTML);const m=o.dom.select('*[data-mce-id="__mcenew"]')[0];if(o.dom.setAttrib(m,"data-mce-id",null),Gt(m)){const w=T(o,m);o.selection.select(w)}else o.selection.select(m)},ee=(o,l)=>{o.dom.setAttrib(l,"src",l.getAttribute("src"))},ne=(o,l)=>{if(l){const r=o.dom.is(l.parentNode,"figure.image")?l.parentNode:l;o.dom.remove(r),o.focus(),o.nodeChanged(),o.dom.isEmpty(o.getBody())&&(o.setContent(""),o.selection.setCursorLocation())}},Mt=(o,l)=>{const r=H(o);if(r)if(S(m=>R(o,m),l,r),ee(o,r),Gt(r.parentNode)){o.dom.setStyle(r,"float","");const m=r.parentNode;T(o,m),o.selection.select(r.parentNode)}else o.selection.select(r),to(o,l,r)},Re=(o,l)=>{const r=l.src;return{...l,src:so(o,r)?r:""}},Kt=(o,l)=>{const r=H(o);if(r){const w={...c(z=>R(o,z),r),...l},I=Re(o,w);w.src?Mt(o,I):ne(o,r)}else l.src&&ye(o,{...be(),...l})};var mo=tinymce.util.Tools.resolve("tinymce.util.ImageUploader"),se=tinymce.util.Tools.resolve("tinymce.util.Tools");const Ce=o=>P(o.value)?o.value:"",Be=o=>P(o.text)?o.text:P(o.title)?o.title:"",Ct=(o,l)=>{const r=[];return se.each(o,m=>{const w=Be(m);
1if(m.menu!==void 0){const I=Ct(m.menu,l);r.push({text:w,items:I})}else{const I=l(m);r.push({text:w,value:I})}}),r},Qt=(o=Ce)=>l=>l?Y.from(l).map(r=>Ct(r,o)):Y.none(),Tt=o=>Qt(Ce)(o),en=o=>_e(o,"items"),To=(o,l)=>Lt(o,r=>en(r)?To(r.items,l):r.value===l?Y.some(r):Y.none()),At={sanitizer:Qt,sanitize:Tt,findEntry:(o,l)=>o.bind(r=>To(r,l))},tn={makeTab:o=>({title:"Advanced",name:"advanced",items:[{type:"grid",columns:2,items:[{type:"input",label:"Vertical space",name:"vspace",inputMode:"numeric"},{type:"input",label:"Horizontal space",name:"hspace",inputMode:"numeric"},{type:"input",label:"Border width",name:"border",inputMode:"numeric"},{type:"listbox",name:"borderstyle",label:"Border style",items:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]}]}]})},po=o=>{const l=At.sanitizer(Ve=>o.convertURL(Ve.value||Ve.url||"","src")),r=new Promise(Ve=>{Rt(o,Tn=>{Ve(l(Tn).map(An=>he([[{text:"None",value:""}],An])))})}),m=At.sanitize(De(o)),w=Ze(o),I=Ot(o),z=Ye(o),Q=Ue(o),Le=B(o),_t=k(o),je=p(o),Jt=at(o),vn=x(o),Sn=ce(o),Vo=ct(o),Cn=Y.some(xt(o)).filter(Ve=>P(Ve)&&Ve.length>0);return r.then(Ve=>({image:Le,imageList:Ve,classList:m,hasAdvTab:w,hasUploadTab:I,hasUploadUrl:z,hasUploadHandler:Q,hasDescription:_t,hasImageTitle:je,hasDimensions:Jt,hasImageCaption:vn,prependURL:Cn,hasAccessibilityOptions:Sn,automaticUploads:Vo}))},Pt=o=>{const l={name:"src",type:"urlinput",filetype:"image",label:"Source",picker_text:"Browse files"},r=o.imageList.map(je=>({name:"images",type:"listbox",label:"Image list",items:je})),m={name:"alt",type:"input",label:"Alternative description",enabled:!(o.hasAccessibilityOptions&&o.image.isDecorative)},w={name:"title",type:"input",label:"Image title"},I={name:"dimensions",type:"sizeinput"},z={type:"label",label:"Accessibility",items:[{name:"isDecorative",type:"checkbox",label:"Image is decorative"}]},Q=o.classList.map(je=>({name:"classes",type:"listbox",label:"Class",items:je})),Le={type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]},_t=je=>je?{type:"grid",columns:2}:{type:"panel"};return he([[l],r.toArray(),o.hasAccessibilityOptions&&o.hasDescription?[z]:[],o.hasDescription?[m]:[],o.hasImageTitle?[w]:[],o.hasDimensions?[I]:[],[{..._t(o.classList.isSome()&&o.hasImageCaption),items:he([Q.toArray(),o.hasImageCaption?[Le]:[]])}]])},$o={makeTab:o=>({title:"General",name:"general",items:Pt(o)}),makeItems:Pt},sn={makeTab:o=>({title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput"}]})},Ao=o=>({prevImage:At.findEntry(o.imageList,o.image.src),prevAlt:o.image.alt,open:!0}),bo=o=>({src:{value:o.src,meta:{}},images:o.src,alt:o.alt,title:o.title,dimensions:{width:o.width,height:o.height},classes:o.class,caption:o.caption,style:o.style,vspace:o.vspace,border:o.border,hspace:o.hspace,borderstyle:o.borderStyle,fileinput:[],isDecorative:o.isDecorative}),go=(o,l)=>({src:o.src.value,alt:(o.alt===null||o.alt.length===0)&&l?null:o.alt,title:o.title,width:o.dimensions.width,height:o.dimensions.height,class:o.classes,style:o.style,caption:o.caption,hspace:o.hspace,vspace:o.vspace,border:o.border,borderStyle:o.borderstyle,isDecorative:o.isDecorative}),ln=(o,l)=>/^(?:[a-zA-Z]+:)?\/\//.test(l)?Y.none():o.prependURL.bind(r=>l.substring(0,r.length)!==r?Y.some(r+l):Y.none()),rn=(o,l)=>{const r=l.getData();ln(o,r.src.value).each(m=>{l.setData({src:{value:m,meta:r.src.meta}})})},an=(o,l,r)=>{o.hasDescription&&P(r.alt)&&(l.alt=r.alt),o.hasAccessibilityOptions&&(l.isDecorative=r.isDecorative||l.isDecorative||!1),o.hasImageTitle&&P(r.title)&&(l.title=r.title),o.hasDimensions&&(P(r.width)&&(l.dimensions.width=r.width),P(r.height)&&(l.dimensions.height=r.height)),P(r.class)&&At.findEntry(o.classList,r.class).each(m=>{l.classes=m.value}),o.hasImageCaption&&Dt(r.caption)&&(l.caption=r.caption),o.hasAdvTab&&(P(r.style)&&(l.style=r.style),P(r.vspace)&&(l.vspace=r.vspace),P(r.border)&&(l.border=r.border),P(r.hspace)&&(l.hspace=r.hspace),P(r.borderstyle)&&(l.borderstyle=r.borderstyle))},Eo=(o,l)=>{const r=l.getData(),m=r.src.meta;
1if(m!==void 0){const w=Ge({},r);an(o,w,m),l.setData(w)}},Fo=(o,l,r,m)=>{const w=m.getData(),I=w.src.value,z=w.src.meta||{};!z.width&&!z.height&&l.hasDimensions&&(bt(I)?o.imageSize(I).then(Q=>{r.open&&m.setData({dimensions:Q})}).catch(Q=>console.error(Q)):m.setData({dimensions:{width:"",height:""}}))},$t=(o,l,r)=>{const m=r.getData(),w=At.findEntry(o.imageList,m.src.value);l.prevImage=w,r.setData({images:w.map(I=>I.value).getOr("")})},_o=(o,l,r,m)=>{rn(l,m),Eo(l,m),Fo(o,l,r,m),$t(l,r,m)},cn=(o,l,r,m)=>{const w=m.getData(),I=At.findEntry(l.imageList,w.images);I.each(z=>{w.alt===""||r.prevImage.map(Le=>Le.text===w.alt).getOr(!1)?z.value===""?m.setData({src:z,alt:r.prevAlt}):m.setData({src:z,alt:z.text}):m.setData({src:z})}),r.prevImage=I,_o(o,l,r,m)},fo=(o,l,r,m)=>{const w=m.getData();m.block("Uploading image"),Bt(w.fileinput).fold(()=>{m.unblock()},I=>{const z=URL.createObjectURL(I),Q=()=>{m.unblock(),URL.revokeObjectURL(z)},Le=_t=>{m.setData({src:{value:_t,meta:{}}}),m.showTab("general"),_o(o,l,r,m),m.focus("src")};oo(I).then(_t=>{const je=o.createBlobCache(I,z,_t);l.automaticUploads?o.uploadImage(je).then(Jt=>{Le(Jt.url),Q()}).catch(Jt=>{Q(),o.alertErr(Jt,()=>{m.focus("fileinput")})}):(o.addToBlobCache(je),Le(je.blobUri()),m.unblock())})})},un=(o,l,r)=>(m,w)=>{w.name==="src"?_o(o,l,r,m):w.name==="images"?cn(o,l,r,m):w.name==="alt"?r.prevAlt=m.getData().alt:w.name==="fileinput"?fo(o,l,r,m):w.name==="isDecorative"&&m.setEnabled("alt",!m.getData().isDecorative)},dn=o=>()=>{o.open=!1},ls=o=>o.hasAdvTab||o.hasUploadUrl||o.hasUploadHandler?{type:"tabpanel",tabs:he([[$o.makeTab(o)],o.hasAdvTab?[tn.makeTab(o)]:[],o.hasUploadTab&&(o.hasUploadUrl||o.hasUploadHandler)?[sn.makeTab(o)]:[]])}:{type:"panel",items:$o.makeItems(o)},mn=(o,l,r)=>m=>{const w=Ge(bo(l.image),m.getData()),I={...w,style:uo(r.normalizeCss,go(w,!1))};o.execCommand("mceUpdateImage",!1,go(I,l.hasAccessibilityOptions)),o.editorUpload.uploadImagesAuto(),m.close()},rs=o=>l=>so(o,l)?Ie(o.documentBaseURI.toAbsolute(l)).then(r=>({width:String(r.width),height:String(r.height)})):Promise.resolve({width:"",height:""}),Uo=o=>(l,r,m)=>{var w;return o.editorUpload.blobCache.create({blob:l,blobUri:r,name:(w=l.name)==null?void 0:w.replace(/\.[^\.]+$/,""),filename:l.name,base64:m.split(",")[1]})},pn=o=>l=>{o.editorUpload.blobCache.add(l)},bn=o=>(l,r)=>{o.windowManager.alert(l,r)},Bo=o=>l=>R(o,l),ko=o=>l=>o.dom.parseStyle(l),gn=o=>(l,r)=>o.dom.serializeStyle(l,r),fn=o=>l=>mo(o).upload([l],!1).then(r=>{var m;return r.length===0?Promise.reject("Failed to upload image"):r[0].status===!1?Promise.reject((m=r[0].error)==null?void 0:m.message):r[0]}),ut=o=>{const l={imageSize:rs(o),addToBlobCache:pn(o),createBlobCache:Uo(o),alertErr:bn(o),normalizeCss:Bo(o),parseStyle:ko(o),serializeStyle:gn(o),uploadImage:fn(o)};return{open:()=>{po(o).then(m=>{const w=Ao(m);return{title:"Insert/Edit Image",size:"normal",body:ls(m),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:bo(m.image),onSubmit:mn(o,m,l),onChange:un(l,m,w),onClose:dn(w)}}).then(o.windowManager.open)}}},hn=o=>{o.addCommand("mceImage",ut(o).open),o.addCommand("mceUpdateImage",(l,r)=>{o.undoManager.transact(()=>Kt(o,r))})},Lo=o=>{const l=o.attr("class");return Pe(l)&&/\bimage\b/.test(l)},Xt=o=>l=>{let r=l.length;const m=w=>{w.attr("contenteditable",o?"true":null)};for(;r--;){const w=l[r];Lo(w)&&(w.attr("contenteditable",o?"false":null),se.each(w.getAll("figcaption"),m))}},yn=o=>{o.on("PreInit",()=>{o.parser.addNodeFilter("figure",Xt(!0)),o.serializer.addNodeFilter("figure",Xt(!1))})},jo=o=>l=>{const r=()=>{l.setEnabled(o.selection.isEditable())};return o.on("NodeChange",r),r(),()=>{o.off("NodeChange",r)}},wn=o=>{o.ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:ut(o).open,onSetup:l=>{l.setActive(Pe(H(o)));const r=o.selection.selectorChangedWithUnbind("img:not([data-mce-object]):not([data-mce-placeholder]),figure.image",l.setActive).unbind,m=jo(o)(l);return()=>{r(),m()}}}),o.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:ut(o).open,onSetup:jo(o)}),o.ui.registry.addContextMenu("image",{update:l=>o.selection.isEditable()&&(Gt(l)||Co(l)&&!no(l))?["image"]:[]})};var xn=()=>{ge.add("image",o=>{It(o),yn(o),wn(o),hn(o)})};xn()})();(function(){var ge=tinymce.util.Tools.resolve("tinymce.PluginManager");const pe=(c,a,u)=>{var g;return u(c,a.prototype)?!0:((g=c.constructor)==null?void 0:g.name)===a.name},O=c=>{const a=typeof c;return c===null?"null":a==="object"&&Array.isArray(c)?"array":a==="object"&&pe(c,String,(u,g)=>g.isPrototypeOf(u))?"string":a},fe=c=>a=>O(a)===c,h=fe("string"),ie=fe("object"),Xe=fe("array"),U=c=>c==null,P=c=>!U(c),me=class{constructor(a,u){dt(this,"tag");dt(this,"value");this.tag=a,this.value=u}static some(a){return new me(!0,a)}static none(){return me.singletonNone}fold(a,u){return this.tag?u(this.value):a()}isSome(){return this.tag}isNone(){return!this.tag}map(a){return this.tag?me.some(a(this.value)):me.none()}bind(a){return this.tag?a(this.value):me.none()}exists(a){return this.tag&&a(this.value)}forall(a){return!this.tag||a(this.value)}filter(a){return!this.tag||a(this.value)?this:me.none()}getOr(a){return this.tag?this.value:a}or(a){return this.tag?this:a}getOrThunk(a){return this.tag?this.value:a()}orThunk(a){return this.tag?this:a()}getOrDie(a){if(this.tag)return this.value;throw new Error(a??"Called getOrDie on None")}static from(a){return P(a)?me.some(a):me.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(a){this.tag&&a(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}};let K=me;dt(K,"singletonNone",new me(!1));const st=Array.prototype.push,te=(c,a)=>{for(let u=0,g=c.length;u<g;u++){const C=c[u];a(C,u)}},xe=c=>{const a=[];for(let u=0,g=c.length;u<g;++u){if(!Xe(c[u]))throw new Error("Arr.flatten item "+u+" was not an array, input
1: "+c);st.apply(a,c[u])}return a},Dt=Object.keys,lt=Object.hasOwnProperty,Pe=(c,a)=>{const u=Dt(c);for(let g=0,C=u.length;g<C;g++){const S=u[g],R=c[S];a(R,S)}},M=(c,a)=>Je(c,a)?K.from(c[a]):K.none(),Je=(c,a)=>lt.call(c,a),Ut=c=>{let a=c;return{get:()=>a,set:C=>{a=C}}},le=(c,a,u)=>a===""||c.length>=a.length&&c.substr(u,u+a.length)===a,Y=(c,a)=>le(c,a,0),re=c=>a=>a.options.get(c),he=c=>{const a=c.options.register;a("audio_template_callback",{processor:"function"}),a("video_template_callback",{processor:"function"}),a("iframe_template_callback",{processor:"function"}),a("media_live_embeds",{processor:"boolean",default:!0}),a("media_filter_html",{processor:"boolean",default:!0}),a("media_url_resolver",{processor:"function"}),a("media_alt_source",{processor:"boolean",default:!0}),a("media_poster",{processor:"boolean",default:!0}),a("media_dimensions",{processor:"boolean",default:!0})},v=re("audio_template_callback"),Bt=re("video_template_callback"),Lt=re("iframe_template_callback"),jt=re("media_live_embeds"),ue=re("media_filter_html"),rt=re("media_url_resolver"),mt=re("media_alt_source"),q=re("media_poster"),J=re("media_dimensions");var _e=tinymce.util.Tools.resolve("tinymce.util.Tools"),pt=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),$e=tinymce.util.Tools.resolve("tinymce.html.DomParser");const Vt=pt.DOM,Ge=c=>c.replace(/px$/,""),bt=c=>{const a=c.attr("style"),u=a?Vt.parseStyle(a):{};return{type:"ephox-embed-iri",source:c.attr("data-ephox-embed-iri"),altsource:"",poster:"",width:M(u,"max-width").map(Ge).getOr(""),height:M(u,"max-height").map(Ge).getOr("")}},Ee=(c,a)=>{let u={};const C=$e({validate:!1,forced_root_block:!1},a).parse(c);for(let S=C;S;S=S.walk())if(S.type===1){const R=S.name;if(S.attr("data-ephox-embed-iri")){u=bt(S);break}else!u.source&&R==="param"&&(u.source=S.attr("movie")),(R==="iframe"||R==="object"||R==="embed"||R==="video"||R==="audio")&&(u.type||(u.type=R),u=_e.extend(S.attributes.map,u)),R==="source"&&(u.source?u.altsource||(u.altsource=S.attr("src")):u.source=S.attr("src")),R==="img"&&!u.poster&&(u.poster=S.attr("src"))}return u.source=u.source||u.src||"",u.altsource=u.altsource||"",u.poster=u.poster||"",u},gt=c=>{const a={mp3:"audio/mpeg",m4a:"audio/x-m4a",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"},u=c.toLowerCase().split(".").pop()??"";return M(a,u).getOr("")};var ae=tinymce.util.Tools.resolve("tinymce.html.Node"),ve=tinymce.util.Tools.resolve("tinymce.html.Serializer");const ft=(c,a={})=>$e({forced_root_block:!1,validate:!1,allow_conditional_comments:!0,...a},c),Ke=pt.DOM,ht=c=>/^[0-9.]+$/.test(c)?c+"px":c,yt=(c,a)=>{const u=a.attr("style"),g=u?Ke.parseStyle(u):{};P(c.width)&&(g["max-width"]=ht(c.width)),P(c.height)&&(g["max-height"]=ht(c.height)),a.attr("style",Ke.serializeStyle(g))},ke=["source","altsource"],Fe=(c,a,u,g)=>{let C=0,S=0;const R=ft(g);R.addNodeFilter("source",T=>C=T.length);const H=R.parse(c);for(let T=H;T;T=T.walk())if(T.type===1){const B=T.name;if(T.attr("data-ephox-embed-iri")){yt(a,T);break}else{switch(B){case"video":case"object":case"embed":case"img":case"iframe":a.height!==void 0&&a.width!==void 0&&(T.attr("width",a.width),T.attr("height",a.height));break}if(u)switch(B){case"video":T.attr("poster",a.poster),T.attr("src",null);for(let ee=C;ee<2;ee++)if(a[ke[ee]]){const ne=new ae("source",1);ne.attr("src",a[ke[ee]]),ne.attr("type",a[ke[ee]+"mime"]||null),T.append(ne)}break;case"iframe":T.attr("src",a.source);break;case"object":const ye=T.getAll("img").length>0;if(a.poster&&!ye){T.attr("src",a.poster);const ee=new ae("img",1);ee.attr("src",a.poster),ee.attr("width",a.width),ee.attr("height",a.height),T.append(ee)}break;case"source":if(S<2&&(T.attr("src",a[ke[S]]),T.attr("type",a[ke[S]+"mime"]||null),!a[ke[S]])){T.remove();continue}S++;break;case"img":a.poster||T.remove();break}}}return ve({},g).serialize(H)},wt=[{regex:/youtu\.be\/([\w\-_\?&=.]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/youtube\.com(.+)v=([^&]+)(&([a-z0-9&=\-_]+))?/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$2?$4",allowFullscreen:!0},{regex:/youtube.com\/embed\/([a-z0-9\?&=\-_]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)\?h=(\w+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$1?h=$2&title=0&byline=0&portrait=0&color=8dc7dc",allowFullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)\?h=(\w+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$2?h=$3&title=0&amp;byline=0",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc",allowFullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$2?title=0&amp;byline=0",allowFullscreen:!0},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'maps.google.com/maps/ms?msid=$2&output=embed"',allowFullscreen:!1},{regex:/dailymotion\.com\/video\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0},{regex:/dai\.ly\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0}],Z=c=>{const a=c.match(/^(https?:\/\/|www\.)(.+)$/i);return a&&a.length>1?a[1]==="www."?"https://":a[1]:"https://"},It=(c,a)=>{const u=Z(a),g=c.regex.exec(a);let C=u+c.url;if(P(g))for(let S=0;S<g.length;S++)C=C.replace("$"+S,()=>g[S]?g[S]:"");return C.replace(/\?$/,"")},at=c=>{const a=wt.filter(u=>u.regex.test(c));return a.length>0?_e.extend({}
1,a[0],{url:It(a[0],c)}):null},Ze=(c,a)=>{if(a)return a(c);{const u=c.allowfullscreen?' allowFullscreen="1"':"";return'<iframe src="'+c.source+'" width="'+c.width+'" height="'+c.height+'"'+u+"></iframe>"}},Ot=c=>{let a='<object data="'+c.source+'" width="'+c.width+'" height="'+c.height+'" type="application/x-shockwave-flash">';return c.poster&&(a+='<img src="'+c.poster+'" width="'+c.width+'" height="'+c.height+'" />'),a+="</object>",a},xt=(c,a)=>a?a(c):'<audio controls="controls" src="'+c.source+'">'+(c.altsource?`
2<source src="`+c.altsource+'"'+(c.altsourcemime?' type="'+c.altsourcemime+'"':"")+` />
3`:"")+"</audio>",De=(c,a)=>a?a(c):'<video width="'+c.width+'" height="'+c.height+'"'+(c.poster?' poster="'+c.poster+'"':"")+` controls="controls">
4<source src="`+c.source+'"'+(c.sourcemime?' type="'+c.sourcemime+'"':"")+` />
5`+(c.altsource?'<source src="'+c.altsource+'"'+(c.altsourcemime?' type="'+c.altsourcemime+'"':"")+` />
6`:"")+"</video>",k=(c,a)=>{const u=_e.extend({},a);if(!u.source&&(_e.extend(u,Ee(u.embed??"",c.schema)),!u.source))return"";u.altsource||(u.altsource=""),u.poster||(u.poster=""),u.source=c.convertURL(u.source,"source"),u.altsource=c.convertURL(u.altsource,"source"),u.sourcemime=gt(u.source),u.altsourcemime=gt(u.altsource),u.poster=c.convertURL(u.poster,"poster");const g=at(u.source);if(g&&(u.source=g.url,u.type=g.type,u.allowfullscreen=g.allowFullscreen,u.width=u.width||String(g.w),u.height=u.height||String(g.h)),u.embed)return Fe(u.embed,u,!0,c.schema);{const C=v(c),S=Bt(c),R=Lt(c);return u.width=u.width||"300",u.height=u.height||"150",_e.each(u,(H,T)=>{u[T]=c.dom.encode(""+H)}),u.type==="iframe"?Ze(u,R):u.sourcemime==="application/x-shockwave-flash"?Ot(u):u.sourcemime.indexOf("audio")!==-1?xt(u,C):De(u,S)}},p=c=>c.hasAttribute("data-mce-object")||c.hasAttribute("data-ephox-embed-iri"),x=c=>{c.on("mousedown",a=>{const u=c.dom.getParent(a.target,".mce-preview-object");u&&c.dom.getAttrib(u,"data-mce-selected")==="2"&&a.stopImmediatePropagation()}),c.on("click keyup touchend",()=>{const a=c.selection.getNode();a&&c.dom.hasClass(a,"mce-preview-object")&&c.dom.getAttrib(a,"data-mce-selected")&&a.setAttribute("data-mce-selected","2")}),c.on("ObjectResized",a=>{const u=a.target;if(u.getAttribute("data-mce-object")){let g=u.getAttribute("data-mce-html");g&&(g=unescape(g),u.setAttribute("data-mce-html",escape(Fe(g,{width:String(a.width),height:String(a.height)},!1,c.schema))))}})},V={},ce=(c,a,u)=>new Promise((g,C)=>{const S=R=>(R.html&&(V[c.source]=R),g({url:c.source,html:R.html?R.html:a(c)}));V[c.source]?S(V[c.source]):u({url:c.source}).then(S).catch(C)}),ct=(c,a)=>Promise.resolve({html:a(c),url:c.source}),Ye=c=>a=>k(c,a),Ue=(c,a)=>{const u=rt(c);return u?ce(a,Ye(c),u):ct(a,Ye(c))},Qe=c=>Je(V,c),Ie=(c,a)=>M(a,c).bind(u=>M(u,"meta")),et=(c,a,u)=>g=>{const C=()=>M(c,g),S=()=>M(a,g),R=B=>M(B,"value").bind(ye=>ye.length>0?K.some(ye):K.none()),H=()=>C().bind(B=>ie(B)?R(B).orThunk(S):S().orThunk(()=>K.from(B))),T=()=>S().orThunk(()=>C().bind(B=>ie(B)?R(B):K.from(B)));return{[g]:(g===u?H():T()).getOr("")}},tt=(c,a)=>{const u={};return M(c,"dimensions").each(g=>{te(["width","height"],C=>{M(a,C).orThunk(()=>M(g,C)).each(S=>u[C]=S)})}),u},oe=(c,a)=>{const u=a&&a!=="dimensions"?Ie(a,c).getOr({}):{},g=et(c,u,a);return{...g("source"),...g("altsource"),...g("poster"),...g("embed"),...tt(c,u)}},Rt=c=>{const a={...c,source:{value:M(c,"source").getOr("")},altsource:{value:M(c,"altsource").getOr("")},poster:{value:M(c,"poster").getOr("")}};return te(["width","height"],u=>{M(c,u).each(g=>{const C=a.dimensions||{};C[u]=g,a.dimensions=C})}),a},to=c=>a=>{const u=a&&a.msg?"Media embed handler error: "+a.msg:"Media embed handler threw unknown error.";c.notificationManager.open({type:"error",text:u})},oo=c=>{const a=c.selection.getNode(),u=p(a)?c.serializer.serialize(a,{selection:!0}
6):"",g=Ee(u,c.schema),S=(()=>{if(Ht(g.source,g.type)){const R=c.dom.getRect(a);return{width:R.w.toString().replace(/px$/,""),height:R.h.toString().replace(/px$/,"")}}else return{}})();return{embed:u,...g,...S}},no=(c,a)=>u=>{if(h(u.url)&&u.url.trim().length>0){const g=u.html,S={...Ee(g,a.schema),source:u.url,embed:g};c.setData(Rt(S))}},so=(c,a)=>{const u=c.dom.select("*[data-mce-object]");for(let g=0;g<a.length;g++)for(let C=u.length-1;C>=0;C--)a[g]===u[C]&&u.splice(C,1);c.selection.select(u[0])},de=(c,a)=>{const u=c.dom.select("*[data-mce-object]");c.insertContent(a),so(c,u),c.nodeChanged()},Ht=(c,a)=>P(a)&&a==="ephox-embed-iri"&&P(at(c)),Nt=(c,a)=>((g,C)=>g.width!==C.width||g.height!==C.height)(c,a)&&Ht(a.source,c.type),lo=(c,a,u)=>{a.embed=Nt(c,a)&&J(u)?k(u,{...a,embed:""}):Fe(a.embed??"",a,!1,u.schema),a.embed&&(c.source===a.source||Qe(a.source))?de(u,a.embed):Ue(u,a).then(g=>{de(u,g.html)}).catch(to(u))},ot=c=>{const a=oo(c),u=Ut(a),g=Rt(a),C=(se,Ce)=>{const Be=oe(Ce.getData(),"source");se.source!==Be.source&&(no(mo,c)({url:Be.source,html:""}),Ue(c,Be).then(no(mo,c)).catch(to(c)))},S=se=>{const Ce=oe(se.getData()),Be=Ee(Ce.embed??"",c.schema);se.setData(Rt(Be))},R=(se,Ce,Be)=>{const Ct=oe(se.getData(),Ce),Qt=Nt(Be,Ct)&&J(c)?{...Ct,embed:""}:Ct,Tt=k(c,Qt);se.setData(Rt({...Qt,embed:Tt}))},H=[{name:"source",type:"urlinput",filetype:"media",label:"Source",picker_text:"Browse files"}],T=J(c)?[{type:"sizeinput",name:"dimensions",label:"Constrain proportions",constrain:!0}]:[],B={title:"General",name:"general",items:xe([H,T])},ee={title:"Embed",items:[{type:"textarea",name:"embed",label:"Paste your embed code below:"}]},ne=[];mt(c)&&ne.push({name:"altsource",type:"urlinput",filetype:"media",label:"Alternative source URL"}),q(c)&&ne.push({name:"poster",type:"urlinput",filetype:"image",label:"Media poster (Image URL)"});const Mt={title:"Advanced",name:"advanced",items:ne},Re=[B,ee];ne.length>0&&Re.push(Mt);const Kt={type:"tabpanel",tabs:Re},mo=c.windowManager.open({title:"Insert/Edit Media",size:"normal",body:Kt,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:se=>{const Ce=oe(se.getData());lo(u.get(),Ce,c),se.close()},onChange:(se,Ce)=>{switch(Ce.name){case"source":C(u.get(),se);break;case"embed":S(se);break;case"dimensions":case"altsource":case"poster":R(se,Ce.name,u.get());break}u.set(oe(se.getData()))},initialData:g})},ro=c=>({showDialog:()=>{ot(c)}}),it=c=>{const a=()=>{ot(c)};c.addCommand("mceMedia",a)};var vo=tinymce.util.Tools.resolve("tinymce.Env");const vt=c=>{const a=c.name;return a==="iframe"||a==="video"||a==="audio"},So=(c,a,u,g=null)=>{const C=c.attr(u);return P(C)?C:Je(a,u)?null:g},$=(c,a,u)=>{const g=a.name==="img"||c.name==="video",C=g?"300":null,S=c.name==="audio"?"30":"150",R=g?S:null;a.attr({width:So(c,u,"width",C),height:So(c,u,"height",R)})},ao=(c,a,u,g)=>{const C=ft(c.schema).parse(g,{context:a});for(;C.firstChild;)u.append(C.firstChild)},zt=(c,a)=>{const u=a.name,g=new ae("img",1);return St(c,a,g),$(a,g,{}),g.attr({style:a.attr("style"),src:vo.transparentSrc,"data-mce-object":u,class:"mce-object mce-object-"+u}),g},Wt=(c,a)=>{const u=a.name,g=new ae("span",1);g.attr({contentEditable:"false",style:a.attr("style"),"data-mce-object":u,class:"mce-preview-object mce-object-"+u}),St(c,a,g);const C=c.dom.parseStyle(a.attr("style")??""),S=new ae(u,1);if($(a,S,C),S.attr({src:a.attr("src"),style:a.attr("style"),class:a.attr("class")}),u==="iframe")S.attr({allowfullscreen:a.attr("allowfullscreen"),frameborder:"0",sandbox:a.attr("sandbox"),referrerpolicy:a.attr("referrerpolicy")});else{te(["controls","crossorigin","currentTime","loop","muted","poster","preload"],B=>{S.attr(B,a.attr(B))});const T=g.attr("data-mce-html");P(T)&&ao(c,u,S,unescape(T))}const R=new ae("span",1);return R.attr("class","mce-shim"),g.append(S),g.append(R),g},St=(c,a,u)=>{const g=a.attributes??[];let C=g.length;for(;C--;){const T=g[C].name;let B=g[C].value;T!=="width"&&T!=="height"&&T!=="style"&&!Y(T,"data-mce-")&&((T==="data"||T==="src")&&(B=c.convertURL(B,T)),u.attr("data-mce-p-"+T,B))}const S=ve({inner:!0},c.schema),R=new ae("div",1);te(a.children(),T=>R.append(T));const H=S.serialize(R);H&&(u.attr("data-mce-html",escape(H)),u.empty())},co=c=>{const a=c.attr("class");return h(a)&&/\btiny-pageembed\b/.test(a)},Oe=c=>{let a=c;for(;a=a.parent;)if(a.attr("data-ephox-embed-iri")||co(a))return!0;return!1},qt=c=>a=>{let u=a.length,g;for(;u--;)g=a[u],g.parent&&(g.parent.attr("data-mce-object")||(vt(g)&&jt(c)?Oe(g)||g.replace(Wt(c,g)):Oe(g)||g.replace(zt(c,g))))},Gt=(c,a,u)=>
6{const g=c.options.get,C=g("xss_sanitization"),S=ue(c);return ft(c.schema,{sanitize:C,validate:S}).parse(u,{context:a})},Co=c=>{c.on("PreInit",()=>{const{schema:a,serializer:u,parser:g}=c,C=a.getBoolAttrs();te("webkitallowfullscreen mozallowfullscreen".split(" "),S=>{C[S]={}}),Pe({embed:["wmode"]},(S,R)=>{const H=a.getElementRule(R);H&&te(S,T=>{H.attributes[T]={},H.attributesOrder.push(T)})}),g.addNodeFilter("iframe,video,audio,object,embed",qt(c)),u.addAttributeFilter("data-mce-object",(S,R)=>{let H=S.length;for(;H--;){const T=S[H];if(!T.parent)continue;const B=T.attr(R),ye=new ae(B,1);if(B!=="audio"){const Re=T.attr("class");Re&&Re.indexOf("mce-preview-object")!==-1&&T.firstChild?ye.attr({width:T.firstChild.attr("width"),height:T.firstChild.attr("height")}):ye.attr({width:T.attr("width"),height:T.attr("height")})}ye.attr({style:T.attr("style")});const ee=T.attributes??[];let ne=ee.length;for(;ne--;){const Re=ee[ne].name;Re.indexOf("data-mce-p-")===0&&ye.attr(Re.substr(11),ee[ne].value)}const Mt=T.attr("data-mce-html");if(Mt){const Re=Gt(c,B,unescape(Mt));te(Re.children(),Kt=>ye.append(Kt))}T.replace(ye)}})}),c.on("SetContent",()=>{const a=c.dom;te(a.select("span.mce-preview-object"),u=>{a.select("span.mce-shim",u).length===0&&a.add(u,"span",{class:"mce-shim"})})})},Se=c=>{c.on("ResolveName",a=>{let u;a.target.nodeType===1&&(u=a.target.getAttribute("data-mce-object"))&&(a.name=u)})},io=c=>a=>{const u=()=>{a.setEnabled(c.selection.isEditable())};return c.on("NodeChange",u),u(),()=>{c.off("NodeChange",u)}},be=c=>{const a=()=>c.execCommand("mceMedia");c.ui.registry.addToggleButton("media",{tooltip:"Insert/edit media",icon:"embed",onAction:a,onSetup:u=>{const g=c.selection;u.setActive(p(g.getNode()));const C=g.selectorChangedWithUnbind("img[data-mce-object],span[data-mce-object],div[data-ephox-embed-iri]",u.setActive).unbind,S=io(c)(u);return()=>{C(),S()}}}),c.ui.registry.addMenuItem("media",{icon:"embed",text:"Media...",onAction:a,onSetup:io(c)})};var uo=()=>{ge.add("media",c=>(he(c),it(c),be(c),Se(c),Co(c),x(c),ro(c)))};uo()})();(function(){var ge=tinymce.util.Tools.resolve("tinymce.PluginManager");const pe=(e,t,n)=>{var s;return n(e,t.prototype)?!0:((s=e.constructor)==null?void 0:s.name)===t.name},O=e=>{const t=typeof e;return e===null?"null":t==="object"&&Array.isArray(e)?"array":t==="object"&&pe(e,String,(n,s)=>s.isPrototypeOf(n))?"string":t},fe=e=>t=>O(t)===e,h=e=>t=>typeof t===e,ie=e=>t=>e===t,Xe=fe("string"),U=fe("array"),P=h("boolean"),K=ie(void 0),st=e=>e==null,te=e=>!st(e),xe=h("function"),Dt=h("number"),lt=()=>{},Pe=(e,t)=>n=>e(t(n)),M=e=>()=>e,Je=e=>e,Ut=(e,t)=>e===t;function le(e,...t){return(...n)=>{const s=t.concat(n);return e.apply(null,s)}}const Y=e=>{e()},re=M(!1),he=M(!0),nt=class{constructor(t,n){dt(this,"tag");dt(this,"value");this.tag=t,this.value=n}static some(t){return new nt(!0,t)}static none(){return nt.singletonNone}fold(t,n){return this.tag?n(this.value):t()}isSome(){return this.tag}isNone(){return!this.tag}map(t){return this.tag?nt.some(t(this.value)):nt.none()}bind(t){return this.tag?t(this.value):nt.none()}exists(t){return this.tag&&t(this.value)}forall(t){return!this.tag||t(this.value)}filter(t){return!this.tag||t(this.value)?this:nt.none()}getOr(t){return this.tag?this.value:t}or(t){return this.tag?this:t}getOrThunk(t){return this.tag?this.value:t()}orThunk(t){return this.tag?this:t()}getOrDie(t){if(this.tag)return this.value;throw new Error(t??"Called getOrDie on None")}static from(t){return te(t)?nt.some(t):nt.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(t){this.tag&&t(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}};let v=nt;dt(v,"singletonNone",new nt(!1));const Bt=Array.prototype.indexOf,Lt=Array.prototype.push,jt=(e,t)=>Bt.call(e,t),ue=(e,t)=>jt(e,t)>-1,rt=(e,t)=>{for(let n=0,s=e.length;n<s;n++){const i=e[n];if(t(i,n))return!0}return!1},mt=(e,t)=>{const n=[];for(let s=0;s<e;s++)n.push(t(s));return n},q=(e,t)=>{const n=e.length,s=new Array(n);for(let i=0;i<n;i++){const b=e[i];s[i]=t(b,i)}return s},J=(e,t)=>
6{for(let n=0,s=e.length;n<s;n++){const i=e[n];t(i,n)}},_e=(e,t)=>{for(let n=e.length-1;n>=0;n--){const s=e[n];t(s,n)}},pt=(e,t)=>{const n=[],s=[];for(let i=0,b=e.length;i<b;i++){const f=e[i];(t(f,i)?n:s).push(f)}return{pass:n,fail:s}},$e=(e,t)=>{const n=[];for(let s=0,i=e.length;s<i;s++){const b=e[s];t(b,s)&&n.push(b)}return n},Vt=(e,t,n)=>(_e(e,(s,i)=>{n=t(n,s,i)}),n),Ge=(e,t,n)=>(J(e,(s,i)=>{n=t(n,s,i)}),n),bt=(e,t,n)=>{for(let s=0,i=e.length;s<i;s++){const b=e[s];if(t(b,s))return v.some(b);if(n(b,s))break}return v.none()},Ee=(e,t)=>bt(e,t,re),gt=e=>{const t=[];for(let n=0,s=e.length;n<s;++n){if(!U(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);Lt.apply(t,e[n])}return t},ae=(e,t)=>gt(q(e,t)),ve=(e,t)=>{for(let n=0,s=e.length;n<s;++n){const i=e[n];if(t(i,n)!==!0)return!1}return!0},ft=(e,t)=>{const n={};for(let s=0,i=e.length;s<i;s++){const b=e[s];n[String(b)]=t(b,s)}return n},Ke=(e,t)=>t>=0&&t<e.length?v.some(e[t]):v.none(),ht=e=>Ke(e,0),yt=e=>Ke(e,e.length-1),ke=(e,t)=>{for(let n=0;n<e.length;n++){const s=t(e[n],n);if(s.isSome())return s}return v.none()},Fe=Object.keys,wt=Object.hasOwnProperty,Z=(e,t)=>{const n=Fe(e);for(let s=0,i=n.length;s<i;s++){const b=n[s],f=e[b];t(f,b)}},It=e=>(t,n)=>{e[n]=t},at=(e,t,n,s)=>{Z(e,(i,b)=>{(t(i,b)?n:s)(i,b)})},Ze=(e,t)=>{const n={};return at(e,t,It(n),lt),n},Ot=(e,t)=>{const n=[];return Z(e,(s,i)=>{n.push(t(s,i))}),n},xt=e=>Ot(e,Je),De=e=>Fe(e).length,k=(e,t)=>p(e,t)?v.from(e[t]):v.none(),p=(e,t)=>wt.call(e,t),x=(e,t)=>p(e,t)&&e[t]!==void 0&&e[t]!==null,V=e=>{for(const t in e)if(wt.call(e,t))return!1;return!0},ce=e=>{let t=e;return{get:()=>t,set:i=>{t=i}}},ct=(e,t,n=Ut)=>e.exists(s=>n(s,t)),Ye=e=>{const t=[],n=s=>{t.push(s)};for(let s=0;s<e.length;s++)e[s].each(n);return t},Ue=(e,t,n)=>e.isSome()&&t.isSome()?v.some(n(e.getOrDie(),t.getOrDie())):v.none(),Qe=e=>e.bind(Je),Ie=(e,t)=>e?v.some(t):v.none(),et=e=>{const t=ce(v.none()),n=()=>t.get().each(e);return{clear:()=>{n(),t.set(v.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:y=>{n(),t.set(v.some(y))}}},tt=()=>et(e=>e.unbind()),oe=(e,t)=>e.substring(t),Rt=(e,t,n)=>t===""||e.length>=t.length&&e.substr(n,n+t.length)===t,to=(e,t)=>oo(e,t)?oe(e,t.length):e,oo=(e,t)=>Rt(e,t,0),so=(e=>t=>t.replace(e,""))(/^\s+|\s+$/g),de=e=>e.length>0,Ht=e=>!de(e),Nt=(e,t=10)=>{const n=parseInt(e,t);return isNaN(n)?v.none():v.some(n)},lo=e=>{const t=parseFloat(e);return isNaN(t)?v.none():v.some(t)},ot=e=>{let t=!1,n;return(...s)=>(t||(t=!0,n=e.apply(null,s)),n)},ro=(e,t)=>{const s=(t||document).createElement("div");if(s.innerHTML=e,!s.hasChildNodes()||s.childNodes.length>1){const i="HTML does not have a single root node";throw console.error(i,e),new Error(i)}return vt(s.childNodes[0])},it=(e,t)=>{const s=(t||document).createElement(e);return vt(s)},vo=(e,t)=>{const s=(t||document).createTextNode(e);return vt(s)},vt=e=>{if(e==null)throw new Error("Node cannot be null or undefined");return{dom:e}},$={fromHtml:ro,fromTag:it,fromText:vo,fromDom:vt,fromPoint:(e,t,n)=>v.from(e.dom.elementFromPoint(t,n)).map(vt)},ao=8,zt=9,Wt=11,St=1,co=3,Oe=(e,t)=>{const n=e.dom;if(n.nodeType!==St)return!1;{const s=n;
6if(s.matches!==void 0)return s.matches(t);if(s.msMatchesSelector!==void 0)return s.msMatchesSelector(t);if(s.webkitMatchesSelector!==void 0)return s.webkitMatchesSelector(t);if(s.mozMatchesSelector!==void 0)return s.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},qt=e=>e.nodeType!==St&&e.nodeType!==zt&&e.nodeType!==Wt||e.childElementCount===0,Gt=(e,t)=>{const n=t===void 0?document:t.dom;return qt(n)?[]:q(n.querySelectorAll(e),$.fromDom)},Co=(e,t)=>{const n=t===void 0?document:t.dom;return qt(n)?v.none():v.from(n.querySelector(e)).map($.fromDom)},Se=(e,t)=>e.dom===t.dom,io=Oe,be=e=>e.dom.nodeName.toLowerCase(),uo=e=>e.dom.nodeType,me=e=>t=>uo(t)===e,c=e=>uo(e)===ao||be(e)==="#comment",a=me(St),u=me(co),g=me(zt),C=me(Wt),S=e=>t=>a(t)&&be(t)===e,R=e=>$.fromDom(e.dom.ownerDocument),H=e=>g(e)?e:R(e),T=e=>v.from(e.dom.parentNode).map($.fromDom),B=(e,t)=>{const n=xe(t)?t:re;let s=e.dom;const i=[];for(;s.parentNode!==null&&s.parentNode!==void 0;){const b=s.parentNode,f=$.fromDom(b);if(i.push(f),n(f)===!0)break;s=b}return i},ye=e=>v.from(e.dom.previousSibling).map($.fromDom),ee=e=>v.from(e.dom.nextSibling).map($.fromDom),ne=e=>q(e.dom.childNodes,$.fromDom),Mt=(e,t)=>{const n=e.dom.childNodes;return v.from(n[t]).map($.fromDom)},Re=e=>Mt(e,0),Kt=e=>C(e)&&te(e.dom.host),mo=e=>$.fromDom(e.dom.getRootNode()),se=e=>{const t=mo(e);return Kt(t)?v.some(t):v.none()},Ce=e=>$.fromDom(e.dom.host),Be=(e,t)=>{T(e).each(s=>{s.dom.insertBefore(t.dom,e.dom)})},Ct=(e,t)=>{ee(e).fold(()=>{T(e).each(i=>{Tt(i,t)})},s=>{Be(s,t)})},Qt=(e,t)=>{Re(e).fold(()=>{Tt(e,t)},s=>{e.dom.insertBefore(t.dom,s.dom)})},Tt=(e,t)=>{e.dom.appendChild(t.dom)},en=(e,t)=>{Be(e,t),Tt(t,e)},To=(e,t)=>{J(t,(n,s)=>{const i=s===0?e:t[s-1];Ct(i,n)})},ns=(e,t)=>{J(t,n=>{Tt(e,n)})},At=(e,t,n)=>{if(Xe(n)||P(n)||Dt(n))e.setAttribute(t,n+"");else throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple")},ss=(e,t,n)=>{At(e.dom,t,n)},tn=(e,t)=>{const n=e.dom;Z(t,(s,i)=>{At(n,i,s)})},po=(e,t)=>{const n=e.dom.getAttribute(t);return n===null?void 0:n},Pt=(e,t)=>v.from(po(e,t)),on=(e,t)=>{e.dom.removeAttribute(t)},$o=e=>Ge(e.dom.attributes,(t,n)=>(t[n.name]=n.value,t),{}),nn=e=>{const t=e.dom;t.parentNode!==null&&t.parentNode.removeChild(t)},sn=e=>{const t=ne(e);t.length>0&&To(e,t),nn(e)},Ao=e=>q(e,$.fromDom),bo=e=>e.style!==void 0&&xe(e.style.getPropertyValue),go=e=>{const t=u(e)?e.dom.parentNode:e.dom;if(t==null||t.ownerDocument===null)return!1;const n=t.ownerDocument;return se($.fromDom(t)).fold(()=>n.body.contains(t),Pe(go,Ce))},ln=(e,t,n)=>{if(!Xe(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);bo(e)&&e.style.setProperty(t,n)},rn=(e,t)=>{bo(e)&&e.style.removeProperty(t)},an=(e,t,n)=>{const s=e.dom;ln(s,t,n)},Eo=(e,t)=>{const n=e.dom,i=window.getComputedStyle(n).getPropertyValue(t);return i===""&&!go(e)?Fo(n,t):i},Fo=(e,t)=>bo(e)?e.style.getPropertyValue(t):"",$t=(e,t)=>{const n=e.dom,s=Fo(n,t);return v.from(s).filter(i=>i.length>0)},_o=(e,t)=>{const n=e.dom;rn(n,t),ct(Pt(e,"style").map(so),"")&&on(e,"style")},cn=(e,t)=>lo(e).getOr(t),fo=(e,t,n)=>cn(Eo(e,t),n),un=(e,t,n,s)=>{const i=fo(e,`padding-${n}`,0),b=fo(e,`padding-${s}`,0),f=fo(e,`border-${n}-width`,0),y=fo(e,`border-${s}-width`,0);return t-i-b-f-y},dn=(e,t)=>{const n=e.dom,s=n.getBoundingClientRect().width||n.offsetWidth;return t==="border-box"?s:un(e,s,"left","right")},mn=e=>dn(e,"content-box"),Uo=((e,t)=>{const n=b=>{if(!e(b))throw new Error("Can only get "+t+" value of a "+t+" node");return s(b).getOr("")},s=b=>e(b)?v.from(b.dom.nodeValue):v.none();return{get:n,getOption:s,set:(b,f)=>{if(!e(b))throw new Error("Can only set raw "+t+" value of a "+t+" node");b.dom.nodeValue=f}}})(u,"text"),pn=e=>Uo.get(e),bn=(e,t)=>Uo.set(e,t);var Bo=(e,t,n,s,i)=>e(n,s)?v.some(n):xe(i)&&i(n)?v.none():t(n,s,i);const ko=(e,t,n)=>{let s=e.dom;const i=xe(n)?n:re;for(;s.parentNode;){s=s.parentNode;const b=$.fromDom(s);if(t(b))return v.some(b);if(i(b))break}return v.none()},gn=(e,t,n)=>Bo((i,b)=>b(i),ko,e,t,n),fn=(e,t)=>{const n=i=>t($.fromDom(i));return Ee(e.dom.childNodes,n).map($.fromDom)},ut=(e,t,n)=>ko(e,s=>Oe(s,t),n),hn=(e,t)=>fn(e,n=>Oe(n,t)),Lo=(e,t)=>
6Co(t,e),Xt=(e,t,n)=>Bo((i,b)=>Oe(i,b),ut,e,t,n),yn=e=>Xt(e,"[contenteditable]"),jo=(e,t=!1)=>go(e)?e.dom.isContentEditable:yn(e).fold(M(t),n=>wn(n)==="true"),wn=e=>e.dom.contentEditable,xn=(e,t)=>$e(ne(e),t),Ne=(e,t)=>{let n=[];return J(ne(e),s=>{t(s)&&(n=n.concat([s])),n=n.concat(Ne(s,t))}),n},o=(e,t)=>xn(e,n=>Oe(n,t)),l=(e,t)=>Gt(t,e),r=(e,t)=>hn(e,t).isSome(),m=e=>e.nodeName.toLowerCase(),w=e=>$.fromDom(e.getBody()),I=e=>t=>Se(t,w(e)),z=e=>e?e.replace(/px$/,""):"",Q=e=>/^\d+(\.\d+)?$/.test(e)?e+"px":e,Le=e=>$.fromDom(e.selection.getStart()),_t=e=>$.fromDom(e.selection.getEnd()),je=e=>gn(e,S("table")).forall(jo),Jt=["tfoot","thead","tbody","colgroup"],vn=e=>ue(Jt,e),Sn=(e,t)=>({rows:e,columns:t}),Vo=(e,t,n)=>({element:e,rowspan:t,colspan:n}),Cn=(e,t,n,s,i,b)=>({element:e,rowspan:t,colspan:n,row:s,column:i,isLocked:b}),Ve=(e,t,n)=>({element:e,cells:t,section:n}),Tn=(e,t,n,s)=>({startRow:e,startCol:t,finishRow:n,finishCol:s}),An=(e,t,n)=>({element:e,colspan:t,column:n}),Qs=(e,t)=>({element:e,columns:t}),_n=(e,t,n=0)=>Pt(e,t).map(s=>parseInt(s,10)).getOr(n),as=(e,t)=>cs(e,t,he),cs=(e,t,n)=>ae(ne(e),s=>Oe(s,t)?n(s)?[s]:[]:cs(s,t,n)),Xs=(e,t,n=re)=>{if(n(t))return v.none();if(ue(e,be(t)))return v.some(t);const s=i=>Oe(i,"table")||n(i);return ut(t,e.join(","),s)},Js=(e,t)=>Xs(["td","th"],e,t),Zs=e=>as(e,"th,td"),Ys=e=>Oe(e,"colgroup")?o(e,"col"):ae(us(e),t=>o(t,"col")),He=(e,t)=>Xt(e,"table",t),is=e=>as(e,"tr"),us=e=>He(e).fold(M([]),t=>o(t,"colgroup")),el=S("th"),tl=(e,t)=>e&&t?"sectionCells":e?"section":"cells",ol=e=>{const t=e.section==="thead",n=ct(nl(e.cells),"th");return e.section==="tfoot"?{type:"footer"}:t||n?{type:"header",subType:tl(t,n)}:{type:"body"}},nl=e=>{const t=$e(e,n=>el(n.element));return t.length===0?v.some("td"):t.length===e.length?v.some("th"):v.none()},sl=e=>{const t=q(e,i=>ol(i).type),n=ue(t,"header"),s=ue(t,"footer");if(!n&&!s)return v.some("body");{const i=ue(t,"body");return n&&!i&&!s?v.some("header"):!n&&!i&&s?v.some("footer"):v.none()}},ll=(e,t)=>q(e,n=>{if(be(n)==="colgroup"){const s=q(Ys(n),i=>{const b=_n(i,"span",1);return Vo(i,1,b)});return Ve(n,s,"colgroup")}else{const s=q(Zs(n),i=>{const b=_n(i,"rowspan",1),f=_n(i,"colspan",1);return Vo(i,b,f)});return Ve(n,s,t(n))}}),rl=e=>T(e).map(t=>{const n=be(t);return vn(n)?n:"tbody"}).getOr("tbody"),al=e=>{const t=is(e),s=[...us(e),...t];return ll(s,rl)},cl="data-snooker-locked-cols",il=e=>Pt(e,cl).bind(t=>v.from(t.match(/\d+/g))).map(t=>ft(t,he)),kn=(e,t)=>e+","+t,ul=(e,t,n)=>v.from(e.access[kn(t,n)]),dl=(e,t,n)=>{const s=ds(e,i=>n(t,i.element));return s.length>0?v.some(s[0]):v.none()},ds=(e,t)=>{const n=ae(e.all,s=>s.cells);return $e(n,t)},ml=e=>{const t={};let n=0;return J(e.cells,s=>{const i=s.colspan;mt(i,b=>{const f=n+b;t[f]=An(s.element,i,f)}),n+=i}),t},ms=e=>{const t={},n=[],i=ht(e).map(ze=>ze.element).bind(He).bind(il).getOr({});let b=0,f=0,y=0;const{pass:_,fail:D}=pt(e,ze=>ze.section==="colgroup");J(D,ze=>{const Et=[];J(ze.cells,Ft=>{let eo=0;for(;t[kn(y,eo)]!==void 0;)eo++;const Jn=x(i,eo.toString()),Ko=Cn(Ft.element,Ft.rowspan,Ft.colspan,y,eo,Jn);for(let Oo=0;Oo<Ft.colspan;Oo++)for(let Ro=0;Ro<Ft.rowspan;Ro++){const Zn=y+Ro,Qo=eo+Oo,Xo=kn(Zn,Qo);t[Xo]=Ko,f=Math.max(f,Qo+1)}Et.push(Ko)}),b++,n.push(Ve(ze.element,Et,ze.section)),y++});const{columns:E,colgroups:L}=yt(_).map(ze=>{const Et=ml(ze);return{colgroups:[Qs(ze.element,xt(Et))],columns:Et}}).getOrThunk(()=>({colgroups:[],columns:{}}));return{grid:Sn(b,f),access:t,all:n,columns:E,colgroups:L}},kt={fromTable:e=>{const t=al(e);return ms(t)},generate:ms,getAt:ul,findItem:dl,filterItems:ds,justCells:e=>ae(e.all,t=>t.cells),justColumns:e=>xt(e.columns),hasColumns:e=>Fe(e.columns).length>0,getColumnAt:(e,t)=>v.from(e.columns[t])},ps=(e,t)=>ke(e.all,n=>Ee(n.cells,s=>Se(t,s.element))),pl=(e,t,n)=>{const s=q(t.selection,b=>Js(b).bind(f=>ps(e,f)).filter(n)),i=Ye(s);return Ie(i.length>0,i)},bl=(e,t)=>t.mergable,gl=(e,t)=>t.unmergable,bs=(e,t)=>pl(e,t,he),fl=(e,t)=>ps(e,t).exists(n=>!n.isLocked),gs=(e,t)=>ve(t,n=>fl(e,n)),hl=(e,t)=>bl(e,t).filter(n=>gs(e,n.cells)),yl=(e,t)=>gl(e,t).filter(n=>gs(e,n));var wl=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],xl=()=>{const e=D=>$.fromDom(D.dom.cloneNode(!1)),t=D=>H(D).dom,n=D=>a(D)?be(D)==="body"?!0:ue(wl,be(D)):!1,s=D=>
6a(D)?ue(["br","img","hr","input"],be(D)):!1,i=D=>a(D)&&po(D,"contenteditable")==="false",b=(D,E)=>D.dom.compareDocumentPosition(E.dom),f=(D,E)=>{const L=$o(D);tn(E,L)},y=D=>{const E=be(D);return ue(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],E)},_=D=>a(D)?Pt(D,"lang"):v.none();return{up:M({selector:ut,closest:Xt,predicate:ko,all:B}),down:M({selector:l,predicate:Ne}),styles:M({get:Eo,getRaw:$t,set:an,remove:_o}),attrs:M({get:po,set:ss,remove:on,copyTo:f}),insert:M({before:Be,after:Ct,afterAll:To,append:Tt,appendAll:ns,prepend:Qt,wrap:en}),remove:M({unwrap:sn,remove:nn}),create:M({nu:$.fromTag,clone:e,text:$.fromText}),query:M({comparePosition:b,prevSibling:ye,nextSibling:ee}),property:M({children:ne,name:be,parent:T,document:t,isText:u,isComment:c,isElement:a,isSpecial:y,getLanguage:_,getText:pn,setText:bn,isBoundary:n,isEmptyTag:s,isNonEditable:i}),eq:Se,is:io}};const vl=(e,t,n,s)=>{const i=n[0],b=n.slice(1);return s(e,t,i,b)},Sl=(e,t,n)=>n.length>0?vl(e,t,n,Cl):v.none(),Cl=(e,t,n,s)=>{const i=t(e,n);return Vt(s,(b,f)=>{const y=t(e,f);return Tl(e,b,y)},i)},Tl=(e,t,n)=>t.bind(s=>n.filter(le(e.eq,s))),Al=Sl,_l=xl(),kl=(e,t)=>Al(_l,(n,s)=>e(s),t),Dl=(e,t)=>{const n=kt.fromTable(e);return bs(n,t).bind(i=>{const b=i[i.length-1],f=i[0].row,y=b.row+b.rowspan,_=n.all.slice(f,y);return sl(_)}).getOr("")},Il=(e,t)=>t.column>=e.startCol&&t.column+t.colspan-1<=e.finishCol&&t.row>=e.startRow&&t.row+t.rowspan-1<=e.finishRow,Ol=(e,t)=>{let n=!0;const s=le(Il,t);for(let i=t.startRow;i<=t.finishRow;i++)for(let b=t.startCol;b<=t.finishCol;b++)n=n&&kt.getAt(e,i,b).exists(s);return n?v.some(t):v.none()},Rl=(e,t)=>Tn(Math.min(e.row,t.row),Math.min(e.column,t.column),Math.max(e.row+e.rowspan-1,t.row+t.rowspan-1),Math.max(e.column+e.colspan-1,t.column+t.colspan-1)),Nl=(e,t,n)=>{const s=kt.findItem(e,t,Se),i=kt.findItem(e,n,Se);return s.bind(b=>i.map(f=>Rl(b,f)))},Ml=(e,t,n)=>Nl(e,t,n).bind(s=>Ol(e,s)),Pl=(e,t,n)=>{const s=$l(e);return Ml(s,t,n)},$l=kt.fromTable;var fs=tinymce.util.Tools.resolve("tinymce.util.Tools");const Ho=(e,t,n)=>{const s=e.select("td,th",t);let i;for(let b=0;b<s.length;b++){const f=e.getStyle(s[b],n);if(K(i)&&(i=f),i!==f)return""}return i},Dn=(e,t,n)=>{fs.each("left center right".split(" "),s=>{s!==n&&e.formatter.remove("align"+s,{},t)}),n&&e.formatter.apply("align"+n,{},t)},El=(e,t,n)=>{fs.each("top middle bottom".split(" "),s=>{s!==n&&e.formatter.remove("valign"+s,{},t)}),n&&e.formatter.apply("valign"+n,{},t)},In=(e,t,n)=>{e.dispatch("TableModified",{...n,table:t})};var Fl=tinymce.util.Tools.resolve("tinymce.Env");const Ul="tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol",Bl=mt(5,e=>{const t=`${e+1}px`;return{title:t,value:t}}),Ll=q(["Solid","Dotted","Dashed","Double","Groove","Ridge","Inset","Outset","None","Hidden"],e=>({title:e,value:e.toLowerCase()})),hs="100%",ys=e=>{const t=e.dom,n=t.getParent(e.selection.getStart(),t.isBlock)??e.getBody();return mn($.fromDom(n))+"px"},jl=(e,t)=>Ts(e)||!Zt(e)?t:Cs(e)?{...t,width:ys(e)}:{...t,width:hs},Vl=(e,t)=>Ts(e)||Zt(e)?t:Cs(e)?{...t,width:ys(e)}:{...t,width:hs},Te=e=>t=>t.options.get(e),Hl=e=>{const t=e.options.register;t("table_border_widths",{processor:"object[]",default:Bl}),t("table_border_styles",{processor:"object[]",default:Ll}),t("table_cell_advtab",{processor:"boolean",default:!0}),t("table_row_advtab",{processor:"boolean",default:!0}),t("table_advtab",{processor:"boolean",default:!0}),t("table_appearance_options",{processor:"boolean",default:!0}),t("table_grid",{processor:"boolean",default:!Fl.deviceType.isTouch()}),t("table_cell_class_list",{processor:"object[]",default:[]}),t("table_row_class_list",{processor:"object[]",default:[]}),t("table_class_list",{processor:"object[]",default:[]}),t("table_toolbar",{processor:"string",default:Ul}),t("table_background_color_map",{processor:"object[]",default:[]}),t("table_border_color_map",{processor:"object[]",default:[]})},ws=Te("table_sizing_mode"),xs=Te("table_border_widths"),On=Te("table_border_styles"),Rn=Te("table_cell_advtab"),Nn=Te("table_row_advtab"),ho=Te("table_advtab"),zl=Te("table_appearance_options"),Wl=Te("table_grid"),Zt=Te("table_style_by_css"),Mn=Te("table_cell_class_list"),ql=Te("table_row_class_list"),Pn=Te("table_class_list"),Gl=Te("table_toolbar"),vs=Te("table_background_color_map"),Ss=Te("table_border_color_map"),Cs=e=>ws(e)==="fixed",Ts=e=>ws(e)==="responsive",As=e=>{const t=e.options,n=t.get("table_default_styles");return t.isSet("table_default_styles")?n:jl(e,n)},_s=e=>{const t=e.options,n=t.get("table_default_attributes");return t.isSet("table_default_attributes")?n:Vl(e,n)},Kl=e=>ut(e,"table"),Ql=(e,t)=>{const n=l(e,t);return n.length>0?v.some(n):v.none()},Xl=(e,t,n)=>Lo(e,t).bind(s=>Lo(e,n).bind(i=>kl(Kl,[s,i]).map(b=>({first:s,last:i,table:b})))),Jl=(e,t)=>
6Ql(e,t),Zl=(e,t,n)=>Xl(e,t,n).bind(s=>{const i=_=>Se(e,_),b="thead,tfoot,tbody,table",f=ut(s.first,b,i),y=ut(s.last,b,i);return f.bind(_=>y.bind(D=>Se(_,D)?Pl(s.table,s.first,s.last):v.none()))}),Yl=Je,er=e=>{const t=(s,i)=>Pt(s,i).exists(b=>parseInt(b,10)>1),n=s=>t(s,"rowspan")||t(s,"colspan");return e.length>0&&ve(e,n)?v.some(e):v.none()},tr=(e,t,n)=>t.length<=1?v.none():Zl(e,n.firstSelectedSelector,n.lastSelectedSelector).map(s=>({bounds:s,cells:t})),$n="data-mce-selected",or="td["+$n+"],th["+$n+"]",En="data-mce-first-selected",nr="td["+En+"],th["+En+"]",Fn="data-mce-last-selected",sr="td["+Fn+"],th["+Fn+"]",Un={selected:$n,selectedSelector:or,firstSelected:En,firstSelectedSelector:nr,lastSelected:Fn,lastSelectedSelector:sr},lr=e=>He(e).bind(t=>Jl(t,Un.firstSelectedSelector)).fold(M(e),t=>t[0]),ks=e=>(t,n)=>{const s=be(t),i=s==="col"||s==="colgroup"?lr(t):t;return Xt(i,e,n)},Ds=ks("th,td,caption"),Is=ks("th,td"),Bn=e=>Ao(e.model.table.getSelectedCells()),rr=(e,t)=>{const n=Is(e),s=n.bind(i=>He(i)).map(i=>is(i));return Ue(n,s,(i,b)=>$e(b,f=>rt(Ao(f.dom.cells),y=>po(y,t)==="1"||Se(y,i)))).getOr([])},Ln=[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}],ar=e=>({value:Os(e)}),cr=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,ir=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,ur=e=>cr.test(e)||ir.test(e),Os=e=>to(e,"#").toUpperCase(),dr=e=>ur(e)?v.some({value:Os(e)}):v.none(),jn=e=>{const t=e.toString(16);return(t.length===1?"0"+t:t).toUpperCase()},Vn=e=>{const t=jn(e.red)+jn(e.green)+jn(e.blue);return ar(t)},mr=/^\s*rgb\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*\)\s*$/i,pr=/^\s*rgba\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*((?:\d?\.\d+|\d+)%?)\s*\)\s*$/i,Rs=(e,t,n,s)=>({red:e,green:t,blue:n,alpha:s}),Ns=(e,t,n,s)=>{const i=parseInt(e,10),b=parseInt(t,10),f=parseInt(n,10),y=parseFloat(s);return Rs(i,b,f,y)},Ms=e=>{const t=mr.exec(e);if(t!==null)return v.some(Ns(t[1],t[2],t[3],"1"));const n=pr.exec(e);return n!==null?v.some(Ns(n[1],n[2],n[3],n[4])):v.none()},br=e=>dr(e).orThunk(()=>Ms(e).map(Vn)).getOrThunk(()=>{const t=document.createElement("canvas");t.height=1,t.width=1;const n=t.getContext("2d");n.clearRect(0,0,t.width,t.height),n.fillStyle="#FFFFFF",n.fillStyle=e,n.fillRect(0,0,1,1);const s=n.getImageData(0,0,1,1).data,i=s[0],b=s[1],f=s[2],y=s[3];return Vn(Rs(i,b,f,y))}),gr=e=>Ms(e).map(Vn).map(t=>"#"+t.value).getOr(e),fr=(e,t,n)=>s=>{const i=tt(),b=Ht(n),f=()=>{const y=Bn(e),_=D=>e.formatter.match(t,{value:n},D.dom,b);b?(s.setActive(!rt(y,_)),i.set(e.formatter.formatChanged(t,D=>s.setActive(!D),!0))):(s.setActive(ve(y,_)),i.set(e.formatter.formatChanged(t,s.setActive,!1,{value:n})))};return e.initialized?f():e.on("init",f),i.clear},Hn=e=>x(e,"menu"),zn=e=>q(e,t=>{const n=t.text||t.title||"";return Hn(t)?{text:n,items:zn(t.menu)}:{text:n,value:t.value}}),Wn=e=>e.length?v.some(zn([{text:"Select...",value:"mce-no-match"},...e])):v.none(),Yt=(e,t,n,s)=>q(t,i=>{const b=i.text||i.title;return Hn(i)?{type:"nestedmenuitem",text:b,getSubmenuItems:()=>Yt(e,i.menu,n,s)}:{text:b,type:"togglemenuitem",onAction:()=>s(i.value),onSetup:fr(e,n,i.value)}}),yo=(e,t)=>n=>{e.execCommand("mceTableApplyCellStyle",!1,{[t]:n})},Do=e=>ae(e,t=>Hn(t)?[{...t,menu:Do(t.menu)}]:de(t.value)?[t]:[]),Io=(e,t,n,s)=>i=>i(Yt(e,t,n,s)),zo=(e,t,n)=>{const s=q(t,i=>({text:i.title,value:"#"+br(i.value).value,type:"choiceitem"}));return[{type:"fancymenuitem",fancytype:"colorswatch",initData:{colors:s.length>0?s:void 0,allowCustomColors:!1},onAction:i=>{const b=i.value==="remove"?"":i.value;e.execCommand("mceTableApplyCellStyle",!1,{[n]:b})}}]},Ps=e=>()=>{const n=e.queryCommandValue("mceTableRowType")==="header"?"body":"header";e.execCommand("mceTableRowType",!1,{type:n})},$s=e=>()=>{const n=e.queryCommandValue("mceTableColType")==="th"?"td":"th";e.execCommand("mceTableColType",!1,{type:n})},hr=e=>Wn(Mn(e)).map(t=>({name:"class",type:"listbox",label:"Class",items:t})),yr=[{name:"width",type:"input",label:"Width"},{name:"celltype",type:"listbox",label:"Cell type",items:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{name:"scope",type:"listbox",label:"Scope",items:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{name:"halign",type:"listbox",label:"Horizontal align",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{name:"valign",type:"listbox",label:"Vertical align",items:Ln}],Es=e=>yr.concat(hr(e).toArray()),qn=(e,t)=>{const s=[{name:"borderstyle",type:"listbox",label:"Border style",items:[{text:"Select...",value:""}].concat(zn(On(e)))},{name:"bordercolor",type:"colorinput",label:"Border color"}
6,{name:"backgroundcolor",type:"colorinput",label:"Background color"}];return{title:"Advanced",name:"advanced",items:t==="cell"?[{name:"borderwidth",type:"input",label:"Border width"}].concat(s):s}},Gn={normal:(e,t)=>{const n=e.dom;return{setAttrib:(f,y)=>{n.setAttrib(t,f,y)},setStyle:(f,y)=>{n.setStyle(t,f,y)},setFormat:(f,y)=>{y===""?e.formatter.remove(f,{value:null},t,!0):e.formatter.apply(f,{value:y},t)}}}},Wo=e=>oo(e,"rgb")?gr(e):e,Kn=e=>{const t=$.fromDom(e);return{borderwidth:$t(t,"border-width").getOr(""),borderstyle:$t(t,"border-style").getOr(""),bordercolor:$t(t,"border-color").map(Wo).getOr(""),backgroundcolor:$t(t,"background-color").map(Wo).getOr("")}},Fs=e=>{const t=e[0],n=e.slice(1);return J(n,s=>{J(Fe(t),i=>{Z(s,(b,f)=>{const y=t[i];y!==""&&i===f&&y!==b&&(t[i]=i==="class"?"mce-no-match":"")})})}),t},Us=(e,t,n,s)=>Ee(e,i=>!K(n.formatter.matchNode(s,t+i))).getOr(""),Qn=le(Us,["left","center","right"],"align"),wr=le(Us,["top","middle","bottom"],"valign"),xr=(e,t)=>{const n=As(e),s=_s(e),i=()=>({borderstyle:k(n,"border-style").getOr(""),bordercolor:Wo(k(n,"border-color").getOr("")),backgroundcolor:Wo(k(n,"background-color").getOr(""))}),b={height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""},f=()=>{const E=n["border-width"];return Zt(e)&&E?{border:E}:k(s,"border").fold(()=>({}),L=>({border:L}))},y=t?i():{},_=()=>{const E=k(n,"border-spacing").or(k(s,"cellspacing")).fold(()=>({}),G=>({cellspacing:G})),L=k(n,"border-padding").or(k(s,"cellpadding")).fold(()=>({}),G=>({cellpadding:G}));return{...E,...L}};return{...b,...n,...s,...y,...f(),..._()}},vr=e=>He($.fromDom(e)).map(t=>{const n={selection:Ao(e.cells)};return Dl(t,n)}).getOr(""),Sr=(e,t,n)=>{const s=(y,_)=>{const D=$t($.fromDom(_),"border-width");return Zt(e)&&D.isSome()?D.getOr(""):y.getAttrib(_,"border")||Ho(e.dom,_,"border-width")||Ho(e.dom,_,"border")||""},i=e.dom,b=Zt(e)?i.getStyle(t,"border-spacing")||i.getAttrib(t,"cellspacing"):i.getAttrib(t,"cellspacing")||i.getStyle(t,"border-spacing"),f=Zt(e)?Ho(i,t,"padding")||i.getAttrib(t,"cellpadding"):i.getAttrib(t,"cellpadding")||Ho(i,t,"padding");return{width:i.getStyle(t,"width")||i.getAttrib(t,"width"),height:i.getStyle(t,"height")||i.getAttrib(t,"height"),cellspacing:b??"",cellpadding:f??"",border:s(i,t),caption:!!i.select("caption",t)[0],class:i.getAttrib(t,"class",""),align:Qn(e,t),...n?Kn(t):{}}},Cr=(e,t,n)=>{const s=e.dom;return{height:s.getStyle(t,"height")||s.getAttrib(t,"height"),class:s.getAttrib(t,"class",""),type:vr(t),align:Qn(e,t),...n?Kn(t):{}}},Tr=(e,t,n,s)=>{const i=e.dom,b=s.getOr(t);return{width:((y,_)=>i.getStyle(y,_)||i.getAttrib(y,_))(b,"width"),scope:i.getAttrib(t,"scope"),celltype:m(t),class:i.getAttrib(t,"class",""),halign:Qn(e,t),valign:wr(e,t),...n?Kn(t):{}}},Bs=(e,t)=>{const n=kt.fromTable(e),s=kt.justCells(n),i=$e(s,b=>rt(t,f=>Se(b.element,f)));return q(i,b=>({element:b.element.dom,column:kt.getColumnAt(n,b.column).map(f=>f.element.dom)}))},Ar=(e,t,n,s)=>{s("scope")&&e.setAttrib("scope",n.scope),s("class")&&n.class!=="mce-no-match"&&e.setAttrib("class",n.class),s("width")&&t.setStyle("width",Q(n.width))},_r=(e,t,n)=>{n("backgroundcolor")&&e.setFormat("tablecellbackgroundcolor",t.backgroundcolor),n("bordercolor")&&e.setFormat("tablecellbordercolor",t.bordercolor),n("borderstyle")&&e.setFormat("tablecellborderstyle",t.borderstyle),n("borderwidth")&&e.setFormat("tablecellborderwidth",Q(t.borderwidth))},kr=(e,t,n,s)=>{const i=t.length===1;J(t,b=>{const f=b.element,y=i?he:s,_=Gn.normal(e,f),D=b.column.map(E=>Gn.normal(e,E)).getOr(_);Ar(_,D,n,y),Rn(e)&&_r(_,n,y),s("halign")&&Dn(e,f,n.halign),s("valign")&&El(e,f,n.valign)})},Dr=(e,t)=>{e.execCommand("mceTableCellType",!1,{type:t.celltype,no_events:!0})},Ir=(e,t,n,s)=>{const i=Ze(s,(b,f)=>n[f]!==b);De(i)>0&&t.length>=1&&He(t[0]).each(b=>{const f=Bs(b,t),y=De(Ze(i,(D,E)=>E!=="scope"&&E!=="celltype"))>0,_=p(i,"celltype");(y||p(i,"scope"))&&kr(e,f,s,le(p,i)),_&&Dr(e,s),In(e,b.dom,{structure:_,style:y})})},Or=(e,t,n,s)=>{const i=s.getData();s.close(),e.undoManager.transact(()=>{Ir(e,t,n,i),e.focus()})},Rr=(e,t)=>
6{const n=He(t[0]).map(s=>q(Bs(s,t),i=>Tr(e,i.element,Rn(e),i.column)));return Fs(n.getOrDie())},Nr=e=>{const t=Bn(e);if(t.length===0)return;const n=Rr(e,t),s={type:"tabpanel",tabs:[{title:"General",name:"general",items:Es(e)},qn(e,"cell")]},i={type:"panel",items:[{type:"grid",columns:2,items:Es(e)}]};e.windowManager.open({title:"Cell Properties",size:"normal",body:Rn(e)?s:i,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:n,onSubmit:le(Or,e,t,n)})},Mr=e=>Wn(ql(e)).map(t=>({name:"class",type:"listbox",label:"Class",items:t})),Pr=[{type:"listbox",name:"type",label:"Row type",items:[{text:"Header",value:"header"},{text:"Body",value:"body"},{text:"Footer",value:"footer"}]},{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height",type:"input"}],Ls=e=>Pr.concat(Mr(e).toArray()),$r=(e,t,n)=>{n("class")&&t.class!=="mce-no-match"&&e.setAttrib("class",t.class),n("height")&&e.setStyle("height",Q(t.height))},Er=(e,t,n)=>{n("backgroundcolor")&&e.setStyle("background-color",t.backgroundcolor),n("bordercolor")&&e.setStyle("border-color",t.bordercolor),n("borderstyle")&&e.setStyle("border-style",t.borderstyle)},Fr=(e,t,n,s)=>{const b=t.length===1?he:s;J(t,f=>{const y=o($.fromDom(f),"td,th"),_=Gn.normal(e,f);$r(_,n,b),Nn(e)&&Er(_,n,b),s("height")&&J(y,D=>{e.dom.setStyle(D.dom,"height",null)}),s("align")&&Dn(e,f,n.align)})},Ur=(e,t)=>{e.execCommand("mceTableRowType",!1,{type:t.type,no_events:!0})},Br=(e,t,n,s)=>{const i=Ze(s,(b,f)=>n[f]!==b);if(De(i)>0){const b=p(i,"type"),f=b?De(i)>1:!0;f&&Fr(e,t,s,le(p,i)),b&&Ur(e,s),He($.fromDom(t[0])).each(y=>In(e,y.dom,{structure:b,style:f}))}},Lr=(e,t,n,s)=>{const i=s.getData();s.close(),e.undoManager.transact(()=>{Br(e,t,n,i),e.focus()})},jr=e=>{const t=rr(Le(e),Un.selected);if(t.length===0)return;const n=q(t,f=>Cr(e,f.dom,Nn(e))),s=Fs(n),i={type:"tabpanel",tabs:[{title:"General",name:"general",items:Ls(e)},qn(e,"row")]},b={type:"panel",items:[{type:"grid",columns:2,items:Ls(e)}]};e.windowManager.open({title:"Row Properties",size:"normal",body:Nn(e)?i:b,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:s,onSubmit:le(Lr,e,q(t,f=>f.dom),s)})},Vr=(e,t,n)=>{const s=n?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],i=[{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}],b=zl(e)?[{type:"input",name:"cellspacing",label:"Cell spacing",inputMode:"numeric"},{type:"input",name:"cellpadding",label:"Cell padding",inputMode:"numeric"},{type:"input",name:"border",label:"Border width"},{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[],f=[{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}],y=t.length>0?[{name:"class",type:"listbox",label:"Class",items:t}]:[];return s.concat(i).concat(b).concat(f).concat(y)},js=(e,t,n,s)=>{if(t.tagName==="TD"||t.tagName==="TH")Xe(n)&&te(s)?e.setStyle(t,n,s):e.setStyles(t,n);else if(t.children)for(let i=0;i<t.children.length;i++)js(e,t.children[i],n,s)},Hr=(e,t,n,s)=>{const i=e.dom,b={},f={},y=Zt(e),_=ho(e),D=parseFloat(n.border)===0;if(!K(n.class)&&n.class!=="mce-no-match"&&(b.class=n.class),f.height=Q(n.height),y?f.width=Q(n.width):i.getAttrib(t,"width")&&(b.width=z(n.width)),y?(D?(b.border=0,f["border-width"]=""):(f["border-width"]=Q(n.border),b.border=1),f["border-spacing"]=Q(n.cellspacing)):(b.border=D?0:n.border,b.cellpadding=n.cellpadding,b.cellspacing=n.cellspacing),y&&t.children){const E={};if(D?E["border-width"]="":s.border&&(E["border-width"]=Q(n.border)),s.cellpadding&&(E.padding=Q(n.cellpadding)),_&&s.bordercolor&&(E["border-color"]=n.bordercolor),!V(E))for(let L=0;L<t.children.length;L++)js(i,t.children[L],E)}if(_){const E=n;f["background-color"]=E.backgroundcolor,f["border-color"]=E.bordercolor,f["border-style"]=E.borderstyle}i.setStyles(t,{...As(e),...f}),i.setAttribs(t,{..._s(e),...b})},zr=(e,t,n,s)=>{const i=e.dom,b=s.getData(),f=Ze(b,(y,_)=>n[_]!==y);s.close(),e.undoManager.transact(()=>
6{if(!t){const y=Nt(b.cols).getOr(1),_=Nt(b.rows).getOr(1);e.execCommand("mceInsertTable",!1,{rows:_,columns:y}),t=Is(Le(e),I(e)).bind(D=>He(D,I(e))).map(D=>D.dom).getOrDie()}if(De(f)>0){const y={border:p(f,"border"),bordercolor:p(f,"bordercolor"),cellpadding:p(f,"cellpadding")};Hr(e,t,b,y);const _=i.select("caption",t)[0];(_&&!b.caption||!_&&b.caption)&&e.execCommand("mceTableToggleCaption"),Dn(e,t,b.align)}if(e.focus(),e.addVisual(),De(f)>0){const y=p(f,"caption"),_=y?De(f)>1:!0;In(e,t,{structure:y,style:_})}})},Vs=(e,t)=>{const n=e.dom;let s,i=xr(e,ho(e));t?(i.cols="1",i.rows="1",ho(e)&&(i.borderstyle="",i.bordercolor="",i.backgroundcolor="")):(s=n.getParent(e.selection.getStart(),"table",e.getBody()),s?i=Sr(e,s,ho(e)):ho(e)&&(i.borderstyle="",i.bordercolor="",i.backgroundcolor=""));const b=Wn(Pn(e));b.isSome()&&i.class&&(i.class=i.class.replace(/\s*mce\-item\-table\s*/g,""));const f={type:"grid",columns:2,items:Vr(e,b.getOr([]),t)},y=()=>({type:"panel",items:[f]}),_=()=>({type:"tabpanel",tabs:[{title:"General",name:"general",items:[f]},qn(e,"table")]}),D=ho(e)?_():y();e.windowManager.open({title:"Table Properties",size:"normal",body:D,onSubmit:le(zr,e,s,i),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:i})},Wr=e=>{const t=n=>{je(Le(e))&&n()};Z({mceTableProps:le(Vs,e,!1),mceTableRowProps:le(jr,e),mceTableCellProps:le(Nr,e),mceInsertTableDialog:le(Vs,e,!0)},(n,s)=>e.addCommand(s,()=>t(n)))},qr=e=>({element:e,mergable:v.none(),unmergable:v.none(),selection:[e]}),Gr=(e,t,n)=>({element:n,mergable:tr(t,e,Un),unmergable:er(e),selection:Yl(e)}),Kr=e=>{const t=ce(v.none()),n=ce([]);let s=v.none();const i=S("caption"),b=N=>s.forall(j=>!j[N]),f=()=>Ds(Le(e),I(e)),y=()=>Ds(_t(e),I(e)),_=()=>f().bind(N=>Qe(Ue(He(N),y().bind(He),(j,we)=>Se(j,we)?i(N)?v.some(qr(N)):v.some(Gr(Bn(e),j,N)):v.none()))),D=N=>He(N.element).map(we=>{const We=kt.fromTable(we),la=bs(We,N).getOr([]),ra=Ge(la,(Jo,Zo)=>(Zo.isLocked&&(Jo.onAny=!0,Zo.column===0?Jo.onFirst=!0:Zo.column+Zo.colspan>=We.grid.columns&&(Jo.onLast=!0)),Jo),{onAny:!1,onFirst:!1,onLast:!1});return{mergeable:hl(We,N).isSome(),unmergeable:yl(We,N).isSome(),locked:ra}}),E=()=>{t.set(ot(_)()),s=t.get().bind(D),J(n.get(),Y)},L=N=>(N(),n.set(n.get().concat([N])),()=>{n.set($e(n.get(),j=>j!==N))}),G=(N,j)=>L(()=>t.get().fold(()=>{N.setEnabled(!1)},we=>{N.setEnabled(!j(we)&&e.selection.isEditable())})),ze=(N,j,we)=>L(()=>t.get().fold(()=>{N.setEnabled(!1),N.setActive(!1)},We=>{N.setEnabled(!j(We)&&e.selection.isEditable()),N.setActive(we(We))})),Et=N=>s.exists(j=>j.locked[N]),Ft=N=>G(N,j=>!1),eo=N=>G(N,j=>i(j.element)),Jn=N=>j=>G(j,we=>i(we.element)||Et(N)),Ko=N=>j=>G(j,we=>i(we.element)||N().isNone()),Oo=(N,j)=>we=>G(we,We=>i(We.element)||N().isNone()||Et(j)),Ro=N=>G(N,j=>b("mergeable")),Zn=N=>G(N,j=>b("unmergeable")),Qo=N=>ze(N,re,j=>He(j.element,I(e)).exists(We=>r(We,"caption"))),Xo=(N,j)=>we=>ze(we,We=>i(We.element),()=>e.queryCommandValue(N)===j),na=Xo("mceTableRowType","header"),sa=Xo("mceTableColType","th");return e.on("NodeChange ExecCommand TableSelectorChange",E),{onSetupTable:Ft,onSetupCellOrRow:eo,onSetupColumn:Jn,onSetupPasteable:Ko,onSetupPasteableColumn:Oo,onSetupMergeable:Ro,onSetupUnmergeable:Zn,resetTargets:E,onSetupTableWithCaption:Qo,onSetupTableRowHeaders:na,onSetupTableColumnHeaders:sa,targets:t.get}};var Qr=tinymce.util.Tools.resolve("tinymce.FakeClipboard");const Hs="x-tinymce/dom-table-",Xr=Hs+"rows",Jr=Hs+"columns",zs=e=>{const t=Qr.read()??[];return ke(t,n=>v.from(n.getType(e)))},qo=()=>zs(Xr),Go=()=>zs(Jr),Ws=e=>t=>{const n=()=>{t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",n),n(),()=>{e.off("NodeChange",n)}},Zr=(e,t)=>{e.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",onSetup:Ws(e),fetch:y=>y("inserttable | cell row column | advtablesort | tableprops deletetable")});const n=y=>()=>e.execCommand(y),s=(y,_)=>{e.queryCommandSupported(_.command)&&e.ui.registry.addButton(y,{..._,onAction:xe(_.onAction)?_.onAction:n(_.command)})},i=(y,_)=>{e.queryCommandSupported(_.command)&&e.ui.registry.addToggleButton(y,{..._,onAction:xe(_.onAction)?_.onAction:n(_.command)})};s("tableprops",{tooltip:"Table properties",command:"mceTableProps",icon:"table",onSetup:t.onSetupTable}),s("tabledelete",{tooltip:"Delete table",command:"mceTableDelete",icon:"table-delete-table",onSetup:t.onSetupTable}
vendor: 3,811 bytes, line 6
6),s("tablecellprops",{tooltip:"Cell properties",command:"mceTableCellProps",icon:"table-cell-properties",onSetup:t.onSetupCellOrRow}),s("tablemergecells",{tooltip:"Merge cells",command:"mceTableMergeCells",icon:"table-merge-cells",onSetup:t.onSetupMergeable}),s("tablesplitcells",{tooltip:"Split cell",command:"mceTableSplitCells",icon:"table-split-cells",onSetup:t.onSetupUnmergeable}),s("tableinsertrowbefore",{tooltip:"Insert row before",command:"mceTableInsertRowBefore",icon:"table-insert-row-above",onSetup:t.onSetupCellOrRow}),s("tableinsertrowafter",{tooltip:"Insert row after",command:"mceTableInsertRowAfter",icon:"table-insert-row-after",onSetup:t.onSetupCellOrRow}),s("tabledeleterow",{tooltip:"Delete row",command:"mceTableDeleteRow",icon:"table-delete-row",onSetup:t.onSetupCellOrRow}),s("tablerowprops",{tooltip:"Row properties",command:"mceTableRowProps",icon:"table-row-properties",onSetup:t.onSetupCellOrRow}),s("tableinsertcolbefore",{tooltip:"Insert column before",command:"mceTableInsertColBefore",icon:"table-insert-column-before",onSetup:t.onSetupColumn("onFirst")}),s("tableinsertcolafter",{tooltip:"Insert column after",command:"mceTableInsertColAfter",icon:"table-insert-column-after",onSetup:t.onSetupColumn("onLast")}),s("tabledeletecol",{tooltip:"Delete column",command:"mceTableDeleteCol",icon:"table-delete-column",onSetup:t.onSetupColumn("onAny")}),s("tablecutrow",{tooltip:"Cut row",command:"mceTableCutRow",icon:"cut-row",onSetup:t.onSetupCellOrRow}),s("tablecopyrow",{tooltip:"Copy row",command:"mceTableCopyRow",icon:"duplicate-row",onSetup:t.onSetupCellOrRow}),s("tablepasterowbefore",{tooltip:"Paste row before",command:"mceTablePasteRowBefore",icon:"paste-row-before",onSetup:t.onSetupPasteable(qo)}),s("tablepasterowafter",{tooltip:"Paste row after",command:"mceTablePasteRowAfter",icon:"paste-row-after",onSetup:t.onSetupPasteable(qo)}),s("tablecutcol",{tooltip:"Cut column",command:"mceTableCutCol",icon:"cut-column",onSetup:t.onSetupColumn("onAny")}),s("tablecopycol",{tooltip:"Copy column",command:"mceTableCopyCol",icon:"duplicate-column",onSetup:t.onSetupColumn("onAny")}),s("tablepastecolbefore",{tooltip:"Paste column before",command:"mceTablePasteColBefore",icon:"paste-column-before",onSetup:t.onSetupPasteableColumn(Go,"onFirst")}),s("tablepastecolafter",{tooltip:"Paste column after",command:"mceTablePasteColAfter",icon:"paste-column-after",onSetup:t.onSetupPasteableColumn(Go,"onLast")}),s("tableinsertdialog",{tooltip:"Insert table",command:"mceInsertTableDialog",icon:"table",onSetup:Ws(e)});const b=Do(Pn(e));b.length!==0&&e.queryCommandSupported("mceTableToggleClass")&&e.ui.registry.addMenuButton("tableclass",{icon:"table-classes",tooltip:"Table styles",fetch:Io(e,b,"tableclass",y=>e.execCommand("mceTableToggleClass",!1,y)),onSetup:t.onSetupTable});const f=Do(Mn(e));f.length!==0&&e.queryCommandSupported("mceTableCellToggleClass")&&e.ui.registry.addMenuButton("tablecellclass",{icon:"table-cell-classes",tooltip:"Cell styles",fetch:Io(e,f,"tablecellclass",y=>e.execCommand("mceTableCellToggleClass",!1,y)),onSetup:t.onSetupCellOrRow}),e.queryCommandSupported("mceTableApplyCellStyle")&&(e.ui.registry.addMenuButton("tablecellvalign",{icon:"vertical-align",tooltip:"Vertical align",fetch:Io(e,Ln,"tablecellverticalalign",yo(e,"vertical-align")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellborderwidth",{icon:"border-width",tooltip:"Border width",fetch:Io(e,xs(e),"tablecellborderwidth",yo(e,"border-width")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellborderstyle",{icon:"border-style",tooltip:"Border style",fetch:Io(e,On(e),"tablecellborderstyle",yo(e,"border-style")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellbackgroundcolor",{icon:"cell-background-color",tooltip:"Backgroun
6d color",fetch:y=>y(zo(e,vs(e),"background-color")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellbordercolor",{icon:"cell-border-color",tooltip:"Border color",fetch:y=>y(zo(e,Ss(e),"border-color")),onSetup:t.onSetupCellOrRow})),i("tablecaption",{tooltip:"Table caption",icon:"table-caption",command:"mceTableToggleCaption",onSetup:t.onSetupTableWithCaption}),i("tablerowheader",{tooltip:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:Ps(e),onSetup:t.onSetupTableRowHeaders}),i("tablecolheader",{tooltip:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:$s(e),onSetup:t.onSetupTableColumnHeaders})},Yr=e=>{const t=s=>e.dom.is(s,"table")&&e.getBody().contains(s)&&e.dom.isEditable(s.parentNode),n=Gl(e);n.length>0&&e.ui.registry.addContextToolbar("table",{predicate:t,items:n,scope:"node",position:"node"})},Xn=e=>t=>{const n=()=>{t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",n),n(),()=>{e.off("NodeChange",n)}},ea=(e,t)=>{const n=L=>()=>e.execCommand(L),s=(L,G)=>e.queryCommandSupported(G.command)?(e.ui.registry.addMenuItem(L,{...G,onAction:xe(G.onAction)?G.onAction:n(G.command)}),!0):!1,i=(L,G)=>{e.queryCommandSupported(G.command)&&e.ui.registry.addToggleMenuItem(L,{...G,onAction:xe(G.onAction)?G.onAction:n(G.command)})},b=L=>{e.execCommand("mceInsertTable",!1,{rows:L.numRows,columns:L.numColumns})},f=[s("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",command:"mceTableInsertRowBefore",onSetup:t.onSetupCellOrRow}),s("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",command:"mceTableInsertRowAfter",onSetup:t.onSetupCellOrRow}),s("tabledeleterow",{text:"Delete row",icon:"table-delete-row",command:"mceTableDeleteRow",onSetup:t.onSetupCellOrRow}),s("tablerowprops",{text:"Row properties",icon:"table-row-properties",command:"mceTableRowProps",onSetup:t.onSetupCellOrRow}),s("tablecutrow",{text:"Cut row",icon:"cut-row",command:"mceTableCutRow",onSetup:t.onSetupCellOrRow}),s("tablecopyrow",{text:"Copy row",icon:"duplicate-row",command:"mceTableCopyRow",onSetup:t.onSetupCellOrRow}),s("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",command:"mceTablePasteRowBefore",onSetup:t.onSetupPasteable(qo)}),s("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",command:"mceTablePasteRowAfter",onSetup:t.onSetupPasteable(qo)})],y=[s("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",command:"mceTableInsertColBefore",onSetup:t.onSetupColumn("onFirst")}),s("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",command:"mceTableInsertColAfter",onSetup:t.onSetupColumn("onLast")}),s("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",command:"mceTableDeleteCol",onSetup:t.onSetupColumn("onAny")}),s("tablecutcolumn",{text:"Cut column",icon:"cut-column",command:"mceTableCutCol",onSetup:t.onSetupColumn("onAny")}),s("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",command:"mceTableCopyCol",onSetup:t.onSetupColumn("onAny")}),s("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",command:"mceTablePasteColBefore",onSetup:t.onSetupPasteableColumn(Go,"onFirst")}),s("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",command:"mceTablePasteColAfter",onSetup:t.onSetupPasteableColumn(Go,"onLast")})],_=[s("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",command:"mceTableCellProps",onSetup:t.onSetupCellOrRow}),s("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",command:"mceTableMergeCells",onSetup:t.onSetupMergeable}),s("tablesplitcells",{text:"Split cell",icon:"table-split-cells",command:"mceTableSplitCells",onSetup:t.onSetupUnmergeable})];Wl(e)?e.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:()=>[{type:"fancymenuitem",fancytype:"inserttable",onAction:b}],onSetup:Xn(e)}):e.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:n("mceInsertTableDialog"),onSetup:Xn(e)}),e.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:n("mceInsertTableDialog"),onSetup:Xn(e)}),s("tableprops",{text:"Table properties",onSetup:t.onSetupTable,command:"mceTableProps"}),s("deletetable",{text:"Delete table",icon:"table-delete-table",onSetup:t.onSetupTable,command:"mceTableDelete"}),ue(f,!0)&&e.ui.registry.addNestedMenuItem("row",{type:"nestedmenuitem",text:"Row",getSubmenuItems:M("tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter")}),ue(y,!0)&&e.ui.registry.addNestedMenuItem("column",{type:"nestedmenuitem",text:"Column",getSubmenuItems:M("tableinsertcolumnbefore tableinsertcolumnafter tabledelete
6column | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter")}),ue(_,!0)&&e.ui.registry.addNestedMenuItem("cell",{type:"nestedmenuitem",text:"Cell",getSubmenuItems:M("tablecellprops tablemergecells tablesplitcells")}),e.ui.registry.addContextMenu("table",{update:()=>(t.resetTargets(),t.targets().fold(M(""),L=>be(L.element)==="caption"?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable"))});const D=Do(Pn(e));D.length!==0&&e.queryCommandSupported("mceTableToggleClass")&&e.ui.registry.addNestedMenuItem("tableclass",{icon:"table-classes",text:"Table styles",getSubmenuItems:()=>Yt(e,D,"tableclass",L=>e.execCommand("mceTableToggleClass",!1,L)),onSetup:t.onSetupTable});const E=Do(Mn(e));E.length!==0&&e.queryCommandSupported("mceTableCellToggleClass")&&e.ui.registry.addNestedMenuItem("tablecellclass",{icon:"table-cell-classes",text:"Cell styles",getSubmenuItems:()=>Yt(e,E,"tablecellclass",L=>e.execCommand("mceTableCellToggleClass",!1,L)),onSetup:t.onSetupCellOrRow}),e.queryCommandSupported("mceTableApplyCellStyle")&&(e.ui.registry.addNestedMenuItem("tablecellvalign",{icon:"vertical-align",text:"Vertical align",getSubmenuItems:()=>Yt(e,Ln,"tablecellverticalalign",yo(e,"vertical-align")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellborderwidth",{icon:"border-width",text:"Border width",getSubmenuItems:()=>Yt(e,xs(e),"tablecellborderwidth",yo(e,"border-width")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellborderstyle",{icon:"border-style",text:"Border style",getSubmenuItems:()=>Yt(e,On(e),"tablecellborderstyle",yo(e,"border-style")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellbackgroundcolor",{icon:"cell-background-color",text:"Background color",getSubmenuItems:()=>zo(e,vs(e),"background-color"),onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellbordercolor",{icon:"cell-border-color",text:"Border color",getSubmenuItems:()=>zo(e,Ss(e),"border-color"),onSetup:t.onSetupCellOrRow})),i("tablecaption",{icon:"table-caption",text:"Table caption",command:"mceTableToggleCaption",onSetup:t.onSetupTableWithCaption}),i("tablerowheader",{text:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:Ps(e),onSetup:t.onSetupTableRowHeaders}),i("tablecolheader",{text:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:$s(e),onSetup:t.onSetupTableRowHeaders})},ta=e=>{const t=Kr(e);Hl(e),Wr(e),ea(e,t),Zr(e,t),Yr(e)};var oa=()=>{ge.add("table",ta)};oa()})();const ya={class:"p-6 lg:p-8 max-w-5xl mx-auto"},wa={class:"flex items-center justify-between mb-6"},xa={class:"flex items-center gap-3"},va={class:"text-h1 text-white"},Sa={class:"flex items-center gap-3"},Ca={key:0,class:"text-emerald-400 text-sm font-medium"},Ta=["disabled"],Aa={key:0,class:"bg-red-500/10 border border-red-500/30 rounded-none p-4 mb-6"},_a={class:"list-disc list-inside space-y-1"},ka={class:"border-b border-gray-800 mb-6"},Da={class:"flex gap-1 overflow-x-auto"},Ia=["onClick"],Oa={class:"space-y-6"},Ra={class:"grid grid-cols-1 lg:grid-cols-3 gap-6"},Na={class:"lg:col-span-2"},Ma={class:"flex items-center gap-2"},Pa={class:"text-gray-600 text-xs mt-1 text-right"},$a={class:"grid grid-cols-1 lg:grid-cols-2 gap-6"},Ea={class:"space-y-2"},Fa={class:"grid grid-cols-1 lg:grid-cols-2 gap-6"},Ua={class:"space-y-6"},Ba={class:"bg-gray-900 border border-gray-800 rounded-none p-6"},La={class:"max-w-xl"},ja={class:"text-[#007a96] text-lg font-medium leading-snug truncate"},Va={class:"text-green-600 text-xs mt-0.5 mb-1"},Ha={class:"text-gray-400 text-sm leading-relaxed line-clamp-2"},za={class:"block text-xs font-semibold text-gray-400 mb-2"},Wa={class:"block text-xs font-semibold text-gray-400 mb-2"},qa={class:"flex gap-2 mb-3"},Ga=["onKeydown"],Ka={class:"flex flex-wrap gap-2"},Qa=["onClick"],Xa={class:"grid grid-cols-1 lg:grid-cols-2 gap-6"},Ja={class:"space-y-6"},Za={key:0,class:"mt-3"},Ya=["src"],ec={class:"space-y-6"},tc={key:0,class:"text-gray-600 text-sm italic py-4 text-center border border-dashed border-gray-800 rounded-none"},oc={class:"space-y-4"},nc={class:"flex items-center justify-between mb-3"},sc={class:"text-xs font-semibold text-gray-500"},lc=["onClick"],rc={class:"space-y-3"},ac=["onUpdate:modelValue"],cc=["onUpdate:modelValue"],ic={class:"space-y-6"},uc={class:"grid grid-cols-1 lg:grid-cols-2 gap-6"},dc={class:"grid grid-cols-1 lg:grid-cols-3 gap-6"},mc={class:"flex gap-2 mb-3"},pc=["onKeydown"],bc={class:"flex flex-wrap gap-2"},gc=["onClick"],fc={class:"pt-4 border-t border-gray-800 flex justify-end"},hc=["disabled"],Rc={__name:"Form",props:{post:Object,admin:Object},setup(ge){var ue,rt,mt,q,J,_e,pt,$e,Vt,Ge,bt,Ee,gt,ae,ve,ft,Ke,ht,yt,ke,Fe,wt,Z,It,at,Ze,Ot,xt,De;const pe=pa(ga,ba),O=ge,fe=wo(()=>{var k;return!!((k=O.post)!=null&&k.id)}),h=ia({title:((ue=O.post)==null?void 0:ue.title)??"",h1:((rt=O.post)==null?void 0:rt.h1)??"",slug:((mt=O.post)==null?void 0:mt.slug)??"",excerpt:((q=O.post)==null?void 0:q.excerpt)??"",content:((J=O.post)==null?void 0:J.content)??"",featured_image:((_e=O.post)==null?void 0:_e.featured_image)??"",featured_image_alt:((pt=O.post)==null?void 0:pt.featured_image_alt)??"",author_name:(($e=O.post)==null?void 0:$e.author_name)??"All Ways Cabo Team",author_bio:((Vt=O.post)==null?void 0:Vt.author_bio)??"",meta_title:((Ge=O.post)==null?void 0:Ge.meta_title)??"",meta_description:((bt=O.post)==null?void 0:bt.meta_description)??"",meta_keywords:((Ee=O.post)==null?void 0:Ee.meta_keywords)??"",focus_keyword:((gt=O.post)==null?void 0:gt.focus_keyword)??"",secondary_keywords:((ae=O.post)==null?void 0:ae.secondary_keywords)??[],canonical_url:((ve=O.post)==null?void 0:ve.canonical_url)??"",robots:((ft=O.post)==null?void 0:ft.robots)??"index, follow",og_title:((Ke=O.post)==null?void 0:Ke.og_title)??"",og_description:((ht=O.post)==null?void 0:ht.og_description)??"",og_image:((yt=O.post)==null?void 0:yt.og_image)??"",schema_type:((ke=O.post)==null?void 0:ke.schema_type)??"Article",faq_items:((Fe=O.post)==null?void 0:Fe.faq_items)??[],custom_schema:((wt=O.post)==null?void 0:wt.custom_schema)??null,category:((Z=O.post)==null?void 0:Z.category)??"",tags:((It=O.post)==null?void 0:It.tags)??[],reading_time:((at=O.post)==null?void 0:at.reading_time)??"",breadcrumb_title:((Ze=O.post)==null?void 0:Ze.breadcrumb_title)??"",status:((Ot=O.post)==null?void 0:Ot.status)??"draft",published_at:(xt=O.post)!=null&&xt.published_at?new Date(O.post.published_at).toISOString().slice(0,16):""}),ie=xo("content"),Xe=[{id:"content",label:"Content"},{id:"seo",label:"SEO Meta"},{id:"og",label:"Social / OG"},{id:"schema",label:"Schema"},{id:"publish",label:"Publish"}],U=xo(null);Yn(()=>O.post,()=>{U.value=null});const P=()=>{var x;const k=()=>{fe.value?h.put(route("blog.admin.update",O.post.id),{onSuccess:()=>{U.value="Saved ✓"}}):h.post(route("blog.admin.store"))},p=(x=ha)==null?void 0:x.activeEditor;p!=null&&p.uploadImages?p.uploadImages().then(k).catch(k):k()};Yn(()=>h.title,k=>{(!fe.value||!h.slug)&&(h.slug=k.toLowerCase().replace(/[áàäâ]/g,"a").replace(/[éèëê]/g,"e").replace(/[íìïî]/g,"i").replace(/[óòöô]/g,"o").replace(/[úùüû]/g,"u").replace(/ñ/g,"n").replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""))});const K=wo(()=>h.meta_title.length),st=wo(()=>h.meta_description.length),te=xo(""),xe=()=>{const k=te.value.trim();k&&!h.secondary_keywords.includes(k)&&h.secondary_keywords.push(k),te.value=""},Dt=k=>h.secondary_keywords.splice(k,1),lt=xo(""),Pe=()=>{const k=lt.value.trim();k&&!h.tags.includes(k)&&h.tags.push(k),lt.value=""},M=k=>h.tags.splice(k,1),Je=()=>h.faq_items.push({question:"",answer:""}),Ut=k=>h.faq_items.splice(k,1),le=wo(()=>h.meta_title||h.title||"Article Title"),Y=wo(()=>h.meta_description||h.excerpt||"Article description preview..."),re=wo(()=>`allwayscabotransportation.com/cabo-travel-guide/${h.slug||"article-slug"}`),he=xo((De=O.post)!=null&&De.custom_schema?JSON.stringify(O.post.custom_schema,null,2):"");Yn(he,k=>{try{h.custom_schema=k?JSON.parse(k):null}catch{}});const v={license_key:"gpl",promotion:!1,branding:!1,height:480,skin:"oxide",content_css:"default",plugins:"advlist autolink code image link lists media table",toolbar:"undo redo | bold italic | alignleft aligncenter alignright | bullist numlist | link image media table | code",automatic_uploads:!0,images_upload_handler:(k,p)=>new Promise((x,V)=>{var Ue,Qe;const ce=new FormData;ce.append("file",k.blob(),k.filename());const ct=((Ue=document.querySelector('meta[name="csrf-token"]'))==null?void 0:Ue.getAttribute("content"))??((Qe=document.cookie.split("; ").find(Ie=>Ie.startsWith("XSRF-TOKEN=")))==null?void 0:Qe.split("=")[1]),Ye={Accept:"application/json"};ct&&(Ye["X-XSRF-TOKEN"]=decodeURIComponent(ct)),fetch(route("blog.admin.upload.image"),{method:"POST",body:ce,headers:Ye,credentials:"same-origin"}).then(Ie=>Ie.json()).then(Ie=>x(Ie.location)).catch(V)})},Bt=xo(null),Lt={process:(k,p,x,V,ce,ct,Ye)=>{var et,tt;const Ue=new FormData;Ue.append("file",p,p.name);const Qe=((et=document.querySelector('meta[name="csrf-token"]'))==null?void 0:et.getAttribute("content"))??((tt=document.cookie.split("; ").find(oe=>oe.startsWith("XSRF-TOKEN=")))==null?void 0:tt.split("=")[1]),Ie={A
6ccept:"application/json"};return Qe&&(Ie["X-XSRF-TOKEN"]=decodeURIComponent(Qe)),fetch(route("blog.admin.upload.file"),{method:"POST",body:Ue,headers:Ie,credentials:"same-origin"}).then(oe=>oe.json()).then(oe=>{h.featured_image=oe.url||oe.location,V(oe.url||oe.location)}).catch(oe=>ce(oe.message)),{abort:()=>Ye()}},load:(k,p,x)=>(fetch(k,{credentials:"same-origin"}).then(V=>V.blob()).then(p).catch(x),{abort:()=>{}})},jt=k=>{(k==null?void 0:k.length)>0&&k[0].serverId?h.featured_image=k[0].serverId:k!=null&&k.length||(h.featured_image="")};return(k,p)=>(Me(),ua(ma,{admin:ge.admin},{default:qs(()=>[d("div",ya,[d("div",wa,[d("div",xa,[es(A(da),{href:k.route("blog.admin.dashboard"),class:"text-gray-500 hover:text-gray-300 transition-colors"},{default:qs(()=>p[27]||(p[27]=[d("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor","stroke-width":"2",viewBox:"0 0 24 24"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 19l-7-7 7-7"})],-1)])),_:1,__:[27]},8,["href"]),d("h1",va,Ae(fe.value?"Edit Article":"New Article"),1)]),d("div",Sa,[U.value?(Me(),qe("span",Ca,Ae(U.value),1)):Yo("",!0),d("button",{onClick:P,disabled:A(h).processing,class:"bg-[#007a96] hover:bg-[#006080] text-white font-semibold px-6 py-2.5 rounded-none transition-colors disabled:opacity-50 text-sm"},Ae(A(h).processing?"Saving...":fe.value?"Save Changes":"Create Article"),9,Ta)])]),Object.keys(A(h).errors).length?(Me(),qe("div",Aa,[p[28]||(p[28]=d("p",{class:"text-red-400 font-semibold text-sm mb-2"},"Please fix the following errors:",-1)),d("ul",_a,[(Me(!0),qe(No,null,Mo(A(h).errors,(x,V)=>(Me(),qe("li",{key:V,class:"text-red-400 text-sm"},Ae(x),1))),128))])])):Yo("",!0),d("div",ka,[d("div",Da,[(Me(),qe(No,null,Mo(Xe,x=>d("button",{key:x.id,onClick:V=>ie.value=x.id,class:ts([ie.value===x.id?"text-white border-b-2 border-[#007a96]":"text-gray-500 hover:text-gray-300","px-4 py-3 text-sm font-medium whitespace-nowrap transition-colors"])},Ae(x.label),11,Ia)),64))])]),F(d("div",Oa,[d("div",Ra,[d("div",Na,[p[29]||(p[29]=d("label",{class:"block text-xs font-semibold text-gray-400 mb-2"},[X("Title "),d("span",{class:"text-red-400"},"*")],-1)),F(d("input",{"onUpdate:modelValue":p[0]||(p[0]=x=>A(h).title=x),type:"text",required:"",class:"w-full bg-gray-900 border border-gray-700 rounded-none px-4 py-3 text-white placeholder-gray-500 focus:border-[#007a96] focus:outline-none text-sm"},null,512),[[W,A(h).title]])]),d("div",null,[p[30]||(p[30]=d("label",{class:"block text-xs font-semibold text-gray-400 mb-2"},[X("H1 Override "),d("span",{class:"text-gray-600 font-normal normal-case"},"(leave blank to use Title)")],-1)),F(d("input",{"onUpdate:modelValue":p[1]||(p[1]=x=>A(h).h1=x),type:"text",class:"w-full bg-gray-900 border border-gray-700 rounded-none px-4 py-3 text-white placeholder-gray-500 focus:border-[#007a96] focus:outline-none text-sm"},null,512),[[W,A(h).h1]])])]),d("div",null,[p[32]||(p[32]=d("label",{class:"block text-xs font-semibold text-gray-400 mb-2"},"URL Slug",-1)),d("div",Ma,[p[31]||(p[31]=d("span",{class:"text-gray-600 text-sm shrink-0"},"/cabo-travel-guide/",-1)),F(d("input",{"onUpdate:modelValue":p[2]||(p[2]=x=>A(h).slug=x),type:"text",class:"flex-1 bg-gray-900 border border-gray-700 rounded-none px-4 py-3 text-white placeholder-gray-500 focus:border-[#007a96] focus:outline-none text-sm font-mono"},null,512),[[W,A(h).slug]])])]),d("div",null,[p[33]||(p[33]=d("label",{class:"block text-xs font-semibold text-gray-400 mb-2"},[X("Excerpt "),d("span",{class:"text-gray-600 font-normal normal-case"},"(max 500 chars — used in listings & fallback meta)")],-1)),F(d("textarea",{"onUpdate:modelValue":p[3]||(p[3]=x=>A(h).excerpt=x),rows:"3",maxlength:"500",class:"w-full bg-gray-900 border border-gray-700 rounded-none px-4 py-3 text-white placeholder-gray-500 focus:border-[#007a96] focus:outline-none text-sm resize-none"},null,512),[[W,A(h).excerpt]]),d("p",Pa,Ae(A(h).excerpt.length)+"/500",1)]),d("div",null,[p[34]||(p[34]=d("label",{class:"block text-xs font-semibold text-gray-400 mb-2"},[X("Content "),d("span",{class:"text-red-400"},"*"),X(),d("span",{class:"text-gray-600 font-normal normal-case"},"(rich text — images & videos can be uploaded)")],-1)),es(A(fa),{modelValue:A(h).content,"onUpdate:modelValue":p[4]||(p[4]=x=>A(h).content=x),init:v,class:"blog-tinymce"},null,8,["modelValue"])]),d("div",$a,[d("div",null,[p[35]||(p[35]=d("label",{class:"block text-xs font-semibold text-gray-400 mb-2"},[X("Featured Image "),d("span",{class:"text-gray-600 font-normal normal-case"},"(upload or paste URL)")],-1)),d("div",Ea,[es(A(pe),{ref_key:"pondFeatured",ref:Bt,name:"featured_image",server:Lt,files:A(h).featured_image?[{source:A(h).featured_image,options:{type:"local"}}]:[],"allow-multiple":!1,"max-files":1,"accepted-file-types":"image/jpeg, image/png, image/webp, image/gif",onUpdatefiles:jt},null,8,["files"]),F(d("input",{"onUpdate:modelValue":p[5]||(p[5]=x=>A(h).featured_image=x),type:"text",class:"w-full bg-gray-900 border border-gray-700 rounded-none px-4 py-2 text-white placeholder-gray-500 focus:border-[#007a96] focus:outline-none text-sm",placeholder:"/uploads/blog/hero.webp"},null,512),[[W,A(h).featured_image]])])]),d("div",null,[p[36]||(p[36]=d("label",{class:"block text-xs font-semibold text-gray-400 mb-2"},[X("Featured Image Alt Text "),d("span",{class:"text-gray-500 font-normal normal-case"},"(important for SEO)")],-1)),F(d("input",{"onUpdate:modelValue":p[6]||(p[6]=x=>A(h).featured_image_alt=x),type:"text",class:"w-full bg-gray-900 border border-gray-700 rounded-none px-4 py-3 text-white placeholder-gray-500 focus:border-[#007a96] focus:outline-none text-sm"},null,512),[[W,A(h).featured_image_alt]])])]),d("div",Fa,[d("div",null,[p[37]||(p[37]=d("label",{class:"block text-xs font-semibold text-gray-400 mb-2"},"Author Name",-1)),F(d("input",{"onUpdate:modelValue":p[7]||(p[7]=x=>A(h).author_name=x),type:"text",class:"w-full bg-gray-900 border border-gray-700 rounded-none px-4 py-3 text-white placeholder-gray-500 focus:border-[#007a96] focus:outline-none text-sm"},null,512),[[W,A(h).author_name]])]),d("div",null,[p[38]||(p[38]=d("label",{class:"block text-xs font-semibold text-gray-400 mb-2"},[X("Author Bio "),d("span",{class:"text-gray-600 font-normal normal-case"},"(max 300 chars)")],-1)),F(d("input",{"onUpdate:modelValue":p[8]||(p[8]=x=>A(h).author_bio=x),type:"text",maxlength:"300",class:"w-full bg-gray-900 border border-gray-700 rounded-none px-4 py-3 text-white placeholder-gray-500 focus:border-[#007a96] focus:outline-none text-sm"},null,512),[[W,A(h).author_bio]])])])],512),[[Po,ie.value==="content"]]),F(d("div",Ua,[d("div",Ba,[p[39]||(p[39]=d("p",{class:"text-xs font-semibold text-gray-500 mb-4"},"Google SERP Preview",-1)),d("div",La,[d("p",ja,Ae(le.value),1),d("p",Va,Ae(re.value),1),d("p",Ha,Ae(Y.value),1)])]),d("div",null,[d("label",za,[p[40]||(p[40]=X(" Meta Title ")),p[41]||(p[41]=d("span",{class:"text-gray-600 font-normal normal-case"},"(ideal: 50–60 chars)",-1)),d("span",{class:ts([K.value>70?"text-red-400":K.value>60?"text-amber-400":"text-emerald-400","ml-2"])},Ae(K.value)+"/70",3)]),F(d("input",{"onUpdate:modelValue":p[9]||(p[9]=x=>A(h).meta_title=x),type:"text",maxlength:"70",class:"w-full bg-gray-900 border border-gray-700 rounded-none px-4 py-3 text-white placeholder-gray-500 focus:border-[#007a96] focus:outline-none text-sm",placeholder:"Primary Keyword — Secondary Keyword | Brand"},null,512),[[W,A(h).meta_title]])]),d("div",null,[d("label",Wa,[p[42]||(p[42]=X(" Meta Description ")),p[43]||(p[43]=d("span",{class:"text-gray-600 font-normal normal-case"},"(ideal: 140–155 chars)",-1)),d("span",{class:ts([st.value>152?"text-red-400":st.value>145?"text-amber-400":"text-emerald-400","ml-2"])},Ae(st.value)+"/152",3)]),F(d("textarea",{"onUpdate:modelValue":p[10]||(p[10]=x=>A(h).meta_description=x),rows:"3",maxlength:"152",class:"w-full bg-gray-900 border border-gray-700 rounded-none px-4 py-3 text-white placeholder-gray-500 focus:border-[#007a96] focus:outline-none text-sm resize-none"},null,512),[[W,A(h).meta_description]])]),d("div",null,[p[44]||(p[44]=d("label",{class:"block text-xs font-semibold text-gray-400 mb-2"},[X("Focus Keyword "),d("span",{class:"text-gray-600 font-normal normal-case"},"(main target keyword)")],-1)),F(d("input",{"onUpdate:modelValue":p[11]||(p[11]=x=>A(h).focus_keyword=x),type:"text",class:"w-full bg-gray-900 border border-gray-700 rounded-none px-4 py-3 text-white placeholder-gray-500 focus:border-[#007a96] focus:outline-none text-sm",placeholder:"e.g. cabo airport transportation"},null,512),[[W,A(h).focus_keyword]])]),d("div",null,[p[45]||(p[45]=d("label",{class:"block text-xs font-semibold text-gray-400 mb-2"},"Secondary Keywords",-1)),d("div",qa,[F(d("input",{"onUpdate:modelValue":p[12]||(p[12]=x=>te.value=x),type:"text",onKeydown:Gs(Ks(xe,["prevent"]),["enter"]),class:"flex-1 bg-gray-900 border border-gray-700 rounded-none px-4 py-2.5 text-white placeholder-gray-500 focus:border-[#007a96] focus:outline-none text-sm",placeholder:"Type keyword and press Enter"},null,40,Ga),[[W,te.value]]),d("button",{onClick:xe,type:"button",class:"bg-gray-800 hover:bg-gray-700 text-gray-300 px-4 py-2.5 rounded-none text-sm transition-colors"},"Add")]),d("div",Ka,[(Me(!0),qe(No,null,Mo(A(h).secondary_keywords,(x,V)=>(Me(),qe("span",{key:V,class:"inline-flex items-center gap-1.5 bg-[#007a96]/20 text-[#007a96] border border-[#007a96]/30 text-xs font-medium px-3 py-1.5 rounded-none"},[X(Ae(x)+" ",1),d("button",{onClick:ce=>Dt(V),type:"button",class:"hover:text-white transition-colors"},"×",8,Qa)]))),128))])]),d("div",null,[p[46]||(p[46]=d("label",{class:"block text-xs font-semibold text-gray-400 mb-2"},[X("Meta Keywords "),d("span",{class:"text-gray-600 font-normal normal-case"},"(comma-separated, for indexing reference)")],-1)),F(d("input",{"onUpdate:modelValue":p[13]||(p[13]=x=>A(h).meta_keywords=x),type:"text",class:"w-full bg-gray-900 border border-gray-700 rounded-none px-4 py-3 text-white placeholder-gray-500 focus:border-[#007a96] focus:outline-none text-sm",placeholder:"cabo transportation, airport shuttle, los cabos transfer"},null,512),[[W,A(h).meta_keywords]])]),d("div",Xa,[d("div",null,[p[47]||(p[47]=d("label",{class:"block text-xs font-semibold text-gray-400 mb-2"},[X("Canonical URL "),d("span",{class:"text-gray-600 font-normal normal-case"},"(leave blank for auto)")],-1)),F(d("input",{"onUpdate:modelValue":p[14]||(p[14]=x=>A(h).canonical_url=x),type:"url",class:"w-full bg-gray-900 border border-gray-700 rounded-none px-4 py-3 text-white placeholder-gray-500 focus:border-[#007a96] focus:outline-none text-sm"},null,512),[[W,A(h).canonical_url]])]),d("div",null,[p[49]||(p[49]=d("label",{class:"block text-xs font-semibold text-gray-400 mb-2"},"Robots Meta",-1)),F(d("select",{"onUpdate:modelValue":p[15]||(p[15]=x=>A(h).robots=x),class:"w-full bg-gray-900 border border-gray-700 rounded-none px-4 py-3 text-white focus:border-[#007a96] focus:outline-none text-sm"},p[48]||(p[48]=[d("option",{value:"index, follow"},"index, follow (default)",-1),d("option",{value:"noindex, follow"},"noindex, follow",-1),d("option",{value:"index, nofollow"},"index, nofollow",-1),d("option",{value:"noindex, nofollow"},"noindex, nofollow",-1)]),512),[[os,A(h).robots]])])])],512),[[Po,ie.value==="seo"]]),F(d("div",Ja,[p[53]||(p[53]=d("div",{class:"bg-blue-500/10 border border-blue-500/20 rounded-none p-4 text-sm text-blue-300"},[d("strong",null,"Tip:"),X(" Leave blank to inherit from Meta Title, Meta Description, and Featured Image automatically. ")],-1)),d("div",null,[p[50]||(p[50]=d("label",{class:"block text-xs font-semibold text-gray-400 mb-2"},[X("OG / Social Title "),d("span",{class:"text-gray-600 font-normal normal-case"},"(max 95 chars)")],-1)),F(d("input",{"onUpdate:modelValue":p[16]||(p[16]=x=>A(h).og_title=x),type:"text",maxlength:"95",class:"w-full bg-gray-900 border border-gray-700 rounded-none px-4 py-3 text-white placeholder-gray-500 focus:border-[#007a96] focus:outline-none text-sm"},null,512),[[W,A(h).og_title]])]),d("div",null,[p[51]||(p[51]=d("label",{class:"block text-xs font-semibold text-gray-400 mb-2"},[X("OG / Social Description "),d("span",{class:"text-gray-600 font-normal normal-case"},"(max 200 chars)")],-1)),F(d("textarea",{"onUpdate:modelValue":p[17]||(p[17]=x=>A(h).og_description=x),rows:"3",maxlength:"200",class:"w-full bg-gray-900 border border-gray-700 rounded-none px-4 py-3 text-white placeholder-gray-500 focus:border-[#007a96] focus:outline-none text-sm resize-none"},null,512),[[W,A(h).og_description]])]),d("div",null,[p[52]||(p[52]=d("label",{class:"block text-xs font-semibold text-gray-400 mb-2"},[X("OG / Social Image URL "),d("span",{class:"text-gray-600 font-normal normal-case"},"(recommended: 1200×630px)")],-1)),F(d("input",{"onUpdate:modelValue":p[18]||(p[18]=x=>A(h).og_image=x),type:"text",class:"w-full bg-gray-900 border border-gray-700 rounded-none px-4 py-3 text-white placeholder-gray-500 focus:border-[#007a96] focus:outline-none text-sm",placeholder:"/images/blog/og-image.
6webp"},null,512),[[W,A(h).og_image]]),A(h).og_image?(Me(),qe("div",Za,[d("img",{src:A(h).og_image,alt:"OG preview",class:"max-h-40 rounded-none border border-gray-700 object-cover"},null,8,Ya)])):Yo("",!0)])],512),[[Po,ie.value==="og"]]),F(d("div",ec,[d("div",null,[p[55]||(p[55]=d("label",{class:"block text-xs font-semibold text-gray-400 mb-2"},"Schema Type",-1)),F(d("select",{"onUpdate:modelValue":p[19]||(p[19]=x=>A(h).schema_type=x),class:"w-full bg-gray-900 border border-gray-700 rounded-none px-4 py-3 text-white focus:border-[#007a96] focus:outline-none text-sm"},p[54]||(p[54]=[d("option",{value:"Article"},"Article",-1),d("option",{value:"TravelGuide"},"TravelGuide (Article + TravelGuide)",-1),d("option",{value:"FAQPage"},"FAQPage",-1),d("option",{value:"HowTo"},"HowTo",-1),d("option",{value:"NewsArticle"},"NewsArticle",-1)]),512),[[os,A(h).schema_type]])]),d("div",null,[d("div",{class:"flex items-center justify-between mb-3"},[p[56]||(p[56]=d("label",{class:"text-xs font-semibold text-gray-400"},[X("FAQ Items "),d("span",{class:"text-gray-600 font-normal normal-case"},"(for FAQPage schema + visible FAQ section)")],-1)),d("button",{onClick:Je,type:"button",class:"text-xs bg-gray-800 hover:bg-gray-700 text-gray-300 px-3 py-1.5 rounded-none transition-colors"},"+ Add FAQ")]),A(h).faq_items.length===0?(Me(),qe("div",tc,' No FAQs yet. Click "+ Add FAQ" to create structured Q&A pairs. ')):Yo("",!0),d("div",oc,[(Me(!0),qe(No,null,Mo(A(h).faq_items,(x,V)=>(Me(),qe("div",{key:V,class:"bg-gray-900 border border-gray-800 rounded-none p-4"},[d("div",nc,[d("span",sc,"FAQ #"+Ae(V+1),1),d("button",{onClick:ce=>Ut(V),type:"button",class:"text-gray-600 hover:text-red-400 transition-colors text-xs"},"Remove",8,lc)]),d("div",rc,[d("div",null,[p[57]||(p[57]=d("label",{class:"block text-xs text-gray-500 mb-1"},"Question",-1)),F(d("input",{"onUpdate:modelValue":ce=>x.question=ce,type:"text",class:"w-full bg-gray-800 border border-gray-700 rounded-none px-3 py-2.5 text-white text-sm focus:border-[#007a96] focus:outline-none"},null,8,ac),[[W,x.question]])]),d("div",null,[p[58]||(p[58]=d("label",{class:"block text-xs text-gray-500 mb-1"},"Answer",-1)),F(d("textarea",{"onUpdate:modelValue":ce=>x.answer=ce,rows:"3",class:"w-full bg-gray-800 border border-gray-700 rounded-none px-3 py-2.5 text-white text-sm focus:border-[#007a96] focus:outline-none resize-none"},null,8,cc),[[W,x.answer]])])])]))),128))])]),d("div",null,[p[59]||(p[59]=d("label",{class:"block text-xs font-semibold text-gray-400 mb-2"},[X("Custom JSON-LD "),d("span",{class:"text-gray-600 font-normal normal-case"},"(advanced — appended to auto-generated schema)")],-1)),F(d("textarea",{"onUpdate:modelValue":p[20]||(p[20]=x=>he.value=x),rows:"10",class:"w-full bg-gray-900 border border-gray-700 rounded-none px-4 py-3 text-white placeholder-gray-500 focus:border-[#007a96] focus:outline-none text-xs font-mono resize-y",placeholder:'[{"@type": "Event", ...}]'},null,512),[[W,he.value]])])],512),[[Po,ie.value==="schema"]]),F(d("div",ic,[d("div",uc,[d("div",null,[p[61]||(p[61]=d("label",{class:"block text-xs font-semibold text-gray-400 mb-2"},"Status",-1)),F(d("select",{"onUpdate:modelValue":p[21]||(p[21]=x=>A(h).status=x),class:"w-full bg-gray-900 border border-gray-700 rounded-none px-4 py-3 text-white focus:border-[#007a96] focus:outline-none text-sm"},p[60]||(p[60]=[d("option",{value:"draft"},"Draft",-1),d("option",{value:"published"},"Published",-1),d("option",{value:"scheduled"},"Scheduled",-1)]),512),[[os,A(h).status]])]),d("div",null,[p[62]||(p[62]=d("label",{class:"block text-xs font-semibold text-gray-400 mb-2"},"Publish Date",-1)),F(d("input",{"onUpdate:modelValue":p[22]||(p[22]=x=>A(h).published_at=x),type:"datetime-local",class:"w-full bg-gray-900 border border-gray-700 rounded-none px-4 py-3 text-white focus:border-[#007a96] focus:outline-none text-sm"},null,512),[[W,A(h).published_at]])])]),d("div",dc,[d("div",null,[p[63]||(p[63]=d("label",{class:"block text-xs font-semibold text-gray-400 mb-2"},"Category",-1)),F(d("input",{"onUpdate:modelValue":p[23]||(p[23]=x=>A(h).category=x),type:"text",class:"w-full bg-gray-900 border border-gray-700 rounded-none px-4 py-3 text-white placeholder-gray-500 focus:border-[#007a96] focus:outline-none text-sm",placeholder:"e.g. Airport Tips, Resorts, Tours"},null,512),[[W,A(h).category]])]),d("div",null,[p[64]||(p[64]=d("label",{class:"block text-xs font-semibold text-gray-400 mb-2"},[X("Reading Time "),d("span",{class:"text-gray-600 font-normal normal-case"},"(minutes — auto-calculated)")],-1)),F(d("input",{"onUpdate:modelValue":p[24]||(p[24]=x=>A(h).reading_time=x),type:"number",min:"1",max:"120",class:"w-full bg-gray-900 border border-gray-700 rounded-none px-4 py-3 text-white placeholder-gray-500 focus:border-[#007a96] focus:outline-none text-sm"},null,512),[[W,A(h).reading_time,void 0,{number:!0}]])]),d("div",null,[p[65]||(p[65]=d("label",{class:"block text-xs font-semibold text-gray-400 mb-2"},[X("Breadcrumb Title "),d("span",{class:"text-gray-600 font-normal normal-case"},"(shorter, optional)")],-1)),F(d("input",{"onUpdate:modelValue":p[25]||
6(p[25]=x=>A(h).breadcrumb_title=x),type:"text",class:"w-full bg-gray-900 border border-gray-700 rounded-none px-4 py-3 text-white placeholder-gray-500 focus:border-[#007a96] focus:outline-none text-sm"},null,512),[[W,A(h).breadcrumb_title]])])]),d("div",null,[p[66]||(p[66]=d("label",{class:"block text-xs font-semibold text-gray-400 mb-2"},"Tags",-1)),d("div",mc,[F(d("input",{"onUpdate:modelValue":p[26]||(p[26]=x=>lt.value=x),type:"text",onKeydown:Gs(Ks(Pe,["prevent"]),["enter"]),class:"flex-1 bg-gray-900 border border-gray-700 rounded-none px-4 py-2.5 text-white placeholder-gray-500 focus:border-[#007a96] focus:outline-none text-sm",placeholder:"Type a tag and press Enter"},null,40,pc),[[W,lt.value]]),d("button",{onClick:Pe,type:"button",class:"bg-gray-800 hover:bg-gray-700 text-gray-300 px-4 py-2.5 rounded-none text-sm transition-colors"},"Add")]),d("div",bc,[(Me(!0),qe(No,null,Mo(A(h).tags,(x,V)=>(Me(),qe("span",{key:V,class:"inline-flex items-center gap-1.5 bg-gray-800 text-gray-300 border border-gray-700 text-xs font-medium px-3 py-1.5 rounded-none"},[X(Ae(x)+" ",1),d("button",{onClick:ce=>M(V),type:"button",class:"hover:text-white transition-colors"},"×",8,gc)]))),128))])]),d("div",fc,[d("button",{onClick:P,disabled:A(h).processing,class:"bg-[#007a96] hover:bg-[#006080] text-white font-semibold px-8 py-3 rounded-none transition-colors disabled:opacity-50"},Ae(A(h).processing?"Saving...":fe.value?"Save Changes":"Create Article"),9,hc)])],512),[[Po,ie.value==="publish"]])])]),_:1},8,["admin"]))}};export{Rc as default};

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.