@jsg-developer/vue-pack 0.0.1 → 0.0.2
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/DEPENDENCY-LICENSES.txt +1 -1075
- package/dist/TabelData.vue_vue_type_script_setup_true_lang-DcKNY6tx.js +2164 -0
- package/dist/TabelData.vue_vue_type_script_setup_true_lang-OEDcnffc.cjs +1 -0
- package/dist/init.cjs.js +1 -1
- package/dist/init.es.js +1 -1
- package/dist/jsgd-vue-pack.cjs.js +1 -1
- package/dist/jsgd-vue-pack.es.js +10 -10
- package/dist/plugin/vue.cjs.js +1 -1
- package/dist/plugin/vue.es.js +41 -41
- package/dist/quill.snow-Bv2PnGeu.cjs +15 -0
- package/dist/quill.snow-CF-SW6JG.js +6297 -0
- package/dist/vue-pack.css +1 -0
- package/package.json +6 -4
- package/dist/TabelData-C_eyn6Uq.cjs +0 -1
- package/dist/TabelData-fKFaSnkC.js +0 -2142
- package/dist/TabelData.vue_vue_type_style_index_0_scoped_76b9b7a6_lang-Dtm1AO8H.js +0 -13685
- package/dist/TabelData.vue_vue_type_style_index_0_scoped_76b9b7a6_lang-jjKlGR9H.cjs +0 -64
- package/dist/jsgd-vue-pack.css +0 -7
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";const i=require("vue");function kl(n,e,t){function r(o,u){var h;Object.defineProperty(o,"_zod",{value:o._zod??{},enumerable:!1}),(h=o._zod).traits??(h.traits=new Set),o._zod.traits.add(n),e(o,u);for(const m in l.prototype)m in o||Object.defineProperty(o,m,{value:l.prototype[m].bind(o)});o._zod.constr=l,o._zod.def=u}const s=t?.Parent??Object;class a extends s{}Object.defineProperty(a,"name",{value:n});function l(o){var u;const h=t?.Parent?new a:this;r(h,o),(u=h._zod).deferred??(u.deferred=[]);for(const m of h._zod.deferred)m();return h}return Object.defineProperty(l,"init",{value:r}),Object.defineProperty(l,Symbol.hasInstance,{value:o=>t?.Parent&&o instanceof t.Parent?!0:o?._zod?.traits?.has(n)}),Object.defineProperty(l,"name",{value:n}),l}function ms(n,e){return typeof e=="bigint"?e.toString():e}const gc=(n,e)=>{n.name="$ZodError",Object.defineProperty(n,"_zod",{value:n._zod,enumerable:!1}),Object.defineProperty(n,"issues",{value:e,enumerable:!1}),n.message=JSON.stringify(e,ms,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},bc=kl("$ZodError",gc);function vc(n,e=t=>t.message){const t={},r=[];for(const s of n.issues)s.path.length>0?(t[s.path[0]]=t[s.path[0]]||[],t[s.path[0]].push(e(s))):r.push(e(s));return{formErrors:r,fieldErrors:t}}function yc(n,e){const t=e||function(a){return a.message},r={_errors:[]},s=a=>{for(const l of a.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(o=>s({issues:o}));else if(l.code==="invalid_key")s({issues:l.issues});else if(l.code==="invalid_element")s({issues:l.issues});else if(l.path.length===0)r._errors.push(t(l));else{let o=r,u=0;for(;u<l.path.length;){const h=l.path[u];u===l.path.length-1?(o[h]=o[h]||{_errors:[]},o[h]._errors.push(t(l))):o[h]=o[h]||{_errors:[]},o=o[h],u++}}};return s(n),r}const Ec=(n,e)=>{bc.init(n,e),n.name="ZodError",Object.defineProperties(n,{format:{value:t=>yc(n,t)},flatten:{value:t=>vc(n,t)},addIssue:{value:t=>{n.issues.push(t),n.message=JSON.stringify(n.issues,ms,2)}},addIssues:{value:t=>{n.issues.push(...t),n.message=JSON.stringify(n.issues,ms,2)}},isEmpty:{get(){return n.issues.length===0}}})},wc=kl("ZodError",Ec);function xc(n,e){const t=i.ref([]),r=i.inject("TableComponents")?.labels,s=i.computed(()=>`${n.field.label??n.fieldKey} ${n.field.required?r.value.required??"*":r.value.optional??"(Optional)"}`),a=(o,u)=>[...new Set([...o,...u])];return{label:s,labels:r,removedItems:t,handlers:{pushError:(o,u)=>e("push:errors",o,u),removeError:o=>e("remove:errors",o),removeChildData:o=>{t.value=a(t.value,o),e("remove-items",t.value)}},mergeNumberArrays:a}}function Sl(n,e){for(n=Math.abs(n),e=Math.abs(e);e!==0;){const t=n%e;n=e,e=t}return n||1}function ir(n,e){if(n===0||e===0)return{w:n,h:e};const t=Sl(n,e);return{w:Math.round(n/t),h:Math.round(e/t)}}function Cl(n,e){if(e===0)return`${n}:0`;const t=n/e,r={"16:9":16/9,"4:3":4/3,"3:2":3/2,"1:1":1,"21:9":21/9},s=.01;for(const[l,o]of Object.entries(r))if(Math.abs(t-o)<s)return l;const a=ir(n,e);return`${a.w}:${a.h}`}function ke(){return Math.random().toString(36).substring(2,9)}function Ll(n,e){if(Array.isArray(n)&&Array.isArray(e)){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}return n===e}function ps(n){return Array.isArray(n)?n.some(ps):n&&typeof n=="object"?Object.values(n).some(ps):typeof n=="string"?n.trim().length>0:!1}function se(n,e){return e.split(".").reduce((t,r)=>t?.[r],n)}function ut(n,e,t){const r=e.split("."),s=r.pop(),a=r.reduce((l,o)=>(l[o]||(l[o]={}),l[o]),n);a[s]=t}function Bl(n,e){const t=e.split(".");let r=n;for(let a=0;a<t.length-1;a++){if(!(t[a]in r))return;r=r[t[a]]}const s=t[t.length-1];r&&s in r&&delete r[s];for(let a=t.length-2;a>=0;a--){const l=t.slice(0,a+1).join("."),o=se(n,l);if(o&&typeof o=="object"&&Object.keys(o).length===0)Bl(n,l);else break}}function ha(n){return n==null?!0:Array.isArray(n)?n.length===0:typeof n=="object"?Object.keys(n).length===0:!1}function Il(n,e){const t=e.split("."),r=(s,a)=>{if(!a.length||!s)return ha(s);const l=a[0],o=a.slice(1),u=/^\d+$/.test(l),h=u?parseInt(l,10):-1;if(o.length===0)Array.isArray(s)&&u?h<s.length&&s.splice(h,1):typeof s=="object"&&!Array.isArray(s)&&delete s[l];else{const m=Array.isArray(s)&&u?s[h]:s[l];r(m,o)&&(Array.isArray(s)&&u?h<s.length&&s.splice(h,1):typeof s=="object"&&!Array.isArray(s)&&delete s[l])}return ha(s)};r(n,t)}function gs(n,e="optionGroupSchema"){const t=new RegExp(`(\\.?${e})+`,"g");return n.replace(t,"").replace(/\.+/g,".").replace(/^\.|\.$/g,"")}const Ol=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Dl=/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/,Ml=/^([01]\d|2[0-3]):([0-5]\d)$/,Rl=/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])T([01]\d|2[0-3]):([0-5]\d)(:[0-5]\d)?$/;function hn(n){if(!Dl.test(n))throw new Error(`Invalid DateOnly format: ${n}. Use YYYY-MM-DD`);return n}function bs(n){if(!Ml.test(n))throw new Error(`Invalid TimeOnly format: ${n}. Use HH:mm`);return n}function Tc(n){if(!Rl.test(n))throw new Error(`Invalid DateTimeString format: ${n}. Use ISO YYYY-MM-DDTHH:mm[:ss]`);return n}const Ps={en:"{label} is required",id:"{label} wajib diisi",es:"{label} es obligatorio",fr:"{label} est requis",de:"{label} ist erforderlich",pt:"{label} é obrigatório",zh:"{label} 是必填项",ja:"{label} は必須です"},er={email:{en:"Invalid email. Example: user@example.com",id:"Email tidak valid. Contoh: user@example.com",es:"Correo electrónico no válido. Ejemplo: user@example.com",fr:"Email invalide. Exemple : user@example.com",de:"Ungültige E-Mail. Beispiel: user@example.com",pt:"E-mail inválido. Exemplo: user@example.com",zh:"电子邮件无效。示例: user@example.com",ja:"無効なメール。例: user@example.com"},url:{en:"Invalid URL. Example: https://example.com",id:"URL tidak valid. Contoh: https://example.com",es:"URL no válida. Ejemplo: https://example.com",fr:"URL invalide. Exemple : https://example.com",de:"Ungültige URL. Beispiel: https://example.com",pt:"URL inválida. Exemplo: https://example.com",zh:"无效的URL。示例: https://example.com",ja:"無効なURL。例: https://example.com"},valueList:{en:"{value} is not allowed",id:"{value} tidak diperbolehkan",es:"{value} no está permitido",fr:"{value} n’est pas autorisé",de:"{value} ist nicht erlaubt",pt:"{value} não é permitido",zh:"{value} 不允许",ja:"{value} は許可されていません"},textMinLength:{en:"Text must be at least {min} characters",id:"Teks minimal {min} karakter",es:"El texto debe tener al menos {min} caracteres",fr:"Le texte doit contenir au moins {min} caractères",de:"Der Text muss mindestens {min} Zeichen lang sein",pt:"O texto deve ter pelo menos {min} caracteres",zh:"文本至少需要 {min} 个字符",ja:"テキストは最低 {min} 文字必要です"},textMaxLength:{en:"Text must be at most {max} characters",id:"Teks maksimal {max} karakter",es:"El texto debe tener como máximo {max} caracteres",fr:"Le texte doit contenir au maximum {max} caractères",de:"Der Text darf höchstens {max} Zeichen lang sein",pt:"O texto deve ter no máximo {max} caracteres",zh:"文本最多 {max} 个字符",ja:"テキストは最大 {max} 文字までです"},textPattern:{en:"Text format is invalid",id:"Format teks tidak valid",es:"El formato del texto no es válido",fr:"Le format du texte est invalide",de:"Das Textformat ist ungültig",pt:"O formato do texto é inválido",zh:"文本格式无效",ja:"テキスト形式が無効です"},numberInvalid:{en:"Invalid number",id:"Angka tidak valid",es:"Número no válido",fr:"Nombre invalide",de:"Ungültige Zahl",pt:"Número inválido",zh:"数字无效",ja:"無効な数字です"},numberInteger:{en:"Must be an integer",id:"Harus berupa bilangan bulat",es:"Debe ser un número entero",fr:"Doit être un entier",de:"Muss eine ganze Zahl sein",pt:"Deve ser um número inteiro",zh:"必须是整数",ja:"整数でなければなりません"},numberMin:{en:"Must be at least {min}",id:"Minimal {min}",es:"Debe ser al menos {min}",fr:"Doit être au moins {min}",de:"Muss mindestens {min} sein",pt:"Deve ser pelo menos {min}",zh:"必须至少为 {min}",ja:"少なくとも {min} である必要があります"},numberMax:{en:"Must be at most {max}",id:"Maksimal {max}",es:"Debe ser como máximo {max}",fr:"Doit être au maximum {max}",de:"Darf höchstens {max} sein",pt:"Deve ser no máximo {max}",zh:"必须最多为 {max}",ja:"最大 {max} でなければなりません"},passwordMin:{en:"Password must be at least {min} characters",id:"Password minimal {min} karakter",es:"La contraseña debe tener al menos {min} caracteres",fr:"Le mot de passe doit contenir au moins {min} caractères",de:"Das Passwort muss mindestens {min} Zeichen lang sein",pt:"A senha deve ter pelo menos {min} caracteres",zh:"密码至少需要 {min} 个字符",ja:"パスワードは最低 {min} 文字必要です"},passwordMax:{en:"Password must be at most {max} characters",id:"Password maksimal {max} karakter",es:"La contraseña debe tener como máximo {max} caracteres",fr:"Le mot de passe doit contenir au maximum {max} caractères",de:"Das Passwort darf höchstens {max} Zeichen lang sein",pt:"A senha deve ter no máximo {max} caracteres",zh:"密码最多 {max} 个字符",ja:"パスワードは最大 {max} 文字までです"},passwordUpper:{en:"Password must contain an uppercase letter",id:"Password harus mengandung huruf kapital",es:"La contraseña debe contener una letra mayúscula",fr:"Le mot de passe doit contenir une lettre majuscule",de:"Das Passwort muss einen Großbuchstaben enthalten",pt:"A senha deve conter uma letra maiúscula",zh:"密码必须包含大写字母",ja:"パスワードには大文字が含まれている必要があります"},passwordLower:{en:"Password must contain a lowercase letter",id:"Password harus mengandung huruf kecil",es:"La contraseña debe contener una letra minúscula",fr:"Le mot de passe doit contenir une lettre minuscule",de:"Das Passwort muss einen Kleinbuchstaben enthalten",pt:"A senha deve conter uma letra minúscula",zh:"密码必须包含小写字母",ja:"パスワードには小文字が含まれている必要があります"},passwordNumber:{en:"Password must contain a number",id:"Password harus mengandung angka",es:"La contraseña debe contener un número",fr:"Le mot de passe doit contenir un chiffre",de:"Das Passwort muss eine Zahl enthalten",pt:"A senha deve conter um número",zh:"密码必须包含数字",ja:"パスワードには数字が含まれている必要があります"},passwordSymbol:{en:"Password must contain a symbol",id:"Password harus mengandung simbol",es:"La contraseña debe contener un símbolo",fr:"Le mot de passe doit contenir un symbole",de:"Das Passwort muss ein Symbol enthalten",pt:"A senha deve conter um símbolo",zh:"密码必须包含符号",ja:"パスワードには記号が含まれている必要があります"},arrayColorMin:{en:"Select at least {min} colors",id:"Pilih minimal {min} warna",es:"Seleccione al menos {min} colores",fr:"Sélectionnez au moins {min} couleurs",de:"Wählen Sie mindestens {min} Farben",pt:"Selecione pelo menos {min} cores",zh:"请至少选择 {min} 种颜色",ja:"少なくとも {min} 色を選択してください"},arrayColorMax:{en:"Select at most {max} colors",id:"Pilih maksimal {max} warna",es:"Seleccione como máximo {max} colores",fr:"Sélectionnez au maximum {max} couleurs",de:"Wählen Sie höchstens {max} Farben",pt:"Selecione no máximo {max} cores",zh:"最多选择 {max} 种颜色",ja:"最大で {max} 色を選択してください"},arrayTagMin:{en:"Select at least {min} tags",id:"Pilih minimal {min} tag",es:"Seleccione al menos {min} etiquetas",fr:"Sélectionnez au moins {min} étiquettes",de:"Wählen Sie mindestens {min} Tags",pt:"Selecione pelo menos {min} tags",zh:"请至少选择 {min} 个标签",ja:"少なくとも {min} 個のタグを選択してください"},arrayTagMax:{en:"Select at most {max} tags",id:"Pilih maksimal {max} tag",es:"Seleccione como máximo {max} etiquetas",fr:"Sélectionnez au maximum {max} étiquettes",de:"Wählen Sie höchstens {max} Tags",pt:"Selecione no máximo {max} tags",zh:"最多选择 {max} 个标签",ja:"最大で {max} 個のタグを選択してください"},dateMin:{en:"Date must be on or after {min}",id:"Tanggal harus pada atau setelah {min}",es:"La fecha debe ser igual o posterior a {min}",fr:"La date doit être postérieure ou égale à {min}",de:"Das Datum muss am oder nach dem {min} liegen",pt:"A data deve ser em ou após {min}",zh:"日期必须在 {min} 之后或等于 {min}",ja:"{min} 以降の日付でなければなりません"},dateMax:{en:"Date must be on or before {max}",id:"Tanggal harus pada atau sebelum {max}",es:"La fecha debe ser igual o anterior a {max}",fr:"La date doit être antérieure ou égale à {max}",de:"Das Datum muss am oder vor dem {max} liegen",pt:"A data deve ser em ou antes de {max}",zh:"日期必须在 {max} 之前或等于 {max}",ja:"{max} 以前の日付でなければなりません"},timeMin:{en:"Time must be at or after {min}",id:"Waktu harus pada atau setelah {min}",es:"La hora debe ser igual o posterior a {min}",fr:"L'heure doit être postérieure ou égale à {min}",de:"Die Uhrzeit muss um oder nach {min} sein",pt:"A hora deve ser em ou após {min}",zh:"时间必须在 {min} 之后或等于 {min}",ja:"{min} 以降の時刻でなければなりません"},timeMax:{en:"Time must be at or before {max}",id:"Waktu harus pada atau sebelum {max}",es:"La hora debe ser igual o anterior a {max}",fr:"L'heure doit être antérieure ou égale à {max}",de:"Die Uhrzeit muss um oder vor {max} sein",pt:"A hora deve ser em ou antes de {max}",zh:"时间必须在 {max} 之前或等于 {max}",ja:"{max} 以前の時刻でなければなりません"},dateTimeMin:{en:"Date and time must be on or after {min}",id:"Tanggal dan waktu harus pada atau setelah {min}",es:"La fecha y hora deben ser iguales o posteriores a {min}",fr:"La date et l'heure doivent être postérieures ou égales à {min}",de:"Datum und Uhrzeit müssen am oder nach {min} liegen",pt:"A data e hora devem ser em ou após {min}",zh:"日期和时间必须在 {min} 之后或等于 {min}",ja:"{min} 以降の日付と時刻でなければなりません"},dateTimeMax:{en:"Date and time must be on or before {max}",id:"Tanggal dan waktu harus pada atau sebelum {max}",es:"La fecha y hora deben ser iguales o anteriores a {max}",fr:"La date et l'heure doivent être antérieures ou égales à {max}",de:"Datum und Uhrzeit müssen am oder vor {max} liegen",pt:"A data e hora devem ser em ou antes de {max}",zh:"日期和时间必须在 {max} 之前或等于 {max}",ja:"{max} 以前の日付と時刻でなければなりません"},imageType:{en:"Image must be in one of the allowed formats",id:"Gambar harus berformat yang diizinkan",es:"La imagen debe estar en uno de los formatos permitidos",fr:"L'image doit être dans l'un des formats autorisés",de:"Das Bild muss in einem der erlaubten Formate vorliegen",pt:"A imagem deve estar em um dos formatos permitidos",zh:"图片必须是允许的格式之一",ja:"画像は許可された形式のいずれかである必要があります"},imageMaxFiles:{en:"You can upload up to {max} images only",id:"Anda hanya dapat mengunggah maksimal {max} gambar",es:"Solo puedes subir hasta {max} imágenes",fr:"Vous pouvez télécharger jusqu’à {max} images seulement",de:"Sie können nur bis zu {max} Bilder hochladen",pt:"Você pode enviar no máximo {max} imagens",zh:"您最多只能上传 {max} 张图片",ja:"アップロードできる画像は最大 {max} 枚までです"},imageMaxSize:{en:"Image size must be less than {max} KB",id:"Ukuran gambar harus kurang dari {max} KB",es:"El tamaño de la imagen debe ser menor de {max} KB",fr:"La taille de l'image doit être inférieure à {max} Ko",de:"Die Bildgröße muss kleiner als {max} KB sein",pt:"O tamanho da imagem deve ser menor que {max} KB",zh:"图片大小必须小于 {max} KB",ja:"画像サイズは {max} KB 未満である必要があります"},imagePixel:{en:"Image size must be {width} x {height} pixels",id:"Ukuran gambar harus {width} x {height} piksel",es:"El tamaño de la imagen debe ser de {width} x {height} píxeles",fr:"La taille de l'image doit être de {width} x {height} pixels",de:"Die Bildgröße muss {width} x {height} Pixel betragen",pt:"A imagem deve ter {width} x {height} pixels",zh:"图片尺寸必须是 {width} x {height} 像素",ja:"画像サイズは {width} x {height} ピクセルである必要があります"},imageMinWidth:{en:"Image width must be at least {min}px",id:"Lebar gambar harus minimal {min}px",es:"El ancho de la imagen debe ser al menos {min}px",fr:"La largeur de l'image doit être au moins de {min}px",de:"Die Bildbreite muss mindestens {min}px betragen",pt:"A largura da imagem deve ter no mínimo {min}px",zh:"图片宽度必须至少 {min}px",ja:"画像の幅は最低 {min}px である必要があります"},imageMinHeight:{en:"Image height must be at least {min}px",id:"Tinggi gambar harus minimal {min}px",es:"La altura de la imagen debe ser al menos {min}px",fr:"La hauteur de l'image doit être au moins de {min}px",de:"Die Bildhöhe muss mindestens {min}px betragen",pt:"A altura da imagem deve ter no mínimo {min}px",zh:"图片高度必须至少 {min}px",ja:"画像の高さは最低 {min}px である必要があります"},imageMaxWidth:{en:"Image width must not exceed {max}px",id:"Lebar gambar tidak boleh melebihi {max}px",es:"El ancho de la imagen no debe superar {max}px",fr:"La largeur de l'image ne doit pas dépasser {max}px",de:"Die Bildbreite darf {max}px nicht überschreiten",pt:"A largura da imagem não pode exceder {max}px",zh:"图片宽度不能超过 {max}px",ja:"画像の幅は {max}px を超えてはいけません"},imageMaxHeight:{en:"Image height must not exceed {max}px",id:"Tinggi gambar tidak boleh melebihi {max}px",es:"La altura de la imagen no debe superar {max}px",fr:"La hauteur de l'image ne doit pas dépasser {max}px",de:"Die Bildhöhe darf {max}px nicht überschreiten",pt:"A altura da imagem não pode exceder {max}px",zh:"图片高度不能超过 {max}px",ja:"画像の高さは {max}px を超えてはいけません"},imageRatio:{en:"Image ratio must be {w}:{h}",id:"Rasio gambar harus {w}:{h}",es:"La relación de la imagen debe ser {w}:{h}",fr:"Le rapport d'image doit être {w}:{h}",de:"Das Seitenverhältnis muss {w}:{h} sein",pt:"A proporção da imagem deve ser {w}:{h}",zh:"图片比例必须为 {w}:{h}",ja:"画像の比率は {w}:{h} である必要があります"},fileType:{en:"File must be in one of the allowed formats",id:"File harus dalam format yang diizinkan",fr:"Le fichier doit être dans l'un des formats autorisés",de:"Die Datei muss in einem der erlaubten Formate vorliegen"},fileMaxSize:{en:"File size must be less than {max} KB",id:"Ukuran file harus kurang dari {max} KB",fr:"La taille du fichier doit être inférieure à {max} Ko",de:"Die Dateigröße muss kleiner als {max} KB sein"},fileMaxFiles:{en:"You can upload up to {max} files only",id:"Anda hanya dapat mengunggah maksimal {max} file",es:"Solo puedes subir hasta {max} archivos",fr:"Vous pouvez télécharger jusqu’à {max} fichiers seulement",de:"Sie können nur bis zu {max} Dateien hochladen",pt:"Você pode enviar no máximo {max} arquivos",zh:"您最多只能上传 {max} 个文件",ja:"アップロードできるファイルは最大 {max} 件までです"}},Ne={en:{lang:"en",required:"(Required)",optional:"(Optional)",noSelection:"None",search:"Search",selection:{selected:"Items are selected",selectedOne:"Item is selected",selectAll:"Select All",clear:"Clear"},placeholder:{string:"Enter text",number:"Enter number",array:"Add items",select:"Select option",richText:"Write content",password:"Enter password",email:"Enter email",tag:"Enter tags",url:"Enter URL",date:"Pick a date",time:"Pick a time",datetime:"Pick a date & time",files:"Upload files (you may select multiple)",images:"Upload images (you may select multiple)"},action:"Action",message:{notFoundDesc:"The data you are looking for could not be found.",notFound:"Data not found",noChange:"No data has changed",noItemSelected:"No data selected",error:{create:"Failed to create data",update:"Failed to update data",delete:"Failed to delete data",get:"Failed to fetch data",getAll:"Failed to fetch all data",deleteMany:"Failed to delete multiple data"},success:{create:"Data created successfully",update:"Data updated successfully",delete:"Data deleted successfully",get:"Data fetched successfully",getAll:"All data fetched successfully",deleteMany:"Multiple data deleted successfully"},process:{loading:"Loading...",create:"Creating data...",update:"Updating data...",delete:"Deleting data...",get:"Fetching data...",getAll:"Fetching all data...",deleteMany:"Deleting multiple data..."}},warning:{delete:"Delete this item?",deleteMany:"Delete selected items?"},btn:{edit:"Edit",remove:"Remove",add:"Add New",cancel:"Cancel",close:"Close",change:"Change",select:"Select",deleteMany:"Delete Many",create:"Create",update:"Update",display:"Display",next:"Next",prev:"Previous",toogle:{active:"Active",inactive:"Inactive"},submit:{create:"Submit Create",update:"Submit Update"}},title:{create:"Create Data",update:"Update Data",display:"Detail Data"}},id:{lang:"id",required:"(Wajib)",optional:"(Opsional)",noSelection:"Tidak ada",search:"Cari",selection:{selected:"Item terpilih",selectedOne:"Item dipilih",selectAll:"Pilih Semua",clear:"Bersihkan"},placeholder:{string:"Masukkan teks",number:"Masukkan angka",array:"Tambah item",select:"Pilih opsi",richText:"Tulis konten",password:"Masukkan kata sandi",email:"Masukkan email",tag:"Masukkan tag",url:"Masukkan URL",date:"Pilih tanggal",time:"Pilih waktu",datetime:"Pilih tanggal & waktu",files:"Unggah file (boleh pilih lebih dari satu)",images:"Unggah gambar (boleh pilih lebih dari satu)"},action:"Aksi",message:{notFoundDesc:"Data yang Anda cari tidak dapat ditemukan.",notFound:"Data tidak ditemukan",noChange:"Tidak ada data yang berubah",noItemSelected:"Tidak ada data yang dipilih",error:{create:"Gagal membuat data",update:"Gagal memperbarui data",delete:"Gagal menghapus data",get:"Gagal mengambil data",getAll:"Gagal mengambil semua data",deleteMany:"Gagal menghapus banyak data"},success:{create:"Berhasil membuat data",update:"Berhasil memperbarui data",delete:"Berhasil menghapus data",get:"Data berhasil diambil",getAll:"Semua data berhasil diambil",deleteMany:"Banyak data berhasil dihapus"},process:{loading:"Memuat...",create:"Membuat data...",update:"Memperbarui data...",delete:"Menghapus data...",get:"Mengambil data...",getAll:"Mengambil semua data...",deleteMany:"Menghapus banyak data..."}},warning:{delete:"Hapus item ini?",deleteMany:"Hapus item terpilih?"},btn:{edit:"Ubah",remove:"Hapus",add:"Tambah",cancel:"Batal",close:"Tutup",change:"Ganti",select:"Pilih",deleteMany:"Hapus Banyak",create:"Buat",update:"Perbarui",display:"Tampilkan",next:"Berikutnya",prev:"Sebelumnya",toogle:{active:"Aktif",inactive:"Nonaktif"},submit:{create:"Kirim Buat",update:"Kirim Perbarui"}},title:{create:"Buat Data",update:"Perbarui Data",display:"Detail Data"}},es:{lang:"es",required:"(Requerido)",optional:"(Opcional)",noSelection:"Ninguno",search:"Buscar",selection:{selected:"Elementos seleccionados",selectedOne:"Elemento seleccionado",selectAll:"Seleccionar Todo",clear:"Limpiar"},placeholder:{string:"Introducir texto",number:"Introducir número",array:"Añadir elementos",select:"Seleccionar opción",richText:"Escribir contenido",password:"Introducir contraseña",email:"Introducir correo electrónico",tag:"Introducir etiquetas",url:"Introducir URL",date:"Seleccionar fecha",time:"Seleccionar hora",datetime:"Seleccionar fecha y hora",files:"Subir archivos (puede seleccionar varios)",images:"Subir imágenes (puede seleccionar varias)"},action:"Acción",message:{notFoundDesc:"No se pudieron encontrar los datos que está buscando.",notFound:"Datos no encontrados",noChange:"No han cambiado datos",noItemSelected:"No hay datos seleccionados",error:{create:"Error al crear datos",update:"Error al actualizar datos",delete:"Error al eliminar datos",get:"Error al obtener datos",getAll:"Error al obtener todos los datos",deleteMany:"Error al eliminar múltiples datos"},success:{create:"Datos creados con éxito",update:"Datos actualizados con éxito",delete:"Datos eliminados con éxito",get:"Datos obtenidos con éxito",getAll:"Todos los datos obtenidos con éxito",deleteMany:"Múltiples datos eliminados con éxito"},process:{loading:"Cargando...",create:"Creando datos...",update:"Actualizando datos...",delete:"Eliminando datos...",get:"Obteniendo datos...",getAll:"Obteniendo todos los datos...",deleteMany:"Eliminando múltiples datos..."}},warning:{delete:"¿Eliminar este elemento?",deleteMany:"¿Eliminar elementos seleccionados?"},btn:{edit:"Editar",remove:"Eliminar",add:"Añadir Nuevo",cancel:"Cancelar",close:"Cerrar",change:"Cambiar",select:"Seleccionar",deleteMany:"Eliminar Varios",create:"Crear",update:"Actualizar",display:"Mostrar",next:"Siguiente",prev:"Anterior",toogle:{active:"Activo",inactive:"Inactivo"},submit:{create:"Enviar Creación",update:"Enviar Actualización"}},title:{create:"Crear Datos",update:"Actualizar Datos",display:"Detalle de Datos"}},fr:{lang:"fr",required:"(Requis)",optional:"(Optionnel)",noSelection:"Aucun",search:"Rechercher",selection:{selected:"Éléments sélectionnés",selectedOne:"Élément sélectionné",selectAll:"Tout Sélectionner",clear:"Effacer"},placeholder:{string:"Saisir du texte",number:"Saisir un nombre",array:"Ajouter des éléments",select:"Sélectionner une option",richText:"Écrire du contenu",password:"Saisir le mot de passe",email:"Saisir l'email",tag:"Saisir des tags",url:"Saisir l'URL",date:"Choisir une date",time:"Choisir une heure",datetime:"Choisir une date et une heure",files:"Télécharger des fichiers (sélection multiple possible)",images:"Télécharger des images (sélection multiple possible)"},action:"Action",message:{notFoundDesc:"Les données que vous recherchez n'ont pas pu être trouvées.",notFound:"Données non trouvées",noChange:"Aucune donnée n'a changé",noItemSelected:"Aucune donnée sélectionnée",error:{create:"Échec de la création des données",update:"Échec de la mise à jour des données",delete:"Échec de la suppression des données",get:"Échec de la récupération des données",getAll:"Échec de la récupération de toutes les données",deleteMany:"Échec de la suppression de plusieurs données"},success:{create:"Données créées avec succès",update:"Données mises à jour avec succès",delete:"Données supprimées avec succès",get:"Données récupérées avec succès",getAll:"Toutes les données ont été récupérées avec succès",deleteMany:"Plusieurs données supprimées avec succès"},process:{loading:"Chargement...",create:"Création des données...",update:"Mise à jour des données...",delete:"Suppression des données...",get:"Récupération des données...",getAll:"Récupération de toutes les données...",deleteMany:"Suppression de plusieurs données..."}},warning:{delete:"Supprimer cet élément ?",deleteMany:"Supprimer les éléments sélectionnés ?"},btn:{edit:"Modifier",remove:"Supprimer",add:"Ajouter",cancel:"Annuler",close:"Fermer",change:"Changer",select:"Sélectionner",deleteMany:"Supprimer Plusieurs",create:"Créer",update:"Mettre à jour",display:"Afficher",next:"Suivant",prev:"Précédent",toogle:{active:"Actif",inactive:"Inactif"},submit:{create:"Soumettre la Création",update:"Soumettre la Mise à Jour"}},title:{create:"Créer des Données",update:"Mettre à jour les Données",display:"Détail des Données"}},de:{lang:"de",required:"(Erforderlich)",optional:"(Optional)",noSelection:"Keine",search:"Suchen",selection:{selected:"Elemente ausgewählt",selectedOne:"Element ist ausgewählt",selectAll:"Alle Auswählen",clear:"Löschen"},placeholder:{string:"Text eingeben",number:"Nummer eingeben",array:"Elemente hinzufügen",select:"Option auswählen",richText:"Inhalt schreiben",password:"Passwort eingeben",email:"E-Mail eingeben",tag:"Tags eingeben",url:"URL eingeben",date:"Datum auswählen",time:"Uhrzeit auswählen",datetime:"Datum & Uhrzeit auswählen",files:"Dateien hochladen (Mehrfachauswahl möglich)",images:"Bilder hochladen (Mehrfachauswahl möglich)"},action:"Aktion",message:{notFoundDesc:"Die von Ihnen gesuchten Daten konnten nicht gefunden werden.",notFound:"Daten nicht gefunden",noChange:"Keine Daten geändert",noItemSelected:"Keine Daten ausgewählt",error:{create:"Erstellen der Daten fehlgeschlagen",update:"Aktualisieren der Daten fehlgeschlagen",delete:"Löschen der Daten fehlgeschlagen",get:"Abrufen der Daten fehlgeschlagen",getAll:"Abrufen aller Daten fehlgeschlagen",deleteMany:"Löschen mehrerer Daten fehlgeschlagen"},success:{create:"Daten erfolgreich erstellt",update:"Daten erfolgreich aktualisiert",delete:"Daten erfolgreich gelöscht",get:"Daten erfolgreich abgerufen",getAll:"Alle Daten erfolgreich abgerufen",deleteMany:"Mehrere Daten erfolgreich gelöscht"},process:{loading:"Laden...",create:"Daten werden erstellt...",update:"Daten werden aktualisiert...",delete:"Daten werden gelöscht...",get:"Daten werden abgerufen...",getAll:"Alle Daten werden abgerufen...",deleteMany:"Mehrere Daten werden gelöscht..."}},warning:{delete:"Dieses Element löschen?",deleteMany:"Ausgewählte Elemente löschen?"},btn:{edit:"Bearbeiten",remove:"Entfernen",add:"Neu Hinzufügen",cancel:"Abbrechen",close:"Schließen",change:"Ändern",select:"Auswählen",deleteMany:"Viele Löschen",create:"Erstellen",update:"Aktualisieren",display:"Anzeigen",next:"Nächste",prev:"Zurück",toogle:{active:"Aktiv",inactive:"Inaktiv"},submit:{create:"Erstellung Senden",update:"Aktualisierung Senden"}},title:{create:"Daten Erstellen",update:"Daten Aktualisieren",display:"Detail der Daten"}},pt:{lang:"pt",required:"(Obrigatório)",optional:"(Opcional)",noSelection:"Nenhum",search:"Pesquisar",selection:{selected:"Itens selecionados",selectedOne:"Item selecionado",selectAll:"Selecionar Tudo",clear:"Limpar"},placeholder:{string:"Digite o texto",number:"Digite o número",array:"Adicionar itens",select:"Selecione a opção",richText:"Escrever conteúdo",password:"Digite a senha",email:"Digite o e-mail",tag:"Digite as tags",url:"Digite a URL",date:"Escolha uma data",time:"Escolha uma hora",datetime:"Escolha uma data e hora",files:"Carregar arquivos (você pode selecionar vários)",images:"Carregar imagens (você pode selecionar várias)"},action:"Ação",message:{notFoundDesc:"Os dados que você está procurando não foram encontrados.",notFound:"Dados não encontrados",noChange:"Nenhum dado foi alterado",noItemSelected:"Nenhum dado selecionado",error:{create:"Falha ao criar dados",update:"Falha ao atualizar dados",delete:"Falha ao excluir dados",get:"Falha ao buscar dados",getAll:"Falha ao buscar todos os dados",deleteMany:"Falha ao excluir múltiplos dados"},success:{create:"Dados criados com sucesso",update:"Dados atualizados com sucesso",delete:"Dados excluídos com sucesso",get:"Dados buscados com sucesso",getAll:"Todos os dados buscados com sucesso",deleteMany:"Múltiplos dados excluídos com sucesso"},process:{loading:"Carregando...",create:"Criando dados...",update:"Atualizando dados...",delete:"Excluindo dados...",get:"Buscando dados...",getAll:"Buscando todos os dados...",deleteMany:"Excluindo múltiplos dados..."}},warning:{delete:"Excluir este item?",deleteMany:"Excluir itens selecionados?"},btn:{edit:"Editar",remove:"Remover",add:"Adicionar Novo",cancel:"Cancelar",close:"Fechar",change:"Mudar",select:"Selecionar",deleteMany:"Excluir Vários",create:"Criar",update:"Atualizar",display:"Exibir",next:"Próximo",prev:"Anterior",toogle:{active:"Ativo",inactive:"Inativo"},submit:{create:"Enviar Criação",update:"Enviar Atualização"}},title:{create:"Criar Dados",update:"Atualizar Dados",display:"Detalhe dos Dados"}},zh:{lang:"zh",required:"(必填)",optional:"(可选)",noSelection:"无",search:"搜索",selection:{selected:"已选择项目",selectedOne:"项目已选择",selectAll:"全选",clear:"清除"},placeholder:{string:"输入文本",number:"输入数字",array:"添加项目",select:"选择选项",richText:"撰写内容",password:"输入密码",email:"输入电子邮件",tag:"输入标签",url:"输入网址",date:"选择日期",time:"选择时间",datetime:"选择日期和时间",files:"上传文件(可多选)",images:"上传图片(可多选)"},action:"操作",message:{notFoundDesc:"您查找的数据不存在。",notFound:"未找到数据",noChange:"数据未更改",noItemSelected:"未选择数据",error:{create:"创建数据失败",update:"更新数据失败",delete:"删除数据失败",get:"获取数据失败",getAll:"获取所有数据失败",deleteMany:"删除多个数据失败"},success:{create:"数据创建成功",update:"数据更新成功",delete:"数据删除成功",get:"数据获取成功",getAll:"所有数据获取成功",deleteMany:"多个数据删除成功"},process:{loading:"加载中...",create:"正在创建数据...",update:"正在更新数据...",delete:"正在删除数据...",get:"正在获取数据...",getAll:"正在获取所有数据...",deleteMany:"正在删除多个数据..."}},warning:{delete:"删除此项?",deleteMany:"删除所选项?"},btn:{edit:"编辑",remove:"移除",add:"新增",cancel:"取消",close:"关闭",change:"更改",select:"选择",deleteMany:"批量删除",create:"创建",update:"更新",display:"显示",next:"下一个",prev:"上一个",toogle:{active:"激活",inactive:"停用"},submit:{create:"提交创建",update:"提交更新"}},title:{create:"创建数据",update:"更新数据",display:"数据详情"}},ja:{lang:"ja",required:"(必須)",optional:"(任意)",noSelection:"なし",search:"検索",selection:{selected:"項目が選択されました",selectedOne:"項目が選択されています",selectAll:"すべて選択",clear:"クリア"},placeholder:{string:"テキストを入力",number:"数値を入力",array:"項目を追加",select:"オプションを選択",richText:"コンテンツを作成",password:"パスワードを入力",email:"メールアドレスを入力",tag:"タグを入力",url:"URLを入力",date:"日付を選択",time:"時間を選択",datetime:"日時を選択",files:"ファイルをアップロード(複数選択可)",images:"画像をアップロード(複数選択可)"},action:"アクション",message:{notFoundDesc:"お探しのデータが見つかりませんでした。",notFound:"データが見つかりません",noChange:"データは変更されていません",noItemSelected:"データが選択されていません",error:{create:"データの作成に失敗しました",update:"データの更新に失敗しました",delete:"データの削除に失敗しました",get:"データの取得に失敗しました",getAll:"すべてのデータの取得に失敗しました",deleteMany:"複数データの削除に失敗しました"},success:{create:"データが正常に作成されました",update:"データが正常に更新されました",delete:"データが正常に削除されました",get:"データが正常に取得されました",getAll:"すべてのデータが正常に取得されました",deleteMany:"複数データが正常に削除されました"},process:{loading:"読み込み中...",create:"データを作成中...",update:"データを更新中...",delete:"データを削除中...",get:"データを取得中...",getAll:"すべてのデータを取得中...",deleteMany:"複数データを削除中..."}},warning:{delete:"この項目を削除しますか?",deleteMany:"選択した項目を削除しますか?"},btn:{edit:"編集",remove:"削除",add:"新規追加",cancel:"キャンセル",close:"閉じる",change:"変更",select:"選択",deleteMany:"複数削除",create:"作成",update:"更新",display:"表示",next:"次へ",prev:"前へ",toogle:{active:"アクティブ",inactive:"非アクティブ"},submit:{create:"作成を送信",update:"更新を送信"}},title:{create:"データ作成",update:"データ更新",display:"データ詳細"}}};function Ac(n,e){Ne[n]=e}function Nc(n,e){Ps[n]=e}function kc(n,e,t){er[n]||(er[n]={}),er[n][e]=t}function fa(n,e){return Ps[n].replace(/\{(\w+)\}/g,(r,s)=>e[s]||"")}function Sc(n,e,t,r,s){const a=i.ref({}),l=i.ref([]),o=i.ref({}),u=i.ref({}),h=i.ref({}),m=i.ref({}),p=i.ref({}),d=i.ref(!1),f=i.computed(()=>n.isUpdate?Object.keys(a.value).some(N=>{const M=a.value[N],j=h.value[N];return Array.isArray(M)&&Array.isArray(j)?JSON.stringify(M)!==JSON.stringify(j):M instanceof File?!0:M!==j}):!0);i.watch([()=>n.schema,()=>n.initialData],([N,M],[j,D])=>{(N!==j||M!==D)&&b(N)},{immediate:!0,deep:!0});function b(N=n.schema){const M={},j={},D=n.initialData??{};y(N,M,j,D),a.value=M,h.value=j}function y(N,M,j,D={},F){for(const[U,K]of Object.entries(N)){if(K.type==="optionGroupSchema"){if(K.withValue){const G=U in D?D[U]:x(K);ut(M,U,G),ut(j,U,structuredClone(i.toRaw(G)))}E(K,M,j,D);continue}if(K.type==="object"){const G=D[U]||{};M[U]={},j[U]={},y(K.schema||{},M[U],j[U],G);continue}const ne=U in D?D[U]:x(K);ut(M,U,ne),ut(j,U,structuredClone(i.toRaw(ne)))}}function E(N,M,j,D){for(const[F,U]of Object.entries(N.options))for(const[K,ne]of Object.entries(U)){const G=ne;if(G.type==="object"){const oe=D[K]||{};M[K]={},j[K]={},y(G.schema||{},M[K],j[K],oe);continue}const ae=K in D?D[K]:x(G);M[K]=ae,j[K]=structuredClone(i.toRaw(ae))}}function x(N){switch(N.type){case"image":return null;case"color":return N.single?"":[];case"optionGroupSchema":if(N.withValue)return N.typeDesign==="cekbox"?[]:"";case"date":return;case"time":return;case"dateTime":return;case"arrayObject":return[];case"tag":return[];case"imageArray":return[];case"fileArray":return[];case"toggle":return!1;case"select":return null;default:return""}}function S(N,M){const j=se(u.value,M);Ll(j,N)||ut(u.value,M,N)}function A(N){Il(u.value,N)}function L(){let N=!0;return o.value={},Object.keys(u.value).length!==0&&(N=!1),N}function O(){let N=L();function M(j,D=""){let F=!0;for(const[U,K]of Object.entries(j)){const ne=D?`${D}.${U}`:U;if(K.type==="object"){const ae=a.value[U]||{};F=W(ne,K.schema||{},ae)&&F;continue}if(K.type==="optionGroupSchema"){F=I(U,K,U)&&F;continue}F=H(U,K)&&F}return o.value.length===0&&(N=!0),F}return N=M(n.schema)&&N,o.value.length===0&&(N=!0),N}function W(N,M,j){let D=!0;for(const[F,U]of Object.entries(M)){const K=N?`${N}.${F}`:F;if(U.type==="object"){D=W(K,U.schema||{},j?.[F]||{})&&D;continue}if(U.type==="optionGroupSchema"){D=I(K,U,F)&&D;continue}H(K,U)?A(K):D=!1}return D}function H(N,M){const j=se(a.value,N);if(M.required&&$(j)){ut(o.value,N,fa(n.lang??"en",{label:M.label??N}));const D=se(o.value,N);return r("error",M.label??N,Array.isArray(D)?D:[D]),!1}else if(se(u.value,N)){ut(o.value,N,se(u.value,N));const D=se(o.value,N);return r("error",M.label??N,Array.isArray(D)?D:[D]),!1}return!0}function I(N,M,j){const D=M.typeDesign==="cekbox"&&(!Array.isArray(se(p.value,N))||se(p.value,N).length===0)||M.typeDesign!=="cekbox"&&se(m.value,N)==null;if(M.required&&D){ut(o.value,N,fa(n.lang??"en",{label:M.label??N}));const F=se(o.value,N);return F&&r("error",M.label??N,Array.isArray(F)?F:[F]),!1}if(M.typeDesign==="select"){const F=se(m.value,N);return F==null||!M.options[F]?!0:C(M.options[F],gs(N,j))}if(M.typeDesign==="cekbox"){const F=Array.isArray(se(p.value,N))?se(p.value,N):[];let U=!0;for(const K of F)M.options[K]&&(U=C(M.options[K],gs(N,j))&&U);return U}return!0}function C(N,M){let j=!0;for(const[D,F]of Object.entries(N)){const U=M?M+"."+D:D;if(F.type==="object"){const ne=se(a.value,U)||{};j=W(U,F.schema||{},ne)&&j;continue}if(!H(U,F)){j=!1;continue}}return j}function $(N){return N==null||N===""||Array.isArray(N)&&N.length===0}function v(){if(d.value=!0,!O()){d.value=!1;return}if(n.isUpdate&&!f.value){t?.value?.show("error",s?.message.noChange??"No data has changed"),setTimeout(()=>{d.value=!1},2e3);return}const N=B();e("submit",N),setTimeout(()=>{d.value=!1},2e3)}function B(){const N=n.schema,M=a.value,j=n.initialData??{},D=n.id&&n.isUpdate?{id:n.id}:{};return k(N,M,j,D)}function k(N,M,j,D={}){if(Array.isArray(N)){for(const F of N)for(const[U,K]of Object.entries(F)){if(K.type==="optionGroupSchema"){Object.assign(D,_(K,M,j,U,M?.[U]));continue}if(K.type==="object"){D[U]=k(K.schema,M?.[U]??{},j?.[U]??{});continue}D[U]=P(M?.[U],K,j?.[U])}return D}for(const[F,U]of Object.entries(N)){if(U.type==="optionGroupSchema"){Object.assign(D,_(U,M,j,F,M?.[F]));continue}if(U.type==="object"){D[F]=k(U.schema,M?.[F]??{},j?.[F]??{});continue}D[F]=P(M?.[F],U,j?.[F])}return D}function P(N,M,j){if(N instanceof File||N instanceof Blob)return N;if(Array.isArray(N))return[...i.toRaw(N)];if(typeof N=="object"&&N!==null){const D=i.toRaw(N);return Object.keys(D).length===0?null:D}if(N===""||N===void 0||N===null)return null;if(typeof j=="number"||M.type==="number"){const D=Number(N);return Number.isFinite(D)?D:null}return N}function _(N,M,j,D,F){const U={};N.withValue&&D&&(U[D]=P(F,N,j?.[D]));for(const[K,ne]of Object.entries(N.options))for(const[G,ae]of Object.entries(ne)){const oe=ae;if(oe.type==="object"){U[G]=k(oe.schema||{},M?.[G]??{},j?.[G]??{});continue}if(oe.type==="optionGroupSchema"){Object.assign(U,_(oe,M,j,G,M?.[G]));continue}U[G]=P(M?.[G],oe,j?.[G])}return U}function q(){e("cancel")}return{formData:a,errors:o,hasChanges:f,seletedOption:m,multiSelected:p,isSubmitting:d,DataChildRemove:l,initializeFormData:b,validate:O,handleSubmit:v,handleCancel:q,pushInputValidateErrorMessage:S,deleteInputValidateErrorMessage:A}}const Cc={class:"modal-header"},Lc={class:"header-content"},Bc={class:"title-section"},Ic={key:0,class:"icon-container"},Oc={key:1,class:"icon-container"},Dc={class:"modal-title"},Mc={class:"modal-body"},Rc={class:"form-fields-container"},qc={class:"modal-footer"},Vc={class:"footer-buttons"},$c={class:"btn-content"},_c=["disabled"],jc={class:"btn-content"},Pc={key:0,class:"btn-loading"},Fc=i.defineComponent({__name:"FormModal",props:{id:{},initialData:{},schema:{},isUpdate:{type:Boolean},lang:{}},emits:["submit","cancel","DataChildRemove"],setup(n,{emit:e}){const t=i.inject("TableComponents")?.loader,r=i.inject("TableComponents")?.ShowAlert,s=n,l=i.inject("TableComponents",{labels:i.ref(Ne[s.lang??"en"])}).labels,o=e,u=i.ref(!1),h=()=>{u.value=window.innerWidth<768};i.onMounted(()=>{h(),window.addEventListener("resize",h)}),i.onUnmounted(()=>{window.removeEventListener("resize",h)});const{formData:m,errors:p,seletedOption:d,multiSelected:f,handleSubmit:b,handleCancel:y,pushInputValidateErrorMessage:E,deleteInputValidateErrorMessage:x,isSubmitting:S}=Sc({id:s.id,initialData:s.initialData,schema:s.schema,isUpdate:s.isUpdate,lang:s.lang},o,t,r,l.value);return(A,L)=>(i.openBlock(),i.createBlock(i.Transition,{name:"modal-overlay",appear:""},{default:i.withCtx(()=>[i.createElementVNode("div",{class:"modal-overlay",onClick:L[3]||(L[3]=i.withModifiers((...O)=>i.unref(y)&&i.unref(y)(...O),["self"]))},[i.createVNode(i.Transition,{name:"modal-container",appear:""},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(["modal-container",{"mobile-view":u.value}])},[i.createElementVNode("div",Cc,[i.createElementVNode("div",Lc,[i.createElementVNode("div",Bc,[n.isUpdate?(i.openBlock(),i.createElementBlock("div",Ic,[...L[4]||(L[4]=[i.createElementVNode("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[i.createElementVNode("path",{d:"M11 5H6C4.89543 5 4 5.89543 4 7V18C4 19.1046 4.89543 20 6 20H17C18.1046 20 19 19.1046 19 18V13M17.5858 3.58579C18.3668 2.80474 19.6332 2.80474 20.4142 3.58579C21.1953 4.36683 21.1953 5.63316 20.4142 6.41421L11.8284 15H9L9 12.1716L17.5858 3.58579Z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):(i.openBlock(),i.createElementBlock("div",Oc,[...L[5]||(L[5]=[i.createElementVNode("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[i.createElementVNode("path",{d:"M12 5V19M5 12H19",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])),i.createElementVNode("h2",Dc,i.toDisplayString(n.isUpdate?typeof i.unref(l)?.title=="object"?i.unref(l)?.title?.update:i.unref(l)?.title:typeof i.unref(l)?.title=="object"?i.unref(l)?.title?.create:i.unref(l)?.title),1)]),i.createElementVNode("button",{class:"close-btn",onClick:L[0]||(L[0]=(...O)=>i.unref(y)&&i.unref(y)(...O)),"aria-label":"Close"},[...L[6]||(L[6]=[i.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[i.createElementVNode("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])])]),i.createElementVNode("div",Mc,[i.createElementVNode("div",Rc,[i.createVNode(i.TransitionGroup,{name:"form-field",tag:"div"},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.schema,(O,W)=>(i.openBlock(),i.createBlock(i.unref(Rr),{key:W,field:O,"field-key":W,"form-data":i.unref(m),"is-update":n.isUpdate,errors:i.unref(p),lang:n.lang??"en","onUpdate:modelValue":(H,I)=>{i.unref(se)(i.unref(m),I)!==H&&i.unref(ut)(i.unref(m),I,H)},"onPush:errors":i.unref(E),"onRemove:errors":i.unref(x),onMultiSelectedChange:(H,I)=>{i.unref(ut)(i.unref(f),I,H)},onSelectedOptionChange:(H,I)=>{i.unref(ut)(i.unref(d),I,H)}},null,8,["field","field-key","form-data","is-update","errors","lang","onUpdate:modelValue","onPush:errors","onRemove:errors","onMultiSelectedChange","onSelectedOptionChange"]))),128))]),_:1})])]),i.createElementVNode("div",qc,[i.createElementVNode("div",Vc,[i.createElementVNode("button",{type:"button",onClick:L[1]||(L[1]=(...O)=>i.unref(y)&&i.unref(y)(...O)),class:"btn btn-cancel"},[i.createElementVNode("span",$c,[L[7]||(L[7]=i.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[i.createElementVNode("path",{d:"M6 18L18 6M6 6L18 18",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)),i.createTextVNode(" "+i.toDisplayString(i.unref(l)?.btn?.cancel??"Cancel"),1)])]),i.createElementVNode("button",{type:"submit",onClick:L[2]||(L[2]=(...O)=>i.unref(b)&&i.unref(b)(...O)),class:"btn btn-submit",disabled:i.unref(S)},[i.createElementVNode("span",jc,[L[8]||(L[8]=i.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[i.createElementVNode("path",{d:"M20 6L9 17L4 12",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)),i.createTextVNode(" "+i.toDisplayString(n.isUpdate?typeof i.unref(l)?.btn?.submit=="object"?i.unref(l)?.btn?.submit?.update:i.unref(l)?.btn?.submit:typeof i.unref(l)?.btn?.submit=="object"?i.unref(l)?.btn?.submit?.create:i.unref(l)?.btn?.submit),1)]),i.unref(S)?(i.openBlock(),i.createElementBlock("span",Pc,[...L[9]||(L[9]=[i.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[i.createElementVNode("path",{d:"M12 2V6M12 18V22M6 12H2M22 12H18M19.0784 19.0784L16.25 16.25M19.0784 4.99994L16.25 7.82837M4.92157 19.0784L7.75 16.25M4.92157 4.99994L7.75 7.82837",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):i.createCommentVNode("",!0)],8,_c)])])],2)]),_:1})])]),_:1}))}}),we=(n,e)=>{const t=n.__vccOpts||n;for(const[r,s]of e)t[r]=s;return t},Fs=we(Fc,[["__scopeId","data-v-63247d47"]]);function z(n,e,t){let r=er[n][t??"en"]||er[n].en;if(e)for(const[s,a]of Object.entries(e))r=r.replace(`{${s}}`,String(a));return r}/*! @license DOMPurify 3.2.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.7/LICENSE */const{entries:ql,setPrototypeOf:ma,isFrozen:Uc,getPrototypeOf:zc,getOwnPropertyDescriptor:Hc}=Object;let{freeze:We,seal:pt,create:Vl}=Object,{apply:vs,construct:ys}=typeof Reflect<"u"&&Reflect;We||(We=function(e){return e});pt||(pt=function(e){return e});vs||(vs=function(e,t){for(var r=arguments.length,s=new Array(r>2?r-2:0),a=2;a<r;a++)s[a-2]=arguments[a];return e.apply(t,s)});ys||(ys=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];return new e(...r)});const Xr=Ze(Array.prototype.forEach),Kc=Ze(Array.prototype.lastIndexOf),pa=Ze(Array.prototype.pop),gr=Ze(Array.prototype.push),Gc=Ze(Array.prototype.splice),ci=Ze(String.prototype.toLowerCase),Wi=Ze(String.prototype.toString),Zi=Ze(String.prototype.match),br=Ze(String.prototype.replace),Wc=Ze(String.prototype.indexOf),Zc=Ze(String.prototype.trim),wt=Ze(Object.prototype.hasOwnProperty),He=Ze(RegExp.prototype.test),vr=Yc(TypeError);function Ze(n){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];return vs(n,e,r)}}function Yc(n){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return ys(n,t)}}function le(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ci;ma&&ma(n,null);let r=e.length;for(;r--;){let s=e[r];if(typeof s=="string"){const a=t(s);a!==s&&(Uc(e)||(e[r]=a),s=a)}n[s]=!0}return n}function Xc(n){for(let e=0;e<n.length;e++)wt(n,e)||(n[e]=null);return n}function Wt(n){const e=Vl(null);for(const[t,r]of ql(n))wt(n,t)&&(Array.isArray(r)?e[t]=Xc(r):r&&typeof r=="object"&&r.constructor===Object?e[t]=Wt(r):e[t]=r);return e}function yr(n,e){for(;n!==null;){const r=Hc(n,e);if(r){if(r.get)return Ze(r.get);if(typeof r.value=="function")return Ze(r.value)}n=zc(n)}function t(){return null}return t}const ga=We(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Yi=We(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","slot","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Xi=We(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Jc=We(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ji=We(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Qc=We(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ba=We(["#text"]),va=We(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Qi=We(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ya=We(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Jr=We(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),eu=pt(/\{\{[\w\W]*|[\w\W]*\}\}/gm),tu=pt(/<%[\w\W]*|[\w\W]*%>/gm),nu=pt(/\$\{[\w\W]*/gm),ru=pt(/^data-[\-\w.\u00B7-\uFFFF]+$/),iu=pt(/^aria-[\-\w]+$/),$l=pt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),su=pt(/^(?:\w+script|data):/i),au=pt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),_l=pt(/^html$/i),lu=pt(/^[a-z][.\w]*(-[.\w]+)+$/i);var Ea=Object.freeze({__proto__:null,ARIA_ATTR:iu,ATTR_WHITESPACE:au,CUSTOM_ELEMENT:lu,DATA_ATTR:ru,DOCTYPE_NAME:_l,ERB_EXPR:tu,IS_ALLOWED_URI:$l,IS_SCRIPT_OR_DATA:su,MUSTACHE_EXPR:eu,TMPLIT_EXPR:nu});const Er={element:1,text:3,progressingInstruction:7,comment:8,document:9},ou=function(){return typeof window>"u"?null:window},cu=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;const s="data-tt-policy-suffix";t&&t.hasAttribute(s)&&(r=t.getAttribute(s));const a="dompurify"+(r?"#"+r:"");try{return e.createPolicy(a,{createHTML(l){return l},createScriptURL(l){return l}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},wa=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function jl(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ou();const e=ee=>jl(ee);if(e.version="3.2.7",e.removed=[],!n||!n.document||n.document.nodeType!==Er.document||!n.Element)return e.isSupported=!1,e;let{document:t}=n;const r=t,s=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:l,Node:o,Element:u,NodeFilter:h,NamedNodeMap:m=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:p,DOMParser:d,trustedTypes:f}=n,b=u.prototype,y=yr(b,"cloneNode"),E=yr(b,"remove"),x=yr(b,"nextSibling"),S=yr(b,"childNodes"),A=yr(b,"parentNode");if(typeof l=="function"){const ee=t.createElement("template");ee.content&&ee.content.ownerDocument&&(t=ee.content.ownerDocument)}let L,O="";const{implementation:W,createNodeIterator:H,createDocumentFragment:I,getElementsByTagName:C}=t,{importNode:$}=r;let v=wa();e.isSupported=typeof ql=="function"&&typeof A=="function"&&W&&W.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:B,ERB_EXPR:k,TMPLIT_EXPR:P,DATA_ATTR:_,ARIA_ATTR:q,IS_SCRIPT_OR_DATA:N,ATTR_WHITESPACE:M,CUSTOM_ELEMENT:j}=Ea;let{IS_ALLOWED_URI:D}=Ea,F=null;const U=le({},[...ga,...Yi,...Xi,...Ji,...ba]);let K=null;const ne=le({},[...va,...Qi,...ya,...Jr]);let G=Object.seal(Vl(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ae=null,oe=null,re=!0,ue=!0,de=!1,he=!0,ce=!1,fe=!0,be=!1,Se=!1,$t=!1,gt=!1,Qt=!1,en=!1,_t=!0,tn=!1;const jn="user-content-";let nn=!0,Ve=!1,Qe={},Lt=null;const Bt=le({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let jt=null;const rn=le({},["audio","video","img","source","image","track"]);let $e=null;const xn=le({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Pt="http://www.w3.org/1998/Math/MathML",sn="http://www.w3.org/2000/svg",Ue="http://www.w3.org/1999/xhtml";let et=Ue,an=!1,It=null;const Ft=le({},[Pt,sn,Ue],Wi);let _e=le({},["mi","mo","mn","ms","mtext"]),bt=le({},["annotation-xml"]);const Tn=le({},["title","style","font","a","script"]);let tt=null;const An=["application/xhtml+xml","text/html"],Ut="text/html";let xe=null,lt=null;const Nn=t.createElement("form"),vt=function(T){return T instanceof RegExp||T instanceof Function},ln=function(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(lt&<===T)){if((!T||typeof T!="object")&&(T={}),T=Wt(T),tt=An.indexOf(T.PARSER_MEDIA_TYPE)===-1?Ut:T.PARSER_MEDIA_TYPE,xe=tt==="application/xhtml+xml"?Wi:ci,F=wt(T,"ALLOWED_TAGS")?le({},T.ALLOWED_TAGS,xe):U,K=wt(T,"ALLOWED_ATTR")?le({},T.ALLOWED_ATTR,xe):ne,It=wt(T,"ALLOWED_NAMESPACES")?le({},T.ALLOWED_NAMESPACES,Wi):Ft,$e=wt(T,"ADD_URI_SAFE_ATTR")?le(Wt(xn),T.ADD_URI_SAFE_ATTR,xe):xn,jt=wt(T,"ADD_DATA_URI_TAGS")?le(Wt(rn),T.ADD_DATA_URI_TAGS,xe):rn,Lt=wt(T,"FORBID_CONTENTS")?le({},T.FORBID_CONTENTS,xe):Bt,ae=wt(T,"FORBID_TAGS")?le({},T.FORBID_TAGS,xe):Wt({}),oe=wt(T,"FORBID_ATTR")?le({},T.FORBID_ATTR,xe):Wt({}),Qe=wt(T,"USE_PROFILES")?T.USE_PROFILES:!1,re=T.ALLOW_ARIA_ATTR!==!1,ue=T.ALLOW_DATA_ATTR!==!1,de=T.ALLOW_UNKNOWN_PROTOCOLS||!1,he=T.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ce=T.SAFE_FOR_TEMPLATES||!1,fe=T.SAFE_FOR_XML!==!1,be=T.WHOLE_DOCUMENT||!1,gt=T.RETURN_DOM||!1,Qt=T.RETURN_DOM_FRAGMENT||!1,en=T.RETURN_TRUSTED_TYPE||!1,$t=T.FORCE_BODY||!1,_t=T.SANITIZE_DOM!==!1,tn=T.SANITIZE_NAMED_PROPS||!1,nn=T.KEEP_CONTENT!==!1,Ve=T.IN_PLACE||!1,D=T.ALLOWED_URI_REGEXP||$l,et=T.NAMESPACE||Ue,_e=T.MATHML_TEXT_INTEGRATION_POINTS||_e,bt=T.HTML_INTEGRATION_POINTS||bt,G=T.CUSTOM_ELEMENT_HANDLING||{},T.CUSTOM_ELEMENT_HANDLING&&vt(T.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(G.tagNameCheck=T.CUSTOM_ELEMENT_HANDLING.tagNameCheck),T.CUSTOM_ELEMENT_HANDLING&&vt(T.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(G.attributeNameCheck=T.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),T.CUSTOM_ELEMENT_HANDLING&&typeof T.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(G.allowCustomizedBuiltInElements=T.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ce&&(ue=!1),Qt&&(gt=!0),Qe&&(F=le({},ba),K=[],Qe.html===!0&&(le(F,ga),le(K,va)),Qe.svg===!0&&(le(F,Yi),le(K,Qi),le(K,Jr)),Qe.svgFilters===!0&&(le(F,Xi),le(K,Qi),le(K,Jr)),Qe.mathMl===!0&&(le(F,Ji),le(K,ya),le(K,Jr))),T.ADD_TAGS&&(F===U&&(F=Wt(F)),le(F,T.ADD_TAGS,xe)),T.ADD_ATTR&&(K===ne&&(K=Wt(K)),le(K,T.ADD_ATTR,xe)),T.ADD_URI_SAFE_ATTR&&le($e,T.ADD_URI_SAFE_ATTR,xe),T.FORBID_CONTENTS&&(Lt===Bt&&(Lt=Wt(Lt)),le(Lt,T.FORBID_CONTENTS,xe)),nn&&(F["#text"]=!0),be&&le(F,["html","head","body"]),F.table&&(le(F,["tbody"]),delete ae.tbody),T.TRUSTED_TYPES_POLICY){if(typeof T.TRUSTED_TYPES_POLICY.createHTML!="function")throw vr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof T.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw vr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');L=T.TRUSTED_TYPES_POLICY,O=L.createHTML("")}else L===void 0&&(L=cu(f,s)),L!==null&&typeof O=="string"&&(O=L.createHTML(""));We&&We(T),lt=T}},ot=le({},[...Yi,...Xi,...Jc]),Pn=le({},[...Ji,...Qc]),cr=function(T){let Z=A(T);(!Z||!Z.tagName)&&(Z={namespaceURI:et,tagName:"template"});const Y=ci(T.tagName),ve=ci(Z.tagName);return It[T.namespaceURI]?T.namespaceURI===sn?Z.namespaceURI===Ue?Y==="svg":Z.namespaceURI===Pt?Y==="svg"&&(ve==="annotation-xml"||_e[ve]):!!ot[Y]:T.namespaceURI===Pt?Z.namespaceURI===Ue?Y==="math":Z.namespaceURI===sn?Y==="math"&&bt[ve]:!!Pn[Y]:T.namespaceURI===Ue?Z.namespaceURI===sn&&!bt[ve]||Z.namespaceURI===Pt&&!_e[ve]?!1:!Pn[Y]&&(Tn[Y]||!ot[Y]):!!(tt==="application/xhtml+xml"&&It[T.namespaceURI]):!1},Xe=function(T){gr(e.removed,{element:T});try{A(T).removeChild(T)}catch{E(T)}},ct=function(T,Z){try{gr(e.removed,{attribute:Z.getAttributeNode(T),from:Z})}catch{gr(e.removed,{attribute:null,from:Z})}if(Z.removeAttribute(T),T==="is")if(gt||Qt)try{Xe(Z)}catch{}else try{Z.setAttribute(T,"")}catch{}},on=function(T){let Z=null,Y=null;if($t)T="<remove></remove>"+T;else{const Te=Zi(T,/^[\r\n\t ]+/);Y=Te&&Te[0]}tt==="application/xhtml+xml"&&et===Ue&&(T='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+T+"</body></html>");const ve=L?L.createHTML(T):T;if(et===Ue)try{Z=new d().parseFromString(ve,tt)}catch{}if(!Z||!Z.documentElement){Z=W.createDocument(et,"template",null);try{Z.documentElement.innerHTML=an?O:ve}catch{}}const Le=Z.body||Z.documentElement;return T&&Y&&Le.insertBefore(t.createTextNode(Y),Le.childNodes[0]||null),et===Ue?C.call(Z,be?"html":"body")[0]:be?Z.documentElement:Le},Ce=function(T){return H.call(T.ownerDocument||T,T,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},kn=function(T){return T instanceof p&&(typeof T.nodeName!="string"||typeof T.textContent!="string"||typeof T.removeChild!="function"||!(T.attributes instanceof m)||typeof T.removeAttribute!="function"||typeof T.setAttribute!="function"||typeof T.namespaceURI!="string"||typeof T.insertBefore!="function"||typeof T.hasChildNodes!="function")},Fn=function(T){return typeof o=="function"&&T instanceof o};function nt(ee,T,Z){Xr(ee,Y=>{Y.call(e,T,Z,lt)})}const Un=function(T){let Z=null;if(nt(v.beforeSanitizeElements,T,null),kn(T))return Xe(T),!0;const Y=xe(T.nodeName);if(nt(v.uponSanitizeElement,T,{tagName:Y,allowedTags:F}),fe&&T.hasChildNodes()&&!Fn(T.firstElementChild)&&He(/<[/\w!]/g,T.innerHTML)&&He(/<[/\w!]/g,T.textContent)||T.nodeType===Er.progressingInstruction||fe&&T.nodeType===Er.comment&&He(/<[/\w]/g,T.data))return Xe(T),!0;if(!F[Y]||ae[Y]){if(!ae[Y]&&Ie(Y)&&(G.tagNameCheck instanceof RegExp&&He(G.tagNameCheck,Y)||G.tagNameCheck instanceof Function&&G.tagNameCheck(Y)))return!1;if(nn&&!Lt[Y]){const ve=A(T)||T.parentNode,Le=S(T)||T.childNodes;if(Le&&ve){const Te=Le.length;for(let De=Te-1;De>=0;--De){const rt=y(Le[De],!0);rt.__removalCount=(T.__removalCount||0)+1,ve.insertBefore(rt,x(T))}}}return Xe(T),!0}return T instanceof u&&!cr(T)||(Y==="noscript"||Y==="noembed"||Y==="noframes")&&He(/<\/no(script|embed|frames)/i,T.innerHTML)?(Xe(T),!0):(ce&&T.nodeType===Er.text&&(Z=T.textContent,Xr([B,k,P],ve=>{Z=br(Z,ve," ")}),T.textContent!==Z&&(gr(e.removed,{element:T.cloneNode()}),T.textContent=Z)),nt(v.afterSanitizeElements,T,null),!1)},zn=function(T,Z,Y){if(_t&&(Z==="id"||Z==="name")&&(Y in t||Y in Nn))return!1;if(!(ue&&!oe[Z]&&He(_,Z))){if(!(re&&He(q,Z))){if(!K[Z]||oe[Z]){if(!(Ie(T)&&(G.tagNameCheck instanceof RegExp&&He(G.tagNameCheck,T)||G.tagNameCheck instanceof Function&&G.tagNameCheck(T))&&(G.attributeNameCheck instanceof RegExp&&He(G.attributeNameCheck,Z)||G.attributeNameCheck instanceof Function&&G.attributeNameCheck(Z,T))||Z==="is"&&G.allowCustomizedBuiltInElements&&(G.tagNameCheck instanceof RegExp&&He(G.tagNameCheck,Y)||G.tagNameCheck instanceof Function&&G.tagNameCheck(Y))))return!1}else if(!$e[Z]){if(!He(D,br(Y,M,""))){if(!((Z==="src"||Z==="xlink:href"||Z==="href")&&T!=="script"&&Wc(Y,"data:")===0&&jt[T])){if(!(de&&!He(N,br(Y,M,"")))){if(Y)return!1}}}}}}return!0},Ie=function(T){return T!=="annotation-xml"&&Zi(T,j)},Hn=function(T){nt(v.beforeSanitizeAttributes,T,null);const{attributes:Z}=T;if(!Z||kn(T))return;const Y={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:K,forceKeepAttr:void 0};let ve=Z.length;for(;ve--;){const Le=Z[ve],{name:Te,namespaceURI:De,value:rt}=Le,it=xe(Te),cn=rt;let Ae=Te==="value"?cn:Zc(cn);if(Y.attrName=it,Y.attrValue=Ae,Y.keepAttr=!0,Y.forceKeepAttr=void 0,nt(v.uponSanitizeAttribute,T,Y),Ae=Y.attrValue,tn&&(it==="id"||it==="name")&&(ct(Te,T),Ae=jn+Ae),fe&&He(/((--!?|])>)|<\/(style|title|textarea)/i,Ae)){ct(Te,T);continue}if(it==="attributename"&&Zi(Ae,"href")){ct(Te,T);continue}if(Y.forceKeepAttr)continue;if(!Y.keepAttr){ct(Te,T);continue}if(!he&&He(/\/>/i,Ae)){ct(Te,T);continue}ce&&Xr([B,k,P],un=>{Ae=br(Ae,un," ")});const st=xe(T.nodeName);if(!zn(st,it,Ae)){ct(Te,T);continue}if(L&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!De)switch(f.getAttributeType(st,it)){case"TrustedHTML":{Ae=L.createHTML(Ae);break}case"TrustedScriptURL":{Ae=L.createScriptURL(Ae);break}}if(Ae!==cn)try{De?T.setAttributeNS(De,Te,Ae):T.setAttribute(Te,Ae),kn(T)?Xe(T):pa(e.removed)}catch{ct(Te,T)}}nt(v.afterSanitizeAttributes,T,null)},ur=function ee(T){let Z=null;const Y=Ce(T);for(nt(v.beforeSanitizeShadowDOM,T,null);Z=Y.nextNode();)nt(v.uponSanitizeShadowNode,Z,null),Un(Z),Hn(Z),Z.content instanceof a&&ee(Z.content);nt(v.afterSanitizeShadowDOM,T,null)};return e.sanitize=function(ee){let T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Z=null,Y=null,ve=null,Le=null;if(an=!ee,an&&(ee="<!-->"),typeof ee!="string"&&!Fn(ee))if(typeof ee.toString=="function"){if(ee=ee.toString(),typeof ee!="string")throw vr("dirty is not a string, aborting")}else throw vr("toString is not a function");if(!e.isSupported)return ee;if(Se||ln(T),e.removed=[],typeof ee=="string"&&(Ve=!1),Ve){if(ee.nodeName){const rt=xe(ee.nodeName);if(!F[rt]||ae[rt])throw vr("root node is forbidden and cannot be sanitized in-place")}}else if(ee instanceof o)Z=on("<!---->"),Y=Z.ownerDocument.importNode(ee,!0),Y.nodeType===Er.element&&Y.nodeName==="BODY"||Y.nodeName==="HTML"?Z=Y:Z.appendChild(Y);else{if(!gt&&!ce&&!be&&ee.indexOf("<")===-1)return L&&en?L.createHTML(ee):ee;if(Z=on(ee),!Z)return gt?null:en?O:""}Z&&$t&&Xe(Z.firstChild);const Te=Ce(Ve?ee:Z);for(;ve=Te.nextNode();)Un(ve),Hn(ve),ve.content instanceof a&&ur(ve.content);if(Ve)return ee;if(gt){if(Qt)for(Le=I.call(Z.ownerDocument);Z.firstChild;)Le.appendChild(Z.firstChild);else Le=Z;return(K.shadowroot||K.shadowrootmode)&&(Le=$.call(r,Le,!0)),Le}let De=be?Z.outerHTML:Z.innerHTML;return be&&F["!doctype"]&&Z.ownerDocument&&Z.ownerDocument.doctype&&Z.ownerDocument.doctype.name&&He(_l,Z.ownerDocument.doctype.name)&&(De="<!DOCTYPE "+Z.ownerDocument.doctype.name+`>
|
|
2
|
-
`+De),ce&&Xr([B,k,P],rt=>{De=br(De,rt," ")}),L&&en?L.createHTML(De):De},e.setConfig=function(){let ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ln(ee),Se=!0},e.clearConfig=function(){lt=null,Se=!1},e.isValidAttribute=function(ee,T,Z){lt||ln({});const Y=xe(ee),ve=xe(T);return zn(Y,ve,Z)},e.addHook=function(ee,T){typeof T=="function"&&gr(v[ee],T)},e.removeHook=function(ee,T){if(T!==void 0){const Z=Kc(v[ee],T);return Z===-1?void 0:Gc(v[ee],Z,1)[0]}return pa(v[ee])},e.removeHooks=function(ee){v[ee]=[]},e.removeAllHooks=function(){v=wa()},e}var uu=jl();const du={class:"tooltip-text-content"},hu={key:1},fu={key:0,class:"tooltip-hotkey"},mu=i.defineComponent({__name:"Tooltip",props:{text:{type:[String,Array],required:!0},position:{type:String,default:"top"},hotkey:{type:String,default:""},as:{type:String,default:"span"}},setup(n){const e=n,t=i.ref(!1),r=i.ref(null),s=i.ref(null),a=i.ref({});let l;const o=()=>{window.clearTimeout(l),l=window.setTimeout(async()=>{t.value=!0,await i.nextTick(),h()},300)},u=()=>{window.clearTimeout(l),t.value=!1};function h(){if(!r.value||!s.value)return;const m=r.value.getBoundingClientRect(),p=s.value.getBoundingClientRect(),d=8;let f=0,b=0;switch(e.position){case"bottom":f=m.bottom+d+window.scrollY,b=m.left+m.width/2-p.width/2+window.scrollX;break;case"left":f=m.top+m.height/2-p.height/2+window.scrollY,b=m.left-p.width-d+window.scrollX;break;case"right":f=m.top+m.height/2-p.height/2+window.scrollY,b=m.right+d+window.scrollX;break;default:f=m.top-p.height-d+window.scrollY,b=m.left+m.width/2-p.width/2+window.scrollX;break}a.value={top:`${f}px`,left:`${b}px`}}return(m,p)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.as),{class:"tooltip-wrapper",ref_key:"trigger",ref:r,onMouseenter:o,onMouseleave:u},{default:i.withCtx(()=>[i.renderSlot(m.$slots,"default",{},void 0,!0),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.createVNode(i.Transition,{name:"tooltip-transition"},{default:i.withCtx(()=>[t.value?(i.openBlock(),i.createElementBlock("div",{key:0,ref_key:"bubble",ref:s,class:i.normalizeClass(["tooltip-bubble",`tooltip-${n.position}`]),style:i.normalizeStyle(a.value)},[i.createElementVNode("div",du,[Array.isArray(n.text)?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(n.text,(d,f)=>(i.openBlock(),i.createElementBlock("p",{key:f},i.toDisplayString(d),1))),128)):(i.openBlock(),i.createElementBlock("p",hu,i.toDisplayString(n.text),1))]),n.hotkey?(i.openBlock(),i.createElementBlock("span",fu,i.toDisplayString(n.hotkey),1)):i.createCommentVNode("",!0)],6)):i.createCommentVNode("",!0)]),_:1})]))]),_:3},544))}}),Ye=we(mu,[["__scopeId","data-v-4ef7aaf7"]]),pu={key:0,class:"loader-overlay"},gu={class:"loader-content"},bu={key:0,class:"state-container"},vu={class:"status-message"},yu={key:1,class:"state-container"},Eu={class:"status-message font-medium"},wu={key:2,class:"state-container"},xu={class:"status-message font-medium"},Tu=i.defineComponent({__name:"LoaderSuccessError",emits:["success","error"],setup(n,{expose:e,emit:t}){const r=t,s=i.ref(!1),a=i.ref("loading"),l=i.ref(""),o=(h="loading",m="")=>{s.value=!0,a.value=h,l.value=m,h!=="loading"&&setTimeout(()=>{u(),r(h==="success"?"success":"error")},3e3)},u=()=>{s.value=!1};return e({show:o,hide:u}),(h,m)=>(i.openBlock(),i.createBlock(i.Transition,{name:"fade"},{default:i.withCtx(()=>[s.value?(i.openBlock(),i.createElementBlock("div",pu,[i.createElementVNode("div",gu,[a.value==="loading"?(i.openBlock(),i.createElementBlock("div",bu,[m[0]||(m[0]=i.createElementVNode("div",{class:"loading-icon-wrapper"},[i.createElementVNode("div",{class:"spinner"})],-1)),i.createElementVNode("p",vu,i.toDisplayString(l.value||"Memproses..."),1)])):i.createCommentVNode("",!0),a.value==="success"?(i.openBlock(),i.createElementBlock("div",yu,[m[1]||(m[1]=i.createElementVNode("div",{class:"status-icon-container"},[i.createElementVNode("div",{class:"icon-background bg-success"},[i.createElementVNode("svg",{class:"status-icon text-success",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[i.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})])]),i.createElementVNode("div",{class:"ping-animation bg-success"})],-1)),i.createElementVNode("p",Eu,i.toDisplayString(l.value||"Berhasil!"),1)])):i.createCommentVNode("",!0),a.value==="error"?(i.openBlock(),i.createElementBlock("div",wu,[m[2]||(m[2]=i.createElementVNode("div",{class:"status-icon-container"},[i.createElementVNode("div",{class:"icon-background bg-error"},[i.createElementVNode("svg",{class:"status-icon text-error",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[i.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})])]),i.createElementVNode("div",{class:"ping-animation bg-error"})],-1)),i.createElementVNode("p",xu,i.toDisplayString(l.value||"Gagal!"),1)])):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]),_:1}))}}),Pl=we(Tu,[["__scopeId","data-v-40156c35"]]);function Au(n,e,t){const r=i.ref(!1),s=i.ref({}),a=i.ref(null),l=i.ref([]),o=i.ref([...n.modelValue??[]]);i.watch(()=>n.modelValue,b=>{o.value=[...b??[]]});const u=i.computed(()=>e.value.btn.add||"Add Item");return{showModal:r,currentEditItem:s,currentEditIndex:a,removeDatas:l,addButtonText:u,localItems:o,handleAddClick:()=>{s.value={},a.value=null,r.value=!0},handleEditClick:b=>{s.value={...o.value[b]},a.value=b,r.value=!0},handleSubmit:b=>{const y=[...o.value];a.value===null?y.push(b):(s.value.id&&(b.id=s.value.id),y[a.value]=b),o.value=y,t("update:modelValue",y,n.id),r.value=!1},remove:b=>{const y=[...o.value];y.splice(b,1),o.value=y,t("update:modelValue",y,n.id)},getImageSrc:b=>typeof b=="string"?b:b instanceof File?URL.createObjectURL(b):""}}function Nu(n,e){const t=i.ref(null),r=i.ref([]),s=i.ref([]);let a=null,l=!1;const o=S=>!(S==null||typeof S=="string"&&S.trim()===""||Array.isArray(S)&&S.length===0||typeof S=="object"&&!Array.isArray(S)&&Object.keys(S).length===0),u=(S,A)=>Object.keys(S).some(L=>o(A[L])),h=S=>{Object.keys(S).forEach(A=>{n.formData[A]=null,e("update:model-value",null,A)})},m=S=>{Object.keys(S).forEach(A=>{A in n.formData||(n.formData[A]=null)})},p=()=>{if(!(n.typeDesign!=="select"&&n.typeDesign!=="dropdown")){for(const[S,A]of Object.entries(n.options))if(u(A,n.formData)){t.value=S,m(A);return}t.value=n.required?Object.keys(n.options)[0]??null:null}},d=()=>{if(n.typeDesign!=="cekbox")return;const S=[];for(const[A,L]of Object.entries(n.options))u(L,n.formData)&&(S.push(A),m(L));r.value=S},f=()=>{p(),d(),l=!0},b=()=>{a&&n.options[a]&&h(n.options[a]),t.value&&n.options[t.value]&&m(n.options[t.value]),a=t.value},y=()=>{const A=Object.keys(n.options).filter(L=>!r.value.includes(L));for(const L of A){const O=n.options[L];O&&h(O)}for(const L of r.value){const O=n.options[L];O&&m(O)}},E=(S,A)=>{e("push:errors",S,A)},x=S=>{e("remove:errors",S)};return i.watch(t,()=>{e("selected-option-change",t.value,n.id),n.withValue&&e("update:model-value",t.value,n.id),l&&b()},{deep:!0}),i.watch(r,()=>{e("multi-selected-change",r.value,n.id),n.withValue&&e("update:model-value",r.value,n.id),l&&y()},{deep:!0}),i.onMounted(()=>{f()}),{selectedOption:t,multiSelected:r,fieldIsColor:s,initializeFormData:f,handleSelectChange:b,handleCheckboxChange:y,errorPush:E,errorRemove:x}}const ku={class:"array-object-wrapper"},Su={class:"items-container"},Cu={class:"item-content"},Lu={class:"item-info"},Bu=["src"],Iu={class:"item-name"},Ou={class:"item-actions"},Du=["onClick"],Mu=["onClick"],Ru=["disabled"],qu={key:1,class:"error-message"},Vu=i.defineComponent({__name:"ArrayObject",props:{id:{default:ke()},label:{},modelValue:{},disabled:{type:Boolean},schema:{},error:{},lang:{}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,s=i.inject("TableComponents",{labels:i.ref(Ne[t.lang??"en"])}).labels,a=e,{showModal:l,currentEditItem:o,currentEditIndex:u,addButtonText:h,handleAddClick:m,handleEditClick:p,handleSubmit:d,remove:f,getImageSrc:b,localItems:y}=Au(t,s,a);return(E,x)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("label",{class:i.normalizeClass(["array-label",{"has-error":t.error}])},i.toDisplayString(n.label),3),i.createElementVNode("div",ku,[i.createElementVNode("div",Su,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(y),(S,A)=>(i.openBlock(),i.createElementBlock("div",{key:A,class:"item-card"},[i.createElementVNode("div",Cu,[i.createElementVNode("div",Lu,[S?.image?(i.openBlock(),i.createElementBlock("img",{key:0,src:i.unref(b)(S.image),class:"item-image",alt:"Preview Gambar"},null,8,Bu)):i.createCommentVNode("",!0),i.createElementVNode("span",Iu,i.toDisplayString(S?.name||`Item ${A+1}`),1)]),i.createElementVNode("div",Ou,[i.createElementVNode("span",{role:"button",tabindex:"0",class:i.normalizeClass(["action-link action-edit",{disabled:n.disabled}]),onClick:L=>!n.disabled&&i.unref(p)(A)},i.toDisplayString(i.unref(s)?.btn?.edit||"Edit"),11,Du),i.createElementVNode("span",{role:"button",tabindex:"0",class:i.normalizeClass(["action-link action-remove",{disabled:n.disabled}]),onClick:L=>!n.disabled&&i.unref(f)(A)},i.toDisplayString(i.unref(s)?.btn?.remove||"Remove"),11,Mu)])])]))),128))]),i.createElementVNode("button",{type:"button",onClick:x[0]||(x[0]=(...S)=>i.unref(m)&&i.unref(m)(...S)),class:"add-button",disabled:n.disabled},i.toDisplayString(i.unref(h)),9,Ru),i.unref(l)?(i.openBlock(),i.createBlock(i.unref(Fs),{key:0,id:i.unref(o).id||null,schema:t.schema,"initial-data":i.unref(o),"is-update":i.unref(u)!==null,lang:t.lang,onSubmit:i.unref(d),onCancel:x[1]||(x[1]=()=>l.value=!1)},null,8,["id","schema","initial-data","is-update","lang","onSubmit"])):i.createCommentVNode("",!0),t.error?(i.openBlock(),i.createElementBlock("p",qu,i.toDisplayString(t.error),1)):i.createCommentVNode("",!0)])],64))}}),Fl=we(Vu,[["__scopeId","data-v-8c2271ad"]]),$u={class:"color-picker-wrapper"},_u={class:"selected-colors-container"},ju=["onClick","disabled"],Pu=["disabled"],Fu={key:0,class:"add-button-container"},Uu=["disabled"],zu={key:2,class:"error-message"},Hu=i.defineComponent({__name:"ColorPicker",props:{id:{default:ke()},selectedColors:{},modelValue:{},single:{type:Boolean},error:{},label:{},disabled:{type:Boolean},validate:{},lang:{}},emits:["update:modelValue","push:error","remove:error"],setup(n,{emit:e}){const t=n,r=e,s=i.ref("#000000"),a=i.ref([...t.modelValue??[]]),o=i.inject("TableComponents",{labels:i.ref(Ne[t.lang??"en"])}).labels,u=i.ref([]);i.watch(()=>({modelValue:t.modelValue,disabled:t.disabled,validate:t.validate,single:t.single}),({modelValue:p,disabled:d,validate:f,single:b})=>{if(Array.isArray(p)?a.value=[...p]:a.value=[p],d||b){u.value=[];return}const y=[],E=a.value.length;if(f&&typeof f=="object"&&!b){const{min:x,max:S}=f;x!==void 0&&E<x&&y.push(z("arrayColorMin",{min:String(x)},t.lang??"en")),S!==void 0&&E>S&&y.push(z("arrayColorMax",{max:String(S)},t.lang??"en"))}u.value=y,y.length?r("push:error",y,t.id):r("remove:error",t.id)});function h(){t.single?(a.value=[s.value],r("update:modelValue",s.value,t.id)):a.value.includes(s.value)||(a.value.push(s.value),r("update:modelValue",a.value,t.id))}function m(p){a.value.splice(p,1),t.single?r("update:modelValue",a.value[0]??"",t.id):r("update:modelValue",a.value,t.id)}return(p,d)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("label",{class:i.normalizeClass(["color-label",{"has-error":u.value.length!==0||n.error}])},i.toDisplayString(n.label),3),i.createElementVNode("div",$u,[i.createElementVNode("div",_u,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,(f,b)=>(i.openBlock(),i.createElementBlock("div",{key:b,class:"selected-color-item"},[i.createElementVNode("div",{style:i.normalizeStyle({backgroundColor:f}),class:"color-swatch"},null,4),t.single?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("button",{key:0,type:"button",onClick:y=>m(b),disabled:n.disabled,class:"remove-color-button"}," × ",8,ju))]))),128))]),i.withDirectives(i.createElementVNode("input",{type:"color","onUpdate:modelValue":d[0]||(d[0]=f=>s.value=f),disabled:n.disabled,class:"color-input"},null,8,Pu),[[i.vModelText,s.value]]),t.single?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Fu,[i.createElementVNode("button",{type:"button",class:"add-button",disabled:n.disabled,onClick:h},i.toDisplayString(i.unref(o)?.btn?.add??"Tambah"),9,Uu)])),u.value.length!==0?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(u.value,(f,b)=>(i.openBlock(),i.createElementBlock("p",{key:b,class:"error-message"},i.toDisplayString(f),1))),128)):typeof t.error=="string"?(i.openBlock(),i.createElementBlock("p",zu,i.toDisplayString(n.error),1)):i.createCommentVNode("",!0)])],64))}}),Ul=we(Hu,[["__scopeId","data-v-ad00b118"]]);function Es(n,e){try{return n.parse(e)}catch(t){if(t instanceof wc){const r=t.issues.map(s=>`${s.path.length>0?s.path.join("."):"root"}: ${s.message}`).join(", ");throw new Error(`Validation failed: ${r}`)}throw t}}function Ku(n,e){const t=n.safeParse(e);return t.success?{success:!0,data:t.data,error:null}:{success:!1,data:null,error:{message:`Validation failed: ${t.error.issues.map(s=>`${s.path.length>0?s.path.join("."):"root"}: ${s.message}`).join(", ")}`,issues:t.error.issues}}}var mn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Us(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Tr={exports:{}};Tr.exports;var xa;function zs(){return xa||(xa=1,(function(n,e){var t=200,r="__lodash_hash_undefined__",s=1,a=2,l=9007199254740991,o="[object Arguments]",u="[object Array]",h="[object AsyncFunction]",m="[object Boolean]",p="[object Date]",d="[object Error]",f="[object Function]",b="[object GeneratorFunction]",y="[object Map]",E="[object Number]",x="[object Null]",S="[object Object]",A="[object Promise]",L="[object Proxy]",O="[object RegExp]",W="[object Set]",H="[object String]",I="[object Symbol]",C="[object Undefined]",$="[object WeakMap]",v="[object ArrayBuffer]",B="[object DataView]",k="[object Float32Array]",P="[object Float64Array]",_="[object Int8Array]",q="[object Int16Array]",N="[object Int32Array]",M="[object Uint8Array]",j="[object Uint8ClampedArray]",D="[object Uint16Array]",F="[object Uint32Array]",U=/[\\^$.*+?()[\]{}|]/g,K=/^\[object .+?Constructor\]$/,ne=/^(?:0|[1-9]\d*)$/,G={};G[k]=G[P]=G[_]=G[q]=G[N]=G[M]=G[j]=G[D]=G[F]=!0,G[o]=G[u]=G[v]=G[m]=G[B]=G[p]=G[d]=G[f]=G[y]=G[E]=G[S]=G[O]=G[W]=G[H]=G[$]=!1;var ae=typeof mn=="object"&&mn&&mn.Object===Object&&mn,oe=typeof self=="object"&&self&&self.Object===Object&&self,re=ae||oe||Function("return this")(),ue=e&&!e.nodeType&&e,de=ue&&!0&&n&&!n.nodeType&&n,he=de&&de.exports===ue,ce=he&&ae.process,fe=(function(){try{return ce&&ce.binding&&ce.binding("util")}catch{}})(),be=fe&&fe.isTypedArray;function Se(c,g){for(var w=-1,R=c==null?0:c.length,ie=0,te=[];++w<R;){var pe=c[w];g(pe,w,c)&&(te[ie++]=pe)}return te}function $t(c,g){for(var w=-1,R=g.length,ie=c.length;++w<R;)c[ie+w]=g[w];return c}function gt(c,g){for(var w=-1,R=c==null?0:c.length;++w<R;)if(g(c[w],w,c))return!0;return!1}function Qt(c,g){for(var w=-1,R=Array(c);++w<c;)R[w]=g(w);return R}function en(c){return function(g){return c(g)}}function _t(c,g){return c.has(g)}function tn(c,g){return c?.[g]}function jn(c){var g=-1,w=Array(c.size);return c.forEach(function(R,ie){w[++g]=[ie,R]}),w}function nn(c,g){return function(w){return c(g(w))}}function Ve(c){var g=-1,w=Array(c.size);return c.forEach(function(R){w[++g]=R}),w}var Qe=Array.prototype,Lt=Function.prototype,Bt=Object.prototype,jt=re["__core-js_shared__"],rn=Lt.toString,$e=Bt.hasOwnProperty,xn=(function(){var c=/[^.]+$/.exec(jt&&jt.keys&&jt.keys.IE_PROTO||"");return c?"Symbol(src)_1."+c:""})(),Pt=Bt.toString,sn=RegExp("^"+rn.call($e).replace(U,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ue=he?re.Buffer:void 0,et=re.Symbol,an=re.Uint8Array,It=Bt.propertyIsEnumerable,Ft=Qe.splice,_e=et?et.toStringTag:void 0,bt=Object.getOwnPropertySymbols,Tn=Ue?Ue.isBuffer:void 0,tt=nn(Object.keys,Object),An=zt(re,"DataView"),Ut=zt(re,"Map"),xe=zt(re,"Promise"),lt=zt(re,"Set"),Nn=zt(re,"WeakMap"),vt=zt(Object,"create"),ln=ze(An),ot=ze(Ut),Pn=ze(xe),cr=ze(lt),Xe=ze(Nn),ct=et?et.prototype:void 0,on=ct?ct.valueOf:void 0;function Ce(c){var g=-1,w=c==null?0:c.length;for(this.clear();++g<w;){var R=c[g];this.set(R[0],R[1])}}function kn(){this.__data__=vt?vt(null):{},this.size=0}function Fn(c){var g=this.has(c)&&delete this.__data__[c];return this.size-=g?1:0,g}function nt(c){var g=this.__data__;if(vt){var w=g[c];return w===r?void 0:w}return $e.call(g,c)?g[c]:void 0}function Un(c){var g=this.__data__;return vt?g[c]!==void 0:$e.call(g,c)}function zn(c,g){var w=this.__data__;return this.size+=this.has(c)?0:1,w[c]=vt&&g===void 0?r:g,this}Ce.prototype.clear=kn,Ce.prototype.delete=Fn,Ce.prototype.get=nt,Ce.prototype.has=Un,Ce.prototype.set=zn;function Ie(c){var g=-1,w=c==null?0:c.length;for(this.clear();++g<w;){var R=c[g];this.set(R[0],R[1])}}function Hn(){this.__data__=[],this.size=0}function ur(c){var g=this.__data__,w=Kn(g,c);if(w<0)return!1;var R=g.length-1;return w==R?g.pop():Ft.call(g,w,1),--this.size,!0}function ee(c){var g=this.__data__,w=Kn(g,c);return w<0?void 0:g[w][1]}function T(c){return Kn(this.__data__,c)>-1}function Z(c,g){var w=this.__data__,R=Kn(w,c);return R<0?(++this.size,w.push([c,g])):w[R][1]=g,this}Ie.prototype.clear=Hn,Ie.prototype.delete=ur,Ie.prototype.get=ee,Ie.prototype.has=T,Ie.prototype.set=Z;function Y(c){var g=-1,w=c==null?0:c.length;for(this.clear();++g<w;){var R=c[g];this.set(R[0],R[1])}}function ve(){this.size=0,this.__data__={hash:new Ce,map:new(Ut||Ie),string:new Ce}}function Le(c){var g=yt(this,c).delete(c);return this.size-=g?1:0,g}function Te(c){return yt(this,c).get(c)}function De(c){return yt(this,c).has(c)}function rt(c,g){var w=yt(this,c),R=w.size;return w.set(c,g),this.size+=w.size==R?0:1,this}Y.prototype.clear=ve,Y.prototype.delete=Le,Y.prototype.get=Te,Y.prototype.has=De,Y.prototype.set=rt;function it(c){var g=-1,w=c==null?0:c.length;for(this.__data__=new Y;++g<w;)this.add(c[g])}function cn(c){return this.__data__.set(c,r),this}function Ae(c){return this.__data__.has(c)}it.prototype.add=it.prototype.push=cn,it.prototype.has=Ae;function st(c){var g=this.__data__=new Ie(c);this.size=g.size}function un(){this.__data__=new Ie,this.size=0}function Li(c){var g=this.__data__,w=g.delete(c);return this.size=g.size,w}function Bi(c){return this.__data__.get(c)}function Ii(c){return this.__data__.has(c)}function Oi(c,g){var w=this.__data__;if(w instanceof Ie){var R=w.__data__;if(!Ut||R.length<t-1)return R.push([c,g]),this.size=++w.size,this;w=this.__data__=new Y(R)}return w.set(c,g),this.size=w.size,this}st.prototype.clear=un,st.prototype.delete=Li,st.prototype.get=Bi,st.prototype.has=Ii,st.prototype.set=Oi;function Di(c,g){var w=Gn(c),R=!w&&Hr(c),ie=!w&&!R&&Wn(c),te=!w&&!R&&!ie&&Wr(c),pe=w||R||ie||te,me=pe?Qt(c.length,String):[],Be=me.length;for(var ge in c)$e.call(c,ge)&&!(pe&&(ge=="length"||ie&&(ge=="offset"||ge=="parent")||te&&(ge=="buffer"||ge=="byteLength"||ge=="byteOffset")||Pi(ge,Be)))&&me.push(ge);return me}function Kn(c,g){for(var w=c.length;w--;)if(zr(c[w][0],g))return w;return-1}function dr(c,g,w){var R=g(c);return Gn(c)?R:$t(R,w(c))}function Sn(c){return c==null?c===void 0?C:x:_e&&_e in Object(c)?Ht(c):Ur(c)}function Pr(c){return Dt(c)&&Sn(c)==o}function Fr(c,g,w,R,ie){return c===g?!0:c==null||g==null||!Dt(c)&&!Dt(g)?c!==c&&g!==g:Mi(c,g,w,R,Fr,ie)}function Mi(c,g,w,R,ie,te){var pe=Gn(c),me=Gn(g),Be=pe?u:Ot(c),ge=me?u:Ot(g);Be=Be==o?S:Be,ge=ge==o?S:ge;var je=Be==S,Je=ge==S,Oe=Be==ge;if(Oe&&Wn(c)){if(!Wn(g))return!1;pe=!0,je=!1}if(Oe&&!je)return te||(te=new st),pe||Wr(c)?hr(c,g,w,R,ie,te):$i(c,g,Be,w,R,ie,te);if(!(w&s)){var Pe=je&&$e.call(c,"__wrapped__"),Re=Je&&$e.call(g,"__wrapped__");if(Pe||Re){var dn=Pe?c.value():c,Kt=Re?g.value():g;return te||(te=new st),ie(dn,Kt,w,R,te)}}return Oe?(te||(te=new st),_i(c,g,w,R,ie,te)):!1}function Ri(c){if(!Gr(c)||Ui(c))return!1;var g=Kr(c)?sn:K;return g.test(ze(c))}function qi(c){return Dt(c)&&mr(c.length)&&!!G[Sn(c)]}function Vi(c){if(!zi(c))return tt(c);var g=[];for(var w in Object(c))$e.call(c,w)&&w!="constructor"&&g.push(w);return g}function hr(c,g,w,R,ie,te){var pe=w&s,me=c.length,Be=g.length;if(me!=Be&&!(pe&&Be>me))return!1;var ge=te.get(c);if(ge&&te.get(g))return ge==g;var je=-1,Je=!0,Oe=w&a?new it:void 0;for(te.set(c,g),te.set(g,c);++je<me;){var Pe=c[je],Re=g[je];if(R)var dn=pe?R(Re,Pe,je,g,c,te):R(Pe,Re,je,c,g,te);if(dn!==void 0){if(dn)continue;Je=!1;break}if(Oe){if(!gt(g,function(Kt,Ln){if(!_t(Oe,Ln)&&(Pe===Kt||ie(Pe,Kt,w,R,te)))return Oe.push(Ln)})){Je=!1;break}}else if(!(Pe===Re||ie(Pe,Re,w,R,te))){Je=!1;break}}return te.delete(c),te.delete(g),Je}function $i(c,g,w,R,ie,te,pe){switch(w){case B:if(c.byteLength!=g.byteLength||c.byteOffset!=g.byteOffset)return!1;c=c.buffer,g=g.buffer;case v:return!(c.byteLength!=g.byteLength||!te(new an(c),new an(g)));case m:case p:case E:return zr(+c,+g);case d:return c.name==g.name&&c.message==g.message;case O:case H:return c==g+"";case y:var me=jn;case W:var Be=R&s;if(me||(me=Ve),c.size!=g.size&&!Be)return!1;var ge=pe.get(c);if(ge)return ge==g;R|=a,pe.set(c,g);var je=hr(me(c),me(g),R,ie,te,pe);return pe.delete(c),je;case I:if(on)return on.call(c)==on.call(g)}return!1}function _i(c,g,w,R,ie,te){var pe=w&s,me=Cn(c),Be=me.length,ge=Cn(g),je=ge.length;if(Be!=je&&!pe)return!1;for(var Je=Be;Je--;){var Oe=me[Je];if(!(pe?Oe in g:$e.call(g,Oe)))return!1}var Pe=te.get(c);if(Pe&&te.get(g))return Pe==g;var Re=!0;te.set(c,g),te.set(g,c);for(var dn=pe;++Je<Be;){Oe=me[Je];var Kt=c[Oe],Ln=g[Oe];if(R)var da=pe?R(Ln,Kt,Oe,g,c,te):R(Kt,Ln,Oe,c,g,te);if(!(da===void 0?Kt===Ln||ie(Kt,Ln,w,R,te):da)){Re=!1;break}dn||(dn=Oe=="constructor")}if(Re&&!dn){var Zr=c.constructor,Yr=g.constructor;Zr!=Yr&&"constructor"in c&&"constructor"in g&&!(typeof Zr=="function"&&Zr instanceof Zr&&typeof Yr=="function"&&Yr instanceof Yr)&&(Re=!1)}return te.delete(c),te.delete(g),Re}function Cn(c){return dr(c,pr,ji)}function yt(c,g){var w=c.__data__;return Fi(g)?w[typeof g=="string"?"string":"hash"]:w.map}function zt(c,g){var w=tn(c,g);return Ri(w)?w:void 0}function Ht(c){var g=$e.call(c,_e),w=c[_e];try{c[_e]=void 0;var R=!0}catch{}var ie=Pt.call(c);return R&&(g?c[_e]=w:delete c[_e]),ie}var ji=bt?function(c){return c==null?[]:(c=Object(c),Se(bt(c),function(g){return It.call(c,g)}))}:Ki,Ot=Sn;(An&&Ot(new An(new ArrayBuffer(1)))!=B||Ut&&Ot(new Ut)!=y||xe&&Ot(xe.resolve())!=A||lt&&Ot(new lt)!=W||Nn&&Ot(new Nn)!=$)&&(Ot=function(c){var g=Sn(c),w=g==S?c.constructor:void 0,R=w?ze(w):"";if(R)switch(R){case ln:return B;case ot:return y;case Pn:return A;case cr:return W;case Xe:return $}return g});function Pi(c,g){return g=g??l,!!g&&(typeof c=="number"||ne.test(c))&&c>-1&&c%1==0&&c<g}function Fi(c){var g=typeof c;return g=="string"||g=="number"||g=="symbol"||g=="boolean"?c!=="__proto__":c===null}function Ui(c){return!!xn&&xn in c}function zi(c){var g=c&&c.constructor,w=typeof g=="function"&&g.prototype||Bt;return c===w}function Ur(c){return Pt.call(c)}function ze(c){if(c!=null){try{return rn.call(c)}catch{}try{return c+""}catch{}}return""}function zr(c,g){return c===g||c!==c&&g!==g}var Hr=Pr((function(){return arguments})())?Pr:function(c){return Dt(c)&&$e.call(c,"callee")&&!It.call(c,"callee")},Gn=Array.isArray;function fr(c){return c!=null&&mr(c.length)&&!Kr(c)}var Wn=Tn||Gi;function Hi(c,g){return Fr(c,g)}function Kr(c){if(!Gr(c))return!1;var g=Sn(c);return g==f||g==b||g==h||g==L}function mr(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=l}function Gr(c){var g=typeof c;return c!=null&&(g=="object"||g=="function")}function Dt(c){return c!=null&&typeof c=="object"}var Wr=be?en(be):qi;function pr(c){return fr(c)?Di(c):Vi(c)}function Ki(){return[]}function Gi(){return!1}n.exports=Hi})(Tr,Tr.exports)),Tr.exports}var Gu=zs();const Cr=Us(Gu),zl=async(n,e,t="id",r="ids")=>{const{data:s,oldData:a,validation:l,endpoint:o,mode:u,db:h,deleteDataDB:m}=n,p=m??!0;if(u!=="get"&&!s)return{message:"data Not Found"};const d=l?Es(l,s):{...s},f=a?l?Es(l,a):{...a}:void 0,{endpoint:b,remaining:y,remainingOld:E}=Wu(o,d,f);let x=u==="create"?"POST":u==="update"?"PATCH":"DELETE",S=!1;if(u==="delete"||u==="deleteMany"){const I=Object.keys(y).length>0?JSON.stringify(y):void 0,C=await hi(b,{method:x,headers:I?{"Content-Type":"application/json"}:void 0,body:I,authType:n.authType,token:n.token,customHeaders:n.customHeaders});if(!C.ok){const v=await C.json().catch(()=>({}));throw new Error(v.message||"Gagal menghapus data")}const $=await C.json();return p&&h&&await pc({[h]:s[r??"ids"]||s[t??"id"]||y._id}),{message:$.message,response:C.ok}}if(u==="get"){const I=await hi(b,{method:"GET",authType:n.authType,token:n.token,customHeaders:n.customHeaders});if(!I.ok){const $=await I.json().catch(()=>({}));throw new Error($.message||"Failed to fetch data")}const C=await I.json();return h&&C.data&&(js(h)?await di({[h]:C.data}):await di({[h]:[C.data]})),{...C,message:C.message??"Data fetched successfully",response:I.ok}}const A=new FormData,L={};let O=u!=="update";if(u==="update"&&E){for(const I in y){const C=y[I],$=E[I],v=!Cr(C,$);(I===t||v)&&(fi(A,I,C,L,$,void 0,e,t)&&(S=!0),I!==t&&(O=!0))}if(!O&&Cr(y,E))throw new Error("No data has changed")}else for(const I in y){const C=y[I],$=Array.isArray(C)&&C.length===0;C!=null&&!$&&(L[I]=C,fi(A,I,C,L,void 0,void 0,e)&&(S=!0))}const W=await hi(b,S?{method:x,body:A,authType:n.authType,token:n.token,customHeaders:n.customHeaders}:{method:x,headers:{"Content-Type":"application/json"},body:JSON.stringify(L),authType:n.authType,token:n.token,customHeaders:n.customHeaders});if(!W.ok){const I=await W.json().catch(()=>({}));throw new Error(I.message||"Failed to process data")}const H=await W.json();if(h){const I=js(h);if(u==="update")await mc(h,H.data);else if(u==="create"&&I){const C=await fc(h);await di({[h]:[...C,H.data]})}}return{message:H.message,data:H.data,response:W.ok}};function fi(n,e,t,r,s={},a,l,o,u){let h=!1;const m=a?`${a}[${e}]`:e;if(Array.isArray(t)&&t.length>0&&typeof t[0]=="object"&&!(t[0]instanceof File)){const p=new Set(t.map(b=>b[o??"id"]).filter(b=>b!==void 0));if(Array.isArray(s)){const b=s.filter(y=>y[o??"id"]!==void 0&&!p.has(y[o??"id"]));if(b.length>0){const y=b.map(E=>E[o??"id"]);r[e+"_deleted"]=y,y.forEach(E=>{n.append(`${e}_deleted[]`,String(E))})}}const d=[];r[e]=d;let f=0;t.forEach(b=>{const y={},E=(Array.isArray(s)?s.find(S=>S[o??"id"]===b[o??"id"]):void 0)||{};let x=!b[o??"id"]||!1;for(const S in b){const A=b[S],L=E?.[S],O=!Cr(A,L);if(A!=null&&(O||!b[o??"id"])){b[o??"id"]?S!=="id"&&(x=!0):x=!0;const W=`${m}[${f}][${S}]`;if(A instanceof File)n.append(W,A),h=!0,y[S]=A.name;else if(Array.isArray(A)||typeof A=="object"&&A!==null){const H=`${m}[${f}]`;fi(n,S,A,y,L,H,l,o)&&(h=!0)}else n.append(W,String(A)),y[S]=A}}x&&(b[o??"id"]!==void 0&&(n.append(`${m}[${f}][${o}]`,String(b[o??"id"])),y[o??"id"]=b[o??"id"]),f+=1,d.push(y))}),d.length===0&&delete r[e]}else if(typeof t=="object"&&t!==null&&!(t instanceof File)&&!Array.isArray(t)){const p={};let d=!1,f;for(const b in t){const y=t[b],E=s?.[b]??null,S=Array.isArray(y)&&y.length===0?null:y,A=!Cr(S,E);b===(o??"id")?f=y:A&&(fi(n,b,y,p,E,m,l,o)&&(h=!0),d=!0)}d&&Object.keys(p).length>0?(f&&(p[o??"id"]=f),r[e]=p):delete r[e]}else if(Array.isArray(t)&&(typeof t[0]!="object"||t[0]===null))t.length>0?(r[e]=t,t.forEach((p,d)=>{const f=`${m}[${d}]`;n.append(f,String(p))})):r[e]=null;else if(Array.isArray(t)&&t.some(p=>p instanceof File)){h=!0;const p=[];t.forEach((d,f)=>{const b=`${m}[${f}]`;d instanceof File?(n.append(b,d),p.push(d.name)):(n.append(b,d),p.push(d))}),r[e]=p}else t instanceof File?(n.append(m,t),r[e]=t.name,h=!0):t!=null&&!Array.isArray(t)&&(n.append(m,String(t)),r[e]=t);return h}function Wu(n,e,t){const r={...e},s=t?{...t}:void 0;return{endpoint:n.replace(/:([a-zA-Z_][a-zA-Z0-9_]*)/g,(l,o)=>{const u=r[o];if(!u)throw new Error(`Missing value for :${o}`);return delete r[o],s&&delete s[o],encodeURIComponent(String(u))}),remaining:r,remainingOld:s}}const Zu={class:"combobox-wrapper"},Yu={class:"input-wrapper"},Xu=["placeholder","disabled"],Ju={key:1,class:"dropdown-icon-wrapper"},Qu={key:1,class:"error-message"},ed=["onMousedown"],td={class:"item-content"},nd={class:"item-label"},rd={key:0,class:"selected-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},id={class:"item-content"},sd={key:1,class:"empty-item"},ad=i.defineComponent({__name:"ComboboxComponent",props:{id:{default:ke()},label:{},optionsIsNumber:{type:Boolean},placeholder:{},options:{},optionsView:{},required:{type:Boolean},disabled:{type:Boolean},modelValue:{},error:{},withCreate:{},lang:{}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,s=i.inject("TableComponents",{labels:i.ref(Ne[t.lang??"en"])}).labels,a=e,l=i.ref([...t.options]),o=i.ref([...t.optionsView||t.options]);i.watch(()=>t.options,I=>{l.value=[...I]},{deep:!0}),i.watch(()=>t.optionsView,I=>{o.value=[...I||t.options]},{deep:!0});const u=i.ref(!1),h=i.ref(""),m=i.ref(!1),p=i.ref(null),d=()=>{u.value=!0,h.value=y.value||""},f=()=>{setTimeout(()=>{u.value=!1},200)},b=(I,C)=>t.optionsIsNumber?Number(I)===Number(C):String(I)===String(C),y=i.computed(()=>E(t.modelValue??"")),E=I=>{const C=l.value.findIndex($=>$===I);return C!==-1&&(o.value?.length??0)>C?o.value[C].toString():I?.toString?.()??""};i.watch(()=>t.modelValue,I=>{I===null&&a("update:modelValue","",t.id),u.value||(h.value=E(I??""))},{immediate:!0,deep:!0});const x=i.computed(()=>!t.withCreate&&l.value.length<5),S=i.computed(()=>{const I=h.value.toLowerCase().trim(),C=l.value.filter((v,B)=>(o.value[B].toString()?.toLowerCase?.()??"").includes(I)),$=o.value.some(v=>v.toString().toLowerCase().trim()===I);return I&&!$?[...C]:C}),A=i.computed(()=>{const I=h.value.toLowerCase().trim();return l.value.filter((C,$)=>(o.value[$].toString()?.toLowerCase?.()??"").includes(I))}),L=i.computed(()=>{const I=x.value?l.value:t.withCreate?S.value:A.value;return[...!t.required&&!l.value.includes("")?[""]:[],...I]}),O=I=>{const C=I?.toString?.().toLowerCase?.();return!o.value.some($=>$.toString().toLowerCase()===C)},W=I=>{if(t.disabled)return;const C=t.optionsIsNumber&&I!==""?Number(I):I;a("update:modelValue",C,t.id),u.value=!1,h.value=E(C)},H=async I=>{if(!t.withCreate.endPoint||!t.withCreate.DB_NAME){p.value?.show("error","Server Error!");return}try{p.value?.show("loading","Please wait...");const{image:C,...$}=I,v=t.withCreate?.submitOption?.delete?.authType??t.withCreate?.submitOption?.global?.authType??"cookie",B=t.withCreate?.submitOption?.delete?.token??t.withCreate?.submitOption?.global?.token??void 0,k=t.withCreate?.submitOption?.delete?.customHeaders??t.withCreate?.submitOption?.global?.customHeaders??void 0,P=await zl({data:$,validation:t.withCreate?.validation??void 0,endpoint:t.withCreate.endPoint,mode:"create",db:t.withCreate?.DB_NAME,authType:v,token:B,customHeaders:k});p.value?.show("success","Data created successfully");const _=t.optionsIsNumber?P.data[t.withCreate?.keys?.idKey??"id"]:P.data[t.withCreate?.keys?.nameKey??"name"],q=P.data[t.withCreate?.keys?.nameKey??"name"];_!=null&&q!=null&&(l.value.some(M=>M?.toString().toLowerCase()===_.toString().toLowerCase())||(l.value.push(_),o.value.push(q))),a("update:modelValue",_,t.id),m.value=!1,u.value=!1}catch(C){console.error(C),p.value?.show("error","Failed to create data")}};return(I,C)=>(i.openBlock(),i.createElementBlock("div",Zu,[n.label?(i.openBlock(),i.createElementBlock("label",{key:0,class:i.normalizeClass(["combobox-label",{"has-error":t.error}])},i.toDisplayString(n.label),3)):i.createCommentVNode("",!0),i.createElementVNode("div",Yu,[x.value?i.createCommentVNode("",!0):i.withDirectives((i.openBlock(),i.createElementBlock("input",{key:0,type:"text","onUpdate:modelValue":C[0]||(C[0]=$=>h.value=$),placeholder:i.unref(s)?.placeholder?.select,onFocus:C[1]||(C[1]=$=>!t.disabled&&d()),onBlur:f,disabled:t.disabled,class:i.normalizeClass(["combobox-input",{"has-error":t.error,"is-open":u.value}])},null,42,Xu)),[[i.vModelText,h.value]]),x.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Ju,[(i.openBlock(),i.createElementBlock("svg",{class:i.normalizeClass(["dropdown-icon",{"is-open":u.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[...C[5]||(C[5]=[i.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)])],2))])),x.value?(i.openBlock(),i.createElementBlock("div",{key:2,onClick:C[2]||(C[2]=$=>!t.disabled&&(u.value=!u.value)),class:i.normalizeClass(["simple-list-trigger",{disabled:t.disabled,"has-error":t.error,"is-open":u.value}])},[i.createElementVNode("span",{class:i.normalizeClass({"is-placeholder":!y.value})},i.toDisplayString(y.value||i.unref(s)?.placeholder.select),3),(i.openBlock(),i.createElementBlock("svg",{class:i.normalizeClass(["dropdown-icon",{"is-open":u.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[...C[6]||(C[6]=[i.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)])],2))],2)):i.createCommentVNode("",!0)]),t.error?(i.openBlock(),i.createElementBlock("p",Qu,i.toDisplayString(t.error),1)):i.createCommentVNode("",!0),i.createVNode(i.Transition,{"enter-active-class":"transition-enter-active","enter-from-class":"transition-enter-from","enter-to-class":"transition-enter-to","leave-active-class":"transition-leave-active","leave-from-class":"transition-leave-from","leave-to-class":"transition-leave-to"},{default:i.withCtx(()=>[u.value?(i.openBlock(),i.createElementBlock("ul",{key:0,class:i.normalizeClass(["dropdown-list",{"has-error":t.error,"simple-list":x.value}])},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(L.value,$=>(i.openBlock(),i.createElementBlock("li",{key:$,onMousedown:i.withModifiers(v=>W($),["prevent"]),class:i.normalizeClass(["dropdown-item",{selected:b($,n.modelValue)}])},[i.createElementVNode("div",td,[i.createElementVNode("span",nd,i.toDisplayString($===""?"— Empty —":E($)),1),$===n.modelValue?(i.openBlock(),i.createElementBlock("svg",rd,[...C[7]||(C[7]=[i.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)])])):i.createCommentVNode("",!0)])],42,ed))),128)),n.withCreate&&h.value&&O(h.value)?(i.openBlock(),i.createElementBlock("li",{key:0,onMousedown:C[3]||(C[3]=i.withModifiers($=>m.value=!0,["prevent"])),class:"create-item"},[i.createElementVNode("div",id,[C[8]||(C[8]=i.createElementVNode("svg",{class:"create-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[i.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})],-1)),i.createTextVNode(" "+i.toDisplayString(i.unref(s)?.btn?.add??"Create new")+' "'+i.toDisplayString(h.value)+'" ',1)])],32)):i.createCommentVNode("",!0),L.value.length===0?(i.openBlock(),i.createElementBlock("li",sd,i.toDisplayString(n.withCreate?"No matches. Create new data":"No options available"),1)):i.createCommentVNode("",!0)],2)):i.createCommentVNode("",!0)]),_:1}),m.value&&n.withCreate?.schema?(i.openBlock(),i.createBlock(i.unref(Fs),{key:2,schema:n.withCreate.schema,"initial-data":{},onSubmit:H,onCancel:C[4]||(C[4]=()=>m.value=!1)},null,8,["schema"])):i.createCommentVNode("",!0),i.createVNode(i.unref(Pl),{ref_key:"loader",ref:p},null,512)]))}}),Hl=we(ad,[["__scopeId","data-v-a06fd9a9"]]),ld={class:"date-input-wrapper"},od=["for"],cd=["id","value","disabled","min","max","placeholder"],ud={key:0,class:"error-message"},dd=i.defineComponent({__name:"DateInput",props:{id:{default:ke()},label:{},placeholder:{},modelValue:{},error:{},disabled:{type:Boolean},validate:{},lang:{}},emits:["update:modelValue","push:error","remove:error"],setup(n,{emit:e}){const t=n,s=i.inject("TableComponents",{labels:i.ref(Ne[t.lang??"en"])}).labels;i.computed(()=>s?.value?.lang??"en");const a=e,l=i.computed(()=>{if(t.validate){const m=t.validate,p=[];return m.minDate&&p.push(z("dateMin",{min:m.minDate},t.lang??"en")),m.maxDate&&p.push(z("dateMax",{max:m.maxDate},t.lang??"en")),p.join(`
|
|
3
|
-
`)}return""}),o=i.ref([]);i.watch(()=>[t.modelValue,t.disabled,t.validate],([m,p,d])=>{if(p){o.value=[];return}const f=[],b=hn(m);if(d&&typeof d=="object"){try{hn(m)}catch(A){o.value=[String(A)],a("push:error",o.value,t.id);return}const{minDate:y,maxDate:E}=d,x=y?hn(y):void 0,S=E?hn(E):void 0;x&&b&&b<x&&f.push(z("dateMin",{min:hn(x)},t.lang??"en")),S&&b&&b>S&&f.push(z("dateMax",{max:hn(S)},t.lang??"en"))}o.value=f,f.length?a("push:error",f,t.id):a("remove:error",t.id)}),i.onMounted(()=>{if(t.modelValue)try{hn(t.modelValue)}catch(m){o.value=[String(m)],a("push:error",o.value,t.id);return}});const u=i.computed(()=>t.placeholder??s?.value?.placeholder?.date??"");function h(m){if(t.disabled)return;const p=m.target;a("update:modelValue",p.value,t.id)}return(m,p)=>(i.openBlock(),i.createElementBlock("div",ld,[i.createElementVNode("label",{for:n.id,class:i.normalizeClass(["date-label",{"has-error":o.value.length||n.error}])},[i.createTextVNode(i.toDisplayString(n.label)+" ",1),l.value?(i.openBlock(),i.createBlock(i.unref(Ye),{key:0,text:l.value,as:"strong"},{default:i.withCtx(()=>[...p[0]||(p[0]=[i.createTextVNode(" ❓",-1)])]),_:1},8,["text"])):i.createCommentVNode("",!0)],10,od),i.createElementVNode("input",{id:n.id,type:"date",value:n.modelValue,disabled:n.disabled,min:t.validate?.minDate,max:t.validate?.maxDate,onInput:h,placeholder:u.value,class:i.normalizeClass(["date-input",{"has-error":o.value.length||n.error}])},null,42,cd),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.value,(d,f)=>(i.openBlock(),i.createElementBlock("p",{key:f,class:"error-message"},i.toDisplayString(d),1))),128)),typeof t.error=="string"&&o.value.length===0?(i.openBlock(),i.createElementBlock("p",ud,i.toDisplayString(n.error),1)):i.createCommentVNode("",!0)]))}}),Kl=we(dd,[["__scopeId","data-v-58dcde29"]]),hd={class:"datetime-input-wrapper"},fd=["for"],md=["id","value","disabled","min","max","placeholder"],pd={key:0,class:"error-message"},gd=i.defineComponent({__name:"DateTimeInput",props:{id:{type:String,default:()=>ke()},label:{type:String,required:!0},placeholder:String,modelValue:{type:String,default:""},error:[String,Array],disabled:Boolean,validate:Object,lang:String,outputFormat:{type:String,default:"local-offset"}},emits:["update:modelValue","push:error","remove:error"],setup(n,{emit:e}){const t=n,s=i.inject("TableComponents",{labels:i.ref(Ne[t.lang??"en"])}).labels,a=e;function l(d){if(!d)return"";if(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}$/.test(d))return d;if(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$/.test(d))return d.substring(0,16);try{const f=new Date(d);if(isNaN(f.getTime()))return"";const b=f.getFullYear(),y=(f.getMonth()+1).toString().padStart(2,"0"),E=f.getDate().toString().padStart(2,"0"),x=f.getHours().toString().padStart(2,"0"),S=f.getMinutes().toString().padStart(2,"0");return`${b}-${y}-${E}T${x}:${S}`}catch{return""}}const o=i.computed(()=>l(t.modelValue)),u=i.computed(()=>{if(t.validate){const d=t.validate,f=[];return d.minDateTime&&f.push(z("dateTimeMin",{min:d.minDateTime},t.lang??"en")),d.maxDateTime&&f.push(z("dateTimeMax",{max:d.maxDateTime},t.lang??"en")),f.join(`
|
|
4
|
-
`)}return""}),h=i.ref([]);i.watch(()=>({val:t.modelValue,disabled:t.disabled,validate:t.validate}),({val:d,disabled:f,validate:b})=>{if(f){h.value=[];return}const y=[],E=l(d);if(b){const{minDateTime:x,maxDateTime:S}=b;if(E){const A=x?l(x):void 0,L=S?l(S):void 0;A&&E<A&&y.push(z("dateTimeMin",{min:String(A)},t.lang??"en")),L&&E>L&&y.push(z("dateTimeMax",{max:String(L)},t.lang??"en"))}}h.value=y,y.length?a("push:error",y,t.id):a("remove:error",t.id)},{deep:!0,immediate:!0});const m=i.computed(()=>t.placeholder??s?.value?.placeholder?.datetime??"");function p(d){if(t.disabled)return;const b=d.target.value;if(!b){a("update:modelValue","",t.id);return}const y=`${b}:00`,E=new Date(y);let x="";if(t.outputFormat==="utc")x=E.toISOString();else{const S=E.getTimezoneOffset(),A=Math.abs(S/60),L=Math.abs(S%60),W=`${S>0?"-":"+"}${String(A).padStart(2,"0")}:${String(L).padStart(2,"0")}`;x=`${y}${W}`}a("update:modelValue",x,t.id)}return(d,f)=>(i.openBlock(),i.createElementBlock("div",hd,[i.createElementVNode("label",{for:n.id,class:i.normalizeClass(["datetime-label",{"has-error":h.value.length||n.error}])},[i.createTextVNode(i.toDisplayString(n.label)+" ",1),u.value?(i.openBlock(),i.createBlock(i.unref(Ye),{key:0,text:u.value,as:"strong"},{default:i.withCtx(()=>[...f[0]||(f[0]=[i.createTextVNode(" ❓",-1)])]),_:1},8,["text"])):i.createCommentVNode("",!0)],10,fd),i.createElementVNode("input",{id:n.id,type:"datetime-local",value:o.value,disabled:n.disabled,min:t.validate?.minDateTime,max:t.validate?.maxDateTime,onInput:p,placeholder:m.value,class:i.normalizeClass(["datetime-input",{"has-error":h.value.length||n.error}])},null,42,md),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(h.value,(b,y)=>(i.openBlock(),i.createElementBlock("p",{key:y,class:"error-message"},i.toDisplayString(b),1))),128)),typeof t.error=="string"&&h.value.length===0?(i.openBlock(),i.createElementBlock("p",pd,i.toDisplayString(n.error),1)):i.createCommentVNode("",!0)]))}}),Gl=we(gd,[["__scopeId","data-v-d551c258"]]),bd={class:"email-input-wrapper"},vd=["for"],yd=["id","value","disabled","placeholder"],Ed={key:1,class:"error-message"},wd=i.defineComponent({__name:"EmailInput",props:{id:{default:ke()},label:{},placeholder:{},modelValue:{},error:{},disabled:{type:Boolean},validate:{},lang:{}},emits:["update:modelValue","push:error","remove:error"],setup(n,{emit:e}){const t=n,r=String(t.modelValue??""),a=i.inject("TableComponents",{labels:i.ref(Ne[t.lang??"en"])}).labels,l=e,o=i.computed(()=>{if(t.validate){const p=t.validate,d=[];return Array.isArray(p.duplicate)&&d.push(z("valueList",{value:p.duplicate.join(", ")},t.lang??"en")),d.join(`
|
|
5
|
-
`)}return""}),u=i.ref([]);i.watch(()=>({val:t.modelValue,disabled:t.disabled,validate:t.validate}),({val:p,disabled:d,validate:f})=>{if(d){u.value=[];return}const b=[],y=String(p??"");if(f&&Array.isArray(f.duplicate)&&f.duplicate.length>0){const E=f.duplicate.map(String).includes(y),x=String(r)===y;E&&!x&&b.push(z("valueList",{value:y},t.lang??"en"))}Ol.test(y)||b.push(z("email",void 0,t.lang??"en")),u.value=b,b.length?l("push:error",b,t.id):l("remove:error",t.id)});const h=i.computed(()=>t.placeholder??a?.value?.placeholder?.email??"");function m(p){if(t.disabled)return;const d=p.target;l("update:modelValue",d.value,t.id)}return(p,d)=>(i.openBlock(),i.createElementBlock("div",bd,[i.createElementVNode("label",{for:n.id,class:i.normalizeClass(["email-label",{"has-error":u.value.length!==0||n.error}])},[i.createTextVNode(i.toDisplayString(n.label)+" ",1),o.value?(i.openBlock(),i.createBlock(i.unref(Ye),{key:0,text:o.value,as:"strong"},{default:i.withCtx(()=>[...d[0]||(d[0]=[i.createTextVNode(" ❓",-1)])]),_:1},8,["text"])):i.createCommentVNode("",!0)],10,vd),i.createElementVNode("input",{id:n.id,type:"email",value:n.modelValue,disabled:n.disabled,onInput:m,placeholder:h.value,class:i.normalizeClass(["email-input",{"has-error":u.value.length!==0||n.error}])},null,42,yd),u.value.length!==0?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(u.value,(f,b)=>(i.openBlock(),i.createElementBlock("p",{key:b,class:"error-message"},i.toDisplayString(f),1))),128)):i.createCommentVNode("",!0),typeof t.error=="string"&&u.value.length===0?(i.openBlock(),i.createElementBlock("p",Ed,i.toDisplayString(n.error),1)):i.createCommentVNode("",!0)]))}}),Wl=we(wd,[["__scopeId","data-v-d50d7a08"]]),xd={class:"file-array-wrapper"},Td=["for"],Ad={class:"upload-container"},Nd={key:0,class:"file-list"},kd={class:"file-info"},Sd={class:"file-details"},Cd={class:"file-name"},Ld={class:"file-size"},Bd=["onClick"],Id={key:1,class:"empty-state"},Od={class:"upload-action"},Dd=["id","disabled"],Md=["for"],Rd={class:"error-container"},qd=i.defineComponent({__name:"FileArrayInput",props:{id:{default:ke},label:{},modelValue:{default:()=>[]},disabled:{type:Boolean},validate:{},lang:{},error:{}},emits:["update:modelValue","push:error","remove:error"],setup(n,{emit:e}){const t=n,r=e,a=i.inject("TableComponents",{labels:i.ref(Ne[t.lang??"en"])}).labels,l=i.inject("TableComponents")?.ShowAlert,o=i.ref([]),u=i.ref([]),h=i.computed(()=>u.value.length>0?u.value:typeof t.error=="string"?[t.error]:Array.isArray(t.error)?t.error:[]),m=i.computed(()=>t.disabled?!0:t.validate?.maxFiles&&t.modelValue&&t.modelValue.length>=t.validate.maxFiles),p=i.computed(()=>{if(!t.validate)return"";const E=t.validate,x=[];return E.maxFiles&&x.push(z("fileMaxFiles",{max:E.maxFiles},t.lang??"en")),E.allowedTypes&&x.push(z("fileType",{},t.lang??"en")+` (${E.allowedTypes.join(", ")})`),E.maxSize&&x.push(z("fileMaxSize",{max:E.maxSize},t.lang??"en")),x.join(`
|
|
6
|
-
`)});i.watch(()=>t.modelValue,E=>{if(!E||E.length===0){o.value=[],b();return}o.value=E.map(x=>x instanceof File?{name:x.name,size:`${(x.size/1024).toFixed(2)} KB`}:{name:x,size:"N/A"}),b()},{immediate:!0,deep:!0});function d(E){if(t.disabled)return;const x=E.target,S=x.files;if(!S||S.length===0)return;const A=t.modelValue||[],L=t.validate?.maxFiles;if(L&&A.length+S.length>L){l?.("error",z("fileMaxFiles",{max:L},t.lang??"en")),x.value="";return}const O=[],W=t.validate?.allowedTypes?.map(H=>H.toLowerCase())??[];for(const H of Array.from(S)){const I=H.name.split(".").pop()?.toLowerCase();if(W.length>0&&(!I||!W.includes(I))){l?.("error","Invalid file type",[z("fileType",{},t.lang??"en")+` (${t.validate?.allowedTypes?.join(", ")})`]);continue}O.push(H)}r("update:modelValue",[...A,...O]),x.value=""}function f(E){if(t.disabled)return;const x=[...t.modelValue||[]];x.splice(E,1),r("update:modelValue",x)}function b(){if(!t.validate||!t.modelValue||t.modelValue.length===0){u.value=[],r("remove:error",t.id);return}const E=[];t.validate.maxFiles&&t.modelValue.length>t.validate.maxFiles&&E.push(z("fileMaxFiles",{max:t.validate.maxFiles},t.lang??"en")),t.modelValue.forEach((x,S)=>{if(x instanceof File){const A=y(x,S+1);E.push(...A)}}),u.value=[...new Set(E)],u.value.length>0?r("push:error",u.value,t.id):r("remove:error",t.id)}function y(E,x){const S=[],A=t.validate;if(A.allowedTypes){const L=E.name.split(".").pop()?.toLowerCase();(!L||!A.allowedTypes.map(O=>O.toLowerCase()).includes(L))&&S.push(`File #${x} (${E.name}): `+z("fileType",{},t.lang??"en")+` (${A.allowedTypes.join(", ")})`)}return A.maxSize&&E.size/1024>A.maxSize&&S.push(`File #${x} (${E.name}): `+z("fileMaxSize",{max:A.maxSize},t.lang??"en")),S}return(E,x)=>(i.openBlock(),i.createElementBlock("div",xd,[i.createElementVNode("label",{for:n.id,class:i.normalizeClass(["file-array-label",{"has-error":h.value.length!==0}])},[i.createTextVNode(i.toDisplayString(n.label)+" ",1),p.value?(i.openBlock(),i.createBlock(i.unref(Ye),{key:0,text:p.value,as:"strong"},{default:i.withCtx(()=>[...x[0]||(x[0]=[i.createTextVNode(" ❓",-1)])]),_:1},8,["text"])):i.createCommentVNode("",!0)],10,Td),i.createElementVNode("div",Ad,[o.value.length>0?(i.openBlock(),i.createElementBlock("div",Nd,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.value,(S,A)=>(i.openBlock(),i.createElementBlock("div",{key:A,class:"file-item"},[i.createElementVNode("div",kd,[x[1]||(x[1]=i.createElementVNode("span",{class:"file-icon"},"📄",-1)),i.createElementVNode("div",Sd,[i.createElementVNode("span",Cd,i.toDisplayString(S.name),1),i.createElementVNode("span",Ld,i.toDisplayString(S.size),1)])]),n.disabled?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("button",{key:0,onClick:L=>f(A),class:"remove-button","aria-label":"Remove file"}," × ",8,Bd))]))),128))])):(i.openBlock(),i.createElementBlock("div",Id,[i.createElementVNode("p",null,i.toDisplayString(i.unref(a)?.message?.noItemSelected),1)])),i.createElementVNode("div",Od,[i.createElementVNode("input",{id:n.id,type:"file",multiple:"",onChange:d,class:"file-input",disabled:t.disabled},null,40,Dd),i.createElementVNode("label",{for:n.id,class:i.normalizeClass(["upload-button",{disabled:m.value}])},i.toDisplayString(i.unref(a)?.btn?.add??"Add Files"),11,Md)])]),i.createElementVNode("div",Rd,[h.value.length>0?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(h.value,(S,A)=>(i.openBlock(),i.createElementBlock("p",{key:A,class:"error-message"},i.toDisplayString(S),1))),128)):i.createCommentVNode("",!0)])]))}}),Zl=we(qd,[["__scopeId","data-v-5028665d"]]),Vd={class:"file-input-wrapper"},$d=["for"],_d={class:"upload-container"},jd={class:"upload-content"},Pd=["id","disabled"],Fd={class:"button-group"},Ud=["for"],zd={key:0,class:"file-info"},Hd={key:0},Kd={key:1},Gd={class:"error-container"},Wd=i.defineComponent({__name:"FileInput",props:{id:{default:ke()},label:{},modelValue:{},disabled:{type:Boolean},validate:{},lang:{},error:{}},emits:["update:modelValue","push:error","remove:error"],setup(n,{emit:e}){const t=n,s=i.inject("TableComponents",{labels:i.ref(Ne[t.lang??"en"])}).labels,a=e,l=i.ref(""),o=i.ref(""),u=i.ref(""),h=i.ref(!0),m=i.ref([]),p=i.computed(()=>{if(t.validate){const E=t.validate,x=[];return E.allowedTypes&&x.push(z("fileType",{},t.lang??"en")+` (${E.allowedTypes.join(", ")})`),E.maxSize&&x.push(z("fileMaxSize",{max:E.maxSize},t.lang??"en")),x.join(`
|
|
7
|
-
`)}return""});i.watch(()=>t.modelValue,E=>{E instanceof File?(l.value=E.name,o.value=`${(E.size/1024).toFixed(2)} KB`,u.value=E.type.split("/").pop()||E.name.split(".").pop()||"unknown",b(E)):y()},{immediate:!0});function d(E){if(t.disabled)return;const S=E.target.files?.[0];S&&a("update:modelValue",S,t.id)}function f(){t.disabled||(a("update:modelValue",null,t.id),a("remove:error",t.id))}function b(E){const x=[];if(t.validate?.allowedTypes){const S=E.name.split(".").pop()?.toLowerCase(),A=t.validate.allowedTypes.map(L=>L.toLowerCase());(!S||!A.includes(S))&&x.push(z("fileType",{},t.lang??"en")+` (${A.join(", ")})`)}t.validate?.maxSize&&(h.value=E.size/1024<=t.validate.maxSize,h.value||x.push(z("fileMaxSize",{max:t.validate.maxSize},t.lang??"en"))),m.value=x,x.length?a("push:error",x,t.id):a("remove:error",t.id)}function y(){l.value="",o.value="",u.value="",m.value=[]}return(E,x)=>(i.openBlock(),i.createElementBlock("div",Vd,[i.createElementVNode("label",{for:n.id,class:i.normalizeClass(["file-label",{"has-error":m.value.length!==0||n.error}])},[i.createTextVNode(i.toDisplayString(n.label)+" ",1),p.value?(i.openBlock(),i.createBlock(i.unref(Ye),{key:0,text:p.value,as:"strong"},{default:i.withCtx(()=>[...x[0]||(x[0]=[i.createTextVNode(" ❓",-1)])]),_:1},8,["text"])):i.createCommentVNode("",!0)],10,$d),i.createElementVNode("div",_d,[i.createElementVNode("div",jd,[i.createElementVNode("input",{id:n.id,type:"file",onChange:d,class:"file-input",disabled:t.disabled},null,40,Pd),i.createElementVNode("div",Fd,[i.createElementVNode("label",{for:n.id,class:i.normalizeClass(["btn btn-select",{disabled:t.disabled}])},i.toDisplayString(l.value?i.unref(s)?.btn?.change:i.unref(s)?.btn?.select),11,Ud),l.value&&!t.disabled?(i.openBlock(),i.createElementBlock("button",{key:0,type:"button",onClick:f,class:"btn btn-remove"},i.toDisplayString(i.unref(s)?.btn?.remove||"Hapus"),1)):i.createCommentVNode("",!0)]),l.value?(i.openBlock(),i.createElementBlock("div",zd,[i.createElementVNode("p",null,[x[1]||(x[1]=i.createElementVNode("b",null,"Name:",-1)),i.createTextVNode(" "+i.toDisplayString(l.value),1)]),o.value?(i.openBlock(),i.createElementBlock("p",Hd,[x[2]||(x[2]=i.createElementVNode("b",null,"Size:",-1)),i.createTextVNode(" "+i.toDisplayString(o.value),1)])):i.createCommentVNode("",!0),u.value?(i.openBlock(),i.createElementBlock("p",Kd,[x[3]||(x[3]=i.createElementVNode("b",null,"Type:",-1)),i.createTextVNode(" "+i.toDisplayString(u.value),1)])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),i.createElementVNode("div",Gd,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(m.value,(S,A)=>(i.openBlock(),i.createElementBlock("p",{key:A,class:"error-message"},i.toDisplayString(S),1))),128))])])]))}}),Yl=we(Wd,[["__scopeId","data-v-0d1262bf"]]),Zd={class:"group-renderer-wrapper"},Yd={key:0,class:"error-message"},Xd={value:null,disabled:""},Jd={key:0,value:null},Qd=["value"],eh={class:"checkbox-label"},th=["value"],nh={key:0,class:"checkbox-content"},rh=i.defineComponent({__name:"GroupRenderer",props:{id:{default:ke()},label:{},typeDesign:{},options:{},optionsLabels:{},withValue:{type:Boolean},formData:{},required:{type:Boolean},disabled:{type:Boolean},errors:{},error:{},lang:{}},emits:["update:model-value","push:errors","remove:errors","selected-option-change","multi-selected-change"],setup(n,{emit:e}){const t=e,r=n,a=i.inject("TableComponents",{labels:i.ref(Ne[r.lang??"en"])}).labels,{selectedOption:l,multiSelected:o,errorPush:u,errorRemove:h}=Nu(r,t);return(m,p)=>(i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("label",{class:i.normalizeClass(["group-label",{"has-error":r.error}])},i.toDisplayString(n.label),3),i.createElementVNode("div",Zd,[r.error?(i.openBlock(),i.createElementBlock("p",Yd,i.toDisplayString(r.error),1)):i.createCommentVNode("",!0),n.typeDesign==="select"||n.typeDesign==="dropdown"?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.withDirectives(i.createElementVNode("select",{"onUpdate:modelValue":p[0]||(p[0]=d=>i.isRef(l)?l.value=d:null),class:"group-select"},[i.createElementVNode("option",Xd,i.toDisplayString(i.unref(a)?.placeholder?.select),1),n.required?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("option",Jd,i.toDisplayString(i.unref(a)?.noSelection),1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.options,(d,f)=>(i.openBlock(),i.createElementBlock("option",{value:f,key:f},i.toDisplayString(r.optionsLabels?.[f]??f),9,Qd))),128))],512),[[i.vModelSelect,i.unref(l)]]),i.unref(l)&&n.options[i.unref(l)]?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(n.options[i.unref(l)],(d,f)=>(i.openBlock(),i.createBlock(i.unref(Rr),{"form-data":r.formData,errors:n.errors,lang:n.lang??"en","onUpdate:modelValue":(b,y)=>m.$emit("update:model-value",b,y),"onPush:errors":i.unref(u),"onRemove:errors":i.unref(h),onMultiSelectedChange:(b,y)=>m.$emit("multi-selected-change",b,y),onSelectedOptionChange:(b,y)=>m.$emit("selected-option-change",b,y),key:f,field:d,"field-key":f},null,8,["form-data","errors","lang","onUpdate:modelValue","onPush:errors","onRemove:errors","onMultiSelectedChange","onSelectedOptionChange","field","field-key"]))),128)):i.createCommentVNode("",!0)],64)):n.typeDesign==="cekbox"?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:2},i.renderList(n.options,(d,f)=>(i.openBlock(),i.createElementBlock("div",{key:f,class:"checkbox-group-item"},[i.createElementVNode("label",eh,[i.withDirectives(i.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":p[1]||(p[1]=b=>i.isRef(o)?o.value=b:null),value:f},null,8,th),[[i.vModelCheckbox,i.unref(o)]]),i.createTextVNode(" "+i.toDisplayString(r.optionsLabels?.[f]??f),1)]),i.unref(o).includes(f)?(i.openBlock(),i.createElementBlock("div",nh,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(d,(b,y)=>(i.openBlock(),i.createBlock(i.unref(Rr),{key:y,field:b,"field-key":y,"form-data":r.formData,errors:n.errors,lang:n.lang??"en","onUpdate:modelValue":(E,x)=>m.$emit("update:model-value",E,x),"onPush:errors":i.unref(u),"onRemove:errors":i.unref(h),onMultiSelectedChange:(E,x)=>m.$emit("multi-selected-change",E,x),onSelectedOptionChange:(E,x)=>m.$emit("selected-option-change",E,x)},null,8,["field","field-key","form-data","errors","lang","onUpdate:modelValue","onPush:errors","onRemove:errors","onMultiSelectedChange","onSelectedOptionChange"]))),128))])):i.createCommentVNode("",!0)]))),128)):i.createCommentVNode("",!0)])]))}}),Xl=we(rh,[["__scopeId","data-v-8d4c24ae"]]),ih={class:"image-array-wrapper"},sh=["for"],ah={class:"upload-container"},lh={key:0,class:"image-grid"},oh=["src","alt"],ch=["onClick"],uh={key:1,class:"empty-state"},dh={class:"upload-action"},hh=["id","disabled"],fh=["for"],mh={class:"error-container"},ph=i.defineComponent({__name:"ImageArrayInput",props:{id:{default:ke},label:{},modelValue:{default:()=>[]},previewAlt:{},disabled:{type:Boolean},error:{},previewImages:{},validate:{},watermark:{},lang:{}},emits:["update:modelValue","push:error","remove:error"],setup(n,{emit:e}){const t=n,r=e,a=i.inject("TableComponents",{labels:i.ref(Ne[t.lang??"en"])}).labels,l=i.inject("TableComponents")?.ShowAlert,o=i.ref([]),u=i.ref([]),h=i.computed(()=>u.value.length>0?u.value:typeof t.error=="string"?[t.error]:Array.isArray(t.error)?t.error:[]),m=i.computed(()=>t.disabled?!0:t.validate?.maxFiles&&t.modelValue&&t.modelValue.length>=t.validate.maxFiles),p=i.computed(()=>{if(!t.validate)return"";const A=t.validate,L=[];if(A.maxFiles&&L.push(z("imageMaxFiles",{max:A.maxFiles},t.lang??"en")),A.allowedTypes&&L.push(z("imageType",{},t.lang??"en")+` (${A.allowedTypes.join(", ")})`),A.maxSize&&L.push(z("imageMaxSize",{max:A.maxSize},t.lang??"en")),A.pixel){const O=A.pixel;("minWidth"in O||"maxWidth"in O||"minHeight"in O||"maxHeight"in O)&&(O.minWidth&&L.push(z("imageMinWidth",{min:O.minWidth},t.lang??"en")),O.minHeight&&L.push(z("imageMinHeight",{min:O.minHeight},t.lang??"en")),O.maxWidth&&L.push(z("imageMaxWidth",{max:O.maxWidth},t.lang??"en")),O.maxHeight&&L.push(z("imageMaxHeight",{max:O.maxHeight},t.lang??"en"))),("width"in O||"height"in O)&&L.push(z("imagePixel",{width:O.width??"any",height:O.height??"any"},t.lang??"en"))}return A.ratio&&L.push(z("imageRatio",{w:A.ratio.Width,h:A.ratio.Height},t.lang??"en")),L.join(`
|
|
8
|
-
`)});i.watch(()=>t.modelValue,async A=>{if(!A||A.length===0){o.value=t.previewImages||[],E();return}const L=A.map(O=>new Promise(W=>{if(typeof O=="string")W(O);else if(O instanceof File){const H=new FileReader;H.onload=I=>W(I.target?.result),H.onerror=()=>W(""),H.readAsDataURL(O)}else W("")}));o.value=await Promise.all(L),E()},{immediate:!0,deep:!0});function d(A,L=!1){return new Promise((O,W)=>{const H=new Image;L&&(H.crossOrigin="anonymous"),H.onload=()=>O(H),H.onerror=I=>{console.error("Failed to load image:",A,I),W(new Error(`Failed to load image: ${A}`))},H.src=A})}async function f(A){if(!t.watermark)return A;const L=t.watermark,O=URL.createObjectURL(A);try{const[W,H]=await Promise.all([d(O,!1),d(L.url,!0)]),I=document.createElement("canvas");I.width=W.width,I.height=W.height;const C=I.getContext("2d");if(!C)return A;C.drawImage(W,0,0),C.globalAlpha=L.transparant/100;let $=0,v=0;const B=10;switch(L.position){case"top-left":$=B,v=B,C.drawImage(H,$,v);break;case"top-right":$=W.width-H.width-B,v=B,C.drawImage(H,$,v);break;case"bottom-left":$=B,v=W.height-H.height-B,C.drawImage(H,$,v);break;case"bottom-right":$=W.width-H.width-B,v=W.height-H.height-B,C.drawImage(H,$,v);break;case"full":C.drawImage(H,0,0,W.width,W.height);break}return C.globalAlpha=1,new Promise((k,P)=>{I.toBlob(_=>{if(_){const q=new File([_],A.name,{type:A.type});k(q)}else P(new Error("Canvas toBlob failed"))},A.type)})}catch(W){throw console.error(`Watermark application failed for ${A.name}:`,W),l?.("error",`Watermark Error (${A.name})`,["Gagal menerapkan watermark pada gambar."]),W}finally{URL.revokeObjectURL(O)}}async function b(A){if(t.disabled)return;const L=A.target,O=L.files;if(!O||O.length===0)return;const W=t.modelValue||[],H=t.validate?.maxFiles;if(H&&W.length+O.length>H){l?.("error",z("imageMaxFiles",{max:H},t.lang??"en")),L.value="";return}const I=[],C=t.validate?.allowedTypes?.map(v=>v.toLowerCase())??[];for(const v of Array.from(O)){const B=v.name.split(".").pop()?.toLowerCase();if(C.length>0&&(!B||!C.includes(B))){l?.("error","Invalid file type",[z("imageType",{},t.lang??"en")+` (${t.validate?.allowedTypes?.join(", ")})`]);continue}I.push(v)}let $=[];if(t.watermark&&I.length>0)try{const v=I.map(B=>f(B));$=await Promise.all(v)}catch(v){console.error("Batch watermarking failed:",v),L.value="";return}else $=I;$.length>0&&r("update:modelValue",[...W,...$]),L.value=""}function y(A){if(t.disabled)return;const L=[...t.modelValue||[]];L.splice(A,1),r("update:modelValue",L)}async function E(){if(!t.validate||!t.modelValue||t.modelValue.length===0){u.value=[],r("remove:error",t.id);return}const A=[];t.validate.maxFiles&&t.modelValue.length>t.validate.maxFiles&&A.push(z("imageMaxFiles",{max:t.validate.maxFiles},t.lang??"en"));const L=t.modelValue.map((W,H)=>x(W,H+1));(await Promise.all(L)).forEach(W=>A.push(...W)),u.value=[...new Set(A)],u.value.length>0?r("push:error",u.value,t.id):r("remove:error",t.id)}async function x(A,L){const O=[];if(!(A instanceof File))return typeof A=="string"&&(t.validate?.pixel||t.validate?.ratio),[];const W=A,H=t.validate;if(H.allowedTypes){const I=W.name.split(".").pop()?.toLowerCase();(!I||!H.allowedTypes.map(C=>C.toLowerCase()).includes(I))&&O.push(`File ${L}: `+z("imageType",{},t.lang??"en")+` (${H.allowedTypes.join(", ")})`)}if(H.maxSize&&W.size/1024>H.maxSize&&O.push(`File ${L}: `+z("imageMaxSize",{max:H.maxSize},t.lang??"en")),H.pixel||H.ratio){const I=await S(W),C=I.width,$=I.height;if(H.pixel){const v=H.pixel;("minWidth"in v&&v.minWidth&&C<v.minWidth||"minHeight"in v&&v.minHeight&&$<v.minHeight||"maxWidth"in v&&v.maxWidth&&C>v.maxWidth||"maxHeight"in v&&v.maxHeight&&$>v.maxHeight)&&O.push(`File ${L}: Invalid dimensions.`),("width"in v&&v.width&&C!==v.width||"height"in v&&v.height&&$!==v.height)&&O.push(`File ${L}: `+z("imagePixel",{width:v.width??C,height:v.height??$},t.lang??"en"))}if(H.ratio){const v=H.ratio.Width,B=H.ratio.Height,k=ir(C,$),P=ir(v,B);let _=k.w===P.w&&k.h===P.h;if(!_){const q=C/$,N=v/B;_=Math.abs(q-N)<=.01}_||O.push(`File ${L}: `+z("imageRatio",{w:String(v),h:String(B)},t.lang??"en"))}}return O}function S(A){return new Promise(L=>{const O=new FileReader;O.onload=W=>{const H=new Image;H.onload=()=>L({width:H.width,height:H.height}),H.onerror=()=>L({width:0,height:0}),H.src=W.target?.result},O.onerror=()=>L({width:0,height:0}),O.readAsDataURL(A)})}return(A,L)=>(i.openBlock(),i.createElementBlock("div",ih,[i.createElementVNode("label",{for:n.id,class:i.normalizeClass(["image-array-label",{"has-error":h.value.length!==0}])},[i.createTextVNode(i.toDisplayString(n.label)+" ",1),p.value?(i.openBlock(),i.createBlock(i.unref(Ye),{key:0,text:p.value,as:"strong"},{default:i.withCtx(()=>[...L[0]||(L[0]=[i.createTextVNode(" ❓",-1)])]),_:1},8,["text"])):i.createCommentVNode("",!0)],10,sh),i.createElementVNode("div",ah,[o.value.length>0?(i.openBlock(),i.createElementBlock("div",lh,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.value,(O,W)=>(i.openBlock(),i.createElementBlock("div",{key:W,class:"image-item-wrapper"},[i.createElementVNode("img",{src:O,alt:`${n.previewAlt} ${W+1}`,class:"image-preview"},null,8,oh),n.disabled?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("button",{key:0,onClick:H=>y(W),class:"remove-button","aria-label":"Remove image"}," × ",8,ch))]))),128))])):(i.openBlock(),i.createElementBlock("div",uh,[i.createElementVNode("p",null,i.toDisplayString(i.unref(a)?.message?.noItemSelected),1)])),i.createElementVNode("div",dh,[i.createElementVNode("input",{id:n.id,type:"file",accept:"image/*",multiple:"",onChange:b,class:"file-input",disabled:t.disabled},null,40,hh),i.createElementVNode("label",{for:n.id,class:i.normalizeClass(["upload-button",{disabled:m.value}])},i.toDisplayString(i.unref(a)?.btn?.add),11,fh)])]),i.createElementVNode("div",mh,[h.value.length>0?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(h.value,(O,W)=>(i.openBlock(),i.createElementBlock("p",{key:W,class:"error-message"},i.toDisplayString(O),1))),128)):i.createCommentVNode("",!0)])]))}}),Jl=we(ph,[["__scopeId","data-v-c23f234e"]]),gh={class:"image-input-wrapper"},bh=["for"],vh={class:"upload-container"},yh={class:"upload-content"},Eh=["src","alt"],wh=["id","disabled"],xh={class:"button-group"},Th=["for"],Ah={class:"info-grid"},Nh={class:"info-value"},kh={class:"info-value"},Sh={class:"info-value"},Ch={class:"info-value"},Lh={class:"error-container"},Bh={key:1,class:"error-message"},Ih=i.defineComponent({__name:"ImageInput",props:{id:{default:ke()},label:{},modelValue:{},previewAlt:{},disabled:{type:Boolean},error:{},previewImage:{},validate:{},watermark:{},lang:{}},emits:["update:modelValue","push:error","remove:error"],setup(n,{emit:e}){const t=n,s=i.inject("TableComponents",{labels:i.ref(Ne[t.lang??"en"])}).labels,a=i.inject("TableComponents")?.ShowAlert,l=e,o=i.ref(""),u=i.ref(""),h=i.ref(""),m=i.ref(""),p=i.ref(null),d=i.ref(null),f=i.ref(t.previewImage||"https://static.vecteezy.com/system/resources/thumbnails/005/720/408/small_2x/crossed-image-icon-picture-not-available-delete-picture-symbol-free-vector.jpg"),b=i.ref(!0);i.ref(!0);const y=i.ref(!0),E=i.ref([]),x=i.computed(()=>{if(t.validate){const I=t.validate,C=[];if(I.allowedTypes&&C.push(z("imageType",{},t.lang??"en")+` (${I.allowedTypes.join(", ")})`),I.maxSize&&C.push(z("imageMaxSize",{max:I.maxSize},t.lang??"en")),I.pixel){const $=I.pixel;("minWidth"in $||"maxWidth"in $||"minHeight"in $||"maxHeight"in $)&&($.minWidth&&C.push(z("imageMinWidth",{min:$.minWidth},t.lang??"en")),$.minHeight&&C.push(z("imageMinHeight",{min:$.minHeight},t.lang??"en")),$.maxWidth&&C.push(z("imageMaxWidth",{max:$.maxWidth},t.lang??"en")),$.maxHeight&&C.push(z("imageMaxHeight",{max:$.maxHeight},t.lang??"en"))),("width"in $||"height"in $)&&C.push(z("imagePixel",{width:$.width??"any",height:$.height??"any"},t.lang??"en"))}return I.ratio&&C.push(z("imageRatio",{w:I.ratio.Width,h:I.ratio.Height},t.lang??"en")),C.join(`
|
|
9
|
-
`)}return""});i.watch(()=>t.modelValue,I=>{if(I instanceof File){o.value=I.name,d.value=I.size/1024,h.value=`${d.value.toFixed(2)} KB`;const C=new FileReader;C.onload=$=>{const v=$.target?.result;f.value=v;const B=new Image;B.onload=()=>{u.value=`${B.width} x ${B.height}`,m.value=Cl(B.width,B.height),p.value={width:B.width,height:B.height},W()},B.src=v},C.readAsDataURL(I)}else if(typeof I=="string"){f.value=I;const C=new Image;C.onload=()=>{u.value=`${C.width} x ${C.height}`,p.value={width:C.width,height:C.height},W()},C.src=I}else H()},{immediate:!0});function S(I,C=!1){return new Promise(($,v)=>{const B=new Image;C&&(B.crossOrigin="anonymous"),B.onload=()=>$(B),B.onerror=k=>{v(new Error(`Failed to load image: ${I}`))},B.src=I})}async function A(I){if(!t.watermark)return I;const C=t.watermark,$=URL.createObjectURL(I);try{const[v,B]=await Promise.all([S($,!1),S(C.url,!0)]),k=document.createElement("canvas");k.width=v.width,k.height=v.height;const P=k.getContext("2d");if(!P)return I;P.drawImage(v,0,0),P.globalAlpha=C.transparant/100;let _=0,q=0;const N=10;switch(C.position){case"top-left":_=N,q=N,P.drawImage(B,_,q);break;case"top-right":_=v.width-B.width-N,q=N,P.drawImage(B,_,q);break;case"bottom-left":_=N,q=v.height-B.height-N,P.drawImage(B,_,q);break;case"bottom-right":_=v.width-B.width-N,q=v.height-B.height-N,P.drawImage(B,_,q);break;case"full":P.drawImage(B,0,0,v.width,v.height);break}return P.globalAlpha=1,new Promise((M,j)=>{k.toBlob(D=>{if(D){const F=new File([D],I.name,{type:I.type});M(F)}else j(new Error("Canvas toBlob failed"))},I.type)})}catch(v){throw a?.("error","Watermark Error",["Gagal menerapkan watermark pada gambar."]),v}finally{URL.revokeObjectURL($)}}async function L(I){if(t.disabled)return;const $=I.target.files?.[0];if($){const v=t.validate?.allowedTypes??["png","jpg","jpeg","gif","bmp","webp","heif","heic","tiff","tif","svg","avif","ico","jfif"],B=$.name.split(".").pop()?.toLowerCase();if(!B||!v.map(P=>P.toLowerCase()).includes(B)){a?.("error","Invalid file type",[z("imageType",{},t.lang??"en")+` (${v.join(", ")})`]),l("update:modelValue",null,t.id);return}let k=$;if(t.watermark)try{k=await A($)}catch{l("update:modelValue",null,t.id);return}l("update:modelValue",k,t.id)}}function O(){t.disabled||(l("update:modelValue",null,t.id),l("remove:error",t.id))}function W(){if(!t.validate){E.value=[],l("remove:error",t.id);return}const I=[];if(t.validate.allowedTypes&&t.modelValue instanceof File){const C=t.modelValue.name.split(".").pop()?.toLowerCase(),$=t.validate.allowedTypes.map(B=>B.toLowerCase());(C?$.includes(C):!1)||I.push(z("imageType",{},t.lang??"en")+` (${$.join(", ")})`)}if(t.validate.maxSize&&(b.value=d.value<=t.validate.maxSize,b.value||I.push(z("imageMaxSize",{max:t.validate.maxSize},t.lang??"en"))),t.validate.pixel&&p.value){const C=t.validate.pixel,$=p.value.width,v=p.value.height;if(("minWidth"in C||"maxWidth"in C||"minHeight"in C||"maxHeight"in C)&&(C.minWidth&&$<C.minWidth&&I.push(z("imageMinWidth",{min:C.minWidth},t.lang??"en")),C.minHeight&&v<C.minHeight&&I.push(z("imageMinHeight",{min:C.minHeight},t.lang??"en")),C.maxWidth&&$>C.maxWidth&&I.push(z("imageMaxWidth",{max:C.maxWidth},t.lang??"en")),C.maxHeight&&v>C.maxHeight&&I.push(z("imageMaxHeight",{max:C.maxHeight},t.lang??"en"))),"width"in C||"height"in C){const B=!C.width||$===C.width,k=!C.height||v===C.height;(!B||!k)&&I.push(z("imagePixel",{width:C.width??$,height:C.height??v},t.lang??"en"))}}if(t.validate.ratio&&p.value){const C=t.validate.ratio.Width,$=t.validate.ratio.Height,v=p.value.width,B=p.value.height,k=ir(v,B),P=ir(C,$);let _=k.w===P.w&&k.h===P.h;if(!_){const q=v/B,N=C/$;_=Math.abs(q-N)<=.01}y.value=_,y.value||I.push(z("imageRatio",{w:String(C),h:String($)},t.lang??"en"))}E.value=I,I.length?l("push:error",I,t.id):l("remove:error",t.id)}function H(){o.value="",u.value="",h.value="",m.value="",E.value=[],f.value=t.previewImage||"https://static.vecteezy.com/system/resources/thumbnails/005/720/408/small_2x/crossed-image-icon-picture-not-available-delete-picture-symbol-free-vector.jpg"}return(I,C)=>(i.openBlock(),i.createElementBlock("div",gh,[i.createElementVNode("label",{for:n.id,class:i.normalizeClass(["image-label",{"has-error":E.value.length!==0||n.error}])},[i.createTextVNode(i.toDisplayString(n.label)+" ",1),x.value?(i.openBlock(),i.createBlock(i.unref(Ye),{key:0,text:x.value,as:"strong"},{default:i.withCtx(()=>[...C[0]||(C[0]=[i.createTextVNode(" ❓",-1)])]),_:1},8,["text"])):i.createCommentVNode("",!0)],10,bh),i.createElementVNode("div",vh,[i.createElementVNode("div",yh,[i.createElementVNode("img",{src:f.value,alt:n.previewAlt,class:"image-preview"},null,8,Eh),i.createElementVNode("input",{id:n.id,type:"file",accept:"image/*",onChange:L,class:"file-input",disabled:t.disabled},null,40,wh),i.createElementVNode("div",xh,[i.createElementVNode("label",{for:n.id,class:i.normalizeClass(["btn btn-select",{disabled:t.disabled}])},i.toDisplayString(n.modelValue?i.unref(s)?.btn?.change:i.unref(s)?.btn?.select),11,Th),n.modelValue&&!t.disabled?(i.openBlock(),i.createElementBlock("button",{key:0,type:"button",onClick:O,class:"btn btn-remove"},i.toDisplayString(i.unref(s)?.btn?.remove),1)):i.createCommentVNode("",!0)]),i.createElementVNode("div",Ah,[o.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[C[1]||(C[1]=i.createElementVNode("span",{class:"info-label"},"Name",-1)),i.createElementVNode("span",Nh,i.toDisplayString(o.value.length>20?o.value.slice(0,20)+"...":o.value),1)],64)):i.createCommentVNode("",!0),u.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[C[2]||(C[2]=i.createElementVNode("span",{class:"info-label"},"Pixels",-1)),i.createElementVNode("span",kh,i.toDisplayString(u.value),1)],64)):i.createCommentVNode("",!0),h.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[C[3]||(C[3]=i.createElementVNode("span",{class:"info-label"},"Size",-1)),i.createElementVNode("span",Sh,i.toDisplayString(h.value),1)],64)):i.createCommentVNode("",!0),m.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[C[4]||(C[4]=i.createElementVNode("span",{class:"info-label"},"Ratio",-1)),i.createElementVNode("span",Ch,i.toDisplayString(m.value),1)],64)):i.createCommentVNode("",!0)])])]),i.createElementVNode("div",Lh,[E.value.length!==0?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(E.value,($,v)=>(i.openBlock(),i.createElementBlock("p",{key:v,class:"error-message"},i.toDisplayString($),1))),128)):i.createCommentVNode("",!0),typeof t.error=="string"&&E.value.length===0?(i.openBlock(),i.createElementBlock("p",Bh,i.toDisplayString(t.error),1)):i.createCommentVNode("",!0),Array.isArray(t.error)&&E.value.length===0?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:2},i.renderList(t.error,($,v)=>(i.openBlock(),i.createElementBlock("p",{key:"ext-"+v,class:"error-message"},i.toDisplayString($),1))),128)):i.createCommentVNode("",!0)])]))}}),Ql=we(Ih,[["__scopeId","data-v-2fa80636"]]),Oh={class:"number-input-wrapper"},Dh=["for"],Mh=["id","value","disabled","placeholder"],Rh={key:1,class:"error-message"},qh=i.defineComponent({__name:"NumberInput",props:{id:{default:ke()},label:{},placeholder:{},modelValue:{},error:{},disabled:{type:Boolean},validate:{},lang:{}},emits:["update:modelValue","push:error","remove:error"],setup(n,{emit:e}){const t=n,r=String(t.modelValue??""),a=i.inject("TableComponents",{labels:i.ref(Ne[t.lang??"en"])}).labels,l=e,o=i.computed(()=>{if(t.validate){const p=t.validate,d=[];return Array.isArray(p.duplicate)&&p.duplicate.length>0&&d.push(z("valueList",{value:p.duplicate.join(", ")},t.lang??"en")),p.integer&&d.push(z("numberInteger")),p.min!==void 0&&d.push(z("numberMin",{min:String(p.min)},t.lang??"en")),p.max!==void 0&&d.push(z("numberMax",{max:String(p.max)},t.lang??"en")),d.join(`
|
|
10
|
-
`)}return""}),u=i.ref([]);i.watch(()=>({val:t.modelValue,disabled:t.disabled,validate:t.validate}),({val:p,disabled:d,validate:f})=>{if(d){u.value=[],l("remove:error",t.id);return}const b=[],y=String(p??"");if(Array.isArray(f?.duplicate)){const E=f.duplicate.map(String).includes(y),x=String(r)===y;E&&!x&&b.push(z("valueList",{value:y},t.lang??"en"))}if(f&&y!==""){const E=Number(y);isNaN(E)?b.push(z("numberInvalid",void 0,t.lang??"en")):(f.integer&&!Number.isInteger(E)&&b.push(z("numberInteger",void 0,t.lang??"en")),f.min!==void 0&&E<f.min&&b.push(z("numberMin",{min:String(f.min)},t.lang??"en")),f.max!==void 0&&E>f.max&&b.push(z("numberMax",{max:String(f.max)},t.lang??"en")))}u.value=b,b.length?l("push:error",b,t.id):t.id&&l("remove:error",t.id)},{deep:!0});const h=i.computed(()=>t.placeholder??a?.value?.placeholder.number??"");function m(p){if(t.disabled)return;const d=p.target;l("update:modelValue",d.value,t.id)}return(p,d)=>(i.openBlock(),i.createElementBlock("div",Oh,[i.createElementVNode("label",{for:n.id,class:i.normalizeClass(["number-label",{"has-error":u.value.length!==0||n.error}])},[i.createTextVNode(i.toDisplayString(n.label)+" ",1),o.value?(i.openBlock(),i.createBlock(i.unref(Ye),{key:0,text:o.value,as:"strong"},{default:i.withCtx(()=>[...d[0]||(d[0]=[i.createTextVNode(" ❓",-1)])]),_:1},8,["text"])):i.createCommentVNode("",!0)],10,Dh),i.createElementVNode("input",{id:n.id,type:"number",value:n.modelValue,disabled:n.disabled,onInput:m,placeholder:h.value,class:i.normalizeClass(["number-input",{"has-error":u.value.length!==0||n.error}])},null,42,Mh),u.value.length!==0?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(u.value,(f,b)=>(i.openBlock(),i.createElementBlock("p",{key:b,class:"error-message"},i.toDisplayString(f),1))),128)):i.createCommentVNode("",!0),typeof t.error=="string"&&u.value.length===0?(i.openBlock(),i.createElementBlock("p",Rh,i.toDisplayString(n.error),1)):i.createCommentVNode("",!0)]))}}),eo=we(qh,[["__scopeId","data-v-a15e96f3"]]),Vh={class:"object-wrapper"},$h={class:"object-label"},_h={class:"object-container"},jh=i.defineComponent({__name:"ObjectInput",props:{id:{default:ke()},label:{},disabled:{type:Boolean},schema:{},formData:{},required:{type:Boolean},errors:{},lang:{}},emits:["update:model-value","selected-option-change","multi-selected-change","push:errors","remove:errors"],setup(n){const e=n,t=i.ref({...e.formData}),r=i.ref({...e.errors});return i.watch(()=>e,()=>{t.value={...e.formData},r.value={...e.errors}},{immediate:!0,deep:!0}),(s,a)=>(i.openBlock(),i.createElementBlock("div",Vh,[i.createElementVNode("label",$h,i.toDisplayString(e.label),1),i.createElementVNode("div",_h,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.schema,(l,o)=>(i.openBlock(),i.createBlock(i.unref(Rr),{key:o,field:l,"field-key":o,"form-data":e.formData,errors:e.errors,lang:n.lang??"en","onUpdate:modelValue":a[0]||(a[0]=(u,h)=>s.$emit("update:model-value",u,e.id+"."+h)),"onRemove:errors":a[1]||(a[1]=u=>s.$emit("remove:errors",e.id+"."+u)),"onPush:errors":a[2]||(a[2]=(u,h)=>s.$emit("push:errors",u,e.id+"."+h)),onMultiSelectedChange:a[3]||(a[3]=(u,h)=>s.$emit("multi-selected-change",u,e.id+"."+h)),onSelectedOptionChange:a[4]||(a[4]=(u,h)=>s.$emit("selected-option-change",u,e.id+"."+h))},null,8,["field","field-key","form-data","errors","lang"]))),128))])]))}}),to=we(jh,[["__scopeId","data-v-4070ea53"]]),Ph={class:"password-input-wrapper"},Fh=["for"],Uh={class:"password-input-container"},zh=["id","type","disabled","placeholder"],Hh={key:1,class:"error-message"},Kh=i.defineComponent({__name:"PasswordInput",props:{id:{default:ke()},label:{},placeholder:{},modelValue:{},error:{},disabled:{type:Boolean},validate:{},lang:{}},emits:["update:modelValue","push:error","remove:error"],setup(n,{emit:e}){const t=n,s=i.inject("TableComponents",{labels:i.ref(Ne[t.lang??"en"])}).labels,a=e;function l(d){if(!t.validate)return[];const f=[],{minLength:b,maxLength:y,requireUppercase:E,requireLowercase:x,requireNumber:S,requireSpecialChar:A}=t.validate;return b&&d.length<b&&f.push(z("passwordMin",{min:String(b)},t.lang??"en")),y&&d.length>y&&f.push(z("passwordMax",{max:String(y)},t.lang??"en")),E&&!/[A-Z]/.test(d)&&f.push(z("passwordUpper",void 0,t.lang??"en")),x&&!/[a-z]/.test(d)&&f.push(z("passwordLower",void 0,t.lang??"en")),S&&!/\d/.test(d)&&f.push(z("passwordNumber",void 0,t.lang??"en")),A&&!/[^A-Za-z0-9]/.test(d)&&f.push(z("passwordSymbol",void 0,t.lang??"en")),f}const o=i.computed(()=>{if(t.validate){const d=t.validate,f=[];return d.minLength&&f.push(z("passwordMin",{min:String(d.minLength)},t.lang??"en")),d.maxLength&&f.push(z("passwordMax",{max:String(d.maxLength)},t.lang??"en")),d.requireUppercase&&f.push(z("passwordUpper",void 0,t.lang??"en")),d.requireLowercase&&f.push(z("passwordLower",void 0,t.lang??"en")),d.requireNumber&&f.push(z("passwordNumber",void 0,t.lang??"en")),d.requireSpecialChar&&f.push(z("passwordSymbol",void 0,t.lang??"en")),f.join(`
|
|
11
|
-
`)}return""}),u=i.ref(!1),h=i.ref([]);i.watch(()=>({val:t.modelValue,disabled:t.disabled}),({val:d,disabled:f})=>{if(f){h.value=[];return}const b=l(String(d??""));h.value=b,b.length!==0?a("push:error",b,t.id):t.id&&a("remove:error",t.id)});const m=i.computed(()=>t.placeholder??s?.value?.placeholder?.password??"");function p(d){if(t.disabled)return;const f=d.target;a("update:modelValue",f.value,t.id)}return(d,f)=>(i.openBlock(),i.createElementBlock("div",Ph,[i.createElementVNode("label",{for:n.id,class:i.normalizeClass(["password-label",{"has-error":h.value.length!==0||n.error}])},[i.createTextVNode(i.toDisplayString(n.label)+" ",1),o.value?(i.openBlock(),i.createBlock(i.unref(Ye),{key:0,text:o.value,as:"strong"},{default:i.withCtx(()=>[...f[0]||(f[0]=[i.createTextVNode(" ❓",-1)])]),_:1},8,["text"])):i.createCommentVNode("",!0)],10,Fh),i.createElementVNode("div",Uh,[i.createElementVNode("input",{id:n.id,type:u.value?"text":"password",class:i.normalizeClass(["password-input",{"has-error":h.value.length!==0||n.error}]),disabled:n.disabled,placeholder:m.value,onInput:p},null,42,zh)]),h.value.length!==0?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(h.value,(b,y)=>(i.openBlock(),i.createElementBlock("p",{key:y,class:"error-message"},i.toDisplayString(b),1))),128)):i.createCommentVNode("",!0),typeof t.error=="string"&&h.value.length===0?(i.openBlock(),i.createElementBlock("p",Hh,i.toDisplayString(n.error),1)):i.createCommentVNode("",!0)]))}}),no=we(Kh,[["__scopeId","data-v-2153889f"]]),Gh={class:"tag-input-wrapper"},Wh=["for"],Zh=["onClick"],Yh=["onKeydown","placeholder"],Xh={key:1,class:"error-message"},Jh=i.defineComponent({__name:"TagInput",props:{id:{default:ke()},label:{},placeholder:{},modelValue:{default:()=>[]},error:{},disabled:{type:Boolean},lang:{},validate:{}},emits:["update:modelValue","push:error","remove:error"],setup(n,{emit:e}){const t=n,r=e,a=i.inject("TableComponents",{labels:i.ref(Ne[t.lang??"en"])}).labels,l=i.ref(),o=i.computed(()=>{if(t.validate){const d=t.validate,f=[];return d.min!==void 0&&f.push(z("arrayTagMin",{min:String(d.min)},t.lang??"en")),d.max!==void 0&&f.push(z("arrayTagMax",{max:String(d.max)},t.lang??"en")),f.join(`
|
|
12
|
-
`)}return""}),u=i.ref([]);i.watch(()=>({val:t.modelValue,disabled:t.disabled,validate:t.validate}),({val:d,disabled:f,validate:b})=>{if(f){u.value=[],r("remove:error",t.id);return}const y=[],E=d??[];b&&(b.min!==void 0&&E.length<b.min&&y.push(z("arrayTagMin",{min:String(b.min)},t.lang??"en")),b.max!==void 0&&E.length>b.max&&y.push(z("arrayTagMax",{max:String(b.max)},t.lang??"en"))),u.value=y,y.length?r("push:error",y,t.id):t.id&&r("remove:error",t.id)},{deep:!0});const h=i.computed(()=>u.value.length>0?u.value[0]+"...":t.placeholder??a?.value?.placeholder?.tag??"");function m(){if(t.disabled)return;const d=l.value?.value?.trim();d&&(r("update:modelValue",[...t.modelValue,d],t.id),l.value&&(l.value.value=""))}function p(d){t.disabled||r("update:modelValue",t.modelValue.filter((f,b)=>b!==d),t.id)}return(d,f)=>(i.openBlock(),i.createElementBlock("div",Gh,[i.createElementVNode("label",{for:n.id,class:i.normalizeClass(["tag-label",{"has-error":u.value.length!==0||n.error}])},[i.createTextVNode(i.toDisplayString(n.label)+" ",1),o.value?(i.openBlock(),i.createBlock(i.unref(Ye),{key:0,text:o.value,as:"strong"},{default:i.withCtx(()=>[...f[0]||(f[0]=[i.createTextVNode(" ❓",-1)])]),_:1},8,["text"])):i.createCommentVNode("",!0)],10,Wh),i.createElementVNode("div",{class:i.normalizeClass(["tags-container",{disabled:n.disabled}])},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.modelValue,(b,y)=>(i.openBlock(),i.createElementBlock("span",{key:y,class:"tag-item"},[i.createTextVNode(i.toDisplayString(b)+" ",1),n.disabled?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("button",{key:0,type:"button",onClick:E=>p(y),class:"remove-tag-button"}," × ",8,Zh))]))),128)),n.disabled?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("input",{key:0,ref_key:"tagInput",ref:l,type:"text",class:"tag-input-field",onKeydown:i.withKeys(i.withModifiers(m,["prevent"]),["enter"]),placeholder:h.value},null,40,Yh))],2),u.value.length!==0?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(u.value,(b,y)=>(i.openBlock(),i.createElementBlock("p",{key:y,class:"error-message"},i.toDisplayString(b),1))),128)):typeof t.error=="string"?(i.openBlock(),i.createElementBlock("p",Xh,i.toDisplayString(n.error),1)):i.createCommentVNode("",!0)]))}}),ro=we(Jh,[["__scopeId","data-v-8aab0ba4"]]),Qh={class:"textarea-wrapper"},ef=["for"],tf=["id","value","placeholder","disabled"],nf={key:1,class:"error-message"},rf=i.defineComponent({__name:"TextAreaInput",props:{id:{default:ke()},label:{},placeholder:{},modelValue:{},error:{},disabled:{type:Boolean},lang:{},validate:{}},emits:["update:modelValue","push:error","remove:error"],setup(n,{emit:e}){const t=n,r=e,a=i.inject("TableComponents",{labels:i.ref(Ne[t.lang??"en"])}).labels,l=i.computed(()=>{if(t.validate){const m=t.validate,p=[];return m.minLength&&p.push(z("textMinLength",{min:String(m.minLength)},t.lang??"en")),m.maxLength&&p.push(z("textMaxLength",{max:String(m.maxLength)},t.lang??"en")),p.join(`
|
|
13
|
-
`)}return""}),o=i.ref([]);i.watch(()=>({val:t.modelValue,disabled:t.disabled,validate:t.validate}),({val:m,disabled:p,validate:d})=>{if(p){o.value=[],r("remove:error",t.id);return}const f=[],b=String(m??"").trim();if(d){const{minLength:y,maxLength:E}=d;y!==void 0&&b.length<y&&f.push(z("textMinLength",{min:String(y)},t.lang??"en")),E!==void 0&&b.length>E&&f.push(z("textMaxLength",{max:String(E)},t.lang??"en"))}o.value=f,f.length?r("push:error",f,t.id):r("remove:error",t.id)},{deep:!0});const u=i.computed(()=>t.placeholder??a.value.placeholder?.string??"");function h(m){if(t.disabled)return;const p=m.target;r("update:modelValue",p.value,t.id)}return(m,p)=>(i.openBlock(),i.createElementBlock("div",Qh,[i.createElementVNode("label",{for:n.id,class:i.normalizeClass(["textarea-label",{"has-error":o.value.length!==0||n.error}])},[i.createTextVNode(i.toDisplayString(n.label)+" ",1),l.value?(i.openBlock(),i.createBlock(i.unref(Ye),{key:0,text:l.value,as:"strong"},{default:i.withCtx(()=>[...p[0]||(p[0]=[i.createTextVNode(" ❓",-1)])]),_:1},8,["text"])):i.createCommentVNode("",!0)],10,ef),i.createElementVNode("textarea",{id:n.id,value:n.modelValue,placeholder:u.value,disabled:n.disabled,rows:"4",class:i.normalizeClass(["textarea-input",{"has-error":o.value.length!==0||n.error}]),onInput:h},null,42,tf),o.value.length!==0?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(o.value,(d,f)=>(i.openBlock(),i.createElementBlock("p",{key:f,class:"error-message"},i.toDisplayString(d),1))),128)):i.createCommentVNode("",!0),typeof t.error=="string"&&o.value.length===0?(i.openBlock(),i.createElementBlock("p",nf,i.toDisplayString(n.error),1)):i.createCommentVNode("",!0)]))}}),io=we(rf,[["__scopeId","data-v-2d1c7fdb"]]);var so=typeof global=="object"&&global&&global.Object===Object&&global,sf=typeof self=="object"&&self&&self.Object===Object&&self,qt=so||sf||Function("return this")(),vn=qt.Symbol,ao=Object.prototype,af=ao.hasOwnProperty,lf=ao.toString,wr=vn?vn.toStringTag:void 0;function of(n){var e=af.call(n,wr),t=n[wr];try{n[wr]=void 0;var r=!0}catch{}var s=lf.call(n);return r&&(e?n[wr]=t:delete n[wr]),s}var cf=Object.prototype,uf=cf.toString;function df(n){return uf.call(n)}var hf="[object Null]",ff="[object Undefined]",Ta=vn?vn.toStringTag:void 0;function lr(n){return n==null?n===void 0?ff:hf:Ta&&Ta in Object(n)?of(n):df(n)}function Zt(n){return n!=null&&typeof n=="object"}var Bn=Array.isArray;function yn(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}function lo(n){return n}var mf="[object AsyncFunction]",pf="[object Function]",gf="[object GeneratorFunction]",bf="[object Proxy]";function Hs(n){if(!yn(n))return!1;var e=lr(n);return e==pf||e==gf||e==mf||e==bf}var es=qt["__core-js_shared__"],Aa=(function(){var n=/[^.]+$/.exec(es&&es.keys&&es.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function vf(n){return!!Aa&&Aa in n}var yf=Function.prototype,Ef=yf.toString;function Mn(n){if(n!=null){try{return Ef.call(n)}catch{}try{return n+""}catch{}}return""}var wf=/[\\^$.*+?()[\]{}|]/g,xf=/^\[object .+?Constructor\]$/,Tf=Function.prototype,Af=Object.prototype,Nf=Tf.toString,kf=Af.hasOwnProperty,Sf=RegExp("^"+Nf.call(kf).replace(wf,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Cf(n){if(!yn(n)||vf(n))return!1;var e=Hs(n)?Sf:xf;return e.test(Mn(n))}function Lf(n,e){return n?.[e]}function Rn(n,e){var t=Lf(n,e);return Cf(t)?t:void 0}var ws=Rn(qt,"WeakMap"),Na=Object.create,Bf=(function(){function n(){}return function(e){if(!yn(e))return{};if(Na)return Na(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}})();function If(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function Of(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}var Df=800,Mf=16,Rf=Date.now;function qf(n){var e=0,t=0;return function(){var r=Rf(),s=Mf-(r-t);if(t=r,s>0){if(++e>=Df)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function Vf(n){return function(){return n}}var mi=(function(){try{var n=Rn(Object,"defineProperty");return n({},"",{}),n}catch{}})(),$f=mi?function(n,e){return mi(n,"toString",{configurable:!0,enumerable:!1,value:Vf(e),writable:!0})}:lo,_f=qf($f);function jf(n,e){for(var t=-1,r=n==null?0:n.length;++t<r&&e(n[t],t,n)!==!1;);return n}var Pf=9007199254740991,Ff=/^(?:0|[1-9]\d*)$/;function oo(n,e){var t=typeof n;return e=e??Pf,!!e&&(t=="number"||t!="symbol"&&Ff.test(n))&&n>-1&&n%1==0&&n<e}function Ks(n,e,t){e=="__proto__"&&mi?mi(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function qr(n,e){return n===e||n!==n&&e!==e}var Uf=Object.prototype,zf=Uf.hasOwnProperty;function co(n,e,t){var r=n[e];(!(zf.call(n,e)&&qr(r,t))||t===void 0&&!(e in n))&&Ks(n,e,t)}function Hf(n,e,t,r){var s=!t;t||(t={});for(var a=-1,l=e.length;++a<l;){var o=e[a],u=void 0;u===void 0&&(u=n[o]),s?Ks(t,o,u):co(t,o,u)}return t}var ka=Math.max;function Kf(n,e,t){return e=ka(e===void 0?n.length-1:e,0),function(){for(var r=arguments,s=-1,a=ka(r.length-e,0),l=Array(a);++s<a;)l[s]=r[e+s];s=-1;for(var o=Array(e+1);++s<e;)o[s]=r[s];return o[e]=t(l),If(n,this,o)}}function Gf(n,e){return _f(Kf(n,e,lo),n+"")}var Wf=9007199254740991;function uo(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=Wf}function wi(n){return n!=null&&uo(n.length)&&!Hs(n)}function Zf(n,e,t){if(!yn(t))return!1;var r=typeof e;return(r=="number"?wi(t)&&oo(e,t.length):r=="string"&&e in t)?qr(t[e],n):!1}function Yf(n){return Gf(function(e,t){var r=-1,s=t.length,a=s>1?t[s-1]:void 0,l=s>2?t[2]:void 0;for(a=n.length>3&&typeof a=="function"?(s--,a):void 0,l&&Zf(t[0],t[1],l)&&(a=s<3?void 0:a,s=1),e=Object(e);++r<s;){var o=t[r];o&&n(e,o,r,a)}return e})}var Xf=Object.prototype;function Gs(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||Xf;return n===t}function Jf(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}var Qf="[object Arguments]";function Sa(n){return Zt(n)&&lr(n)==Qf}var ho=Object.prototype,em=ho.hasOwnProperty,tm=ho.propertyIsEnumerable,xs=Sa((function(){return arguments})())?Sa:function(n){return Zt(n)&&em.call(n,"callee")&&!tm.call(n,"callee")};function nm(){return!1}var fo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ca=fo&&typeof module=="object"&&module&&!module.nodeType&&module,rm=Ca&&Ca.exports===fo,La=rm?qt.Buffer:void 0,im=La?La.isBuffer:void 0,Lr=im||nm,sm="[object Arguments]",am="[object Array]",lm="[object Boolean]",om="[object Date]",cm="[object Error]",um="[object Function]",dm="[object Map]",hm="[object Number]",fm="[object Object]",mm="[object RegExp]",pm="[object Set]",gm="[object String]",bm="[object WeakMap]",vm="[object ArrayBuffer]",ym="[object DataView]",Em="[object Float32Array]",wm="[object Float64Array]",xm="[object Int8Array]",Tm="[object Int16Array]",Am="[object Int32Array]",Nm="[object Uint8Array]",km="[object Uint8ClampedArray]",Sm="[object Uint16Array]",Cm="[object Uint32Array]",Ee={};Ee[Em]=Ee[wm]=Ee[xm]=Ee[Tm]=Ee[Am]=Ee[Nm]=Ee[km]=Ee[Sm]=Ee[Cm]=!0;Ee[sm]=Ee[am]=Ee[vm]=Ee[lm]=Ee[ym]=Ee[om]=Ee[cm]=Ee[um]=Ee[dm]=Ee[hm]=Ee[fm]=Ee[mm]=Ee[pm]=Ee[gm]=Ee[bm]=!1;function Lm(n){return Zt(n)&&uo(n.length)&&!!Ee[lr(n)]}function Ws(n){return function(e){return n(e)}}var mo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,kr=mo&&typeof module=="object"&&module&&!module.nodeType&&module,Bm=kr&&kr.exports===mo,ts=Bm&&so.process,sr=(function(){try{var n=kr&&kr.require&&kr.require("util").types;return n||ts&&ts.binding&&ts.binding("util")}catch{}})(),Ba=sr&&sr.isTypedArray,Zs=Ba?Ws(Ba):Lm,Im=Object.prototype,Om=Im.hasOwnProperty;function po(n,e){var t=Bn(n),r=!t&&xs(n),s=!t&&!r&&Lr(n),a=!t&&!r&&!s&&Zs(n),l=t||r||s||a,o=l?Jf(n.length,String):[],u=o.length;for(var h in n)(e||Om.call(n,h))&&!(l&&(h=="length"||s&&(h=="offset"||h=="parent")||a&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||oo(h,u)))&&o.push(h);return o}function go(n,e){return function(t){return n(e(t))}}var Dm=go(Object.keys,Object),Mm=Object.prototype,Rm=Mm.hasOwnProperty;function qm(n){if(!Gs(n))return Dm(n);var e=[];for(var t in Object(n))Rm.call(n,t)&&t!="constructor"&&e.push(t);return e}function Vm(n){return wi(n)?po(n):qm(n)}function $m(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var _m=Object.prototype,jm=_m.hasOwnProperty;function Pm(n){if(!yn(n))return $m(n);var e=Gs(n),t=[];for(var r in n)r=="constructor"&&(e||!jm.call(n,r))||t.push(r);return t}function bo(n){return wi(n)?po(n,!0):Pm(n)}var Br=Rn(Object,"create");function Fm(){this.__data__=Br?Br(null):{},this.size=0}function Um(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var zm="__lodash_hash_undefined__",Hm=Object.prototype,Km=Hm.hasOwnProperty;function Gm(n){var e=this.__data__;if(Br){var t=e[n];return t===zm?void 0:t}return Km.call(e,n)?e[n]:void 0}var Wm=Object.prototype,Zm=Wm.hasOwnProperty;function Ym(n){var e=this.__data__;return Br?e[n]!==void 0:Zm.call(e,n)}var Xm="__lodash_hash_undefined__";function Jm(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=Br&&e===void 0?Xm:e,this}function In(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}In.prototype.clear=Fm;In.prototype.delete=Um;In.prototype.get=Gm;In.prototype.has=Ym;In.prototype.set=Jm;function Qm(){this.__data__=[],this.size=0}function xi(n,e){for(var t=n.length;t--;)if(qr(n[t][0],e))return t;return-1}var ep=Array.prototype,tp=ep.splice;function np(n){var e=this.__data__,t=xi(e,n);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():tp.call(e,t,1),--this.size,!0}function rp(n){var e=this.__data__,t=xi(e,n);return t<0?void 0:e[t][1]}function ip(n){return xi(this.__data__,n)>-1}function sp(n,e){var t=this.__data__,r=xi(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}function Xt(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Xt.prototype.clear=Qm;Xt.prototype.delete=np;Xt.prototype.get=rp;Xt.prototype.has=ip;Xt.prototype.set=sp;var Ir=Rn(qt,"Map");function ap(){this.size=0,this.__data__={hash:new In,map:new(Ir||Xt),string:new In}}function lp(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function Ti(n,e){var t=n.__data__;return lp(e)?t[typeof e=="string"?"string":"hash"]:t.map}function op(n){var e=Ti(this,n).delete(n);return this.size-=e?1:0,e}function cp(n){return Ti(this,n).get(n)}function up(n){return Ti(this,n).has(n)}function dp(n,e){var t=Ti(this,n),r=t.size;return t.set(n,e),this.size+=t.size==r?0:1,this}function qn(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}qn.prototype.clear=ap;qn.prototype.delete=op;qn.prototype.get=cp;qn.prototype.has=up;qn.prototype.set=dp;function hp(n,e){for(var t=-1,r=e.length,s=n.length;++t<r;)n[s+t]=e[t];return n}var vo=go(Object.getPrototypeOf,Object),fp="[object Object]",mp=Function.prototype,pp=Object.prototype,yo=mp.toString,gp=pp.hasOwnProperty,bp=yo.call(Object);function vp(n){if(!Zt(n)||lr(n)!=fp)return!1;var e=vo(n);if(e===null)return!0;var t=gp.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&yo.call(t)==bp}function yp(){this.__data__=new Xt,this.size=0}function Ep(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function wp(n){return this.__data__.get(n)}function xp(n){return this.__data__.has(n)}var Tp=200;function Ap(n,e){var t=this.__data__;if(t instanceof Xt){var r=t.__data__;if(!Ir||r.length<Tp-1)return r.push([n,e]),this.size=++t.size,this;t=this.__data__=new qn(r)}return t.set(n,e),this.size=t.size,this}function Mt(n){var e=this.__data__=new Xt(n);this.size=e.size}Mt.prototype.clear=yp;Mt.prototype.delete=Ep;Mt.prototype.get=wp;Mt.prototype.has=xp;Mt.prototype.set=Ap;var Eo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ia=Eo&&typeof module=="object"&&module&&!module.nodeType&&module,Np=Ia&&Ia.exports===Eo,Oa=Np?qt.Buffer:void 0,Da=Oa?Oa.allocUnsafe:void 0;function wo(n,e){if(e)return n.slice();var t=n.length,r=Da?Da(t):new n.constructor(t);return n.copy(r),r}function kp(n,e){for(var t=-1,r=n==null?0:n.length,s=0,a=[];++t<r;){var l=n[t];e(l,t,n)&&(a[s++]=l)}return a}function Sp(){return[]}var Cp=Object.prototype,Lp=Cp.propertyIsEnumerable,Ma=Object.getOwnPropertySymbols,Bp=Ma?function(n){return n==null?[]:(n=Object(n),kp(Ma(n),function(e){return Lp.call(n,e)}))}:Sp;function Ip(n,e,t){var r=e(n);return Bn(n)?r:hp(r,t(n))}function Ts(n){return Ip(n,Vm,Bp)}var As=Rn(qt,"DataView"),Ns=Rn(qt,"Promise"),ks=Rn(qt,"Set"),Ra="[object Map]",Op="[object Object]",qa="[object Promise]",Va="[object Set]",$a="[object WeakMap]",_a="[object DataView]",Dp=Mn(As),Mp=Mn(Ir),Rp=Mn(Ns),qp=Mn(ks),Vp=Mn(ws),xt=lr;(As&&xt(new As(new ArrayBuffer(1)))!=_a||Ir&&xt(new Ir)!=Ra||Ns&&xt(Ns.resolve())!=qa||ks&&xt(new ks)!=Va||ws&&xt(new ws)!=$a)&&(xt=function(n){var e=lr(n),t=e==Op?n.constructor:void 0,r=t?Mn(t):"";if(r)switch(r){case Dp:return _a;case Mp:return Ra;case Rp:return qa;case qp:return Va;case Vp:return $a}return e});var $p=Object.prototype,_p=$p.hasOwnProperty;function jp(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&_p.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var pi=qt.Uint8Array;function Ys(n){var e=new n.constructor(n.byteLength);return new pi(e).set(new pi(n)),e}function Pp(n,e){var t=Ys(n.buffer);return new n.constructor(t,n.byteOffset,n.byteLength)}var Fp=/\w*$/;function Up(n){var e=new n.constructor(n.source,Fp.exec(n));return e.lastIndex=n.lastIndex,e}var ja=vn?vn.prototype:void 0,Pa=ja?ja.valueOf:void 0;function zp(n){return Pa?Object(Pa.call(n)):{}}function xo(n,e){var t=e?Ys(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var Hp="[object Boolean]",Kp="[object Date]",Gp="[object Map]",Wp="[object Number]",Zp="[object RegExp]",Yp="[object Set]",Xp="[object String]",Jp="[object Symbol]",Qp="[object ArrayBuffer]",eg="[object DataView]",tg="[object Float32Array]",ng="[object Float64Array]",rg="[object Int8Array]",ig="[object Int16Array]",sg="[object Int32Array]",ag="[object Uint8Array]",lg="[object Uint8ClampedArray]",og="[object Uint16Array]",cg="[object Uint32Array]";function ug(n,e,t){var r=n.constructor;switch(e){case Qp:return Ys(n);case Hp:case Kp:return new r(+n);case eg:return Pp(n);case tg:case ng:case rg:case ig:case sg:case ag:case lg:case og:case cg:return xo(n,t);case Gp:return new r;case Wp:case Xp:return new r(n);case Zp:return Up(n);case Yp:return new r;case Jp:return zp(n)}}function To(n){return typeof n.constructor=="function"&&!Gs(n)?Bf(vo(n)):{}}var dg="[object Map]";function hg(n){return Zt(n)&&xt(n)==dg}var Fa=sr&&sr.isMap,fg=Fa?Ws(Fa):hg,mg="[object Set]";function pg(n){return Zt(n)&&xt(n)==mg}var Ua=sr&&sr.isSet,gg=Ua?Ws(Ua):pg,bg=1,Ao="[object Arguments]",vg="[object Array]",yg="[object Boolean]",Eg="[object Date]",wg="[object Error]",No="[object Function]",xg="[object GeneratorFunction]",Tg="[object Map]",Ag="[object Number]",ko="[object Object]",Ng="[object RegExp]",kg="[object Set]",Sg="[object String]",Cg="[object Symbol]",Lg="[object WeakMap]",Bg="[object ArrayBuffer]",Ig="[object DataView]",Og="[object Float32Array]",Dg="[object Float64Array]",Mg="[object Int8Array]",Rg="[object Int16Array]",qg="[object Int32Array]",Vg="[object Uint8Array]",$g="[object Uint8ClampedArray]",_g="[object Uint16Array]",jg="[object Uint32Array]",ye={};ye[Ao]=ye[vg]=ye[Bg]=ye[Ig]=ye[yg]=ye[Eg]=ye[Og]=ye[Dg]=ye[Mg]=ye[Rg]=ye[qg]=ye[Tg]=ye[Ag]=ye[ko]=ye[Ng]=ye[kg]=ye[Sg]=ye[Cg]=ye[Vg]=ye[$g]=ye[_g]=ye[jg]=!0;ye[wg]=ye[No]=ye[Lg]=!1;function ui(n,e,t,r,s,a){var l,o=e&bg;if(l!==void 0)return l;if(!yn(n))return n;var u=Bn(n);if(u)l=jp(n);else{var h=xt(n),m=h==No||h==xg;if(Lr(n))return wo(n,o);if(h==ko||h==Ao||m&&!s)l=m?{}:To(n);else{if(!ye[h])return s?n:{};l=ug(n,h,o)}}a||(a=new Mt);var p=a.get(n);if(p)return p;a.set(n,l),gg(n)?n.forEach(function(b){l.add(ui(b,e,t,b,n,a))}):fg(n)&&n.forEach(function(b,y){l.set(y,ui(b,e,t,y,n,a))});var d=Ts,f=u?void 0:d(n);return jf(f||n,function(b,y){f&&(y=b,b=n[y]),co(l,y,ui(b,e,t,y,n,a))}),l}var Pg=1,Fg=4;function tr(n){return ui(n,Pg|Fg)}var Ug="__lodash_hash_undefined__";function zg(n){return this.__data__.set(n,Ug),this}function Hg(n){return this.__data__.has(n)}function gi(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new qn;++e<t;)this.add(n[e])}gi.prototype.add=gi.prototype.push=zg;gi.prototype.has=Hg;function Kg(n,e){for(var t=-1,r=n==null?0:n.length;++t<r;)if(e(n[t],t,n))return!0;return!1}function Gg(n,e){return n.has(e)}var Wg=1,Zg=2;function So(n,e,t,r,s,a){var l=t&Wg,o=n.length,u=e.length;if(o!=u&&!(l&&u>o))return!1;var h=a.get(n),m=a.get(e);if(h&&m)return h==e&&m==n;var p=-1,d=!0,f=t&Zg?new gi:void 0;for(a.set(n,e),a.set(e,n);++p<o;){var b=n[p],y=e[p];if(r)var E=l?r(y,b,p,e,n,a):r(b,y,p,n,e,a);if(E!==void 0){if(E)continue;d=!1;break}if(f){if(!Kg(e,function(x,S){if(!Gg(f,S)&&(b===x||s(b,x,t,r,a)))return f.push(S)})){d=!1;break}}else if(!(b===y||s(b,y,t,r,a))){d=!1;break}}return a.delete(n),a.delete(e),d}function Yg(n){var e=-1,t=Array(n.size);return n.forEach(function(r,s){t[++e]=[s,r]}),t}function Xg(n){var e=-1,t=Array(n.size);return n.forEach(function(r){t[++e]=r}),t}var Jg=1,Qg=2,eb="[object Boolean]",tb="[object Date]",nb="[object Error]",rb="[object Map]",ib="[object Number]",sb="[object RegExp]",ab="[object Set]",lb="[object String]",ob="[object Symbol]",cb="[object ArrayBuffer]",ub="[object DataView]",za=vn?vn.prototype:void 0,ns=za?za.valueOf:void 0;function db(n,e,t,r,s,a,l){switch(t){case ub:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case cb:return!(n.byteLength!=e.byteLength||!a(new pi(n),new pi(e)));case eb:case tb:case ib:return qr(+n,+e);case nb:return n.name==e.name&&n.message==e.message;case sb:case lb:return n==e+"";case rb:var o=Yg;case ab:var u=r&Jg;if(o||(o=Xg),n.size!=e.size&&!u)return!1;var h=l.get(n);if(h)return h==e;r|=Qg,l.set(n,e);var m=So(o(n),o(e),r,s,a,l);return l.delete(n),m;case ob:if(ns)return ns.call(n)==ns.call(e)}return!1}var hb=1,fb=Object.prototype,mb=fb.hasOwnProperty;function pb(n,e,t,r,s,a){var l=t&hb,o=Ts(n),u=o.length,h=Ts(e),m=h.length;if(u!=m&&!l)return!1;for(var p=u;p--;){var d=o[p];if(!(l?d in e:mb.call(e,d)))return!1}var f=a.get(n),b=a.get(e);if(f&&b)return f==e&&b==n;var y=!0;a.set(n,e),a.set(e,n);for(var E=l;++p<u;){d=o[p];var x=n[d],S=e[d];if(r)var A=l?r(S,x,d,e,n,a):r(x,S,d,n,e,a);if(!(A===void 0?x===S||s(x,S,t,r,a):A)){y=!1;break}E||(E=d=="constructor")}if(y&&!E){var L=n.constructor,O=e.constructor;L!=O&&"constructor"in n&&"constructor"in e&&!(typeof L=="function"&&L instanceof L&&typeof O=="function"&&O instanceof O)&&(y=!1)}return a.delete(n),a.delete(e),y}var gb=1,Ha="[object Arguments]",Ka="[object Array]",Qr="[object Object]",bb=Object.prototype,Ga=bb.hasOwnProperty;function vb(n,e,t,r,s,a){var l=Bn(n),o=Bn(e),u=l?Ka:xt(n),h=o?Ka:xt(e);u=u==Ha?Qr:u,h=h==Ha?Qr:h;var m=u==Qr,p=h==Qr,d=u==h;if(d&&Lr(n)){if(!Lr(e))return!1;l=!0,m=!1}if(d&&!m)return a||(a=new Mt),l||Zs(n)?So(n,e,t,r,s,a):db(n,e,u,t,r,s,a);if(!(t&gb)){var f=m&&Ga.call(n,"__wrapped__"),b=p&&Ga.call(e,"__wrapped__");if(f||b){var y=f?n.value():n,E=b?e.value():e;return a||(a=new Mt),s(y,E,t,r,a)}}return d?(a||(a=new Mt),pb(n,e,t,r,s,a)):!1}function Co(n,e,t,r,s){return n===e?!0:n==null||e==null||!Zt(n)&&!Zt(e)?n!==n&&e!==e:vb(n,e,t,r,Co,s)}function yb(n){return function(e,t,r){for(var s=-1,a=Object(e),l=r(e),o=l.length;o--;){var u=l[++s];if(t(a[u],u,a)===!1)break}return e}}var Eb=yb();function Ss(n,e,t){(t!==void 0&&!qr(n[e],t)||t===void 0&&!(e in n))&&Ks(n,e,t)}function wb(n){return Zt(n)&&wi(n)}function Cs(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function xb(n){return Hf(n,bo(n))}function Tb(n,e,t,r,s,a,l){var o=Cs(n,t),u=Cs(e,t),h=l.get(u);if(h){Ss(n,t,h);return}var m=a?a(o,u,t+"",n,e,l):void 0,p=m===void 0;if(p){var d=Bn(u),f=!d&&Lr(u),b=!d&&!f&&Zs(u);m=u,d||f||b?Bn(o)?m=o:wb(o)?m=Of(o):f?(p=!1,m=wo(u,!0)):b?(p=!1,m=xo(u,!0)):m=[]:vp(u)||xs(u)?(m=o,xs(o)?m=xb(o):(!yn(o)||Hs(o))&&(m=To(u))):p=!1}p&&(l.set(u,m),s(m,u,r,a,l),l.delete(u)),Ss(n,t,m)}function Lo(n,e,t,r,s){n!==e&&Eb(e,function(a,l){if(s||(s=new Mt),yn(a))Tb(n,e,l,t,Lo,r,s);else{var o=r?r(Cs(n,l),a,l+"",n,e,s):void 0;o===void 0&&(o=a),Ss(n,l,o)}},bo)}function Xs(n,e){return Co(n,e)}var gn=Yf(function(n,e,t){Lo(n,e,t)}),Q=(n=>(n[n.TYPE=3]="TYPE",n[n.LEVEL=12]="LEVEL",n[n.ATTRIBUTE=13]="ATTRIBUTE",n[n.BLOT=14]="BLOT",n[n.INLINE=7]="INLINE",n[n.BLOCK=11]="BLOCK",n[n.BLOCK_BLOT=10]="BLOCK_BLOT",n[n.INLINE_BLOT=6]="INLINE_BLOT",n[n.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",n[n.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",n[n.ANY=15]="ANY",n))(Q||{});class Rt{constructor(e,t,r={}){this.attrName=e,this.keyName=t;const s=Q.TYPE&Q.ATTRIBUTE;this.scope=r.scope!=null?r.scope&Q.LEVEL|s:Q.ATTRIBUTE,r.whitelist!=null&&(this.whitelist=r.whitelist)}static keys(e){return Array.from(e.attributes).map(t=>t.name)}add(e,t){return this.canAdd(e,t)?(e.setAttribute(this.keyName,t),!0):!1}canAdd(e,t){return this.whitelist==null?!0:typeof t=="string"?this.whitelist.indexOf(t.replace(/["']/g,""))>-1:this.whitelist.indexOf(t)>-1}remove(e){e.removeAttribute(this.keyName)}value(e){const t=e.getAttribute(this.keyName);return this.canAdd(e,t)&&t?t:""}}class nr extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const Bo=class Ls{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(e,t=!1){if(e==null)return null;if(this.blots.has(e))return this.blots.get(e)||null;if(t){let r=null;try{r=e.parentNode}catch{return null}return this.find(r,t)}return null}create(e,t,r){const s=this.query(t);if(s==null)throw new nr(`Unable to create ${t} blot`);const a=s,l=t instanceof Node||t.nodeType===Node.TEXT_NODE?t:a.create(r),o=new a(e,l,r);return Ls.blots.set(o.domNode,o),o}find(e,t=!1){return Ls.find(e,t)}query(e,t=Q.ANY){let r;return typeof e=="string"?r=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?r=this.types.text:typeof e=="number"?e&Q.LEVEL&Q.BLOCK?r=this.types.block:e&Q.LEVEL&Q.INLINE&&(r=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some(s=>(r=this.classes[s],!!r)),r=r||this.tags[e.tagName]),r==null?null:"scope"in r&&t&Q.LEVEL&r.scope&&t&Q.TYPE&r.scope?r:null}register(...e){return e.map(t=>{const r="blotName"in t,s="attrName"in t;if(!r&&!s)throw new nr("Invalid definition");if(r&&t.blotName==="abstract")throw new nr("Cannot register abstract class");const a=r?t.blotName:s?t.attrName:void 0;return this.types[a]=t,s?typeof t.keyName=="string"&&(this.attributes[t.keyName]=t):r&&(t.className&&(this.classes[t.className]=t),t.tagName&&(Array.isArray(t.tagName)?t.tagName=t.tagName.map(l=>l.toUpperCase()):t.tagName=t.tagName.toUpperCase(),(Array.isArray(t.tagName)?t.tagName:[t.tagName]).forEach(l=>{(this.tags[l]==null||t.className==null)&&(this.tags[l]=t)}))),t})}};Bo.blots=new WeakMap;let ar=Bo;function Wa(n,e){return(n.getAttribute("class")||"").split(/\s+/).filter(t=>t.indexOf(`${e}-`)===0)}class Ab extends Rt{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map(t=>t.split("-").slice(0,-1).join("-"))}add(e,t){return this.canAdd(e,t)?(this.remove(e),e.classList.add(`${this.keyName}-${t}`),!0):!1}remove(e){Wa(e,this.keyName).forEach(t=>{e.classList.remove(t)}),e.classList.length===0&&e.removeAttribute("class")}value(e){const t=(Wa(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""}}const St=Ab;function rs(n){const e=n.split("-"),t=e.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("");return e[0]+t}class Nb extends Rt{static keys(e){return(e.getAttribute("style")||"").split(";").map(t=>t.split(":")[0].trim())}add(e,t){return this.canAdd(e,t)?(e.style[rs(this.keyName)]=t,!0):!1}remove(e){e.style[rs(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const t=e.style[rs(this.keyName)];return this.canAdd(e,t)?t:""}}const En=Nb;class kb{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,t){t?e.add(this.domNode,t)&&(e.value(this.domNode)!=null?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=ar.find(this.domNode);if(e==null)return;const t=Rt.keys(this.domNode),r=St.keys(this.domNode),s=En.keys(this.domNode);t.concat(r).concat(s).forEach(a=>{const l=e.scroll.query(a,Q.ATTRIBUTE);l instanceof Rt&&(this.attributes[l.attrName]=l)})}copy(e){Object.keys(this.attributes).forEach(t=>{const r=this.attributes[t].value(this.domNode);e.format(t,r)})}move(e){this.copy(e),Object.keys(this.attributes).forEach(t=>{this.attributes[t].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((e,t)=>(e[t]=this.attributes[t].value(this.domNode),e),{})}}const Ai=kb,Io=class{constructor(e,t){this.scroll=e,this.domNode=t,ar.blots.set(t,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new nr("Blot definition missing tagName");let t,r;return Array.isArray(this.tagName)?(typeof e=="string"?(r=e.toUpperCase(),parseInt(r,10).toString()===r&&(r=parseInt(r,10))):typeof e=="number"&&(r=e),typeof r=="number"?t=document.createElement(this.tagName[r-1]):r&&this.tagName.indexOf(r)>-1?t=document.createElement(r):t=document.createElement(this.tagName[0])):t=document.createElement(this.tagName),this.className&&t.classList.add(this.className),t}get statics(){return this.constructor}attach(){}clone(){const e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){this.parent!=null&&this.parent.removeChild(this),ar.blots.delete(this.domNode)}deleteAt(e,t){this.isolate(e,t).remove()}formatAt(e,t,r,s){const a=this.isolate(e,t);if(this.scroll.query(r,Q.BLOT)!=null&&s)a.wrap(r,s);else if(this.scroll.query(r,Q.ATTRIBUTE)!=null){const l=this.scroll.create(this.statics.scope);a.wrap(l),l.format(r,s)}}insertAt(e,t,r){const s=r==null?this.scroll.create("text",t):this.scroll.create(t,r),a=this.split(e);this.parent.insertBefore(s,a||void 0)}isolate(e,t){const r=this.split(e);if(r==null)throw new Error("Attempt to isolate at end");return r.split(t),r}length(){return 1}offset(e=this.parent){return this.parent==null||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(e,t){const r=typeof e=="string"?this.scroll.create(e,t):e;return this.parent!=null&&(this.parent.insertBefore(r,this.next||void 0),this.remove()),r}split(e,t){return e===0?this:this.next}update(e,t){}wrap(e,t){const r=typeof e=="string"?this.scroll.create(e,t):e;if(this.parent!=null&&this.parent.insertBefore(r,this.next||void 0),typeof r.appendChild!="function")throw new nr(`Cannot wrap ${e}`);return r.appendChild(this),r}};Io.blotName="abstract";let Oo=Io;const Do=class extends Oo{static value(e){return!0}index(e,t){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(t,1):-1}position(e,t){let r=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(r+=1),[this.parent.domNode,r]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};Do.scope=Q.INLINE_BLOT;let Sb=Do;const Fe=Sb;class Cb{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const t=e.slice(1);this.append(...t)}}at(e){const t=this.iterator();let r=t();for(;r&&e>0;)e-=1,r=t();return r}contains(e){const t=this.iterator();let r=t();for(;r;){if(r===e)return!0;r=t()}return!1}indexOf(e){const t=this.iterator();let r=t(),s=0;for(;r;){if(r===e)return s;s+=1,r=t()}return-1}insertBefore(e,t){e!=null&&(this.remove(e),e.next=t,t!=null?(e.prev=t.prev,t.prev!=null&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)):this.tail!=null?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)}offset(e){let t=0,r=this.head;for(;r!=null;){if(r===e)return t;t+=r.length(),r=r.next}return-1}remove(e){this.contains(e)&&(e.prev!=null&&(e.prev.next=e.next),e.next!=null&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)}iterator(e=this.head){return()=>{const t=e;return e!=null&&(e=e.next),t}}find(e,t=!1){const r=this.iterator();let s=r();for(;s;){const a=s.length();if(e<a||t&&e===a&&(s.next==null||s.next.length()!==0))return[s,e];e-=a,s=r()}return[null,0]}forEach(e){const t=this.iterator();let r=t();for(;r;)e(r),r=t()}forEachAt(e,t,r){if(t<=0)return;const[s,a]=this.find(e);let l=e-a;const o=this.iterator(s);let u=o();for(;u&&l<e+t;){const h=u.length();e>l?r(u,e-l,Math.min(t,l+h-e)):r(u,0,Math.min(h,e+t-l)),l+=h,u=o()}}map(e){return this.reduce((t,r)=>(t.push(e(r)),t),[])}reduce(e,t){const r=this.iterator();let s=r();for(;s;)t=e(t,s),s=r();return t}}function Za(n,e){const t=e.find(n);if(t)return t;try{return e.create(n)}catch{const r=e.create(Q.INLINE);return Array.from(n.childNodes).forEach(s=>{r.domNode.appendChild(s)}),n.parentNode&&n.parentNode.replaceChild(r.domNode,n),r.attach(),r}}const Mo=class fn extends Oo{constructor(e,t){super(e,t),this.uiNode=null,this.build()}appendChild(e){this.insertBefore(e)}attach(){super.attach(),this.children.forEach(e=>{e.attach()})}attachUI(e){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=e,fn.uiClass&&this.uiNode.classList.add(fn.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new Cb,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{const t=Za(e,this.scroll);this.insertBefore(t,this.children.head||void 0)}catch(t){if(t instanceof nr)return;throw t}})}deleteAt(e,t){if(e===0&&t===this.length())return this.remove();this.children.forEachAt(e,t,(r,s,a)=>{r.deleteAt(s,a)})}descendant(e,t=0){const[r,s]=this.children.find(t);return e.blotName==null&&e(r)||e.blotName!=null&&r instanceof e?[r,s]:r instanceof fn?r.descendant(e,s):[null,-1]}descendants(e,t=0,r=Number.MAX_VALUE){let s=[],a=r;return this.children.forEachAt(t,r,(l,o,u)=>{(e.blotName==null&&e(l)||e.blotName!=null&&l instanceof e)&&s.push(l),l instanceof fn&&(s=s.concat(l.descendants(e,o,a))),a-=u}),s}detach(){this.children.forEach(e=>{e.detach()}),super.detach()}enforceAllowedChildren(){let e=!1;this.children.forEach(t=>{e||this.statics.allowedChildren.some(r=>t instanceof r)||(t.statics.scope===Q.BLOCK_BLOT?(t.next!=null&&this.splitAfter(t),t.prev!=null&&this.splitAfter(t.prev),t.parent.unwrap(),e=!0):t instanceof fn?t.unwrap():t.remove())})}formatAt(e,t,r,s){this.children.forEachAt(e,t,(a,l,o)=>{a.formatAt(l,o,r,s)})}insertAt(e,t,r){const[s,a]=this.children.find(e);if(s)s.insertAt(a,t,r);else{const l=r==null?this.scroll.create("text",t):this.scroll.create(t,r);this.appendChild(l)}}insertBefore(e,t){e.parent!=null&&e.parent.children.remove(e);let r=null;this.children.insertBefore(e,t||null),e.parent=this,t!=null&&(r=t.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==r)&&this.domNode.insertBefore(e.domNode,r),e.attach()}length(){return this.children.reduce((e,t)=>e+t.length(),0)}moveChildren(e,t){this.children.forEach(r=>{e.insertBefore(r,t)})}optimize(e){if(super.optimize(e),this.enforceAllowedChildren(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0)if(this.statics.defaultChild!=null){const t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t)}else this.remove()}path(e,t=!1){const[r,s]=this.children.find(e,t),a=[[this,e]];return r instanceof fn?a.concat(r.path(s,t)):(r!=null&&a.push([r,s]),a)}removeChild(e){this.children.remove(e)}replaceWith(e,t){const r=typeof e=="string"?this.scroll.create(e,t):e;return r instanceof fn&&this.moveChildren(r),super.replaceWith(r)}split(e,t=!1){if(!t){if(e===0)return this;if(e===this.length())return this.next}const r=this.clone();return this.parent&&this.parent.insertBefore(r,this.next||void 0),this.children.forEachAt(e,this.length(),(s,a,l)=>{const o=s.split(a,t);o!=null&&r.appendChild(o)}),r}splitAfter(e){const t=this.clone();for(;e.next!=null;)t.appendChild(e.next);return this.parent&&this.parent.insertBefore(t,this.next||void 0),t}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(e,t){const r=[],s=[];e.forEach(a=>{a.target===this.domNode&&a.type==="childList"&&(r.push(...a.addedNodes),s.push(...a.removedNodes))}),s.forEach(a=>{if(a.parentNode!=null&&a.tagName!=="IFRAME"&&document.body.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const l=this.scroll.find(a);l!=null&&(l.domNode.parentNode==null||l.domNode.parentNode===this.domNode)&&l.detach()}),r.filter(a=>a.parentNode===this.domNode&&a!==this.uiNode).sort((a,l)=>a===l?0:a.compareDocumentPosition(l)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(a=>{let l=null;a.nextSibling!=null&&(l=this.scroll.find(a.nextSibling));const o=Za(a,this.scroll);(o.next!==l||o.next==null)&&(o.parent!=null&&o.parent.removeChild(this),this.insertBefore(o,l||void 0))}),this.enforceAllowedChildren()}};Mo.uiClass="";let Lb=Mo;const Nt=Lb;function Bb(n,e){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(n[t]!==e[t])return!1;return!0}const Zn=class Yn extends Nt{static create(e){return super.create(e)}static formats(e,t){const r=t.query(Yn.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new Ai(this.domNode)}format(e,t){if(e===this.statics.blotName&&!t)this.children.forEach(r=>{r instanceof Yn||(r=r.wrap(Yn.blotName,!0)),this.attributes.copy(r)}),this.unwrap();else{const r=this.scroll.query(e,Q.INLINE);if(r==null)return;r instanceof Rt?this.attributes.attribute(r,t):t&&(e!==this.statics.blotName||this.formats()[e]!==t)&&this.replaceWith(e,t)}}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return t!=null&&(e[this.statics.blotName]=t),e}formatAt(e,t,r,s){this.formats()[r]!=null||this.scroll.query(r,Q.ATTRIBUTE)?this.isolate(e,t).format(r,s):super.formatAt(e,t,r,s)}optimize(e){super.optimize(e);const t=this.formats();if(Object.keys(t).length===0)return this.unwrap();const r=this.next;r instanceof Yn&&r.prev===this&&Bb(t,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(e,t){const r=super.replaceWith(e,t);return this.attributes.copy(r),r}update(e,t){super.update(e,t),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}wrap(e,t){const r=super.wrap(e,t);return r instanceof Yn&&this.attributes.move(r),r}};Zn.allowedChildren=[Zn,Fe],Zn.blotName="inline",Zn.scope=Q.INLINE_BLOT,Zn.tagName="SPAN";let Ib=Zn;const Js=Ib,Xn=class Bs extends Nt{static create(e){return super.create(e)}static formats(e,t){const r=t.query(Bs.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new Ai(this.domNode)}format(e,t){const r=this.scroll.query(e,Q.BLOCK);r!=null&&(r instanceof Rt?this.attributes.attribute(r,t):e===this.statics.blotName&&!t?this.replaceWith(Bs.blotName):t&&(e!==this.statics.blotName||this.formats()[e]!==t)&&this.replaceWith(e,t))}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return t!=null&&(e[this.statics.blotName]=t),e}formatAt(e,t,r,s){this.scroll.query(r,Q.BLOCK)!=null?this.format(r,s):super.formatAt(e,t,r,s)}insertAt(e,t,r){if(r==null||this.scroll.query(t,Q.INLINE)!=null)super.insertAt(e,t,r);else{const s=this.split(e);if(s!=null){const a=this.scroll.create(t,r);s.parent.insertBefore(a,s)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(e,t){const r=super.replaceWith(e,t);return this.attributes.copy(r),r}update(e,t){super.update(e,t),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}};Xn.blotName="block",Xn.scope=Q.BLOCK_BLOT,Xn.tagName="P",Xn.allowedChildren=[Js,Xn,Fe];let Ob=Xn;const Or=Ob,Is=class extends Nt{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,t){super.deleteAt(e,t),this.enforceAllowedChildren()}formatAt(e,t,r,s){super.formatAt(e,t,r,s),this.enforceAllowedChildren()}insertAt(e,t,r){super.insertAt(e,t,r),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};Is.blotName="container",Is.scope=Q.BLOCK_BLOT;let Db=Is;const Ni=Db;class Mb extends Fe{static formats(e,t){}format(e,t){super.formatAt(0,this.length(),e,t)}formatAt(e,t,r,s){e===0&&t===this.length()?this.format(r,s):super.formatAt(e,t,r,s)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const at=Mb,Rb={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},qb=100,Jn=class extends Nt{constructor(e,t){super(null,t),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver(r=>{this.update(r)}),this.observer.observe(this.domNode,Rb),this.attach()}create(e,t){return this.registry.create(this,e,t)}find(e,t=!1){const r=this.registry.find(e,t);return r?r.scroll===this?r:t?this.find(r.scroll.domNode.parentNode,!0):null:null}query(e,t=Q.ANY){return this.registry.query(e,t)}register(...e){return this.registry.register(...e)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,t){this.update(),e===0&&t===this.length()?this.children.forEach(r=>{r.remove()}):super.deleteAt(e,t)}formatAt(e,t,r,s){this.update(),super.formatAt(e,t,r,s)}insertAt(e,t,r){this.update(),super.insertAt(e,t,r)}optimize(e=[],t={}){super.optimize(t);const r=t.mutationsMap||new WeakMap;let s=Array.from(this.observer.takeRecords());for(;s.length>0;)e.push(s.pop());const a=(u,h=!0)=>{u==null||u===this||u.domNode.parentNode!=null&&(r.has(u.domNode)||r.set(u.domNode,[]),h&&a(u.parent))},l=u=>{r.has(u.domNode)&&(u instanceof Nt&&u.children.forEach(l),r.delete(u.domNode),u.optimize(t))};let o=e;for(let u=0;o.length>0;u+=1){if(u>=qb)throw new Error("[Parchment] Maximum optimize iterations reached");for(o.forEach(h=>{const m=this.find(h.target,!0);m!=null&&(m.domNode===h.target&&(h.type==="childList"?(a(this.find(h.previousSibling,!1)),Array.from(h.addedNodes).forEach(p=>{const d=this.find(p,!1);a(d,!1),d instanceof Nt&&d.children.forEach(f=>{a(f,!1)})})):h.type==="attributes"&&a(m.prev)),a(m))}),this.children.forEach(l),o=Array.from(this.observer.takeRecords()),s=o.slice();s.length>0;)e.push(s.pop())}}update(e,t={}){e=e||this.observer.takeRecords();const r=new WeakMap;e.map(s=>{const a=this.find(s.target,!0);return a==null?null:r.has(a.domNode)?(r.get(a.domNode).push(s),null):(r.set(a.domNode,[s]),a)}).forEach(s=>{s!=null&&s!==this&&r.has(s.domNode)&&s.update(r.get(s.domNode)||[],t)}),t.mutationsMap=r,r.has(this.domNode)&&super.update(r.get(this.domNode),t),this.optimize(e,t)}};Jn.blotName="scroll",Jn.defaultChild=Or,Jn.allowedChildren=[Or,Ni],Jn.scope=Q.BLOCK_BLOT,Jn.tagName="DIV";let Vb=Jn;const Qs=Vb,Os=class Ro extends Fe{static create(e){return document.createTextNode(e)}static value(e){return e.data}constructor(e,t){super(e,t),this.text=this.statics.value(this.domNode)}deleteAt(e,t){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+t)}index(e,t){return this.domNode===e?t:-1}insertAt(e,t,r){r==null?(this.text=this.text.slice(0,e)+t+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,t,r)}length(){return this.text.length}optimize(e){super.optimize(e),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof Ro&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(e,t=!1){return[this.domNode,e]}split(e,t=!1){if(!t){if(e===0)return this;if(e===this.length())return this.next}const r=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(r,this.next||void 0),this.text=this.statics.value(this.domNode),r}update(e,t){e.some(r=>r.type==="characterData"&&r.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};Os.blotName="text",Os.scope=Q.INLINE_BLOT;let $b=Os;const bi=$b,_b=Object.freeze(Object.defineProperty({__proto__:null,Attributor:Rt,AttributorStore:Ai,BlockBlot:Or,ClassAttributor:St,ContainerBlot:Ni,EmbedBlot:at,InlineBlot:Js,LeafBlot:Fe,ParentBlot:Nt,Registry:ar,Scope:Q,ScrollBlot:Qs,StyleAttributor:En,TextBlot:bi},Symbol.toStringTag,{value:"Module"}));var ei={exports:{}},is,Ya;function jb(){if(Ya)return is;Ya=1;var n=-1,e=1,t=0;function r(v,B,k,P,_){if(v===B)return v?[[t,v]]:[];if(k!=null){var q=C(v,B,k);if(q)return q}var N=o(v,B),M=v.substring(0,N);v=v.substring(N),B=B.substring(N),N=h(v,B);var j=v.substring(v.length-N);v=v.substring(0,v.length-N),B=B.substring(0,B.length-N);var D=s(v,B);return M&&D.unshift([t,M]),j&&D.push([t,j]),S(D,_),P&&p(D),D}function s(v,B){var k;if(!v)return[[e,B]];if(!B)return[[n,v]];var P=v.length>B.length?v:B,_=v.length>B.length?B:v,q=P.indexOf(_);if(q!==-1)return k=[[e,P.substring(0,q)],[t,_],[e,P.substring(q+_.length)]],v.length>B.length&&(k[0][0]=k[2][0]=n),k;if(_.length===1)return[[n,v],[e,B]];var N=m(v,B);if(N){var M=N[0],j=N[1],D=N[2],F=N[3],U=N[4],K=r(M,D),ne=r(j,F);return K.concat([[t,U]],ne)}return a(v,B)}function a(v,B){for(var k=v.length,P=B.length,_=Math.ceil((k+P)/2),q=_,N=2*_,M=new Array(N),j=new Array(N),D=0;D<N;D++)M[D]=-1,j[D]=-1;M[q+1]=0,j[q+1]=0;for(var F=k-P,U=F%2!==0,K=0,ne=0,G=0,ae=0,oe=0;oe<_;oe++){for(var re=-oe+K;re<=oe-ne;re+=2){var ue=q+re,de;re===-oe||re!==oe&&M[ue-1]<M[ue+1]?de=M[ue+1]:de=M[ue-1]+1;for(var he=de-re;de<k&&he<P&&v.charAt(de)===B.charAt(he);)de++,he++;if(M[ue]=de,de>k)ne+=2;else if(he>P)K+=2;else if(U){var ce=q+F-re;if(ce>=0&&ce<N&&j[ce]!==-1){var fe=k-j[ce];if(de>=fe)return l(v,B,de,he)}}}for(var be=-oe+G;be<=oe-ae;be+=2){var ce=q+be,fe;be===-oe||be!==oe&&j[ce-1]<j[ce+1]?fe=j[ce+1]:fe=j[ce-1]+1;for(var Se=fe-be;fe<k&&Se<P&&v.charAt(k-fe-1)===B.charAt(P-Se-1);)fe++,Se++;if(j[ce]=fe,fe>k)ae+=2;else if(Se>P)G+=2;else if(!U){var ue=q+F-be;if(ue>=0&&ue<N&&M[ue]!==-1){var de=M[ue],he=q+de-ue;if(fe=k-fe,de>=fe)return l(v,B,de,he)}}}}return[[n,v],[e,B]]}function l(v,B,k,P){var _=v.substring(0,k),q=B.substring(0,P),N=v.substring(k),M=B.substring(P),j=r(_,q),D=r(N,M);return j.concat(D)}function o(v,B){if(!v||!B||v.charAt(0)!==B.charAt(0))return 0;for(var k=0,P=Math.min(v.length,B.length),_=P,q=0;k<_;)v.substring(q,_)==B.substring(q,_)?(k=_,q=k):P=_,_=Math.floor((P-k)/2+k);return A(v.charCodeAt(_-1))&&_--,_}function u(v,B){var k=v.length,P=B.length;if(k==0||P==0)return 0;k>P?v=v.substring(k-P):k<P&&(B=B.substring(0,k));var _=Math.min(k,P);if(v==B)return _;for(var q=0,N=1;;){var M=v.substring(_-N),j=B.indexOf(M);if(j==-1)return q;N+=j,(j==0||v.substring(_-N)==B.substring(0,N))&&(q=N,N++)}}function h(v,B){if(!v||!B||v.slice(-1)!==B.slice(-1))return 0;for(var k=0,P=Math.min(v.length,B.length),_=P,q=0;k<_;)v.substring(v.length-_,v.length-q)==B.substring(B.length-_,B.length-q)?(k=_,q=k):P=_,_=Math.floor((P-k)/2+k);return L(v.charCodeAt(v.length-_))&&_--,_}function m(v,B){var k=v.length>B.length?v:B,P=v.length>B.length?B:v;if(k.length<4||P.length*2<k.length)return null;function _(ne,G,ae){for(var oe=ne.substring(ae,ae+Math.floor(ne.length/4)),re=-1,ue="",de,he,ce,fe;(re=G.indexOf(oe,re+1))!==-1;){var be=o(ne.substring(ae),G.substring(re)),Se=h(ne.substring(0,ae),G.substring(0,re));ue.length<Se+be&&(ue=G.substring(re-Se,re)+G.substring(re,re+be),de=ne.substring(0,ae-Se),he=ne.substring(ae+be),ce=G.substring(0,re-Se),fe=G.substring(re+be))}return ue.length*2>=ne.length?[de,he,ce,fe,ue]:null}var q=_(k,P,Math.ceil(k.length/4)),N=_(k,P,Math.ceil(k.length/2)),M;if(!q&&!N)return null;N?q?M=q[4].length>N[4].length?q:N:M=N:M=q;var j,D,F,U;v.length>B.length?(j=M[0],D=M[1],F=M[2],U=M[3]):(F=M[0],U=M[1],j=M[2],D=M[3]);var K=M[4];return[j,D,F,U,K]}function p(v){for(var B=!1,k=[],P=0,_=null,q=0,N=0,M=0,j=0,D=0;q<v.length;)v[q][0]==t?(k[P++]=q,N=j,M=D,j=0,D=0,_=v[q][1]):(v[q][0]==e?j+=v[q][1].length:D+=v[q][1].length,_&&_.length<=Math.max(N,M)&&_.length<=Math.max(j,D)&&(v.splice(k[P-1],0,[n,_]),v[k[P-1]+1][0]=e,P--,P--,q=P>0?k[P-1]:-1,N=0,M=0,j=0,D=0,_=null,B=!0)),q++;for(B&&S(v),x(v),q=1;q<v.length;){if(v[q-1][0]==n&&v[q][0]==e){var F=v[q-1][1],U=v[q][1],K=u(F,U),ne=u(U,F);K>=ne?(K>=F.length/2||K>=U.length/2)&&(v.splice(q,0,[t,U.substring(0,K)]),v[q-1][1]=F.substring(0,F.length-K),v[q+1][1]=U.substring(K),q++):(ne>=F.length/2||ne>=U.length/2)&&(v.splice(q,0,[t,F.substring(0,ne)]),v[q-1][0]=e,v[q-1][1]=U.substring(0,U.length-ne),v[q+1][0]=n,v[q+1][1]=F.substring(ne),q++),q++}q++}}var d=/[^a-zA-Z0-9]/,f=/\s/,b=/[\r\n]/,y=/\n\r?\n$/,E=/^\r?\n\r?\n/;function x(v){function B(ne,G){if(!ne||!G)return 6;var ae=ne.charAt(ne.length-1),oe=G.charAt(0),re=ae.match(d),ue=oe.match(d),de=re&&ae.match(f),he=ue&&oe.match(f),ce=de&&ae.match(b),fe=he&&oe.match(b),be=ce&&ne.match(y),Se=fe&&G.match(E);return be||Se?5:ce||fe?4:re&&!de&&he?3:de||he?2:re||ue?1:0}for(var k=1;k<v.length-1;){if(v[k-1][0]==t&&v[k+1][0]==t){var P=v[k-1][1],_=v[k][1],q=v[k+1][1],N=h(P,_);if(N){var M=_.substring(_.length-N);P=P.substring(0,P.length-N),_=M+_.substring(0,_.length-N),q=M+q}for(var j=P,D=_,F=q,U=B(P,_)+B(_,q);_.charAt(0)===q.charAt(0);){P+=_.charAt(0),_=_.substring(1)+q.charAt(0),q=q.substring(1);var K=B(P,_)+B(_,q);K>=U&&(U=K,j=P,D=_,F=q)}v[k-1][1]!=j&&(j?v[k-1][1]=j:(v.splice(k-1,1),k--),v[k][1]=D,F?v[k+1][1]=F:(v.splice(k+1,1),k--))}k++}}function S(v,B){v.push([t,""]);for(var k=0,P=0,_=0,q="",N="",M;k<v.length;){if(k<v.length-1&&!v[k][1]){v.splice(k,1);continue}switch(v[k][0]){case e:_++,N+=v[k][1],k++;break;case n:P++,q+=v[k][1],k++;break;case t:var j=k-_-P-1;if(B){if(j>=0&&W(v[j][1])){var D=v[j][1].slice(-1);if(v[j][1]=v[j][1].slice(0,-1),q=D+q,N=D+N,!v[j][1]){v.splice(j,1),k--;var F=j-1;v[F]&&v[F][0]===e&&(_++,N=v[F][1]+N,F--),v[F]&&v[F][0]===n&&(P++,q=v[F][1]+q,F--),j=F}}if(O(v[k][1])){var D=v[k][1].charAt(0);v[k][1]=v[k][1].slice(1),q+=D,N+=D}}if(k<v.length-1&&!v[k][1]){v.splice(k,1);break}if(q.length>0||N.length>0){q.length>0&&N.length>0&&(M=o(N,q),M!==0&&(j>=0?v[j][1]+=N.substring(0,M):(v.splice(0,0,[t,N.substring(0,M)]),k++),N=N.substring(M),q=q.substring(M)),M=h(N,q),M!==0&&(v[k][1]=N.substring(N.length-M)+v[k][1],N=N.substring(0,N.length-M),q=q.substring(0,q.length-M)));var U=_+P;q.length===0&&N.length===0?(v.splice(k-U,U),k=k-U):q.length===0?(v.splice(k-U,U,[e,N]),k=k-U+1):N.length===0?(v.splice(k-U,U,[n,q]),k=k-U+1):(v.splice(k-U,U,[n,q],[e,N]),k=k-U+2)}k!==0&&v[k-1][0]===t?(v[k-1][1]+=v[k][1],v.splice(k,1)):k++,_=0,P=0,q="",N="";break}}v[v.length-1][1]===""&&v.pop();var K=!1;for(k=1;k<v.length-1;)v[k-1][0]===t&&v[k+1][0]===t&&(v[k][1].substring(v[k][1].length-v[k-1][1].length)===v[k-1][1]?(v[k][1]=v[k-1][1]+v[k][1].substring(0,v[k][1].length-v[k-1][1].length),v[k+1][1]=v[k-1][1]+v[k+1][1],v.splice(k-1,1),K=!0):v[k][1].substring(0,v[k+1][1].length)==v[k+1][1]&&(v[k-1][1]+=v[k+1][1],v[k][1]=v[k][1].substring(v[k+1][1].length)+v[k+1][1],v.splice(k+1,1),K=!0)),k++;K&&S(v,B)}function A(v){return v>=55296&&v<=56319}function L(v){return v>=56320&&v<=57343}function O(v){return L(v.charCodeAt(0))}function W(v){return A(v.charCodeAt(v.length-1))}function H(v){for(var B=[],k=0;k<v.length;k++)v[k][1].length>0&&B.push(v[k]);return B}function I(v,B,k,P){return W(v)||O(P)?null:H([[t,v],[n,B],[e,k],[t,P]])}function C(v,B,k){var P=typeof k=="number"?{index:k,length:0}:k.oldRange,_=typeof k=="number"?null:k.newRange,q=v.length,N=B.length;if(P.length===0&&(_===null||_.length===0)){var M=P.index,j=v.slice(0,M),D=v.slice(M),F=_?_.index:null;e:{var U=M+N-q;if(F!==null&&F!==U||U<0||U>N)break e;var K=B.slice(0,U),ne=B.slice(U);if(ne!==D)break e;var G=Math.min(M,U),ae=j.slice(0,G),oe=K.slice(0,G);if(ae!==oe)break e;var re=j.slice(G),ue=K.slice(G);return I(ae,re,ue,D)}e:{if(F!==null&&F!==M)break e;var de=M,K=B.slice(0,de),ne=B.slice(de);if(K!==j)break e;var he=Math.min(q-de,N-de),ce=D.slice(D.length-he),fe=ne.slice(ne.length-he);if(ce!==fe)break e;var re=D.slice(0,D.length-he),ue=ne.slice(0,ne.length-he);return I(j,re,ue,ce)}}if(P.length>0&&_&&_.length===0)e:{var ae=v.slice(0,P.index),ce=v.slice(P.index+P.length),G=ae.length,he=ce.length;if(N<G+he)break e;var oe=B.slice(0,G),fe=B.slice(N-he);if(ae!==oe||ce!==fe)break e;var re=v.slice(G,q-he),ue=B.slice(G,N-he);return I(ae,re,ue,ce)}return null}function $(v,B,k,P){return r(v,B,k,P,!0)}return $.INSERT=e,$.DELETE=n,$.EQUAL=t,is=$,is}var Ar={exports:{}};Ar.exports;var Xa;function qo(){return Xa||(Xa=1,(function(n,e){var t=200,r="__lodash_hash_undefined__",s=9007199254740991,a="[object Arguments]",l="[object Array]",o="[object Boolean]",u="[object Date]",h="[object Error]",m="[object Function]",p="[object GeneratorFunction]",d="[object Map]",f="[object Number]",b="[object Object]",y="[object Promise]",E="[object RegExp]",x="[object Set]",S="[object String]",A="[object Symbol]",L="[object WeakMap]",O="[object ArrayBuffer]",W="[object DataView]",H="[object Float32Array]",I="[object Float64Array]",C="[object Int8Array]",$="[object Int16Array]",v="[object Int32Array]",B="[object Uint8Array]",k="[object Uint8ClampedArray]",P="[object Uint16Array]",_="[object Uint32Array]",q=/[\\^$.*+?()[\]{}|]/g,N=/\w*$/,M=/^\[object .+?Constructor\]$/,j=/^(?:0|[1-9]\d*)$/,D={};D[a]=D[l]=D[O]=D[W]=D[o]=D[u]=D[H]=D[I]=D[C]=D[$]=D[v]=D[d]=D[f]=D[b]=D[E]=D[x]=D[S]=D[A]=D[B]=D[k]=D[P]=D[_]=!0,D[h]=D[m]=D[L]=!1;var F=typeof mn=="object"&&mn&&mn.Object===Object&&mn,U=typeof self=="object"&&self&&self.Object===Object&&self,K=F||U||Function("return this")(),ne=e&&!e.nodeType&&e,G=ne&&!0&&n&&!n.nodeType&&n,ae=G&&G.exports===ne;function oe(c,g){return c.set(g[0],g[1]),c}function re(c,g){return c.add(g),c}function ue(c,g){for(var w=-1,R=c?c.length:0;++w<R&&g(c[w],w,c)!==!1;);return c}function de(c,g){for(var w=-1,R=g.length,ie=c.length;++w<R;)c[ie+w]=g[w];return c}function he(c,g,w,R){for(var ie=-1,te=c?c.length:0;++ie<te;)w=g(w,c[ie],ie,c);return w}function ce(c,g){for(var w=-1,R=Array(c);++w<c;)R[w]=g(w);return R}function fe(c,g){return c?.[g]}function be(c){var g=!1;if(c!=null&&typeof c.toString!="function")try{g=!!(c+"")}catch{}return g}function Se(c){var g=-1,w=Array(c.size);return c.forEach(function(R,ie){w[++g]=[ie,R]}),w}function $t(c,g){return function(w){return c(g(w))}}function gt(c){var g=-1,w=Array(c.size);return c.forEach(function(R){w[++g]=R}),w}var Qt=Array.prototype,en=Function.prototype,_t=Object.prototype,tn=K["__core-js_shared__"],jn=(function(){var c=/[^.]+$/.exec(tn&&tn.keys&&tn.keys.IE_PROTO||"");return c?"Symbol(src)_1."+c:""})(),nn=en.toString,Ve=_t.hasOwnProperty,Qe=_t.toString,Lt=RegExp("^"+nn.call(Ve).replace(q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Bt=ae?K.Buffer:void 0,jt=K.Symbol,rn=K.Uint8Array,$e=$t(Object.getPrototypeOf,Object),xn=Object.create,Pt=_t.propertyIsEnumerable,sn=Qt.splice,Ue=Object.getOwnPropertySymbols,et=Bt?Bt.isBuffer:void 0,an=$t(Object.keys,Object),It=yt(K,"DataView"),Ft=yt(K,"Map"),_e=yt(K,"Promise"),bt=yt(K,"Set"),Tn=yt(K,"WeakMap"),tt=yt(Object,"create"),An=ze(It),Ut=ze(Ft),xe=ze(_e),lt=ze(bt),Nn=ze(Tn),vt=jt?jt.prototype:void 0,ln=vt?vt.valueOf:void 0;function ot(c){var g=-1,w=c?c.length:0;for(this.clear();++g<w;){var R=c[g];this.set(R[0],R[1])}}function Pn(){this.__data__=tt?tt(null):{}}function cr(c){return this.has(c)&&delete this.__data__[c]}function Xe(c){var g=this.__data__;if(tt){var w=g[c];return w===r?void 0:w}return Ve.call(g,c)?g[c]:void 0}function ct(c){var g=this.__data__;return tt?g[c]!==void 0:Ve.call(g,c)}function on(c,g){var w=this.__data__;return w[c]=tt&&g===void 0?r:g,this}ot.prototype.clear=Pn,ot.prototype.delete=cr,ot.prototype.get=Xe,ot.prototype.has=ct,ot.prototype.set=on;function Ce(c){var g=-1,w=c?c.length:0;for(this.clear();++g<w;){var R=c[g];this.set(R[0],R[1])}}function kn(){this.__data__=[]}function Fn(c){var g=this.__data__,w=Ae(g,c);if(w<0)return!1;var R=g.length-1;return w==R?g.pop():sn.call(g,w,1),!0}function nt(c){var g=this.__data__,w=Ae(g,c);return w<0?void 0:g[w][1]}function Un(c){return Ae(this.__data__,c)>-1}function zn(c,g){var w=this.__data__,R=Ae(w,c);return R<0?w.push([c,g]):w[R][1]=g,this}Ce.prototype.clear=kn,Ce.prototype.delete=Fn,Ce.prototype.get=nt,Ce.prototype.has=Un,Ce.prototype.set=zn;function Ie(c){var g=-1,w=c?c.length:0;for(this.clear();++g<w;){var R=c[g];this.set(R[0],R[1])}}function Hn(){this.__data__={hash:new ot,map:new(Ft||Ce),string:new ot}}function ur(c){return Cn(this,c).delete(c)}function ee(c){return Cn(this,c).get(c)}function T(c){return Cn(this,c).has(c)}function Z(c,g){return Cn(this,c).set(c,g),this}Ie.prototype.clear=Hn,Ie.prototype.delete=ur,Ie.prototype.get=ee,Ie.prototype.has=T,Ie.prototype.set=Z;function Y(c){this.__data__=new Ce(c)}function ve(){this.__data__=new Ce}function Le(c){return this.__data__.delete(c)}function Te(c){return this.__data__.get(c)}function De(c){return this.__data__.has(c)}function rt(c,g){var w=this.__data__;if(w instanceof Ce){var R=w.__data__;if(!Ft||R.length<t-1)return R.push([c,g]),this;w=this.__data__=new Ie(R)}return w.set(c,g),this}Y.prototype.clear=ve,Y.prototype.delete=Le,Y.prototype.get=Te,Y.prototype.has=De,Y.prototype.set=rt;function it(c,g){var w=fr(c)||Gn(c)?ce(c.length,String):[],R=w.length,ie=!!R;for(var te in c)Ve.call(c,te)&&!(ie&&(te=="length"||Fi(te,R)))&&w.push(te);return w}function cn(c,g,w){var R=c[g];(!(Ve.call(c,g)&&Hr(R,w))||w===void 0&&!(g in c))&&(c[g]=w)}function Ae(c,g){for(var w=c.length;w--;)if(Hr(c[w][0],g))return w;return-1}function st(c,g){return c&&hr(g,pr(g),c)}function un(c,g,w,R,ie,te,pe){var me;if(R&&(me=te?R(c,ie,te,pe):R(c)),me!==void 0)return me;if(!Dt(c))return c;var Be=fr(c);if(Be){if(me=ji(c),!g)return Vi(c,me)}else{var ge=Ht(c),je=ge==m||ge==p;if(Kr(c))return Kn(c,g);if(ge==b||ge==a||je&&!te){if(be(c))return te?c:{};if(me=Ot(je?{}:c),!g)return $i(c,st(me,c))}else{if(!D[ge])return te?c:{};me=Pi(c,ge,un,g)}}pe||(pe=new Y);var Je=pe.get(c);if(Je)return Je;if(pe.set(c,me),!Be)var Oe=w?_i(c):pr(c);return ue(Oe||c,function(Pe,Re){Oe&&(Re=Pe,Pe=c[Re]),cn(me,Re,un(Pe,g,w,R,Re,c,pe))}),me}function Li(c){return Dt(c)?xn(c):{}}function Bi(c,g,w){var R=g(c);return fr(c)?R:de(R,w(c))}function Ii(c){return Qe.call(c)}function Oi(c){if(!Dt(c)||zi(c))return!1;var g=mr(c)||be(c)?Lt:M;return g.test(ze(c))}function Di(c){if(!Ur(c))return an(c);var g=[];for(var w in Object(c))Ve.call(c,w)&&w!="constructor"&&g.push(w);return g}function Kn(c,g){if(g)return c.slice();var w=new c.constructor(c.length);return c.copy(w),w}function dr(c){var g=new c.constructor(c.byteLength);return new rn(g).set(new rn(c)),g}function Sn(c,g){var w=g?dr(c.buffer):c.buffer;return new c.constructor(w,c.byteOffset,c.byteLength)}function Pr(c,g,w){var R=g?w(Se(c),!0):Se(c);return he(R,oe,new c.constructor)}function Fr(c){var g=new c.constructor(c.source,N.exec(c));return g.lastIndex=c.lastIndex,g}function Mi(c,g,w){var R=g?w(gt(c),!0):gt(c);return he(R,re,new c.constructor)}function Ri(c){return ln?Object(ln.call(c)):{}}function qi(c,g){var w=g?dr(c.buffer):c.buffer;return new c.constructor(w,c.byteOffset,c.length)}function Vi(c,g){var w=-1,R=c.length;for(g||(g=Array(R));++w<R;)g[w]=c[w];return g}function hr(c,g,w,R){w||(w={});for(var ie=-1,te=g.length;++ie<te;){var pe=g[ie],me=void 0;cn(w,pe,me===void 0?c[pe]:me)}return w}function $i(c,g){return hr(c,zt(c),g)}function _i(c){return Bi(c,pr,zt)}function Cn(c,g){var w=c.__data__;return Ui(g)?w[typeof g=="string"?"string":"hash"]:w.map}function yt(c,g){var w=fe(c,g);return Oi(w)?w:void 0}var zt=Ue?$t(Ue,Object):Ki,Ht=Ii;(It&&Ht(new It(new ArrayBuffer(1)))!=W||Ft&&Ht(new Ft)!=d||_e&&Ht(_e.resolve())!=y||bt&&Ht(new bt)!=x||Tn&&Ht(new Tn)!=L)&&(Ht=function(c){var g=Qe.call(c),w=g==b?c.constructor:void 0,R=w?ze(w):void 0;if(R)switch(R){case An:return W;case Ut:return d;case xe:return y;case lt:return x;case Nn:return L}return g});function ji(c){var g=c.length,w=c.constructor(g);return g&&typeof c[0]=="string"&&Ve.call(c,"index")&&(w.index=c.index,w.input=c.input),w}function Ot(c){return typeof c.constructor=="function"&&!Ur(c)?Li($e(c)):{}}function Pi(c,g,w,R){var ie=c.constructor;switch(g){case O:return dr(c);case o:case u:return new ie(+c);case W:return Sn(c,R);case H:case I:case C:case $:case v:case B:case k:case P:case _:return qi(c,R);case d:return Pr(c,R,w);case f:case S:return new ie(c);case E:return Fr(c);case x:return Mi(c,R,w);case A:return Ri(c)}}function Fi(c,g){return g=g??s,!!g&&(typeof c=="number"||j.test(c))&&c>-1&&c%1==0&&c<g}function Ui(c){var g=typeof c;return g=="string"||g=="number"||g=="symbol"||g=="boolean"?c!=="__proto__":c===null}function zi(c){return!!jn&&jn in c}function Ur(c){var g=c&&c.constructor,w=typeof g=="function"&&g.prototype||_t;return c===w}function ze(c){if(c!=null){try{return nn.call(c)}catch{}try{return c+""}catch{}}return""}function zr(c){return un(c,!0,!0)}function Hr(c,g){return c===g||c!==c&&g!==g}function Gn(c){return Hi(c)&&Ve.call(c,"callee")&&(!Pt.call(c,"callee")||Qe.call(c)==a)}var fr=Array.isArray;function Wn(c){return c!=null&&Gr(c.length)&&!mr(c)}function Hi(c){return Wr(c)&&Wn(c)}var Kr=et||Gi;function mr(c){var g=Dt(c)?Qe.call(c):"";return g==m||g==p}function Gr(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=s}function Dt(c){var g=typeof c;return!!c&&(g=="object"||g=="function")}function Wr(c){return!!c&&typeof c=="object"}function pr(c){return Wn(c)?it(c):Di(c)}function Ki(){return[]}function Gi(){return!1}n.exports=zr})(Ar,Ar.exports)),Ar.exports}var ti={},Ja;function Pb(){if(Ja)return ti;Ja=1,Object.defineProperty(ti,"__esModule",{value:!0});const n=qo(),e=zs();var t;return(function(r){function s(u={},h={},m=!1){typeof u!="object"&&(u={}),typeof h!="object"&&(h={});let p=n(h);m||(p=Object.keys(p).reduce((d,f)=>(p[f]!=null&&(d[f]=p[f]),d),{}));for(const d in u)u[d]!==void 0&&h[d]===void 0&&(p[d]=u[d]);return Object.keys(p).length>0?p:void 0}r.compose=s;function a(u={},h={}){typeof u!="object"&&(u={}),typeof h!="object"&&(h={});const m=Object.keys(u).concat(Object.keys(h)).reduce((p,d)=>(e(u[d],h[d])||(p[d]=h[d]===void 0?null:h[d]),p),{});return Object.keys(m).length>0?m:void 0}r.diff=a;function l(u={},h={}){u=u||{};const m=Object.keys(h).reduce((p,d)=>(h[d]!==u[d]&&u[d]!==void 0&&(p[d]=h[d]),p),{});return Object.keys(u).reduce((p,d)=>(u[d]!==h[d]&&h[d]===void 0&&(p[d]=null),p),m)}r.invert=l;function o(u,h,m=!1){if(typeof u!="object")return h;if(typeof h!="object")return;if(!m)return h;const p=Object.keys(h).reduce((d,f)=>(u[f]===void 0&&(d[f]=h[f]),d),{});return Object.keys(p).length>0?p:void 0}r.transform=o})(t||(t={})),ti.default=t,ti}var ni={},Qa;function Vo(){if(Qa)return ni;Qa=1,Object.defineProperty(ni,"__esModule",{value:!0});var n;return(function(e){function t(r){return typeof r.delete=="number"?r.delete:typeof r.retain=="number"?r.retain:typeof r.retain=="object"&&r.retain!==null?1:typeof r.insert=="string"?r.insert.length:1}e.length=t})(n||(n={})),ni.default=n,ni}var ri={},el;function Fb(){if(el)return ri;el=1,Object.defineProperty(ri,"__esModule",{value:!0});const n=Vo();class e{constructor(r){this.ops=r,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(r){r||(r=1/0);const s=this.ops[this.index];if(s){const a=this.offset,l=n.default.length(s);if(r>=l-a?(r=l-a,this.index+=1,this.offset=0):this.offset+=r,typeof s.delete=="number")return{delete:r};{const o={};return s.attributes&&(o.attributes=s.attributes),typeof s.retain=="number"?o.retain=r:typeof s.retain=="object"&&s.retain!==null?o.retain=s.retain:typeof s.insert=="string"?o.insert=s.insert.substr(a,r):o.insert=s.insert,o}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?n.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const r=this.ops[this.index];return r?typeof r.delete=="number"?"delete":typeof r.retain=="number"||typeof r.retain=="object"&&r.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const r=this.offset,s=this.index,a=this.next(),l=this.ops.slice(this.index);return this.offset=r,this.index=s,[a].concat(l)}}else return[]}}return ri.default=e,ri}var tl;function Ub(){return tl||(tl=1,(function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const t=jb(),r=qo(),s=zs(),a=Pb();e.AttributeMap=a.default;const l=Vo();e.Op=l.default;const o=Fb();e.OpIterator=o.default;const u="\0",h=(p,d)=>{if(typeof p!="object"||p===null)throw new Error(`cannot retain a ${typeof p}`);if(typeof d!="object"||d===null)throw new Error(`cannot retain a ${typeof d}`);const f=Object.keys(p)[0];if(!f||f!==Object.keys(d)[0])throw new Error(`embed types not matched: ${f} != ${Object.keys(d)[0]}`);return[f,p[f],d[f]]};class m{constructor(d){Array.isArray(d)?this.ops=d:d!=null&&Array.isArray(d.ops)?this.ops=d.ops:this.ops=[]}static registerEmbed(d,f){this.handlers[d]=f}static unregisterEmbed(d){delete this.handlers[d]}static getHandler(d){const f=this.handlers[d];if(!f)throw new Error(`no handlers for embed type "${d}"`);return f}insert(d,f){const b={};return typeof d=="string"&&d.length===0?this:(b.insert=d,f!=null&&typeof f=="object"&&Object.keys(f).length>0&&(b.attributes=f),this.push(b))}delete(d){return d<=0?this:this.push({delete:d})}retain(d,f){if(typeof d=="number"&&d<=0)return this;const b={retain:d};return f!=null&&typeof f=="object"&&Object.keys(f).length>0&&(b.attributes=f),this.push(b)}push(d){let f=this.ops.length,b=this.ops[f-1];if(d=r(d),typeof b=="object"){if(typeof d.delete=="number"&&typeof b.delete=="number")return this.ops[f-1]={delete:b.delete+d.delete},this;if(typeof b.delete=="number"&&d.insert!=null&&(f-=1,b=this.ops[f-1],typeof b!="object"))return this.ops.unshift(d),this;if(s(d.attributes,b.attributes)){if(typeof d.insert=="string"&&typeof b.insert=="string")return this.ops[f-1]={insert:b.insert+d.insert},typeof d.attributes=="object"&&(this.ops[f-1].attributes=d.attributes),this;if(typeof d.retain=="number"&&typeof b.retain=="number")return this.ops[f-1]={retain:b.retain+d.retain},typeof d.attributes=="object"&&(this.ops[f-1].attributes=d.attributes),this}}return f===this.ops.length?this.ops.push(d):this.ops.splice(f,0,d),this}chop(){const d=this.ops[this.ops.length-1];return d&&typeof d.retain=="number"&&!d.attributes&&this.ops.pop(),this}filter(d){return this.ops.filter(d)}forEach(d){this.ops.forEach(d)}map(d){return this.ops.map(d)}partition(d){const f=[],b=[];return this.forEach(y=>{(d(y)?f:b).push(y)}),[f,b]}reduce(d,f){return this.ops.reduce(d,f)}changeLength(){return this.reduce((d,f)=>f.insert?d+l.default.length(f):f.delete?d-f.delete:d,0)}length(){return this.reduce((d,f)=>d+l.default.length(f),0)}slice(d=0,f=1/0){const b=[],y=new o.default(this.ops);let E=0;for(;E<f&&y.hasNext();){let x;E<d?x=y.next(d-E):(x=y.next(f-E),b.push(x)),E+=l.default.length(x)}return new m(b)}compose(d){const f=new o.default(this.ops),b=new o.default(d.ops),y=[],E=b.peek();if(E!=null&&typeof E.retain=="number"&&E.attributes==null){let S=E.retain;for(;f.peekType()==="insert"&&f.peekLength()<=S;)S-=f.peekLength(),y.push(f.next());E.retain-S>0&&b.next(E.retain-S)}const x=new m(y);for(;f.hasNext()||b.hasNext();)if(b.peekType()==="insert")x.push(b.next());else if(f.peekType()==="delete")x.push(f.next());else{const S=Math.min(f.peekLength(),b.peekLength()),A=f.next(S),L=b.next(S);if(L.retain){const O={};if(typeof A.retain=="number")O.retain=typeof L.retain=="number"?S:L.retain;else if(typeof L.retain=="number")A.retain==null?O.insert=A.insert:O.retain=A.retain;else{const H=A.retain==null?"insert":"retain",[I,C,$]=h(A[H],L.retain),v=m.getHandler(I);O[H]={[I]:v.compose(C,$,H==="retain")}}const W=a.default.compose(A.attributes,L.attributes,typeof A.retain=="number");if(W&&(O.attributes=W),x.push(O),!b.hasNext()&&s(x.ops[x.ops.length-1],O)){const H=new m(f.rest());return x.concat(H).chop()}}else typeof L.delete=="number"&&(typeof A.retain=="number"||typeof A.retain=="object"&&A.retain!==null)&&x.push(L)}return x.chop()}concat(d){const f=new m(this.ops.slice());return d.ops.length>0&&(f.push(d.ops[0]),f.ops=f.ops.concat(d.ops.slice(1))),f}diff(d,f){if(this.ops===d.ops)return new m;const b=[this,d].map(A=>A.map(L=>{if(L.insert!=null)return typeof L.insert=="string"?L.insert:u;const O=A===d?"on":"with";throw new Error("diff() called "+O+" non-document")}).join("")),y=new m,E=t(b[0],b[1],f,!0),x=new o.default(this.ops),S=new o.default(d.ops);return E.forEach(A=>{let L=A[1].length;for(;L>0;){let O=0;switch(A[0]){case t.INSERT:O=Math.min(S.peekLength(),L),y.push(S.next(O));break;case t.DELETE:O=Math.min(L,x.peekLength()),x.next(O),y.delete(O);break;case t.EQUAL:O=Math.min(x.peekLength(),S.peekLength(),L);const W=x.next(O),H=S.next(O);s(W.insert,H.insert)?y.retain(O,a.default.diff(W.attributes,H.attributes)):y.push(H).delete(O);break}L-=O}}),y.chop()}eachLine(d,f=`
|
|
14
|
-
`){const b=new o.default(this.ops);let y=new m,E=0;for(;b.hasNext();){if(b.peekType()!=="insert")return;const x=b.peek(),S=l.default.length(x)-b.peekLength(),A=typeof x.insert=="string"?x.insert.indexOf(f,S)-S:-1;if(A<0)y.push(b.next());else if(A>0)y.push(b.next(A));else{if(d(y,b.next(1).attributes||{},E)===!1)return;E+=1,y=new m}}y.length()>0&&d(y,{},E)}invert(d){const f=new m;return this.reduce((b,y)=>{if(y.insert)f.delete(l.default.length(y));else{if(typeof y.retain=="number"&&y.attributes==null)return f.retain(y.retain),b+y.retain;if(y.delete||typeof y.retain=="number"){const E=y.delete||y.retain;return d.slice(b,b+E).forEach(S=>{y.delete?f.push(S):y.retain&&y.attributes&&f.retain(l.default.length(S),a.default.invert(y.attributes,S.attributes))}),b+E}else if(typeof y.retain=="object"&&y.retain!==null){const E=d.slice(b,b+1),x=new o.default(E.ops).next(),[S,A,L]=h(y.retain,x.insert),O=m.getHandler(S);return f.retain({[S]:O.invert(A,L)},a.default.invert(y.attributes,x.attributes)),b+1}}return b},0),f.chop()}transform(d,f=!1){if(f=!!f,typeof d=="number")return this.transformPosition(d,f);const b=d,y=new o.default(this.ops),E=new o.default(b.ops),x=new m;for(;y.hasNext()||E.hasNext();)if(y.peekType()==="insert"&&(f||E.peekType()!=="insert"))x.retain(l.default.length(y.next()));else if(E.peekType()==="insert")x.push(E.next());else{const S=Math.min(y.peekLength(),E.peekLength()),A=y.next(S),L=E.next(S);if(A.delete)continue;if(L.delete)x.push(L);else{const O=A.retain,W=L.retain;let H=typeof W=="object"&&W!==null?W:S;if(typeof O=="object"&&O!==null&&typeof W=="object"&&W!==null){const I=Object.keys(O)[0];if(I===Object.keys(W)[0]){const C=m.getHandler(I);C&&(H={[I]:C.transform(O[I],W[I],f)})}}x.retain(H,a.default.transform(A.attributes,L.attributes,f))}}return x.chop()}transformPosition(d,f=!1){f=!!f;const b=new o.default(this.ops);let y=0;for(;b.hasNext()&&y<=d;){const E=b.peekLength(),x=b.peekType();if(b.next(),x==="delete"){d-=Math.min(E,d-y);continue}else x==="insert"&&(y<d||!f)&&(d+=E);y+=E}return d}}m.Op=l.default,m.OpIterator=o.default,m.AttributeMap=a.default,m.handlers={},e.default=m,n.exports=m,n.exports.default=m})(ei,ei.exports)),ei.exports}var mt=Ub();const J=Us(mt);class Ct extends at{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}Ct.blotName="break";Ct.tagName="BR";let kt=class extends bi{};const zb={"&":"&","<":"<",">":">",'"':""","'":"'"};function ki(n){return n.replace(/[&<>"']/g,e=>zb[e])}class Ke extends Js{static allowedChildren=[Ke,Ct,at,kt];static order=["cursor","inline","link","underline","strike","italic","bold","script","code"];static compare(e,t){const r=Ke.order.indexOf(e),s=Ke.order.indexOf(t);return r>=0||s>=0?r-s:e===t?0:e<t?-1:1}formatAt(e,t,r,s){if(Ke.compare(this.statics.blotName,r)<0&&this.scroll.query(r,Q.BLOT)){const a=this.isolate(e,t);s&&a.wrap(r,s)}else super.formatAt(e,t,r,s)}optimize(e){if(super.optimize(e),this.parent instanceof Ke&&Ke.compare(this.statics.blotName,this.parent.statics.blotName)>0){const t=this.parent.isolate(this.offset(),this.length());this.moveChildren(t),t.wrap(this)}}}const nl=1;class qe extends Or{cache={};delta(){return this.cache.delta==null&&(this.cache.delta=$o(this)),this.cache.delta}deleteAt(e,t){super.deleteAt(e,t),this.cache={}}formatAt(e,t,r,s){t<=0||(this.scroll.query(r,Q.BLOCK)?e+t===this.length()&&this.format(r,s):super.formatAt(e,Math.min(t,this.length()-e-1),r,s),this.cache={})}insertAt(e,t,r){if(r!=null){super.insertAt(e,t,r),this.cache={};return}if(t.length===0)return;const s=t.split(`
|
|
15
|
-
`),a=s.shift();a.length>0&&(e<this.length()-1||this.children.tail==null?super.insertAt(Math.min(e,this.length()-1),a):this.children.tail.insertAt(this.children.tail.length(),a),this.cache={});let l=this;s.reduce((o,u)=>(l=l.split(o,!0),l.insertAt(0,u),u.length),e+a.length)}insertBefore(e,t){const{head:r}=this.children;super.insertBefore(e,t),r instanceof Ct&&r.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+nl),this.cache.length}moveChildren(e,t){super.moveChildren(e,t),this.cache={}}optimize(e){super.optimize(e),this.cache={}}path(e){return super.path(e,!0)}removeChild(e){super.removeChild(e),this.cache={}}split(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(t&&(e===0||e>=this.length()-nl)){const s=this.clone();return e===0?(this.parent.insertBefore(s,this),this):(this.parent.insertBefore(s,this.next),s)}const r=super.split(e,t);return this.cache={},r}}qe.blotName="block";qe.tagName="P";qe.defaultChild=Ct;qe.allowedChildren=[Ct,Ke,at,kt];class ft extends at{attach(){super.attach(),this.attributes=new Ai(this.domNode)}delta(){return new J().insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,t){const r=this.scroll.query(e,Q.BLOCK_ATTRIBUTE);r!=null&&this.attributes.attribute(r,t)}formatAt(e,t,r,s){this.format(r,s)}insertAt(e,t,r){if(r!=null){super.insertAt(e,t,r);return}const s=t.split(`
|
|
16
|
-
`),a=s.pop(),l=s.map(u=>{const h=this.scroll.create(qe.blotName);return h.insertAt(0,u),h}),o=this.split(e);l.forEach(u=>{this.parent.insertBefore(u,o)}),a&&this.parent.insertBefore(this.scroll.create("text",a),o)}}ft.scope=Q.BLOCK_BLOT;function $o(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return n.descendants(Fe).reduce((t,r)=>r.length()===0?t:t.insert(r.value(),dt(r,{},e)),new J).insert(`
|
|
17
|
-
`,dt(n))}function dt(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return n==null||("formats"in n&&typeof n.formats=="function"&&(e={...e,...n.formats()},t&&delete e["code-token"]),n.parent==null||n.parent.statics.blotName==="scroll"||n.parent.statics.scope!==n.statics.scope)?e:dt(n.parent,e,t)}class Tt extends at{static blotName="cursor";static className="ql-cursor";static tagName="span";static CONTENTS="\uFEFF";static value(){}constructor(e,t,r){super(e,t),this.selection=r,this.textNode=document.createTextNode(Tt.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(e,t){if(this.savedLength!==0){super.format(e,t);return}let r=this,s=0;for(;r!=null&&r.statics.scope!==Q.BLOCK_BLOT;)s+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=Tt.CONTENTS.length,r.optimize(),r.formatAt(s,Tt.CONTENTS.length,e,t),this.savedLength=0)}index(e,t){return e===this.textNode?0:super.index(e,t)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||this.parent==null)return null;const e=this.selection.getNativeRange();for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const t=this.prev instanceof kt?this.prev:null,r=t?t.length():0,s=this.next instanceof kt?this.next:null,a=s?s.text:"",{textNode:l}=this,o=l.data.split(Tt.CONTENTS).join("");l.data=Tt.CONTENTS;let u;if(t)u=t,(o||s)&&(t.insertAt(t.length(),o+a),s&&s.remove());else if(s)u=s,s.insertAt(0,o);else{const h=document.createTextNode(o);u=this.scroll.create(h),this.parent.insertBefore(u,this)}if(this.remove(),e){const h=(d,f)=>t&&d===t.domNode?f:d===l?r+f-1:s&&d===s.domNode?r+o.length+f:null,m=h(e.start.node,e.start.offset),p=h(e.end.node,e.end.offset);if(m!==null&&p!==null)return{startNode:u.domNode,startOffset:m,endNode:u.domNode,endOffset:p}}return null}update(e,t){if(e.some(r=>r.type==="characterData"&&r.target===this.textNode)){const r=this.restore();r&&(t.range=r)}}optimize(e){super.optimize(e);let{parent:t}=this;for(;t;){if(t.domNode.tagName==="A"){this.savedLength=Tt.CONTENTS.length,t.isolate(this.offset(t),this.length()).unwrap(),this.savedLength=0;break}t=t.parent}}value(){return""}}var ss={exports:{}},rl;function Hb(){return rl||(rl=1,(function(n){var e=Object.prototype.hasOwnProperty,t="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(t=!1));function s(u,h,m){this.fn=u,this.context=h,this.once=m||!1}function a(u,h,m,p,d){if(typeof m!="function")throw new TypeError("The listener must be a function");var f=new s(m,p||u,d),b=t?t+h:h;return u._events[b]?u._events[b].fn?u._events[b]=[u._events[b],f]:u._events[b].push(f):(u._events[b]=f,u._eventsCount++),u}function l(u,h){--u._eventsCount===0?u._events=new r:delete u._events[h]}function o(){this._events=new r,this._eventsCount=0}o.prototype.eventNames=function(){var h=[],m,p;if(this._eventsCount===0)return h;for(p in m=this._events)e.call(m,p)&&h.push(t?p.slice(1):p);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(m)):h},o.prototype.listeners=function(h){var m=t?t+h:h,p=this._events[m];if(!p)return[];if(p.fn)return[p.fn];for(var d=0,f=p.length,b=new Array(f);d<f;d++)b[d]=p[d].fn;return b},o.prototype.listenerCount=function(h){var m=t?t+h:h,p=this._events[m];return p?p.fn?1:p.length:0},o.prototype.emit=function(h,m,p,d,f,b){var y=t?t+h:h;if(!this._events[y])return!1;var E=this._events[y],x=arguments.length,S,A;if(E.fn){switch(E.once&&this.removeListener(h,E.fn,void 0,!0),x){case 1:return E.fn.call(E.context),!0;case 2:return E.fn.call(E.context,m),!0;case 3:return E.fn.call(E.context,m,p),!0;case 4:return E.fn.call(E.context,m,p,d),!0;case 5:return E.fn.call(E.context,m,p,d,f),!0;case 6:return E.fn.call(E.context,m,p,d,f,b),!0}for(A=1,S=new Array(x-1);A<x;A++)S[A-1]=arguments[A];E.fn.apply(E.context,S)}else{var L=E.length,O;for(A=0;A<L;A++)switch(E[A].once&&this.removeListener(h,E[A].fn,void 0,!0),x){case 1:E[A].fn.call(E[A].context);break;case 2:E[A].fn.call(E[A].context,m);break;case 3:E[A].fn.call(E[A].context,m,p);break;case 4:E[A].fn.call(E[A].context,m,p,d);break;default:if(!S)for(O=1,S=new Array(x-1);O<x;O++)S[O-1]=arguments[O];E[A].fn.apply(E[A].context,S)}}return!0},o.prototype.on=function(h,m,p){return a(this,h,m,p,!1)},o.prototype.once=function(h,m,p){return a(this,h,m,p,!0)},o.prototype.removeListener=function(h,m,p,d){var f=t?t+h:h;if(!this._events[f])return this;if(!m)return l(this,f),this;var b=this._events[f];if(b.fn)b.fn===m&&(!d||b.once)&&(!p||b.context===p)&&l(this,f);else{for(var y=0,E=[],x=b.length;y<x;y++)(b[y].fn!==m||d&&!b[y].once||p&&b[y].context!==p)&&E.push(b[y]);E.length?this._events[f]=E.length===1?E[0]:E:l(this,f)}return this},o.prototype.removeAllListeners=function(h){var m;return h?(m=t?t+h:h,this._events[m]&&l(this,m)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=t,o.EventEmitter=o,n.exports=o})(ss)),ss.exports}var Kb=Hb();const Gb=Us(Kb),Ds=new WeakMap,Ms=["error","warn","log","info"];let Rs="warn";function _o(n){if(Rs&&Ms.indexOf(n)<=Ms.indexOf(Rs)){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];console[n](...t)}}function Jt(n){return Ms.reduce((e,t)=>(e[t]=_o.bind(console,t,n),e),{})}Jt.level=n=>{Rs=n};_o.level=Jt.level;const as=Jt("quill:events"),Wb=["selectionchange","mousedown","mouseup","click"];Wb.forEach(n=>{document.addEventListener(n,function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];Array.from(document.querySelectorAll(".ql-container")).forEach(s=>{const a=Ds.get(s);a&&a.emitter&&a.emitter.handleDOM(...t)})})});class X extends Gb{static events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SCROLL_EMBED_UPDATE:"scroll-embed-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change",COMPOSITION_BEFORE_START:"composition-before-start",COMPOSITION_START:"composition-start",COMPOSITION_BEFORE_END:"composition-before-end",COMPOSITION_END:"composition-end"};static sources={API:"api",SILENT:"silent",USER:"user"};constructor(){super(),this.domListeners={},this.on("error",as.error)}emit(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return as.log.call(as,...t),super.emit(...t)}handleDOM(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];(this.domListeners[e.type]||[]).forEach(a=>{let{node:l,handler:o}=a;(e.target===l||l.contains(e.target))&&o(e,...r)})}listenDOM(e,t,r){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:t,handler:r})}}const ls=Jt("quill:selection");class On{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=e,this.length=t}}class Zb{constructor(e,t){this.emitter=t,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new On(0,0),this.lastRange=this.savedRange,this.lastNative=null,this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,()=>{!this.mouseDown&&!this.composing&&setTimeout(this.update.bind(this,X.sources.USER),1)}),this.emitter.on(X.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const r=this.getNativeRange();r!=null&&r.start.node!==this.cursor.textNode&&this.emitter.once(X.events.SCROLL_UPDATE,(s,a)=>{try{this.root.contains(r.start.node)&&this.root.contains(r.end.node)&&this.setNativeRange(r.start.node,r.start.offset,r.end.node,r.end.offset);const l=a.some(o=>o.type==="characterData"||o.type==="childList"||o.type==="attributes"&&o.target===this.root);this.update(l?X.sources.SILENT:s)}catch{}})}),this.emitter.on(X.events.SCROLL_OPTIMIZE,(r,s)=>{if(s.range){const{startNode:a,startOffset:l,endNode:o,endOffset:u}=s.range;this.setNativeRange(a,l,o,u),this.update(X.sources.SILENT)}}),this.update(X.sources.SILENT)}handleComposition(){this.emitter.on(X.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(X.events.COMPOSITION_END,()=>{if(this.composing=!1,this.cursor.parent){const e=this.cursor.restore();if(!e)return;setTimeout(()=>{this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)},1)}})}handleDragging(){this.emitter.listenDOM("mousedown",document.body,()=>{this.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,()=>{this.mouseDown=!1,this.update(X.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(e,t){this.scroll.update();const r=this.getNativeRange();if(!(r==null||!r.native.collapsed||this.scroll.query(e,Q.BLOCK))){if(r.start.node!==this.cursor.textNode){const s=this.scroll.find(r.start.node,!1);if(s==null)return;if(s instanceof Fe){const a=s.split(r.start.offset);s.parent.insertBefore(this.cursor,a)}else s.insertBefore(this.cursor,r.start.node);this.cursor.attach()}this.cursor.format(e,t),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const r=this.scroll.length();e=Math.min(e,r-1),t=Math.min(e+t,r-1)-e;let s,[a,l]=this.scroll.leaf(e);if(a==null)return null;if(t>0&&l===a.length()){const[m]=this.scroll.leaf(e+1);if(m){const[p]=this.scroll.line(e),[d]=this.scroll.line(e+1);p===d&&(a=m,l=0)}}[s,l]=a.position(l,!0);const o=document.createRange();if(t>0)return o.setStart(s,l),[a,l]=this.scroll.leaf(e+t),a==null?null:([s,l]=a.position(l,!0),o.setEnd(s,l),o.getBoundingClientRect());let u="left",h;if(s instanceof Text){if(!s.data.length)return null;l<s.data.length?(o.setStart(s,l),o.setEnd(s,l+1)):(o.setStart(s,l-1),o.setEnd(s,l),u="right"),h=o.getBoundingClientRect()}else{if(!(a.domNode instanceof Element))return null;h=a.domNode.getBoundingClientRect(),l>0&&(u="right")}return{bottom:h.top+h.height,height:h.height,left:h[u],right:h[u],top:h.top,width:0}}getNativeRange(){const e=document.getSelection();if(e==null||e.rangeCount<=0)return null;const t=e.getRangeAt(0);if(t==null)return null;const r=this.normalizeNative(t);return ls.info("getNativeRange",r),r}getRange(){const e=this.scroll.domNode;if("isConnected"in e&&!e.isConnected)return[null,null];const t=this.getNativeRange();return t==null?[null,null]:[this.normalizedToRange(t),t]}hasFocus(){return document.activeElement===this.root||document.activeElement!=null&&os(this.root,document.activeElement)}normalizedToRange(e){const t=[[e.start.node,e.start.offset]];e.native.collapsed||t.push([e.end.node,e.end.offset]);const r=t.map(l=>{const[o,u]=l,h=this.scroll.find(o,!0),m=h.offset(this.scroll);return u===0?m:h instanceof Fe?m+h.index(o,u):m+h.length()}),s=Math.min(Math.max(...r),this.scroll.length()-1),a=Math.min(s,...r);return new On(a,s-a)}normalizeNative(e){if(!os(this.root,e.startContainer)||!e.collapsed&&!os(this.root,e.endContainer))return null;const t={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[t.start,t.end].forEach(r=>{let{node:s,offset:a}=r;for(;!(s instanceof Text)&&s.childNodes.length>0;)if(s.childNodes.length>a)s=s.childNodes[a],a=0;else if(s.childNodes.length===a)s=s.lastChild,s instanceof Text?a=s.data.length:s.childNodes.length>0?a=s.childNodes.length:a=s.childNodes.length+1;else break;r.node=s,r.offset=a}),t}rangeToNative(e){const t=this.scroll.length(),r=(s,a)=>{s=Math.min(t-1,s);const[l,o]=this.scroll.leaf(s);return l?l.position(o,a):[null,-1]};return[...r(e.index,!1),...r(e.index+e.length,!0)]}setNativeRange(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:t,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(ls.info("setNativeRange",e,t,r,s),e!=null&&(this.root.parentNode==null||e.parentNode==null||r.parentNode==null))return;const l=document.getSelection();if(l!=null)if(e!=null){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:o}=this.getNativeRange()||{};if(o==null||a||e!==o.startContainer||t!==o.startOffset||r!==o.endContainer||s!==o.endOffset){e instanceof Element&&e.tagName==="BR"&&(t=Array.from(e.parentNode.childNodes).indexOf(e),e=e.parentNode),r instanceof Element&&r.tagName==="BR"&&(s=Array.from(r.parentNode.childNodes).indexOf(r),r=r.parentNode);const u=document.createRange();u.setStart(e,t),u.setEnd(r,s),l.removeAllRanges(),l.addRange(u)}}else l.removeAllRanges(),this.root.blur()}setRange(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:X.sources.API;if(typeof t=="string"&&(r=t,t=!1),ls.info("setRange",e),e!=null){const s=this.rangeToNative(e);this.setNativeRange(...s,t)}else this.setNativeRange(null);this.update(r)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:X.sources.USER;const t=this.lastRange,[r,s]=this.getRange();if(this.lastRange=r,this.lastNative=s,this.lastRange!=null&&(this.savedRange=this.lastRange),!Xs(t,this.lastRange)){if(!this.composing&&s!=null&&s.native.collapsed&&s.start.node!==this.cursor.textNode){const l=this.cursor.restore();l&&this.setNativeRange(l.startNode,l.startOffset,l.endNode,l.endOffset)}const a=[X.events.SELECTION_CHANGE,tr(this.lastRange),tr(t),e];this.emitter.emit(X.events.EDITOR_CHANGE,...a),e!==X.sources.SILENT&&this.emitter.emit(...a)}}}function os(n,e){try{e.parentNode}catch{return!1}return n.contains(e)}const Yb=/^[ -~]*$/;class Xb{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let t=this.scroll.length();this.scroll.batchStart();const r=il(e),s=new J;return Qb(r.ops.slice()).reduce((l,o)=>{const u=mt.Op.length(o);let h=o.attributes||{},m=!1,p=!1;if(o.insert!=null){if(s.retain(u),typeof o.insert=="string"){const b=o.insert;p=!b.endsWith(`
|
|
18
|
-
`)&&(t<=l||!!this.scroll.descendant(ft,l)[0]),this.scroll.insertAt(l,b);const[y,E]=this.scroll.line(l);let x=gn({},dt(y));if(y instanceof qe){const[S]=y.descendant(Fe,E);S&&(x=gn(x,dt(S)))}h=mt.AttributeMap.diff(x,h)||{}}else if(typeof o.insert=="object"){const b=Object.keys(o.insert)[0];if(b==null)return l;const y=this.scroll.query(b,Q.INLINE)!=null;if(y)(t<=l||this.scroll.descendant(ft,l)[0])&&(p=!0);else if(l>0){const[E,x]=this.scroll.descendant(Fe,l-1);E instanceof kt?E.value()[x]!==`
|
|
19
|
-
`&&(m=!0):E instanceof at&&E.statics.scope===Q.INLINE_BLOT&&(m=!0)}if(this.scroll.insertAt(l,b,o.insert[b]),y){const[E]=this.scroll.descendant(Fe,l);if(E){const x=gn({},dt(E));h=mt.AttributeMap.diff(x,h)||{}}}}t+=u}else if(s.push(o),o.retain!==null&&typeof o.retain=="object"){const b=Object.keys(o.retain)[0];if(b==null)return l;this.scroll.updateEmbedAt(l,b,o.retain[b])}Object.keys(h).forEach(b=>{this.scroll.formatAt(l,u,b,h[b])});const d=m?1:0,f=p?1:0;return t+=d+f,s.retain(d),s.delete(f),l+u+d+f},0),s.reduce((l,o)=>typeof o.delete=="number"?(this.scroll.deleteAt(l,o.delete),l):l+mt.Op.length(o),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(r)}deleteText(e,t){return this.scroll.deleteAt(e,t),this.update(new J().retain(e).delete(t))}formatLine(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(r).forEach(a=>{this.scroll.lines(e,Math.max(t,1)).forEach(l=>{l.format(a,r[a])})}),this.scroll.optimize();const s=new J().retain(e).retain(t,tr(r));return this.update(s)}formatText(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(r).forEach(a=>{this.scroll.formatAt(e,t,a,r[a])});const s=new J().retain(e).retain(t,tr(r));return this.update(s)}getContents(e,t){return this.delta.slice(e,e+t)}getDelta(){return this.scroll.lines().reduce((e,t)=>e.concat(t.delta()),new J)}getFormat(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=[],s=[];t===0?this.scroll.path(e).forEach(o=>{const[u]=o;u instanceof qe?r.push(u):u instanceof Fe&&s.push(u)}):(r=this.scroll.lines(e,t),s=this.scroll.descendants(Fe,e,t));const[a,l]=[r,s].map(o=>{const u=o.shift();if(u==null)return{};let h=dt(u);for(;Object.keys(h).length>0;){const m=o.shift();if(m==null)return h;h=Jb(dt(m),h)}return h});return{...a,...l}}getHTML(e,t){const[r,s]=this.scroll.line(e);if(r){const a=r.length();return r.length()>=s+t&&!(s===0&&t===a)?Dr(r,s,t,!0):Dr(this.scroll,e,t,!0)}return""}getText(e,t){return this.getContents(e,t).filter(r=>typeof r.insert=="string").map(r=>r.insert).join("")}insertContents(e,t){const r=il(t),s=new J().retain(e).concat(r);return this.scroll.insertContents(e,r),this.update(s)}insertEmbed(e,t,r){return this.scroll.insertAt(e,t,r),this.update(new J().retain(e).insert({[t]:r}))}insertText(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t=t.replace(/\r\n/g,`
|
|
20
|
-
`).replace(/\r/g,`
|
|
21
|
-
`),this.scroll.insertAt(e,t),Object.keys(r).forEach(s=>{this.scroll.formatAt(e,t.length,s,r[s])}),this.update(new J().retain(e).insert(t,tr(r)))}isBlank(){if(this.scroll.children.length===0)return!0;if(this.scroll.children.length>1)return!1;const e=this.scroll.children.head;if(e?.statics.blotName!==qe.blotName)return!1;const t=e;return t.children.length>1?!1:t.children.head instanceof Ct}removeFormat(e,t){const r=this.getText(e,t),[s,a]=this.scroll.line(e+t);let l=0,o=new J;s!=null&&(l=s.length()-a,o=s.delta().slice(a,a+l-1).insert(`
|
|
22
|
-
`));const h=this.getContents(e,t+l).diff(new J().insert(r).concat(o)),m=new J().retain(e).concat(h);return this.applyDelta(m)}update(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;const s=this.delta;if(t.length===1&&t[0].type==="characterData"&&t[0].target.data.match(Yb)&&this.scroll.find(t[0].target)){const a=this.scroll.find(t[0].target),l=dt(a),o=a.offset(this.scroll),u=t[0].oldValue.replace(Tt.CONTENTS,""),h=new J().insert(u),m=new J().insert(a.value()),p=r&&{oldRange:sl(r.oldRange,-o),newRange:sl(r.newRange,-o)};e=new J().retain(o).concat(h.diff(m,p)).reduce((f,b)=>b.insert?f.insert(b.insert,l):f.push(b),new J),this.delta=s.compose(e)}else this.delta=this.getDelta(),(!e||!Xs(s.compose(e),this.delta))&&(e=s.diff(this.delta,r));return e}}function Qn(n,e,t){if(n.length===0){const[f]=cs(t.pop());return e<=0?`</li></${f}>`:`</li></${f}>${Qn([],e-1,t)}`}const[{child:r,offset:s,length:a,indent:l,type:o},...u]=n,[h,m]=cs(o);if(l>e)return t.push(o),l===e+1?`<${h}><li${m}>${Dr(r,s,a)}${Qn(u,l,t)}`:`<${h}><li>${Qn(n,e+1,t)}`;const p=t[t.length-1];if(l===e&&o===p)return`</li><li${m}>${Dr(r,s,a)}${Qn(u,l,t)}`;const[d]=cs(t.pop());return`</li></${d}>${Qn(n,e-1,t)}`}function Dr(n,e,t){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if("html"in n&&typeof n.html=="function")return n.html(e,t);if(n instanceof kt)return ki(n.value().slice(e,e+t)).replaceAll(" "," ");if(n instanceof Nt){if(n.statics.blotName==="list-container"){const h=[];return n.children.forEachAt(e,t,(m,p,d)=>{const f="formats"in m&&typeof m.formats=="function"?m.formats():{};h.push({child:m,offset:p,length:d,indent:f.indent||0,type:f.list})}),Qn(h,-1,[])}const s=[];if(n.children.forEachAt(e,t,(h,m,p)=>{s.push(Dr(h,m,p))}),r||n.statics.blotName==="list")return s.join("");const{outerHTML:a,innerHTML:l}=n.domNode,[o,u]=a.split(`>${l}<`);return o==="<table"?`<table style="border: 1px solid #000;">${s.join("")}<${u}`:`${o}>${s.join("")}<${u}`}return n.domNode instanceof Element?n.domNode.outerHTML:""}function Jb(n,e){return Object.keys(e).reduce((t,r)=>{if(n[r]==null)return t;const s=e[r];return s===n[r]?t[r]=s:Array.isArray(s)?s.indexOf(n[r])<0?t[r]=s.concat([n[r]]):t[r]=s:t[r]=[s,n[r]],t},{})}function cs(n){const e=n==="ordered"?"ol":"ul";switch(n){case"checked":return[e,' data-list="checked"'];case"unchecked":return[e,' data-list="unchecked"'];default:return[e,""]}}function il(n){return n.reduce((e,t)=>{if(typeof t.insert=="string"){const r=t.insert.replace(/\r\n/g,`
|
|
23
|
-
`).replace(/\r/g,`
|
|
24
|
-
`);return e.insert(r,t.attributes)}return e.push(t)},new J)}function sl(n,e){let{index:t,length:r}=n;return new On(t+e,r)}function Qb(n){const e=[];return n.forEach(t=>{typeof t.insert=="string"?t.insert.split(`
|
|
25
|
-
`).forEach((s,a)=>{a&&e.push({insert:`
|
|
26
|
-
`,attributes:t.attributes}),s&&e.push({insert:s,attributes:t.attributes})}):e.push(t)}),e}class Vt{static DEFAULTS={};constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=e,this.options=t}}const ii="\uFEFF";class ea extends at{constructor(e,t){super(e,t),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach(r=>{this.contentNode.appendChild(r)}),this.leftGuard=document.createTextNode(ii),this.rightGuard=document.createTextNode(ii),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(e,t){return e===this.leftGuard?0:e===this.rightGuard?1:super.index(e,t)}restore(e){let t=null,r;const s=e.data.split(ii).join("");if(e===this.leftGuard)if(this.prev instanceof kt){const a=this.prev.length();this.prev.insertAt(a,s),t={startNode:this.prev.domNode,startOffset:a+s.length}}else r=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(r),this),t={startNode:r,startOffset:s.length};else e===this.rightGuard&&(this.next instanceof kt?(this.next.insertAt(0,s),t={startNode:this.next.domNode,startOffset:s.length}):(r=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(r),this.next),t={startNode:r,startOffset:s.length}));return e.data=ii,t}update(e,t){e.forEach(r=>{if(r.type==="characterData"&&(r.target===this.leftGuard||r.target===this.rightGuard)){const s=this.restore(r.target);s&&(t.range=s)}})}}class e1{isComposing=!1;constructor(e,t){this.scroll=e,this.emitter=t,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",e=>{this.isComposing||this.handleCompositionStart(e)}),this.scroll.domNode.addEventListener("compositionend",e=>{this.isComposing&&queueMicrotask(()=>{this.handleCompositionEnd(e)})})}handleCompositionStart(e){const t=e.target instanceof Node?this.scroll.find(e.target,!0):null;t&&!(t instanceof ea)&&(this.emitter.emit(X.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(X.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(X.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(X.events.COMPOSITION_END,e),this.isComposing=!1}}class or{static DEFAULTS={modules:{}};static themes={default:or};modules={};constructor(e,t){this.quill=e,this.options=t}init(){Object.keys(this.options.modules).forEach(e=>{this.modules[e]==null&&this.addModule(e)})}addModule(e){const t=this.quill.constructor.import(`modules/${e}`);return this.modules[e]=new t(this.quill,this.options.modules[e]||{}),this.modules[e]}}const t1=n=>n.parentElement||n.getRootNode().host||null,n1=n=>{const e=n.getBoundingClientRect(),t="offsetWidth"in n&&Math.abs(e.width)/n.offsetWidth||1,r="offsetHeight"in n&&Math.abs(e.height)/n.offsetHeight||1;return{top:e.top,right:e.left+n.clientWidth*t,bottom:e.top+n.clientHeight*r,left:e.left}},si=n=>{const e=parseInt(n,10);return Number.isNaN(e)?0:e},al=(n,e,t,r,s,a)=>n<t&&e>r?0:n<t?-(t-n+s):e>r?e-n>r-t?n+s-t:e-r+a:0,r1=(n,e)=>{const t=n.ownerDocument;let r=e,s=n;for(;s;){const a=s===t.body,l=a?{top:0,right:window.visualViewport?.width??t.documentElement.clientWidth,bottom:window.visualViewport?.height??t.documentElement.clientHeight,left:0}:n1(s),o=getComputedStyle(s),u=al(r.left,r.right,l.left,l.right,si(o.scrollPaddingLeft),si(o.scrollPaddingRight)),h=al(r.top,r.bottom,l.top,l.bottom,si(o.scrollPaddingTop),si(o.scrollPaddingBottom));if(u||h)if(a)t.defaultView?.scrollBy(u,h);else{const{scrollLeft:m,scrollTop:p}=s;h&&(s.scrollTop+=h),u&&(s.scrollLeft+=u);const d=s.scrollLeft-m,f=s.scrollTop-p;r={left:r.left-d,top:r.top-f,right:r.right-d,bottom:r.bottom-f}}s=a||o.position==="fixed"?null:t1(s)}},i1=100,s1=["block","break","cursor","inline","scroll","text"],a1=(n,e,t)=>{const r=new ar;return s1.forEach(s=>{const a=e.query(s);a&&r.register(a)}),n.forEach(s=>{let a=e.query(s);a||t.error(`Cannot register "${s}" specified in "formats" config. Are you sure it was registered?`);let l=0;for(;a;)if(r.register(a),a="blotName"in a?a.requiredContainer??null:null,l+=1,l>i1){t.error(`Cycle detected in registering blot requiredContainer: "${s}"`);break}}),r},rr=Jt("quill"),ai=new ar;Nt.uiClass="ql-ui";class V{static DEFAULTS={bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:ai,theme:"default"};static events=X.events;static sources=X.sources;static version="2.0.3";static imports={delta:J,parchment:_b,"core/module":Vt,"core/theme":or};static debug(e){e===!0&&(e="log"),Jt.level(e)}static find(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Ds.get(e)||ai.find(e,t)}static import(e){return this.imports[e]==null&&rr.error(`Cannot import ${e}. Are you sure it was registered?`),this.imports[e]}static register(){if(typeof(arguments.length<=0?void 0:arguments[0])!="string"){const e=arguments.length<=0?void 0:arguments[0],t=!!(!(arguments.length<=1)&&arguments[1]),r="attrName"in e?e.attrName:e.blotName;typeof r=="string"?this.register(`formats/${r}`,e,t):Object.keys(e).forEach(s=>{this.register(s,e[s],t)})}else{const e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],r=!!(!(arguments.length<=2)&&arguments[2]);this.imports[e]!=null&&!r&&rr.warn(`Overwriting ${e} with`,t),this.imports[e]=t,(e.startsWith("blots/")||e.startsWith("formats/"))&&t&&typeof t!="boolean"&&t.blotName!=="abstract"&&ai.register(t),typeof t.register=="function"&&t.register(ai)}}constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=l1(e,t),this.container=this.options.container,this.container==null){rr.error("Invalid Quill container",e);return}this.options.debug&&V.debug(this.options.debug);const r=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",Ds.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new X;const s=Qs.blotName,a=this.options.registry.query(s);if(!a||!("blotName"in a))throw new Error(`Cannot initialize Quill without "${s}" blot`);if(this.scroll=new a(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new Xb(this.scroll),this.selection=new Zb(this.scroll,this.emitter),this.composition=new e1(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.uploader=this.theme.addModule("uploader"),this.theme.addModule("input"),this.theme.addModule("uiNode"),this.theme.init(),this.emitter.on(X.events.EDITOR_CHANGE,l=>{l===X.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(X.events.SCROLL_UPDATE,(l,o)=>{const u=this.selection.lastRange,[h]=this.selection.getRange(),m=u&&h?{oldRange:u,newRange:h}:void 0;Et.call(this,()=>this.editor.update(null,o,m),l)}),this.emitter.on(X.events.SCROLL_EMBED_UPDATE,(l,o)=>{const u=this.selection.lastRange,[h]=this.selection.getRange(),m=u&&h?{oldRange:u,newRange:h}:void 0;Et.call(this,()=>{const p=new J().retain(l.offset(this)).retain({[l.statics.blotName]:o});return this.editor.update(p,[],m)},V.sources.USER)}),r){const l=this.clipboard.convert({html:`${r}<p><br></p>`,text:`
|
|
27
|
-
`});this.setContents(l)}this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof e=="string"){const r=e;e=document.createElement("div"),e.classList.add(r)}return this.container.insertBefore(e,t),e}blur(){this.selection.setRange(null)}deleteText(e,t,r){return[e,t,,r]=Gt(e,t,r),Et.call(this,()=>this.editor.deleteText(e,t),r,e,-1*t)}disable(){this.enable(!1)}editReadOnly(e){this.allowReadOnlyEdits=!0;const t=e();return this.allowReadOnlyEdits=!1,t}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(e),this.container.classList.toggle("ql-disabled",!e)}focus(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.selection.focus(),e.preventScroll||this.scrollSelectionIntoView()}format(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:X.sources.API;return Et.call(this,()=>{const s=this.getSelection(!0);let a=new J;if(s==null)return a;if(this.scroll.query(e,Q.BLOCK))a=this.editor.formatLine(s.index,s.length,{[e]:t});else{if(s.length===0)return this.selection.format(e,t),a;a=this.editor.formatText(s.index,s.length,{[e]:t})}return this.setSelection(s,X.sources.SILENT),a},r)}formatLine(e,t,r,s,a){let l;return[e,t,l,a]=Gt(e,t,r,s,a),Et.call(this,()=>this.editor.formatLine(e,t,l),a,e,0)}formatText(e,t,r,s,a){let l;return[e,t,l,a]=Gt(e,t,r,s,a),Et.call(this,()=>this.editor.formatText(e,t,l),a,e,0)}getBounds(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=null;if(typeof e=="number"?r=this.selection.getBounds(e,t):r=this.selection.getBounds(e.index,e.length),!r)return null;const s=this.container.getBoundingClientRect();return{bottom:r.bottom-s.top,height:r.height,left:r.left-s.left,right:r.right-s.left,top:r.top-s.top,width:r.width}}getContents(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-e;return[e,t]=Gt(e,t),this.editor.getContents(e,t)}getFormat(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof e=="number"?this.editor.getFormat(e,t):this.editor.getFormat(e.index,e.length)}getIndex(e){return e.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(e){return this.scroll.leaf(e)}getLine(e){return this.scroll.line(e)}getLines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof e!="number"?this.scroll.lines(e.index,e.length):this.scroll.lines(e,t)}getModule(e){return this.theme.modules[e]}getSelection(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return typeof e=="number"&&(t=t??this.getLength()-e),[e,t]=Gt(e,t),this.editor.getHTML(e,t)}getText(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return typeof e=="number"&&(t=t??this.getLength()-e),[e,t]=Gt(e,t),this.editor.getText(e,t)}hasFocus(){return this.selection.hasFocus()}insertEmbed(e,t,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:V.sources.API;return Et.call(this,()=>this.editor.insertEmbed(e,t,r),s,e)}insertText(e,t,r,s,a){let l;return[e,,l,a]=Gt(e,0,r,s,a),Et.call(this,()=>this.editor.insertText(e,t,l),a,e,t.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(e,t,r){return[e,t,,r]=Gt(e,t,r),Et.call(this,()=>this.editor.removeFormat(e,t),r,e)}scrollRectIntoView(e){r1(this.root,e)}scrollIntoView(){console.warn("Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead."),this.scrollSelectionIntoView()}scrollSelectionIntoView(){const e=this.selection.lastRange,t=e&&this.selection.getBounds(e.index,e.length);t&&this.scrollRectIntoView(t)}setContents(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:X.sources.API;return Et.call(this,()=>{e=new J(e);const r=this.getLength(),s=this.editor.deleteText(0,r),a=this.editor.insertContents(0,e),l=this.editor.deleteText(this.getLength()-1,1);return s.compose(a).compose(l)},t)}setSelection(e,t,r){e==null?this.selection.setRange(null,t||V.sources.API):([e,t,,r]=Gt(e,t,r),this.selection.setRange(new On(Math.max(0,e),t),r),r!==X.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:X.sources.API;const r=new J().insert(e);return this.setContents(r,t)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:X.sources.USER;const t=this.scroll.update(e);return this.selection.update(e),t}updateContents(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:X.sources.API;return Et.call(this,()=>(e=new J(e),this.editor.applyDelta(e)),t,!0)}}function ll(n){return typeof n=="string"?document.querySelector(n):n}function us(n){return Object.entries(n??{}).reduce((e,t)=>{let[r,s]=t;return{...e,[r]:s===!0?{}:s}},{})}function ol(n){return Object.fromEntries(Object.entries(n).filter(e=>e[1]!==void 0))}function l1(n,e){const t=ll(n);if(!t)throw new Error("Invalid Quill container");const s=!e.theme||e.theme===V.DEFAULTS.theme?or:V.import(`themes/${e.theme}`);if(!s)throw new Error(`Invalid theme ${e.theme}. Did you register it?`);const{modules:a,...l}=V.DEFAULTS,{modules:o,...u}=s.DEFAULTS;let h=us(e.modules);h!=null&&h.toolbar&&h.toolbar.constructor!==Object&&(h={...h,toolbar:{container:h.toolbar}});const m=gn({},us(a),us(o),h),p={...l,...ol(u),...ol(e)};let d=e.registry;return d?e.formats&&rr.warn('Ignoring "formats" option because "registry" is specified'):d=e.formats?a1(e.formats,p.registry,rr):p.registry,{...p,registry:d,container:t,theme:s,modules:Object.entries(m).reduce((f,b)=>{let[y,E]=b;if(!E)return f;const x=V.import(`modules/${y}`);return x==null?(rr.error(`Cannot load ${y} module. Are you sure you registered it?`),f):{...f,[y]:gn({},x.DEFAULTS||{},E)}},{}),bounds:ll(p.bounds)}}function Et(n,e,t,r){if(!this.isEnabled()&&e===X.sources.USER&&!this.allowReadOnlyEdits)return new J;let s=t==null?null:this.getSelection();const a=this.editor.delta,l=n();if(s!=null&&(t===!0&&(t=s.index),r==null?s=cl(s,l,e):r!==0&&(s=cl(s,t,r,e)),this.setSelection(s,X.sources.SILENT)),l.length()>0){const o=[X.events.TEXT_CHANGE,l,a,e];this.emitter.emit(X.events.EDITOR_CHANGE,...o),e!==X.sources.SILENT&&this.emitter.emit(...o)}return l}function Gt(n,e,t,r,s){let a={};return typeof n.index=="number"&&typeof n.length=="number"?typeof e!="number"?(s=r,r=t,t=e,e=n.length,n=n.index):(e=n.length,n=n.index):typeof e!="number"&&(s=r,r=t,t=e,e=0),typeof t=="object"?(a=t,s=r):typeof t=="string"&&(r!=null?a[t]=r:s=t),s=s||X.sources.API,[n,e,a,s]}function cl(n,e,t,r){const s=typeof t=="number"?t:0;if(n==null)return null;let a,l;return e&&typeof e.transformPosition=="function"?[a,l]=[n.index,n.index+n.length].map(o=>e.transformPosition(o,r!==X.sources.USER)):[a,l]=[n.index,n.index+n.length].map(o=>o<e||o===e&&r===X.sources.USER?o:s>=0?o+s:Math.max(e,o+s)),new On(a,l-a)}class Vn extends Ni{}function ul(n){return n instanceof qe||n instanceof ft}function dl(n){return typeof n.updateContent=="function"}class o1 extends Qs{static blotName="scroll";static className="ql-editor";static tagName="DIV";static defaultChild=qe;static allowedChildren=[qe,ft,Vn];constructor(e,t,r){let{emitter:s}=r;super(e,t),this.emitter=s,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",a=>this.handleDragStart(a))}batchStart(){Array.isArray(this.batch)||(this.batch=[])}batchEnd(){if(!this.batch)return;const e=this.batch;this.batch=!1,this.update(e)}emitMount(e){this.emitter.emit(X.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(X.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,t){this.emitter.emit(X.events.SCROLL_EMBED_UPDATE,e,t)}deleteAt(e,t){const[r,s]=this.line(e),[a]=this.line(e+t);if(super.deleteAt(e,t),a!=null&&r!==a&&s>0){if(r instanceof ft||a instanceof ft){this.optimize();return}const l=a.children.head instanceof Ct?null:a.children.head;r.moveChildren(a,l),r.remove()}this.optimize()}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",e?"true":"false")}formatAt(e,t,r,s){super.formatAt(e,t,r,s),this.optimize()}insertAt(e,t,r){if(e>=this.length())if(r==null||this.scroll.query(t,Q.BLOCK)==null){const s=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(s),r==null&&t.endsWith(`
|
|
28
|
-
`)?s.insertAt(0,t.slice(0,-1),r):s.insertAt(0,t,r)}else{const s=this.scroll.create(t,r);this.appendChild(s)}else super.insertAt(e,t,r);this.optimize()}insertBefore(e,t){if(e.statics.scope===Q.INLINE_BLOT){const r=this.scroll.create(this.statics.defaultChild.blotName);r.appendChild(e),super.insertBefore(r,t)}else super.insertBefore(e,t)}insertContents(e,t){const r=this.deltaToRenderBlocks(t.concat(new J().insert(`
|
|
29
|
-
`))),s=r.pop();if(s==null)return;this.batchStart();const a=r.shift();if(a){const u=a.type==="block"&&(a.delta.length()===0||!this.descendant(ft,e)[0]&&e<this.length()),h=a.type==="block"?a.delta:new J().insert({[a.key]:a.value});ds(this,e,h);const m=a.type==="block"?1:0,p=e+h.length()+m;u&&this.insertAt(p-1,`
|
|
30
|
-
`);const d=dt(this.line(e)[0]),f=mt.AttributeMap.diff(d,a.attributes)||{};Object.keys(f).forEach(b=>{this.formatAt(p-1,1,b,f[b])}),e=p}let[l,o]=this.children.find(e);if(r.length&&(l&&(l=l.split(o),o=0),r.forEach(u=>{if(u.type==="block"){const h=this.createBlock(u.attributes,l||void 0);ds(h,0,u.delta)}else{const h=this.create(u.key,u.value);this.insertBefore(h,l||void 0),Object.keys(u.attributes).forEach(m=>{h.format(m,u.attributes[m])})}})),s.type==="block"&&s.delta.length()){const u=l?l.offset(l.scroll)+o:this.length();ds(this,u,s.delta)}this.batchEnd(),this.optimize()}isEnabled(){return this.domNode.getAttribute("contenteditable")==="true"}leaf(e){const t=this.path(e).pop();if(!t)return[null,-1];const[r,s]=t;return r instanceof Fe?[r,s]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(ul,e)}lines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;const r=(s,a,l)=>{let o=[],u=l;return s.children.forEachAt(a,l,(h,m,p)=>{ul(h)?o.push(h):h instanceof Ni&&(o=o.concat(r(h,m,u))),u-=p}),o};return r(this,e,t)}optimize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch||(super.optimize(e,t),e.length>0&&this.emitter.emit(X.events.SCROLL_OPTIMIZE,e,t))}path(e){return super.path(e).slice(1)}remove(){}update(e){if(this.batch){Array.isArray(e)&&(this.batch=this.batch.concat(e));return}let t=X.sources.USER;typeof e=="string"&&(t=e),Array.isArray(e)||(e=this.observer.takeRecords()),e=e.filter(r=>{let{target:s}=r;const a=this.find(s,!0);return a&&!dl(a)}),e.length>0&&this.emitter.emit(X.events.SCROLL_BEFORE_UPDATE,t,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(X.events.SCROLL_UPDATE,t,e)}updateEmbedAt(e,t,r){const[s]=this.descendant(a=>a instanceof ft,e);s&&s.statics.blotName===t&&dl(s)&&s.updateContent(r)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){const t=[];let r=new J;return e.forEach(s=>{const a=s?.insert;if(a)if(typeof a=="string"){const l=a.split(`
|
|
31
|
-
`);l.slice(0,-1).forEach(u=>{r.insert(u,s.attributes),t.push({type:"block",delta:r,attributes:s.attributes??{}}),r=new J});const o=l[l.length-1];o&&r.insert(o,s.attributes)}else{const l=Object.keys(a)[0];if(!l)return;this.query(l,Q.INLINE)?r.push(s):(r.length()&&t.push({type:"block",delta:r,attributes:{}}),r=new J,t.push({type:"blockEmbed",key:l,value:a[l],attributes:s.attributes??{}}))}}),r.length()&&t.push({type:"block",delta:r,attributes:{}}),t}createBlock(e,t){let r;const s={};Object.entries(e).forEach(o=>{let[u,h]=o;this.query(u,Q.BLOCK&Q.BLOT)!=null?r=u:s[u]=h});const a=this.create(r||this.statics.defaultChild.blotName,r?e[r]:void 0);this.insertBefore(a,t||void 0);const l=a.length();return Object.entries(s).forEach(o=>{let[u,h]=o;a.formatAt(0,l,u,h)}),a}}function ds(n,e,t){t.reduce((r,s)=>{const a=mt.Op.length(s);let l=s.attributes||{};if(s.insert!=null){if(typeof s.insert=="string"){const o=s.insert;n.insertAt(r,o);const[u]=n.descendant(Fe,r),h=dt(u);l=mt.AttributeMap.diff(h,l)||{}}else if(typeof s.insert=="object"){const o=Object.keys(s.insert)[0];if(o==null)return r;if(n.insertAt(r,o,s.insert[o]),n.scroll.query(o,Q.INLINE)!=null){const[h]=n.descendant(Fe,r),m=dt(h);l=mt.AttributeMap.diff(m,l)||{}}}}return Object.keys(l).forEach(o=>{n.formatAt(r,a,o,l[o])}),r+a},e)}const ta={scope:Q.BLOCK,whitelist:["right","center","justify"]},c1=new Rt("align","align",ta),jo=new St("align","ql-align",ta),Po=new En("align","text-align",ta);class Fo extends En{value(e){let t=super.value(e);return t.startsWith("rgb(")?(t=t.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),`#${t.split(",").map(s=>`00${parseInt(s,10).toString(16)}`.slice(-2)).join("")}`):t}}const u1=new St("color","ql-color",{scope:Q.INLINE}),na=new Fo("color","color",{scope:Q.INLINE}),d1=new St("background","ql-bg",{scope:Q.INLINE}),ra=new Fo("background","background-color",{scope:Q.INLINE});class $n extends Vn{static create(e){const t=super.create(e);return t.setAttribute("spellcheck","false"),t}code(e,t){return this.children.map(r=>r.length()<=1?"":r.domNode.innerText).join(`
|
|
32
|
-
`).slice(e,e+t)}html(e,t){return`<pre>
|
|
33
|
-
${ki(this.code(e,t))}
|
|
34
|
-
</pre>`}}class Ge extends qe{static TAB=" ";static register(){V.register($n)}}class ia extends Ke{}ia.blotName="code";ia.tagName="CODE";Ge.blotName="code-block";Ge.className="ql-code-block";Ge.tagName="DIV";$n.blotName="code-block-container";$n.className="ql-code-block-container";$n.tagName="DIV";$n.allowedChildren=[Ge];Ge.allowedChildren=[kt,Ct,Tt];Ge.requiredContainer=$n;const sa={scope:Q.BLOCK,whitelist:["rtl"]},Uo=new Rt("direction","dir",sa),zo=new St("direction","ql-direction",sa),Ho=new En("direction","direction",sa),Ko={scope:Q.INLINE,whitelist:["serif","monospace"]},Go=new St("font","ql-font",Ko);class h1 extends En{value(e){return super.value(e).replace(/["']/g,"")}}const Wo=new h1("font","font-family",Ko),Zo=new St("size","ql-size",{scope:Q.INLINE,whitelist:["small","large","huge"]}),Yo=new En("size","font-size",{scope:Q.INLINE,whitelist:["10px","18px","32px"]}),f1=Jt("quill:keyboard"),m1=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Si extends Vt{static match(e,t){return["altKey","ctrlKey","metaKey","shiftKey"].some(r=>!!t[r]!==e[r]&&t[r]!==null)?!1:t.key===e.key||t.key===e.which}constructor(e,t){super(e,t),this.bindings={},Object.keys(this.options.bindings).forEach(r=>{this.options.bindings[r]&&this.addBinding(this.options.bindings[r])}),this.addBinding({key:"Enter",shiftKey:null},this.handleEnter),this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},()=>{}),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:"Backspace"},{collapsed:!0},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0},this.handleDelete)):(this.addBinding({key:"Backspace"},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:"Backspace"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Delete"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=g1(e);if(s==null){f1.warn("Attempted to add invalid keyboard binding",s);return}typeof t=="function"&&(t={handler:t}),typeof r=="function"&&(r={handler:r}),(Array.isArray(s.key)?s.key:[s.key]).forEach(l=>{const o={...s,key:l,...t,...r};this.bindings[o.key]=this.bindings[o.key]||[],this.bindings[o.key].push(o)})}listen(){this.quill.root.addEventListener("keydown",e=>{if(e.defaultPrevented||e.isComposing||e.keyCode===229&&(e.key==="Enter"||e.key==="Backspace"))return;const s=(this.bindings[e.key]||[]).concat(this.bindings[e.which]||[]).filter(x=>Si.match(e,x));if(s.length===0)return;const a=V.find(e.target,!0);if(a&&a.scroll!==this.quill.scroll)return;const l=this.quill.getSelection();if(l==null||!this.quill.hasFocus())return;const[o,u]=this.quill.getLine(l.index),[h,m]=this.quill.getLeaf(l.index),[p,d]=l.length===0?[h,m]:this.quill.getLeaf(l.index+l.length),f=h instanceof bi?h.value().slice(0,m):"",b=p instanceof bi?p.value().slice(d):"",y={collapsed:l.length===0,empty:l.length===0&&o.length()<=1,format:this.quill.getFormat(l),line:o,offset:u,prefix:f,suffix:b,event:e};s.some(x=>{if(x.collapsed!=null&&x.collapsed!==y.collapsed||x.empty!=null&&x.empty!==y.empty||x.offset!=null&&x.offset!==y.offset)return!1;if(Array.isArray(x.format)){if(x.format.every(S=>y.format[S]==null))return!1}else if(typeof x.format=="object"&&!Object.keys(x.format).every(S=>x.format[S]===!0?y.format[S]!=null:x.format[S]===!1?y.format[S]==null:Xs(x.format[S],y.format[S])))return!1;return x.prefix!=null&&!x.prefix.test(y.prefix)||x.suffix!=null&&!x.suffix.test(y.suffix)?!1:x.handler.call(this,l,y,x)!==!0})&&e.preventDefault()})}handleBackspace(e,t){const r=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;if(e.index===0||this.quill.getLength()<=1)return;let s={};const[a]=this.quill.getLine(e.index);let l=new J().retain(e.index-r).delete(r);if(t.offset===0){const[o]=this.quill.getLine(e.index-1);if(o&&!(o.statics.blotName==="block"&&o.length()<=1)){const h=a.formats(),m=this.quill.getFormat(e.index-1,1);if(s=mt.AttributeMap.diff(h,m)||{},Object.keys(s).length>0){const p=new J().retain(e.index+a.length()-2).retain(1,s);l=l.compose(p)}}}this.quill.updateContents(l,V.sources.USER),this.quill.focus()}handleDelete(e,t){const r=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(e.index>=this.quill.getLength()-r)return;let s={};const[a]=this.quill.getLine(e.index);let l=new J().retain(e.index).delete(r);if(t.offset>=a.length()-1){const[o]=this.quill.getLine(e.index+1);if(o){const u=a.formats(),h=this.quill.getFormat(e.index,1);s=mt.AttributeMap.diff(u,h)||{},Object.keys(s).length>0&&(l=l.retain(o.length()-1).retain(1,s))}}this.quill.updateContents(l,V.sources.USER),this.quill.focus()}handleDeleteRange(e){aa({range:e,quill:this.quill}),this.quill.focus()}handleEnter(e,t){const r=Object.keys(t.format).reduce((a,l)=>(this.quill.scroll.query(l,Q.BLOCK)&&!Array.isArray(t.format[l])&&(a[l]=t.format[l]),a),{}),s=new J().retain(e.index).delete(e.length).insert(`
|
|
35
|
-
`,r);this.quill.updateContents(s,V.sources.USER),this.quill.setSelection(e.index+1,V.sources.SILENT),this.quill.focus()}}const p1={bindings:{bold:hs("bold"),italic:hs("italic"),underline:hs("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(n,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","+1",V.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(n,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","-1",V.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(n,e){e.format.indent!=null?this.quill.format("indent","-1",V.sources.USER):e.format.list!=null&&this.quill.format("list",!1,V.sources.USER)}},"indent code-block":hl(!0),"outdent code-block":hl(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(n){this.quill.deleteText(n.index-1,1,V.sources.USER)}},tab:{key:"Tab",handler(n,e){if(e.format.table)return!0;this.quill.history.cutoff();const t=new J().retain(n.index).delete(n.length).insert(" ");return this.quill.updateContents(t,V.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(n.index+1,V.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,V.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(n,e){const t={list:!1};e.format.indent&&(t.indent=!1),this.quill.formatLine(n.index,n.length,t,V.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(n){const[e,t]=this.quill.getLine(n.index),r={...e.formats(),list:"checked"},s=new J().retain(n.index).insert(`
|
|
36
|
-
`,r).retain(e.length()-t-1).retain(1,{list:"unchecked"});this.quill.updateContents(s,V.sources.USER),this.quill.setSelection(n.index+1,V.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(n,e){const[t,r]=this.quill.getLine(n.index),s=new J().retain(n.index).insert(`
|
|
37
|
-
`,e.format).retain(t.length()-r-1).retain(1,{header:null});this.quill.updateContents(s,V.sources.USER),this.quill.setSelection(n.index+1,V.sources.SILENT),this.quill.scrollSelectionIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:!0,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(n){const e=this.quill.getModule("table");if(e){const[t,r,s,a]=e.getTable(n),l=b1(t,r,s,a);if(l==null)return;let o=t.offset();if(l<0){const u=new J().retain(o).insert(`
|
|
38
|
-
`);this.quill.updateContents(u,V.sources.USER),this.quill.setSelection(n.index+1,n.length,V.sources.SILENT)}else if(l>0){o+=t.length();const u=new J().retain(o).insert(`
|
|
39
|
-
`);this.quill.updateContents(u,V.sources.USER),this.quill.setSelection(o,V.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(n,e){const{event:t,line:r}=e,s=r.offset(this.quill.scroll);t.shiftKey?this.quill.setSelection(s-1,V.sources.USER):this.quill.setSelection(s+r.length(),V.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(n,e){if(this.quill.scroll.query("list")==null)return!0;const{length:t}=e.prefix,[r,s]=this.quill.getLine(n.index);if(s>t)return!0;let a;switch(e.prefix.trim()){case"[]":case"[ ]":a="unchecked";break;case"[x]":a="checked";break;case"-":case"*":a="bullet";break;default:a="ordered"}this.quill.insertText(n.index," ",V.sources.USER),this.quill.history.cutoff();const l=new J().retain(n.index-s).delete(t+1).retain(r.length()-2-s).retain(1,{list:a});return this.quill.updateContents(l,V.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(n.index-t,V.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(n){const[e,t]=this.quill.getLine(n.index);let r=2,s=e;for(;s!=null&&s.length()<=1&&s.formats()["code-block"];)if(s=s.prev,r-=1,r<=0){const a=new J().retain(n.index+e.length()-t-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(a,V.sources.USER),this.quill.setSelection(n.index-1,V.sources.SILENT),!1}return!0}},"embed left":li("ArrowLeft",!1),"embed left shift":li("ArrowLeft",!0),"embed right":li("ArrowRight",!1),"embed right shift":li("ArrowRight",!0),"table down":fl(!1),"table up":fl(!0)}};Si.DEFAULTS=p1;function hl(n){return{key:"Tab",shiftKey:!n,format:{"code-block":!0},handler(e,t){let{event:r}=t;const s=this.quill.scroll.query("code-block"),{TAB:a}=s;if(e.length===0&&!r.shiftKey){this.quill.insertText(e.index,a,V.sources.USER),this.quill.setSelection(e.index+a.length,V.sources.SILENT);return}const l=e.length===0?this.quill.getLines(e.index,1):this.quill.getLines(e);let{index:o,length:u}=e;l.forEach((h,m)=>{n?(h.insertAt(0,a),m===0?o+=a.length:u+=a.length):h.domNode.textContent.startsWith(a)&&(h.deleteAt(0,a.length),m===0?o-=a.length:u-=a.length)}),this.quill.update(V.sources.USER),this.quill.setSelection(o,u,V.sources.SILENT)}}}function li(n,e){return{key:n,shiftKey:e,altKey:null,[n==="ArrowLeft"?"prefix":"suffix"]:/^$/,handler(r){let{index:s}=r;n==="ArrowRight"&&(s+=r.length+1);const[a]=this.quill.getLeaf(s);return a instanceof at?(n==="ArrowLeft"?e?this.quill.setSelection(r.index-1,r.length+1,V.sources.USER):this.quill.setSelection(r.index-1,V.sources.USER):e?this.quill.setSelection(r.index,r.length+1,V.sources.USER):this.quill.setSelection(r.index+r.length+1,V.sources.USER),!1):!0}}}function hs(n){return{key:n[0],shortKey:!0,handler(e,t){this.quill.format(n,!t.format[n],V.sources.USER)}}}function fl(n){return{key:n?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(e,t){const r=n?"prev":"next",s=t.line,a=s.parent[r];if(a!=null){if(a.statics.blotName==="table-row"){let l=a.children.head,o=s;for(;o.prev!=null;)o=o.prev,l=l.next;const u=l.offset(this.quill.scroll)+Math.min(t.offset,l.length()-1);this.quill.setSelection(u,0,V.sources.USER)}}else{const l=s.table()[r];l!=null&&(n?this.quill.setSelection(l.offset(this.quill.scroll)+l.length()-1,0,V.sources.USER):this.quill.setSelection(l.offset(this.quill.scroll),0,V.sources.USER))}return!1}}}function g1(n){if(typeof n=="string"||typeof n=="number")n={key:n};else if(typeof n=="object")n=tr(n);else return null;return n.shortKey&&(n[m1]=n.shortKey,delete n.shortKey),n}function aa(n){let{quill:e,range:t}=n;const r=e.getLines(t);let s={};if(r.length>1){const a=r[0].formats(),l=r[r.length-1].formats();s=mt.AttributeMap.diff(l,a)||{}}e.deleteText(t,V.sources.USER),Object.keys(s).length>0&&e.formatLine(t.index,1,s,V.sources.USER),e.setSelection(t.index,V.sources.SILENT)}function b1(n,e,t,r){return e.prev==null&&e.next==null?t.prev==null&&t.next==null?r===0?-1:1:t.prev==null?-1:1:e.prev==null?-1:e.next==null?1:null}const v1=/font-weight:\s*normal/,y1=["P","OL","UL"],ml=n=>n&&y1.includes(n.tagName),E1=n=>{Array.from(n.querySelectorAll("br")).filter(e=>ml(e.previousElementSibling)&&ml(e.nextElementSibling)).forEach(e=>{e.parentNode?.removeChild(e)})},w1=n=>{Array.from(n.querySelectorAll('b[style*="font-weight"]')).filter(e=>e.getAttribute("style")?.match(v1)).forEach(e=>{const t=n.createDocumentFragment();t.append(...e.childNodes),e.parentNode?.replaceChild(t,e)})};function x1(n){n.querySelector('[id^="docs-internal-guid-"]')&&(w1(n),E1(n))}const T1=/\bmso-list:[^;]*ignore/i,A1=/\bmso-list:[^;]*\bl(\d+)/i,N1=/\bmso-list:[^;]*\blevel(\d+)/i,k1=(n,e)=>{const t=n.getAttribute("style"),r=t?.match(A1);if(!r)return null;const s=Number(r[1]),a=t?.match(N1),l=a?Number(a[1]):1,o=new RegExp(`@list l${s}:level${l}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),u=e.match(o),h=u&&u[1]==="bullet"?"bullet":"ordered";return{id:s,indent:l,type:h,element:n}},S1=n=>{const e=Array.from(n.querySelectorAll("[style*=mso-list]")),t=[],r=[];e.forEach(l=>{(l.getAttribute("style")||"").match(T1)?t.push(l):r.push(l)}),t.forEach(l=>l.parentNode?.removeChild(l));const s=n.documentElement.innerHTML,a=r.map(l=>k1(l,s)).filter(l=>l);for(;a.length;){const l=[];let o=a.shift();for(;o;)l.push(o),o=a.length&&a[0]?.element===o.element.nextElementSibling&&a[0].id===o.id?a.shift():null;const u=document.createElement("ul");l.forEach(p=>{const d=document.createElement("li");d.setAttribute("data-list",p.type),p.indent>1&&d.setAttribute("class",`ql-indent-${p.indent-1}`),d.innerHTML=p.element.innerHTML,u.appendChild(d)});const h=l[0]?.element,{parentNode:m}=h??{};h&&m?.replaceChild(u,h),l.slice(1).forEach(p=>{let{element:d}=p;m?.removeChild(d)})}};function C1(n){n.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&S1(n)}const L1=[C1,x1],B1=n=>{n.documentElement&&L1.forEach(e=>{e(n)})},I1=Jt("quill:clipboard"),O1=[[Node.TEXT_NODE,H1],[Node.TEXT_NODE,gl],["br",$1],[Node.ELEMENT_NODE,gl],[Node.ELEMENT_NODE,V1],[Node.ELEMENT_NODE,q1],[Node.ELEMENT_NODE,U1],["li",P1],["ol, ul",F1],["pre",_1],["tr",z1],["b",fs("bold")],["i",fs("italic")],["strike",fs("strike")],["style",j1]],D1=[c1,Uo].reduce((n,e)=>(n[e.keyName]=e,n),{}),pl=[Po,ra,na,Ho,Wo,Yo].reduce((n,e)=>(n[e.keyName]=e,n),{});class M1 extends Vt{static DEFAULTS={matchers:[]};constructor(e,t){super(e,t),this.quill.root.addEventListener("copy",r=>this.onCaptureCopy(r,!1)),this.quill.root.addEventListener("cut",r=>this.onCaptureCopy(r,!0)),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],O1.concat(this.options.matchers??[]).forEach(r=>{let[s,a]=r;this.addMatcher(s,a)})}addMatcher(e,t){this.matchers.push([e,t])}convert(e){let{html:t,text:r}=e,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(s[Ge.blotName])return new J().insert(r||"",{[Ge.blotName]:s[Ge.blotName]});if(!t)return new J().insert(r||"",s);const a=this.convertHTML(t);return Vr(a,`
|
|
40
|
-
`)&&(a.ops[a.ops.length-1].attributes==null||s.table)?a.compose(new J().retain(a.length()-1).delete(1)):a}normalizeHTML(e){B1(e)}convertHTML(e){const t=new DOMParser().parseFromString(e,"text/html");this.normalizeHTML(t);const r=t.body,s=new WeakMap,[a,l]=this.prepareMatching(r,s);return la(this.quill.scroll,r,a,l,s)}dangerouslyPasteHTML(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:V.sources.API;if(typeof e=="string"){const s=this.convert({html:e,text:""});this.quill.setContents(s,t),this.quill.setSelection(0,V.sources.SILENT)}else{const s=this.convert({html:t,text:""});this.quill.updateContents(new J().retain(e).concat(s),r),this.quill.setSelection(e+s.length(),V.sources.SILENT)}}onCaptureCopy(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e.defaultPrevented)return;e.preventDefault();const[r]=this.quill.selection.getRange();if(r==null)return;const{html:s,text:a}=this.onCopy(r,t);e.clipboardData?.setData("text/plain",a),e.clipboardData?.setData("text/html",s),t&&aa({range:r,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter(t=>t[0]!=="#").join(`
|
|
41
|
-
`)}onCapturePaste(e){if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();const t=this.quill.getSelection(!0);if(t==null)return;const r=e.clipboardData?.getData("text/html");let s=e.clipboardData?.getData("text/plain");if(!r&&!s){const l=e.clipboardData?.getData("text/uri-list");l&&(s=this.normalizeURIList(l))}const a=Array.from(e.clipboardData?.files||[]);if(!r&&a.length>0){this.quill.uploader.upload(t,a);return}if(r&&a.length>0){const l=new DOMParser().parseFromString(r,"text/html");if(l.body.childElementCount===1&&l.body.firstElementChild?.tagName==="IMG"){this.quill.uploader.upload(t,a);return}}this.onPaste(t,{html:r,text:s})}onCopy(e){const t=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:t}}onPaste(e,t){let{text:r,html:s}=t;const a=this.quill.getFormat(e.index),l=this.convert({text:r,html:s},a);I1.log("onPaste",l,{text:r,html:s});const o=new J().retain(e.index).delete(e.length).concat(l);this.quill.updateContents(o,V.sources.USER),this.quill.setSelection(o.length()-e.length,V.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,t){const r=[],s=[];return this.matchers.forEach(a=>{const[l,o]=a;switch(l){case Node.TEXT_NODE:s.push(o);break;case Node.ELEMENT_NODE:r.push(o);break;default:Array.from(e.querySelectorAll(l)).forEach(u=>{t.has(u)?t.get(u)?.push(o):t.set(u,[o])});break}}),[r,s]}}function _n(n,e,t,r){return r.query(e)?n.reduce((s,a)=>{if(!a.insert)return s;if(a.attributes&&a.attributes[e])return s.push(a);const l=t?{[e]:t}:{};return s.insert(a.insert,{...l,...a.attributes})},new J):n}function Vr(n,e){let t="";for(let r=n.ops.length-1;r>=0&&t.length<e.length;--r){const s=n.ops[r];if(typeof s.insert!="string")break;t=s.insert+t}return t.slice(-1*e.length)===e}function pn(n,e){if(!(n instanceof Element))return!1;const t=e.query(n);return t&&t.prototype instanceof at?!1:["address","article","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","iframe","li","main","nav","ol","output","p","pre","section","table","td","tr","ul","video"].includes(n.tagName.toLowerCase())}function R1(n,e){return n.previousElementSibling&&n.nextElementSibling&&!pn(n.previousElementSibling,e)&&!pn(n.nextElementSibling,e)}const oi=new WeakMap;function Xo(n){return n==null?!1:(oi.has(n)||(n.tagName==="PRE"?oi.set(n,!0):oi.set(n,Xo(n.parentNode))),oi.get(n))}function la(n,e,t,r,s){return e.nodeType===e.TEXT_NODE?r.reduce((a,l)=>l(e,a,n),new J):e.nodeType===e.ELEMENT_NODE?Array.from(e.childNodes||[]).reduce((a,l)=>{let o=la(n,l,t,r,s);return l.nodeType===e.ELEMENT_NODE&&(o=t.reduce((u,h)=>h(l,u,n),o),o=(s.get(l)||[]).reduce((u,h)=>h(l,u,n),o)),a.concat(o)},new J):new J}function fs(n){return(e,t,r)=>_n(t,n,!0,r)}function q1(n,e,t){const r=Rt.keys(n),s=St.keys(n),a=En.keys(n),l={};return r.concat(s).concat(a).forEach(o=>{let u=t.query(o,Q.ATTRIBUTE);u!=null&&(l[u.attrName]=u.value(n),l[u.attrName])||(u=D1[o],u!=null&&(u.attrName===o||u.keyName===o)&&(l[u.attrName]=u.value(n)||void 0),u=pl[o],u!=null&&(u.attrName===o||u.keyName===o)&&(u=pl[o],l[u.attrName]=u.value(n)||void 0))}),Object.entries(l).reduce((o,u)=>{let[h,m]=u;return _n(o,h,m,t)},e)}function V1(n,e,t){const r=t.query(n);if(r==null)return e;if(r.prototype instanceof at){const s={},a=r.value(n);if(a!=null)return s[r.blotName]=a,new J().insert(s,r.formats(n,t))}else if(r.prototype instanceof Or&&!Vr(e,`
|
|
42
|
-
`)&&e.insert(`
|
|
43
|
-
`),"blotName"in r&&"formats"in r&&typeof r.formats=="function")return _n(e,r.blotName,r.formats(n,t),t);return e}function $1(n,e){return Vr(e,`
|
|
44
|
-
`)||e.insert(`
|
|
45
|
-
`),e}function _1(n,e,t){const r=t.query("code-block"),s=r&&"formats"in r&&typeof r.formats=="function"?r.formats(n,t):!0;return _n(e,"code-block",s,t)}function j1(){return new J}function P1(n,e,t){const r=t.query(n);if(r==null||r.blotName!=="list"||!Vr(e,`
|
|
46
|
-
`))return e;let s=-1,a=n.parentNode;for(;a!=null;)["OL","UL"].includes(a.tagName)&&(s+=1),a=a.parentNode;return s<=0?e:e.reduce((l,o)=>o.insert?o.attributes&&typeof o.attributes.indent=="number"?l.push(o):l.insert(o.insert,{indent:s,...o.attributes||{}}):l,new J)}function F1(n,e,t){const r=n;let s=r.tagName==="OL"?"ordered":"bullet";const a=r.getAttribute("data-checked");return a&&(s=a==="true"?"checked":"unchecked"),_n(e,"list",s,t)}function gl(n,e,t){if(!Vr(e,`
|
|
47
|
-
`)){if(pn(n,t)&&(n.childNodes.length>0||n instanceof HTMLParagraphElement))return e.insert(`
|
|
48
|
-
`);if(e.length()>0&&n.nextSibling){let r=n.nextSibling;for(;r!=null;){if(pn(r,t))return e.insert(`
|
|
49
|
-
`);const s=t.query(r);if(s&&s.prototype instanceof ft)return e.insert(`
|
|
50
|
-
`);r=r.firstChild}}}return e}function U1(n,e,t){const r={},s=n.style||{};return s.fontStyle==="italic"&&(r.italic=!0),s.textDecoration==="underline"&&(r.underline=!0),s.textDecoration==="line-through"&&(r.strike=!0),(s.fontWeight?.startsWith("bold")||parseInt(s.fontWeight,10)>=700)&&(r.bold=!0),e=Object.entries(r).reduce((a,l)=>{let[o,u]=l;return _n(a,o,u,t)},e),parseFloat(s.textIndent||0)>0?new J().insert(" ").concat(e):e}function z1(n,e,t){const r=n.parentElement?.tagName==="TABLE"?n.parentElement:n.parentElement?.parentElement;if(r!=null){const a=Array.from(r.querySelectorAll("tr")).indexOf(n)+1;return _n(e,"table",a,t)}return e}function H1(n,e,t){let r=n.data;if(n.parentElement?.tagName==="O:P")return e.insert(r.trim());if(!Xo(n)){if(r.trim().length===0&&r.includes(`
|
|
51
|
-
`)&&!R1(n,t))return e;r=r.replace(/[^\S\u00a0]/g," "),r=r.replace(/ {2,}/g," "),(n.previousSibling==null&&n.parentElement!=null&&pn(n.parentElement,t)||n.previousSibling instanceof Element&&pn(n.previousSibling,t))&&(r=r.replace(/^ /,"")),(n.nextSibling==null&&n.parentElement!=null&&pn(n.parentElement,t)||n.nextSibling instanceof Element&&pn(n.nextSibling,t))&&(r=r.replace(/ $/,"")),r=r.replaceAll(" "," ")}return e.insert(r)}class K1 extends Vt{static DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};lastRecorded=0;ignoreChange=!1;stack={undo:[],redo:[]};currentRange=null;constructor(e,t){super(e,t),this.quill.on(V.events.EDITOR_CHANGE,(r,s,a,l)=>{r===V.events.SELECTION_CHANGE?s&&l!==V.sources.SILENT&&(this.currentRange=s):r===V.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||l===V.sources.USER?this.record(s,a):this.transform(s)),this.currentRange=qs(this.currentRange,s))}),this.quill.keyboard.addBinding({key:"z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:["z","Z"],shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:"y",shortKey:!0},this.redo.bind(this)),this.quill.root.addEventListener("beforeinput",r=>{r.inputType==="historyUndo"?(this.undo(),r.preventDefault()):r.inputType==="historyRedo"&&(this.redo(),r.preventDefault())})}change(e,t){if(this.stack[e].length===0)return;const r=this.stack[e].pop();if(!r)return;const s=this.quill.getContents(),a=r.delta.invert(s);this.stack[t].push({delta:a,range:qs(r.range,a)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(r.delta,V.sources.USER),this.ignoreChange=!1,this.restoreSelection(r)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(e,t){if(e.ops.length===0)return;this.stack.redo=[];let r=e.invert(t),s=this.currentRange;const a=Date.now();if(this.lastRecorded+this.options.delay>a&&this.stack.undo.length>0){const l=this.stack.undo.pop();l&&(r=r.compose(l.delta),s=l.range)}else this.lastRecorded=a;r.length()!==0&&(this.stack.undo.push({delta:r,range:s}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(e){bl(this.stack.undo,e),bl(this.stack.redo,e)}undo(){this.change("undo","redo")}restoreSelection(e){if(e.range)this.quill.setSelection(e.range,V.sources.USER);else{const t=W1(this.quill.scroll,e.delta);this.quill.setSelection(t,V.sources.USER)}}}function bl(n,e){let t=e;for(let r=n.length-1;r>=0;r-=1){const s=n[r];n[r]={delta:t.transform(s.delta,!0),range:s.range&&qs(s.range,t)},t=s.delta.transform(t),n[r].delta.length()===0&&n.splice(r,1)}}function G1(n,e){const t=e.ops[e.ops.length-1];return t==null?!1:t.insert!=null?typeof t.insert=="string"&&t.insert.endsWith(`
|
|
52
|
-
`):t.attributes!=null?Object.keys(t.attributes).some(r=>n.query(r,Q.BLOCK)!=null):!1}function W1(n,e){const t=e.reduce((s,a)=>s+(a.delete||0),0);let r=e.length()-t;return G1(n,e)&&(r-=1),r}function qs(n,e){if(!n)return n;const t=e.transformPosition(n.index),r=e.transformPosition(n.index+n.length);return{index:t,length:r-t}}class Jo extends Vt{constructor(e,t){super(e,t),e.root.addEventListener("drop",r=>{r.preventDefault();let s=null;if(document.caretRangeFromPoint)s=document.caretRangeFromPoint(r.clientX,r.clientY);else if(document.caretPositionFromPoint){const l=document.caretPositionFromPoint(r.clientX,r.clientY);s=document.createRange(),s.setStart(l.offsetNode,l.offset),s.setEnd(l.offsetNode,l.offset)}const a=s&&e.selection.normalizeNative(s);if(a){const l=e.selection.normalizedToRange(a);r.dataTransfer?.files&&this.upload(l,r.dataTransfer.files)}})}upload(e,t){const r=[];Array.from(t).forEach(s=>{s&&this.options.mimetypes?.includes(s.type)&&r.push(s)}),r.length>0&&this.options.handler.call(this,e,r)}}Jo.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(n,e){if(!this.quill.scroll.query("image"))return;const t=e.map(r=>new Promise(s=>{const a=new FileReader;a.onload=()=>{s(a.result)},a.readAsDataURL(r)}));Promise.all(t).then(r=>{const s=r.reduce((a,l)=>a.insert({image:l}),new J().retain(n.index).delete(n.length));this.quill.updateContents(s,X.sources.USER),this.quill.setSelection(n.index+r.length,X.sources.SILENT)})}};const Z1=["insertText","insertReplacementText"];class Y1 extends Vt{constructor(e,t){super(e,t),e.root.addEventListener("beforeinput",r=>{this.handleBeforeInput(r)}),/Android/i.test(navigator.userAgent)||e.on(V.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(e){aa({range:e,quill:this.quill})}replaceText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(e.length===0)return!1;if(t){const r=this.quill.getFormat(e.index,1);this.deleteRange(e),this.quill.updateContents(new J().retain(e.index).insert(t,r),V.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+t.length,0,V.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!Z1.includes(e.inputType))return;const t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||t.collapsed===!0)return;const r=X1(e);if(r==null)return;const s=this.quill.selection.normalizeNative(t),a=s?this.quill.selection.normalizedToRange(s):null;a&&this.replaceText(a,r)&&e.preventDefault()}handleCompositionStart(){const e=this.quill.getSelection();e&&this.replaceText(e)}}function X1(n){return typeof n.data=="string"?n.data:n.dataTransfer?.types.includes("text/plain")?n.dataTransfer.getData("text/plain"):null}const J1=/Mac/i.test(navigator.platform),Q1=100,ev=n=>!!(n.key==="ArrowLeft"||n.key==="ArrowRight"||n.key==="ArrowUp"||n.key==="ArrowDown"||n.key==="Home"||J1&&n.key==="a"&&n.ctrlKey===!0);class tv extends Vt{isListening=!1;selectionChangeDeadline=0;constructor(e,t){super(e,t),this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(e,t){let{line:r,event:s}=t;if(!(r instanceof Nt)||!r.uiNode)return!0;const a=getComputedStyle(r.domNode).direction==="rtl";return a&&s.key!=="ArrowRight"||!a&&s.key!=="ArrowLeft"?!0:(this.quill.setSelection(e.index-1,e.length+(s.shiftKey?1:0),V.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",e=>{!e.defaultPrevented&&ev(e)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+Q1,this.isListening)return;this.isListening=!0;const e=()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()};document.addEventListener("selectionchange",e,{once:!0})}handleSelectionChange(){const e=document.getSelection();if(!e)return;const t=e.getRangeAt(0);if(t.collapsed!==!0||t.startOffset!==0)return;const r=this.quill.scroll.find(t.startContainer);if(!(r instanceof Nt)||!r.uiNode)return;const s=document.createRange();s.setStartAfter(r.uiNode),s.setEndAfter(r.uiNode),e.removeAllRanges(),e.addRange(s)}}V.register({"blots/block":qe,"blots/block/embed":ft,"blots/break":Ct,"blots/container":Vn,"blots/cursor":Tt,"blots/embed":ea,"blots/inline":Ke,"blots/scroll":o1,"blots/text":kt,"modules/clipboard":M1,"modules/history":K1,"modules/keyboard":Si,"modules/uploader":Jo,"modules/input":Y1,"modules/uiNode":tv});class nv extends St{add(e,t){let r=0;if(t==="+1"||t==="-1"){const s=this.value(e)||0;r=t==="+1"?s+1:s-1}else typeof t=="number"&&(r=t);return r===0?(this.remove(e),!0):super.add(e,r.toString())}canAdd(e,t){return super.canAdd(e,t)||super.canAdd(e,parseInt(t,10))}value(e){return parseInt(super.value(e),10)||void 0}}const rv=new nv("indent","ql-indent",{scope:Q.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class iv extends qe{static blotName="blockquote";static tagName="blockquote"}class sv extends qe{static blotName="header";static tagName=["H1","H2","H3","H4","H5","H6"];static formats(e){return this.tagName.indexOf(e.tagName)+1}}class $r extends Vn{}$r.blotName="list-container";$r.tagName="OL";class _r extends qe{static create(e){const t=super.create();return t.setAttribute("data-list",e),t}static formats(e){return e.getAttribute("data-list")||void 0}static register(){V.register($r)}constructor(e,t){super(e,t);const r=t.ownerDocument.createElement("span"),s=a=>{if(!e.isEnabled())return;const l=this.statics.formats(t,e);l==="checked"?(this.format("list","unchecked"),a.preventDefault()):l==="unchecked"&&(this.format("list","checked"),a.preventDefault())};r.addEventListener("mousedown",s),r.addEventListener("touchstart",s),this.attachUI(r)}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-list",t):super.format(e,t)}}_r.blotName="list";_r.tagName="LI";$r.allowedChildren=[_r];_r.requiredContainer=$r;class oa extends Ke{static blotName="bold";static tagName=["STRONG","B"];static create(){return super.create()}static formats(){return!0}optimize(e){super.optimize(e),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}class av extends oa{static blotName="italic";static tagName=["EM","I"]}class vi extends Ke{static blotName="link";static tagName="A";static SANITIZED_URL="about:blank";static PROTOCOL_WHITELIST=["http","https","mailto","tel","sms"];static create(e){const t=super.create(e);return t.setAttribute("href",this.sanitize(e)),t.setAttribute("rel","noopener noreferrer"),t.setAttribute("target","_blank"),t}static formats(e){return e.getAttribute("href")}static sanitize(e){return Qo(e,this.PROTOCOL_WHITELIST)?e:this.SANITIZED_URL}format(e,t){e!==this.statics.blotName||!t?super.format(e,t):this.domNode.setAttribute("href",this.constructor.sanitize(t))}}function Qo(n,e){const t=document.createElement("a");t.href=n;const r=t.href.slice(0,t.href.indexOf(":"));return e.indexOf(r)>-1}class lv extends Ke{static blotName="script";static tagName=["SUB","SUP"];static create(e){return e==="super"?document.createElement("sup"):e==="sub"?document.createElement("sub"):super.create(e)}static formats(e){if(e.tagName==="SUB")return"sub";if(e.tagName==="SUP")return"super"}}class ov extends oa{static blotName="strike";static tagName=["S","STRIKE"]}class cv extends Ke{static blotName="underline";static tagName="U"}class uv extends ea{static blotName="formula";static className="ql-formula";static tagName="SPAN";static create(e){if(window.katex==null)throw new Error("Formula module requires KaTeX.");const t=super.create(e);return typeof e=="string"&&(window.katex.render(e,t,{throwOnError:!1,errorColor:"#f00"}),t.setAttribute("data-value",e)),t}static value(e){return e.getAttribute("data-value")}html(){const{formula:e}=this.value();return`<span>${e}</span>`}}const vl=["alt","height","width"];let dv=class extends at{static blotName="image";static tagName="IMG";static create(e){const t=super.create(e);return typeof e=="string"&&t.setAttribute("src",this.sanitize(e)),t}static formats(e){return vl.reduce((t,r)=>(e.hasAttribute(r)&&(t[r]=e.getAttribute(r)),t),{})}static match(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}static sanitize(e){return Qo(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,t){vl.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}};const yl=["height","width"];class hv extends ft{static blotName="video";static className="ql-video";static tagName="IFRAME";static create(e){const t=super.create(e);return t.setAttribute("frameborder","0"),t.setAttribute("allowfullscreen","true"),t.setAttribute("src",this.sanitize(e)),t}static formats(e){return yl.reduce((t,r)=>(e.hasAttribute(r)&&(t[r]=e.getAttribute(r)),t),{})}static sanitize(e){return vi.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,t){yl.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}html(){const{video:e}=this.value();return`<a href="${e}">${e}</a>`}}const Nr=new St("code-token","hljs",{scope:Q.INLINE});class Yt extends Ke{static formats(e,t){for(;e!=null&&e!==t.domNode;){if(e.classList&&e.classList.contains(Ge.className))return super.formats(e,t);e=e.parentNode}}constructor(e,t,r){super(e,t,r),Nr.add(this.domNode,r)}format(e,t){e!==Yt.blotName?super.format(e,t):t?Nr.add(this.domNode,t):(Nr.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),Nr.value(this.domNode)||this.unwrap()}}Yt.blotName="code-token";Yt.className="ql-token";class ht extends Ge{static create(e){const t=super.create(e);return typeof e=="string"&&t.setAttribute("data-language",e),t}static formats(e){return e.getAttribute("data-language")||"plain"}static register(){}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-language",t):super.format(e,t)}replaceWith(e,t){return this.formatAt(0,this.length(),Yt.blotName,!1),super.replaceWith(e,t)}}class Sr extends $n{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,t){e===ht.blotName&&(this.forceNext=!0,this.children.forEach(r=>{r.format(e,t)}))}formatAt(e,t,r,s){r===ht.blotName&&(this.forceNext=!0),super.formatAt(e,t,r,s)}highlight(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.children.head==null)return;const s=`${Array.from(this.domNode.childNodes).filter(l=>l!==this.uiNode).map(l=>l.textContent).join(`
|
|
53
|
-
`)}
|
|
54
|
-
`,a=ht.formats(this.children.head.domNode);if(t||this.forceNext||this.cachedText!==s){if(s.trim().length>0||this.cachedText==null){const l=this.children.reduce((u,h)=>u.concat($o(h,!1)),new J),o=e(s,a);l.diff(o).reduce((u,h)=>{let{retain:m,attributes:p}=h;return m?(p&&Object.keys(p).forEach(d=>{[ht.blotName,Yt.blotName].includes(d)&&this.formatAt(u,m,d,p[d])}),u+m):u},0)}this.cachedText=s,this.forceNext=!1}}html(e,t){const[r]=this.children.find(e);return`<pre data-language="${r?ht.formats(r.domNode):"plain"}">
|
|
55
|
-
${ki(this.code(e,t))}
|
|
56
|
-
</pre>`}optimize(e){if(super.optimize(e),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const t=ht.formats(this.children.head.domNode);t!==this.uiNode.value&&(this.uiNode.value=t)}}}Sr.allowedChildren=[ht];ht.requiredContainer=Sr;ht.allowedChildren=[Yt,Tt,kt,Ct];const fv=(n,e,t)=>{if(typeof n.versionString=="string"){const r=n.versionString.split(".")[0];if(parseInt(r,10)>=11)return n.highlight(t,{language:e}).value}return n.highlight(e,t).value};class ec extends Vt{static register(){V.register(Yt,!0),V.register(ht,!0),V.register(Sr,!0)}constructor(e,t){if(super(e,t),this.options.hljs==null)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce((r,s)=>{let{key:a}=s;return r[a]=!0,r},{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(V.events.SCROLL_BLOT_MOUNT,e=>{if(!(e instanceof Sr))return;const t=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach(r=>{let{key:s,label:a}=r;const l=t.ownerDocument.createElement("option");l.textContent=a,l.setAttribute("value",s),t.appendChild(l)}),t.addEventListener("change",()=>{e.format(ht.blotName,t.value),this.quill.root.focus(),this.highlight(e,!0)}),e.uiNode==null&&(e.attachUI(t),e.children.head&&(t.value=ht.formats(e.children.head.domNode)))})}initTimer(){let e=null;this.quill.on(V.events.SCROLL_OPTIMIZE,()=>{e&&clearTimeout(e),e=setTimeout(()=>{this.highlight(),e=null},this.options.interval)})}highlight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.quill.selection.composing)return;this.quill.update(V.sources.USER);const r=this.quill.getSelection();(e==null?this.quill.scroll.descendants(Sr):[e]).forEach(a=>{a.highlight(this.highlightBlot,t)}),this.quill.update(V.sources.SILENT),r!=null&&this.quill.setSelection(r,V.sources.SILENT)}highlightBlot(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"plain";if(t=this.languages[t]?t:"plain",t==="plain")return ki(e).split(`
|
|
57
|
-
`).reduce((s,a,l)=>(l!==0&&s.insert(`
|
|
58
|
-
`,{[Ge.blotName]:t}),s.insert(a)),new J);const r=this.quill.root.ownerDocument.createElement("div");return r.classList.add(Ge.className),r.innerHTML=fv(this.options.hljs,t,e),la(this.quill.scroll,r,[(s,a)=>{const l=Nr.value(s);return l?a.compose(new J().retain(a.length(),{[Yt.blotName]:l})):a}],[(s,a)=>s.data.split(`
|
|
59
|
-
`).reduce((l,o,u)=>(u!==0&&l.insert(`
|
|
60
|
-
`,{[Ge.blotName]:t}),l.insert(o)),a)],new WeakMap)}}ec.DEFAULTS={hljs:window.hljs,interval:1e3,languages:[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"diff",label:"Diff"},{key:"xml",label:"HTML/XML"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"ruby",label:"Ruby"},{key:"sql",label:"SQL"}]};class At extends qe{static blotName="table";static tagName="TD";static create(e){const t=super.create();return e?t.setAttribute("data-row",e):t.setAttribute("data-row",ca()),t}static formats(e){if(e.hasAttribute("data-row"))return e.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(e,t){e===At.blotName&&t?this.domNode.setAttribute("data-row",t):super.format(e,t)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}}class Dn extends Vn{static blotName="table-row";static tagName="TR";checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){const e=this.children.head.formats(),t=this.children.tail.formats(),r=this.next.children.head.formats(),s=this.next.children.tail.formats();return e.table===t.table&&e.table===r.table&&e.table===s.table}return!1}optimize(e){super.optimize(e),this.children.forEach(t=>{if(t.next==null)return;const r=t.formats(),s=t.next.formats();if(r.table!==s.table){const a=this.splitAfter(t);a&&a.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}class bn extends Vn{static blotName="table-body";static tagName="TBODY"}class yi extends Vn{static blotName="table-container";static tagName="TABLE";balanceCells(){const e=this.descendants(Dn),t=e.reduce((r,s)=>Math.max(s.children.length,r),0);e.forEach(r=>{new Array(t-r.children.length).fill(0).forEach(()=>{let s;r.children.head!=null&&(s=At.formats(r.children.head.domNode));const a=this.scroll.create(At.blotName,s);r.appendChild(a),a.optimize()})})}cells(e){return this.rows().map(t=>t.children.at(e))}deleteColumn(e){const[t]=this.descendant(bn);t==null||t.children.head==null||t.children.forEach(r=>{const s=r.children.at(e);s?.remove()})}insertColumn(e){const[t]=this.descendant(bn);t==null||t.children.head==null||t.children.forEach(r=>{const s=r.children.at(e),a=At.formats(r.children.head.domNode),l=this.scroll.create(At.blotName,a);r.insertBefore(l,s)})}insertRow(e){const[t]=this.descendant(bn);if(t==null||t.children.head==null)return;const r=ca(),s=this.scroll.create(Dn.blotName);t.children.head.children.forEach(()=>{const l=this.scroll.create(At.blotName,r);s.appendChild(l)});const a=t.children.at(e);t.insertBefore(s,a)}rows(){const e=this.children.head;return e==null?[]:e.children.map(t=>t)}}yi.allowedChildren=[bn];bn.requiredContainer=yi;bn.allowedChildren=[Dn];Dn.requiredContainer=bn;Dn.allowedChildren=[At];At.requiredContainer=Dn;function ca(){return`row-${Math.random().toString(36).slice(2,6)}`}class mv extends Vt{static register(){V.register(At),V.register(Dn),V.register(bn),V.register(yi)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(yi).forEach(e=>{e.balanceCells()})}deleteColumn(){const[e,,t]=this.getTable();t!=null&&(e.deleteColumn(t.cellOffset()),this.quill.update(V.sources.USER))}deleteRow(){const[,e]=this.getTable();e!=null&&(e.remove(),this.quill.update(V.sources.USER))}deleteTable(){const[e]=this.getTable();if(e==null)return;const t=e.offset();e.remove(),this.quill.update(V.sources.USER),this.quill.setSelection(t,V.sources.SILENT)}getTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.quill.getSelection();if(e==null)return[null,null,null,-1];const[t,r]=this.quill.getLine(e.index);if(t==null||t.statics.blotName!==At.blotName)return[null,null,null,-1];const s=t.parent;return[s.parent.parent,s,t,r]}insertColumn(e){const t=this.quill.getSelection();if(!t)return;const[r,s,a]=this.getTable(t);if(a==null)return;const l=a.cellOffset();r.insertColumn(l+e),this.quill.update(V.sources.USER);let o=s.rowOffset();e===0&&(o+=1),this.quill.setSelection(t.index+o,t.length,V.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(e){const t=this.quill.getSelection();if(!t)return;const[r,s,a]=this.getTable(t);if(a==null)return;const l=s.rowOffset();r.insertRow(l+e),this.quill.update(V.sources.USER),e>0?this.quill.setSelection(t,V.sources.SILENT):this.quill.setSelection(t.index+s.children.length,t.length,V.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(e,t){const r=this.quill.getSelection();if(r==null)return;const s=new Array(e).fill(0).reduce(a=>{const l=new Array(t).fill(`
|
|
61
|
-
`).join("");return a.insert(l,{table:ca()})},new J().retain(r.index));this.quill.updateContents(s,V.sources.USER),this.quill.setSelection(r.index,V.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(V.events.SCROLL_OPTIMIZE,e=>{e.some(t=>["TD","TR","TBODY","TABLE"].includes(t.target.tagName)?(this.quill.once(V.events.TEXT_CHANGE,(r,s,a)=>{a===V.sources.USER&&this.balanceTables()}),!0):!1)})}}const El=Jt("quill:toolbar");class ua extends Vt{constructor(e,t){if(super(e,t),Array.isArray(this.options.container)){const r=document.createElement("div");r.setAttribute("role","toolbar"),pv(r,this.options.container),e.container?.parentNode?.insertBefore(r,e.container),this.container=r}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){El.error("Container required for toolbar",this.options);return}this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(r=>{const s=this.options.handlers?.[r];s&&this.addHandler(r,s)}),Array.from(this.container.querySelectorAll("button, select")).forEach(r=>{this.attach(r)}),this.quill.on(V.events.EDITOR_CHANGE,()=>{const[r]=this.quill.selection.getRange();this.update(r)})}addHandler(e,t){this.handlers[e]=t}attach(e){let t=Array.from(e.classList).find(s=>s.indexOf("ql-")===0);if(!t)return;if(t=t.slice(3),e.tagName==="BUTTON"&&e.setAttribute("type","button"),this.handlers[t]==null&&this.quill.scroll.query(t)==null){El.warn("ignoring attaching to nonexistent format",t,e);return}const r=e.tagName==="SELECT"?"change":"click";e.addEventListener(r,s=>{let a;if(e.tagName==="SELECT"){if(e.selectedIndex<0)return;const o=e.options[e.selectedIndex];o.hasAttribute("selected")?a=!1:a=o.value||!1}else e.classList.contains("ql-active")?a=!1:a=e.value||!e.hasAttribute("value"),s.preventDefault();this.quill.focus();const[l]=this.quill.selection.getRange();if(this.handlers[t]!=null)this.handlers[t].call(this,a);else if(this.quill.scroll.query(t).prototype instanceof at){if(a=prompt(`Enter ${t}`),!a)return;this.quill.updateContents(new J().retain(l.index).delete(l.length).insert({[t]:a}),V.sources.USER)}else this.quill.format(t,a,V.sources.USER);this.update(l)}),this.controls.push([t,e])}update(e){const t=e==null?{}:this.quill.getFormat(e);this.controls.forEach(r=>{const[s,a]=r;if(a.tagName==="SELECT"){let l=null;if(e==null)l=null;else if(t[s]==null)l=a.querySelector("option[selected]");else if(!Array.isArray(t[s])){let o=t[s];typeof o=="string"&&(o=o.replace(/"/g,'\\"')),l=a.querySelector(`option[value="${o}"]`)}l==null?(a.value="",a.selectedIndex=-1):l.selected=!0}else if(e==null)a.classList.remove("ql-active"),a.setAttribute("aria-pressed","false");else if(a.hasAttribute("value")){const l=t[s],o=l===a.getAttribute("value")||l!=null&&l.toString()===a.getAttribute("value")||l==null&&!a.getAttribute("value");a.classList.toggle("ql-active",o),a.setAttribute("aria-pressed",o.toString())}else{const l=t[s]!=null;a.classList.toggle("ql-active",l),a.setAttribute("aria-pressed",l.toString())}})}}ua.DEFAULTS={};function wl(n,e,t){const r=document.createElement("button");r.setAttribute("type","button"),r.classList.add(`ql-${e}`),r.setAttribute("aria-pressed","false"),t!=null?(r.value=t,r.setAttribute("aria-label",`${e}: ${t}`)):r.setAttribute("aria-label",e),n.appendChild(r)}function pv(n,e){Array.isArray(e[0])||(e=[e]),e.forEach(t=>{const r=document.createElement("span");r.classList.add("ql-formats"),t.forEach(s=>{if(typeof s=="string")wl(r,s);else{const a=Object.keys(s)[0],l=s[a];Array.isArray(l)?gv(r,a,l):wl(r,a,l)}}),n.appendChild(r)})}function gv(n,e,t){const r=document.createElement("select");r.classList.add(`ql-${e}`),t.forEach(s=>{const a=document.createElement("option");s!==!1?a.setAttribute("value",String(s)):a.setAttribute("selected","selected"),r.appendChild(a)}),n.appendChild(r)}ua.DEFAULTS={container:null,handlers:{clean(){const n=this.quill.getSelection();if(n!=null)if(n.length===0){const e=this.quill.getFormat();Object.keys(e).forEach(t=>{this.quill.scroll.query(t,Q.INLINE)!=null&&this.quill.format(t,!1,V.sources.USER)})}else this.quill.removeFormat(n.index,n.length,V.sources.USER)},direction(n){const{align:e}=this.quill.getFormat();n==="rtl"&&e==null?this.quill.format("align","right",V.sources.USER):!n&&e==="right"&&this.quill.format("align",!1,V.sources.USER),this.quill.format("direction",n,V.sources.USER)},indent(n){const e=this.quill.getSelection(),t=this.quill.getFormat(e),r=parseInt(t.indent||0,10);if(n==="+1"||n==="-1"){let s=n==="+1"?1:-1;t.direction==="rtl"&&(s*=-1),this.quill.format("indent",r+s,V.sources.USER)}},link(n){n===!0&&(n=prompt("Enter link URL:")),this.quill.format("link",n,V.sources.USER)},list(n){const e=this.quill.getSelection(),t=this.quill.getFormat(e);n==="check"?t.list==="checked"||t.list==="unchecked"?this.quill.format("list",!1,V.sources.USER):this.quill.format("list","unchecked",V.sources.USER):this.quill.format("list",n,V.sources.USER)}}};const bv='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"/></svg>',vv='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"/><line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"/></svg>',yv='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"/></svg>',Ev='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="3" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="3" y1="4" y2="4"/></svg>',wv='<svg viewbox="0 0 18 18"><g class="ql-fill ql-color-label"><polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"/><rect height="1" width="1" x="4" y="4"/><polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"/><rect height="1" width="1" x="2" y="6"/><rect height="1" width="1" x="3" y="5"/><rect height="1" width="1" x="4" y="7"/><polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"/><rect height="1" width="1" x="2" y="12"/><rect height="1" width="1" x="2" y="9"/><rect height="1" width="1" x="2" y="15"/><polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"/><rect height="1" width="1" x="3" y="8"/><path d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"/><path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"/><path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"/><rect height="1" width="1" x="12" y="2"/><rect height="1" width="1" x="11" y="3"/><path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"/><rect height="1" width="1" x="2" y="3"/><rect height="1" width="1" x="6" y="2"/><rect height="1" width="1" x="3" y="2"/><rect height="1" width="1" x="5" y="3"/><rect height="1" width="1" x="9" y="2"/><rect height="1" width="1" x="15" y="14"/><polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"/><rect height="1" width="1" x="13" y="7"/><rect height="1" width="1" x="15" y="5"/><rect height="1" width="1" x="14" y="6"/><rect height="1" width="1" x="15" y="8"/><rect height="1" width="1" x="14" y="9"/><path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"/><rect height="1" width="1" x="14" y="3"/><polygon points="12 6.868 12 6 11.62 6 12 6.868"/><rect height="1" width="1" x="15" y="2"/><rect height="1" width="1" x="12" y="5"/><rect height="1" width="1" x="13" y="4"/><polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"/><rect height="1" width="1" x="9" y="14"/><rect height="1" width="1" x="8" y="15"/><path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"/><rect height="1" width="1" x="5" y="15"/><path d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"/><rect height="1" width="1" x="11" y="15"/><path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"/><rect height="1" width="1" x="14" y="15"/><rect height="1" width="1" x="15" y="11"/></g><polyline class="ql-stroke" points="5.5 13 9 5 12.5 13"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="11" y2="11"/></svg>',xv='<svg viewbox="0 0 18 18"><rect class="ql-fill ql-stroke" height="3" width="3" x="4" y="5"/><rect class="ql-fill ql-stroke" height="3" width="3" x="11" y="5"/><path class="ql-even ql-fill ql-stroke" d="M7,8c0,4.031-3,5-3,5"/><path class="ql-even ql-fill ql-stroke" d="M14,8c0,4.031-3,5-3,5"/></svg>',Tv='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z"/><path class="ql-stroke" d="M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z"/></svg>',Av='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="5" x2="13" y1="3" y2="3"/><line class="ql-stroke" x1="6" x2="9.35" y1="12" y2="3"/><line class="ql-stroke" x1="11" x2="15" y1="11" y2="15"/><line class="ql-stroke" x1="15" x2="11" y1="11" y2="15"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="7" x="2" y="14"/></svg>',xl='<svg viewbox="0 0 18 18"><polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"/><polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"/><line class="ql-stroke" x1="10" x2="8" y1="5" y2="13"/></svg>',Nv='<svg viewbox="0 0 18 18"><line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"/><polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"/></svg>',kv='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"/><line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"/><path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"/><rect class="ql-fill" height="11" width="1" x="11" y="4"/><rect class="ql-fill" height="11" width="1" x="13" y="4"/></svg>',Sv='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"/><line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"/><path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"/><rect class="ql-fill" height="11" width="1" x="5" y="4"/><rect class="ql-fill" height="11" width="1" x="7" y="4"/></svg>',Cv='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"/><rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"/><path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"/></svg>',Lv='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"/></svg>',Bv='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',Iv='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',Ov='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"/></svg>',Dv='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',Mv='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"/></svg>',Rv='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"/><line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"/><line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"/></svg>',qv='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="10" width="12" x="3" y="4"/><circle class="ql-fill" cx="6" cy="7" r="1"/><polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"/></svg>',Vv='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"/></svg>',$v='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"/></svg>',_v='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"/><path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"/><path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"/></svg>',jv='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>',Pv='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"/><polyline class="ql-stroke" points="3 4 4 5 6 3"/><line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"/><polyline class="ql-stroke" points="3 14 4 15 6 13"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="3 9 4 10 6 8"/></svg>',Fv='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>',Uv='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"/><path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"/></svg>',zv='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"/><path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"/></svg>',Hv='<svg viewbox="0 0 18 18"><line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"/><path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"/><path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"/></svg>',Kv='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="2" width="3" x="5" y="5"/><rect class="ql-fill" height="2" width="4" x="9" y="5"/><g class="ql-fill ql-transparent"><rect height="2" width="3" x="5" y="8"/><rect height="2" width="4" x="9" y="8"/><rect height="2" width="3" x="5" y="11"/><rect height="2" width="4" x="9" y="11"/></g></svg>',Gv='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"/></svg>',Wv='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="12" width="1" x="5" y="3"/><rect class="ql-fill" height="12" width="1" x="12" y="3"/><rect class="ql-fill" height="2" width="8" x="5" y="8"/><rect class="ql-fill" height="1" width="3" x="3" y="5"/><rect class="ql-fill" height="1" width="3" x="3" y="7"/><rect class="ql-fill" height="1" width="3" x="3" y="10"/><rect class="ql-fill" height="1" width="3" x="3" y="12"/><rect class="ql-fill" height="1" width="3" x="12" y="5"/><rect class="ql-fill" height="1" width="3" x="12" y="7"/><rect class="ql-fill" height="1" width="3" x="12" y="10"/><rect class="ql-fill" height="1" width="3" x="12" y="12"/></svg>',Mr={align:{"":bv,center:vv,right:yv,justify:Ev},background:wv,blockquote:xv,bold:Tv,clean:Av,code:xl,"code-block":xl,color:Nv,direction:{"":kv,rtl:Sv},formula:Cv,header:{1:Lv,2:Bv,3:Iv,4:Ov,5:Dv,6:Mv},italic:Rv,image:qv,indent:{"+1":Vv,"-1":$v},link:_v,list:{bullet:jv,check:Pv,ordered:Fv},script:{sub:Uv,super:zv},strike:Hv,table:Kv,underline:Gv,video:Wv},Zv='<svg viewbox="0 0 18 18"><polygon class="ql-stroke" points="7 11 9 13 11 11 7 11"/><polygon class="ql-stroke" points="7 7 9 5 11 7 7 7"/></svg>';let Tl=0;function Al(n,e){n.setAttribute(e,`${n.getAttribute(e)!=="true"}`)}class Ci{constructor(e){this.select=e,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",()=>{this.togglePicker()}),this.label.addEventListener("keydown",t=>{switch(t.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),t.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),Al(this.label,"aria-expanded"),Al(this.options,"aria-hidden")}buildItem(e){const t=document.createElement("span");t.tabIndex="0",t.setAttribute("role","button"),t.classList.add("ql-picker-item");const r=e.getAttribute("value");return r&&t.setAttribute("data-value",r),e.textContent&&t.setAttribute("data-label",e.textContent),t.addEventListener("click",()=>{this.selectItem(t,!0)}),t.addEventListener("keydown",s=>{switch(s.key){case"Enter":this.selectItem(t,!0),s.preventDefault();break;case"Escape":this.escape(),s.preventDefault();break}}),t}buildLabel(){const e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML=Zv,e.tabIndex="0",e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),this.container.appendChild(e),e}buildOptions(){const e=document.createElement("span");e.classList.add("ql-picker-options"),e.setAttribute("aria-hidden","true"),e.tabIndex="-1",e.id=`ql-picker-options-${Tl}`,Tl+=1,this.label.setAttribute("aria-controls",e.id),this.options=e,Array.from(this.select.options).forEach(t=>{const r=this.buildItem(t);e.appendChild(r),t.selected===!0&&this.selectItem(r)}),this.container.appendChild(e)}buildPicker(){Array.from(this.select.attributes).forEach(e=>{this.container.setAttribute(e.name,e.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout(()=>this.label.focus(),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.container.querySelector(".ql-selected");e!==r&&(r?.classList.remove("ql-selected"),e!=null&&(e.classList.add("ql-selected"),this.select.selectedIndex=Array.from(e.parentNode.children).indexOf(e),e.hasAttribute("data-value")?this.label.setAttribute("data-value",e.getAttribute("data-value")):this.label.removeAttribute("data-value"),e.hasAttribute("data-label")?this.label.setAttribute("data-label",e.getAttribute("data-label")):this.label.removeAttribute("data-label"),t&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let e;if(this.select.selectedIndex>-1){const r=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(r)}else this.selectItem(null);const t=e!=null&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",t)}}class tc extends Ci{constructor(e,t){super(e),this.label.innerHTML=t,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach(r=>{r.classList.add("ql-primary")})}buildItem(e){const t=super.buildItem(e);return t.style.backgroundColor=e.getAttribute("value")||"",t}selectItem(e,t){super.selectItem(e,t);const r=this.label.querySelector(".ql-color-label"),s=e&&e.getAttribute("data-value")||"";r&&(r.tagName==="line"?r.style.stroke=s:r.style.fill=s)}}class nc extends Ci{constructor(e,t){super(e),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(r=>{r.innerHTML=t[r.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(e,t){super.selectItem(e,t);const r=e||this.defaultItem;if(r!=null){if(this.label.innerHTML===r.innerHTML)return;this.label.innerHTML=r.innerHTML}}}const Yv=n=>{const{overflowY:e}=getComputedStyle(n,null);return e!=="visible"&&e!=="clip"};class rc{constructor(e,t){this.quill=e,this.boundsContainer=t||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,Yv(this.quill.root)&&this.quill.root.addEventListener("scroll",()=>{this.root.style.marginTop=`${-1*this.quill.root.scrollTop}px`}),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(e){const t=e.left+e.width/2-this.root.offsetWidth/2,r=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${t}px`,this.root.style.top=`${r}px`,this.root.classList.remove("ql-flip");const s=this.boundsContainer.getBoundingClientRect(),a=this.root.getBoundingClientRect();let l=0;if(a.right>s.right&&(l=s.right-a.right,this.root.style.left=`${t+l}px`),a.left<s.left&&(l=s.left-a.left,this.root.style.left=`${t+l}px`),a.bottom>s.bottom){const o=a.bottom-a.top,u=e.bottom-e.top+o;this.root.style.top=`${r-u}px`,this.root.classList.add("ql-flip")}return l}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const Xv=[!1,"center","right","justify"],Jv=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],Qv=[!1,"serif","monospace"],ey=["1","2","3",!1],ty=["small",!1,"large","huge"];class jr extends or{constructor(e,t){super(e,t);const r=s=>{if(!document.body.contains(e.root)){document.body.removeEventListener("click",r);return}this.tooltip!=null&&!this.tooltip.root.contains(s.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach(a=>{a.container.contains(s.target)||a.close()})};e.emitter.listenDOM("click",document.body,r)}addModule(e){const t=super.addModule(e);return e==="toolbar"&&this.extendToolbar(t),t}buildButtons(e,t){Array.from(e).forEach(r=>{(r.getAttribute("class")||"").split(/\s+/).forEach(a=>{if(a.startsWith("ql-")&&(a=a.slice(3),t[a]!=null))if(a==="direction")r.innerHTML=t[a][""]+t[a].rtl;else if(typeof t[a]=="string")r.innerHTML=t[a];else{const l=r.value||"";l!=null&&t[a][l]&&(r.innerHTML=t[a][l])}})})}buildPickers(e,t){this.pickers=Array.from(e).map(s=>{if(s.classList.contains("ql-align")&&(s.querySelector("option")==null&&xr(s,Xv),typeof t.align=="object"))return new nc(s,t.align);if(s.classList.contains("ql-background")||s.classList.contains("ql-color")){const a=s.classList.contains("ql-background")?"background":"color";return s.querySelector("option")==null&&xr(s,Jv,a==="background"?"#ffffff":"#000000"),new tc(s,t[a])}return s.querySelector("option")==null&&(s.classList.contains("ql-font")?xr(s,Qv):s.classList.contains("ql-header")?xr(s,ey):s.classList.contains("ql-size")&&xr(s,ty)),new Ci(s)});const r=()=>{this.pickers.forEach(s=>{s.update()})};this.quill.on(X.events.EDITOR_CHANGE,r)}}jr.DEFAULTS=gn({},or.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let n=this.container.querySelector("input.ql-image[type=file]");n==null&&(n=document.createElement("input"),n.setAttribute("type","file"),n.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),n.classList.add("ql-image"),n.addEventListener("change",()=>{const e=this.quill.getSelection(!0);this.quill.uploader.upload(e,n.files),n.value=""}),this.container.appendChild(n)),n.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class ic extends rc{constructor(e,t){super(e,t),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",e=>{e.key==="Enter"?(this.save(),e.preventDefault()):e.key==="Escape"&&(this.cancel(),e.preventDefault())})}cancel(){this.hide(),this.restoreFocus()}edit(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),this.textbox==null)return;t!=null?this.textbox.value=t:e!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const r=this.quill.getBounds(this.quill.selection.savedRange);r!=null&&this.position(r),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${e}`)||""),this.root.setAttribute("data-mode",e)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:e}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{const{scrollTop:t}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",e,X.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,X.sources.USER)),this.quill.root.scrollTop=t;break}case"video":e=ny(e);case"formula":{if(!e)break;const t=this.quill.getSelection(!0);if(t!=null){const r=t.index+t.length;this.quill.insertEmbed(r,this.root.getAttribute("data-mode"),e,X.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(r+1," ",X.sources.USER),this.quill.setSelection(r+2,X.sources.USER)}break}}this.textbox.value="",this.hide()}}function ny(n){let e=n.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||n.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return e?`${e[1]||"https"}://www.youtube.com/embed/${e[2]}?showinfo=0`:(e=n.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${e[1]||"https"}://player.vimeo.com/video/${e[2]}/`:n}function xr(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;e.forEach(r=>{const s=document.createElement("option");r===t?s.setAttribute("selected","selected"):s.setAttribute("value",String(r)),n.appendChild(s)})}const ry=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class iy extends ic{static TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join("");constructor(e,t){super(e,t),this.quill.on(X.events.EDITOR_CHANGE,(r,s,a,l)=>{if(r===X.events.SELECTION_CHANGE)if(s!=null&&s.length>0&&l===X.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const o=this.quill.getLines(s.index,s.length);if(o.length===1){const u=this.quill.getBounds(s);u!=null&&this.position(u)}else{const u=o[o.length-1],h=this.quill.getIndex(u),m=Math.min(u.length()-1,s.index+s.length-h),p=this.quill.getBounds(new On(h,m));p!=null&&this.position(p)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()})}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",()=>{this.root.classList.remove("ql-editing")}),this.quill.on(X.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains("ql-hidden"))return;const e=this.quill.getSelection();if(e!=null){const t=this.quill.getBounds(e);t!=null&&this.position(t)}},1)})}cancel(){this.show()}position(e){const t=super.position(e),r=this.root.querySelector(".ql-tooltip-arrow");return r.style.marginLeft="",t!==0&&(r.style.marginLeft=`${-1*t-r.offsetWidth/2}px`),t}}class sc extends jr{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=ry),super(e,t),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new iy(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),Mr),this.buildPickers(e.container.querySelectorAll("select"),Mr))}}sc.DEFAULTS=gn({},jr.DEFAULTS,{modules:{toolbar:{handlers:{link(n){n?this.quill.theme.tooltip.edit():this.quill.format("link",!1,V.sources.USER)}}}}});const sy=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class ay extends ic{static TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join("");preview=this.root.querySelector("a.ql-preview");listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",e=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),e.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",e=>{if(this.linkRange!=null){const t=this.linkRange;this.restoreFocus(),this.quill.formatText(t,"link",!1,X.sources.USER),delete this.linkRange}e.preventDefault(),this.hide()}),this.quill.on(X.events.SELECTION_CHANGE,(e,t,r)=>{if(e!=null){if(e.length===0&&r===X.sources.USER){const[s,a]=this.quill.scroll.descendant(vi,e.index);if(s!=null){this.linkRange=new On(e.index-a,s.length());const l=vi.formats(s.domNode);this.preview.textContent=l,this.preview.setAttribute("href",l),this.show();const o=this.quill.getBounds(this.linkRange);o!=null&&this.position(o);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}class ac extends jr{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=sy),super(e,t),this.quill.container.classList.add("ql-snow")}extendToolbar(e){e.container!=null&&(e.container.classList.add("ql-snow"),this.buildButtons(e.container.querySelectorAll("button"),Mr),this.buildPickers(e.container.querySelectorAll("select"),Mr),this.tooltip=new ay(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(t,r)=>{e.handlers.link.call(e,!r.format.link)}))}}ac.DEFAULTS=gn({},jr.DEFAULTS,{modules:{toolbar:{handlers:{link(n){if(n){const e=this.quill.getSelection();if(e==null||e.length===0)return;let t=this.quill.getText(e);/^\S+@\S+\.\S+$/.test(t)&&t.indexOf("mailto:")!==0&&(t=`mailto:${t}`);const{tooltip:r}=this.quill.theme;r.edit("link",t)}else this.quill.format("link",!1,V.sources.USER)}}}}});V.register({"attributors/attribute/direction":Uo,"attributors/class/align":jo,"attributors/class/background":d1,"attributors/class/color":u1,"attributors/class/direction":zo,"attributors/class/font":Go,"attributors/class/size":Zo,"attributors/style/align":Po,"attributors/style/background":ra,"attributors/style/color":na,"attributors/style/direction":Ho,"attributors/style/font":Wo,"attributors/style/size":Yo},!0);V.register({"formats/align":jo,"formats/direction":zo,"formats/indent":rv,"formats/background":ra,"formats/color":na,"formats/font":Go,"formats/size":Zo,"formats/blockquote":iv,"formats/code-block":Ge,"formats/header":sv,"formats/list":_r,"formats/bold":oa,"formats/code":ia,"formats/italic":av,"formats/link":vi,"formats/script":lv,"formats/strike":ov,"formats/underline":cv,"formats/formula":uv,"formats/image":dv,"formats/video":hv,"modules/syntax":ec,"modules/table":mv,"modules/toolbar":ua,"themes/bubble":sc,"themes/snow":ac,"ui/icons":Mr,"ui/picker":Ci,"ui/icon-picker":nc,"ui/color-picker":tc,"ui/tooltip":rc},!0);const ly=["for"],oy=["id"],cy={class:"ql-formats"},uy={key:0,viewBox:"0 0 18 18"},dy={key:1,viewBox:"0 0 18 18"},hy=["id"],fy={key:1,class:"error-message"},my=i.defineComponent({__name:"TextAreaQuill",props:{id:{default:ke()},label:{},placeholder:{},modelValue:{},error:{},disabled:{type:Boolean},lang:{},validate:{}},emits:["update:modelValue","push:error","remove:error"],setup(n,{emit:e}){const t=n,r=e;let s=null;const a=i.ref(!1),l=()=>{a.value=!a.value};i.watch(a,d=>{d?document.body.style.overflow="hidden":document.body.style.overflow=""});const u=i.inject("TableComponents",{labels:i.ref(Ne[t.lang??"en"])}).labels,h=i.computed(()=>t.placeholder??u.value.placeholder?.richText??"Write content here..."),m=i.computed(()=>{if(t.validate){const d=t.validate,f=[];return d.minLength&&f.push(z("textMinLength",{min:String(d.minLength)},t.lang??"en")),d.maxLength&&f.push(z("textMaxLength",{max:String(d.maxLength)},t.lang??"en")),f.join(`
|
|
62
|
-
`)}return""}),p=i.ref([]);return i.watch(()=>({val:t.modelValue,disabled:t.disabled,validate:t.validate}),({val:d,disabled:f,validate:b})=>{if(f){p.value=[],r("remove:error",t.id);return}const y=[],E=String(d??"").replace(/<[^>]*>?/gm,"").trim();if(b){const{minLength:x,maxLength:S}=b;x!==void 0&&E.length<x&&E.length!==0&&y.push(z("textMinLength",{min:String(x)},t.lang??"en")),S!==void 0&&E.length>S&&y.push(z("textMaxLength",{max:String(S)},t.lang??"en"))}p.value=y,y.length?r("push:error",y,t.id):r("remove:error",t.id)},{deep:!0}),i.onMounted(()=>{const d=document.getElementById(`editor-container-${t.id}`);if(!d){console.error(`Editor container with ID editor-container-${t.id} not found`);return}s=new V(d,{modules:{toolbar:`#toolbar-container-${t.id}`},placeholder:h.value,theme:"snow",readOnly:t.disabled??!1}),t.modelValue&&(s.root.innerHTML=t.modelValue),s.on("text-change",()=>{r("update:modelValue",s.root.innerHTML,t.id)})}),i.watch(()=>t.disabled,d=>{s&&s.enable(!d)}),(d,f)=>(i.openBlock(),i.createBlock(i.Teleport,{to:"body",disabled:!a.value},[i.createElementVNode("div",{class:i.normalizeClass(["rich-text-editor-wrapper",{"editor-maximized":a.value}])},[i.createElementVNode("label",{for:n.id,class:i.normalizeClass(["quill-label",{"has-error":p.value.length!==0||n.error}])},[i.createTextVNode(i.toDisplayString(n.label)+" ",1),m.value?(i.openBlock(),i.createBlock(i.unref(Ye),{key:0,text:m.value,as:"strong"},{default:i.withCtx(()=>[...f[0]||(f[0]=[i.createTextVNode(" ❓",-1)])]),_:1},8,["text"])):i.createCommentVNode("",!0)],10,ly),i.createElementVNode("div",{id:`toolbar-container-${n.id}`,class:"quill-toolbar"},[f[3]||(f[3]=i.createElementVNode("span",{class:"ql-formats"},[i.createElementVNode("select",{class:"ql-font"}),i.createElementVNode("select",{class:"ql-size"})],-1)),f[4]||(f[4]=i.createElementVNode("span",{class:"ql-formats"},[i.createElementVNode("button",{class:"ql-bold"}),i.createElementVNode("button",{class:"ql-italic"}),i.createElementVNode("button",{class:"ql-underline"}),i.createElementVNode("button",{class:"ql-strike"})],-1)),f[5]||(f[5]=i.createElementVNode("span",{class:"ql-formats"},[i.createElementVNode("select",{class:"ql-color"}),i.createElementVNode("select",{class:"ql-background"})],-1)),f[6]||(f[6]=i.createElementVNode("span",{class:"ql-formats"},[i.createElementVNode("button",{class:"ql-script",value:"sub"}),i.createElementVNode("button",{class:"ql-script",value:"super"})],-1)),f[7]||(f[7]=i.createElementVNode("span",{class:"ql-formats"},[i.createElementVNode("button",{class:"ql-header",value:"1"}),i.createElementVNode("button",{class:"ql-header",value:"2"}),i.createElementVNode("button",{class:"ql-blockquote"}),i.createElementVNode("button",{class:"ql-code-block"})],-1)),f[8]||(f[8]=i.createElementVNode("span",{class:"ql-formats"},[i.createElementVNode("button",{class:"ql-list",value:"ordered"}),i.createElementVNode("button",{class:"ql-list",value:"bullet"}),i.createElementVNode("button",{class:"ql-indent",value:"-1"}),i.createElementVNode("button",{class:"ql-indent",value:"+1"})],-1)),f[9]||(f[9]=i.createElementVNode("span",{class:"ql-formats"},[i.createElementVNode("button",{class:"ql-direction",value:"rtl"}),i.createElementVNode("select",{class:"ql-align"})],-1)),i.createElementVNode("span",cy,[i.createElementVNode("button",{onClick:l,class:"maximize-button"},[a.value?(i.openBlock(),i.createElementBlock("svg",dy,[...f[2]||(f[2]=[i.createElementVNode("rect",{class:"ql-stroke",x:"5",y:"5",width:"8",height:"8"},null,-1),i.createElementVNode("polyline",{class:"ql-stroke",points:"15 3 10 8"},null,-1),i.createElementVNode("polyline",{class:"ql-stroke",points:"3 15 8 10"},null,-1)])])):(i.openBlock(),i.createElementBlock("svg",uy,[...f[1]||(f[1]=[i.createElementVNode("rect",{class:"ql-stroke",x:"3",y:"3",width:"12",height:"12"},null,-1),i.createElementVNode("rect",{class:"ql-stroke",x:"10",y:"10",width:"1",height:"1"},null,-1),i.createElementVNode("rect",{class:"ql-stroke",x:"7",y:"10",width:"1",height:"1"},null,-1),i.createElementVNode("rect",{class:"ql-stroke",x:"10",y:"7",width:"1",height:"1"},null,-1),i.createElementVNode("rect",{class:"ql-stroke",x:"7",y:"7",width:"1",height:"1"},null,-1)])]))])])],8,oy),i.createElementVNode("div",{id:`editor-container-${n.id}`,class:i.normalizeClass(["quill-editor-container",{"has-error":n.error}])},null,10,hy),p.value.length!==0?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(p.value,(b,y)=>(i.openBlock(),i.createElementBlock("p",{key:y,class:"error-message"},i.toDisplayString(b),1))),128)):i.createCommentVNode("",!0),typeof t.error=="string"&&p.value.length===0?(i.openBlock(),i.createElementBlock("p",fy,i.toDisplayString(n.error),1)):i.createCommentVNode("",!0)],2)],8,["disabled"]))}}),lc=we(my,[["__scopeId","data-v-fd6a4bec"]]),py={class:"text-input-wrapper"},gy=["for"],by=["id","value","disabled","placeholder"],vy={key:1,class:"error-message"},yy=i.defineComponent({__name:"TextInput",props:{id:{default:ke()},label:{},placeholder:{},modelValue:{},error:{},disabled:{type:Boolean},validate:{},lang:{}},emits:["update:modelValue","push:error","remove:error"],setup(n,{emit:e}){const t=n,r=String(t.modelValue??""),a=i.inject("TableComponents",{labels:i.ref(Ne[t.lang??"en"])}).labels,l=e,o=i.computed(()=>{if(t.validate){const p=t.validate,d=[];return Array.isArray(p.duplicate)&&d.push(z("valueList",{value:p.duplicate.join(", ")},t.lang??"en")),p.minLength&&d.push(z("textMinLength",{min:String(p.minLength)},t.lang??"en")),p.maxLength&&d.push(z("textMaxLength",{max:String(p.maxLength)},t.lang??"en")),p.pattern&&d.push(z("textPattern")),d.join(`
|
|
63
|
-
`)}return""}),u=i.ref([]);i.watch(()=>({val:t.modelValue,disabled:t.disabled,validate:t.validate}),({val:p,disabled:d,validate:f})=>{if(d){u.value=[];return}const b=[],y=String(p??"");if(f){if(Array.isArray(f.duplicate)&&f.duplicate.length>0){const E=f.duplicate.map(String).includes(y),x=String(r)===y;E&&!x&&b.push(z("valueList",{value:y},t.lang??"en"))}f.minLength!==void 0&&y.length<f.minLength&&b.push(z("textMinLength",{min:String(f.minLength)},t.lang??"en")),f.maxLength!==void 0&&y.length>f.maxLength&&b.push(z("textMaxLength",{max:String(f.maxLength)},t.lang??"en")),f.pattern&&(new RegExp(f.pattern).test(y)||b.push(z("textPattern")))}u.value=b,b.length?l("push:error",b,t.id):l("remove:error",t.id)},{deep:!0});const h=i.computed(()=>t.placeholder??a?.value?.placeholder?.string??"");function m(p){if(t.disabled)return;const d=p.target;l("update:modelValue",d.value,t.id)}return(p,d)=>(i.openBlock(),i.createElementBlock("div",py,[i.createElementVNode("label",{for:n.id,class:i.normalizeClass(["text-label",{"has-error":u.value.length!==0||n.error}])},[i.createTextVNode(i.toDisplayString(n.label)+" ",1),o.value?(i.openBlock(),i.createBlock(i.unref(Ye),{key:0,text:o.value,as:"strong"},{default:i.withCtx(()=>[...d[0]||(d[0]=[i.createTextVNode(" ❓",-1)])]),_:1},8,["text"])):i.createCommentVNode("",!0)],10,gy),i.createElementVNode("input",{id:n.id,type:"text",value:n.modelValue,disabled:n.disabled,onInput:m,placeholder:h.value,class:i.normalizeClass(["text-input",{"has-error":u.value.length!==0||n.error}])},null,42,by),u.value.length!==0?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(u.value,(f,b)=>(i.openBlock(),i.createElementBlock("p",{key:b,class:"error-message"},i.toDisplayString(f),1))),128)):i.createCommentVNode("",!0),typeof t.error=="string"&&u.value.length===0?(i.openBlock(),i.createElementBlock("p",vy,i.toDisplayString(n.error),1)):i.createCommentVNode("",!0)]))}}),oc=we(yy,[["__scopeId","data-v-f0c552df"]]),Ey={class:"time-input-wrapper"},wy=["for"],xy=["id","value","disabled","min","max","placeholder"],Ty={key:0,class:"error-message"},Ay=i.defineComponent({__name:"TimeInput",props:{id:{default:ke()},label:{},placeholder:{},modelValue:{},error:{},disabled:{type:Boolean},validate:{},lang:{}},emits:["update:modelValue","push:error","remove:error"],setup(n,{emit:e}){const t=n,s=i.inject("TableComponents",{labels:i.ref(Ne[t.lang??"en"])}).labels,a=e,l=i.computed(()=>{if(t.validate){const p=t.validate,d=[];return p.minTime&&d.push(z("timeMin",{min:p.minTime},t.lang??"en")),p.maxTime&&d.push(z("timeMax",{max:p.maxTime},t.lang??"en")),d.join(`
|
|
64
|
-
`)}return""}),o=i.ref([]);function u(p){if(!p)return;const[d,f]=p.split(":").map(Number);if(isNaN(d)||isNaN(f))return;const b=new Date;return b.setHours(d,f,0,0),b}i.watch(()=>[t.modelValue,t.disabled,t.validate],([p,d,f])=>{if(d){o.value=[];return}const b=[],y=u(p);if(f&&typeof f=="object"){try{bs(p)}catch(S){o.value=[String(S)],a("push:error",o.value,t.id);return}const E=f.minTime?u(f.minTime):void 0,x=f.maxTime?u(f.maxTime):void 0;E&&y&&y<E&&b.push(z("timeMin",{min:f.minTime??""},t.lang??"en")),x&&y&&y>x&&b.push(z("timeMax",{max:f.maxTime??""},t.lang??"en"))}o.value=b,b.length?a("push:error",b,t.id):a("remove:error",t.id)}),i.onMounted(()=>{if(t.modelValue)try{bs(t.modelValue)}catch(p){o.value=[String(p)],a("push:error",o.value,t.id);return}});const h=i.computed(()=>t.placeholder??s?.value?.placeholder?.time??"");function m(p){if(t.disabled)return;const d=p.target;a("update:modelValue",d.value,t.id)}return(p,d)=>(i.openBlock(),i.createElementBlock("div",Ey,[i.createElementVNode("label",{for:n.id,class:i.normalizeClass(["time-label",{"has-error":o.value.length||n.error}])},[i.createTextVNode(i.toDisplayString(n.label)+" ",1),l.value?(i.openBlock(),i.createBlock(i.unref(Ye),{key:0,text:l.value,as:"strong"},{default:i.withCtx(()=>[...d[0]||(d[0]=[i.createTextVNode(" ❓",-1)])]),_:1},8,["text"])):i.createCommentVNode("",!0)],10,wy),i.createElementVNode("input",{id:n.id,type:"time",value:n.modelValue,disabled:n.disabled,min:t.validate?.minTime,max:t.validate?.maxTime,onInput:m,placeholder:h.value,class:i.normalizeClass(["time-input",{"has-error":o.value.length||n.error}])},null,42,xy),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.value,(f,b)=>(i.openBlock(),i.createElementBlock("p",{key:b,class:"error-message"},i.toDisplayString(f),1))),128)),typeof t.error=="string"&&o.value.length===0?(i.openBlock(),i.createElementBlock("p",Ty,i.toDisplayString(n.error),1)):i.createCommentVNode("",!0)]))}}),cc=we(Ay,[["__scopeId","data-v-cb8d7064"]]),Ny={class:"toggle-wrapper"},ky={class:"toggle-label"},Sy=["disabled"],Cy=i.defineComponent({__name:"ToggleInput",props:{id:{default:ke()},label:{},modelValue:{type:Boolean},disabled:{type:Boolean},lang:{}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,s=i.inject("TableComponents",{labels:i.ref(Ne[t.lang??"en"])}).labels,a=e;function l(){t.disabled||a("update:modelValue",!t.modelValue,t.id)}return(o,u)=>(i.openBlock(),i.createElementBlock("div",Ny,[i.createElementVNode("label",ky,i.toDisplayString(n.label),1),i.createElementVNode("button",{type:"button",onClick:l,disabled:n.disabled,class:i.normalizeClass(["toggle-button",{active:n.modelValue}])},i.toDisplayString(n.modelValue?i.unref(s)?.btn.toogle.active:i.unref(s)?.btn.toogle.inactive),11,Sy)]))}}),uc=we(Cy,[["__scopeId","data-v-0857573f"]]),Ly={class:"url-input-wrapper"},By=["for"],Iy=["id","value","disabled","placeholder"],Oy={key:0,class:"error-message"},Dy=i.defineComponent({__name:"UrlInput",props:{id:{default:ke()},label:{},placeholder:{},modelValue:{},error:{},validate:{type:Boolean},disabled:{type:Boolean},lang:{}},emits:["update:modelValue","push:error","remove:error"],setup(n,{emit:e}){const t=i.ref(void 0),r=i.ref(),s=n,l=i.inject("TableComponents",{labels:i.ref(Ne[s.lang??"en"])}).labels,o=e;function u(h){if(s.disabled)return;const m=h.target;if(o("update:modelValue",m.value,s.id),!m.value){t.value=void 0,o("remove:error",s.id);return}try{new URL(m.value),t.value=void 0,o("remove:error",s.id)}catch{t.value=z("url",{},s.lang??"en"),o("push:error",t.value,s.id)}}return i.watch(()=>s,()=>{r.value=s.error||t.value||""},{deep:!0}),(h,m)=>(i.openBlock(),i.createElementBlock("div",Ly,[i.createElementVNode("label",{for:n.id,class:i.normalizeClass(["url-label",{"has-error":r.value}])},i.toDisplayString(n.label),11,By),i.createElementVNode("input",{id:n.id,type:"text",value:n.modelValue,onInput:u,disabled:n.disabled,class:"url-input",placeholder:n.placeholder??i.unref(l)?.placeholder.url+": https://example.com"},null,40,Iy),r.value?(i.openBlock(),i.createElementBlock("p",Oy,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0)]))}}),dc=we(Dy,[["__scopeId","data-v-b99526fa"]]),Rr=i.defineComponent({__name:"FormFieldRenderer",props:{field:{},fieldKey:{},formData:{},errors:{},isUpdate:{type:Boolean},lang:{}},emits:["update:model-value","push:errors","remove:errors","selected-option-change","multi-selected-change"],setup(n,{emit:e}){const t=n,r=i.ref({...t.formData}),s=i.ref({...t.errors}),a=e;i.watch(()=>t,()=>{r.value={...t.formData},s.value={...t.errors}},{immediate:!0,deep:!0}),i.ref(t.isUpdate?void 0:t.field.value);function l(h){const m=se(r.value,t.fieldKey);return!m&&!t.isUpdate?t.field.value:(t.field.type==="dateTime",m)}const{label:o,handlers:u}=xc(t,a);return(h,m)=>(i.openBlock(),i.createElementBlock("div",null,[n.field.type==="text"?(i.openBlock(),i.createBlock(i.unref(oc),{key:0,id:n.fieldKey,label:i.unref(o),"model-value":l()??"",error:i.unref(se)(s.value,n.fieldKey),disabled:n.field.disabled,validate:n.field.validate,lang:n.lang,placeholder:n.field.placeholder,"onUpdate:modelValue":m[0]||(m[0]=p=>h.$emit("update:model-value",p,n.fieldKey)),"onRemove:error":i.unref(u).removeError,"onPush:error":i.unref(u).pushError},null,8,["id","label","model-value","error","disabled","validate","lang","placeholder","onRemove:error","onPush:error"])):i.createCommentVNode("",!0),n.field.type==="number"?(i.openBlock(),i.createBlock(i.unref(eo),{key:1,id:n.fieldKey,label:i.unref(o),placeholder:n.field.placeholder,"model-value":l()??"",error:i.unref(se)(s.value,n.fieldKey),disabled:n.field.disabled,lang:n.lang,validate:n.field.validate,"onUpdate:modelValue":m[1]||(m[1]=p=>h.$emit("update:model-value",p,n.fieldKey)),"onRemove:error":i.unref(u).removeError,"onPush:error":i.unref(u).pushError},null,8,["id","label","placeholder","model-value","error","disabled","lang","validate","onRemove:error","onPush:error"])):i.createCommentVNode("",!0),n.field.type==="email"?(i.openBlock(),i.createBlock(i.unref(Wl),{key:2,id:n.fieldKey,label:i.unref(o),placeholder:n.field.placeholder,"model-value":l()??"",error:i.unref(se)(s.value,n.fieldKey),disabled:n.field.disabled,validate:n.field.validate,lang:n.lang,"onUpdate:modelValue":m[2]||(m[2]=p=>h.$emit("update:model-value",p,n.fieldKey)),"onRemove:error":i.unref(u).removeError,"onPush:error":i.unref(u).pushError},null,8,["id","label","placeholder","model-value","error","disabled","validate","lang","onRemove:error","onPush:error"])):i.createCommentVNode("",!0),n.field.type==="tag"?(i.openBlock(),i.createBlock(i.unref(ro),{key:3,id:n.fieldKey,label:i.unref(o),placeholder:n.field.placeholder,"model-value":l()??[],error:i.unref(se)(s.value,n.fieldKey),disabled:n.field.disabled,lang:n.lang,validate:n.field.validate,"onUpdate:modelValue":m[3]||(m[3]=p=>h.$emit("update:model-value",p,n.fieldKey))},null,8,["id","label","placeholder","model-value","error","disabled","lang","validate"])):i.createCommentVNode("",!0),n.field.type==="toggle"?(i.openBlock(),i.createBlock(i.unref(uc),{key:4,id:n.fieldKey,label:i.unref(o),"model-value":!!(l()??!1),error:i.unref(se)(s.value,n.fieldKey),disabled:n.field.disabled,lang:n.lang,"onUpdate:modelValue":m[4]||(m[4]=p=>h.$emit("update:model-value",p,n.fieldKey))},null,8,["id","label","model-value","error","disabled","lang"])):i.createCommentVNode("",!0),n.field.type==="url"?(i.openBlock(),i.createBlock(i.unref(dc),{key:5,id:n.fieldKey,label:i.unref(o),placeholder:n.field.placeholder,"model-value":l()??"",error:i.unref(se)(s.value,n.fieldKey),disabled:n.field.disabled,validate:n.field.validate??!0,lang:n.lang,"onUpdate:modelValue":m[5]||(m[5]=p=>h.$emit("update:model-value",p,n.fieldKey)),"onRemove:error":m[6]||(m[6]=p=>i.unref(u).removeError(n.fieldKey)),"onPush:error":m[7]||(m[7]=p=>i.unref(u).pushError(p,n.fieldKey))},null,8,["id","label","placeholder","model-value","error","disabled","validate","lang"])):i.createCommentVNode("",!0),n.field.type==="password"?(i.openBlock(),i.createBlock(i.unref(no),{key:6,id:n.fieldKey,label:i.unref(o),lang:n.lang,placeholder:n.field.placeholder,"model-value":l()??"",error:i.unref(se)(s.value,n.fieldKey),disabled:n.field.disabled,validate:n.field.validate,"onUpdate:modelValue":m[8]||(m[8]=p=>h.$emit("update:model-value",p,n.fieldKey)),"onRemove:error":i.unref(u).removeError,"onPush:error":i.unref(u).pushError},null,8,["id","label","lang","placeholder","model-value","error","disabled","validate","onRemove:error","onPush:error"])):i.createCommentVNode("",!0),n.field.type==="richText"?(i.openBlock(),i.createBlock(i.unref(lc),{key:7,id:n.fieldKey,label:i.unref(o),error:i.unref(se)(s.value,n.fieldKey),"model-value":l()??"",disabled:n.field.disabled,lang:n.lang,validate:n.field.validate,"onUpdate:modelValue":m[9]||(m[9]=p=>h.$emit("update:model-value",p,n.fieldKey)),"onRemove:error":i.unref(u).removeError,"onPush:error":i.unref(u).pushError},null,8,["id","label","error","model-value","disabled","lang","validate","onRemove:error","onPush:error"])):i.createCommentVNode("",!0),n.field.type==="textArea"?(i.openBlock(),i.createBlock(i.unref(io),{key:8,id:n.fieldKey,label:i.unref(o),error:i.unref(se)(s.value,n.fieldKey),"model-value":l()??"",disabled:n.field.disabled,lang:n.lang,validate:n.field.validate,"onUpdate:modelValue":m[10]||(m[10]=p=>h.$emit("update:model-value",p,n.fieldKey)),"onRemove:error":i.unref(u).removeError,"onPush:error":i.unref(u).pushError},null,8,["id","label","error","model-value","disabled","lang","validate","onRemove:error","onPush:error"])):i.createCommentVNode("",!0),n.field.type==="image"?(i.openBlock(),i.createBlock(i.unref(Ql),{key:9,id:n.fieldKey,label:i.unref(o),"model-value":l()??null,disabled:n.field.disabled,"preview-alt":n.fieldKey,"onUpdate:modelValue":m[11]||(m[11]=p=>h.$emit("update:model-value",p,n.fieldKey)),validate:n.field.validate,watermark:n.field.watermark,error:i.unref(se)(s.value,n.fieldKey),"onRemove:error":i.unref(u).removeError,"onPush:error":i.unref(u).pushError,lang:n.lang},null,8,["id","label","model-value","disabled","preview-alt","validate","watermark","error","onRemove:error","onPush:error","lang"])):i.createCommentVNode("",!0),n.field.type==="imageArray"?(i.openBlock(),i.createBlock(i.unref(Jl),{key:10,id:n.fieldKey,label:i.unref(o),"model-value":l()??[],disabled:n.field.disabled,"preview-alt":n.fieldKey,"onUpdate:modelValue":m[12]||(m[12]=p=>h.$emit("update:model-value",p,n.fieldKey)),validate:n.field.validate,watermark:n.field.watermark,error:i.unref(se)(s.value,n.fieldKey),"onRemove:error":i.unref(u).removeError,"onPush:error":i.unref(u).pushError,lang:n.lang},null,8,["id","label","model-value","disabled","preview-alt","validate","watermark","error","onRemove:error","onPush:error","lang"])):i.createCommentVNode("",!0),n.field.type==="file"?(i.openBlock(),i.createBlock(i.unref(Yl),{key:11,id:n.fieldKey,label:i.unref(o),"model-value":l()??null,disabled:n.field.disabled,"preview-alt":n.fieldKey,"onUpdate:modelValue":m[13]||(m[13]=p=>h.$emit("update:model-value",p,n.fieldKey)),validate:n.field.validate,error:i.unref(se)(s.value,n.fieldKey),"onRemove:error":i.unref(u).removeError,"onPush:error":i.unref(u).pushError,lang:n.lang},null,8,["id","label","model-value","disabled","preview-alt","validate","error","onRemove:error","onPush:error","lang"])):i.createCommentVNode("",!0),n.field.type==="fileArray"?(i.openBlock(),i.createBlock(i.unref(Zl),{key:12,id:n.fieldKey,label:i.unref(o),"model-value":l()??null,disabled:n.field.disabled,"preview-alt":n.fieldKey,"onUpdate:modelValue":m[14]||(m[14]=p=>h.$emit("update:model-value",p,n.fieldKey)),validate:n.field.validate,error:i.unref(se)(s.value,n.fieldKey),"onRemove:error":i.unref(u).removeError,"onPush:error":i.unref(u).pushError,lang:n.lang},null,8,["id","label","model-value","disabled","preview-alt","validate","error","onRemove:error","onPush:error","lang"])):i.createCommentVNode("",!0),n.field.type==="color"?(i.openBlock(),i.createBlock(i.unref(Ul),{key:13,id:n.fieldKey,label:i.unref(o),"model-value":n.field.single?l()??"":l()??[],"onUpdate:modelValue":m[15]||(m[15]=p=>h.$emit("update:model-value",p,n.fieldKey)),error:i.unref(se)(s.value,n.fieldKey),disabled:n.field.disabled,validate:n.field.validate,single:n.field.single,lang:n.lang},null,8,["id","label","model-value","error","disabled","validate","single","lang"])):i.createCommentVNode("",!0),n.field.type==="select"?(i.openBlock(),i.createBlock(i.unref(Hl),{key:14,id:n.fieldKey,label:i.unref(o),options:n.field.options,"options-view":n.field.optionsView||n.field.options,type:n.field.type,error:i.unref(se)(s.value,n.fieldKey),required:n.field.required,disabled:n.field.disabled,"model-value":l(),"with-create":n.field.withCreate,"onUpdate:modelValue":m[16]||(m[16]=p=>h.$emit("update:model-value",p,n.fieldKey)),lang:n.lang},null,8,["id","label","options","options-view","type","error","required","disabled","model-value","with-create","lang"])):i.createCommentVNode("",!0),n.field.type==="object"?(i.openBlock(),i.createBlock(i.unref(to),{key:15,id:n.fieldKey,label:i.unref(o),schema:n.field.schema,"form-data":i.unref(se)(r.value,n.fieldKey)??{},errors:i.unref(se)(s.value,n.fieldKey)??{},disabled:n.field.disabled,lang:n.lang,"onUpdate:modelValue":m[17]||(m[17]=(p,d)=>h.$emit("update:model-value",p,d)),"onRemove:errors":m[18]||(m[18]=p=>i.unref(u).removeError(p)),"onPush:errors":m[19]||(m[19]=(p,d)=>i.unref(u).pushError(p,d)),onMultiSelectedChange:m[20]||(m[20]=(p,d)=>h.$emit("multi-selected-change",p,d)),onSelectedOptionChange:m[21]||(m[21]=(p,d)=>h.$emit("selected-option-change",p,d))},null,8,["id","label","schema","form-data","errors","disabled","lang"])):i.createCommentVNode("",!0),n.field.type==="arrayObject"?(i.openBlock(),i.createBlock(i.unref(Fl),{key:16,id:n.fieldKey,label:i.unref(o),"model-value":l()??[],schema:n.field.schema,disabled:n.field.disabled,error:i.unref(se)(s.value,n.fieldKey),lang:n.lang,"onUpdate:modelValue":m[22]||(m[22]=p=>h.$emit("update:model-value",p,n.fieldKey))},null,8,["id","label","model-value","schema","disabled","error","lang"])):i.createCommentVNode("",!0),n.field.type==="date"?(i.openBlock(),i.createBlock(i.unref(Kl),{key:17,id:n.fieldKey,label:i.unref(o),"model-value":l(),error:i.unref(se)(s.value,n.fieldKey),disabled:n.field.disabled,placeholder:n.field.placeholder,validate:n.field.validate,lang:n.lang,"onUpdate:modelValue":m[23]||(m[23]=p=>h.$emit("update:model-value",p,n.fieldKey)),"onRemove:error":i.unref(u).removeError,"onPush:error":i.unref(u).pushError},null,8,["id","label","model-value","error","disabled","placeholder","validate","lang","onRemove:error","onPush:error"])):i.createCommentVNode("",!0),n.field.type==="time"?(i.openBlock(),i.createBlock(i.unref(cc),{key:18,id:n.fieldKey,label:i.unref(o),"model-value":l(),error:i.unref(se)(s.value,n.fieldKey),disabled:n.field.disabled,placeholder:n.field.placeholder,validate:n.field.validate,lang:n.lang,"onUpdate:modelValue":m[24]||(m[24]=p=>h.$emit("update:model-value",p,n.fieldKey)),"onRemove:error":i.unref(u).removeError,"onPush:error":i.unref(u).pushError},null,8,["id","label","model-value","error","disabled","placeholder","validate","lang","onRemove:error","onPush:error"])):i.createCommentVNode("",!0),n.field.type==="dateTime"?(i.openBlock(),i.createBlock(i.unref(Gl),{key:19,id:n.fieldKey,label:i.unref(o),"model-value":l(),error:i.unref(se)(s.value,n.fieldKey),disabled:n.field.disabled,placeholder:n.field.placeholder,validate:n.field.validate,"output-format":n.field.outputFormat,lang:n.lang,"onUpdate:modelValue":m[25]||(m[25]=p=>h.$emit("update:model-value",p,n.fieldKey)),"onRemove:error":i.unref(u).removeError,"onPush:error":i.unref(u).pushError},null,8,["id","label","model-value","error","disabled","placeholder","validate","output-format","lang","onRemove:error","onPush:error"])):i.createCommentVNode("",!0),n.field.type==="optionGroupSchema"?(i.openBlock(),i.createBlock(i.unref(Xl),{key:20,id:n.fieldKey,label:i.unref(o),"type-design":n.field.typeDesign,options:n.field.options,"options-labels":n.field.optionsLabels,required:n.field.required,disabled:n.field.disabled,"form-data":r.value,errors:s.value,error:i.unref(se)(s.value,n.fieldKey),"with-value":n.field.withValue,onMultiSelectedChange:m[26]||(m[26]=(p,d)=>h.$emit("multi-selected-change",p,d)),onSelectedOptionChange:m[27]||(m[27]=(p,d)=>h.$emit("selected-option-change",p,d)),"onUpdate:modelValue":m[28]||(m[28]=(p,d)=>h.$emit("update:model-value",p,d)),"onRemove:error":i.unref(u).removeError,"onPush:error":i.unref(u).pushError},null,8,["id","label","type-design","options","options-labels","required","disabled","form-data","errors","error","with-value","onRemove:error","onPush:error"])):i.createCommentVNode("",!0)]))}});let Vs=[],$s=[],Ei="MyAppDB",Nl=1;const Me={single:new Set,array:new Set};let _s=!1;function hc(n){_s||(_s=!0,Ei=n.dbName||Ei,Nl=n.dbVersion||Nl,Vs=n.storeSingle||[],$s=n.storeArray||[],Vs.forEach(e=>Me.single.add(e)),$s.forEach(e=>Me.array.add(e)))}function js(n){return Me.array.has(n)}async function wn(n=[]){_s||hc({}),n.forEach(My);const e=await new Promise((l,o)=>{const u=indexedDB.open(Ei);u.onsuccess=()=>l(u.result),u.onerror=()=>o(u.error)}),t=new Set(Array.from(e.objectStoreNames)),r=new Set([...Me.single,...Me.array]);let s=!1;for(const l of r)if(!t.has(l)){s=!0;break}if(!s)return e;const a=e.version;return e.close(),new Promise((l,o)=>{const u=indexedDB.open(Ei,a+1);u.onupgradeneeded=h=>{const m=h.target.result,p=new Set(Array.from(m.objectStoreNames));Me.single.forEach(d=>{p.has(d)||m.createObjectStore(d)}),Me.array.forEach(d=>{p.has(d)||m.createObjectStore(d,{keyPath:"id"})})},u.onsuccess=()=>l(u.result),u.onerror=()=>o(u.error)})}function My(n){const e=Vs.includes(n)||Me.single.has(n),t=$s.includes(n)||Me.array.has(n);!e&&!t&&Me.array.add(n)}async function di(n){const e=Object.keys(n),t=await wn(e),r=t.transaction(Array.from(t.objectStoreNames),"readwrite");for(const s of e)if(Me.single.has(s)&&n[s]!==void 0)r.objectStore(s).put(n[s],"current");else if(Me.array.has(s)&&Array.isArray(n[s])){const a=r.objectStore(s);a.clear(),n[s].forEach(l=>a.put(l))}return new Promise((s,a)=>{r.oncomplete=()=>s(),r.onerror=()=>a(r.error)})}async function Ry(n,e="current"){Me.single.add(n);const t=await wn([n]);if(!t.objectStoreNames.contains(n))return;const s=t.transaction(n,"readonly").objectStore(n);return new Promise((a,l)=>{const o=s.get(e);o.onsuccess=()=>a(o.result),o.onerror=()=>l(o.error)})}async function fc(n){Me.array.add(n);const e=await wn([n]);if(!e.objectStoreNames.contains(n))return[];const r=e.transaction(n,"readonly").objectStore(n);return new Promise((s,a)=>{const l=r.getAll();l.onsuccess=()=>s(l.result||[]),l.onerror=()=>a(l.error)})}async function mc(n,e){Me.array.add(n);const r=(await wn([n])).transaction(n,"readwrite");return r.objectStore(n).put(e),new Promise((a,l)=>{r.oncomplete=()=>a(),r.onerror=()=>l(r.error)})}async function qy(n,e){Me.array.add(n);const t=await wn([n]);if(!t.objectStoreNames.contains(n))return;const s=t.transaction(n,"readonly").objectStore(n);return new Promise((a,l)=>{const o=s.get(e);o.onsuccess=()=>a(o.result),o.onerror=()=>l(o.error)})}async function Vy(n){const e=await wn([n]);if(!e.objectStoreNames.contains(n))return;const t=e.transaction(n,"readwrite");return t.objectStore(n).clear(),new Promise((r,s)=>{t.oncomplete=()=>r(),t.onerror=()=>s(t.error)})}async function $y(n,e){Me.array.add(n);const t=await wn([n]);if(!t.objectStoreNames.contains(n)){console.warn(`Store "${n}" not found. Skipping delete operation.`);return}const r=t.transaction(n,"readwrite");return r.objectStore(n).delete(e),new Promise((s,a)=>{r.oncomplete=()=>s(),r.onerror=()=>a(r.error)})}async function pc(n){const e=Object.keys(n);if(e.length===0)return;e.forEach(a=>Me.array.add(a));const t=await wn(e),r=e.filter(a=>t.objectStoreNames.contains(a));if(r.length===0)return;const s=t.transaction(r,"readwrite");for(const[a,l]of Object.entries(n)){if(!r.includes(a))continue;const o=s.objectStore(a);(Array.isArray(l)?l:[l]).forEach(h=>o.delete(h))}return new Promise((a,l)=>{s.oncomplete=()=>a(),s.onerror=()=>l(s.error)})}async function hi(n,e={}){const{authType:t="cookie",token:r,customHeaders:s,...a}=e,l=new Headers(a.headers||{});if(t==="bearer"&&r)l.set("Authorization",`Bearer ${r}`);else if(t==="custom"&&s)for(const[u,h]of Object.entries(s))l.set(u,h);const o=await fetch(n,{...a,headers:l,credentials:t==="cookie"?"include":"omit"});if(!o.ok){let u=null;try{u=await o.json()}catch{u=null}const h={status:o.status,message:u?.message??u?.error??u?.errors??o.statusText??"Unknown error"};return Promise.reject(h)}return o}exports.ArrayObjectInput=Fl;exports.ColorInput=Ul;exports.DATETIME_REGEX=Rl;exports.DATE_REGEX=Dl;exports.DateInput=Kl;exports.DateTimeInput=Gl;exports.EmailInput=Wl;exports.FileArrayInput=Zl;exports.FileInput=Yl;exports.FormModal=Fs;exports.GroupRendererInput=Xl;exports.ImageArrayInput=Jl;exports.ImageInput=Ql;exports.Loader=Pl;exports.NumberInput=eo;exports.ObjectInput=to;exports.PasswordInput=no;exports.SelectedOptions=Hl;exports.TIME_REGEX=Ml;exports.TagInput=ro;exports.TextAreaInput=io;exports.TextAreaQuillInput=lc;exports.TextInput=oc;exports.TimeInput=cc;exports.ToggleInput=uc;exports.Tooltip=Ye;exports.UrlInput=dc;exports._export_sfc=we;exports._sfc_main=Rr;exports.clearStore=Vy;exports.configureIndexedDB=hc;exports.defaultMessagesErrorRequired=Ps;exports.defaultTextLabelsMap=Ne;exports.deleteItemFromStore=$y;exports.deleteNestedAndCleanup=Il;exports.emailRegex=Ol;exports.gcd=Sl;exports.getCommonRatio=Cl;exports.getFromIndexedDB=fc;exports.getItemById=qy;exports.getMessage=z;exports.getNested=se;exports.getSingleFromIndexedDB=Ry;exports.hasAnyError=ps;exports.inputMessages=er;exports.isEqual=Cr;exports.isSameMessage=Ll;exports.isStoreArray=js;exports.normalizeKey=gs;exports.purify=uu;exports.registerErrorMessageRequired=Nc;exports.registerInputMessages=kc;exports.registerLanguage=Ac;exports.removeFromIndexedDB=pc;exports.safeValidate=Ku;exports.saveToIndexedDB=di;exports.secureFetch=hi;exports.setNested=ut;exports.setUID=ke;exports.simplifyRatio=ir;exports.submitData=zl;exports.toDateOnly=hn;exports.toDateTimeString=Tc;exports.toTimeOnly=bs;exports.unsetNested=Bl;exports.updateItemInStore=mc;exports.validate=Es;
|