@bagelink/vue 1.9.134 → 1.9.136
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/form/inputs/Upload/UploadInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/Upload/useFileUpload.d.ts +1 -0
- package/dist/components/form/inputs/Upload/useFileUpload.d.ts.map +1 -1
- package/dist/form-flow/form-flow.d.ts +2 -0
- package/dist/form-flow/form-flow.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +4 -2
- package/dist/style.css +1 -1
- package/dist/types/BagelForm.d.ts +1 -0
- package/dist/types/BagelForm.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/form/inputs/Upload/UploadInput.vue +1 -0
- package/src/components/form/inputs/Upload/useFileUpload.ts +4 -0
- package/src/form-flow/form-flow.ts +2 -0
- package/src/types/BagelForm.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadInput.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/inputs/Upload/UploadInput.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UploadInput.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/inputs/Upload/UploadInput.vue"],"names":[],"mappings":"AAgOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAMnE,KAAK,WAAW,GAAG,gBAAgB,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AA2E5E,iBAAS,cAAc;WAgiBT,OAAO,IAA6B;;;;;;;;;;;;;;;;;;;;;;;;YAXtB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;YACI,GAAG;;;;EAerC;AA2BD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;UA5oB8C,MAAM;;;;cAAtB,OAAO;wFAqpBxD,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFileUpload.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/inputs/Upload/useFileUpload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAIxD,UAAU,kBAAkB;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IAClC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,IAAI,CAAA;IAC3C,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB;AAED,wBAAgB,aAAa,CAAC,KAAK,GAAE,kBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAclC,IAAI;gCAkCY,MAAM,GAAG,IAAI,GAAG,SAAS;;qBAhC1C,IAAI,GAAG,IAAI,EAAE,GAAG,QAAQ,GAAG,IAAI;;;
|
|
1
|
+
{"version":3,"file":"useFileUpload.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/inputs/Upload/useFileUpload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAIxD,UAAU,kBAAkB;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IAClC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,aAAa,CAAA;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,IAAI,CAAA;IAC3C,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB;AAED,wBAAgB,aAAa,CAAC,KAAK,GAAE,kBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAclC,IAAI;gCAkCY,MAAM,GAAG,IAAI,GAAG,SAAS;;qBAhC1C,IAAI,GAAG,IAAI,EAAE,GAAG,QAAQ,GAAG,IAAI;;;EA+IvD"}
|
|
@@ -154,6 +154,7 @@ export declare const $: {
|
|
|
154
154
|
upload(labelOrConfig?: string | (BaseFieldConfig & {
|
|
155
155
|
multiple?: boolean;
|
|
156
156
|
accept?: string;
|
|
157
|
+
capture?: boolean | "user" | "environment";
|
|
157
158
|
dirPath?: string;
|
|
158
159
|
width?: string;
|
|
159
160
|
height?: string;
|
|
@@ -167,6 +168,7 @@ export declare const $: {
|
|
|
167
168
|
}), config?: BaseFieldConfig & {
|
|
168
169
|
multiple?: boolean;
|
|
169
170
|
accept?: string;
|
|
171
|
+
capture?: boolean | "user" | "environment";
|
|
170
172
|
dirPath?: string;
|
|
171
173
|
width?: string;
|
|
172
174
|
icon?: IconType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-flow.d.ts","source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CAAC;CAC1D,CAAA;AAED,KAAK,cAAc,CAAC,CAAC,IAAI,CAAC,SAAS,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,GAAG,CAAA"}
|
package/dist/index.cjs
CHANGED
|
@@ -155,7 +155,7 @@ ${t.preList[r]}
|
|
|
155
155
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...o){const r=new this(t);return o.forEach(a=>r.set(a)),r}static accessor(t){const r=(this[yf]=this[yf]={accessors:{}}).accessors,a=this.prototype;function l(i){const s=oa(i);r[s]||(vS(a,i),r[s]=!0)}return ce.isArray(t)?t.forEach(l):l(t),this}};nn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ce.reduceDescriptors(nn.prototype,({value:e},t)=>{let o=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[o]=r}}});ce.freezeMethods(nn);function Bs(e,t){const o=this||il,r=t||o,a=nn.from(r.headers);let l=r.data;return ce.forEach(e,function(s){l=s.call(o,l,a.normalize(),t?t.status:void 0)}),a.normalize(),l}function kg(e){return!!(e&&e.__CANCEL__)}let sl=class extends We{constructor(t,o,r){super(t??"canceled",We.ERR_CANCELED,o,r),this.name="CanceledError",this.__CANCEL__=!0}};function Eg(e,t,o){const r=o.config.validateStatus;!o.status||!r||r(o.status)?e(o):t(new We("Request failed with status code "+o.status,[We.ERR_BAD_REQUEST,We.ERR_BAD_RESPONSE][Math.floor(o.status/100)-4],o.config,o.request,o))}function yS(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function bS(e,t){e=e||10;const o=new Array(e),r=new Array(e);let a=0,l=0,i;return t=t!==void 0?t:1e3,function(c){const u=Date.now(),d=r[l];i||(i=u),o[a]=c,r[a]=u;let f=l,p=0;for(;f!==a;)p+=o[f++],f=f%e;if(a=(a+1)%e,a===l&&(l=(l+1)%e),u-i<t)return;const h=d&&u-d;return h?Math.round(p*1e3/h):void 0}}function _S(e,t){let o=0,r=1e3/t,a,l;const i=(u,d=Date.now())=>{o=d,a=null,l&&(clearTimeout(l),l=null),e(...u)};return[(...u)=>{const d=Date.now(),f=d-o;f>=r?i(u,d):(a=u,l||(l=setTimeout(()=>{l=null,i(a)},r-f)))},()=>a&&i(a)]}const ri=(e,t,o=3)=>{let r=0;const a=bS(50,250);return _S(l=>{const i=l.loaded,s=l.lengthComputable?l.total:void 0,c=i-r,u=a(c),d=i<=s;r=i;const f={loaded:i,total:s,progress:s?i/s:void 0,bytes:c,rate:u||void 0,estimated:u&&s&&d?(s-i)/u:void 0,event:l,lengthComputable:s!=null,[t?"download":"upload"]:!0};e(f)},o)},bf=(e,t)=>{const o=e!=null;return[r=>t[0]({lengthComputable:o,total:e,loaded:r}),t[1]]},_f=e=>(...t)=>ce.asap(()=>e(...t)),wS=jt.hasStandardBrowserEnv?((e,t)=>o=>(o=new URL(o,jt.origin),e.protocol===o.protocol&&e.host===o.host&&(t||e.port===o.port)))(new URL(jt.origin),jt.navigator&&/(msie|trident)/i.test(jt.navigator.userAgent)):()=>!0,$S=jt.hasStandardBrowserEnv?{write(e,t,o,r,a,l,i){if(typeof document>"u")return;const s=[`${e}=${encodeURIComponent(t)}`];ce.isNumber(o)&&s.push(`expires=${new Date(o).toUTCString()}`),ce.isString(r)&&s.push(`path=${r}`),ce.isString(a)&&s.push(`domain=${a}`),l===!0&&s.push("secure"),ce.isString(i)&&s.push(`SameSite=${i}`),document.cookie=s.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function kS(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function ES(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Cg(e,t,o){let r=!kS(t);return e&&(r||o==!1)?ES(e,t):t}const wf=e=>e instanceof nn?{...e}:e;function nr(e,t){t=t||{};const o={};function r(u,d,f,p){return ce.isPlainObject(u)&&ce.isPlainObject(d)?ce.merge.call({caseless:p},u,d):ce.isPlainObject(d)?ce.merge({},d):ce.isArray(d)?d.slice():d}function a(u,d,f,p){if(ce.isUndefined(d)){if(!ce.isUndefined(u))return r(void 0,u,f,p)}else return r(u,d,f,p)}function l(u,d){if(!ce.isUndefined(d))return r(void 0,d)}function i(u,d){if(ce.isUndefined(d)){if(!ce.isUndefined(u))return r(void 0,u)}else return r(void 0,d)}function s(u,d,f){if(f in t)return r(u,d);if(f in e)return r(void 0,u)}const c={url:l,method:l,data:l,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:s,headers:(u,d,f)=>a(wf(u),wf(d),f,!0)};return ce.forEach(Object.keys({...e,...t}),function(d){if(d==="__proto__"||d==="constructor"||d==="prototype")return;const f=ce.hasOwnProp(c,d)?c[d]:a,p=f(e[d],t[d],d);ce.isUndefined(p)&&f!==s||(o[d]=p)}),o}const Sg=e=>{const t=nr({},e);let{data:o,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:l,headers:i,auth:s}=t;if(t.headers=i=nn.from(i),t.url=wg(Cg(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&i.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),ce.isFormData(o)){if(jt.hasStandardBrowserEnv||jt.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(ce.isFunction(o.getHeaders)){const c=o.getHeaders(),u=["content-type","content-length"];Object.entries(c).forEach(([d,f])=>{u.includes(d.toLowerCase())&&i.set(d,f)})}}if(jt.hasStandardBrowserEnv&&(r&&ce.isFunction(r)&&(r=r(t)),r||r!==!1&&wS(t.url))){const c=a&&l&&$S.read(l);c&&i.set(a,c)}return t},CS=typeof XMLHttpRequest<"u",SS=CS&&function(e){return new Promise(function(o,r){const a=Sg(e);let l=a.data;const i=nn.from(a.headers).normalize();let{responseType:s,onUploadProgress:c,onDownloadProgress:u}=a,d,f,p,h,m;function g(){h&&h(),m&&m(),a.cancelToken&&a.cancelToken.unsubscribe(d),a.signal&&a.signal.removeEventListener("abort",d)}let b=new XMLHttpRequest;b.open(a.method.toUpperCase(),a.url,!0),b.timeout=a.timeout;function v(){if(!b)return;const _=nn.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),w={data:!s||s==="text"||s==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:_,config:e,request:b};Eg(function(C){o(C),g()},function(C){r(C),g()},w),b=null}"onloadend"in b?b.onloadend=v:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(v)},b.onabort=function(){b&&(r(new We("Request aborted",We.ECONNABORTED,e,b)),b=null)},b.onerror=function($){const w=$&&$.message?$.message:"Network Error",k=new We(w,We.ERR_NETWORK,e,b);k.event=$||null,r(k),b=null},b.ontimeout=function(){let $=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const w=a.transitional||Hu;a.timeoutErrorMessage&&($=a.timeoutErrorMessage),r(new We($,w.clarifyTimeoutError?We.ETIMEDOUT:We.ECONNABORTED,e,b)),b=null},l===void 0&&i.setContentType(null),"setRequestHeader"in b&&ce.forEach(i.toJSON(),function($,w){b.setRequestHeader(w,$)}),ce.isUndefined(a.withCredentials)||(b.withCredentials=!!a.withCredentials),s&&s!=="json"&&(b.responseType=a.responseType),u&&([p,m]=ri(u,!0),b.addEventListener("progress",p)),c&&b.upload&&([f,h]=ri(c),b.upload.addEventListener("progress",f),b.upload.addEventListener("loadend",h)),(a.cancelToken||a.signal)&&(d=_=>{b&&(r(!_||_.type?new sl(null,e,b):_),b.abort(),b=null)},a.cancelToken&&a.cancelToken.subscribe(d),a.signal&&(a.signal.aborted?d():a.signal.addEventListener("abort",d)));const y=yS(a.url);if(y&&jt.protocols.indexOf(y)===-1){r(new We("Unsupported protocol "+y+":",We.ERR_BAD_REQUEST,e));return}b.send(l||null)})},xS=(e,t)=>{const{length:o}=e=e?e.filter(Boolean):[];if(t||o){let r=new AbortController,a;const l=function(u){if(!a){a=!0,s();const d=u instanceof Error?u:this.reason;r.abort(d instanceof We?d:new sl(d instanceof Error?d.message:d))}};let i=t&&setTimeout(()=>{i=null,l(new We(`timeout of ${t}ms exceeded`,We.ETIMEDOUT))},t);const s=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(l):u.removeEventListener("abort",l)}),e=null)};e.forEach(u=>u.addEventListener("abort",l));const{signal:c}=r;return c.unsubscribe=()=>ce.asap(s),c}},TS=function*(e,t){let o=e.byteLength;if(o<t){yield e;return}let r=0,a;for(;r<o;)a=r+t,yield e.slice(r,a),r=a},NS=async function*(e,t){for await(const o of DS(e))yield*TS(o,t)},DS=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:o,value:r}=await t.read();if(o)break;yield r}}finally{await t.cancel()}},$f=(e,t,o,r)=>{const a=NS(e,t);let l=0,i,s=c=>{i||(i=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:u,value:d}=await a.next();if(u){s(),c.close();return}let f=d.byteLength;if(o){let p=l+=f;o(p)}c.enqueue(new Uint8Array(d))}catch(u){throw s(u),u}},cancel(c){return s(c),a.return()}},{highWaterMark:2})},kf=64*1024,{isFunction:_l}=ce,AS=(({Request:e,Response:t})=>({Request:e,Response:t}))(ce.global),{ReadableStream:Ef,TextEncoder:Cf}=ce.global,Sf=(e,...t)=>{try{return!!e(...t)}catch{return!1}},BS=e=>{e=ce.merge.call({skipUndefined:!0},AS,e);const{fetch:t,Request:o,Response:r}=e,a=t?_l(t):typeof fetch=="function",l=_l(o),i=_l(r);if(!a)return!1;const s=a&&_l(Ef),c=a&&(typeof Cf=="function"?(m=>g=>m.encode(g))(new Cf):async m=>new Uint8Array(await new o(m).arrayBuffer())),u=l&&s&&Sf(()=>{let m=!1;const g=new o(jt.origin,{body:new Ef,method:"POST",get duplex(){return m=!0,"half"}}).headers.has("Content-Type");return m&&!g}),d=i&&s&&Sf(()=>ce.isReadableStream(new r("").body)),f={stream:d&&(m=>m.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!f[m]&&(f[m]=(g,b)=>{let v=g&&g[m];if(v)return v.call(g);throw new We(`Response type '${m}' is not supported`,We.ERR_NOT_SUPPORT,b)})});const p=async m=>{if(m==null)return 0;if(ce.isBlob(m))return m.size;if(ce.isSpecCompliantForm(m))return(await new o(jt.origin,{method:"POST",body:m}).arrayBuffer()).byteLength;if(ce.isArrayBufferView(m)||ce.isArrayBuffer(m))return m.byteLength;if(ce.isURLSearchParams(m)&&(m=m+""),ce.isString(m))return(await c(m)).byteLength},h=async(m,g)=>{const b=ce.toFiniteNumber(m.getContentLength());return b??p(g)};return async m=>{let{url:g,method:b,data:v,signal:y,cancelToken:_,timeout:$,onDownloadProgress:w,onUploadProgress:k,responseType:C,headers:D,withCredentials:T="same-origin",fetchOptions:B}=Sg(m),P=t||fetch;C=C?(C+"").toLowerCase():"text";let E=xS([y,_&&_.toAbortSignal()],$),S=null;const V=E&&E.unsubscribe&&(()=>{E.unsubscribe()});let A;try{if(k&&u&&b!=="get"&&b!=="head"&&(A=await h(D,v))!==0){let O=new o(g,{method:"POST",body:v,duplex:"half"}),z;if(ce.isFormData(v)&&(z=O.headers.get("content-type"))&&D.setContentType(z),O.body){const[H,Z]=bf(A,ri(_f(k)));v=$f(O.body,kf,H,Z)}}ce.isString(T)||(T=T?"include":"omit");const M=l&&"credentials"in o.prototype,I={...B,signal:E,method:b.toUpperCase(),headers:D.normalize().toJSON(),body:v,duplex:"half",credentials:M?T:void 0};S=l&&new o(g,I);let L=await(l?P(S,B):P(g,I));const te=d&&(C==="stream"||C==="response");if(d&&(w||te&&V)){const O={};["status","statusText","headers"].forEach(ie=>{O[ie]=L[ie]});const z=ce.toFiniteNumber(L.headers.get("content-length")),[H,Z]=w&&bf(z,ri(_f(w),!0))||[];L=new r($f(L.body,kf,H,()=>{Z&&Z(),V&&V()}),O)}C=C||"text";let ee=await f[ce.findKey(f,C)||"text"](L,m);return!te&&V&&V(),await new Promise((O,z)=>{Eg(O,z,{data:ee,headers:nn.from(L.headers),status:L.status,statusText:L.statusText,config:m,request:S})})}catch(M){throw V&&V(),M&&M.name==="TypeError"&&/Load failed|fetch/i.test(M.message)?Object.assign(new We("Network Error",We.ERR_NETWORK,m,S,M&&M.response),{cause:M.cause||M}):We.from(M,M&&M.code,m,S,M&&M.response)}}},VS=new Map,xg=e=>{let t=e&&e.env||{};const{fetch:o,Request:r,Response:a}=t,l=[r,a,o];let i=l.length,s=i,c,u,d=VS;for(;s--;)c=l[s],u=d.get(c),u===void 0&&d.set(c,u=s?new Map:BS(t)),d=u;return u};xg();const Wu={http:KC,xhr:SS,fetch:{get:xg}};ce.forEach(Wu,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const xf=e=>`- ${e}`,MS=e=>ce.isFunction(e)||e===null||e===!1;function LS(e,t){e=ce.isArray(e)?e:[e];const{length:o}=e;let r,a;const l={};for(let i=0;i<o;i++){r=e[i];let s;if(a=r,!MS(r)&&(a=Wu[(s=String(r)).toLowerCase()],a===void 0))throw new We(`Unknown adapter '${s}'`);if(a&&(ce.isFunction(a)||(a=a.get(t))))break;l[s||"#"+i]=a}if(!a){const i=Object.entries(l).map(([c,u])=>`adapter ${c} `+(u===!1?"is not supported by the environment":"is not available in the build"));let s=o?i.length>1?`since :
|
|
156
156
|
`+i.map(xf).join(`
|
|
157
157
|
`):" "+xf(i[0]):"as no adapter specified";throw new We("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return a}const Tg={getAdapter:LS,adapters:Wu};function Vs(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new sl(null,e)}function Tf(e){return Vs(e),e.headers=nn.from(e.headers),e.data=Bs.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Tg.getAdapter(e.adapter||il.adapter,e)(e).then(function(r){return Vs(e),r.data=Bs.call(e,e.transformResponse,r),r.headers=nn.from(r.headers),r},function(r){return kg(r)||(Vs(e),r&&r.response&&(r.response.data=Bs.call(e,e.transformResponse,r.response),r.response.headers=nn.from(r.response.headers))),Promise.reject(r)})}const Ng="1.13.6",Qi={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Qi[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Nf={};Qi.transitional=function(t,o,r){function a(l,i){return"[Axios v"+Ng+"] Transitional option '"+l+"'"+i+(r?". "+r:"")}return(l,i,s)=>{if(t===!1)throw new We(a(i," has been removed"+(o?" in "+o:"")),We.ERR_DEPRECATED);return o&&!Nf[i]&&(Nf[i]=!0,console.warn(a(i," has been deprecated since v"+o+" and will be removed in the near future"))),t?t(l,i,s):!0}};Qi.spelling=function(t){return(o,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function PS(e,t,o){if(typeof e!="object")throw new We("options must be an object",We.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const l=r[a],i=t[l];if(i){const s=e[l],c=s===void 0||i(s,l,e);if(c!==!0)throw new We("option "+l+" must be "+c,We.ERR_BAD_OPTION_VALUE);continue}if(o!==!0)throw new We("Unknown option "+l,We.ERR_BAD_OPTION)}}const Ol={assertOptions:PS,validators:Qi},yn=Ol.validators;let Jo=class{constructor(t){this.defaults=t||{},this.interceptors={request:new vf,response:new vf}}async request(t,o){try{return await this._request(t,o)}catch(r){if(r instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const l=a.stack?a.stack.replace(/^.+\n/,""):"";try{r.stack?l&&!String(r.stack).endsWith(l.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
158
|
-
`+l):r.stack=l}catch{}}throw r}}_request(t,o){typeof t=="string"?(o=o||{},o.url=t):o=t||{},o=nr(this.defaults,o);const{transitional:r,paramsSerializer:a,headers:l}=o;r!==void 0&&Ol.assertOptions(r,{silentJSONParsing:yn.transitional(yn.boolean),forcedJSONParsing:yn.transitional(yn.boolean),clarifyTimeoutError:yn.transitional(yn.boolean),legacyInterceptorReqResOrdering:yn.transitional(yn.boolean)},!1),a!=null&&(ce.isFunction(a)?o.paramsSerializer={serialize:a}:Ol.assertOptions(a,{encode:yn.function,serialize:yn.function},!0)),o.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?o.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:o.allowAbsoluteUrls=!0),Ol.assertOptions(o,{baseUrl:yn.spelling("baseURL"),withXsrfToken:yn.spelling("withXSRFToken")},!0),o.method=(o.method||this.defaults.method||"get").toLowerCase();let i=l&&ce.merge(l.common,l[o.method]);l&&ce.forEach(["delete","get","head","post","put","patch","common"],m=>{delete l[m]}),o.headers=nn.concat(i,l);const s=[];let c=!0;this.interceptors.request.forEach(function(g){if(typeof g.runWhen=="function"&&g.runWhen(o)===!1)return;c=c&&g.synchronous;const b=o.transitional||Hu;b&&b.legacyInterceptorReqResOrdering?s.unshift(g.fulfilled,g.rejected):s.push(g.fulfilled,g.rejected)});const u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let d,f=0,p;if(!c){const m=[Tf.bind(this),void 0];for(m.unshift(...s),m.push(...u),p=m.length,d=Promise.resolve(o);f<p;)d=d.then(m[f++],m[f++]);return d}p=s.length;let h=o;for(;f<p;){const m=s[f++],g=s[f++];try{h=m(h)}catch(b){g.call(this,b);break}}try{d=Tf.call(this,h)}catch(m){return Promise.reject(m)}for(f=0,p=u.length;f<p;)d=d.then(u[f++],u[f++]);return d}getUri(t){t=nr(this.defaults,t);const o=Cg(t.baseURL,t.url,t.allowAbsoluteUrls);return wg(o,t.params,t.paramsSerializer)}};ce.forEach(["delete","get","head","options"],function(t){Jo.prototype[t]=function(o,r){return this.request(nr(r||{},{method:t,url:o,data:(r||{}).data}))}});ce.forEach(["post","put","patch"],function(t){function o(r){return function(l,i,s){return this.request(nr(s||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:l,data:i}))}}Jo.prototype[t]=o(),Jo.prototype[t+"Form"]=o(!0)});let IS=class Dg{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let o;this.promise=new Promise(function(l){o=l});const r=this;this.promise.then(a=>{if(!r._listeners)return;let l=r._listeners.length;for(;l-- >0;)r._listeners[l](a);r._listeners=null}),this.promise.then=a=>{let l;const i=new Promise(s=>{r.subscribe(s),l=s}).then(a);return i.cancel=function(){r.unsubscribe(l)},i},t(function(l,i,s){r.reason||(r.reason=new sl(l,i,s),o(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const o=this._listeners.indexOf(t);o!==-1&&this._listeners.splice(o,1)}toAbortSignal(){const t=new AbortController,o=r=>{t.abort(r)};return this.subscribe(o),t.signal.unsubscribe=()=>this.unsubscribe(o),t.signal}static source(){let t;return{token:new Dg(function(a){t=a}),cancel:t}}};function OS(e){return function(o){return e.apply(null,o)}}function RS(e){return ce.isObject(e)&&e.isAxiosError===!0}const Lc={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Lc).forEach(([e,t])=>{Lc[t]=e});function Ag(e){const t=new Jo(e),o=ug(Jo.prototype.request,t);return ce.extend(o,Jo.prototype,t,{allOwnKeys:!0}),ce.extend(o,t,null,{allOwnKeys:!0}),o.create=function(a){return Ag(nr(e,a))},o}const wt=Ag(il);wt.Axios=Jo;wt.CanceledError=sl;wt.CancelToken=IS;wt.isCancel=kg;wt.VERSION=Ng;wt.toFormData=Zi;wt.AxiosError=We;wt.Cancel=wt.CanceledError;wt.all=function(t){return Promise.all(t)};wt.spread=OS;wt.isAxiosError=RS;wt.mergeConfig=nr;wt.AxiosHeaders=nn;wt.formToJSON=e=>$g(ce.isHTMLForm(e)?new FormData(e):e);wt.getAdapter=Tg.getAdapter;wt.HttpStatusCode=Lc;wt.default=wt;const{Axios:RO,AxiosError:FO,CanceledError:zO,isCancel:UO,CancelToken:HO,VERSION:jO,all:WO,Cancel:qO,isAxiosError:GO,spread:YO,toFormData:XO,AxiosHeaders:KO,HttpStatusCode:JO,formToJSON:ZO,getAdapter:QO,mergeConfig:eR}=wt;let vr=wt;function FS(e={}){e.baseURL!==void 0&&(vr=wt.create({baseURL:e.baseURL}))}const Ms={get:async e=>vr.get("/files",{params:{path_key:e}}),put:async(e,t)=>vr.put("/files",e,{params:{path_key:t}}),delete:async e=>vr.delete(`/files/${e}`,{params:{path_key:e}}),upload:async(e,t)=>{const o=new FormData;return o.append("file",e),o.append("upload",e),vr.post("/files/upload",o,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:t==null?void 0:t.onUploadProgress,params:{dir_path:t==null?void 0:t.dirPath,tags:t==null?void 0:t.tags}})},list:async e=>vr.get("/files/list",{params:{dir_path:e}})};function Bg(e={}){const t=e.namespace||"default",o=n.ref([]),r=n.ref([]),a=n.ref([]),l=n.computed(()=>{const f=r.value.map(p=>p.path_key);return[...a.value,...f]}),i=f=>URL.createObjectURL(f);function s(f){if(!f)return;let p=[];f instanceof File?p=[f]:f instanceof FileList?p=Array.from(f):Array.isArray(f)&&(p=f);const h=p.map(m=>({url:i(m),name:m.name,file:m,progress:0,namespace:t}));e.multiple?o.value.push(...h):o.value=h,e.onFileQueued&&h.length>0&&e.onFileQueued(h)}async function c(f){var p;if(typeof f=="string"){r.value=r.value.filter(m=>m.path_key!==f);const h=a.value.indexOf(f);h!==-1&&a.value.splice(h,1);try{await Ms.delete(f)}catch(m){console.error("Error deleting file:",m)}}else if(f){const h=f instanceof File?{name:f.name}:f,m=o.value.findIndex(g=>g.file.name===h.name&&g.namespace===t);m!==-1&&o.value.splice(m,1)}(p=e.onChange)==null||p.call(e)}async function u(){const f=o.value.filter(p=>p.namespace===t);for(const p of f){p.uploading=!0,e.multiple||a.value.splice(0,1);try{const{data:h}=await Ms.upload(p.file,{onUploadProgress:m=>{p.progress=m.loaded/m.total*100-1},dirPath:n.toValue(e.dirPath)});a.value.push(h.path_key)}catch(h){console.error("Error uploading file:",h)}}o.value=o.value.filter(p=>p.namespace!==t)}function d(f=!1){if(e.disabled)return;const p=document.createElement("input");p.type="file",p.multiple=!!e.multiple,p.accept=e.accept||"",p.onchange=h=>{s(h.target.files),f&&u()},p.click()}return n.onMounted(()=>{const f=n.toValue(e.dirPath);f&&Ms.list(f).then(p=>{const h=Array.isArray(p.data)?p.data:[p.data];r.value.push(...h)}).catch(p=>{console.error("Error loading files:",p)})}),{fileQueue:o,storageFiles:r,pk:a,pathKeys:l,fileToUrl:i,removeFile:c,flushQueue:u,addFile:s,browse:d,namespace:t}}const zS={class:"bagel-input"},US={key:0},HS={key:1,placeholder:"required",type:"text",required:"",class:"pixel"},jS={key:1,class:"flex align-items-center gap-1 p-05"},WS={class:"txt-gray txt-12"},qS={class:"m-05 flex opacity-8 z-99 gap-025"},GS={class:"flex gap-025 rounded pe-1 ps-05 py-025 -my-1"},YS={class:"ellipsis-1 word-break-all h-20 m-0 color-black txt16"},XS={key:2,class:"txt-gray txt-12"},KS={key:0,class:"bgl-multi-preview"},JS={class:"m-0"},ZS=["src"],QS={class:"no-margin multi-preview-txt"},e3={key:0,class:"progress"},t3={key:1,class:"bgl-single-preview"},n3={key:0,class:"h-100"},o3=["src"],r3={class:"p-1 flex column hover fileUploadPlaceHolder justify-content-center mb-05"},a3={class:"pretty balance user-select-none"},l3=n.defineComponent({__name:"UploadInput",props:{id:{},label:{},multiple:{type:Boolean},modelValue:{},width:{},height:{default:"215px"},dirPath:{},fill:{type:Boolean},oval:{type:Boolean},theme:{default:"dropzone"},accept:{default:"*"},required:{type:Boolean},disabled:{type:Boolean},baseURL:{},placeholder:{},noFilePlaceholder:{},btnPlaceholder:{},showIcon:{type:Boolean,default:!0},icon:{default:"upload_2"}},emits:["update:modelValue","addFileStart"],setup(e,{emit:t}){const o=e,r=t,{$t:a}=Vt(),{fileQueue:l,pathKeys:i,removeFile:s,flushQueue:c,addFile:u,browse:d,pk:f}=Bg({disabled:o.disabled,dirPath:o.dirPath,multiple:o.multiple,accept:o.accept,namespace:o.id||"upload",onFileQueued:async()=>{await c(),g()},onChange:g});n.watch(()=>o.modelValue,y=>f.value=y?[y].flat().filter(Boolean):[],{immediate:!0});const p=y=>ni.test(y),h=n.ref(!1);function m(y,_=!1){y.preventDefault(),y.stopPropagation(),o.disabled||(h.value=_)}function g(){o.multiple?r("update:modelValue",i.value):r("update:modelValue",i.value[0]||void 0)}async function b(y){var _;o.disabled||(y.preventDefault(),y.stopPropagation(),r("addFileStart"),u((_=y.dataTransfer)==null?void 0:_.files),h.value=!1)}function v(y){return!y||typeof y!="string"?"file":y.split("/").pop()||"file"}return(y,_)=>{const $=n.resolveDirective("tooltip"),w=n.resolveDirective("lightbox");return n.openBlock(),n.createElementBlock("div",zS,[e.label?(n.openBlock(),n.createElementBlock("label",US,n.toDisplayString(e.label),1)):n.createCommentVNode("",!0),e.required&&!n.unref(i).length?(n.openBlock(),n.createElementBlock("input",HS)):n.createCommentVNode("",!0),e.theme==="basic"?(n.openBlock(),n.createBlock(n.unref(en),{key:2,outline:"",class:"flex p-05 gap-1",onDragover:_[2]||(_[2]=k=>m(k,!0)),onDrop:b},{default:n.withCtx(()=>[!n.unref(i).length&&!n.unref(l).length?(n.openBlock(),n.createBlock(n.unref(ne),{key:0,class:"px-1-5",icon:"upload",outline:"",value:e.btnPlaceholder||n.unref(a)("upload.upload"),onClick:_[0]||(_[0]=k=>n.unref(d)())},null,8,["value"])):n.createCommentVNode("",!0),n.unref(l).length>0?(n.openBlock(),n.createElementBlock("div",jS,[n.createVNode(n.unref(Lo),{size:"20"}),n.createElementVNode("span",WS,n.toDisplayString(n.unref(a)("upload.uploading",{count:n.unref(l).length,plural:n.unref(l).length>1?"s":""})),1)])):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(i),k=>(n.openBlock(),n.createElementBlock("div",{key:k,class:"txt-gray txt-12 flex"},[n.createElementVNode("div",qS,[n.withDirectives(n.createVNode(n.unref(ne),{color:"gray",thin:"",icon:"delete",onClick:C=>n.unref(s)(k)},null,8,["onClick"]),[[$,"Delete"]]),n.withDirectives(n.createVNode(n.unref(ne),{color:"gray",thin:"",icon:"autorenew",onClick:_[1]||(_[1]=C=>n.unref(d)())},null,512),[[$,"Replace"]]),n.createVNode(n.unref(ne),{icon:"download",color:"gray",thin:"",href:n.unref(Hn)(k),download:v(k)},null,8,["href","download"]),n.createElementVNode("div",GS,[n.createVNode(n.unref(Ne),{icon:"draft",size:1.5}),n.withDirectives((n.openBlock(),n.createElementBlock("p",YS,[n.createTextVNode(n.toDisplayString(v(k)),1)])),[[w,{src:n.unref(Hn)(k),download:!0}]])])])]))),128)),!n.unref(i).length&&!n.unref(l).length?(n.openBlock(),n.createElementBlock("span",XS,n.toDisplayString(e.noFilePlaceholder||n.unref(a)("upload.noFile")),1)):n.createCommentVNode("",!0)]),_:1})):(n.openBlock(),n.createElementBlock("div",{key:3,class:n.normalizeClass(["fileUploadWrap",{fileDropZone:!n.unref(i).length&&!n.unref(l).length,dragover:h.value,"bgl_oval-upload":e.oval}]),style:n.normalizeStyle({width:e.width,height:e.height}),onClick:_[4]||(_[4]=k=>n.unref(d)()),onDragover:_[5]||(_[5]=k=>m(k,!0)),onDrop:b,onDragleave:_[6]||(_[6]=k=>m(k))},[n.renderSlot(y.$slots,"files",{files:n.unref(i),fileQueue:n.unref(l)},()=>[e.multiple?(n.openBlock(),n.createElementBlock("div",KS,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(i),k=>n.withDirectives((n.openBlock(),n.createElementBlock("div",{key:k,class:n.normalizeClass(["multi-image-item-preview",{"bgl_fill-image":e.fill}])},[p(k)?(n.openBlock(),n.createBlock(n.unref(Va),{key:0,pathKey:k,class:"multi-preview"},null,8,["pathKey"])):(n.openBlock(),n.createBlock(n.unref(Ne),{key:1,icon:"description",class:"multi-preview"})),n.createElementVNode("p",JS,n.toDisplayString(v(k)),1),n.createVNode(n.unref(ne),{thin:"",flat:"",icon:"delete",color:"red",onClick:C=>n.unref(s)(k)},null,8,["onClick"])],2)),[[w,{src:n.unref(Hn)(k),download:!0}]])),128)),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(l),k=>(n.openBlock(),n.createElementBlock("div",{key:k.name,class:n.normalizeClass(["multi-image-item-preview",{"bgl_fill-image":e.fill}])},[p(k.file.type)?(n.openBlock(),n.createElementBlock("img",{key:0,class:"multi-preview",src:k.url,alt:""},null,8,ZS)):(n.openBlock(),n.createBlock(n.unref(Ne),{key:1,icon:"description",class:"multi-preview"})),n.createElementVNode("p",QS,n.toDisplayString(k.name),1),n.createElementVNode("div",{class:n.normalizeClass(["pie",{complete:k.progress===100}]),style:n.normalizeStyle([{"--p":k.progress},{"--b":"2px"}])},[k.progress<100?(n.openBlock(),n.createElementBlock("span",e3,n.toDisplayString(k.progress.toFixed(0)),1)):n.createCommentVNode("",!0),n.createVNode(n.unref(Ne),{class:"success",icon:"check_circle"})],6)],2))),128))])):n.unref(i).length>0||n.unref(l).length>0?(n.openBlock(),n.createElementBlock("div",t3,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(i),k=>(n.openBlock(),n.createElementBlock("div",{key:k,class:n.normalizeClass(["single-image-item-preview",{"bgl_fill-image":e.fill}])},[n.createElementVNode("div",{class:n.normalizeClass(["flex opacity-8 z-99 gap-025 absolute top-0 start-0",{"mx-auto end-0 mt-1 justify-content-center":e.oval,"m-05":!e.oval}])},[n.withDirectives(n.createVNode(n.unref(ne),{color:"white",frame:"",thin:"",icon:"delete",onClick:C=>n.unref(s)(k)},null,8,["onClick"]),[[$,"Delete"]]),n.withDirectives(n.createVNode(n.unref(ne),{color:"white",frame:"",thin:"",icon:"autorenew",onClick:_[3]||(_[3]=C=>n.unref(d)())},null,512),[[$,"Replace"]]),n.withDirectives(n.createVNode(n.unref(ne),{color:"white",frame:"",thin:"",icon:"download",href:n.unref(Hn)(k),download:v(k)},null,8,["href","download"]),[[$,"Download"]])],2),p(k)?(n.openBlock(),n.createElementBlock("div",n3,[n.withDirectives(n.createVNode(n.unref(Va),{class:"single-preview",pathKey:k,alt:""},null,8,["pathKey"]),[[w,{src:n.unref(Hn)(k),download:!0}]])])):n.withDirectives((n.openBlock(),n.createBlock(n.unref(Ne),{key:1,size:4,weight:"2",icon:"description",class:"color-primary w-100"},null,512)),[[w,{src:n.unref(Hn)(k),download:!0}]])],2))),128)),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(l),k=>(n.openBlock(),n.createElementBlock("div",{key:k.name,class:n.normalizeClass(["single-image-item-preview",{"bgl_fill-image":e.fill}])},[n.createVNode(n.unref(Lo),{type:"bar",progress:k.progress,class:"absolute bottom-05 end start w-100px mx-auto rounded overflow-hidden"},null,8,["progress"]),p(k.file.type)?(n.openBlock(),n.createElementBlock("img",{key:0,class:"single-preview opacity-5",src:k.url,alt:""},null,8,o3)):n.createCommentVNode("",!0)],2))),128))])):n.createCommentVNode("",!0)],!0),!n.unref(i).length&&!n.unref(l).length||e.multiple?n.renderSlot(y.$slots,"placeholder",{key:0,files:n.unref(i),fileQueue:n.unref(l),browse:n.unref(d)},()=>[n.createElementVNode("p",r3,[e.showIcon?(n.openBlock(),n.createBlock(n.unref(Ne),{key:0,name:e.icon,size:"2.5",class:"user-select-none"},null,8,["name"])):n.createCommentVNode("",!0),n.createElementVNode("span",a3,n.toDisplayString(n.unref(Ge)(e.placeholder)||n.unref(a)("upload.dropPlaceholder")),1)])],!0):n.createCommentVNode("",!0)],38))])}}}),Da=Ve(l3,[["__scopeId","data-v-104bea2f"]]),i3=["h1","h2","h3","h4","h5","h6","separator","p","blockquote","orderedList","unorderedList","separator","bold","italic","underline","separator","alignMenu","ltrDirection","rtlDirection","separator","insertTable","separator","link","image","video","embed","clear","separator","undo","redo","separator","splitView","fullScreen"],s3=[{name:"headingsMenu",label:"Headings",icon:"title"},{name:"mediaMenu",label:"Media",icon:"perm_media"},{name:"alignMenu",label:"Alignment",icon:"format_align_left"},{name:"h1",label:"Heading 1",icon:"format_h1"},{name:"h2",label:"Heading 2",icon:"format_h2"},{name:"h3",label:"Heading 3",icon:"format_h3"},{name:"h4",label:"Heading 4",icon:"format_h4"},{name:"h5",label:"Heading 5",icon:"format_h5"},{name:"h6",label:"Heading 6",icon:"format_h6"},{name:"p",label:"Paragraph",icon:"format_paragraph"},{name:"blockquote",label:"Blockquote",icon:"format_quote"},{name:"bold",label:"Bold",icon:"format_bold"},{name:"italic",label:"Italic",icon:"format_italic"},{name:"underline",label:"Underline",icon:"format_underlined"},{name:"orderedList",label:"Ordered List",icon:"format_list_numbered"},{name:"unorderedList",label:"Unordered List",icon:"format_list_bulleted"},{name:"link",label:"Link",icon:"add_link"},{name:"image",label:"Image",icon:"add_photo_alternate"},{name:"video",label:"Video",icon:"play_circle"},{name:"embed",label:"Embed",icon:"media_link"},{name:"splitView",label:"Split View",icon:"code"},{name:"clear",label:"Clear Formatting",icon:"format_clear"},{name:"alignLeft",label:"Align Left",icon:"format_align_left"},{name:"alignCenter",label:"Align Center",icon:"format_align_center"},{name:"alignRight",label:"Align Right",icon:"format_align_right"},{name:"alignJustify",label:"Align Justify",icon:"format_align_justify"},{name:"tableAlignLeft",label:"Table Align Left",icon:"format_align_left"},{name:"tableAlignCenter",label:"Table Align Center",icon:"format_align_center"},{name:"tableAlignRight",label:"Table Align Right",icon:"format_align_right"},{name:"tableAlignJustify",label:"Table Align Justify",icon:"format_align_justify"},{name:"indent",label:"Indent",icon:"format_indent_increase"},{name:"outdent",label:"Outdent",icon:"format_indent_decrease"},{name:"fontColor",label:"Font Color",icon:"format_color_text"},{name:"bgColor",label:"Background Color",icon:"format_color_fill"},{name:"insertTable",label:"Insert Table",icon:"table"},{name:"deleteTable",label:"Delete Table",icon:"delete_sweep"},{name:"mergeCells",label:"Merge Cells",icon:"table_chart"},{name:"splitCells",label:"Split Cells",icon:"dashboard"},{name:"addRowBefore",label:"Insert Row Above",icon:"add_box"},{name:"addRowAfter",label:"Insert Row Below",icon:"vertical_align_bottom"},{name:"deleteRow",label:"Delete Row",icon:"remove"},{name:"insertColumnLeft",label:"Insert Column Left",icon:"format_indent_decrease"},{name:"insertColumnRight",label:"Insert Column Right",icon:"format_indent_increase"},{name:"deleteColumn",label:"Delete Column",icon:"view_week"},{name:"separator"},{name:"undo",label:"Undo",icon:"undo"},{name:"redo",label:"Redo",icon:"redo"},{name:"separator"},{name:"fullScreen",label:"Full Screen",icon:"fullscreen",class:"ms-auto"},{name:"textDirection",label:"Text Direction (RTL/LTR)",icon:"format_textdirection_r_to_l"},{name:"ltrDirection",label:"Left to Right",icon:"format_textdirection_l_to_r"},{name:"rtlDirection",label:"Right to Left",icon:"format_textdirection_r_to_l"}],c3={class:"table-grid-selector p-075"},u3={class:"txt-center mb-075"},d3={style:{"font-size":"14px","font-weight":"500",color:"#333","margin-bottom":"4px"}},f3=["onFocus","onMouseenter","onClick"],m3={class:"border-top pt-075"},p3=10,h3=10,g3=n.defineComponent({__name:"TableGridSelector",emits:["insert","openAdvanced"],setup(e,{emit:t}){const o=t,r=n.ref(0),a=n.ref(0),l=n.computed(()=>{const f=[];for(let p=1;p<=p3;p++)for(let h=1;h<=h3;h++)f.push({row:p,col:h,isActive:p<=r.value&&h<=a.value});return f}),i=n.computed(()=>r.value===0||a.value===0?"Select table size":`${r.value} × ${a.value}`);function s(f,p){r.value=f,a.value=p}function c(f,p,h){o("insert",f,p),h()}function u(f){o("openAdvanced"),f()}function d(){r.value=0,a.value=0}return(f,p)=>(n.openBlock(),n.createBlock(n.unref(on),{placement:"bottom-start",thin:"",flat:"",icon:"table"},{default:n.withCtx(({hide:h})=>[n.createElementVNode("div",c3,[n.createElementVNode("div",u3,[n.createElementVNode("div",d3,n.toDisplayString(i.value),1),p[0]||(p[0]=n.createElementVNode("div",{style:{"font-size":"12px",color:"#666"}}," Hover to select size ",-1))]),n.createElementVNode("div",{style:{display:"grid","grid-template-columns":"repeat(10, 20px)","grid-template-rows":"repeat(10, 20px)",gap:"2px","margin-bottom":"12px",direction:"ltr"},onMouseleave:d,onBlur:d},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value,m=>(n.openBlock(),n.createElementBlock("div",{key:`${m.row}-${m.col}`,tabindex:"0",style:n.normalizeStyle({width:"20px",height:"20px",border:"1px solid #ddd",backgroundColor:m.isActive?"var(--bgl-primary)":"#fff",cursor:"pointer",borderRadius:"2px",transition:"background-color 0.1s ease"}),onFocus:g=>s(m),onMouseenter:g=>s(m.row,m.col),onClick:g=>c(m.row,m.col,h)},null,44,f3))),128))],32),n.createElementVNode("div",m3,[n.createVNode(n.unref(ne),{value:"Advanced Settings",icon:"settings",class:"bg-gray-30 color-black",onClick:m=>u(h)},null,8,["onClick"])])])]),_:1}))}}),v3={class:"toolbar flex gap-025 pb-05 flex-wrap",role:"toolbar",style:{position:"relative"}},y3={class:"flex flex-column p-025"},b3=n.defineComponent({__name:"EditorToolbar",props:{config:{default:()=>i3},selectedStyles:{},hideImages:{type:Boolean,default:!1},hideVideos:{type:Boolean,default:!1},hideEmbeds:{type:Boolean,default:!1},hideTables:{type:Boolean,default:!1},hideAlignment:{type:Boolean,default:!1},hideDirections:{type:Boolean,default:!1},hideH5H6:{type:Boolean,default:!1},hide:{default:()=>[]}},emits:["action"],setup(e,{emit:t}){const o=t;function r(){return e.selectedStyles.has("alignLeft")?"format_align_left":e.selectedStyles.has("alignCenter")?"format_align_center":e.selectedStyles.has("alignRight")?"format_align_right":e.selectedStyles.has("alignJustify")?"format_align_justify":"format_align_left"}function a(){return e.selectedStyles.has("alignLeft")||e.selectedStyles.has("alignCenter")||e.selectedStyles.has("alignRight")||e.selectedStyles.has("alignJustify")}function l(f){if(e.hide.includes(f))return!0;const p={image:["insertImage","image"],video:["insertVideo","video"],embed:["insertEmbed","embed"],table:["insertTable"],direction:["textDirection"],fullScreen:["fullScreen"],ul:["unorderedList"],ol:["orderedList"],splitView:["splitView"],p:["p"],align:["alignMenu"],alignment:["alignMenu"]};for(const[m,g]of Object.entries(p))if(e.hide.includes(m)&&g.includes(f))return!0;return{insertImage:e.hideImages,insertVideo:e.hideVideos,insertEmbed:e.hideEmbeds,insertTable:e.hideTables,alignMenu:e.hideAlignment,textDirection:e.hideDirections,h5:e.hideH5H6,h6:e.hideH5H6}[f]||!1}const i=f=>s3.find(p=>p.name===f);function s(f){const p=e.config.map(i).filter(Boolean);let h=-1;for(let g=f-1;g>=0;g--){const b=p[g];if(b&&b.name!=="separator"&&!l(b.name)){h=g;break}}let m=-1;for(let g=f+1;g<p.length;g++){const b=p[g];if(b&&b.name!=="separator"&&!l(b.name)){m=g;break}}if(h===-1||m===-1)return!1;for(let g=h+1;g<f;g++){const b=p[g];if(b&&b.name==="separator")return!1}return!0}function c(f,p){console.log("EditorToolbar: runAction called",{name:f,value:p}),o("action",f,p)}function u(f,p){const h=document.createElement("table");h.style.width="100%",h.style.borderCollapse="collapse",h.style.marginBottom="1rem";const m=document.createElement("thead"),g=m.insertRow();for(let v=0;v<p;v++){const y=document.createElement("th");y.innerHTML=`Header ${v+1}`,y.style.padding="8px",y.style.border="1px solid #ddd",y.style.backgroundColor="#f4f4f4",g.appendChild(y)}h.appendChild(m);const b=document.createElement("tbody");for(let v=0;v<f;v++){const y=b.insertRow();for(let _=0;_<p;_++){const $=y.insertCell();$.innerHTML=" ",$.style.padding="8px",$.style.border="1px solid #ddd"}}h.appendChild(b),o("action","insertTable",h.outerHTML)}function d(){o("action","insertTable")}return(f,p)=>{const h=n.resolveDirective("tooltip");return n.openBlock(),n.createElementBlock("div",v3,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.config.map(i).filter(Boolean),(m,g)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:g},[m.name==="insertTable"&&!l("insertTable")?(n.openBlock(),n.createBlock(g3,{key:0,onInsert:u,onOpenAdvanced:d})):m.name==="insertImage"&&!l("insertImage")?n.withDirectives((n.openBlock(),n.createBlock(n.unref(ne),{key:1,icon:m.icon,thin:"",flat:"","aria-label":m.name,class:n.normalizeClass([[m.class,{active:e.selectedStyles.has(m.name)}],""]),tabindex:"-1",onClick:b=>c(m.name)},null,8,["icon","aria-label","class","onClick"])),[[h,m.label]]):m.name==="insertVideo"&&!l("insertVideo")?n.withDirectives((n.openBlock(),n.createBlock(n.unref(ne),{key:2,icon:m.icon,thin:"",flat:"","aria-label":m.name,class:n.normalizeClass([[m.class,{active:e.selectedStyles.has(m.name)}],""]),tabindex:"-1",onClick:b=>c(m.name)},null,8,["icon","aria-label","class","onClick"])),[[h,m.label]]):m.name==="insertEmbed"&&!l("insertEmbed")?n.withDirectives((n.openBlock(),n.createBlock(n.unref(ne),{key:3,icon:m.icon,thin:"",flat:"","aria-label":m.name,class:n.normalizeClass([[m.class,{active:e.selectedStyles.has(m.name)}],""]),tabindex:"-1",onClick:b=>c(m.name)},null,8,["icon","aria-label","class","onClick"])),[[h,m.label]]):m.name==="alignMenu"&&!l("alignMenu")?(n.openBlock(),n.createBlock(n.unref(on),{key:4,placement:"bottom-start",thin:"",flat:"",icon:r(),class:n.normalizeClass({"alignment-active":a()})},{default:n.withCtx(({hide:b})=>[n.createElementVNode("div",y3,[n.createVNode(n.unref(ne),{thin:"",flat:"",icon:"format_align_left",class:n.normalizeClass({active:e.selectedStyles.has("alignLeft")}),onClick:v=>{c("alignLeft"),b()}},null,8,["class","onClick"]),n.createVNode(n.unref(ne),{thin:"",flat:"",icon:"format_align_center",class:n.normalizeClass({active:e.selectedStyles.has("alignCenter")}),onClick:v=>{c("alignCenter"),b()}},null,8,["class","onClick"]),n.createVNode(n.unref(ne),{thin:"",flat:"",icon:"format_align_right",class:n.normalizeClass({active:e.selectedStyles.has("alignRight")}),onClick:v=>{c("alignRight"),b()}},null,8,["class","onClick"]),n.createVNode(n.unref(ne),{thin:"",flat:"",icon:"format_align_justify",class:n.normalizeClass({active:e.selectedStyles.has("alignJustify")}),onClick:v=>{c("alignJustify"),b()}},null,8,["class","onClick"])])]),_:1},8,["icon","class"])):m.name==="textDirection"&&!l("textDirection")?n.withDirectives((n.openBlock(),n.createBlock(n.unref(ne),{key:5,icon:e.selectedStyles.has("textDirection")?"format_textdirection_l_to_r":"format_textdirection_r_to_l",thin:"",flat:"","aria-label":m.name,class:n.normalizeClass([[m.class,{active:e.selectedStyles.has("textDirection")}],""]),tabindex:"-1",onClick:b=>c(m.name)},null,8,["icon","aria-label","class","onClick"])),[[h,m.label]]):(m.name==="h5"||m.name==="h6")&&!l(m.name)?n.withDirectives((n.openBlock(),n.createBlock(n.unref(ne),{key:6,icon:m.icon,thin:"",flat:"","aria-label":m.name,class:n.normalizeClass([[m.class,{active:e.selectedStyles.has(m.name)}],""]),tabindex:"-1",onClick:b=>c(m.name)},null,8,["icon","aria-label","class","onClick"])),[[h,m.label]]):m.name!=="separator"&&m.name!=="insertTable"&&m.name!=="insertImage"&&m.name!=="insertVideo"&&m.name!=="insertEmbed"&&m.name!=="alignMenu"&&m.name!=="textDirection"&&m.name!=="h5"&&m.name!=="h6"&&!l(m.name)?n.withDirectives((n.openBlock(),n.createBlock(n.unref(ne),{key:7,icon:m.icon,thin:"",flat:"","aria-label":m.name,class:n.normalizeClass([[m.class,{active:e.selectedStyles.has(m.name)}],""]),tabindex:"-1",onClick:b=>c(m.name)},null,8,["icon","aria-label","class","onClick"])),[[h,m.label]]):m.name==="separator"&&s(g)?(n.openBlock(),n.createElementBlock("span",{key:`separator-${g}`,class:"opacity-2 mb-025"},"|")):n.createCommentVNode("",!0)],64))),128))])}}}),_3=Ve(b3,[["__scopeId","data-v-a3d072e5"]]);function w3(e,t){const{doc:o}=t;if(!o){console.log("No doc found");return}const r=o.getSelection();if(!r||!r.rangeCount){console.log("No selection found");return}let a=r.getRangeAt(0);if(a.collapsed){if(!$3(o,a)){console.log("Failed to select word at cursor");const{showTooltipMessage:u}=t;u?u("To add a link, please select text first or place cursor within a word"):alert("To add a link, please select text first or place the cursor within a word you want to turn into a link.");return}a=r.getRangeAt(0)}const l=a.commonAncestorContainer,i=l.nodeType===Node.TEXT_NODE?l.parentElement:l,s=i==null?void 0:i.closest("a");if(t.openLinkModal){t.openLinkModal(r,a,s);return}console.warn("Link modal not available - openLinkModal function not found"),alert("Link functionality requires proper modal setup")}function $3(e,t){if(!t.collapsed)return!0;let o=t.startContainer,r=t.startOffset;if(o.nodeType!==Node.TEXT_NODE){const c=o;if(c.childNodes.length>0&&r<c.childNodes.length){const u=c.childNodes[r];if(u.nodeType===Node.TEXT_NODE)o=u,r=0;else return!1}else return!1}const a=o.textContent||"";if(!a)return!1;let l=r,i=r;const s=/[\u0590-\u05FF\u0600-\u06FF\w]/;for(;l>0&&s.test(a[l-1]);)l--;for(;i<a.length&&s.test(a[i]);)i++;if(l<i){t.setStart(o,l),t.setEnd(o,i);const c=e.getSelection();return c&&(c.removeAllRanges(),c.addRange(t)),!0}return!1}function Df(e,t,o){if(!o.doc)return;const r=o.doc.createElement("table");r.style.width="100%",r.style.borderCollapse="collapse",r.style.marginBottom="1rem";const a=o.doc.createElement("thead"),l=a.insertRow();for(let c=0;c<t;c++){const u=o.doc.createElement("th");u.innerHTML=`Header ${c+1}`,u.style.padding="8px",u.style.border="1px solid var(--border-color, #ddd)",u.style.backgroundColor="var(--bgl-gray-light, #f4f4f4)",l.appendChild(u)}r.appendChild(a);const i=o.doc.createElement("tbody");for(let c=0;c<e;c++){const u=i.insertRow();for(let d=0;d<t;d++){const f=u.insertCell();f.innerHTML=" ",f.style.padding="8px",f.style.border="1px solid var(--border-color, #ddd)"}}r.appendChild(i);const{range:s}=o;if(s){if(s.insertNode(r),o.doc.getSelection()){const c=r.querySelector("td");if(c){s.selectNodeContents(c),s.collapse(!0);const u=o.doc.getSelection();u&&(u.removeAllRanges(),u.addRange(s))}}}else o.doc.body.appendChild(r);o.content=o.doc.body.innerHTML}function k3(e,t){var l;const o=Array.from(e.cloneContents().querySelectorAll("td"));if(o.length<2)return;const r=(l=e.startContainer.parentElement)==null?void 0:l.closest("td");if(!r)return;r.colSpan=o.length,r.innerHTML=o.map(i=>i.innerHTML).join(" "),o.slice(1).forEach(i=>{const s=t.getElementById(i.id);s==null||s.remove()});const a=t.editorState;a&&(a.content=t.body.innerHTML)}function E3(e,t){var l;const o=(l=e.startContainer.parentElement)==null?void 0:l.closest("td");if(!o||!o.colSpan||o.colSpan===1)return;const r=new Array(o.colSpan-1).fill(0).map(()=>{const i=t.createElement("td");return i.style.border="1px solid var(--border-color)",i.style.padding="8px",i.innerHTML=" ",i});o.colSpan=1,o.insertAdjacentElement("afterend",r[0]),r.slice(1).forEach(i=>{r[0].insertAdjacentElement("afterend",i)});const a=t.editorState;a&&(a.content=t.body.innerHTML)}function Af(e,t,o){var c;const r=(c=t.startContainer.parentElement)==null?void 0:c.closest("td");if(!r)return;const a=r.parentElement,l=a==null?void 0:a.parentElement;if(!a||!l)return;const i=a.cloneNode(!0);Array.from(i.cells).forEach(u=>u.innerHTML=" "),a.insertAdjacentElement(e==="before"?"beforebegin":"afterend",i);const s=o.editorState;s&&(s.content=o.body.innerHTML)}function C3(e){var l;const t=(l=e.startContainer.parentElement)==null?void 0:l.closest("td");if(!t)return;const o=t.parentElement;if(!o)return;const r=o.ownerDocument;o.remove();const a=r.editorState;a&&(a.content=r.body.innerHTML)}function S3(e){var l;const t=(l=e.startContainer.parentElement)==null?void 0:l.closest("td");if(!t)return;const o=t.closest("table");if(!o)return;const r=o.ownerDocument;o.remove();const a=r.editorState;a&&(a.content=r.body.innerHTML)}function Bf(e,t){var s;const o=(s=t.startContainer.parentElement)==null?void 0:s.closest("td");if(!o)return;const r=o.closest("table");if(!r)return;const a=o.cellIndex,{rows:l}=r;for(let c=0;c<l.length;c++){const u=l[c].insertCell(e==="after"?a+1:a);u.innerHTML=" ",u.style.border="1px solid var(--border-color)",u.style.padding="8px"}const i=r.ownerDocument.editorState;i&&(i.content=r.ownerDocument.body.innerHTML)}function x3(e){var s;const t=(s=e.startContainer.parentElement)==null?void 0:s.closest("td");if(!t)return;const o=t.closest("table");if(!o)return;const r=t.cellIndex,{rows:a}=o,l=o.ownerDocument;for(let c=0;c<a.length;c++)a[c].deleteCell(r);a[0].cells.length===0&&o.remove();const i=l.editorState;i&&(i.content=l.body.innerHTML)}function T3(e,t){var s;const o=(s=e.startContainer.parentElement)==null?void 0:s.closest("td");if(!o)return;const r=o.closest("table");if(!r)return;const a=o.cellIndex,{rows:l}=r;for(let c=0;c<l.length;c++){const u=l[c].cells[a];u&&(u.style.textAlign=t)}const i=r.ownerDocument.editorState;i&&(i.content=r.ownerDocument.body.innerHTML)}function ct(e){if(!e.doc)return null;const t=e.doc.getSelection();if(!t||!t.rangeCount)return null;const o=t.getRangeAt(0);return{selection:t,range:o}}function Ls(e,t,o){if(!t.collapsed)return!1;let r=t.startContainer,a=t.startOffset;if(r.nodeType!==Node.TEXT_NODE){const f=r;if(f.childNodes.length>0&&a<f.childNodes.length){const p=f.childNodes[a];if(p.nodeType===Node.TEXT_NODE)r=p,a=0;else return!1}else return!1}const{parentElement:l}=r,i=l==null?void 0:l.closest(o.toLowerCase());if(i)try{const f=i.parentNode;if(f){for(;i.firstChild;)f.insertBefore(i.firstChild,i);f.removeChild(i);const p=e.createRange();p.setStart(r,a),p.collapse(!0);const h=e.getSelection();return h&&(h.removeAllRanges(),h.addRange(p)),!0}}catch(f){return console.error("Error removing formatting from word:",f),!1}const s=r.textContent||"";if(!s)return!1;let c=a,u=a;const d=/[\u0590-\u05FF\u0600-\u06FF\w]/;for(a>0&&d.test(s[a-1])&&(a>=s.length||!d.test(s[a]))&&(c=a-1,u=a-1);c>0&&d.test(s[c-1]);)c--;for(;u<s.length&&d.test(s[u]);)u++;if(c<u&&u>c)try{const f=s.substring(0,c),p=s.substring(c,u),h=s.substring(u),m=e.createElement(o);m.textContent=p;const g=r.parentNode;if(g){if(f){const y=e.createTextNode(f);g.insertBefore(y,r)}if(g.insertBefore(m,r),h){const y=e.createTextNode(h);g.insertBefore(y,r)}g.removeChild(r);const b=e.createRange();b.setStartAfter(m),b.collapse(!0);const v=e.getSelection();return v&&(v.removeAllRanges(),v.addRange(b)),!0}}catch(f){console.error("Error applying formatting to word:",f)}return!1}function N3(e){if(!e.doc)return;e.content=e.doc.body.innerHTML;const t=e.doc.getSelection();t&&t.rangeCount>0&&(e.selection=t,e.range=t.getRangeAt(0).cloneRange(),e.rangeCount=t.rangeCount)}function ra(e){let t=e.nodeType===Node.TEXT_NODE?e.parentElement:e;for(;t;){if(t.matches&&t.matches("p,h1,h2,h3,h4,h5,h6,blockquote,li,div"))return t;t=t.parentElement}return null}function Qe(e,t,o){return{name:e,execute:(r,a)=>{r.doc&&(t(r,a),N3(r))},isActive:o}}function D3(e){const t={undo:Qe("Undo",()=>{if(e.undoStack.length>0&&e.doc){const p=e.undoStack.pop();p!==void 0&&(e.redoStack.push(e.content),e.content=p,e.doc.body.innerHTML=p)}}),redo:Qe("Redo",()=>{if(e.redoStack.length>0&&e.doc){const p=e.redoStack.pop();p!==void 0&&(e.undoStack.push(e.content),e.content=p,e.doc.body.innerHTML=p)}})},o={bold:Qe("Bold",p=>{const h=ct(p);if(!h)return;let{range:m,selection:g}=h;if(m.collapsed)return Ls(p.doc,m,"b"),void 0;const b=m.commonAncestorContainer,v=b.nodeType===Node.TEXT_NODE?b.parentElement:b,y=v==null?void 0:v.closest("b, strong");if(y)try{const _=y.parentNode;for(;y.firstChild;)_==null||_.insertBefore(y.firstChild,y);_==null||_.removeChild(y),g.removeAllRanges(),g.addRange(m)}catch(_){console.error("Error removing bold:",_)}else try{const _=p.doc.createElement("b");try{m.surroundContents(_)}catch{const $=m.extractContents();_.appendChild($),m.insertNode(_)}m.selectNodeContents(_),g.removeAllRanges(),g.addRange(m)}catch(_){console.error("Error applying bold:",_)}},p=>{const h=ct(p);if(!h)return!1;const m=h.range.commonAncestorContainer,g=m.nodeType===Node.TEXT_NODE?m.parentElement:m;return!!(g!=null&&g.closest("b, strong"))}),italic:Qe("Italic",p=>{const h=ct(p);if(!h)return;let{range:m,selection:g}=h;if(m.collapsed)return Ls(p.doc,m,"i"),void 0;const b=m.commonAncestorContainer,v=b.nodeType===Node.TEXT_NODE?b.parentElement:b,y=v==null?void 0:v.closest("i, em");if(y)try{const _=y.parentNode;for(;y.firstChild;)_==null||_.insertBefore(y.firstChild,y);_==null||_.removeChild(y),g.removeAllRanges(),g.addRange(m)}catch(_){console.error("Error removing italic:",_)}else try{const _=p.doc.createElement("i");try{m.surroundContents(_)}catch{const $=m.extractContents();_.appendChild($),m.insertNode(_)}m.selectNodeContents(_),g.removeAllRanges(),g.addRange(m)}catch(_){console.error("Error applying italic:",_)}},p=>{const h=ct(p);if(!h)return!1;const m=h.range.commonAncestorContainer,g=m.nodeType===Node.TEXT_NODE?m.parentElement:m;return!!(g!=null&&g.closest("i, em"))}),underline:Qe("Underline",p=>{const h=ct(p);if(!h)return;let{range:m,selection:g}=h;if(m.collapsed)return Ls(p.doc,m,"u"),void 0;const b=m.commonAncestorContainer,v=b.nodeType===Node.TEXT_NODE?b.parentElement:b,y=v==null?void 0:v.closest("u");if(y)try{const _=y.parentNode;for(;y.firstChild;)_==null||_.insertBefore(y.firstChild,y);_==null||_.removeChild(y),g.removeAllRanges(),g.addRange(m)}catch(_){console.error("Error removing underline:",_)}else try{const _=p.doc.createElement("u");try{m.surroundContents(_)}catch{const $=m.extractContents();_.appendChild($),m.insertNode(_)}m.selectNodeContents(_),g.removeAllRanges(),g.addRange(m)}catch(_){console.error("Error applying underline:",_)}},p=>{const h=ct(p);if(!h)return!1;const m=h.range.commonAncestorContainer,g=m.nodeType===Node.TEXT_NODE?m.parentElement:m;return!!(g!=null&&g.closest("u"))}),link:Qe("Link",p=>{const{openLinkModal:h}=p;h&&w3(h,p)},p=>{const h=ct(p);if(!h)return!1;const m=h.range.commonAncestorContainer,g=m.nodeType===Node.TEXT_NODE?m.parentElement:m;return!!(g!=null&&g.closest("a"))})},r=["h1","h2","h3","h4","h5","h6"].reduce((p,h)=>({...p,[h]:Qe(`Heading ${h}`,m=>{var B,P,E,S;const g=ct(m);if(!g)return;const{range:b,selection:v}=g,y=ra(b.commonAncestorContainer);if(!y)return;const{startContainer:_}=b,{endContainer:$}=b,{startOffset:w}=b,{endOffset:k}=b,C=b.collapsed,D=y.tagName.toLowerCase()===h.toLowerCase(),T=D?"p":h;try{const V=m.doc.createElement(T);for(;y.firstChild;)V.appendChild(y.firstChild);(B=y.parentNode)==null||B.replaceChild(V,y);try{const A=m.doc.createRange(),M=(te,ee,O)=>{if(te===ee)return O;if(te.nodeType===Node.TEXT_NODE){const z=m.doc.createTreeWalker(O,NodeFilter.SHOW_TEXT,null);let H=0;const Z=m.doc.createTreeWalker(ee,NodeFilter.SHOW_TEXT,null);let ie=Z.nextNode();for(;ie&&ie!==te;)H++,ie=Z.nextNode();let pe=z.nextNode(),he=0;for(;pe&&he<H;)he++,pe=z.nextNode();return pe}return O.firstChild},I=M(_,y,V),L=M($,y,V);if(I&&L){if(I.nodeType===Node.TEXT_NODE){const te=Math.min(w,((P=I.textContent)==null?void 0:P.length)||0);A.setStart(I,te)}else A.setStart(I,0);if(C)A.collapse(!0);else if(L.nodeType===Node.TEXT_NODE){const te=Math.min(k,((E=L.textContent)==null?void 0:E.length)||0);A.setEnd(L,te)}else A.setEnd(L,0);v.removeAllRanges(),v.addRange(A)}else A.selectNodeContents(V),C&&A.collapse(!0),v.removeAllRanges(),v.addRange(A)}catch(A){console.warn("Error restoring selection after heading change:",A);const M=m.doc.createRange();M.selectNodeContents(V),M.collapse(!0),v.removeAllRanges(),v.addRange(M)}if(!D&&!V.nextElementSibling){const M=m.doc.createElement("p");M.dir=V.dir||m.doc.body.dir,(S=V.parentNode)==null||S.insertBefore(M,V.nextSibling)}}catch(V){console.error(`Error applying ${h} heading:`,V)}})}),{}),a={p:Qe("Paragraph",p=>{var b;const h=ct(p);if(!h)return;const{range:m}=h,g=ra(m.commonAncestorContainer);if(g&&g.tagName.toLowerCase()!=="p")try{const v=p.doc.createElement("p");for(;g.firstChild;)v.appendChild(g.firstChild);(b=g.parentNode)==null||b.replaceChild(v,g),m.selectNodeContents(v),m.collapse(!1),h.selection.removeAllRanges(),h.selection.addRange(m)}catch(v){console.error("Error applying paragraph:",v)}}),blockquote:Qe("Blockquote",p=>{var y;const h=ct(p);if(!h)return;const{range:m}=h,g=ra(m.commonAncestorContainer);if(!g)return;const v=g.tagName.toLowerCase()==="blockquote"?"p":"blockquote";try{const _=p.doc.createElement(v);for(;g.firstChild;)_.appendChild(g.firstChild);(y=g.parentNode)==null||y.replaceChild(_,g),m.selectNodeContents(_),m.collapse(!1),h.selection.removeAllRanges(),h.selection.addRange(m)}catch(_){console.error("Error applying blockquote:",_)}})},l={orderedList:Qe("Ordered List",p=>{var v,y,_;const h=ct(p);if(!h)return;const{range:m}=h,g=ra(m.commonAncestorContainer);if(!g)return;const b=g.closest("li");if(b){const $=b.parentElement;if(!$)return;if($.tagName.toLowerCase()==="ol"){const w=p.doc.createElement("p");for(;b.firstChild;)w.appendChild(b.firstChild);(v=$.parentNode)==null||v.insertBefore(w,$),b.remove(),$.querySelector("li")||$.remove(),m.selectNodeContents(w),m.collapse(!1),h.selection.removeAllRanges(),h.selection.addRange(m);return}if($.tagName.toLowerCase()==="ul"){const w=p.doc.createElement("ol"),k=m.startOffset,C=m.startContainer;for(;$.firstChild;)w.appendChild($.firstChild);(y=$.parentNode)==null||y.replaceChild(w,$);try{const D=p.doc.createRange();D.setStart(C,k),D.collapse(!0),h.selection.removeAllRanges(),h.selection.addRange(D)}catch{const D=w.querySelector("li");if(D){const T=p.doc.createRange();T.selectNodeContents(D),T.collapse(!0),h.selection.removeAllRanges(),h.selection.addRange(T)}}return}}try{const $=p.doc.createElement("ol"),w=p.doc.createElement("li");for(;g.firstChild;)w.appendChild(g.firstChild);$.appendChild(w),(_=g.parentNode)==null||_.replaceChild($,g),m.selectNodeContents(w),m.collapse(!1),h.selection.removeAllRanges(),h.selection.addRange(m)}catch($){console.error("Error creating ordered list:",$)}}),unorderedList:Qe("Unordered List",p=>{var v,y,_;const h=ct(p);if(!h)return;const{range:m}=h,g=ra(m.commonAncestorContainer);if(!g)return;const b=g.closest("li");if(b){const $=b.parentElement;if(!$)return;if($.tagName.toLowerCase()==="ul"){const w=p.doc.createElement("p");for(;b.firstChild;)w.appendChild(b.firstChild);(v=$.parentNode)==null||v.insertBefore(w,$),b.remove(),$.querySelector("li")||$.remove(),m.selectNodeContents(w),m.collapse(!1),h.selection.removeAllRanges(),h.selection.addRange(m);return}if($.tagName.toLowerCase()==="ol"){const w=p.doc.createElement("ul"),k=m.startOffset,C=m.startContainer;for(;$.firstChild;)w.appendChild($.firstChild);(y=$.parentNode)==null||y.replaceChild(w,$);try{const D=p.doc.createRange();D.setStart(C,k),D.collapse(!0),h.selection.removeAllRanges(),h.selection.addRange(D)}catch(D){console.warn("Could not restore cursor position:",D);const T=w.querySelector("li");if(T){const B=p.doc.createRange();B.selectNodeContents(T),B.collapse(!0),h.selection.removeAllRanges(),h.selection.addRange(B)}}return}}try{const $=p.doc.createElement("ul"),w=p.doc.createElement("li");for(;g.firstChild;)w.appendChild(g.firstChild);$.appendChild(w),(_=g.parentNode)==null||_.replaceChild($,g),m.selectNodeContents(w),m.collapse(!1),h.selection.removeAllRanges(),h.selection.addRange(m)}catch($){console.error("Error creating unordered list:",$)}})},i={clear:Qe("Clear Formatting",p=>{const h=ct(p);if(!h)return;const{range:m,selection:g}=h;try{let b=function(y){return y.replace(/[\u200B-\u200D\uFEFF]/g,"").replace(/\s+/g," ").replace(/\u00A0/g," ").trim()},v=function(y){if(y.nodeType===Node.TEXT_NODE){const _=b(y.textContent||"");return p.doc.createTextNode(_)}if(y.nodeType===Node.ELEMENT_NODE){const _=y,$=_.tagName.toLowerCase(),w=["p","h1","h2","h3","h4","h5","h6","ul","ol","li","blockquote","div","table","tr","td","th","thead","tbody","b","i","u","a","img","iframe","video","audio","figure","figcaption"];if(["strong","em","span","font","strike","sub","sup","mark","del","ins","small","big"].includes($)){const C=b(_.textContent||"");return p.doc.createTextNode(C)}if(w.includes($)){const C=p.doc.createElement($);return $==="a"&&_.hasAttribute("href")?(C.setAttribute("href",_.getAttribute("href")||""),_.hasAttribute("target")&&C.setAttribute("target",_.getAttribute("target")||""),_.hasAttribute("rel")&&C.setAttribute("rel",_.getAttribute("rel")||"")):$==="img"?(_.hasAttribute("src")&&C.setAttribute("src",_.getAttribute("src")||""),_.hasAttribute("alt")&&C.setAttribute("alt",_.getAttribute("alt")||""),_.hasAttribute("width")&&C.setAttribute("width",_.getAttribute("width")||""),_.hasAttribute("height")&&C.setAttribute("height",_.getAttribute("height")||"")):$==="iframe"?(_.hasAttribute("src")&&C.setAttribute("src",_.getAttribute("src")||""),_.hasAttribute("width")&&C.setAttribute("width",_.getAttribute("width")||""),_.hasAttribute("height")&&C.setAttribute("height",_.getAttribute("height")||""),_.hasAttribute("frameborder")&&C.setAttribute("frameborder",_.getAttribute("frameborder")||""),_.hasAttribute("allowfullscreen")&&C.setAttribute("allowfullscreen",_.getAttribute("allowfullscreen")||"")):($==="video"||$==="audio")&&(_.hasAttribute("src")&&C.setAttribute("src",_.getAttribute("src")||""),_.hasAttribute("controls")&&C.setAttribute("controls",_.getAttribute("controls")||""),_.hasAttribute("width")&&C.setAttribute("width",_.getAttribute("width")||""),_.hasAttribute("height")&&C.setAttribute("height",_.getAttribute("height")||"")),Array.from(_.childNodes).forEach(D=>{var B;const T=v(D);((B=T.textContent)!=null&&B.trim()||T.nodeType===Node.ELEMENT_NODE)&&C.appendChild(T)}),C}}return p.doc.createTextNode("")};if(m.collapsed){const{body:y}=p.doc,_=p.doc.createDocumentFragment();if(Array.from(y.childNodes).forEach($=>{var k;const w=v($);((k=w.textContent)!=null&&k.trim()||w.nodeType===Node.ELEMENT_NODE)&&_.appendChild(w)}),y.innerHTML="",y.appendChild(_),!y.firstElementChild){const $=p.doc.createElement("p");y.appendChild($);const w=p.doc.createRange();w.selectNodeContents($),w.collapse(!0),g.removeAllRanges(),g.addRange(w)}}else{const y=m.cloneContents(),_=p.doc.createElement("div");_.appendChild(y);const $=p.doc.createDocumentFragment();Array.from(_.childNodes).forEach(w=>{var C;const k=v(w);((C=k.textContent)!=null&&C.trim()||k.nodeType===Node.ELEMENT_NODE)&&$.appendChild(k)}),m.deleteContents(),m.insertNode($),m.collapse(!1),g.removeAllRanges(),g.addRange(m)}}catch(b){console.error("Error clearing formatting:",b)}})},s={insertTable:Qe("Insert Table",(p,h)=>{if(console.log("insertTable command called with value:",h),p.openTableEditor&&!h){console.log("Opening table editor modal for new table"),p.openTableEditor(null);return}if(!h){const[m,g]=[3,3];Df(m,g,p);return}if(h.includes("<table")){console.log("Inserting HTML table");const m=ct(p);if(!m||!p.doc){console.error("No selection info or document");return}const{range:g}=m;try{const b=p.doc.createElement("div");b.innerHTML=h;const v=b.querySelector("table");if(v){console.log("Table parsed successfully, inserting...");const y=v.cloneNode(!0);g.insertNode(y),g.setStartAfter(y),g.collapse(!0);const _=p.doc.getSelection();_&&(_.removeAllRanges(),_.addRange(g)),console.log("Table inserted successfully")}else console.error("Could not parse table from HTML")}catch(b){console.error("Error inserting HTML table:",b)}}else{const[m,g]=h.split("x").map(Number)||[3,3];Df(m,g,p)}}),deleteTable:Qe("Delete Table",p=>p.range&&S3(p.range)),mergeCells:Qe("Merge Cells",p=>p.range&&p.doc&&k3(p.range,p.doc)),splitCells:Qe("Split Cells",p=>p.range&&p.doc&&E3(p.range,p.doc)),addRowBefore:Qe("Add Row Before",p=>p.range&&p.doc&&Af("before",p.range,p.doc)),addRowAfter:Qe("Add Row After",p=>p.range&&p.doc&&Af("after",p.range,p.doc)),deleteRow:Qe("Delete Row",p=>p.range&&C3(p.range)),insertColumnLeft:Qe("Insert Column Left",p=>p.range&&Bf("before",p.range)),insertColumnRight:Qe("Insert Column Right",p=>p.range&&Bf("after",p.range)),deleteColumn:Qe("Delete Column",p=>p.range&&x3(p.range))},c=["Left","Center","Right","Justify"].reduce((p,h)=>({...p,[`tableAlign${h}`]:Qe(`Table Align ${h}`,m=>{if(m.range){const g=h==="Left"?"start":h==="Right"?"end":h.toLowerCase();T3(m.range,g)}})}),{}),u={alignLeft:Qe("Align Left",p=>{var b;const h=ct(p);if(!h)return;const{range:m}=h,g=m.startContainer.nodeType===Node.TEXT_NODE?(b=m.startContainer.parentElement)==null?void 0:b.closest("p, h1, h2, h3, h4, h5, h6"):m.startContainer.closest("p, h1, h2, h3, h4, h5, h6");g&&(g.style.textAlign="left")},p=>{var b;const h=ct(p);if(!h)return!1;const{range:m}=h,g=m.startContainer.nodeType===Node.TEXT_NODE?(b=m.startContainer.parentElement)==null?void 0:b.closest("p, h1, h2, h3, h4, h5, h6"):m.startContainer.closest("p, h1, h2, h3, h4, h5, h6");return(g==null?void 0:g.style.textAlign)==="left"}),alignCenter:Qe("Align Center",p=>{var b;const h=ct(p);if(!h)return;const{range:m}=h,g=m.startContainer.nodeType===Node.TEXT_NODE?(b=m.startContainer.parentElement)==null?void 0:b.closest("p, h1, h2, h3, h4, h5, h6"):m.startContainer.closest("p, h1, h2, h3, h4, h5, h6");g&&(g.style.textAlign="center")},p=>{var b;const h=ct(p);if(!h)return!1;const{range:m}=h,g=m.startContainer.nodeType===Node.TEXT_NODE?(b=m.startContainer.parentElement)==null?void 0:b.closest("p, h1, h2, h3, h4, h5, h6"):m.startContainer.closest("p, h1, h2, h3, h4, h5, h6");return(g==null?void 0:g.style.textAlign)==="center"}),alignRight:Qe("Align Right",p=>{var b;const h=ct(p);if(!h)return;const{range:m}=h,g=m.startContainer.nodeType===Node.TEXT_NODE?(b=m.startContainer.parentElement)==null?void 0:b.closest("p, h1, h2, h3, h4, h5, h6"):m.startContainer.closest("p, h1, h2, h3, h4, h5, h6");g&&(g.style.textAlign="right")},p=>{var b;const h=ct(p);if(!h)return!1;const{range:m}=h,g=m.startContainer.nodeType===Node.TEXT_NODE?(b=m.startContainer.parentElement)==null?void 0:b.closest("p, h1, h2, h3, h4, h5, h6"):m.startContainer.closest("p, h1, h2, h3, h4, h5, h6");return(g==null?void 0:g.style.textAlign)==="right"}),alignJustify:Qe("Align Justify",p=>{var b;const h=ct(p);if(!h)return;const{range:m}=h,g=m.startContainer.nodeType===Node.TEXT_NODE?(b=m.startContainer.parentElement)==null?void 0:b.closest("p, h1, h2, h3, h4, h5, h6"):m.startContainer.closest("p, h1, h2, h3, h4, h5, h6");g&&(g.style.textAlign="justify")},p=>{var b;const h=ct(p);if(!h)return!1;const{range:m}=h,g=m.startContainer.nodeType===Node.TEXT_NODE?(b=m.startContainer.parentElement)==null?void 0:b.closest("p, h1, h2, h3, h4, h5, h6"):m.startContainer.closest("p, h1, h2, h3, h4, h5, h6");return(g==null?void 0:g.style.textAlign)==="justify"}),textDirection:Qe("Toggle Text Direction",p=>{var b;const h=ct(p);if(!h)return;const{range:m}=h,g=m.startContainer.nodeType===Node.TEXT_NODE?(b=m.startContainer.parentElement)==null?void 0:b.closest("p, h1, h2, h3, h4, h5, h6"):m.startContainer.closest("p, h1, h2, h3, h4, h5, h6");if(g){const v=g.dir||"ltr";g.dir=v==="ltr"?"rtl":"ltr"}},p=>{var b;const h=ct(p);if(!h)return!1;const{range:m}=h,g=m.startContainer.nodeType===Node.TEXT_NODE?(b=m.startContainer.parentElement)==null?void 0:b.closest("p, h1, h2, h3, h4, h5, h6"):m.startContainer.closest("p, h1, h2, h3, h4, h5, h6");return(g==null?void 0:g.dir)==="rtl"}),ltrDirection:Qe("Set Left to Right Direction",p=>{var b;const h=ct(p);if(!h)return;const{range:m}=h,g=m.startContainer.nodeType===Node.TEXT_NODE?(b=m.startContainer.parentElement)==null?void 0:b.closest("p, h1, h2, h3, h4, h5, h6"):m.startContainer.closest("p, h1, h2, h3, h4, h5, h6");g&&(g.dir="ltr")},p=>{var b;const h=ct(p);if(!h)return!1;const{range:m}=h,g=m.startContainer.nodeType===Node.TEXT_NODE?(b=m.startContainer.parentElement)==null?void 0:b.closest("p, h1, h2, h3, h4, h5, h6"):m.startContainer.closest("p, h1, h2, h3, h4, h5, h6");return(g==null?void 0:g.dir)==="ltr"}),rtlDirection:Qe("Set Right to Left Direction",p=>{var b;const h=ct(p);if(!h)return;const{range:m}=h,g=m.startContainer.nodeType===Node.TEXT_NODE?(b=m.startContainer.parentElement)==null?void 0:b.closest("p, h1, h2, h3, h4, h5, h6"):m.startContainer.closest("p, h1, h2, h3, h4, h5, h6");g&&(g.dir="rtl")},p=>{var b;const h=ct(p);if(!h)return!1;const{range:m}=h,g=m.startContainer.nodeType===Node.TEXT_NODE?(b=m.startContainer.parentElement)==null?void 0:b.closest("p, h1, h2, h3, h4, h5, h6"):m.startContainer.closest("p, h1, h2, h3, h4, h5, h6");return(g==null?void 0:g.dir)==="rtl"})},d={fullScreen:Qe("Full Screen",p=>{p.isFullscreen=!p.isFullscreen},p=>p.isFullscreen),splitView:Qe("Split View",p=>{p.isSplitView=!p.isSplitView},p=>p.isSplitView),codeView:Qe("Code View",p=>{p.isCodeView=!p.isCodeView},p=>p.isCodeView)},f={image:Qe("Insert Image",p=>{const{openImageModal:h}=p;h?h():console.warn("Image insertion requires modal implementation")}),video:Qe("Insert Video",p=>{const{openVideoModal:h}=p;h?h():console.warn("Video insertion requires modal implementation")}),embed:Qe("Insert Embed",p=>{const{openEmbedModal:h}=p;h?h():console.warn("Embed insertion requires modal implementation")})};return{...t,...o,...r,...a,...l,...i,...s,...c,...u,...d,...f}}function A3(e,t){return{execute(o,r){const a=t[o];a&&a.execute(e,r)},isActive(o){var a;const r=t[o];return((a=r.isActive)==null?void 0:a.call(r,e))||!1},getValue(o){var a;const r=t[o];return((a=r.getValue)==null?void 0:a.call(r,e))||null}}}function Vg(e,t){const o=t.getSelection();if(!o||!o.rangeCount)return!1;const a=o.getRangeAt(0).commonAncestorContainer,l=a.nodeType===Node.TEXT_NODE?a.parentElement:a;if(!l)return!1;const i=(u,d)=>u?d(u)?!0:i(u.parentElement,d):!1,s={bold:u=>{var f;const d=(f=u.tagName)==null?void 0:f.toLowerCase();return d==="strong"||d==="b"},italic:u=>{var f;const d=(f=u.tagName)==null?void 0:f.toLowerCase();return d==="em"||d==="i"},underline:u=>{var f;return((f=u.tagName)==null?void 0:f.toLowerCase())==="u"},h1:u=>{var d;return((d=u.tagName)==null?void 0:d.toLowerCase())==="h1"},h2:u=>{var d;return((d=u.tagName)==null?void 0:d.toLowerCase())==="h2"},h3:u=>{var d;return((d=u.tagName)==null?void 0:d.toLowerCase())==="h3"},h4:u=>{var d;return((d=u.tagName)==null?void 0:d.toLowerCase())==="h4"},h5:u=>{var d;return((d=u.tagName)==null?void 0:d.toLowerCase())==="h5"},h6:u=>{var d;return((d=u.tagName)==null?void 0:d.toLowerCase())==="h6"},p:u=>{var d;return((d=u.tagName)==null?void 0:d.toLowerCase())==="p"},blockquote:u=>{var d;return((d=u.tagName)==null?void 0:d.toLowerCase())==="blockquote"},orderedList:u=>!!u.closest("ol"),unorderedList:u=>!!u.closest("ul"),alignLeft:u=>{const d=u.closest("p, h1, h2, h3, h4, h5, h6");return(d==null?void 0:d.style.textAlign)==="start"},alignCenter:u=>{const d=u.closest("p, h1, h2, h3, h4, h5, h6");return(d==null?void 0:d.style.textAlign)==="center"},alignRight:u=>{const d=u.closest("p, h1, h2, h3, h4, h5, h6");return(d==null?void 0:d.style.textAlign)==="end"},alignJustify:u=>{const d=u.closest("p, h1, h2, h3, h4, h5, h6");return(d==null?void 0:d.style.textAlign)==="justify"},textDirection:u=>{const d=u.closest("p, h1, h2, h3, h4, h5, h6");return(d==null?void 0:d.dir)==="rtl"},ltrDirection:u=>{const d=u.closest("p, h1, h2, h3, h4, h5, h6");return(d==null?void 0:d.dir)==="ltr"},rtlDirection:u=>{const d=u.closest("p, h1, h2, h3, h4, h5, h6");return(d==null?void 0:d.dir)==="rtl"}};if(["splitView","codeView","fullScreen"].includes(e))return!1;const c=s[e];return c?i(l,c):i(l,u=>{var d;return((d=u.tagName)==null?void 0:d.toLowerCase())===e.toLowerCase()})}function B3(e,t){const o=D3(e),r=A3(e,o),a=()=>{if(!e.doc)return;const l=new Set;["bold","italic","underline","link","h1","h2","h3","h4","h5","h6","blockquote","p","orderedList","unorderedList","alignLeft","alignCenter","alignRight","alignJustify","textDirection","ltrDirection","rtlDirection"].forEach(s=>{Vg(s,e.doc)&&l.add(s)}),e.selectedStyles=l};return{execute:(l,i)=>{if(!e.doc){console.log("[useCommands] No document available, skipping command");return}if(t==null||t.logCommand(l,i),["splitView","codeView","fullScreen"].includes(l))switch(l){case"splitView":e.isSplitView=!e.isSplitView;return;case"codeView":e.isCodeView=!e.isCodeView;return;case"fullScreen":e.isFullscreen=!e.isFullscreen;return}try{e.doc.body.focus()}catch(c){console.error("[useCommands] Error focusing editor:",c)}const s=e.doc.getSelection();s!=null&&s.rangeCount&&(e.selection=s,e.range=s.getRangeAt(0).cloneRange(),e.rangeCount=s.rangeCount);try{r.execute(l,i),["splitView","codeView","fullScreen"].includes(l)||a()}catch(c){console.error("[useCommands] Error during command execution:",c)}},isActive:r.isActive,getValue:r.getValue}}class V3{constructor(t=1e3){Pe(this,"session");Pe(this,"maxActions");Pe(this,"isDevelopment");this.maxActions=t,this.session=this.createNewSession(),this.isDevelopment=!1}createNewSession(){return{id:`session_${Date.now()}`,startTime:Date.now(),actions:[]}}getNodeDescription(t){var r;if(t.nodeType===Node.TEXT_NODE)return`Text("${(r=t.textContent)==null?void 0:r.slice(0,20)}${t.textContent&&t.textContent.length>20?"...":""}")`;const o=t;return`${o.tagName.toLowerCase()}${o.id?`#${o.id}`:""}`}captureState(t){if(!t.doc||!t.selection)return{content:"",selection:null,activeStyles:[],caretPosition:null};const{selection:o}=t,r=o.rangeCount?o.getRangeAt(0):null;return{content:t.doc.body.innerHTML,selection:r?{start:r.startOffset,end:r.endOffset,collapsed:r.collapsed,text:r.toString()}:null,activeStyles:Array.from(t.selectedStyles),caretPosition:r?{node:this.getNodeDescription(r.startContainer),offset:r.startOffset}:null}}logCommand(t,o,r){this.addAction({type:"command",name:t,timestamp:Date.now(),details:{value:o},state:this.captureState(r)})}logPaste(t,o){this.addAction({type:"paste",name:"paste",timestamp:Date.now(),details:{html:t.getData("text/html"),text:t.getData("text/plain"),types:Array.from(t.types)},state:this.captureState(o)})}logKeyboard(t,o){this.addAction({type:"keyboard",name:"keypress",timestamp:Date.now(),details:{key:t.key,code:t.code,ctrl:t.ctrlKey,alt:t.altKey,shift:t.shiftKey,meta:t.metaKey},state:this.captureState(o)})}logSelection(t){this.addAction({type:"selection",name:"selection_change",timestamp:Date.now(),details:{},state:this.captureState(t)})}logInput(t,o,r){this.addAction({type:"input",name:t,timestamp:Date.now(),details:{data:o},state:this.captureState(r)})}addAction(t){this.session.actions.push(t),this.session.actions.length>this.maxActions&&this.session.actions.shift(),this.isDevelopment&&console.log("Editor Action:",t)}getSession(){return this.session}clearSession(){this.session=this.createNewSession()}exportSession(){return JSON.stringify(this.session,null,2)}downloadSession(){const t=new Blob([this.exportSession()],{type:"application/json"}),o=URL.createObjectURL(t),r=document.createElement("a");r.href=o,r.download=`editor_session_${this.session.id}.json`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(o)}exportSessionWithPrompt(t){const o={message:t||"here is a debug log, can you analyze and fix accordingly?",session:this.session};return JSON.stringify(o,null,2)}}function Vf(e){const t=document.createElement("div");t.innerHTML=e;const o=[];return t.querySelectorAll("iframe").forEach((r,a)=>{const l=`<!--iframe-${a}-->`;o.push(r.cloneNode(!0)),r.replaceWith(l)}),{html:t.innerHTML,iframes:o}}function Mf(e,t,o){const r=/<!--iframe-(\d+)-->/g;e.body.innerHTML=t.replace(r,(a,l)=>{const i=o[Number(l)];return i?i.outerHTML:""})}function M3(){let e=null;const t=n.reactive({content:"",doc:void 0,selection:null,selectedStyles:new Set,isFullscreen:!1,isSplitView:!1,isCodeView:!1,hasInit:!1,undoStack:[],redoStack:[],rangeCount:0,range:null,debug:void 0}),o={styles:()=>{if(!t.doc)return;const c=new Set;["bold","italic","underline","h1","h2","h3","h4","h5","h6","blockquote","p","orderedList","unorderedList","alignLeft","alignCenter","alignRight","alignJustify","textDirection","ltrDirection","rtlDirection"].forEach(d=>{t.doc&&Vg(d,t.doc)&&c.add(d)}),t.selectedStyles=c},content:c=>{if(!t.doc)return;t.doc.body.innerHTML!==t.content&&(t.undoStack.push(t.content),t.redoStack=[]);const d=t.doc.getSelection(),f=d!=null&&d.rangeCount?d.getRangeAt(0).cloneRange():null;if(c==="html"){const p=Vf(t.content);t.doc.body.innerHTML=p.html,setTimeout(()=>{if(t.doc&&(Mf(t.doc,t.content,p.iframes),f&&d))try{d.removeAllRanges(),d.addRange(f)}catch{}},0)}else t.doc.body.textContent=t.content},selection:()=>{if(!t.doc)return;const c=t.doc.getSelection();if(c)try{if(!t.doc.body.contains(c.anchorNode)){t.doc.body.focus();return}(!t.selection||t.selection!==c||t.rangeCount!==c.rangeCount||c.rangeCount>0&&t.range&&(t.range.startContainer!==c.getRangeAt(0).startContainer||t.range.startOffset!==c.getRangeAt(0).startOffset||t.range.endContainer!==c.getRangeAt(0).endContainer||t.range.endOffset!==c.getRangeAt(0).endOffset))&&(t.selection=c,t.rangeCount=c.rangeCount,c.rangeCount>0&&(t.range=c.getRangeAt(0).cloneRange()),o.styles())}catch{t.selection=null,t.range=null,t.rangeCount=0,t.selectedStyles=new Set}}},r={undo:()=>{if(t.undoStack.length===0)return;t.redoStack.push(t.content);const c=t.undoStack.pop();c!==void 0&&(t.content=c,o.content("html"))},redo:()=>{if(t.redoStack.length===0)return;t.undoStack.push(t.content);const c=t.redoStack.pop();c!==void 0&&(t.content=c,o.content("html"))}},a={emptyTags:c=>{var p;const u=c.createTreeWalker(c.body,NodeFilter.SHOW_ELEMENT,null),d=[];let f=u.nextNode();for(;f;){if(["br","img","hr","input"].includes(f.tagName.toLowerCase())){f=u.nextNode();continue}const h=((p=f.textContent)==null?void 0:p.trim())||"",m=f.innerHTML.trim(),g=m==="<br>"||m==="<br/>",b=m===" "||h===" ",v=!h&&!m,y=f.parentElement===c.body;(v||b||g&&!y)&&d.push(f),f=u.nextNode()}d.forEach(h=>{h.remove()})},normalizeContent:c=>{var p;const u=c.createTreeWalker(c.body,NodeFilter.SHOW_TEXT),d=[];let f;for(;f=u.nextNode();)f.parentElement===c.body&&((p=f.textContent)!=null&&p.trim())&&d.push(f);d.forEach(h=>{const m=c.createElement("p");m.dir=c.body.dir,m.appendChild(h.cloneNode()),c.body.replaceChild(m,h)})}};function l(c){e&&(e(),e=null);let u=!1;const d={input:()=>{if(u)return;u=!0;const f=c.body.innerHTML;f!==t.content&&(t.content=f),u=!1},selectionchange:()=>{u||o.selection()},mouseup:()=>{u||o.selection()},keyup:f=>{u||["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(f.key)&&o.selection()}};return Object.entries(d).forEach(([f,p])=>{c.addEventListener(f,p)}),e=()=>{Object.entries(d).forEach(([f,p])=>{c.removeEventListener(f,p)})},e}function i(c){if(t.hasInit&&e&&(e(),e=null),t.doc=c,t.hasInit=!0,c.editorState=t,t.content&&t.content.trim()&&!t.content.match(/^<p(?:\s[^>]*)?>(?:<br\s*\/?>)?\s*<\/p>$/i)){const u=Vf(t.content);c.body.innerHTML=u.html,setTimeout(()=>{t.doc&&Mf(c,t.content,u.iframes)},0)}if(a.normalizeContent(c),c.body.firstElementChild){const u=c.createRange(),d=c.getSelection();d&&(u.selectNodeContents(c.body),u.collapse(!1),d.removeAllRanges(),d.addRange(u),t.range=u.cloneRange(),t.selection=d,t.rangeCount=d.rangeCount)}else{const u=c.getSelection();if(u){const d=c.createRange();d.setStart(c.body,0),d.setEnd(c.body,0),u.removeAllRanges(),u.addRange(d),t.range=d.cloneRange(),t.selection=u,t.rangeCount=u.rangeCount}}e=l(c)}function s(){if(!t.debug){const c=new V3,u={debugger:c,logCommand:(d,f)=>{c.logCommand(d,f,t)},getSession:()=>c.getSession(),clearSession:()=>{c.clearSession()},downloadSession:()=>{c.downloadSession()},exportDebugWithPrompt:d=>c.exportSessionWithPrompt(d)};t.debug=u}}return typeof window<"u"&&window.addEventListener("beforeunload",()=>{e&&e()}),{state:t,init:i,updateState:o,history:r,initDebugger:s,cleanup:()=>{e&&(e(),e=null)}}}const L3=[{key:"b",command:"bold"},{key:"i",command:"italic"},{key:"u",command:"underline"},{key:"k",command:"link"},{key:"z",command:"undo"},{key:"z",modifiers:{shift:!0},command:"redo"},{key:"y",command:"redo"},{key:".",modifiers:{shift:!0},command:"orderedList"},{key:"/",modifiers:{shift:!0},command:"unorderedList"},{key:"]",command:"indent"},{key:"[",command:"outdent"},...Array.from({length:6},(e,t)=>({key:String(t+1),modifiers:{alt:!0},command:`h${t+1}`}))];function P3(e,t){e.addEventListener("keydown",o=>{if(!o.ctrlKey&&!o.metaKey)return;const r=L3.find(a=>{const l=a.key===o.key,i=!a.modifiers||(!a.modifiers.ctrl||o.ctrlKey||o.metaKey)&&(!a.modifiers.alt||o.altKey)&&(!a.modifiers.shift||o.shiftKey);return l&&i});r&&(o.preventDefault(),t.execute(r.command))})}const I3={key:0},O3={key:1,class:"flex pt-05"},R3={class:"inline-toolbar-content"},F3={class:"menu-header"},z3={class:"px-025"},U3={key:3,class:"context-menu-separator"},H3={class:"flex gap-05 align-items-end"},j3={class:"flex gap-1"},W3={class:"flex gap-05 w-100"},q3={class:"flex gap-1"},G3={class:"flex gap-05 w-100"},Y3={class:"grid gap-0"},X3={key:0,class:"flex gap-025 opacity-5 -mt-05"},K3={key:1,class:"grid grid-wrap-2 gap-05"},J3={class:"grid grid-wrap-2 gap-05 py-1"},Z3={class:"overflow-hidden flex justify-content-center"},Q3={class:"flex gap-05 w-100"},ex={class:"grid grid-wrap-4 m_grid-wrap-2 gap-col-1 table-editor testMe1"},tx={class:"grid-span-1"},nx={class:"flex gap-025 mt-025 radius-1 p-05 w-fit",style:{height:"var(--input-height)",background:"var(--input-bg)"}},ox={class:"grid-span-1"},rx={class:"flex gap-025 mt-025 radius-1 p-025 w-fit",style:{height:"var(--input-height)",background:"var(--input-bg)"}},ax={key:0,class:"grid-span-4 m_grid-span-2 grid-wrap-4 m_grid-wrap-2 grid gap-col-1 border-bottom pb-05 mb-05"},lx={key:1,class:"grid grid-wrap-4 m_grid-wrap-2 gap-col-1 grid-span-4 m_grid-span-2 border-bottom pb-05 mb-05"},ix=["innerHTML"],sx=n.defineComponent({inheritAttrs:!1,__name:"index",props:{modelValue:{},toolbarConfig:{},debug:{type:Boolean},label:{},height:{},basic:{type:Boolean},simple:{type:Boolean},placeholder:{},hideToolbar:{type:Boolean},hideInlineToolbar:{type:Boolean},hideImages:{type:Boolean},hideVideos:{type:Boolean},hideEmbed:{type:Boolean},hideTables:{type:Boolean},hideAlignment:{type:Boolean},hideDirections:{type:Boolean},hideH5H6:{type:Boolean},hide:{},autofocus:{type:Boolean},textColor:{},fontSize:{}},emits:["update:modelValue"],setup(e,{expose:t,emit:o}){const r=e,a=o,l=n.useAttrs(),i=n.ref(),s=M3(),c=n.ref(!1),u=n.ref(!1),d=B3(s.state,s.state.debug),f=n.ref(0),p=n.computed(()=>(f.value,typeof document<"u"&&getComputedStyle(document.documentElement).getPropertyValue("--input-color").trim()||"#000")),h=n.computed(()=>{const x=p.value;return r.textColor||(x&&x.length>0&&x!=="#000"?x:"inherit")});let m=null;n.onMounted(()=>{typeof document<"u"&&(m=new MutationObserver(x=>{let N=!1;x.forEach(j=>{if(j.type==="attributes"){const{attributeName:le}=j;(le==="data-theme"||le==="class"||le==="style")&&(N=!0)}}),N&&(f.value++,u.value&&setTimeout(()=>{re()},50))}),m.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme","class","style"]}),document.body&&m.observe(document.body,{attributes:!0,attributeFilter:["class","data-theme"]}))}),n.onBeforeUnmount(()=>{m==null||m.disconnect()}),r.debug&&typeof window<"u"&&(window.forceRichTextUpdate=()=>{f.value++},window.debugRichText=Je);const g=n.computed(()=>!(r.hideToolbar||r.basic)),b=n.computed(()=>!r.hideInlineToolbar),v=n.computed(()=>r.toolbarConfig),y=n.computed(()=>{const x=[...r.hide||[]];return r.simple&&["h1","h2","h3","h4","h5","h6","image","video","embed","ul","ol","blockquote","direction","table","alignment"].forEach(j=>{x.includes(j)||x.push(j)}),x}),_=n.ref(!1),$=n.ref({url:"",openInNewTab:!0}),w=n.ref(!1),k=n.ref({message:"",x:0,y:0});let C=null;const D=n.ref(!1),T=n.ref({src:"",alt:"",width:"",height:"",credit:"",figcaption:!1});let B=null;const P=n.ref(!1),E=n.ref({src:"",width:"560",height:"315",alt:""});let S=null;const V=n.ref(!1),A=n.ref({top:0,left:0}),M=n.ref(null),I=n.ref(!1),L=n.ref({src:"",width:"",autoplay:!1,mute:!1,controls:!0,loop:!1,aspectRatio:"16:9",customWidth:"",customHeight:"",caption:"",showCaption:!1});let te=null;const ee=n.ref(!1),O=n.ref({rows:3,cols:3,width:100,borderWidth:1,borderColor:"#dddddd",cellPadding:8,showHeaders:!0,headerBgColor:"#f4f4f4",headerTextColor:"#333333",cellBgColor:"#ffffff",cellTextColor:"#333333",alternateRows:!1,alternateRowBgColor:"#f9f9f9",alternateRowTextColor:"#333333",fixedLayout:!0,alignment:"left",direction:"ltr"}),z=n.ref(!1),H=n.ref({x:0,y:0}),Z=n.ref(null);let ie=null;const pe=n.computed(()=>{const x=O.value;let j=`<table style="${`
|
|
158
|
+
`+l):r.stack=l}catch{}}throw r}}_request(t,o){typeof t=="string"?(o=o||{},o.url=t):o=t||{},o=nr(this.defaults,o);const{transitional:r,paramsSerializer:a,headers:l}=o;r!==void 0&&Ol.assertOptions(r,{silentJSONParsing:yn.transitional(yn.boolean),forcedJSONParsing:yn.transitional(yn.boolean),clarifyTimeoutError:yn.transitional(yn.boolean),legacyInterceptorReqResOrdering:yn.transitional(yn.boolean)},!1),a!=null&&(ce.isFunction(a)?o.paramsSerializer={serialize:a}:Ol.assertOptions(a,{encode:yn.function,serialize:yn.function},!0)),o.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?o.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:o.allowAbsoluteUrls=!0),Ol.assertOptions(o,{baseUrl:yn.spelling("baseURL"),withXsrfToken:yn.spelling("withXSRFToken")},!0),o.method=(o.method||this.defaults.method||"get").toLowerCase();let i=l&&ce.merge(l.common,l[o.method]);l&&ce.forEach(["delete","get","head","post","put","patch","common"],m=>{delete l[m]}),o.headers=nn.concat(i,l);const s=[];let c=!0;this.interceptors.request.forEach(function(g){if(typeof g.runWhen=="function"&&g.runWhen(o)===!1)return;c=c&&g.synchronous;const b=o.transitional||Hu;b&&b.legacyInterceptorReqResOrdering?s.unshift(g.fulfilled,g.rejected):s.push(g.fulfilled,g.rejected)});const u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let d,f=0,p;if(!c){const m=[Tf.bind(this),void 0];for(m.unshift(...s),m.push(...u),p=m.length,d=Promise.resolve(o);f<p;)d=d.then(m[f++],m[f++]);return d}p=s.length;let h=o;for(;f<p;){const m=s[f++],g=s[f++];try{h=m(h)}catch(b){g.call(this,b);break}}try{d=Tf.call(this,h)}catch(m){return Promise.reject(m)}for(f=0,p=u.length;f<p;)d=d.then(u[f++],u[f++]);return d}getUri(t){t=nr(this.defaults,t);const o=Cg(t.baseURL,t.url,t.allowAbsoluteUrls);return wg(o,t.params,t.paramsSerializer)}};ce.forEach(["delete","get","head","options"],function(t){Jo.prototype[t]=function(o,r){return this.request(nr(r||{},{method:t,url:o,data:(r||{}).data}))}});ce.forEach(["post","put","patch"],function(t){function o(r){return function(l,i,s){return this.request(nr(s||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:l,data:i}))}}Jo.prototype[t]=o(),Jo.prototype[t+"Form"]=o(!0)});let IS=class Dg{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let o;this.promise=new Promise(function(l){o=l});const r=this;this.promise.then(a=>{if(!r._listeners)return;let l=r._listeners.length;for(;l-- >0;)r._listeners[l](a);r._listeners=null}),this.promise.then=a=>{let l;const i=new Promise(s=>{r.subscribe(s),l=s}).then(a);return i.cancel=function(){r.unsubscribe(l)},i},t(function(l,i,s){r.reason||(r.reason=new sl(l,i,s),o(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const o=this._listeners.indexOf(t);o!==-1&&this._listeners.splice(o,1)}toAbortSignal(){const t=new AbortController,o=r=>{t.abort(r)};return this.subscribe(o),t.signal.unsubscribe=()=>this.unsubscribe(o),t.signal}static source(){let t;return{token:new Dg(function(a){t=a}),cancel:t}}};function OS(e){return function(o){return e.apply(null,o)}}function RS(e){return ce.isObject(e)&&e.isAxiosError===!0}const Lc={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Lc).forEach(([e,t])=>{Lc[t]=e});function Ag(e){const t=new Jo(e),o=ug(Jo.prototype.request,t);return ce.extend(o,Jo.prototype,t,{allOwnKeys:!0}),ce.extend(o,t,null,{allOwnKeys:!0}),o.create=function(a){return Ag(nr(e,a))},o}const wt=Ag(il);wt.Axios=Jo;wt.CanceledError=sl;wt.CancelToken=IS;wt.isCancel=kg;wt.VERSION=Ng;wt.toFormData=Zi;wt.AxiosError=We;wt.Cancel=wt.CanceledError;wt.all=function(t){return Promise.all(t)};wt.spread=OS;wt.isAxiosError=RS;wt.mergeConfig=nr;wt.AxiosHeaders=nn;wt.formToJSON=e=>$g(ce.isHTMLForm(e)?new FormData(e):e);wt.getAdapter=Tg.getAdapter;wt.HttpStatusCode=Lc;wt.default=wt;const{Axios:RO,AxiosError:FO,CanceledError:zO,isCancel:UO,CancelToken:HO,VERSION:jO,all:WO,Cancel:qO,isAxiosError:GO,spread:YO,toFormData:XO,AxiosHeaders:KO,HttpStatusCode:JO,formToJSON:ZO,getAdapter:QO,mergeConfig:eR}=wt;let vr=wt;function FS(e={}){e.baseURL!==void 0&&(vr=wt.create({baseURL:e.baseURL}))}const Ms={get:async e=>vr.get("/files",{params:{path_key:e}}),put:async(e,t)=>vr.put("/files",e,{params:{path_key:t}}),delete:async e=>vr.delete(`/files/${e}`,{params:{path_key:e}}),upload:async(e,t)=>{const o=new FormData;return o.append("file",e),o.append("upload",e),vr.post("/files/upload",o,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:t==null?void 0:t.onUploadProgress,params:{dir_path:t==null?void 0:t.dirPath,tags:t==null?void 0:t.tags}})},list:async e=>vr.get("/files/list",{params:{dir_path:e}})};function Bg(e={}){const t=e.namespace||"default",o=n.ref([]),r=n.ref([]),a=n.ref([]),l=n.computed(()=>{const f=r.value.map(p=>p.path_key);return[...a.value,...f]}),i=f=>URL.createObjectURL(f);function s(f){if(!f)return;let p=[];f instanceof File?p=[f]:f instanceof FileList?p=Array.from(f):Array.isArray(f)&&(p=f);const h=p.map(m=>({url:i(m),name:m.name,file:m,progress:0,namespace:t}));e.multiple?o.value.push(...h):o.value=h,e.onFileQueued&&h.length>0&&e.onFileQueued(h)}async function c(f){var p;if(typeof f=="string"){r.value=r.value.filter(m=>m.path_key!==f);const h=a.value.indexOf(f);h!==-1&&a.value.splice(h,1);try{await Ms.delete(f)}catch(m){console.error("Error deleting file:",m)}}else if(f){const h=f instanceof File?{name:f.name}:f,m=o.value.findIndex(g=>g.file.name===h.name&&g.namespace===t);m!==-1&&o.value.splice(m,1)}(p=e.onChange)==null||p.call(e)}async function u(){const f=o.value.filter(p=>p.namespace===t);for(const p of f){p.uploading=!0,e.multiple||a.value.splice(0,1);try{const{data:h}=await Ms.upload(p.file,{onUploadProgress:m=>{p.progress=m.loaded/m.total*100-1},dirPath:n.toValue(e.dirPath)});a.value.push(h.path_key)}catch(h){console.error("Error uploading file:",h)}}o.value=o.value.filter(p=>p.namespace!==t)}function d(f=!1){if(e.disabled)return;const p=document.createElement("input");p.type="file",p.multiple=!!e.multiple,p.accept=e.accept||"",e.capture!==void 0&&e.capture!==!1&&(p.capture=e.capture===!0?"environment":e.capture),p.onchange=h=>{s(h.target.files),f&&u()},p.click()}return n.onMounted(()=>{const f=n.toValue(e.dirPath);f&&Ms.list(f).then(p=>{const h=Array.isArray(p.data)?p.data:[p.data];r.value.push(...h)}).catch(p=>{console.error("Error loading files:",p)})}),{fileQueue:o,storageFiles:r,pk:a,pathKeys:l,fileToUrl:i,removeFile:c,flushQueue:u,addFile:s,browse:d,namespace:t}}const zS={class:"bagel-input"},US={key:0},HS={key:1,placeholder:"required",type:"text",required:"",class:"pixel"},jS={key:1,class:"flex align-items-center gap-1 p-05"},WS={class:"txt-gray txt-12"},qS={class:"m-05 flex opacity-8 z-99 gap-025"},GS={class:"flex gap-025 rounded pe-1 ps-05 py-025 -my-1"},YS={class:"ellipsis-1 word-break-all h-20 m-0 color-black txt16"},XS={key:2,class:"txt-gray txt-12"},KS={key:0,class:"bgl-multi-preview"},JS={class:"m-0"},ZS=["src"],QS={class:"no-margin multi-preview-txt"},e3={key:0,class:"progress"},t3={key:1,class:"bgl-single-preview"},n3={key:0,class:"h-100"},o3=["src"],r3={class:"p-1 flex column hover fileUploadPlaceHolder justify-content-center mb-05"},a3={class:"pretty balance user-select-none"},l3=n.defineComponent({__name:"UploadInput",props:{id:{},label:{},multiple:{type:Boolean},modelValue:{},width:{},height:{default:"215px"},dirPath:{},fill:{type:Boolean},oval:{type:Boolean},theme:{default:"dropzone"},accept:{default:"*"},capture:{type:[Boolean,String]},required:{type:Boolean},disabled:{type:Boolean},baseURL:{},placeholder:{},noFilePlaceholder:{},btnPlaceholder:{},showIcon:{type:Boolean,default:!0},icon:{default:"upload_2"}},emits:["update:modelValue","addFileStart"],setup(e,{emit:t}){const o=e,r=t,{$t:a}=Vt(),{fileQueue:l,pathKeys:i,removeFile:s,flushQueue:c,addFile:u,browse:d,pk:f}=Bg({disabled:o.disabled,dirPath:o.dirPath,multiple:o.multiple,accept:o.accept,capture:o.capture,namespace:o.id||"upload",onFileQueued:async()=>{await c(),g()},onChange:g});n.watch(()=>o.modelValue,y=>f.value=y?[y].flat().filter(Boolean):[],{immediate:!0});const p=y=>ni.test(y),h=n.ref(!1);function m(y,_=!1){y.preventDefault(),y.stopPropagation(),o.disabled||(h.value=_)}function g(){o.multiple?r("update:modelValue",i.value):r("update:modelValue",i.value[0]||void 0)}async function b(y){var _;o.disabled||(y.preventDefault(),y.stopPropagation(),r("addFileStart"),u((_=y.dataTransfer)==null?void 0:_.files),h.value=!1)}function v(y){return!y||typeof y!="string"?"file":y.split("/").pop()||"file"}return(y,_)=>{const $=n.resolveDirective("tooltip"),w=n.resolveDirective("lightbox");return n.openBlock(),n.createElementBlock("div",zS,[e.label?(n.openBlock(),n.createElementBlock("label",US,n.toDisplayString(e.label),1)):n.createCommentVNode("",!0),e.required&&!n.unref(i).length?(n.openBlock(),n.createElementBlock("input",HS)):n.createCommentVNode("",!0),e.theme==="basic"?(n.openBlock(),n.createBlock(n.unref(en),{key:2,outline:"",class:"flex p-05 gap-1",onDragover:_[2]||(_[2]=k=>m(k,!0)),onDrop:b},{default:n.withCtx(()=>[!n.unref(i).length&&!n.unref(l).length?(n.openBlock(),n.createBlock(n.unref(ne),{key:0,class:"px-1-5",icon:"upload",outline:"",value:e.btnPlaceholder||n.unref(a)("upload.upload"),onClick:_[0]||(_[0]=k=>n.unref(d)())},null,8,["value"])):n.createCommentVNode("",!0),n.unref(l).length>0?(n.openBlock(),n.createElementBlock("div",jS,[n.createVNode(n.unref(Lo),{size:"20"}),n.createElementVNode("span",WS,n.toDisplayString(n.unref(a)("upload.uploading",{count:n.unref(l).length,plural:n.unref(l).length>1?"s":""})),1)])):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(i),k=>(n.openBlock(),n.createElementBlock("div",{key:k,class:"txt-gray txt-12 flex"},[n.createElementVNode("div",qS,[n.withDirectives(n.createVNode(n.unref(ne),{color:"gray",thin:"",icon:"delete",onClick:C=>n.unref(s)(k)},null,8,["onClick"]),[[$,"Delete"]]),n.withDirectives(n.createVNode(n.unref(ne),{color:"gray",thin:"",icon:"autorenew",onClick:_[1]||(_[1]=C=>n.unref(d)())},null,512),[[$,"Replace"]]),n.createVNode(n.unref(ne),{icon:"download",color:"gray",thin:"",href:n.unref(Hn)(k),download:v(k)},null,8,["href","download"]),n.createElementVNode("div",GS,[n.createVNode(n.unref(Ne),{icon:"draft",size:1.5}),n.withDirectives((n.openBlock(),n.createElementBlock("p",YS,[n.createTextVNode(n.toDisplayString(v(k)),1)])),[[w,{src:n.unref(Hn)(k),download:!0}]])])])]))),128)),!n.unref(i).length&&!n.unref(l).length?(n.openBlock(),n.createElementBlock("span",XS,n.toDisplayString(e.noFilePlaceholder||n.unref(a)("upload.noFile")),1)):n.createCommentVNode("",!0)]),_:1})):(n.openBlock(),n.createElementBlock("div",{key:3,class:n.normalizeClass(["fileUploadWrap",{fileDropZone:!n.unref(i).length&&!n.unref(l).length,dragover:h.value,"bgl_oval-upload":e.oval}]),style:n.normalizeStyle({width:e.width,height:e.height}),onClick:_[4]||(_[4]=k=>n.unref(d)()),onDragover:_[5]||(_[5]=k=>m(k,!0)),onDrop:b,onDragleave:_[6]||(_[6]=k=>m(k))},[n.renderSlot(y.$slots,"files",{files:n.unref(i),fileQueue:n.unref(l)},()=>[e.multiple?(n.openBlock(),n.createElementBlock("div",KS,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(i),k=>n.withDirectives((n.openBlock(),n.createElementBlock("div",{key:k,class:n.normalizeClass(["multi-image-item-preview",{"bgl_fill-image":e.fill}])},[p(k)?(n.openBlock(),n.createBlock(n.unref(Va),{key:0,pathKey:k,class:"multi-preview"},null,8,["pathKey"])):(n.openBlock(),n.createBlock(n.unref(Ne),{key:1,icon:"description",class:"multi-preview"})),n.createElementVNode("p",JS,n.toDisplayString(v(k)),1),n.createVNode(n.unref(ne),{thin:"",flat:"",icon:"delete",color:"red",onClick:C=>n.unref(s)(k)},null,8,["onClick"])],2)),[[w,{src:n.unref(Hn)(k),download:!0}]])),128)),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(l),k=>(n.openBlock(),n.createElementBlock("div",{key:k.name,class:n.normalizeClass(["multi-image-item-preview",{"bgl_fill-image":e.fill}])},[p(k.file.type)?(n.openBlock(),n.createElementBlock("img",{key:0,class:"multi-preview",src:k.url,alt:""},null,8,ZS)):(n.openBlock(),n.createBlock(n.unref(Ne),{key:1,icon:"description",class:"multi-preview"})),n.createElementVNode("p",QS,n.toDisplayString(k.name),1),n.createElementVNode("div",{class:n.normalizeClass(["pie",{complete:k.progress===100}]),style:n.normalizeStyle([{"--p":k.progress},{"--b":"2px"}])},[k.progress<100?(n.openBlock(),n.createElementBlock("span",e3,n.toDisplayString(k.progress.toFixed(0)),1)):n.createCommentVNode("",!0),n.createVNode(n.unref(Ne),{class:"success",icon:"check_circle"})],6)],2))),128))])):n.unref(i).length>0||n.unref(l).length>0?(n.openBlock(),n.createElementBlock("div",t3,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(i),k=>(n.openBlock(),n.createElementBlock("div",{key:k,class:n.normalizeClass(["single-image-item-preview",{"bgl_fill-image":e.fill}])},[n.createElementVNode("div",{class:n.normalizeClass(["flex opacity-8 z-99 gap-025 absolute top-0 start-0",{"mx-auto end-0 mt-1 justify-content-center":e.oval,"m-05":!e.oval}])},[n.withDirectives(n.createVNode(n.unref(ne),{color:"white",frame:"",thin:"",icon:"delete",onClick:C=>n.unref(s)(k)},null,8,["onClick"]),[[$,"Delete"]]),n.withDirectives(n.createVNode(n.unref(ne),{color:"white",frame:"",thin:"",icon:"autorenew",onClick:_[3]||(_[3]=C=>n.unref(d)())},null,512),[[$,"Replace"]]),n.withDirectives(n.createVNode(n.unref(ne),{color:"white",frame:"",thin:"",icon:"download",href:n.unref(Hn)(k),download:v(k)},null,8,["href","download"]),[[$,"Download"]])],2),p(k)?(n.openBlock(),n.createElementBlock("div",n3,[n.withDirectives(n.createVNode(n.unref(Va),{class:"single-preview",pathKey:k,alt:""},null,8,["pathKey"]),[[w,{src:n.unref(Hn)(k),download:!0}]])])):n.withDirectives((n.openBlock(),n.createBlock(n.unref(Ne),{key:1,size:4,weight:"2",icon:"description",class:"color-primary w-100"},null,512)),[[w,{src:n.unref(Hn)(k),download:!0}]])],2))),128)),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(l),k=>(n.openBlock(),n.createElementBlock("div",{key:k.name,class:n.normalizeClass(["single-image-item-preview",{"bgl_fill-image":e.fill}])},[n.createVNode(n.unref(Lo),{type:"bar",progress:k.progress,class:"absolute bottom-05 end start w-100px mx-auto rounded overflow-hidden"},null,8,["progress"]),p(k.file.type)?(n.openBlock(),n.createElementBlock("img",{key:0,class:"single-preview opacity-5",src:k.url,alt:""},null,8,o3)):n.createCommentVNode("",!0)],2))),128))])):n.createCommentVNode("",!0)],!0),!n.unref(i).length&&!n.unref(l).length||e.multiple?n.renderSlot(y.$slots,"placeholder",{key:0,files:n.unref(i),fileQueue:n.unref(l),browse:n.unref(d)},()=>[n.createElementVNode("p",r3,[e.showIcon?(n.openBlock(),n.createBlock(n.unref(Ne),{key:0,name:e.icon,size:"2.5",class:"user-select-none"},null,8,["name"])):n.createCommentVNode("",!0),n.createElementVNode("span",a3,n.toDisplayString(n.unref(Ge)(e.placeholder)||n.unref(a)("upload.dropPlaceholder")),1)])],!0):n.createCommentVNode("",!0)],38))])}}}),Da=Ve(l3,[["__scopeId","data-v-f4bb6c01"]]),i3=["h1","h2","h3","h4","h5","h6","separator","p","blockquote","orderedList","unorderedList","separator","bold","italic","underline","separator","alignMenu","ltrDirection","rtlDirection","separator","insertTable","separator","link","image","video","embed","clear","separator","undo","redo","separator","splitView","fullScreen"],s3=[{name:"headingsMenu",label:"Headings",icon:"title"},{name:"mediaMenu",label:"Media",icon:"perm_media"},{name:"alignMenu",label:"Alignment",icon:"format_align_left"},{name:"h1",label:"Heading 1",icon:"format_h1"},{name:"h2",label:"Heading 2",icon:"format_h2"},{name:"h3",label:"Heading 3",icon:"format_h3"},{name:"h4",label:"Heading 4",icon:"format_h4"},{name:"h5",label:"Heading 5",icon:"format_h5"},{name:"h6",label:"Heading 6",icon:"format_h6"},{name:"p",label:"Paragraph",icon:"format_paragraph"},{name:"blockquote",label:"Blockquote",icon:"format_quote"},{name:"bold",label:"Bold",icon:"format_bold"},{name:"italic",label:"Italic",icon:"format_italic"},{name:"underline",label:"Underline",icon:"format_underlined"},{name:"orderedList",label:"Ordered List",icon:"format_list_numbered"},{name:"unorderedList",label:"Unordered List",icon:"format_list_bulleted"},{name:"link",label:"Link",icon:"add_link"},{name:"image",label:"Image",icon:"add_photo_alternate"},{name:"video",label:"Video",icon:"play_circle"},{name:"embed",label:"Embed",icon:"media_link"},{name:"splitView",label:"Split View",icon:"code"},{name:"clear",label:"Clear Formatting",icon:"format_clear"},{name:"alignLeft",label:"Align Left",icon:"format_align_left"},{name:"alignCenter",label:"Align Center",icon:"format_align_center"},{name:"alignRight",label:"Align Right",icon:"format_align_right"},{name:"alignJustify",label:"Align Justify",icon:"format_align_justify"},{name:"tableAlignLeft",label:"Table Align Left",icon:"format_align_left"},{name:"tableAlignCenter",label:"Table Align Center",icon:"format_align_center"},{name:"tableAlignRight",label:"Table Align Right",icon:"format_align_right"},{name:"tableAlignJustify",label:"Table Align Justify",icon:"format_align_justify"},{name:"indent",label:"Indent",icon:"format_indent_increase"},{name:"outdent",label:"Outdent",icon:"format_indent_decrease"},{name:"fontColor",label:"Font Color",icon:"format_color_text"},{name:"bgColor",label:"Background Color",icon:"format_color_fill"},{name:"insertTable",label:"Insert Table",icon:"table"},{name:"deleteTable",label:"Delete Table",icon:"delete_sweep"},{name:"mergeCells",label:"Merge Cells",icon:"table_chart"},{name:"splitCells",label:"Split Cells",icon:"dashboard"},{name:"addRowBefore",label:"Insert Row Above",icon:"add_box"},{name:"addRowAfter",label:"Insert Row Below",icon:"vertical_align_bottom"},{name:"deleteRow",label:"Delete Row",icon:"remove"},{name:"insertColumnLeft",label:"Insert Column Left",icon:"format_indent_decrease"},{name:"insertColumnRight",label:"Insert Column Right",icon:"format_indent_increase"},{name:"deleteColumn",label:"Delete Column",icon:"view_week"},{name:"separator"},{name:"undo",label:"Undo",icon:"undo"},{name:"redo",label:"Redo",icon:"redo"},{name:"separator"},{name:"fullScreen",label:"Full Screen",icon:"fullscreen",class:"ms-auto"},{name:"textDirection",label:"Text Direction (RTL/LTR)",icon:"format_textdirection_r_to_l"},{name:"ltrDirection",label:"Left to Right",icon:"format_textdirection_l_to_r"},{name:"rtlDirection",label:"Right to Left",icon:"format_textdirection_r_to_l"}],c3={class:"table-grid-selector p-075"},u3={class:"txt-center mb-075"},d3={style:{"font-size":"14px","font-weight":"500",color:"#333","margin-bottom":"4px"}},f3=["onFocus","onMouseenter","onClick"],m3={class:"border-top pt-075"},p3=10,h3=10,g3=n.defineComponent({__name:"TableGridSelector",emits:["insert","openAdvanced"],setup(e,{emit:t}){const o=t,r=n.ref(0),a=n.ref(0),l=n.computed(()=>{const f=[];for(let p=1;p<=p3;p++)for(let h=1;h<=h3;h++)f.push({row:p,col:h,isActive:p<=r.value&&h<=a.value});return f}),i=n.computed(()=>r.value===0||a.value===0?"Select table size":`${r.value} × ${a.value}`);function s(f,p){r.value=f,a.value=p}function c(f,p,h){o("insert",f,p),h()}function u(f){o("openAdvanced"),f()}function d(){r.value=0,a.value=0}return(f,p)=>(n.openBlock(),n.createBlock(n.unref(on),{placement:"bottom-start",thin:"",flat:"",icon:"table"},{default:n.withCtx(({hide:h})=>[n.createElementVNode("div",c3,[n.createElementVNode("div",u3,[n.createElementVNode("div",d3,n.toDisplayString(i.value),1),p[0]||(p[0]=n.createElementVNode("div",{style:{"font-size":"12px",color:"#666"}}," Hover to select size ",-1))]),n.createElementVNode("div",{style:{display:"grid","grid-template-columns":"repeat(10, 20px)","grid-template-rows":"repeat(10, 20px)",gap:"2px","margin-bottom":"12px",direction:"ltr"},onMouseleave:d,onBlur:d},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value,m=>(n.openBlock(),n.createElementBlock("div",{key:`${m.row}-${m.col}`,tabindex:"0",style:n.normalizeStyle({width:"20px",height:"20px",border:"1px solid #ddd",backgroundColor:m.isActive?"var(--bgl-primary)":"#fff",cursor:"pointer",borderRadius:"2px",transition:"background-color 0.1s ease"}),onFocus:g=>s(m),onMouseenter:g=>s(m.row,m.col),onClick:g=>c(m.row,m.col,h)},null,44,f3))),128))],32),n.createElementVNode("div",m3,[n.createVNode(n.unref(ne),{value:"Advanced Settings",icon:"settings",class:"bg-gray-30 color-black",onClick:m=>u(h)},null,8,["onClick"])])])]),_:1}))}}),v3={class:"toolbar flex gap-025 pb-05 flex-wrap",role:"toolbar",style:{position:"relative"}},y3={class:"flex flex-column p-025"},b3=n.defineComponent({__name:"EditorToolbar",props:{config:{default:()=>i3},selectedStyles:{},hideImages:{type:Boolean,default:!1},hideVideos:{type:Boolean,default:!1},hideEmbeds:{type:Boolean,default:!1},hideTables:{type:Boolean,default:!1},hideAlignment:{type:Boolean,default:!1},hideDirections:{type:Boolean,default:!1},hideH5H6:{type:Boolean,default:!1},hide:{default:()=>[]}},emits:["action"],setup(e,{emit:t}){const o=t;function r(){return e.selectedStyles.has("alignLeft")?"format_align_left":e.selectedStyles.has("alignCenter")?"format_align_center":e.selectedStyles.has("alignRight")?"format_align_right":e.selectedStyles.has("alignJustify")?"format_align_justify":"format_align_left"}function a(){return e.selectedStyles.has("alignLeft")||e.selectedStyles.has("alignCenter")||e.selectedStyles.has("alignRight")||e.selectedStyles.has("alignJustify")}function l(f){if(e.hide.includes(f))return!0;const p={image:["insertImage","image"],video:["insertVideo","video"],embed:["insertEmbed","embed"],table:["insertTable"],direction:["textDirection"],fullScreen:["fullScreen"],ul:["unorderedList"],ol:["orderedList"],splitView:["splitView"],p:["p"],align:["alignMenu"],alignment:["alignMenu"]};for(const[m,g]of Object.entries(p))if(e.hide.includes(m)&&g.includes(f))return!0;return{insertImage:e.hideImages,insertVideo:e.hideVideos,insertEmbed:e.hideEmbeds,insertTable:e.hideTables,alignMenu:e.hideAlignment,textDirection:e.hideDirections,h5:e.hideH5H6,h6:e.hideH5H6}[f]||!1}const i=f=>s3.find(p=>p.name===f);function s(f){const p=e.config.map(i).filter(Boolean);let h=-1;for(let g=f-1;g>=0;g--){const b=p[g];if(b&&b.name!=="separator"&&!l(b.name)){h=g;break}}let m=-1;for(let g=f+1;g<p.length;g++){const b=p[g];if(b&&b.name!=="separator"&&!l(b.name)){m=g;break}}if(h===-1||m===-1)return!1;for(let g=h+1;g<f;g++){const b=p[g];if(b&&b.name==="separator")return!1}return!0}function c(f,p){console.log("EditorToolbar: runAction called",{name:f,value:p}),o("action",f,p)}function u(f,p){const h=document.createElement("table");h.style.width="100%",h.style.borderCollapse="collapse",h.style.marginBottom="1rem";const m=document.createElement("thead"),g=m.insertRow();for(let v=0;v<p;v++){const y=document.createElement("th");y.innerHTML=`Header ${v+1}`,y.style.padding="8px",y.style.border="1px solid #ddd",y.style.backgroundColor="#f4f4f4",g.appendChild(y)}h.appendChild(m);const b=document.createElement("tbody");for(let v=0;v<f;v++){const y=b.insertRow();for(let _=0;_<p;_++){const $=y.insertCell();$.innerHTML=" ",$.style.padding="8px",$.style.border="1px solid #ddd"}}h.appendChild(b),o("action","insertTable",h.outerHTML)}function d(){o("action","insertTable")}return(f,p)=>{const h=n.resolveDirective("tooltip");return n.openBlock(),n.createElementBlock("div",v3,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.config.map(i).filter(Boolean),(m,g)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:g},[m.name==="insertTable"&&!l("insertTable")?(n.openBlock(),n.createBlock(g3,{key:0,onInsert:u,onOpenAdvanced:d})):m.name==="insertImage"&&!l("insertImage")?n.withDirectives((n.openBlock(),n.createBlock(n.unref(ne),{key:1,icon:m.icon,thin:"",flat:"","aria-label":m.name,class:n.normalizeClass([[m.class,{active:e.selectedStyles.has(m.name)}],""]),tabindex:"-1",onClick:b=>c(m.name)},null,8,["icon","aria-label","class","onClick"])),[[h,m.label]]):m.name==="insertVideo"&&!l("insertVideo")?n.withDirectives((n.openBlock(),n.createBlock(n.unref(ne),{key:2,icon:m.icon,thin:"",flat:"","aria-label":m.name,class:n.normalizeClass([[m.class,{active:e.selectedStyles.has(m.name)}],""]),tabindex:"-1",onClick:b=>c(m.name)},null,8,["icon","aria-label","class","onClick"])),[[h,m.label]]):m.name==="insertEmbed"&&!l("insertEmbed")?n.withDirectives((n.openBlock(),n.createBlock(n.unref(ne),{key:3,icon:m.icon,thin:"",flat:"","aria-label":m.name,class:n.normalizeClass([[m.class,{active:e.selectedStyles.has(m.name)}],""]),tabindex:"-1",onClick:b=>c(m.name)},null,8,["icon","aria-label","class","onClick"])),[[h,m.label]]):m.name==="alignMenu"&&!l("alignMenu")?(n.openBlock(),n.createBlock(n.unref(on),{key:4,placement:"bottom-start",thin:"",flat:"",icon:r(),class:n.normalizeClass({"alignment-active":a()})},{default:n.withCtx(({hide:b})=>[n.createElementVNode("div",y3,[n.createVNode(n.unref(ne),{thin:"",flat:"",icon:"format_align_left",class:n.normalizeClass({active:e.selectedStyles.has("alignLeft")}),onClick:v=>{c("alignLeft"),b()}},null,8,["class","onClick"]),n.createVNode(n.unref(ne),{thin:"",flat:"",icon:"format_align_center",class:n.normalizeClass({active:e.selectedStyles.has("alignCenter")}),onClick:v=>{c("alignCenter"),b()}},null,8,["class","onClick"]),n.createVNode(n.unref(ne),{thin:"",flat:"",icon:"format_align_right",class:n.normalizeClass({active:e.selectedStyles.has("alignRight")}),onClick:v=>{c("alignRight"),b()}},null,8,["class","onClick"]),n.createVNode(n.unref(ne),{thin:"",flat:"",icon:"format_align_justify",class:n.normalizeClass({active:e.selectedStyles.has("alignJustify")}),onClick:v=>{c("alignJustify"),b()}},null,8,["class","onClick"])])]),_:1},8,["icon","class"])):m.name==="textDirection"&&!l("textDirection")?n.withDirectives((n.openBlock(),n.createBlock(n.unref(ne),{key:5,icon:e.selectedStyles.has("textDirection")?"format_textdirection_l_to_r":"format_textdirection_r_to_l",thin:"",flat:"","aria-label":m.name,class:n.normalizeClass([[m.class,{active:e.selectedStyles.has("textDirection")}],""]),tabindex:"-1",onClick:b=>c(m.name)},null,8,["icon","aria-label","class","onClick"])),[[h,m.label]]):(m.name==="h5"||m.name==="h6")&&!l(m.name)?n.withDirectives((n.openBlock(),n.createBlock(n.unref(ne),{key:6,icon:m.icon,thin:"",flat:"","aria-label":m.name,class:n.normalizeClass([[m.class,{active:e.selectedStyles.has(m.name)}],""]),tabindex:"-1",onClick:b=>c(m.name)},null,8,["icon","aria-label","class","onClick"])),[[h,m.label]]):m.name!=="separator"&&m.name!=="insertTable"&&m.name!=="insertImage"&&m.name!=="insertVideo"&&m.name!=="insertEmbed"&&m.name!=="alignMenu"&&m.name!=="textDirection"&&m.name!=="h5"&&m.name!=="h6"&&!l(m.name)?n.withDirectives((n.openBlock(),n.createBlock(n.unref(ne),{key:7,icon:m.icon,thin:"",flat:"","aria-label":m.name,class:n.normalizeClass([[m.class,{active:e.selectedStyles.has(m.name)}],""]),tabindex:"-1",onClick:b=>c(m.name)},null,8,["icon","aria-label","class","onClick"])),[[h,m.label]]):m.name==="separator"&&s(g)?(n.openBlock(),n.createElementBlock("span",{key:`separator-${g}`,class:"opacity-2 mb-025"},"|")):n.createCommentVNode("",!0)],64))),128))])}}}),_3=Ve(b3,[["__scopeId","data-v-a3d072e5"]]);function w3(e,t){const{doc:o}=t;if(!o){console.log("No doc found");return}const r=o.getSelection();if(!r||!r.rangeCount){console.log("No selection found");return}let a=r.getRangeAt(0);if(a.collapsed){if(!$3(o,a)){console.log("Failed to select word at cursor");const{showTooltipMessage:u}=t;u?u("To add a link, please select text first or place cursor within a word"):alert("To add a link, please select text first or place the cursor within a word you want to turn into a link.");return}a=r.getRangeAt(0)}const l=a.commonAncestorContainer,i=l.nodeType===Node.TEXT_NODE?l.parentElement:l,s=i==null?void 0:i.closest("a");if(t.openLinkModal){t.openLinkModal(r,a,s);return}console.warn("Link modal not available - openLinkModal function not found"),alert("Link functionality requires proper modal setup")}function $3(e,t){if(!t.collapsed)return!0;let o=t.startContainer,r=t.startOffset;if(o.nodeType!==Node.TEXT_NODE){const c=o;if(c.childNodes.length>0&&r<c.childNodes.length){const u=c.childNodes[r];if(u.nodeType===Node.TEXT_NODE)o=u,r=0;else return!1}else return!1}const a=o.textContent||"";if(!a)return!1;let l=r,i=r;const s=/[\u0590-\u05FF\u0600-\u06FF\w]/;for(;l>0&&s.test(a[l-1]);)l--;for(;i<a.length&&s.test(a[i]);)i++;if(l<i){t.setStart(o,l),t.setEnd(o,i);const c=e.getSelection();return c&&(c.removeAllRanges(),c.addRange(t)),!0}return!1}function Df(e,t,o){if(!o.doc)return;const r=o.doc.createElement("table");r.style.width="100%",r.style.borderCollapse="collapse",r.style.marginBottom="1rem";const a=o.doc.createElement("thead"),l=a.insertRow();for(let c=0;c<t;c++){const u=o.doc.createElement("th");u.innerHTML=`Header ${c+1}`,u.style.padding="8px",u.style.border="1px solid var(--border-color, #ddd)",u.style.backgroundColor="var(--bgl-gray-light, #f4f4f4)",l.appendChild(u)}r.appendChild(a);const i=o.doc.createElement("tbody");for(let c=0;c<e;c++){const u=i.insertRow();for(let d=0;d<t;d++){const f=u.insertCell();f.innerHTML=" ",f.style.padding="8px",f.style.border="1px solid var(--border-color, #ddd)"}}r.appendChild(i);const{range:s}=o;if(s){if(s.insertNode(r),o.doc.getSelection()){const c=r.querySelector("td");if(c){s.selectNodeContents(c),s.collapse(!0);const u=o.doc.getSelection();u&&(u.removeAllRanges(),u.addRange(s))}}}else o.doc.body.appendChild(r);o.content=o.doc.body.innerHTML}function k3(e,t){var l;const o=Array.from(e.cloneContents().querySelectorAll("td"));if(o.length<2)return;const r=(l=e.startContainer.parentElement)==null?void 0:l.closest("td");if(!r)return;r.colSpan=o.length,r.innerHTML=o.map(i=>i.innerHTML).join(" "),o.slice(1).forEach(i=>{const s=t.getElementById(i.id);s==null||s.remove()});const a=t.editorState;a&&(a.content=t.body.innerHTML)}function E3(e,t){var l;const o=(l=e.startContainer.parentElement)==null?void 0:l.closest("td");if(!o||!o.colSpan||o.colSpan===1)return;const r=new Array(o.colSpan-1).fill(0).map(()=>{const i=t.createElement("td");return i.style.border="1px solid var(--border-color)",i.style.padding="8px",i.innerHTML=" ",i});o.colSpan=1,o.insertAdjacentElement("afterend",r[0]),r.slice(1).forEach(i=>{r[0].insertAdjacentElement("afterend",i)});const a=t.editorState;a&&(a.content=t.body.innerHTML)}function Af(e,t,o){var c;const r=(c=t.startContainer.parentElement)==null?void 0:c.closest("td");if(!r)return;const a=r.parentElement,l=a==null?void 0:a.parentElement;if(!a||!l)return;const i=a.cloneNode(!0);Array.from(i.cells).forEach(u=>u.innerHTML=" "),a.insertAdjacentElement(e==="before"?"beforebegin":"afterend",i);const s=o.editorState;s&&(s.content=o.body.innerHTML)}function C3(e){var l;const t=(l=e.startContainer.parentElement)==null?void 0:l.closest("td");if(!t)return;const o=t.parentElement;if(!o)return;const r=o.ownerDocument;o.remove();const a=r.editorState;a&&(a.content=r.body.innerHTML)}function S3(e){var l;const t=(l=e.startContainer.parentElement)==null?void 0:l.closest("td");if(!t)return;const o=t.closest("table");if(!o)return;const r=o.ownerDocument;o.remove();const a=r.editorState;a&&(a.content=r.body.innerHTML)}function Bf(e,t){var s;const o=(s=t.startContainer.parentElement)==null?void 0:s.closest("td");if(!o)return;const r=o.closest("table");if(!r)return;const a=o.cellIndex,{rows:l}=r;for(let c=0;c<l.length;c++){const u=l[c].insertCell(e==="after"?a+1:a);u.innerHTML=" ",u.style.border="1px solid var(--border-color)",u.style.padding="8px"}const i=r.ownerDocument.editorState;i&&(i.content=r.ownerDocument.body.innerHTML)}function x3(e){var s;const t=(s=e.startContainer.parentElement)==null?void 0:s.closest("td");if(!t)return;const o=t.closest("table");if(!o)return;const r=t.cellIndex,{rows:a}=o,l=o.ownerDocument;for(let c=0;c<a.length;c++)a[c].deleteCell(r);a[0].cells.length===0&&o.remove();const i=l.editorState;i&&(i.content=l.body.innerHTML)}function T3(e,t){var s;const o=(s=e.startContainer.parentElement)==null?void 0:s.closest("td");if(!o)return;const r=o.closest("table");if(!r)return;const a=o.cellIndex,{rows:l}=r;for(let c=0;c<l.length;c++){const u=l[c].cells[a];u&&(u.style.textAlign=t)}const i=r.ownerDocument.editorState;i&&(i.content=r.ownerDocument.body.innerHTML)}function ct(e){if(!e.doc)return null;const t=e.doc.getSelection();if(!t||!t.rangeCount)return null;const o=t.getRangeAt(0);return{selection:t,range:o}}function Ls(e,t,o){if(!t.collapsed)return!1;let r=t.startContainer,a=t.startOffset;if(r.nodeType!==Node.TEXT_NODE){const f=r;if(f.childNodes.length>0&&a<f.childNodes.length){const p=f.childNodes[a];if(p.nodeType===Node.TEXT_NODE)r=p,a=0;else return!1}else return!1}const{parentElement:l}=r,i=l==null?void 0:l.closest(o.toLowerCase());if(i)try{const f=i.parentNode;if(f){for(;i.firstChild;)f.insertBefore(i.firstChild,i);f.removeChild(i);const p=e.createRange();p.setStart(r,a),p.collapse(!0);const h=e.getSelection();return h&&(h.removeAllRanges(),h.addRange(p)),!0}}catch(f){return console.error("Error removing formatting from word:",f),!1}const s=r.textContent||"";if(!s)return!1;let c=a,u=a;const d=/[\u0590-\u05FF\u0600-\u06FF\w]/;for(a>0&&d.test(s[a-1])&&(a>=s.length||!d.test(s[a]))&&(c=a-1,u=a-1);c>0&&d.test(s[c-1]);)c--;for(;u<s.length&&d.test(s[u]);)u++;if(c<u&&u>c)try{const f=s.substring(0,c),p=s.substring(c,u),h=s.substring(u),m=e.createElement(o);m.textContent=p;const g=r.parentNode;if(g){if(f){const y=e.createTextNode(f);g.insertBefore(y,r)}if(g.insertBefore(m,r),h){const y=e.createTextNode(h);g.insertBefore(y,r)}g.removeChild(r);const b=e.createRange();b.setStartAfter(m),b.collapse(!0);const v=e.getSelection();return v&&(v.removeAllRanges(),v.addRange(b)),!0}}catch(f){console.error("Error applying formatting to word:",f)}return!1}function N3(e){if(!e.doc)return;e.content=e.doc.body.innerHTML;const t=e.doc.getSelection();t&&t.rangeCount>0&&(e.selection=t,e.range=t.getRangeAt(0).cloneRange(),e.rangeCount=t.rangeCount)}function ra(e){let t=e.nodeType===Node.TEXT_NODE?e.parentElement:e;for(;t;){if(t.matches&&t.matches("p,h1,h2,h3,h4,h5,h6,blockquote,li,div"))return t;t=t.parentElement}return null}function Qe(e,t,o){return{name:e,execute:(r,a)=>{r.doc&&(t(r,a),N3(r))},isActive:o}}function D3(e){const t={undo:Qe("Undo",()=>{if(e.undoStack.length>0&&e.doc){const p=e.undoStack.pop();p!==void 0&&(e.redoStack.push(e.content),e.content=p,e.doc.body.innerHTML=p)}}),redo:Qe("Redo",()=>{if(e.redoStack.length>0&&e.doc){const p=e.redoStack.pop();p!==void 0&&(e.undoStack.push(e.content),e.content=p,e.doc.body.innerHTML=p)}})},o={bold:Qe("Bold",p=>{const h=ct(p);if(!h)return;let{range:m,selection:g}=h;if(m.collapsed)return Ls(p.doc,m,"b"),void 0;const b=m.commonAncestorContainer,v=b.nodeType===Node.TEXT_NODE?b.parentElement:b,y=v==null?void 0:v.closest("b, strong");if(y)try{const _=y.parentNode;for(;y.firstChild;)_==null||_.insertBefore(y.firstChild,y);_==null||_.removeChild(y),g.removeAllRanges(),g.addRange(m)}catch(_){console.error("Error removing bold:",_)}else try{const _=p.doc.createElement("b");try{m.surroundContents(_)}catch{const $=m.extractContents();_.appendChild($),m.insertNode(_)}m.selectNodeContents(_),g.removeAllRanges(),g.addRange(m)}catch(_){console.error("Error applying bold:",_)}},p=>{const h=ct(p);if(!h)return!1;const m=h.range.commonAncestorContainer,g=m.nodeType===Node.TEXT_NODE?m.parentElement:m;return!!(g!=null&&g.closest("b, strong"))}),italic:Qe("Italic",p=>{const h=ct(p);if(!h)return;let{range:m,selection:g}=h;if(m.collapsed)return Ls(p.doc,m,"i"),void 0;const b=m.commonAncestorContainer,v=b.nodeType===Node.TEXT_NODE?b.parentElement:b,y=v==null?void 0:v.closest("i, em");if(y)try{const _=y.parentNode;for(;y.firstChild;)_==null||_.insertBefore(y.firstChild,y);_==null||_.removeChild(y),g.removeAllRanges(),g.addRange(m)}catch(_){console.error("Error removing italic:",_)}else try{const _=p.doc.createElement("i");try{m.surroundContents(_)}catch{const $=m.extractContents();_.appendChild($),m.insertNode(_)}m.selectNodeContents(_),g.removeAllRanges(),g.addRange(m)}catch(_){console.error("Error applying italic:",_)}},p=>{const h=ct(p);if(!h)return!1;const m=h.range.commonAncestorContainer,g=m.nodeType===Node.TEXT_NODE?m.parentElement:m;return!!(g!=null&&g.closest("i, em"))}),underline:Qe("Underline",p=>{const h=ct(p);if(!h)return;let{range:m,selection:g}=h;if(m.collapsed)return Ls(p.doc,m,"u"),void 0;const b=m.commonAncestorContainer,v=b.nodeType===Node.TEXT_NODE?b.parentElement:b,y=v==null?void 0:v.closest("u");if(y)try{const _=y.parentNode;for(;y.firstChild;)_==null||_.insertBefore(y.firstChild,y);_==null||_.removeChild(y),g.removeAllRanges(),g.addRange(m)}catch(_){console.error("Error removing underline:",_)}else try{const _=p.doc.createElement("u");try{m.surroundContents(_)}catch{const $=m.extractContents();_.appendChild($),m.insertNode(_)}m.selectNodeContents(_),g.removeAllRanges(),g.addRange(m)}catch(_){console.error("Error applying underline:",_)}},p=>{const h=ct(p);if(!h)return!1;const m=h.range.commonAncestorContainer,g=m.nodeType===Node.TEXT_NODE?m.parentElement:m;return!!(g!=null&&g.closest("u"))}),link:Qe("Link",p=>{const{openLinkModal:h}=p;h&&w3(h,p)},p=>{const h=ct(p);if(!h)return!1;const m=h.range.commonAncestorContainer,g=m.nodeType===Node.TEXT_NODE?m.parentElement:m;return!!(g!=null&&g.closest("a"))})},r=["h1","h2","h3","h4","h5","h6"].reduce((p,h)=>({...p,[h]:Qe(`Heading ${h}`,m=>{var B,P,E,S;const g=ct(m);if(!g)return;const{range:b,selection:v}=g,y=ra(b.commonAncestorContainer);if(!y)return;const{startContainer:_}=b,{endContainer:$}=b,{startOffset:w}=b,{endOffset:k}=b,C=b.collapsed,D=y.tagName.toLowerCase()===h.toLowerCase(),T=D?"p":h;try{const V=m.doc.createElement(T);for(;y.firstChild;)V.appendChild(y.firstChild);(B=y.parentNode)==null||B.replaceChild(V,y);try{const A=m.doc.createRange(),M=(te,ee,O)=>{if(te===ee)return O;if(te.nodeType===Node.TEXT_NODE){const z=m.doc.createTreeWalker(O,NodeFilter.SHOW_TEXT,null);let H=0;const Z=m.doc.createTreeWalker(ee,NodeFilter.SHOW_TEXT,null);let ie=Z.nextNode();for(;ie&&ie!==te;)H++,ie=Z.nextNode();let pe=z.nextNode(),he=0;for(;pe&&he<H;)he++,pe=z.nextNode();return pe}return O.firstChild},I=M(_,y,V),L=M($,y,V);if(I&&L){if(I.nodeType===Node.TEXT_NODE){const te=Math.min(w,((P=I.textContent)==null?void 0:P.length)||0);A.setStart(I,te)}else A.setStart(I,0);if(C)A.collapse(!0);else if(L.nodeType===Node.TEXT_NODE){const te=Math.min(k,((E=L.textContent)==null?void 0:E.length)||0);A.setEnd(L,te)}else A.setEnd(L,0);v.removeAllRanges(),v.addRange(A)}else A.selectNodeContents(V),C&&A.collapse(!0),v.removeAllRanges(),v.addRange(A)}catch(A){console.warn("Error restoring selection after heading change:",A);const M=m.doc.createRange();M.selectNodeContents(V),M.collapse(!0),v.removeAllRanges(),v.addRange(M)}if(!D&&!V.nextElementSibling){const M=m.doc.createElement("p");M.dir=V.dir||m.doc.body.dir,(S=V.parentNode)==null||S.insertBefore(M,V.nextSibling)}}catch(V){console.error(`Error applying ${h} heading:`,V)}})}),{}),a={p:Qe("Paragraph",p=>{var b;const h=ct(p);if(!h)return;const{range:m}=h,g=ra(m.commonAncestorContainer);if(g&&g.tagName.toLowerCase()!=="p")try{const v=p.doc.createElement("p");for(;g.firstChild;)v.appendChild(g.firstChild);(b=g.parentNode)==null||b.replaceChild(v,g),m.selectNodeContents(v),m.collapse(!1),h.selection.removeAllRanges(),h.selection.addRange(m)}catch(v){console.error("Error applying paragraph:",v)}}),blockquote:Qe("Blockquote",p=>{var y;const h=ct(p);if(!h)return;const{range:m}=h,g=ra(m.commonAncestorContainer);if(!g)return;const v=g.tagName.toLowerCase()==="blockquote"?"p":"blockquote";try{const _=p.doc.createElement(v);for(;g.firstChild;)_.appendChild(g.firstChild);(y=g.parentNode)==null||y.replaceChild(_,g),m.selectNodeContents(_),m.collapse(!1),h.selection.removeAllRanges(),h.selection.addRange(m)}catch(_){console.error("Error applying blockquote:",_)}})},l={orderedList:Qe("Ordered List",p=>{var v,y,_;const h=ct(p);if(!h)return;const{range:m}=h,g=ra(m.commonAncestorContainer);if(!g)return;const b=g.closest("li");if(b){const $=b.parentElement;if(!$)return;if($.tagName.toLowerCase()==="ol"){const w=p.doc.createElement("p");for(;b.firstChild;)w.appendChild(b.firstChild);(v=$.parentNode)==null||v.insertBefore(w,$),b.remove(),$.querySelector("li")||$.remove(),m.selectNodeContents(w),m.collapse(!1),h.selection.removeAllRanges(),h.selection.addRange(m);return}if($.tagName.toLowerCase()==="ul"){const w=p.doc.createElement("ol"),k=m.startOffset,C=m.startContainer;for(;$.firstChild;)w.appendChild($.firstChild);(y=$.parentNode)==null||y.replaceChild(w,$);try{const D=p.doc.createRange();D.setStart(C,k),D.collapse(!0),h.selection.removeAllRanges(),h.selection.addRange(D)}catch{const D=w.querySelector("li");if(D){const T=p.doc.createRange();T.selectNodeContents(D),T.collapse(!0),h.selection.removeAllRanges(),h.selection.addRange(T)}}return}}try{const $=p.doc.createElement("ol"),w=p.doc.createElement("li");for(;g.firstChild;)w.appendChild(g.firstChild);$.appendChild(w),(_=g.parentNode)==null||_.replaceChild($,g),m.selectNodeContents(w),m.collapse(!1),h.selection.removeAllRanges(),h.selection.addRange(m)}catch($){console.error("Error creating ordered list:",$)}}),unorderedList:Qe("Unordered List",p=>{var v,y,_;const h=ct(p);if(!h)return;const{range:m}=h,g=ra(m.commonAncestorContainer);if(!g)return;const b=g.closest("li");if(b){const $=b.parentElement;if(!$)return;if($.tagName.toLowerCase()==="ul"){const w=p.doc.createElement("p");for(;b.firstChild;)w.appendChild(b.firstChild);(v=$.parentNode)==null||v.insertBefore(w,$),b.remove(),$.querySelector("li")||$.remove(),m.selectNodeContents(w),m.collapse(!1),h.selection.removeAllRanges(),h.selection.addRange(m);return}if($.tagName.toLowerCase()==="ol"){const w=p.doc.createElement("ul"),k=m.startOffset,C=m.startContainer;for(;$.firstChild;)w.appendChild($.firstChild);(y=$.parentNode)==null||y.replaceChild(w,$);try{const D=p.doc.createRange();D.setStart(C,k),D.collapse(!0),h.selection.removeAllRanges(),h.selection.addRange(D)}catch(D){console.warn("Could not restore cursor position:",D);const T=w.querySelector("li");if(T){const B=p.doc.createRange();B.selectNodeContents(T),B.collapse(!0),h.selection.removeAllRanges(),h.selection.addRange(B)}}return}}try{const $=p.doc.createElement("ul"),w=p.doc.createElement("li");for(;g.firstChild;)w.appendChild(g.firstChild);$.appendChild(w),(_=g.parentNode)==null||_.replaceChild($,g),m.selectNodeContents(w),m.collapse(!1),h.selection.removeAllRanges(),h.selection.addRange(m)}catch($){console.error("Error creating unordered list:",$)}})},i={clear:Qe("Clear Formatting",p=>{const h=ct(p);if(!h)return;const{range:m,selection:g}=h;try{let b=function(y){return y.replace(/[\u200B-\u200D\uFEFF]/g,"").replace(/\s+/g," ").replace(/\u00A0/g," ").trim()},v=function(y){if(y.nodeType===Node.TEXT_NODE){const _=b(y.textContent||"");return p.doc.createTextNode(_)}if(y.nodeType===Node.ELEMENT_NODE){const _=y,$=_.tagName.toLowerCase(),w=["p","h1","h2","h3","h4","h5","h6","ul","ol","li","blockquote","div","table","tr","td","th","thead","tbody","b","i","u","a","img","iframe","video","audio","figure","figcaption"];if(["strong","em","span","font","strike","sub","sup","mark","del","ins","small","big"].includes($)){const C=b(_.textContent||"");return p.doc.createTextNode(C)}if(w.includes($)){const C=p.doc.createElement($);return $==="a"&&_.hasAttribute("href")?(C.setAttribute("href",_.getAttribute("href")||""),_.hasAttribute("target")&&C.setAttribute("target",_.getAttribute("target")||""),_.hasAttribute("rel")&&C.setAttribute("rel",_.getAttribute("rel")||"")):$==="img"?(_.hasAttribute("src")&&C.setAttribute("src",_.getAttribute("src")||""),_.hasAttribute("alt")&&C.setAttribute("alt",_.getAttribute("alt")||""),_.hasAttribute("width")&&C.setAttribute("width",_.getAttribute("width")||""),_.hasAttribute("height")&&C.setAttribute("height",_.getAttribute("height")||"")):$==="iframe"?(_.hasAttribute("src")&&C.setAttribute("src",_.getAttribute("src")||""),_.hasAttribute("width")&&C.setAttribute("width",_.getAttribute("width")||""),_.hasAttribute("height")&&C.setAttribute("height",_.getAttribute("height")||""),_.hasAttribute("frameborder")&&C.setAttribute("frameborder",_.getAttribute("frameborder")||""),_.hasAttribute("allowfullscreen")&&C.setAttribute("allowfullscreen",_.getAttribute("allowfullscreen")||"")):($==="video"||$==="audio")&&(_.hasAttribute("src")&&C.setAttribute("src",_.getAttribute("src")||""),_.hasAttribute("controls")&&C.setAttribute("controls",_.getAttribute("controls")||""),_.hasAttribute("width")&&C.setAttribute("width",_.getAttribute("width")||""),_.hasAttribute("height")&&C.setAttribute("height",_.getAttribute("height")||"")),Array.from(_.childNodes).forEach(D=>{var B;const T=v(D);((B=T.textContent)!=null&&B.trim()||T.nodeType===Node.ELEMENT_NODE)&&C.appendChild(T)}),C}}return p.doc.createTextNode("")};if(m.collapsed){const{body:y}=p.doc,_=p.doc.createDocumentFragment();if(Array.from(y.childNodes).forEach($=>{var k;const w=v($);((k=w.textContent)!=null&&k.trim()||w.nodeType===Node.ELEMENT_NODE)&&_.appendChild(w)}),y.innerHTML="",y.appendChild(_),!y.firstElementChild){const $=p.doc.createElement("p");y.appendChild($);const w=p.doc.createRange();w.selectNodeContents($),w.collapse(!0),g.removeAllRanges(),g.addRange(w)}}else{const y=m.cloneContents(),_=p.doc.createElement("div");_.appendChild(y);const $=p.doc.createDocumentFragment();Array.from(_.childNodes).forEach(w=>{var C;const k=v(w);((C=k.textContent)!=null&&C.trim()||k.nodeType===Node.ELEMENT_NODE)&&$.appendChild(k)}),m.deleteContents(),m.insertNode($),m.collapse(!1),g.removeAllRanges(),g.addRange(m)}}catch(b){console.error("Error clearing formatting:",b)}})},s={insertTable:Qe("Insert Table",(p,h)=>{if(console.log("insertTable command called with value:",h),p.openTableEditor&&!h){console.log("Opening table editor modal for new table"),p.openTableEditor(null);return}if(!h){const[m,g]=[3,3];Df(m,g,p);return}if(h.includes("<table")){console.log("Inserting HTML table");const m=ct(p);if(!m||!p.doc){console.error("No selection info or document");return}const{range:g}=m;try{const b=p.doc.createElement("div");b.innerHTML=h;const v=b.querySelector("table");if(v){console.log("Table parsed successfully, inserting...");const y=v.cloneNode(!0);g.insertNode(y),g.setStartAfter(y),g.collapse(!0);const _=p.doc.getSelection();_&&(_.removeAllRanges(),_.addRange(g)),console.log("Table inserted successfully")}else console.error("Could not parse table from HTML")}catch(b){console.error("Error inserting HTML table:",b)}}else{const[m,g]=h.split("x").map(Number)||[3,3];Df(m,g,p)}}),deleteTable:Qe("Delete Table",p=>p.range&&S3(p.range)),mergeCells:Qe("Merge Cells",p=>p.range&&p.doc&&k3(p.range,p.doc)),splitCells:Qe("Split Cells",p=>p.range&&p.doc&&E3(p.range,p.doc)),addRowBefore:Qe("Add Row Before",p=>p.range&&p.doc&&Af("before",p.range,p.doc)),addRowAfter:Qe("Add Row After",p=>p.range&&p.doc&&Af("after",p.range,p.doc)),deleteRow:Qe("Delete Row",p=>p.range&&C3(p.range)),insertColumnLeft:Qe("Insert Column Left",p=>p.range&&Bf("before",p.range)),insertColumnRight:Qe("Insert Column Right",p=>p.range&&Bf("after",p.range)),deleteColumn:Qe("Delete Column",p=>p.range&&x3(p.range))},c=["Left","Center","Right","Justify"].reduce((p,h)=>({...p,[`tableAlign${h}`]:Qe(`Table Align ${h}`,m=>{if(m.range){const g=h==="Left"?"start":h==="Right"?"end":h.toLowerCase();T3(m.range,g)}})}),{}),u={alignLeft:Qe("Align Left",p=>{var b;const h=ct(p);if(!h)return;const{range:m}=h,g=m.startContainer.nodeType===Node.TEXT_NODE?(b=m.startContainer.parentElement)==null?void 0:b.closest("p, h1, h2, h3, h4, h5, h6"):m.startContainer.closest("p, h1, h2, h3, h4, h5, h6");g&&(g.style.textAlign="left")},p=>{var b;const h=ct(p);if(!h)return!1;const{range:m}=h,g=m.startContainer.nodeType===Node.TEXT_NODE?(b=m.startContainer.parentElement)==null?void 0:b.closest("p, h1, h2, h3, h4, h5, h6"):m.startContainer.closest("p, h1, h2, h3, h4, h5, h6");return(g==null?void 0:g.style.textAlign)==="left"}),alignCenter:Qe("Align Center",p=>{var b;const h=ct(p);if(!h)return;const{range:m}=h,g=m.startContainer.nodeType===Node.TEXT_NODE?(b=m.startContainer.parentElement)==null?void 0:b.closest("p, h1, h2, h3, h4, h5, h6"):m.startContainer.closest("p, h1, h2, h3, h4, h5, h6");g&&(g.style.textAlign="center")},p=>{var b;const h=ct(p);if(!h)return!1;const{range:m}=h,g=m.startContainer.nodeType===Node.TEXT_NODE?(b=m.startContainer.parentElement)==null?void 0:b.closest("p, h1, h2, h3, h4, h5, h6"):m.startContainer.closest("p, h1, h2, h3, h4, h5, h6");return(g==null?void 0:g.style.textAlign)==="center"}),alignRight:Qe("Align Right",p=>{var b;const h=ct(p);if(!h)return;const{range:m}=h,g=m.startContainer.nodeType===Node.TEXT_NODE?(b=m.startContainer.parentElement)==null?void 0:b.closest("p, h1, h2, h3, h4, h5, h6"):m.startContainer.closest("p, h1, h2, h3, h4, h5, h6");g&&(g.style.textAlign="right")},p=>{var b;const h=ct(p);if(!h)return!1;const{range:m}=h,g=m.startContainer.nodeType===Node.TEXT_NODE?(b=m.startContainer.parentElement)==null?void 0:b.closest("p, h1, h2, h3, h4, h5, h6"):m.startContainer.closest("p, h1, h2, h3, h4, h5, h6");return(g==null?void 0:g.style.textAlign)==="right"}),alignJustify:Qe("Align Justify",p=>{var b;const h=ct(p);if(!h)return;const{range:m}=h,g=m.startContainer.nodeType===Node.TEXT_NODE?(b=m.startContainer.parentElement)==null?void 0:b.closest("p, h1, h2, h3, h4, h5, h6"):m.startContainer.closest("p, h1, h2, h3, h4, h5, h6");g&&(g.style.textAlign="justify")},p=>{var b;const h=ct(p);if(!h)return!1;const{range:m}=h,g=m.startContainer.nodeType===Node.TEXT_NODE?(b=m.startContainer.parentElement)==null?void 0:b.closest("p, h1, h2, h3, h4, h5, h6"):m.startContainer.closest("p, h1, h2, h3, h4, h5, h6");return(g==null?void 0:g.style.textAlign)==="justify"}),textDirection:Qe("Toggle Text Direction",p=>{var b;const h=ct(p);if(!h)return;const{range:m}=h,g=m.startContainer.nodeType===Node.TEXT_NODE?(b=m.startContainer.parentElement)==null?void 0:b.closest("p, h1, h2, h3, h4, h5, h6"):m.startContainer.closest("p, h1, h2, h3, h4, h5, h6");if(g){const v=g.dir||"ltr";g.dir=v==="ltr"?"rtl":"ltr"}},p=>{var b;const h=ct(p);if(!h)return!1;const{range:m}=h,g=m.startContainer.nodeType===Node.TEXT_NODE?(b=m.startContainer.parentElement)==null?void 0:b.closest("p, h1, h2, h3, h4, h5, h6"):m.startContainer.closest("p, h1, h2, h3, h4, h5, h6");return(g==null?void 0:g.dir)==="rtl"}),ltrDirection:Qe("Set Left to Right Direction",p=>{var b;const h=ct(p);if(!h)return;const{range:m}=h,g=m.startContainer.nodeType===Node.TEXT_NODE?(b=m.startContainer.parentElement)==null?void 0:b.closest("p, h1, h2, h3, h4, h5, h6"):m.startContainer.closest("p, h1, h2, h3, h4, h5, h6");g&&(g.dir="ltr")},p=>{var b;const h=ct(p);if(!h)return!1;const{range:m}=h,g=m.startContainer.nodeType===Node.TEXT_NODE?(b=m.startContainer.parentElement)==null?void 0:b.closest("p, h1, h2, h3, h4, h5, h6"):m.startContainer.closest("p, h1, h2, h3, h4, h5, h6");return(g==null?void 0:g.dir)==="ltr"}),rtlDirection:Qe("Set Right to Left Direction",p=>{var b;const h=ct(p);if(!h)return;const{range:m}=h,g=m.startContainer.nodeType===Node.TEXT_NODE?(b=m.startContainer.parentElement)==null?void 0:b.closest("p, h1, h2, h3, h4, h5, h6"):m.startContainer.closest("p, h1, h2, h3, h4, h5, h6");g&&(g.dir="rtl")},p=>{var b;const h=ct(p);if(!h)return!1;const{range:m}=h,g=m.startContainer.nodeType===Node.TEXT_NODE?(b=m.startContainer.parentElement)==null?void 0:b.closest("p, h1, h2, h3, h4, h5, h6"):m.startContainer.closest("p, h1, h2, h3, h4, h5, h6");return(g==null?void 0:g.dir)==="rtl"})},d={fullScreen:Qe("Full Screen",p=>{p.isFullscreen=!p.isFullscreen},p=>p.isFullscreen),splitView:Qe("Split View",p=>{p.isSplitView=!p.isSplitView},p=>p.isSplitView),codeView:Qe("Code View",p=>{p.isCodeView=!p.isCodeView},p=>p.isCodeView)},f={image:Qe("Insert Image",p=>{const{openImageModal:h}=p;h?h():console.warn("Image insertion requires modal implementation")}),video:Qe("Insert Video",p=>{const{openVideoModal:h}=p;h?h():console.warn("Video insertion requires modal implementation")}),embed:Qe("Insert Embed",p=>{const{openEmbedModal:h}=p;h?h():console.warn("Embed insertion requires modal implementation")})};return{...t,...o,...r,...a,...l,...i,...s,...c,...u,...d,...f}}function A3(e,t){return{execute(o,r){const a=t[o];a&&a.execute(e,r)},isActive(o){var a;const r=t[o];return((a=r.isActive)==null?void 0:a.call(r,e))||!1},getValue(o){var a;const r=t[o];return((a=r.getValue)==null?void 0:a.call(r,e))||null}}}function Vg(e,t){const o=t.getSelection();if(!o||!o.rangeCount)return!1;const a=o.getRangeAt(0).commonAncestorContainer,l=a.nodeType===Node.TEXT_NODE?a.parentElement:a;if(!l)return!1;const i=(u,d)=>u?d(u)?!0:i(u.parentElement,d):!1,s={bold:u=>{var f;const d=(f=u.tagName)==null?void 0:f.toLowerCase();return d==="strong"||d==="b"},italic:u=>{var f;const d=(f=u.tagName)==null?void 0:f.toLowerCase();return d==="em"||d==="i"},underline:u=>{var f;return((f=u.tagName)==null?void 0:f.toLowerCase())==="u"},h1:u=>{var d;return((d=u.tagName)==null?void 0:d.toLowerCase())==="h1"},h2:u=>{var d;return((d=u.tagName)==null?void 0:d.toLowerCase())==="h2"},h3:u=>{var d;return((d=u.tagName)==null?void 0:d.toLowerCase())==="h3"},h4:u=>{var d;return((d=u.tagName)==null?void 0:d.toLowerCase())==="h4"},h5:u=>{var d;return((d=u.tagName)==null?void 0:d.toLowerCase())==="h5"},h6:u=>{var d;return((d=u.tagName)==null?void 0:d.toLowerCase())==="h6"},p:u=>{var d;return((d=u.tagName)==null?void 0:d.toLowerCase())==="p"},blockquote:u=>{var d;return((d=u.tagName)==null?void 0:d.toLowerCase())==="blockquote"},orderedList:u=>!!u.closest("ol"),unorderedList:u=>!!u.closest("ul"),alignLeft:u=>{const d=u.closest("p, h1, h2, h3, h4, h5, h6");return(d==null?void 0:d.style.textAlign)==="start"},alignCenter:u=>{const d=u.closest("p, h1, h2, h3, h4, h5, h6");return(d==null?void 0:d.style.textAlign)==="center"},alignRight:u=>{const d=u.closest("p, h1, h2, h3, h4, h5, h6");return(d==null?void 0:d.style.textAlign)==="end"},alignJustify:u=>{const d=u.closest("p, h1, h2, h3, h4, h5, h6");return(d==null?void 0:d.style.textAlign)==="justify"},textDirection:u=>{const d=u.closest("p, h1, h2, h3, h4, h5, h6");return(d==null?void 0:d.dir)==="rtl"},ltrDirection:u=>{const d=u.closest("p, h1, h2, h3, h4, h5, h6");return(d==null?void 0:d.dir)==="ltr"},rtlDirection:u=>{const d=u.closest("p, h1, h2, h3, h4, h5, h6");return(d==null?void 0:d.dir)==="rtl"}};if(["splitView","codeView","fullScreen"].includes(e))return!1;const c=s[e];return c?i(l,c):i(l,u=>{var d;return((d=u.tagName)==null?void 0:d.toLowerCase())===e.toLowerCase()})}function B3(e,t){const o=D3(e),r=A3(e,o),a=()=>{if(!e.doc)return;const l=new Set;["bold","italic","underline","link","h1","h2","h3","h4","h5","h6","blockquote","p","orderedList","unorderedList","alignLeft","alignCenter","alignRight","alignJustify","textDirection","ltrDirection","rtlDirection"].forEach(s=>{Vg(s,e.doc)&&l.add(s)}),e.selectedStyles=l};return{execute:(l,i)=>{if(!e.doc){console.log("[useCommands] No document available, skipping command");return}if(t==null||t.logCommand(l,i),["splitView","codeView","fullScreen"].includes(l))switch(l){case"splitView":e.isSplitView=!e.isSplitView;return;case"codeView":e.isCodeView=!e.isCodeView;return;case"fullScreen":e.isFullscreen=!e.isFullscreen;return}try{e.doc.body.focus()}catch(c){console.error("[useCommands] Error focusing editor:",c)}const s=e.doc.getSelection();s!=null&&s.rangeCount&&(e.selection=s,e.range=s.getRangeAt(0).cloneRange(),e.rangeCount=s.rangeCount);try{r.execute(l,i),["splitView","codeView","fullScreen"].includes(l)||a()}catch(c){console.error("[useCommands] Error during command execution:",c)}},isActive:r.isActive,getValue:r.getValue}}class V3{constructor(t=1e3){Pe(this,"session");Pe(this,"maxActions");Pe(this,"isDevelopment");this.maxActions=t,this.session=this.createNewSession(),this.isDevelopment=!1}createNewSession(){return{id:`session_${Date.now()}`,startTime:Date.now(),actions:[]}}getNodeDescription(t){var r;if(t.nodeType===Node.TEXT_NODE)return`Text("${(r=t.textContent)==null?void 0:r.slice(0,20)}${t.textContent&&t.textContent.length>20?"...":""}")`;const o=t;return`${o.tagName.toLowerCase()}${o.id?`#${o.id}`:""}`}captureState(t){if(!t.doc||!t.selection)return{content:"",selection:null,activeStyles:[],caretPosition:null};const{selection:o}=t,r=o.rangeCount?o.getRangeAt(0):null;return{content:t.doc.body.innerHTML,selection:r?{start:r.startOffset,end:r.endOffset,collapsed:r.collapsed,text:r.toString()}:null,activeStyles:Array.from(t.selectedStyles),caretPosition:r?{node:this.getNodeDescription(r.startContainer),offset:r.startOffset}:null}}logCommand(t,o,r){this.addAction({type:"command",name:t,timestamp:Date.now(),details:{value:o},state:this.captureState(r)})}logPaste(t,o){this.addAction({type:"paste",name:"paste",timestamp:Date.now(),details:{html:t.getData("text/html"),text:t.getData("text/plain"),types:Array.from(t.types)},state:this.captureState(o)})}logKeyboard(t,o){this.addAction({type:"keyboard",name:"keypress",timestamp:Date.now(),details:{key:t.key,code:t.code,ctrl:t.ctrlKey,alt:t.altKey,shift:t.shiftKey,meta:t.metaKey},state:this.captureState(o)})}logSelection(t){this.addAction({type:"selection",name:"selection_change",timestamp:Date.now(),details:{},state:this.captureState(t)})}logInput(t,o,r){this.addAction({type:"input",name:t,timestamp:Date.now(),details:{data:o},state:this.captureState(r)})}addAction(t){this.session.actions.push(t),this.session.actions.length>this.maxActions&&this.session.actions.shift(),this.isDevelopment&&console.log("Editor Action:",t)}getSession(){return this.session}clearSession(){this.session=this.createNewSession()}exportSession(){return JSON.stringify(this.session,null,2)}downloadSession(){const t=new Blob([this.exportSession()],{type:"application/json"}),o=URL.createObjectURL(t),r=document.createElement("a");r.href=o,r.download=`editor_session_${this.session.id}.json`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(o)}exportSessionWithPrompt(t){const o={message:t||"here is a debug log, can you analyze and fix accordingly?",session:this.session};return JSON.stringify(o,null,2)}}function Vf(e){const t=document.createElement("div");t.innerHTML=e;const o=[];return t.querySelectorAll("iframe").forEach((r,a)=>{const l=`<!--iframe-${a}-->`;o.push(r.cloneNode(!0)),r.replaceWith(l)}),{html:t.innerHTML,iframes:o}}function Mf(e,t,o){const r=/<!--iframe-(\d+)-->/g;e.body.innerHTML=t.replace(r,(a,l)=>{const i=o[Number(l)];return i?i.outerHTML:""})}function M3(){let e=null;const t=n.reactive({content:"",doc:void 0,selection:null,selectedStyles:new Set,isFullscreen:!1,isSplitView:!1,isCodeView:!1,hasInit:!1,undoStack:[],redoStack:[],rangeCount:0,range:null,debug:void 0}),o={styles:()=>{if(!t.doc)return;const c=new Set;["bold","italic","underline","h1","h2","h3","h4","h5","h6","blockquote","p","orderedList","unorderedList","alignLeft","alignCenter","alignRight","alignJustify","textDirection","ltrDirection","rtlDirection"].forEach(d=>{t.doc&&Vg(d,t.doc)&&c.add(d)}),t.selectedStyles=c},content:c=>{if(!t.doc)return;t.doc.body.innerHTML!==t.content&&(t.undoStack.push(t.content),t.redoStack=[]);const d=t.doc.getSelection(),f=d!=null&&d.rangeCount?d.getRangeAt(0).cloneRange():null;if(c==="html"){const p=Vf(t.content);t.doc.body.innerHTML=p.html,setTimeout(()=>{if(t.doc&&(Mf(t.doc,t.content,p.iframes),f&&d))try{d.removeAllRanges(),d.addRange(f)}catch{}},0)}else t.doc.body.textContent=t.content},selection:()=>{if(!t.doc)return;const c=t.doc.getSelection();if(c)try{if(!t.doc.body.contains(c.anchorNode)){t.doc.body.focus();return}(!t.selection||t.selection!==c||t.rangeCount!==c.rangeCount||c.rangeCount>0&&t.range&&(t.range.startContainer!==c.getRangeAt(0).startContainer||t.range.startOffset!==c.getRangeAt(0).startOffset||t.range.endContainer!==c.getRangeAt(0).endContainer||t.range.endOffset!==c.getRangeAt(0).endOffset))&&(t.selection=c,t.rangeCount=c.rangeCount,c.rangeCount>0&&(t.range=c.getRangeAt(0).cloneRange()),o.styles())}catch{t.selection=null,t.range=null,t.rangeCount=0,t.selectedStyles=new Set}}},r={undo:()=>{if(t.undoStack.length===0)return;t.redoStack.push(t.content);const c=t.undoStack.pop();c!==void 0&&(t.content=c,o.content("html"))},redo:()=>{if(t.redoStack.length===0)return;t.undoStack.push(t.content);const c=t.redoStack.pop();c!==void 0&&(t.content=c,o.content("html"))}},a={emptyTags:c=>{var p;const u=c.createTreeWalker(c.body,NodeFilter.SHOW_ELEMENT,null),d=[];let f=u.nextNode();for(;f;){if(["br","img","hr","input"].includes(f.tagName.toLowerCase())){f=u.nextNode();continue}const h=((p=f.textContent)==null?void 0:p.trim())||"",m=f.innerHTML.trim(),g=m==="<br>"||m==="<br/>",b=m===" "||h===" ",v=!h&&!m,y=f.parentElement===c.body;(v||b||g&&!y)&&d.push(f),f=u.nextNode()}d.forEach(h=>{h.remove()})},normalizeContent:c=>{var p;const u=c.createTreeWalker(c.body,NodeFilter.SHOW_TEXT),d=[];let f;for(;f=u.nextNode();)f.parentElement===c.body&&((p=f.textContent)!=null&&p.trim())&&d.push(f);d.forEach(h=>{const m=c.createElement("p");m.dir=c.body.dir,m.appendChild(h.cloneNode()),c.body.replaceChild(m,h)})}};function l(c){e&&(e(),e=null);let u=!1;const d={input:()=>{if(u)return;u=!0;const f=c.body.innerHTML;f!==t.content&&(t.content=f),u=!1},selectionchange:()=>{u||o.selection()},mouseup:()=>{u||o.selection()},keyup:f=>{u||["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(f.key)&&o.selection()}};return Object.entries(d).forEach(([f,p])=>{c.addEventListener(f,p)}),e=()=>{Object.entries(d).forEach(([f,p])=>{c.removeEventListener(f,p)})},e}function i(c){if(t.hasInit&&e&&(e(),e=null),t.doc=c,t.hasInit=!0,c.editorState=t,t.content&&t.content.trim()&&!t.content.match(/^<p(?:\s[^>]*)?>(?:<br\s*\/?>)?\s*<\/p>$/i)){const u=Vf(t.content);c.body.innerHTML=u.html,setTimeout(()=>{t.doc&&Mf(c,t.content,u.iframes)},0)}if(a.normalizeContent(c),c.body.firstElementChild){const u=c.createRange(),d=c.getSelection();d&&(u.selectNodeContents(c.body),u.collapse(!1),d.removeAllRanges(),d.addRange(u),t.range=u.cloneRange(),t.selection=d,t.rangeCount=d.rangeCount)}else{const u=c.getSelection();if(u){const d=c.createRange();d.setStart(c.body,0),d.setEnd(c.body,0),u.removeAllRanges(),u.addRange(d),t.range=d.cloneRange(),t.selection=u,t.rangeCount=u.rangeCount}}e=l(c)}function s(){if(!t.debug){const c=new V3,u={debugger:c,logCommand:(d,f)=>{c.logCommand(d,f,t)},getSession:()=>c.getSession(),clearSession:()=>{c.clearSession()},downloadSession:()=>{c.downloadSession()},exportDebugWithPrompt:d=>c.exportSessionWithPrompt(d)};t.debug=u}}return typeof window<"u"&&window.addEventListener("beforeunload",()=>{e&&e()}),{state:t,init:i,updateState:o,history:r,initDebugger:s,cleanup:()=>{e&&(e(),e=null)}}}const L3=[{key:"b",command:"bold"},{key:"i",command:"italic"},{key:"u",command:"underline"},{key:"k",command:"link"},{key:"z",command:"undo"},{key:"z",modifiers:{shift:!0},command:"redo"},{key:"y",command:"redo"},{key:".",modifiers:{shift:!0},command:"orderedList"},{key:"/",modifiers:{shift:!0},command:"unorderedList"},{key:"]",command:"indent"},{key:"[",command:"outdent"},...Array.from({length:6},(e,t)=>({key:String(t+1),modifiers:{alt:!0},command:`h${t+1}`}))];function P3(e,t){e.addEventListener("keydown",o=>{if(!o.ctrlKey&&!o.metaKey)return;const r=L3.find(a=>{const l=a.key===o.key,i=!a.modifiers||(!a.modifiers.ctrl||o.ctrlKey||o.metaKey)&&(!a.modifiers.alt||o.altKey)&&(!a.modifiers.shift||o.shiftKey);return l&&i});r&&(o.preventDefault(),t.execute(r.command))})}const I3={key:0},O3={key:1,class:"flex pt-05"},R3={class:"inline-toolbar-content"},F3={class:"menu-header"},z3={class:"px-025"},U3={key:3,class:"context-menu-separator"},H3={class:"flex gap-05 align-items-end"},j3={class:"flex gap-1"},W3={class:"flex gap-05 w-100"},q3={class:"flex gap-1"},G3={class:"flex gap-05 w-100"},Y3={class:"grid gap-0"},X3={key:0,class:"flex gap-025 opacity-5 -mt-05"},K3={key:1,class:"grid grid-wrap-2 gap-05"},J3={class:"grid grid-wrap-2 gap-05 py-1"},Z3={class:"overflow-hidden flex justify-content-center"},Q3={class:"flex gap-05 w-100"},ex={class:"grid grid-wrap-4 m_grid-wrap-2 gap-col-1 table-editor testMe1"},tx={class:"grid-span-1"},nx={class:"flex gap-025 mt-025 radius-1 p-05 w-fit",style:{height:"var(--input-height)",background:"var(--input-bg)"}},ox={class:"grid-span-1"},rx={class:"flex gap-025 mt-025 radius-1 p-025 w-fit",style:{height:"var(--input-height)",background:"var(--input-bg)"}},ax={key:0,class:"grid-span-4 m_grid-span-2 grid-wrap-4 m_grid-wrap-2 grid gap-col-1 border-bottom pb-05 mb-05"},lx={key:1,class:"grid grid-wrap-4 m_grid-wrap-2 gap-col-1 grid-span-4 m_grid-span-2 border-bottom pb-05 mb-05"},ix=["innerHTML"],sx=n.defineComponent({inheritAttrs:!1,__name:"index",props:{modelValue:{},toolbarConfig:{},debug:{type:Boolean},label:{},height:{},basic:{type:Boolean},simple:{type:Boolean},placeholder:{},hideToolbar:{type:Boolean},hideInlineToolbar:{type:Boolean},hideImages:{type:Boolean},hideVideos:{type:Boolean},hideEmbed:{type:Boolean},hideTables:{type:Boolean},hideAlignment:{type:Boolean},hideDirections:{type:Boolean},hideH5H6:{type:Boolean},hide:{},autofocus:{type:Boolean},textColor:{},fontSize:{}},emits:["update:modelValue"],setup(e,{expose:t,emit:o}){const r=e,a=o,l=n.useAttrs(),i=n.ref(),s=M3(),c=n.ref(!1),u=n.ref(!1),d=B3(s.state,s.state.debug),f=n.ref(0),p=n.computed(()=>(f.value,typeof document<"u"&&getComputedStyle(document.documentElement).getPropertyValue("--input-color").trim()||"#000")),h=n.computed(()=>{const x=p.value;return r.textColor||(x&&x.length>0&&x!=="#000"?x:"inherit")});let m=null;n.onMounted(()=>{typeof document<"u"&&(m=new MutationObserver(x=>{let N=!1;x.forEach(j=>{if(j.type==="attributes"){const{attributeName:le}=j;(le==="data-theme"||le==="class"||le==="style")&&(N=!0)}}),N&&(f.value++,u.value&&setTimeout(()=>{re()},50))}),m.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme","class","style"]}),document.body&&m.observe(document.body,{attributes:!0,attributeFilter:["class","data-theme"]}))}),n.onBeforeUnmount(()=>{m==null||m.disconnect()}),r.debug&&typeof window<"u"&&(window.forceRichTextUpdate=()=>{f.value++},window.debugRichText=Je);const g=n.computed(()=>!(r.hideToolbar||r.basic)),b=n.computed(()=>!r.hideInlineToolbar),v=n.computed(()=>r.toolbarConfig),y=n.computed(()=>{const x=[...r.hide||[]];return r.simple&&["h1","h2","h3","h4","h5","h6","image","video","embed","ul","ol","blockquote","direction","table","alignment"].forEach(j=>{x.includes(j)||x.push(j)}),x}),_=n.ref(!1),$=n.ref({url:"",openInNewTab:!0}),w=n.ref(!1),k=n.ref({message:"",x:0,y:0});let C=null;const D=n.ref(!1),T=n.ref({src:"",alt:"",width:"",height:"",credit:"",figcaption:!1});let B=null;const P=n.ref(!1),E=n.ref({src:"",width:"560",height:"315",alt:""});let S=null;const V=n.ref(!1),A=n.ref({top:0,left:0}),M=n.ref(null),I=n.ref(!1),L=n.ref({src:"",width:"",autoplay:!1,mute:!1,controls:!0,loop:!1,aspectRatio:"16:9",customWidth:"",customHeight:"",caption:"",showCaption:!1});let te=null;const ee=n.ref(!1),O=n.ref({rows:3,cols:3,width:100,borderWidth:1,borderColor:"#dddddd",cellPadding:8,showHeaders:!0,headerBgColor:"#f4f4f4",headerTextColor:"#333333",cellBgColor:"#ffffff",cellTextColor:"#333333",alternateRows:!1,alternateRowBgColor:"#f9f9f9",alternateRowTextColor:"#333333",fixedLayout:!0,alignment:"left",direction:"ltr"}),z=n.ref(!1),H=n.ref({x:0,y:0}),Z=n.ref(null);let ie=null;const pe=n.computed(()=>{const x=O.value;let j=`<table style="${`
|
|
159
159
|
width: ${x.width}%;
|
|
160
160
|
border-collapse: collapse;
|
|
161
161
|
margin-bottom: 1rem;
|
package/dist/index.mjs
CHANGED
|
@@ -14284,7 +14284,7 @@ function zC(e = {}) {
|
|
|
14284
14284
|
if (e.disabled)
|
|
14285
14285
|
return;
|
|
14286
14286
|
const h = document.createElement("input");
|
|
14287
|
-
h.type = "file", h.multiple = !!e.multiple, h.accept = e.accept || "", h.onchange = (m) => {
|
|
14287
|
+
h.type = "file", h.multiple = !!e.multiple, h.accept = e.accept || "", e.capture !== void 0 && e.capture !== !1 && (h.capture = e.capture === !0 ? "environment" : e.capture), h.onchange = (m) => {
|
|
14288
14288
|
i(m.target.files), d && c();
|
|
14289
14289
|
}, h.click();
|
|
14290
14290
|
}
|
|
@@ -14347,6 +14347,7 @@ const jC = { class: "bagel-input" }, WC = { key: 0 }, qC = {
|
|
|
14347
14347
|
oval: { type: Boolean },
|
|
14348
14348
|
theme: { default: "dropzone" },
|
|
14349
14349
|
accept: { default: "*" },
|
|
14350
|
+
capture: { type: [Boolean, String] },
|
|
14350
14351
|
required: { type: Boolean },
|
|
14351
14352
|
disabled: { type: Boolean },
|
|
14352
14353
|
baseURL: {},
|
|
@@ -14371,6 +14372,7 @@ const jC = { class: "bagel-input" }, WC = { key: 0 }, qC = {
|
|
|
14371
14372
|
dirPath: n.dirPath,
|
|
14372
14373
|
multiple: n.multiple,
|
|
14373
14374
|
accept: n.accept,
|
|
14375
|
+
capture: n.capture,
|
|
14374
14376
|
namespace: n.id || "upload",
|
|
14375
14377
|
onFileQueued: async () => {
|
|
14376
14378
|
await s(), p();
|
|
@@ -14622,7 +14624,7 @@ const jC = { class: "bagel-input" }, WC = { key: 0 }, qC = {
|
|
|
14622
14624
|
]);
|
|
14623
14625
|
};
|
|
14624
14626
|
}
|
|
14625
|
-
}), Bi = /* @__PURE__ */ Ke(ck, [["__scopeId", "data-v-
|
|
14627
|
+
}), Bi = /* @__PURE__ */ Ke(ck, [["__scopeId", "data-v-f4bb6c01"]]), uk = [
|
|
14626
14628
|
"h1",
|
|
14627
14629
|
"h2",
|
|
14628
14630
|
"h3",
|