Kargi-Sitesi/node_modules/rxfire/storage/index.cjs.js.map

1 line
No EOL
6 KiB
Text

{"version":3,"file":"index.cjs.js","sources":["../../storage/index.ts"],"sourcesContent":["import { getDownloadURL as _getDownloadURL, getMetadata as _getMetadata, uploadBytesResumable as _uploadBytesResumable, uploadString as _uploadString, } from 'firebase/storage';\nimport { Observable, from } from 'rxjs';\nimport { map, shareReplay } from 'rxjs/operators';\nexport function fromTask(task) {\n return new Observable(function (subscriber) {\n var lastSnapshot = null;\n var complete = false;\n var hasError = false;\n var error = null;\n var emit = function (snapshot) {\n lastSnapshot = snapshot;\n schedule();\n };\n var id = null;\n /**\n * Schedules an async event to check and emit\n * the most recent snapshot, and complete or error\n * if necessary.\n */\n var schedule = function () {\n if (!id) {\n id = setTimeout(function () {\n id = null;\n if (lastSnapshot)\n subscriber.next(lastSnapshot);\n if (complete)\n subscriber.complete();\n if (hasError)\n subscriber.error(error);\n });\n }\n };\n subscriber.add(function () {\n // If we have any emissions checks scheduled, cancel them.\n if (id)\n clearTimeout(id);\n });\n // Emit the initial snapshot\n emit(task.snapshot);\n // Take each update and schedule them to be emitted (see `emit`)\n subscriber.add(task.on('state_changed', emit));\n // task is a promise, so we can convert that to an observable,\n // this is done for the ergonomics around making sure we don't\n // try to push errors or completions through closed subscribers\n subscriber.add(from(task).subscribe({\n next: emit,\n error: function (err) {\n hasError = true;\n error = err;\n schedule();\n },\n complete: function () {\n complete = true;\n schedule();\n },\n }));\n });\n}\nexport function getDownloadURL(ref) {\n return from(_getDownloadURL(ref));\n}\n// TODO: fix storage typing in firebase, then apply the same fix here\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getMetadata(ref) {\n return from(_getMetadata(ref));\n}\n// MARK: Breaking change (renaming put to uploadBytesResumable)\nexport function uploadBytesResumable(ref, data, metadata) {\n return new Observable(function (subscriber) {\n var task = _uploadBytesResumable(ref, data, metadata);\n var subscription = fromTask(task).subscribe(subscriber);\n return function unsubscribe() {\n subscription.unsubscribe();\n task.cancel();\n };\n }).pipe(shareReplay({ bufferSize: 1, refCount: true }));\n}\n// MARK: Breaking change (renaming put to uploadString)\nexport function uploadString(ref, data, format, metadata) {\n return from(_uploadString(ref, data, format, metadata));\n}\nexport function percentage(task) {\n return fromTask(task).pipe(map(function (snapshot) { return ({\n progress: (snapshot.bytesTransferred / snapshot.totalBytes) * 100,\n snapshot: snapshot,\n }); }));\n}\n"],"names":["Observable","from","_getDownloadURL","_getMetadata","_uploadBytesResumable","shareReplay","_uploadString","map"],"mappings":";;;;;;;;AAGO,SAAS,QAAQ,CAAC,IAAI,EAAE;AAC/B,IAAI,OAAO,IAAIA,eAAU,CAAC,UAAU,UAAU,EAAE;AAChD,QAAQ,IAAI,YAAY,GAAG,IAAI,CAAC;AAChC,QAAQ,IAAI,QAAQ,GAAG,KAAK,CAAC;AAC7B,QAAQ,IAAI,QAAQ,GAAG,KAAK,CAAC;AAC7B,QAAQ,IAAI,KAAK,GAAG,IAAI,CAAC;AACzB,QAAQ,IAAI,IAAI,GAAG,UAAU,QAAQ,EAAE;AACvC,YAAY,YAAY,GAAG,QAAQ,CAAC;AACpC,YAAY,QAAQ,EAAE,CAAC;AACvB,SAAS,CAAC;AACV,QAAQ,IAAI,EAAE,GAAG,IAAI,CAAC;AACtB;AACA;AACA;AACA;AACA;AACA,QAAQ,IAAI,QAAQ,GAAG,YAAY;AACnC,YAAY,IAAI,CAAC,EAAE,EAAE;AACrB,gBAAgB,EAAE,GAAG,UAAU,CAAC,YAAY;AAC5C,oBAAoB,EAAE,GAAG,IAAI,CAAC;AAC9B,oBAAoB,IAAI,YAAY;AACpC,wBAAwB,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AACtD,oBAAoB,IAAI,QAAQ;AAChC,wBAAwB,UAAU,CAAC,QAAQ,EAAE,CAAC;AAC9C,oBAAoB,IAAI,QAAQ;AAChC,wBAAwB,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAChD,iBAAiB,CAAC,CA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