(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,849138,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(){let e,t,r=r=>{if(r&&("object"==typeof r||"function"==typeof r)){if(e)return e.has(r)}else if(t)return t.has(r);return!1};return{get:r=>{if(r&&("object"==typeof r||"function"==typeof r)){if(e)return e.get(r)}else if(t)return t.get(r)},set:(r,o)=>{r&&("object"==typeof r||"function"==typeof r)?(e||(e=new WeakMap),e.set(r,o)):(t||(t=new Map),t.set(r,o))},has:r,assert:e=>{if(!r(e))throw TypeError("Side channel does not contain the given key")}}},("object"==typeof r.default&&null!==r.default||"function"==typeof r.default)&&(Object.assign(r.default,r),t.exports=r.default)},195241,(e,t,r)=>{"use strict";var o=String.prototype.replace,n=/%20/g,a="RFC3986";t.exports={default:a,formatters:{RFC1738:function(e){return o.call(e,n,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:a}},278324,(e,t,r)=>{"use strict";var o=e.r(195241),n=e.r(849138),a=Object.prototype.hasOwnProperty,i=Array.isArray,l=n(),s=function(e,t){return l.set(e,t),e},c=function(e){return l.has(e)},u=function(e){return l.get(e)},f=function(e,t){l.set(e,t)},p=function(){for(var e=[],t=0;t<256;++t)e[e.length]="%"+((t<16?"0":"")+t.toString(16)).toUpperCase();return e}(),d=function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(i(r)){for(var o=[],n=0;nr?s(y(a,{plainObjects:o}),a.length-1):a},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],o=0;o=1024?i.slice(s,s+1024):i,u=[],f=0;f=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||a===o.RFC1738&&(40===d||41===d)){u[u.length]=c.charAt(f);continue}if(d<128){u[u.length]=p[d];continue}if(d<2048){u[u.length]=p[192|d>>6]+p[128|63&d];continue}if(d<55296||d>=57344){u[u.length]=p[224|d>>12]+p[128|d>>6&63]+p[128|63&d];continue}f+=1,d=65536+((1023&d)<<10|1023&c.charCodeAt(f)),u[u.length]=p[240|d>>18]+p[128|d>>12&63]+p[128|d>>6&63]+p[128|63&d]}l+=u.join("")}return l},isBuffer:function(e){return!!e&&"object"==typeof e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isOverflow:c,isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},markOverflow:s,maybeMap:function(e,t){if(i(e)){for(var r=[],o=0;oo.arrayLimit)return s(y(t.concat(r),o),n);t[n]=r}else if(!t||"object"!=typeof t)return[t,r];else if(c(t)){var l=u(t)+1;t[l]=r,f(t,l)}else{if(o&&o.strictMerge)return[t,r];(o&&(o.plainObjects||o.allowPrototypes)||!a.call(Object.prototype,r))&&(t[r]=!0)}return t}if(!t||"object"!=typeof t){if(c(r)){for(var p=Object.keys(r),d=o&&o.plainObjects?{__proto__:null,0:t}:{0:t},h=0;ho.arrayLimit?s(y(m,o),m.length-1):m}var g=t;return(i(t)&&!i(r)&&(g=y(t,o)),i(t)&&i(r))?(r.forEach(function(r,n){if(a.call(t,n)){var i=t[n];i&&"object"==typeof i&&r&&"object"==typeof r?t[n]=e(i,r,o):t[t.length]=r}else t[n]=r}),t):Object.keys(r).reduce(function(t,n){var i=r[n];if(a.call(t,n)?t[n]=e(t[n],i,o):t[n]=i,c(r)&&!c(t)&&s(t,u(r)),c(t)){var l=parseInt(n,10);String(l)===n&&l>=0&&l>u(t)&&f(t,l)}return t},g)}}},729280,(e,t,r)=>{"use strict";var o=e.r(849138),n=e.r(278324),a=e.r(195241),i=Object.prototype.hasOwnProperty,l={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},s=Array.isArray,c=Array.prototype.push,u=function(e,t){c.apply(e,s(t)?t:[t])},f=Date.prototype.toISOString,p=a.default,d={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:n.encode,encodeValuesOnly:!1,filter:void 0,format:p,formatter:a.formatters[p],indices:!1,serializeDate:function(e){return f.call(e)},skipNulls:!1,strictNullHandling:!1},y={},h=function e(t,r,a,i,l,c,f,p,h,m,g,_,b,v,w,S,O,E){for(var D,x,P=t,A=E,j=0,k=!1;void 0!==(A=A.get(y))&&!k;){var I=A.get(t);if(j+=1,void 0!==I)if(I===j)throw RangeError("Cyclic object value");else k=!0;void 0===A.get(y)&&(j=0)}if("function"==typeof m?P=m(r,P):P instanceof Date?P=b(P):"comma"===a&&s(P)&&(P=n.maybeMap(P,function(e){return e instanceof Date?b(e):e})),null===P){if(c)return h&&!S?h(r,d.encoder,O,"key",v):r;P=""}if("string"==typeof(D=P)||"number"==typeof D||"boolean"==typeof D||"symbol"==typeof D||"bigint"==typeof D||n.isBuffer(P))return h?[w(S?r:h(r,d.encoder,O,"key",v))+"="+w(h(P,d.encoder,O,"value",v))]:[w(r)+"="+w(String(P))];var L=[];if(void 0===P)return L;if("comma"===a&&s(P))S&&h&&(P=n.maybeMap(P,h)),x=[{value:P.length>0?P.join(",")||null:void 0}];else if(s(m))x=m;else{var R=Object.keys(P);x=g?R.sort(g):R}var N=p?String(r).replace(/\./g,"%2E"):String(r),C=i&&s(P)&&1===P.length?N+"[]":N;if(l&&s(P)&&0===P.length)return C+"[]";for(var M=0;M0?b+_:""}},874816,(e,t,r)=>{"use strict";var o=e.r(278324),n=Object.prototype.hasOwnProperty,a=Array.isArray,i={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:o.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},l=function(e,t,r){if(e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1)return e.split(",");if(t.throwOnLimitExceeded&&r>=t.arrayLimit)throw RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");return e},s=function(e,t){var r={__proto__:null},s=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;s=s.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var c=t.parameterLimit===1/0?void 0:t.parameterLimit,u=s.split(t.delimiter,t.throwOnLimitExceeded?c+1:c);if(t.throwOnLimitExceeded&&u.length>c)throw RangeError("Parameter limit exceeded. Only "+c+" parameter"+(1===c?"":"s")+" allowed.");var f=-1,p=t.charset;if(t.charsetSentinel)for(d=0;d-1)?r[y]=o.combine(r[y],h,t.arrayLimit,t.plainObjects):b&&"last"!==t.duplicates||(r[y]=h)}}return r},c=function(e,t,r,n){var a=0;if(e.length>0&&"[]"===e[e.length-1]){var i=e.slice(0,-1).join("");a=Array.isArray(t)&&t[i]?t[i].length:0}for(var s=n?t:l(t,r,a),c=e.length-1;c>=0;--c){var u,f=e[c];if("[]"===f&&r.parseArrays)u=o.isOverflow(s)?s:r.allowEmptyArrays&&(""===s||r.strictNullHandling&&null===s)?[]:o.combine([],s,r.arrayLimit,r.plainObjects);else{u=r.plainObjects?{__proto__:null}:{};var p="["===f.charAt(0)&&"]"===f.charAt(f.length-1)?f.slice(1,-1):f,d=r.decodeDotInKeys?p.replace(/%2E/g,"."):p,y=parseInt(d,10),h=!isNaN(y)&&f!==d&&String(y)===d&&y>=0&&r.parseArrays;if(r.parseArrays||""!==d)if(h&&y{"use strict";var o=e.r(729280),n=e.r(874816);t.exports={formats:e.r(195241),parse:n,stringify:o}},211857,11512,e=>{"use strict";var t,r,o=e.i(464837);(t={}).OPENAI="openai",t.AZURE_OPENAI="azure_openai",t.ANTHROPIC="anthropic",t.Replicate="replicate",t.HuggingfaceHub="huggingface_hub",t.MiniMax="minimax",t.Spark="spark",t.Tongyi="tongyi",t.ChatGLM="chatglm";var n=((r={}).fireCrawl="firecrawl",r.jinaReader="jinareader",r.waterCrawl="watercrawl",r);e.s(["DataSourceProvider",()=>n],11512);var a=e.i(367916);e.s(["checkFirecrawlTaskStatus",0,e=>(0,a.get)(`website/crawl/status/${e}`,{params:{provider:n.fireCrawl}},{silent:!0}),"checkIsUsedInApp",0,e=>(0,a.get)(`/datasets/${e}/use-check`,{},{silent:!0}),"checkJinaReaderTaskStatus",0,e=>(0,a.get)(`website/crawl/status/${e}`,{params:{provider:"jinareader"}},{silent:!0}),"checkUsageExternalAPI",0,e=>{let{apiTemplateId:t}=e;return(0,a.get)(`/datasets/external-knowledge-api/${t}/use-check`)},"checkWatercrawlTaskStatus",0,e=>(0,a.get)(`website/crawl/status/${e}`,{params:{provider:n.waterCrawl}},{silent:!0}),"createApikey",0,e=>{let{url:t,body:r}=e;return(0,a.post)(t,r)},"createDocument",0,e=>{let{datasetId:t,body:r}=e;return(0,a.post)(`/datasets/${t}/documents`,{body:r})},"createEmptyDataset",0,e=>{let{name:t}=e;return(0,a.post)("/datasets",{body:{name:t}})},"createExternalAPI",0,e=>{let{body:t}=e;return(0,a.post)("/datasets/external-knowledge-api",{body:t})},"createExternalKnowledgeBase",0,e=>{let{body:t}=e;return(0,a.post)("/datasets/external",{body:t})},"createFirecrawlTask",0,e=>(0,a.post)("website/crawl",{body:{...e,provider:n.fireCrawl}}),"createFirstDocument",0,e=>{let{body:t}=e;return(0,a.post)("/datasets/init",{body:t})},"createJinaReaderTask",0,e=>(0,a.post)("website/crawl",{body:{...e,provider:n.jinaReader}}),"createWatercrawlTask",0,e=>(0,a.post)("website/crawl",{body:{...e,provider:n.waterCrawl}}),"delApikey",0,e=>{let{url:t,params:r}=e;return(0,a.del)(t,r)},"deleteDataset",0,e=>(0,a.del)(`/datasets/${e}`),"deleteExternalAPI",0,e=>{let{apiTemplateId:t}=e;return(0,a.del)(`/datasets/external-knowledge-api/${t}`)},"downloadDocumentsZip",0,e=>{let{datasetId:t,documentIds:r}=e;return(0,a.post)(`/datasets/${t}/documents/download-zip`,{body:{document_ids:r}})},"fetchDatasets",0,e=>{let{url:t,params:r}=e,n=o.default.stringify(r,{indices:!1});return(0,a.get)(`${t}?${n}`)},"fetchDefaultProcessRule",0,e=>{let{url:t}=e;return(0,a.get)(t)},"fetchDocumentDownloadUrl",0,e=>{let{datasetId:t,documentId:r}=e;return(0,a.get)(`/datasets/${t}/documents/${r}/download`,{})},"fetchExternalAPI",0,e=>{let{apiTemplateId:t}=e;return(0,a.get)(`/datasets/external-knowledge-api/${t}`)},"fetchFileIndexingEstimate",0,e=>(0,a.post)("/datasets/indexing-estimate",{body:e}),"fetchIndexingStatus",0,e=>{let{datasetId:t,documentId:r}=e;return(0,a.get)(`/datasets/${t}/documents/${r}/indexing-status`,{})},"fetchIndexingStatusBatch",0,e=>{let{datasetId:t,batchId:r}=e;return(0,a.get)(`/datasets/${t}/batch/${r}/indexing-status`,{})},"fetchNotionPagePreview",0,e=>{let{pageID:t,pageType:r,credentialID:o}=e;return(0,a.get)(`notion/pages/${t}/${r}/preview`,{params:{credential_id:o}})},"modifyDocMetadata",0,e=>{let{datasetId:t,documentId:r,body:o}=e;return(0,a.put)(`/datasets/${t}/documents/${r}/metadata`,{body:o})},"pauseDocIndexing",0,e=>{let{datasetId:t,documentId:r}=e;return(0,a.patch)(`/datasets/${t}/documents/${r}/processing/pause`)},"renameDocumentName",0,e=>{let{datasetId:t,documentId:r,name:o}=e;return(0,a.post)(`/datasets/${t}/documents/${r}/rename`,{body:{name:o}})},"resumeDocIndexing",0,e=>{let{datasetId:t,documentId:r}=e;return(0,a.patch)(`/datasets/${t}/documents/${r}/processing/resume`)},"retryErrorDocs",0,e=>{let{datasetId:t,document_ids:r}=e;return(0,a.post)(`/datasets/${t}/retry`,{body:{document_ids:r}})},"updateDatasetSetting",0,e=>{let{datasetId:t,body:r}=e;return(0,a.patch)(`/datasets/${t}`,{body:r})},"updateExternalAPI",0,e=>{let{apiTemplateId:t,body:r}=e;return(0,a.patch)(`/datasets/external-knowledge-api/${t}`,{body:r})}],211857)},805735,e=>{"use strict";var t,r=Symbol.for("immer-nothing"),o=Symbol.for("immer-draftable"),n=Symbol.for("immer-state");function a(e){for(var t=arguments.length,r=Array(t>1?t-1:0),o=1;o!!e&&!!e[n];function h(e){return!!e&&(_(e)||E(e)||!!e[o]||!!e[s]?.[o]||D(e)||x(e))}var m=i[c][s].toString(),g=new WeakMap;function _(e){if(!e||!P(e))return!1;let t=l(e);if(null===t||t===i[c])return!0;let r=i.hasOwnProperty.call(t,s)&&t[s];if(r===Object)return!0;if(!A(r))return!1;let o=g.get(r);return void 0===o&&(o=Function.toString.call(r),g.set(r,o)),o===m}function b(e,t){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];0===v(e)?(r?Reflect.ownKeys(e):i.keys(e)).forEach(r=>{t(r,e[r],e)}):e.forEach((r,o)=>t(o,r,e))}function v(e){let t=e[n];return t?t.type_:E(e)?1:D(e)?2:3*!!x(e)}var w=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:v(e);return 2===r?e.has(t):i[c].hasOwnProperty.call(e,t)},S=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:v(e);return 2===r?e.get(t):e[t]},O=function(e,t,r){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:v(e);2===o?e.set(t,r):3===o?e.add(r):e[t]=r},E=Array.isArray,D=e=>e instanceof Map,x=e=>e instanceof Set,P=e=>"object"==typeof e,A=e=>"function"==typeof e,j=e=>e.modified_?e.copy_:e.base_;function k(e,t){if(D(e))return new Map(e);if(x(e))return new Set(e);if(E(e))return Array[c].slice.call(e);let r=_(e);if(!0!==t&&("class_only"!==t||r)){let t=l(e);if(null!==t&&r)return{...e};let o=i.create(t);return i.assign(o,e)}{let t=i.getOwnPropertyDescriptors(e);delete t[n];let r=Reflect.ownKeys(t);for(let o=0;o1&&void 0!==arguments[1]&&arguments[1];return R(e)||y(e)||!h(e)||(v(e)>1&&i.defineProperties(e,{set:L,add:L,clear:L,delete:L}),i.freeze(e),t&&b(e,(e,t)=>{I(t,!0)},!1)),e}var L={[d]:function(){a(2)}};function R(e){return!(null!==e&&P(e))||i.isFrozen(e)}var N="MapSet",C="Patches",M="ArrayMethods",T={};function z(e){let t=T[e];return t||a(0,e),t}var F=e=>!!T[e];function $(e,t){t&&(e.patchPlugin_=z(C),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function K(e){H(e),e.drafts_.forEach(B),e.drafts_=null}function H(e){e===t&&(t=e.parent_)}var U=e=>t={drafts_:[],parent_:t,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:F(N)?z(N):void 0,arrayMethodsPlugin_:F(M)?z(M):void 0};function B(e){let t=e[n];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Q(e,t){t.unfinalizedDrafts_=t.drafts_.length;let o=t.drafts_[0];if(void 0!==e&&e!==o){o[n].modified_&&(K(t),a(4)),h(e)&&(e=W(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(o[n].base_,e,t)}else e=W(t,o);return function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&I(t,r)}(t,e,!0),K(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==r?e:void 0}function W(e,t){if(R(t))return t;let r=t[n];if(!r)return q(t,e.handledSet_,e);if(!J(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){let{callbacks_:t}=r;if(t)for(;t.length>0;)t.pop()(e);X(r,e)}return r.copy_}function V(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var J=(e,t)=>e.scope_===t,Z=[];function G(e,t,r,o){let n=e.copy_||e.base_,a=e.type_;if(void 0!==o&&S(n,o,a)===t)return void O(n,o,r,a);if(!e.draftLocations_){let t=e.draftLocations_=new Map;b(n,(e,r)=>{if(y(r)){let o=t.get(r)||[];o.push(e),t.set(r,o)}})}for(let o of e.draftLocations_.get(t)??Z)O(n,o,r,a)}function X(e,t){if(e.modified_&&!e.finalized_&&(3===e.type_||1===e.type_&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:r}=t;if(r){let o=r.getPath(e);o&&r.generatePatches_(e,o,t)}V(e)}}function q(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||y(e)||t.has(e)||!h(e)||R(e)||(t.add(e),b(e,(o,a)=>{if(y(a)){let t=a[n];J(t,r)&&(O(e,o,j(t),e.type_),V(t))}else h(a)&&q(a,t,r)})),e}var Y={get(e,t){let r;if(t===n)return e;let o=e.scope_.arrayMethodsPlugin_,a=1===e.type_&&"string"==typeof t;if(a&&o?.isArrayOperationMethod(t))return o.createMethodInterceptor(e,t);let i=e.copy_||e.base_;if(!w(i,t,e.type_)){var l;let r;return l=e,(r=er(i,t))?d in r?r[d]:r.get?.call(l.draft_):void 0}let s=i[t];if(e.finalized_||!h(s)||a&&e.operationMethod&&o?.isMutatingArrayMethod(e.operationMethod)&&Number.isInteger(r=+t)&&String(r)===t)return s;if(s===et(e.base_,t)){en(e);let r=1===e.type_?+t:t,o=ea(e.scope_,s,e,r);return e.copy_[r]=o}return s},has:(e,t)=>t in(e.copy_||e.base_),ownKeys:e=>Reflect.ownKeys(e.copy_||e.base_),set(e,t,r){let o=er(e.copy_||e.base_,t);if(o?.set)return o.set.call(e.draft_,r),!0;if(!e.modified_){let o=et(e.copy_||e.base_,t),a=o?.[n];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if((r===o?0!==r||1/r==1/o:r!=r&&o!=o)&&(void 0!==r||w(e.base_,t,e.type_)))return!0;en(e),eo(e)}return!!(e.copy_[t]===r&&(void 0!==r||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t]))||(e.copy_[t]=r,e.assigned_.set(t,!0),!function(e,t,r){let{scope_:o}=e;if(y(r)){let a=r[n];J(a,o)&&a.callbacks_.push(function(){en(e),G(e,r,j(a),t)})}else h(r)&&e.callbacks_.push(function(){let n=e.copy_||e.base_;3===e.type_?n.has(r)&&q(r,o.handledSet_,o):S(n,t,e.type_)===r&&o.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&q(S(e.copy_,t,e.type_),o.handledSet_,o)})}(e,t,r),!0)},deleteProperty:(e,t)=>(en(e),void 0!==et(e.base_,t)||t in e.base_?(e.assigned_.set(t,!1),eo(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){let r=e.copy_||e.base_,o=Reflect.getOwnPropertyDescriptor(r,t);return o?{[p]:!0,[u]:1!==e.type_||"length"!==t,[f]:o[f],[d]:r[t]}:o},defineProperty(){a(11)},getPrototypeOf:e=>l(e.base_),setPrototypeOf(){a(12)}},ee={};for(let e in Y){let t=Y[e];ee[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}function et(e,t){let r=e[n];return(r?r.copy_||r.base_:e)[t]}function er(e,t){if(!(t in e))return;let r=l(e);for(;r;){let e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=l(r)}}function eo(e){!e.modified_&&(e.modified_=!0,e.parent_&&eo(e.parent_))}function en(e){e.copy_||(e.assigned_=new Map,e.copy_=k(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function ea(e,r,o,n){let[a,i]=D(r)?z(N).proxyMap_(r,o):x(r)?z(N).proxySet_(r,o):function(e,r){let o=E(e),n={type_:+!!o,scope_:r?r.scope_:t,modified_:!1,finalized_:!1,assigned_:void 0,parent_:r,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},a=n,i=Y;o&&(a=[n],i=ee);let{revoke:l,proxy:s}=Proxy.revocable(a,i);return n.draft_=s,n.revoke_=l,[s,n]}(r,o);if((o?.scope_??t).drafts_.push(a),i.callbacks_=o?.callbacks_??[],i.key_=n,o&&void 0!==n)o.callbacks_.push(function(e){if(!i||!J(i,e))return;e.mapSetPlugin_?.fixSetContents(i);let t=j(i);G(o,i.draft_??i,t,n),X(i,e)});else i.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(i);let{patchPlugin_:t}=e;i.modified_&&t&&t.generatePatches_(i,[],e)});return a}ee.deleteProperty=function(e,t){return ee.set.call(this,e,t,void 0)},ee.set=function(e,t,r){return Y.set.call(this,e[0],t,r,e[0])};var ei=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,o)=>{let n;if(A(e)&&!A(t)){let r=t;t=e;let o=this;return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r;for(var n=arguments.length,a=Array(n>1?n-1:0),i=1;it.call(this,e,...a))}}if(A(t)||a(6),void 0===o||A(o)||a(7),h(e)){let r=U(this),a=ea(r,e,void 0),i=!0;try{n=t(a),i=!1}finally{i?K(r):H(r)}return $(r,o),Q(n,r)}if(e&&P(e))a(1,e);else{if(void 0===(n=t(e))&&(n=e),n===r&&(n=void 0),this.autoFreeze_&&I(n,!0),o){let t=[],r=[];z(C).generateReplacementPatches_(e,n,{patches_:t,inversePatches_:r}),o(t,r)}return n}},this.produceWithPatches=(e,t)=>{let r,o;if(A(e)){var n=this;return function(t){for(var r=arguments.length,o=Array(r>1?r-1:0),a=1;ae(t,...o))}}return[this.produce(e,t,(e,t)=>{r=e,o=t}),r,o]},(e=>"boolean"==typeof e)(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),(e=>"boolean"==typeof e)(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),(e=>"boolean"==typeof e)(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){var t;h(e)||a(8),y(e)&&(y(t=e)||a(10,t),e=function e(t){let r;if(!h(t)||R(t))return t;let o=t[n],a=!0;if(o){if(!o.modified_)return o.base_;o.finalized_=!0,r=k(t,o.scope_.immer_.useStrictShallowCopy_),a=o.scope_.immer_.shouldUseStrictIteration()}else r=k(t,!0);return b(r,(t,o)=>{O(r,t,e(o))},a),o&&(o.finalized_=!1),r}(t));let r=U(this),o=ea(r,e,void 0);return o[n].isManual_=!0,H(r),o}finishDraft(e,t){let r=e&&e[n];r&&r.isManual_||a(9);let{scope_:o}=r;return $(o,t),Q(void 0,o)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let o=t[r];if(0===o.path.length&&"replace"===o.op){e=o.value;break}}r>-1&&(t=t.slice(r+1));let o=z(C).applyPatches_;return y(e)?o(e,t):this.produce(e,e=>o(e,t))}},el=ei.produce,es=ei.setAutoFreeze.bind(ei);e.s(["produce",()=>el,"setAutoFreeze",()=>es])}]);