inertia-bootstrap-forms 1.0.61 → 1.0.63

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.
@@ -13116,9 +13116,15 @@ const O0 = {
13116
13116
  i.errorHandler ? i.errorHandler(h) : u(h.message), n("restriction-failed", d, h);
13117
13117
  }), sn(() => {
13118
13118
  let d;
13119
- i.useXHR && import("./index-BNTFmIVu.js").then((h) => {
13119
+ i.useXHR && import("./index-BcKW1G-4.js").then((h) => {
13120
13120
  d = h.default, s.value.use(d, {
13121
13121
  endpoint: i.url,
13122
+ formData: !0,
13123
+ headers: {
13124
+ Accept: "application/json",
13125
+ "X-Requested-With": "XMLHttpRequest"
13126
+ // این هدر به لاراول کمک میکند درخواست را AJAX تشخیص دهد
13127
+ },
13122
13128
  ...i.XHRConfig
13123
13129
  });
13124
13130
  });
@@ -5,7 +5,7 @@ var et = (i) => {
5
5
  var ct = (i, e, t) => e in i ? pt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
6
6
  var y = (i, e, t) => ct(i, typeof e != "symbol" ? e + "" : e, t), G = (i, e, t) => e.has(i) || et("Cannot " + t);
7
7
  var r = (i, e, t) => (G(i, e, "read from private field"), t ? t.call(i) : e.get(i)), m = (i, e, t) => e.has(i) ? et("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(i) : e.set(i, t), c = (i, e, t, s) => (G(i, e, "write to private field"), s ? s.call(i, t) : e.set(i, t), t), g = (i, e, t) => (G(i, e, "access private method"), t);
8
- import { T as mt } from "./index-Cr0ZhLal.js";
8
+ import { T as mt } from "./index-BON97lSo.js";
9
9
  class K extends Error {
10
10
  constructor(t, s = null) {
11
11
  super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall.");
@@ -1,4 +1,4 @@
1
- import { A as n, C as s, a as u, b as p, c as o, _ as e, d as I, E as i, F as r, f as l, m as c, G as m, L as b, M as S, h as C, g as d, P as x, Q as g, R as h, j as k, l as y, S as F, k as P, i as T, n as A, o as B, p as E, e as L } from "./index-Cr0ZhLal.js";
1
+ import { A as n, C as s, a as u, b as p, c as o, _ as e, d as I, E as i, F as r, f as l, m as c, G as m, L as b, M as S, h as C, g as d, P as x, Q as g, R as h, j as k, l as y, S as F, k as P, i as T, n as A, o as B, p as E, e as L } from "./index-BON97lSo.js";
2
2
  export {
3
3
  n as AmountInput,
4
4
  s as CaptchaInput,
@@ -16,4 +16,4 @@
16
16
  * ${l.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:o.length}),details:a},"error",this.opts.infoTimeout),typeof AggregateError=="function")throw new AggregateError(o,a);{const l=new Error(a);throw l.errors=o,l}}this.setState({files:n}),i.forEach(a=>{this.emit("file-added",a)}),this.emit("files-added",i),i.length>5?this.log(`Added batch of ${i.length} files`):Object.values(i).forEach(a=>{this.log(`Added file: ${a.name}
17
17
  id: ${a.id}
18
18
  type: ${a.type}`)}),i.length>0&&V(this,L,Fs).call(this)}removeFiles(e){const{files:n,currentUploads:i}=this.getState(),r={...n},s={...i},o=Object.create(null);e.forEach(d=>{n[d]&&(o[d]=n[d],delete r[d])});function a(d){return o[d]===void 0}Object.keys(s).forEach(d=>{const f=i[d].fileIDs.filter(a);if(f.length===0){delete s[d];return}const{capabilities:h}=this.getState();if(f.length!==i[d].fileIDs.length&&!h.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");s[d]={...i[d],fileIDs:f}});const l={currentUploads:s,files:r};Object.keys(r).length===0&&(l.allowNewUpload=!0,l.error=null,l.recoveredState=null),this.setState(l),E(this,Yt).call(this);const c=Object.keys(o);c.forEach(d=>{this.emit("file-removed",o[d])}),c.length>5?this.log(`Removed ${c.length} files`):this.log(`Removed files: ${c.join(", ")}`)}removeFile(e){this.removeFiles([e])}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).progress.uploadComplete)return;const n=this.getFile(e),r=!(n.isPaused||!1);return this.setFileState(e,{isPaused:r}),this.emit("upload-pause",n,r),r}pauseAll(){const e={...this.getState().files};Object.keys(e).filter(i=>!e[i].progress.uploadComplete&&e[i].progress.uploadStarted).forEach(i=>{const r={...e[i],isPaused:!0};e[i]=r}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){const e={...this.getState().files};Object.keys(e).filter(i=>!e[i].progress.uploadComplete&&e[i].progress.uploadStarted).forEach(i=>{const r={...e[i],isPaused:!1,error:null};e[i]=r}),this.setState({files:e}),this.emit("resume-all")}async retryAll(){const e=await V(this,L,Ms).call(this);return this.emit("complete",e),e}cancelAll(){this.emit("cancel-all");const{files:e}=this.getState(),n=Object.keys(e);n.length&&this.removeFiles(n),this.setState(Yi)}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",this.getFile(e));const n=V(this,L,ui).call(this,[e],{forceAllowNewUpload:!0});return V(this,L,di).call(this,n)}logout(){this.iteratePlugins(e=>{var n,i;(i=(n=e.provider)==null?void 0:n.logout)==null||i.call(n)})}[Symbol.for("uppy test: updateTotalProgress")](){return V(this,L,Ds).call(this)}updateOnlineStatus(){window.navigator.onLine??!0?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}getID(){return this.opts.id}use(e,...n){if(typeof e!="function"){const o=`Expected a plugin class, but got ${e===null?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`;throw new TypeError(o)}const i=new e(this,...n),r=i.id;if(!r)throw new Error("Your plugin must have an id");if(!i.type)throw new Error("Your plugin must have a type");const s=this.getPlugin(r);if(s){const o=`Already found a plugin named '${s.id}'. Tried to use: '${r}'.
19
- Uppy plugins must have unique \`id\` options.`;throw new Error(o)}return e.VERSION&&this.log(`Using ${r} v${e.VERSION}`),i.type in E(this,ze)?E(this,ze)[i.type].push(i):E(this,ze)[i.type]=[i],i.install(),this.emit("plugin-added",i),this}getPlugin(e){for(const n of Object.values(E(this,ze))){const i=n.find(r=>r.id===e);if(i!=null)return i}}[Symbol.for("uppy test: getPlugins")](e){return E(this,ze)[e]}iteratePlugins(e){Object.values(E(this,ze)).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const n=E(this,ze)[e.type],i=n.findIndex(o=>o.id===e.id);i!==-1&&n.splice(i,1);const s={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(s)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),E(this,Qn).call(this),this.iteratePlugins(e=>{this.removePlugin(e)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",E(this,kt)),window.removeEventListener("offline",E(this,kt)))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,n="info",i=3e3){const r=typeof e=="object";this.setState({info:[...this.getState().info,{type:n,message:r?e.message:e,details:r?e.details:null}]}),setTimeout(()=>this.hideInfo(),i),this.emit("info-visible")}log(e,n){const{logger:i}=this.opts;switch(n){case"error":i.error(e);break;case"warning":i.warn(e);break;default:i.debug(e);break}}registerRequestClient(e,n){E(this,Zn).set(e,n)}getRequestClientForFile(e){if(!("remote"in e&&e.remote))throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);const n=E(this,Zn).get(e.remote.requestClientId);if(n==null)throw new Error(`requestClientId "${e.remote.requestClientId}" not registered for file "${e.id}"`);return n}async restore(e){this.log(`Core: Running restored upload "${e}"`);const n=await V(this,L,di).call(this,e);return this.emit("complete",n),n}[Symbol.for("uppy test: createUpload")](...e){return V(this,L,ui).call(this,...e)}addResultData(e,n){if(!V(this,L,nu).call(this,e)){this.log(`Not setting result for an upload that has been removed: ${e}`);return}const{currentUploads:i}=this.getState(),r={...i[e],result:{...i[e].result,...n}};this.setState({currentUploads:{...i,[e]:r}})}async upload(){var r;(r=E(this,ze).uploader)!=null&&r.length||this.log("No uploader type plugins are used","warning");let{files:e}=this.getState();if(V(this,L,Ps).call(this).length>0){const s=await V(this,L,Ms).call(this);if(!(this.getFiles().filter(a=>a.progress.uploadStarted==null).length>0))return this.emit("complete",s),s;({files:e}=this.getState())}const i=this.opts.onBeforeUpload(e);if(i===!1)throw new Error("Not starting the upload because onBeforeUpload returned false");i&&typeof i=="object"&&(e=i,this.setState({files:e}));try{if(E(this,qe).validateMinNumberOfFiles(e),!V(this,L,Qc).call(this,e))throw new xe(this.i18n("missingRequiredMetaField"));const{currentUploads:s}=this.getState(),o=Object.values(s).flatMap(d=>d.fileIDs),a=Object.keys(e).filter(d=>{const f=this.getFile(d);return f&&!f.progress.uploadStarted&&!o.includes(d)}),l=V(this,L,ui).call(this,a),c=await V(this,L,di).call(this,l);return this.emit("complete",c),c}catch(s){throw V(this,L,Zt).call(this,[s]),s}}};ze=new WeakMap,qe=new WeakMap,Qn=new WeakMap,Wt=new WeakMap,Tn=new WeakMap,Fn=new WeakMap,Gt=new WeakMap,L=new WeakSet,Zt=function(e){for(const o of e)o.isRestriction?this.emit("restriction-failed",o.file,o):this.emit("error",o,o.file),this.log(o,"warning");const n=e.filter(o=>o.isUserFacing),i=4,r=n.slice(0,i),s=n.slice(i);r.forEach(({message:o,details:a=""})=>{this.info({message:o,details:a},"error",this.opts.infoTimeout)}),s.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:s.length})})},Ts=function(e){const{missingFields:n,error:i}=E(this,qe).getMissingRequiredMetaFields(e);return n.length>0?(this.setFileState(e.id,{missingRequiredMetaFields:n,error:i.message}),this.log(i.message),this.emit("restriction-failed",e,i),!1):(n.length===0&&e.missingRequiredMetaFields&&this.setFileState(e.id,{missingRequiredMetaFields:[]}),!0)},Qc=function(e){let n=!0;for(const i of Object.values(e))V(this,L,Ts).call(this,i)||(n=!1);return n},Zc=function(e){const{allowNewUpload:n}=this.getState();if(n===!1){const i=new xe(this.i18n("noMoreFilesAllowed"),{file:e});throw V(this,L,Zt).call(this,[i]),i}},Jc=function(e){const n=e instanceof File?{name:e.name,type:e.type,size:e.size,data:e,meta:{},isRemote:!1,source:void 0,preview:void 0}:e,i=Sc(n),r=Y0(i,n),s=wc(r).extension,o=v_(n,this.getID()),a={...n.meta,name:r,type:i},l=Number.isFinite(n.data.size)?n.data.size:null;return{source:n.source||"",id:o,name:r,extension:s||"",meta:{...this.getState().meta,...a},type:i,progress:{percentage:0,bytesUploaded:!1,bytesTotal:l,uploadComplete:!1,uploadStarted:null},size:l,isGhost:!1,...n.isRemote?{isRemote:!0,remote:n.remote,data:n.data}:{isRemote:!1,data:n.data},preview:n.preview}},Fs=function(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(e=>{e.isRestriction||this.log(e.stack||e.message||e)})},4))},Ns=function(e){let{files:n}=this.getState(),i={...n};const r=[],s=[];for(const o of e)try{let a=V(this,L,Jc).call(this,o);V(this,L,Zc).call(this,a);const l=n[a.id],c=l==null?void 0:l.isGhost;if(c&&!a.isRemote){if(a.data==null)throw new Error("File data is missing");a={...l,isGhost:!1,data:a.data},this.log(`Replaced the blob in the restored ghost file: ${a.name}, ${a.id}`)}const d=this.opts.onBeforeFileAdded(a,i);if(n=this.getState().files,i={...n,...i},!d&&this.checkIfFileAlreadyExists(a.id))throw new xe(this.i18n("noDuplicates",{fileName:a.name??this.i18n("unnamed")}),{file:a});if(d===!1&&!c)throw new xe("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:a});typeof d=="object"&&d!==null&&(a=d),E(this,qe).validateSingleFile(a),i[a.id]=a,r.push(a)}catch(a){s.push(a)}try{E(this,qe).validateAggregateRestrictions(Object.values(n),r)}catch(o){return s.push(o),{nextFilesState:n,validFilesToAdd:[],errors:s}}return{nextFilesState:i,validFilesToAdd:r,errors:s}},Ps=function(){const{files:e}=this.getState();return Object.keys(e).filter(n=>{const i=e[n];return i.error&&(!i.missingRequiredMetaFields||i.missingRequiredMetaFields.length===0)})},Ms=async function(){const e=V(this,L,Ps).call(this),n={...this.getState().files};if(e.forEach(r=>{n[r]={...n[r],isPaused:!1,error:null}}),this.setState({files:n,error:null}),this.emit("retry-all",this.getFilesByIds(e)),e.length===0)return{successful:[],failed:[]};const i=V(this,L,ui).call(this,e,{forceAllowNewUpload:!0});return V(this,L,di).call(this,i)},Zi=new WeakMap,Ds=function(){const e=V(this,L,eu).call(this);let n=null;e!=null&&(n=Math.round(e*100),n>100?n=100:n<0&&(n=0)),this.emit("progress",n??0),this.setState({totalProgress:n??0})},Yt=new WeakMap,eu=function(){const n=this.getFiles().filter(l=>l.progress.uploadStarted||l.progress.preprocess||l.progress.postprocess);if(n.length===0)return 0;if(n.every(l=>l.progress.uploadComplete))return 1;const i=l=>l.progress.bytesTotal!=null&&l.progress.bytesTotal!==0,r=n.filter(i),s=n.filter(l=>!i(l));if(r.every(l=>l.progress.uploadComplete)&&s.length>0&&!s.every(l=>l.progress.uploadComplete))return null;const o=r.reduce((l,c)=>l+(c.progress.bytesTotal??0),0),a=r.reduce((l,c)=>l+(c.progress.bytesUploaded||0),0);return o===0?0:a/o},tu=function(){const e=(r,s,o)=>{let a=r.message||"Unknown error";r.details&&(a+=` ${r.details}`),this.setState({error:a}),s!=null&&s.id in this.getState().files&&this.setFileState(s.id,{error:a,response:o})};this.on("error",e),this.on("upload-error",(r,s,o)=>{if(e(s,r,o),typeof s=="object"&&s.message){this.log(s.message,"error");const a=new Error(this.i18n("failedToUpload",{file:(r==null?void 0:r.name)??""}));a.isUserFacing=!0,a.details=s.message,s.details&&(a.details+=` ${s.details}`),V(this,L,Zt).call(this,[a])}else V(this,L,Zt).call(this,[s])});let n=null;this.on("upload-stalled",(r,s)=>{const{message:o}=r,a=s.map(l=>l.meta.name).join(", ");n||(this.info({message:o,details:a},"warning",this.opts.infoTimeout),n=setTimeout(()=>{n=null},this.opts.infoTimeout)),this.log(`${o} ${a}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});const i=r=>{const s=r.filter(a=>{const l=a!=null&&this.getFile(a.id);return l||this.log(`Not setting progress for a file that has been removed: ${a==null?void 0:a.id}`),l}),o=Object.fromEntries(s.map(a=>[a.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,bytesUploaded:0,bytesTotal:a.size}}]));this.patchFilesState(o)};this.on("upload-start",i),this.on("upload-progress",E(this,Zi)),this.on("upload-success",(r,s)=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r==null?void 0:r.id}`);return}const o=this.getFile(r.id).progress,a=E(this,Gt).size>0;this.setFileState(r.id,{progress:{...o,postprocess:a?{mode:"indeterminate"}:void 0,uploadComplete:!0,...!a&&{complete:!0},percentage:100,bytesUploaded:o.bytesTotal},response:s,uploadURL:s.uploadURL,isPaused:!1}),r.size==null&&this.setFileState(r.id,{size:s.bytesUploaded||o.bytesTotal}),E(this,Yt).call(this)}),this.on("preprocess-progress",(r,s)=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r==null?void 0:r.id}`);return}this.setFileState(r.id,{progress:{...this.getFile(r.id).progress,preprocess:s}})}),this.on("preprocess-complete",r=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r==null?void 0:r.id}`);return}const s={...this.getState().files};s[r.id]={...s[r.id],progress:{...s[r.id].progress}},delete s[r.id].progress.preprocess,this.setState({files:s})}),this.on("postprocess-progress",(r,s)=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r==null?void 0:r.id}`);return}this.setFileState(r.id,{progress:{...this.getState().files[r.id].progress,postprocess:s}})}),this.on("postprocess-complete",r=>{const s=r&&this.getFile(r.id);if(s==null){this.log(`Not setting progress for a file that has been removed: ${r==null?void 0:r.id}`);return}const{postprocess:o,...a}=s.progress;this.patchFilesState({[s.id]:{progress:{...a,complete:!0}}})}),this.on("restored",()=>{E(this,Yt).call(this)}),this.on("dashboard:file-edit-complete",r=>{r&&V(this,L,Ts).call(this,r)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",E(this,kt)),window.addEventListener("offline",E(this,kt)),setTimeout(E(this,kt),3e3))},kt=new WeakMap,Zn=new WeakMap,ui=function(e,n={}){const{forceAllowNewUpload:i=!1}=n,{allowNewUpload:r,currentUploads:s}=this.getState();if(!r&&!i)throw new Error("Cannot create a new upload: already uploading.");const o=W0();return this.emit("upload",o,this.getFilesByIds(e)),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:{...s,[o]:{fileIDs:e,step:0,result:{}}}}),o},nu=function(e){const{currentUploads:n}=this.getState();return n[e]},$s=function(e){const{[e]:n,...i}=this.getState().currentUploads;this.setState({currentUploads:i})},di=async function(e){const n=()=>{const{currentUploads:o}=this.getState();return o[e]};let i=n();if(!i)throw new Error("Nonexistent upload");const r=[...E(this,Tn),...E(this,Fn),...E(this,Gt)];try{for(let o=i.step||0;o<r.length;o++){const a=r[o];this.setState({currentUploads:{...this.getState().currentUploads,[e]:{...i,step:o}}});const{fileIDs:l}=i;if(await a(l,e),i=n(),!i)break}}catch(o){throw V(this,L,$s).call(this,e),o}if(i){i.fileIDs.forEach(c=>{const d=this.getFile(c);d!=null&&d.progress.postprocess&&this.emit("postprocess-complete",d)});const o=i.fileIDs.map(c=>this.getFile(c)),a=o.filter(c=>!c.error),l=o.filter(c=>c.error);this.addResultData(e,{successful:a,failed:l,uploadID:e}),i=n()}let s;return i&&(s=i.result,V(this,L,$s).call(this,e)),s==null&&(this.log(`Not setting result for an upload that has been removed: ${e}`),s={successful:[],failed:[],uploadID:e}),s},j(Ji,"VERSION",G0.version);let Ss=Ji;const Z0={__name:"UppyInput",props:{name:{type:String,required:!0},multiple:{type:Boolean,default:!1},useXHR:{type:Boolean,default:!0},XHRConfig:{type:Object,default:{}},url:{type:String,default:"/upload"},config:{type:Object,default:()=>({})},errorHandler:{type:Function,default:null}},emits:["update:modelValue","file-added","file-removed","beforeUpload","progress","upload","upload-progress","upload-error","upload-success","upload-pause","complete","error","upload-retry","upload-stalled","retry-all","cancel-all","restriction-failed"],setup(t,{emit:e}){var d;const n=t,i=e,r=u.ref(null),s=u.shallowRef(null),o=u.inject("form",{value:{},errors:{},getID:f=>f}),a=u.inject("group",null),l=u.computed({get(){var f;return(f=a==null?void 0:a.value)!=null&&f.name?a.value.getData(n.name):o.value[n.name]},set(f){var h;(h=a==null?void 0:a.value)!=null&&h.name?a.value.setData(n.name,f):o.value[n.name]=f,i("update:modelValue",f)}});s.value=new Ss({id:n.name,autoProceed:!0,...n.config,restrictions:{maxNumberOfFiles:n.multiple?10:1,...((d=n.config)==null?void 0:d.restrictions)||{}}}),s.value.on("before-upload",f=>{i("beforeUpload",f)}),s.value.on("upload-success",(f,h)=>{const g=h.body??h;if(n.multiple){const m=Array.isArray(l.value)?l.value:[];l.value=[...m,g]}else l.value=g;i("upload-success",f,h)}),s.value.on("file-added",f=>i("file-added",f)),s.value.on("file-removed",f=>{var h;if(n.multiple&&Array.isArray(l.value)){const g=((h=f.response)==null?void 0:h.body)??f.response;l.value=l.value.filter(m=>JSON.stringify(m)!==JSON.stringify(g))}else l.value=null;f.response&&fetch(n.url,{method:"DELETE",headers:{"X-Requested-With":"XMLHttpRequest","Content-Type":"application/json"},body:JSON.stringify(f.response.body??f.response)}),i("file-removed",f)}),s.value.on("complete",f=>i("complete",f)),s.value.on("error",f=>i("error",f)),s.value.on("restriction-failed",(f,h)=>{n.errorHandler?n.errorHandler(h):c(h.message),i("restriction-failed",f,h)}),u.onMounted(()=>{let f;n.useXHR&&Promise.resolve().then(()=>ib).then(h=>{f=h.default,s.value.use(f,{endpoint:n.url,...n.XHRConfig})})}),u.onBeforeUnmount(()=>{s.value&&s.value.destroy()});function c(f){const h=document.createElement("div");h.textContent=f,h.className="uppy-error",r.value&&(r.value.prepend(h),setTimeout(()=>h.remove(),3e3))}return(f,h)=>s.value?(u.openBlock(),u.createElementBlock("div",{key:0,class:"uppy-input-area",ref_key:"inputEl",ref:r},[u.createVNode(u.unref(l_),{name:"uu"+t.name,uppy:s.value},{default:u.withCtx(()=>[u.renderSlot(f.$slots,"default",{uppy:s.value},()=>[u.createVNode(u.unref(u_),{class:"uppy-file-lists"}),u.createVNode(u.unref(c_))])]),_:3},8,["name","uppy"])],512)):u.createCommentVNode("",!0)}},J0={version:"5.1.1"},eb={strings:{uploadStalled:"Upload has not made any progress for %{seconds} seconds. You may want to retry it."}};function tb(t,e){let n=e;return n||(n=new Error("Upload error")),typeof n=="string"&&(n=new Error(n)),n instanceof Error||(n=Object.assign(new Error("Upload error"),{data:n})),w_(t)?(n=new bs(n,t),n):(n.request=t,n)}function Rc(t){return t.data.slice(0,t.data.size,t.meta.type)}const nb={formData:!0,fieldName:"file",method:"post",allowedMetaFields:!0,bundle:!1,headers:{},timeout:30*1e3,limit:5,withCredentials:!1,responseType:""};class Hc extends A_{constructor(n,i){super(n,{...nb,fieldName:i.bundle?"files[]":"file",...i});K(this,it);K(this,Nn);j(this,"requests");j(this,"uploaderEvents");K(this,Jn,async n=>{if(n.length===0){this.uppy.log("[XHRUpload] No files to upload!");return}this.opts.limit===0&&!this.opts[vs]&&this.uppy.log("[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0","warning"),this.uppy.log("[XHRUpload] Uploading...");const i=this.uppy.getFilesByIds(n),r=m_(i),s=g_(r);if(this.uppy.emit("upload-start",s),this.opts.bundle){if(r.some(a=>a.isRemote))throw new Error("Can’t upload remote files when the `bundle: true` option is set");if(typeof this.opts.headers=="function")throw new TypeError("`headers` may not be a function when the `bundle: true` option is set");await V(this,it,ru).call(this,r)}else await V(this,it,ou).call(this,r)});if(this.type="uploader",this.id=this.opts.id||"XHRUpload",this.defaultLocale=eb,this.i18nInit(),vs in this.opts?this.requests=this.opts[vs]:this.requests=new S_(this.opts.limit),this.opts.bundle&&!this.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");if(this.opts.bundle&&typeof this.opts.headers=="function")throw new Error("`opts.headers` can not be a function when the `bundle: true` option is set.");if((i==null?void 0:i.allowedMetaFields)===void 0&&"metaFields"in this.opts)throw new Error("The `metaFields` option has been renamed to `allowedMetaFields`.");this.uploaderEvents=Object.create(null),re(this,Nn,r=>async(s,o)=>{var a,l;try{const c=await f_(s,{...o,onBeforeRequest:(h,g)=>{var m,p;return(p=(m=this.opts).onBeforeRequest)==null?void 0:p.call(m,h,g,r)},shouldRetry:this.opts.shouldRetry,onAfterResponse:this.opts.onAfterResponse,onTimeout:h=>{const g=Math.ceil(h/1e3),m=new Error(this.i18n("uploadStalled",{seconds:g}));this.uppy.emit("upload-stalled",m,r)},onUploadProgress:h=>{if(h.lengthComputable)for(const{id:g}of r){const m=this.uppy.getFile(g);m!=null&&this.uppy.emit("upload-progress",m,{uploadStarted:m.progress.uploadStarted??0,bytesUploaded:h.loaded/h.total*m.size,bytesTotal:m.size})}}});let d=await((l=(a=this.opts).getResponseData)==null?void 0:l.call(a,c));if(c.responseType==="json")d??(d=c.response);else try{d??(d=JSON.parse(c.responseText))}catch(h){throw new Error("@uppy/xhr-upload expects a JSON response (with a `url` property). To parse non-JSON responses, use `getResponseData` to turn your response into JSON.",{cause:h})}const f=typeof(d==null?void 0:d.url)=="string"?d.url:void 0;for(const{id:h}of r)this.uppy.emit("upload-success",this.uppy.getFile(h),{status:c.status,body:d,uploadURL:f});return c}catch(c){if(c.name==="AbortError")return;const d=c.request;for(const f of r)this.uppy.emit("upload-error",this.uppy.getFile(f.id),tb(d,c),d);throw c}})}getOptions(n){const i=this.uppy.getState().xhrUpload,{headers:r}=this.opts,s={...this.opts,...i||{},...n.xhrUpload||{},headers:{}};return typeof r=="function"?s.headers=r(n):Object.assign(s.headers,this.opts.headers),i&&Object.assign(s.headers,i.headers),n.xhrUpload&&Object.assign(s.headers,n.xhrUpload.headers),s}addMetadata(n,i,r){kc(r.allowedMetaFields,i).forEach(o=>{const a=i[o];Array.isArray(a)?a.forEach(l=>n.append(o,l)):n.append(o,a)})}createFormDataUpload(n,i){const r=new FormData;this.addMetadata(r,n.meta,i);const s=Rc(n);return n.name?r.append(i.fieldName,s,n.meta.name):r.append(i.fieldName,s),r}createBundledUpload(n,i){const r=new FormData,{meta:s}=this.uppy.getState();return this.addMetadata(r,s,i),n.forEach(o=>{const a=this.getOptions(o),l=Rc(o);o.name?r.append(a.fieldName,l,o.name):r.append(a.fieldName,l)}),r}install(){if(this.opts.bundle){const{capabilities:n}=this.uppy.getState();this.uppy.setState({capabilities:{...n,individualCancellation:!1}})}this.uppy.addUploader(E(this,Jn))}uninstall(){if(this.opts.bundle){const{capabilities:n}=this.uppy.getState();this.uppy.setState({capabilities:{...n,individualCancellation:!0}})}this.uppy.removeUploader(E(this,Jn))}}Nn=new WeakMap,it=new WeakSet,iu=async function(n){const i=new I_(this.uppy),r=new AbortController,s=this.requests.wrapPromiseFunction(async()=>{const o=this.getOptions(n),a=E(this,Nn).call(this,[n]),l=o.formData?this.createFormDataUpload(n,o):n.data,c=typeof o.endpoint=="string"?o.endpoint:await o.endpoint(n);return a(c,{...o,body:l,signal:r.signal})});i.onFileRemove(n.id,()=>r.abort()),i.onCancelAll(n.id,()=>{r.abort()});try{await s()}catch(o){if(o.message!=="Cancelled")throw o}finally{i.remove()}},ru=async function(n){const i=new AbortController,r=this.requests.wrapPromiseFunction(async()=>{const o=this.uppy.getState().xhrUpload??{},a=E(this,Nn).call(this,n),l=this.createBundledUpload(n,{...this.opts,...o}),c=typeof this.opts.endpoint=="string"?this.opts.endpoint:await this.opts.endpoint(n);return a(c,{...this.opts,body:l,signal:i.signal})});function s(){i.abort()}this.uppy.once("cancel-all",s);try{await r()}catch(o){if(o.message!=="Cancelled")throw o}finally{this.uppy.off("cancel-all",s)}},su=function(n){var s;const i=this.getOptions(n),r=kc(i.allowedMetaFields,n.meta);return{...(s=n.remote)==null?void 0:s.body,protocol:"multipart",endpoint:i.endpoint,size:n.data.size,fieldname:i.fieldName,metadata:Object.fromEntries(r.map(o=>[o,n.meta[o]])),httpMethod:i.method,useFormData:i.formData,headers:i.headers}},ou=async function(n){await Promise.allSettled(n.map(i=>{if(i.isRemote){const r=()=>this.requests,s=new AbortController,o=l=>{l.id===i.id&&s.abort()};this.uppy.on("file-removed",o);const a=this.uppy.getRequestClientForFile(i).uploadRemoteFile(i,V(this,it,su).call(this,i),{signal:s.signal,getQueue:r});return this.requests.wrapSyncFunction(()=>{this.uppy.off("file-removed",o)},{priority:-1})(),a}return V(this,it,iu).call(this,i)}))},Jn=new WeakMap,j(Hc,"VERSION",J0.version);const ib=Object.freeze(Object.defineProperty({__proto__:null,default:Hc},Symbol.toStringTag,{value:"Module"}));T.AmountInput=bh,T.CaptchaInput=Oh,T.CheckboxButtonInput=Mh,T.CheckboxInput=jh,T.CheckboxToggle=zh,T.DropzoneInput=zg,T.EditorInput=Zh,T.EmailInput=pp,T.FileInput=dp,T.FormContainer=Ep,T.FormLabel=Ip,T.GroupControl=ua,T.LocationInput=Fp,T.MobileInput=Mp,T.MultiQuantityInput=Kp,T.PasswordInput=Lp,T.PersianDatePickerInput=Yh,T.QuantityInput=da,T.RangeSliderInput=H1,T.SecondarySubmitButton=Xp,T.Select2Input=Ag,T.SimpleUploader=i1,T.StarRatingInput=Ng,T.SubmitButton=$g,T.TelInput=jg,T.TextAreaInput=xg,T.TextInput=Ln,T.UppyInput=Z0,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})});
19
+ Uppy plugins must have unique \`id\` options.`;throw new Error(o)}return e.VERSION&&this.log(`Using ${r} v${e.VERSION}`),i.type in E(this,ze)?E(this,ze)[i.type].push(i):E(this,ze)[i.type]=[i],i.install(),this.emit("plugin-added",i),this}getPlugin(e){for(const n of Object.values(E(this,ze))){const i=n.find(r=>r.id===e);if(i!=null)return i}}[Symbol.for("uppy test: getPlugins")](e){return E(this,ze)[e]}iteratePlugins(e){Object.values(E(this,ze)).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const n=E(this,ze)[e.type],i=n.findIndex(o=>o.id===e.id);i!==-1&&n.splice(i,1);const s={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(s)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),E(this,Qn).call(this),this.iteratePlugins(e=>{this.removePlugin(e)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",E(this,kt)),window.removeEventListener("offline",E(this,kt)))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,n="info",i=3e3){const r=typeof e=="object";this.setState({info:[...this.getState().info,{type:n,message:r?e.message:e,details:r?e.details:null}]}),setTimeout(()=>this.hideInfo(),i),this.emit("info-visible")}log(e,n){const{logger:i}=this.opts;switch(n){case"error":i.error(e);break;case"warning":i.warn(e);break;default:i.debug(e);break}}registerRequestClient(e,n){E(this,Zn).set(e,n)}getRequestClientForFile(e){if(!("remote"in e&&e.remote))throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);const n=E(this,Zn).get(e.remote.requestClientId);if(n==null)throw new Error(`requestClientId "${e.remote.requestClientId}" not registered for file "${e.id}"`);return n}async restore(e){this.log(`Core: Running restored upload "${e}"`);const n=await V(this,L,di).call(this,e);return this.emit("complete",n),n}[Symbol.for("uppy test: createUpload")](...e){return V(this,L,ui).call(this,...e)}addResultData(e,n){if(!V(this,L,nu).call(this,e)){this.log(`Not setting result for an upload that has been removed: ${e}`);return}const{currentUploads:i}=this.getState(),r={...i[e],result:{...i[e].result,...n}};this.setState({currentUploads:{...i,[e]:r}})}async upload(){var r;(r=E(this,ze).uploader)!=null&&r.length||this.log("No uploader type plugins are used","warning");let{files:e}=this.getState();if(V(this,L,Ps).call(this).length>0){const s=await V(this,L,Ms).call(this);if(!(this.getFiles().filter(a=>a.progress.uploadStarted==null).length>0))return this.emit("complete",s),s;({files:e}=this.getState())}const i=this.opts.onBeforeUpload(e);if(i===!1)throw new Error("Not starting the upload because onBeforeUpload returned false");i&&typeof i=="object"&&(e=i,this.setState({files:e}));try{if(E(this,qe).validateMinNumberOfFiles(e),!V(this,L,Qc).call(this,e))throw new xe(this.i18n("missingRequiredMetaField"));const{currentUploads:s}=this.getState(),o=Object.values(s).flatMap(d=>d.fileIDs),a=Object.keys(e).filter(d=>{const f=this.getFile(d);return f&&!f.progress.uploadStarted&&!o.includes(d)}),l=V(this,L,ui).call(this,a),c=await V(this,L,di).call(this,l);return this.emit("complete",c),c}catch(s){throw V(this,L,Zt).call(this,[s]),s}}};ze=new WeakMap,qe=new WeakMap,Qn=new WeakMap,Wt=new WeakMap,Tn=new WeakMap,Fn=new WeakMap,Gt=new WeakMap,L=new WeakSet,Zt=function(e){for(const o of e)o.isRestriction?this.emit("restriction-failed",o.file,o):this.emit("error",o,o.file),this.log(o,"warning");const n=e.filter(o=>o.isUserFacing),i=4,r=n.slice(0,i),s=n.slice(i);r.forEach(({message:o,details:a=""})=>{this.info({message:o,details:a},"error",this.opts.infoTimeout)}),s.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:s.length})})},Ts=function(e){const{missingFields:n,error:i}=E(this,qe).getMissingRequiredMetaFields(e);return n.length>0?(this.setFileState(e.id,{missingRequiredMetaFields:n,error:i.message}),this.log(i.message),this.emit("restriction-failed",e,i),!1):(n.length===0&&e.missingRequiredMetaFields&&this.setFileState(e.id,{missingRequiredMetaFields:[]}),!0)},Qc=function(e){let n=!0;for(const i of Object.values(e))V(this,L,Ts).call(this,i)||(n=!1);return n},Zc=function(e){const{allowNewUpload:n}=this.getState();if(n===!1){const i=new xe(this.i18n("noMoreFilesAllowed"),{file:e});throw V(this,L,Zt).call(this,[i]),i}},Jc=function(e){const n=e instanceof File?{name:e.name,type:e.type,size:e.size,data:e,meta:{},isRemote:!1,source:void 0,preview:void 0}:e,i=Sc(n),r=Y0(i,n),s=wc(r).extension,o=v_(n,this.getID()),a={...n.meta,name:r,type:i},l=Number.isFinite(n.data.size)?n.data.size:null;return{source:n.source||"",id:o,name:r,extension:s||"",meta:{...this.getState().meta,...a},type:i,progress:{percentage:0,bytesUploaded:!1,bytesTotal:l,uploadComplete:!1,uploadStarted:null},size:l,isGhost:!1,...n.isRemote?{isRemote:!0,remote:n.remote,data:n.data}:{isRemote:!1,data:n.data},preview:n.preview}},Fs=function(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(e=>{e.isRestriction||this.log(e.stack||e.message||e)})},4))},Ns=function(e){let{files:n}=this.getState(),i={...n};const r=[],s=[];for(const o of e)try{let a=V(this,L,Jc).call(this,o);V(this,L,Zc).call(this,a);const l=n[a.id],c=l==null?void 0:l.isGhost;if(c&&!a.isRemote){if(a.data==null)throw new Error("File data is missing");a={...l,isGhost:!1,data:a.data},this.log(`Replaced the blob in the restored ghost file: ${a.name}, ${a.id}`)}const d=this.opts.onBeforeFileAdded(a,i);if(n=this.getState().files,i={...n,...i},!d&&this.checkIfFileAlreadyExists(a.id))throw new xe(this.i18n("noDuplicates",{fileName:a.name??this.i18n("unnamed")}),{file:a});if(d===!1&&!c)throw new xe("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:a});typeof d=="object"&&d!==null&&(a=d),E(this,qe).validateSingleFile(a),i[a.id]=a,r.push(a)}catch(a){s.push(a)}try{E(this,qe).validateAggregateRestrictions(Object.values(n),r)}catch(o){return s.push(o),{nextFilesState:n,validFilesToAdd:[],errors:s}}return{nextFilesState:i,validFilesToAdd:r,errors:s}},Ps=function(){const{files:e}=this.getState();return Object.keys(e).filter(n=>{const i=e[n];return i.error&&(!i.missingRequiredMetaFields||i.missingRequiredMetaFields.length===0)})},Ms=async function(){const e=V(this,L,Ps).call(this),n={...this.getState().files};if(e.forEach(r=>{n[r]={...n[r],isPaused:!1,error:null}}),this.setState({files:n,error:null}),this.emit("retry-all",this.getFilesByIds(e)),e.length===0)return{successful:[],failed:[]};const i=V(this,L,ui).call(this,e,{forceAllowNewUpload:!0});return V(this,L,di).call(this,i)},Zi=new WeakMap,Ds=function(){const e=V(this,L,eu).call(this);let n=null;e!=null&&(n=Math.round(e*100),n>100?n=100:n<0&&(n=0)),this.emit("progress",n??0),this.setState({totalProgress:n??0})},Yt=new WeakMap,eu=function(){const n=this.getFiles().filter(l=>l.progress.uploadStarted||l.progress.preprocess||l.progress.postprocess);if(n.length===0)return 0;if(n.every(l=>l.progress.uploadComplete))return 1;const i=l=>l.progress.bytesTotal!=null&&l.progress.bytesTotal!==0,r=n.filter(i),s=n.filter(l=>!i(l));if(r.every(l=>l.progress.uploadComplete)&&s.length>0&&!s.every(l=>l.progress.uploadComplete))return null;const o=r.reduce((l,c)=>l+(c.progress.bytesTotal??0),0),a=r.reduce((l,c)=>l+(c.progress.bytesUploaded||0),0);return o===0?0:a/o},tu=function(){const e=(r,s,o)=>{let a=r.message||"Unknown error";r.details&&(a+=` ${r.details}`),this.setState({error:a}),s!=null&&s.id in this.getState().files&&this.setFileState(s.id,{error:a,response:o})};this.on("error",e),this.on("upload-error",(r,s,o)=>{if(e(s,r,o),typeof s=="object"&&s.message){this.log(s.message,"error");const a=new Error(this.i18n("failedToUpload",{file:(r==null?void 0:r.name)??""}));a.isUserFacing=!0,a.details=s.message,s.details&&(a.details+=` ${s.details}`),V(this,L,Zt).call(this,[a])}else V(this,L,Zt).call(this,[s])});let n=null;this.on("upload-stalled",(r,s)=>{const{message:o}=r,a=s.map(l=>l.meta.name).join(", ");n||(this.info({message:o,details:a},"warning",this.opts.infoTimeout),n=setTimeout(()=>{n=null},this.opts.infoTimeout)),this.log(`${o} ${a}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});const i=r=>{const s=r.filter(a=>{const l=a!=null&&this.getFile(a.id);return l||this.log(`Not setting progress for a file that has been removed: ${a==null?void 0:a.id}`),l}),o=Object.fromEntries(s.map(a=>[a.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,bytesUploaded:0,bytesTotal:a.size}}]));this.patchFilesState(o)};this.on("upload-start",i),this.on("upload-progress",E(this,Zi)),this.on("upload-success",(r,s)=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r==null?void 0:r.id}`);return}const o=this.getFile(r.id).progress,a=E(this,Gt).size>0;this.setFileState(r.id,{progress:{...o,postprocess:a?{mode:"indeterminate"}:void 0,uploadComplete:!0,...!a&&{complete:!0},percentage:100,bytesUploaded:o.bytesTotal},response:s,uploadURL:s.uploadURL,isPaused:!1}),r.size==null&&this.setFileState(r.id,{size:s.bytesUploaded||o.bytesTotal}),E(this,Yt).call(this)}),this.on("preprocess-progress",(r,s)=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r==null?void 0:r.id}`);return}this.setFileState(r.id,{progress:{...this.getFile(r.id).progress,preprocess:s}})}),this.on("preprocess-complete",r=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r==null?void 0:r.id}`);return}const s={...this.getState().files};s[r.id]={...s[r.id],progress:{...s[r.id].progress}},delete s[r.id].progress.preprocess,this.setState({files:s})}),this.on("postprocess-progress",(r,s)=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r==null?void 0:r.id}`);return}this.setFileState(r.id,{progress:{...this.getState().files[r.id].progress,postprocess:s}})}),this.on("postprocess-complete",r=>{const s=r&&this.getFile(r.id);if(s==null){this.log(`Not setting progress for a file that has been removed: ${r==null?void 0:r.id}`);return}const{postprocess:o,...a}=s.progress;this.patchFilesState({[s.id]:{progress:{...a,complete:!0}}})}),this.on("restored",()=>{E(this,Yt).call(this)}),this.on("dashboard:file-edit-complete",r=>{r&&V(this,L,Ts).call(this,r)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",E(this,kt)),window.addEventListener("offline",E(this,kt)),setTimeout(E(this,kt),3e3))},kt=new WeakMap,Zn=new WeakMap,ui=function(e,n={}){const{forceAllowNewUpload:i=!1}=n,{allowNewUpload:r,currentUploads:s}=this.getState();if(!r&&!i)throw new Error("Cannot create a new upload: already uploading.");const o=W0();return this.emit("upload",o,this.getFilesByIds(e)),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:{...s,[o]:{fileIDs:e,step:0,result:{}}}}),o},nu=function(e){const{currentUploads:n}=this.getState();return n[e]},$s=function(e){const{[e]:n,...i}=this.getState().currentUploads;this.setState({currentUploads:i})},di=async function(e){const n=()=>{const{currentUploads:o}=this.getState();return o[e]};let i=n();if(!i)throw new Error("Nonexistent upload");const r=[...E(this,Tn),...E(this,Fn),...E(this,Gt)];try{for(let o=i.step||0;o<r.length;o++){const a=r[o];this.setState({currentUploads:{...this.getState().currentUploads,[e]:{...i,step:o}}});const{fileIDs:l}=i;if(await a(l,e),i=n(),!i)break}}catch(o){throw V(this,L,$s).call(this,e),o}if(i){i.fileIDs.forEach(c=>{const d=this.getFile(c);d!=null&&d.progress.postprocess&&this.emit("postprocess-complete",d)});const o=i.fileIDs.map(c=>this.getFile(c)),a=o.filter(c=>!c.error),l=o.filter(c=>c.error);this.addResultData(e,{successful:a,failed:l,uploadID:e}),i=n()}let s;return i&&(s=i.result,V(this,L,$s).call(this,e)),s==null&&(this.log(`Not setting result for an upload that has been removed: ${e}`),s={successful:[],failed:[],uploadID:e}),s},j(Ji,"VERSION",G0.version);let Ss=Ji;const Z0={__name:"UppyInput",props:{name:{type:String,required:!0},multiple:{type:Boolean,default:!1},useXHR:{type:Boolean,default:!0},XHRConfig:{type:Object,default:{}},url:{type:String,default:"/upload"},config:{type:Object,default:()=>({})},errorHandler:{type:Function,default:null}},emits:["update:modelValue","file-added","file-removed","beforeUpload","progress","upload","upload-progress","upload-error","upload-success","upload-pause","complete","error","upload-retry","upload-stalled","retry-all","cancel-all","restriction-failed"],setup(t,{emit:e}){var d;const n=t,i=e,r=u.ref(null),s=u.shallowRef(null),o=u.inject("form",{value:{},errors:{},getID:f=>f}),a=u.inject("group",null),l=u.computed({get(){var f;return(f=a==null?void 0:a.value)!=null&&f.name?a.value.getData(n.name):o.value[n.name]},set(f){var h;(h=a==null?void 0:a.value)!=null&&h.name?a.value.setData(n.name,f):o.value[n.name]=f,i("update:modelValue",f)}});s.value=new Ss({id:n.name,autoProceed:!0,...n.config,restrictions:{maxNumberOfFiles:n.multiple?10:1,...((d=n.config)==null?void 0:d.restrictions)||{}}}),s.value.on("before-upload",f=>{i("beforeUpload",f)}),s.value.on("upload-success",(f,h)=>{const g=h.body??h;if(n.multiple){const m=Array.isArray(l.value)?l.value:[];l.value=[...m,g]}else l.value=g;i("upload-success",f,h)}),s.value.on("file-added",f=>i("file-added",f)),s.value.on("file-removed",f=>{var h;if(n.multiple&&Array.isArray(l.value)){const g=((h=f.response)==null?void 0:h.body)??f.response;l.value=l.value.filter(m=>JSON.stringify(m)!==JSON.stringify(g))}else l.value=null;f.response&&fetch(n.url,{method:"DELETE",headers:{"X-Requested-With":"XMLHttpRequest","Content-Type":"application/json"},body:JSON.stringify(f.response.body??f.response)}),i("file-removed",f)}),s.value.on("complete",f=>i("complete",f)),s.value.on("error",f=>i("error",f)),s.value.on("restriction-failed",(f,h)=>{n.errorHandler?n.errorHandler(h):c(h.message),i("restriction-failed",f,h)}),u.onMounted(()=>{let f;n.useXHR&&Promise.resolve().then(()=>ib).then(h=>{f=h.default,s.value.use(f,{endpoint:n.url,formData:!0,headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest"},...n.XHRConfig})})}),u.onBeforeUnmount(()=>{s.value&&s.value.destroy()});function c(f){const h=document.createElement("div");h.textContent=f,h.className="uppy-error",r.value&&(r.value.prepend(h),setTimeout(()=>h.remove(),3e3))}return(f,h)=>s.value?(u.openBlock(),u.createElementBlock("div",{key:0,class:"uppy-input-area",ref_key:"inputEl",ref:r},[u.createVNode(u.unref(l_),{name:"uu"+t.name,uppy:s.value},{default:u.withCtx(()=>[u.renderSlot(f.$slots,"default",{uppy:s.value},()=>[u.createVNode(u.unref(u_),{class:"uppy-file-lists"}),u.createVNode(u.unref(c_))])]),_:3},8,["name","uppy"])],512)):u.createCommentVNode("",!0)}},J0={version:"5.1.1"},eb={strings:{uploadStalled:"Upload has not made any progress for %{seconds} seconds. You may want to retry it."}};function tb(t,e){let n=e;return n||(n=new Error("Upload error")),typeof n=="string"&&(n=new Error(n)),n instanceof Error||(n=Object.assign(new Error("Upload error"),{data:n})),w_(t)?(n=new bs(n,t),n):(n.request=t,n)}function Rc(t){return t.data.slice(0,t.data.size,t.meta.type)}const nb={formData:!0,fieldName:"file",method:"post",allowedMetaFields:!0,bundle:!1,headers:{},timeout:30*1e3,limit:5,withCredentials:!1,responseType:""};class Hc extends A_{constructor(n,i){super(n,{...nb,fieldName:i.bundle?"files[]":"file",...i});K(this,it);K(this,Nn);j(this,"requests");j(this,"uploaderEvents");K(this,Jn,async n=>{if(n.length===0){this.uppy.log("[XHRUpload] No files to upload!");return}this.opts.limit===0&&!this.opts[vs]&&this.uppy.log("[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0","warning"),this.uppy.log("[XHRUpload] Uploading...");const i=this.uppy.getFilesByIds(n),r=m_(i),s=g_(r);if(this.uppy.emit("upload-start",s),this.opts.bundle){if(r.some(a=>a.isRemote))throw new Error("Can’t upload remote files when the `bundle: true` option is set");if(typeof this.opts.headers=="function")throw new TypeError("`headers` may not be a function when the `bundle: true` option is set");await V(this,it,ru).call(this,r)}else await V(this,it,ou).call(this,r)});if(this.type="uploader",this.id=this.opts.id||"XHRUpload",this.defaultLocale=eb,this.i18nInit(),vs in this.opts?this.requests=this.opts[vs]:this.requests=new S_(this.opts.limit),this.opts.bundle&&!this.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");if(this.opts.bundle&&typeof this.opts.headers=="function")throw new Error("`opts.headers` can not be a function when the `bundle: true` option is set.");if((i==null?void 0:i.allowedMetaFields)===void 0&&"metaFields"in this.opts)throw new Error("The `metaFields` option has been renamed to `allowedMetaFields`.");this.uploaderEvents=Object.create(null),re(this,Nn,r=>async(s,o)=>{var a,l;try{const c=await f_(s,{...o,onBeforeRequest:(h,g)=>{var m,p;return(p=(m=this.opts).onBeforeRequest)==null?void 0:p.call(m,h,g,r)},shouldRetry:this.opts.shouldRetry,onAfterResponse:this.opts.onAfterResponse,onTimeout:h=>{const g=Math.ceil(h/1e3),m=new Error(this.i18n("uploadStalled",{seconds:g}));this.uppy.emit("upload-stalled",m,r)},onUploadProgress:h=>{if(h.lengthComputable)for(const{id:g}of r){const m=this.uppy.getFile(g);m!=null&&this.uppy.emit("upload-progress",m,{uploadStarted:m.progress.uploadStarted??0,bytesUploaded:h.loaded/h.total*m.size,bytesTotal:m.size})}}});let d=await((l=(a=this.opts).getResponseData)==null?void 0:l.call(a,c));if(c.responseType==="json")d??(d=c.response);else try{d??(d=JSON.parse(c.responseText))}catch(h){throw new Error("@uppy/xhr-upload expects a JSON response (with a `url` property). To parse non-JSON responses, use `getResponseData` to turn your response into JSON.",{cause:h})}const f=typeof(d==null?void 0:d.url)=="string"?d.url:void 0;for(const{id:h}of r)this.uppy.emit("upload-success",this.uppy.getFile(h),{status:c.status,body:d,uploadURL:f});return c}catch(c){if(c.name==="AbortError")return;const d=c.request;for(const f of r)this.uppy.emit("upload-error",this.uppy.getFile(f.id),tb(d,c),d);throw c}})}getOptions(n){const i=this.uppy.getState().xhrUpload,{headers:r}=this.opts,s={...this.opts,...i||{},...n.xhrUpload||{},headers:{}};return typeof r=="function"?s.headers=r(n):Object.assign(s.headers,this.opts.headers),i&&Object.assign(s.headers,i.headers),n.xhrUpload&&Object.assign(s.headers,n.xhrUpload.headers),s}addMetadata(n,i,r){kc(r.allowedMetaFields,i).forEach(o=>{const a=i[o];Array.isArray(a)?a.forEach(l=>n.append(o,l)):n.append(o,a)})}createFormDataUpload(n,i){const r=new FormData;this.addMetadata(r,n.meta,i);const s=Rc(n);return n.name?r.append(i.fieldName,s,n.meta.name):r.append(i.fieldName,s),r}createBundledUpload(n,i){const r=new FormData,{meta:s}=this.uppy.getState();return this.addMetadata(r,s,i),n.forEach(o=>{const a=this.getOptions(o),l=Rc(o);o.name?r.append(a.fieldName,l,o.name):r.append(a.fieldName,l)}),r}install(){if(this.opts.bundle){const{capabilities:n}=this.uppy.getState();this.uppy.setState({capabilities:{...n,individualCancellation:!1}})}this.uppy.addUploader(E(this,Jn))}uninstall(){if(this.opts.bundle){const{capabilities:n}=this.uppy.getState();this.uppy.setState({capabilities:{...n,individualCancellation:!0}})}this.uppy.removeUploader(E(this,Jn))}}Nn=new WeakMap,it=new WeakSet,iu=async function(n){const i=new I_(this.uppy),r=new AbortController,s=this.requests.wrapPromiseFunction(async()=>{const o=this.getOptions(n),a=E(this,Nn).call(this,[n]),l=o.formData?this.createFormDataUpload(n,o):n.data,c=typeof o.endpoint=="string"?o.endpoint:await o.endpoint(n);return a(c,{...o,body:l,signal:r.signal})});i.onFileRemove(n.id,()=>r.abort()),i.onCancelAll(n.id,()=>{r.abort()});try{await s()}catch(o){if(o.message!=="Cancelled")throw o}finally{i.remove()}},ru=async function(n){const i=new AbortController,r=this.requests.wrapPromiseFunction(async()=>{const o=this.uppy.getState().xhrUpload??{},a=E(this,Nn).call(this,n),l=this.createBundledUpload(n,{...this.opts,...o}),c=typeof this.opts.endpoint=="string"?this.opts.endpoint:await this.opts.endpoint(n);return a(c,{...this.opts,body:l,signal:i.signal})});function s(){i.abort()}this.uppy.once("cancel-all",s);try{await r()}catch(o){if(o.message!=="Cancelled")throw o}finally{this.uppy.off("cancel-all",s)}},su=function(n){var s;const i=this.getOptions(n),r=kc(i.allowedMetaFields,n.meta);return{...(s=n.remote)==null?void 0:s.body,protocol:"multipart",endpoint:i.endpoint,size:n.data.size,fieldname:i.fieldName,metadata:Object.fromEntries(r.map(o=>[o,n.meta[o]])),httpMethod:i.method,useFormData:i.formData,headers:i.headers}},ou=async function(n){await Promise.allSettled(n.map(i=>{if(i.isRemote){const r=()=>this.requests,s=new AbortController,o=l=>{l.id===i.id&&s.abort()};this.uppy.on("file-removed",o);const a=this.uppy.getRequestClientForFile(i).uploadRemoteFile(i,V(this,it,su).call(this,i),{signal:s.signal,getQueue:r});return this.requests.wrapSyncFunction(()=>{this.uppy.off("file-removed",o)},{priority:-1})(),a}return V(this,it,iu).call(this,i)}))},Jn=new WeakMap,j(Hc,"VERSION",J0.version);const ib=Object.freeze(Object.defineProperty({__proto__:null,default:Hc},Symbol.toStringTag,{value:"Module"}));T.AmountInput=bh,T.CaptchaInput=Oh,T.CheckboxButtonInput=Mh,T.CheckboxInput=jh,T.CheckboxToggle=zh,T.DropzoneInput=zg,T.EditorInput=Zh,T.EmailInput=pp,T.FileInput=dp,T.FormContainer=Ep,T.FormLabel=Ip,T.GroupControl=ua,T.LocationInput=Fp,T.MobileInput=Mp,T.MultiQuantityInput=Kp,T.PasswordInput=Lp,T.PersianDatePickerInput=Yh,T.QuantityInput=da,T.RangeSliderInput=H1,T.SecondarySubmitButton=Xp,T.Select2Input=Ag,T.SimpleUploader=i1,T.StarRatingInput=Ng,T.SubmitButton=$g,T.TelInput=jg,T.TextAreaInput=xg,T.TextInput=Ln,T.UppyInput=Z0,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,70 +1,70 @@
1
- {
2
- "name": "inertia-bootstrap-forms",
3
- "version": "1.0.61",
4
- "description": "Create bootstrap forms with inertia and twitter bootstrap",
5
- "main": "dist/inertia-bootstrap-forms.cjs.js",
6
- "module": "dist/inertia-bootstrap-forms.es.js",
7
- "type": "module",
8
- "types": "./index.d.ts",
9
- "scripts": {
10
- "dev": "vite build --watch",
11
- "build": "vite build"
12
- },
13
- "files": [
14
- "dist",
15
- "src",
16
- "index.d.ts"
17
- ],
18
- "exports": {
19
- ".": {
20
- "import": "./dist/inertia-bootstrap-forms.es.js"
21
- },
22
- "./dist/*.css": {
23
- "import": "./dist/style.css"
24
- }
25
- },
26
- "author": "NovinVision",
27
- "license": "ISC",
28
- "repository": {
29
- "type": "git",
30
- "url": "git+https://github.com/novinvision/inertia-bootstrap-forms.git"
31
- },
32
- "keywords": [
33
- "inertia",
34
- "vue",
35
- "laravel",
36
- "bootstrap",
37
- "forms"
38
- ],
39
- "dependencies": {
40
- "@tinymce/tinymce-vue": "^6.1.0",
41
- "@uppy/audio": "^3.1.0",
42
- "@uppy/core": "^5.2.0",
43
- "@uppy/dashboard": "^5.1.1",
44
- "@uppy/drag-drop": "^5.1.0",
45
- "@uppy/locales": "^5.1.1",
46
- "@uppy/vue": "^3.2.0",
47
- "@uppy/xhr-upload": "^5.1.1",
48
- "@vitejs/plugin-vue": "^5.2.4",
49
- "@vue-leaflet/vue-leaflet": "^0.10.1",
50
- "choices.js": "^11.1.0",
51
- "svelte-range-slider-pips": "^4.1.0",
52
- "vue-tel-input": "^9.3.0",
53
- "vue3-bootstrap-components": "1.0.42",
54
- "vue3-persian-datetime-picker": "^1.2.2"
55
- },
56
- "peerDependencies": {
57
- "@inertiajs/vue3": ">2.0",
58
- "dropzone": "^6.0.0-beta.2",
59
- "vue": "^3.0"
60
- },
61
- "devDependencies": {
62
- "dropzone": "^6.0.0-beta.2",
63
- "sass-embedded": "^1.89.2",
64
- "vite": "^5"
65
- },
66
- "bugs": {
67
- "url": "https://github.com/novinvision/inertia-bootstrap-forms/issues"
68
- },
69
- "homepage": "https://github.com/novinvision/inertia-bootstrap-forms#readme"
70
- }
1
+ {
2
+ "name": "inertia-bootstrap-forms",
3
+ "version": "1.0.63",
4
+ "description": "Create bootstrap forms with inertia and twitter bootstrap",
5
+ "main": "dist/inertia-bootstrap-forms.cjs.js",
6
+ "module": "dist/inertia-bootstrap-forms.es.js",
7
+ "type": "module",
8
+ "types": "./index.d.ts",
9
+ "scripts": {
10
+ "dev": "vite build --watch",
11
+ "build": "vite build"
12
+ },
13
+ "files": [
14
+ "dist",
15
+ "src",
16
+ "index.d.ts"
17
+ ],
18
+ "exports": {
19
+ ".": {
20
+ "import": "./dist/inertia-bootstrap-forms.es.js"
21
+ },
22
+ "./dist/*.css": {
23
+ "import": "./dist/style.css"
24
+ }
25
+ },
26
+ "author": "NovinVision",
27
+ "license": "ISC",
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "git+https://github.com/novinvision/inertia-bootstrap-forms.git"
31
+ },
32
+ "keywords": [
33
+ "inertia",
34
+ "vue",
35
+ "laravel",
36
+ "bootstrap",
37
+ "forms"
38
+ ],
39
+ "dependencies": {
40
+ "@tinymce/tinymce-vue": "^6.1.0",
41
+ "@uppy/audio": "^3.1.0",
42
+ "@uppy/core": "^5.2.0",
43
+ "@uppy/dashboard": "^5.1.1",
44
+ "@uppy/drag-drop": "^5.1.0",
45
+ "@uppy/locales": "^5.1.1",
46
+ "@uppy/vue": "^3.2.0",
47
+ "@uppy/xhr-upload": "^5.1.1",
48
+ "@vitejs/plugin-vue": "^5.2.4",
49
+ "@vue-leaflet/vue-leaflet": "^0.10.1",
50
+ "choices.js": "^11.1.0",
51
+ "svelte-range-slider-pips": "^4.1.0",
52
+ "vue-tel-input": "^9.3.0",
53
+ "vue3-bootstrap-components": "1.0.42",
54
+ "vue3-persian-datetime-picker": "^1.2.2"
55
+ },
56
+ "peerDependencies": {
57
+ "@inertiajs/vue3": ">2.0",
58
+ "dropzone": "^6.0.0-beta.2",
59
+ "vue": "^3.0"
60
+ },
61
+ "devDependencies": {
62
+ "dropzone": "^6.0.0-beta.2",
63
+ "sass-embedded": "^1.89.2",
64
+ "vite": "^5"
65
+ },
66
+ "bugs": {
67
+ "url": "https://github.com/novinvision/inertia-bootstrap-forms/issues"
68
+ },
69
+ "homepage": "https://github.com/novinvision/inertia-bootstrap-forms#readme"
70
+ }
package/src/UppyInput.vue CHANGED
@@ -135,6 +135,11 @@ onMounted(() => {
135
135
  XHR = module.default; // چون اکثر پکیج‌ها default export دارند
136
136
  uppy.value.use(XHR, {
137
137
  endpoint: props.url,
138
+ formData: true,
139
+ headers: {
140
+ 'Accept': 'application/json',
141
+ 'X-Requested-With': 'XMLHttpRequest' // این هدر به لاراول کمک میکند درخواست را AJAX تشخیص دهد
142
+ },
138
143
  ...props.XHRConfig
139
144
  });
140
145
  });
@@ -1,199 +0,0 @@
1
- /* --- Variables & Theme --- */
2
- :root {
3
- /* Red Palette */
4
- --uppy-color-red-50: oklch(97.1% .013 17.38);
5
- --uppy-color-red-500: oklch(63.7% .237 25.331);
6
- --uppy-color-red-600: oklch(57.7% .245 27.325);
7
- --uppy-color-red-700: oklch(50.5% .213 27.518);
8
-
9
- /* Amber Palette */
10
- --uppy-color-amber-50: oklch(98.7% .022 95.277);
11
- --uppy-color-amber-500: oklch(76.9% .188 70.08);
12
-
13
- /* Green Palette */
14
- --uppy-color-green-50: oklch(98.2% .018 155.826);
15
- --uppy-color-green-500: oklch(72.3% .219 149.579);
16
- --uppy-color-green-600: oklch(62.7% .194 149.214);
17
- --uppy-color-green-700: oklch(52.7% .154 150.069);
18
-
19
- /* Blue Palette */
20
- --uppy-color-blue-50: oklch(97% .014 254.604);
21
- --uppy-color-blue-500: oklch(62.3% .214 259.815);
22
- --uppy-color-blue-600: oklch(54.6% .245 262.881);
23
- --uppy-color-blue-700: oklch(48.8% .243 264.376);
24
-
25
- /* Gray & Basic */
26
- --uppy-color-gray-50: oklch(98.5% .002 247.839);
27
- --uppy-color-gray-100: oklch(96.7% .003 264.542);
28
- --uppy-color-gray-300: oklch(87.2% .01 258.338);
29
- --uppy-color-gray-500: oklch(55.1% .027 264.364);
30
- --uppy-color-gray-600: oklch(44.6% .03 256.802);
31
- --uppy-color-white: #ffffff;
32
-
33
- /* Spacing & Utilities */
34
- --uppy-spacing: .25rem;
35
- --uppy-text-sm: .875rem;
36
- --uppy-radius-lg: .5rem;
37
- --uppy-font-weight-medium: 500;
38
- --uppy-transition-duration: .15s;
39
- --uppy-transition-timing: cubic-bezier(.4, 0, .2, 1);
40
- }
41
-
42
- /* --- Base Reset --- */
43
- .uppy-reset, .uppy-reset * {
44
- box-sizing: border-box;
45
- border: 0 solid;
46
- margin: 0;
47
- padding: 0;
48
- }
49
-
50
- .uppy-reset {
51
- -webkit-text-size-adjust: 100%;
52
- tab-size: 4;
53
- font-family: ui-sans-serif, system-ui, sans-serif;
54
- line-height: 1.5;
55
- }
56
-
57
- .uppy-reset h1, .uppy-reset h2, .uppy-reset h3,
58
- .uppy-reset h4, .uppy-reset h5, .uppy-reset h6 {
59
- font-size: inherit;
60
- font-weight: inherit;
61
- }
62
-
63
- .uppy-reset ol, .uppy-reset ul {
64
- list-style: none;
65
- }
66
-
67
- .uppy-reset img, .uppy-reset video {
68
- max-width: 100%;
69
- height: auto;
70
- }
71
-
72
- .uppy-reset button, .uppy-reset input,
73
- .uppy-reset select, .uppy-reset textarea {
74
- font: inherit;
75
- color: inherit;
76
- }
77
-
78
- /* --- Layout & Positioning --- */
79
- .uppy-absolute { position: absolute; }
80
- .uppy-relative { position: relative; }
81
- .uppy-inset-0 { inset: 0; }
82
- .uppy-z-10 { z-index: 10; }
83
- .uppy-block { display: block; }
84
- .uppy-flex { display: flex; }
85
- .uppy-grid { display: grid; }
86
- .uppy-hidden { display: none; }
87
- .uppy-flex-1 { flex: 1 1 0%; }
88
- .uppy-flex-col { flex-direction: column; }
89
- .uppy-items-center { align-items: center; }
90
- .uppy-justify-center { justify-content: center; }
91
- .uppy-ml-auto { margin-left: auto; }
92
-
93
- /* --- Sizing --- */
94
- .uppy-h-full { height: 100%; }
95
- .uppy-w-full { width: 100%; }
96
- .uppy-h-3-4 { height: 75%; }
97
- .uppy-w-3-4 { width: 75%; }
98
- .uppy-h-32px { height: 32px; }
99
- .uppy-w-32px { width: 32px; }
100
- .uppy-min-w-18 { min-width: calc(var(--uppy-spacing) * 18); }
101
-
102
- /* --- Spacing --- */
103
- .uppy-my-2 { margin-top: calc(var(--uppy-spacing) * 2); margin-bottom: calc(var(--uppy-spacing) * 2); }
104
- .uppy-my-4 { margin-top: calc(var(--uppy-spacing) * 4); margin-bottom: calc(var(--uppy-spacing) * 4); }
105
- .uppy-p-2 { padding: calc(var(--uppy-spacing) * 2); }
106
- .uppy-p-6 { padding: calc(var(--uppy-spacing) * 6); }
107
- .uppy-gap-2 { gap: calc(var(--uppy-spacing) * 2); }
108
- .uppy-gap-4 { gap: calc(var(--uppy-spacing) * 4); }
109
-
110
- /* --- Typography --- */
111
- .uppy-text-sm {
112
- font-size: var(--uppy-text-sm);
113
- line-height: calc(1.25 / .875);
114
- }
115
- .uppy-font-medium { font-weight: var(--uppy-font-weight-medium); }
116
- .uppy-text-right { text-align: right; }
117
- .uppy-truncate {
118
- overflow: hidden;
119
- text-overflow: ellipsis;
120
- white-space: nowrap;
121
- }
122
- .uppy-tabular-nums { font-variant-numeric: tabular-nums; }
123
-
124
- /* --- Grid Systems --- */
125
- .uppy-grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
126
- .uppy-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
127
- .uppy-grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
128
- .uppy-grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
129
- .uppy-grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
130
- .uppy-grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
131
-
132
- /* --- Border & Radius --- */
133
- .uppy-rounded { border-radius: .25rem; }
134
- .uppy-rounded-full { border-radius: 9999px; }
135
- .uppy-rounded-lg { border-radius: var(--uppy-radius-lg); }
136
- .uppy-border-2 { border-width: 2px; border-style: solid; }
137
- .uppy-border-dashed { border-style: dashed; }
138
- .uppy-border-gray-300 { border-color: var(--uppy-color-gray-300); }
139
-
140
- /* --- Background Colors --- */
141
- .uppy-bg-blue-500 { background-color: var(--uppy-color-blue-500); }
142
- .uppy-bg-blue-700 { background-color: var(--uppy-color-blue-700); }
143
- .uppy-bg-gray-50 { background-color: var(--uppy-color-gray-50); }
144
- .uppy-bg-green-500 { background-color: var(--uppy-color-green-500); }
145
- .uppy-bg-red-500 { background-color: var(--uppy-color-red-500); }
146
- .uppy-bg-transparent { background-color: transparent; }
147
-
148
- /* --- Text Colors --- */
149
- .uppy-text-blue-500 { color: var(--uppy-color-blue-500); }
150
- .uppy-text-gray-500 { color: var(--uppy-color-gray-500); }
151
- .uppy-text-green-500 { color: var(--uppy-color-green-500); }
152
- .uppy-text-red-500 { color: var(--uppy-color-red-500); }
153
- .uppy-text-white { color: var(--uppy-color-white); }
154
-
155
- /* --- Transitions & Effects --- */
156
- .uppy-transition-all {
157
- transition-property: all;
158
- transition-duration: var(--uppy-transition-duration);
159
- transition-timing-function: var(--uppy-transition-timing);
160
- }
161
- .uppy-duration-200 { transition-duration: .2s; }
162
- .uppy-cursor-pointer { cursor: pointer; }
163
- .uppy-disabled-not-allowed:disabled { cursor: not-allowed; }
164
-
165
- /* --- Hover States --- */
166
- @media (hover: hover) {
167
- .uppy-hover-bg-blue-50:hover { background-color: var(--uppy-color-blue-50); }
168
- .uppy-hover-bg-blue-600:hover { background-color: var(--uppy-color-blue-600); }
169
- .uppy-hover-bg-red-50:hover { background-color: var(--uppy-color-red-50); }
170
- .uppy-hover-text-blue-700:hover { color: var(--uppy-color-blue-700); }
171
- }
172
-
173
- /* --- Progress Bar Styles --- */
174
- .uppy-progress-blue::-webkit-progress-value { background-color: var(--uppy-color-blue-500); }
175
- .uppy-progress-blue::-moz-progress-bar { background-color: var(--uppy-color-blue-500); }
176
- .uppy-progress-green::-webkit-progress-value { background-color: var(--uppy-color-green-500); }
177
- .uppy-progress-red::-webkit-progress-value { background-color: var(--uppy-color-red-500); }
178
- .uppy-progress-bar-bg::-webkit-progress-bar { background-color: var(--uppy-color-gray-100); }
179
-
180
- .uppy-reset p {
181
- margin-bottom: 0;
182
- }
183
-
184
- .uppy-file-lists > ul {
185
- list-style: none;
186
- padding: 0;
187
- margin: 0;
188
- }
189
-
190
- .uppy-input-area .uppy-error {
191
- display: block;
192
- padding: 5px;
193
- background-color: #f8d7da;
194
- border: 1px solid #f5c2c7;
195
- color: #842029;
196
- text-align: center;
197
- border-radius: 0.5rem;
198
- margin-bottom: 5px;
199
- }