remnote-bridge 0.1.7 → 0.1.8
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/README.md +30 -6
- package/dist/cli/commands/connect.js +31 -2
- package/dist/cli/commands/health.js +111 -1
- package/dist/cli/commands/setup.js +112 -0
- package/dist/cli/daemon/daemon.js +101 -20
- package/dist/cli/daemon/headless-browser.js +291 -0
- package/dist/cli/daemon/static-server.js +84 -0
- package/dist/cli/main.js +22 -6
- package/dist/cli/server/ws-server.js +62 -1
- package/dist/mcp/daemon-client.js +4 -1
- package/dist/mcp/instructions.js +52 -5
- package/dist/mcp/tools/infra-tools.js +39 -9
- package/package.json +5 -1
- package/remnote-plugin/dist/bridge-icon.svg +8 -0
- package/remnote-plugin/dist/bridge_widget-sandbox.js +65 -0
- package/remnote-plugin/dist/bridge_widget.js +65 -0
- package/remnote-plugin/dist/index-sandbox.css +591 -0
- package/remnote-plugin/dist/index-sandbox.js +64 -0
- package/remnote-plugin/dist/index.css +591 -0
- package/remnote-plugin/dist/index.html +9 -0
- package/remnote-plugin/dist/index.js +64 -0
- package/remnote-plugin/dist/manifest.json +22 -0
- package/skills/remnote-bridge/SKILL.md +48 -4
- package/skills/remnote-bridge/instructions/connect.md +40 -10
- package/skills/remnote-bridge/instructions/disconnect.md +1 -1
- package/skills/remnote-bridge/instructions/health.md +67 -1
- package/skills/remnote-bridge/instructions/overall.md +1 -1
- package/skills/remnote-bridge/instructions/setup.md +130 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
const IMPORT_META=import.meta;(()=>{var Pf={216(qt,G,Ke){var Rt=Object.defineProperty,Ne=Object.defineProperties,et=Object.getOwnPropertyDescriptors,B=Object.getOwnPropertySymbols,mn=Object.prototype.hasOwnProperty,_t=Object.prototype.propertyIsEnumerable,Xe=(ct,He,dt)=>He in ct?Rt(ct,He,{enumerable:!0,configurable:!0,writable:!0,value:dt}):ct[He]=dt,O=(ct,He)=>{for(var dt in He||(He={}))mn.call(He,dt)&&Xe(ct,dt,He[dt]);if(B)for(var dt of B(He))_t.call(He,dt)&&Xe(ct,dt,He[dt]);return ct},X=(ct,He)=>Ne(ct,et(He)),d=(ct,He)=>Rt(ct,"name",{value:He,configurable:!0}),bt=(ct,He,dt)=>new Promise((nn,Ge)=>{var ot=me=>{try{ae(dt.next(me))}catch(Ie){Ge(Ie)}},ie=me=>{try{ae(dt.throw(me))}catch(Ie){Ge(Ie)}},ae=me=>me.done?nn(me.value):Promise.resolve(me.value).then(ot,ie);ae((dt=dt.apply(ct,He)).next())});d(function(ct,He){qt.exports=He(Ke(999),Ke(874))},"webpackUniversalModuleDefinition")(self,function(ct,He){return(function(){var dt={944:function(ie){var ae=1e3,me=ae*60,Ie=me*60,Me=Ie*24,tt=Me*7,W=Me*365.25;ie.exports=function(ne,se){se=se||{};var we=typeof ne;if(we==="string"&&ne.length>0)return Be(ne);if(we==="number"&&isFinite(ne))return se.long?de(ne):Ve(ne);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(ne))};function Be(ne){if(ne=String(ne),!(ne.length>100)){var se=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(ne);if(se){var we=parseFloat(se[1]),ee=(se[2]||"ms").toLowerCase();switch(ee){case"years":case"year":case"yrs":case"yr":case"y":return we*W;case"weeks":case"week":case"w":return we*tt;case"days":case"day":case"d":return we*Me;case"hours":case"hour":case"hrs":case"hr":case"h":return we*Ie;case"minutes":case"minute":case"mins":case"min":case"m":return we*me;case"seconds":case"second":case"secs":case"sec":case"s":return we*ae;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return we;default:return}}}}d(Be,"parse");function Ve(ne){var se=Math.abs(ne);return se>=Me?Math.round(ne/Me)+"d":se>=Ie?Math.round(ne/Ie)+"h":se>=me?Math.round(ne/me)+"m":se>=ae?Math.round(ne/ae)+"s":ne+"ms"}d(Ve,"fmtShort");function de(ne){var se=Math.abs(ne);return se>=Me?pe(ne,se,Me,"day"):se>=Ie?pe(ne,se,Ie,"hour"):se>=me?pe(ne,se,me,"minute"):se>=ae?pe(ne,se,ae,"second"):ne+" ms"}d(de,"fmtLong");function pe(ne,se,we,ee){var ge=se>=we*1.5;return Math.round(ne/we)+" "+ee+(ge?"s":"")}d(pe,"plural")},854:function(ie,ae,me){ae.formatArgs=Me,ae.save=tt,ae.load=W,ae.useColors=Ie,ae.storage=Be(),ae.destroy=(()=>{let de=!1;return()=>{de||(de=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),ae.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Ie(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}d(Ie,"useColors");function Me(de){if(de[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+de[0]+(this.useColors?"%c ":" ")+"+"+ie.exports.humanize(this.diff),!this.useColors)return;const pe="color: "+this.color;de.splice(1,0,pe,"color: inherit");let ne=0,se=0;de[0].replace(/%[a-zA-Z%]/g,we=>{we!=="%%"&&(ne++,we==="%c"&&(se=ne))}),de.splice(se,0,pe)}d(Me,"formatArgs"),ae.log=console.debug||console.log||(()=>{});function tt(de){try{de?ae.storage.setItem("debug",de):ae.storage.removeItem("debug")}catch{}}d(tt,"save");function W(){let de;try{de=ae.storage.getItem("debug")}catch{}return!de&&typeof process<"u"&&"env"in process&&(de=process.env.DEBUG),de}d(W,"load");function Be(){try{return localStorage}catch{}}d(Be,"localstorage"),ie.exports=me(892)(ae);const{formatters:Ve}=ie.exports;Ve.j=function(de){try{return JSON.stringify(de)}catch(pe){return"[UnexpectedJSONParseError]: "+pe.message}}},892:function(ie,ae,me){function Ie(Me){W.debug=W,W.default=W,W.coerce=se,W.disable=de,W.enable=Ve,W.enabled=pe,W.humanize=me(944),W.destroy=we,Object.keys(Me).forEach(ee=>{W[ee]=Me[ee]}),W.names=[],W.skips=[],W.formatters={};function tt(ee){let ge=0;for(let C=0;C<ee.length;C++)ge=(ge<<5)-ge+ee.charCodeAt(C),ge|=0;return W.colors[Math.abs(ge)%W.colors.length]}d(tt,"selectColor"),W.selectColor=tt;function W(ee){let ge,C=null,V,F;function A(...Y){if(!A.enabled)return;const Q=A,oe=Number(new Date),U=oe-(ge||oe);Q.diff=U,Q.prev=ge,Q.curr=oe,ge=oe,Y[0]=W.coerce(Y[0]),typeof Y[0]!="string"&&Y.unshift("%O");let ve=0;Y[0]=Y[0].replace(/%([a-zA-Z%])/g,(j,ln)=>{if(j==="%%")return"%";ve++;const Vt=W.formatters[ln];if(typeof Vt=="function"){const Mn=Y[ve];j=Vt.call(Q,Mn),Y.splice(ve,1),ve--}return j}),W.formatArgs.call(Q,Y),(Q.log||W.log).apply(Q,Y)}return d(A,"debug"),A.namespace=ee,A.useColors=W.useColors(),A.color=W.selectColor(ee),A.extend=Be,A.destroy=W.destroy,Object.defineProperty(A,"enabled",{enumerable:!0,configurable:!1,get:()=>C!==null?C:(V!==W.namespaces&&(V=W.namespaces,F=W.enabled(ee)),F),set:Y=>{C=Y}}),typeof W.init=="function"&&W.init(A),A}d(W,"createDebug");function Be(ee,ge){const C=W(this.namespace+(typeof ge>"u"?":":ge)+ee);return C.log=this.log,C}d(Be,"extend");function Ve(ee){W.save(ee),W.namespaces=ee,W.names=[],W.skips=[];let ge;const C=(typeof ee=="string"?ee:"").split(/[\s,]+/),V=C.length;for(ge=0;ge<V;ge++)C[ge]&&(ee=C[ge].replace(/\*/g,".*?"),ee[0]==="-"?W.skips.push(new RegExp("^"+ee.slice(1)+"$")):W.names.push(new RegExp("^"+ee+"$")))}d(Ve,"enable");function de(){const ee=[...W.names.map(ne),...W.skips.map(ne).map(ge=>"-"+ge)].join(",");return W.enable(""),ee}d(de,"disable");function pe(ee){if(ee[ee.length-1]==="*")return!0;let ge,C;for(ge=0,C=W.skips.length;ge<C;ge++)if(W.skips[ge].test(ee))return!1;for(ge=0,C=W.names.length;ge<C;ge++)if(W.names[ge].test(ee))return!0;return!1}d(pe,"enabled");function ne(ee){return ee.toString().substring(2,ee.toString().length-2).replace(/\.\*\?$/,"*")}d(ne,"toNamespace");function se(ee){return ee instanceof Error?ee.stack||ee.message:ee}d(se,"coerce");function we(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return d(we,"destroy"),W.enable(W.load()),W}d(Ie,"setup"),ie.exports=Ie},772:function(ie){"use strict";/*
|
|
2
|
+
object-assign
|
|
3
|
+
(c) Sindre Sorhus
|
|
4
|
+
@license MIT
|
|
5
|
+
*/var ae=Object.getOwnPropertySymbols,me=Object.prototype.hasOwnProperty,Ie=Object.prototype.propertyIsEnumerable;function Me(W){if(W==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(W)}d(Me,"toObject");function tt(){try{if(!Object.assign)return!1;var W=new String("abc");if(W[5]="de",Object.getOwnPropertyNames(W)[0]==="5")return!1;for(var Be={},Ve=0;Ve<10;Ve++)Be["_"+String.fromCharCode(Ve)]=Ve;var de=Object.getOwnPropertyNames(Be).map(function(ne){return Be[ne]});if(de.join("")!=="0123456789")return!1;var pe={};return"abcdefghijklmnopqrst".split("").forEach(function(ne){pe[ne]=ne}),Object.keys(Object.assign({},pe)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}d(tt,"shouldUseNative"),ie.exports=tt()?Object.assign:function(W,Be){for(var Ve,de=Me(W),pe,ne=1;ne<arguments.length;ne++){Ve=Object(arguments[ne]);for(var se in Ve)me.call(Ve,se)&&(de[se]=Ve[se]);if(ae){pe=ae(Ve);for(var we=0;we<pe.length;we++)Ie.call(Ve,pe[we])&&(de[pe[we]]=Ve[pe[we]])}}return de}},346:function(ie,ae,me){"use strict";var Ie;/** @license React v17.0.2
|
|
6
|
+
* react-jsx-runtime.production.min.js
|
|
7
|
+
*
|
|
8
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the MIT license found in the
|
|
11
|
+
* LICENSE file in the root directory of this source tree.
|
|
12
|
+
*/me(772);var Me=me(359),tt=60103;if(Ie=60107,typeof Symbol=="function"&&Symbol.for){var W=Symbol.for;tt=W("react.element"),Ie=W("react.fragment")}var Be=Me.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Ve=Object.prototype.hasOwnProperty,de={key:!0,ref:!0,__self:!0,__source:!0};function pe(ne,se,we){var ee,ge={},C=null,V=null;we!==void 0&&(C=""+we),se.key!==void 0&&(C=""+se.key),se.ref!==void 0&&(V=se.ref);for(ee in se)Ve.call(se,ee)&&!de.hasOwnProperty(ee)&&(ge[ee]=se[ee]);if(ne&&ne.defaultProps)for(ee in se=ne.defaultProps,se)ge[ee]===void 0&&(ge[ee]=se[ee]);return{$$typeof:tt,type:ne,key:C,ref:V,props:ge,_owner:Be.current}}d(pe,"q"),ae.jsx=pe,ae.jsxs=pe},232:function(ie,ae,me){"use strict";ie.exports=me(346)},359:function(ie){"use strict";ie.exports=ct},318:function(ie){"use strict";ie.exports=He}},nn={};function Ge(ie){var ae=nn[ie];if(ae!==void 0)return ae.exports;var me=nn[ie]={exports:{}};return dt[ie](me,me.exports,Ge),me.exports}d(Ge,"__webpack_require__"),(function(){Ge.n=function(ie){var ae=ie&&ie.__esModule?function(){return ie.default}:function(){return ie};return Ge.d(ae,{a:ae}),ae}})(),(function(){Ge.d=function(ie,ae){for(var me in ae)Ge.o(ae,me)&&!Ge.o(ie,me)&&Object.defineProperty(ie,me,{enumerable:!0,get:ae[me]})}})(),(function(){Ge.o=function(ie,ae){return Object.prototype.hasOwnProperty.call(ie,ae)}})(),(function(){Ge.r=function(ie){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(ie,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(ie,"__esModule",{value:!0})}})();var ot={};return(function(){"use strict";Ge.r(ot),Ge.d(ot,{AppEvents:function(){return A},AppNamespace:function(){return Rs},BuiltInPowerupCodes:function(){return Er},Card:function(){return cr},CardNamespace:function(){return hi},CheckboxMatcher:function(){return Wl},ComponentFocusableItemType:function(){return gu},DEPRECATED_RICH_TEXT_ELEMENT_TYPES:function(){return nr},DEPRECATED_RICH_TEXT_ELEMENT_TYPES_TO_NEW_FORMATTING:function(){return Zi},DEPRECATED_RICH_TEXT_FORMATTING_TYPES:function(){return Su},DateMatcher:function(){return Ro},DateMatcherTypesToDisplayValue:function(){return $l},DateNamespace:function(){return jr},DocumentViewer:function(){return Md},EXAM_SCHEDULER_EXPLANATION_TYPES:function(){return Cu},EditorEvents:function(){return de},EditorNamespace:function(){return ht},EmbedComponentType:function(){return Dn},EventNamespace:function(){return xr},FocusEvents:function(){return F},FocusNamespace:function(){return Ji},FocusPropsType:function(){return yu},GetCardInfoNodeCardFields:function(){return Vi},GlobalEvent:function(){return Be},KnowledgeBaseNamespace:function(){return Fo},LegacySearchPortalSingleSelectQueryExpression:function(){return Yl},LoadingSpinnerPlugin:function(){return Zd},MessagingEvents:function(){return we},MessagingNamespace:function(){return Os},MoveUnit:function(){return Tu},MultiSelectMatcher:function(){return Es},MultiSelectMatcherTypesToDisplayValue:function(){return Ql},NonRelativeMatcherTypes:function(){return bu},NumberMatcher:function(){return Tn},NumberMatcherTypesToDisplayValue:function(){return Oo},PDFWebReader:function(){return jd},PORTAL_TYPE:function(){return Eu},PageType_DUPE_1:function(){return Wi},PluginAccessScopeType:function(){return Sr},PluginActionPermissionLevel:function(){return Dl},PluginCommandMenuLocation:function(){return vu},PluginRem:function(){return Wn},PowerupEvent:function(){return ne},PowerupNamespace:function(){return rr},PowerupSlotCodeMap:function(){return Ui},PreviewRemCards:function(){return Wd},PropertyLocation:function(){return zl},PropertyType:function(){return Ll},QueryExpressionType:function(){return Jt},QueryNodeType:function(){return xt},QueryRemType:function(){return Pu},Query_DUPE_2:function(){return Lo},Queue:function(){return Ud},QueueEvent:function(){return Ve},QueueInteractionScore:function(){return wu},QueueItemType:function(){return Jl},QueueItemTypeHumanReadable:function(){return Qi},QueueItemTypeHumanReadableTextToSpeech:function(){return Cs},QueueNamespace:function(){return Cr},RICH_TEXT_ELEMENT_TYPE:function(){return _u},RICH_TEXT_FORMATTING:function(){return dr},RNPlugin:function(){return so},ReactRNPlugin:function(){return Rc},ReaderNamespace:function(){return An},RegisterPowerupOptions:function(){return Ou},RegisterPropertyOptions:function(){return xs},RelativeDateMatcher:function(){return Lr},RelativeDateMatcherToLabel:function(){return Ru},RelativeDateModifier:function(){return Io},RelativeDatePeriod:function(){return Hl},RemColor:function(){return ws},RemEvent:function(){return pe},RemHierarchyEditorTree:function(){return Bd},RemNamespace:function(){return ji},RemRichTextEditor:function(){return zd},RemType:function(){return Al},RemTypeTinyGraph:function(){return Fl},RemViewer:function(){return Ld},RichText:function(){return Fd},RichTextEditor:function(){return Ad},RichTextNamespace:function(){return hr},SchedulerExplanationType:function(){return Ml},SchedulerNamespace:function(){return yi},SearchNamespace:function(){return Ms},SearchPortalCheckboxQueryExpression:function(){return Xl},SearchPortalDateQueryExpression:function(){return gi},SearchPortalGetCardInfoQueryNode:function(){return Ul},SearchPortalGroupQueryNode:function(){return Ss},SearchPortalMultiSelectQueryExpression:function(){return Gl},SearchPortalNumberQueryExpression:function(){return Ts},SearchPortalQuery:function(){return $i},SearchPortalQueryExpression:function(){return ql},SearchPortalRefQueryExpression:function(){return Zl},SearchPortalRemTypeQueryExpression:function(){return ku},SearchPortalSingleSelectQueryExpression:function(){return wt},SearchPortalSlotQueryNode:function(){return Bl},SearchPortalTextQueryExpression:function(){return Kl},SearchPortalUnaryQueryNode:function(){return _s},SelectSourceType:function(){return mi},SelectionType:function(){return vs},SetRemType:function(){return pu},SettingEvents:function(){return ee},SettingsNamespace:function(){return Hn},SidebarEvents:function(){return se},SingleSelectMatcher:function(){return bo},SingleSelectMatcherTypesToDisplayValue:function(){return Iu},SpecialPluginCallback:function(){return xu},StorageEvents:function(){return ge},StorageNamespace:function(){return Us},TextMatcher:function(){return Vl},TextMatcherTypesToDisplayValue:function(){return Hi},TextMatchersAllowedWithoutPrimaryQuery:function(){return Yc},WidgetEvents:function(){return C},WidgetLocation:function(){return fu},WidgetNamespace:function(){return Qn},WindowEvents:function(){return V},WindowNamespace:function(){return Vo},createReactiveApi:function(){return hd},declareIndexPlugin:function(){return Yd},filterAsync:function(){return uf},isAppEvent:function(){return Y},numberValidatorSig:function(){return ko},parseManifest:function(){return gp},remTypeTinyGraphToNormal:function(){return mu},remTypeToTinyGraphType:function(){return hu},renderWidget:function(){return Gd},richTextFormatNameCodeMap:function(){return Nl},stringValidatorSig:function(){return jl},useAPIEventListener:function(){return bc},useGetRemsByIdsReactive:function(){return tf},useLocalStorageState:function(){return of},useOnMessageBroadcast:function(){return Xd},usePlugin:function(){return ki},useRunAsync:function(){return af},useSessionStorageState:function(){return rf},useSyncedStorageState:function(){return sf},useTrackerPlugin:function(){return yf}});var ie={};Ge.r(ie),Ge.d(ie,{VERSION:function(){return lo},after:function(){return ml},all:function(){return Ga},allKeys:function(){return Si},any:function(){return Pi},assign:function(){return fo},before:function(){return Ha},bind:function(){return mc},bindAll:function(){return gc},chain:function(){return Za},chunk:function(){return Ed},clone:function(){return ts},collect:function(){return ri},compact:function(){return le},compose:function(){return jn},constant:function(){return qs},contains:function(){return yr},countBy:function(){return Z},create:function(){return re},debounce:function(){return wc},default:function(){return Rf},defaults:function(){return sl},defer:function(){return ei},delay:function(){return Wa},detect:function(){return _o},difference:function(){return ze},drop:function(){return z},each:function(){return Xn},escape:function(){return yo},every:function(){return Ga},extend:function(){return ol},extendOwn:function(){return fo},filter:function(){return gr},find:function(){return _o},findIndex:function(){return ns},findKey:function(){return wo},findLastIndex:function(){return gl},findWhere:function(){return Qa},first:function(){return L},flatten:function(){return Re},foldl:function(){return Ci},foldr:function(){return Sc},forEach:function(){return Xn},functions:function(){return Qr},get:function(){return Ti},groupBy:function(){return te},has:function(){return ul},head:function(){return L},identity:function(){return po},include:function(){return yr},includes:function(){return yr},indexBy:function(){return Pe},indexOf:function(){return _c},initial:function(){return P},inject:function(){return Ci},intersection:function(){return wd},invert:function(){return $r},invoke:function(){return vl},isArguments:function(){return Gs},isArray:function(){return Pr},isArrayBuffer:function(){return Qs},isBoolean:function(){return Ea},isDataView:function(){return Yo},isDate:function(){return oc},isElement:function(){return ic},isEmpty:function(){return cc},isEqual:function(){return rl},isError:function(){return xa},isFinite:function(){return Ys},isFunction:function(){return pn},isMap:function(){return Xt},isMatch:function(){return tl},isNaN:function(){return Xs},isNull:function(){return rc},isNumber:function(){return Ta},isObject:function(){return or},isRegExp:function(){return sc},isSet:function(){return Ei},isString:function(){return fn},isSymbol:function(){return Ca},isTypedArray:function(){return Da},isUndefined:function(){return Sa},isWeakMap:function(){return hn},isWeakSet:function(){return ja},iteratee:function(){return Yn},keys:function(){return Yt},last:function(){return ke},lastIndexOf:function(){return yl},map:function(){return ri},mapObject:function(){return mo},matcher:function(){return kn},matches:function(){return kn},max:function(){return o},memoize:function(){return yc},methods:function(){return Qr},min:function(){return l},mixin:function(){return od},negate:function(){return hl},noop:function(){return go},now:function(){return qr},object:function(){return _d},omit:function(){return T},once:function(){return ti},pairs:function(){return es},partial:function(){return pl},partition:function(){return fe},pick:function(){return k},pluck:function(){return e},property:function(){return Yr},propertyOf:function(){return Rn},random:function(){return lr},range:function(){return Sd},reduce:function(){return Ci},reduceRight:function(){return Sc},reject:function(){return Ka},rest:function(){return z},restArguments:function(){return sn},result:function(){return vo},sample:function(){return m},select:function(){return gr},shuffle:function(){return y},size:function(){return Te},some:function(){return Pi},sortBy:function(){return E},sortedIndex:function(){return rs},tail:function(){return z},take:function(){return L},tap:function(){return al},template:function(){return Ua},templateSettings:function(){return fc},throttle:function(){return vc},times:function(){return Rr},toArray:function(){return f},toPath:function(){return Gn},transpose:function(){return Ec},unescape:function(){return nd},union:function(){return id},uniq:function(){return ar},unique:function(){return ar},uniqueId:function(){return hc},unzip:function(){return Ec},values:function(){return kt},where:function(){return n},without:function(){return Ae},wrap:function(){return Va},zip:function(){return kf}});var ae=Object.defineProperty,me=Object.getOwnPropertySymbols,Ie=Object.prototype.hasOwnProperty,Me=Object.prototype.propertyIsEnumerable,tt=d((t,r,i)=>r in t?ae(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,"__defNormalProp"),W=d((t,r)=>{for(var i in r||(r={}))Ie.call(r,i)&&tt(t,i,r[i]);if(me)for(var i of me(r))Me.call(r,i)&&tt(t,i,r[i]);return t},"__spreadValues");const Be={GlobalOpenRem:"global.open-rem",URLChange:"global.url-change"},Ve={QueueLoadCard:"queue.load-card",QueueCompleteCard:"queue.complete-card",QueueEnter:"queue.enter",QueueExit:"queue.exit",RevealAnswer:"queue.reveal-answer"},de={EditorSelectionChanged:"editor.selection-changed",EditorTextEdited:"editor.text-edited"},pe={RemChanged:"rem.changed",GlobalRemChanged:"global.rem.changed"},ne={PowerupSlotChanged:"powerup.slot.changed",ClickRemReference:"powerup.click-rem-reference",MouseOverLink:"powerup.mouse-enter-link",MouseOutLink:"powerup.mouse-out-link",SetTodoStatus:"powerup.todo.set-status"},se={ClickSidebarItem:"sidebar.click-item"},we={MessageBroadcast:"messaging.broadcast"},ee={SettingChanged:"setting.changed"},ge={StorageSessionChange:"storage.session.changed",StorageSyncedChange:"storage.synced.changed",StorageLocalChange:"storage.local.changed"},C={FakeEmbedComponentDimensionChange:"widget.virtual-embed-dimension-change",FakeEmbedDOMEvent:"widget.virtual-embed-dom-event",StealKeyEvent:"widget.steal-key-event"},V={FocusedPaneChange:"window.focusedPane.changed",CurrentWindowTreeChange:"window.PaneIdWindowTree.changed"},F={FocusedRemChange:"window.focusedRem.changed",FocusedPortalChange:"window.focusedPortal.changed"},A=W(W(W(W(W(W(W(W(W(W(W(W({onActivate:"onActivate",onDeactivate:"onDeactivate",setDarkMode:"setDarkMode",setCustomCSS:"setCustomCSS"},V),we),se),ne),pe),Be),Ve),ge),C),de),ee),F);function Y(t){return Object.values(A).includes(t)}d(Y,"isAppEvent");var Q;(function(t){t.assertEqual=a=>a;function r(a){}d(r,"assertIs"),t.assertIs=r;function i(a){throw new Error}d(i,"assertNever"),t.assertNever=i,t.arrayToEnum=a=>{const c={};for(const p of a)c[p]=p;return c},t.getValidEnumValues=a=>{const c=t.objectKeys(a).filter(h=>typeof a[a[h]]!="number"),p={};for(const h of c)p[h]=a[h];return t.objectValues(p)},t.objectValues=a=>t.objectKeys(a).map(function(c){return a[c]}),t.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const c=[];for(const p in a)Object.prototype.hasOwnProperty.call(a,p)&&c.push(p);return c},t.find=(a,c)=>{for(const p of a)if(c(p))return p},t.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function s(a,c=" | "){return a.map(p=>typeof p=="string"?`'${p}'`:p).join(c)}d(s,"joinValues"),t.joinValues=s,t.jsonStringifyReplacer=(a,c)=>typeof c=="bigint"?c.toString():c})(Q||(Q={}));var oe;(function(t){t.mergeShapes=(r,i)=>O(O({},r),i)})(oe||(oe={}));const U=Q.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ve=d(t=>{switch(typeof t){case"undefined":return U.undefined;case"string":return U.string;case"number":return isNaN(t)?U.nan:U.number;case"boolean":return U.boolean;case"function":return U.function;case"bigint":return U.bigint;case"symbol":return U.symbol;case"object":return Array.isArray(t)?U.array:t===null?U.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?U.promise:typeof Map<"u"&&t instanceof Map?U.map:typeof Set<"u"&&t instanceof Set?U.set:typeof Date<"u"&&t instanceof Date?U.date:U.object;default:return U.unknown}},"getParsedType"),j=Q.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),ln=d(t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson");class Vt extends Error{constructor(r){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const i=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,i):this.__proto__=i,this.name="ZodError",this.issues=r}get errors(){return this.issues}format(r){const i=r||function(c){return c.message},s={_errors:[]},a=d(c=>{for(const p of c.issues)if(p.code==="invalid_union")p.unionErrors.map(a);else if(p.code==="invalid_return_type")a(p.returnTypeError);else if(p.code==="invalid_arguments")a(p.argumentsError);else if(p.path.length===0)s._errors.push(i(p));else{let h=s,g=0;for(;g<p.path.length;){const v=p.path[g];g===p.path.length-1?(h[v]=h[v]||{_errors:[]},h[v]._errors.push(i(p))):h[v]=h[v]||{_errors:[]},h=h[v],g++}}},"processError");return a(this),s}toString(){return this.message}get message(){return JSON.stringify(this.issues,Q.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(r=i=>i.message){const i={},s=[];for(const a of this.issues)a.path.length>0?(i[a.path[0]]=i[a.path[0]]||[],i[a.path[0]].push(r(a))):s.push(r(a));return{formErrors:s,fieldErrors:i}}get formErrors(){return this.flatten()}}d(Vt,"ZodError"),Vt.create=t=>new Vt(t);const Mn=d((t,r)=>{let i;switch(t.code){case j.invalid_type:t.received===U.undefined?i="Required":i=`Expected ${t.expected}, received ${t.received}`;break;case j.invalid_literal:i=`Invalid literal value, expected ${JSON.stringify(t.expected,Q.jsonStringifyReplacer)}`;break;case j.unrecognized_keys:i=`Unrecognized key(s) in object: ${Q.joinValues(t.keys,", ")}`;break;case j.invalid_union:i="Invalid input";break;case j.invalid_union_discriminator:i=`Invalid discriminator value. Expected ${Q.joinValues(t.options)}`;break;case j.invalid_enum_value:i=`Invalid enum value. Expected ${Q.joinValues(t.options)}, received '${t.received}'`;break;case j.invalid_arguments:i="Invalid function arguments";break;case j.invalid_return_type:i="Invalid function return type";break;case j.invalid_date:i="Invalid date";break;case j.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(i=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(i=`${i} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?i=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?i=`Invalid input: must end with "${t.validation.endsWith}"`:Q.assertNever(t.validation):t.validation!=="regex"?i=`Invalid ${t.validation}`:i="Invalid";break;case j.too_small:t.type==="array"?i=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?i=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?i=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?i=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:i="Invalid input";break;case j.too_big:t.type==="array"?i=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?i=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?i=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?i=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?i=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:i="Invalid input";break;case j.custom:i="Invalid input";break;case j.invalid_intersection_types:i="Intersection results could not be merged";break;case j.not_multiple_of:i=`Number must be a multiple of ${t.multipleOf}`;break;case j.not_finite:i="Number must be finite";break;default:i=r.defaultError,Q.assertNever(t)}return{message:i}},"errorMap");let us=Mn;function vr(t){us=t}d(vr,"setErrorMap");function _n(){return us}d(_n,"getErrorMap");const li=d(t=>{const{data:r,path:i,errorMaps:s,issueData:a}=t,c=[...i,...a.path||[]],p=X(O({},a),{path:c});let h="";const g=s.filter(v=>!!v).slice().reverse();for(const v of g)h=v(p,{data:r,defaultError:h}).message;return X(O({},a),{path:c,message:a.message||h})},"makeIssue"),ai=[];function J(t,r){const i=li({issueData:r,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,_n(),Mn].filter(s=>!!s)});t.common.issues.push(i)}d(J,"addIssueToContext");class It{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(r,i){const s=[];for(const a of i){if(a.status==="aborted")return _e;a.status==="dirty"&&r.dirty(),s.push(a.value)}return{status:r.value,value:s}}static mergeObjectAsync(r,i){return bt(this,null,function*(){const s=[];for(const a of i)s.push({key:yield a.key,value:yield a.value});return It.mergeObjectSync(r,s)})}static mergeObjectSync(r,i){const s={};for(const a of i){const{key:c,value:p}=a;if(c.status==="aborted"||p.status==="aborted")return _e;c.status==="dirty"&&r.dirty(),p.status==="dirty"&&r.dirty(),c.value!=="__proto__"&&(typeof p.value<"u"||a.alwaysSet)&&(s[c.value]=p.value)}return{status:r.value,value:s}}}d(It,"ParseStatus");const _e=Object.freeze({status:"aborted"}),bi=d(t=>({status:"dirty",value:t}),"DIRTY"),w=d(t=>({status:"valid",value:t}),"OK"),S=d(t=>t.status==="aborted","isAborted"),b=d(t=>t.status==="dirty","isDirty"),_=d(t=>t.status==="valid","isValid"),M=d(t=>typeof Promise<"u"&&t instanceof Promise,"isAsync");var R;(function(t){t.errToObj=r=>typeof r=="string"?{message:r}:r||{},t.toString=r=>typeof r=="string"?r:r?.message})(R||(R={}));class ${constructor(r,i,s,a){this._cachedPath=[],this.parent=r,this.data=i,this._path=s,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}d($,"ParseInputLazyPath");const K=d((t,r)=>{if(_(r))return{success:!0,data:r.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const i=new Vt(t.common.issues);return this._error=i,this._error}}},"handleResult");function H(t){if(!t)return{};const{errorMap:r,invalid_type_error:i,required_error:s,description:a}=t;if(r&&(i||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return r?{errorMap:r,description:a}:{errorMap:d((c,p)=>c.code!=="invalid_type"?{message:p.defaultError}:typeof p.data>"u"?{message:s??p.defaultError}:{message:i??p.defaultError},"customMap"),description:a}}d(H,"processCreateParams");class q{constructor(r){this.spa=this.safeParseAsync,this._def=r,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(r){return ve(r.data)}_getOrReturnCtx(r,i){return i||{common:r.parent.common,data:r.data,parsedType:ve(r.data),schemaErrorMap:this._def.errorMap,path:r.path,parent:r.parent}}_processInputParams(r){return{status:new It,ctx:{common:r.parent.common,data:r.data,parsedType:ve(r.data),schemaErrorMap:this._def.errorMap,path:r.path,parent:r.parent}}}_parseSync(r){const i=this._parse(r);if(M(i))throw new Error("Synchronous parse encountered promise.");return i}_parseAsync(r){const i=this._parse(r);return Promise.resolve(i)}parse(r,i){const s=this.safeParse(r,i);if(s.success)return s.data;throw s.error}safeParse(r,i){var s;const a={common:{issues:[],async:(s=i?.async)!==null&&s!==void 0?s:!1,contextualErrorMap:i?.errorMap},path:i?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:ve(r)},c=this._parseSync({data:r,path:a.path,parent:a});return K(a,c)}parseAsync(r,i){return bt(this,null,function*(){const s=yield this.safeParseAsync(r,i);if(s.success)return s.data;throw s.error})}safeParseAsync(r,i){return bt(this,null,function*(){const s={common:{issues:[],contextualErrorMap:i?.errorMap,async:!0},path:i?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:ve(r)},a=this._parse({data:r,path:s.path,parent:s}),c=yield M(a)?a:Promise.resolve(a);return K(s,c)})}refine(r,i){const s=d(a=>typeof i=="string"||typeof i>"u"?{message:i}:typeof i=="function"?i(a):i,"getIssueProperties");return this._refinement((a,c)=>{const p=r(a),h=d(()=>c.addIssue(O({code:j.custom},s(a))),"setError");return typeof Promise<"u"&&p instanceof Promise?p.then(g=>g?!0:(h(),!1)):p?!0:(h(),!1)})}refinement(r,i){return this._refinement((s,a)=>r(s)?!0:(a.addIssue(typeof i=="function"?i(s,a):i),!1))}_refinement(r){return new xe({schema:this,typeName:he.ZodEffects,effect:{type:"refinement",refinement:r}})}superRefine(r){return this._refinement(r)}optional(){return On.create(this,this._def)}nullable(){return Nr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Qe.create(this,this._def)}promise(){return cn.create(this,this._def)}or(r){return Tt.create([this,r],this._def)}and(r){return zn.create(this,r,this._def)}transform(r){return new xe(X(O({},H(this._def)),{schema:this,typeName:he.ZodEffects,effect:{type:"transform",transform:r}}))}default(r){const i=typeof r=="function"?r:()=>r;return new ci(X(O({},H(this._def)),{innerType:this,defaultValue:i,typeName:he.ZodDefault}))}brand(){return new cs(O({typeName:he.ZodBranded,type:this},H(this._def)))}catch(r){const i=typeof r=="function"?r:()=>r;return new Ni(X(O({},H(this._def)),{innerType:this,catchValue:i,typeName:he.ZodCatch}))}describe(r){const i=this.constructor;return new i(X(O({},this._def),{description:r}))}pipe(r){return di.create(this,r)}readonly(){return fi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}d(q,"ZodType");const Oe=/^c[^\s-]{8,}$/i,be=/^[a-z][a-z0-9]*$/,ft=/[0-9A-HJKMNP-TV-Z]{26}/,We=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,pt=/^([A-Z0-9_+-]+\.?)*[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Mt=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u"),Ue=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Le=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,st=d(t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"),"datetimeRegex");function nt(t,r){return!!((r==="v4"||!r)&&Ue.test(t)||(r==="v6"||!r)&&Le.test(t))}d(nt,"isValidIP");class je extends q{constructor(){super(...arguments),this._regex=(r,i,s)=>this.refinement(a=>r.test(a),O({validation:i,code:j.invalid_string},R.errToObj(s))),this.nonempty=r=>this.min(1,R.errToObj(r)),this.trim=()=>new je(X(O({},this._def),{checks:[...this._def.checks,{kind:"trim"}]})),this.toLowerCase=()=>new je(X(O({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]})),this.toUpperCase=()=>new je(X(O({},this._def),{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}_parse(r){if(this._def.coerce&&(r.data=String(r.data)),this._getType(r)!==U.string){const a=this._getOrReturnCtx(r);return J(a,{code:j.invalid_type,expected:U.string,received:a.parsedType}),_e}const i=new It;let s;for(const a of this._def.checks)if(a.kind==="min")r.data.length<a.value&&(s=this._getOrReturnCtx(r,s),J(s,{code:j.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),i.dirty());else if(a.kind==="max")r.data.length>a.value&&(s=this._getOrReturnCtx(r,s),J(s,{code:j.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),i.dirty());else if(a.kind==="length"){const c=r.data.length>a.value,p=r.data.length<a.value;(c||p)&&(s=this._getOrReturnCtx(r,s),c?J(s,{code:j.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):p&&J(s,{code:j.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),i.dirty())}else if(a.kind==="email")pt.test(r.data)||(s=this._getOrReturnCtx(r,s),J(s,{validation:"email",code:j.invalid_string,message:a.message}),i.dirty());else if(a.kind==="emoji")Mt.test(r.data)||(s=this._getOrReturnCtx(r,s),J(s,{validation:"emoji",code:j.invalid_string,message:a.message}),i.dirty());else if(a.kind==="uuid")We.test(r.data)||(s=this._getOrReturnCtx(r,s),J(s,{validation:"uuid",code:j.invalid_string,message:a.message}),i.dirty());else if(a.kind==="cuid")Oe.test(r.data)||(s=this._getOrReturnCtx(r,s),J(s,{validation:"cuid",code:j.invalid_string,message:a.message}),i.dirty());else if(a.kind==="cuid2")be.test(r.data)||(s=this._getOrReturnCtx(r,s),J(s,{validation:"cuid2",code:j.invalid_string,message:a.message}),i.dirty());else if(a.kind==="ulid")ft.test(r.data)||(s=this._getOrReturnCtx(r,s),J(s,{validation:"ulid",code:j.invalid_string,message:a.message}),i.dirty());else if(a.kind==="url")try{new URL(r.data)}catch{s=this._getOrReturnCtx(r,s),J(s,{validation:"url",code:j.invalid_string,message:a.message}),i.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(r.data)||(s=this._getOrReturnCtx(r,s),J(s,{validation:"regex",code:j.invalid_string,message:a.message}),i.dirty())):a.kind==="trim"?r.data=r.data.trim():a.kind==="includes"?r.data.includes(a.value,a.position)||(s=this._getOrReturnCtx(r,s),J(s,{code:j.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),i.dirty()):a.kind==="toLowerCase"?r.data=r.data.toLowerCase():a.kind==="toUpperCase"?r.data=r.data.toUpperCase():a.kind==="startsWith"?r.data.startsWith(a.value)||(s=this._getOrReturnCtx(r,s),J(s,{code:j.invalid_string,validation:{startsWith:a.value},message:a.message}),i.dirty()):a.kind==="endsWith"?r.data.endsWith(a.value)||(s=this._getOrReturnCtx(r,s),J(s,{code:j.invalid_string,validation:{endsWith:a.value},message:a.message}),i.dirty()):a.kind==="datetime"?st(a).test(r.data)||(s=this._getOrReturnCtx(r,s),J(s,{code:j.invalid_string,validation:"datetime",message:a.message}),i.dirty()):a.kind==="ip"?nt(r.data,a.version)||(s=this._getOrReturnCtx(r,s),J(s,{validation:"ip",code:j.invalid_string,message:a.message}),i.dirty()):Q.assertNever(a);return{status:i.value,value:r.data}}_addCheck(r){return new je(X(O({},this._def),{checks:[...this._def.checks,r]}))}email(r){return this._addCheck(O({kind:"email"},R.errToObj(r)))}url(r){return this._addCheck(O({kind:"url"},R.errToObj(r)))}emoji(r){return this._addCheck(O({kind:"emoji"},R.errToObj(r)))}uuid(r){return this._addCheck(O({kind:"uuid"},R.errToObj(r)))}cuid(r){return this._addCheck(O({kind:"cuid"},R.errToObj(r)))}cuid2(r){return this._addCheck(O({kind:"cuid2"},R.errToObj(r)))}ulid(r){return this._addCheck(O({kind:"ulid"},R.errToObj(r)))}ip(r){return this._addCheck(O({kind:"ip"},R.errToObj(r)))}datetime(r){var i;return typeof r=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:r}):this._addCheck(O({kind:"datetime",precision:typeof r?.precision>"u"?null:r?.precision,offset:(i=r?.offset)!==null&&i!==void 0?i:!1},R.errToObj(r?.message)))}regex(r,i){return this._addCheck(O({kind:"regex",regex:r},R.errToObj(i)))}includes(r,i){return this._addCheck(O({kind:"includes",value:r,position:i?.position},R.errToObj(i?.message)))}startsWith(r,i){return this._addCheck(O({kind:"startsWith",value:r},R.errToObj(i)))}endsWith(r,i){return this._addCheck(O({kind:"endsWith",value:r},R.errToObj(i)))}min(r,i){return this._addCheck(O({kind:"min",value:r},R.errToObj(i)))}max(r,i){return this._addCheck(O({kind:"max",value:r},R.errToObj(i)))}length(r,i){return this._addCheck(O({kind:"length",value:r},R.errToObj(i)))}get isDatetime(){return!!this._def.checks.find(r=>r.kind==="datetime")}get isEmail(){return!!this._def.checks.find(r=>r.kind==="email")}get isURL(){return!!this._def.checks.find(r=>r.kind==="url")}get isEmoji(){return!!this._def.checks.find(r=>r.kind==="emoji")}get isUUID(){return!!this._def.checks.find(r=>r.kind==="uuid")}get isCUID(){return!!this._def.checks.find(r=>r.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(r=>r.kind==="cuid2")}get isULID(){return!!this._def.checks.find(r=>r.kind==="ulid")}get isIP(){return!!this._def.checks.find(r=>r.kind==="ip")}get minLength(){let r=null;for(const i of this._def.checks)i.kind==="min"&&(r===null||i.value>r)&&(r=i.value);return r}get maxLength(){let r=null;for(const i of this._def.checks)i.kind==="max"&&(r===null||i.value<r)&&(r=i.value);return r}}d(je,"ZodString"),je.create=t=>{var r;return new je(O({checks:[],typeName:he.ZodString,coerce:(r=t?.coerce)!==null&&r!==void 0?r:!1},H(t)))};function qe(t,r){const i=(t.toString().split(".")[1]||"").length,s=(r.toString().split(".")[1]||"").length,a=i>s?i:s,c=parseInt(t.toFixed(a).replace(".","")),p=parseInt(r.toFixed(a).replace(".",""));return c%p/Math.pow(10,a)}d(qe,"floatSafeRemainder");class De extends q{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(r){if(this._def.coerce&&(r.data=Number(r.data)),this._getType(r)!==U.number){const a=this._getOrReturnCtx(r);return J(a,{code:j.invalid_type,expected:U.number,received:a.parsedType}),_e}let i;const s=new It;for(const a of this._def.checks)a.kind==="int"?Q.isInteger(r.data)||(i=this._getOrReturnCtx(r,i),J(i,{code:j.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?r.data<a.value:r.data<=a.value)&&(i=this._getOrReturnCtx(r,i),J(i,{code:j.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?r.data>a.value:r.data>=a.value)&&(i=this._getOrReturnCtx(r,i),J(i,{code:j.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?qe(r.data,a.value)!==0&&(i=this._getOrReturnCtx(r,i),J(i,{code:j.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(r.data)||(i=this._getOrReturnCtx(r,i),J(i,{code:j.not_finite,message:a.message}),s.dirty()):Q.assertNever(a);return{status:s.value,value:r.data}}gte(r,i){return this.setLimit("min",r,!0,R.toString(i))}gt(r,i){return this.setLimit("min",r,!1,R.toString(i))}lte(r,i){return this.setLimit("max",r,!0,R.toString(i))}lt(r,i){return this.setLimit("max",r,!1,R.toString(i))}setLimit(r,i,s,a){return new De(X(O({},this._def),{checks:[...this._def.checks,{kind:r,value:i,inclusive:s,message:R.toString(a)}]}))}_addCheck(r){return new De(X(O({},this._def),{checks:[...this._def.checks,r]}))}int(r){return this._addCheck({kind:"int",message:R.toString(r)})}positive(r){return this._addCheck({kind:"min",value:0,inclusive:!1,message:R.toString(r)})}negative(r){return this._addCheck({kind:"max",value:0,inclusive:!1,message:R.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:0,inclusive:!0,message:R.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:0,inclusive:!0,message:R.toString(r)})}multipleOf(r,i){return this._addCheck({kind:"multipleOf",value:r,message:R.toString(i)})}finite(r){return this._addCheck({kind:"finite",message:R.toString(r)})}safe(r){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:R.toString(r)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:R.toString(r)})}get minValue(){let r=null;for(const i of this._def.checks)i.kind==="min"&&(r===null||i.value>r)&&(r=i.value);return r}get maxValue(){let r=null;for(const i of this._def.checks)i.kind==="max"&&(r===null||i.value<r)&&(r=i.value);return r}get isInt(){return!!this._def.checks.find(r=>r.kind==="int"||r.kind==="multipleOf"&&Q.isInteger(r.value))}get isFinite(){let r=null,i=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(i===null||s.value>i)&&(i=s.value):s.kind==="max"&&(r===null||s.value<r)&&(r=s.value)}return Number.isFinite(i)&&Number.isFinite(r)}}d(De,"ZodNumber"),De.create=t=>new De(O({checks:[],typeName:he.ZodNumber,coerce:t?.coerce||!1},H(t)));class $e extends q{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(r){if(this._def.coerce&&(r.data=BigInt(r.data)),this._getType(r)!==U.bigint){const a=this._getOrReturnCtx(r);return J(a,{code:j.invalid_type,expected:U.bigint,received:a.parsedType}),_e}let i;const s=new It;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?r.data<a.value:r.data<=a.value)&&(i=this._getOrReturnCtx(r,i),J(i,{code:j.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?r.data>a.value:r.data>=a.value)&&(i=this._getOrReturnCtx(r,i),J(i,{code:j.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?r.data%a.value!==BigInt(0)&&(i=this._getOrReturnCtx(r,i),J(i,{code:j.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):Q.assertNever(a);return{status:s.value,value:r.data}}gte(r,i){return this.setLimit("min",r,!0,R.toString(i))}gt(r,i){return this.setLimit("min",r,!1,R.toString(i))}lte(r,i){return this.setLimit("max",r,!0,R.toString(i))}lt(r,i){return this.setLimit("max",r,!1,R.toString(i))}setLimit(r,i,s,a){return new $e(X(O({},this._def),{checks:[...this._def.checks,{kind:r,value:i,inclusive:s,message:R.toString(a)}]}))}_addCheck(r){return new $e(X(O({},this._def),{checks:[...this._def.checks,r]}))}positive(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:R.toString(r)})}negative(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:R.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:R.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:R.toString(r)})}multipleOf(r,i){return this._addCheck({kind:"multipleOf",value:r,message:R.toString(i)})}get minValue(){let r=null;for(const i of this._def.checks)i.kind==="min"&&(r===null||i.value>r)&&(r=i.value);return r}get maxValue(){let r=null;for(const i of this._def.checks)i.kind==="max"&&(r===null||i.value<r)&&(r=i.value);return r}}d($e,"ZodBigInt"),$e.create=t=>{var r;return new $e(O({checks:[],typeName:he.ZodBigInt,coerce:(r=t?.coerce)!==null&&r!==void 0?r:!1},H(t)))};class Sn extends q{_parse(r){if(this._def.coerce&&(r.data=!!r.data),this._getType(r)!==U.boolean){const i=this._getOrReturnCtx(r);return J(i,{code:j.invalid_type,expected:U.boolean,received:i.parsedType}),_e}return w(r.data)}}d(Sn,"ZodBoolean"),Sn.create=t=>new Sn(O({typeName:he.ZodBoolean,coerce:t?.coerce||!1},H(t)));class Lt extends q{_parse(r){if(this._def.coerce&&(r.data=new Date(r.data)),this._getType(r)!==U.date){const a=this._getOrReturnCtx(r);return J(a,{code:j.invalid_type,expected:U.date,received:a.parsedType}),_e}if(isNaN(r.data.getTime())){const a=this._getOrReturnCtx(r);return J(a,{code:j.invalid_date}),_e}const i=new It;let s;for(const a of this._def.checks)a.kind==="min"?r.data.getTime()<a.value&&(s=this._getOrReturnCtx(r,s),J(s,{code:j.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),i.dirty()):a.kind==="max"?r.data.getTime()>a.value&&(s=this._getOrReturnCtx(r,s),J(s,{code:j.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),i.dirty()):Q.assertNever(a);return{status:i.value,value:new Date(r.data.getTime())}}_addCheck(r){return new Lt(X(O({},this._def),{checks:[...this._def.checks,r]}))}min(r,i){return this._addCheck({kind:"min",value:r.getTime(),message:R.toString(i)})}max(r,i){return this._addCheck({kind:"max",value:r.getTime(),message:R.toString(i)})}get minDate(){let r=null;for(const i of this._def.checks)i.kind==="min"&&(r===null||i.value>r)&&(r=i.value);return r!=null?new Date(r):null}get maxDate(){let r=null;for(const i of this._def.checks)i.kind==="max"&&(r===null||i.value<r)&&(r=i.value);return r!=null?new Date(r):null}}d(Lt,"ZodDate"),Lt.create=t=>new Lt(O({checks:[],coerce:t?.coerce||!1,typeName:he.ZodDate},H(t)));class an extends q{_parse(r){if(this._getType(r)!==U.symbol){const i=this._getOrReturnCtx(r);return J(i,{code:j.invalid_type,expected:U.symbol,received:i.parsedType}),_e}return w(r.data)}}d(an,"ZodSymbol"),an.create=t=>new an(O({typeName:he.ZodSymbol},H(t)));class Ot extends q{_parse(r){if(this._getType(r)!==U.undefined){const i=this._getOrReturnCtx(r);return J(i,{code:j.invalid_type,expected:U.undefined,received:i.parsedType}),_e}return w(r.data)}}d(Ot,"ZodUndefined"),Ot.create=t=>new Ot(O({typeName:he.ZodUndefined},H(t)));class zt extends q{_parse(r){if(this._getType(r)!==U.null){const i=this._getOrReturnCtx(r);return J(i,{code:j.invalid_type,expected:U.null,received:i.parsedType}),_e}return w(r.data)}}d(zt,"ZodNull"),zt.create=t=>new zt(O({typeName:he.ZodNull},H(t)));class Ht extends q{constructor(){super(...arguments),this._any=!0}_parse(r){return w(r.data)}}d(Ht,"ZodAny"),Ht.create=t=>new Ht(O({typeName:he.ZodAny},H(t)));class yt extends q{constructor(){super(...arguments),this._unknown=!0}_parse(r){return w(r.data)}}d(yt,"ZodUnknown"),yt.create=t=>new yt(O({typeName:he.ZodUnknown},H(t)));class St extends q{_parse(r){const i=this._getOrReturnCtx(r);return J(i,{code:j.invalid_type,expected:U.never,received:i.parsedType}),_e}}d(St,"ZodNever"),St.create=t=>new St(O({typeName:he.ZodNever},H(t)));class Bt extends q{_parse(r){if(this._getType(r)!==U.undefined){const i=this._getOrReturnCtx(r);return J(i,{code:j.invalid_type,expected:U.void,received:i.parsedType}),_e}return w(r.data)}}d(Bt,"ZodVoid"),Bt.create=t=>new Bt(O({typeName:he.ZodVoid},H(t)));class Qe extends q{_parse(r){const{ctx:i,status:s}=this._processInputParams(r),a=this._def;if(i.parsedType!==U.array)return J(i,{code:j.invalid_type,expected:U.array,received:i.parsedType}),_e;if(a.exactLength!==null){const p=i.data.length>a.exactLength.value,h=i.data.length<a.exactLength.value;(p||h)&&(J(i,{code:p?j.too_big:j.too_small,minimum:h?a.exactLength.value:void 0,maximum:p?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),s.dirty())}if(a.minLength!==null&&i.data.length<a.minLength.value&&(J(i,{code:j.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),s.dirty()),a.maxLength!==null&&i.data.length>a.maxLength.value&&(J(i,{code:j.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),s.dirty()),i.common.async)return Promise.all([...i.data].map((p,h)=>a.type._parseAsync(new $(i,p,i.path,h)))).then(p=>It.mergeArray(s,p));const c=[...i.data].map((p,h)=>a.type._parseSync(new $(i,p,i.path,h)));return It.mergeArray(s,c)}get element(){return this._def.type}min(r,i){return new Qe(X(O({},this._def),{minLength:{value:r,message:R.toString(i)}}))}max(r,i){return new Qe(X(O({},this._def),{maxLength:{value:r,message:R.toString(i)}}))}length(r,i){return new Qe(X(O({},this._def),{exactLength:{value:r,message:R.toString(i)}}))}nonempty(r){return this.min(1,r)}}d(Qe,"ZodArray"),Qe.create=(t,r)=>new Qe(O({type:t,minLength:null,maxLength:null,exactLength:null,typeName:he.ZodArray},H(r)));function gn(t){if(t instanceof rt){const r={};for(const i in t.shape){const s=t.shape[i];r[i]=On.create(gn(s))}return new rt(X(O({},t._def),{shape:()=>r}))}else return t instanceof Qe?new Qe(X(O({},t._def),{type:gn(t.element)})):t instanceof On?On.create(gn(t.unwrap())):t instanceof Nr?Nr.create(gn(t.unwrap())):t instanceof un?un.create(t.items.map(r=>gn(r))):t}d(gn,"deepPartialify");class rt extends q{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const r=this._def.shape(),i=Q.objectKeys(r);return this._cached={shape:r,keys:i}}_parse(r){if(this._getType(r)!==U.object){const g=this._getOrReturnCtx(r);return J(g,{code:j.invalid_type,expected:U.object,received:g.parsedType}),_e}const{status:i,ctx:s}=this._processInputParams(r),{shape:a,keys:c}=this._getCached(),p=[];if(!(this._def.catchall instanceof St&&this._def.unknownKeys==="strip"))for(const g in s.data)c.includes(g)||p.push(g);const h=[];for(const g of c){const v=a[g],ce=s.data[g];h.push({key:{status:"valid",value:g},value:v._parse(new $(s,ce,s.path,g)),alwaysSet:g in s.data})}if(this._def.catchall instanceof St){const g=this._def.unknownKeys;if(g==="passthrough")for(const v of p)h.push({key:{status:"valid",value:v},value:{status:"valid",value:s.data[v]}});else if(g==="strict")p.length>0&&(J(s,{code:j.unrecognized_keys,keys:p}),i.dirty());else if(g!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const g=this._def.catchall;for(const v of p){const ce=s.data[v];h.push({key:{status:"valid",value:v},value:g._parse(new $(s,ce,s.path,v)),alwaysSet:v in s.data})}}return s.common.async?Promise.resolve().then(()=>bt(this,null,function*(){const g=[];for(const v of h){const ce=yield v.key;g.push({key:ce,value:yield v.value,alwaysSet:v.alwaysSet})}return g})).then(g=>It.mergeObjectSync(i,g)):It.mergeObjectSync(i,h)}get shape(){return this._def.shape()}strict(r){return R.errToObj,new rt(O(X(O({},this._def),{unknownKeys:"strict"}),r!==void 0?{errorMap:(i,s)=>{var a,c,p,h;const g=(p=(c=(a=this._def).errorMap)===null||c===void 0?void 0:c.call(a,i,s).message)!==null&&p!==void 0?p:s.defaultError;return i.code==="unrecognized_keys"?{message:(h=R.errToObj(r).message)!==null&&h!==void 0?h:g}:{message:g}}}:{}))}strip(){return new rt(X(O({},this._def),{unknownKeys:"strip"}))}passthrough(){return new rt(X(O({},this._def),{unknownKeys:"passthrough"}))}extend(r){return new rt(X(O({},this._def),{shape:()=>O(O({},this._def.shape()),r)}))}merge(r){return new rt({unknownKeys:r._def.unknownKeys,catchall:r._def.catchall,shape:()=>O(O({},this._def.shape()),r._def.shape()),typeName:he.ZodObject})}setKey(r,i){return this.augment({[r]:i})}catchall(r){return new rt(X(O({},this._def),{catchall:r}))}pick(r){const i={};return Q.objectKeys(r).forEach(s=>{r[s]&&this.shape[s]&&(i[s]=this.shape[s])}),new rt(X(O({},this._def),{shape:()=>i}))}omit(r){const i={};return Q.objectKeys(this.shape).forEach(s=>{r[s]||(i[s]=this.shape[s])}),new rt(X(O({},this._def),{shape:()=>i}))}deepPartial(){return gn(this)}partial(r){const i={};return Q.objectKeys(this.shape).forEach(s=>{const a=this.shape[s];r&&!r[s]?i[s]=a:i[s]=a.optional()}),new rt(X(O({},this._def),{shape:()=>i}))}required(r){const i={};return Q.objectKeys(this.shape).forEach(s=>{if(r&&!r[s])i[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof On;)a=a._def.innerType;i[s]=a}}),new rt(X(O({},this._def),{shape:()=>i}))}keyof(){return Oi(Q.objectKeys(this.shape))}}d(rt,"ZodObject"),rt.create=(t,r)=>new rt(O({shape:()=>t,unknownKeys:"strip",catchall:St.create(),typeName:he.ZodObject},H(r))),rt.strictCreate=(t,r)=>new rt(O({shape:()=>t,unknownKeys:"strict",catchall:St.create(),typeName:he.ZodObject},H(r))),rt.lazycreate=(t,r)=>new rt(O({shape:t,unknownKeys:"strip",catchall:St.create(),typeName:he.ZodObject},H(r)));class Tt extends q{_parse(r){const{ctx:i}=this._processInputParams(r),s=this._def.options;function a(c){for(const h of c)if(h.result.status==="valid")return h.result;for(const h of c)if(h.result.status==="dirty")return i.common.issues.push(...h.ctx.common.issues),h.result;const p=c.map(h=>new Vt(h.ctx.common.issues));return J(i,{code:j.invalid_union,unionErrors:p}),_e}if(d(a,"handleResults"),i.common.async)return Promise.all(s.map(c=>bt(this,null,function*(){const p=X(O({},i),{common:X(O({},i.common),{issues:[]}),parent:null});return{result:yield c._parseAsync({data:i.data,path:i.path,parent:p}),ctx:p}}))).then(a);{let c;const p=[];for(const g of s){const v=X(O({},i),{common:X(O({},i.common),{issues:[]}),parent:null}),ce=g._parseSync({data:i.data,path:i.path,parent:v});if(ce.status==="valid")return ce;ce.status==="dirty"&&!c&&(c={result:ce,ctx:v}),v.common.issues.length&&p.push(v.common.issues)}if(c)return i.common.issues.push(...c.ctx.common.issues),c.result;const h=p.map(g=>new Vt(g));return J(i,{code:j.invalid_union,unionErrors:h}),_e}}get options(){return this._def.options}}d(Tt,"ZodUnion"),Tt.create=(t,r)=>new Tt(O({options:t,typeName:he.ZodUnion},H(r)));const Or=d(t=>t instanceof Jn?Or(t.schema):t instanceof xe?Or(t.innerType()):t instanceof Zn?[t.value]:t instanceof In?t.options:t instanceof ur?Object.keys(t.enum):t instanceof ci?Or(t._def.innerType):t instanceof Ot?[void 0]:t instanceof zt?[null]:null,"getDiscriminator");class wr extends q{_parse(r){const{ctx:i}=this._processInputParams(r);if(i.parsedType!==U.object)return J(i,{code:j.invalid_type,expected:U.object,received:i.parsedType}),_e;const s=this.discriminator,a=i.data[s],c=this.optionsMap.get(a);return c?i.common.async?c._parseAsync({data:i.data,path:i.path,parent:i}):c._parseSync({data:i.data,path:i.path,parent:i}):(J(i,{code:j.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),_e)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(r,i,s){const a=new Map;for(const c of i){const p=Or(c.shape[r]);if(!p)throw new Error(`A discriminator value for key \`${r}\` could not be extracted from all schema options`);for(const h of p){if(a.has(h))throw new Error(`Discriminator property ${String(r)} has duplicate value ${String(h)}`);a.set(h,c)}}return new wr(O({typeName:he.ZodDiscriminatedUnion,discriminator:r,options:i,optionsMap:a},H(s)))}}d(wr,"ZodDiscriminatedUnion");function Ii(t,r){const i=ve(t),s=ve(r);if(t===r)return{valid:!0,data:t};if(i===U.object&&s===U.object){const a=Q.objectKeys(r),c=Q.objectKeys(t).filter(h=>a.indexOf(h)!==-1),p=O(O({},t),r);for(const h of c){const g=Ii(t[h],r[h]);if(!g.valid)return{valid:!1};p[h]=g.data}return{valid:!0,data:p}}else if(i===U.array&&s===U.array){if(t.length!==r.length)return{valid:!1};const a=[];for(let c=0;c<t.length;c++){const p=t[c],h=r[c],g=Ii(p,h);if(!g.valid)return{valid:!1};a.push(g.data)}return{valid:!0,data:a}}else return i===U.date&&s===U.date&&+t==+r?{valid:!0,data:t}:{valid:!1}}d(Ii,"mergeValues");class zn extends q{_parse(r){const{status:i,ctx:s}=this._processInputParams(r),a=d((c,p)=>{if(S(c)||S(p))return _e;const h=Ii(c.value,p.value);return h.valid?((b(c)||b(p))&&i.dirty(),{status:i.value,value:h.data}):(J(s,{code:j.invalid_intersection_types}),_e)},"handleParsed");return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([c,p])=>a(c,p)):a(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}d(zn,"ZodIntersection"),zn.create=(t,r,i)=>new zn(O({left:t,right:r,typeName:he.ZodIntersection},H(i)));class un extends q{_parse(r){const{status:i,ctx:s}=this._processInputParams(r);if(s.parsedType!==U.array)return J(s,{code:j.invalid_type,expected:U.array,received:s.parsedType}),_e;if(s.data.length<this._def.items.length)return J(s,{code:j.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_e;!this._def.rest&&s.data.length>this._def.items.length&&(J(s,{code:j.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.dirty());const a=[...s.data].map((c,p)=>{const h=this._def.items[p]||this._def.rest;return h?h._parse(new $(s,c,s.path,p)):null}).filter(c=>!!c);return s.common.async?Promise.all(a).then(c=>It.mergeArray(i,c)):It.mergeArray(i,a)}get items(){return this._def.items}rest(r){return new un(X(O({},this._def),{rest:r}))}}d(un,"ZodTuple"),un.create=(t,r)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new un(O({items:t,typeName:he.ZodTuple,rest:null},H(r)))};class Bn extends q{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(r){const{status:i,ctx:s}=this._processInputParams(r);if(s.parsedType!==U.object)return J(s,{code:j.invalid_type,expected:U.object,received:s.parsedType}),_e;const a=[],c=this._def.keyType,p=this._def.valueType;for(const h in s.data)a.push({key:c._parse(new $(s,h,s.path,h)),value:p._parse(new $(s,s.data[h],s.path,h))});return s.common.async?It.mergeObjectAsync(i,a):It.mergeObjectSync(i,a)}get element(){return this._def.valueType}static create(r,i,s){return i instanceof q?new Bn(O({keyType:r,valueType:i,typeName:he.ZodRecord},H(s))):new Bn(O({keyType:je.create(),valueType:r,typeName:he.ZodRecord},H(i)))}}d(Bn,"ZodRecord");class ui extends q{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(r){const{status:i,ctx:s}=this._processInputParams(r);if(s.parsedType!==U.map)return J(s,{code:j.invalid_type,expected:U.map,received:s.parsedType}),_e;const a=this._def.keyType,c=this._def.valueType,p=[...s.data.entries()].map(([h,g],v)=>({key:a._parse(new $(s,h,s.path,[v,"key"])),value:c._parse(new $(s,g,s.path,[v,"value"]))}));if(s.common.async){const h=new Map;return Promise.resolve().then(()=>bt(this,null,function*(){for(const g of p){const v=yield g.key,ce=yield g.value;if(v.status==="aborted"||ce.status==="aborted")return _e;(v.status==="dirty"||ce.status==="dirty")&&i.dirty(),h.set(v.value,ce.value)}return{status:i.value,value:h}}))}else{const h=new Map;for(const g of p){const v=g.key,ce=g.value;if(v.status==="aborted"||ce.status==="aborted")return _e;(v.status==="dirty"||ce.status==="dirty")&&i.dirty(),h.set(v.value,ce.value)}return{status:i.value,value:h}}}}d(ui,"ZodMap"),ui.create=(t,r,i)=>new ui(O({valueType:r,keyType:t,typeName:he.ZodMap},H(i)));class En extends q{_parse(r){const{status:i,ctx:s}=this._processInputParams(r);if(s.parsedType!==U.set)return J(s,{code:j.invalid_type,expected:U.set,received:s.parsedType}),_e;const a=this._def;a.minSize!==null&&s.data.size<a.minSize.value&&(J(s,{code:j.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),i.dirty()),a.maxSize!==null&&s.data.size>a.maxSize.value&&(J(s,{code:j.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),i.dirty());const c=this._def.valueType;function p(g){const v=new Set;for(const ce of g){if(ce.status==="aborted")return _e;ce.status==="dirty"&&i.dirty(),v.add(ce.value)}return{status:i.value,value:v}}d(p,"finalizeSet");const h=[...s.data.values()].map((g,v)=>c._parse(new $(s,g,s.path,v)));return s.common.async?Promise.all(h).then(g=>p(g)):p(h)}min(r,i){return new En(X(O({},this._def),{minSize:{value:r,message:R.toString(i)}}))}max(r,i){return new En(X(O({},this._def),{maxSize:{value:r,message:R.toString(i)}}))}size(r,i){return this.min(r,i).max(r,i)}nonempty(r){return this.min(1,r)}}d(En,"ZodSet"),En.create=(t,r)=>new En(O({valueType:t,minSize:null,maxSize:null,typeName:he.ZodSet},H(r)));class Un extends q{constructor(){super(...arguments),this.validate=this.implement}_parse(r){const{ctx:i}=this._processInputParams(r);if(i.parsedType!==U.function)return J(i,{code:j.invalid_type,expected:U.function,received:i.parsedType}),_e;function s(h,g){return li({data:h,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,_n(),Mn].filter(v=>!!v),issueData:{code:j.invalid_arguments,argumentsError:g}})}d(s,"makeArgsIssue");function a(h,g){return li({data:h,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,_n(),Mn].filter(v=>!!v),issueData:{code:j.invalid_return_type,returnTypeError:g}})}d(a,"makeReturnsIssue");const c={errorMap:i.common.contextualErrorMap},p=i.data;if(this._def.returns instanceof cn){const h=this;return w(function(...g){return bt(this,null,function*(){const v=new Vt([]),ce=yield h._def.args.parseAsync(g,c).catch(wn=>{throw v.addIssue(s(g,wn)),v}),Fe=yield Reflect.apply(p,this,ce);return yield h._def.returns._def.type.parseAsync(Fe,c).catch(wn=>{throw v.addIssue(a(Fe,wn)),v})})})}else{const h=this;return w(function(...g){const v=h._def.args.safeParse(g,c);if(!v.success)throw new Vt([s(g,v.error)]);const ce=Reflect.apply(p,this,v.data),Fe=h._def.returns.safeParse(ce,c);if(!Fe.success)throw new Vt([a(ce,Fe.error)]);return Fe.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...r){return new Un(X(O({},this._def),{args:un.create(r).rest(yt.create())}))}returns(r){return new Un(X(O({},this._def),{returns:r}))}implement(r){return this.parse(r)}strictImplement(r){return this.parse(r)}static create(r,i,s){return new Un(O({args:r||un.create([]).rest(yt.create()),returns:i||yt.create(),typeName:he.ZodFunction},H(s)))}}d(Un,"ZodFunction");class Jn extends q{get schema(){return this._def.getter()}_parse(r){const{ctx:i}=this._processInputParams(r);return this._def.getter()._parse({data:i.data,path:i.path,parent:i})}}d(Jn,"ZodLazy"),Jn.create=(t,r)=>new Jn(O({getter:t,typeName:he.ZodLazy},H(r)));class Zn extends q{_parse(r){if(r.data!==this._def.value){const i=this._getOrReturnCtx(r);return J(i,{received:i.data,code:j.invalid_literal,expected:this._def.value}),_e}return{status:"valid",value:r.data}}get value(){return this._def.value}}d(Zn,"ZodLiteral"),Zn.create=(t,r)=>new Zn(O({value:t,typeName:he.ZodLiteral},H(r)));function Oi(t,r){return new In(O({values:t,typeName:he.ZodEnum},H(r)))}d(Oi,"createZodEnum");class In extends q{_parse(r){if(typeof r.data!="string"){const i=this._getOrReturnCtx(r),s=this._def.values;return J(i,{expected:Q.joinValues(s),received:i.parsedType,code:j.invalid_type}),_e}if(this._def.values.indexOf(r.data)===-1){const i=this._getOrReturnCtx(r),s=this._def.values;return J(i,{received:i.data,code:j.invalid_enum_value,options:s}),_e}return w(r.data)}get options(){return this._def.values}get enum(){const r={};for(const i of this._def.values)r[i]=i;return r}get Values(){const r={};for(const i of this._def.values)r[i]=i;return r}get Enum(){const r={};for(const i of this._def.values)r[i]=i;return r}extract(r){return In.create(r)}exclude(r){return In.create(this.options.filter(i=>!r.includes(i)))}}d(In,"ZodEnum"),In.create=Oi;class ur extends q{_parse(r){const i=Q.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(r);if(s.parsedType!==U.string&&s.parsedType!==U.number){const a=Q.objectValues(i);return J(s,{expected:Q.joinValues(a),received:s.parsedType,code:j.invalid_type}),_e}if(i.indexOf(r.data)===-1){const a=Q.objectValues(i);return J(s,{received:s.data,code:j.invalid_enum_value,options:a}),_e}return w(r.data)}get enum(){return this._def.values}}d(ur,"ZodNativeEnum"),ur.create=(t,r)=>new ur(O({values:t,typeName:he.ZodNativeEnum},H(r)));class cn extends q{unwrap(){return this._def.type}_parse(r){const{ctx:i}=this._processInputParams(r);if(i.parsedType!==U.promise&&i.common.async===!1)return J(i,{code:j.invalid_type,expected:U.promise,received:i.parsedType}),_e;const s=i.parsedType===U.promise?i.data:Promise.resolve(i.data);return w(s.then(a=>this._def.type.parseAsync(a,{path:i.path,errorMap:i.common.contextualErrorMap})))}}d(cn,"ZodPromise"),cn.create=(t,r)=>new cn(O({type:t,typeName:he.ZodPromise},H(r)));class xe extends q{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===he.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(r){const{status:i,ctx:s}=this._processInputParams(r),a=this._def.effect||null,c={addIssue:p=>{J(s,p),p.fatal?i.abort():i.dirty()},get path(){return s.path}};if(c.addIssue=c.addIssue.bind(c),a.type==="preprocess"){const p=a.transform(s.data,c);return s.common.issues.length?{status:"dirty",value:s.data}:s.common.async?Promise.resolve(p).then(h=>this._def.schema._parseAsync({data:h,path:s.path,parent:s})):this._def.schema._parseSync({data:p,path:s.path,parent:s})}if(a.type==="refinement"){const p=d(h=>{const g=a.refinement(h,c);if(s.common.async)return Promise.resolve(g);if(g instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return h},"executeRefinement");if(s.common.async===!1){const h=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return h.status==="aborted"?_e:(h.status==="dirty"&&i.dirty(),p(h.value),{status:i.value,value:h.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(h=>h.status==="aborted"?_e:(h.status==="dirty"&&i.dirty(),p(h.value).then(()=>({status:i.value,value:h.value}))))}if(a.type==="transform")if(s.common.async===!1){const p=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!_(p))return p;const h=a.transform(p.value,c);if(h instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:i.value,value:h}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(p=>_(p)?Promise.resolve(a.transform(p.value,c)).then(h=>({status:i.value,value:h})):p);Q.assertNever(a)}}d(xe,"ZodEffects"),xe.create=(t,r,i)=>new xe(O({schema:t,typeName:he.ZodEffects,effect:r},H(i))),xe.createWithPreprocess=(t,r,i)=>new xe(O({schema:r,effect:{type:"preprocess",transform:t},typeName:he.ZodEffects},H(i)));class On extends q{_parse(r){return this._getType(r)===U.undefined?w(void 0):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}}d(On,"ZodOptional"),On.create=(t,r)=>new On(O({innerType:t,typeName:he.ZodOptional},H(r)));class Nr extends q{_parse(r){return this._getType(r)===U.null?w(null):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}}d(Nr,"ZodNullable"),Nr.create=(t,r)=>new Nr(O({innerType:t,typeName:he.ZodNullable},H(r)));class ci extends q{_parse(r){const{ctx:i}=this._processInputParams(r);let s=i.data;return i.parsedType===U.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:i.path,parent:i})}removeDefault(){return this._def.innerType}}d(ci,"ZodDefault"),ci.create=(t,r)=>new ci(O({innerType:t,typeName:he.ZodDefault,defaultValue:typeof r.default=="function"?r.default:()=>r.default},H(r)));class Ni extends q{_parse(r){const{ctx:i}=this._processInputParams(r),s=X(O({},i),{common:X(O({},i.common),{issues:[]})}),a=this._def.innerType._parse({data:s.data,path:s.path,parent:O({},s)});return M(a)?a.then(c=>({status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new Vt(s.common.issues)},input:s.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Vt(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}d(Ni,"ZodCatch"),Ni.create=(t,r)=>new Ni(O({innerType:t,typeName:he.ZodCatch,catchValue:typeof r.catch=="function"?r.catch:()=>r.catch},H(r)));class Di extends q{_parse(r){if(this._getType(r)!==U.nan){const i=this._getOrReturnCtx(r);return J(i,{code:j.invalid_type,expected:U.nan,received:i.parsedType}),_e}return{status:"valid",value:r.data}}}d(Di,"ZodNaN"),Di.create=t=>new Di(O({typeName:he.ZodNaN},H(t)));const Tl=Symbol("zod_brand");class cs extends q{_parse(r){const{ctx:i}=this._processInputParams(r),s=i.data;return this._def.type._parse({data:s,path:i.path,parent:i})}unwrap(){return this._def.type}}d(cs,"ZodBranded");class di extends q{_parse(r){const{status:i,ctx:s}=this._processInputParams(r);if(s.common.async)return d(()=>bt(this,null,function*(){const a=yield this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?_e:a.status==="dirty"?(i.dirty(),bi(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})}),"handleAsync")();{const a=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?_e:a.status==="dirty"?(i.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:s.path,parent:s})}}static create(r,i){return new di({in:r,out:i,typeName:he.ZodPipeline})}}d(di,"ZodPipeline");class fi extends q{_parse(r){const i=this._def.innerType._parse(r);return _(i)&&(i.value=Object.freeze(i.value)),i}}d(fi,"ZodReadonly"),fi.create=(t,r)=>new fi(O({innerType:t,typeName:he.ZodReadonly},H(r)));const er=d((t,r={},i)=>t?Ht.create().superRefine((s,a)=>{var c,p;if(!t(s)){const h=typeof r=="function"?r(s):typeof r=="string"?{message:r}:r,g=(p=(c=h.fatal)!==null&&c!==void 0?c:i)!==null&&p!==void 0?p:!0,v=typeof h=="string"?{message:h}:h;a.addIssue(X(O({code:"custom"},v),{fatal:g}))}}):Ht.create(),"custom"),Dr={object:rt.lazycreate};var he;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(he||(he={}));const Ar=d((t,r={message:`Input not instance of ${t.name}`})=>er(i=>i instanceof t,r),"instanceOfType"),Ai=je.create,Fi=De.create,So=Di.create,Ya=$e.create,ds=Sn.create,Xa=Lt.create,Eo=an.create,Fc=Ot.create,Lc=zt.create,fs=Ht.create,qa=yt.create,jc=St.create,To=Bt.create,Ja=Qe.create,ps=rt.create,Li=rt.strictCreate,xl=Tt.create,eu=wr.create,hs=zn.create,tu=un.create,nu=Bn.create,ru=ui.create,iu=En.create,ou=Un.create,Cl=Jn.create,Mc=Zn.create,Pl=In.create,zc=ur.create,vt=cn.create,pi=xe.create,Bc=On.create,Uc=Nr.create,xo=xe.createWithPreprocess,su=di.create;var x=Object.freeze({__proto__:null,defaultErrorMap:Mn,setErrorMap:vr,getErrorMap:_n,makeIssue:li,EMPTY_PATH:ai,addIssueToContext:J,ParseStatus:It,INVALID:_e,DIRTY:bi,OK:w,isAborted:S,isDirty:b,isValid:_,isAsync:M,get util(){return Q},get objectUtil(){return oe},ZodParsedType:U,getParsedType:ve,ZodType:q,ZodString:je,ZodNumber:De,ZodBigInt:$e,ZodBoolean:Sn,ZodDate:Lt,ZodSymbol:an,ZodUndefined:Ot,ZodNull:zt,ZodAny:Ht,ZodUnknown:yt,ZodNever:St,ZodVoid:Bt,ZodArray:Qe,ZodObject:rt,ZodUnion:Tt,ZodDiscriminatedUnion:wr,ZodIntersection:zn,ZodTuple:un,ZodRecord:Bn,ZodMap:ui,ZodSet:En,ZodFunction:Un,ZodLazy:Jn,ZodLiteral:Zn,ZodEnum:In,ZodNativeEnum:ur,ZodPromise:cn,ZodEffects:xe,ZodTransformer:xe,ZodOptional:On,ZodNullable:Nr,ZodDefault:ci,ZodCatch:Ni,ZodNaN:Di,BRAND:Tl,ZodBranded:cs,ZodPipeline:di,ZodReadonly:fi,custom:er,Schema:q,ZodSchema:q,late:Dr,get ZodFirstPartyTypeKind(){return he},coerce:{string:t=>je.create(X(O({},t),{coerce:!0})),number:t=>De.create(X(O({},t),{coerce:!0})),boolean:t=>Sn.create(X(O({},t),{coerce:!0})),bigint:t=>$e.create(X(O({},t),{coerce:!0})),date:t=>Lt.create(X(O({},t),{coerce:!0}))},any:fs,array:Ja,bigint:Ya,boolean:ds,date:Xa,discriminatedUnion:eu,effect:pi,enum:Pl,function:ou,instanceof:Ar,intersection:hs,lazy:Cl,literal:Mc,map:ru,nan:So,nativeEnum:zc,never:jc,null:Lc,nullable:Uc,number:Fi,object:ps,oboolean:d(()=>ds().optional(),"oboolean"),onumber:d(()=>Fi().optional(),"onumber"),optional:Bc,ostring:d(()=>Ai().optional(),"ostring"),pipeline:su,preprocess:xo,promise:vt,record:nu,set:iu,strictObject:Li,string:Ai,symbol:Eo,transformer:pi,tuple:tu,undefined:Fc,union:xl,unknown:qa,void:To,NEVER:_e,ZodIssueCode:j,quotelessJson:ln,ZodError:Vt});function Fr(t,r){return(i,s)=>t(i,s,r)}d(Fr,"makeNamespacedCall");var kl=Object.defineProperty,ms=d((t,r,i)=>r in t?kl(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,"base_defNormalProp"),_r=d((t,r,i)=>(ms(t,typeof r!="symbol"?r+"":r,i),i),"__publicField");class Ut{constructor(r,i){_r(this,"_call"),_r(this,"call"),this._call=r,this.call=Fr(this._call,i)}}d(Ut,"NamespaceBase");function $t(t){return typeof t=="string"?t:t instanceof Wn?t._id:t}d($t,"getRemId");const lu=d(t=>t.map($t),"getRemIds");var Zc=Object.defineProperty,au=Object.getOwnPropertySymbols,gs=Object.prototype.hasOwnProperty,Wc=Object.prototype.propertyIsEnumerable,Rl=d((t,r,i)=>r in t?Zc(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,"rem_defNormalProp"),bl=d((t,r)=>{for(var i in r||(r={}))gs.call(r,i)&&Rl(t,i,r[i]);if(au)for(var i of au(r))Wc.call(r,i)&&Rl(t,i,r[i]);return t},"rem_spreadValues"),N=d((t,r,i)=>(Rl(t,typeof r!="symbol"?r+"":r,i),i),"rem_publicField"),D=d((t,r,i)=>new Promise((s,a)=>{var c=d(g=>{try{h(i.next(g))}catch(v){a(v)}},"fulfilled"),p=d(g=>{try{h(i.throw(g))}catch(v){a(v)}},"rejected"),h=d(g=>g.done?s(g.value):Promise.resolve(g.value).then(c,p),"step");h((i=i.apply(t,r)).next())}),"__async");class Wn{constructor(r,i){N(this,"_id"),N(this,"createdAt"),N(this,"localUpdatedAt"),N(this,"updatedAt"),N(this,"parent"),N(this,"children"),N(this,"type"),N(this,"text"),N(this,"backText"),N(this,"_callMethod"),N(this,"call",(s,a)=>D(this,null,function*(){return yield this._callMethod(s,bl({remId:this._id},a),Mi)})),N(this,"callAndReturnRem",(s,a)=>D(this,null,function*(){const c=yield this.call(s,a);if(c)return new Wn(c,this._callMethod.bind(this))})),N(this,"callAndReturnManyRem",(s,a)=>D(this,null,function*(){const c=yield this.call(s,a);return c?c.map(p=>new Wn(p,this._callMethod.bind(this))):[]})),N(this,"setTableFilter",s=>D(this,null,function*(){return yield this.call("setTableFilter",{filter:s})})),N(this,"isTable",()=>D(this,null,function*(){return yield this.call("isTable",{})})),N(this,"allRemInFolderQueue",()=>D(this,null,function*(){return((yield this.call("allRemInFolderQueue",{}))||[]).map(s=>new Wn(s,this._callMethod.bind(this)))})),N(this,"positionAmongstSiblings",s=>D(this,null,function*(){return this.call("positionAmongstSiblings",{portalId:s})})),N(this,"positionAmongstVisibleSiblings",s=>D(this,null,function*(){return this.call("positionAmongstVisibleSiblings",{portalId:s})})),N(this,"hasPowerup",s=>D(this,null,function*(){return yield this.call("hasPowerup",{powerupCode:s})})),N(this,"getHiddenExplicitlyIncludedState",s=>D(this,null,function*(){return yield this.call("getHiddenExplicitlyIncludedState",{portalId:s})})),N(this,"setHiddenExplicitlyIncludedState",(s,a)=>D(this,null,function*(){return yield this.call("setHiddenExplicitlyIncludedState",{hiddenExplicitlyIncludedState:s,portalId:a})})),N(this,"getLastPracticed",()=>D(this,null,function*(){return yield this.call("getLastPracticed",{})})),N(this,"addPowerup",s=>D(this,null,function*(){return yield this.call("addPowerup",{powerupCode:s})})),N(this,"getLastTimeMovedTo",()=>D(this,null,function*(){return yield this.call("getLastTimeMovedTo",{})})),N(this,"getSchemaVersion",()=>D(this,null,function*(){return yield this.call("getSchemaVersion",{})})),N(this,"embeddedQueueViewMode",()=>D(this,null,function*(){return yield this.call("embeddedQueueViewMode",{})})),N(this,"isCollapsed",s=>D(this,null,function*(){return yield this.call("isCollapsed",{portalId:s})})),N(this,"setIsCollapsed",(s,a)=>D(this,null,function*(){return yield this.call("setIsCollapsed",{isCollapsed:s,portalId:a})})),N(this,"timesSelectedInSearch",()=>D(this,null,function*(){return yield this.call("timesSelectedInSearch",{})})),N(this,"getPortalType",()=>D(this,null,function*(){return yield this.call("getPortalType",{})})),N(this,"getPortalDirectlyIncludedRem",()=>D(this,null,function*(){return yield this.call("getPortalDirectlyIncludedRem",{})})),N(this,"getType",()=>D(this,null,function*(){return yield this.call("getType",{})})),N(this,"setPowerupProperty",(s,a,c)=>D(this,null,function*(){const p=Object.values(Er).includes(s)?Ui[s][a]:a;return yield this.call("setPowerupProperty",{powerupCode:s,powerupSlot:p,value:c})})),N(this,"getPowerupProperty",(s,a)=>D(this,null,function*(){const c=Object.values(Er).includes(s)?Ui[s][a]:a;return yield this.call("getPowerupProperty",{powerupCode:s,powerupSlot:c})})),N(this,"getPowerupPropertyAsRem",(s,a)=>D(this,null,function*(){const c=Object.values(Er).includes(s)?Ui[s][a]:a;return yield this.callAndReturnRem("getPowerupPropertyAsRem",{powerupCode:s,powerupSlot:c})})),N(this,"getTagPropertyAsRem",s=>D(this,null,function*(){return yield this.callAndReturnRem("getTagPropertyAsRem",{propertyId:s})})),N(this,"getPowerupPropertyAsRichText",(s,a)=>D(this,null,function*(){const c=Object.values(Er).includes(s)?Ui[s][a]:a;return yield this.call("getPowerupPropertyAsRichText",{powerupCode:s,powerupSlot:c})})),N(this,"setText",s=>D(this,null,function*(){return yield this.call("setText",{text:s})})),N(this,"setBackText",s=>D(this,null,function*(){return yield this.call("setBackText",{backText:s})})),N(this,"getTagPropertyValue",s=>D(this,null,function*(){return yield this.call("getTagPropertyValue",{propertyId:s})})),N(this,"getPropertyType",()=>D(this,null,function*(){return yield this.call("getPropertyType",{})})),N(this,"setTagPropertyValue",(s,a)=>D(this,null,function*(){return yield this.call("setTagPropertyValue",{propertyId:s,value:a})})),N(this,"removeTag",(s,a=!1)=>D(this,null,function*(){return yield this.call(a?"removeTagAndSlots":"removeTag",{tagId:s})})),N(this,"removePowerup",s=>D(this,null,function*(){return yield this.call("removePowerup",{powerupCode:s})})),N(this,"addTag",s=>D(this,null,function*(){const a=$t(s);return yield this.call("addTag",{tagId:a})})),N(this,"remove",()=>D(this,null,function*(){return yield this.call("remove",{})})),N(this,"getTagRems",()=>D(this,null,function*(){return this.callAndReturnManyRem("getTagRems",{})})),N(this,"addToPortal",s=>D(this,null,function*(){const a=$t(s);return yield this.call("addToPortal",{portalId:a})})),N(this,"removeFromPortal",s=>D(this,null,function*(){const a=$t(s);return yield this.call("removeFromPortal",{portalId:a})})),N(this,"setParent",(s,a)=>D(this,null,function*(){const c=$t(s);return yield this.call("setParent",{parentId:c,positionAmongstSiblings:a})})),N(this,"getOrCreateAliasWithText",s=>D(this,null,function*(){return yield this.callAndReturnRem("getOrCreateAliasWithText",{aliasText:s})})),N(this,"getChildrenRem",()=>D(this,null,function*(){return yield this.callAndReturnManyRem("getChildrenRem")})),N(this,"allRemInDocumentOrPortal",()=>D(this,null,function*(){return yield this.callAndReturnManyRem("allRemInDocumentOrPortal")})),N(this,"expand",(s,a)=>D(this,null,function*(){const c=$t(s);return yield this.call("expand",{portalId:c,recurse:a})})),N(this,"collapse",s=>D(this,null,function*(){const a=$t(s);return yield this.call("collapse",{portalId:a})})),N(this,"siblingRem",()=>D(this,null,function*(){return yield this.callAndReturnManyRem("siblingRem")})),N(this,"visibleSiblingRem",s=>D(this,null,function*(){return yield this.callAndReturnManyRem("visibleSiblingRem",{portalId:s})})),N(this,"taggedRem",()=>D(this,null,function*(){return yield this.callAndReturnManyRem("taggedRem")})),N(this,"ancestorTagRem",()=>D(this,null,function*(){return yield this.callAndReturnManyRem("ancestorTagRem")})),N(this,"descendantTagRem",()=>D(this,null,function*(){return yield this.callAndReturnManyRem("descendantTagRem")})),N(this,"getDescendants",()=>D(this,null,function*(){return yield this.callAndReturnManyRem("getDescendants")})),N(this,"getCards",()=>D(this,null,function*(){const s=yield this.call("getCards");return s?.map(a=>new cr(a,this._callMethod))||[]})),N(this,"getAliases",()=>D(this,null,function*(){return yield this.callAndReturnManyRem("getAliases")})),N(this,"getParentRem",()=>D(this,null,function*(){return yield this.callAndReturnRem("getParentRem")})),N(this,"portalsAndDocumentsIn",()=>D(this,null,function*(){return yield this.callAndReturnManyRem("portalsAndDocumentsIn")})),N(this,"merge",s=>D(this,null,function*(){return yield this.call("merge",{remIdToMergeIntoThisOne:s})})),N(this,"mergeAndSetAlias",s=>D(this,null,function*(){const a=$t(s);return yield this.call("mergeAndSetAlias",{remIdToMergeIntoThisOne:a})})),N(this,"indent",s=>D(this,null,function*(){const a=$t(s);return yield this.call("indent",{portalId:a})})),N(this,"outdent",s=>D(this,null,function*(){const a=$t(s);return yield this.call("outdent",{portalId:a})})),N(this,"setType",s=>D(this,null,function*(){return yield this.call("setType",{type:s})})),N(this,"remsReferencingThis",()=>D(this,null,function*(){return yield this.callAndReturnManyRem("remsReferencingThis")})),N(this,"remsBeingReferenced",()=>D(this,null,function*(){return yield this.callAndReturnManyRem("remsBeingReferenced")})),N(this,"deepRemsBeingReferenced",()=>D(this,null,function*(){return yield this.callAndReturnManyRem("deepRemsBeingReferenced")})),N(this,"getSources",()=>D(this,null,function*(){return yield this.callAndReturnManyRem("getSources")})),N(this,"addSource",s=>D(this,null,function*(){const a=$t(s);return yield this.call("addSource",{sourceId:a})})),N(this,"removeSource",s=>D(this,null,function*(){const a=$t(s);return yield this.call("removeSource",{sourceId:a})})),N(this,"isDocument",()=>D(this,null,function*(){return yield this.call("isDocument")})),N(this,"setIsDocument",s=>D(this,null,function*(){return yield this.call("setIsDocument",{isDocument:s})})),N(this,"isListItem",()=>D(this,null,function*(){return yield this.call("isListItem")})),N(this,"setIsListItem",s=>D(this,null,function*(){return yield this.call("setIsListItem",{isListItem:s})})),N(this,"isCardItem",()=>D(this,null,function*(){return yield this.call("isMultilineCard")})),N(this,"setIsCardItem",s=>D(this,null,function*(){return yield this.call("setIsMultilineCard",{isCardItem:s})})),N(this,"isQuote",()=>D(this,null,function*(){return yield this.call("isQuote")})),N(this,"setIsQuote",s=>D(this,null,function*(){yield this.call("setIsQuote",{isQuote:s})})),N(this,"isCode",()=>D(this,null,function*(){return yield this.call("isCode")})),N(this,"setIsCode",s=>D(this,null,function*(){yield this.call("setIsCode",{isCode:s})})),N(this,"isTodo",()=>D(this,null,function*(){return yield this.call("isTodo")})),N(this,"setIsTodo",s=>D(this,null,function*(){yield this.call("setIsTodo",{isTodo:s})})),N(this,"getTodoStatus",()=>D(this,null,function*(){return yield this.call("getTodoStatus")})),N(this,"setTodoStatus",s=>D(this,null,function*(){return yield this.call("setTodoStatus",{todoStatus:s})})),N(this,"getFontSize",()=>D(this,null,function*(){return yield this.call("getFontSize")})),N(this,"setFontSize",s=>D(this,null,function*(){return yield this.call("setFontSize",{fontSize:s})})),N(this,"getHighlightColor",()=>D(this,null,function*(){return yield this.call("getHighlightColor")})),N(this,"setHighlightColor",s=>D(this,null,function*(){return yield this.call("setHighlightColor",{highlightColor:s})})),N(this,"isPowerup",()=>D(this,null,function*(){return yield this.call("isPowerup")})),N(this,"isPowerupEnum",()=>D(this,null,function*(){return yield this.call("isPowerupEnum")})),N(this,"isPowerupPropertyListItem",()=>D(this,null,function*(){return yield this.call("isPowerupPropertyListItem")})),N(this,"isPowerupSlot",()=>D(this,null,function*(){return yield this.call("isPowerupSlot")})),N(this,"isPowerupProperty",()=>D(this,null,function*(){return yield this.call("isPowerupProperty")})),N(this,"isSlot",()=>D(this,null,function*(){return yield this.call("isSlot")})),N(this,"setIsSlot",s=>D(this,null,function*(){return yield this.call("setIsSlot",{isSlot:s})})),N(this,"isProperty",()=>D(this,null,function*(){return yield this.call("isSlot")})),N(this,"setIsProperty",s=>D(this,null,function*(){return yield this.call("setIsSlot",{isSlot:s})})),N(this,"openRemInContext",s=>D(this,null,function*(){yield this.call("openRemInContext",{portalId:s})})),N(this,"openRemAsPage",()=>D(this,null,function*(){yield this.call("openRemAsPage")})),N(this,"getEnablePractice",()=>D(this,null,function*(){return yield this.call("getEnablePractice")})),N(this,"getPracticeDirection",()=>D(this,null,function*(){return yield this.call("getPracticeDirection")})),N(this,"setEnablePractice",s=>D(this,null,function*(){return yield this.call("setEnablePractice",{enablePractice:s})})),N(this,"setPracticeDirection",s=>D(this,null,function*(){return yield this.call("setPracticeDirection",{direction:s})})),N(this,"copyPortalReferenceToClipboard",()=>D(this,null,function*(){return yield this.call("copyPortalReferenceToClipboard")})),N(this,"copyTagReferenceToClipboard",()=>D(this,null,function*(){return yield this.call("copyTagReferenceToClipboard")})),N(this,"copyReferenceToClipboard",()=>D(this,null,function*(){return yield this.call("copyReferenceToClipboard")})),N(this,"scrollToReaderHighlight",()=>D(this,null,function*(){return yield this.call("scrollToReaderHighlight")})),N(this,"isFolder",()=>D(this,null,function*(){return yield this.call("isFolder")})),N(this,"setIsFolder",s=>D(this,null,function*(){return yield this.call("setIsFolder",{isFolder:s})})),this._id=r._id,this.parent=r.parent,this.children=r.children,this.type=r.type,this.text=r.text,this.backText=r.backText,this.updatedAt=r.u,this.localUpdatedAt=r.o,this.createdAt=r.createdAt,this._callMethod=i}}d(Wn,"RemObject");class ji extends Ut{constructor(r){super(r,Mi),N(this,"findOne",i=>D(this,null,function*(){if(!i)return;const s=yield this.call("findOne",{remId:i});if(s)return new Qt(s,this.call)})),N(this,"createSingleRemWithMarkdown",(i,s)=>D(this,null,function*(){const a=yield this.call("createSingleRemWithMarkdown",{markdown:i,parentId:s});return a&&new Qt(a,this.call)})),N(this,"createTreeWithMarkdown",(i,s)=>D(this,null,function*(){return((yield this.call("createTreeWithMarkdown",{markdown:i,parentId:s}))||[]).map(a=>new Qt(a,this.call))})),N(this,"findByName",(i,s)=>D(this,null,function*(){const a=yield this.call("findByName",{name:i,parentId:s});if(a)return new Qt(a,this.call)})),N(this,"moveRems",(i,s,a,c)=>D(this,null,function*(){const p=lu(i),h=$t(s),g=$t(c);yield this.call("moveRems",{portalId:g,remIds:p,newParentId:h,positionAmongstSiblings:a})})),N(this,"getAll",()=>D(this,null,function*(){return((yield this.call("getAll",{}))||[]).map(i=>new Qt(i,this._call))})),N(this,"findMany",i=>D(this,null,function*(){const s=lu(i),a=yield this.call("findMany",{remIds:s});if(a)return a.map(c=>new Qt(c,this._call))})),N(this,"createPortal",()=>D(this,null,function*(){const i=yield this.call("createPortal",{});return i?new Qt(i,this._call):void 0})),N(this,"createLinkRem",(i,s=!0)=>D(this,null,function*(){const a=yield this.call("createLinkRem",{url:i,addTitle:s});if(a)return new Qt(a,this._call)})),N(this,"createTable",i=>D(this,null,function*(){const s=$t(i),a=yield this.call("createTable",{existingTagId:s});if(a)return new Qt(a,this._call)})),N(this,"createRem",()=>D(this,null,function*(){const i=yield this.call("createRem",{});if(i)return new Qt(i,this._call)}))}}d(ji,"RemNamespace");const Qt=Wn,Mi="rem";var ys=Object.defineProperty,Il=Object.getOwnPropertySymbols,Nn=Object.prototype.hasOwnProperty,zi=Object.prototype.propertyIsEnumerable,Co=d((t,r,i)=>r in t?ys(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,"card_defNormalProp"),Bi=d((t,r)=>{for(var i in r||(r={}))Nn.call(r,i)&&Co(t,i,r[i]);if(Il)for(var i of Il(r))zi.call(r,i)&&Co(t,i,r[i]);return t},"card_spreadValues"),rn=d((t,r,i)=>(Co(t,typeof r!="symbol"?r+"":r,i),i),"card_publicField"),tr=d((t,r,i)=>new Promise((s,a)=>{var c=d(g=>{try{h(i.next(g))}catch(v){a(v)}},"fulfilled"),p=d(g=>{try{h(i.throw(g))}catch(v){a(v)}},"rejected"),h=d(g=>g.done?s(g.value):Promise.resolve(g.value).then(c,p),"step");h((i=i.apply(t,r)).next())}),"card_async");const Po="card";class hi extends Ut{constructor(r){super(r,Po),rn(this,"findOne",i=>tr(this,null,function*(){if(!i)return;const s=yield this.call("findOne",{id:i});return s?new cr(s,this._call):void 0})),rn(this,"getAll",()=>tr(this,null,function*(){const i=yield this.call("getAll",{});return i?.map(s=>new cr(s,this._call))||[]})),rn(this,"findMany",i=>tr(this,null,function*(){const s=yield this.call("findMany",{ids:i});return s?.map(a=>new cr(a,this._call))||[]}))}}d(hi,"CardNamespace");class cr extends Ut{constructor(r,i){super(i,Po),rn(this,"_id"),rn(this,"remId"),rn(this,"type"),rn(this,"createdAt"),rn(this,"repetitionHistory"),rn(this,"nextRepetitionTime"),rn(this,"timesWrongInRow"),rn(this,"lastRepetitionTime"),rn(this,"callCard",(a,c)=>tr(this,null,function*(){return yield this._call(a,Bi({id:this._id},c),Po)})),rn(this,"callRem",(a,c)=>tr(this,null,function*(){return yield this._call(a,Bi({},c),Mi)})),rn(this,"getType",()=>tr(this,null,function*(){return yield this.callCard("getType",{id:this._id})})),rn(this,"getRem",()=>tr(this,null,function*(){return yield this.callRem("findOne",{remId:this.remId})})),rn(this,"remove",()=>tr(this,null,function*(){return yield this.callCard("remove",{})})),rn(this,"updateCardRepetitionStatus",a=>tr(this,null,function*(){return yield this.callCard("updateCardRepetitionStatus",{score:a})})),this._id=r._id,this.remId=r.remId;const s=r.cardType;this.type=s==="f"?"forward":s==="b"?"backward":{clozeId:s},this.createdAt=r.createdAt,this.repetitionHistory=r.history,this.nextRepetitionTime=r.activeNextTime,this.timesWrongInRow=r.timesWrongInRow}}d(cr,"Card");var uu=Object.defineProperty,Vc=Object.defineProperties,Hc=Object.getOwnPropertyDescriptors,cu=Object.getOwnPropertySymbols,Ol=Object.prototype.hasOwnProperty,$c=Object.prototype.propertyIsEnumerable,du=d((t,r,i)=>r in t?uu(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,"interfaces_defNormalProp"),Qc=d((t,r)=>{for(var i in r||(r={}))Ol.call(r,i)&&du(t,i,r[i]);if(cu)for(var i of cu(r))$c.call(r,i)&&du(t,i,r[i]);return t},"interfaces_spreadValues"),Kc=d((t,r)=>Vc(t,Hc(r)),"__spreadProps"),vs=(t=>(t.Rem="Rem",t.Text="Text",t.PDF="PDF",t.WebReader="WebReader",t))(vs||{});const Nl={quote:"q",underline:"u",bold:"b",italic:"l"};var ws=(t=>(t[t.undefined=0]="undefined",t[t.Red=1]="Red",t[t.Orange=2]="Orange",t[t.Yellow=3]="Yellow",t[t.Green=4]="Green",t[t.Blue=6]="Blue",t[t.Purple=5]="Purple",t[t.Gray=7]="Gray",t[t.Brown=8]="Brown",t[t.Pink=9]="Pink",t))(ws||{}),Dl=(t=>(t.Read="Read",t.ReadCreate="ReadCreate",t.ReadCreateModify="ReadCreateModify",t.ReadCreateModifyDelete="ReadCreateModifyDelete",t))(Dl||{}),Sr=(t=>(t.All="All",t.DescendantsOfName="DescendantsOfName",t.DescendantsOfId="DescendantsOfId",t.Powerup="Powerup",t.FocusedSubtree="FocusedSubtree",t.KnowledgeBaseInfo="KnowledgeBaseInfo",t))(Sr||{}),fu=(t=>(t.FloatingWidget="FloatingWidget",t.PaneHeader="PaneHeader",t.Index="Index",t.TopBar="TopBar",t.QueueToolbar="QueueToolbar",t.QueueBelowTopBar="QueueBelowTopBar",t.DocumentAboveToolbar="AboveDocumentToolbar",t.DocumentBelowToolbar="DocumentBelowToolbar",t.DocumentBelowEditor="DocumentBelowEditor",t.DocumentBelowTitle="DocumentBelowTitle",t.SidebarEnd="SidebarEnd",t.RemReferencePopupStart="RemReferencePopupStart",t.RemReferencePopupRight="RemReferencePopupRight",t.Pane="Pane",t.FlashcardAnswerButtons="FlashcardAnswerButtons",t.FlashcardAnswer="FlashcardAnswer",t.Flashcard="Flashcard",t.FlashcardExtraDetail="FlashcardExtraDetail",t.FlashcardUnder="FlashcardUnder",t.RightSidebar="RightSidebar",t.LeftSidebar="LeftSidebar",t.Popup="Popup",t.UnderRemEditor="UnderRemEditor",t.RightSideOfEditor="RightSideOfEditor",t.SelectedTextMenu="SelectedTextMenu",t.PDFHighlightToolbarLocation="PDFHighlightToolbarLocation",t.PDFHighlightPopupLocation="PDFHighlightPopupLocation",t.DeckPage="DeckPage",t.LearningProgressPage="LearningProgressPage",t))(fu||{}),Er=(t=>(t.Aliases="l",t.AutoSort="a",t.AppliedTemplates="at",t.AutoTemplate="m",t.CustomCSS="c",t.DailyDocument="d",t.DisableCards="u",t.Divider="dv",t.Document="o",t.DocumentSidebar="s",t.EditLater="e",t.Emoji="j",t.ExtraCardDetail="x",t.Header="r",t.Highlight="h",t.Link="b",t.List="i",t.MultipleChoice="mc",t.MultiLineCard="w",t.PDFPageNumber="pn",t.PDFHighlight="n",t.QuickAdd="q",t.Quote="qt",t.RestoredFromTrash="rt",t.Slot="y",t.Sources="os",t.SuperPrivate="k",t.TableOfContent="toc",t.TextToSpeech="tts",t.EmbedWebsite="ew",t.UsedAsTag="g",t.Todo="t",t.UploadedFile="f",t.WebHighlight="p",t.Website="z",t.Code="cd",t.TypeInAnswer="ty",t.Deck="de",t.SearchPortal="sp",t.Collection="ct",t.HTMLHighlight="hh",t.HideQueueAncestors="ha",t.ImportedDocument="id",t.Image="im",t.SavedDocuments="sd",t.Callout="clo",t))(Er||{});const Ui={ha:{},l:{Aliases:"a"},ct:{Template:"t"},a:{SortDirection:"d"},cd:{Language:"l",DontWrap:"w",DontBoundHeight:"b"},m:{},c:{},d:{Timestamp:"s",Date:"d"},u:{},o:{Status:"s",DeprecatedSource:"o"},s:{},dv:{},e:{Message:"m"},j:{},x:{},r:{Size:"s"},h:{Color:"c"},b:{URL:"u",Title:"t",ReadPercent:"r",LastReadDate:"d",FileURL:"f"},i:{},w:{},n:{Data:"d",PdfId:"p"},hh:{Data:"d",HTMLId:"h"},pn:{},q:{},qt:{},rt:{Date:"d"},y:{SelectTag:"t",ExtraSlotsOnFrontOfCard:"f",ExtraSlotsOnBackOfCard:"b"},os:{Sources:"os"},at:{Templates:"t"},sp:{Query:"q",Filter:"f",AutomaticBacklinkSearchPortalFor:"b",DontIncludeNestedDescendants:"s"},k:{},g:{AutoActivate:"a",Pinned:"p",CollapseConfigure:"c",PrimaryColumnName:"n"},t:{Status:"s"},ew:{URL:"u",WIDTH:"w",HEIGHT:"h"},toc:{},tts:{},f:{Type:"t",URL:"u",Name:"n",Authors:"a",Keywords:"k",Title:"i",ViewerData:"v",ReadPercent:"r",LastReadDate:"d",HasNoTextLayer:"tl",Theme:"h"},p:{Data:"d",Url:"w"},z:{Hostname:"u"},clo:{BulletIcon:"b"},ty:{},de:{Topics:"t",Status:"s",MaxNewCardsPerDay:"m",MaxTotalCardsPerDay:"c",ExamSchedulerDate:"e",RetrievabilityPeriodStartDate:"r",ConsolidationPeriodStartDate:"pmd",ConsolidationPeriodReIntroSectionLength:"pml",ExamConfig:"ec",SavedExamInfo:"ei",ExamSchedulerDesiredStability:"eds",ExamSchedulerMaxNewCardsPerDay:"emnc",ExamSchedulerMaxTotalCardsPerDay:"emtc",ExamSchedulerCollection:"emcd"},id:{},sd:{},mc:{},im:{Image:"i"}};var pu=(t=>(t[t.DEFAULT_TYPE=void 0]="DEFAULT_TYPE",t[t.CONCEPT=1]="CONCEPT",t[t.DESCRIPTOR=2]="DESCRIPTOR",t))(pu||{}),Al=(t=>(t[t.DEFAULT_TYPE=void 0]="DEFAULT_TYPE",t[t.CONCEPT=1]="CONCEPT",t[t.DESCRIPTOR=2]="DESCRIPTOR",t[t.DEPRECATED_BASIC_CARD=4]="DEPRECATED_BASIC_CARD",t[t.PORTAL=6]="PORTAL",t[t.DEPRECATED_SLOT=3]="DEPRECATED_SLOT",t[t.DEPRECATED_PATTERN=5]="DEPRECATED_PATTERN",t[t.DEPRECATED_COLLECTION=7]="DEPRECATED_COLLECTION",t[t.DEPRECATED_TEXT=8]="DEPRECATED_TEXT",t))(Al||{}),Fl=(t=>(t[t.DEFAULT_TYPE=0]="DEFAULT_TYPE",t[t.CONCEPT=1]="CONCEPT",t[t.DESCRIPTOR=2]="DESCRIPTOR",t[t.PORTAL=3]="PORTAL",t))(Fl||{});function hu(t){switch(t){case 1:return 1;case 2:return 2;case 6:return 3;default:return 0}}d(hu,"remTypeToTinyGraphType");function mu(t){switch(t){case 1:return 1;case 2:return 2;case 3:return 6;default:return Al.DEFAULT_TYPE}}d(mu,"remTypeTinyGraphToNormal");var gu=(t=>(t.MultipleWindows="multipleWindows",t.MultipleWindowsPanel="multipleWindowsPanel",t.Dropdown="Dropdown",t.Breadcrumbs="Breadcrumbs",t.FloatingDiscussion="floatingDiscussion",t.WindowManager="windowManager",t.RemPage="RemPage",t.WindowPane="windowPane",t.MobileTabBar="MobileTabBar",t.Document="document",t.NotificationPanel="notificationPanel",t.EmojiPicker="EmojiPicker",t.HierarchyEditorTree="hierarchyEditorTree",t.ChangeCodeLanguage="ChangeCodeLanguage",t.HierarchyEditorTreePortal="hierarchyEditorTreePortal",t.HierarchyEditorTreeRem="hierarchyEditorTreeRem",t.RichTextEditor="richTextEditor",t.RichTextEditorItem="richTextEditorItem",t.RichTextEditorAliasPopup="richTextEditorAliasPopup",t.TableCellList="tableCellList",t.TableCellPopup="tableCellPopup",t.Table="Table",t.ColumnConfigurationMenu="columnConfigurationMenu",t.Popup="popup",t.Omnibar="omnibar",t.QuickAdd="quickAdd",t.Date="date",t.Queue="queue",t.TypeAnswerBox="typeAnswerBox",t.QueryBuilder="queryBuilder",t.PublishedKnowledgeBase="publishedKnowledgeBase",t.ArticleViewer="articleViewer",t.Article="article",t.FullPageSearch="fullPageSearch",t.ExtraDate="extraDate",t.DropToOpenAsDocument="dropToOpenAsDocument",t.TableSearch="TableSearch",t.PDF="pdf",t.PdfPageNumber="pdfPageNumber",t.NotesPopup="notesPopup",t.PDFUploader="pdfUploader",t.Reader="reader",t.RemSearchPopup="remSearchPopup",t.Debugger="debugger",t.SelectRem="selectRem",t.ExpressionSelect="ExpressionSelect",t.HiddenChildren="hiddenChildren",t.TableTitle="tableTitle",t.TableTagTitle="tableTagTitle",t.TableColumnTitle="tableColumnTitle",t.Toolbar="toolbar",t.Title="title",t.SidebarTitleEdit="sidebarTitleEdit",t.ArticleQueue="articleQueue",t.UserDocument="userDocument",t.DocumentSidebar="documentSidebar",t.RightSidebar="rightSidebar",t.Documents="documents",t.AudioVideo="audioVideo",t.ImageNode="imageNode",t.QueryNodeEditor="queryNodeEditor",t.LinkBox="linkBox",t.SelectedTextMenu="selectedTextMenu",t.RemReferenceNode="remReferenceNode",t.DeckTopicsList="deckTopics",t.DeckTopic="deckTopic",t.AddDeckTopic="addDeckTopic",t.DocSources="docSources",t.DocTags="docTags",t.AddSources="addSources",t.AddTags="addTags",t.InlineLink="inlineLink",t.ImageSelector="imageSelector",t.Latex="latex",t.Image="image",t.Cloze="cloze",t.Alias="alias",t.QueueFolderDropdownSelector="queueFolderDropdownSelector",t.CustomEditLaterMessage="customEditLaterMessage",t.DocumentParents="documentParents",t.AreaHighlight="areaHighlight",t.WindowOne="windowOne",t.WindowTwo="windowTwo",t.Replace="replace",t.Find="find",t.Tag="tag",t.TagBar="tagBar",t.Menu="menu",t.Screenshot="screenshot",t.HelpMessage="helpMessage",t.AddNode="addNode",t.EditEdge="editEdge",t.Controls="controls",t.DocumentSource="documentSource",t.Merge="merge",t.HierarchyEditorTemplateFields="hierarchyEditorTemplateFields",t.SearchExistingTable="searchExistingTable",t.FieldKey="fieldKey",t.PluginRemRichTextEditor="pluginRemRichTextEditor",t.PluginRichTextViewer="pluginRichTextViewer",t.RemHierarchyEditorTree="remHierarchyEditorTree",t.PluginQueue="pluginQueue",t.RichTextEditorFakeEmbed="richTextEditorFakeEmbed",t.DocumentHeader="documentHeader",t.EmbedWebsite="embedWebsite",t.TemplateValueEditor="TemplateValueEditor",t.TemplateValueTextEditor="TemplateValueTextEditor",t.Key="key",t.Value="value",t.CtrlF="ctrlF",t.CtrlFFind="ctrlFind",t.CtrlFReplace="ctrlReplace",t.CtrlFFilter="ctrlFilter",t.SearchResult="searchResult",t.SearchResultItem="searchResultItem",t.FocusableInput="focusableInput",t.UpvoteDownvoteFeedback="UpvoteDownvoteFeedback",t.RightSidebarHelpInput="RightSidebarHelpInput",t.LeftSidebarTutorial="LeftSidebarTutorial",t.CardTableSearchQuery="cardTableSearchQuery",t.Tab="tab",t.ExamDeckRemSearchPopup="ExamDeckRemSearchPopup",t.RightSideImagePopup="RightSideImagePopup",t.RightSideUploadedImagePopup="RightSideUploadedImagePopup",t.RemDocumentSidebar="RemDocumentSidebar",t.RemEmoji="remEmoji",t.FlashcardPreview="FlashcardPreview",t.HoverPreview="HoverPreview",t))(gu||{}),yu=(t=>(t.Text="text",t.SelectedRange="selectedRange",t))(yu||{}),Gc=(t=>(t.Global="global",t.RemFocused="rem-focused",t.RemSelected="rem-selected",t))(Gc||{}),Ll=(t=>(t[t.IMPLICIT_TEXT=void 0]="IMPLICIT_TEXT",t.NUMBER="number",t.DEPRECATED_TITLE="title",t.TEXT="text",t.CHECKBOX="checkbox",t.DATE="date",t.MULTI_SELECT="multi_select",t.SINGLE_SELECT="single_select",t.CREATED_AT="created_at",t.LAST_UPDATED="last_updated",t.IMAGE="image",t.URL="url",t.DEFINITION="definition",t))(Ll||{}),vu=(t=>(t.PropertyConfigMenu="PropertyConfigMenu",t.QueueMenu="QueueMenu",t.ReaderMenu="ReaderMenu",t.PDFHighlightPopupLocation="PDFHighlightPopupLocation",t.DocumentMenu="DocumentMenu",t))(vu||{});const jl=x.union([x.object({type:x.literal("email")}),x.object({type:x.literal("url")}),x.object({type:x.literal("regex"),arg:x.string()}),x.object({type:x.literal("startsWith"),arg:x.string()}),x.object({type:x.literal("endsWith"),arg:x.string()}),x.object({type:x.literal("min"),arg:x.number().positive()}),x.object({type:x.literal("max"),arg:x.number().positive()}),x.object({type:x.literal("length"),arg:x.number().positive()})]),ko=x.union([x.object({type:x.literal("gte"),arg:x.number()}),x.object({type:x.literal("min"),arg:x.number()}),x.object({type:x.literal("gt"),arg:x.number()}),x.object({type:x.literal("lt"),arg:x.number()}),x.object({type:x.literal("lte"),arg:x.number()}),x.object({type:x.literal("int")}),x.object({type:x.literal("multipleOf"),arg:x.number()}),x.object({type:x.literal("step"),arg:x.number()}),x.object({type:x.literal("positive")}),x.object({type:x.literal("negative")}),x.object({type:x.literal("max"),arg:x.number()})]);var wu=(t=>(t[t.TOO_EARLY=.01]="TOO_EARLY",t[t.AGAIN=0]="AGAIN",t[t.HARD=.5]="HARD",t[t.GOOD=1]="GOOD",t[t.EASY=1.5]="EASY",t[t.VIEWED_AS_LEECH=2]="VIEWED_AS_LEECH",t[t.RESET=3]="RESET",t[t.MANUAL_DATE=4]="MANUAL_DATE",t[t.MANUAL_EASE=5]="MANUAL_EASE",t))(wu||{}),Dn=(t=>(t.Queue="Queue",t.PreviewRemCards="ViewAsCard",t.LoadingSpinner="LoadingSpinner",t.RichTextEditor="RichTextEditor",t.RichText="RichTextViewer",t.RemRichTextEditor="RemRichTextEditor",t.RemViewer="RemViewer",t.RemHierarchyEditorTree="RemHierarchyEditorTree",t.PDFWebReader="PDFWebReader",t.DocumentViewer="DocumentViewer",t))(Dn||{});const _u={REM:"q",IMAGE:"i",AUDIO:"a",PLUGIN:"p",DRAWING:"r",GLOBAL_NAME:"g",DEPRECATED_CODE:"o",ANNOTATION:"n",TEXT:"m",LATEX:"x",CARD_DELIMITER:"s",FLASHCARD_ICON:"fi",DYNAMIC_ICON:"di",ADD_ICON:"ai"},dr={CLOZE:"cId",UNDERLINE:"u",SUBSCRIPT:"sub",SUPERSCRIPT:"sup",BOLD:"b",STRIKETHROUGH:"str",ITALIC:"l",INLINE_LINK:"qId",INLINE_CODE:"q",QUOTE:"qt",HIDDEN_CLOZE:"hiddenCloze",REVEALED_CLOZE:"revealedCloze",HIGHLIGHT:"h",TEXT_COLOR:"tc",DEPRECATED_LINK:"url",CODE:"code",CODE_LANGUAGE:"language",COMMENT_ID:"c",CLOZE_HINT:"cloze-hint",CARD_HINT_FRONT:"card-hint-front",CARD_HINT_BACK:"card-hint-back",MULTILINE_CARD_HINT:"multiline-card-item-hint"},nr={UNDERLINE:"u",BOLD:"b",ITALIC:"t",INLINE_CODE:"c",CLOZE:"e",HIDDEN_CLOZE:"z",LINK:"l",HIGHLIGHT:"h",DATE:"d"},Su={LATEX:"x"},Zi={[nr.UNDERLINE]:dr.UNDERLINE,[nr.BOLD]:dr.BOLD,[nr.ITALIC]:dr.ITALIC,[nr.INLINE_CODE]:dr.INLINE_CODE,[nr.CLOZE]:dr.CLOZE,[nr.HIDDEN_CLOZE]:dr.HIDDEN_CLOZE,[nr.LINK]:dr.DEPRECATED_LINK,[nr.HIGHLIGHT]:dr.HIGHLIGHT,[nr.DATE]:!0};var Eu=(t=>(t[t.PORTAL=void 0]="PORTAL",t[t.EMBEDDED_QUEUE=2]="EMBEDDED_QUEUE",t[t.SCAFFOLD=3]="SCAFFOLD",t[t.SEARCH_PORTAL=4]="SEARCH_PORTAL",t))(Eu||{}),Tu=(t=>(t[t.OFFSET=0]="OFFSET",t[t.UNIT=1]="UNIT",t[t.CHARACTER=2]="CHARACTER",t[t.WORD=3]="WORD",t[t.WORD_START=4]="WORD_START",t[t.WORD_END=5]="WORD_END",t[t.LINE=6]="LINE",t))(Tu||{}),xu=(t=>(t.SRSScheduleCard="SRSScheduleCard",t.GetNextCard="GetNextCard",t))(xu||{}),Ml=(t=>(t.RetrievabilityPeriodPreExam="pre_exam",t.MaintenancePeriod="maintenance_period",t.EnterConsolidationPeriod="enter_consolidation_period",t.ConsolidationPeriod="consolidation_period",t.NotGoodEnoughForExam="exam_not_good",t.PostponedExamStartDate="postpone_start",t.NormalRepetition="normal_repetition",t))(Ml||{});const Cu=["pre_exam","maintenance_period","enter_consolidation_period","consolidation_period","exam_not_good","postpone_start"];var mi=(t=>(t[t.Enum=void 0]="Enum",t.AnyRem="any",t.Relation="relation",t))(mi||{}),Wi=(t=>(t.Queue="Queue",t))(Wi||{}),zl=(t=>(t.RIGHT="right",t.BELOW="label",t.ONLY_DOCUMENT="only_document",t.ONLY_IN_TABLE="only_table",t[t.INLINE=void 0]="INLINE",t))(zl||{}),Vi=(t=>(t.NumReviews="num_reviews",t.DueDate="due_date",t.IsEnabled="is_enabled",t.IsDue="is_due",t.IsLeech="is_leech",t.CardMasteryLevel="card_mastery_level",t.CreatedAt="created_at",t))(Vi||{}),Jt=(t=>(t.Text="Text",t.Reference="Reference",t.Portal="Portal",t.Tag="Tag",t.TagWithoutInheritance="TagWithoutInheritance",t.Connection="Connection",t.IsDescendantOf="IsDescendantOf",t.InDocument="InDocument",t.RemType="RemType",t.Date="Date",t.MultiSelect="Multi Select",t.LegacyMultiSelect="MultiSelect",t.SingleSelect="Single Select",t.LegacySingleSelect="SingleSelect",t.Checkbox="Checkbox",t.Number="NumberExpression",t))(Jt||{}),xt=(t=>(t.Or="or",t.And="and",t.Not="not",t.Expression="expression",t.GetSlot="get_slot",t.GetCardInfo="get_card_info",t))(xt||{});const _s=x.object({exp:x.literal("not"),exp1:x.lazy(()=>$i)}),Ss=x.object({exp:x.union([x.literal("and"),x.literal("or")]),exps:x.lazy(()=>$i.array()),cannotRemove:x.boolean().optional()}),Bl=x.object({exp:x.literal("get_slot"),slotRemId:x.string(),exps:x.lazy(()=>$i)}),Ul=x.object({exp:x.literal("get_card_info"),cardField:x.nativeEnum(Vi),exp1:x.lazy(()=>$i)}),Zl=x.object({exp:x.literal("expression"),refType:x.enum(["Reference","Portal","Tag","TagWithoutInheritance","IsDescendantOf","InDocument","Connection"]),remId:x.string(),cannotRemove:x.boolean().optional(),cannotAdd:x.boolean().optional()}),Pu=x.enum(["concept","descriptor","none"]),ku=x.object({exp:x.literal("expression"),refType:x.literal("RemType"),remType:Pu});var Wl=(t=>(t.Checked="checked",t.Unchecked="unchecked",t))(Wl||{}),Vl=(t=>(t.Contains="contains",t.DoesNotContain="doesNotContain",t.Is="is",t.IsNot="notIs",t.StartsWith="startsWith",t.EndsWith="endsWith",t.IsEmpty="empty",t.IsNotEmpty="notEmpty",t.DefaultContains="",t))(Vl||{});const Yc=["contains","is","startsWith","endsWith",""];var Tn=(t=>(t.Is="is",t.IsNot="notIs",t.GreaterThan="greaterThan",t.LessThan="lessThan",t.GreaterThanOrEquals="greaterThanOrEquals",t.LessThanOrEquals="lessThanOrEquals",t.IsEmpty="notEmpty",t.IsNotEmpty="empty",t))(Tn||{}),Ro=(t=>(t.Is="is",t.IsBefore="before",t.IsAfter="after",t.IsOnOrBefore="onOrBefore",t.IsOnOrAfter="onOrAfter",t.IsBetween="between",t.IsRelativeToToday="relativeToToday",t.IsEmpty="empty",t.IsNotEmpty="notEmpty",t))(Ro||{}),Lr=(t=>(t.Today="today",t.StartOfTheWeek="startoftheweek",t.StartOfTheMonth="startofthemonth",t.StartOfTheYear="startoftheyear",t.EndOfTheWeek="endoftheweek",t.EndOfTheMonth="endofthemonth",t.EndOfTheYear="endoftheyear",t))(Lr||{});const Ru={today:"Today",startoftheweek:"Start of the week",startofthemonth:"Start of the month",startoftheyear:"Start of the year",endoftheweek:"End of the week",endofthemonth:"End of the month",endoftheyear:"End of the year"};var Es=(t=>(t.Contains="contains",t.DoesNotContain="doesNotContains",t.IsEmpty="empty",t.IsNotEmpty="notEmpty",t))(Es||{}),bo=(t=>(t.Is="is",t.IsNot="notIs",t.IsEmpty="empty",t.IsNotEmpty="notEmpty",t))(bo||{});const bu=Object.values(Ro).filter(t=>t!=="relativeToToday");var Io=(t=>(t.Past="past",t.Next="next",t.This="this",t))(Io||{}),Hl=(t=>(t.Day="day",t.Week="week",t.Month="month",t.Year="year",t))(Hl||{});const Hi={"":"contains",contains:"contains",is:"is",notIs:"is not",doesNotContain:"does not contain",startsWith:"starts with",endsWith:"ends with",empty:"is empty",notEmpty:"is not empty"},$l={is:"is",empty:"is empty",notEmpty:"is not empty",after:"is after",before:"is before",between:"is between",onOrAfter:"is on or after",onOrBefore:"is on or before",relativeToToday:"is relative to today"},Oo={is:"is",notIs:"is not",notEmpty:"is empty",empty:"is not empty",greaterThan:"is greater than",lessThan:"is less than",greaterThanOrEquals:"is greater than or equals",lessThanOrEquals:"is less than or equals"},Ql={contains:"contains",doesNotContains:"does not contains",empty:"is empty",notEmpty:"is not empty"},Iu={is:"is",notIs:"is not",empty:"is empty",notEmpty:"is not empty"},Kl=x.object({exp:x.literal("expression"),refType:x.literal("Text"),text:x.string(),matcherType:x.nativeEnum(Vl)}),Ts=x.object({exp:x.literal("expression"),refType:x.literal("NumberExpression"),text:x.string(),matcherType:x.nativeEnum(Tn)}),gi=x.object({exp:x.literal("expression"),refType:x.literal("Date"),date:x.string().optional(),optionalDate:x.string().optional(),dateRelativeMatcher:x.nativeEnum(Lr).optional(),optionalDateRelativeMatcher:x.nativeEnum(Lr).optional(),relativeDateModifier:x.nativeEnum(Io).optional(),relativePeriodOffset:x.number().optional(),relativeDatePeriod:x.nativeEnum(Hl).optional(),matcherType:x.nativeEnum(Ro)}),Gl=x.object({exp:x.literal("expression"),refType:x.literal("Multi Select"),matcherType:x.nativeEnum(Es),remIds:x.array(x.string()).optional()}),Yl=x.object({exp:x.literal("expression"),refType:x.literal("SingleSelect"),matcherType:x.nativeEnum(bo),remId:x.string().optional()}),Xl=x.object({exp:x.literal("expression"),refType:x.literal("Checkbox"),value:x.nativeEnum(Wl)}),wt=x.object({exp:x.literal("expression"),refType:x.literal("Single Select"),matcherType:x.nativeEnum(bo),remIds:x.array(x.string()).optional()}),ql=x.lazy(()=>x.union([Zl,Kl,Ts,ku,gi,Gl,wt,Yl,Xl,gi])),$i=x.lazy(()=>x.union([_s,Ss,Bl,Ul,ql])),xs=x.object({code:x.string(),name:x.string(),onlyProgrammaticModifying:x.boolean().optional(),hidden:x.boolean().optional(),enumValues:x.record(x.string()).optional(),defaultEnumValue:x.string().optional(),propertyType:x.nativeEnum(Ll).optional(),propertyLocation:x.nativeEnum(zl).optional(),selectSourceType:x.nativeEnum(mi).optional(),dontPublishToSharedArticle:x.boolean().optional()}),Ou=x.union([x.object({slots:xs.array()}),x.object({properties:xs.array()})]);var Jl=(t=>(t[t.ForwardCard=1]="ForwardCard",t[t.BackwardCard=2]="BackwardCard",t[t.EditInQueue=3]="EditInQueue",t[t.QueueNoticeCard=4]="QueueNoticeCard",t[t.ClozeCard=5]="ClozeCard",t[t.DocumentCard=6]="DocumentCard",t[t.SelectCluster=7]="SelectCluster",t[t.SubFolderSelector=8]="SubFolderSelector",t[t.DailyTargetGoalSelector=10]="DailyTargetGoalSelector",t[t.StreakGoalSelector=11]="StreakGoalSelector",t[t.AddExtraNewOrStaleCards=12]="AddExtraNewOrStaleCards",t[t.SignUpToSaveProgress=14]="SignUpToSaveProgress",t[t.Plugin=15]="Plugin",t[t.DailyCheckpoint=16]="DailyCheckpoint",t[t.Checkpoint=17]="Checkpoint",t[t.Leech=18]="Leech",t[t.StartExamPractice=19]="StartExamPractice",t[t.EndExamPractice=20]="EndExamPractice",t[t.TransitionOutOfActive=21]="TransitionOutOfActive",t[t.PracticeBuried=22]="PracticeBuried",t[t.PracticeAgainForExamTomorrowSlide=23]="PracticeAgainForExamTomorrowSlide",t[t.OfflineImageCards=24]="OfflineImageCards",t[t.PrivateCards=25]="PrivateCards",t))(Jl||{});const Qi={1:"Forward Card",2:"Backward Card",3:"Edit in Queue",4:"Queue Notice Card",5:"Cloze Card",6:"Document Card",7:"Select Cluster",8:"Subfolder Selector",10:"Daily Target Goal Selector",11:"Streak Goal Selector",12:"Add Extra New or Stale Cards",14:"Sign Up to Save Progress",15:"Plugin",16:"Daily Checkpoint",21:"Transition Out Of Active",17:"Checkpoint",18:"Leech",19:"Start Exam Practice",20:"End Exam Practice",22:"Practice Buried",23:"Practice Again for Exam Tomorrow",24:"Offline Image Cards",25:"Private Cards"},Cs=Kc(Qc({},Qi),{18:"It looks like you're struggling to learn and retain this card."});var Ki=Ge(854),ea=Ge.n(Ki),Ps=Object.defineProperty,ks=Object.getOwnPropertySymbols,ta=Object.prototype.hasOwnProperty,Nu=Object.prototype.propertyIsEnumerable,na=d((t,r,i)=>r in t?Ps(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,"app_defNormalProp"),Du=d((t,r)=>{var i={};for(var s in t)ta.call(t,s)&&r.indexOf(s)<0&&(i[s]=t[s]);if(t!=null&&ks)for(var s of ks(t))r.indexOf(s)<0&&Nu.call(t,s)&&(i[s]=t[s]);return i},"__objRest"),Kt=d((t,r,i)=>(na(t,typeof r!="symbol"?r+"":r,i),i),"app_publicField"),Gt=d((t,r,i)=>new Promise((s,a)=>{var c=d(g=>{try{h(i.next(g))}catch(v){a(v)}},"fulfilled"),p=d(g=>{try{h(i.throw(g))}catch(v){a(v)}},"rejected"),h=d(g=>g.done?s(g.value):Promise.resolve(g.value).then(c,p),"step");h((i=i.apply(t,r)).next())}),"app_async");const Gi="app";class Rs extends Ut{constructor(r,i){super(r,Gi),Kt(this,"plugin"),Kt(this,"waitForInitialSync",()=>Gt(this,null,function*(){yield this._call("waitForInitialSync",{})})),Kt(this,"registerPowerup",s=>Gt(this,null,function*(){yield this._call("registerPowerup",s)})),Kt(this,"registerWidget",(s,a,c)=>Gt(this,null,function*(){yield this._call("registerWidget",{fileName:s,location:a,options:c})})),Kt(this,"unregisterWidget",(s,a)=>Gt(this,null,function*(){yield this._call("unregisterWidget",{fileName:s,location:a})})),Kt(this,"registerCommand",s=>Gt(this,null,function*(){const a=s,{action:c}=a,p=Du(a,["action"]),h=s.id;this.plugin.model[h]=c,yield this._call("registerCommand",p)})),Kt(this,"registerSidebarButton",s=>Gt(this,null,function*(){const{id:a,name:c,action:p}=s;this.plugin.model[a]=p,yield this._call("registerSidebarButton",{id:a,name:c})})),Kt(this,"registerRemMenuItem",s=>Gt(this,null,function*(){const{id:a,name:c,action:p}=s;this.plugin.model[a]=p,yield this._call("registerRemMenuItem",{id:a,name:c})})),Kt(this,"registerMenuItem",s=>Gt(this,null,function*(){const{id:a,name:c,action:p,location:h}=s;this.plugin.model[a]=p,yield this._call("registerMenuItem",{id:a,name:c,location:h})})),Kt(this,"unregisterMenuItem",s=>Gt(this,null,function*(){yield this._call("unregisterMenuItem",{id:s})})),Kt(this,"stealKeys",s=>Gt(this,null,function*(){yield this._call("stealKeys",{keys:s})})),Kt(this,"releaseKeys",s=>Gt(this,null,function*(){yield this._call("releaseKeys",{keys:s})})),Kt(this,"registerCSS",(s,a)=>Gt(this,null,function*(){yield this._call("registerCSS",{id:s,css:a})})),Kt(this,"registerStatusBarItem",(s,a)=>Gt(this,null,function*(){yield this._call("registerStatusBarItem",{id:s,html:a})})),Kt(this,"getOperatingSystem",()=>Gt(this,null,function*(){return yield this._call("getOperatingSystem",{})})),Kt(this,"getPlatform",()=>Gt(this,null,function*(){return yield this._call("getPlatform",{})})),Kt(this,"registerCallback",(s,a)=>{this.plugin.model[s]=a}),Kt(this,"transaction",s=>Gt(this,null,function*(){const a=Math.random().toString();this.registerCallback(a,s);const c=yield this._call("transaction",{id:a});return delete this.plugin.model[a],c})),Kt(this,"toast",s=>Gt(this,null,function*(){yield this._call("toast",{message:s,options:{}})})),this.plugin=i}}d(Rs,"AppNamespace");var ra=Object.defineProperty,Xc=d((t,r,i)=>r in t?ra(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,"date_defNormalProp"),No=d((t,r,i)=>(Xc(t,typeof r!="symbol"?r+"":r,i),i),"date_publicField"),Tr=d((t,r,i)=>new Promise((s,a)=>{var c=d(g=>{try{h(i.next(g))}catch(v){a(v)}},"fulfilled"),p=d(g=>{try{h(i.throw(g))}catch(v){a(v)}},"rejected"),h=d(g=>g.done?s(g.value):Promise.resolve(g.value).then(c,p),"step");h((i=i.apply(t,r)).next())}),"date_async");const bs="date";class jr extends Ut{constructor(r){super(r,bs),No(this,"getDailyDoc",i=>Tr(this,null,function*(){const s=yield this.call("getDailyDoc",{date:i});if(s)return new Qt(s,this._call)})),No(this,"getTodaysDoc",()=>Tr(this,null,function*(){const i=yield this.call("getTodaysDoc",{});if(i)return new Qt(i,this._call)}))}}d(jr,"DateNamespace");var Au=Object.defineProperty,Mr=Object.getOwnPropertySymbols,Do=Object.prototype.hasOwnProperty,Yi=Object.prototype.propertyIsEnumerable,Xi=d((t,r,i)=>r in t?Au(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,"editor_defNormalProp"),Fu=d((t,r)=>{for(var i in r||(r={}))Do.call(r,i)&&Xi(t,i,r[i]);if(Mr)for(var i of Mr(r))Yi.call(r,i)&&Xi(t,i,r[i]);return t},"editor_spreadValues"),Nt=d((t,r,i)=>(Xi(t,typeof r!="symbol"?r+"":r,i),i),"editor_publicField"),Et=d((t,r,i)=>new Promise((s,a)=>{var c=d(g=>{try{h(i.next(g))}catch(v){a(v)}},"fulfilled"),p=d(g=>{try{h(i.throw(g))}catch(v){a(v)}},"rejected"),h=d(g=>g.done?s(g.value):Promise.resolve(g.value).then(c,p),"step");h((i=i.apply(t,r)).next())}),"editor_async");const zr="editor";class ht extends Ut{constructor(r){super(r,zr),Nt(this,"setText",i=>Et(this,null,function*(){return this.call("setText",{richText:i})})),Nt(this,"copy",()=>Et(this,null,function*(){return this.call("copy",{})})),Nt(this,"cut",()=>Et(this,null,function*(){return this.call("cut",{})})),Nt(this,"deleteCharacters",(i,s)=>Et(this,null,function*(){return this.call("deleteCharacters",{characters:i,direction:s})})),Nt(this,"delete",()=>Et(this,null,function*(){return this.call("delete",{})})),Nt(this,"getSelectedRem",()=>Et(this,null,function*(){const i=yield this.getSelection();return i&&i.type===vs.Rem?i:void 0})),Nt(this,"getSelectedText",()=>Et(this,null,function*(){const i=yield this.getSelection();return i&&i.type===vs.Text?i:void 0})),Nt(this,"getSelection",()=>Et(this,null,function*(){return this.call("getSelection",{})})),Nt(this,"selectRem",(i,s)=>Et(this,null,function*(){return this.call("setSelectedLines",{range:i,portalId:s})})),Nt(this,"selectText",i=>Et(this,null,function*(){return this.call("setSelectedRichText",Fu({},i))})),Nt(this,"collapseSelection",i=>Et(this,null,function*(){return this.call("collapseSelection",{to:i})})),Nt(this,"undo",()=>Et(this,null,function*(){return this.call("undo",{})})),Nt(this,"redo",()=>Et(this,null,function*(){return this.call("redo",{})})),Nt(this,"moveCaret",(i,s)=>Et(this,null,function*(){return this.call("moveCaret",{amount:i,unit:s})})),Nt(this,"moveCaretVertical",i=>Et(this,null,function*(){return this.call("moveCaretVertical",{direction:i})})),Nt(this,"getCaretPosition",()=>Et(this,null,function*(){return this.call("getCaretPosition",{})})),Nt(this,"insertPlainText",i=>Et(this,null,function*(){return this.call("insertPlainText",{string:i})})),Nt(this,"insertRichText",i=>Et(this,null,function*(){return this.call("insertRichText",{richText:i})})),Nt(this,"insertMarkdown",i=>Et(this,null,function*(){return this.call("insertMarkdown",{markdown:i})})),Nt(this,"getFocusedEditorText",()=>Et(this,null,function*(){return this.call("getFocusedEditorText",{})}))}}d(ht,"EditorNamespace");var Dt=Object.defineProperty,Br=d((t,r,i)=>r in t?Dt(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,"event_defNormalProp"),en=d((t,r,i)=>(Br(t,typeof r!="symbol"?r+"":r,i),i),"event_publicField");const xn="event";class xr extends Ut{constructor(r,i){super(r,xn),en(this,"plugin"),en(this,"addListener",(s,a,c)=>{s in this.plugin.listeners||(this.plugin.listeners[s]=new Map),this.plugin.listeners[s].get(a)||this.plugin.listeners[s].set(a,[]),!this.plugin.listeners[s].get(a).includes(c)&&(this.plugin.listeners[s].get(a).push(c),this._call("events.addListener",{eventId:s,listenerKey:a}))}),en(this,"removeListener",(s,a,c)=>{const p=this.plugin.listeners[s];if(!p)return;const h=p.get(a);if(h){if(c){const g=h.indexOf(c);if(g==-1)return;h.splice(g,1)}else h.splice(0,h.length);h.length===0&&(p.delete(a),this._call("events.removeListener",{eventId:s,listenerKey:a}))}}),this.plugin=i}}d(xr,"EventNamespace");var qi=Object.defineProperty,Cn=d((t,r,i)=>r in t?qi(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,"focus_defNormalProp"),Ao=d((t,r,i)=>(Cn(t,typeof r!="symbol"?r+"":r,i),i),"focus_publicField"),ia=d((t,r,i)=>new Promise((s,a)=>{var c=d(g=>{try{h(i.next(g))}catch(v){a(v)}},"fulfilled"),p=d(g=>{try{h(i.throw(g))}catch(v){a(v)}},"rejected"),h=d(g=>g.done?s(g.value):Promise.resolve(g.value).then(c,p),"step");h((i=i.apply(t,r)).next())}),"focus_async");const Lu="focus";class Ji extends Ut{constructor(r){super(r,Lu),Ao(this,"getFocusedRem",()=>ia(this,null,function*(){const i=yield this.call("getFocusedRem",{});return i?new Qt(i,this._call):void 0})),Ao(this,"getFocusedPortal",()=>ia(this,null,function*(){const i=yield this.call("getFocusedPortal",{});return i?new Qt(i,this._call):void 0}))}}d(Ji,"FocusNamespace");var ju=Object.defineProperty,oa=d((t,r,i)=>r in t?ju(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,"knowledge_base_defNormalProp"),fr=d((t,r,i)=>(oa(t,typeof r!="symbol"?r+"":r,i),i),"knowledge_base_publicField"),Mu=d((t,r,i)=>new Promise((s,a)=>{var c=d(g=>{try{h(i.next(g))}catch(v){a(v)}},"fulfilled"),p=d(g=>{try{h(i.throw(g))}catch(v){a(v)}},"rejected"),h=d(g=>g.done?s(g.value):Promise.resolve(g.value).then(c,p),"step");h((i=i.apply(t,r)).next())}),"knowledge_base_async");const sa="kb";class Fo{constructor(r){fr(this,"_call"),fr(this,"call"),fr(this,"getCurrentKnowledgeBaseData",()=>Mu(this,null,function*(){return this.call("getCurrentKnowledgeBaseData",{})})),fr(this,"isPrimaryKnowledgeBase",()=>Mu(this,null,function*(){return this.call("isPrimaryKnowledgeBase",{})})),this._call=r,this.call=Fr(this._call,sa)}}d(Fo,"KnowledgeBaseNamespace");var qc=Object.defineProperty,zu=d((t,r,i)=>r in t?qc(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,"messaging_defNormalProp"),la=d((t,r,i)=>(zu(t,typeof r!="symbol"?r+"":r,i),i),"messaging_publicField"),Jc=d((t,r,i)=>new Promise((s,a)=>{var c=d(g=>{try{h(i.next(g))}catch(v){a(v)}},"fulfilled"),p=d(g=>{try{h(i.throw(g))}catch(v){a(v)}},"rejected"),h=d(g=>g.done?s(g.value):Promise.resolve(g.value).then(c,p),"step");h((i=i.apply(t,r)).next())}),"messaging_async");const Is="messaging";class Os extends Ut{constructor(r){super(r,Is),la(this,"broadcast",i=>Jc(this,null,function*(){return this.call("broadcast",{message:i})}))}}d(Os,"MessagingNamespace");var Bu=Object.defineProperty,Uu=d((t,r,i)=>r in t?Bu(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,"powerup_defNormalProp"),aa=d((t,r,i)=>(Uu(t,typeof r!="symbol"?r+"":r,i),i),"powerup_publicField"),Ns=d((t,r,i)=>new Promise((s,a)=>{var c=d(g=>{try{h(i.next(g))}catch(v){a(v)}},"fulfilled"),p=d(g=>{try{h(i.throw(g))}catch(v){a(v)}},"rejected"),h=d(g=>g.done?s(g.value):Promise.resolve(g.value).then(c,p),"step");h((i=i.apply(t,r)).next())}),"powerup_async");const ed="powerup";class rr extends Ut{constructor(r){super(r,ed),aa(this,"getPowerupByCode",i=>Ns(this,null,function*(){const s=yield this.call("getPowerupByCode",{powerupCode:i});if(s)return new Qt(s,this._call)})),aa(this,"getPowerupSlotByCode",(i,s)=>Ns(this,null,function*(){const a=Object.values(Er).includes(i)?Ui[i][s]:s,c=yield this.call("getPowerupSlotByCode",{powerupCode:i,powerupSlot:a});if(c)return new Qt(c,this._call)}))}}d(rr,"PowerupNamespace");class Lo{static and(r){return{exp:xt.And,exps:r}}static or(r){return{exp:xt.Or,exps:r}}static not(r){return{exp:xt.Not,exp1:r}}static cardInfo(r,i){return{exp:xt.GetCardInfo,cardField:r,exp1:i}}static tableColumn(r,i){return{exp:xt.GetSlot,slotRemId:r,exps:i}}static hasReferenceTo(r){return{exp:xt.Expression,refType:Jt.Reference,remId:r}}static text(r,i){return{exp:xt.Expression,refType:Jt.Text,text:i||"",matcherType:r}}static documentsThatContain(r){return{exp:xt.Expression,refType:Jt.Portal,remId:r}}static isTaggedWith(r){return{exp:xt.Expression,refType:Jt.Tag,remId:r}}static isDirectlyTaggedWith(r){return{exp:xt.Expression,refType:Jt.TagWithoutInheritance,remId:r}}static isDescendantOf(r){return{exp:xt.Expression,refType:Jt.IsDescendantOf,remId:r}}static isInDocument(r){return{exp:xt.Expression,refType:Jt.InDocument,remId:r}}static hasAnyConnectionTo(r){return{exp:xt.Expression,refType:Jt.Connection,remId:r}}static hasRemType(r){return{exp:xt.Expression,refType:Jt.RemType,remType:r}}static tagWithoutInheritance(r){return{exp:xt.Expression,refType:Jt.TagWithoutInheritance,remId:r}}static multiSelect(r,i){return{exp:xt.Expression,refType:Jt.MultiSelect,matcherType:r,remIds:i}}static singleSelect(r,i){return{exp:xt.Expression,refType:Jt.SingleSelect,matcherType:r,remIds:i}}static checkbox(r){return{exp:xt.Expression,refType:Jt.Checkbox,value:r}}static date(r,i,s){return{exp:xt.Expression,refType:Jt.Date,matcherType:r,date:typeof i=="string"||i==null?void 0:i.toISOString(),dateRelativeMatcher:typeof i=="string"?i:void 0,optionalDate:typeof s=="string"||s==null?void 0:s.toISOString(),optionalDateRelativeMatcher:typeof s=="string"?s:void 0}}static dateRelativeToToday(r,i,s){return{exp:xt.Expression,refType:Jt.Date,matcherType:Ro.IsRelativeToToday,relativeDateModifier:r,relativePeriodOffset:s,relativeDatePeriod:i}}static number(r,i){return{exp:xt.Expression,refType:Jt.Number,text:i?.toString()||"",matcherType:r}}}d(Lo,"Query_DUPE_2");var ua=Object.defineProperty,Zu=d((t,r,i)=>r in t?ua(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,"queue_defNormalProp"),mt=d((t,r,i)=>(Zu(t,typeof r!="symbol"?r+"":r,i),i),"queue_publicField"),on=d((t,r,i)=>new Promise((s,a)=>{var c=d(g=>{try{h(i.next(g))}catch(v){a(v)}},"fulfilled"),p=d(g=>{try{h(i.throw(g))}catch(v){a(v)}},"rejected"),h=d(g=>g.done?s(g.value):Promise.resolve(g.value).then(c,p),"step");h((i=i.apply(t,r)).next())}),"queue_async");const Wu="queue";class Cr extends Ut{constructor(r){super(r,Wu),mt(this,"getAverageTimePerCard",()=>on(this,null,function*(){return yield this.call("getAverageTimePerCard",{})})),mt(this,"getCurrentQueueScreenType",()=>on(this,null,function*(){return yield this.call("getCurrentQueueScreenType",{})})),mt(this,"goBackToPreviousCard",()=>on(this,null,function*(){yield this.call("goBackToPreviousCard",{})})),mt(this,"hasRevealedAnswer",()=>on(this,null,function*(){return yield this.call("hasRevealedAnswer",{})})),mt(this,"showAnswer",()=>on(this,null,function*(){yield this.call("showAnswer",{})})),mt(this,"rateCurrentCard",i=>on(this,null,function*(){yield this.call("rateCurrentCard",{score:i})})),mt(this,"isTypeAnswerEnabled",()=>on(this,null,function*(){return yield this.call("isTypeAnswerEnabled",{})})),mt(this,"getCurrentCard",()=>on(this,null,function*(){const i=yield this.call("getCurrentCard",{});return i?new cr(i,this._call):void 0})),mt(this,"getNumRemainingCards",()=>on(this,null,function*(){return yield this.call("getNumRemainingCards",{})})),mt(this,"getCurrentStreak",()=>on(this,null,function*(){return yield this.call("getCurrentStreak",{})})),mt(this,"removeCurrentCardFromQueue",(i=!0)=>on(this,null,function*(){yield this.call("removeCurrentCardFromQueue",{addToBackStack:i})})),mt(this,"inLookbackMode",()=>on(this,null,function*(){return yield this.call("inLookbackMode",{})}))}}d(Cr,"QueueNamespace");var jo=Object.defineProperty,pr=d((t,r,i)=>r in t?jo(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,"reader_defNormalProp"),Vu=d((t,r,i)=>(pr(t,typeof r!="symbol"?r+"":r,i),i),"reader_publicField"),Hu=d((t,r,i)=>new Promise((s,a)=>{var c=d(g=>{try{h(i.next(g))}catch(v){a(v)}},"fulfilled"),p=d(g=>{try{h(i.throw(g))}catch(v){a(v)}},"rejected"),h=d(g=>g.done?s(g.value):Promise.resolve(g.value).then(c,p),"step");h((i=i.apply(t,r)).next())}),"reader_async");class An extends Ut{constructor(r){super(r,"reader"),Vu(this,"callAndReturnRem",(i,s)=>Hu(this,null,function*(){const a=yield this.call(i,s||{});if(a)return new Qt(a,this._call)}))}addHighlight(){return Hu(this,null,function*(){return this.callAndReturnRem("addHighlight")})}}d(An,"ReaderNamespace");var Ds=Object.defineProperty,As=Object.defineProperties,eo=Object.getOwnPropertyDescriptors,Mo=Object.getOwnPropertySymbols,ca=Object.prototype.hasOwnProperty,da=Object.prototype.propertyIsEnumerable,Fs=d((t,r,i)=>r in t?Ds(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,"rich_text_defNormalProp"),to=d((t,r)=>{for(var i in r||(r={}))ca.call(r,i)&&Fs(t,i,r[i]);if(Mo)for(var i of Mo(r))da.call(r,i)&&Fs(t,i,r[i]);return t},"rich_text_spreadValues"),Vn=d((t,r)=>As(t,eo(r)),"rich_text_spreadProps"),Ce=d((t,r,i)=>(Fs(t,typeof r!="symbol"?r+"":r,i),i),"rich_text_publicField"),it=d((t,r,i)=>new Promise((s,a)=>{var c=d(g=>{try{h(i.next(g))}catch(v){a(v)}},"fulfilled"),p=d(g=>{try{h(i.throw(g))}catch(v){a(v)}},"rejected"),h=d(g=>g.done?s(g.value):Promise.resolve(g.value).then(c,p),"step");h((i=i.apply(t,r)).next())}),"rich_text_async");const $u="richText";class dn{constructor(r){Ce(this,"richText",[]),Ce(this,"richTextNamespace"),Ce(this,"code",(i,s)=>(this.richText.push({i:"m",code:!0,language:s,text:i}),this)),Ce(this,"image",(i,s,a)=>(this.richText.push({i:"i",url:i,width:s,height:a}),this)),Ce(this,"rem",i=>{const s={i:"q",_id:$t(i)};return this.richText.push(s),this}),Ce(this,"text",(i,s=[])=>{if(s.length===0)return this.richText.push(i),this;const a=Object.fromEntries(s.map(c=>ws[c]?["h",ws[c]]:[Nl[c],!0])||[]);return this.richText.push(Vn(to({i:"m"},a),{text:i})),this}),Ce(this,"audio",i=>(this.richText.push({i:"a",url:i,onlyAudio:!0}),this)),Ce(this,"latex",(i,s=!1)=>(this.richText.push({i:"x",text:i,block:s}),this)),Ce(this,"video",i=>(this.richText.push({i:"a",url:i,onlyAudio:!1}),this)),Ce(this,"newline",()=>(this.richText.push(`
|
|
13
|
+
`),this)),Ce(this,"value",()=>this.richTextNamespace.normalize(this.richText)),this.richTextNamespace=r}}d(dn,"RichTextBuilder");class hr extends Ut{constructor(r){super(r,$u),Ce(this,"indexOfElementAt",(i,s)=>it(this,null,function*(){return this.call("indexOfElementAt",{richText:i,position:s})})),Ce(this,"normalize",i=>it(this,null,function*(){return this.call("normalize",{richText:i})})),Ce(this,"removeTextFormatFromRange",(i,s,a,c)=>it(this,null,function*(){return this.call("removeTextFormatFromRange",{text:i,start:s,end:a,format:c})})),Ce(this,"applyTextFormatToRange",(i,s,a,c)=>it(this,null,function*(){return this.call("applyTextFormatToRange",{text:i,start:s,end:a,format:c})})),Ce(this,"toggleTextFormatOnRange",(i,s,a,c)=>it(this,null,function*(){return this.call("toggleTextFormatOnRange",{text:i,start:s,end:a,format:c})})),Ce(this,"replaceAllRichText",(i,s,a)=>it(this,null,function*(){return this.call("replaceAllRichText",{richText:i,findText:s,replacementText:a})})),Ce(this,"splitRichText",(i,s)=>it(this,null,function*(){return this.call("splitRichText",{richText:i,splitText:s})})),Ce(this,"empty",(i,s)=>it(this,null,function*(){return this.call("empty",{richText:i,allowSpaces:s})})),Ce(this,"indexOf",(i,s,a)=>it(this,null,function*(){return this.call("indexOf",{richText:i,character:s,startChar:a})})),Ce(this,"toHTML",i=>it(this,null,function*(){return this.call("toHTML",{richText:i})})),Ce(this,"length",i=>it(this,null,function*(){return this.call("length",{richText:i})})),Ce(this,"trimEnd",i=>it(this,null,function*(){return this.call("trimEnd",{richText:i})})),Ce(this,"trimStart",i=>it(this,null,function*(){return this.call("trimStart",{richText:i})})),Ce(this,"trim",i=>it(this,null,function*(){return this.call("trim",{richText:i})})),Ce(this,"split",(i,s)=>it(this,null,function*(){return this.call("split",{richText:i,separationCharacter:s})})),Ce(this,"deepGetRemAndAliasIdsFromRichText",i=>it(this,null,function*(){return this.call("deepGetRemAndAliasIdsFromRichText",{richText:i})})),Ce(this,"deepGetRemIdsFromRichText",i=>it(this,null,function*(){return this.call("deepGetRemIdsFromRichText",{richText:i})})),Ce(this,"findAllExternalURLs",i=>it(this,null,function*(){return this.call("findAllExternalURLs",{richText:i})})),Ce(this,"getRemAndAliasIdsFromRichText",i=>it(this,null,function*(){return this.call("getRemAndAliasIdsFromRichText",{richText:i})})),Ce(this,"getRemIdsFromRichText",i=>it(this,null,function*(){return this.call("getRemIdsFromRichText",{richText:i})})),Ce(this,"equals",(i,s)=>it(this,null,function*(){return this.call("equals",{richText1:i,richText2:s})})),Ce(this,"substring",(i,s,a)=>it(this,null,function*(){return this.call("substring",{richText:i,start:s,end:a})})),Ce(this,"charAt",(i,s)=>it(this,null,function*(){return this.call("charAt",{richText:i,index:s})})),Ce(this,"toString",i=>it(this,null,function*(){return this.call("toString",{richText:i})})),Ce(this,"toMarkdown",i=>it(this,null,function*(){return this.call("toMarkdown",{richText:i})})),Ce(this,"parseFromMarkdown",i=>it(this,null,function*(){return this.call("parseFromMarkdown",{markdown:i})})),Ce(this,"parseAndInsertHtml",(i,s)=>it(this,null,function*(){const a=$t(s);return this.call("parseAndInsertHtml",{html:i,remId:a})}))}get code(){return new dn(this).code}get image(){return new dn(this).image}get rem(){return new dn(this).rem}get text(){return new dn(this).text}get audio(){return new dn(this).audio}get latex(){return new dn(this).latex}get video(){return new dn(this).video}get newline(){return new dn(this).newline}}d(hr,"RichTextNamespace");const Qu="scheduler";class yi extends Ut{constructor(r){super(r,Qu)}registerCustomScheduler(r,i){return this.call("registerCustomScheduler",{name:r,parameters:i})}}d(yi,"SchedulerNamespace");var Ku=Object.defineProperty,Gu=d((t,r,i)=>r in t?Ku(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,"search_defNormalProp"),Ls=d((t,r,i)=>(Gu(t,typeof r!="symbol"?r+"":r,i),i),"search_publicField"),js=d((t,r,i)=>new Promise((s,a)=>{var c=d(g=>{try{h(i.next(g))}catch(v){a(v)}},"fulfilled"),p=d(g=>{try{h(i.throw(g))}catch(v){a(v)}},"rejected"),h=d(g=>g.done?s(g.value):Promise.resolve(g.value).then(c,p),"step");h((i=i.apply(t,r)).next())}),"search_async");const Yu="search";class Ms extends Ut{constructor(r){super(r,Yu),Ls(this,"search",(i,s,a)=>js(this,null,function*(){const c=$t(s);return((yield this.call("search",{queryText:i,searchContextRemId:c,options:a}))||[]).map(p=>new Qt(p,this._call))}))}}d(Ms,"SearchNamespace");var Xu=Object.defineProperty,zs=Object.getOwnPropertySymbols,Bs=Object.prototype.hasOwnProperty,zo=Object.prototype.propertyIsEnumerable,no=d((t,r,i)=>r in t?Xu(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,"settings_defNormalProp"),Bo=d((t,r)=>{for(var i in r||(r={}))Bs.call(r,i)&&no(t,i,r[i]);if(zs)for(var i of zs(r))zo.call(r,i)&&no(t,i,r[i]);return t},"settings_spreadValues"),Ur=d((t,r,i)=>(no(t,typeof r!="symbol"?r+"":r,i),i),"settings_publicField"),ro=d((t,r,i)=>new Promise((s,a)=>{var c=d(g=>{try{h(i.next(g))}catch(v){a(v)}},"fulfilled"),p=d(g=>{try{h(i.throw(g))}catch(v){a(v)}},"rejected"),h=d(g=>g.done?s(g.value):Promise.resolve(g.value).then(c,p),"step");h((i=i.apply(t,r)).next())}),"settings_async");const Uo="settings";class Hn extends Ut{constructor(r){super(r,Uo),Ur(this,"registerDropdownSetting",i=>ro(this,null,function*(){return this.call("registerDropdownSetting",Bo({},i))})),Ur(this,"registerBooleanSetting",i=>ro(this,null,function*(){return this.call("registerBooleanSetting",Bo({},i))})),Ur(this,"registerStringSetting",i=>ro(this,null,function*(){return this.call("registerStringSetting",Bo({},i))})),Ur(this,"registerNumberSetting",i=>ro(this,null,function*(){return this.call("registerNumberSetting",Bo({},i))})),Ur(this,"getSetting",i=>ro(this,null,function*(){return yield this.call("getSetting",{settingId:i})}))}}d(Hn,"SettingsNamespace");var Zo=Object.defineProperty,Wo=d((t,r,i)=>r in t?Zo(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,"storage_defNormalProp"),$n=d((t,r,i)=>(Wo(t,typeof r!="symbol"?r+"":r,i),i),"storage_publicField"),Zr=d((t,r,i)=>new Promise((s,a)=>{var c=d(g=>{try{h(i.next(g))}catch(v){a(v)}},"fulfilled"),p=d(g=>{try{h(i.throw(g))}catch(v){a(v)}},"rejected"),h=d(g=>g.done?s(g.value):Promise.resolve(g.value).then(c,p),"step");h((i=i.apply(t,r)).next())}),"storage_async");const io="storage";class Us extends Ut{constructor(r){super(r,io),$n(this,"setSession",(i,s)=>Zr(this,null,function*(){return this.call("setSession",{key:i,value:s})})),$n(this,"getSession",i=>Zr(this,null,function*(){if(i)return this.call("getSession",{key:i})})),$n(this,"setSynced",(i,s)=>Zr(this,null,function*(){return this.call("setSynced",{key:i,value:s})})),$n(this,"getSynced",i=>Zr(this,null,function*(){if(i)return this.call("getSynced",{key:i})})),$n(this,"setLocal",(i,s)=>Zr(this,null,function*(){return this.call("setLocal",{key:i,value:s})})),$n(this,"getLocal",i=>Zr(this,null,function*(){if(i)return this.call("getLocal",{key:i})}))}}d(Us,"StorageNamespace");var fa=Object.defineProperty,At=d((t,r,i)=>r in t?fa(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,"widget_defNormalProp"),Wr=d((t,r,i)=>(At(t,typeof r!="symbol"?r+"":r,i),i),"widget_publicField"),Fn=d((t,r,i)=>new Promise((s,a)=>{var c=d(g=>{try{h(i.next(g))}catch(v){a(v)}},"fulfilled"),p=d(g=>{try{h(i.throw(g))}catch(v){a(v)}},"rejected"),h=d(g=>g.done?s(g.value):Promise.resolve(g.value).then(c,p),"step");h((i=i.apply(t,r)).next())}),"widget_async");const Vr="widget";class Qn extends Ut{constructor(r){super(r,Vr),Wr(this,"getWidgetsAtLocation",(i,s)=>Fn(this,null,function*(){return this.call("getWidgetsAtLocation",{location:i,remId:s})})),Wr(this,"getDimensions",i=>Fn(this,null,function*(){return this.call("getDimensions",{widgetInstanceId:i})})),Wr(this,"openPopup",(i,s,a)=>Fn(this,null,function*(){return this.call("openPopup",{widgetFileName:i,contextData:s,clickOutsideToClose:a})})),Wr(this,"closePopup",(i=!0)=>Fn(this,null,function*(){return this.call("closePopup",{restoreFocus:i})})),Wr(this,"getWidgetContext",()=>Fn(this,null,function*(){return this.call("getWidgetContext",{})}))}}d(Qn,"WidgetNamespace");var qu=Object.defineProperty,Ju=d((t,r,i)=>r in t?qu(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,"window_defNormalProp"),Ct=d((t,r,i)=>(Ju(t,typeof r!="symbol"?r+"":r,i),i),"window_publicField"),Pt=d((t,r,i)=>new Promise((s,a)=>{var c=d(g=>{try{h(i.next(g))}catch(v){a(v)}},"fulfilled"),p=d(g=>{try{h(i.throw(g))}catch(v){a(v)}},"rejected"),h=d(g=>g.done?s(g.value):Promise.resolve(g.value).then(c,p),"step");h((i=i.apply(t,r)).next())}),"window_async");const Zs="window";class Vo extends Ut{constructor(r){super(r,Zs),Ct(this,"stealKeys",(i,s)=>Pt(this,null,function*(){yield this.call("stealKeys",{keys:s,id:i})})),Ct(this,"releaseKeys",(i,s)=>Pt(this,null,function*(){yield this.call("releaseKeys",{keys:s,id:i})})),Ct(this,"openFloatingWidget",(i,s,a,c)=>Pt(this,null,function*(){return yield this.call("openFloatingWidget",{fileName:i,position:s,classContainer:a,closeWhenClickOutside:c})})),Ct(this,"closeFloatingWidget",i=>Pt(this,null,function*(){return yield this.call("closeFloatingWidget",{floatingWidgetId:i})})),Ct(this,"isFloatingWidgetOpen",i=>Pt(this,null,function*(){return yield this.call("isFloatingWidgetOpen",{floatingWidgetId:i})})),Ct(this,"setFloatingWidgetPosition",(i,s)=>Pt(this,null,function*(){return yield this.call("setFloatingWidgetPosition",{floatingWidgetId:i,position:s})})),Ct(this,"closeAllFloatingWidgets",()=>Pt(this,null,function*(){return yield this.call("closeAllFloatingWidgets",{})})),Ct(this,"getCurrentWindowTree",()=>Pt(this,null,function*(){return yield this.call("getCurrentWindowTree",{})})),Ct(this,"setRemWindowTree",i=>Pt(this,null,function*(){return yield this.call("setRemWindowTree",{tree:i})})),Ct(this,"getLastFocusedPane",()=>Pt(this,null,function*(){return yield this.call("getLastFocusedPane",{})})),Ct(this,"setCurrentWindowTreeFromString",i=>Pt(this,null,function*(){return yield this.call("setCurrentWindowTreeFromString",{treeString:i})})),Ct(this,"getOpenPaneIds",()=>Pt(this,null,function*(){return yield this.call("getOpenPaneIds",{})})),Ct(this,"getFocusedPaneId",()=>Pt(this,null,function*(){return yield this.call("getFocusedPaneId",{})})),Ct(this,"setFocusedPaneId",i=>Pt(this,null,function*(){return yield this.call("setFocusedPaneId",{paneId:i})})),Ct(this,"getURL",()=>Pt(this,null,function*(){return yield this.call("getURL",{})})),Ct(this,"setURL",i=>Pt(this,null,function*(){return yield this.call("setURL",{url:i})})),Ct(this,"openRem",i=>Pt(this,null,function*(){return yield this.call("openRem",{remId:i._id})})),Ct(this,"getOpenPaneRemIds",()=>Pt(this,null,function*(){return yield this.call("getOpenPaneRemIds",{})})),Ct(this,"getOpenPaneRemId",i=>Pt(this,null,function*(){if(i)return yield this.call("getOpenPaneRemId",{paneId:i})})),Ct(this,"openWidgetInPane",(i,s)=>Pt(this,null,function*(){return yield this.call("openWidgetInPane",{fileName:i,contextData:s})})),Ct(this,"openWidgetInRightSidebar",(i,s)=>Pt(this,null,function*(){return yield this.call("openWidgetInRightSidebar",{fileName:i,contextData:s})})),Ct(this,"isOnPage",i=>Pt(this,null,function*(){return yield this.call("isOnPage",{page:i})}))}}d(Vo,"WindowNamespace");var oo=Object.defineProperty,Ws=Object.getOwnPropertySymbols,Ho=Object.prototype.hasOwnProperty,Kn=Object.prototype.propertyIsEnumerable,vi=d((t,r,i)=>r in t?oo(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,"plugin_base_defNormalProp"),jt=d((t,r)=>{for(var i in r||(r={}))Ho.call(r,i)&&vi(t,i,r[i]);if(Ws)for(var i of Ws(r))Kn.call(r,i)&&vi(t,i,r[i]);return t},"plugin_base_spreadValues"),Se=d((t,r,i)=>(vi(t,typeof r!="symbol"?r+"":r,i),i),"plugin_base_publicField"),lt=d((t,r,i)=>new Promise((s,a)=>{var c=d(g=>{try{h(i.next(g))}catch(v){a(v)}},"fulfilled"),p=d(g=>{try{h(i.throw(g))}catch(v){a(v)}},"rejected"),h=d(g=>g.done?s(g.value):Promise.resolve(g.value).then(c,p),"step");h((i=i.apply(t,r)).next())}),"plugin_base_async");class so{constructor(){Se(this,"apiCallPromise",{}),Se(this,"model",{}),Se(this,"listeners",{}),Se(this,"usedMessageIds",1),Se(this,"widgetInstanceId"),Se(this,"inSandbox"),Se(this,"isNative"),Se(this,"rootURL"),Se(this,"mountDiv"),Se(this,"widgetBodyResizeObserver",null),Se(this,"widgetOptions"),Se(this,"manifest"),Se(this,"id"),Se(this,"app",new Rs(this._call.bind(this),this)),Se(this,"editor",new ht(this._call.bind(this))),Se(this,"event",new xr(this._call.bind(this),this)),Se(this,"messaging",new Os(this._call.bind(this))),Se(this,"focus",new Ji(this._call.bind(this))),Se(this,"date",new jr(this._call.bind(this))),Se(this,"widget",new Qn(this._call.bind(this))),Se(this,"window",new Vo(this._call.bind(this))),Se(this,"powerup",new rr(this._call.bind(this))),Se(this,"richText",new hr(this._call.bind(this))),Se(this,"rem",new ji(this._call.bind(this))),Se(this,"card",new hi(this._call.bind(this))),Se(this,"storage",new Us(this._call.bind(this))),Se(this,"settings",new Hn(this._call.bind(this))),Se(this,"search",new Ms(this._call.bind(this))),Se(this,"kb",new Fo(this._call.bind(this))),Se(this,"scheduler",new yi(this._call.bind(this))),Se(this,"queue",new Cr(this._call.bind(this))),Se(this,"reader",new An(this._call.bind(this))),window.onmessage=r=>{this._receive(r)},this.pluginLogger=ea()(`plugin:${this.id||"Plugin"}`),this.logApi=ea()(`plugin:API:${this.id||"Plugin"}`),this.logApi("START"),this.event.addListener(A.onActivate,void 0,this.receiveActivateMessage.bind(this)),this.event.addListener(A.onDeactivate,void 0,this.receiveDeactivateMessage.bind(this)),this.event.addListener(A.setDarkMode,void 0,this.setDarkMode.bind(this)),this.event.addListener(A.setCustomCSS,void 0,this.setCustomCSS.bind(this)),this._call("askToActivate",{})}pluginLogger(...r){}logApi(...r){}setDarkMode({darkMode:r}){this.inSandbox&&(document.body.classList.add(r?"dark":"light"),document.body.classList.remove(r?"light":"dark"))}setCustomCSS({cssBlocks:r,cssUrls:i}){const s=document.getElementsByTagName("head")[0];for(const a of[...s.children])a.classList.contains("custom-css")&&a.remove();for(const a of r){const c=document.createElement("style");c.classList.add("custom-css"),c.innerHTML=a,s.appendChild(c)}for(const a of i){const c=document.createElement("link");c.classList.add("custom-css"),c.rel="stylesheet",c.href=a,s.appendChild(c)}}track(r){let i=!1,s=!1,a=!1,c=[];const p=d(()=>{if(i){for(const{event:h,key:g}of c.flatMap(v=>v.reactiveDeps))this.event.removeListener(h,g,p);return}else s?a=!0:(s=!0,d(()=>lt(this,null,function*(){c=yield hd(this,r,p,()=>{},c||[]),s=!1,a&&(a=!1,p())}),"effect")())},"run");return p(),()=>{i=!0}}loadManifest(){return lt(this,null,function*(){if(!this.manifest)try{const r=yield fetch(this.rootURL+"manifest.json");if(r.ok){const i=yield r.json();this.manifest=i,this.id=i.id}}catch(r){console.log("Failed to load manifest.json",r)}})}receiveActivateMessage(r){return lt(this,null,function*(){var i,s,a,c,p;if(!r.inSandbox&&!((i=window.activeWidgetIds)!=null&&i.has(r.widgetInstanceId))){console.error("Not activating widget",r.widgetInstanceId,"as it is already unmounted");return}if(!r.inSandbox&&!r.mountDiv)throw new Error("Native plugin didn't receive mountDiv");const h=r.inSandbox?this.createMountDiv():r.mountDiv;this.inSandbox=r.inSandbox,this.isNative=!r.inSandbox,this.widgetOptions=r.widgetOptions,this.widgetInstanceId=r.widgetInstanceId,this.rootURL=r.rootURL,this.mountDiv=h,yield this.loadManifest(),this.isNative&&(window.widgetIdToWidget[this.widgetInstanceId]=this),this.onActivate(h,r.rootURL);const g=(a=(s=r.widgetOptions)==null?void 0:s.dimensions)==null?void 0:a.height,v=(p=(c=r.widgetOptions)==null?void 0:c.dimensions)==null?void 0:p.width;if(v=="auto"&&r.inSandbox&&(h.style.display="inline-block"),(g==="auto"||v==="auto")&&this.autoAdjustWidgetContainerDimension(),r.inSandbox&&(g==="auto"&&(document.documentElement.style.overflowY="hidden"),v==="auto"&&(document.documentElement.style.overflowX="hidden")),r.inSandbox)for(const ce of r.styleSheetHREFs){const Fe=document.createElement("link");Fe.href=ce,Fe.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(Fe)}yield this._call("activateCompleted",{})})}receiveDeactivateMessage(r){return lt(this,null,function*(){this.widgetBodyResizeObserver&&this.widgetBodyResizeObserver.disconnect(),this.onDeactivate()})}createMountDiv(){const r=document.createElement("div");return document.body.appendChild(r),r}log(...r){this.pluginLogger(r)}_call(r,i,s){return lt(this,null,function*(){const a=this.usedMessageIds++;typeof s=="string"?r=s+"."+r:typeof s=="object"&&(r=[...s,r].join("."));const c={pluginId:this.id,widgetInstanceId:this.widgetInstanceId,methodName:r,args:i,messageId:a,isIntendedForRemNoteAPIMain:!0};this.logApi("Call",a);const p=this.isNative?window:window.parent,h=yield new Promise(g=>{this.apiCallPromise[a]=g;try{p.postMessage(c,"*")}catch{console.error(`Failed to call plugin method with arguments: ${r} ${i}`)}});if(this.logApi("Got response",h),h!=null&&h.error)throw new Error("Plugin Error: "+h.error);return h?.response})}_receive(r){return lt(this,null,function*(){var i,s,a;if((i=r.data)!=null&&i.isIntendedForRemNoteAPIPlugin){const c=r.data;if("messageId"in c){const p=c.messageId;this.logApi("API _receive",p,c,this.apiCallPromise[p]),this.apiCallPromise[p](c),delete this.apiCallPromise[p]}else if("callbackId"in c){const p=this.model[c.callbackId];p||console.error(`Tried to execute callback ${c.callbackId}, but it was not registered`);const h=yield p?.(c.args);c.callbackReturnValueHandlerId&&this._call("handleCallbackResponse",{result:h,callbackReturnValueHandlerId:c.callbackReturnValueHandlerId},"callback")}else if("eventId"in c){if(!Y(c.eventId))throw new Error("Invalid event "+c.eventId);(a=(s=this.listeners[c.eventId])==null?void 0:s.get(c.listenerKey))==null||a.forEach(p=>p(c.args))}}})}autoAdjustWidgetContainerDimension(){return lt(this,null,function*(){const r=new ResizeObserver(s=>{for(let a of s)if(a.contentBoxSize){const c=window.getComputedStyle(a.target),p=parseFloat(c.getPropertyValue("margin-block-start"))||0,h=parseFloat(c.getPropertyValue("margin-block-end"))||0,g=parseFloat(c.getPropertyValue("margin-inline-start"))||0,v=parseFloat(c.getPropertyValue("margin-inline-end"))||0,ce={height:a.contentBoxSize[0].blockSize+p+h,width:a.contentBoxSize[0].inlineSize+g+v};this._call("widgetEvents.updateWidgetContainerDimension",ce)}}),i=this.inSandbox?this.mountDiv:this.mountDiv.firstChild;i&&(r.observe(i),this.widgetBodyResizeObserver=r)})}createFakeEmbedComponent(r){return lt(this,null,function*(){return this._call("widgetEvents.createFakeEmbedComponent",r)})}unmountFakeEmbedComponent(r){return lt(this,null,function*(){return this._call("widgetEvents.unmountFakeEmbedComponent",{id:r})})}updateFakeEmbedComponentRect(r,i){return lt(this,null,function*(){return this._call("widgetEvents.updateFakeEmbedComponentRect",jt({id:r},i))})}updateFakeEmbedExternalProps(r,i){return lt(this,null,function*(){return this._call("widgetEvents.updateFakeEmbedExternalProps",{id:r,externalProps:i})})}ping(){return lt(this,null,function*(){return yield this._call("ping",{})})}}d(so,"RNPlugin");var at=Ge(232);let Pn=d(t=>crypto.getRandomValues(new Uint8Array(t)),"random"),pa=d((t,r,i)=>{let s=(2<<Math.log(t.length-1)/Math.LN2)-1,a=-~(1.6*s*r/t.length);return(c=r)=>{let p="";for(;;){let h=i(a),g=a;for(;g--;)if(p+=t[h[g]&s]||"",p.length===c)return p}}},"customRandom"),ec=d((t,r=21)=>pa(t,r,Pn),"customAlphabet"),wi=d((t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((r,i)=>(i&=63,i<36?r+=i.toString(36):i<62?r+=(i-26).toString(36).toUpperCase():i>62?r+="-":r+="_",r),""),"nanoid");var ue=Ge(359),ir=Ge.n(ue),lo="1.13.6",ao=typeof self=="object"&&self.self===self&&self||typeof Ke.g=="object"&&Ke.g.global===Ke.g&&Ke.g||Function("return this")()||{},$o=Array.prototype,Vs=Object.prototype,ha=typeof Symbol<"u"?Symbol.prototype:null,Qo=$o.push,Hr=$o.slice,uo=Vs.toString,Hs=Vs.hasOwnProperty,$s=typeof ArrayBuffer<"u",ma=typeof DataView<"u",tc=Array.isArray,Ko=Object.keys,ga=Object.create,ya=$s&&ArrayBuffer.isView,nc=isNaN,va=isFinite,wa=!{toString:null}.propertyIsEnumerable("toString"),_a=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],td=Math.pow(2,53)-1;function sn(t,r){return r=r==null?t.length-1:+r,function(){for(var i=Math.max(arguments.length-r,0),s=Array(i),a=0;a<i;a++)s[a]=arguments[a+r];switch(r){case 0:return t.call(this,s);case 1:return t.call(this,arguments[0],s);case 2:return t.call(this,arguments[0],arguments[1],s)}var c=Array(r+1);for(a=0;a<r;a++)c[a]=arguments[a];return c[r]=s,t.apply(this,c)}}d(sn,"restArguments");function or(t){var r=typeof t;return r==="function"||r==="object"&&!!t}d(or,"isObject");function rc(t){return t===null}d(rc,"isNull");function Sa(t){return t===void 0}d(Sa,"isUndefined");function Ea(t){return t===!0||t===!1||uo.call(t)==="[object Boolean]"}d(Ea,"isBoolean");function ic(t){return!!(t&&t.nodeType===1)}d(ic,"isElement");function gt(t){var r="[object "+t+"]";return function(i){return uo.call(i)===r}}d(gt,"tagTester");var fn=gt("String"),Ta=gt("Number"),oc=gt("Date"),sc=gt("RegExp"),xa=gt("Error"),Ca=gt("Symbol"),Qs=gt("ArrayBuffer"),Pa=gt("Function"),ka=ao.document&&ao.document.childNodes;typeof Int8Array!="object"&&typeof ka!="function"&&(Pa=d(function(t){return typeof t=="function"||!1},"isFunction"));var pn=Pa,Go=gt("Object"),Ra=ma&&Go(new DataView(new ArrayBuffer(8))),Ks=typeof Map<"u"&&Go(new Map),lc=gt("DataView");function ba(t){return t!=null&&pn(t.getInt8)&&Qs(t.buffer)}d(ba,"ie10IsDataView");var Yo=Ra?ba:lc,Pr=tc||gt("Array");function mr(t,r){return t!=null&&Hs.call(t,r)}d(mr,"has");var sr=gt("Arguments");(function(){sr(arguments)||(sr=d(function(t){return mr(t,"callee")},"isArguments"))})();var Gs=sr;function Ys(t){return!Ca(t)&&va(t)&&!isNaN(parseFloat(t))}d(Ys,"isFinite_isFinite");function Xs(t){return Ta(t)&&nc(t)}d(Xs,"isNaN_isNaN");function qs(t){return function(){return t}}d(qs,"constant");function _i(t){return function(r){var i=t(r);return typeof i=="number"&&i>=0&&i<=td}}d(_i,"createSizePropertyCheck");function Ia(t){return function(r){return r?.[t]}}d(Ia,"shallowProperty");var Js=Ia("byteLength"),Oa=_i(Js),Na=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function ac(t){return ya?ya(t)&&!Yo(t):Oa(t)&&Na.test(uo.call(t))}d(ac,"isTypedArray");var Da=$s?ac:qs(!1),yn=Ia("length");function uc(t){for(var r={},i=t.length,s=0;s<i;++s)r[t[s]]=!0;return{contains:function(a){return r[a]===!0},push:function(a){return r[a]=!0,t.push(a)}}}d(uc,"emulatedSet");function el(t,r){r=uc(r);var i=_a.length,s=t.constructor,a=pn(s)&&s.prototype||Vs,c="constructor";for(mr(t,c)&&!r.contains(c)&&r.push(c);i--;)c=_a[i],c in t&&t[c]!==a[c]&&!r.contains(c)&&r.push(c)}d(el,"collectNonEnumProps");function Yt(t){if(!or(t))return[];if(Ko)return Ko(t);var r=[];for(var i in t)mr(t,i)&&r.push(i);return wa&&el(t,r),r}d(Yt,"keys");function cc(t){if(t==null)return!0;var r=yn(t);return typeof r=="number"&&(Pr(t)||fn(t)||Gs(t))?r===0:yn(Yt(t))===0}d(cc,"isEmpty");function tl(t,r){var i=Yt(r),s=i.length;if(t==null)return!s;for(var a=Object(t),c=0;c<s;c++){var p=i[c];if(r[p]!==a[p]||!(p in a))return!1}return!0}d(tl,"isMatch");function Ye(t){if(t instanceof Ye)return t;if(!(this instanceof Ye))return new Ye(t);this._wrapped=t}d(Ye,"_"),Ye.VERSION=lo,Ye.prototype.value=function(){return this._wrapped},Ye.prototype.valueOf=Ye.prototype.toJSON=Ye.prototype.value,Ye.prototype.toString=function(){return String(this._wrapped)};function nl(t){return new Uint8Array(t.buffer||t,t.byteOffset||0,Js(t))}d(nl,"toBufferView");var Aa="[object DataView]";function Xo(t,r,i,s){if(t===r)return t!==0||1/t===1/r;if(t==null||r==null)return!1;if(t!==t)return r!==r;var a=typeof t;return a!=="function"&&a!=="object"&&typeof r!="object"?!1:qo(t,r,i,s)}d(Xo,"eq");function qo(t,r,i,s){t instanceof Ye&&(t=t._wrapped),r instanceof Ye&&(r=r._wrapped);var a=uo.call(t);if(a!==uo.call(r))return!1;if(Ra&&a=="[object Object]"&&Yo(t)){if(!Yo(r))return!1;a=Aa}switch(a){case"[object RegExp]":case"[object String]":return""+t==""+r;case"[object Number]":return+t!=+t?+r!=+r:+t==0?1/+t===1/r:+t==+r;case"[object Date]":case"[object Boolean]":return+t==+r;case"[object Symbol]":return ha.valueOf.call(t)===ha.valueOf.call(r);case"[object ArrayBuffer]":case Aa:return qo(nl(t),nl(r),i,s)}var c=a==="[object Array]";if(!c&&Da(t)){var p=Js(t);if(p!==Js(r))return!1;if(t.buffer===r.buffer&&t.byteOffset===r.byteOffset)return!0;c=!0}if(!c){if(typeof t!="object"||typeof r!="object")return!1;var h=t.constructor,g=r.constructor;if(h!==g&&!(pn(h)&&h instanceof h&&pn(g)&&g instanceof g)&&"constructor"in t&&"constructor"in r)return!1}i=i||[],s=s||[];for(var v=i.length;v--;)if(i[v]===t)return s[v]===r;if(i.push(t),s.push(r),c){if(v=t.length,v!==r.length)return!1;for(;v--;)if(!Xo(t[v],r[v],i,s))return!1}else{var ce=Yt(t),Fe;if(v=ce.length,Yt(r).length!==v)return!1;for(;v--;)if(Fe=ce[v],!(mr(r,Fe)&&Xo(t[Fe],r[Fe],i,s)))return!1}return i.pop(),s.pop(),!0}d(qo,"deepEq");function rl(t,r){return Xo(t,r)}d(rl,"isEqual");function Si(t){if(!or(t))return[];var r=[];for(var i in t)r.push(i);return wa&&el(t,r),r}d(Si,"allKeys");function co(t){var r=yn(t);return function(i){if(i==null)return!1;var s=Si(i);if(yn(s))return!1;for(var a=0;a<r;a++)if(!pn(i[t[a]]))return!1;return t!==Ee||!pn(i[il])}}d(co,"ie11fingerprint");var il="forEach",dc="has",Fa=["clear","delete"],Jo=["get",dc,"set"],La=Fa.concat(il,Jo),Ee=Fa.concat(Jo),vn=["add"].concat(Fa,il,dc),Xt=Ks?co(La):gt("Map"),hn=Ks?co(Ee):gt("WeakMap"),Ei=Ks?co(vn):gt("Set"),ja=gt("WeakSet");function kt(t){for(var r=Yt(t),i=r.length,s=Array(i),a=0;a<i;a++)s[a]=t[r[a]];return s}d(kt,"values");function es(t){for(var r=Yt(t),i=r.length,s=Array(i),a=0;a<i;a++)s[a]=[r[a],t[r[a]]];return s}d(es,"pairs");function $r(t){for(var r={},i=Yt(t),s=0,a=i.length;s<a;s++)r[t[i[s]]]=i[s];return r}d($r,"invert");function Qr(t){var r=[];for(var i in t)pn(t[i])&&r.push(i);return r.sort()}d(Qr,"functions");function kr(t,r){return function(i){var s=arguments.length;if(r&&(i=Object(i)),s<2||i==null)return i;for(var a=1;a<s;a++)for(var c=arguments[a],p=t(c),h=p.length,g=0;g<h;g++){var v=p[g];(!r||i[v]===void 0)&&(i[v]=c[v])}return i}}d(kr,"createAssigner");var ol=kr(Si),fo=kr(Yt),sl=kr(Si,!0);function ll(){return function(){}}d(ll,"ctor");function Kr(t){if(!or(t))return{};if(ga)return ga(t);var r=ll();r.prototype=t;var i=new r;return r.prototype=null,i}d(Kr,"baseCreate");function re(t,r){var i=Kr(t);return r&&fo(i,r),i}d(re,"create");function ts(t){return or(t)?Pr(t)?t.slice():ol({},t):t}d(ts,"clone");function al(t,r){return r(t),t}d(al,"tap");function Gn(t){return Pr(t)?t:[t]}d(Gn,"toPath"),Ye.toPath=Gn;function Ln(t){return Ye.toPath(t)}d(Ln,"_toPath_toPath");function Gr(t,r){for(var i=r.length,s=0;s<i;s++){if(t==null)return;t=t[r[s]]}return i?t:void 0}d(Gr,"deepGet");function Ti(t,r,i){var s=Gr(t,Ln(r));return Sa(s)?i:s}d(Ti,"get");function ul(t,r){r=Ln(r);for(var i=r.length,s=0;s<i;s++){var a=r[s];if(!mr(t,a))return!1;t=t[a]}return!!i}d(ul,"has_has");function po(t){return t}d(po,"identity");function kn(t){return t=fo({},t),function(r){return tl(r,t)}}d(kn,"matcher");function Yr(t){return t=Ln(t),function(r){return Gr(r,t)}}d(Yr,"property");function Xr(t,r,i){if(r===void 0)return t;switch(i??3){case 1:return function(s){return t.call(r,s)};case 3:return function(s,a,c){return t.call(r,s,a,c)};case 4:return function(s,a,c,p){return t.call(r,s,a,c,p)}}return function(){return t.apply(r,arguments)}}d(Xr,"optimizeCb");function ho(t,r,i){return t==null?po:pn(t)?Xr(t,r,i):or(t)&&!Pr(t)?kn(t):Yr(t)}d(ho,"baseIteratee");function Yn(t,r){return ho(t,r,1/0)}d(Yn,"iteratee"),Ye.iteratee=Yn;function tn(t,r,i){return Ye.iteratee!==Yn?Ye.iteratee(t,r):ho(t,r,i)}d(tn,"cb");function mo(t,r,i){r=tn(r,i);for(var s=Yt(t),a=s.length,c={},p=0;p<a;p++){var h=s[p];c[h]=r(t[h],h,t)}return c}d(mo,"mapObject");function go(){}d(go,"noop");function Rn(t){return t==null?go:function(r){return Ti(t,r)}}d(Rn,"propertyOf");function Rr(t,r,i){var s=Array(Math.max(0,t));r=Xr(r,i,1);for(var a=0;a<t;a++)s[a]=r(a);return s}d(Rr,"times");function lr(t,r){return r==null&&(r=t,t=0),t+Math.floor(Math.random()*(r-t+1))}d(lr,"random_random");var qr=Date.now||function(){return new Date().getTime()};function bn(t){var r=d(function(c){return t[c]},"escaper"),i="(?:"+Yt(t).join("|")+")",s=RegExp(i),a=RegExp(i,"g");return function(c){return c=c==null?"":""+c,s.test(c)?c.replace(a,r):c}}d(bn,"createEscaper");var Ma={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},yo=bn(Ma),za=$r(Ma),nd=bn(za),fc=Ye.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},cl=/(.)^/,dl={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Ba=/\\|'|\r|\n|\u2028|\u2029/g;function xi(t){return"\\"+dl[t]}d(xi,"escapeChar");var pc=/^\s*(\w|\$)+\s*$/;function Ua(t,r,i){!r&&i&&(r=i),r=sl({},r,Ye.templateSettings);var s=RegExp([(r.escape||cl).source,(r.interpolate||cl).source,(r.evaluate||cl).source].join("|")+"|$","g"),a=0,c="__p+='";t.replace(s,function(v,ce,Fe,wn,Ze){return c+=t.slice(a,Ze).replace(Ba,xi),a=Ze+v.length,ce?c+=`'+
|
|
14
|
+
((__t=(`+ce+`))==null?'':_.escape(__t))+
|
|
15
|
+
'`:Fe?c+=`'+
|
|
16
|
+
((__t=(`+Fe+`))==null?'':__t)+
|
|
17
|
+
'`:wn&&(c+=`';
|
|
18
|
+
`+wn+`
|
|
19
|
+
__p+='`),v}),c+=`';
|
|
20
|
+
`;var p=r.variable;if(p){if(!pc.test(p))throw new Error("variable is not a bare identifier: "+p)}else c=`with(obj||{}){
|
|
21
|
+
`+c+`}
|
|
22
|
+
`,p="obj";c=`var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};
|
|
23
|
+
`+c+`return __p;
|
|
24
|
+
`;var h;try{h=new Function(p,"_",c)}catch(v){throw v.source=c,v}var g=d(function(v){return h.call(this,v,Ye)},"template");return g.source="function("+p+`){
|
|
25
|
+
`+c+"}",g}d(Ua,"template");function vo(t,r,i){r=Ln(r);var s=r.length;if(!s)return pn(i)?i.call(t):i;for(var a=0;a<s;a++){var c=t?.[r[a]];c===void 0&&(c=i,a=s),t=pn(c)?c.call(t):c}return t}d(vo,"result");var rd=0;function hc(t){var r=++rd+"";return t?t+r:r}d(hc,"uniqueId");function Za(t){var r=Ye(t);return r._chain=!0,r}d(Za,"chain");function fl(t,r,i,s,a){if(!(s instanceof r))return t.apply(i,a);var c=Kr(t.prototype),p=t.apply(c,a);return or(p)?p:c}d(fl,"executeBound");var br=sn(function(t,r){var i=br.placeholder,s=d(function(){for(var a=0,c=r.length,p=Array(c),h=0;h<c;h++)p[h]=r[h]===i?arguments[a++]:r[h];for(;a<arguments.length;)p.push(arguments[a++]);return fl(t,s,this,this,p)},"bound");return s});br.placeholder=Ye;var pl=br,mc=sn(function(t,r,i){if(!pn(t))throw new TypeError("Bind must be called on a function");var s=sn(function(a){return fl(t,s,r,this,i.concat(a))});return s}),Zt=_i(yn);function Jr(t,r,i,s){if(s=s||[],!r&&r!==0)r=1/0;else if(r<=0)return s.concat(t);for(var a=s.length,c=0,p=yn(t);c<p;c++){var h=t[c];if(Zt(h)&&(Pr(h)||Gs(h)))if(r>1)Jr(h,r-1,i,s),a=s.length;else for(var g=0,v=h.length;g<v;)s[a++]=h[g++];else i||(s[a++]=h)}return s}d(Jr,"flatten");var gc=sn(function(t,r){r=Jr(r,!1,!1);var i=r.length;if(i<1)throw new Error("bindAll must be passed function names");for(;i--;){var s=r[i];t[s]=mc(t[s],t)}return t});function yc(t,r){var i=d(function(s){var a=i.cache,c=""+(r?r.apply(this,arguments):s);return mr(a,c)||(a[c]=t.apply(this,arguments)),a[c]},"memoize");return i.cache={},i}d(yc,"memoize");var Wa=sn(function(t,r,i){return setTimeout(function(){return t.apply(null,i)},r)}),ei=pl(Wa,Ye,1);function vc(t,r,i){var s,a,c,p,h=0;i||(i={});var g=d(function(){h=i.leading===!1?0:qr(),s=null,p=t.apply(a,c),s||(a=c=null)},"later"),v=d(function(){var ce=qr();!h&&i.leading===!1&&(h=ce);var Fe=r-(ce-h);return a=this,c=arguments,Fe<=0||Fe>r?(s&&(clearTimeout(s),s=null),h=ce,p=t.apply(a,c),s||(a=c=null)):!s&&i.trailing!==!1&&(s=setTimeout(g,Fe)),p},"throttled");return v.cancel=function(){clearTimeout(s),h=0,s=a=c=null},v}d(vc,"throttle");function wc(t,r,i){var s,a,c,p,h,g=d(function(){var ce=qr()-a;r>ce?s=setTimeout(g,r-ce):(s=null,i||(p=t.apply(h,c)),s||(c=h=null))},"later"),v=sn(function(ce){return h=this,c=ce,a=qr(),s||(s=setTimeout(g,r),i&&(p=t.apply(h,c))),p});return v.cancel=function(){clearTimeout(s),s=c=h=null},v}d(wc,"debounce");function Va(t,r){return pl(r,t)}d(Va,"wrap");function hl(t){return function(){return!t.apply(this,arguments)}}d(hl,"negate");function jn(){var t=arguments,r=t.length-1;return function(){for(var i=r,s=t[r].apply(this,arguments);i--;)s=t[i].call(this,s);return s}}d(jn,"compose");function ml(t,r){return function(){if(--t<1)return r.apply(this,arguments)}}d(ml,"after");function Ha(t,r){var i;return function(){return--t>0&&(i=r.apply(this,arguments)),t<=1&&(r=null),i}}d(Ha,"before");var ti=pl(Ha,2);function wo(t,r,i){r=tn(r,i);for(var s=Yt(t),a,c=0,p=s.length;c<p;c++)if(a=s[c],r(t[a],a,t))return a}d(wo,"findKey");function ni(t){return function(r,i,s){i=tn(i,s);for(var a=yn(r),c=t>0?0:a-1;c>=0&&c<a;c+=t)if(i(r[c],c,r))return c;return-1}}d(ni,"createPredicateIndexFinder");var ns=ni(1),gl=ni(-1);function rs(t,r,i,s){i=tn(i,s,1);for(var a=i(r),c=0,p=yn(t);c<p;){var h=Math.floor((c+p)/2);i(t[h])<a?c=h+1:p=h}return c}d(rs,"sortedIndex");function $a(t,r,i){return function(s,a,c){var p=0,h=yn(s);if(typeof c=="number")t>0?p=c>=0?c:Math.max(c+h,p):h=c>=0?Math.min(c+1,h):c+h+1;else if(i&&c&&h)return c=i(s,a),s[c]===a?c:-1;if(a!==a)return c=r(Hr.call(s,p,h),Xs),c>=0?c+p:-1;for(c=t>0?p:h-1;c>=0&&c<h;c+=t)if(s[c]===a)return c;return-1}}d($a,"createIndexFinder");var _c=$a(1,ns,rs),yl=$a(-1,gl);function _o(t,r,i){var s=Zt(t)?ns:wo,a=s(t,r,i);if(a!==void 0&&a!==-1)return t[a]}d(_o,"find");function Qa(t,r){return _o(t,kn(r))}d(Qa,"findWhere");function Xn(t,r,i){r=Xr(r,i);var s,a;if(Zt(t))for(s=0,a=t.length;s<a;s++)r(t[s],s,t);else{var c=Yt(t);for(s=0,a=c.length;s<a;s++)r(t[c[s]],c[s],t)}return t}d(Xn,"each");function ri(t,r,i){r=tn(r,i);for(var s=!Zt(t)&&Yt(t),a=(s||t).length,c=Array(a),p=0;p<a;p++){var h=s?s[p]:p;c[p]=r(t[h],h,t)}return c}d(ri,"map");function is(t){var r=d(function(i,s,a,c){var p=!Zt(i)&&Yt(i),h=(p||i).length,g=t>0?0:h-1;for(c||(a=i[p?p[g]:g],g+=t);g>=0&&g<h;g+=t){var v=p?p[g]:g;a=s(a,i[v],v,i)}return a},"reducer");return function(i,s,a,c){var p=arguments.length>=3;return r(i,Xr(s,c,4),a,p)}}d(is,"createReduce");var Ci=is(1),Sc=is(-1);function gr(t,r,i){var s=[];return r=tn(r,i),Xn(t,function(a,c,p){r(a,c,p)&&s.push(a)}),s}d(gr,"filter");function Ka(t,r,i){return gr(t,hl(tn(r)),i)}d(Ka,"reject");function Ga(t,r,i){r=tn(r,i);for(var s=!Zt(t)&&Yt(t),a=(s||t).length,c=0;c<a;c++){var p=s?s[c]:c;if(!r(t[p],p,t))return!1}return!0}d(Ga,"every");function Pi(t,r,i){r=tn(r,i);for(var s=!Zt(t)&&Yt(t),a=(s||t).length,c=0;c<a;c++){var p=s?s[c]:c;if(r(t[p],p,t))return!0}return!1}d(Pi,"some");function yr(t,r,i,s){return Zt(t)||(t=kt(t)),(typeof i!="number"||s)&&(i=0),_c(t,r,i)>=0}d(yr,"contains");var vl=sn(function(t,r,i){var s,a;return pn(r)?a=r:(r=Ln(r),s=r.slice(0,-1),r=r[r.length-1]),ri(t,function(c){var p=a;if(!p){if(s&&s.length&&(c=Gr(c,s)),c==null)return;p=c[r]}return p==null?p:p.apply(c,i)})});function e(t,r){return ri(t,Yr(r))}d(e,"pluck");function n(t,r){return gr(t,kn(r))}d(n,"where");function o(t,r,i){var s=-1/0,a=-1/0,c,p;if(r==null||typeof r=="number"&&typeof t[0]!="object"&&t!=null){t=Zt(t)?t:kt(t);for(var h=0,g=t.length;h<g;h++)c=t[h],c!=null&&c>s&&(s=c)}else r=tn(r,i),Xn(t,function(v,ce,Fe){p=r(v,ce,Fe),(p>a||p===-1/0&&s===-1/0)&&(s=v,a=p)});return s}d(o,"max");function l(t,r,i){var s=1/0,a=1/0,c,p;if(r==null||typeof r=="number"&&typeof t[0]!="object"&&t!=null){t=Zt(t)?t:kt(t);for(var h=0,g=t.length;h<g;h++)c=t[h],c!=null&&c<s&&(s=c)}else r=tn(r,i),Xn(t,function(v,ce,Fe){p=r(v,ce,Fe),(p<a||p===1/0&&s===1/0)&&(s=v,a=p)});return s}d(l,"min");var u=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function f(t){return t?Pr(t)?Hr.call(t):fn(t)?t.match(u):Zt(t)?ri(t,po):kt(t):[]}d(f,"toArray");function m(t,r,i){if(r==null||i)return Zt(t)||(t=kt(t)),t[lr(t.length-1)];var s=f(t),a=yn(s);r=Math.max(Math.min(r,a),0);for(var c=a-1,p=0;p<r;p++){var h=lr(p,c),g=s[p];s[p]=s[h],s[h]=g}return s.slice(0,r)}d(m,"sample");function y(t){return m(t,1/0)}d(y,"shuffle");function E(t,r,i){var s=0;return r=tn(r,i),e(ri(t,function(a,c,p){return{value:a,index:s++,criteria:r(a,c,p)}}).sort(function(a,c){var p=a.criteria,h=c.criteria;if(p!==h){if(p>h||p===void 0)return 1;if(p<h||h===void 0)return-1}return a.index-c.index}),"value")}d(E,"sortBy");function I(t,r){return function(i,s,a){var c=r?[[],[]]:{};return s=tn(s,a),Xn(i,function(p,h){var g=s(p,h,i);t(c,p,g)}),c}}d(I,"group");var te=I(function(t,r,i){mr(t,i)?t[i].push(r):t[i]=[r]}),Pe=I(function(t,r,i){t[i]=r}),Z=I(function(t,r,i){mr(t,i)?t[i]++:t[i]=1}),fe=I(function(t,r,i){t[i?0:1].push(r)},!0);function Te(t){return t==null?0:Zt(t)?t.length:Yt(t).length}d(Te,"size");function ye(t,r,i){return r in i}d(ye,"keyInObj");var k=sn(function(t,r){var i={},s=r[0];if(t==null)return i;pn(s)?(r.length>1&&(s=Xr(s,r[1])),r=Si(t)):(s=ye,r=Jr(r,!1,!1),t=Object(t));for(var a=0,c=r.length;a<c;a++){var p=r[a],h=t[p];s(h,p,t)&&(i[p]=h)}return i}),T=sn(function(t,r){var i=r[0],s;return pn(i)?(i=hl(i),r.length>1&&(s=r[1])):(r=ri(Jr(r,!1,!1),String),i=d(function(a,c){return!yr(r,c)},"iteratee")),k(t,i,s)});function P(t,r,i){return Hr.call(t,0,Math.max(0,t.length-(r==null||i?1:r)))}d(P,"initial");function L(t,r,i){return t==null||t.length<1?r==null||i?void 0:[]:r==null||i?t[0]:P(t,t.length-r)}d(L,"first");function z(t,r,i){return Hr.call(t,r==null||i?1:r)}d(z,"rest");function ke(t,r,i){return t==null||t.length<1?r==null||i?void 0:[]:r==null||i?t[t.length-1]:z(t,Math.max(0,t.length-r))}d(ke,"last");function le(t){return gr(t,Boolean)}d(le,"compact");function Re(t,r){return Jr(t,r,!1)}d(Re,"flatten_flatten");var ze=sn(function(t,r){return r=Jr(r,!0,!0),gr(t,function(i){return!yr(r,i)})}),Ae=sn(function(t,r){return ze(t,r)});function ar(t,r,i,s){Ea(r)||(s=i,i=r,r=!1),i!=null&&(i=tn(i,s));for(var a=[],c=[],p=0,h=yn(t);p<h;p++){var g=t[p],v=i?i(g,p,t):g;r&&!i?((!p||c!==v)&&a.push(g),c=v):i?yr(c,v)||(c.push(v),a.push(g)):yr(a,g)||a.push(g)}return a}d(ar,"uniq");var id=sn(function(t){return ar(Jr(t,!0,!0))});function wd(t){for(var r=[],i=arguments.length,s=0,a=yn(t);s<a;s++){var c=t[s];if(!yr(r,c)){var p;for(p=1;p<i&&yr(arguments[p],c);p++);p===i&&r.push(c)}}return r}d(wd,"intersection");function Ec(t){for(var r=t&&o(t,yn).length||0,i=Array(r),s=0;s<r;s++)i[s]=e(t,s);return i}d(Ec,"unzip");var kf=sn(Ec);function _d(t,r){for(var i={},s=0,a=yn(t);s<a;s++)r?i[t[s]]=r[s]:i[t[s][0]]=t[s][1];return i}d(_d,"object");function Sd(t,r,i){r==null&&(r=t||0,t=0),i||(i=r<t?-1:1);for(var s=Math.max(Math.ceil((r-t)/i),0),a=Array(s),c=0;c<s;c++,t+=i)a[c]=t;return a}d(Sd,"range");function Ed(t,r){if(r==null||r<1)return[];for(var i=[],s=0,a=t.length;s<a;)i.push(Hr.call(t,s,s+=r));return i}d(Ed,"chunk");function Tc(t,r){return t._chain?Ye(r).chain():r}d(Tc,"chainResult");function od(t){return Xn(Qr(t),function(r){var i=Ye[r]=t[r];Ye.prototype[r]=function(){var s=[this._wrapped];return Qo.apply(s,arguments),Tc(this,i.apply(Ye,s))}}),Ye}d(od,"mixin"),Xn(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var r=$o[t];Ye.prototype[t]=function(){var i=this._wrapped;return i!=null&&(r.apply(i,arguments),(t==="shift"||t==="splice")&&i.length===0&&delete i[0]),Tc(this,i)}}),Xn(["concat","join","slice"],function(t){var r=$o[t];Ye.prototype[t]=function(){var i=this._wrapped;return i!=null&&(i=r.apply(i,arguments)),Tc(this,i)}});var Rf=Ye,sd=od(ie);sd._=sd;var ld=sd,bf=Object.defineProperty,If=d((t,r,i)=>r in t?bf(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,"AncestorScrollDetector_defNormalProp"),ad=d((t,r,i)=>(If(t,typeof r!="symbol"?r+"":r,i),i),"AncestorScrollDetector_publicField");class Td{constructor(r){ad(this,"tree",new Map),ad(this,"rootNode"),ad(this,"handleScroll",i=>{if(!i.target)return;const s=i.target;this.tree.get(s)&&s.querySelectorAll(".js-fake-embed").forEach(a=>{const c=this.tree.get(a);c&&c.callback&&c.callback(s)})}),this.rootNode=r}addListener(r,i){var s;if(!((s=this.rootNode)!=null&&s.contains(r))||this.tree.has(r))return;let a=r;for(this.tree.set(a,{node:a,children:new Map,leaf:!0,callback:i});a&&a.parentElement;){const c=this.tree.get(a.parentElement);if(c){c.children.set(a,!0);break}this.tree.set(a.parentElement,{node:a.parentElement,children:new Map([[a,!0]])}),a.parentElement.addEventListener("scroll",this.handleScroll),a=a.parentElement}}removeListener(r){const i=this.tree.get(r);if(!i||!i.leaf)return;let s=r;for(;s;){const a=this.tree.get(s);if(!a)break;const c=s.parentElement?this.tree.get(s.parentElement):null;if(s!==this.rootNode&&!c||c&&!c.children.has(s)||(c&&c?.children.delete(s),a.children.size!==0)||(s.removeEventListener("scroll",this.handleScroll),this.tree.delete(s),!c))break;s=c.node}}}d(Td,"AncestorScrollDetector");const ud=(0,ue.createContext)({}),Of=d(({root:t,children:r})=>{const i=(0,ue.useMemo)(()=>new Td(t),[]);return(0,at.jsx)(ud.Provider,{value:i,children:r})},"AncestorScrollDetectorProvider"),Nf=d(()=>(0,ue.useContext)(ud),"useAncestorScrollDetector"),xd=(0,ue.createContext)(null),Df=d(({plugin:t,children:r})=>(0,at.jsx)(xd.Provider,{value:t,children:r}),"PluginProvider"),ki=d(()=>{const t=(0,ue.useContext)(xd);if(!t)throw new Error("You must wrap any RemNote API hooks in a <PluginProvider/>");return t},"usePlugin"),Cd=(0,ue.createContext)(null),Af=d(({pluginRoot:t,children:r})=>(0,at.jsx)(Cd.Provider,{value:t,children:r}),"PluginRootProvider"),Ff=d(()=>(0,ue.useContext)(Cd),"usePluginRootDivRef");function Pd(t){return{all:t=t||new Map,on:function(r,i){var s=t.get(r);s?s.push(i):t.set(r,[i])},off:function(r,i){var s=t.get(r);s&&(i?s.splice(s.indexOf(i)>>>0,1):t.set(r,[]))},emit:function(r,i){var s=t.get(r);s&&s.slice().map(function(a){a(i)}),(s=t.get("*"))&&s.slice().map(function(a){a(r,i)})}}}d(Pd,"mitt");const xc=Pd();var Cc=(t=>(t.PluginBodyResizeOrTreeRenders="PluginBodyResizeOrTreeRenders",t))(Cc||{});const Lf=d((t,r)=>{(0,ue.useEffect)(()=>(xc.on(t,r),()=>xc.off(t,r)),[t,r])},"useEvent");function kd(t){const r=ue.useRef(t),i=ue.useRef(0);return ld.isEqual(t,r.current)||(r.current=t,i.current+=1),ue.useMemo(()=>r.current,[i.current])}d(kd,"useDeepCompareMemoize");function Rd(t,r){return ue.useEffect(t,kd(r))}d(Rd,"useDeepCompareEffectNoCheck");var jf=Object.defineProperty,Mf=Object.defineProperties,zf=Object.getOwnPropertyDescriptors,Pc=Object.getOwnPropertySymbols,bd=Object.prototype.hasOwnProperty,Id=Object.prototype.propertyIsEnumerable,Od=d((t,r,i)=>r in t?jf(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,"FakeEmbed_defNormalProp"),Ir=d((t,r)=>{for(var i in r||(r={}))bd.call(r,i)&&Od(t,i,r[i]);if(Pc)for(var i of Pc(r))Id.call(r,i)&&Od(t,i,r[i]);return t},"FakeEmbed_spreadValues"),Bf=d((t,r)=>Mf(t,zf(r)),"FakeEmbed_spreadProps"),Uf=d((t,r)=>{var i={};for(var s in t)bd.call(t,s)&&r.indexOf(s)<0&&(i[s]=t[s]);if(t!=null&&Pc)for(var s of Pc(t))r.indexOf(s)<0&&Id.call(t,s)&&(i[s]=t[s]);return i},"FakeEmbed_objRest"),Zf=d((t,r,i)=>new Promise((s,a)=>{var c=d(g=>{try{h(i.next(g))}catch(v){a(v)}},"fulfilled"),p=d(g=>{try{h(i.throw(g))}catch(v){a(v)}},"rejected"),h=d(g=>g.done?s(g.value):Promise.resolve(g.value).then(c,p),"step");h((i=i.apply(t,r)).next())}),"FakeEmbed_async");const Wf=d(t=>typeof t=="string"&&/[0-9]{1,}%/.test(t)?parseInt(t.replace("%","")):void 0,"parsePercentage"),Vf=d(t=>typeof t=="string"&&/[0-9]{1,}px/.test(t)?parseInt(t.replace("px","")):void 0,"parsePx"),kc=d((t,r)=>{const i=Wf(r),s=Vf(r);return i?t*i/100:s||null},"dimensionToNumber"),Hf=d(({maxWidth:t,maxHeight:r,width:i,height:s,constraintWidth:a,constraintHeight:c})=>{const p=typeof i=="string"&&i!=="auto"?kc(a,i):i,h=typeof t=="string"?kc(a,t):t,g=typeof s=="string"&&s!=="auto"?kc(c,s):s,v=typeof r=="string"?kc(c,r):r;return{width:p,maxWidth:h,height:g,maxHeight:v}},"calculateStyles");function Nd(t){return t.clientHeight<t.scrollHeight}d(Nd,"isVerticallyScrollable");function Dd(t){return t.clientWidth<t.scrollWidth}d(Dd,"isHorizontallScrollable");const $f=d(({componentType:t,externalProps:r,maxHeight:i=null,maxWidth:s=null,height:a="auto",width:c="auto",constraintRef:p="parent"})=>{var h,g,v,ce,Fe,wn;((g=(h=window?.Env)==null?void 0:h.deploy)!=null&&g.isDevelopment||(ce=(v=window?.Env)==null?void 0:v.deploy)!=null&&ce.isStaging||(wn=(Fe=window?.Env)==null?void 0:Fe.app)!=null&&wn.isCypress)&&(console.error("You imported the wrong component!"),alert("You imported the wrong component!"));const Ze=(0,ue.useRef)(null),ut=ki(),Sl=Ff(),qn=(0,ue.useRef)(),[El,yp]=(0,ue.useState)(!1),md=Nf(),Dc=(0,ue.useRef)(),Ri=(0,ue.useRef)({height:a,width:c,maxHeight:i,maxWidth:s}),os=(0,ue.useRef)(),Sf=(0,ue.useCallback)(Je=>{!Ze.current||Je.height===void 0||Je.width===void 0||ut.isNative||(Ze.current.style.height=Je.height+"px",Ze.current.style.width=Je.width+"px")},[]),Ef=d(Je=>{var Ft;Je.type=="wheel"?vp(Je):(Ft=Ze.current)==null||Ft.dispatchEvent(new Event(Je.type,Bf(Ir({},Je),{bubbles:!0})))},"onDOMEvent"),vp=(0,ue.useCallback)(Je=>{if(!(!Ze.current||Je.deltaY===void 0||Je.deltaX===void 0)){if(Je.deltaY){let Ft=Ze.current;for(;Ft&&!Nd(Ft);)Ft=Ft.parentElement;Ft&&(Ft.scrollTop+=Je.deltaY)}if(Je.deltaX){let Ft=Ze.current;for(;Ft&&!Dd(Ft);)Ft=Ft.parentElement;Ft&&(Ft.scrollLeft+=Je.deltaX)}}},[]),Tf=d(()=>{if(!qn.current||!ut)return;const Je=Dc.current?Hf({constraintWidth:Dc.current.constraintWidth,constraintHeight:Dc.current.constraintHeight,height:Ri.current.height,width:Ri.current.width,maxHeight:Ri.current.maxHeight,maxWidth:Ri.current.maxWidth}):{height:Ri.current.height,width:Ri.current.width,maxHeight:Ri.current.maxHeight,maxWidth:Ri.current.maxWidth};ut.updateFakeEmbedComponentRect(qn.current,Je)},"updateDimensions"),xf=d(()=>{var Je;if(!(ut!=null&&ut.inSandbox)||!Ze.current||!qn.current)return;const{top:Ft,left:ss}=Ze.current.getBoundingClientRect(),ls=((Je=Sl?.current)==null?void 0:Je.getBoundingClientRect())||{top:0,left:0},si=Ft-ls.top,as=ss-ls.left;os.current&&os?.current.top===si&&os?.current.left===as||(os.current={left:as,top:si},ut.updateFakeEmbedComponentRect(qn.current,{top:si,left:as}))},"handleResizeOrScrollEvent");(0,ue.useEffect)(()=>{if(ut||console.error("You must wrap your components in a <PluginProvider/> or a renderWidget call."),!ut||!Ze.current)return;gd();const Je=wi();return Zf(void 0,null,function*(){var Ft;const{top:ss,left:ls}=Ze.current.getBoundingClientRect();os.current={top:ss,left:ls};const si=((Ft=Sl?.current)==null?void 0:Ft.getBoundingClientRect())||{top:0,left:0},as=ss-si.top,yd=ls-si.left;ut.event.addListener(A.FakeEmbedComponentDimensionChange,Je,Sf),ut.event.addListener(A.FakeEmbedDOMEvent,Je,Ef),ut.isNative&&window.nativePluginDivs.set("virtual-"+Je,Ze.current),yield ut.createFakeEmbedComponent({id:Je,type:t,top:as,left:yd,externalProps:r}),qn.current=Je,yp(!0)}),()=>{qn.current&&(ut.unmountFakeEmbedComponent(qn.current),ut.isNative&&window.nativePluginDivs.delete("virtual-"+Je),ut.event.removeListener(A.FakeEmbedComponentDimensionChange,qn.current,Sf),ut.event.removeListener(A.FakeEmbedDOMEvent,qn.current,Ef))}},[]);function gd(){try{JSON.stringify(r)}catch{throw console.error("ExternalProps are not serializable.",r),new Error(`All props passed to a RemNote React Component must be JSON serializable. Check the devtools to see your props for your ${t} component.`)}}d(gd,"throwErrorIfExternalPropsAreNotSerializable");function Cf(){gd(),qn.current&&ut.updateFakeEmbedExternalProps(qn.current,r)}return d(Cf,"updateExternalProps"),Rd(Cf,[r]),(0,ue.useEffect)(()=>{El&&(Ri.current={maxHeight:i,maxWidth:s,height:a,width:c},Tf())},[i,s,c,a,El]),(0,ue.useEffect)(()=>{var Je;if(ut!=null&&ut.inSandbox&&qn.current&&El&&p){const Ft=p==="parent"?(Je=Ze.current)==null?void 0:Je.parentElement:p.current;if(!Ft)return;const ss=new ResizeObserver(ls=>{for(const si of ls)if(si.contentBoxSize){const as=si.contentBoxSize[0].inlineSize,yd=si.contentBoxSize[0].blockSize;Dc.current={constraintHeight:yd,constraintWidth:as},Tf()}});return ss.observe(Ft),()=>ss.disconnect()}else return},[p,El]),Lf(Cc.PluginBodyResizeOrTreeRenders,xf),(0,ue.useLayoutEffect)(()=>{if(!(!El||!Ze.current||!md))return md.addListener(Ze.current,ld.debounce(xf,10)),()=>{Ze.current&&md.removeListener(Ze.current)}},[El]),(0,ue.useEffect)(()=>()=>{ut&&qn.current&&ut.unmountFakeEmbedComponent(qn.current)},[]),(0,at.jsx)("div",{ref:Ze,className:"js-fake-embed"})},"FakeEmbedHost"),ii=d(t=>{const r=t,{width:i,maxHeight:s,constraintRef:a,height:c,maxWidth:p,componentType:h}=r,g=Uf(r,["width","maxHeight","constraintRef","height","maxWidth","componentType"]);return(0,at.jsx)($f,{componentType:h,externalProps:g,width:i,height:c,maxHeight:s,maxWidth:p,constraintRef:a})},"FakeEmbedHostConcrete");class Ad extends ue.Component{render(){return(0,at.jsx)(ii,Ir({componentType:Dn.RichTextEditor},this.props))}}d(Ad,"RichTextEditor");class Fd extends ue.Component{render(){return(0,at.jsx)(ii,Ir({componentType:Dn.RichText},this.props))}}d(Fd,"RichText");class Ld extends ue.Component{render(){return(0,at.jsx)(ii,Ir({componentType:Dn.RemViewer},this.props))}}d(Ld,"RemViewer");class jd extends ue.Component{render(){return(0,at.jsx)(ii,Ir({componentType:Dn.PDFWebReader},this.props))}}d(jd,"PDFWebReader");class Md extends ue.Component{render(){return(0,at.jsx)(ii,Ir({componentType:Dn.DocumentViewer},this.props))}}d(Md,"DocumentViewer");class zd extends ue.Component{render(){return(0,at.jsx)(ii,Ir({componentType:Dn.RemRichTextEditor},this.props))}}d(zd,"RemRichTextEditor");class Bd extends ue.Component{render(){return(0,at.jsx)(ii,Ir({componentType:Dn.RemHierarchyEditorTree},this.props))}}d(Bd,"RemHierarchyEditorTree");class Ud extends ue.Component{render(){return(0,at.jsx)(ii,Ir({componentType:Dn.Queue},this.props))}}d(Ud,"Queue");class Zd extends ue.Component{render(){return(0,at.jsx)(ii,Ir({componentType:Dn.LoadingSpinner},this.props))}}d(Zd,"LoadingSpinnerPlugin");class Wd extends ue.Component{render(){return(0,at.jsx)(ii,Ir({componentType:Dn.PreviewRemCards},this.props))}}d(Wd,"PreviewRemCards");function cd(t){var r,i,s="";if(typeof t=="string"||typeof t=="number")s+=t;else if(typeof t=="object")if(Array.isArray(t))for(r=0;r<t.length;r++)t[r]&&(i=cd(t[r]))&&(s&&(s+=" "),s+=i);else for(r in t)t[r]&&(s&&(s+=" "),s+=r);return s}d(cd,"r");function Vd(){for(var t,r,i=0,s="";i<arguments.length;)(t=arguments[i++])&&(r=cd(t))&&(s&&(s+=" "),s+=r);return s}d(Vd,"clsx");var Qf=Vd,Kf=Ge(318),Hd=Ge.n(Kf),Gf=Object.defineProperty,Yf=d((t,r,i)=>r in t?Gf(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,"PluginRenderer_defNormalProp"),$d=d((t,r,i)=>(Yf(t,typeof r!="symbol"?r+"":r,i),i),"PluginRenderer_publicField"),Qd=d((t,r,i)=>new Promise((s,a)=>{var c=d(g=>{try{h(i.next(g))}catch(v){a(v)}},"fulfilled"),p=d(g=>{try{h(i.throw(g))}catch(v){a(v)}},"rejected"),h=d(g=>g.done?s(g.value):Promise.resolve(g.value).then(c,p),"step");h((i=i.apply(t,r)).next())}),"PluginRenderer_async");const Xf=d(({plugin:t,children:r})=>{const i=(0,ue.useRef)(null);(0,ue.useEffect)(()=>{if(!i.current||!t.inSandbox)return;const h=new ResizeObserver(()=>{i.current&&xc.emit(Cc.PluginBodyResizeOrTreeRenders)}),g=new MutationObserver(v=>{for(const ce of v)(ce.type==="attributes"||ce.type==="childList")&&xc.emit(Cc.PluginBodyResizeOrTreeRenders)});return g.observe(i.current,{attributes:!0,childList:!0,subtree:!0}),h.observe(i.current),()=>{i.current&&(h.disconnect(),g.disconnect())}},[]);const s=t.inSandbox?{current:document.getElementsByTagName("html")[0]}:i,a=t.inSandbox?document.getElementsByTagName("html")[0]:t.mountDiv,c=t.inSandbox?Of:Kd,p=(0,at.jsx)("div",{ref:i,className:Qf("plugin rn-clr-content-primary font-inter",t.id==="demo-tabs"&&"fade-on-hide-ui"),"data-plugin-id":t.id,children:r});return(0,at.jsx)(Df,{plugin:t,children:(0,at.jsx)(Af,{pluginRoot:s,children:(0,at.jsx)(c,{root:a,children:p})})})},"PluginWrapper");function Kd(t){return(0,at.jsx)(ud.Provider,{value:null,children:t.children})}d(Kd,"NoScrollDetector");class Rc extends so{constructor(r,i){super(),$d(this,"initReact"),$d(this,"onDeactivateReact"),this.initReact=r,this.onDeactivateReact=i}onActivate(r,i){return Qd(this,null,function*(){this.initReact(this,r,i)})}onDeactivate(){return Qd(this,null,function*(){this.onDeactivateReact(this)})}}d(Rc,"ReactRNPlugin");const Gd=d(t=>{const r=d(i=>{const s=d((c,p,h)=>Hd().render((0,at.jsxs)(ue.StrictMode,{children:[(0,at.jsx)(Xf,{plugin:c,children:(0,at.jsx)(t,{})}),(0,at.jsx)("link",{rel:"stylesheet",href:`${h}App.css`,as:"style",type:"text/css",crossOrigin:"anonymous"})]}),p),"initReact"),a=d(c=>{console.log("onDeactivateReact"),Hd().unmountComponentAtNode(c.mountDiv)},"onDeactivateReact");return i?(window.__plugin?(console.log("[HMR] Hot reloading RemNote plugin widget."),a(window.__plugin),s(window.__plugin,window.__plugin.mountDiv,window.__plugin.rootURL)):window.__plugin=new Rc(s,a),window.__plugin):new Rc(s,a)},"makePlugin");try{const i=new URL(IMPORT_META.url).searchParams,s=i.get("widgetName"),a=i.get("pluginId");window.nativePluginRenderers.set(`${a}.${s}`,r)}catch{r(!0)}},"renderWidget");function Yd(t,r){function i(){const s=ki();return(0,ue.useEffect)(()=>(s&&t(s),()=>{s&&r(s)}),[s]),null}d(i,"IndexWidget"),Gd(i)}d(Yd,"declareIndexPlugin");function Xd(t){return bc(A.MessageBroadcast,void 0,t)}d(Xd,"useOnMessageBroadcast");function bc(t,r,i){const s=ki();(0,ue.useEffect)(()=>(s.event.addListener(t,r,i),()=>{s.event.removeListener(t,r,i)}),[t,r,i])}d(bc,"useAPIEventListener");var qf=Object.defineProperty,qd=Object.getOwnPropertySymbols,Jf=Object.prototype.hasOwnProperty,ep=Object.prototype.propertyIsEnumerable,Jd=d((t,r,i)=>r in t?qf(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,"rem_hooks_defNormalProp"),tp=d((t,r)=>{for(var i in r||(r={}))Jf.call(r,i)&&Jd(t,i,r[i]);if(qd)for(var i of qd(r))ep.call(r,i)&&Jd(t,i,r[i]);return t},"rem_hooks_spreadValues"),np=d((t,r,i)=>new Promise((s,a)=>{var c=d(g=>{try{h(i.next(g))}catch(v){a(v)}},"fulfilled"),p=d(g=>{try{h(i.throw(g))}catch(v){a(v)}},"rejected"),h=d(g=>g.done?s(g.value):Promise.resolve(g.value).then(c,p),"step");h((i=i.apply(t,r)).next())}),"rem_hooks_async");function dd(t,r){const i=new Set(r);return t.filter(s=>!i.has(s))}d(dd,"rem_hooks_difference");function ef(t){return t.filter(r=>r)}d(ef,"rem_hooks_compact");function tf(t){const r=ki(),i=ef(t||[]),[s,a]=(0,ue.useState)({}),[c,p]=(0,ue.useState)(i.map(Fe=>s[Fe])),h=d((Fe,wn)=>{wn&&a(Ze=>{const ut=tp({},Ze);return ut[Fe]=wn,p(i.map(Sl=>ut[Sl])),ut})},"setRem"),g=d(Fe=>np(this,null,function*(){h(Fe,yield r.rem.findOne(Fe))}),"refetchRem"),v=(0,ue.useRef)([]),ce=(0,ue.useRef)(new Map);return(0,ue.useEffect)(()=>{const Fe=dd(i,v.current),wn=dd(v.current,i);for(const Ze of Fe){const ut=d(()=>g(Ze),"listener");ce.current.set(Ze,ut),r.event.addListener(A.RemChanged,Ze,ut),g(Ze)}for(const Ze of wn)r.event.removeListener(A.RemChanged,Ze,ce.current.get(Ze));p(i.map(Ze=>s[Ze])),v.current=i},[i.length,...i]),(0,ue.useEffect)(()=>()=>{for(const Fe of v.current)r.event.removeListener(A.RemChanged,Fe,ce.current.get(Fe))},[]),c}d(tf,"useGetRemsByIdsReactive");var nf=d((t,r,i)=>new Promise((s,a)=>{var c=d(g=>{try{h(i.next(g))}catch(v){a(v)}},"fulfilled"),p=d(g=>{try{h(i.throw(g))}catch(v){a(v)}},"rejected"),h=d(g=>g.done?s(g.value):Promise.resolve(g.value).then(c,p),"step");h((i=i.apply(t,r)).next())}),"storage_hooks_async");function Ic(t,r,i,s,a,c){const[p,h]=(0,ue.useState)(c),g=d(()=>nf(this,null,function*(){r&&h((yield s(r))||c)}),"refetchValue");return(0,ue.useEffect)(()=>{g()},[r]),bc(i,r,v=>{h(v)}),[p,d(v=>nf(this,null,function*(){yield a(r,v)}),"setValue")]}d(Ic,"useStorageStateInternal");function rf(t,r){const i=ki();return Ic(i,t,A.StorageSessionChange,i.storage.getSession,i.storage.setSession,r)}d(rf,"useSessionStorageState");function of(t,r){const i=ki();return Ic(i,t,A.StorageLocalChange,i.storage.getLocal,i.storage.setLocal,r)}d(of,"useLocalStorageState");function sf(t,r){const i=ki();return Ic(i,t,A.StorageSyncedChange,i.storage.getSynced,i.storage.setSynced,r)}d(sf,"useSyncedStorageState");var lf=d((t,r,i)=>new Promise((s,a)=>{var c=d(g=>{try{h(i.next(g))}catch(v){a(v)}},"fulfilled"),p=d(g=>{try{h(i.throw(g))}catch(v){a(v)}},"rejected"),h=d(g=>g.done?s(g.value):Promise.resolve(g.value).then(c,p),"step");h((i=i.apply(t,r)).next())}),"react_hooks_async");function af(t,r){const[i,s]=(0,ue.useState)(void 0);return(0,ue.useEffect)(()=>{lf(this,null,function*(){return s(yield t())})},r),i}d(af,"useRunAsync");function uf(t,r){return lf(this,null,function*(){const i=[],s=yield Promise.all(t.map(a=>r(a)));for(const[a,c]of ld.zip(s,t))a&&i.push(c);return i})}d(uf,"filterAsync");const rp=["card","editor","focus","messaging","powerup","rem","richText","settings","storage","widget","window","search"],Wt=d(t=>({event:A.RemChanged,key:typeof t=="string"?t:typeof t=="object"?t._id:void 0}),"remReactiveDep"),oi=d(t=>({event:t,key:void 0}),"noKeyDep"),cf={allRemInDocumentOrPortal:{resultDeps:t=>t.map(Wt)},deepRemsBeingReferenced:{resultDeps:t=>t.map(Wt)},getAliases:{resultDeps:t=>t.map(Wt)},getDescendants:{resultDeps:t=>t.map(Wt)},getSources:{resultDeps:t=>t.map(Wt)},getTagRems:{resultDeps:t=>t.map(Wt)},getParentRem:{resultDeps:t=>[Wt(t)]},getChildrenRem:{resultDeps:t=>t.map(Wt)},getPortalDirectlyIncludedRem:{resultDeps:t=>t.map(Wt)},portalsAndDocumentsIn:{resultDeps:t=>t.map(Wt)},remsBeingReferenced:{resultDeps:t=>t.map(Wt)},remsReferencingThis:{resultDeps:t=>t.map(Wt)},siblingRem:{resultDeps:t=>t.map(Wt)},taggedRem:{resultDeps:t=>t.map(Wt)}},df={rem:{findByName:{resultDeps:t=>[Wt(t)]},findOne:{argsDeps:t=>[Wt(t[0])]},findMany:{argsDeps:t=>t[0].map(Wt)},getAll:{resultDeps:t=>t.map(Wt)}},powerup:{getPowerupSlotByCode:{resultDeps:t=>[Wt(t)]},getPowerupByCode:{resultDeps:t=>[Wt(t)]}},settings:{getSetting:{argsDeps:t=>[{event:A.SettingChanged,key:t[0]}]}},card:{},storage:{getLocal:{argsDeps:t=>[{event:A.StorageLocalChange,key:t[0]}]},getSession:{argsDeps:t=>[{event:A.StorageSessionChange,key:t[0]}]},getSynced:{argsDeps:t=>[{event:A.StorageSyncedChange,key:t[0]}]}},window:{getCurrentWindowTree:{argsDeps:()=>[oi(A.CurrentWindowTreeChange)]},getFocusedPaneId:{argsDeps:()=>[oi(A.FocusedPaneChange)]}},editor:{getFocusedEditorText:{argsDeps:()=>[oi(A.FocusedRemChange),oi(A.EditorTextEdited)]},getSelection:{argsDeps:()=>[oi(A.EditorSelectionChanged)]},getSelectedRem:{argsDeps:()=>[oi(A.EditorSelectionChanged)]},getSelectedText:{argsDeps:()=>[oi(A.EditorSelectionChanged)]},getCaretPosition:{argsDeps:()=>[oi(A.EditorSelectionChanged)]}},focus:{getFocusedRem:{argsDeps:()=>[oi(A.FocusedRemChange)],resultDeps:t=>[Wt(t)]},getFocusedPortal:{argsDeps:()=>[oi(A.FocusedPortalChange)],resultDeps:t=>[Wt(t)]}}};var Oc=d((t,r,i)=>new Promise((s,a)=>{var c=d(g=>{try{h(i.next(g))}catch(v){a(v)}},"fulfilled"),p=d(g=>{try{h(i.throw(g))}catch(v){a(v)}},"rejected"),h=d(g=>g.done?s(g.value):Promise.resolve(g.value).then(c,p),"step");h((i=i.apply(t,r)).next())}),"useTracker_async");const wl=!1;function ff(t){return rp.includes(t)}d(ff,"isNamespacedProp");const ip=d((t,r)=>Array.isArray(t)&&t[0]instanceof Wn?(wl&&console.log("wrapping result array in Rem proxy"),t.map(i=>fd(i,r))):t&&t instanceof Wn?(wl&&console.log("wrapping result in Rem proxy"),fd(t,r)):t,"wrapResult"),pf=d((t,r,i,s)=>new Proxy(t,{apply:(a,c,p)=>Oc(void 0,null,function*(){const h=yield a.apply(c,p);return s(r,c,i,p,h),ip(h,s)})}),"wrapFunctionCall");function fd(t,r){return new Proxy(t,{get(i,s){var a;return typeof i[s]=="function"&&(a=cf)!=null&&a[s]?pf(i[s],void 0,s,r):i[s]}})}d(fd,"interceptReactiveRemCalls");function hf(t,r,i){return new Proxy(r,{get(s,a){var c,p;return typeof a=="string"&&typeof s[a]=="function"&&(p=(c=df)==null?void 0:c[t])!=null&&p[a]?pf(s[a],t,a,i):s[a]}})}d(hf,"interceptReactiveAPICalls");function mf(t,r){return new Proxy(t,{get(i,s){return ff(s)?hf(s,i[s],r):i[s]}})}d(mf,"interceptAPINamespaceAccesses");function pd(t){return new Set(t?.map(({reactiveDeps:r})=>r.map(Nc)).flat())}d(pd,"subscriptionsToSubscriptionSet");function Nc(t){const{event:r,key:i}=t;return`${r}.${i}`}d(Nc,"reactiveDepToKey");const op=d(t=>{const r=[];return{proxy:mf(t,(i,s,a,c,p)=>{var h,g,v,ce,Fe,wn;const Ze=i?(g=(h=df)==null?void 0:h[i])==null?void 0:g[a]:(v=cf)==null?void 0:v[a],ut=[...((ce=Ze.thisDeps)==null?void 0:ce.call(Ze,s))||[],...((Fe=Ze.argsDeps)==null?void 0:Fe.call(Ze,c))||[],...((wn=Ze.resultDeps)==null?void 0:wn.call(Ze,p))||[]];r.push({methodName:a,args:c,reactiveDeps:ut})}),subscriptions:r}},"wrapApiWithListen"),hd=d((t,r,i,s,a)=>Oc(void 0,null,function*(){const c=op(t);return yield d(()=>Oc(void 0,null,function*(){c.subscriptions.length;const p=yield r(c.proxy);wl&&console.log("useReactiveAPI result",p),s(p)}),"changeHandler")(),gf(t,i,a,c.subscriptions),c.subscriptions}),"createReactiveApi");function gf(t,r,i,s){const a=pd(i||[]),c=pd(s);i?.forEach(({reactiveDeps:p})=>{for(const h of p)if(!c.has(Nc(h))){const{event:g,key:v}=h;wl&&console.log("removeListener",g,v),t.event.removeListener(g,v,r)}}),s?.forEach(({reactiveDeps:p})=>{for(const h of p)if(!a.has(Nc(h))){const{event:g,key:v}=h;wl&&console.log("addListener",g,v),t.event.addListener(g,v,r)}})}d(gf,"updateListeners");function yf(t,r=[]){const i=ki(),[s,a]=ir().useState(),c=(0,ue.useRef)(!1),p=(0,ue.useRef)(!1),h=(0,ue.useRef)(),g=(0,ue.useRef)(t);g.current=t;const v=d(()=>{wl&&console.log("useReactiveAPI RUN",c.current,p.current,h.current,r),c.current?p.current=!0:(c.current=!0,d(()=>Oc(this,null,function*(){h.current=yield hd(i,g.current,v,a,h.current||[]),c.current=!1,p.current&&(p.current=!1,v())}),"effect")())},"run");return ir().useEffect(v,r),s}d(yf,"useTrackerPlugin");const sp=/^[-_a-zA-Z0-9]+$/,lp=x.nativeEnum(Dl),_p=x.nativeEnum(Sr),_l=x.object({level:lp}),ap=x.object({type:x.literal(Sr.KnowledgeBaseInfo)}).merge(_l),up=x.object({type:x.literal(Sr.All)}).merge(_l),cp=x.object({type:x.literal(Sr.DescendantsOfName),remName:x.string()}).merge(_l),dp=x.object({type:x.literal(Sr.DescendantsOfId),remId:x.string()}).merge(_l),fp=x.object({type:x.literal(Sr.Powerup),powerupCode:x.string()}).merge(_l),pp=x.object({type:x.literal(Sr.FocusedSubtree)}).merge(_l),hp=x.union([up,cp,dp,fp,pp,ap]),vf=x.object({major:x.number().gte(0),minor:x.number().gte(0),patch:x.number().gte(0)}),wf=x.object({id:x.string().min(5).max(100).refine(t=>sp.test(t),"Plugin ids may consist only of lowercase Latin letters a-z, A-Z, hyphens, underscores, and digits 0-9"),name:x.string().min(3).max(100),version:vf,manifestVersion:x.literal(1),requestNative:x.boolean(),requiredScopes:x.array(hp),repoUrl:x.string().url(),author:x.string().min(3).max(100),enableOnMobile:x.boolean(),theme:x.union([x.literal("dark"),x.literal("light")]).array().optional(),minimumRemNoteVersion:vf.optional(),description:x.string().max(200).optional(),projectUrl:x.string().url().optional(),supportUrl:x.string().url().optional(),changelogUrl:x.string().url().optional(),unlisted:x.boolean().optional()}),mp=wf.merge(x.object({repoUrl:x.string().url().optional()})),Sp=d(t=>`${t.field}: ${t.message}`,"formatValidationError"),_f=d(t=>{const r=t.errors,i=[];for(const s of r){const{code:a,message:c,path:p}=s,h={field:p.join(".")?p.join("."):"Root Object",message:`${c} (${a})`};"expected"in s&&(h.expected=s.expected),"received"in s&&(h.received=s.received),i.push(h)}return i},"prettifyZodErrors"),gp=d(t=>{const r=wf.safeParse(t);return r.success?r:{success:!1,errors:_f(r.error)}},"parseManifest"),Ep=d(t=>{const r=mp.safeParse(t);return r.success?r:{success:!1,errors:_f(r.error)}},"parseSnippetManifest")})(),ot})()})},575(qt){"use strict";/*
|
|
26
|
+
object-assign
|
|
27
|
+
(c) Sindre Sorhus
|
|
28
|
+
@license MIT
|
|
29
|
+
*/var G=Object.getOwnPropertySymbols,Ke=Object.prototype.hasOwnProperty,Rt=Object.prototype.propertyIsEnumerable;function Ne(B){if(B==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(B)}function et(){try{if(!Object.assign)return!1;var B=new String("abc");if(B[5]="de",Object.getOwnPropertyNames(B)[0]==="5")return!1;for(var mn={},_t=0;_t<10;_t++)mn["_"+String.fromCharCode(_t)]=_t;var Xe=Object.getOwnPropertyNames(mn).map(function(X){return mn[X]});if(Xe.join("")!=="0123456789")return!1;var O={};return"abcdefghijklmnopqrst".split("").forEach(function(X){O[X]=X}),Object.keys(Object.assign({},O)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}qt.exports=et()?Object.assign:function(B,mn){for(var _t,Xe=Ne(B),O,X=1;X<arguments.length;X++){_t=Object(arguments[X]);for(var d in _t)Ke.call(_t,d)&&(Xe[d]=_t[d]);if(G){O=G(_t);for(var bt=0;bt<O.length;bt++)Rt.call(_t,O[bt])&&(Xe[O[bt]]=_t[O[bt]])}}return Xe}},638(qt,G,Ke){"use strict";/** @license React v17.0.2
|
|
30
|
+
* react-dom.production.min.js
|
|
31
|
+
*
|
|
32
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the MIT license found in the
|
|
35
|
+
* LICENSE file in the root directory of this source tree.
|
|
36
|
+
*/var Rt=Ke(999),Ne=Ke(575),et=Ke(825);function B(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,o=1;o<arguments.length;o++)n+="&args[]="+encodeURIComponent(arguments[o]);return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!Rt)throw Error(B(227));var mn=new Set,_t={};function Xe(e,n){O(e,n),O(e+"Capture",n)}function O(e,n){for(_t[e]=n,e=0;e<n.length;e++)mn.add(n[e])}var X=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,bt=Object.prototype.hasOwnProperty,ct={},He={};function dt(e){return bt.call(He,e)?!0:bt.call(ct,e)?!1:d.test(e)?He[e]=!0:(ct[e]=!0,!1)}function nn(e,n,o,l){if(o!==null&&o.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return l?!1:o!==null?!o.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Ge(e,n,o,l){if(n===null||typeof n>"u"||nn(e,n,o,l))return!0;if(l)return!1;if(o!==null)switch(o.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function ot(e,n,o,l,u,f,m){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=l,this.attributeNamespace=u,this.mustUseProperty=o,this.propertyName=e,this.type=n,this.sanitizeURL=f,this.removeEmptyString=m}var ie={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ie[e]=new ot(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];ie[n]=new ot(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){ie[e]=new ot(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ie[e]=new ot(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ie[e]=new ot(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){ie[e]=new ot(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){ie[e]=new ot(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){ie[e]=new ot(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){ie[e]=new ot(e,5,!1,e.toLowerCase(),null,!1,!1)});var ae=/[\-:]([a-z])/g;function me(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var n=e.replace(ae,me);ie[n]=new ot(n,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(ae,me);ie[n]=new ot(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(ae,me);ie[n]=new ot(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){ie[e]=new ot(e,1,!1,e.toLowerCase(),null,!1,!1)}),ie.xlinkHref=new ot("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){ie[e]=new ot(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ie(e,n,o,l){var u=ie.hasOwnProperty(n)?ie[n]:null,f=u!==null?u.type===0:l?!1:!(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N");f||(Ge(n,o,u,l)&&(o=null),l||u===null?dt(n)&&(o===null?e.removeAttribute(n):e.setAttribute(n,""+o)):u.mustUseProperty?e[u.propertyName]=o===null?u.type===3?!1:"":o:(n=u.attributeName,l=u.attributeNamespace,o===null?e.removeAttribute(n):(u=u.type,o=u===3||u===4&&o===!0?"":""+o,l?e.setAttributeNS(l,n,o):e.setAttribute(n,o))))}var Me=Rt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,tt=60103,W=60106,Be=60107,Ve=60108,de=60114,pe=60109,ne=60110,se=60112,we=60113,ee=60120,ge=60115,C=60116,V=60121,F=60128,A=60129,Y=60130,Q=60131;if(typeof Symbol=="function"&&Symbol.for){var oe=Symbol.for;tt=oe("react.element"),W=oe("react.portal"),Be=oe("react.fragment"),Ve=oe("react.strict_mode"),de=oe("react.profiler"),pe=oe("react.provider"),ne=oe("react.context"),se=oe("react.forward_ref"),we=oe("react.suspense"),ee=oe("react.suspense_list"),ge=oe("react.memo"),C=oe("react.lazy"),V=oe("react.block"),oe("react.scope"),F=oe("react.opaque.id"),A=oe("react.debug_trace_mode"),Y=oe("react.offscreen"),Q=oe("react.legacy_hidden")}var U=typeof Symbol=="function"&&Symbol.iterator;function ve(e){return e===null||typeof e!="object"?null:(e=U&&e[U]||e["@@iterator"],typeof e=="function"?e:null)}var j;function ln(e){if(j===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);j=n&&n[1]||""}return`
|
|
37
|
+
`+j+e}var Vt=!1;function Mn(e,n){if(!e||Vt)return"";Vt=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(n)if(n=function(){throw Error()},Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(n,[])}catch(E){var l=E}Reflect.construct(e,[],n)}else{try{n.call()}catch(E){l=E}e.call(n.prototype)}else{try{throw Error()}catch(E){l=E}e()}}catch(E){if(E&&l&&typeof E.stack=="string"){for(var u=E.stack.split(`
|
|
38
|
+
`),f=l.stack.split(`
|
|
39
|
+
`),m=u.length-1,y=f.length-1;1<=m&&0<=y&&u[m]!==f[y];)y--;for(;1<=m&&0<=y;m--,y--)if(u[m]!==f[y]){if(m!==1||y!==1)do if(m--,y--,0>y||u[m]!==f[y])return`
|
|
40
|
+
`+u[m].replace(" at new "," at ");while(1<=m&&0<=y);break}}}finally{Vt=!1,Error.prepareStackTrace=o}return(e=e?e.displayName||e.name:"")?ln(e):""}function us(e){switch(e.tag){case 5:return ln(e.type);case 16:return ln("Lazy");case 13:return ln("Suspense");case 19:return ln("SuspenseList");case 0:case 2:case 15:return e=Mn(e.type,!1),e;case 11:return e=Mn(e.type.render,!1),e;case 22:return e=Mn(e.type._render,!1),e;case 1:return e=Mn(e.type,!0),e;default:return""}}function vr(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Be:return"Fragment";case W:return"Portal";case de:return"Profiler";case Ve:return"StrictMode";case we:return"Suspense";case ee:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ne:return(e.displayName||"Context")+".Consumer";case pe:return(e._context.displayName||"Context")+".Provider";case se:var n=e.render;return n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case ge:return vr(e.type);case V:return vr(e._render);case C:n=e._payload,e=e._init;try{return vr(e(n))}catch{}}return null}function _n(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function li(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function ai(e){var n=li(e)?"checked":"value",o=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),l=""+e[n];if(!e.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var u=o.get,f=o.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return u.call(this)},set:function(m){l=""+m,f.call(this,m)}}),Object.defineProperty(e,n,{enumerable:o.enumerable}),{getValue:function(){return l},setValue:function(m){l=""+m},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function J(e){e._valueTracker||(e._valueTracker=ai(e))}function It(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var o=n.getValue(),l="";return e&&(l=li(e)?e.checked?"true":"false":e.value),e=l,e!==o?(n.setValue(e),!0):!1}function _e(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function bi(e,n){var o=n.checked;return Ne({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:o??e._wrapperState.initialChecked})}function w(e,n){var o=n.defaultValue==null?"":n.defaultValue,l=n.checked!=null?n.checked:n.defaultChecked;o=_n(n.value!=null?n.value:o),e._wrapperState={initialChecked:l,initialValue:o,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function S(e,n){n=n.checked,n!=null&&Ie(e,"checked",n,!1)}function b(e,n){S(e,n);var o=_n(n.value),l=n.type;if(o!=null)l==="number"?(o===0&&e.value===""||e.value!=o)&&(e.value=""+o):e.value!==""+o&&(e.value=""+o);else if(l==="submit"||l==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?M(e,n.type,o):n.hasOwnProperty("defaultValue")&&M(e,n.type,_n(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function _(e,n,o){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var l=n.type;if(!(l!=="submit"&&l!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,o||n===e.value||(e.value=n),e.defaultValue=n}o=e.name,o!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,o!==""&&(e.name=o)}function M(e,n,o){(n!=="number"||_e(e.ownerDocument)!==e)&&(o==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+o&&(e.defaultValue=""+o))}function R(e){var n="";return Rt.Children.forEach(e,function(o){o!=null&&(n+=o)}),n}function $(e,n){return e=Ne({children:void 0},n),(n=R(n.children))&&(e.children=n),e}function K(e,n,o,l){if(e=e.options,n){n={};for(var u=0;u<o.length;u++)n["$"+o[u]]=!0;for(o=0;o<e.length;o++)u=n.hasOwnProperty("$"+e[o].value),e[o].selected!==u&&(e[o].selected=u),u&&l&&(e[o].defaultSelected=!0)}else{for(o=""+_n(o),n=null,u=0;u<e.length;u++){if(e[u].value===o){e[u].selected=!0,l&&(e[u].defaultSelected=!0);return}n!==null||e[u].disabled||(n=e[u])}n!==null&&(n.selected=!0)}}function H(e,n){if(n.dangerouslySetInnerHTML!=null)throw Error(B(91));return Ne({},n,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function q(e,n){var o=n.value;if(o==null){if(o=n.children,n=n.defaultValue,o!=null){if(n!=null)throw Error(B(92));if(Array.isArray(o)){if(!(1>=o.length))throw Error(B(93));o=o[0]}n=o}n==null&&(n=""),o=n}e._wrapperState={initialValue:_n(o)}}function Oe(e,n){var o=_n(n.value),l=_n(n.defaultValue);o!=null&&(o=""+o,o!==e.value&&(e.value=o),n.defaultValue==null&&e.defaultValue!==o&&(e.defaultValue=o)),l!=null&&(e.defaultValue=""+l)}function be(e){var n=e.textContent;n===e._wrapperState.initialValue&&n!==""&&n!==null&&(e.value=n)}var ft={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function We(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function pt(e,n){return e==null||e==="http://www.w3.org/1999/xhtml"?We(n):e==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Mt,Ue=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,o,l,u){MSApp.execUnsafeLocalFunction(function(){return e(n,o,l,u)})}:e})(function(e,n){if(e.namespaceURI!==ft.svg||"innerHTML"in e)e.innerHTML=n;else{for(Mt=Mt||document.createElement("div"),Mt.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=Mt.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function Le(e,n){if(n){var o=e.firstChild;if(o&&o===e.lastChild&&o.nodeType===3){o.nodeValue=n;return}}e.textContent=n}var st={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},nt=["Webkit","ms","Moz","O"];Object.keys(st).forEach(function(e){nt.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),st[n]=st[e]})});function je(e,n,o){return n==null||typeof n=="boolean"||n===""?"":o||typeof n!="number"||n===0||st.hasOwnProperty(e)&&st[e]?(""+n).trim():n+"px"}function qe(e,n){e=e.style;for(var o in n)if(n.hasOwnProperty(o)){var l=o.indexOf("--")===0,u=je(o,n[o],l);o==="float"&&(o="cssFloat"),l?e.setProperty(o,u):e[o]=u}}var De=Ne({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function $e(e,n){if(n){if(De[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(B(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(B(60));if(!(typeof n.dangerouslySetInnerHTML=="object"&&"__html"in n.dangerouslySetInnerHTML))throw Error(B(61))}if(n.style!=null&&typeof n.style!="object")throw Error(B(62))}}function Sn(e,n){if(e.indexOf("-")===-1)return typeof n.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function Lt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var an=null,Ot=null,zt=null;function Ht(e){if(e=Do(e)){if(typeof an!="function")throw Error(B(280));var n=e.stateNode;n&&(n=Xi(n),an(e.stateNode,e.type,n))}}function yt(e){Ot?zt?zt.push(e):zt=[e]:Ot=e}function St(){if(Ot){var e=Ot,n=zt;if(zt=Ot=null,Ht(e),n)for(e=0;e<n.length;e++)Ht(n[e])}}function Bt(e,n){return e(n)}function Qe(e,n,o,l,u){return e(n,o,l,u)}function gn(){}var rt=Bt,Tt=!1,Or=!1;function wr(){(Ot!==null||zt!==null)&&(gn(),St())}function Ii(e,n,o){if(Or)return e(n,o);Or=!0;try{return rt(e,n,o)}finally{Or=!1,wr()}}function zn(e,n){var o=e.stateNode;if(o===null)return null;var l=Xi(o);if(l===null)return null;o=l[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(o&&typeof o!="function")throw Error(B(231,n,typeof o));return o}var un=!1;if(X)try{var Bn={};Object.defineProperty(Bn,"passive",{get:function(){un=!0}}),window.addEventListener("test",Bn,Bn),window.removeEventListener("test",Bn,Bn)}catch{un=!1}function ui(e,n,o,l,u,f,m,y,E){var I=Array.prototype.slice.call(arguments,3);try{n.apply(o,I)}catch(te){this.onError(te)}}var En=!1,Un=null,Jn=!1,Zn=null,Oi={onError:function(e){En=!0,Un=e}};function In(e,n,o,l,u,f,m,y,E){En=!1,Un=null,ui.apply(Oi,arguments)}function ur(e,n,o,l,u,f,m,y,E){if(In.apply(this,arguments),En){if(En){var I=Un;En=!1,Un=null}else throw Error(B(198));Jn||(Jn=!0,Zn=I)}}function cn(e){var n=e,o=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&1026)!==0&&(o=n.return),e=n.return;while(e)}return n.tag===3?o:null}function xe(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function On(e){if(cn(e)!==e)throw Error(B(188))}function Nr(e){var n=e.alternate;if(!n){if(n=cn(e),n===null)throw Error(B(188));return n!==e?null:e}for(var o=e,l=n;;){var u=o.return;if(u===null)break;var f=u.alternate;if(f===null){if(l=u.return,l!==null){o=l;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===o)return On(u),e;if(f===l)return On(u),n;f=f.sibling}throw Error(B(188))}if(o.return!==l.return)o=u,l=f;else{for(var m=!1,y=u.child;y;){if(y===o){m=!0,o=u,l=f;break}if(y===l){m=!0,l=u,o=f;break}y=y.sibling}if(!m){for(y=f.child;y;){if(y===o){m=!0,o=f,l=u;break}if(y===l){m=!0,l=f,o=u;break}y=y.sibling}if(!m)throw Error(B(189))}}if(o.alternate!==l)throw Error(B(190))}if(o.tag!==3)throw Error(B(188));return o.stateNode.current===o?e:n}function ci(e){if(e=Nr(e),!e)return null;for(var n=e;;){if(n.tag===5||n.tag===6)return n;if(n.child)n.child.return=n,n=n.child;else{if(n===e)break;for(;!n.sibling;){if(!n.return||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}}return null}function Ni(e,n){for(var o=e.alternate;n!==null;){if(n===e||n===o)return!0;n=n.return}return!1}var Di,Tl,cs,di,fi=!1,er=[],Dr=null,he=null,Ar=null,Ai=new Map,Fi=new Map,So=[],Ya="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function ds(e,n,o,l,u){return{blockedOn:e,domEventName:n,eventSystemFlags:o|16,nativeEvent:u,targetContainers:[l]}}function Xa(e,n){switch(e){case"focusin":case"focusout":Dr=null;break;case"dragenter":case"dragleave":he=null;break;case"mouseover":case"mouseout":Ar=null;break;case"pointerover":case"pointerout":Ai.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Fi.delete(n.pointerId)}}function Eo(e,n,o,l,u,f){return e===null||e.nativeEvent!==f?(e=ds(n,o,l,u,f),n!==null&&(n=Do(n),n!==null&&Tl(n)),e):(e.eventSystemFlags|=l,n=e.targetContainers,u!==null&&n.indexOf(u)===-1&&n.push(u),e)}function Fc(e,n,o,l,u){switch(n){case"focusin":return Dr=Eo(Dr,e,n,o,l,u),!0;case"dragenter":return he=Eo(he,e,n,o,l,u),!0;case"mouseover":return Ar=Eo(Ar,e,n,o,l,u),!0;case"pointerover":var f=u.pointerId;return Ai.set(f,Eo(Ai.get(f)||null,e,n,o,l,u)),!0;case"gotpointercapture":return f=u.pointerId,Fi.set(f,Eo(Fi.get(f)||null,e,n,o,l,u)),!0}return!1}function Lc(e){var n=Mr(e.target);if(n!==null){var o=cn(n);if(o!==null){if(n=o.tag,n===13){if(n=xe(o),n!==null){e.blockedOn=n,di(e.lanePriority,function(){et.unstable_runWithPriority(e.priority,function(){cs(o)})});return}}else if(n===3&&o.stateNode.hydrate){e.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}e.blockedOn=null}function fs(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var o=N(e.domEventName,e.eventSystemFlags,n[0],e.nativeEvent);if(o!==null)return n=Do(o),n!==null&&Tl(n),e.blockedOn=o,!1;n.shift()}return!0}function qa(e,n,o){fs(e)&&o.delete(n)}function jc(){for(fi=!1;0<er.length;){var e=er[0];if(e.blockedOn!==null){e=Do(e.blockedOn),e!==null&&Di(e);break}for(var n=e.targetContainers;0<n.length;){var o=N(e.domEventName,e.eventSystemFlags,n[0],e.nativeEvent);if(o!==null){e.blockedOn=o;break}n.shift()}e.blockedOn===null&&er.shift()}Dr!==null&&fs(Dr)&&(Dr=null),he!==null&&fs(he)&&(he=null),Ar!==null&&fs(Ar)&&(Ar=null),Ai.forEach(qa),Fi.forEach(qa)}function To(e,n){e.blockedOn===n&&(e.blockedOn=null,fi||(fi=!0,et.unstable_scheduleCallback(et.unstable_NormalPriority,jc)))}function Ja(e){function n(u){return To(u,e)}if(0<er.length){To(er[0],e);for(var o=1;o<er.length;o++){var l=er[o];l.blockedOn===e&&(l.blockedOn=null)}}for(Dr!==null&&To(Dr,e),he!==null&&To(he,e),Ar!==null&&To(Ar,e),Ai.forEach(n),Fi.forEach(n),o=0;o<So.length;o++)l=So[o],l.blockedOn===e&&(l.blockedOn=null);for(;0<So.length&&(o=So[0],o.blockedOn===null);)Lc(o),o.blockedOn===null&&So.shift()}function ps(e,n){var o={};return o[e.toLowerCase()]=n.toLowerCase(),o["Webkit"+e]="webkit"+n,o["Moz"+e]="moz"+n,o}var Li={animationend:ps("Animation","AnimationEnd"),animationiteration:ps("Animation","AnimationIteration"),animationstart:ps("Animation","AnimationStart"),transitionend:ps("Transition","TransitionEnd")},xl={},eu={};X&&(eu=document.createElement("div").style,"AnimationEvent"in window||(delete Li.animationend.animation,delete Li.animationiteration.animation,delete Li.animationstart.animation),"TransitionEvent"in window||delete Li.transitionend.transition);function hs(e){if(xl[e])return xl[e];if(!Li[e])return e;var n=Li[e],o;for(o in n)if(n.hasOwnProperty(o)&&o in eu)return xl[e]=n[o];return e}var tu=hs("animationend"),nu=hs("animationiteration"),ru=hs("animationstart"),iu=hs("transitionend"),ou=new Map,Cl=new Map,Mc=["abort","abort",tu,"animationEnd",nu,"animationIteration",ru,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",iu,"transitionEnd","waiting","waiting"];function Pl(e,n){for(var o=0;o<e.length;o+=2){var l=e[o],u=e[o+1];u="on"+(u[0].toUpperCase()+u.slice(1)),Cl.set(l,n),ou.set(l,u),Xe(u,[l])}}var zc=et.unstable_now;zc();var vt=8;function pi(e){if((1&e)!==0)return vt=15,1;if((2&e)!==0)return vt=14,2;if((4&e)!==0)return vt=13,4;var n=24&e;return n!==0?(vt=12,n):(e&32)!==0?(vt=11,32):(n=192&e,n!==0?(vt=10,n):(e&256)!==0?(vt=9,256):(n=3584&e,n!==0?(vt=8,n):(e&4096)!==0?(vt=7,4096):(n=4186112&e,n!==0?(vt=6,n):(n=62914560&e,n!==0?(vt=5,n):e&67108864?(vt=4,67108864):(e&134217728)!==0?(vt=3,134217728):(n=805306368&e,n!==0?(vt=2,n):(1073741824&e)!==0?(vt=1,1073741824):(vt=8,e))))))}function Bc(e){switch(e){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}function Uc(e){switch(e){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(B(358,e))}}function xo(e,n){var o=e.pendingLanes;if(o===0)return vt=0;var l=0,u=0,f=e.expiredLanes,m=e.suspendedLanes,y=e.pingedLanes;if(f!==0)l=f,u=vt=15;else if(f=o&134217727,f!==0){var E=f&~m;E!==0?(l=pi(E),u=vt):(y&=f,y!==0&&(l=pi(y),u=vt))}else f=o&~m,f!==0?(l=pi(f),u=vt):y!==0&&(l=pi(y),u=vt);if(l===0)return 0;if(l=31-_r(l),l=o&((0>l?0:1<<l)<<1)-1,n!==0&&n!==l&&(n&m)===0){if(pi(n),u<=vt)return n;vt=u}if(n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=l;0<n;)o=31-_r(n),u=1<<o,l|=e[o],n&=~u;return l}function su(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function x(e,n){switch(e){case 15:return 1;case 14:return 2;case 12:return e=Fr(24&~n),e===0?x(10,n):e;case 10:return e=Fr(192&~n),e===0?x(8,n):e;case 8:return e=Fr(3584&~n),e===0&&(e=Fr(4186112&~n),e===0&&(e=512)),e;case 2:return n=Fr(805306368&~n),n===0&&(n=268435456),n}throw Error(B(358,e))}function Fr(e){return e&-e}function kl(e){for(var n=[],o=0;31>o;o++)n.push(e);return n}function ms(e,n,o){e.pendingLanes|=n;var l=n-1;e.suspendedLanes&=l,e.pingedLanes&=l,e=e.eventTimes,n=31-_r(n),e[n]=o}var _r=Math.clz32?Math.clz32:lu,Ut=Math.log,$t=Math.LN2;function lu(e){return e===0?32:31-(Ut(e)/$t|0)|0}var Zc=et.unstable_UserBlockingPriority,au=et.unstable_runWithPriority,gs=!0;function Wc(e,n,o,l){Tt||gn();var u=bl,f=Tt;Tt=!0;try{Qe(u,e,n,o,l)}finally{(Tt=f)||wr()}}function Rl(e,n,o,l){au(Zc,bl.bind(null,e,n,o,l))}function bl(e,n,o,l){if(gs){var u;if((u=(n&4)===0)&&0<er.length&&-1<Ya.indexOf(e))e=ds(null,e,n,o,l),er.push(e);else{var f=N(e,n,o,l);if(f===null)u&&Xa(e,l);else{if(u){if(-1<Ya.indexOf(e)){e=ds(f,e,n,o,l),er.push(e);return}if(Fc(f,e,n,o,l))return;Xa(e,l)}Jl(e,n,l,null,o)}}}}function N(e,n,o,l){var u=Lt(l);if(u=Mr(u),u!==null){var f=cn(u);if(f===null)u=null;else{var m=f.tag;if(m===13){if(u=xe(f),u!==null)return u;u=null}else if(m===3){if(f.stateNode.hydrate)return f.tag===3?f.stateNode.containerInfo:null;u=null}else f!==u&&(u=null)}}return Jl(e,n,l,u,o),null}var D=null,Wn=null,ji=null;function Qt(){if(ji)return ji;var e,n=Wn,o=n.length,l,u="value"in D?D.value:D.textContent,f=u.length;for(e=0;e<o&&n[e]===u[e];e++);var m=o-e;for(l=1;l<=m&&n[o-l]===u[f-l];l++);return ji=u.slice(e,1<l?1-l:void 0)}function Mi(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function ys(){return!0}function Il(){return!1}function Nn(e){function n(o,l,u,f,m){this._reactName=o,this._targetInst=u,this.type=l,this.nativeEvent=f,this.target=m,this.currentTarget=null;for(var y in e)e.hasOwnProperty(y)&&(o=e[y],this[y]=o?o(f):f[y]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?ys:Il,this.isPropagationStopped=Il,this}return Ne(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=ys)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=ys)},persist:function(){},isPersistent:ys}),n}var zi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Co=Nn(zi),Bi=Ne({},zi,{view:0,detail:0}),rn=Nn(Bi),tr,Po,hi,cr=Ne({},Bi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Er,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==hi&&(hi&&e.type==="mousemove"?(tr=e.screenX-hi.screenX,Po=e.screenY-hi.screenY):Po=tr=0,hi=e),tr)},movementY:function(e){return"movementY"in e?e.movementY:Po}}),uu=Nn(cr),Vc=Ne({},cr,{dataTransfer:0}),Hc=Nn(Vc),cu=Ne({},Bi,{relatedTarget:0}),Ol=Nn(cu),$c=Ne({},zi,{animationName:0,elapsedTime:0,pseudoElement:0}),du=Nn($c),Qc=Ne({},zi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Kc=Nn(Qc),vs=Ne({},zi,{data:0}),Nl=Nn(vs),ws={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Dl={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Sr={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function fu(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=Sr[e])?!!n[e]:!1}function Er(){return fu}var Ui=Ne({},Bi,{key:function(e){if(e.key){var n=ws[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Mi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Dl[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Er,charCode:function(e){return e.type==="keypress"?Mi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Mi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),pu=Nn(Ui),Al=Ne({},cr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Fl=Nn(Al),hu=Ne({},Bi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Er}),mu=Nn(hu),gu=Ne({},zi,{propertyName:0,elapsedTime:0,pseudoElement:0}),yu=Nn(gu),Gc=Ne({},cr,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Ll=Nn(Gc),vu=[9,13,27,32],jl=X&&"CompositionEvent"in window,ko=null;X&&"documentMode"in document&&(ko=document.documentMode);var wu=X&&"TextEvent"in window&&!ko,Dn=X&&(!jl||ko&&8<ko&&11>=ko),_u=" ",dr=!1;function nr(e,n){switch(e){case"keyup":return vu.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Su(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Zi=!1;function Eu(e,n){switch(e){case"compositionend":return Su(n);case"keypress":return n.which!==32?null:(dr=!0,_u);case"textInput":return e=n.data,e===_u&&dr?null:e;default:return null}}function Tu(e,n){if(Zi)return e==="compositionend"||!jl&&nr(e,n)?(e=Qt(),ji=Wn=D=null,Zi=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Dn&&n.locale!=="ko"?null:n.data;default:return null}}var xu={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ml(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!xu[e.type]:n==="textarea"}function Cu(e,n,o,l){yt(l),n=Cs(n,"onChange"),0<n.length&&(o=new Co("onChange","change",null,o,l),e.push({event:o,listeners:n}))}var mi=null,Wi=null;function zl(e){Xl(e,0)}function Vi(e){var n=Yi(e);if(It(n))return e}function Jt(e,n){if(e==="change")return n}var xt=!1;if(X){var _s;if(X){var Ss="oninput"in document;if(!Ss){var Bl=document.createElement("div");Bl.setAttribute("oninput","return;"),Ss=typeof Bl.oninput=="function"}_s=Ss}else _s=!1;xt=_s&&(!document.documentMode||9<document.documentMode)}function Ul(){mi&&(mi.detachEvent("onpropertychange",Zl),Wi=mi=null)}function Zl(e){if(e.propertyName==="value"&&Vi(Wi)){var n=[];if(Cu(n,Wi,e,Lt(e)),e=zl,Tt)e(n);else{Tt=!0;try{Bt(e,n)}finally{Tt=!1,wr()}}}}function Pu(e,n,o){e==="focusin"?(Ul(),mi=n,Wi=o,mi.attachEvent("onpropertychange",Zl)):e==="focusout"&&Ul()}function ku(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Vi(Wi)}function Wl(e,n){if(e==="click")return Vi(n)}function Vl(e,n){if(e==="input"||e==="change")return Vi(n)}function Yc(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var Tn=typeof Object.is=="function"?Object.is:Yc,Ro=Object.prototype.hasOwnProperty;function Lr(e,n){if(Tn(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var o=Object.keys(e),l=Object.keys(n);if(o.length!==l.length)return!1;for(l=0;l<o.length;l++)if(!Ro.call(n,o[l])||!Tn(e[o[l]],n[o[l]]))return!1;return!0}function Ru(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Es(e,n){var o=Ru(e);e=0;for(var l;o;){if(o.nodeType===3){if(l=e+o.textContent.length,e<=n&&l>=n)return{node:o,offset:n-e};e=l}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=Ru(o)}}function bo(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?bo(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function bu(){for(var e=window,n=_e();n instanceof e.HTMLIFrameElement;){try{var o=typeof n.contentWindow.location.href=="string"}catch{o=!1}if(o)e=n.contentWindow;else break;n=_e(e.document)}return n}function Io(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var Hl=X&&"documentMode"in document&&11>=document.documentMode,Hi=null,$l=null,Oo=null,Ql=!1;function Iu(e,n,o){var l=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Ql||Hi==null||Hi!==_e(l)||(l=Hi,"selectionStart"in l&&Io(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Oo&&Lr(Oo,l)||(Oo=l,l=Cs($l,"onSelect"),0<l.length&&(n=new Co("onSelect","select",null,n,o),e.push({event:n,listeners:l}),n.target=Hi)))}Pl("cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),Pl("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),Pl(Mc,2);for(var Kl="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),Ts=0;Ts<Kl.length;Ts++)Cl.set(Kl[Ts],0);O("onMouseEnter",["mouseout","mouseover"]),O("onMouseLeave",["mouseout","mouseover"]),O("onPointerEnter",["pointerout","pointerover"]),O("onPointerLeave",["pointerout","pointerover"]),Xe("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Xe("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Xe("onBeforeInput",["compositionend","keypress","textInput","paste"]),Xe("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Xe("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Xe("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var gi="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Gl=new Set("cancel close invalid load scroll toggle".split(" ").concat(gi));function Yl(e,n,o){var l=e.type||"unknown-event";e.currentTarget=o,ur(l,n,void 0,e),e.currentTarget=null}function Xl(e,n){n=(n&4)!==0;for(var o=0;o<e.length;o++){var l=e[o],u=l.event;l=l.listeners;e:{var f=void 0;if(n)for(var m=l.length-1;0<=m;m--){var y=l[m],E=y.instance,I=y.currentTarget;if(y=y.listener,E!==f&&u.isPropagationStopped())break e;Yl(u,y,I),f=E}else for(m=0;m<l.length;m++){if(y=l[m],E=y.instance,I=y.currentTarget,y=y.listener,E!==f&&u.isPropagationStopped())break e;Yl(u,y,I),f=E}}}if(Jn)throw e=Zn,Jn=!1,Zn=null,e}function wt(e,n){var o=Fu(n),l=e+"__bubble";o.has(l)||(Ou(n,e,2,!1),o.add(l))}var ql="_reactListening"+Math.random().toString(36).slice(2);function $i(e){e[ql]||(e[ql]=!0,mn.forEach(function(n){Gl.has(n)||xs(n,!1,e,null),xs(n,!0,e,null)}))}function xs(e,n,o,l){var u=4<arguments.length&&arguments[4]!==void 0?arguments[4]:0,f=o;if(e==="selectionchange"&&o.nodeType!==9&&(f=o.ownerDocument),l!==null&&!n&&Gl.has(e)){if(e!=="scroll")return;u|=2,f=l}var m=Fu(f),y=e+"__"+(n?"capture":"bubble");m.has(y)||(n&&(u|=4),Ou(f,e,u,n),m.add(y))}function Ou(e,n,o,l){var u=Cl.get(n);switch(u===void 0?2:u){case 0:u=Wc;break;case 1:u=Rl;break;default:u=bl}o=u.bind(null,n,o,e),u=void 0,!un||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(u=!0),l?u!==void 0?e.addEventListener(n,o,{capture:!0,passive:u}):e.addEventListener(n,o,!0):u!==void 0?e.addEventListener(n,o,{passive:u}):e.addEventListener(n,o,!1)}function Jl(e,n,o,l,u){var f=l;if((n&1)===0&&(n&2)===0&&l!==null)e:for(;;){if(l===null)return;var m=l.tag;if(m===3||m===4){var y=l.stateNode.containerInfo;if(y===u||y.nodeType===8&&y.parentNode===u)break;if(m===4)for(m=l.return;m!==null;){var E=m.tag;if((E===3||E===4)&&(E=m.stateNode.containerInfo,E===u||E.nodeType===8&&E.parentNode===u))return;m=m.return}for(;y!==null;){if(m=Mr(y),m===null)return;if(E=m.tag,E===5||E===6){l=f=m;continue e}y=y.parentNode}}l=l.return}Ii(function(){var I=f,te=Lt(o),Pe=[];e:{var Z=ou.get(e);if(Z!==void 0){var fe=Co,Te=e;switch(e){case"keypress":if(Mi(o)===0)break e;case"keydown":case"keyup":fe=pu;break;case"focusin":Te="focus",fe=Ol;break;case"focusout":Te="blur",fe=Ol;break;case"beforeblur":case"afterblur":fe=Ol;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":fe=uu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=Hc;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=mu;break;case tu:case nu:case ru:fe=du;break;case iu:fe=yu;break;case"scroll":fe=rn;break;case"wheel":fe=Ll;break;case"copy":case"cut":case"paste":fe=Kc;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=Fl}var ye=(n&4)!==0,k=!ye&&e==="scroll",T=ye?Z!==null?Z+"Capture":null:Z;ye=[];for(var P=I,L;P!==null;){L=P;var z=L.stateNode;if(L.tag===5&&z!==null&&(L=z,T!==null&&(z=zn(P,T),z!=null&&ye.push(Qi(P,z,L)))),k)break;P=P.return}0<ye.length&&(Z=new fe(Z,Te,null,o,te),Pe.push({event:Z,listeners:ye}))}}if((n&7)===0){e:{if(Z=e==="mouseover"||e==="pointerover",fe=e==="mouseout"||e==="pointerout",Z&&(n&16)===0&&(Te=o.relatedTarget||o.fromElement)&&(Mr(Te)||Te[jr]))break e;if((fe||Z)&&(Z=te.window===te?te:(Z=te.ownerDocument)?Z.defaultView||Z.parentWindow:window,fe?(Te=o.relatedTarget||o.toElement,fe=I,Te=Te?Mr(Te):null,Te!==null&&(k=cn(Te),Te!==k||Te.tag!==5&&Te.tag!==6)&&(Te=null)):(fe=null,Te=I),fe!==Te)){if(ye=uu,z="onMouseLeave",T="onMouseEnter",P="mouse",(e==="pointerout"||e==="pointerover")&&(ye=Fl,z="onPointerLeave",T="onPointerEnter",P="pointer"),k=fe==null?Z:Yi(fe),L=Te==null?Z:Yi(Te),Z=new ye(z,P+"leave",fe,o,te),Z.target=k,Z.relatedTarget=L,z=null,Mr(te)===I&&(ye=new ye(T,P+"enter",Te,o,te),ye.target=L,ye.relatedTarget=k,z=ye),k=z,fe&&Te)t:{for(ye=fe,T=Te,P=0,L=ye;L;L=Ki(L))P++;for(L=0,z=T;z;z=Ki(z))L++;for(;0<P-L;)ye=Ki(ye),P--;for(;0<L-P;)T=Ki(T),L--;for(;P--;){if(ye===T||T!==null&&ye===T.alternate)break t;ye=Ki(ye),T=Ki(T)}ye=null}else ye=null;fe!==null&&ea(Pe,Z,fe,ye,!1),Te!==null&&k!==null&&ea(Pe,k,Te,ye,!0)}}e:{if(Z=I?Yi(I):window,fe=Z.nodeName&&Z.nodeName.toLowerCase(),fe==="select"||fe==="input"&&Z.type==="file")var ke=Jt;else if(Ml(Z))if(xt)ke=Vl;else{ke=ku;var le=Pu}else(fe=Z.nodeName)&&fe.toLowerCase()==="input"&&(Z.type==="checkbox"||Z.type==="radio")&&(ke=Wl);if(ke&&(ke=ke(e,I))){Cu(Pe,ke,o,te);break e}le&&le(e,Z,I),e==="focusout"&&(le=Z._wrapperState)&&le.controlled&&Z.type==="number"&&M(Z,"number",Z.value)}switch(le=I?Yi(I):window,e){case"focusin":(Ml(le)||le.contentEditable==="true")&&(Hi=le,$l=I,Oo=null);break;case"focusout":Oo=$l=Hi=null;break;case"mousedown":Ql=!0;break;case"contextmenu":case"mouseup":case"dragend":Ql=!1,Iu(Pe,o,te);break;case"selectionchange":if(Hl)break;case"keydown":case"keyup":Iu(Pe,o,te)}var Re;if(jl)e:{switch(e){case"compositionstart":var ze="onCompositionStart";break e;case"compositionend":ze="onCompositionEnd";break e;case"compositionupdate":ze="onCompositionUpdate";break e}ze=void 0}else Zi?nr(e,o)&&(ze="onCompositionEnd"):e==="keydown"&&o.keyCode===229&&(ze="onCompositionStart");ze&&(Dn&&o.locale!=="ko"&&(Zi||ze!=="onCompositionStart"?ze==="onCompositionEnd"&&Zi&&(Re=Qt()):(D=te,Wn="value"in D?D.value:D.textContent,Zi=!0)),le=Cs(I,ze),0<le.length&&(ze=new Nl(ze,e,null,o,te),Pe.push({event:ze,listeners:le}),Re?ze.data=Re:(Re=Su(o),Re!==null&&(ze.data=Re)))),(Re=wu?Eu(e,o):Tu(e,o))&&(I=Cs(I,"onBeforeInput"),0<I.length&&(te=new Nl("onBeforeInput","beforeinput",null,o,te),Pe.push({event:te,listeners:I}),te.data=Re))}Xl(Pe,n)})}function Qi(e,n,o){return{instance:e,listener:n,currentTarget:o}}function Cs(e,n){for(var o=n+"Capture",l=[];e!==null;){var u=e,f=u.stateNode;u.tag===5&&f!==null&&(u=f,f=zn(e,o),f!=null&&l.unshift(Qi(e,f,u)),f=zn(e,n),f!=null&&l.push(Qi(e,f,u))),e=e.return}return l}function Ki(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ea(e,n,o,l,u){for(var f=n._reactName,m=[];o!==null&&o!==l;){var y=o,E=y.alternate,I=y.stateNode;if(E!==null&&E===l)break;y.tag===5&&I!==null&&(y=I,u?(E=zn(o,f),E!=null&&m.unshift(Qi(o,E,y))):u||(E=zn(o,f),E!=null&&m.push(Qi(o,E,y)))),o=o.return}m.length!==0&&e.push({event:n,listeners:m})}function Ps(){}var ks=null,ta=null;function Nu(e,n){switch(e){case"button":case"input":case"select":case"textarea":return!!n.autoFocus}return!1}function na(e,n){return e==="textarea"||e==="option"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Du=typeof setTimeout=="function"?setTimeout:void 0,Kt=typeof clearTimeout=="function"?clearTimeout:void 0;function Gt(e){e.nodeType===1?e.textContent="":e.nodeType===9&&(e=e.body,e!=null&&(e.textContent=""))}function Gi(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break}return e}function Rs(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var o=e.data;if(o==="$"||o==="$!"||o==="$?"){if(n===0)return e;n--}else o==="/$"&&n++}e=e.previousSibling}return null}var ra=0;function Xc(e){return{$$typeof:F,toString:e,valueOf:e}}var No=Math.random().toString(36).slice(2),Tr="__reactFiber$"+No,bs="__reactProps$"+No,jr="__reactContainer$"+No,Au="__reactEvents$"+No;function Mr(e){var n=e[Tr];if(n)return n;for(var o=e.parentNode;o;){if(n=o[jr]||o[Tr]){if(o=n.alternate,n.child!==null||o!==null&&o.child!==null)for(e=Rs(e);e!==null;){if(o=e[Tr])return o;e=Rs(e)}return n}e=o,o=e.parentNode}return null}function Do(e){return e=e[Tr]||e[jr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Yi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(B(33))}function Xi(e){return e[bs]||null}function Fu(e){var n=e[Au];return n===void 0&&(n=e[Au]=new Set),n}var Nt=[],Et=-1;function zr(e){return{current:e}}function ht(e){0>Et||(e.current=Nt[Et],Nt[Et]=null,Et--)}function Dt(e,n){Et++,Nt[Et]=e.current,e.current=n}var Br={},en=zr(Br),xn=zr(!1),xr=Br;function qi(e,n){var o=e.type.contextTypes;if(!o)return Br;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===n)return l.__reactInternalMemoizedMaskedChildContext;var u={},f;for(f in o)u[f]=n[f];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=u),u}function Cn(e){return e=e.childContextTypes,e!=null}function Ao(){ht(xn),ht(en)}function ia(e,n,o){if(en.current!==Br)throw Error(B(168));Dt(en,n),Dt(xn,o)}function Lu(e,n,o){var l=e.stateNode;if(e=n.childContextTypes,typeof l.getChildContext!="function")return o;l=l.getChildContext();for(var u in l)if(!(u in e))throw Error(B(108,vr(n)||"Unknown",u));return Ne({},o,l)}function Ji(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Br,xr=en.current,Dt(en,e),Dt(xn,xn.current),!0}function ju(e,n,o){var l=e.stateNode;if(!l)throw Error(B(169));o?(e=Lu(e,n,xr),l.__reactInternalMemoizedMergedChildContext=e,ht(xn),ht(en),Dt(en,e)):ht(xn),Dt(xn,o)}var oa=null,fr=null,Mu=et.unstable_runWithPriority,sa=et.unstable_scheduleCallback,Fo=et.unstable_cancelCallback,qc=et.unstable_shouldYield,zu=et.unstable_requestPaint,la=et.unstable_now,Jc=et.unstable_getCurrentPriorityLevel,Is=et.unstable_ImmediatePriority,Os=et.unstable_UserBlockingPriority,Bu=et.unstable_NormalPriority,Uu=et.unstable_LowPriority,aa=et.unstable_IdlePriority,Ns={},ed=zu!==void 0?zu:function(){},rr=null,Lo=null,ua=!1,Zu=la(),mt=1e4>Zu?la:function(){return la()-Zu};function on(){switch(Jc()){case Is:return 99;case Os:return 98;case Bu:return 97;case Uu:return 96;case aa:return 95;default:throw Error(B(332))}}function Wu(e){switch(e){case 99:return Is;case 98:return Os;case 97:return Bu;case 96:return Uu;case 95:return aa;default:throw Error(B(332))}}function Cr(e,n){return e=Wu(e),Mu(e,n)}function jo(e,n,o){return e=Wu(e),sa(e,n,o)}function pr(){if(Lo!==null){var e=Lo;Lo=null,Fo(e)}Vu()}function Vu(){if(!ua&&rr!==null){ua=!0;var e=0;try{var n=rr;Cr(99,function(){for(;e<n.length;e++){var o=n[e];do o=o(!0);while(o!==null)}}),rr=null}catch(o){throw rr!==null&&(rr=rr.slice(e+1)),sa(Is,pr),o}finally{ua=!1}}}var Hu=Me.ReactCurrentBatchConfig;function An(e,n){if(e&&e.defaultProps){n=Ne({},n),e=e.defaultProps;for(var o in e)n[o]===void 0&&(n[o]=e[o]);return n}return n}var Ds=zr(null),As=null,eo=null,Mo=null;function ca(){Mo=eo=As=null}function da(e){var n=Ds.current;ht(Ds),e.type._context._currentValue=n}function Fs(e,n){for(;e!==null;){var o=e.alternate;if((e.childLanes&n)===n){if(o===null||(o.childLanes&n)===n)break;o.childLanes|=n}else e.childLanes|=n,o!==null&&(o.childLanes|=n);e=e.return}}function to(e,n){As=e,Mo=eo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(gt=!0),e.firstContext=null)}function Vn(e,n){if(Mo!==e&&n!==!1&&n!==0)if((typeof n!="number"||n===1073741823)&&(Mo=e,n=1073741823),n={context:e,observedBits:n,next:null},eo===null){if(As===null)throw Error(B(308));eo=n,As.dependencies={lanes:0,firstContext:n,responders:null}}else eo=eo.next=n;return e._currentValue}var Ce=!1;function it(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function $u(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function dn(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function hr(e,n){if(e=e.updateQueue,e!==null){e=e.shared;var o=e.pending;o===null?n.next=n:(n.next=o.next,o.next=n),e.pending=n}}function Qu(e,n){var o=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,o===l)){var u=null,f=null;if(o=o.firstBaseUpdate,o!==null){do{var m={eventTime:o.eventTime,lane:o.lane,tag:o.tag,payload:o.payload,callback:o.callback,next:null};f===null?u=f=m:f=f.next=m,o=o.next}while(o!==null);f===null?u=f=n:f=f.next=n}else u=f=n;o={baseState:l.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:l.shared,effects:l.effects},e.updateQueue=o;return}e=o.lastBaseUpdate,e===null?o.firstBaseUpdate=n:e.next=n,o.lastBaseUpdate=n}function yi(e,n,o,l){var u=e.updateQueue;Ce=!1;var f=u.firstBaseUpdate,m=u.lastBaseUpdate,y=u.shared.pending;if(y!==null){u.shared.pending=null;var E=y,I=E.next;E.next=null,m===null?f=I:m.next=I,m=E;var te=e.alternate;if(te!==null){te=te.updateQueue;var Pe=te.lastBaseUpdate;Pe!==m&&(Pe===null?te.firstBaseUpdate=I:Pe.next=I,te.lastBaseUpdate=E)}}if(f!==null){Pe=u.baseState,m=0,te=I=E=null;do{y=f.lane;var Z=f.eventTime;if((l&y)===y){te!==null&&(te=te.next={eventTime:Z,lane:0,tag:f.tag,payload:f.payload,callback:f.callback,next:null});e:{var fe=e,Te=f;switch(y=n,Z=o,Te.tag){case 1:if(fe=Te.payload,typeof fe=="function"){Pe=fe.call(Z,Pe,y);break e}Pe=fe;break e;case 3:fe.flags=fe.flags&-4097|64;case 0:if(fe=Te.payload,y=typeof fe=="function"?fe.call(Z,Pe,y):fe,y==null)break e;Pe=Ne({},Pe,y);break e;case 2:Ce=!0}}f.callback!==null&&(e.flags|=32,y=u.effects,y===null?u.effects=[f]:y.push(f))}else Z={eventTime:Z,lane:y,tag:f.tag,payload:f.payload,callback:f.callback,next:null},te===null?(I=te=Z,E=Pe):te=te.next=Z,m|=y;if(f=f.next,f===null){if(y=u.shared.pending,y===null)break;f=y.next,y.next=null,u.lastBaseUpdate=y,u.shared.pending=null}}while(!0);te===null&&(E=Pe),u.baseState=E,u.firstBaseUpdate=I,u.lastBaseUpdate=te,Qr|=m,e.lanes=m,e.memoizedState=Pe}}function Ku(e,n,o){if(e=n.effects,n.effects=null,e!==null)for(n=0;n<e.length;n++){var l=e[n],u=l.callback;if(u!==null){if(l.callback=null,l=o,typeof u!="function")throw Error(B(191,u));u.call(l)}}}var Gu=new Rt.Component().refs;function Ls(e,n,o,l){n=e.memoizedState,o=o(l,n),o=o==null?n:Ne({},n,o),e.memoizedState=o,e.lanes===0&&(e.updateQueue.baseState=o)}var js={isMounted:function(e){return(e=e._reactInternals)?cn(e)===e:!1},enqueueSetState:function(e,n,o){e=e._reactInternals;var l=Rn(),u=Rr(e),f=dn(l,u);f.payload=n,o!=null&&(f.callback=o),hr(e,f),lr(e,u,l)},enqueueReplaceState:function(e,n,o){e=e._reactInternals;var l=Rn(),u=Rr(e),f=dn(l,u);f.tag=1,f.payload=n,o!=null&&(f.callback=o),hr(e,f),lr(e,u,l)},enqueueForceUpdate:function(e,n){e=e._reactInternals;var o=Rn(),l=Rr(e),u=dn(o,l);u.tag=2,n!=null&&(u.callback=n),hr(e,u),lr(e,l,o)}};function Yu(e,n,o,l,u,f,m){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,f,m):n.prototype&&n.prototype.isPureReactComponent?!Lr(o,l)||!Lr(u,f):!0}function Ms(e,n,o){var l=!1,u=Br,f=n.contextType;return typeof f=="object"&&f!==null?f=Vn(f):(u=Cn(n)?xr:en.current,l=n.contextTypes,f=(l=l!=null)?qi(e,u):Br),n=new n(o,f),e.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=js,e.stateNode=n,n._reactInternals=e,l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=u,e.__reactInternalMemoizedMaskedChildContext=f),n}function Xu(e,n,o,l){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(o,l),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(o,l),n.state!==e&&js.enqueueReplaceState(n,n.state,null)}function zs(e,n,o,l){var u=e.stateNode;u.props=o,u.state=e.memoizedState,u.refs=Gu,it(e);var f=n.contextType;typeof f=="object"&&f!==null?u.context=Vn(f):(f=Cn(n)?xr:en.current,u.context=qi(e,f)),yi(e,o,u,l),u.state=e.memoizedState,f=n.getDerivedStateFromProps,typeof f=="function"&&(Ls(e,n,f,o),u.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(n=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),n!==u.state&&js.enqueueReplaceState(u,u.state,null),yi(e,o,u,l),u.state=e.memoizedState),typeof u.componentDidMount=="function"&&(e.flags|=4)}var Bs=Array.isArray;function zo(e,n,o){if(e=o.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(o._owner){if(o=o._owner,o){if(o.tag!==1)throw Error(B(309));var l=o.stateNode}if(!l)throw Error(B(147,e));var u=""+e;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===u?n.ref:(n=function(f){var m=l.refs;m===Gu&&(m=l.refs={}),f===null?delete m[u]:m[u]=f},n._stringRef=u,n)}if(typeof e!="string")throw Error(B(284));if(!o._owner)throw Error(B(290,e))}return e}function no(e,n){if(e.type!=="textarea")throw Error(B(31,Object.prototype.toString.call(n)==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":n))}function Bo(e){function n(k,T){if(e){var P=k.lastEffect;P!==null?(P.nextEffect=T,k.lastEffect=T):k.firstEffect=k.lastEffect=T,T.nextEffect=null,T.flags=8}}function o(k,T){if(!e)return null;for(;T!==null;)n(k,T),T=T.sibling;return null}function l(k,T){for(k=new Map;T!==null;)T.key!==null?k.set(T.key,T):k.set(T.index,T),T=T.sibling;return k}function u(k,T){return k=ti(k,T),k.index=0,k.sibling=null,k}function f(k,T,P){return k.index=P,e?(P=k.alternate,P!==null?(P=P.index,P<T?(k.flags=2,T):P):(k.flags=2,T)):T}function m(k){return e&&k.alternate===null&&(k.flags=2),k}function y(k,T,P,L){return T===null||T.tag!==6?(T=gl(P,k.mode,L),T.return=k,T):(T=u(T,P),T.return=k,T)}function E(k,T,P,L){return T!==null&&T.elementType===P.type?(L=u(T,P.props),L.ref=zo(k,T,P),L.return=k,L):(L=wo(P.type,P.key,P.props,null,k.mode,L),L.ref=zo(k,T,P),L.return=k,L)}function I(k,T,P,L){return T===null||T.tag!==4||T.stateNode.containerInfo!==P.containerInfo||T.stateNode.implementation!==P.implementation?(T=rs(P,k.mode,L),T.return=k,T):(T=u(T,P.children||[]),T.return=k,T)}function te(k,T,P,L,z){return T===null||T.tag!==7?(T=ni(P,k.mode,L,z),T.return=k,T):(T=u(T,P),T.return=k,T)}function Pe(k,T,P){if(typeof T=="string"||typeof T=="number")return T=gl(""+T,k.mode,P),T.return=k,T;if(typeof T=="object"&&T!==null){switch(T.$$typeof){case tt:return P=wo(T.type,T.key,T.props,null,k.mode,P),P.ref=zo(k,null,T),P.return=k,P;case W:return T=rs(T,k.mode,P),T.return=k,T}if(Bs(T)||ve(T))return T=ni(T,k.mode,P,null),T.return=k,T;no(k,T)}return null}function Z(k,T,P,L){var z=T!==null?T.key:null;if(typeof P=="string"||typeof P=="number")return z!==null?null:y(k,T,""+P,L);if(typeof P=="object"&&P!==null){switch(P.$$typeof){case tt:return P.key===z?P.type===Be?te(k,T,P.props.children,L,z):E(k,T,P,L):null;case W:return P.key===z?I(k,T,P,L):null}if(Bs(P)||ve(P))return z!==null?null:te(k,T,P,L,null);no(k,P)}return null}function fe(k,T,P,L,z){if(typeof L=="string"||typeof L=="number")return k=k.get(P)||null,y(T,k,""+L,z);if(typeof L=="object"&&L!==null){switch(L.$$typeof){case tt:return k=k.get(L.key===null?P:L.key)||null,L.type===Be?te(T,k,L.props.children,z,L.key):E(T,k,L,z);case W:return k=k.get(L.key===null?P:L.key)||null,I(T,k,L,z)}if(Bs(L)||ve(L))return k=k.get(P)||null,te(T,k,L,z,null);no(T,L)}return null}function Te(k,T,P,L){for(var z=null,ke=null,le=T,Re=T=0,ze=null;le!==null&&Re<P.length;Re++){le.index>Re?(ze=le,le=null):ze=le.sibling;var Ae=Z(k,le,P[Re],L);if(Ae===null){le===null&&(le=ze);break}e&&le&&Ae.alternate===null&&n(k,le),T=f(Ae,T,Re),ke===null?z=Ae:ke.sibling=Ae,ke=Ae,le=ze}if(Re===P.length)return o(k,le),z;if(le===null){for(;Re<P.length;Re++)le=Pe(k,P[Re],L),le!==null&&(T=f(le,T,Re),ke===null?z=le:ke.sibling=le,ke=le);return z}for(le=l(k,le);Re<P.length;Re++)ze=fe(le,k,Re,P[Re],L),ze!==null&&(e&&ze.alternate!==null&&le.delete(ze.key===null?Re:ze.key),T=f(ze,T,Re),ke===null?z=ze:ke.sibling=ze,ke=ze);return e&&le.forEach(function(ar){return n(k,ar)}),z}function ye(k,T,P,L){var z=ve(P);if(typeof z!="function")throw Error(B(150));if(P=z.call(P),P==null)throw Error(B(151));for(var ke=z=null,le=T,Re=T=0,ze=null,Ae=P.next();le!==null&&!Ae.done;Re++,Ae=P.next()){le.index>Re?(ze=le,le=null):ze=le.sibling;var ar=Z(k,le,Ae.value,L);if(ar===null){le===null&&(le=ze);break}e&&le&&ar.alternate===null&&n(k,le),T=f(ar,T,Re),ke===null?z=ar:ke.sibling=ar,ke=ar,le=ze}if(Ae.done)return o(k,le),z;if(le===null){for(;!Ae.done;Re++,Ae=P.next())Ae=Pe(k,Ae.value,L),Ae!==null&&(T=f(Ae,T,Re),ke===null?z=Ae:ke.sibling=Ae,ke=Ae);return z}for(le=l(k,le);!Ae.done;Re++,Ae=P.next())Ae=fe(le,k,Re,Ae.value,L),Ae!==null&&(e&&Ae.alternate!==null&&le.delete(Ae.key===null?Re:Ae.key),T=f(Ae,T,Re),ke===null?z=Ae:ke.sibling=Ae,ke=Ae);return e&&le.forEach(function(id){return n(k,id)}),z}return function(k,T,P,L){var z=typeof P=="object"&&P!==null&&P.type===Be&&P.key===null;z&&(P=P.props.children);var ke=typeof P=="object"&&P!==null;if(ke)switch(P.$$typeof){case tt:e:{for(ke=P.key,z=T;z!==null;){if(z.key===ke){switch(z.tag){case 7:if(P.type===Be){o(k,z.sibling),T=u(z,P.props.children),T.return=k,k=T;break e}break;default:if(z.elementType===P.type){o(k,z.sibling),T=u(z,P.props),T.ref=zo(k,z,P),T.return=k,k=T;break e}}o(k,z);break}else n(k,z);z=z.sibling}P.type===Be?(T=ni(P.props.children,k.mode,L,P.key),T.return=k,k=T):(L=wo(P.type,P.key,P.props,null,k.mode,L),L.ref=zo(k,T,P),L.return=k,k=L)}return m(k);case W:e:{for(z=P.key;T!==null;){if(T.key===z)if(T.tag===4&&T.stateNode.containerInfo===P.containerInfo&&T.stateNode.implementation===P.implementation){o(k,T.sibling),T=u(T,P.children||[]),T.return=k,k=T;break e}else{o(k,T);break}else n(k,T);T=T.sibling}T=rs(P,k.mode,L),T.return=k,k=T}return m(k)}if(typeof P=="string"||typeof P=="number")return P=""+P,T!==null&&T.tag===6?(o(k,T.sibling),T=u(T,P),T.return=k,k=T):(o(k,T),T=gl(P,k.mode,L),T.return=k,k=T),m(k);if(Bs(P))return Te(k,T,P,L);if(ve(P))return ye(k,T,P,L);if(ke&&no(k,P),typeof P>"u"&&!z)switch(k.tag){case 1:case 22:case 0:case 11:case 15:throw Error(B(152,vr(k.type)||"Component"))}return o(k,T)}}var Ur=Bo(!0),ro=Bo(!1),Uo={},Hn=zr(Uo),Zo=zr(Uo),Wo=zr(Uo);function $n(e){if(e===Uo)throw Error(B(174));return e}function Zr(e,n){switch(Dt(Wo,n),Dt(Zo,e),Dt(Hn,Uo),e=n.nodeType,e){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:pt(null,"");break;default:e=e===8?n.parentNode:n,n=e.namespaceURI||null,e=e.tagName,n=pt(n,e)}ht(Hn),Dt(Hn,n)}function io(){ht(Hn),ht(Zo),ht(Wo)}function Us(e){$n(Wo.current);var n=$n(Hn.current),o=pt(n,e.type);n!==o&&(Dt(Zo,e),Dt(Hn,o))}function fa(e){Zo.current===e&&(ht(Hn),ht(Zo))}var At=zr(0);function Wr(e){for(var n=e;n!==null;){if(n.tag===13){var o=n.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||o.data==="$?"||o.data==="$!"))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&64)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Fn=null,Vr=null,Qn=!1;function qu(e,n){var o=jn(5,null,null,0);o.elementType="DELETED",o.type="DELETED",o.stateNode=n,o.return=e,o.flags=8,e.lastEffect!==null?(e.lastEffect.nextEffect=o,e.lastEffect=o):e.firstEffect=e.lastEffect=o}function Ju(e,n){switch(e.tag){case 5:var o=e.type;return n=n.nodeType!==1||o.toLowerCase()!==n.nodeName.toLowerCase()?null:n,n!==null?(e.stateNode=n,!0):!1;case 6:return n=e.pendingProps===""||n.nodeType!==3?null:n,n!==null?(e.stateNode=n,!0):!1;case 13:return!1;default:return!1}}function Ct(e){if(Qn){var n=Vr;if(n){var o=n;if(!Ju(e,n)){if(n=Gi(o.nextSibling),!n||!Ju(e,n)){e.flags=e.flags&-1025|2,Qn=!1,Fn=e;return}qu(Fn,o)}Fn=e,Vr=Gi(n.firstChild)}else e.flags=e.flags&-1025|2,Qn=!1,Fn=e}}function Pt(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Fn=e}function Zs(e){if(e!==Fn)return!1;if(!Qn)return Pt(e),Qn=!0,!1;var n=e.type;if(e.tag!==5||n!=="head"&&n!=="body"&&!na(n,e.memoizedProps))for(n=Vr;n;)qu(e,n),n=Gi(n.nextSibling);if(Pt(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(317));e:{for(e=e.nextSibling,n=0;e;){if(e.nodeType===8){var o=e.data;if(o==="/$"){if(n===0){Vr=Gi(e.nextSibling);break e}n--}else o!=="$"&&o!=="$!"&&o!=="$?"||n++}e=e.nextSibling}Vr=null}}else Vr=Fn?Gi(e.stateNode.nextSibling):null;return!0}function Vo(){Vr=Fn=null,Qn=!1}var oo=[];function Ws(){for(var e=0;e<oo.length;e++)oo[e]._workInProgressVersionPrimary=null;oo.length=0}var Ho=Me.ReactCurrentDispatcher,Kn=Me.ReactCurrentBatchConfig,vi=0,jt=null,Se=null,lt=null,so=!1,at=!1;function Pn(){throw Error(B(321))}function pa(e,n){if(n===null)return!1;for(var o=0;o<n.length&&o<e.length;o++)if(!Tn(e[o],n[o]))return!1;return!0}function ec(e,n,o,l,u,f){if(vi=f,jt=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,Ho.current=e===null||e.memoizedState===null?rc:Sa,e=o(l,u),at){f=0;do{if(at=!1,!(25>f))throw Error(B(301));f+=1,lt=Se=null,n.updateQueue=null,Ho.current=Ea,e=o(l,u)}while(at)}if(Ho.current=or,n=Se!==null&&Se.next!==null,vi=0,lt=Se=jt=null,so=!1,n)throw Error(B(300));return e}function wi(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lt===null?jt.memoizedState=lt=e:lt=lt.next=e,lt}function ue(){if(Se===null){var e=jt.alternate;e=e!==null?e.memoizedState:null}else e=Se.next;var n=lt===null?jt.memoizedState:lt.next;if(n!==null)lt=n,Se=e;else{if(e===null)throw Error(B(310));Se=e,e={memoizedState:Se.memoizedState,baseState:Se.baseState,baseQueue:Se.baseQueue,queue:Se.queue,next:null},lt===null?jt.memoizedState=lt=e:lt=lt.next=e}return lt}function ir(e,n){return typeof n=="function"?n(e):n}function lo(e){var n=ue(),o=n.queue;if(o===null)throw Error(B(311));o.lastRenderedReducer=e;var l=Se,u=l.baseQueue,f=o.pending;if(f!==null){if(u!==null){var m=u.next;u.next=f.next,f.next=m}l.baseQueue=u=f,o.pending=null}if(u!==null){u=u.next,l=l.baseState;var y=m=f=null,E=u;do{var I=E.lane;if((vi&I)===I)y!==null&&(y=y.next={lane:0,action:E.action,eagerReducer:E.eagerReducer,eagerState:E.eagerState,next:null}),l=E.eagerReducer===e?E.eagerState:e(l,E.action);else{var te={lane:I,action:E.action,eagerReducer:E.eagerReducer,eagerState:E.eagerState,next:null};y===null?(m=y=te,f=l):y=y.next=te,jt.lanes|=I,Qr|=I}E=E.next}while(E!==null&&E!==u);y===null?f=l:y.next=m,Tn(l,n.memoizedState)||(gt=!0),n.memoizedState=l,n.baseState=f,n.baseQueue=y,o.lastRenderedState=l}return[n.memoizedState,o.dispatch]}function ao(e){var n=ue(),o=n.queue;if(o===null)throw Error(B(311));o.lastRenderedReducer=e;var l=o.dispatch,u=o.pending,f=n.memoizedState;if(u!==null){o.pending=null;var m=u=u.next;do f=e(f,m.action),m=m.next;while(m!==u);Tn(f,n.memoizedState)||(gt=!0),n.memoizedState=f,n.baseQueue===null&&(n.baseState=f),o.lastRenderedState=f}return[f,l]}function $o(e,n,o){var l=n._getVersion;l=l(n._source);var u=n._workInProgressVersionPrimary;if(u!==null?e=u===l:(e=e.mutableReadLanes,(e=(vi&e)===e)&&(n._workInProgressVersionPrimary=l,oo.push(n))),e)return o(n._source);throw oo.push(n),Error(B(350))}function Vs(e,n,o,l){var u=vn;if(u===null)throw Error(B(349));var f=n._getVersion,m=f(n._source),y=Ho.current,E=y.useState(function(){return $o(u,n,o)}),I=E[1],te=E[0];E=lt;var Pe=e.memoizedState,Z=Pe.refs,fe=Z.getSnapshot,Te=Pe.source;Pe=Pe.subscribe;var ye=jt;return e.memoizedState={refs:Z,source:n,subscribe:l},y.useEffect(function(){Z.getSnapshot=o,Z.setSnapshot=I;var k=f(n._source);if(!Tn(m,k)){k=o(n._source),Tn(te,k)||(I(k),k=Rr(ye),u.mutableReadLanes|=k&u.pendingLanes),k=u.mutableReadLanes,u.entangledLanes|=k;for(var T=u.entanglements,P=k;0<P;){var L=31-_r(P),z=1<<L;T[L]|=k,P&=~z}}},[o,n,l]),y.useEffect(function(){return l(n._source,function(){var k=Z.getSnapshot,T=Z.setSnapshot;try{T(k(n._source));var P=Rr(ye);u.mutableReadLanes|=P&u.pendingLanes}catch(L){T(function(){throw L})}})},[n,l]),Tn(fe,o)&&Tn(Te,n)&&Tn(Pe,l)||(e={pending:null,dispatch:null,lastRenderedReducer:ir,lastRenderedState:te},e.dispatch=I=sn.bind(null,jt,e),E.queue=e,E.baseQueue=null,te=$o(u,n,o),E.memoizedState=E.baseState=te),te}function ha(e,n,o){var l=ue();return Vs(l,e,n,o)}function Qo(e){var n=wi();return typeof e=="function"&&(e=e()),n.memoizedState=n.baseState=e,e=n.queue={pending:null,dispatch:null,lastRenderedReducer:ir,lastRenderedState:e},e=e.dispatch=sn.bind(null,jt,e),[n.memoizedState,e]}function Hr(e,n,o,l){return e={tag:e,create:n,destroy:o,deps:l,next:null},n=jt.updateQueue,n===null?(n={lastEffect:null},jt.updateQueue=n,n.lastEffect=e.next=e):(o=n.lastEffect,o===null?n.lastEffect=e.next=e:(l=o.next,o.next=e,e.next=l,n.lastEffect=e)),e}function uo(e){var n=wi();return e={current:e},n.memoizedState=e}function Hs(){return ue().memoizedState}function $s(e,n,o,l){var u=wi();jt.flags|=e,u.memoizedState=Hr(1|n,o,void 0,l===void 0?null:l)}function ma(e,n,o,l){var u=ue();l=l===void 0?null:l;var f=void 0;if(Se!==null){var m=Se.memoizedState;if(f=m.destroy,l!==null&&pa(l,m.deps)){Hr(n,o,f,l);return}}jt.flags|=e,u.memoizedState=Hr(1|n,o,f,l)}function tc(e,n){return $s(516,4,e,n)}function Ko(e,n){return ma(516,4,e,n)}function ga(e,n){return ma(4,2,e,n)}function ya(e,n){if(typeof n=="function")return e=e(),n(e),function(){n(null)};if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function nc(e,n,o){return o=o!=null?o.concat([e]):null,ma(4,2,ya.bind(null,n,e),o)}function va(){}function wa(e,n){var o=ue();n=n===void 0?null:n;var l=o.memoizedState;return l!==null&&n!==null&&pa(n,l[1])?l[0]:(o.memoizedState=[e,n],e)}function _a(e,n){var o=ue();n=n===void 0?null:n;var l=o.memoizedState;return l!==null&&n!==null&&pa(n,l[1])?l[0]:(e=e(),o.memoizedState=[e,n],e)}function td(e,n){var o=on();Cr(98>o?98:o,function(){e(!0)}),Cr(97<o?97:o,function(){var l=Kn.transition;Kn.transition=1;try{e(!1),n()}finally{Kn.transition=l}})}function sn(e,n,o){var l=Rn(),u=Rr(e),f={lane:u,action:o,eagerReducer:null,eagerState:null,next:null},m=n.pending;if(m===null?f.next=f:(f.next=m.next,m.next=f),n.pending=f,m=e.alternate,e===jt||m!==null&&m===jt)at=so=!0;else{if(e.lanes===0&&(m===null||m.lanes===0)&&(m=n.lastRenderedReducer,m!==null))try{var y=n.lastRenderedState,E=m(y,o);if(f.eagerReducer=m,f.eagerState=E,Tn(E,y))return}catch{}lr(e,u,l)}}var or={readContext:Vn,useCallback:Pn,useContext:Pn,useEffect:Pn,useImperativeHandle:Pn,useLayoutEffect:Pn,useMemo:Pn,useReducer:Pn,useRef:Pn,useState:Pn,useDebugValue:Pn,useDeferredValue:Pn,useTransition:Pn,useMutableSource:Pn,useOpaqueIdentifier:Pn,unstable_isNewReconciler:!1},rc={readContext:Vn,useCallback:function(e,n){return wi().memoizedState=[e,n===void 0?null:n],e},useContext:Vn,useEffect:tc,useImperativeHandle:function(e,n,o){return o=o!=null?o.concat([e]):null,$s(4,2,ya.bind(null,n,e),o)},useLayoutEffect:function(e,n){return $s(4,2,e,n)},useMemo:function(e,n){var o=wi();return n=n===void 0?null:n,e=e(),o.memoizedState=[e,n],e},useReducer:function(e,n,o){var l=wi();return n=o!==void 0?o(n):n,l.memoizedState=l.baseState=n,e=l.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},e=e.dispatch=sn.bind(null,jt,e),[l.memoizedState,e]},useRef:uo,useState:Qo,useDebugValue:va,useDeferredValue:function(e){var n=Qo(e),o=n[0],l=n[1];return tc(function(){var u=Kn.transition;Kn.transition=1;try{l(e)}finally{Kn.transition=u}},[e]),o},useTransition:function(){var e=Qo(!1),n=e[0];return e=td.bind(null,e[1]),uo(e),[e,n]},useMutableSource:function(e,n,o){var l=wi();return l.memoizedState={refs:{getSnapshot:n,setSnapshot:null},source:e,subscribe:o},Vs(l,e,n,o)},useOpaqueIdentifier:function(){if(Qn){var e=!1,n=Xc(function(){throw e||(e=!0,o("r:"+(ra++).toString(36))),Error(B(355))}),o=Qo(n)[1];return(jt.mode&2)===0&&(jt.flags|=516,Hr(5,function(){o("r:"+(ra++).toString(36))},void 0,null)),n}return n="r:"+(ra++).toString(36),Qo(n),n},unstable_isNewReconciler:!1},Sa={readContext:Vn,useCallback:wa,useContext:Vn,useEffect:Ko,useImperativeHandle:nc,useLayoutEffect:ga,useMemo:_a,useReducer:lo,useRef:Hs,useState:function(){return lo(ir)},useDebugValue:va,useDeferredValue:function(e){var n=lo(ir),o=n[0],l=n[1];return Ko(function(){var u=Kn.transition;Kn.transition=1;try{l(e)}finally{Kn.transition=u}},[e]),o},useTransition:function(){var e=lo(ir)[0];return[Hs().current,e]},useMutableSource:ha,useOpaqueIdentifier:function(){return lo(ir)[0]},unstable_isNewReconciler:!1},Ea={readContext:Vn,useCallback:wa,useContext:Vn,useEffect:Ko,useImperativeHandle:nc,useLayoutEffect:ga,useMemo:_a,useReducer:ao,useRef:Hs,useState:function(){return ao(ir)},useDebugValue:va,useDeferredValue:function(e){var n=ao(ir),o=n[0],l=n[1];return Ko(function(){var u=Kn.transition;Kn.transition=1;try{l(e)}finally{Kn.transition=u}},[e]),o},useTransition:function(){var e=ao(ir)[0];return[Hs().current,e]},useMutableSource:ha,useOpaqueIdentifier:function(){return ao(ir)[0]},unstable_isNewReconciler:!1},ic=Me.ReactCurrentOwner,gt=!1;function fn(e,n,o,l){n.child=e===null?ro(n,null,o,l):Ur(n,e.child,o,l)}function Ta(e,n,o,l,u){o=o.render;var f=n.ref;return to(n,u),l=ec(e,n,o,l,f,u),e!==null&&!gt?(n.updateQueue=e.updateQueue,n.flags&=-517,e.lanes&=~u,sr(e,n,u)):(n.flags|=1,fn(e,n,l,u),n.child)}function oc(e,n,o,l,u,f){if(e===null){var m=o.type;return typeof m=="function"&&!ml(m)&&m.defaultProps===void 0&&o.compare===null&&o.defaultProps===void 0?(n.tag=15,n.type=m,sc(e,n,m,l,u,f)):(e=wo(o.type,null,l,n,n.mode,f),e.ref=n.ref,e.return=n,n.child=e)}return m=e.child,(u&f)===0&&(u=m.memoizedProps,o=o.compare,o=o!==null?o:Lr,o(u,l)&&e.ref===n.ref)?sr(e,n,f):(n.flags|=1,e=ti(m,l),e.ref=n.ref,e.return=n,n.child=e)}function sc(e,n,o,l,u,f){if(e!==null&&Lr(e.memoizedProps,l)&&e.ref===n.ref)if(gt=!1,(f&u)!==0)(e.flags&16384)!==0&&(gt=!0);else return n.lanes=e.lanes,sr(e,n,f);return Qs(e,n,o,l,f)}function xa(e,n,o){var l=n.pendingProps,u=l.children,f=e!==null?e.memoizedState:null;if(l.mode==="hidden"||l.mode==="unstable-defer-without-hiding")if((n.mode&4)===0)n.memoizedState={baseLanes:0},dl(n,o);else if((o&1073741824)!==0)n.memoizedState={baseLanes:0},dl(n,f!==null?f.baseLanes:o);else return e=f!==null?f.baseLanes|o:o,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:e},dl(n,e),null;else f!==null?(l=f.baseLanes|o,n.memoizedState=null):l=o,dl(n,l);return fn(e,n,u,o),n.child}function Ca(e,n){var o=n.ref;(e===null&&o!==null||e!==null&&e.ref!==o)&&(n.flags|=128)}function Qs(e,n,o,l,u){var f=Cn(o)?xr:en.current;return f=qi(n,f),to(n,u),o=ec(e,n,o,l,f,u),e!==null&&!gt?(n.updateQueue=e.updateQueue,n.flags&=-517,e.lanes&=~u,sr(e,n,u)):(n.flags|=1,fn(e,n,o,u),n.child)}function Pa(e,n,o,l,u){if(Cn(o)){var f=!0;Ji(n)}else f=!1;if(to(n,u),n.stateNode===null)e!==null&&(e.alternate=null,n.alternate=null,n.flags|=2),Ms(n,o,l),zs(n,o,l,u),l=!0;else if(e===null){var m=n.stateNode,y=n.memoizedProps;m.props=y;var E=m.context,I=o.contextType;typeof I=="object"&&I!==null?I=Vn(I):(I=Cn(o)?xr:en.current,I=qi(n,I));var te=o.getDerivedStateFromProps,Pe=typeof te=="function"||typeof m.getSnapshotBeforeUpdate=="function";Pe||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(y!==l||E!==I)&&Xu(n,m,l,I),Ce=!1;var Z=n.memoizedState;m.state=Z,yi(n,l,m,u),E=n.memoizedState,y!==l||Z!==E||xn.current||Ce?(typeof te=="function"&&(Ls(n,o,te,l),E=n.memoizedState),(y=Ce||Yu(n,o,y,l,Z,E,I))?(Pe||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(n.flags|=4)):(typeof m.componentDidMount=="function"&&(n.flags|=4),n.memoizedProps=l,n.memoizedState=E),m.props=l,m.state=E,m.context=I,l=y):(typeof m.componentDidMount=="function"&&(n.flags|=4),l=!1)}else{m=n.stateNode,$u(e,n),y=n.memoizedProps,I=n.type===n.elementType?y:An(n.type,y),m.props=I,Pe=n.pendingProps,Z=m.context,E=o.contextType,typeof E=="object"&&E!==null?E=Vn(E):(E=Cn(o)?xr:en.current,E=qi(n,E));var fe=o.getDerivedStateFromProps;(te=typeof fe=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(y!==Pe||Z!==E)&&Xu(n,m,l,E),Ce=!1,Z=n.memoizedState,m.state=Z,yi(n,l,m,u);var Te=n.memoizedState;y!==Pe||Z!==Te||xn.current||Ce?(typeof fe=="function"&&(Ls(n,o,fe,l),Te=n.memoizedState),(I=Ce||Yu(n,o,I,l,Z,Te,E))?(te||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(l,Te,E),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(l,Te,E)),typeof m.componentDidUpdate=="function"&&(n.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(n.flags|=256)):(typeof m.componentDidUpdate!="function"||y===e.memoizedProps&&Z===e.memoizedState||(n.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&Z===e.memoizedState||(n.flags|=256),n.memoizedProps=l,n.memoizedState=Te),m.props=l,m.state=Te,m.context=E,l=I):(typeof m.componentDidUpdate!="function"||y===e.memoizedProps&&Z===e.memoizedState||(n.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&Z===e.memoizedState||(n.flags|=256),l=!1)}return ka(e,n,o,l,f,u)}function ka(e,n,o,l,u,f){Ca(e,n);var m=(n.flags&64)!==0;if(!l&&!m)return u&&ju(n,o,!1),sr(e,n,f);l=n.stateNode,ic.current=n;var y=m&&typeof o.getDerivedStateFromError!="function"?null:l.render();return n.flags|=1,e!==null&&m?(n.child=Ur(n,e.child,null,f),n.child=Ur(n,null,y,f)):fn(e,n,y,f),n.memoizedState=l.state,u&&ju(n,o,!0),n.child}function pn(e){var n=e.stateNode;n.pendingContext?ia(e,n.pendingContext,n.pendingContext!==n.context):n.context&&ia(e,n.context,!1),Zr(e,n.containerInfo)}var Go={dehydrated:null,retryLane:0};function Ra(e,n,o){var l=n.pendingProps,u=At.current,f=!1,m;return(m=(n.flags&64)!==0)||(m=e!==null&&e.memoizedState===null?!1:(u&2)!==0),m?(f=!0,n.flags&=-65):e!==null&&e.memoizedState===null||l.fallback===void 0||l.unstable_avoidThisFallback===!0||(u|=1),Dt(At,u&1),e===null?(l.fallback!==void 0&&Ct(n),e=l.children,u=l.fallback,f?(e=Ks(n,e,u,o),n.child.memoizedState={baseLanes:o},n.memoizedState=Go,e):typeof l.unstable_expectedLoadTime=="number"?(e=Ks(n,e,u,o),n.child.memoizedState={baseLanes:o},n.memoizedState=Go,n.lanes=33554432,e):(o=ns({mode:"visible",children:e},n.mode,o,null),o.return=n,n.child=o)):e.memoizedState!==null?f?(l=ba(e,n,l.children,l.fallback,o),f=n.child,u=e.child.memoizedState,f.memoizedState=u===null?{baseLanes:o}:{baseLanes:u.baseLanes|o},f.childLanes=e.childLanes&~o,n.memoizedState=Go,l):(o=lc(e,n,l.children,o),n.memoizedState=null,o):f?(l=ba(e,n,l.children,l.fallback,o),f=n.child,u=e.child.memoizedState,f.memoizedState=u===null?{baseLanes:o}:{baseLanes:u.baseLanes|o},f.childLanes=e.childLanes&~o,n.memoizedState=Go,l):(o=lc(e,n,l.children,o),n.memoizedState=null,o)}function Ks(e,n,o,l){var u=e.mode,f=e.child;return n={mode:"hidden",children:n},(u&2)===0&&f!==null?(f.childLanes=0,f.pendingProps=n):f=ns(n,u,0,null),o=ni(o,u,l,null),f.return=e,o.return=e,f.sibling=o,e.child=f,o}function lc(e,n,o,l){var u=e.child;return e=u.sibling,o=ti(u,{mode:"visible",children:o}),(n.mode&2)===0&&(o.lanes=l),o.return=n,o.sibling=null,e!==null&&(e.nextEffect=null,e.flags=8,n.firstEffect=n.lastEffect=e),n.child=o}function ba(e,n,o,l,u){var f=n.mode,m=e.child;e=m.sibling;var y={mode:"hidden",children:o};return(f&2)===0&&n.child!==m?(o=n.child,o.childLanes=0,o.pendingProps=y,m=o.lastEffect,m!==null?(n.firstEffect=o.firstEffect,n.lastEffect=m,m.nextEffect=null):n.firstEffect=n.lastEffect=null):o=ti(m,y),e!==null?l=ti(e,l):(l=ni(l,f,u,null),l.flags|=2),l.return=n,o.return=n,o.sibling=l,n.child=o,l}function Yo(e,n){e.lanes|=n;var o=e.alternate;o!==null&&(o.lanes|=n),Fs(e.return,n)}function Pr(e,n,o,l,u,f){var m=e.memoizedState;m===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:l,tail:o,tailMode:u,lastEffect:f}:(m.isBackwards=n,m.rendering=null,m.renderingStartTime=0,m.last=l,m.tail=o,m.tailMode=u,m.lastEffect=f)}function mr(e,n,o){var l=n.pendingProps,u=l.revealOrder,f=l.tail;if(fn(e,n,l.children,o),l=At.current,(l&2)!==0)l=l&1|2,n.flags|=64;else{if(e!==null&&(e.flags&64)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Yo(e,o);else if(e.tag===19)Yo(e,o);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}l&=1}if(Dt(At,l),(n.mode&2)===0)n.memoizedState=null;else switch(u){case"forwards":for(o=n.child,u=null;o!==null;)e=o.alternate,e!==null&&Wr(e)===null&&(u=o),o=o.sibling;o=u,o===null?(u=n.child,n.child=null):(u=o.sibling,o.sibling=null),Pr(n,!1,u,o,f,n.lastEffect);break;case"backwards":for(o=null,u=n.child,n.child=null;u!==null;){if(e=u.alternate,e!==null&&Wr(e)===null){n.child=u;break}e=u.sibling,u.sibling=o,o=u,u=e}Pr(n,!0,o,null,f,n.lastEffect);break;case"together":Pr(n,!1,null,null,void 0,n.lastEffect);break;default:n.memoizedState=null}return n.child}function sr(e,n,o){if(e!==null&&(n.dependencies=e.dependencies),Qr|=n.lanes,(o&n.childLanes)!==0){if(e!==null&&n.child!==e.child)throw Error(B(153));if(n.child!==null){for(e=n.child,o=ti(e,e.pendingProps),n.child=o,o.return=n;e.sibling!==null;)e=e.sibling,o=o.sibling=ti(e,e.pendingProps),o.return=n;o.sibling=null}return n.child}return null}var Gs,Ys,Xs,qs;Gs=function(e,n){for(var o=n.child;o!==null;){if(o.tag===5||o.tag===6)e.appendChild(o.stateNode);else if(o.tag!==4&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===n)break;for(;o.sibling===null;){if(o.return===null||o.return===n)return;o=o.return}o.sibling.return=o.return,o=o.sibling}},Ys=function(){},Xs=function(e,n,o,l){var u=e.memoizedProps;if(u!==l){e=n.stateNode,$n(Hn.current);var f=null;switch(o){case"input":u=bi(e,u),l=bi(e,l),f=[];break;case"option":u=$(e,u),l=$(e,l),f=[];break;case"select":u=Ne({},u,{value:void 0}),l=Ne({},l,{value:void 0}),f=[];break;case"textarea":u=H(e,u),l=H(e,l),f=[];break;default:typeof u.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=Ps)}$e(o,l);var m;o=null;for(I in u)if(!l.hasOwnProperty(I)&&u.hasOwnProperty(I)&&u[I]!=null)if(I==="style"){var y=u[I];for(m in y)y.hasOwnProperty(m)&&(o||(o={}),o[m]="")}else I!=="dangerouslySetInnerHTML"&&I!=="children"&&I!=="suppressContentEditableWarning"&&I!=="suppressHydrationWarning"&&I!=="autoFocus"&&(_t.hasOwnProperty(I)?f||(f=[]):(f=f||[]).push(I,null));for(I in l){var E=l[I];if(y=u?.[I],l.hasOwnProperty(I)&&E!==y&&(E!=null||y!=null))if(I==="style")if(y){for(m in y)!y.hasOwnProperty(m)||E&&E.hasOwnProperty(m)||(o||(o={}),o[m]="");for(m in E)E.hasOwnProperty(m)&&y[m]!==E[m]&&(o||(o={}),o[m]=E[m])}else o||(f||(f=[]),f.push(I,o)),o=E;else I==="dangerouslySetInnerHTML"?(E=E?E.__html:void 0,y=y?y.__html:void 0,E!=null&&y!==E&&(f=f||[]).push(I,E)):I==="children"?typeof E!="string"&&typeof E!="number"||(f=f||[]).push(I,""+E):I!=="suppressContentEditableWarning"&&I!=="suppressHydrationWarning"&&(_t.hasOwnProperty(I)?(E!=null&&I==="onScroll"&&wt("scroll",e),f||y===E||(f=[])):typeof E=="object"&&E!==null&&E.$$typeof===F?E.toString():(f=f||[]).push(I,E))}o&&(f=f||[]).push("style",o);var I=f;(n.updateQueue=I)&&(n.flags|=4)}},qs=function(e,n,o,l){o!==l&&(n.flags|=4)};function _i(e,n){if(!Qn)switch(e.tailMode){case"hidden":n=e.tail;for(var o=null;n!==null;)n.alternate!==null&&(o=n),n=n.sibling;o===null?e.tail=null:o.sibling=null;break;case"collapsed":o=e.tail;for(var l=null;o!==null;)o.alternate!==null&&(l=o),o=o.sibling;l===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function Ia(e,n,o){var l=n.pendingProps;switch(n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:return Cn(n.type)&&Ao(),null;case 3:return io(),ht(xn),ht(en),Ws(),l=n.stateNode,l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Zs(n)?n.flags|=4:l.hydrate||(n.flags|=256)),Ys(n),null;case 5:fa(n);var u=$n(Wo.current);if(o=n.type,e!==null&&n.stateNode!=null)Xs(e,n,o,l,u),e.ref!==n.ref&&(n.flags|=128);else{if(!l){if(n.stateNode===null)throw Error(B(166));return null}if(e=$n(Hn.current),Zs(n)){l=n.stateNode,o=n.type;var f=n.memoizedProps;switch(l[Tr]=n,l[bs]=f,o){case"dialog":wt("cancel",l),wt("close",l);break;case"iframe":case"object":case"embed":wt("load",l);break;case"video":case"audio":for(e=0;e<gi.length;e++)wt(gi[e],l);break;case"source":wt("error",l);break;case"img":case"image":case"link":wt("error",l),wt("load",l);break;case"details":wt("toggle",l);break;case"input":w(l,f),wt("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!f.multiple},wt("invalid",l);break;case"textarea":q(l,f),wt("invalid",l)}$e(o,f),e=null;for(var m in f)f.hasOwnProperty(m)&&(u=f[m],m==="children"?typeof u=="string"?l.textContent!==u&&(e=["children",u]):typeof u=="number"&&l.textContent!==""+u&&(e=["children",""+u]):_t.hasOwnProperty(m)&&u!=null&&m==="onScroll"&&wt("scroll",l));switch(o){case"input":J(l),_(l,f,!0);break;case"textarea":J(l),be(l);break;case"select":case"option":break;default:typeof f.onClick=="function"&&(l.onclick=Ps)}l=e,n.updateQueue=l,l!==null&&(n.flags|=4)}else{switch(m=u.nodeType===9?u:u.ownerDocument,e===ft.html&&(e=We(o)),e===ft.html?o==="script"?(e=m.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=m.createElement(o,{is:l.is}):(e=m.createElement(o),o==="select"&&(m=e,l.multiple?m.multiple=!0:l.size&&(m.size=l.size))):e=m.createElementNS(e,o),e[Tr]=n,e[bs]=l,Gs(e,n,!1,!1),n.stateNode=e,m=Sn(o,l),o){case"dialog":wt("cancel",e),wt("close",e),u=l;break;case"iframe":case"object":case"embed":wt("load",e),u=l;break;case"video":case"audio":for(u=0;u<gi.length;u++)wt(gi[u],e);u=l;break;case"source":wt("error",e),u=l;break;case"img":case"image":case"link":wt("error",e),wt("load",e),u=l;break;case"details":wt("toggle",e),u=l;break;case"input":w(e,l),u=bi(e,l),wt("invalid",e);break;case"option":u=$(e,l);break;case"select":e._wrapperState={wasMultiple:!!l.multiple},u=Ne({},l,{value:void 0}),wt("invalid",e);break;case"textarea":q(e,l),u=H(e,l),wt("invalid",e);break;default:u=l}$e(o,u);var y=u;for(f in y)if(y.hasOwnProperty(f)){var E=y[f];f==="style"?qe(e,E):f==="dangerouslySetInnerHTML"?(E=E?E.__html:void 0,E!=null&&Ue(e,E)):f==="children"?typeof E=="string"?(o!=="textarea"||E!=="")&&Le(e,E):typeof E=="number"&&Le(e,""+E):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(_t.hasOwnProperty(f)?E!=null&&f==="onScroll"&&wt("scroll",e):E!=null&&Ie(e,f,E,m))}switch(o){case"input":J(e),_(e,l,!1);break;case"textarea":J(e),be(e);break;case"option":l.value!=null&&e.setAttribute("value",""+_n(l.value));break;case"select":e.multiple=!!l.multiple,f=l.value,f!=null?K(e,!!l.multiple,f,!1):l.defaultValue!=null&&K(e,!!l.multiple,l.defaultValue,!0);break;default:typeof u.onClick=="function"&&(e.onclick=Ps)}Nu(o,l)&&(n.flags|=4)}n.ref!==null&&(n.flags|=128)}return null;case 6:if(e&&n.stateNode!=null)qs(e,n,e.memoizedProps,l);else{if(typeof l!="string"&&n.stateNode===null)throw Error(B(166));o=$n(Wo.current),$n(Hn.current),Zs(n)?(l=n.stateNode,o=n.memoizedProps,l[Tr]=n,l.nodeValue!==o&&(n.flags|=4)):(l=(o.nodeType===9?o:o.ownerDocument).createTextNode(l),l[Tr]=n,n.stateNode=l)}return null;case 13:return ht(At),l=n.memoizedState,(n.flags&64)!==0?(n.lanes=o,n):(l=l!==null,o=!1,e===null?n.memoizedProps.fallback!==void 0&&Zs(n):o=e.memoizedState!==null,l&&!o&&(n.mode&2)!==0&&(e===null&&n.memoizedProps.unstable_avoidThisFallback!==!0||(At.current&1)!==0?kt===0&&(kt=3):((kt===0||kt===3)&&(kt=4),vn===null||(Qr&134217727)===0&&(kr&134217727)===0||yo(vn,hn))),(l||o)&&(n.flags|=4),null);case 4:return io(),Ys(n),e===null&&$i(n.stateNode.containerInfo),null;case 10:return da(n),null;case 17:return Cn(n.type)&&Ao(),null;case 19:if(ht(At),l=n.memoizedState,l===null)return null;if(f=(n.flags&64)!==0,m=l.rendering,m===null)if(f)_i(l,!1);else{if(kt!==0||e!==null&&(e.flags&64)!==0)for(e=n.child;e!==null;){if(m=Wr(e),m!==null){for(n.flags|=64,_i(l,!1),f=m.updateQueue,f!==null&&(n.updateQueue=f,n.flags|=4),l.lastEffect===null&&(n.firstEffect=null),n.lastEffect=l.lastEffect,l=o,o=n.child;o!==null;)f=o,e=l,f.flags&=2,f.nextEffect=null,f.firstEffect=null,f.lastEffect=null,m=f.alternate,m===null?(f.childLanes=0,f.lanes=e,f.child=null,f.memoizedProps=null,f.memoizedState=null,f.updateQueue=null,f.dependencies=null,f.stateNode=null):(f.childLanes=m.childLanes,f.lanes=m.lanes,f.child=m.child,f.memoizedProps=m.memoizedProps,f.memoizedState=m.memoizedState,f.updateQueue=m.updateQueue,f.type=m.type,e=m.dependencies,f.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),o=o.sibling;return Dt(At,At.current&1|2),n.child}e=e.sibling}l.tail!==null&&mt()>ll&&(n.flags|=64,f=!0,_i(l,!1),n.lanes=33554432)}else{if(!f)if(e=Wr(m),e!==null){if(n.flags|=64,f=!0,o=e.updateQueue,o!==null&&(n.updateQueue=o,n.flags|=4),_i(l,!0),l.tail===null&&l.tailMode==="hidden"&&!m.alternate&&!Qn)return n=n.lastEffect=l.lastEffect,n!==null&&(n.nextEffect=null),null}else 2*mt()-l.renderingStartTime>ll&&o!==1073741824&&(n.flags|=64,f=!0,_i(l,!1),n.lanes=33554432);l.isBackwards?(m.sibling=n.child,n.child=m):(o=l.last,o!==null?o.sibling=m:n.child=m,l.last=m)}return l.tail!==null?(o=l.tail,l.rendering=o,l.tail=o.sibling,l.lastEffect=n.lastEffect,l.renderingStartTime=mt(),o.sibling=null,n=At.current,Dt(At,f?n&1|2:n&1),o):null;case 23:case 24:return Ba(),e!==null&&e.memoizedState!==null!=(n.memoizedState!==null)&&l.mode!=="unstable-defer-without-hiding"&&(n.flags|=4),null}throw Error(B(156,n.tag))}function Js(e){switch(e.tag){case 1:Cn(e.type)&&Ao();var n=e.flags;return n&4096?(e.flags=n&-4097|64,e):null;case 3:if(io(),ht(xn),ht(en),Ws(),n=e.flags,(n&64)!==0)throw Error(B(285));return e.flags=n&-4097|64,e;case 5:return fa(e),null;case 13:return ht(At),n=e.flags,n&4096?(e.flags=n&-4097|64,e):null;case 19:return ht(At),null;case 4:return io(),null;case 10:return da(e),null;case 23:case 24:return Ba(),null;default:return null}}function Oa(e,n){try{var o="",l=n;do o+=us(l),l=l.return;while(l);var u=o}catch(f){u=`
|
|
41
|
+
Error generating stack: `+f.message+`
|
|
42
|
+
`+f.stack}return{value:e,source:n,stack:u}}function Na(e,n){try{console.error(n.value)}catch(o){setTimeout(function(){throw o})}}var ac=typeof WeakMap=="function"?WeakMap:Map;function Da(e,n,o){o=dn(-1,o),o.tag=3,o.payload={element:null};var l=n.value;return o.callback=function(){ts||(ts=!0,al=l),Na(e,n)},o}function yn(e,n,o){o=dn(-1,o),o.tag=3;var l=e.type.getDerivedStateFromError;if(typeof l=="function"){var u=n.value;o.payload=function(){return Na(e,n),l(u)}}var f=e.stateNode;return f!==null&&typeof f.componentDidCatch=="function"&&(o.callback=function(){typeof l!="function"&&(Gn===null?Gn=new Set([this]):Gn.add(this),Na(e,n));var m=n.stack;this.componentDidCatch(n.value,{componentStack:m!==null?m:""})}),o}var uc=typeof WeakSet=="function"?WeakSet:Set;function el(e){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(o){ei(e,o)}else n.current=null}function Yt(e,n){switch(n.tag){case 0:case 11:case 15:case 22:return;case 1:if(n.flags&256&&e!==null){var o=e.memoizedProps,l=e.memoizedState;e=n.stateNode,n=e.getSnapshotBeforeUpdate(n.elementType===n.type?o:An(n.type,o),l),e.__reactInternalSnapshotBeforeUpdate=n}return;case 3:n.flags&256&&Gt(n.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(B(163))}function cc(e,n,o){switch(o.tag){case 0:case 11:case 15:case 22:if(n=o.updateQueue,n=n!==null?n.lastEffect:null,n!==null){e=n=n.next;do{if((e.tag&3)===3){var l=e.create;e.destroy=l()}e=e.next}while(e!==n)}if(n=o.updateQueue,n=n!==null?n.lastEffect:null,n!==null){e=n=n.next;do{var u=e;l=u.next,u=u.tag,(u&4)!==0&&(u&1)!==0&&(gc(o,e),Jr(o,e)),e=l}while(e!==n)}return;case 1:e=o.stateNode,o.flags&4&&(n===null?e.componentDidMount():(l=o.elementType===o.type?n.memoizedProps:An(o.type,n.memoizedProps),e.componentDidUpdate(l,n.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),n=o.updateQueue,n!==null&&Ku(o,n,e);return;case 3:if(n=o.updateQueue,n!==null){if(e=null,o.child!==null)switch(o.child.tag){case 5:e=o.child.stateNode;break;case 1:e=o.child.stateNode}Ku(o,n,e)}return;case 5:e=o.stateNode,n===null&&o.flags&4&&Nu(o.type,o.memoizedProps)&&e.focus();return;case 6:return;case 4:return;case 12:return;case 13:o.memoizedState===null&&(o=o.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&Ja(o))));return;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(B(163))}function tl(e,n){for(var o=e;;){if(o.tag===5){var l=o.stateNode;if(n)l=l.style,typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none";else{l=o.stateNode;var u=o.memoizedProps.style;u=u!=null&&u.hasOwnProperty("display")?u.display:null,l.style.display=je("display",u)}}else if(o.tag===6)o.stateNode.nodeValue=n?"":o.memoizedProps;else if((o.tag!==23&&o.tag!==24||o.memoizedState===null||o===e)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===e)break;for(;o.sibling===null;){if(o.return===null||o.return===e)return;o=o.return}o.sibling.return=o.return,o=o.sibling}}function Ye(e,n){if(fr&&typeof fr.onCommitFiberUnmount=="function")try{fr.onCommitFiberUnmount(oa,n)}catch{}switch(n.tag){case 0:case 11:case 14:case 15:case 22:if(e=n.updateQueue,e!==null&&(e=e.lastEffect,e!==null)){var o=e=e.next;do{var l=o,u=l.destroy;if(l=l.tag,u!==void 0)if((l&4)!==0)gc(n,o);else{l=n;try{u()}catch(f){ei(l,f)}}o=o.next}while(o!==e)}break;case 1:if(el(n),e=n.stateNode,typeof e.componentWillUnmount=="function")try{e.props=n.memoizedProps,e.state=n.memoizedState,e.componentWillUnmount()}catch(f){ei(n,f)}break;case 5:el(n);break;case 4:Si(e,n)}}function nl(e){e.alternate=null,e.child=null,e.dependencies=null,e.firstEffect=null,e.lastEffect=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.return=null,e.updateQueue=null}function Aa(e){return e.tag===5||e.tag===3||e.tag===4}function Xo(e){e:{for(var n=e.return;n!==null;){if(Aa(n))break e;n=n.return}throw Error(B(160))}var o=n;switch(n=o.stateNode,o.tag){case 5:var l=!1;break;case 3:n=n.containerInfo,l=!0;break;case 4:n=n.containerInfo,l=!0;break;default:throw Error(B(161))}o.flags&16&&(Le(n,""),o.flags&=-17);e:t:for(o=e;;){for(;o.sibling===null;){if(o.return===null||Aa(o.return)){o=null;break e}o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.flags&2||o.child===null||o.tag===4)continue t;o.child.return=o,o=o.child}if(!(o.flags&2)){o=o.stateNode;break e}}l?qo(e,o,n):rl(e,o,n)}function qo(e,n,o){var l=e.tag,u=l===5||l===6;if(u)e=u?e.stateNode:e.stateNode.instance,n?o.nodeType===8?o.parentNode.insertBefore(e,n):o.insertBefore(e,n):(o.nodeType===8?(n=o.parentNode,n.insertBefore(e,o)):(n=o,n.appendChild(e)),o=o._reactRootContainer,o!=null||n.onclick!==null||(n.onclick=Ps));else if(l!==4&&(e=e.child,e!==null))for(qo(e,n,o),e=e.sibling;e!==null;)qo(e,n,o),e=e.sibling}function rl(e,n,o){var l=e.tag,u=l===5||l===6;if(u)e=u?e.stateNode:e.stateNode.instance,n?o.insertBefore(e,n):o.appendChild(e);else if(l!==4&&(e=e.child,e!==null))for(rl(e,n,o),e=e.sibling;e!==null;)rl(e,n,o),e=e.sibling}function Si(e,n){for(var o=n,l=!1,u,f;;){if(!l){l=o.return;e:for(;;){if(l===null)throw Error(B(160));switch(u=l.stateNode,l.tag){case 5:f=!1;break e;case 3:u=u.containerInfo,f=!0;break e;case 4:u=u.containerInfo,f=!0;break e}l=l.return}l=!0}if(o.tag===5||o.tag===6){e:for(var m=e,y=o,E=y;;)if(Ye(m,E),E.child!==null&&E.tag!==4)E.child.return=E,E=E.child;else{if(E===y)break e;for(;E.sibling===null;){if(E.return===null||E.return===y)break e;E=E.return}E.sibling.return=E.return,E=E.sibling}f?(m=u,y=o.stateNode,m.nodeType===8?m.parentNode.removeChild(y):m.removeChild(y)):u.removeChild(o.stateNode)}else if(o.tag===4){if(o.child!==null){u=o.stateNode.containerInfo,f=!0,o.child.return=o,o=o.child;continue}}else if(Ye(e,o),o.child!==null){o.child.return=o,o=o.child;continue}if(o===n)break;for(;o.sibling===null;){if(o.return===null||o.return===n)return;o=o.return,o.tag===4&&(l=!1)}o.sibling.return=o.return,o=o.sibling}}function co(e,n){switch(n.tag){case 0:case 11:case 14:case 15:case 22:var o=n.updateQueue;if(o=o!==null?o.lastEffect:null,o!==null){var l=o=o.next;do(l.tag&3)===3&&(e=l.destroy,l.destroy=void 0,e!==void 0&&e()),l=l.next;while(l!==o)}return;case 1:return;case 5:if(o=n.stateNode,o!=null){l=n.memoizedProps;var u=e!==null?e.memoizedProps:l;e=n.type;var f=n.updateQueue;if(n.updateQueue=null,f!==null){for(o[bs]=l,e==="input"&&l.type==="radio"&&l.name!=null&&S(o,l),Sn(e,u),n=Sn(e,l),u=0;u<f.length;u+=2){var m=f[u],y=f[u+1];m==="style"?qe(o,y):m==="dangerouslySetInnerHTML"?Ue(o,y):m==="children"?Le(o,y):Ie(o,m,y,n)}switch(e){case"input":b(o,l);break;case"textarea":Oe(o,l);break;case"select":e=o._wrapperState.wasMultiple,o._wrapperState.wasMultiple=!!l.multiple,f=l.value,f!=null?K(o,!!l.multiple,f,!1):e!==!!l.multiple&&(l.defaultValue!=null?K(o,!!l.multiple,l.defaultValue,!0):K(o,!!l.multiple,l.multiple?[]:"",!1))}}}return;case 6:if(n.stateNode===null)throw Error(B(162));n.stateNode.nodeValue=n.memoizedProps;return;case 3:o=n.stateNode,o.hydrate&&(o.hydrate=!1,Ja(o.containerInfo));return;case 12:return;case 13:n.memoizedState!==null&&(sl=mt(),tl(n.child,!0)),il(n);return;case 19:il(n);return;case 17:return;case 23:case 24:tl(n,n.memoizedState!==null);return}throw Error(B(163))}function il(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var o=e.stateNode;o===null&&(o=e.stateNode=new uc),n.forEach(function(l){var u=wc.bind(null,e,l);o.has(l)||(o.add(l),l.then(u,u))})}}function dc(e,n){return e!==null&&(e=e.memoizedState,e===null||e.dehydrated!==null)?(n=n.memoizedState,n!==null&&n.dehydrated===null):!1}var Fa=Math.ceil,Jo=Me.ReactCurrentDispatcher,La=Me.ReactCurrentOwner,Ee=0,vn=null,Xt=null,hn=0,Ei=0,ja=zr(0),kt=0,es=null,$r=0,Qr=0,kr=0,ol=0,fo=null,sl=0,ll=1/0;function Kr(){ll=mt()+500}var re=null,ts=!1,al=null,Gn=null,Ln=!1,Gr=null,Ti=90,ul=[],po=[],kn=null,Yr=0,Xr=null,ho=-1,Yn=0,tn=0,mo=null,go=!1;function Rn(){return(Ee&48)!==0?mt():ho!==-1?ho:ho=mt()}function Rr(e){if(e=e.mode,(e&2)===0)return 1;if((e&4)===0)return on()===99?1:2;if(Yn===0&&(Yn=$r),Hu.transition!==0){tn!==0&&(tn=fo!==null?fo.pendingLanes:0),e=Yn;var n=4186112&~tn;return n&=-n,n===0&&(e=4186112&~e,n=e&-e,n===0&&(n=8192)),n}return e=on(),(Ee&4)!==0&&e===98?e=x(12,Yn):(e=Bc(e),e=x(e,Yn)),e}function lr(e,n,o){if(50<Yr)throw Yr=0,Xr=null,Error(B(185));if(e=qr(e,n),e===null)return null;ms(e,n,o),e===vn&&(kr|=n,kt===4&&yo(e,hn));var l=on();n===1?(Ee&8)!==0&&(Ee&48)===0?za(e):(bn(e,o),Ee===0&&(Kr(),pr())):((Ee&4)===0||l!==98&&l!==99||(kn===null?kn=new Set([e]):kn.add(e)),bn(e,o)),fo=e}function qr(e,n){e.lanes|=n;var o=e.alternate;for(o!==null&&(o.lanes|=n),o=e,e=e.return;e!==null;)e.childLanes|=n,o=e.alternate,o!==null&&(o.childLanes|=n),o=e,e=e.return;return o.tag===3?o.stateNode:null}function bn(e,n){for(var o=e.callbackNode,l=e.suspendedLanes,u=e.pingedLanes,f=e.expirationTimes,m=e.pendingLanes;0<m;){var y=31-_r(m),E=1<<y,I=f[y];if(I===-1){if((E&l)===0||(E&u)!==0){I=n,pi(E);var te=vt;f[y]=10<=te?I+250:6<=te?I+5e3:-1}}else I<=n&&(e.expiredLanes|=E);m&=~E}if(l=xo(e,e===vn?hn:0),n=vt,l===0)o!==null&&(o!==Ns&&Fo(o),e.callbackNode=null,e.callbackPriority=0);else{if(o!==null){if(e.callbackPriority===n)return;o!==Ns&&Fo(o)}n===15?(o=za.bind(null,e),rr===null?(rr=[o],Lo=sa(Is,Vu)):rr.push(o),o=Ns):n===14?o=jo(99,za.bind(null,e)):(o=Uc(n),o=jo(o,Ma.bind(null,e))),e.callbackPriority=n,e.callbackNode=o}}function Ma(e){if(ho=-1,tn=Yn=0,(Ee&48)!==0)throw Error(B(327));var n=e.callbackNode;if(Zt()&&e.callbackNode!==n)return null;var o=xo(e,e===vn?hn:0);if(o===0)return null;var l=o,u=Ee;Ee|=16;var f=Ua();(vn!==e||hn!==l)&&(Kr(),xi(e,l));do try{hc();break}catch(y){pc(e,y)}while(!0);if(ca(),Jo.current=f,Ee=u,Xt!==null?l=0:(vn=null,hn=0,l=kt),($r&kr)!==0)xi(e,0);else if(l!==0){if(l===2&&(Ee|=64,e.hydrate&&(e.hydrate=!1,Gt(e.containerInfo)),o=su(e),o!==0&&(l=vo(e,o))),l===1)throw n=es,xi(e,0),yo(e,o),bn(e,mt()),n;switch(e.finishedWork=e.current.alternate,e.finishedLanes=o,l){case 0:case 1:throw Error(B(345));case 2:br(e);break;case 3:if(yo(e,o),(o&62914560)===o&&(l=sl+500-mt(),10<l)){if(xo(e,0)!==0)break;if(u=e.suspendedLanes,(u&o)!==o){Rn(),e.pingedLanes|=e.suspendedLanes&u;break}e.timeoutHandle=Du(br.bind(null,e),l);break}br(e);break;case 4:if(yo(e,o),(o&4186112)===o)break;for(l=e.eventTimes,u=-1;0<o;){var m=31-_r(o);f=1<<m,m=l[m],m>u&&(u=m),o&=~f}if(o=u,o=mt()-o,o=(120>o?120:480>o?480:1080>o?1080:1920>o?1920:3e3>o?3e3:4320>o?4320:1960*Fa(o/1960))-o,10<o){e.timeoutHandle=Du(br.bind(null,e),o);break}br(e);break;case 5:br(e);break;default:throw Error(B(329))}}return bn(e,mt()),e.callbackNode===n?Ma.bind(null,e):null}function yo(e,n){for(n&=~ol,n&=~kr,e.suspendedLanes|=n,e.pingedLanes&=~n,e=e.expirationTimes;0<n;){var o=31-_r(n),l=1<<o;e[o]=-1,n&=~l}}function za(e){if((Ee&48)!==0)throw Error(B(327));if(Zt(),e===vn&&(e.expiredLanes&hn)!==0){var n=hn,o=vo(e,n);($r&kr)!==0&&(n=xo(e,n),o=vo(e,n))}else n=xo(e,0),o=vo(e,n);if(e.tag!==0&&o===2&&(Ee|=64,e.hydrate&&(e.hydrate=!1,Gt(e.containerInfo)),n=su(e),n!==0&&(o=vo(e,n))),o===1)throw o=es,xi(e,0),yo(e,n),bn(e,mt()),o;return e.finishedWork=e.current.alternate,e.finishedLanes=n,br(e),bn(e,mt()),null}function nd(){if(kn!==null){var e=kn;kn=null,e.forEach(function(n){n.expiredLanes|=24&n.pendingLanes,bn(n,mt())})}pr()}function fc(e,n){var o=Ee;Ee|=1;try{return e(n)}finally{Ee=o,Ee===0&&(Kr(),pr())}}function cl(e,n){var o=Ee;Ee&=-2,Ee|=8;try{return e(n)}finally{Ee=o,Ee===0&&(Kr(),pr())}}function dl(e,n){Dt(ja,Ei),Ei|=n,$r|=n}function Ba(){Ei=ja.current,ht(ja)}function xi(e,n){e.finishedWork=null,e.finishedLanes=0;var o=e.timeoutHandle;if(o!==-1&&(e.timeoutHandle=-1,Kt(o)),Xt!==null)for(o=Xt.return;o!==null;){var l=o;switch(l.tag){case 1:l=l.type.childContextTypes,l!=null&&Ao();break;case 3:io(),ht(xn),ht(en),Ws();break;case 5:fa(l);break;case 4:io();break;case 13:ht(At);break;case 19:ht(At);break;case 10:da(l);break;case 23:case 24:Ba()}o=o.return}vn=e,Xt=ti(e.current,null),hn=Ei=$r=n,kt=0,es=null,ol=kr=Qr=0}function pc(e,n){do{var o=Xt;try{if(ca(),Ho.current=or,so){for(var l=jt.memoizedState;l!==null;){var u=l.queue;u!==null&&(u.pending=null),l=l.next}so=!1}if(vi=0,lt=Se=jt=null,at=!1,La.current=null,o===null||o.return===null){kt=1,es=n,Xt=null;break}e:{var f=e,m=o.return,y=o,E=n;if(n=hn,y.flags|=2048,y.firstEffect=y.lastEffect=null,E!==null&&typeof E=="object"&&typeof E.then=="function"){var I=E;if((y.mode&2)===0){var te=y.alternate;te?(y.updateQueue=te.updateQueue,y.memoizedState=te.memoizedState,y.lanes=te.lanes):(y.updateQueue=null,y.memoizedState=null)}var Pe=(At.current&1)!==0,Z=m;do{var fe;if(fe=Z.tag===13){var Te=Z.memoizedState;if(Te!==null)fe=Te.dehydrated!==null;else{var ye=Z.memoizedProps;fe=ye.fallback===void 0?!1:ye.unstable_avoidThisFallback!==!0?!0:!Pe}}if(fe){var k=Z.updateQueue;if(k===null){var T=new Set;T.add(I),Z.updateQueue=T}else k.add(I);if((Z.mode&2)===0){if(Z.flags|=64,y.flags|=16384,y.flags&=-2981,y.tag===1)if(y.alternate===null)y.tag=17;else{var P=dn(-1,1);P.tag=2,hr(y,P)}y.lanes|=1;break e}E=void 0,y=n;var L=f.pingCache;if(L===null?(L=f.pingCache=new ac,E=new Set,L.set(I,E)):(E=L.get(I),E===void 0&&(E=new Set,L.set(I,E))),!E.has(y)){E.add(y);var z=vc.bind(null,f,I,y);I.then(z,z)}Z.flags|=4096,Z.lanes=n;break e}Z=Z.return}while(Z!==null);E=Error((vr(y.type)||"A React component")+` suspended while rendering, but no fallback UI was specified.
|
|
43
|
+
|
|
44
|
+
Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`)}kt!==5&&(kt=2),E=Oa(E,y),Z=m;do{switch(Z.tag){case 3:f=E,Z.flags|=4096,n&=-n,Z.lanes|=n;var ke=Da(Z,f,n);Qu(Z,ke);break e;case 1:f=E;var le=Z.type,Re=Z.stateNode;if((Z.flags&64)===0&&(typeof le.getDerivedStateFromError=="function"||Re!==null&&typeof Re.componentDidCatch=="function"&&(Gn===null||!Gn.has(Re)))){Z.flags|=4096,n&=-n,Z.lanes|=n;var ze=yn(Z,f,n);Qu(Z,ze);break e}}Z=Z.return}while(Z!==null)}fl(o)}catch(Ae){n=Ae,Xt===o&&o!==null&&(Xt=o=o.return);continue}break}while(!0)}function Ua(){var e=Jo.current;return Jo.current=or,e===null?or:e}function vo(e,n){var o=Ee;Ee|=16;var l=Ua();vn===e&&hn===n||xi(e,n);do try{rd();break}catch(u){pc(e,u)}while(!0);if(ca(),Ee=o,Jo.current=l,Xt!==null)throw Error(B(261));return vn=null,hn=0,kt}function rd(){for(;Xt!==null;)Za(Xt)}function hc(){for(;Xt!==null&&!qc();)Za(Xt)}function Za(e){var n=Va(e.alternate,e,Ei);e.memoizedProps=e.pendingProps,n===null?fl(e):Xt=n,La.current=null}function fl(e){var n=e;do{var o=n.alternate;if(e=n.return,(n.flags&2048)===0){if(o=Ia(o,n,Ei),o!==null){Xt=o;return}if(o=n,o.tag!==24&&o.tag!==23||o.memoizedState===null||(Ei&1073741824)!==0||(o.mode&4)===0){for(var l=0,u=o.child;u!==null;)l|=u.lanes|u.childLanes,u=u.sibling;o.childLanes=l}e!==null&&(e.flags&2048)===0&&(e.firstEffect===null&&(e.firstEffect=n.firstEffect),n.lastEffect!==null&&(e.lastEffect!==null&&(e.lastEffect.nextEffect=n.firstEffect),e.lastEffect=n.lastEffect),1<n.flags&&(e.lastEffect!==null?e.lastEffect.nextEffect=n:e.firstEffect=n,e.lastEffect=n))}else{if(o=Js(n),o!==null){o.flags&=2047,Xt=o;return}e!==null&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}if(n=n.sibling,n!==null){Xt=n;return}Xt=n=e}while(n!==null);kt===0&&(kt=5)}function br(e){var n=on();return Cr(99,pl.bind(null,e,n)),null}function pl(e,n){do Zt();while(Gr!==null);if((Ee&48)!==0)throw Error(B(327));var o=e.finishedWork;if(o===null)return null;if(e.finishedWork=null,e.finishedLanes=0,o===e.current)throw Error(B(177));e.callbackNode=null;var l=o.lanes|o.childLanes,u=l,f=e.pendingLanes&~u;e.pendingLanes=u,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=u,e.mutableReadLanes&=u,e.entangledLanes&=u,u=e.entanglements;for(var m=e.eventTimes,y=e.expirationTimes;0<f;){var E=31-_r(f),I=1<<E;u[E]=0,m[E]=-1,y[E]=-1,f&=~I}if(kn!==null&&(l&24)===0&&kn.has(e)&&kn.delete(e),e===vn&&(Xt=vn=null,hn=0),1<o.flags?o.lastEffect!==null?(o.lastEffect.nextEffect=o,l=o.firstEffect):l=o:l=o.firstEffect,l!==null){if(u=Ee,Ee|=32,La.current=null,ks=gs,m=bu(),Io(m)){if("selectionStart"in m)y={start:m.selectionStart,end:m.selectionEnd};else e:if(y=(y=m.ownerDocument)&&y.defaultView||window,(I=y.getSelection&&y.getSelection())&&I.rangeCount!==0){y=I.anchorNode,f=I.anchorOffset,E=I.focusNode,I=I.focusOffset;try{y.nodeType,E.nodeType}catch{y=null;break e}var te=0,Pe=-1,Z=-1,fe=0,Te=0,ye=m,k=null;t:for(;;){for(var T;ye!==y||f!==0&&ye.nodeType!==3||(Pe=te+f),ye!==E||I!==0&&ye.nodeType!==3||(Z=te+I),ye.nodeType===3&&(te+=ye.nodeValue.length),(T=ye.firstChild)!==null;)k=ye,ye=T;for(;;){if(ye===m)break t;if(k===y&&++fe===f&&(Pe=te),k===E&&++Te===I&&(Z=te),(T=ye.nextSibling)!==null)break;ye=k,k=ye.parentNode}ye=T}y=Pe===-1||Z===-1?null:{start:Pe,end:Z}}else y=null;y=y||{start:0,end:0}}else y=null;ta={focusedElem:m,selectionRange:y},gs=!1,mo=null,go=!1,re=l;do try{mc()}catch(Ae){if(re===null)throw Error(B(330));ei(re,Ae),re=re.nextEffect}while(re!==null);mo=null,re=l;do try{for(m=e;re!==null;){var P=re.flags;if(P&16&&Le(re.stateNode,""),P&128){var L=re.alternate;if(L!==null){var z=L.ref;z!==null&&(typeof z=="function"?z(null):z.current=null)}}switch(P&1038){case 2:Xo(re),re.flags&=-3;break;case 6:Xo(re),re.flags&=-3,co(re.alternate,re);break;case 1024:re.flags&=-1025;break;case 1028:re.flags&=-1025,co(re.alternate,re);break;case 4:co(re.alternate,re);break;case 8:y=re,Si(m,y);var ke=y.alternate;nl(y),ke!==null&&nl(ke)}re=re.nextEffect}}catch(Ae){if(re===null)throw Error(B(330));ei(re,Ae),re=re.nextEffect}while(re!==null);if(z=ta,L=bu(),P=z.focusedElem,m=z.selectionRange,L!==P&&P&&P.ownerDocument&&bo(P.ownerDocument.documentElement,P)){for(m!==null&&Io(P)&&(L=m.start,z=m.end,z===void 0&&(z=L),"selectionStart"in P?(P.selectionStart=L,P.selectionEnd=Math.min(z,P.value.length)):(z=(L=P.ownerDocument||document)&&L.defaultView||window,z.getSelection&&(z=z.getSelection(),y=P.textContent.length,ke=Math.min(m.start,y),m=m.end===void 0?ke:Math.min(m.end,y),!z.extend&&ke>m&&(y=m,m=ke,ke=y),y=Es(P,ke),f=Es(P,m),y&&f&&(z.rangeCount!==1||z.anchorNode!==y.node||z.anchorOffset!==y.offset||z.focusNode!==f.node||z.focusOffset!==f.offset)&&(L=L.createRange(),L.setStart(y.node,y.offset),z.removeAllRanges(),ke>m?(z.addRange(L),z.extend(f.node,f.offset)):(L.setEnd(f.node,f.offset),z.addRange(L)))))),L=[],z=P;z=z.parentNode;)z.nodeType===1&&L.push({element:z,left:z.scrollLeft,top:z.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<L.length;P++)z=L[P],z.element.scrollLeft=z.left,z.element.scrollTop=z.top}gs=!!ks,ta=ks=null,e.current=o,re=l;do try{for(P=e;re!==null;){var le=re.flags;if(le&36&&cc(P,re.alternate,re),le&128){L=void 0;var Re=re.ref;if(Re!==null){var ze=re.stateNode;re.tag,L=ze,typeof Re=="function"?Re(L):Re.current=L}}re=re.nextEffect}}catch(Ae){if(re===null)throw Error(B(330));ei(re,Ae),re=re.nextEffect}while(re!==null);re=null,ed(),Ee=u}else e.current=o;if(Ln)Ln=!1,Gr=e,Ti=n;else for(re=l;re!==null;)n=re.nextEffect,re.nextEffect=null,re.flags&8&&(le=re,le.sibling=null,le.stateNode=null),re=n;if(l=e.pendingLanes,l===0&&(Gn=null),l===1?e===Xr?Yr++:(Yr=0,Xr=e):Yr=0,o=o.stateNode,fr&&typeof fr.onCommitFiberRoot=="function")try{fr.onCommitFiberRoot(oa,o,void 0,(o.current.flags&64)===64)}catch{}if(bn(e,mt()),ts)throw ts=!1,e=al,al=null,e;return(Ee&8)!==0||pr(),null}function mc(){for(;re!==null;){var e=re.alternate;go||mo===null||((re.flags&8)!==0?Ni(re,mo)&&(go=!0):re.tag===13&&dc(e,re)&&Ni(re,mo)&&(go=!0));var n=re.flags;(n&256)!==0&&Yt(e,re),(n&512)===0||Ln||(Ln=!0,jo(97,function(){return Zt(),null})),re=re.nextEffect}}function Zt(){if(Ti!==90){var e=97<Ti?97:Ti;return Ti=90,Cr(e,yc)}return!1}function Jr(e,n){ul.push(n,e),Ln||(Ln=!0,jo(97,function(){return Zt(),null}))}function gc(e,n){po.push(n,e),Ln||(Ln=!0,jo(97,function(){return Zt(),null}))}function yc(){if(Gr===null)return!1;var e=Gr;if(Gr=null,(Ee&48)!==0)throw Error(B(331));var n=Ee;Ee|=32;var o=po;po=[];for(var l=0;l<o.length;l+=2){var u=o[l],f=o[l+1],m=u.destroy;if(u.destroy=void 0,typeof m=="function")try{m()}catch(E){if(f===null)throw Error(B(330));ei(f,E)}}for(o=ul,ul=[],l=0;l<o.length;l+=2){u=o[l],f=o[l+1];try{var y=u.create;u.destroy=y()}catch(E){if(f===null)throw Error(B(330));ei(f,E)}}for(y=e.current.firstEffect;y!==null;)e=y.nextEffect,y.nextEffect=null,y.flags&8&&(y.sibling=null,y.stateNode=null),y=e;return Ee=n,pr(),!0}function Wa(e,n,o){n=Oa(o,n),n=Da(e,n,1),hr(e,n),n=Rn(),e=qr(e,1),e!==null&&(ms(e,1,n),bn(e,n))}function ei(e,n){if(e.tag===3)Wa(e,e,n);else for(var o=e.return;o!==null;){if(o.tag===3){Wa(o,e,n);break}else if(o.tag===1){var l=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Gn===null||!Gn.has(l))){e=Oa(n,e);var u=yn(o,e,1);if(hr(o,u),u=Rn(),o=qr(o,1),o!==null)ms(o,1,u),bn(o,u);else if(typeof l.componentDidCatch=="function"&&(Gn===null||!Gn.has(l)))try{l.componentDidCatch(n,e)}catch{}break}}o=o.return}}function vc(e,n,o){var l=e.pingCache;l!==null&&l.delete(n),n=Rn(),e.pingedLanes|=e.suspendedLanes&o,vn===e&&(hn&o)===o&&(kt===4||kt===3&&(hn&62914560)===hn&&500>mt()-sl?xi(e,0):ol|=o),bn(e,n)}function wc(e,n){var o=e.stateNode;o!==null&&o.delete(n),n=0,n===0&&(n=e.mode,(n&2)===0?n=1:(n&4)===0?n=on()===99?1:2:(Yn===0&&(Yn=$r),n=Fr(62914560&~Yn),n===0&&(n=4194304))),o=Rn(),e=qr(e,n),e!==null&&(ms(e,n,o),bn(e,o))}var Va;Va=function(e,n,o){var l=n.lanes;if(e!==null)if(e.memoizedProps!==n.pendingProps||xn.current)gt=!0;else if((o&l)!==0)gt=(e.flags&16384)!==0;else{switch(gt=!1,n.tag){case 3:pn(n),Vo();break;case 5:Us(n);break;case 1:Cn(n.type)&&Ji(n);break;case 4:Zr(n,n.stateNode.containerInfo);break;case 10:l=n.memoizedProps.value;var u=n.type._context;Dt(Ds,u._currentValue),u._currentValue=l;break;case 13:if(n.memoizedState!==null)return(o&n.child.childLanes)!==0?Ra(e,n,o):(Dt(At,At.current&1),n=sr(e,n,o),n!==null?n.sibling:null);Dt(At,At.current&1);break;case 19:if(l=(o&n.childLanes)!==0,(e.flags&64)!==0){if(l)return mr(e,n,o);n.flags|=64}if(u=n.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),Dt(At,At.current),l)break;return null;case 23:case 24:return n.lanes=0,xa(e,n,o)}return sr(e,n,o)}else gt=!1;switch(n.lanes=0,n.tag){case 2:if(l=n.type,e!==null&&(e.alternate=null,n.alternate=null,n.flags|=2),e=n.pendingProps,u=qi(n,en.current),to(n,o),u=ec(null,n,l,e,u,o),n.flags|=1,typeof u=="object"&&u!==null&&typeof u.render=="function"&&u.$$typeof===void 0){if(n.tag=1,n.memoizedState=null,n.updateQueue=null,Cn(l)){var f=!0;Ji(n)}else f=!1;n.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,it(n);var m=l.getDerivedStateFromProps;typeof m=="function"&&Ls(n,l,m,e),u.updater=js,n.stateNode=u,u._reactInternals=n,zs(n,l,e,o),n=ka(null,n,l,!0,f,o)}else n.tag=0,fn(null,n,u,o),n=n.child;return n;case 16:u=n.elementType;e:{switch(e!==null&&(e.alternate=null,n.alternate=null,n.flags|=2),e=n.pendingProps,f=u._init,u=f(u._payload),n.type=u,f=n.tag=Ha(u),e=An(u,e),f){case 0:n=Qs(null,n,u,e,o);break e;case 1:n=Pa(null,n,u,e,o);break e;case 11:n=Ta(null,n,u,e,o);break e;case 14:n=oc(null,n,u,An(u.type,e),l,o);break e}throw Error(B(306,u,""))}return n;case 0:return l=n.type,u=n.pendingProps,u=n.elementType===l?u:An(l,u),Qs(e,n,l,u,o);case 1:return l=n.type,u=n.pendingProps,u=n.elementType===l?u:An(l,u),Pa(e,n,l,u,o);case 3:if(pn(n),l=n.updateQueue,e===null||l===null)throw Error(B(282));if(l=n.pendingProps,u=n.memoizedState,u=u!==null?u.element:null,$u(e,n),yi(n,l,null,o),l=n.memoizedState.element,l===u)Vo(),n=sr(e,n,o);else{if(u=n.stateNode,(f=u.hydrate)&&(Vr=Gi(n.stateNode.containerInfo.firstChild),Fn=n,f=Qn=!0),f){if(e=u.mutableSourceEagerHydrationData,e!=null)for(u=0;u<e.length;u+=2)f=e[u],f._workInProgressVersionPrimary=e[u+1],oo.push(f);for(o=ro(n,null,l,o),n.child=o;o;)o.flags=o.flags&-3|1024,o=o.sibling}else fn(e,n,l,o),Vo();n=n.child}return n;case 5:return Us(n),e===null&&Ct(n),l=n.type,u=n.pendingProps,f=e!==null?e.memoizedProps:null,m=u.children,na(l,u)?m=null:f!==null&&na(l,f)&&(n.flags|=16),Ca(e,n),fn(e,n,m,o),n.child;case 6:return e===null&&Ct(n),null;case 13:return Ra(e,n,o);case 4:return Zr(n,n.stateNode.containerInfo),l=n.pendingProps,e===null?n.child=Ur(n,null,l,o):fn(e,n,l,o),n.child;case 11:return l=n.type,u=n.pendingProps,u=n.elementType===l?u:An(l,u),Ta(e,n,l,u,o);case 7:return fn(e,n,n.pendingProps,o),n.child;case 8:return fn(e,n,n.pendingProps.children,o),n.child;case 12:return fn(e,n,n.pendingProps.children,o),n.child;case 10:e:{l=n.type._context,u=n.pendingProps,m=n.memoizedProps,f=u.value;var y=n.type._context;if(Dt(Ds,y._currentValue),y._currentValue=f,m!==null)if(y=m.value,f=Tn(y,f)?0:(typeof l._calculateChangedBits=="function"?l._calculateChangedBits(y,f):1073741823)|0,f===0){if(m.children===u.children&&!xn.current){n=sr(e,n,o);break e}}else for(y=n.child,y!==null&&(y.return=n);y!==null;){var E=y.dependencies;if(E!==null){m=y.child;for(var I=E.firstContext;I!==null;){if(I.context===l&&(I.observedBits&f)!==0){y.tag===1&&(I=dn(-1,o&-o),I.tag=2,hr(y,I)),y.lanes|=o,I=y.alternate,I!==null&&(I.lanes|=o),Fs(y.return,o),E.lanes|=o;break}I=I.next}}else m=y.tag===10&&y.type===n.type?null:y.child;if(m!==null)m.return=y;else for(m=y;m!==null;){if(m===n){m=null;break}if(y=m.sibling,y!==null){y.return=m.return,m=y;break}m=m.return}y=m}fn(e,n,u.children,o),n=n.child}return n;case 9:return u=n.type,f=n.pendingProps,l=f.children,to(n,o),u=Vn(u,f.unstable_observedBits),l=l(u),n.flags|=1,fn(e,n,l,o),n.child;case 14:return u=n.type,f=An(u,n.pendingProps),f=An(u.type,f),oc(e,n,u,f,l,o);case 15:return sc(e,n,n.type,n.pendingProps,l,o);case 17:return l=n.type,u=n.pendingProps,u=n.elementType===l?u:An(l,u),e!==null&&(e.alternate=null,n.alternate=null,n.flags|=2),n.tag=1,Cn(l)?(e=!0,Ji(n)):e=!1,to(n,o),Ms(n,l,u),zs(n,l,u,o),ka(null,n,l,!0,e,o);case 19:return mr(e,n,o);case 23:return xa(e,n,o);case 24:return xa(e,n,o)}throw Error(B(156,n.tag))};function hl(e,n,o,l){this.tag=e,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function jn(e,n,o,l){return new hl(e,n,o,l)}function ml(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ha(e){if(typeof e=="function")return ml(e)?1:0;if(e!=null){if(e=e.$$typeof,e===se)return 11;if(e===ge)return 14}return 2}function ti(e,n){var o=e.alternate;return o===null?(o=jn(e.tag,n,e.key,e.mode),o.elementType=e.elementType,o.type=e.type,o.stateNode=e.stateNode,o.alternate=e,e.alternate=o):(o.pendingProps=n,o.type=e.type,o.flags=0,o.nextEffect=null,o.firstEffect=null,o.lastEffect=null),o.childLanes=e.childLanes,o.lanes=e.lanes,o.child=e.child,o.memoizedProps=e.memoizedProps,o.memoizedState=e.memoizedState,o.updateQueue=e.updateQueue,n=e.dependencies,o.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},o.sibling=e.sibling,o.index=e.index,o.ref=e.ref,o}function wo(e,n,o,l,u,f){var m=2;if(l=e,typeof e=="function")ml(e)&&(m=1);else if(typeof e=="string")m=5;else e:switch(e){case Be:return ni(o.children,u,f,n);case A:m=8,u|=16;break;case Ve:m=8,u|=1;break;case de:return e=jn(12,o,n,u|8),e.elementType=de,e.type=de,e.lanes=f,e;case we:return e=jn(13,o,n,u),e.type=we,e.elementType=we,e.lanes=f,e;case ee:return e=jn(19,o,n,u),e.elementType=ee,e.lanes=f,e;case Y:return ns(o,u,f,n);case Q:return e=jn(24,o,n,u),e.elementType=Q,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case pe:m=10;break e;case ne:m=9;break e;case se:m=11;break e;case ge:m=14;break e;case C:m=16,l=null;break e;case V:m=22;break e}throw Error(B(130,e==null?e:typeof e,""))}return n=jn(m,o,n,u),n.elementType=e,n.type=l,n.lanes=f,n}function ni(e,n,o,l){return e=jn(7,e,l,n),e.lanes=o,e}function ns(e,n,o,l){return e=jn(23,e,l,n),e.elementType=Y,e.lanes=o,e}function gl(e,n,o){return e=jn(6,e,null,n),e.lanes=o,e}function rs(e,n,o){return n=jn(4,e.children!==null?e.children:[],e.key,n),n.lanes=o,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function $a(e,n,o){this.tag=n,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=o,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=kl(0),this.expirationTimes=kl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=kl(0),this.mutableSourceEagerHydrationData=null}function _c(e,n,o){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:W,key:l==null?null:""+l,children:e,containerInfo:n,implementation:o}}function yl(e,n,o,l){var u=n.current,f=Rn(),m=Rr(u);e:if(o){o=o._reactInternals;t:{if(cn(o)!==o||o.tag!==1)throw Error(B(170));var y=o;do{switch(y.tag){case 3:y=y.stateNode.context;break t;case 1:if(Cn(y.type)){y=y.stateNode.__reactInternalMemoizedMergedChildContext;break t}}y=y.return}while(y!==null);throw Error(B(171))}if(o.tag===1){var E=o.type;if(Cn(E)){o=Lu(o,E,y);break e}}o=y}else o=Br;return n.context===null?n.context=o:n.pendingContext=o,n=dn(f,m),n.payload={element:e},l=l===void 0?null:l,l!==null&&(n.callback=l),hr(u,n),lr(u,m,f),m}function _o(e){return e=e.current,e.child?(e.child.tag===5,e.child.stateNode):null}function Qa(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var o=e.retryLane;e.retryLane=o!==0&&o<n?o:n}}function Xn(e,n){Qa(e,n),(e=e.alternate)&&Qa(e,n)}function ri(){return null}function is(e,n,o){var l=o!=null&&o.hydrationOptions!=null&&o.hydrationOptions.mutableSources||null;if(o=new $a(e,n,o!=null&&o.hydrate===!0),n=jn(3,null,null,n===2?7:n===1?3:0),o.current=n,n.stateNode=o,it(n),e[jr]=o.current,$i(e.nodeType===8?e.parentNode:e),l)for(e=0;e<l.length;e++){n=l[e];var u=n._getVersion;u=u(n._source),o.mutableSourceEagerHydrationData==null?o.mutableSourceEagerHydrationData=[n,u]:o.mutableSourceEagerHydrationData.push(n,u)}this._internalRoot=o}is.prototype.render=function(e){yl(e,this._internalRoot,null,null)},is.prototype.unmount=function(){var e=this._internalRoot,n=e.containerInfo;yl(null,e,null,function(){n[jr]=null})};function Ci(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Sc(e,n){if(n||(n=e?e.nodeType===9?e.documentElement:e.firstChild:null,n=!(!n||n.nodeType!==1||!n.hasAttribute("data-reactroot"))),!n)for(var o;o=e.lastChild;)e.removeChild(o);return new is(e,0,n?{hydrate:!0}:void 0)}function gr(e,n,o,l,u){var f=o._reactRootContainer;if(f){var m=f._internalRoot;if(typeof u=="function"){var y=u;u=function(){var I=_o(m);y.call(I)}}yl(n,m,e,u)}else{if(f=o._reactRootContainer=Sc(o,l),m=f._internalRoot,typeof u=="function"){var E=u;u=function(){var I=_o(m);E.call(I)}}cl(function(){yl(n,m,e,u)})}return _o(m)}Di=function(e){if(e.tag===13){var n=Rn();lr(e,4,n),Xn(e,4)}},Tl=function(e){if(e.tag===13){var n=Rn();lr(e,67108864,n),Xn(e,67108864)}},cs=function(e){if(e.tag===13){var n=Rn(),o=Rr(e);lr(e,o,n),Xn(e,o)}},di=function(e,n){return n()},an=function(e,n,o){switch(n){case"input":if(b(e,o),n=o.name,o.type==="radio"&&n!=null){for(o=e;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),n=0;n<o.length;n++){var l=o[n];if(l!==e&&l.form===e.form){var u=Xi(l);if(!u)throw Error(B(90));It(l),b(l,u)}}}break;case"textarea":Oe(e,o);break;case"select":n=o.value,n!=null&&K(e,!!o.multiple,n,!1)}},Bt=fc,Qe=function(e,n,o,l,u){var f=Ee;Ee|=4;try{return Cr(98,e.bind(null,n,o,l,u))}finally{Ee=f,Ee===0&&(Kr(),pr())}},gn=function(){(Ee&49)===0&&(nd(),Zt())},rt=function(e,n){var o=Ee;Ee|=2;try{return e(n)}finally{Ee=o,Ee===0&&(Kr(),pr())}};function Ka(e,n){var o=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ci(n))throw Error(B(200));return _c(e,n,null,o)}var Ga={Events:[Do,Yi,Xi,yt,St,Zt,{current:!1}]},Pi={findFiberByHostInstance:Mr,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"},yr={bundleType:Pi.bundleType,version:Pi.version,rendererPackageName:Pi.rendererPackageName,rendererConfig:Pi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Me.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ci(e),e===null?null:e.stateNode},findFiberByHostInstance:Pi.findFiberByHostInstance||ri,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vl.isDisabled&&vl.supportsFiber)try{oa=vl.inject(yr),fr=vl}catch{}}G.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ga,G.createPortal=Ka,G.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(B(188)):Error(B(268,Object.keys(e)));return e=ci(n),e=e===null?null:e.stateNode,e},G.flushSync=function(e,n){var o=Ee;if((o&48)!==0)return e(n);Ee|=1;try{if(e)return Cr(99,e.bind(null,n))}finally{Ee=o,pr()}},G.hydrate=function(e,n,o){if(!Ci(n))throw Error(B(200));return gr(null,e,n,!0,o)},G.render=function(e,n,o){if(!Ci(n))throw Error(B(200));return gr(null,e,n,!1,o)},G.unmountComponentAtNode=function(e){if(!Ci(e))throw Error(B(40));return e._reactRootContainer?(cl(function(){gr(null,null,e,!1,function(){e._reactRootContainer=null,e[jr]=null})}),!0):!1},G.unstable_batchedUpdates=fc,G.unstable_createPortal=function(e,n){return Ka(e,n,2<arguments.length&&arguments[2]!==void 0?arguments[2]:null)},G.unstable_renderSubtreeIntoContainer=function(e,n,o,l){if(!Ci(o))throw Error(B(200));if(e==null||e._reactInternals===void 0)throw Error(B(38));return gr(e,n,o,!1,l)},G.version="17.0.2"},874(qt,G,Ke){"use strict";function Rt(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Rt)}catch(Ne){console.error(Ne)}}Rt(),qt.exports=Ke(638)},926(qt,G,Ke){"use strict";/** @license React v17.0.2
|
|
45
|
+
* react.production.min.js
|
|
46
|
+
*
|
|
47
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
48
|
+
*
|
|
49
|
+
* This source code is licensed under the MIT license found in the
|
|
50
|
+
* LICENSE file in the root directory of this source tree.
|
|
51
|
+
*/var Rt=Ke(575),Ne=60103,et=60106;G.Fragment=60107,G.StrictMode=60108,G.Profiler=60114;var B=60109,mn=60110,_t=60112;G.Suspense=60113;var Xe=60115,O=60116;if(typeof Symbol=="function"&&Symbol.for){var X=Symbol.for;Ne=X("react.element"),et=X("react.portal"),G.Fragment=X("react.fragment"),G.StrictMode=X("react.strict_mode"),G.Profiler=X("react.profiler"),B=X("react.provider"),mn=X("react.context"),_t=X("react.forward_ref"),G.Suspense=X("react.suspense"),Xe=X("react.memo"),O=X("react.lazy")}var d=typeof Symbol=="function"&&Symbol.iterator;function bt(C){return C===null||typeof C!="object"?null:(C=d&&C[d]||C["@@iterator"],typeof C=="function"?C:null)}function ct(C){for(var V="https://reactjs.org/docs/error-decoder.html?invariant="+C,F=1;F<arguments.length;F++)V+="&args[]="+encodeURIComponent(arguments[F]);return"Minified React error #"+C+"; visit "+V+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var He={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},dt={};function nn(C,V,F){this.props=C,this.context=V,this.refs=dt,this.updater=F||He}nn.prototype.isReactComponent={},nn.prototype.setState=function(C,V){if(typeof C!="object"&&typeof C!="function"&&C!=null)throw Error(ct(85));this.updater.enqueueSetState(this,C,V,"setState")},nn.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function Ge(){}Ge.prototype=nn.prototype;function ot(C,V,F){this.props=C,this.context=V,this.refs=dt,this.updater=F||He}var ie=ot.prototype=new Ge;ie.constructor=ot,Rt(ie,nn.prototype),ie.isPureReactComponent=!0;var ae={current:null},me=Object.prototype.hasOwnProperty,Ie={key:!0,ref:!0,__self:!0,__source:!0};function Me(C,V,F){var A,Y={},Q=null,oe=null;if(V!=null)for(A in V.ref!==void 0&&(oe=V.ref),V.key!==void 0&&(Q=""+V.key),V)me.call(V,A)&&!Ie.hasOwnProperty(A)&&(Y[A]=V[A]);var U=arguments.length-2;if(U===1)Y.children=F;else if(1<U){for(var ve=Array(U),j=0;j<U;j++)ve[j]=arguments[j+2];Y.children=ve}if(C&&C.defaultProps)for(A in U=C.defaultProps,U)Y[A]===void 0&&(Y[A]=U[A]);return{$$typeof:Ne,type:C,key:Q,ref:oe,props:Y,_owner:ae.current}}function tt(C,V){return{$$typeof:Ne,type:C.type,key:V,ref:C.ref,props:C.props,_owner:C._owner}}function W(C){return typeof C=="object"&&C!==null&&C.$$typeof===Ne}function Be(C){var V={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(F){return V[F]})}var Ve=/\/+/g;function de(C,V){return typeof C=="object"&&C!==null&&C.key!=null?Be(""+C.key):V.toString(36)}function pe(C,V,F,A,Y){var Q=typeof C;(Q==="undefined"||Q==="boolean")&&(C=null);var oe=!1;if(C===null)oe=!0;else switch(Q){case"string":case"number":oe=!0;break;case"object":switch(C.$$typeof){case Ne:case et:oe=!0}}if(oe)return oe=C,Y=Y(oe),C=A===""?"."+de(oe,0):A,Array.isArray(Y)?(F="",C!=null&&(F=C.replace(Ve,"$&/")+"/"),pe(Y,V,F,"",function(j){return j})):Y!=null&&(W(Y)&&(Y=tt(Y,F+(!Y.key||oe&&oe.key===Y.key?"":(""+Y.key).replace(Ve,"$&/")+"/")+C)),V.push(Y)),1;if(oe=0,A=A===""?".":A+":",Array.isArray(C))for(var U=0;U<C.length;U++){Q=C[U];var ve=A+de(Q,U);oe+=pe(Q,V,F,ve,Y)}else if(ve=bt(C),typeof ve=="function")for(C=ve.call(C),U=0;!(Q=C.next()).done;)Q=Q.value,ve=A+de(Q,U++),oe+=pe(Q,V,F,ve,Y);else if(Q==="object")throw V=""+C,Error(ct(31,V==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":V));return oe}function ne(C,V,F){if(C==null)return C;var A=[],Y=0;return pe(C,A,"","",function(Q){return V.call(F,Q,Y++)}),A}function se(C){if(C._status===-1){var V=C._result;V=V(),C._status=0,C._result=V,V.then(function(F){C._status===0&&(F=F.default,C._status=1,C._result=F)},function(F){C._status===0&&(C._status=2,C._result=F)})}if(C._status===1)return C._result;throw C._result}var we={current:null};function ee(){var C=we.current;if(C===null)throw Error(ct(321));return C}var ge={ReactCurrentDispatcher:we,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:ae,IsSomeRendererActing:{current:!1},assign:Rt};G.Children={map:ne,forEach:function(C,V,F){ne(C,function(){V.apply(this,arguments)},F)},count:function(C){var V=0;return ne(C,function(){V++}),V},toArray:function(C){return ne(C,function(V){return V})||[]},only:function(C){if(!W(C))throw Error(ct(143));return C}},G.Component=nn,G.PureComponent=ot,G.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ge,G.cloneElement=function(C,V,F){if(C==null)throw Error(ct(267,C));var A=Rt({},C.props),Y=C.key,Q=C.ref,oe=C._owner;if(V!=null){if(V.ref!==void 0&&(Q=V.ref,oe=ae.current),V.key!==void 0&&(Y=""+V.key),C.type&&C.type.defaultProps)var U=C.type.defaultProps;for(ve in V)me.call(V,ve)&&!Ie.hasOwnProperty(ve)&&(A[ve]=V[ve]===void 0&&U!==void 0?U[ve]:V[ve])}var ve=arguments.length-2;if(ve===1)A.children=F;else if(1<ve){U=Array(ve);for(var j=0;j<ve;j++)U[j]=arguments[j+2];A.children=U}return{$$typeof:Ne,type:C.type,key:Y,ref:Q,props:A,_owner:oe}},G.createContext=function(C,V){return V===void 0&&(V=null),C={$$typeof:mn,_calculateChangedBits:V,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null},C.Provider={$$typeof:B,_context:C},C.Consumer=C},G.createElement=Me,G.createFactory=function(C){var V=Me.bind(null,C);return V.type=C,V},G.createRef=function(){return{current:null}},G.forwardRef=function(C){return{$$typeof:_t,render:C}},G.isValidElement=W,G.lazy=function(C){return{$$typeof:O,_payload:{_status:-1,_result:C},_init:se}},G.memo=function(C,V){return{$$typeof:Xe,type:C,compare:V===void 0?null:V}},G.useCallback=function(C,V){return ee().useCallback(C,V)},G.useContext=function(C,V){return ee().useContext(C,V)},G.useDebugValue=function(){},G.useEffect=function(C,V){return ee().useEffect(C,V)},G.useImperativeHandle=function(C,V,F){return ee().useImperativeHandle(C,V,F)},G.useLayoutEffect=function(C,V){return ee().useLayoutEffect(C,V)},G.useMemo=function(C,V){return ee().useMemo(C,V)},G.useReducer=function(C,V,F){return ee().useReducer(C,V,F)},G.useRef=function(C){return ee().useRef(C)},G.useState=function(C){return ee().useState(C)},G.version="17.0.2"},999(qt,G,Ke){"use strict";qt.exports=Ke(926)},742(qt,G){"use strict";/** @license React v0.20.2
|
|
52
|
+
* scheduler.production.min.js
|
|
53
|
+
*
|
|
54
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
55
|
+
*
|
|
56
|
+
* This source code is licensed under the MIT license found in the
|
|
57
|
+
* LICENSE file in the root directory of this source tree.
|
|
58
|
+
*/var Ke,Rt,Ne,et;if(typeof performance=="object"&&typeof performance.now=="function"){var B=performance;G.unstable_now=function(){return B.now()}}else{var mn=Date,_t=mn.now();G.unstable_now=function(){return mn.now()-_t}}if(typeof window>"u"||typeof MessageChannel!="function"){var Xe=null,O=null,X=function(){if(Xe!==null)try{var F=G.unstable_now();Xe(!0,F),Xe=null}catch(A){throw setTimeout(X,0),A}};Ke=function(F){Xe!==null?setTimeout(Ke,0,F):(Xe=F,setTimeout(X,0))},Rt=function(F,A){O=setTimeout(F,A)},Ne=function(){clearTimeout(O)},G.unstable_shouldYield=function(){return!1},et=G.unstable_forceFrameRate=function(){}}else{var d=window.setTimeout,bt=window.clearTimeout;if(typeof console<"u"){var ct=window.cancelAnimationFrame;typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),typeof ct!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var He=!1,dt=null,nn=-1,Ge=5,ot=0;G.unstable_shouldYield=function(){return G.unstable_now()>=ot},et=function(){},G.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Ge=0<F?Math.floor(1e3/F):5};var ie=new MessageChannel,ae=ie.port2;ie.port1.onmessage=function(){if(dt!==null){var F=G.unstable_now();ot=F+Ge;try{dt(!0,F)?ae.postMessage(null):(He=!1,dt=null)}catch(A){throw ae.postMessage(null),A}}else He=!1},Ke=function(F){dt=F,He||(He=!0,ae.postMessage(null))},Rt=function(F,A){nn=d(function(){F(G.unstable_now())},A)},Ne=function(){bt(nn),nn=-1}}function me(F,A){var Y=F.length;F.push(A);e:for(;;){var Q=Y-1>>>1,oe=F[Q];if(oe!==void 0&&0<tt(oe,A))F[Q]=A,F[Y]=oe,Y=Q;else break e}}function Ie(F){return F=F[0],F===void 0?null:F}function Me(F){var A=F[0];if(A!==void 0){var Y=F.pop();if(Y!==A){F[0]=Y;e:for(var Q=0,oe=F.length;Q<oe;){var U=2*(Q+1)-1,ve=F[U],j=U+1,ln=F[j];if(ve!==void 0&&0>tt(ve,Y))ln!==void 0&&0>tt(ln,ve)?(F[Q]=ln,F[j]=Y,Q=j):(F[Q]=ve,F[U]=Y,Q=U);else if(ln!==void 0&&0>tt(ln,Y))F[Q]=ln,F[j]=Y,Q=j;else break e}}return A}return null}function tt(F,A){var Y=F.sortIndex-A.sortIndex;return Y!==0?Y:F.id-A.id}var W=[],Be=[],Ve=1,de=null,pe=3,ne=!1,se=!1,we=!1;function ee(F){for(var A=Ie(Be);A!==null;){if(A.callback===null)Me(Be);else if(A.startTime<=F)Me(Be),A.sortIndex=A.expirationTime,me(W,A);else break;A=Ie(Be)}}function ge(F){if(we=!1,ee(F),!se)if(Ie(W)!==null)se=!0,Ke(C);else{var A=Ie(Be);A!==null&&Rt(ge,A.startTime-F)}}function C(F,A){se=!1,we&&(we=!1,Ne()),ne=!0;var Y=pe;try{for(ee(A),de=Ie(W);de!==null&&(!(de.expirationTime>A)||F&&!G.unstable_shouldYield());){var Q=de.callback;if(typeof Q=="function"){de.callback=null,pe=de.priorityLevel;var oe=Q(de.expirationTime<=A);A=G.unstable_now(),typeof oe=="function"?de.callback=oe:de===Ie(W)&&Me(W),ee(A)}else Me(W);de=Ie(W)}if(de!==null)var U=!0;else{var ve=Ie(Be);ve!==null&&Rt(ge,ve.startTime-A),U=!1}return U}finally{de=null,pe=Y,ne=!1}}var V=et;G.unstable_IdlePriority=5,G.unstable_ImmediatePriority=1,G.unstable_LowPriority=4,G.unstable_NormalPriority=3,G.unstable_Profiling=null,G.unstable_UserBlockingPriority=2,G.unstable_cancelCallback=function(F){F.callback=null},G.unstable_continueExecution=function(){se||ne||(se=!0,Ke(C))},G.unstable_getCurrentPriorityLevel=function(){return pe},G.unstable_getFirstCallbackNode=function(){return Ie(W)},G.unstable_next=function(F){switch(pe){case 1:case 2:case 3:var A=3;break;default:A=pe}var Y=pe;pe=A;try{return F()}finally{pe=Y}},G.unstable_pauseExecution=function(){},G.unstable_requestPaint=V,G.unstable_runWithPriority=function(F,A){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var Y=pe;pe=F;try{return A()}finally{pe=Y}},G.unstable_scheduleCallback=function(F,A,Y){var Q=G.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?Q+Y:Q):Y=Q,F){case 1:var oe=-1;break;case 2:oe=250;break;case 5:oe=1073741823;break;case 4:oe=1e4;break;default:oe=5e3}return oe=Y+oe,F={id:Ve++,callback:A,priorityLevel:F,startTime:Y,expirationTime:oe,sortIndex:-1},Y>Q?(F.sortIndex=Y,me(Be,F),Ie(W)===null&&F===Ie(Be)&&(we?Ne():we=!0,Rt(ge,Y-Q))):(F.sortIndex=oe,me(W,F),se||ne||(se=!0,Ke(C))),F},G.unstable_wrapCallback=function(F){var A=pe;return function(){var Y=pe;pe=A;try{return F.apply(this,arguments)}finally{pe=Y}}}},825(qt,G,Ke){"use strict";qt.exports=Ke(742)}},vd={};function Ac(qt){var G=vd[qt];if(G!==void 0)return G.exports;var Ke=vd[qt]={exports:{}};return Pf[qt](Ke,Ke.exports,Ac),Ke.exports}Ac.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}})();var wp={};(()=>{"use strict";var qt=Ac(216);const G="bridge-ws-url",Ke="ws://127.0.0.1:3002",Rt="0.1.0";var Ne=Object.defineProperty,et=(w,S,b)=>S in w?Ne(w,S,{enumerable:!0,configurable:!0,writable:!0,value:b}):w[S]=b,B=(w,S,b)=>et(w,typeof S!="symbol"?S+"":S,b);class mn{constructor(S){B(this,"ws",null),B(this,"reconnectAttempts",0),B(this,"reconnectTimeout",null),B(this,"messageHandler",null),B(this,"status","disconnected"),B(this,"isShuttingDown",!1),B(this,"_sdkReady"),B(this,"config"),this._sdkReady=S.sdkReady,this.config={url:S.url,pluginVersion:S.pluginVersion,sdkReady:S.sdkReady,maxReconnectAttempts:S.maxReconnectAttempts??10,initialReconnectDelay:S.initialReconnectDelay??1e3,maxReconnectDelay:S.maxReconnectDelay??3e4,onStatusChange:S.onStatusChange,onLog:S.onLog}}log(S,b="info"){this.config.onLog?.(S,b)}setStatus(S){this.status!==S&&(this.status=S,this.config.onStatusChange?.(S))}sendHello(){const S={type:"hello",version:this.config.pluginVersion,sdkReady:this._sdkReady};try{this.ws?.send(JSON.stringify(S)),this.log(`\u53D1\u9001 hello\uFF08v${this.config.pluginVersion}, sdkReady=${this._sdkReady}\uFF09`)}catch(b){this.log(`\u53D1\u9001 hello \u5931\u8D25: ${b}`,"warn")}}connect(){if(!(this.ws?.readyState===WebSocket.OPEN||this.ws?.readyState===WebSocket.CONNECTING)){this.isShuttingDown=!1,this.setStatus("connecting"),this.log(`\u6B63\u5728\u8FDE\u63A5 ${this.config.url}...`);try{this.ws=new WebSocket(this.config.url),this.ws.onopen=()=>{this.log("\u5DF2\u8FDE\u63A5\u5230\u5B88\u62A4\u8FDB\u7A0B"),this.reconnectAttempts=0,this.setStatus("connected"),this.sendHello()},this.ws.onmessage=async S=>{await this.handleMessage(typeof S.data=="string"?S.data:String(S.data))},this.ws.onclose=S=>{this.log(`\u8FDE\u63A5\u65AD\u5F00: ${S.code} ${S.reason}`,"warn"),this.setStatus("disconnected"),this.isShuttingDown||this.scheduleReconnect()},this.ws.onerror=S=>{this.log(`WebSocket \u9519\u8BEF: ${S}`,"error")}}catch(S){this.log(`\u8FDE\u63A5\u5931\u8D25: ${S}`,"error"),this.setStatus("disconnected"),this.scheduleReconnect()}}}async handleMessage(S){try{const b=JSON.parse(S);if(b.type==="ping"){this.ws?.send(JSON.stringify({type:"pong"}));return}if(b.id&&b.action&&this.messageHandler){const _=b;this.log(`\u6536\u5230\u8BF7\u6C42: ${_.action}`);try{const M=await this.messageHandler(_),R={id:_.id,result:M};this.ws?.send(JSON.stringify(R)),this.log(`\u5B8C\u6210: ${_.action}`)}catch(M){const R=M instanceof Error?M.message:String(M),$={id:_.id,error:R};this.ws?.send(JSON.stringify($)),this.log(`\u5931\u8D25: ${_.action} - ${R}`,"error")}}}catch(b){this.log(`\u5904\u7406\u6D88\u606F\u5931\u8D25: ${b}`,"error")}}scheduleReconnect(){if(this.isShuttingDown)return;if(this.reconnectAttempts>=this.config.maxReconnectAttempts){this.log("\u5DF2\u8FBE\u6700\u5927\u91CD\u8FDE\u6B21\u6570","error");return}const S=Math.min(this.config.initialReconnectDelay*Math.pow(2,this.reconnectAttempts),this.config.maxReconnectDelay),b=Math.random()*.3*S,_=S+b;this.reconnectAttempts++,this.log(`${Math.round(_)}ms \u540E\u91CD\u8FDE\uFF08\u7B2C ${this.reconnectAttempts}/${this.config.maxReconnectAttempts} \u6B21\uFF09`),this.reconnectTimeout=setTimeout(()=>{this.connect()},_)}setMessageHandler(S){this.messageHandler=S}setSdkReady(S){this._sdkReady=S}disconnect(){this.isShuttingDown=!0,this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.ws&&(this.ws.close(1e3,"Plugin disconnect"),this.ws=null),this.setStatus("disconnected")}reconnect(){this.reconnectAttempts=0,this.disconnect(),this.connect()}getStatus(){return this.status}}async function _t(w){const[S,b,_,M]=await Promise.all([w.isPowerupProperty(),w.isPowerupSlot(),w.isPowerupPropertyListItem(),w.isPowerupEnum()]);return S||b||_||M}async function Xe(w){const S=await Promise.all(w.map(_t));return w.filter((b,_)=>!S[_])}async function O(w){const S=await Promise.all(w.map(b=>b.isPowerup()));return w.filter((b,_)=>!S[_])}async function X(w,S){const{includePowerup:b=!1}=S,_=await w.rem.findOne(S.remId);if(!_)throw new Error(`Rem not found: ${S.remId}`);const[M,R,$,K,H,q,Oe,be,ft,We,pt,Mt,Ue,Le,st,nt,je,qe,De,$e,Sn,Lt,an,Ot,zt,Ht,yt,St,Bt,Qe,gn,rt,Tt,Or,wr,Ii,zn,un,Bn,ui,En,Un,Jn]=await Promise.all([_.isDocument(),_.getFontSize(),_.getHighlightColor(),_.isTodo(),_.getTodoStatus(),_.isCode(),_.isQuote(),_.isListItem(),_.isCardItem(),_.isTable(),_.isSlot(),_.isProperty(),_.getEnablePractice(),_.getPracticeDirection(),_.getTagRems(),_.getSources(),_.getAliases(),_.positionAmongstSiblings(),_.isPowerup(),_.isPowerupEnum(),_.isPowerupProperty(),_.isPowerupPropertyListItem(),_.isPowerupSlot(),_.getPortalType(),_.getPortalDirectlyIncludedRem(),_.getPropertyType(),_.remsBeingReferenced(),_.deepRemsBeingReferenced(),_.remsReferencingThis(),_.taggedRem(),_.ancestorTagRem(),_.descendantTagRem(),_.getDescendants(),_.siblingRem(),_.portalsAndDocumentsIn(),_.allRemInDocumentOrPortal(),_.allRemInFolderQueue(),_.getChildrenRem(),_.timesSelectedInSearch(),_.getLastTimeMovedTo(),_.getSchemaVersion(),_.embeddedQueueViewMode(),_.getLastPracticed()]);let Zn=st,Oi=_.children??[],In=0,ur=0;if(!b){Zn=await O(st),In=st.length-Zn.length;const xe=await Xe(un);ur=un.length-xe.length,Oi=xe.map(On=>On._id)}const cn={id:_._id,text:d(_.text??[]),backText:_.backText?d(_.backText):null,type:bt(_.type),isDocument:M,parent:_.parent,children:Oi,fontSize:R??null,highlightColor:$??null,isTodo:K,todoStatus:H??null,isCode:q,isQuote:Oe,isListItem:be,isCardItem:ft,isTable:!!We,isSlot:pt,isProperty:Mt,isPowerup:De,isPowerupEnum:$e,isPowerupProperty:Sn,isPowerupPropertyListItem:Lt,isPowerupSlot:an,portalType:bt(_.type)==="portal"?ct(Ot):null,portalDirectlyIncludedRem:zt.map(xe=>xe._id),propertyType:Ht??null,enablePractice:Ue,practiceDirection:Le,tags:Zn.map(xe=>xe._id),sources:nt.map(xe=>xe._id),aliases:je.map(xe=>xe._id),remsBeingReferenced:yt.map(xe=>xe._id),deepRemsBeingReferenced:St.map(xe=>xe._id),remsReferencingThis:Bt.map(xe=>xe._id),taggedRem:Qe.map(xe=>xe._id),ancestorTagRem:gn.map(xe=>xe._id),descendantTagRem:rt.map(xe=>xe._id),descendants:Tt.map(xe=>xe._id),siblingRem:Or.map(xe=>xe._id),portalsAndDocumentsIn:wr.map(xe=>xe._id),allRemInDocumentOrPortal:Ii.map(xe=>xe._id),allRemInFolderQueue:zn.map(xe=>xe._id),positionAmongstSiblings:qe??null,timesSelectedInSearch:Bn,lastTimeMovedTo:ui,schemaVersion:En,embeddedQueueViewMode:Un,createdAt:_.createdAt,updatedAt:_.updatedAt,localUpdatedAt:_.localUpdatedAt,lastPracticed:Jn};return!b&&(In>0||ur>0)?{...cn,powerupFiltered:{tags:In,children:ur}}:cn}function d(w){return w.map(S=>{if(typeof S=="string")return S;const b={};for(const _ of Object.keys(S).sort())b[_]=S[_];return b})}function bt(w){switch(w){case 1:return"concept";case 2:return"descriptor";case 6:return"portal";default:return"default"}}function ct(w){switch(w){case 2:return"embedded_queue";case 3:return"scaffold";case 4:return"search_portal";default:return"portal"}}function He(w){return"type"in w&&w.type==="elided"}function dt(w){if(w.isDivider)return"---";const{markdownText:S,markdownBackText:b,hasMultilineChildren:_,practiceDirection:M}=w;let R;return b!==null?R=S+(_?M==="backward"?" \u2191 ":M==="both"?" \u2195 ":" \u2193 ":M==="backward"?" \u2190 ":M==="both"?" \u2194 ":" \u2192 ")+b:_?R=S+(M==="backward"?" \u2191":M==="both"?" \u2195":" \u2193"):R=S,w.isCode&&(R="`"+R+"`"),w.isTodo&&(R=(w.todoStatus==="Finished"?"- [x] ":"- [ ] ")+R),w.fontSize&&(R=(w.fontSize==="H1"?"# ":w.fontSize==="H2"?"## ":"### ")+R),R}function nn(w,S){const b=[];w.type==="concept"?b.push("type:concept"):w.type==="descriptor"?b.push("type:descriptor"):w.type==="portal"&&(b.push("type:portal"),w.portalRefs.length>0&&b.push("refs:"+w.portalRefs.join(","))),w.isDocument&&b.push("doc"),w.isCardItem&&b.push("role:card-item"),S&&w.childrenCount>0&&b.push("children:"+w.childrenCount);for(const _ of w.tags)b.push("tag:"+_.name+"("+_.id+")");return w.isTopLevel&&b.push("top"),b}function Ge(w){return{markdownBackText:null,type:"default",hasMultilineChildren:!1,practiceDirection:"none",isCardItem:!1,isDocument:!1,isPortal:!1,portalRefs:[],tags:[],fontSize:null,isTodo:!1,todoStatus:null,isCode:!1,isDivider:!1,...w}}function ot(w,S=!1){const b=dt(w),_=nn(w,S),M=_.length>0?" "+_.join(" "):"";return`${b} <!--${w.id}${M}-->`}function ie(w){const S=w.isExact?"siblings":"nodes";return`<!--...elided ${w.isExact?"":">="}${w.count} ${S} (parent:${w.parentId} range:${w.rangeFrom}-${w.rangeTo} total:${w.totalSiblings})-->`}function ae(w){const S=[];function b(_,M){const R=" ".repeat(M);if(He(_)){S.push(R+ie(_));return}const $=ot(_.rem,_.folded);if(S.push(R+$),!_.folded)for(const K of _.children)b(K,M+1)}return b(w,0),S.join(`
|
|
59
|
+
`)}function me(w,S,b){if(w<=S)return{visibleIndices:null,elided:null};const _=Math.ceil(S*.7),M=Math.floor(S*.3);return{visibleIndices:{head:_,tail:M},elided:{count:w-_-M,parentId:b,rangeFrom:_,rangeTo:w-M-1,totalSiblings:w}}}async function Ie(w,S,b,_){const M=_?.includePowerup??!1,[R,$,K,H,q,Oe,be,ft,We,pt,Mt,Ue,Le]=await Promise.all([w.richText.toMarkdown(S.text??[]),S.backText?w.richText.toMarkdown(S.backText):Promise.resolve(null),S.getType(),S.isCardItem(),S.isDocument(),S.getTagRems().then(qe=>M?qe:O(qe).then(De=>{const $e=qe.length-De.length;return $e>0&&_?.onFilteredTags?.($e),De})),S.getPracticeDirection(),S.getFontSize(),S.isTodo(),S.getTodoStatus(),S.isCode(),S.hasPowerup("dv"),S.type===6?S.getPortalDirectlyIncludedRem():Promise.resolve([])]);let st=!1;b.length>0&&(st=(await Promise.all(b.map(De=>De.isCardItem()))).some(Boolean));const nt=Ue&&(S.text??[]).length===0,je=await Promise.all(Oe.map(async qe=>({id:qe._id,name:Me(await w.richText.toMarkdown(qe.text??[]))})));return{id:S._id,markdownText:Me(R),markdownBackText:$!==null?Me($):null,type:tt(K),hasMultilineChildren:st,practiceDirection:be??"none",isCardItem:H,isDocument:q,isPortal:S.type===6,portalRefs:Le.map(qe=>qe._id),childrenCount:b.length,tags:je,fontSize:ft??null,isTodo:We,todoStatus:pt??null,isCode:Mt,isDivider:nt,isTopLevel:S.parent===null}}function Me(w){return w.replace(/\n/g," ")}function tt(w){switch(w){case 1:return"concept";case 2:return"descriptor";case 6:return"portal";default:return"default"}}async function W(w,S){const{remId:b,depth:_=3,maxNodes:M=200,maxSiblings:R=20,ancestorLevels:$=0,includePowerup:K=!1}=S,H=await w.rem.findOne(b);if(!H)throw new Error(`Rem not found: ${b}`);let q=0,Oe=0,be=0;const ft={remaining:M};async function We(nt,je,qe){q++,ft.remaining--;const De=await nt.getChildrenRem(),$e=K?De:await Xe(De);K||(be+=De.length-$e.length);const Lt=qe!==-1&&je>=qe&&$e.length>0,an=await Ie(w,nt,$e,{includePowerup:K,onFilteredTags:zt=>{Oe+=zt}});Lt&&(an.hasMultilineChildren=!1);const Ot=[];if(!Lt){const{visibleIndices:zt,elided:Ht}=me($e.length,R,nt._id);if(zt){const{head:yt,tail:St}=zt;for(let Qe=0;Qe<yt&&ft.remaining>0;Qe++)Ot.push(await We($e[Qe],je+1,qe));if(Ht){const Qe=qe!==-1&&je+1>=qe;Ot.push({type:"elided",count:Ht.count,isExact:Qe,parentId:Ht.parentId,rangeFrom:Ht.rangeFrom,rangeTo:Ht.rangeTo,totalSiblings:Ht.totalSiblings})}const Bt=$e.length-St;for(let Qe=Bt;Qe<$e.length&&ft.remaining>0;Qe++)Ot.push(await We($e[Qe],je+1,qe))}else for(let yt=0;yt<$e.length;yt++){if(ft.remaining<=0){const St=$e.length-yt;Ot.push({type:"elided",count:St,isExact:!1,parentId:nt._id,rangeFrom:yt,rangeTo:$e.length-1,totalSiblings:$e.length});break}Ot.push(await We($e[yt],je+1,qe))}}return{rem:an,children:Ot,folded:Lt}}const pt=await We(H,0,_);await H.getParentRem()||(pt.rem.isTopLevel=!0);const Ue=ae(pt),Le={rootId:b,depth:_,nodeCount:q,outline:Ue},st=Math.min(Math.max($,0),10);if(st>0){const nt=[];let je=H;for(let qe=0;qe<st;qe++){const De=await je.getParentRem();if(!De)break;const[$e,Sn,Lt]=await Promise.all([w.richText.toMarkdown(De.text??[]),De.getChildrenRem(),De.isDocument()]);nt.push({id:De._id,name:Me($e),childrenCount:Sn.length,isDocument:Lt}),je=De}if(nt.length>0){const qe=nt[nt.length-1];await je.getParentRem()||(qe.isTopLevel=!0),Le.ancestors=nt}}return!K&&(Oe>0||be>0)&&(Le.powerupFiltered={tags:Oe,children:be}),Le}async function Be(w,S){const{depth:b=-1,maxNodes:_=200,maxSiblings:M=20}=S,$=(await w.rem.getAll()).filter(Ue=>Ue.parent===null),K=await Promise.all($.map(Ue=>Ue.isDocument())),H=$.filter((Ue,Le)=>K[Le]);let q=0;const Oe={remaining:_};async function be(Ue,Le,st){q++,Oe.remaining--;const nt=await Ue.getChildrenRem(),je=await Xe(nt),qe=await Promise.all(je.map(St=>St.isDocument())),De=je.filter((St,Bt)=>qe[Bt]),$e=je.length-De.length,Lt=st!==-1&&Le>=st&&De.length>0,an=Ue.type===6,[Ot,zt]=await Promise.all([w.richText.toMarkdown(Ue.text??[]),an?Ue.getPortalDirectlyIncludedRem():Promise.resolve([])]),Ht=Ge({id:Ue._id,markdownText:Ot.replace(/\n/g," "),childrenCount:je.length,isDocument:!0,isTopLevel:Ue.parent===null,isPortal:an,...an?{type:"portal",portalRefs:zt.map(St=>St._id)}:{}}),yt=[];if(!Lt&&De.length>0){const{visibleIndices:St,elided:Bt}=me(De.length,M,Ue._id);if(St){const{head:Qe,tail:gn}=St;for(let Tt=0;Tt<Qe&&Oe.remaining>0;Tt++)yt.push(await be(De[Tt],Le+1,st));if(Bt){const Tt=st!==-1&&Le+1>=st;yt.push({type:"elided",count:Bt.count,isExact:Tt,parentId:Bt.parentId,rangeFrom:Bt.rangeFrom,rangeTo:Bt.rangeTo,totalSiblings:Bt.totalSiblings})}const rt=De.length-gn;for(let Tt=rt;Tt<De.length&&Oe.remaining>0;Tt++)yt.push(await be(De[Tt],Le+1,st))}else for(let Qe=0;Qe<De.length;Qe++){if(Oe.remaining<=0){const gn=De.length-Qe;yt.push({type:"elided",count:gn,isExact:!1,parentId:Ue._id,rangeFrom:Qe,rangeTo:De.length-1,totalSiblings:De.length});break}yt.push(await be(De[Qe],Le+1,st))}}return{rem:Ht,children:yt,folded:Lt}}const ft=[],{visibleIndices:We,elided:pt}=me(H.length,M,"root");if(We){const{head:Ue,tail:Le}=We;for(let nt=0;nt<Ue&&Oe.remaining>0;nt++)ft.push(await be(H[nt],0,b));pt&&ft.push({type:"elided",count:pt.count,isExact:!1,parentId:"root",rangeFrom:pt.rangeFrom,rangeTo:pt.rangeTo,totalSiblings:pt.totalSiblings});const st=H.length-Le;for(let nt=st;nt<H.length&&Oe.remaining>0;nt++)ft.push(await be(H[nt],0,b))}else for(let Ue=0;Ue<H.length;Ue++){if(Oe.remaining<=0){const Le=H.length-Ue;ft.push({type:"elided",count:Le,isExact:!1,parentId:"root",rangeFrom:Ue,rangeTo:H.length-1,totalSiblings:H.length});break}ft.push(await be(H[Ue],0,b))}const Mt=["<!-- globe: \u77E5\u8BC6\u5E93\u6982\u89C8 -->"];for(const Ue of ft)He(Ue)?Mt.push(ie(Ue)):Mt.push(ae(Ue));return{nodeCount:q,outline:Mt.join(`
|
|
60
|
+
`)}}async function Ve(w,S){const b=[];let _=S;for(;_;){const M=await w.richText.toMarkdown(_.text??[]);b.unshift(M.replace(/\n/g," ").trim()||_._id),_=await _.getParentRem()}return b}async function de(w,S){const{mode:b="focus",ancestorLevels:_=2,maxNodes:M=200,maxSiblings:R=20,depth:$=3}=S;return b==="page"?pe(w,{maxNodes:M,maxSiblings:R,depth:$}):ne(w,{ancestorLevels:_,maxNodes:M,maxSiblings:R})}async function pe(w,S){const b=await w.window.getFocusedPaneId();if(!b)throw new Error("\u65E0\u6CD5\u83B7\u53D6\u5F53\u524D\u9762\u677F ID\uFF0C\u8BF7\u786E\u4FDD\u6709\u6253\u5F00\u7684\u9875\u9762");const _=await w.window.getOpenPaneRemId(b);if(!_)throw new Error("\u5F53\u524D\u9762\u677F\u6CA1\u6709\u6253\u5F00\u4EFB\u4F55 Rem");const M=await w.rem.findOne(_);if(!M)throw new Error(`Page Rem not found: ${_}`);const R=await Ve(w,M);let $=0;const K={remaining:S.maxNodes},H=await ee(w,M,0,S.depth,S.maxSiblings,K);$=S.maxNodes-K.remaining;const Oe=`<!-- page: ${R[R.length-1]||_} -->
|
|
61
|
+
<!-- path: ${R.join(" > ")} -->`+`
|
|
62
|
+
`+ae(H);return{nodeCount:$,outline:Oe,breadcrumb:R,mode:"page"}}async function ne(w,S){const b=await w.focus.getFocusedRem();if(!b)throw new Error("\u5F53\u524D\u6CA1\u6709\u805A\u7126\u7684 Rem\uFF0C\u8BF7\u5148\u5728 RemNote \u4E2D\u70B9\u51FB\u4E00\u4E2A Rem");const _=await Ve(w,b),M=[b];let R=b;for(let We=0;We<S.ancestorLevels;We++){const pt=await R.getParentRem();if(!pt)break;M.unshift(pt),R=pt}const $={remaining:S.maxNodes};let K=0;const H=M[0],q=await se(w,H,M,0,b._id,S.maxSiblings,$);K=S.maxNodes-$.remaining;const Oe=_[_.length-1]||b._id,ft=`<!-- path: ${_.join(" > ")} -->
|
|
63
|
+
<!-- focus: ${Oe} (${b._id}) -->`+`
|
|
64
|
+
`+ae(q);return{nodeCount:K,outline:ft,breadcrumb:_,mode:"focus"}}async function se(w,S,b,_,M,R,$){$.remaining--;const K=S._id===M,H=b.some(pt=>pt._id===S._id),q=_+1<b.length?b[_+1]:null,Oe=await S.getChildrenRem(),be=await Xe(Oe),ft=await V(w,S,be.length,K),We=[];if(K){const pt=await ge(w,be,R,S._id,$,0,3);We.push(...pt)}else if(H&&q){const{visibleIndices:pt,elided:Mt}=me(be.length,R,S._id),Ue=async Le=>$.remaining<=0?C(S._id,0,0,0):Le._id===q._id||Le._id===M?se(w,Le,b,_+1,M,R,$):q._id===M?we(w,Le,1,3,R,$):we(w,Le,0,0,R,$);if(pt){const{head:Le,tail:st}=pt;for(let je=0;je<Le&&$.remaining>0;je++)We.push(await Ue(be[je]));Mt&&We.push({type:"elided",count:Mt.count,isExact:!1,parentId:Mt.parentId,rangeFrom:Mt.rangeFrom,rangeTo:Mt.rangeTo,totalSiblings:Mt.totalSiblings});const nt=be.length-st;for(let je=nt;je<be.length&&$.remaining>0;je++)We.push(await Ue(be[je]))}else for(let Le=0;Le<be.length;Le++){if($.remaining<=0){We.push({type:"elided",count:be.length-Le,isExact:!1,parentId:S._id,rangeFrom:Le,rangeTo:be.length-1,totalSiblings:be.length});break}We.push(await Ue(be[Le]))}}return{rem:ft,children:We,folded:We.length===0&&be.length>0}}async function we(w,S,b,_,M,R){R.remaining--;const $=await S.getChildrenRem(),K=await Xe($),H=await V(w,S,K.length,!1),q=[];if(b>0&&K.length>0){const Oe=Math.min(K.length,_,M);for(let be=0;be<Oe&&R.remaining>0;be++)q.push(await we(w,K[be],b-1,_,M,R));Oe<K.length&&q.push({type:"elided",count:K.length-Oe,isExact:!1,parentId:S._id,rangeFrom:Oe,rangeTo:K.length-1,totalSiblings:K.length})}return{rem:H,children:q,folded:q.length===0&&K.length>0}}async function ee(w,S,b,_,M,R){R.remaining--;const $=await S.getChildrenRem(),K=await Xe($),q=_!==-1&&b>=_&&K.length>0,Oe=await Ie(w,S,K),be=[];if(!q){const ft=await ge(w,K,M,S._id,R,b+1,_);be.push(...ft)}return{rem:Oe,children:be,folded:q}}async function ge(w,S,b,_,M,R,$){const K=[],{visibleIndices:H,elided:q}=me(S.length,b,_);if(H){const{head:Oe,tail:be}=H;for(let We=0;We<Oe&&M.remaining>0;We++)K.push(await ee(w,S[We],R,$,b,M));if(q){const We=$!==-1&&R>=$;K.push({type:"elided",count:q.count,isExact:We,parentId:q.parentId,rangeFrom:q.rangeFrom,rangeTo:q.rangeTo,totalSiblings:q.totalSiblings})}const ft=S.length-be;for(let We=ft;We<S.length&&M.remaining>0;We++)K.push(await ee(w,S[We],R,$,b,M))}else for(let Oe=0;Oe<S.length;Oe++){if(M.remaining<=0){K.push({type:"elided",count:S.length-Oe,isExact:!1,parentId:_,rangeFrom:Oe,rangeTo:S.length-1,totalSiblings:S.length});break}K.push(await ee(w,S[Oe],R,$,b,M))}return K}function C(w,S,b,_){return{type:"elided",count:1,isExact:!1,parentId:w,rangeFrom:S,rangeTo:b,totalSiblings:_}}async function V(w,S,b,_){const M=S.type===6,[R,$,K]=await Promise.all([w.richText.toMarkdown(S.text??[]),S.isDocument(),M?S.getPortalDirectlyIncludedRem():Promise.resolve([])]);return Ge({id:S._id,markdownText:(_?"* ":"")+R.replace(/\n/g," "),childrenCount:b,isDocument:$,isTopLevel:S.parent===null,isPortal:M,...M?{type:"portal",portalRefs:K.map(H=>H._id)}:{}})}async function F(w,S){const b=await w.rem.findOne(S.remId);if(!b)throw new Error(`Rem not found: ${S.remId}`);const _=[],M=S.changes,R="parent"in M,$="positionAmongstSiblings"in M;for(const K of Object.keys(M))if(K!=="positionAmongstSiblings")try{await A(b,w,K,M[K],{position:K==="parent"&&$?M.positionAmongstSiblings:void 0}),_.push(K),K==="parent"&&$&&_.push("positionAmongstSiblings")}catch(H){return{applied:_,failed:{field:K,error:H instanceof Error?H.message:String(H)}}}if($&&!R)try{const K=b.parent;K&&await b.setParent(K,M.positionAmongstSiblings),_.push("positionAmongstSiblings")}catch(K){return{applied:_,failed:{field:"positionAmongstSiblings",error:K instanceof Error?K.message:String(K)}}}return{applied:_}}async function A(w,S,b,_,M){switch(b){case"text":await w.setText(_);break;case"backText":_===null?await w.setBackText([]):typeof _=="string"?await w.setBackText([_]):await w.setBackText(_);break;case"type":await w.setType(U(_));break;case"isDocument":await w.setIsDocument(_);break;case"parent":await w.setParent(_,M.position);break;case"fontSize":await w.setFontSize(_===null?void 0:_);break;case"highlightColor":_===null?await w.removePowerup("h"):await w.setHighlightColor(_);break;case"isTodo":await w.setIsTodo(_);break;case"todoStatus":_!==null&&await w.setTodoStatus(_);break;case"isCode":await w.setIsCode(_);break;case"isQuote":await w.setIsQuote(_);break;case"isListItem":await w.setIsListItem(_);break;case"isCardItem":await w.setIsCardItem(_);break;case"isSlot":await w.setIsSlot(_);break;case"isProperty":await w.setIsProperty(_);break;case"enablePractice":await w.setEnablePractice(_);break;case"practiceDirection":await w.setPracticeDirection(_);break;case"tags":await Y(w,_);break;case"sources":await Q(w,_);break;case"portalDirectlyIncludedRem":await oe(w,S,_);break;case"addPowerup":await w.addPowerup(_);break;default:throw new Error(`\u4E0D\u53EF\u5199\u5165\u7684\u5B57\u6BB5: ${b}`)}}async function Y(w,S){const b=await w.getTagRems(),_=new Set(b.map(R=>R._id)),M=new Set(S);for(const R of S)_.has(R)||await w.addTag(R);for(const R of _)M.has(R)||await w.removeTag(R)}async function Q(w,S){const b=await w.getSources(),_=new Set(b.map(R=>R._id)),M=new Set(S);for(const R of S)_.has(R)||await w.addSource(R);for(const R of _)M.has(R)||await w.removeSource(R)}async function oe(w,S,b){if(w.type!==6)throw new Error("portalDirectlyIncludedRem can only be modified on Portal Rem");const _=await w.getPortalDirectlyIncludedRem(),M=new Set(_.map($=>$._id)),R=new Set(b);for(const $ of b)if(!M.has($)){const K=await S.rem.findOne($);if(!K)throw new Error(`Rem not found: ${$}`);await K.addToPortal(w)}for(const $ of M)if(!R.has($)){const K=await S.rem.findOne($);if(!K)throw new Error(`Rem not found: ${$}`);await K.removeFromPortal(w)}}function U(w){switch(w){case"concept":return 1;case"descriptor":return 2;case"default":return"DEFAULT_TYPE";case"portal":throw new Error("Portal \u4E0D\u53EF\u901A\u8FC7 setType() \u8BBE\u7F6E\uFF0C\u53EA\u80FD\u901A\u8FC7 createPortal() \u521B\u5EFA");default:throw new Error(`\u672A\u77E5\u7684 Rem \u7C7B\u578B: ${w}`)}}async function ve(w,S){const{content:b,parentId:_,position:M}=S,R=await w.rem.findOne(_);if(!R)throw new Error(`Parent Rem not found: ${_}`);const $=await w.rem.createSingleRemWithMarkdown(b,_);if(!$)throw new Error(`Failed to create Rem with content: ${b.slice(0,50)}`);const K=await R.getChildrenRem(),H=K.findIndex(q=>q._id===$._id);return H!==-1&&H!==M&&M<K.length&&await $.setParent(R,M),{remId:$._id}}async function j(w,S){const b=await w.rem.findOne(S.remId);if(!b)throw new Error(`Rem not found: ${S.remId}`);return await b.remove(),{ok:!0}}async function ln(w,S){const{remId:b,newParentId:_,position:M}=S,R=await w.rem.findOne(b);if(!R)throw new Error(`Rem not found: ${b}`);const $=await w.rem.findOne(_);if(!$)throw new Error(`New parent Rem not found: ${_}`);return await R.setParent($,M),{ok:!0}}async function Vt(w,S){const{parentId:b,order:_}=S,M=await w.rem.findOne(b);if(!M)throw new Error(`Parent Rem not found: ${b}`);const $=(await M.getChildrenRem()).map(K=>K._id);for(let K=0;K<_.length;K++){const H=_[K],q=await M.getChildrenRem(),Oe=q.findIndex(be=>be._id===H);Oe!==-1&&Oe!==K&&await q[Oe].setParent(M,K)}return{ok:!0}}async function Mn(w,S){const{query:b,numResults:_=20}=S;if(!b||b.trim()==="")throw new Error("search query \u4E0D\u80FD\u4E3A\u7A7A");const M=await w.search.search([b],void 0,{numResults:_}),R=[];for(const $ of M){const K=await w.richText.toMarkdown($.text??[]),H=await $.isDocument();R.push({remId:$._id,text:K.replace(/\n/g," "),isDocument:H})}return{query:b,results:R,totalFound:R.length}}async function us(w,S){const{parentId:b,position:_}=S,M=await w.rem.createPortal();if(!M)throw new Error("Failed to create portal");const R=await w.rem.findOne(b);if(!R)throw new Error(`Parent Rem not found: ${b}`);return await M.setParent(R,_),{remId:M._id}}async function vr(w,S){const{portalId:b,remId:_}=S,M=await w.rem.findOne(b);if(!M)throw new Error(`Portal not found: ${b}`);const R=await w.rem.findOne(_);if(!R)throw new Error(`Rem not found: ${_}`);await R.addToPortal(M)}async function _n(w,S){const{portalId:b,remId:_}=S,M=await w.rem.findOne(b);if(!M)throw new Error(`Portal not found: ${b}`);const R=await w.rem.findOne(_);if(!R)throw new Error(`Rem not found: ${_}`);await R.removeFromPortal(M)}function li(w){return async S=>{switch(S.action){case"read_rem":return X(w,S.payload);case"read_tree":return W(w,S.payload);case"write_rem_fields":return F(w,S.payload);case"create_rem":return ve(w,S.payload);case"delete_rem":return j(w,S.payload);case"move_rem":return ln(w,S.payload);case"reorder_children":return Vt(w,S.payload);case"read_globe":return Be(w,S.payload);case"read_context":return de(w,S.payload);case"search":return Mn(w,S.payload);case"create_portal":return us(w,S.payload);case"add_to_portal":return vr(w,S.payload);case"remove_from_portal":return _n(w,S.payload);default:throw new Error(`\u672A\u5B9E\u73B0\u7684 action: ${S.action}`)}}}let ai=null;const J=[];let It=!1;async function _e(w){await w.settings.registerStringSetting({id:G,title:"Bridge WS Server URL",description:"\u5B88\u62A4\u8FDB\u7A0B WebSocket Server \u5730\u5740\uFF08\u9ED8\u8BA4 ws://127.0.0.1:3002\uFF09",defaultValue:Ke}),await w.app.registerWidget("bridge_widget",qt.WidgetLocation.RightSidebar,{dimensions:{height:"auto",width:"100%"},widgetTabIcon:"https://cdn.jsdelivr.net/npm/lucide-static@0.460.0/icons/globe.svg"});const S=await w.settings.getSetting(G)||Ke;ai=new mn({url:S,pluginVersion:Rt,sdkReady:!0,maxReconnectAttempts:10,initialReconnectDelay:1e3,maxReconnectDelay:3e4,onStatusChange:b=>{w.storage.setSession("bridge-status",b)},onLog:(b,_)=>{J.push({time:Date.now(),message:b,level:_}),J.length>30&&J.splice(0,J.length-30),It||(It=!0,queueMicrotask(async()=>{It=!1,await w.storage.setSession("bridge-logs",J.slice())}))}}),ai.setMessageHandler(li(w)),ai.connect()}async function bi(w){ai?.disconnect(),ai=null}(0,qt.declareIndexPlugin)(_e,bi)})()})();
|