@uxland/primary-shell 5.3.13 → 5.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +268 -162
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +85 -62
- package/dist/index.umd.cjs.map +1 -1
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/domain/model.d.ts +1 -1
- package/package.json +1 -1
- package/src/UI/internal-views/upper-nav-views.ts +8 -0
- package/src/internal-plugins/activity-history/activity-history-item/domain/model.ts +2 -5
- package/src/internal-plugins/activity-history/activity-history-item/domain/specs/diagnostics-filter-spec.test.ts +6 -6
- package/src/internal-plugins/activity-history/activity-history-item/domain/specs/search-string-spec.test.ts +15 -0
- package/src/internal-plugins/activity-history/activity-history-item/domain/specs/search-string-spec.ts +6 -14
- package/src/internal-plugins/activity-history/activity-history-item/domain/validation/diagnostics/has-valid-diagnostics.test.ts +8 -8
- package/src/internal-plugins/activity-history/activity-history-item/domain/validation/diagnostics/has-valid-diagnostics.ts +1 -1
- package/src/internal-plugins/activity-history/activity-history-item/domain/validation/is-valid-full-history-item.test.ts +7 -7
- package/src/internal-plugins/activity-history/activity-history-item/list/UI/main-view/template.ts +1 -1
- package/src/internal-plugins/activity-history/activity-history-item/list/UI/timeline/activity-history-timeline.ts +20 -9
- package/src/internal-plugins/activity-history/activity-history-item/list/UI/timeline/styles.css +2 -2
- package/src/internal-plugins/activity-history/activity-history-item/list/UI/timeline/template.ts +46 -52
- package/src/internal-plugins/activity-history/activity-history-item/list/bootstrapper.ts +1 -2
- package/src/internal-plugins/activity-history/activity-history-item/list/group-history-items/group-history-items.test.ts +3 -3
package/dist/index.umd.cjs
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
*
|
|
28
28
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
29
29
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
30
|
-
*/const o$Y=()=>{};function _isPlaceholder(te){return te!=null&&typeof te=="object"&&te["@@functional/placeholder"]===!0}function _curry1(te){return function J(X){return arguments.length===0||_isPlaceholder(X)?J:te.apply(this,arguments)}}function _curry2(te){return function J(X,re){switch(arguments.length){case 0:return J;case 1:return _isPlaceholder(X)?J:_curry1(function(ne){return te(X,ne)});default:return _isPlaceholder(X)&&_isPlaceholder(re)?J:_isPlaceholder(X)?_curry1(function(ne){return te(ne,re)}):_isPlaceholder(re)?_curry1(function(ne){return te(X,ne)}):te(X,re)}}}function _isFunction(te){var J=Object.prototype.toString.call(te);return J==="[object Function]"||J==="[object AsyncFunction]"||J==="[object GeneratorFunction]"||J==="[object AsyncGeneratorFunction]"}function _arrayFromIterator(te){for(var J=[],X;!(X=te.next()).done;)J.push(X.value);return J}function _includesWith(te,J,X){for(var re=0,ne=X.length;re<ne;){if(te(J,X[re]))return!0;re+=1}return!1}function _functionName(te){var J=String(te).match(/^function (\w*)/);return J==null?"":J[1]}function _has(te,J){return Object.prototype.hasOwnProperty.call(J,te)}function _objectIs(te,J){return te===J?te!==0||1/te===1/J:te!==te&&J!==J}const _objectIs$1=typeof Object.is=="function"?Object.is:_objectIs;var toString$1=Object.prototype.toString,_isArguments=function(){return toString$1.call(arguments)==="[object Arguments]"?function(J){return toString$1.call(J)==="[object Arguments]"}:function(J){return _has("callee",J)}}(),hasEnumBug=!{toString:null}.propertyIsEnumerable("toString"),nonEnumerableProps=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],hasArgsEnumBug=function(){return arguments.propertyIsEnumerable("length")}(),contains$1=function(J,X){for(var re=0;re<J.length;){if(J[re]===X)return!0;re+=1}return!1},keys=_curry1(typeof Object.keys=="function"&&!hasArgsEnumBug?function(J){return Object(J)!==J?[]:Object.keys(J)}:function(J){if(Object(J)!==J)return[];var X,re,ne=[],oe=hasArgsEnumBug&&_isArguments(J);for(X in J)_has(X,J)&&(!oe||X!=="length")&&(ne[ne.length]=X);if(hasEnumBug)for(re=nonEnumerableProps.length-1;re>=0;)X=nonEnumerableProps[re],_has(X,J)&&!contains$1(ne,X)&&(ne[ne.length]=X),re-=1;return ne}),type=_curry1(function(J){return J===null?"Null":J===void 0?"Undefined":Object.prototype.toString.call(J).slice(8,-1)});function _uniqContentEquals(te,J,X,re){var ne=_arrayFromIterator(te),oe=_arrayFromIterator(J);function de(ce,he){return _equals(ce,he,X.slice(),re.slice())}return!_includesWith(function(ce,he){return!_includesWith(de,he,ce)},oe,ne)}function _equals(te,J,X,re){if(_objectIs$1(te,J))return!0;var ne=type(te);if(ne!==type(J)||te==null||J==null)return!1;if(typeof te["fantasy-land/equals"]=="function"||typeof J["fantasy-land/equals"]=="function")return typeof te["fantasy-land/equals"]=="function"&&te["fantasy-land/equals"](J)&&typeof J["fantasy-land/equals"]=="function"&&J["fantasy-land/equals"](te);if(typeof te.equals=="function"||typeof J.equals=="function")return typeof te.equals=="function"&&te.equals(J)&&typeof J.equals=="function"&&J.equals(te);switch(ne){case"Arguments":case"Array":case"Object":if(typeof te.constructor=="function"&&_functionName(te.constructor)==="Promise")return te===J;break;case"Boolean":case"Number":case"String":if(!(typeof te==typeof J&&_objectIs$1(te.valueOf(),J.valueOf())))return!1;break;case"Date":if(!_objectIs$1(te.valueOf(),J.valueOf()))return!1;break;case"Error":return te.name===J.name&&te.message===J.message;case"RegExp":if(!(te.source===J.source&&te.global===J.global&&te.ignoreCase===J.ignoreCase&&te.multiline===J.multiline&&te.sticky===J.sticky&&te.unicode===J.unicode))return!1;break}for(var oe=X.length-1;oe>=0;){if(X[oe]===te)return re[oe]===J;oe-=1}switch(ne){case"Map":return te.size!==J.size?!1:_uniqContentEquals(te.entries(),J.entries(),X.concat([te]),re.concat([J]));case"Set":return te.size!==J.size?!1:_uniqContentEquals(te.values(),J.values(),X.concat([te]),re.concat([J]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var de=keys(te);if(de.length!==keys(J).length)return!1;var ce=X.concat([te]),he=re.concat([J]);for(oe=de.length-1;oe>=0;){var ue=de[oe];if(!(_has(ue,J)&&_equals(J[ue],te[ue],ce,he)))return!1;oe-=1}return!0}var equals=_curry2(function(J,X){return _equals(J,X,[],[])});function _indexOf(te,J,X){var re,ne;if(typeof te.indexOf=="function")switch(typeof J){case"number":if(J===0){for(re=1/J;X<te.length;){if(ne=te[X],ne===0&&1/ne===re)return X;X+=1}return-1}else if(J!==J){for(;X<te.length;){if(ne=te[X],typeof ne=="number"&&ne!==ne)return X;X+=1}return-1}return te.indexOf(J,X);case"string":case"boolean":case"function":case"undefined":return te.indexOf(J,X);case"object":if(J===null)return te.indexOf(J,X)}for(;X<te.length;){if(equals(te[X],J))return X;X+=1}return-1}function _includes(te,J){return _indexOf(J,te,0)>=0}function _map(te,J){for(var X=0,re=J.length,ne=Array(re);X<re;)ne[X]=te(J[X]),X+=1;return ne}function _quote(te){var J=te.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0");return'"'+J.replace(/"/g,'\\"')+'"'}var pad=function(J){return(J<10?"0":"")+J},_toISOString=typeof Date.prototype.toISOString=="function"?function(J){return J.toISOString()}:function(J){return J.getUTCFullYear()+"-"+pad(J.getUTCMonth()+1)+"-"+pad(J.getUTCDate())+"T"+pad(J.getUTCHours())+":"+pad(J.getUTCMinutes())+":"+pad(J.getUTCSeconds())+"."+(J.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"};function _complement(te){return function(){return!te.apply(this,arguments)}}const _isArray=Array.isArray||function(J){return J!=null&&J.length>=0&&Object.prototype.toString.call(J)==="[object Array]"};function _isTransformer(te){return te!=null&&typeof te["@@transducer/step"]=="function"}function _dispatchable(te,J,X){return function(){if(arguments.length===0)return X();var re=Array.prototype.slice.call(arguments,0),ne=re.pop();if(!_isArray(ne)){for(var oe=0;oe<te.length;){if(typeof ne[te[oe]]=="function")return ne[te[oe]].apply(ne,re);oe+=1}if(_isTransformer(ne)){var de=J.apply(null,re);return de(ne)}}return X.apply(this,arguments)}}function _filter(te,J){for(var X=0,re=J.length,ne=[];X<re;)te(J[X])&&(ne[ne.length]=J[X]),X+=1;return ne}function _isObject(te){return Object.prototype.toString.call(te)==="[object Object]"}function _isString(te){return Object.prototype.toString.call(te)==="[object String]"}var _isArrayLike=_curry1(function(J){return _isArray(J)?!0:!J||typeof J!="object"||_isString(J)?!1:J.nodeType===1?!!J.length:J.length===0?!0:J.length>0?J.hasOwnProperty(0)&&J.hasOwnProperty(J.length-1):!1}),XWrap=function(){function te(J){this.f=J}return te.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},te.prototype["@@transducer/result"]=function(J){return J},te.prototype["@@transducer/step"]=function(J,X){return this.f(J,X)},te}();function _xwrap(te){return new XWrap(te)}function _arity(te,J){switch(te){case 0:return function(){return J.apply(this,arguments)};case 1:return function(X){return J.apply(this,arguments)};case 2:return function(X,re){return J.apply(this,arguments)};case 3:return function(X,re,ne){return J.apply(this,arguments)};case 4:return function(X,re,ne,oe){return J.apply(this,arguments)};case 5:return function(X,re,ne,oe,de){return J.apply(this,arguments)};case 6:return function(X,re,ne,oe,de,ce){return J.apply(this,arguments)};case 7:return function(X,re,ne,oe,de,ce,he){return J.apply(this,arguments)};case 8:return function(X,re,ne,oe,de,ce,he,ue){return J.apply(this,arguments)};case 9:return function(X,re,ne,oe,de,ce,he,ue,pe){return J.apply(this,arguments)};case 10:return function(X,re,ne,oe,de,ce,he,ue,pe,fe){return J.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}var bind$1=_curry2(function(J,X){return _arity(J.length,function(){return J.apply(X,arguments)})});function _arrayReduce(te,J,X){for(var re=0,ne=X.length;re<ne;){if(J=te["@@transducer/step"](J,X[re]),J&&J["@@transducer/reduced"]){J=J["@@transducer/value"];break}re+=1}return te["@@transducer/result"](J)}function _iterableReduce(te,J,X){for(var re=X.next();!re.done;){if(J=te["@@transducer/step"](J,re.value),J&&J["@@transducer/reduced"]){J=J["@@transducer/value"];break}re=X.next()}return te["@@transducer/result"](J)}function _methodReduce(te,J,X,re){return te["@@transducer/result"](X[re](bind$1(te["@@transducer/step"],te),J))}var symIterator=typeof Symbol<"u"?Symbol.iterator:"@@iterator";function _reduce(te,J,X){if(typeof te=="function"&&(te=_xwrap(te)),_isArrayLike(X))return _arrayReduce(te,J,X);if(typeof X["fantasy-land/reduce"]=="function")return _methodReduce(te,J,X,"fantasy-land/reduce");if(X[symIterator]!=null)return _iterableReduce(te,J,X[symIterator]());if(typeof X.next=="function")return _iterableReduce(te,J,X);if(typeof X.reduce=="function")return _methodReduce(te,J,X,"reduce");throw new TypeError("reduce: list must be array or iterable")}const _xfBase={init:function(){return this.xf["@@transducer/init"]()},result:function(te){return this.xf["@@transducer/result"](te)}};var XFilter=function(){function te(J,X){this.xf=X,this.f=J}return te.prototype["@@transducer/init"]=_xfBase.init,te.prototype["@@transducer/result"]=_xfBase.result,te.prototype["@@transducer/step"]=function(J,X){return this.f(X)?this.xf["@@transducer/step"](J,X):J},te}(),_xfilter=_curry2(function(J,X){return new XFilter(J,X)}),filter=_curry2(_dispatchable(["filter"],_xfilter,function(te,J){return _isObject(J)?_reduce(function(X,re){return te(J[re])&&(X[re]=J[re]),X},{},keys(J)):_filter(te,J)})),reject=_curry2(function(J,X){return filter(_complement(J),X)});function _toString(te,J){var X=function(de){var ce=J.concat([te]);return _includes(de,ce)?"<Circular>":_toString(de,ce)},re=function(oe,de){return _map(function(ce){return _quote(ce)+": "+X(oe[ce])},de.slice().sort())};switch(Object.prototype.toString.call(te)){case"[object Arguments]":return"(function() { return arguments; }("+_map(X,te).join(", ")+"))";case"[object Array]":return"["+_map(X,te).concat(re(te,reject(function(oe){return/^\d+$/.test(oe)},keys(te)))).join(", ")+"]";case"[object Boolean]":return typeof te=="object"?"new Boolean("+X(te.valueOf())+")":te.toString();case"[object Date]":return"new Date("+(isNaN(te.valueOf())?X(NaN):_quote(_toISOString(te)))+")";case"[object Null]":return"null";case"[object Number]":return typeof te=="object"?"new Number("+X(te.valueOf())+")":1/te===-1/0?"-0":te.toString(10);case"[object String]":return typeof te=="object"?"new String("+X(te.valueOf())+")":_quote(te);case"[object Undefined]":return"undefined";default:if(typeof te.toString=="function"){var ne=te.toString();if(ne!=="[object Object]")return ne}return"{"+re(te,keys(te)).join(", ")+"}"}}function _assertPromise(te,J){if(J==null||!_isFunction(J.then))throw new TypeError("`"+te+"` expected a Promise, received "+_toString(J,[]))}var andThen=_curry2(function(J,X){return _assertPromise("andThen",X),X.then(J)}),XMap=function(){function te(J,X){this.xf=X,this.f=J}return te.prototype["@@transducer/init"]=_xfBase.init,te.prototype["@@transducer/result"]=_xfBase.result,te.prototype["@@transducer/step"]=function(J,X){return this.xf["@@transducer/step"](J,this.f(X))},te}(),_xmap=_curry2(function(J,X){return new XMap(J,X)});function _curryN(te,J,X){return function(){for(var re=[],ne=0,oe=te,de=0;de<J.length||ne<arguments.length;){var ce;de<J.length&&(!_isPlaceholder(J[de])||ne>=arguments.length)?ce=J[de]:(ce=arguments[ne],ne+=1),re[de]=ce,_isPlaceholder(ce)||(oe-=1),de+=1}return oe<=0?X.apply(this,re):_arity(oe,_curryN(te,re,X))}}var curryN=_curry2(function(J,X){return J===1?_curry1(X):_arity(J,_curryN(J,[],X))}),map=_curry2(_dispatchable(["fantasy-land/map","map"],_xmap,function(J,X){switch(Object.prototype.toString.call(X)){case"[object Function]":return curryN(X.length,function(){return J.call(this,X.apply(this,arguments))});case"[object Object]":return _reduce(function(re,ne){return re[ne]=J(X[ne]),re},{},keys(X));default:return _map(J,X)}}));function _pipe(te,J){return function(){return J.call(this,te.apply(this,arguments))}}function _curry3(te){return function J(X,re,ne){switch(arguments.length){case 0:return J;case 1:return _isPlaceholder(X)?J:_curry2(function(oe,de){return te(X,oe,de)});case 2:return _isPlaceholder(X)&&_isPlaceholder(re)?J:_isPlaceholder(X)?_curry2(function(oe,de){return te(oe,re,de)}):_isPlaceholder(re)?_curry2(function(oe,de){return te(X,oe,de)}):_curry1(function(oe){return te(X,re,oe)});default:return _isPlaceholder(X)&&_isPlaceholder(re)&&_isPlaceholder(ne)?J:_isPlaceholder(X)&&_isPlaceholder(re)?_curry2(function(oe,de){return te(oe,de,ne)}):_isPlaceholder(X)&&_isPlaceholder(ne)?_curry2(function(oe,de){return te(oe,re,de)}):_isPlaceholder(re)&&_isPlaceholder(ne)?_curry2(function(oe,de){return te(X,oe,de)}):_isPlaceholder(X)?_curry1(function(oe){return te(oe,re,ne)}):_isPlaceholder(re)?_curry1(function(oe){return te(X,oe,ne)}):_isPlaceholder(ne)?_curry1(function(oe){return te(X,re,oe)}):te(X,re,ne)}}}var reduce=_curry3(_reduce);function _checkForMethod(te,J){return function(){var X=arguments.length;if(X===0)return J();var re=arguments[X-1];return _isArray(re)||typeof re[te]!="function"?J.apply(this,arguments):re[te].apply(re,Array.prototype.slice.call(arguments,0,X-1))}}var slice=_curry3(_checkForMethod("slice",function(J,X,re){return Array.prototype.slice.call(re,J,X)})),tail=_curry1(_checkForMethod("tail",slice(1,1/0)));function pipe(){if(arguments.length===0)throw new Error("pipe requires at least one argument");return _arity(arguments[0].length,reduce(_pipe,arguments[0],tail(arguments)))}let c$u=class{constructor(J){this.targetRegion=J}async attach(){const J=this.targetRegion.regionManager.getRegisteredViews(this.targetRegion.name);return pipe(map(X=>this.targetRegion.addView(X.key,X.view)),bind$1(Promise.all,Promise),andThen(o$Y))(J)}detach(){return Promise.resolve()}},s$z=class{constructor(){this.registry=[]}get behaviors(){return[...this.registry]}register(J){this.behaviors.some(X=>X===J)||this.registry.push(J)}};const e$V=new s$z;e$V.register(c$u);const a$s=e$V;let l$A=class{constructor(J){this.host=J}get behaviors(){return a$s.behaviors.map(J=>new J(this.host.uxlRegion))}activateView(J){return this.host.contains(J)||this.addViewToHost(J),J.hidden=!1,Promise.resolve(void 0)}deactivateView(J){return J.view&&J.view.removeFromDomWhenDeactivated?this.removeViewFromHost(J):J.hidden=!0,Promise.resolve(null)}removeView(J){this.removeViewFromHost(J)}viewAdded(J){}addViewToHost(J){this.host.appendChild(J)}removeViewFromHost(J){this.host.removeChild(J),this.host.uxlRegion.viewRemovedFromDom(J.view)}};const e$U=(te,J)=>!te.sortHint&&!J.sortHint||!J.sortHint?-1:te.sortHint?te.sortHint.localeCompare(J.sortHint):1;let s$y=class extends l$A{async viewAdded(J){await this.host.uxlRegion.activate(J)}addViewToHost(J){const X=this.host.uxlRegion.currentActiveViews.sort(e$U).indexOf(J.view);X>=this.host.children.length?super.addViewToHost(J):this.host.insertBefore(J,this.host.children[X])}};const f$s=(te,J)=>new s$y(J);let o$X=class extends l$A{async activateView(J){const X=this.host.uxlRegion.currentActiveViews.filter(re=>re!==J.view);for(const re of X)await this.host.uxlRegion.deactivate(re);return super.activateView(J)}async deactivateView(J){await super.deactivateView(J);const X=this.host.uxlRegion.currentViews.find(re=>re.isDefault);X&&J.view!=X&&this.host.uxlRegion.currentActiveViews.length==0&&await this.host.uxlRegion.activate(X)}async viewAdded(J){!this.host.uxlRegion.currentActiveViews.length&&J.isDefault&&await this.host.uxlRegion.activate(J)}},o$W=class extends o$X{constructor(J){super(J),this.attrForSelected="name",this.attrForSelectedProperty="attrForSelected",this.selectedProperty="selected",J[this.attrForSelectedProperty]=this.attrForSelected}async activateView(J){await super.activateView(J),J[this.attrForSelected]||(J[this.attrForSelected]=J.viewKey),this.host[this.selectedProperty]=J.viewKey}async deactivateView(J){this.host[this.selectedProperty]===J.viewKey&&(this.host[this.selectedProperty]=null,await super.deactivateView(J))}};const d$v=(te,J)=>new o$W(J),a$r=(te,J)=>{if(te=typeof te=="function"?te():te,!te)throw new Error(J)},o$V=te=>typeof HTMLElement=="object"?te instanceof HTMLElement:te&&typeof te=="object"&&te!=null&&te.nodeType===1&&typeof te.nodeName=="string",f$r=te=>{if(!te.htmlTag&&!te.element&&!te.factory)throw new Error("One of properties htmlTag, factory or element must be set");return te.htmlTag&&a$r(typeof te.htmlTag=="string","htmlTag property must be an string"),te.factory&&a$r(typeof te.factory=="function","factory property must be a function"),te.element&&a$r(o$V(te.element),"element property must be an HTMLElement"),!0},f$q=async(te,J,X)=>{let re;return te.element?re=te.element:te.factory?re=await te.factory():te.htmlTag&&(te.htmlUrl&&await import(te.htmlUrl),re=window.document.createElement(te.htmlTag)),re.view=te,re.region=J,re.viewKey=X,re};let y$k=class{constructor(J,X,re,ne,oe){this.name=J,this.regionManager=X,this.host=re,this.adapter=ne,this.definition=oe,this.views={},this.activeViews=[],this.components=new WeakMap,this.host.uxlRegion=this}async addView(J,X){return f$r(X),a$r(typeof this.getView(J)>"u",`Already exists a view with key ${J}`),this.views[J]=X,await this.adapter.viewAdded(X),this}async removeView(J){await this.deactivate(J),this.remove(J),delete this.views[J]}async removeViews(){Object.keys(this.views).forEach(J=>this.removeView(J))}get context(){return this._context}set context(J){this._context=J,Object.keys(this.views).forEach(X=>{const re=this.views[X];if(this.components.has(re)){const ne=this.components.get(re);ne&&(ne.regionContext=this._context)}})}async activate(J){let X=J;if(typeof J=="string"?(X=this.getView(J),a$r(X,`Region does not contain a view with key ${J}`)):a$r(Object.keys(this.views).some(re=>typeof this.views[re]<"u"),"Region does not contain this view"),!this.activeViews.some(re=>re===X)){if(!this.components.has(X)){const ne=await f$q(X,this,typeof J=="string"?J:this.getKey(X));ne.regionContext=this.context,this.components.set(X,ne)}const re=this.components.get(X);this.activeViews.push(X),re.active=!0,await this.adapter.activateView(re)}return this}viewRemovedFromDom(J){this.components.delete(J)}remove(J){const X=typeof J=="string"?this.getView(J):J,re=this.components.get(X);re&&this.adapter.removeView(re)}async deactivate(J){const X=typeof J=="string"?this.getView(J):J,re=this.activeViews.indexOf(X);re!==-1&&this.activeViews.splice(re,1);const ne=this.components.get(X);ne&&(ne.active=!1,await this.adapter.deactivateView(ne))}getView(J){return this.views[J]}get currentViews(){return Object.keys(this.views).map(J=>this.views[J])}get currentActiveViews(){return[...this.activeViews]}getKey(J){return Object.keys(this.views).find(X=>this.views[X]==J)}containsView(J){return typeof J=="string"?this.getView(J)!==void 0:Object.keys(this.views).some(X=>this.views[X]==J)}isViewActive(J){if(this.containsView(J)){const X=typeof J=="string"?this.getView(J):J;return this.activeViews.indexOf(X)!==-1}throw new Error(`region ${this.name} doest not contain this view`)}async toggleViewActive(J){if(this.containsView(J))return this.isViewActive(J)?(await this.deactivate(J),!1):(await this.activate(J),!0);throw new Error(`region ${this.name} doest not contain this view`)}};const e$T="default",r$M="dynamic";let y$j=class{constructor(){this.adapterRegistry=new Map,this.adapterRegistry.set(r$M,[])}registerAdapterFactory(J,X){this.adapterRegistry.set(J,X)}get dynamicFactories(){return this.adapterRegistry.get(r$M)}registerDynamicAdapterFactory(J){this.dynamicFactories.indexOf(J)===-1&&this.dynamicFactories.push(J)}getDynamicFactory(J){return this.dynamicFactories.reduce((X,re)=>X||re(J),null)}getAdapterFactory(J){return this.getDynamicFactory(J)||(this.adapterRegistry.has(J.constructor)?this.adapterRegistry.get(J.constructor):this.adapterRegistry.has(J.localName)?this.adapterRegistry.get(J.localName):this.adapterRegistry.has(J.tagName)?this.adapterRegistry.get(J.tagName):this.adapterRegistry.has(e$T)?this.adapterRegistry.get(e$T):null)}registerDefaultAdapterFactory(J){this.adapterRegistry.set(e$T,J)}};const p$h=new y$j,o$U="__uxl_regions__",s$x=te=>(J,X)=>{J.constructor[o$U]={...J.constructor[o$U],[X]:te}},p$g=(te,J,X)=>{const re=X.getAdapterFactory(J);return a$r(typeof re=="function","No region adapter factory found for the host"),re(te,J)},h$v=async(te,J,X,re)=>{await J._updatePromise;const ne=J.shadowRoot.querySelector(`#${te.targetId}`);if(ne){const oe=te.adapterFactory?te.adapterFactory(te,ne):p$g(te,ne,re);a$r(oe,"No region adapter found for the host");const de=te.scoped?X.createRegionManager():X,ce=new y$k(te.name,de,ne,oe,te);return de.add(te.name,ce),ce}else console.warn(`region host with id ${te.targetId} not found for region named ${te.name}`)};/*
|
|
30
|
+
*/const o$Y=()=>{};function _isPlaceholder(te){return te!=null&&typeof te=="object"&&te["@@functional/placeholder"]===!0}function _curry1(te){return function J(X){return arguments.length===0||_isPlaceholder(X)?J:te.apply(this,arguments)}}function _curry2(te){return function J(X,re){switch(arguments.length){case 0:return J;case 1:return _isPlaceholder(X)?J:_curry1(function(ne){return te(X,ne)});default:return _isPlaceholder(X)&&_isPlaceholder(re)?J:_isPlaceholder(X)?_curry1(function(ne){return te(ne,re)}):_isPlaceholder(re)?_curry1(function(ne){return te(X,ne)}):te(X,re)}}}function _isFunction(te){var J=Object.prototype.toString.call(te);return J==="[object Function]"||J==="[object AsyncFunction]"||J==="[object GeneratorFunction]"||J==="[object AsyncGeneratorFunction]"}function _arrayFromIterator(te){for(var J=[],X;!(X=te.next()).done;)J.push(X.value);return J}function _includesWith(te,J,X){for(var re=0,ne=X.length;re<ne;){if(te(J,X[re]))return!0;re+=1}return!1}function _functionName(te){var J=String(te).match(/^function (\w*)/);return J==null?"":J[1]}function _has(te,J){return Object.prototype.hasOwnProperty.call(J,te)}function _objectIs(te,J){return te===J?te!==0||1/te===1/J:te!==te&&J!==J}const _objectIs$1=typeof Object.is=="function"?Object.is:_objectIs;var toString$1=Object.prototype.toString,_isArguments=function(){return toString$1.call(arguments)==="[object Arguments]"?function(J){return toString$1.call(J)==="[object Arguments]"}:function(J){return _has("callee",J)}}(),hasEnumBug=!{toString:null}.propertyIsEnumerable("toString"),nonEnumerableProps=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],hasArgsEnumBug=function(){return arguments.propertyIsEnumerable("length")}(),contains$1=function(J,X){for(var re=0;re<J.length;){if(J[re]===X)return!0;re+=1}return!1},keys=_curry1(typeof Object.keys=="function"&&!hasArgsEnumBug?function(J){return Object(J)!==J?[]:Object.keys(J)}:function(J){if(Object(J)!==J)return[];var X,re,ne=[],oe=hasArgsEnumBug&&_isArguments(J);for(X in J)_has(X,J)&&(!oe||X!=="length")&&(ne[ne.length]=X);if(hasEnumBug)for(re=nonEnumerableProps.length-1;re>=0;)X=nonEnumerableProps[re],_has(X,J)&&!contains$1(ne,X)&&(ne[ne.length]=X),re-=1;return ne}),type=_curry1(function(J){return J===null?"Null":J===void 0?"Undefined":Object.prototype.toString.call(J).slice(8,-1)});function _uniqContentEquals(te,J,X,re){var ne=_arrayFromIterator(te),oe=_arrayFromIterator(J);function de(ce,he){return _equals(ce,he,X.slice(),re.slice())}return!_includesWith(function(ce,he){return!_includesWith(de,he,ce)},oe,ne)}function _equals(te,J,X,re){if(_objectIs$1(te,J))return!0;var ne=type(te);if(ne!==type(J)||te==null||J==null)return!1;if(typeof te["fantasy-land/equals"]=="function"||typeof J["fantasy-land/equals"]=="function")return typeof te["fantasy-land/equals"]=="function"&&te["fantasy-land/equals"](J)&&typeof J["fantasy-land/equals"]=="function"&&J["fantasy-land/equals"](te);if(typeof te.equals=="function"||typeof J.equals=="function")return typeof te.equals=="function"&&te.equals(J)&&typeof J.equals=="function"&&J.equals(te);switch(ne){case"Arguments":case"Array":case"Object":if(typeof te.constructor=="function"&&_functionName(te.constructor)==="Promise")return te===J;break;case"Boolean":case"Number":case"String":if(!(typeof te==typeof J&&_objectIs$1(te.valueOf(),J.valueOf())))return!1;break;case"Date":if(!_objectIs$1(te.valueOf(),J.valueOf()))return!1;break;case"Error":return te.name===J.name&&te.message===J.message;case"RegExp":if(!(te.source===J.source&&te.global===J.global&&te.ignoreCase===J.ignoreCase&&te.multiline===J.multiline&&te.sticky===J.sticky&&te.unicode===J.unicode))return!1;break}for(var oe=X.length-1;oe>=0;){if(X[oe]===te)return re[oe]===J;oe-=1}switch(ne){case"Map":return te.size!==J.size?!1:_uniqContentEquals(te.entries(),J.entries(),X.concat([te]),re.concat([J]));case"Set":return te.size!==J.size?!1:_uniqContentEquals(te.values(),J.values(),X.concat([te]),re.concat([J]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var de=keys(te);if(de.length!==keys(J).length)return!1;var ce=X.concat([te]),he=re.concat([J]);for(oe=de.length-1;oe>=0;){var ue=de[oe];if(!(_has(ue,J)&&_equals(J[ue],te[ue],ce,he)))return!1;oe-=1}return!0}var equals=_curry2(function(J,X){return _equals(J,X,[],[])});function _indexOf(te,J,X){var re,ne;if(typeof te.indexOf=="function")switch(typeof J){case"number":if(J===0){for(re=1/J;X<te.length;){if(ne=te[X],ne===0&&1/ne===re)return X;X+=1}return-1}else if(J!==J){for(;X<te.length;){if(ne=te[X],typeof ne=="number"&&ne!==ne)return X;X+=1}return-1}return te.indexOf(J,X);case"string":case"boolean":case"function":case"undefined":return te.indexOf(J,X);case"object":if(J===null)return te.indexOf(J,X)}for(;X<te.length;){if(equals(te[X],J))return X;X+=1}return-1}function _includes(te,J){return _indexOf(J,te,0)>=0}function _map(te,J){for(var X=0,re=J.length,ne=Array(re);X<re;)ne[X]=te(J[X]),X+=1;return ne}function _quote(te){var J=te.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0");return'"'+J.replace(/"/g,'\\"')+'"'}var pad=function(J){return(J<10?"0":"")+J},_toISOString=typeof Date.prototype.toISOString=="function"?function(J){return J.toISOString()}:function(J){return J.getUTCFullYear()+"-"+pad(J.getUTCMonth()+1)+"-"+pad(J.getUTCDate())+"T"+pad(J.getUTCHours())+":"+pad(J.getUTCMinutes())+":"+pad(J.getUTCSeconds())+"."+(J.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"};function _complement(te){return function(){return!te.apply(this,arguments)}}const _isArray=Array.isArray||function(J){return J!=null&&J.length>=0&&Object.prototype.toString.call(J)==="[object Array]"};function _isTransformer(te){return te!=null&&typeof te["@@transducer/step"]=="function"}function _dispatchable(te,J,X){return function(){if(arguments.length===0)return X();var re=Array.prototype.slice.call(arguments,0),ne=re.pop();if(!_isArray(ne)){for(var oe=0;oe<te.length;){if(typeof ne[te[oe]]=="function")return ne[te[oe]].apply(ne,re);oe+=1}if(_isTransformer(ne)){var de=J.apply(null,re);return de(ne)}}return X.apply(this,arguments)}}function _filter(te,J){for(var X=0,re=J.length,ne=[];X<re;)te(J[X])&&(ne[ne.length]=J[X]),X+=1;return ne}function _isObject(te){return Object.prototype.toString.call(te)==="[object Object]"}function _isString(te){return Object.prototype.toString.call(te)==="[object String]"}var _isArrayLike=_curry1(function(J){return _isArray(J)?!0:!J||typeof J!="object"||_isString(J)?!1:J.nodeType===1?!!J.length:J.length===0?!0:J.length>0?J.hasOwnProperty(0)&&J.hasOwnProperty(J.length-1):!1}),XWrap=function(){function te(J){this.f=J}return te.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},te.prototype["@@transducer/result"]=function(J){return J},te.prototype["@@transducer/step"]=function(J,X){return this.f(J,X)},te}();function _xwrap(te){return new XWrap(te)}function _arity(te,J){switch(te){case 0:return function(){return J.apply(this,arguments)};case 1:return function(X){return J.apply(this,arguments)};case 2:return function(X,re){return J.apply(this,arguments)};case 3:return function(X,re,ne){return J.apply(this,arguments)};case 4:return function(X,re,ne,oe){return J.apply(this,arguments)};case 5:return function(X,re,ne,oe,de){return J.apply(this,arguments)};case 6:return function(X,re,ne,oe,de,ce){return J.apply(this,arguments)};case 7:return function(X,re,ne,oe,de,ce,he){return J.apply(this,arguments)};case 8:return function(X,re,ne,oe,de,ce,he,ue){return J.apply(this,arguments)};case 9:return function(X,re,ne,oe,de,ce,he,ue,pe){return J.apply(this,arguments)};case 10:return function(X,re,ne,oe,de,ce,he,ue,pe,fe){return J.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}var bind$1=_curry2(function(J,X){return _arity(J.length,function(){return J.apply(X,arguments)})});function _arrayReduce(te,J,X){for(var re=0,ne=X.length;re<ne;){if(J=te["@@transducer/step"](J,X[re]),J&&J["@@transducer/reduced"]){J=J["@@transducer/value"];break}re+=1}return te["@@transducer/result"](J)}function _iterableReduce(te,J,X){for(var re=X.next();!re.done;){if(J=te["@@transducer/step"](J,re.value),J&&J["@@transducer/reduced"]){J=J["@@transducer/value"];break}re=X.next()}return te["@@transducer/result"](J)}function _methodReduce(te,J,X,re){return te["@@transducer/result"](X[re](bind$1(te["@@transducer/step"],te),J))}var symIterator=typeof Symbol<"u"?Symbol.iterator:"@@iterator";function _reduce(te,J,X){if(typeof te=="function"&&(te=_xwrap(te)),_isArrayLike(X))return _arrayReduce(te,J,X);if(typeof X["fantasy-land/reduce"]=="function")return _methodReduce(te,J,X,"fantasy-land/reduce");if(X[symIterator]!=null)return _iterableReduce(te,J,X[symIterator]());if(typeof X.next=="function")return _iterableReduce(te,J,X);if(typeof X.reduce=="function")return _methodReduce(te,J,X,"reduce");throw new TypeError("reduce: list must be array or iterable")}const _xfBase={init:function(){return this.xf["@@transducer/init"]()},result:function(te){return this.xf["@@transducer/result"](te)}};var XFilter=function(){function te(J,X){this.xf=X,this.f=J}return te.prototype["@@transducer/init"]=_xfBase.init,te.prototype["@@transducer/result"]=_xfBase.result,te.prototype["@@transducer/step"]=function(J,X){return this.f(X)?this.xf["@@transducer/step"](J,X):J},te}(),_xfilter=_curry2(function(J,X){return new XFilter(J,X)}),filter=_curry2(_dispatchable(["filter"],_xfilter,function(te,J){return _isObject(J)?_reduce(function(X,re){return te(J[re])&&(X[re]=J[re]),X},{},keys(J)):_filter(te,J)})),reject=_curry2(function(J,X){return filter(_complement(J),X)});function _toString(te,J){var X=function(de){var ce=J.concat([te]);return _includes(de,ce)?"<Circular>":_toString(de,ce)},re=function(oe,de){return _map(function(ce){return _quote(ce)+": "+X(oe[ce])},de.slice().sort())};switch(Object.prototype.toString.call(te)){case"[object Arguments]":return"(function() { return arguments; }("+_map(X,te).join(", ")+"))";case"[object Array]":return"["+_map(X,te).concat(re(te,reject(function(oe){return/^\d+$/.test(oe)},keys(te)))).join(", ")+"]";case"[object Boolean]":return typeof te=="object"?"new Boolean("+X(te.valueOf())+")":te.toString();case"[object Date]":return"new Date("+(isNaN(te.valueOf())?X(NaN):_quote(_toISOString(te)))+")";case"[object Null]":return"null";case"[object Number]":return typeof te=="object"?"new Number("+X(te.valueOf())+")":1/te===-1/0?"-0":te.toString(10);case"[object String]":return typeof te=="object"?"new String("+X(te.valueOf())+")":_quote(te);case"[object Undefined]":return"undefined";default:if(typeof te.toString=="function"){var ne=te.toString();if(ne!=="[object Object]")return ne}return"{"+re(te,keys(te)).join(", ")+"}"}}function _assertPromise(te,J){if(J==null||!_isFunction(J.then))throw new TypeError("`"+te+"` expected a Promise, received "+_toString(J,[]))}var andThen=_curry2(function(J,X){return _assertPromise("andThen",X),X.then(J)}),XMap=function(){function te(J,X){this.xf=X,this.f=J}return te.prototype["@@transducer/init"]=_xfBase.init,te.prototype["@@transducer/result"]=_xfBase.result,te.prototype["@@transducer/step"]=function(J,X){return this.xf["@@transducer/step"](J,this.f(X))},te}(),_xmap=_curry2(function(J,X){return new XMap(J,X)});function _curryN(te,J,X){return function(){for(var re=[],ne=0,oe=te,de=0;de<J.length||ne<arguments.length;){var ce;de<J.length&&(!_isPlaceholder(J[de])||ne>=arguments.length)?ce=J[de]:(ce=arguments[ne],ne+=1),re[de]=ce,_isPlaceholder(ce)||(oe-=1),de+=1}return oe<=0?X.apply(this,re):_arity(oe,_curryN(te,re,X))}}var curryN=_curry2(function(J,X){return J===1?_curry1(X):_arity(J,_curryN(J,[],X))}),map=_curry2(_dispatchable(["fantasy-land/map","map"],_xmap,function(J,X){switch(Object.prototype.toString.call(X)){case"[object Function]":return curryN(X.length,function(){return J.call(this,X.apply(this,arguments))});case"[object Object]":return _reduce(function(re,ne){return re[ne]=J(X[ne]),re},{},keys(X));default:return _map(J,X)}}));function _pipe(te,J){return function(){return J.call(this,te.apply(this,arguments))}}function _curry3(te){return function J(X,re,ne){switch(arguments.length){case 0:return J;case 1:return _isPlaceholder(X)?J:_curry2(function(oe,de){return te(X,oe,de)});case 2:return _isPlaceholder(X)&&_isPlaceholder(re)?J:_isPlaceholder(X)?_curry2(function(oe,de){return te(oe,re,de)}):_isPlaceholder(re)?_curry2(function(oe,de){return te(X,oe,de)}):_curry1(function(oe){return te(X,re,oe)});default:return _isPlaceholder(X)&&_isPlaceholder(re)&&_isPlaceholder(ne)?J:_isPlaceholder(X)&&_isPlaceholder(re)?_curry2(function(oe,de){return te(oe,de,ne)}):_isPlaceholder(X)&&_isPlaceholder(ne)?_curry2(function(oe,de){return te(oe,re,de)}):_isPlaceholder(re)&&_isPlaceholder(ne)?_curry2(function(oe,de){return te(X,oe,de)}):_isPlaceholder(X)?_curry1(function(oe){return te(oe,re,ne)}):_isPlaceholder(re)?_curry1(function(oe){return te(X,oe,ne)}):_isPlaceholder(ne)?_curry1(function(oe){return te(X,re,oe)}):te(X,re,ne)}}}var reduce=_curry3(_reduce);function _checkForMethod(te,J){return function(){var X=arguments.length;if(X===0)return J();var re=arguments[X-1];return _isArray(re)||typeof re[te]!="function"?J.apply(this,arguments):re[te].apply(re,Array.prototype.slice.call(arguments,0,X-1))}}var slice=_curry3(_checkForMethod("slice",function(J,X,re){return Array.prototype.slice.call(re,J,X)})),tail=_curry1(_checkForMethod("tail",slice(1,1/0)));function pipe(){if(arguments.length===0)throw new Error("pipe requires at least one argument");return _arity(arguments[0].length,reduce(_pipe,arguments[0],tail(arguments)))}let c$u=class{constructor(J){this.targetRegion=J}async attach(){const J=this.targetRegion.regionManager.getRegisteredViews(this.targetRegion.name);return pipe(map(X=>this.targetRegion.addView(X.key,X.view)),bind$1(Promise.all,Promise),andThen(o$Y))(J)}detach(){return Promise.resolve()}},s$z=class{constructor(){this.registry=[]}get behaviors(){return[...this.registry]}register(J){this.behaviors.some(X=>X===J)||this.registry.push(J)}};const e$X=new s$z;e$X.register(c$u);const a$s=e$X;let l$A=class{constructor(J){this.host=J}get behaviors(){return a$s.behaviors.map(J=>new J(this.host.uxlRegion))}activateView(J){return this.host.contains(J)||this.addViewToHost(J),J.hidden=!1,Promise.resolve(void 0)}deactivateView(J){return J.view&&J.view.removeFromDomWhenDeactivated?this.removeViewFromHost(J):J.hidden=!0,Promise.resolve(null)}removeView(J){this.removeViewFromHost(J)}viewAdded(J){}addViewToHost(J){this.host.appendChild(J)}removeViewFromHost(J){this.host.removeChild(J),this.host.uxlRegion.viewRemovedFromDom(J.view)}};const e$W=(te,J)=>!te.sortHint&&!J.sortHint||!J.sortHint?-1:te.sortHint?te.sortHint.localeCompare(J.sortHint):1;let s$y=class extends l$A{async viewAdded(J){await this.host.uxlRegion.activate(J)}addViewToHost(J){const X=this.host.uxlRegion.currentActiveViews.sort(e$W).indexOf(J.view);X>=this.host.children.length?super.addViewToHost(J):this.host.insertBefore(J,this.host.children[X])}};const f$s=(te,J)=>new s$y(J);let o$X=class extends l$A{async activateView(J){const X=this.host.uxlRegion.currentActiveViews.filter(re=>re!==J.view);for(const re of X)await this.host.uxlRegion.deactivate(re);return super.activateView(J)}async deactivateView(J){await super.deactivateView(J);const X=this.host.uxlRegion.currentViews.find(re=>re.isDefault);X&&J.view!=X&&this.host.uxlRegion.currentActiveViews.length==0&&await this.host.uxlRegion.activate(X)}async viewAdded(J){!this.host.uxlRegion.currentActiveViews.length&&J.isDefault&&await this.host.uxlRegion.activate(J)}},o$W=class extends o$X{constructor(J){super(J),this.attrForSelected="name",this.attrForSelectedProperty="attrForSelected",this.selectedProperty="selected",J[this.attrForSelectedProperty]=this.attrForSelected}async activateView(J){await super.activateView(J),J[this.attrForSelected]||(J[this.attrForSelected]=J.viewKey),this.host[this.selectedProperty]=J.viewKey}async deactivateView(J){this.host[this.selectedProperty]===J.viewKey&&(this.host[this.selectedProperty]=null,await super.deactivateView(J))}};const d$v=(te,J)=>new o$W(J),a$r=(te,J)=>{if(te=typeof te=="function"?te():te,!te)throw new Error(J)},o$V=te=>typeof HTMLElement=="object"?te instanceof HTMLElement:te&&typeof te=="object"&&te!=null&&te.nodeType===1&&typeof te.nodeName=="string",f$r=te=>{if(!te.htmlTag&&!te.element&&!te.factory)throw new Error("One of properties htmlTag, factory or element must be set");return te.htmlTag&&a$r(typeof te.htmlTag=="string","htmlTag property must be an string"),te.factory&&a$r(typeof te.factory=="function","factory property must be a function"),te.element&&a$r(o$V(te.element),"element property must be an HTMLElement"),!0},f$q=async(te,J,X)=>{let re;return te.element?re=te.element:te.factory?re=await te.factory():te.htmlTag&&(te.htmlUrl&&await import(te.htmlUrl),re=window.document.createElement(te.htmlTag)),re.view=te,re.region=J,re.viewKey=X,re};let y$k=class{constructor(J,X,re,ne,oe){this.name=J,this.regionManager=X,this.host=re,this.adapter=ne,this.definition=oe,this.views={},this.activeViews=[],this.components=new WeakMap,this.host.uxlRegion=this}async addView(J,X){return f$r(X),a$r(typeof this.getView(J)>"u",`Already exists a view with key ${J}`),this.views[J]=X,await this.adapter.viewAdded(X),this}async removeView(J){await this.deactivate(J),this.remove(J),delete this.views[J]}async removeViews(){Object.keys(this.views).forEach(J=>this.removeView(J))}get context(){return this._context}set context(J){this._context=J,Object.keys(this.views).forEach(X=>{const re=this.views[X];if(this.components.has(re)){const ne=this.components.get(re);ne&&(ne.regionContext=this._context)}})}async activate(J){let X=J;if(typeof J=="string"?(X=this.getView(J),a$r(X,`Region does not contain a view with key ${J}`)):a$r(Object.keys(this.views).some(re=>typeof this.views[re]<"u"),"Region does not contain this view"),!this.activeViews.some(re=>re===X)){if(!this.components.has(X)){const ne=await f$q(X,this,typeof J=="string"?J:this.getKey(X));ne.regionContext=this.context,this.components.set(X,ne)}const re=this.components.get(X);this.activeViews.push(X),re.active=!0,await this.adapter.activateView(re)}return this}viewRemovedFromDom(J){this.components.delete(J)}remove(J){const X=typeof J=="string"?this.getView(J):J,re=this.components.get(X);re&&this.adapter.removeView(re)}async deactivate(J){const X=typeof J=="string"?this.getView(J):J,re=this.activeViews.indexOf(X);re!==-1&&this.activeViews.splice(re,1);const ne=this.components.get(X);ne&&(ne.active=!1,await this.adapter.deactivateView(ne))}getView(J){return this.views[J]}get currentViews(){return Object.keys(this.views).map(J=>this.views[J])}get currentActiveViews(){return[...this.activeViews]}getKey(J){return Object.keys(this.views).find(X=>this.views[X]==J)}containsView(J){return typeof J=="string"?this.getView(J)!==void 0:Object.keys(this.views).some(X=>this.views[X]==J)}isViewActive(J){if(this.containsView(J)){const X=typeof J=="string"?this.getView(J):J;return this.activeViews.indexOf(X)!==-1}throw new Error(`region ${this.name} doest not contain this view`)}async toggleViewActive(J){if(this.containsView(J))return this.isViewActive(J)?(await this.deactivate(J),!1):(await this.activate(J),!0);throw new Error(`region ${this.name} doest not contain this view`)}};const e$V="default",r$M="dynamic";let y$j=class{constructor(){this.adapterRegistry=new Map,this.adapterRegistry.set(r$M,[])}registerAdapterFactory(J,X){this.adapterRegistry.set(J,X)}get dynamicFactories(){return this.adapterRegistry.get(r$M)}registerDynamicAdapterFactory(J){this.dynamicFactories.indexOf(J)===-1&&this.dynamicFactories.push(J)}getDynamicFactory(J){return this.dynamicFactories.reduce((X,re)=>X||re(J),null)}getAdapterFactory(J){return this.getDynamicFactory(J)||(this.adapterRegistry.has(J.constructor)?this.adapterRegistry.get(J.constructor):this.adapterRegistry.has(J.localName)?this.adapterRegistry.get(J.localName):this.adapterRegistry.has(J.tagName)?this.adapterRegistry.get(J.tagName):this.adapterRegistry.has(e$V)?this.adapterRegistry.get(e$V):null)}registerDefaultAdapterFactory(J){this.adapterRegistry.set(e$V,J)}};const p$h=new y$j,o$U="__uxl_regions__",s$x=te=>(J,X)=>{J.constructor[o$U]={...J.constructor[o$U],[X]:te}},p$g=(te,J,X)=>{const re=X.getAdapterFactory(J);return a$r(typeof re=="function","No region adapter factory found for the host"),re(te,J)},h$v=async(te,J,X,re)=>{await J._updatePromise;const ne=J.shadowRoot.querySelector(`#${te.targetId}`);if(ne){const oe=te.adapterFactory?te.adapterFactory(te,ne):p$g(te,ne,re);a$r(oe,"No region adapter found for the host");const de=te.scoped?X.createRegionManager():X,ce=new y$k(te.name,de,ne,oe,te);return de.add(te.name,ce),ce}else console.warn(`region host with id ${te.targetId} not found for region named ${te.name}`)};/*
|
|
31
31
|
* @license
|
|
32
32
|
* BSD License
|
|
33
33
|
*
|
|
@@ -47,17 +47,17 @@
|
|
|
47
47
|
* @license
|
|
48
48
|
* Copyright 2019 Google LLC
|
|
49
49
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
50
|
-
*/const t$m=window,e$
|
|
50
|
+
*/const t$m=window,e$U=t$m.ShadowRoot&&(t$m.ShadyCSS===void 0||t$m.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$w=Symbol(),n$G=new WeakMap;let o$T=class{constructor(J,X,re){if(this._$cssResult$=!0,re!==s$w)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=J,this.t=X}get styleSheet(){let J=this.o;const X=this.t;if(e$U&&J===void 0){const re=X!==void 0&&X.length===1;re&&(J=n$G.get(X)),J===void 0&&((this.o=J=new CSSStyleSheet).replaceSync(this.cssText),re&&n$G.set(X,J))}return J}toString(){return this.cssText}};const r$K=te=>new o$T(typeof te=="string"?te:te+"",void 0,s$w),S$g=(te,J)=>{e$U?te.adoptedStyleSheets=J.map(X=>X instanceof CSSStyleSheet?X:X.styleSheet):J.forEach(X=>{const re=document.createElement("style"),ne=t$m.litNonce;ne!==void 0&&re.setAttribute("nonce",ne),re.textContent=X.cssText,te.appendChild(re)})},c$t=e$U?te=>te:te=>te instanceof CSSStyleSheet?(J=>{let X="";for(const re of J.cssRules)X+=re.cssText;return r$K(X)})(te):te;/**
|
|
51
51
|
* @license
|
|
52
52
|
* Copyright 2017 Google LLC
|
|
53
53
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
54
|
-
*/var s$v;const e$
|
|
54
|
+
*/var s$v;const e$T=window,r$J=e$T.trustedTypes,h$u=r$J?r$J.emptyScript:"",o$S=e$T.reactiveElementPolyfillSupport,n$F={toAttribute(te,J){switch(J){case Boolean:te=te?h$u:null;break;case Object:case Array:te=te==null?te:JSON.stringify(te)}return te},fromAttribute(te,J){let X=te;switch(J){case Boolean:X=te!==null;break;case Number:X=te===null?null:Number(te);break;case Object:case Array:try{X=JSON.parse(te)}catch{X=null}}return X}},a$q=(te,J)=>J!==te&&(J==J||te==te),l$z={attribute:!0,type:String,converter:n$F,reflect:!1,hasChanged:a$q},d$t="finalized";let u$v=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(J){var X;this.finalize(),((X=this.h)!==null&&X!==void 0?X:this.h=[]).push(J)}static get observedAttributes(){this.finalize();const J=[];return this.elementProperties.forEach((X,re)=>{const ne=this._$Ep(re,X);ne!==void 0&&(this._$Ev.set(ne,re),J.push(ne))}),J}static createProperty(J,X=l$z){if(X.state&&(X.attribute=!1),this.finalize(),this.elementProperties.set(J,X),!X.noAccessor&&!this.prototype.hasOwnProperty(J)){const re=typeof J=="symbol"?Symbol():"__"+J,ne=this.getPropertyDescriptor(J,re,X);ne!==void 0&&Object.defineProperty(this.prototype,J,ne)}}static getPropertyDescriptor(J,X,re){return{get(){return this[X]},set(ne){const oe=this[J];this[X]=ne,this.requestUpdate(J,oe,re)},configurable:!0,enumerable:!0}}static getPropertyOptions(J){return this.elementProperties.get(J)||l$z}static finalize(){if(this.hasOwnProperty(d$t))return!1;this[d$t]=!0;const J=Object.getPrototypeOf(this);if(J.finalize(),J.h!==void 0&&(this.h=[...J.h]),this.elementProperties=new Map(J.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const X=this.properties,re=[...Object.getOwnPropertyNames(X),...Object.getOwnPropertySymbols(X)];for(const ne of re)this.createProperty(ne,X[ne])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(J){const X=[];if(Array.isArray(J)){const re=new Set(J.flat(1/0).reverse());for(const ne of re)X.unshift(c$t(ne))}else J!==void 0&&X.push(c$t(J));return X}static _$Ep(J,X){const re=X.attribute;return re===!1?void 0:typeof re=="string"?re:typeof J=="string"?J.toLowerCase():void 0}_$Eu(){var J;this._$E_=new Promise(X=>this.enableUpdating=X),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(J=this.constructor.h)===null||J===void 0||J.forEach(X=>X(this))}addController(J){var X,re;((X=this._$ES)!==null&&X!==void 0?X:this._$ES=[]).push(J),this.renderRoot!==void 0&&this.isConnected&&((re=J.hostConnected)===null||re===void 0||re.call(J))}removeController(J){var X;(X=this._$ES)===null||X===void 0||X.splice(this._$ES.indexOf(J)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((J,X)=>{this.hasOwnProperty(X)&&(this._$Ei.set(X,this[X]),delete this[X])})}createRenderRoot(){var J;const X=(J=this.shadowRoot)!==null&&J!==void 0?J:this.attachShadow(this.constructor.shadowRootOptions);return S$g(X,this.constructor.elementStyles),X}connectedCallback(){var J;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(J=this._$ES)===null||J===void 0||J.forEach(X=>{var re;return(re=X.hostConnected)===null||re===void 0?void 0:re.call(X)})}enableUpdating(J){}disconnectedCallback(){var J;(J=this._$ES)===null||J===void 0||J.forEach(X=>{var re;return(re=X.hostDisconnected)===null||re===void 0?void 0:re.call(X)})}attributeChangedCallback(J,X,re){this._$AK(J,re)}_$EO(J,X,re=l$z){var ne;const oe=this.constructor._$Ep(J,re);if(oe!==void 0&&re.reflect===!0){const de=(((ne=re.converter)===null||ne===void 0?void 0:ne.toAttribute)!==void 0?re.converter:n$F).toAttribute(X,re.type);this._$El=J,de==null?this.removeAttribute(oe):this.setAttribute(oe,de),this._$El=null}}_$AK(J,X){var re;const ne=this.constructor,oe=ne._$Ev.get(J);if(oe!==void 0&&this._$El!==oe){const de=ne.getPropertyOptions(oe),ce=typeof de.converter=="function"?{fromAttribute:de.converter}:((re=de.converter)===null||re===void 0?void 0:re.fromAttribute)!==void 0?de.converter:n$F;this._$El=oe,this[oe]=ce.fromAttribute(X,de.type),this._$El=null}}requestUpdate(J,X,re){let ne=!0;J!==void 0&&(((re=re||this.constructor.getPropertyOptions(J)).hasChanged||a$q)(this[J],X)?(this._$AL.has(J)||this._$AL.set(J,X),re.reflect===!0&&this._$El!==J&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(J,re))):ne=!1),!this.isUpdatePending&&ne&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(X){Promise.reject(X)}const J=this.scheduleUpdate();return J!=null&&await J,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var J;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((ne,oe)=>this[oe]=ne),this._$Ei=void 0);let X=!1;const re=this._$AL;try{X=this.shouldUpdate(re),X?(this.willUpdate(re),(J=this._$ES)===null||J===void 0||J.forEach(ne=>{var oe;return(oe=ne.hostUpdate)===null||oe===void 0?void 0:oe.call(ne)}),this.update(re)):this._$Ek()}catch(ne){throw X=!1,this._$Ek(),ne}X&&this._$AE(re)}willUpdate(J){}_$AE(J){var X;(X=this._$ES)===null||X===void 0||X.forEach(re=>{var ne;return(ne=re.hostUpdated)===null||ne===void 0?void 0:ne.call(re)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(J)),this.updated(J)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(J){return!0}update(J){this._$EC!==void 0&&(this._$EC.forEach((X,re)=>this._$EO(re,this[re],X)),this._$EC=void 0),this._$Ek()}updated(J){}firstUpdated(J){}};u$v[d$t]=!0,u$v.elementProperties=new Map,u$v.elementStyles=[],u$v.shadowRootOptions={mode:"open"},o$S==null||o$S({ReactiveElement:u$v}),((s$v=e$T.reactiveElementVersions)!==null&&s$v!==void 0?s$v:e$T.reactiveElementVersions=[]).push("1.6.3");/**
|
|
55
55
|
* @license
|
|
56
56
|
* Copyright 2017 Google LLC
|
|
57
57
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
58
|
-
*/var t$l;const i$C=window,s$u=i$C.trustedTypes,e$
|
|
58
|
+
*/var t$l;const i$C=window,s$u=i$C.trustedTypes,e$S=s$u?s$u.createPolicy("lit-html",{createHTML:te=>te}):void 0,o$R="$lit$",n$E=`lit$${(Math.random()+"").slice(9)}$`,l$y="?"+n$E,h$t=`<${l$y}>`,r$I=document,u$u=()=>r$I.createComment(""),d$s=te=>te===null||typeof te!="object"&&typeof te!="function",c$s=Array.isArray,v$f=te=>c$s(te)||typeof(te==null?void 0:te[Symbol.iterator])=="function",a$p=`[
|
|
59
59
|
\f\r]`,f$p=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_$k=/-->/g,m$f=/>/g,p$f=RegExp(`>|${a$p}(?:([^\\s"'>=/]+)(${a$p}*=${a$p}*(?:[^
|
|
60
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),g$l=/'/g,$$a=/"/g,y$i=/^(?:script|style|textarea|title)$/i,T$3=Symbol.for("lit-noChange"),A$1=Symbol.for("lit-nothing"),E$5=new WeakMap,C$9=r$I.createTreeWalker(r$I,129,null,!1);function P$2(te,J){if(!Array.isArray(te)||!te.hasOwnProperty("raw"))throw Error("invalid template strings array");return e$
|
|
60
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),g$l=/'/g,$$a=/"/g,y$i=/^(?:script|style|textarea|title)$/i,T$3=Symbol.for("lit-noChange"),A$1=Symbol.for("lit-nothing"),E$5=new WeakMap,C$9=r$I.createTreeWalker(r$I,129,null,!1);function P$2(te,J){if(!Array.isArray(te)||!te.hasOwnProperty("raw"))throw Error("invalid template strings array");return e$S!==void 0?e$S.createHTML(J):J}const V$4=(te,J)=>{const X=te.length-1,re=[];let ne,oe=J===2?"<svg>":"",de=f$p;for(let ce=0;ce<X;ce++){const he=te[ce];let ue,pe,fe=-1,ge=0;for(;ge<he.length&&(de.lastIndex=ge,pe=de.exec(he),pe!==null);)ge=de.lastIndex,de===f$p?pe[1]==="!--"?de=_$k:pe[1]!==void 0?de=m$f:pe[2]!==void 0?(y$i.test(pe[2])&&(ne=RegExp("</"+pe[2],"g")),de=p$f):pe[3]!==void 0&&(de=p$f):de===p$f?pe[0]===">"?(de=ne??f$p,fe=-1):pe[1]===void 0?fe=-2:(fe=de.lastIndex-pe[2].length,ue=pe[1],de=pe[3]===void 0?p$f:pe[3]==='"'?$$a:g$l):de===$$a||de===g$l?de=p$f:de===_$k||de===m$f?de=f$p:(de=p$f,ne=void 0);const me=de===p$f&&te[ce+1].startsWith("/>")?" ":"";oe+=de===f$p?he+h$t:fe>=0?(re.push(ue),he.slice(0,fe)+o$R+he.slice(fe)+n$E+me):he+n$E+(fe===-2?(re.push(void 0),ce):me)}return[P$2(te,oe+(te[X]||"<?>")+(J===2?"</svg>":"")),re]};let N$3=class Or{constructor({strings:J,_$litType$:X},re){let ne;this.parts=[];let oe=0,de=0;const ce=J.length-1,he=this.parts,[ue,pe]=V$4(J,X);if(this.el=Or.createElement(ue,re),C$9.currentNode=this.el.content,X===2){const fe=this.el.content,ge=fe.firstChild;ge.remove(),fe.append(...ge.childNodes)}for(;(ne=C$9.nextNode())!==null&&he.length<ce;){if(ne.nodeType===1){if(ne.hasAttributes()){const fe=[];for(const ge of ne.getAttributeNames())if(ge.endsWith(o$R)||ge.startsWith(n$E)){const me=pe[de++];if(fe.push(ge),me!==void 0){const ve=ne.getAttribute(me.toLowerCase()+o$R).split(n$E),be=/([.?@])?(.*)/.exec(me);he.push({type:1,index:oe,name:be[2],strings:ve,ctor:be[1]==="."?H$2:be[1]==="?"?L$5:be[1]==="@"?z$3:k$7})}else he.push({type:6,index:oe})}for(const ge of fe)ne.removeAttribute(ge)}if(y$i.test(ne.tagName)){const fe=ne.textContent.split(n$E),ge=fe.length-1;if(ge>0){ne.textContent=s$u?s$u.emptyScript:"";for(let me=0;me<ge;me++)ne.append(fe[me],u$u()),C$9.nextNode(),he.push({type:2,index:++oe});ne.append(fe[ge],u$u())}}}else if(ne.nodeType===8)if(ne.data===l$y)he.push({type:2,index:oe});else{let fe=-1;for(;(fe=ne.data.indexOf(n$E,fe+1))!==-1;)he.push({type:7,index:oe}),fe+=n$E.length-1}oe++}}static createElement(J,X){const re=r$I.createElement("template");return re.innerHTML=J,re}};function S$f(te,J,X=te,re){var ne,oe,de,ce;if(J===T$3)return J;let he=re!==void 0?(ne=X._$Co)===null||ne===void 0?void 0:ne[re]:X._$Cl;const ue=d$s(J)?void 0:J._$litDirective$;return(he==null?void 0:he.constructor)!==ue&&((oe=he==null?void 0:he._$AO)===null||oe===void 0||oe.call(he,!1),ue===void 0?he=void 0:(he=new ue(te),he._$AT(te,X,re)),re!==void 0?((de=(ce=X)._$Co)!==null&&de!==void 0?de:ce._$Co=[])[re]=he:X._$Cl=he),he!==void 0&&(J=S$f(te,he._$AS(te,J.values),he,re)),J}let M$4=class{constructor(J,X){this._$AV=[],this._$AN=void 0,this._$AD=J,this._$AM=X}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(J){var X;const{el:{content:re},parts:ne}=this._$AD,oe=((X=J==null?void 0:J.creationScope)!==null&&X!==void 0?X:r$I).importNode(re,!0);C$9.currentNode=oe;let de=C$9.nextNode(),ce=0,he=0,ue=ne[0];for(;ue!==void 0;){if(ce===ue.index){let pe;ue.type===2?pe=new R$1(de,de.nextSibling,this,J):ue.type===1?pe=new ue.ctor(de,ue.name,ue.strings,this,J):ue.type===6&&(pe=new Z$2(de,this,J)),this._$AV.push(pe),ue=ne[++he]}ce!==(ue==null?void 0:ue.index)&&(de=C$9.nextNode(),ce++)}return C$9.currentNode=r$I,oe}v(J){let X=0;for(const re of this._$AV)re!==void 0&&(re.strings!==void 0?(re._$AI(J,re,X),X+=re.strings.length-2):re._$AI(J[X])),X++}},R$1=class qr{constructor(J,X,re,ne){var oe;this.type=2,this._$AH=A$1,this._$AN=void 0,this._$AA=J,this._$AB=X,this._$AM=re,this.options=ne,this._$Cp=(oe=ne==null?void 0:ne.isConnected)===null||oe===void 0||oe}get _$AU(){var J,X;return(X=(J=this._$AM)===null||J===void 0?void 0:J._$AU)!==null&&X!==void 0?X:this._$Cp}get parentNode(){let J=this._$AA.parentNode;const X=this._$AM;return X!==void 0&&(J==null?void 0:J.nodeType)===11&&(J=X.parentNode),J}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(J,X=this){J=S$f(this,J,X),d$s(J)?J===A$1||J==null||J===""?(this._$AH!==A$1&&this._$AR(),this._$AH=A$1):J!==this._$AH&&J!==T$3&&this._(J):J._$litType$!==void 0?this.g(J):J.nodeType!==void 0?this.$(J):v$f(J)?this.T(J):this._(J)}k(J){return this._$AA.parentNode.insertBefore(J,this._$AB)}$(J){this._$AH!==J&&(this._$AR(),this._$AH=this.k(J))}_(J){this._$AH!==A$1&&d$s(this._$AH)?this._$AA.nextSibling.data=J:this.$(r$I.createTextNode(J)),this._$AH=J}g(J){var X;const{values:re,_$litType$:ne}=J,oe=typeof ne=="number"?this._$AC(J):(ne.el===void 0&&(ne.el=N$3.createElement(P$2(ne.h,ne.h[0]),this.options)),ne);if(((X=this._$AH)===null||X===void 0?void 0:X._$AD)===oe)this._$AH.v(re);else{const de=new M$4(oe,this),ce=de.u(this.options);de.v(re),this.$(ce),this._$AH=de}}_$AC(J){let X=E$5.get(J.strings);return X===void 0&&E$5.set(J.strings,X=new N$3(J)),X}T(J){c$s(this._$AH)||(this._$AH=[],this._$AR());const X=this._$AH;let re,ne=0;for(const oe of J)ne===X.length?X.push(re=new qr(this.k(u$u()),this.k(u$u()),this,this.options)):re=X[ne],re._$AI(oe),ne++;ne<X.length&&(this._$AR(re&&re._$AB.nextSibling,ne),X.length=ne)}_$AR(J=this._$AA.nextSibling,X){var re;for((re=this._$AP)===null||re===void 0||re.call(this,!1,!0,X);J&&J!==this._$AB;){const ne=J.nextSibling;J.remove(),J=ne}}setConnected(J){var X;this._$AM===void 0&&(this._$Cp=J,(X=this._$AP)===null||X===void 0||X.call(this,J))}},k$7=class{constructor(J,X,re,ne,oe){this.type=1,this._$AH=A$1,this._$AN=void 0,this.element=J,this.name=X,this._$AM=ne,this.options=oe,re.length>2||re[0]!==""||re[1]!==""?(this._$AH=Array(re.length-1).fill(new String),this.strings=re):this._$AH=A$1}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(J,X=this,re,ne){const oe=this.strings;let de=!1;if(oe===void 0)J=S$f(this,J,X,0),de=!d$s(J)||J!==this._$AH&&J!==T$3,de&&(this._$AH=J);else{const ce=J;let he,ue;for(J=oe[0],he=0;he<oe.length-1;he++)ue=S$f(this,ce[re+he],X,he),ue===T$3&&(ue=this._$AH[he]),de||(de=!d$s(ue)||ue!==this._$AH[he]),ue===A$1?J=A$1:J!==A$1&&(J+=(ue??"")+oe[he+1]),this._$AH[he]=ue}de&&!ne&&this.j(J)}j(J){J===A$1?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,J??"")}},H$2=class extends k$7{constructor(){super(...arguments),this.type=3}j(J){this.element[this.name]=J===A$1?void 0:J}};const I$2=s$u?s$u.emptyScript:"";let L$5=class extends k$7{constructor(){super(...arguments),this.type=4}j(J){J&&J!==A$1?this.element.setAttribute(this.name,I$2):this.element.removeAttribute(this.name)}},z$3=class extends k$7{constructor(J,X,re,ne,oe){super(J,X,re,ne,oe),this.type=5}_$AI(J,X=this){var re;if((J=(re=S$f(this,J,X,0))!==null&&re!==void 0?re:A$1)===T$3)return;const ne=this._$AH,oe=J===A$1&&ne!==A$1||J.capture!==ne.capture||J.once!==ne.once||J.passive!==ne.passive,de=J!==A$1&&(ne===A$1||oe);oe&&this.element.removeEventListener(this.name,this,ne),de&&this.element.addEventListener(this.name,this,J),this._$AH=J}handleEvent(J){var X,re;typeof this._$AH=="function"?this._$AH.call((re=(X=this.options)===null||X===void 0?void 0:X.host)!==null&&re!==void 0?re:this.element,J):this._$AH.handleEvent(J)}},Z$2=class{constructor(J,X,re){this.element=J,this.type=6,this._$AN=void 0,this._$AM=X,this.options=re}get _$AU(){return this._$AM._$AU}_$AI(J){S$f(this,J)}};const B$5=i$C.litHtmlPolyfillSupport;B$5==null||B$5(N$3,R$1),((t$l=i$C.litHtmlVersions)!==null&&t$l!==void 0?t$l:i$C.litHtmlVersions=[]).push("2.8.0");const D$2=(te,J,X)=>{var re,ne;const oe=(re=X==null?void 0:X.renderBefore)!==null&&re!==void 0?re:J;let de=oe._$litPart$;if(de===void 0){const ce=(ne=X==null?void 0:X.renderBefore)!==null&&ne!==void 0?ne:null;oe._$litPart$=de=new R$1(J.insertBefore(u$u(),ce),ce,void 0,X??{})}return de._$AI(te),de};/**
|
|
61
61
|
* @license
|
|
62
62
|
* Copyright 2017 Google LLC
|
|
63
63
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
* @license
|
|
66
66
|
* Copyright 2017 Google LLC
|
|
67
67
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
68
|
-
*/const i$B=(te,J)=>J.kind==="method"&&J.descriptor&&!("value"in J.descriptor)?{...J,finisher(X){X.createProperty(J.key,te)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:J.key,initializer(){typeof J.initializer=="function"&&(this[J.key]=J.initializer.call(this))},finisher(X){X.createProperty(J.key,te)}},e$
|
|
68
|
+
*/const i$B=(te,J)=>J.kind==="method"&&J.descriptor&&!("value"in J.descriptor)?{...J,finisher(X){X.createProperty(J.key,te)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:J.key,initializer(){typeof J.initializer=="function"&&(this[J.key]=J.initializer.call(this))},finisher(X){X.createProperty(J.key,te)}},e$R=(te,J,X)=>{J.constructor.createProperty(X,te)};function n$C(te){return(J,X)=>X!==void 0?e$R(te,J,X):i$B(te,J)}/**
|
|
69
69
|
* @license
|
|
70
70
|
* Copyright 2021 Google LLC
|
|
71
71
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -73,11 +73,11 @@
|
|
|
73
73
|
* @license
|
|
74
74
|
* Copyright 2019 Google LLC
|
|
75
75
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
76
|
-
*/const t$k=globalThis,e$
|
|
76
|
+
*/const t$k=globalThis,e$Q=t$k.ShadowRoot&&(t$k.ShadyCSS===void 0||t$k.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$r=Symbol(),o$P=new WeakMap;let n$A=class{constructor(J,X,re){if(this._$cssResult$=!0,re!==s$r)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=J,this.t=X}get styleSheet(){let J=this.o;const X=this.t;if(e$Q&&J===void 0){const re=X!==void 0&&X.length===1;re&&(J=o$P.get(X)),J===void 0&&((this.o=J=new CSSStyleSheet).replaceSync(this.cssText),re&&o$P.set(X,J))}return J}toString(){return this.cssText}};const r$H=te=>new n$A(typeof te=="string"?te:te+"",void 0,s$r),i$A=(te,...J)=>{const X=te.length===1?te[0]:J.reduce((re,ne,oe)=>re+(de=>{if(de._$cssResult$===!0)return de.cssText;if(typeof de=="number")return de;throw Error("Value passed to 'css' function must be a 'css' function result: "+de+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(ne)+te[oe+1],te[0]);return new n$A(X,te,s$r)},S$e=(te,J)=>{if(e$Q)te.adoptedStyleSheets=J.map(X=>X instanceof CSSStyleSheet?X:X.styleSheet);else for(const X of J){const re=document.createElement("style"),ne=t$k.litNonce;ne!==void 0&&re.setAttribute("nonce",ne),re.textContent=X.cssText,te.appendChild(re)}},c$r=e$Q?te=>te:te=>te instanceof CSSStyleSheet?(J=>{let X="";for(const re of J.cssRules)X+=re.cssText;return r$H(X)})(te):te;/**
|
|
77
77
|
* @license
|
|
78
78
|
* Copyright 2017 Google LLC
|
|
79
79
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
80
|
-
*/const{is:i$z,defineProperty:e$
|
|
80
|
+
*/const{is:i$z,defineProperty:e$P,getOwnPropertyDescriptor:r$G,getOwnPropertyNames:h$s,getOwnPropertySymbols:o$O,getPrototypeOf:n$z}=Object,a$n=globalThis,c$q=a$n.trustedTypes,l$t=c$q?c$q.emptyScript:"",p$e=a$n.reactiveElementPolyfillSupport,d$q=(te,J)=>te,u$r={toAttribute(te,J){switch(J){case Boolean:te=te?l$t:null;break;case Object:case Array:te=te==null?te:JSON.stringify(te)}return te},fromAttribute(te,J){let X=te;switch(J){case Boolean:X=te!==null;break;case Number:X=te===null?null:Number(te);break;case Object:case Array:try{X=JSON.parse(te)}catch{X=null}}return X}},f$o=(te,J)=>!i$z(te,J),y$h={attribute:!0,type:String,converter:u$r,reflect:!1,hasChanged:f$o};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),a$n.litPropertyMetadata??(a$n.litPropertyMetadata=new WeakMap);let b$s=class extends HTMLElement{static addInitializer(J){this._$Ei(),(this.l??(this.l=[])).push(J)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(J,X=y$h){if(X.state&&(X.attribute=!1),this._$Ei(),this.elementProperties.set(J,X),!X.noAccessor){const re=Symbol(),ne=this.getPropertyDescriptor(J,re,X);ne!==void 0&&e$P(this.prototype,J,ne)}}static getPropertyDescriptor(J,X,re){const{get:ne,set:oe}=r$G(this.prototype,J)??{get(){return this[X]},set(de){this[X]=de}};return{get(){return ne==null?void 0:ne.call(this)},set(de){const ce=ne==null?void 0:ne.call(this);oe.call(this,de),this.requestUpdate(J,ce,re)},configurable:!0,enumerable:!0}}static getPropertyOptions(J){return this.elementProperties.get(J)??y$h}static _$Ei(){if(this.hasOwnProperty(d$q("elementProperties")))return;const J=n$z(this);J.finalize(),J.l!==void 0&&(this.l=[...J.l]),this.elementProperties=new Map(J.elementProperties)}static finalize(){if(this.hasOwnProperty(d$q("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(d$q("properties"))){const X=this.properties,re=[...h$s(X),...o$O(X)];for(const ne of re)this.createProperty(ne,X[ne])}const J=this[Symbol.metadata];if(J!==null){const X=litPropertyMetadata.get(J);if(X!==void 0)for(const[re,ne]of X)this.elementProperties.set(re,ne)}this._$Eh=new Map;for(const[X,re]of this.elementProperties){const ne=this._$Eu(X,re);ne!==void 0&&this._$Eh.set(ne,X)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(J){const X=[];if(Array.isArray(J)){const re=new Set(J.flat(1/0).reverse());for(const ne of re)X.unshift(c$r(ne))}else J!==void 0&&X.push(c$r(J));return X}static _$Eu(J,X){const re=X.attribute;return re===!1?void 0:typeof re=="string"?re:typeof J=="string"?J.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var J;this._$ES=new Promise(X=>this.enableUpdating=X),this._$AL=new Map,this._$E_(),this.requestUpdate(),(J=this.constructor.l)==null||J.forEach(X=>X(this))}addController(J){var X;(this._$EO??(this._$EO=new Set)).add(J),this.renderRoot!==void 0&&this.isConnected&&((X=J.hostConnected)==null||X.call(J))}removeController(J){var X;(X=this._$EO)==null||X.delete(J)}_$E_(){const J=new Map,X=this.constructor.elementProperties;for(const re of X.keys())this.hasOwnProperty(re)&&(J.set(re,this[re]),delete this[re]);J.size>0&&(this._$Ep=J)}createRenderRoot(){const J=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return S$e(J,this.constructor.elementStyles),J}connectedCallback(){var J;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(J=this._$EO)==null||J.forEach(X=>{var re;return(re=X.hostConnected)==null?void 0:re.call(X)})}enableUpdating(J){}disconnectedCallback(){var J;(J=this._$EO)==null||J.forEach(X=>{var re;return(re=X.hostDisconnected)==null?void 0:re.call(X)})}attributeChangedCallback(J,X,re){this._$AK(J,re)}_$EC(J,X){var oe;const re=this.constructor.elementProperties.get(J),ne=this.constructor._$Eu(J,re);if(ne!==void 0&&re.reflect===!0){const de=(((oe=re.converter)==null?void 0:oe.toAttribute)!==void 0?re.converter:u$r).toAttribute(X,re.type);this._$Em=J,de==null?this.removeAttribute(ne):this.setAttribute(ne,de),this._$Em=null}}_$AK(J,X){var oe;const re=this.constructor,ne=re._$Eh.get(J);if(ne!==void 0&&this._$Em!==ne){const de=re.getPropertyOptions(ne),ce=typeof de.converter=="function"?{fromAttribute:de.converter}:((oe=de.converter)==null?void 0:oe.fromAttribute)!==void 0?de.converter:u$r;this._$Em=ne,this[ne]=ce.fromAttribute(X,de.type),this._$Em=null}}requestUpdate(J,X,re){if(J!==void 0){if(re??(re=this.constructor.getPropertyOptions(J)),!(re.hasChanged??f$o)(this[J],X))return;this.P(J,X,re)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(J,X,re){this._$AL.has(J)||this._$AL.set(J,X),re.reflect===!0&&this._$Em!==J&&(this._$Ej??(this._$Ej=new Set)).add(J)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(X){Promise.reject(X)}const J=this.scheduleUpdate();return J!=null&&await J,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var re;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[oe,de]of this._$Ep)this[oe]=de;this._$Ep=void 0}const ne=this.constructor.elementProperties;if(ne.size>0)for(const[oe,de]of ne)de.wrapped!==!0||this._$AL.has(oe)||this[oe]===void 0||this.P(oe,this[oe],de)}let J=!1;const X=this._$AL;try{J=this.shouldUpdate(X),J?(this.willUpdate(X),(re=this._$EO)==null||re.forEach(ne=>{var oe;return(oe=ne.hostUpdate)==null?void 0:oe.call(ne)}),this.update(X)):this._$EU()}catch(ne){throw J=!1,this._$EU(),ne}J&&this._$AE(X)}willUpdate(J){}_$AE(J){var X;(X=this._$EO)==null||X.forEach(re=>{var ne;return(ne=re.hostUpdated)==null?void 0:ne.call(re)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(J)),this.updated(J)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(J){return!0}update(J){this._$Ej&&(this._$Ej=this._$Ej.forEach(X=>this._$EC(X,this[X]))),this._$EU()}updated(J){}firstUpdated(J){}};b$s.elementStyles=[],b$s.shadowRootOptions={mode:"open"},b$s[d$q("elementProperties")]=new Map,b$s[d$q("finalized")]=new Map,p$e==null||p$e({ReactiveElement:b$s}),(a$n.reactiveElementVersions??(a$n.reactiveElementVersions=[])).push("2.0.4");/**
|
|
81
81
|
* @license
|
|
82
82
|
* Copyright 2017 Google LLC
|
|
83
83
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -99,7 +99,15 @@
|
|
|
99
99
|
* @license
|
|
100
100
|
* Copyright 2017 Google LLC
|
|
101
101
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
102
|
-
*/function r$E(te){return n$x({...te,state:!0,attribute:!1})}const y$g=te=>j$2(te,p$h);let a$m=class{constructor(){this.viewsByRegion={},this.regions={}}registerRegion(J,X){this.regions[J]=[...this.regions[J]||[],X]}unregisterRegion(J,X){this.regions[J]=this.getRegionsByName(J).filter(re=>re!==X)}registerView(J,X,re){this.viewsByRegion[J]=[...this.viewsByRegion[J]||[],{key:X,view:re}]}getRegisteredViews(J){return this.viewsByRegion[J]||[]}getRegionsByName(J){return this.regions[J]||[]}destroy(){this.viewsByRegion={},this.regions={}}clear(){this.viewsByRegion={}}},n$w=class Rr{constructor(J){this._viewRegistry=J,this._regions={}}add(J,X){if(this.getRegion(J))throw new Error("A region with the same name already exists");return this._regions[J]=X,this._viewRegistry.registerRegion(J,X),this}getRegion(J){return this._regions[J]}remove(J){let X,re="";return typeof J=="string"?(X=this.getRegion(J),re=J,delete this._regions[J]):typeof J=="object"&&(re=Object.keys(this._regions).find(ne=>this._regions[ne]===J),re&&(X=J,delete this._regions[re])),re&&X&&this._viewRegistry.unregisterRegion(re,X),X}addViewToRegion(J,X,re){const ne=this.getRegion(J);if(!ne)throw new Error(`Couldn't find a region with name: ${J}`);return ne.addView(X,re),this}registerViewWithRegion(J,X,re){return this._viewRegistry.registerView(J,X,re),this._viewRegistry.getRegionsByName(J).forEach(ne=>ne.addView(X,re)),this}getRegisteredViews(J){return this._viewRegistry.getRegisteredViews(J)}clear(){return Object.values(this._viewRegistry.regions).forEach(J=>{J!=null&&J.length&&Object.keys(J[0].views).forEach(X=>{var re;return(re=J[0])==null?void 0:re.removeView(X)})}),this}destroy(){return this.clear(),Object.values(this._viewRegistry.regions).forEach(J=>this.remove(J[0])),this._regions={},this}createRegionManager(){return new Rr(this._viewRegistry)}},h$p=class extends n$w{constructor(J){const X=new a$m;super(X),this._name=J}clear(){return super.clear(),this._viewRegistry.clear(),this}destroy(){return super.destroy(),this._viewRegistry.destroy(),this}};const x$5=te=>new h$p(te),c$o=te=>te.importer(),l$s=te=>async(J,X)=>{try{const re=await c$o(J);console.debug("imported plugin: ",J.pluginId);const ne=X(J);return await te(ne)(re),console.debug("initialized plugin: ",J.pluginId),{dispose:()=>w$3(ne)(re)}}catch(re){console.error(re)}},u$q=te=>J=>J.initialize(te),w$3=te=>J=>J.dispose(te),v$d=async(te,J)=>{if(!(te!=null&&te.length))throw new Error("No plugins to bootstrap");const X=re=>l$s(u$q)(re,J);return(await Promise.allSettled(te.map(X))).map(re=>re.status==="fulfilled"?re.value:null)},primariaShellId="primaria-shell";var __extends$2=function(){var te=function(J,X){return te=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(re,ne){re.__proto__=ne}||function(re,ne){for(var oe in ne)Object.prototype.hasOwnProperty.call(ne,oe)&&(re[oe]=ne[oe])},te(J,X)};return function(J,X){if(typeof X!="function"&&X!==null)throw new TypeError("Class extends value "+String(X)+" is not a constructor or null");te(J,X);function re(){this.constructor=J}J.prototype=X===null?Object.create(X):(re.prototype=X.prototype,new re)}}(),__spreadArray$3=function(te,J,X){if(X||arguments.length===2)for(var re=0,ne=J.length,oe;re<ne;re++)(oe||!(re in J))&&(oe||(oe=Array.prototype.slice.call(J,0,re)),oe[re]=J[re]);return te.concat(oe||Array.prototype.slice.call(J))},OrderMappings=function(){function te(){this._mappings=[]}return te.prototype.add=function(J){J.order!==0&&(J.order=this._mappings.length),this._mappings.push(J),this.onAdded(J)},te.prototype.clear=function(){this._mappings=[]},te}();function byOrder(te,J){return(J.order||0)-(te.order||0)}var NotificationMappings=function(te){__extends$2(J,te);function J(){return te!==null&&te.apply(this,arguments)||this}return J.prototype.onAdded=function(X){var re=X.handler.prototype.constructor.name;mediatorSettings.resolver.add(re,X.handler)},J.prototype.setOrder=function(X,re){for(var ne=this.getAll(X),oe=0,de=ne;oe<de.length;oe++){var ce=de[oe];ce.order=re.indexOf(ce.handler)}},J.prototype.getAll=function(X){var re=this._mappings.filter(function(ne){return ne.notification===X});if(re.length===0)throw new Error("Cannot find notification handler with key: ".concat(X.prototype.name));return re.sort(byOrder)},J}(OrderMappings),BehaviorMappings=function(te){__extends$2(J,te);function J(){return te!==null&&te.apply(this,arguments)||this}return J.prototype.onAdded=function(X){var re=X.behavior.prototype.constructor.name;mediatorSettings.resolver.add(re,X.behavior)},J.prototype.setOrder=function(X){for(var re=this.getAll(),ne=0,oe=re;ne<oe.length;ne++){var de=oe[ne];de.order=X.indexOf(de.behavior)}},J.prototype.getAll=function(){var X=__spreadArray$3([],this._mappings,!0);return X.sort(byOrder)},J}(OrderMappings),Dispatcher=function(){function te(){this._notifications=new NotificationMappings,this._behaviors=new BehaviorMappings}return Object.defineProperty(te.prototype,"notifications",{get:function(){return this._notifications},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"behaviors",{get:function(){return this._behaviors},enumerable:!1,configurable:!0}),te}(),HandlerInstance=function(){function te(J,X){this._name=J,this._value=X}return Object.defineProperty(te.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"value",{get:function(){return this._value},enumerable:!1,configurable:!0}),te}(),Resolver=function(){function te(){this._instances=[]}return te.prototype.resolve=function(J){var X=this._instances.find(function(ne){return ne.name===J});if(!X)throw new Error("Cannot find element with key: ".concat(J));var re=X.value;return new re},te.prototype.add=function(J,X){var re=this._instances.find(function(ne){return ne.name===J});if(re===void 0)this._instances.push(new HandlerInstance(J,X));else throw new Error("The key ".concat(J," is already been added"))},te.prototype.remove=function(J){var X=this._instances.findIndex(function(re){return re.name===J});X>=0&&this._instances.splice(X,1)},te.prototype.clear=function(){this._instances=[]},te}(),MediatrSettings=function(){function te(){this.resolver=new Resolver,this.dispatcher=new Dispatcher}return te}(),mediatorSettings=new MediatrSettings,requestHandler=function(te){return function(J){var X=te.prototype.constructor.name;mediatorSettings.resolver.add(X,J)}},notificationHandler=function(te){return function(J){mediatorSettings.dispatcher.notifications.add({notification:te,handler:J})}},__awaiter$4=function(te,J,X,re){function ne(oe){return oe instanceof X?oe:new X(function(de){de(oe)})}return new(X||(X=Promise))(function(oe,de){function ce(pe){try{ue(re.next(pe))}catch(fe){de(fe)}}function he(pe){try{ue(re.throw(pe))}catch(fe){de(fe)}}function ue(pe){pe.done?oe(pe.value):ne(pe.value).then(ce,he)}ue((re=re.apply(te,J||[])).next())})},__generator$4=function(te,J){var X={label:0,sent:function(){if(oe[0]&1)throw oe[1];return oe[1]},trys:[],ops:[]},re,ne,oe,de;return de={next:ce(0),throw:ce(1),return:ce(2)},typeof Symbol=="function"&&(de[Symbol.iterator]=function(){return this}),de;function ce(ue){return function(pe){return he([ue,pe])}}function he(ue){if(re)throw new TypeError("Generator is already executing.");for(;de&&(de=0,ue[0]&&(X=0)),X;)try{if(re=1,ne&&(oe=ue[0]&2?ne.return:ue[0]?ne.throw||((oe=ne.return)&&oe.call(ne),0):ne.next)&&!(oe=oe.call(ne,ue[1])).done)return oe;switch(ne=0,oe&&(ue=[ue[0]&2,oe.value]),ue[0]){case 0:case 1:oe=ue;break;case 4:return X.label++,{value:ue[1],done:!1};case 5:X.label++,ne=ue[1],ue=[0];continue;case 7:ue=X.ops.pop(),X.trys.pop();continue;default:if(oe=X.trys,!(oe=oe.length>0&&oe[oe.length-1])&&(ue[0]===6||ue[0]===2)){X=0;continue}if(ue[0]===3&&(!oe||ue[1]>oe[0]&&ue[1]<oe[3])){X.label=ue[1];break}if(ue[0]===6&&X.label<oe[1]){X.label=oe[1],oe=ue;break}if(oe&&X.label<oe[2]){X.label=oe[2],X.ops.push(ue);break}oe[2]&&X.ops.pop(),X.trys.pop();continue}ue=J.call(te,X)}catch(pe){ue=[6,pe],ne=0}finally{re=oe=0}if(ue[0]&5)throw ue[1];return{value:ue[0]?ue[1]:void 0,done:!0}}},Mediator=function(){function te(){}return te.prototype.send=function(J){return __awaiter$4(this,void 0,void 0,function(){var X,re,ne,oe,de,ce=this;return __generator$4(this,function(he){switch(he.label){case 0:return X=J.constructor.name,re=mediatorSettings.resolver.resolve(X),ne=mediatorSettings.dispatcher.behaviors.getAll().map(function(ue){return ue.behavior}),oe=0,de=function(){return __awaiter$4(ce,void 0,void 0,function(){var ue,pe;return __generator$4(this,function(fe){switch(fe.label){case 0:return oe<ne.length?(ue=ne[oe],pe=mediatorSettings.resolver.resolve(ue.name),oe++,[4,pe.handle(J,de)]):[3,2];case 1:return[2,fe.sent()];case 2:return[4,re.handle(J)];case 3:return[2,fe.sent()]}})})},[4,de()];case 1:return[2,he.sent()]}})})},te.prototype.publish=function(J){return __awaiter$4(this,void 0,void 0,function(){var X,re=this;return __generator$4(this,function(ne){switch(ne.label){case 0:return X=mediatorSettings.dispatcher.notifications.getAll(J.constructor),[4,Promise.all(X.map(function(oe){return __awaiter$4(re,void 0,void 0,function(){var de;return __generator$4(this,function(ce){return de=mediatorSettings.resolver.resolve(oe.handler.name),[2,de.handle(J)]})})}))];case 1:return ne.sent(),[2]}})})},te}();const disposableFactory=te=>({dispose:()=>{mediatorSettings.resolver.remove(te.name);const J=mediatorSettings.dispatcher.notifications._mappings.findIndex(X=>X.handler.name===te.name);J>-1&&mediatorSettings.dispatcher.notifications._mappings.splice(J,1)}});class Broker{constructor(){this.eventConstructorMap=new Map,this.requestConstructorMap=new Map,this.mediator=new Mediator,mediatorSettings.resolver.clear()}send(J,X){const re=typeof J=="string"?this.getRequest(J,X):J;return this.mediator.send(re)}publish(J,X){const re=typeof J=="string"?this.getEvent(J,X):J,ne=re.constructor||Object.getPrototypeOf(re).constructor;return mediatorSettings.dispatcher.notifications._mappings.filter(de=>de.notification===ne).length?this.mediator.publish(re):Promise.resolve()}subscribe(J,X){const re=typeof J=="function"?J:this.getEventType(J),ne=createDynamicEventHandler(X);return notificationHandler(re)(ne),disposableFactory(ne)}registerRequest(J,X){const re=typeof J=="function"?J:this.getRequestType(J),ne=createDynamicRequestHandler(X);return requestHandler(re)(ne),disposableFactory(ne)}getEvent(J,X){const re=this.getEventType(J);return new re(X)}getRequest(J,X){const re=this.getRequestType(J);return new re(X)}getEventType(J){if(!this.eventConstructorMap.has(J)){const X=createDynamicEventClass(J);this.eventConstructorMap.set(J,X)}return this.eventConstructorMap.get(J)}getRequestType(J){if(!this.requestConstructorMap.has(J)){const X=createDynamicRequestClass(J);this.requestConstructorMap.set(J,X)}return this.requestConstructorMap.get(J)}}const createDynamicEventClass=te=>createDynamicMessageClass(te,"Event"),createDynamicRequestClass=te=>createDynamicMessageClass(te,"Request"),createDynamicMessageClass=(te,J)=>new Function(`return class ${J}_${te} {
|
|
102
|
+
*/function r$E(te){return n$x({...te,state:!0,attribute:!1})}/**
|
|
103
|
+
* @license
|
|
104
|
+
* Copyright 2017 Google LLC
|
|
105
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
106
|
+
*/const e$O=(te,J,X)=>(X.configurable=!0,X.enumerable=!0,Reflect.decorate&&typeof J!="object"&&Object.defineProperty(te,J,X),X);/**
|
|
107
|
+
* @license
|
|
108
|
+
* Copyright 2017 Google LLC
|
|
109
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
110
|
+
*/function e$N(te,J){return(X,re,ne)=>{const oe=de=>{var ce;return((ce=de.renderRoot)==null?void 0:ce.querySelector(te))??null};return e$O(X,re,{get(){return oe(this)}})}}const y$g=te=>j$2(te,p$h);let a$m=class{constructor(){this.viewsByRegion={},this.regions={}}registerRegion(J,X){this.regions[J]=[...this.regions[J]||[],X]}unregisterRegion(J,X){this.regions[J]=this.getRegionsByName(J).filter(re=>re!==X)}registerView(J,X,re){this.viewsByRegion[J]=[...this.viewsByRegion[J]||[],{key:X,view:re}]}getRegisteredViews(J){return this.viewsByRegion[J]||[]}getRegionsByName(J){return this.regions[J]||[]}destroy(){this.viewsByRegion={},this.regions={}}clear(){this.viewsByRegion={}}},n$w=class Rr{constructor(J){this._viewRegistry=J,this._regions={}}add(J,X){if(this.getRegion(J))throw new Error("A region with the same name already exists");return this._regions[J]=X,this._viewRegistry.registerRegion(J,X),this}getRegion(J){return this._regions[J]}remove(J){let X,re="";return typeof J=="string"?(X=this.getRegion(J),re=J,delete this._regions[J]):typeof J=="object"&&(re=Object.keys(this._regions).find(ne=>this._regions[ne]===J),re&&(X=J,delete this._regions[re])),re&&X&&this._viewRegistry.unregisterRegion(re,X),X}addViewToRegion(J,X,re){const ne=this.getRegion(J);if(!ne)throw new Error(`Couldn't find a region with name: ${J}`);return ne.addView(X,re),this}registerViewWithRegion(J,X,re){return this._viewRegistry.registerView(J,X,re),this._viewRegistry.getRegionsByName(J).forEach(ne=>ne.addView(X,re)),this}getRegisteredViews(J){return this._viewRegistry.getRegisteredViews(J)}clear(){return Object.values(this._viewRegistry.regions).forEach(J=>{J!=null&&J.length&&Object.keys(J[0].views).forEach(X=>{var re;return(re=J[0])==null?void 0:re.removeView(X)})}),this}destroy(){return this.clear(),Object.values(this._viewRegistry.regions).forEach(J=>this.remove(J[0])),this._regions={},this}createRegionManager(){return new Rr(this._viewRegistry)}},h$p=class extends n$w{constructor(J){const X=new a$m;super(X),this._name=J}clear(){return super.clear(),this._viewRegistry.clear(),this}destroy(){return super.destroy(),this._viewRegistry.destroy(),this}};const x$5=te=>new h$p(te),c$o=te=>te.importer(),l$s=te=>async(J,X)=>{try{const re=await c$o(J);console.debug("imported plugin: ",J.pluginId);const ne=X(J);return await te(ne)(re),console.debug("initialized plugin: ",J.pluginId),{dispose:()=>w$3(ne)(re)}}catch(re){console.error(re)}},u$q=te=>J=>J.initialize(te),w$3=te=>J=>J.dispose(te),v$d=async(te,J)=>{if(!(te!=null&&te.length))throw new Error("No plugins to bootstrap");const X=re=>l$s(u$q)(re,J);return(await Promise.allSettled(te.map(X))).map(re=>re.status==="fulfilled"?re.value:null)},primariaShellId="primaria-shell";var __extends$2=function(){var te=function(J,X){return te=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(re,ne){re.__proto__=ne}||function(re,ne){for(var oe in ne)Object.prototype.hasOwnProperty.call(ne,oe)&&(re[oe]=ne[oe])},te(J,X)};return function(J,X){if(typeof X!="function"&&X!==null)throw new TypeError("Class extends value "+String(X)+" is not a constructor or null");te(J,X);function re(){this.constructor=J}J.prototype=X===null?Object.create(X):(re.prototype=X.prototype,new re)}}(),__spreadArray$3=function(te,J,X){if(X||arguments.length===2)for(var re=0,ne=J.length,oe;re<ne;re++)(oe||!(re in J))&&(oe||(oe=Array.prototype.slice.call(J,0,re)),oe[re]=J[re]);return te.concat(oe||Array.prototype.slice.call(J))},OrderMappings=function(){function te(){this._mappings=[]}return te.prototype.add=function(J){J.order!==0&&(J.order=this._mappings.length),this._mappings.push(J),this.onAdded(J)},te.prototype.clear=function(){this._mappings=[]},te}();function byOrder(te,J){return(J.order||0)-(te.order||0)}var NotificationMappings=function(te){__extends$2(J,te);function J(){return te!==null&&te.apply(this,arguments)||this}return J.prototype.onAdded=function(X){var re=X.handler.prototype.constructor.name;mediatorSettings.resolver.add(re,X.handler)},J.prototype.setOrder=function(X,re){for(var ne=this.getAll(X),oe=0,de=ne;oe<de.length;oe++){var ce=de[oe];ce.order=re.indexOf(ce.handler)}},J.prototype.getAll=function(X){var re=this._mappings.filter(function(ne){return ne.notification===X});if(re.length===0)throw new Error("Cannot find notification handler with key: ".concat(X.prototype.name));return re.sort(byOrder)},J}(OrderMappings),BehaviorMappings=function(te){__extends$2(J,te);function J(){return te!==null&&te.apply(this,arguments)||this}return J.prototype.onAdded=function(X){var re=X.behavior.prototype.constructor.name;mediatorSettings.resolver.add(re,X.behavior)},J.prototype.setOrder=function(X){for(var re=this.getAll(),ne=0,oe=re;ne<oe.length;ne++){var de=oe[ne];de.order=X.indexOf(de.behavior)}},J.prototype.getAll=function(){var X=__spreadArray$3([],this._mappings,!0);return X.sort(byOrder)},J}(OrderMappings),Dispatcher=function(){function te(){this._notifications=new NotificationMappings,this._behaviors=new BehaviorMappings}return Object.defineProperty(te.prototype,"notifications",{get:function(){return this._notifications},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"behaviors",{get:function(){return this._behaviors},enumerable:!1,configurable:!0}),te}(),HandlerInstance=function(){function te(J,X){this._name=J,this._value=X}return Object.defineProperty(te.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"value",{get:function(){return this._value},enumerable:!1,configurable:!0}),te}(),Resolver=function(){function te(){this._instances=[]}return te.prototype.resolve=function(J){var X=this._instances.find(function(ne){return ne.name===J});if(!X)throw new Error("Cannot find element with key: ".concat(J));var re=X.value;return new re},te.prototype.add=function(J,X){var re=this._instances.find(function(ne){return ne.name===J});if(re===void 0)this._instances.push(new HandlerInstance(J,X));else throw new Error("The key ".concat(J," is already been added"))},te.prototype.remove=function(J){var X=this._instances.findIndex(function(re){return re.name===J});X>=0&&this._instances.splice(X,1)},te.prototype.clear=function(){this._instances=[]},te}(),MediatrSettings=function(){function te(){this.resolver=new Resolver,this.dispatcher=new Dispatcher}return te}(),mediatorSettings=new MediatrSettings,requestHandler=function(te){return function(J){var X=te.prototype.constructor.name;mediatorSettings.resolver.add(X,J)}},notificationHandler=function(te){return function(J){mediatorSettings.dispatcher.notifications.add({notification:te,handler:J})}},__awaiter$4=function(te,J,X,re){function ne(oe){return oe instanceof X?oe:new X(function(de){de(oe)})}return new(X||(X=Promise))(function(oe,de){function ce(pe){try{ue(re.next(pe))}catch(fe){de(fe)}}function he(pe){try{ue(re.throw(pe))}catch(fe){de(fe)}}function ue(pe){pe.done?oe(pe.value):ne(pe.value).then(ce,he)}ue((re=re.apply(te,J||[])).next())})},__generator$4=function(te,J){var X={label:0,sent:function(){if(oe[0]&1)throw oe[1];return oe[1]},trys:[],ops:[]},re,ne,oe,de;return de={next:ce(0),throw:ce(1),return:ce(2)},typeof Symbol=="function"&&(de[Symbol.iterator]=function(){return this}),de;function ce(ue){return function(pe){return he([ue,pe])}}function he(ue){if(re)throw new TypeError("Generator is already executing.");for(;de&&(de=0,ue[0]&&(X=0)),X;)try{if(re=1,ne&&(oe=ue[0]&2?ne.return:ue[0]?ne.throw||((oe=ne.return)&&oe.call(ne),0):ne.next)&&!(oe=oe.call(ne,ue[1])).done)return oe;switch(ne=0,oe&&(ue=[ue[0]&2,oe.value]),ue[0]){case 0:case 1:oe=ue;break;case 4:return X.label++,{value:ue[1],done:!1};case 5:X.label++,ne=ue[1],ue=[0];continue;case 7:ue=X.ops.pop(),X.trys.pop();continue;default:if(oe=X.trys,!(oe=oe.length>0&&oe[oe.length-1])&&(ue[0]===6||ue[0]===2)){X=0;continue}if(ue[0]===3&&(!oe||ue[1]>oe[0]&&ue[1]<oe[3])){X.label=ue[1];break}if(ue[0]===6&&X.label<oe[1]){X.label=oe[1],oe=ue;break}if(oe&&X.label<oe[2]){X.label=oe[2],X.ops.push(ue);break}oe[2]&&X.ops.pop(),X.trys.pop();continue}ue=J.call(te,X)}catch(pe){ue=[6,pe],ne=0}finally{re=oe=0}if(ue[0]&5)throw ue[1];return{value:ue[0]?ue[1]:void 0,done:!0}}},Mediator=function(){function te(){}return te.prototype.send=function(J){return __awaiter$4(this,void 0,void 0,function(){var X,re,ne,oe,de,ce=this;return __generator$4(this,function(he){switch(he.label){case 0:return X=J.constructor.name,re=mediatorSettings.resolver.resolve(X),ne=mediatorSettings.dispatcher.behaviors.getAll().map(function(ue){return ue.behavior}),oe=0,de=function(){return __awaiter$4(ce,void 0,void 0,function(){var ue,pe;return __generator$4(this,function(fe){switch(fe.label){case 0:return oe<ne.length?(ue=ne[oe],pe=mediatorSettings.resolver.resolve(ue.name),oe++,[4,pe.handle(J,de)]):[3,2];case 1:return[2,fe.sent()];case 2:return[4,re.handle(J)];case 3:return[2,fe.sent()]}})})},[4,de()];case 1:return[2,he.sent()]}})})},te.prototype.publish=function(J){return __awaiter$4(this,void 0,void 0,function(){var X,re=this;return __generator$4(this,function(ne){switch(ne.label){case 0:return X=mediatorSettings.dispatcher.notifications.getAll(J.constructor),[4,Promise.all(X.map(function(oe){return __awaiter$4(re,void 0,void 0,function(){var de;return __generator$4(this,function(ce){return de=mediatorSettings.resolver.resolve(oe.handler.name),[2,de.handle(J)]})})}))];case 1:return ne.sent(),[2]}})})},te}();const disposableFactory=te=>({dispose:()=>{mediatorSettings.resolver.remove(te.name);const J=mediatorSettings.dispatcher.notifications._mappings.findIndex(X=>X.handler.name===te.name);J>-1&&mediatorSettings.dispatcher.notifications._mappings.splice(J,1)}});class Broker{constructor(){this.eventConstructorMap=new Map,this.requestConstructorMap=new Map,this.mediator=new Mediator,mediatorSettings.resolver.clear()}send(J,X){const re=typeof J=="string"?this.getRequest(J,X):J;return this.mediator.send(re)}publish(J,X){const re=typeof J=="string"?this.getEvent(J,X):J,ne=re.constructor||Object.getPrototypeOf(re).constructor;return mediatorSettings.dispatcher.notifications._mappings.filter(de=>de.notification===ne).length?this.mediator.publish(re):Promise.resolve()}subscribe(J,X){const re=typeof J=="function"?J:this.getEventType(J),ne=createDynamicEventHandler(X);return notificationHandler(re)(ne),disposableFactory(ne)}registerRequest(J,X){const re=typeof J=="function"?J:this.getRequestType(J),ne=createDynamicRequestHandler(X);return requestHandler(re)(ne),disposableFactory(ne)}getEvent(J,X){const re=this.getEventType(J);return new re(X)}getRequest(J,X){const re=this.getRequestType(J);return new re(X)}getEventType(J){if(!this.eventConstructorMap.has(J)){const X=createDynamicEventClass(J);this.eventConstructorMap.set(J,X)}return this.eventConstructorMap.get(J)}getRequestType(J){if(!this.requestConstructorMap.has(J)){const X=createDynamicRequestClass(J);this.requestConstructorMap.set(J,X)}return this.requestConstructorMap.get(J)}}const createDynamicEventClass=te=>createDynamicMessageClass(te,"Event"),createDynamicRequestClass=te=>createDynamicMessageClass(te,"Request"),createDynamicMessageClass=(te,J)=>new Function(`return class ${J}_${te} {
|
|
103
111
|
constructor(payload) {
|
|
104
112
|
Object.assign(this, payload);
|
|
105
113
|
}
|
|
@@ -317,38 +325,22 @@ Registered bindings:`,ne.forEach(function(oe){var de="Object";oe.implementationT
|
|
|
317
325
|
${template$i(this)}
|
|
318
326
|
`}static get styles(){return i$A`
|
|
319
327
|
${r$H(styles$h)}
|
|
320
|
-
`}handleTest(){console.log(this.selectedPeriodDate)}};__decorateClass$p([n$x()],ExportPdfModal.prototype,"selectedRadioOption",2),__decorateClass$p([n$x()],ExportPdfModal.prototype,"text",2),__decorateClass$p([n$x()],ExportPdfModal.prototype,"selectedVisibilityLevelElement",2),__decorateClass$p([n$x()],ExportPdfModal.prototype,"selectedPeriodDate",2),__decorateClass$p([n$x({type:Array})],ExportPdfModal.prototype,"arrayElements",2),ExportPdfModal=__decorateClass$p([t$j("export-pdf-modal")],ExportPdfModal);class ExportToPdfHandler extends ApiBaseHandler{async handle(){try{this.api.interactionService.confirm(void 0,ExportPdfModal,{title:translate("modal.selectExportOption"),confirmButtonText:"Exportar",cancelButtonText:"Cancelar"})}catch(J){this._notifyError(J.message)}}_notifyError(J){this.api.notificationService.error(J||"actions.delete.error")}}class ExportPdf{}let request$e;const bootstrapExportPdf=te=>{request$e=te.registerRequest(ExportPdf,ExportToPdfHandler)},teardownExportPdf=()=>{request$e==null||request$e.dispose()},{addActivityHistoryItems}=activityHistoryCollectionsSlice.actions;class AddHistoryItemsHandler extends StoreBaseHandler{async handle(J){try{const X=validateAndFilterBasicItems(J.items);this.store.dispatch(addActivityHistoryItems({id:J.entityId,items:X,componentFactory:J.componentFactory,searchPredicate:J.searchPredicate})),handleAddDiagnosticsFilter(X,this.store)}catch(X){console.log(X.message)}}}let request$d;const bootstrapAddHistoryItems=te=>{request$d=te.registerRequest(addHistoryItemsCommand,AddHistoryItemsHandler)},teardownAddHistoryItems=()=>{request$d==null||request$d.dispose()},{updateActivityHistoryItem}=activityHistoryCollectionsSlice.actions;class UpdateHistoryItemHandler extends StoreBaseHandler{async handle(J){try{ensureAreValidBasicActivityHistoryItems([J.item]),this.store.dispatch(updateActivityHistoryItem({id:J.entityId,item:J.item}))}catch(X){console.log(X.message)}}}const updateHistoryItemCommand="update_history_item_request";let request$c;const bootstrapUpdateHistoryItem=te=>{request$c=te.registerRequest(updateHistoryItemCommand,UpdateHistoryItemHandler)},teardownUpdateHistoryItem=()=>{request$c==null||request$c.dispose()};function connectedProperty(te,J={}){return createConnectedProperty(store)(te,J)}const activityHistorySearchStringSelector=te=>te.activityHistoryFilters.searchString;function getUniqueObjects(te,J,X,re){const ne=`Sense ${re.toLocaleLowerCase()}`,oe=new Map;let de=!1;for(const he of te){const ue=J.reduce((me,ve)=>me==null?void 0:me[ve],he),pe=X.reduce((me,ve)=>me==null?void 0:me[ve],he),fe=typeof ue=="string"&&ue.trim()!=="",ge=typeof pe=="string"&&pe.trim()!=="";fe&&ge?oe.has(ue)||oe.set(ue,{id:ue,title:pe}):de=!0}const ce=Array.from(oe.values()).sort((he,ue)=>he.title.localeCompare(ue.title,"ca",{sensitivity:"base"}));return de&&ce.push({id:"",title:ne}),ce}class TrueSpec extends Spec{isSatisfiedBy(){return!0}}class CommonFilterSpec extends Spec{constructor(J){super(),this.commonFilters=J}isSatisfiedBy(J){return this.commonFilters.filter(ne=>ne.enabled).reduce((ne,oe)=>ne.and(new oe.spec),new TrueSpec).isSatisfiedBy(J)}}class FalseSpec extends Spec{isSatisfiedBy(){return!1}}class PropPathSpec extends Spec{constructor(J,X){super(),this.propPath=J,this.value=X}isSatisfiedBy(J){return this.propPath.reduce((re,ne)=>re==null?void 0:re[ne],J)===this.value}}class CustomFilterSpec extends Spec{constructor(J){super(),this.filters=J}isSatisfiedBy(J){const X=this.filters.filter(re=>re.enabled);return X.length===0?!0:X.every(re=>{if(!this.belongsToGroup(J,re))return!0;const ne=re.filters.filter(oe=>oe.enabled||oe.singleOption);return ne.length===0?!0:ne.every(oe=>oe.singleOption?oe.enabled?!0:new PropPathSpec(oe.propPathValue,!1).isSatisfiedBy(J):!oe.enabledValues||oe.enabledValues.length===0?!0:oe.enabledValues.reduce((ce,he)=>ce.or(new PropPathSpec(oe.propPathValue,he)),new FalseSpec).isSatisfiedBy(J))})}belongsToGroup(J,X){return J.type===X.id}}const normalizeStringToNFD=te=>te==null?"":String(te).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLocaleLowerCase(),propContainsString=(te,J)=>{const X=normalizeStringToNFD(te),re=normalizeStringToNFD(J);return X.toString().toLowerCase().indexOf(re)!==-1||X.toString().indexOf(re)!==-1},commonFieldsSearchPredicate=(te,J)=>{var he,ue,pe,fe,ge,me,ve;const X=((he=te.professional)==null?void 0:he.name)&&propContainsString((ue=te.professional)==null?void 0:ue.name,J),re=te.center.description&&propContainsString(te.center.description,J),ne=((pe=te.professional)==null?void 0:pe.speciality.description)&&propContainsString((fe=te.professional)==null?void 0:fe.speciality.description,J),oe=((ge=te.professional)==null?void 0:ge.role.description)&&propContainsString((me=te.professional)==null?void 0:me.role.description,J),de=te.service.description&&propContainsString(te.service.description,J),ce=(ve=te.diagnostics)==null?void 0:ve.some(be=>propContainsString(be.id,J)||propContainsString(be.description,J));return X||re||ne||oe||de||ce};class SearchStringSpec extends Spec{constructor(J,X){super(),this.searchString=J,this.searchPredicate=X}isSatisfiedBy(J){var ne;if(!((ne=this.searchString)!=null&&ne.trim()))return!0;const X=commonFieldsSearchPredicate(J,this.searchString),re=this.searchPredicate?this.searchPredicate(this.searchString.toLowerCase(),J):!1;return!!(X||re)}}class TypeSpec extends Spec{constructor(J){super(),this.itemType=J}isSatisfiedBy(J){return(J==null?void 0:J.type)===this.itemType}}class ComposedTypeSpec extends Spec{constructor(J){super(),this.filters=J}isSatisfiedBy(J){return this.filters.filter(ne=>ne.enabled).map(ne=>ne.id).reduce((ne,oe)=>ne.or(new TypeSpec(oe)),new FalseSpec).isSatisfiedBy(J)}}const activityHistoryFiltersSelector=te=>te.activityHistoryFilters.filters,activityHistoryCommonFiltersSelector=createSelector(activityHistoryFiltersSelector,te=>{var J;return((J=te.find(isCommonFilterGroup))==null?void 0:J.filters)||[]}),activityHistoryEnabledCommonFiltersSelector=createSelector(activityHistoryCommonFiltersSelector,te=>te.filter(J=>J.enabled)),areCommonFiltersActive=createSelector(activityHistoryEnabledCommonFiltersSelector,te=>!!te.length),activityHistoryCustomFilterGroupsSelector=createSelector(activityHistoryFiltersSelector,te=>te.filter(isCustomFilter).sort(sortBySortProperty)),sortBySortProperty=(te,J)=>Number(te.sort)-Number(J.sort),areCustomFiltersActive=createSelector(activityHistoryCustomFilterGroupsSelector,te=>te.some(J=>J.filters.some(X=>{var re;return(re=X.enabledValues)==null?void 0:re.length}))),activeGroupsWithEnabledFilters=createSelector(activityHistoryCustomFilterGroupsSelector,te=>te.filter(J=>J.enabled).map(({id:J,title:X,enabled:re,sort:ne,filters:oe})=>({id:J,title:X,enabled:re,sort:ne,filters:oe.filter(de=>{var ce;return(ce=de.enabledValues)==null?void 0:ce.length})})).filter(J=>J.filters.length>0)),areSameDiagnostics=(te,J)=>{if(te.length!==J.length)return!1;const X=te.map(ne=>ne.codi).sort(),re=J.map(ne=>ne.codi).sort();return X.every((ne,oe)=>ne===re[oe])},hasValidDiagnostic=te=>te!=null&&typeof te.codi=="string"&&typeof te.cataleg=="string"&&typeof te.descripcio=="string",hasValidDiagnostics=te=>te==null?!0:Array.isArray(te)&&te.every(hasValidDiagnostic),isSameVisit=(te,J)=>{var oe,de,ce,he,ue,pe,fe,ge,me,ve,be,_e,we,Se,Ce,ye,Ae,Le;const X=((oe=te.professional)==null?void 0:oe.id)===((de=J.professional)==null?void 0:de.id)&&((he=(ce=te.professional)==null?void 0:ce.role)==null?void 0:he.id)===((pe=(ue=J.professional)==null?void 0:ue.role)==null?void 0:pe.id)&&((ge=(fe=te.professional)==null?void 0:fe.speciality)==null?void 0:ge.id)===((ve=(me=J.professional)==null?void 0:me.speciality)==null?void 0:ve.id),re=((be=te.ep)==null?void 0:be.id)===((_e=J.ep)==null?void 0:_e.id)&&((we=te.up)==null?void 0:we.id)===((Se=J.up)==null?void 0:Se.id)&&((Ce=te.center)==null?void 0:Ce.id)===((ye=J.center)==null?void 0:ye.id)&&((Ae=te.service)==null?void 0:Ae.id)===((Le=J.service)==null?void 0:Le.id),ne=new Date(te.date).toDateString()===new Date(J.date).toDateString();return X&&re&&ne},withinEightHours=(te,J)=>Math.abs(new Date(te).getTime()-new Date(J).getTime())<=8*60*60*1e3;function groupByValidDiagnostics(te){te.forEach(J=>{const X=[],re=[];J.items.forEach(ne=>{const oe=ne.diagnostics;if((oe==null?void 0:oe.length)>0&&hasValidDiagnostics(oe)){let ce=!1;for(const he of X){const ue=he.items[0];if(areSameDiagnostics(ue.diagnostics,oe)){he.items.push(ne),ce=!0;break}}ce||X.push({idSubGroup:crypto.randomUUID(),items:[ne]})}else re.push(ne)}),J.items=re,J.subGroups=X})}const groupActivityHistoryItems=te=>{const J=[];return te==null||te.forEach(X=>{let re=!1;for(const ne of J){const oe=ne.items[0],de=ne.items[ne.items.length-1];if(isSameVisit(oe,X)&&withinEightHours(oe.date,X.date)&&withinEightHours(de.date,X.date)){ne.items.push(X),ne.sameVisit=!0,re=!0;break}}if(!re)for(const ne of J){if(ne.sameVisit)continue;const oe=ne.items[0],de=ne.items[ne.items.length-1];if(withinEightHours(oe.date,X.date)&&withinEightHours(de.date,X.date)){ne.items.push(X),re=!0;break}}re||J.push({idGroup:crypto.randomUUID(),items:[X],sameVisit:!1})}),groupByValidDiagnostics(J),J},sortGroupsByMostRecentDate=te=>{const J=oe=>oe.reduce((de,ce)=>{const he=new Date(ce.date);return he>de?he:de},new Date(0)),X=oe=>oe.sort((de,ce)=>new Date(ce.date).getTime()-new Date(de.date).getTime()),re=oe=>J(oe.items),ne=oe=>{const de=oe.items.length>0?[J(oe.items)]:[],ce=oe.subGroups.map(re),he=[...de,...ce];return he.length>0?new Date(Math.max(...he.map(ue=>ue.getTime()))):new Date(0)};return te.forEach(oe=>{oe.items=X(oe.items),oe.subGroups.forEach(de=>{de.items=X(de.items)}),oe.subGroups.sort((de,ce)=>re(ce).getTime()-re(de).getTime())}),te.sort((oe,de)=>ne(de).getTime()-ne(oe).getTime())},diagnosticFilterSelector=createSelector(activityHistoryFiltersSelector,te=>te.find(isDiagnosticFilter)),diagnosticFilterEnabledValuesSelector=createSelector(diagnosticFilterSelector,te=>(te==null?void 0:te.enabledValues)||[]),areDiagnosticFiltersActive=createSelector(diagnosticFilterEnabledValuesSelector,te=>!!te.length);class DiagnosticCodeSpec extends Spec{constructor(J){super(),this.diagnosticCodes=J}isSatisfiedBy(J){var re;return(re=this.diagnosticCodes)!=null&&re.length?(J.diagnostics??[]).some(ne=>this.diagnosticCodes.includes(ne.codi)):!0}}const activityHistoryCollectionsSelector=te=>te.activityHistoryCollections.collections,mapItemsWithMetadata=(te,J,X,re)=>te.map(ne=>({...ne,searchPredicate:re,componentFactory:J,type:X})),activityHistoryMappedItems=createSelector(activityHistoryCollectionsSelector,te=>Object.values(te).flatMap(J=>mapItemsWithMetadata(J.items,J.componentFactory,J.id,J.searchPredicate))),customFilterGroupsWithOptionsSelector=createSelector(activityHistoryCustomFilterGroupsSelector,activityHistoryCollectionsSelector,(te,J)=>te.map(re=>{const ne=J[re.id];return{...re,filters:re.filters.map(oe=>({...oe,options:(oe.singleOption?[]:getUniqueObjects(ne.items,oe.propPathValue,oe.propsPathDescription,oe.title))||[]}))}})),activityHistoryGroupedItems=createSelector(activityHistoryMappedItems,activityHistorySearchStringSelector,activityHistoryCommonFiltersSelector,activityHistoryCustomFilterGroupsSelector,diagnosticFilterEnabledValuesSelector,(te,J,X,re,ne)=>{const oe=te.filter(he=>new SearchStringSpec(J,he.searchPredicate).and(new CommonFilterSpec(X)).and(new ComposedTypeSpec(re)).and(new CustomFilterSpec(re)).and(new DiagnosticCodeSpec(ne)).isSatisfiedBy(he)),de=groupActivityHistoryItems(oe);return sortGroupsByMostRecentDate(de)}),styles$g=":host{min-height:1px;height:100%}.virtualizer{height:100%;padding-inline:16px}.container{min-height:1px;height:100%}.visit:first-child{margin-top:var(--dss-spacing-md)}.visit{width:calc(100% - var(--dss-spacing-md) - var(--dss-spacing-md));display:flex;flex-direction:column;gap:var(--dss-spacing-md);background-color:#fff;border-radius:var(--dss-radius-sm);padding:var(--dss-spacing-sm);margin-bottom:var(--dss-spacing-md)}.visit .visit__header{display:flex;flex-direction:row;align-items:center;gap:16px}.visit .visit__header .title{flex:1;font-size:14px;line-height:24px;display:flex;flex-direction:row;gap:12px;color:var(--color-neutral-800)}.visit .visit__header .title-date{font-weight:700}.visit .visit__header .title-description{font-weight:600;display:flex;flex-direction:row;gap:4px}.visit .visit__header .highlight{background-color:#ff0;font-weight:700}.visit .visit__items{display:flex;flex-direction:column;gap:16px}.visit .visit__items .item[has-divider]{border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.visit .visit__items .item[has-divider]:last-of-type{border:none}.visit .diagnostics{display:flex;flex-direction:column;gap:16px;border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.visit .diagnostics:last-of-type{border:none}.visit .diagnostics .diagnostics__header{display:flex;flex-direction:row;align-items:center;gap:16px}.visit .diagnostics .diagnostics__items{display:flex;flex-direction:column}.visit .diagnostics .diagnostics__items .item[has-divider]{border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.visit .diagnostics .diagnostics__items .item[has-divider]:last-of-type{border:none}.feedback{width:100%;height:100%;display:flex;align-items:center;justify-content:center}";function toDate(te){const J=Object.prototype.toString.call(te);return te instanceof Date||typeof te=="object"&&J==="[object Date]"?new te.constructor(+te):typeof te=="number"||J==="[object Number]"||typeof te=="string"||J==="[object String]"?new Date(te):new Date(NaN)}function constructFrom(te,J){return te instanceof Date?new te.constructor(J):new Date(J)}function addDays(te,J){const X=toDate(te);return isNaN(J)?constructFrom(te,NaN):(J&&X.setDate(X.getDate()+J),X)}const millisecondsInWeek=6048e5,millisecondsInDay=864e5,millisecondsInMinute=6e4,millisecondsInHour=36e5,millisecondsInSecond=1e3;let defaultOptions={};function getDefaultOptions$1(){return defaultOptions}function startOfWeek(te,J){var ce,he,ue,pe;const X=getDefaultOptions$1(),re=(J==null?void 0:J.weekStartsOn)??((he=(ce=J==null?void 0:J.locale)==null?void 0:ce.options)==null?void 0:he.weekStartsOn)??X.weekStartsOn??((pe=(ue=X.locale)==null?void 0:ue.options)==null?void 0:pe.weekStartsOn)??0,ne=toDate(te),oe=ne.getDay(),de=(oe<re?7:0)+oe-re;return ne.setDate(ne.getDate()-de),ne.setHours(0,0,0,0),ne}function startOfISOWeek(te){return startOfWeek(te,{weekStartsOn:1})}function getISOWeekYear(te){const J=toDate(te),X=J.getFullYear(),re=constructFrom(te,0);re.setFullYear(X+1,0,4),re.setHours(0,0,0,0);const ne=startOfISOWeek(re),oe=constructFrom(te,0);oe.setFullYear(X,0,4),oe.setHours(0,0,0,0);const de=startOfISOWeek(oe);return J.getTime()>=ne.getTime()?X+1:J.getTime()>=de.getTime()?X:X-1}function startOfDay(te){const J=toDate(te);return J.setHours(0,0,0,0),J}function getTimezoneOffsetInMilliseconds(te){const J=toDate(te),X=new Date(Date.UTC(J.getFullYear(),J.getMonth(),J.getDate(),J.getHours(),J.getMinutes(),J.getSeconds(),J.getMilliseconds()));return X.setUTCFullYear(J.getFullYear()),+te-+X}function differenceInCalendarDays(te,J){const X=startOfDay(te),re=startOfDay(J),ne=+X-getTimezoneOffsetInMilliseconds(X),oe=+re-getTimezoneOffsetInMilliseconds(re);return Math.round((ne-oe)/millisecondsInDay)}function startOfISOWeekYear(te){const J=getISOWeekYear(te),X=constructFrom(te,0);return X.setFullYear(J,0,4),X.setHours(0,0,0,0),startOfISOWeek(X)}function isDate(te){return te instanceof Date||typeof te=="object"&&Object.prototype.toString.call(te)==="[object Date]"}function isValid(te){if(!isDate(te)&&typeof te!="number")return!1;const J=toDate(te);return!isNaN(Number(J))}function endOfMonth(te){const J=toDate(te),X=J.getMonth();return J.setFullYear(J.getFullYear(),X+1,0),J.setHours(23,59,59,999),J}function eachDayOfInterval(te,J){const X=toDate(te.start),re=toDate(te.end);let ne=+X>+re;const oe=ne?+X:+re,de=ne?re:X;de.setHours(0,0,0,0);let ce=1;const he=[];for(;+de<=oe;)he.push(toDate(de)),de.setDate(de.getDate()+ce),de.setHours(0,0,0,0);return ne?he.reverse():he}function startOfMonth(te){const J=toDate(te);return J.setDate(1),J.setHours(0,0,0,0),J}function startOfYear(te){const J=toDate(te),X=constructFrom(te,0);return X.setFullYear(J.getFullYear(),0,1),X.setHours(0,0,0,0),X}const formatDistanceLocale={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},formatDistance=(te,J,X)=>{let re;const ne=formatDistanceLocale[te];return typeof ne=="string"?re=ne:J===1?re=ne.one:re=ne.other.replace("{{count}}",J.toString()),X!=null&&X.addSuffix?X.comparison&&X.comparison>0?"in "+re:re+" ago":re};function buildFormatLongFn(te){return(J={})=>{const X=J.width?String(J.width):te.defaultWidth;return te.formats[X]||te.formats[te.defaultWidth]}}const dateFormats={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},timeFormats={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},dateTimeFormats={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong={date:buildFormatLongFn({formats:dateFormats,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats,defaultWidth:"full"})},formatRelativeLocale={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},formatRelative=(te,J,X,re)=>formatRelativeLocale[te];function buildLocalizeFn(te){return(J,X)=>{const re=X!=null&&X.context?String(X.context):"standalone";let ne;if(re==="formatting"&&te.formattingValues){const de=te.defaultFormattingWidth||te.defaultWidth,ce=X!=null&&X.width?String(X.width):de;ne=te.formattingValues[ce]||te.formattingValues[de]}else{const de=te.defaultWidth,ce=X!=null&&X.width?String(X.width):te.defaultWidth;ne=te.values[ce]||te.values[de]}const oe=te.argumentCallback?te.argumentCallback(J):J;return ne[oe]}}const eraValues={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},quarterValues={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},monthValues={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},dayValues={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},dayPeriodValues={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},formattingDayPeriodValues={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ordinalNumber=(te,J)=>{const X=Number(te),re=X%100;if(re>20||re<10)switch(re%10){case 1:return X+"st";case 2:return X+"nd";case 3:return X+"rd"}return X+"th"},localize={ordinalNumber,era:buildLocalizeFn({values:eraValues,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues,defaultWidth:"wide",argumentCallback:te=>te-1}),month:buildLocalizeFn({values:monthValues,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues,defaultWidth:"wide",formattingValues:formattingDayPeriodValues,defaultFormattingWidth:"wide"})};function buildMatchFn(te){return(J,X={})=>{const re=X.width,ne=re&&te.matchPatterns[re]||te.matchPatterns[te.defaultMatchWidth],oe=J.match(ne);if(!oe)return null;const de=oe[0],ce=re&&te.parsePatterns[re]||te.parsePatterns[te.defaultParseWidth],he=Array.isArray(ce)?findIndex(ce,fe=>fe.test(de)):findKey(ce,fe=>fe.test(de));let ue;ue=te.valueCallback?te.valueCallback(he):he,ue=X.valueCallback?X.valueCallback(ue):ue;const pe=J.slice(de.length);return{value:ue,rest:pe}}}function findKey(te,J){for(const X in te)if(Object.prototype.hasOwnProperty.call(te,X)&&J(te[X]))return X}function findIndex(te,J){for(let X=0;X<te.length;X++)if(J(te[X]))return X}function buildMatchPatternFn(te){return(J,X={})=>{const re=J.match(te.matchPattern);if(!re)return null;const ne=re[0],oe=J.match(te.parsePattern);if(!oe)return null;let de=te.valueCallback?te.valueCallback(oe[0]):oe[0];de=X.valueCallback?X.valueCallback(de):de;const ce=J.slice(ne.length);return{value:de,rest:ce}}}const matchOrdinalNumberPattern=/^(\d+)(th|st|nd|rd)?/i,parseOrdinalNumberPattern=/\d+/i,matchEraPatterns={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},parseEraPatterns={any:[/^b/i,/^(a|c)/i]},matchQuarterPatterns={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},parseQuarterPatterns={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},parseMonthPatterns={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},matchDayPatterns={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},parseDayPatterns={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},matchDayPeriodPatterns={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},parseDayPeriodPatterns={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},match={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern,parsePattern:parseOrdinalNumberPattern,valueCallback:te=>parseInt(te,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns,defaultParseWidth:"any",valueCallback:te=>te+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns,defaultParseWidth:"any"})},enUS={code:"en-US",formatDistance,formatLong,formatRelative,localize,match,options:{weekStartsOn:0,firstWeekContainsDate:1}};function getDayOfYear(te){const J=toDate(te);return differenceInCalendarDays(J,startOfYear(J))+1}function getISOWeek(te){const J=toDate(te),X=+startOfISOWeek(J)-+startOfISOWeekYear(J);return Math.round(X/millisecondsInWeek)+1}function getWeekYear(te,J){var pe,fe,ge,me;const X=toDate(te),re=X.getFullYear(),ne=getDefaultOptions$1(),oe=(J==null?void 0:J.firstWeekContainsDate)??((fe=(pe=J==null?void 0:J.locale)==null?void 0:pe.options)==null?void 0:fe.firstWeekContainsDate)??ne.firstWeekContainsDate??((me=(ge=ne.locale)==null?void 0:ge.options)==null?void 0:me.firstWeekContainsDate)??1,de=constructFrom(te,0);de.setFullYear(re+1,0,oe),de.setHours(0,0,0,0);const ce=startOfWeek(de,J),he=constructFrom(te,0);he.setFullYear(re,0,oe),he.setHours(0,0,0,0);const ue=startOfWeek(he,J);return X.getTime()>=ce.getTime()?re+1:X.getTime()>=ue.getTime()?re:re-1}function startOfWeekYear(te,J){var ce,he,ue,pe;const X=getDefaultOptions$1(),re=(J==null?void 0:J.firstWeekContainsDate)??((he=(ce=J==null?void 0:J.locale)==null?void 0:ce.options)==null?void 0:he.firstWeekContainsDate)??X.firstWeekContainsDate??((pe=(ue=X.locale)==null?void 0:ue.options)==null?void 0:pe.firstWeekContainsDate)??1,ne=getWeekYear(te,J),oe=constructFrom(te,0);return oe.setFullYear(ne,0,re),oe.setHours(0,0,0,0),startOfWeek(oe,J)}function getWeek(te,J){const X=toDate(te),re=+startOfWeek(X,J)-+startOfWeekYear(X,J);return Math.round(re/millisecondsInWeek)+1}function addLeadingZeros(te,J){const X=te<0?"-":"",re=Math.abs(te).toString().padStart(J,"0");return X+re}const lightFormatters={y(te,J){const X=te.getFullYear(),re=X>0?X:1-X;return addLeadingZeros(J==="yy"?re%100:re,J.length)},M(te,J){const X=te.getMonth();return J==="M"?String(X+1):addLeadingZeros(X+1,2)},d(te,J){return addLeadingZeros(te.getDate(),J.length)},a(te,J){const X=te.getHours()/12>=1?"pm":"am";switch(J){case"a":case"aa":return X.toUpperCase();case"aaa":return X;case"aaaaa":return X[0];case"aaaa":default:return X==="am"?"a.m.":"p.m."}},h(te,J){return addLeadingZeros(te.getHours()%12||12,J.length)},H(te,J){return addLeadingZeros(te.getHours(),J.length)},m(te,J){return addLeadingZeros(te.getMinutes(),J.length)},s(te,J){return addLeadingZeros(te.getSeconds(),J.length)},S(te,J){const X=J.length,re=te.getMilliseconds(),ne=Math.trunc(re*Math.pow(10,X-3));return addLeadingZeros(ne,J.length)}},dayPeriodEnum={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},formatters={G:function(te,J,X){const re=te.getFullYear()>0?1:0;switch(J){case"G":case"GG":case"GGG":return X.era(re,{width:"abbreviated"});case"GGGGG":return X.era(re,{width:"narrow"});case"GGGG":default:return X.era(re,{width:"wide"})}},y:function(te,J,X){if(J==="yo"){const re=te.getFullYear(),ne=re>0?re:1-re;return X.ordinalNumber(ne,{unit:"year"})}return lightFormatters.y(te,J)},Y:function(te,J,X,re){const ne=getWeekYear(te,re),oe=ne>0?ne:1-ne;if(J==="YY"){const de=oe%100;return addLeadingZeros(de,2)}return J==="Yo"?X.ordinalNumber(oe,{unit:"year"}):addLeadingZeros(oe,J.length)},R:function(te,J){const X=getISOWeekYear(te);return addLeadingZeros(X,J.length)},u:function(te,J){const X=te.getFullYear();return addLeadingZeros(X,J.length)},Q:function(te,J,X){const re=Math.ceil((te.getMonth()+1)/3);switch(J){case"Q":return String(re);case"QQ":return addLeadingZeros(re,2);case"Qo":return X.ordinalNumber(re,{unit:"quarter"});case"QQQ":return X.quarter(re,{width:"abbreviated",context:"formatting"});case"QQQQQ":return X.quarter(re,{width:"narrow",context:"formatting"});case"QQQQ":default:return X.quarter(re,{width:"wide",context:"formatting"})}},q:function(te,J,X){const re=Math.ceil((te.getMonth()+1)/3);switch(J){case"q":return String(re);case"qq":return addLeadingZeros(re,2);case"qo":return X.ordinalNumber(re,{unit:"quarter"});case"qqq":return X.quarter(re,{width:"abbreviated",context:"standalone"});case"qqqqq":return X.quarter(re,{width:"narrow",context:"standalone"});case"qqqq":default:return X.quarter(re,{width:"wide",context:"standalone"})}},M:function(te,J,X){const re=te.getMonth();switch(J){case"M":case"MM":return lightFormatters.M(te,J);case"Mo":return X.ordinalNumber(re+1,{unit:"month"});case"MMM":return X.month(re,{width:"abbreviated",context:"formatting"});case"MMMMM":return X.month(re,{width:"narrow",context:"formatting"});case"MMMM":default:return X.month(re,{width:"wide",context:"formatting"})}},L:function(te,J,X){const re=te.getMonth();switch(J){case"L":return String(re+1);case"LL":return addLeadingZeros(re+1,2);case"Lo":return X.ordinalNumber(re+1,{unit:"month"});case"LLL":return X.month(re,{width:"abbreviated",context:"standalone"});case"LLLLL":return X.month(re,{width:"narrow",context:"standalone"});case"LLLL":default:return X.month(re,{width:"wide",context:"standalone"})}},w:function(te,J,X,re){const ne=getWeek(te,re);return J==="wo"?X.ordinalNumber(ne,{unit:"week"}):addLeadingZeros(ne,J.length)},I:function(te,J,X){const re=getISOWeek(te);return J==="Io"?X.ordinalNumber(re,{unit:"week"}):addLeadingZeros(re,J.length)},d:function(te,J,X){return J==="do"?X.ordinalNumber(te.getDate(),{unit:"date"}):lightFormatters.d(te,J)},D:function(te,J,X){const re=getDayOfYear(te);return J==="Do"?X.ordinalNumber(re,{unit:"dayOfYear"}):addLeadingZeros(re,J.length)},E:function(te,J,X){const re=te.getDay();switch(J){case"E":case"EE":case"EEE":return X.day(re,{width:"abbreviated",context:"formatting"});case"EEEEE":return X.day(re,{width:"narrow",context:"formatting"});case"EEEEEE":return X.day(re,{width:"short",context:"formatting"});case"EEEE":default:return X.day(re,{width:"wide",context:"formatting"})}},e:function(te,J,X,re){const ne=te.getDay(),oe=(ne-re.weekStartsOn+8)%7||7;switch(J){case"e":return String(oe);case"ee":return addLeadingZeros(oe,2);case"eo":return X.ordinalNumber(oe,{unit:"day"});case"eee":return X.day(ne,{width:"abbreviated",context:"formatting"});case"eeeee":return X.day(ne,{width:"narrow",context:"formatting"});case"eeeeee":return X.day(ne,{width:"short",context:"formatting"});case"eeee":default:return X.day(ne,{width:"wide",context:"formatting"})}},c:function(te,J,X,re){const ne=te.getDay(),oe=(ne-re.weekStartsOn+8)%7||7;switch(J){case"c":return String(oe);case"cc":return addLeadingZeros(oe,J.length);case"co":return X.ordinalNumber(oe,{unit:"day"});case"ccc":return X.day(ne,{width:"abbreviated",context:"standalone"});case"ccccc":return X.day(ne,{width:"narrow",context:"standalone"});case"cccccc":return X.day(ne,{width:"short",context:"standalone"});case"cccc":default:return X.day(ne,{width:"wide",context:"standalone"})}},i:function(te,J,X){const re=te.getDay(),ne=re===0?7:re;switch(J){case"i":return String(ne);case"ii":return addLeadingZeros(ne,J.length);case"io":return X.ordinalNumber(ne,{unit:"day"});case"iii":return X.day(re,{width:"abbreviated",context:"formatting"});case"iiiii":return X.day(re,{width:"narrow",context:"formatting"});case"iiiiii":return X.day(re,{width:"short",context:"formatting"});case"iiii":default:return X.day(re,{width:"wide",context:"formatting"})}},a:function(te,J,X){const ne=te.getHours()/12>=1?"pm":"am";switch(J){case"a":case"aa":return X.dayPeriod(ne,{width:"abbreviated",context:"formatting"});case"aaa":return X.dayPeriod(ne,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return X.dayPeriod(ne,{width:"narrow",context:"formatting"});case"aaaa":default:return X.dayPeriod(ne,{width:"wide",context:"formatting"})}},b:function(te,J,X){const re=te.getHours();let ne;switch(re===12?ne=dayPeriodEnum.noon:re===0?ne=dayPeriodEnum.midnight:ne=re/12>=1?"pm":"am",J){case"b":case"bb":return X.dayPeriod(ne,{width:"abbreviated",context:"formatting"});case"bbb":return X.dayPeriod(ne,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return X.dayPeriod(ne,{width:"narrow",context:"formatting"});case"bbbb":default:return X.dayPeriod(ne,{width:"wide",context:"formatting"})}},B:function(te,J,X){const re=te.getHours();let ne;switch(re>=17?ne=dayPeriodEnum.evening:re>=12?ne=dayPeriodEnum.afternoon:re>=4?ne=dayPeriodEnum.morning:ne=dayPeriodEnum.night,J){case"B":case"BB":case"BBB":return X.dayPeriod(ne,{width:"abbreviated",context:"formatting"});case"BBBBB":return X.dayPeriod(ne,{width:"narrow",context:"formatting"});case"BBBB":default:return X.dayPeriod(ne,{width:"wide",context:"formatting"})}},h:function(te,J,X){if(J==="ho"){let re=te.getHours()%12;return re===0&&(re=12),X.ordinalNumber(re,{unit:"hour"})}return lightFormatters.h(te,J)},H:function(te,J,X){return J==="Ho"?X.ordinalNumber(te.getHours(),{unit:"hour"}):lightFormatters.H(te,J)},K:function(te,J,X){const re=te.getHours()%12;return J==="Ko"?X.ordinalNumber(re,{unit:"hour"}):addLeadingZeros(re,J.length)},k:function(te,J,X){let re=te.getHours();return re===0&&(re=24),J==="ko"?X.ordinalNumber(re,{unit:"hour"}):addLeadingZeros(re,J.length)},m:function(te,J,X){return J==="mo"?X.ordinalNumber(te.getMinutes(),{unit:"minute"}):lightFormatters.m(te,J)},s:function(te,J,X){return J==="so"?X.ordinalNumber(te.getSeconds(),{unit:"second"}):lightFormatters.s(te,J)},S:function(te,J){return lightFormatters.S(te,J)},X:function(te,J,X){const re=te.getTimezoneOffset();if(re===0)return"Z";switch(J){case"X":return formatTimezoneWithOptionalMinutes(re);case"XXXX":case"XX":return formatTimezone(re);case"XXXXX":case"XXX":default:return formatTimezone(re,":")}},x:function(te,J,X){const re=te.getTimezoneOffset();switch(J){case"x":return formatTimezoneWithOptionalMinutes(re);case"xxxx":case"xx":return formatTimezone(re);case"xxxxx":case"xxx":default:return formatTimezone(re,":")}},O:function(te,J,X){const re=te.getTimezoneOffset();switch(J){case"O":case"OO":case"OOO":return"GMT"+formatTimezoneShort(re,":");case"OOOO":default:return"GMT"+formatTimezone(re,":")}},z:function(te,J,X){const re=te.getTimezoneOffset();switch(J){case"z":case"zz":case"zzz":return"GMT"+formatTimezoneShort(re,":");case"zzzz":default:return"GMT"+formatTimezone(re,":")}},t:function(te,J,X){const re=Math.trunc(te.getTime()/1e3);return addLeadingZeros(re,J.length)},T:function(te,J,X){const re=te.getTime();return addLeadingZeros(re,J.length)}};function formatTimezoneShort(te,J=""){const X=te>0?"-":"+",re=Math.abs(te),ne=Math.trunc(re/60),oe=re%60;return oe===0?X+String(ne):X+String(ne)+J+addLeadingZeros(oe,2)}function formatTimezoneWithOptionalMinutes(te,J){return te%60===0?(te>0?"-":"+")+addLeadingZeros(Math.abs(te)/60,2):formatTimezone(te,J)}function formatTimezone(te,J=""){const X=te>0?"-":"+",re=Math.abs(te),ne=addLeadingZeros(Math.trunc(re/60),2),oe=addLeadingZeros(re%60,2);return X+ne+J+oe}const dateLongFormatter=(te,J)=>{switch(te){case"P":return J.date({width:"short"});case"PP":return J.date({width:"medium"});case"PPP":return J.date({width:"long"});case"PPPP":default:return J.date({width:"full"})}},timeLongFormatter=(te,J)=>{switch(te){case"p":return J.time({width:"short"});case"pp":return J.time({width:"medium"});case"ppp":return J.time({width:"long"});case"pppp":default:return J.time({width:"full"})}},dateTimeLongFormatter=(te,J)=>{const X=te.match(/(P+)(p+)?/)||[],re=X[1],ne=X[2];if(!ne)return dateLongFormatter(te,J);let oe;switch(re){case"P":oe=J.dateTime({width:"short"});break;case"PP":oe=J.dateTime({width:"medium"});break;case"PPP":oe=J.dateTime({width:"long"});break;case"PPPP":default:oe=J.dateTime({width:"full"});break}return oe.replace("{{date}}",dateLongFormatter(re,J)).replace("{{time}}",timeLongFormatter(ne,J))},longFormatters={p:timeLongFormatter,P:dateTimeLongFormatter},dayOfYearTokenRE=/^D+$/,weekYearTokenRE=/^Y+$/,throwTokens=["D","DD","YY","YYYY"];function isProtectedDayOfYearToken(te){return dayOfYearTokenRE.test(te)}function isProtectedWeekYearToken(te){return weekYearTokenRE.test(te)}function warnOrThrowProtectedError(te,J,X){const re=message(te,J,X);if(console.warn(re),throwTokens.includes(te))throw new RangeError(re)}function message(te,J,X){const re=te[0]==="Y"?"years":"days of the month";return`Use \`${te.toLowerCase()}\` instead of \`${te}\` (in \`${J}\`) for formatting ${re} to the input \`${X}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const formattingTokensRegExp$1=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,longFormattingTokensRegExp$1=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,escapedStringRegExp$1=/^'([^]*?)'?$/,doubleQuoteRegExp$1=/''/g,unescapedLatinCharacterRegExp$1=/[a-zA-Z]/;function format(te,J,X){var pe,fe,ge,me;const re=getDefaultOptions$1(),ne=re.locale??enUS,oe=re.firstWeekContainsDate??((fe=(pe=re.locale)==null?void 0:pe.options)==null?void 0:fe.firstWeekContainsDate)??1,de=re.weekStartsOn??((me=(ge=re.locale)==null?void 0:ge.options)==null?void 0:me.weekStartsOn)??0,ce=toDate(te);if(!isValid(ce))throw new RangeError("Invalid time value");let he=J.match(longFormattingTokensRegExp$1).map(ve=>{const be=ve[0];if(be==="p"||be==="P"){const _e=longFormatters[be];return _e(ve,ne.formatLong)}return ve}).join("").match(formattingTokensRegExp$1).map(ve=>{if(ve==="''")return{isToken:!1,value:"'"};const be=ve[0];if(be==="'")return{isToken:!1,value:cleanEscapedString$1(ve)};if(formatters[be])return{isToken:!0,value:ve};if(be.match(unescapedLatinCharacterRegExp$1))throw new RangeError("Format string contains an unescaped latin alphabet character `"+be+"`");return{isToken:!1,value:ve}});ne.localize.preprocessor&&(he=ne.localize.preprocessor(ce,he));const ue={firstWeekContainsDate:oe,weekStartsOn:de,locale:ne};return he.map(ve=>{if(!ve.isToken)return ve.value;const be=ve.value;(isProtectedWeekYearToken(be)||isProtectedDayOfYearToken(be))&&warnOrThrowProtectedError(be,J,String(te));const _e=formatters[be[0]];return _e(ce,be,ne.localize,ue)}).join("")}function cleanEscapedString$1(te){const J=te.match(escapedStringRegExp$1);return J?J[1].replace(doubleQuoteRegExp$1,"'"):te}function getDay(te){return toDate(te).getDay()}function getDefaultOptions(){return Object.assign({},getDefaultOptions$1())}function getISODay(te){let X=toDate(te).getDay();return X===0&&(X=7),X}function transpose(te,J){const X=J instanceof Date?constructFrom(J,0):new J(0);return X.setFullYear(te.getFullYear(),te.getMonth(),te.getDate()),X.setHours(te.getHours(),te.getMinutes(),te.getSeconds(),te.getMilliseconds()),X}const TIMEZONE_UNIT_PRIORITY=10;class Setter{constructor(){Nt(this,"subPriority",0)}validate(J,X){return!0}}class ValueSetter extends Setter{constructor(J,X,re,ne,oe){super(),this.value=J,this.validateValue=X,this.setValue=re,this.priority=ne,oe&&(this.subPriority=oe)}validate(J,X){return this.validateValue(J,this.value,X)}set(J,X,re){return this.setValue(J,X,this.value,re)}}class DateToSystemTimezoneSetter extends Setter{constructor(){super(...arguments);Nt(this,"priority",TIMEZONE_UNIT_PRIORITY);Nt(this,"subPriority",-1)}set(X,re){return re.timestampIsSet?X:constructFrom(X,transpose(X,Date))}}class Parser{run(J,X,re,ne){const oe=this.parse(J,X,re,ne);return oe?{setter:new ValueSetter(oe.value,this.validate,this.set,this.priority,this.subPriority),rest:oe.rest}:null}validate(J,X,re){return!0}}class EraParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",140);Nt(this,"incompatibleTokens",["R","u","t","T"])}parse(X,re,ne){switch(re){case"G":case"GG":case"GGG":return ne.era(X,{width:"abbreviated"})||ne.era(X,{width:"narrow"});case"GGGGG":return ne.era(X,{width:"narrow"});case"GGGG":default:return ne.era(X,{width:"wide"})||ne.era(X,{width:"abbreviated"})||ne.era(X,{width:"narrow"})}}set(X,re,ne){return re.era=ne,X.setFullYear(ne,0,1),X.setHours(0,0,0,0),X}}const numericPatterns={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},timezonePatterns={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function mapValue(te,J){return te&&{value:J(te.value),rest:te.rest}}function parseNumericPattern(te,J){const X=J.match(te);return X?{value:parseInt(X[0],10),rest:J.slice(X[0].length)}:null}function parseTimezonePattern(te,J){const X=J.match(te);if(!X)return null;if(X[0]==="Z")return{value:0,rest:J.slice(1)};const re=X[1]==="+"?1:-1,ne=X[2]?parseInt(X[2],10):0,oe=X[3]?parseInt(X[3],10):0,de=X[5]?parseInt(X[5],10):0;return{value:re*(ne*millisecondsInHour+oe*millisecondsInMinute+de*millisecondsInSecond),rest:J.slice(X[0].length)}}function parseAnyDigitsSigned(te){return parseNumericPattern(numericPatterns.anyDigitsSigned,te)}function parseNDigits(te,J){switch(te){case 1:return parseNumericPattern(numericPatterns.singleDigit,J);case 2:return parseNumericPattern(numericPatterns.twoDigits,J);case 3:return parseNumericPattern(numericPatterns.threeDigits,J);case 4:return parseNumericPattern(numericPatterns.fourDigits,J);default:return parseNumericPattern(new RegExp("^\\d{1,"+te+"}"),J)}}function parseNDigitsSigned(te,J){switch(te){case 1:return parseNumericPattern(numericPatterns.singleDigitSigned,J);case 2:return parseNumericPattern(numericPatterns.twoDigitsSigned,J);case 3:return parseNumericPattern(numericPatterns.threeDigitsSigned,J);case 4:return parseNumericPattern(numericPatterns.fourDigitsSigned,J);default:return parseNumericPattern(new RegExp("^-?\\d{1,"+te+"}"),J)}}function dayPeriodEnumToHours(te){switch(te){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function normalizeTwoDigitYear(te,J){const X=J>0,re=X?J:1-J;let ne;if(re<=50)ne=te||100;else{const oe=re+50,de=Math.trunc(oe/100)*100,ce=te>=oe%100;ne=te+de-(ce?100:0)}return X?ne:1-ne}function isLeapYearIndex(te){return te%400===0||te%4===0&&te%100!==0}class YearParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",130);Nt(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(X,re,ne){const oe=de=>({year:de,isTwoDigitYear:re==="yy"});switch(re){case"y":return mapValue(parseNDigits(4,X),oe);case"yo":return mapValue(ne.ordinalNumber(X,{unit:"year"}),oe);default:return mapValue(parseNDigits(re.length,X),oe)}}validate(X,re){return re.isTwoDigitYear||re.year>0}set(X,re,ne){const oe=X.getFullYear();if(ne.isTwoDigitYear){const ce=normalizeTwoDigitYear(ne.year,oe);return X.setFullYear(ce,0,1),X.setHours(0,0,0,0),X}const de=!("era"in re)||re.era===1?ne.year:1-ne.year;return X.setFullYear(de,0,1),X.setHours(0,0,0,0),X}}class LocalWeekYearParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",130);Nt(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(X,re,ne){const oe=de=>({year:de,isTwoDigitYear:re==="YY"});switch(re){case"Y":return mapValue(parseNDigits(4,X),oe);case"Yo":return mapValue(ne.ordinalNumber(X,{unit:"year"}),oe);default:return mapValue(parseNDigits(re.length,X),oe)}}validate(X,re){return re.isTwoDigitYear||re.year>0}set(X,re,ne,oe){const de=getWeekYear(X,oe);if(ne.isTwoDigitYear){const he=normalizeTwoDigitYear(ne.year,de);return X.setFullYear(he,0,oe.firstWeekContainsDate),X.setHours(0,0,0,0),startOfWeek(X,oe)}const ce=!("era"in re)||re.era===1?ne.year:1-ne.year;return X.setFullYear(ce,0,oe.firstWeekContainsDate),X.setHours(0,0,0,0),startOfWeek(X,oe)}}class ISOWeekYearParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",130);Nt(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(X,re){return parseNDigitsSigned(re==="R"?4:re.length,X)}set(X,re,ne){const oe=constructFrom(X,0);return oe.setFullYear(ne,0,4),oe.setHours(0,0,0,0),startOfISOWeek(oe)}}class ExtendedYearParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",130);Nt(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(X,re){return parseNDigitsSigned(re==="u"?4:re.length,X)}set(X,re,ne){return X.setFullYear(ne,0,1),X.setHours(0,0,0,0),X}}class QuarterParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",120);Nt(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(X,re,ne){switch(re){case"Q":case"QQ":return parseNDigits(re.length,X);case"Qo":return ne.ordinalNumber(X,{unit:"quarter"});case"QQQ":return ne.quarter(X,{width:"abbreviated",context:"formatting"})||ne.quarter(X,{width:"narrow",context:"formatting"});case"QQQQQ":return ne.quarter(X,{width:"narrow",context:"formatting"});case"QQQQ":default:return ne.quarter(X,{width:"wide",context:"formatting"})||ne.quarter(X,{width:"abbreviated",context:"formatting"})||ne.quarter(X,{width:"narrow",context:"formatting"})}}validate(X,re){return re>=1&&re<=4}set(X,re,ne){return X.setMonth((ne-1)*3,1),X.setHours(0,0,0,0),X}}class StandAloneQuarterParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",120);Nt(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(X,re,ne){switch(re){case"q":case"qq":return parseNDigits(re.length,X);case"qo":return ne.ordinalNumber(X,{unit:"quarter"});case"qqq":return ne.quarter(X,{width:"abbreviated",context:"standalone"})||ne.quarter(X,{width:"narrow",context:"standalone"});case"qqqqq":return ne.quarter(X,{width:"narrow",context:"standalone"});case"qqqq":default:return ne.quarter(X,{width:"wide",context:"standalone"})||ne.quarter(X,{width:"abbreviated",context:"standalone"})||ne.quarter(X,{width:"narrow",context:"standalone"})}}validate(X,re){return re>=1&&re<=4}set(X,re,ne){return X.setMonth((ne-1)*3,1),X.setHours(0,0,0,0),X}}class MonthParser extends Parser{constructor(){super(...arguments);Nt(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);Nt(this,"priority",110)}parse(X,re,ne){const oe=de=>de-1;switch(re){case"M":return mapValue(parseNumericPattern(numericPatterns.month,X),oe);case"MM":return mapValue(parseNDigits(2,X),oe);case"Mo":return mapValue(ne.ordinalNumber(X,{unit:"month"}),oe);case"MMM":return ne.month(X,{width:"abbreviated",context:"formatting"})||ne.month(X,{width:"narrow",context:"formatting"});case"MMMMM":return ne.month(X,{width:"narrow",context:"formatting"});case"MMMM":default:return ne.month(X,{width:"wide",context:"formatting"})||ne.month(X,{width:"abbreviated",context:"formatting"})||ne.month(X,{width:"narrow",context:"formatting"})}}validate(X,re){return re>=0&&re<=11}set(X,re,ne){return X.setMonth(ne,1),X.setHours(0,0,0,0),X}}class StandAloneMonthParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",110);Nt(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(X,re,ne){const oe=de=>de-1;switch(re){case"L":return mapValue(parseNumericPattern(numericPatterns.month,X),oe);case"LL":return mapValue(parseNDigits(2,X),oe);case"Lo":return mapValue(ne.ordinalNumber(X,{unit:"month"}),oe);case"LLL":return ne.month(X,{width:"abbreviated",context:"standalone"})||ne.month(X,{width:"narrow",context:"standalone"});case"LLLLL":return ne.month(X,{width:"narrow",context:"standalone"});case"LLLL":default:return ne.month(X,{width:"wide",context:"standalone"})||ne.month(X,{width:"abbreviated",context:"standalone"})||ne.month(X,{width:"narrow",context:"standalone"})}}validate(X,re){return re>=0&&re<=11}set(X,re,ne){return X.setMonth(ne,1),X.setHours(0,0,0,0),X}}function setWeek(te,J,X){const re=toDate(te),ne=getWeek(re,X)-J;return re.setDate(re.getDate()-ne*7),re}class LocalWeekParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",100);Nt(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(X,re,ne){switch(re){case"w":return parseNumericPattern(numericPatterns.week,X);case"wo":return ne.ordinalNumber(X,{unit:"week"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=1&&re<=53}set(X,re,ne,oe){return startOfWeek(setWeek(X,ne,oe),oe)}}function setISOWeek(te,J){const X=toDate(te),re=getISOWeek(X)-J;return X.setDate(X.getDate()-re*7),X}class ISOWeekParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",100);Nt(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(X,re,ne){switch(re){case"I":return parseNumericPattern(numericPatterns.week,X);case"Io":return ne.ordinalNumber(X,{unit:"week"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=1&&re<=53}set(X,re,ne){return startOfISOWeek(setISOWeek(X,ne))}}const DAYS_IN_MONTH=[31,28,31,30,31,30,31,31,30,31,30,31],DAYS_IN_MONTH_LEAP_YEAR=[31,29,31,30,31,30,31,31,30,31,30,31];class DateParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"subPriority",1);Nt(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(X,re,ne){switch(re){case"d":return parseNumericPattern(numericPatterns.date,X);case"do":return ne.ordinalNumber(X,{unit:"date"});default:return parseNDigits(re.length,X)}}validate(X,re){const ne=X.getFullYear(),oe=isLeapYearIndex(ne),de=X.getMonth();return oe?re>=1&&re<=DAYS_IN_MONTH_LEAP_YEAR[de]:re>=1&&re<=DAYS_IN_MONTH[de]}set(X,re,ne){return X.setDate(ne),X.setHours(0,0,0,0),X}}class DayOfYearParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"subpriority",1);Nt(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(X,re,ne){switch(re){case"D":case"DD":return parseNumericPattern(numericPatterns.dayOfYear,X);case"Do":return ne.ordinalNumber(X,{unit:"date"});default:return parseNDigits(re.length,X)}}validate(X,re){const ne=X.getFullYear();return isLeapYearIndex(ne)?re>=1&&re<=366:re>=1&&re<=365}set(X,re,ne){return X.setMonth(0,ne),X.setHours(0,0,0,0),X}}function setDay(te,J,X){var fe,ge,me,ve;const re=getDefaultOptions$1(),ne=(X==null?void 0:X.weekStartsOn)??((ge=(fe=X==null?void 0:X.locale)==null?void 0:fe.options)==null?void 0:ge.weekStartsOn)??re.weekStartsOn??((ve=(me=re.locale)==null?void 0:me.options)==null?void 0:ve.weekStartsOn)??0,oe=toDate(te),de=oe.getDay(),he=(J%7+7)%7,ue=7-ne,pe=J<0||J>6?J-(de+ue)%7:(he+ue)%7-(de+ue)%7;return addDays(oe,pe)}class DayParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(X,re,ne){switch(re){case"E":case"EE":case"EEE":return ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"});case"EEEEE":return ne.day(X,{width:"narrow",context:"formatting"});case"EEEEEE":return ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"});case"EEEE":default:return ne.day(X,{width:"wide",context:"formatting"})||ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"})}}validate(X,re){return re>=0&&re<=6}set(X,re,ne,oe){return X=setDay(X,ne,oe),X.setHours(0,0,0,0),X}}class LocalDayParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(X,re,ne,oe){const de=ce=>{const he=Math.floor((ce-1)/7)*7;return(ce+oe.weekStartsOn+6)%7+he};switch(re){case"e":case"ee":return mapValue(parseNDigits(re.length,X),de);case"eo":return mapValue(ne.ordinalNumber(X,{unit:"day"}),de);case"eee":return ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"});case"eeeee":return ne.day(X,{width:"narrow",context:"formatting"});case"eeeeee":return ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"});case"eeee":default:return ne.day(X,{width:"wide",context:"formatting"})||ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"})}}validate(X,re){return re>=0&&re<=6}set(X,re,ne,oe){return X=setDay(X,ne,oe),X.setHours(0,0,0,0),X}}class StandAloneLocalDayParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(X,re,ne,oe){const de=ce=>{const he=Math.floor((ce-1)/7)*7;return(ce+oe.weekStartsOn+6)%7+he};switch(re){case"c":case"cc":return mapValue(parseNDigits(re.length,X),de);case"co":return mapValue(ne.ordinalNumber(X,{unit:"day"}),de);case"ccc":return ne.day(X,{width:"abbreviated",context:"standalone"})||ne.day(X,{width:"short",context:"standalone"})||ne.day(X,{width:"narrow",context:"standalone"});case"ccccc":return ne.day(X,{width:"narrow",context:"standalone"});case"cccccc":return ne.day(X,{width:"short",context:"standalone"})||ne.day(X,{width:"narrow",context:"standalone"});case"cccc":default:return ne.day(X,{width:"wide",context:"standalone"})||ne.day(X,{width:"abbreviated",context:"standalone"})||ne.day(X,{width:"short",context:"standalone"})||ne.day(X,{width:"narrow",context:"standalone"})}}validate(X,re){return re>=0&&re<=6}set(X,re,ne,oe){return X=setDay(X,ne,oe),X.setHours(0,0,0,0),X}}function setISODay(te,J){const X=toDate(te),re=getISODay(X),ne=J-re;return addDays(X,ne)}class ISODayParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(X,re,ne){const oe=de=>de===0?7:de;switch(re){case"i":case"ii":return parseNDigits(re.length,X);case"io":return ne.ordinalNumber(X,{unit:"day"});case"iii":return mapValue(ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"}),oe);case"iiiii":return mapValue(ne.day(X,{width:"narrow",context:"formatting"}),oe);case"iiiiii":return mapValue(ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"}),oe);case"iiii":default:return mapValue(ne.day(X,{width:"wide",context:"formatting"})||ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"}),oe)}}validate(X,re){return re>=1&&re<=7}set(X,re,ne){return X=setISODay(X,ne),X.setHours(0,0,0,0),X}}class AMPMParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",80);Nt(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(X,re,ne){switch(re){case"a":case"aa":case"aaa":return ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"aaaaa":return ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"aaaa":default:return ne.dayPeriod(X,{width:"wide",context:"formatting"})||ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"})}}set(X,re,ne){return X.setHours(dayPeriodEnumToHours(ne),0,0,0),X}}class AMPMMidnightParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",80);Nt(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(X,re,ne){switch(re){case"b":case"bb":case"bbb":return ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"bbbbb":return ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"bbbb":default:return ne.dayPeriod(X,{width:"wide",context:"formatting"})||ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"})}}set(X,re,ne){return X.setHours(dayPeriodEnumToHours(ne),0,0,0),X}}class DayPeriodParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",80);Nt(this,"incompatibleTokens",["a","b","t","T"])}parse(X,re,ne){switch(re){case"B":case"BB":case"BBB":return ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"BBBBB":return ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"BBBB":default:return ne.dayPeriod(X,{width:"wide",context:"formatting"})||ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"})}}set(X,re,ne){return X.setHours(dayPeriodEnumToHours(ne),0,0,0),X}}class Hour1to12Parser extends Parser{constructor(){super(...arguments);Nt(this,"priority",70);Nt(this,"incompatibleTokens",["H","K","k","t","T"])}parse(X,re,ne){switch(re){case"h":return parseNumericPattern(numericPatterns.hour12h,X);case"ho":return ne.ordinalNumber(X,{unit:"hour"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=1&&re<=12}set(X,re,ne){const oe=X.getHours()>=12;return oe&&ne<12?X.setHours(ne+12,0,0,0):!oe&&ne===12?X.setHours(0,0,0,0):X.setHours(ne,0,0,0),X}}class Hour0to23Parser extends Parser{constructor(){super(...arguments);Nt(this,"priority",70);Nt(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(X,re,ne){switch(re){case"H":return parseNumericPattern(numericPatterns.hour23h,X);case"Ho":return ne.ordinalNumber(X,{unit:"hour"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=0&&re<=23}set(X,re,ne){return X.setHours(ne,0,0,0),X}}class Hour0To11Parser extends Parser{constructor(){super(...arguments);Nt(this,"priority",70);Nt(this,"incompatibleTokens",["h","H","k","t","T"])}parse(X,re,ne){switch(re){case"K":return parseNumericPattern(numericPatterns.hour11h,X);case"Ko":return ne.ordinalNumber(X,{unit:"hour"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=0&&re<=11}set(X,re,ne){return X.getHours()>=12&&ne<12?X.setHours(ne+12,0,0,0):X.setHours(ne,0,0,0),X}}class Hour1To24Parser extends Parser{constructor(){super(...arguments);Nt(this,"priority",70);Nt(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(X,re,ne){switch(re){case"k":return parseNumericPattern(numericPatterns.hour24h,X);case"ko":return ne.ordinalNumber(X,{unit:"hour"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=1&&re<=24}set(X,re,ne){const oe=ne<=24?ne%24:ne;return X.setHours(oe,0,0,0),X}}class MinuteParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",60);Nt(this,"incompatibleTokens",["t","T"])}parse(X,re,ne){switch(re){case"m":return parseNumericPattern(numericPatterns.minute,X);case"mo":return ne.ordinalNumber(X,{unit:"minute"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=0&&re<=59}set(X,re,ne){return X.setMinutes(ne,0,0),X}}class SecondParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",50);Nt(this,"incompatibleTokens",["t","T"])}parse(X,re,ne){switch(re){case"s":return parseNumericPattern(numericPatterns.second,X);case"so":return ne.ordinalNumber(X,{unit:"second"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=0&&re<=59}set(X,re,ne){return X.setSeconds(ne,0),X}}class FractionOfSecondParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",30);Nt(this,"incompatibleTokens",["t","T"])}parse(X,re){const ne=oe=>Math.trunc(oe*Math.pow(10,-re.length+3));return mapValue(parseNDigits(re.length,X),ne)}set(X,re,ne){return X.setMilliseconds(ne),X}}class ISOTimezoneWithZParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",10);Nt(this,"incompatibleTokens",["t","T","x"])}parse(X,re){switch(re){case"X":return parseTimezonePattern(timezonePatterns.basicOptionalMinutes,X);case"XX":return parseTimezonePattern(timezonePatterns.basic,X);case"XXXX":return parseTimezonePattern(timezonePatterns.basicOptionalSeconds,X);case"XXXXX":return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds,X);case"XXX":default:return parseTimezonePattern(timezonePatterns.extended,X)}}set(X,re,ne){return re.timestampIsSet?X:constructFrom(X,X.getTime()-getTimezoneOffsetInMilliseconds(X)-ne)}}class ISOTimezoneParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",10);Nt(this,"incompatibleTokens",["t","T","X"])}parse(X,re){switch(re){case"x":return parseTimezonePattern(timezonePatterns.basicOptionalMinutes,X);case"xx":return parseTimezonePattern(timezonePatterns.basic,X);case"xxxx":return parseTimezonePattern(timezonePatterns.basicOptionalSeconds,X);case"xxxxx":return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds,X);case"xxx":default:return parseTimezonePattern(timezonePatterns.extended,X)}}set(X,re,ne){return re.timestampIsSet?X:constructFrom(X,X.getTime()-getTimezoneOffsetInMilliseconds(X)-ne)}}class TimestampSecondsParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",40);Nt(this,"incompatibleTokens","*")}parse(X){return parseAnyDigitsSigned(X)}set(X,re,ne){return[constructFrom(X,ne*1e3),{timestampIsSet:!0}]}}class TimestampMillisecondsParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",20);Nt(this,"incompatibleTokens","*")}parse(X){return parseAnyDigitsSigned(X)}set(X,re,ne){return[constructFrom(X,ne),{timestampIsSet:!0}]}}const parsers={G:new EraParser,y:new YearParser,Y:new LocalWeekYearParser,R:new ISOWeekYearParser,u:new ExtendedYearParser,Q:new QuarterParser,q:new StandAloneQuarterParser,M:new MonthParser,L:new StandAloneMonthParser,w:new LocalWeekParser,I:new ISOWeekParser,d:new DateParser,D:new DayOfYearParser,E:new DayParser,e:new LocalDayParser,c:new StandAloneLocalDayParser,i:new ISODayParser,a:new AMPMParser,b:new AMPMMidnightParser,B:new DayPeriodParser,h:new Hour1to12Parser,H:new Hour0to23Parser,K:new Hour0To11Parser,k:new Hour1To24Parser,m:new MinuteParser,s:new SecondParser,S:new FractionOfSecondParser,X:new ISOTimezoneWithZParser,x:new ISOTimezoneParser,t:new TimestampSecondsParser,T:new TimestampMillisecondsParser},formattingTokensRegExp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,longFormattingTokensRegExp=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,escapedStringRegExp=/^'([^]*?)'?$/,doubleQuoteRegExp=/''/g,notWhitespaceRegExp=/\S/,unescapedLatinCharacterRegExp=/[a-zA-Z]/;function parse(te,J,X,re){var be,_e,we,Se;const ne=getDefaultOptions(),oe=ne.locale??enUS,de=ne.firstWeekContainsDate??((_e=(be=ne.locale)==null?void 0:be.options)==null?void 0:_e.firstWeekContainsDate)??1,ce=ne.weekStartsOn??((Se=(we=ne.locale)==null?void 0:we.options)==null?void 0:Se.weekStartsOn)??0,he={firstWeekContainsDate:de,weekStartsOn:ce,locale:oe},ue=[new DateToSystemTimezoneSetter],pe=J.match(longFormattingTokensRegExp).map(Ce=>{const ye=Ce[0];if(ye in longFormatters){const Ae=longFormatters[ye];return Ae(Ce,oe.formatLong)}return Ce}).join("").match(formattingTokensRegExp),fe=[];for(let Ce of pe){isProtectedWeekYearToken(Ce)&&warnOrThrowProtectedError(Ce,J,te),isProtectedDayOfYearToken(Ce)&&warnOrThrowProtectedError(Ce,J,te);const ye=Ce[0],Ae=parsers[ye];if(Ae){const{incompatibleTokens:Le}=Ae;if(Array.isArray(Le)){const Me=fe.find(He=>Le.includes(He.token)||He.token===ye);if(Me)throw new RangeError(`The format string mustn't contain \`${Me.fullToken}\` and \`${Ce}\` at the same time`)}else if(Ae.incompatibleTokens==="*"&&fe.length>0)throw new RangeError(`The format string mustn't contain \`${Ce}\` and any other token at the same time`);fe.push({token:ye,fullToken:Ce});const De=Ae.run(te,Ce,oe.match,he);if(!De)return constructFrom(X,NaN);ue.push(De.setter),te=De.rest}else{if(ye.match(unescapedLatinCharacterRegExp))throw new RangeError("Format string contains an unescaped latin alphabet character `"+ye+"`");if(Ce==="''"?Ce="'":ye==="'"&&(Ce=cleanEscapedString(Ce)),te.indexOf(Ce)===0)te=te.slice(Ce.length);else return constructFrom(X,NaN)}}if(te.length>0&¬WhitespaceRegExp.test(te))return constructFrom(X,NaN);const ge=ue.map(Ce=>Ce.priority).sort((Ce,ye)=>ye-Ce).filter((Ce,ye,Ae)=>Ae.indexOf(Ce)===ye).map(Ce=>ue.filter(ye=>ye.priority===Ce).sort((ye,Ae)=>Ae.subPriority-ye.subPriority)).map(Ce=>Ce[0]);let me=toDate(X);if(isNaN(me.getTime()))return constructFrom(X,NaN);const ve={};for(const Ce of ge){if(!Ce.validate(me,he))return constructFrom(X,NaN);const ye=Ce.set(me,ve,he);Array.isArray(ye)?(me=ye[0],Object.assign(ve,ye[1])):me=ye}return constructFrom(X,me)}function cleanEscapedString(te){return te.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp,"'")}const notFound="data:image/svg+xml,%3csvg%20width='215'%20height='150'%20viewBox='0%200%20215%20150'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20opacity='0.9'%20d='M135.132%2057.43C96.9221%2047.658%2083.3815%20-29.7048%2026.9734%2012.5083C-13.0511%2042.4595%2011.4691%20115.499%2061.6878%20107.019C92.0822%20101.867%2087.3917%20101.341%20113.129%20115.244C139.231%20129.308%20167.972%20136.397%20195.855%20111.436C210.28%2098.5179%20215.939%2067.0352%20201.939%2050.7417C184.388%2030.3592%20158.485%2063.4098%20135.132%2057.43Z'%20fill='%23EFF7FF'/%3e%3cellipse%20cx='120.5'%20cy='143.5'%20rx='52.5'%20ry='3.5'%20fill='%23F5F5F5'/%3e%3cpath%20d='M121.387%2080.2184C121.995%2079.5948%20122.563%2078.953%20123.09%2078.2959L134.396%2089.3383C135.09%2090.0177%20134.851%2091.389%20133.861%2092.4024C132.872%2093.4159%20131.505%2093.6888%20130.811%2093.0094L119.505%2081.967C120.148%2081.424%20120.777%2080.8407%20121.385%2080.2171L121.387%2080.2184Z'%20fill='%231D1D1D'/%3e%3cpath%20opacity='0.6'%20d='M121.127%2079.9896C132.157%2068.6986%20131.888%2050.5485%20120.527%2039.4502C109.166%2028.3519%2091.0149%2028.5081%2079.9849%2039.799C68.955%2051.09%2069.2233%2069.2401%2080.5843%2080.3385C91.9453%2091.4368%20110.097%2091.2806%20121.127%2079.9896Z'%20fill='%238FC2F5'/%3e%3cpath%20d='M78.0382%2083.0622C90.8729%2095.6382%20111.378%2095.4578%20123.835%2082.6609C136.293%2069.8625%20135.986%2049.2932%20123.15%2036.7173C110.316%2024.1413%2089.8107%2024.3217%2077.3538%2037.1186C64.8956%2049.9169%2065.2022%2070.4862%2078.0382%2083.0622ZM80.642%2080.387C69.289%2069.264%2069.0172%2051.0692%2080.037%2039.749C91.0569%2028.4288%20109.194%2028.2694%20120.547%2039.3938C131.9%2050.5182%20132.171%2068.713%20121.152%2080.0332C110.132%2091.3534%2091.9949%2091.5128%2080.642%2080.3884V80.387Z'%20fill='%237BACFC'/%3e%3cpath%20d='M169.953%20128.522L171.714%20126.696C173.474%20124.871%20173.421%20121.964%20171.595%20120.205L135.013%2084.9265C133.187%2083.1661%20130.281%2083.2205%20128.522%2085.0451L126.761%2086.8711C125.001%2088.6957%20125.055%2091.6028%20126.88%2093.3619L163.462%20128.64C165.287%20130.401%20168.194%20130.346%20169.953%20128.522Z'%20fill='%23656565'/%3e%3cpath%20opacity='0.35'%20d='M88.8399%2071.2315C96.506%2079.2245%20101.258%2078.1642%20100.757%2082.4547C100.256%2086.7452%2091.398%2085.7448%2082.7698%2076.0396C74.1415%2066.3344%2075.0893%2054.9166%2079.8491%2055.2485C84.6089%2055.5803%2080.129%2062.1492%2088.8399%2071.2315Z'%20fill='white'/%3e%3c/svg%3e";/**
|
|
328
|
+
`}handleTest(){console.log(this.selectedPeriodDate)}};__decorateClass$p([n$x()],ExportPdfModal.prototype,"selectedRadioOption",2),__decorateClass$p([n$x()],ExportPdfModal.prototype,"text",2),__decorateClass$p([n$x()],ExportPdfModal.prototype,"selectedVisibilityLevelElement",2),__decorateClass$p([n$x()],ExportPdfModal.prototype,"selectedPeriodDate",2),__decorateClass$p([n$x({type:Array})],ExportPdfModal.prototype,"arrayElements",2),ExportPdfModal=__decorateClass$p([t$j("export-pdf-modal")],ExportPdfModal);class ExportToPdfHandler extends ApiBaseHandler{async handle(){try{this.api.interactionService.confirm(void 0,ExportPdfModal,{title:translate("modal.selectExportOption"),confirmButtonText:"Exportar",cancelButtonText:"Cancelar"})}catch(J){this._notifyError(J.message)}}_notifyError(J){this.api.notificationService.error(J||"actions.delete.error")}}class ExportPdf{}let request$e;const bootstrapExportPdf=te=>{request$e=te.registerRequest(ExportPdf,ExportToPdfHandler)},teardownExportPdf=()=>{request$e==null||request$e.dispose()},{addActivityHistoryItems}=activityHistoryCollectionsSlice.actions;class AddHistoryItemsHandler extends StoreBaseHandler{async handle(J){try{const X=validateAndFilterBasicItems(J.items);this.store.dispatch(addActivityHistoryItems({id:J.entityId,items:X,componentFactory:J.componentFactory,searchPredicate:J.searchPredicate})),handleAddDiagnosticsFilter(X,this.store)}catch(X){console.log(X.message)}}}let request$d;const bootstrapAddHistoryItems=te=>{request$d=te.registerRequest(addHistoryItemsCommand,AddHistoryItemsHandler)},teardownAddHistoryItems=()=>{request$d==null||request$d.dispose()},{updateActivityHistoryItem}=activityHistoryCollectionsSlice.actions;class UpdateHistoryItemHandler extends StoreBaseHandler{async handle(J){try{ensureAreValidBasicActivityHistoryItems([J.item]),this.store.dispatch(updateActivityHistoryItem({id:J.entityId,item:J.item}))}catch(X){console.log(X.message)}}}const updateHistoryItemCommand="update_history_item_request";let request$c;const bootstrapUpdateHistoryItem=te=>{request$c=te.registerRequest(updateHistoryItemCommand,UpdateHistoryItemHandler)},teardownUpdateHistoryItem=()=>{request$c==null||request$c.dispose()};function connectedProperty(te,J={}){return createConnectedProperty(store)(te,J)}const activityHistorySearchStringSelector=te=>te.activityHistoryFilters.searchString;function getUniqueObjects(te,J,X,re){const ne=`Sense ${re.toLocaleLowerCase()}`,oe=new Map;let de=!1;for(const he of te){const ue=J.reduce((me,ve)=>me==null?void 0:me[ve],he),pe=X.reduce((me,ve)=>me==null?void 0:me[ve],he),fe=typeof ue=="string"&&ue.trim()!=="",ge=typeof pe=="string"&&pe.trim()!=="";fe&&ge?oe.has(ue)||oe.set(ue,{id:ue,title:pe}):de=!0}const ce=Array.from(oe.values()).sort((he,ue)=>he.title.localeCompare(ue.title,"ca",{sensitivity:"base"}));return de&&ce.push({id:"",title:ne}),ce}class TrueSpec extends Spec{isSatisfiedBy(){return!0}}class CommonFilterSpec extends Spec{constructor(J){super(),this.commonFilters=J}isSatisfiedBy(J){return this.commonFilters.filter(ne=>ne.enabled).reduce((ne,oe)=>ne.and(new oe.spec),new TrueSpec).isSatisfiedBy(J)}}class FalseSpec extends Spec{isSatisfiedBy(){return!1}}class PropPathSpec extends Spec{constructor(J,X){super(),this.propPath=J,this.value=X}isSatisfiedBy(J){return this.propPath.reduce((re,ne)=>re==null?void 0:re[ne],J)===this.value}}class CustomFilterSpec extends Spec{constructor(J){super(),this.filters=J}isSatisfiedBy(J){const X=this.filters.filter(re=>re.enabled);return X.length===0?!0:X.every(re=>{if(!this.belongsToGroup(J,re))return!0;const ne=re.filters.filter(oe=>oe.enabled||oe.singleOption);return ne.length===0?!0:ne.every(oe=>oe.singleOption?oe.enabled?!0:new PropPathSpec(oe.propPathValue,!1).isSatisfiedBy(J):!oe.enabledValues||oe.enabledValues.length===0?!0:oe.enabledValues.reduce((ce,he)=>ce.or(new PropPathSpec(oe.propPathValue,he)),new FalseSpec).isSatisfiedBy(J))})}belongsToGroup(J,X){return J.type===X.id}}const normalizeStringToNFD=te=>te==null?"":String(te).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLocaleLowerCase(),propContainsString=(te,J)=>{const X=normalizeStringToNFD(te),re=normalizeStringToNFD(J);return X.toString().toLowerCase().indexOf(re)!==-1||X.toString().indexOf(re)!==-1},commonFieldsSearchPredicate=(te,J)=>{var he,ue,pe,fe,ge,me,ve,be,_e,we,Se;const X=((he=te.professional)==null?void 0:he.name)&&propContainsString((ue=te.professional)==null?void 0:ue.name,J),re=((pe=te.center)==null?void 0:pe.description)&&propContainsString(te.center.description,J),ne=((ge=(fe=te.professional)==null?void 0:fe.speciality)==null?void 0:ge.description)&&propContainsString((me=te.professional)==null?void 0:me.speciality.description,J),oe=((be=(ve=te.professional)==null?void 0:ve.role)==null?void 0:be.description)&&propContainsString((_e=te.professional)==null?void 0:_e.role.description,J),de=((we=te.service)==null?void 0:we.description)&&propContainsString(te.service.description,J),ce=(Se=te.diagnostics)==null?void 0:Se.some(Ce=>propContainsString(Ce.id,J)||propContainsString(Ce.description,J));return X||re||ne||oe||de||ce};class SearchStringSpec extends Spec{constructor(J,X){super(),this.searchString=J,this.searchPredicate=X}isSatisfiedBy(J){var ne;if(!((ne=this.searchString)!=null&&ne.trim()))return!0;const X=commonFieldsSearchPredicate(J,this.searchString),re=this.searchPredicate?this.searchPredicate(this.searchString.toLowerCase(),J):!1;return!!(X||re)}}class TypeSpec extends Spec{constructor(J){super(),this.itemType=J}isSatisfiedBy(J){return(J==null?void 0:J.type)===this.itemType}}class ComposedTypeSpec extends Spec{constructor(J){super(),this.filters=J}isSatisfiedBy(J){return this.filters.filter(ne=>ne.enabled).map(ne=>ne.id).reduce((ne,oe)=>ne.or(new TypeSpec(oe)),new FalseSpec).isSatisfiedBy(J)}}const activityHistoryFiltersSelector=te=>te.activityHistoryFilters.filters,activityHistoryCommonFiltersSelector=createSelector(activityHistoryFiltersSelector,te=>{var J;return((J=te.find(isCommonFilterGroup))==null?void 0:J.filters)||[]}),activityHistoryEnabledCommonFiltersSelector=createSelector(activityHistoryCommonFiltersSelector,te=>te.filter(J=>J.enabled)),areCommonFiltersActive=createSelector(activityHistoryEnabledCommonFiltersSelector,te=>!!te.length),activityHistoryCustomFilterGroupsSelector=createSelector(activityHistoryFiltersSelector,te=>te.filter(isCustomFilter).sort(sortBySortProperty)),sortBySortProperty=(te,J)=>Number(te.sort)-Number(J.sort),areCustomFiltersActive=createSelector(activityHistoryCustomFilterGroupsSelector,te=>te.some(J=>J.filters.some(X=>{var re;return(re=X.enabledValues)==null?void 0:re.length}))),activeGroupsWithEnabledFilters=createSelector(activityHistoryCustomFilterGroupsSelector,te=>te.filter(J=>J.enabled).map(({id:J,title:X,enabled:re,sort:ne,filters:oe})=>({id:J,title:X,enabled:re,sort:ne,filters:oe.filter(de=>{var ce;return(ce=de.enabledValues)==null?void 0:ce.length})})).filter(J=>J.filters.length>0)),areSameDiagnostics=(te,J)=>{if(te.length!==J.length)return!1;const X=te.map(ne=>ne.codi).sort(),re=J.map(ne=>ne.codi).sort();return X.every((ne,oe)=>ne===re[oe])},hasValidDiagnostic=te=>te!=null&&typeof te.codi=="string"&&typeof te.cataleg=="string"&&typeof te.description=="string",hasValidDiagnostics=te=>te==null?!0:Array.isArray(te)&&te.every(hasValidDiagnostic),isSameVisit=(te,J)=>{var oe,de,ce,he,ue,pe,fe,ge,me,ve,be,_e,we,Se,Ce,ye,Ae,Le;const X=((oe=te.professional)==null?void 0:oe.id)===((de=J.professional)==null?void 0:de.id)&&((he=(ce=te.professional)==null?void 0:ce.role)==null?void 0:he.id)===((pe=(ue=J.professional)==null?void 0:ue.role)==null?void 0:pe.id)&&((ge=(fe=te.professional)==null?void 0:fe.speciality)==null?void 0:ge.id)===((ve=(me=J.professional)==null?void 0:me.speciality)==null?void 0:ve.id),re=((be=te.ep)==null?void 0:be.id)===((_e=J.ep)==null?void 0:_e.id)&&((we=te.up)==null?void 0:we.id)===((Se=J.up)==null?void 0:Se.id)&&((Ce=te.center)==null?void 0:Ce.id)===((ye=J.center)==null?void 0:ye.id)&&((Ae=te.service)==null?void 0:Ae.id)===((Le=J.service)==null?void 0:Le.id),ne=new Date(te.date).toDateString()===new Date(J.date).toDateString();return X&&re&&ne},withinEightHours=(te,J)=>Math.abs(new Date(te).getTime()-new Date(J).getTime())<=8*60*60*1e3;function groupByValidDiagnostics(te){te.forEach(J=>{const X=[],re=[];J.items.forEach(ne=>{const oe=ne.diagnostics;if((oe==null?void 0:oe.length)>0&&hasValidDiagnostics(oe)){let ce=!1;for(const he of X){const ue=he.items[0];if(areSameDiagnostics(ue.diagnostics,oe)){he.items.push(ne),ce=!0;break}}ce||X.push({idSubGroup:crypto.randomUUID(),items:[ne]})}else re.push(ne)}),J.items=re,J.subGroups=X})}const groupActivityHistoryItems=te=>{const J=[];return te==null||te.forEach(X=>{let re=!1;for(const ne of J){const oe=ne.items[0],de=ne.items[ne.items.length-1];if(isSameVisit(oe,X)&&withinEightHours(oe.date,X.date)&&withinEightHours(de.date,X.date)){ne.items.push(X),ne.sameVisit=!0,re=!0;break}}if(!re)for(const ne of J){if(ne.sameVisit)continue;const oe=ne.items[0],de=ne.items[ne.items.length-1];if(withinEightHours(oe.date,X.date)&&withinEightHours(de.date,X.date)){ne.items.push(X),re=!0;break}}re||J.push({idGroup:crypto.randomUUID(),items:[X],sameVisit:!1})}),groupByValidDiagnostics(J),J},sortGroupsByMostRecentDate=te=>{const J=oe=>oe.reduce((de,ce)=>{const he=new Date(ce.date);return he>de?he:de},new Date(0)),X=oe=>oe.sort((de,ce)=>new Date(ce.date).getTime()-new Date(de.date).getTime()),re=oe=>J(oe.items),ne=oe=>{const de=oe.items.length>0?[J(oe.items)]:[],ce=oe.subGroups.map(re),he=[...de,...ce];return he.length>0?new Date(Math.max(...he.map(ue=>ue.getTime()))):new Date(0)};return te.forEach(oe=>{oe.items=X(oe.items),oe.subGroups.forEach(de=>{de.items=X(de.items)}),oe.subGroups.sort((de,ce)=>re(ce).getTime()-re(de).getTime())}),te.sort((oe,de)=>ne(de).getTime()-ne(oe).getTime())},diagnosticFilterSelector=createSelector(activityHistoryFiltersSelector,te=>te.find(isDiagnosticFilter)),diagnosticFilterEnabledValuesSelector=createSelector(diagnosticFilterSelector,te=>(te==null?void 0:te.enabledValues)||[]),areDiagnosticFiltersActive=createSelector(diagnosticFilterEnabledValuesSelector,te=>!!te.length);class DiagnosticCodeSpec extends Spec{constructor(J){super(),this.diagnosticCodes=J}isSatisfiedBy(J){var re;return(re=this.diagnosticCodes)!=null&&re.length?(J.diagnostics??[]).some(ne=>this.diagnosticCodes.includes(ne.codi)):!0}}const activityHistoryCollectionsSelector=te=>te.activityHistoryCollections.collections,mapItemsWithMetadata=(te,J,X,re)=>te.map(ne=>({...ne,searchPredicate:re,componentFactory:J,type:X})),activityHistoryMappedItems=createSelector(activityHistoryCollectionsSelector,te=>Object.values(te).flatMap(J=>mapItemsWithMetadata(J.items,J.componentFactory,J.id,J.searchPredicate))),customFilterGroupsWithOptionsSelector=createSelector(activityHistoryCustomFilterGroupsSelector,activityHistoryCollectionsSelector,(te,J)=>te.map(re=>{const ne=J[re.id];return{...re,filters:re.filters.map(oe=>({...oe,options:(oe.singleOption?[]:getUniqueObjects(ne.items,oe.propPathValue,oe.propsPathDescription,oe.title))||[]}))}})),activityHistoryGroupedItems=createSelector(activityHistoryMappedItems,activityHistorySearchStringSelector,activityHistoryCommonFiltersSelector,activityHistoryCustomFilterGroupsSelector,diagnosticFilterEnabledValuesSelector,(te,J,X,re,ne)=>{const oe=te.filter(he=>new SearchStringSpec(J,he.searchPredicate).and(new CommonFilterSpec(X)).and(new ComposedTypeSpec(re)).and(new CustomFilterSpec(re)).and(new DiagnosticCodeSpec(ne)).isSatisfiedBy(he)),de=groupActivityHistoryItems(oe);return sortGroupsByMostRecentDate(de)}),styles$g=":host{min-height:1px;height:100%}.virtualizer{height:100%;padding-inline:16px}.container{min-height:1px;height:100%}.visit:first-child{margin-top:var(--dss-spacing-md)}.visit{width:calc(100% - var(--dss-spacing-md) - var(--dss-spacing-md));display:flex;flex-direction:column;gap:var(--dss-spacing-sm);background-color:#fff;border-radius:var(--dss-radius-sm);padding:var(--dss-spacing-sm);margin-bottom:var(--dss-spacing-md)}.visit .visit__header{display:flex;flex-direction:row;align-items:center;gap:16px}.visit .visit__header .title{flex:1;font-size:14px;line-height:24px;display:flex;flex-direction:row;gap:12px;color:var(--color-neutral-800)}.visit .visit__header .title-date{font-weight:700}.visit .visit__header .title-description{font-weight:600;display:flex;flex-direction:row;gap:4px}.visit .visit__header .highlight{background-color:#ff0;font-weight:700}.visit .visit__items{display:flex;flex-direction:column;gap:16px}.visit .visit__items .item[has-divider]{border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.visit .visit__items .item[has-divider]:last-of-type{border:none}.visit .diagnostics{display:flex;flex-direction:column;gap:var(--dss-spacing-sm);border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.visit .diagnostics:last-of-type{border:none}.visit .diagnostics .diagnostics__header{display:flex;flex-direction:row;align-items:center;gap:16px}.visit .diagnostics .diagnostics__items{display:flex;flex-direction:column}.visit .diagnostics .diagnostics__items .item[has-divider]{border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.visit .diagnostics .diagnostics__items .item[has-divider]:last-of-type{border:none}.feedback{width:100%;height:100%;display:flex;align-items:center;justify-content:center}";function toDate(te){const J=Object.prototype.toString.call(te);return te instanceof Date||typeof te=="object"&&J==="[object Date]"?new te.constructor(+te):typeof te=="number"||J==="[object Number]"||typeof te=="string"||J==="[object String]"?new Date(te):new Date(NaN)}function constructFrom(te,J){return te instanceof Date?new te.constructor(J):new Date(J)}function addDays(te,J){const X=toDate(te);return isNaN(J)?constructFrom(te,NaN):(J&&X.setDate(X.getDate()+J),X)}const millisecondsInWeek=6048e5,millisecondsInDay=864e5,millisecondsInMinute=6e4,millisecondsInHour=36e5,millisecondsInSecond=1e3;let defaultOptions={};function getDefaultOptions$1(){return defaultOptions}function startOfWeek(te,J){var ce,he,ue,pe;const X=getDefaultOptions$1(),re=(J==null?void 0:J.weekStartsOn)??((he=(ce=J==null?void 0:J.locale)==null?void 0:ce.options)==null?void 0:he.weekStartsOn)??X.weekStartsOn??((pe=(ue=X.locale)==null?void 0:ue.options)==null?void 0:pe.weekStartsOn)??0,ne=toDate(te),oe=ne.getDay(),de=(oe<re?7:0)+oe-re;return ne.setDate(ne.getDate()-de),ne.setHours(0,0,0,0),ne}function startOfISOWeek(te){return startOfWeek(te,{weekStartsOn:1})}function getISOWeekYear(te){const J=toDate(te),X=J.getFullYear(),re=constructFrom(te,0);re.setFullYear(X+1,0,4),re.setHours(0,0,0,0);const ne=startOfISOWeek(re),oe=constructFrom(te,0);oe.setFullYear(X,0,4),oe.setHours(0,0,0,0);const de=startOfISOWeek(oe);return J.getTime()>=ne.getTime()?X+1:J.getTime()>=de.getTime()?X:X-1}function startOfDay(te){const J=toDate(te);return J.setHours(0,0,0,0),J}function getTimezoneOffsetInMilliseconds(te){const J=toDate(te),X=new Date(Date.UTC(J.getFullYear(),J.getMonth(),J.getDate(),J.getHours(),J.getMinutes(),J.getSeconds(),J.getMilliseconds()));return X.setUTCFullYear(J.getFullYear()),+te-+X}function differenceInCalendarDays(te,J){const X=startOfDay(te),re=startOfDay(J),ne=+X-getTimezoneOffsetInMilliseconds(X),oe=+re-getTimezoneOffsetInMilliseconds(re);return Math.round((ne-oe)/millisecondsInDay)}function startOfISOWeekYear(te){const J=getISOWeekYear(te),X=constructFrom(te,0);return X.setFullYear(J,0,4),X.setHours(0,0,0,0),startOfISOWeek(X)}function isDate(te){return te instanceof Date||typeof te=="object"&&Object.prototype.toString.call(te)==="[object Date]"}function isValid(te){if(!isDate(te)&&typeof te!="number")return!1;const J=toDate(te);return!isNaN(Number(J))}function endOfMonth(te){const J=toDate(te),X=J.getMonth();return J.setFullYear(J.getFullYear(),X+1,0),J.setHours(23,59,59,999),J}function eachDayOfInterval(te,J){const X=toDate(te.start),re=toDate(te.end);let ne=+X>+re;const oe=ne?+X:+re,de=ne?re:X;de.setHours(0,0,0,0);let ce=1;const he=[];for(;+de<=oe;)he.push(toDate(de)),de.setDate(de.getDate()+ce),de.setHours(0,0,0,0);return ne?he.reverse():he}function startOfMonth(te){const J=toDate(te);return J.setDate(1),J.setHours(0,0,0,0),J}function startOfYear(te){const J=toDate(te),X=constructFrom(te,0);return X.setFullYear(J.getFullYear(),0,1),X.setHours(0,0,0,0),X}const formatDistanceLocale={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},formatDistance=(te,J,X)=>{let re;const ne=formatDistanceLocale[te];return typeof ne=="string"?re=ne:J===1?re=ne.one:re=ne.other.replace("{{count}}",J.toString()),X!=null&&X.addSuffix?X.comparison&&X.comparison>0?"in "+re:re+" ago":re};function buildFormatLongFn(te){return(J={})=>{const X=J.width?String(J.width):te.defaultWidth;return te.formats[X]||te.formats[te.defaultWidth]}}const dateFormats={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},timeFormats={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},dateTimeFormats={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong={date:buildFormatLongFn({formats:dateFormats,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats,defaultWidth:"full"})},formatRelativeLocale={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},formatRelative=(te,J,X,re)=>formatRelativeLocale[te];function buildLocalizeFn(te){return(J,X)=>{const re=X!=null&&X.context?String(X.context):"standalone";let ne;if(re==="formatting"&&te.formattingValues){const de=te.defaultFormattingWidth||te.defaultWidth,ce=X!=null&&X.width?String(X.width):de;ne=te.formattingValues[ce]||te.formattingValues[de]}else{const de=te.defaultWidth,ce=X!=null&&X.width?String(X.width):te.defaultWidth;ne=te.values[ce]||te.values[de]}const oe=te.argumentCallback?te.argumentCallback(J):J;return ne[oe]}}const eraValues={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},quarterValues={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},monthValues={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},dayValues={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},dayPeriodValues={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},formattingDayPeriodValues={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ordinalNumber=(te,J)=>{const X=Number(te),re=X%100;if(re>20||re<10)switch(re%10){case 1:return X+"st";case 2:return X+"nd";case 3:return X+"rd"}return X+"th"},localize={ordinalNumber,era:buildLocalizeFn({values:eraValues,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues,defaultWidth:"wide",argumentCallback:te=>te-1}),month:buildLocalizeFn({values:monthValues,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues,defaultWidth:"wide",formattingValues:formattingDayPeriodValues,defaultFormattingWidth:"wide"})};function buildMatchFn(te){return(J,X={})=>{const re=X.width,ne=re&&te.matchPatterns[re]||te.matchPatterns[te.defaultMatchWidth],oe=J.match(ne);if(!oe)return null;const de=oe[0],ce=re&&te.parsePatterns[re]||te.parsePatterns[te.defaultParseWidth],he=Array.isArray(ce)?findIndex(ce,fe=>fe.test(de)):findKey(ce,fe=>fe.test(de));let ue;ue=te.valueCallback?te.valueCallback(he):he,ue=X.valueCallback?X.valueCallback(ue):ue;const pe=J.slice(de.length);return{value:ue,rest:pe}}}function findKey(te,J){for(const X in te)if(Object.prototype.hasOwnProperty.call(te,X)&&J(te[X]))return X}function findIndex(te,J){for(let X=0;X<te.length;X++)if(J(te[X]))return X}function buildMatchPatternFn(te){return(J,X={})=>{const re=J.match(te.matchPattern);if(!re)return null;const ne=re[0],oe=J.match(te.parsePattern);if(!oe)return null;let de=te.valueCallback?te.valueCallback(oe[0]):oe[0];de=X.valueCallback?X.valueCallback(de):de;const ce=J.slice(ne.length);return{value:de,rest:ce}}}const matchOrdinalNumberPattern=/^(\d+)(th|st|nd|rd)?/i,parseOrdinalNumberPattern=/\d+/i,matchEraPatterns={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},parseEraPatterns={any:[/^b/i,/^(a|c)/i]},matchQuarterPatterns={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},parseQuarterPatterns={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},parseMonthPatterns={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},matchDayPatterns={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},parseDayPatterns={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},matchDayPeriodPatterns={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},parseDayPeriodPatterns={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},match={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern,parsePattern:parseOrdinalNumberPattern,valueCallback:te=>parseInt(te,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns,defaultParseWidth:"any",valueCallback:te=>te+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns,defaultParseWidth:"any"})},enUS={code:"en-US",formatDistance,formatLong,formatRelative,localize,match,options:{weekStartsOn:0,firstWeekContainsDate:1}};function getDayOfYear(te){const J=toDate(te);return differenceInCalendarDays(J,startOfYear(J))+1}function getISOWeek(te){const J=toDate(te),X=+startOfISOWeek(J)-+startOfISOWeekYear(J);return Math.round(X/millisecondsInWeek)+1}function getWeekYear(te,J){var pe,fe,ge,me;const X=toDate(te),re=X.getFullYear(),ne=getDefaultOptions$1(),oe=(J==null?void 0:J.firstWeekContainsDate)??((fe=(pe=J==null?void 0:J.locale)==null?void 0:pe.options)==null?void 0:fe.firstWeekContainsDate)??ne.firstWeekContainsDate??((me=(ge=ne.locale)==null?void 0:ge.options)==null?void 0:me.firstWeekContainsDate)??1,de=constructFrom(te,0);de.setFullYear(re+1,0,oe),de.setHours(0,0,0,0);const ce=startOfWeek(de,J),he=constructFrom(te,0);he.setFullYear(re,0,oe),he.setHours(0,0,0,0);const ue=startOfWeek(he,J);return X.getTime()>=ce.getTime()?re+1:X.getTime()>=ue.getTime()?re:re-1}function startOfWeekYear(te,J){var ce,he,ue,pe;const X=getDefaultOptions$1(),re=(J==null?void 0:J.firstWeekContainsDate)??((he=(ce=J==null?void 0:J.locale)==null?void 0:ce.options)==null?void 0:he.firstWeekContainsDate)??X.firstWeekContainsDate??((pe=(ue=X.locale)==null?void 0:ue.options)==null?void 0:pe.firstWeekContainsDate)??1,ne=getWeekYear(te,J),oe=constructFrom(te,0);return oe.setFullYear(ne,0,re),oe.setHours(0,0,0,0),startOfWeek(oe,J)}function getWeek(te,J){const X=toDate(te),re=+startOfWeek(X,J)-+startOfWeekYear(X,J);return Math.round(re/millisecondsInWeek)+1}function addLeadingZeros(te,J){const X=te<0?"-":"",re=Math.abs(te).toString().padStart(J,"0");return X+re}const lightFormatters={y(te,J){const X=te.getFullYear(),re=X>0?X:1-X;return addLeadingZeros(J==="yy"?re%100:re,J.length)},M(te,J){const X=te.getMonth();return J==="M"?String(X+1):addLeadingZeros(X+1,2)},d(te,J){return addLeadingZeros(te.getDate(),J.length)},a(te,J){const X=te.getHours()/12>=1?"pm":"am";switch(J){case"a":case"aa":return X.toUpperCase();case"aaa":return X;case"aaaaa":return X[0];case"aaaa":default:return X==="am"?"a.m.":"p.m."}},h(te,J){return addLeadingZeros(te.getHours()%12||12,J.length)},H(te,J){return addLeadingZeros(te.getHours(),J.length)},m(te,J){return addLeadingZeros(te.getMinutes(),J.length)},s(te,J){return addLeadingZeros(te.getSeconds(),J.length)},S(te,J){const X=J.length,re=te.getMilliseconds(),ne=Math.trunc(re*Math.pow(10,X-3));return addLeadingZeros(ne,J.length)}},dayPeriodEnum={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},formatters={G:function(te,J,X){const re=te.getFullYear()>0?1:0;switch(J){case"G":case"GG":case"GGG":return X.era(re,{width:"abbreviated"});case"GGGGG":return X.era(re,{width:"narrow"});case"GGGG":default:return X.era(re,{width:"wide"})}},y:function(te,J,X){if(J==="yo"){const re=te.getFullYear(),ne=re>0?re:1-re;return X.ordinalNumber(ne,{unit:"year"})}return lightFormatters.y(te,J)},Y:function(te,J,X,re){const ne=getWeekYear(te,re),oe=ne>0?ne:1-ne;if(J==="YY"){const de=oe%100;return addLeadingZeros(de,2)}return J==="Yo"?X.ordinalNumber(oe,{unit:"year"}):addLeadingZeros(oe,J.length)},R:function(te,J){const X=getISOWeekYear(te);return addLeadingZeros(X,J.length)},u:function(te,J){const X=te.getFullYear();return addLeadingZeros(X,J.length)},Q:function(te,J,X){const re=Math.ceil((te.getMonth()+1)/3);switch(J){case"Q":return String(re);case"QQ":return addLeadingZeros(re,2);case"Qo":return X.ordinalNumber(re,{unit:"quarter"});case"QQQ":return X.quarter(re,{width:"abbreviated",context:"formatting"});case"QQQQQ":return X.quarter(re,{width:"narrow",context:"formatting"});case"QQQQ":default:return X.quarter(re,{width:"wide",context:"formatting"})}},q:function(te,J,X){const re=Math.ceil((te.getMonth()+1)/3);switch(J){case"q":return String(re);case"qq":return addLeadingZeros(re,2);case"qo":return X.ordinalNumber(re,{unit:"quarter"});case"qqq":return X.quarter(re,{width:"abbreviated",context:"standalone"});case"qqqqq":return X.quarter(re,{width:"narrow",context:"standalone"});case"qqqq":default:return X.quarter(re,{width:"wide",context:"standalone"})}},M:function(te,J,X){const re=te.getMonth();switch(J){case"M":case"MM":return lightFormatters.M(te,J);case"Mo":return X.ordinalNumber(re+1,{unit:"month"});case"MMM":return X.month(re,{width:"abbreviated",context:"formatting"});case"MMMMM":return X.month(re,{width:"narrow",context:"formatting"});case"MMMM":default:return X.month(re,{width:"wide",context:"formatting"})}},L:function(te,J,X){const re=te.getMonth();switch(J){case"L":return String(re+1);case"LL":return addLeadingZeros(re+1,2);case"Lo":return X.ordinalNumber(re+1,{unit:"month"});case"LLL":return X.month(re,{width:"abbreviated",context:"standalone"});case"LLLLL":return X.month(re,{width:"narrow",context:"standalone"});case"LLLL":default:return X.month(re,{width:"wide",context:"standalone"})}},w:function(te,J,X,re){const ne=getWeek(te,re);return J==="wo"?X.ordinalNumber(ne,{unit:"week"}):addLeadingZeros(ne,J.length)},I:function(te,J,X){const re=getISOWeek(te);return J==="Io"?X.ordinalNumber(re,{unit:"week"}):addLeadingZeros(re,J.length)},d:function(te,J,X){return J==="do"?X.ordinalNumber(te.getDate(),{unit:"date"}):lightFormatters.d(te,J)},D:function(te,J,X){const re=getDayOfYear(te);return J==="Do"?X.ordinalNumber(re,{unit:"dayOfYear"}):addLeadingZeros(re,J.length)},E:function(te,J,X){const re=te.getDay();switch(J){case"E":case"EE":case"EEE":return X.day(re,{width:"abbreviated",context:"formatting"});case"EEEEE":return X.day(re,{width:"narrow",context:"formatting"});case"EEEEEE":return X.day(re,{width:"short",context:"formatting"});case"EEEE":default:return X.day(re,{width:"wide",context:"formatting"})}},e:function(te,J,X,re){const ne=te.getDay(),oe=(ne-re.weekStartsOn+8)%7||7;switch(J){case"e":return String(oe);case"ee":return addLeadingZeros(oe,2);case"eo":return X.ordinalNumber(oe,{unit:"day"});case"eee":return X.day(ne,{width:"abbreviated",context:"formatting"});case"eeeee":return X.day(ne,{width:"narrow",context:"formatting"});case"eeeeee":return X.day(ne,{width:"short",context:"formatting"});case"eeee":default:return X.day(ne,{width:"wide",context:"formatting"})}},c:function(te,J,X,re){const ne=te.getDay(),oe=(ne-re.weekStartsOn+8)%7||7;switch(J){case"c":return String(oe);case"cc":return addLeadingZeros(oe,J.length);case"co":return X.ordinalNumber(oe,{unit:"day"});case"ccc":return X.day(ne,{width:"abbreviated",context:"standalone"});case"ccccc":return X.day(ne,{width:"narrow",context:"standalone"});case"cccccc":return X.day(ne,{width:"short",context:"standalone"});case"cccc":default:return X.day(ne,{width:"wide",context:"standalone"})}},i:function(te,J,X){const re=te.getDay(),ne=re===0?7:re;switch(J){case"i":return String(ne);case"ii":return addLeadingZeros(ne,J.length);case"io":return X.ordinalNumber(ne,{unit:"day"});case"iii":return X.day(re,{width:"abbreviated",context:"formatting"});case"iiiii":return X.day(re,{width:"narrow",context:"formatting"});case"iiiiii":return X.day(re,{width:"short",context:"formatting"});case"iiii":default:return X.day(re,{width:"wide",context:"formatting"})}},a:function(te,J,X){const ne=te.getHours()/12>=1?"pm":"am";switch(J){case"a":case"aa":return X.dayPeriod(ne,{width:"abbreviated",context:"formatting"});case"aaa":return X.dayPeriod(ne,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return X.dayPeriod(ne,{width:"narrow",context:"formatting"});case"aaaa":default:return X.dayPeriod(ne,{width:"wide",context:"formatting"})}},b:function(te,J,X){const re=te.getHours();let ne;switch(re===12?ne=dayPeriodEnum.noon:re===0?ne=dayPeriodEnum.midnight:ne=re/12>=1?"pm":"am",J){case"b":case"bb":return X.dayPeriod(ne,{width:"abbreviated",context:"formatting"});case"bbb":return X.dayPeriod(ne,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return X.dayPeriod(ne,{width:"narrow",context:"formatting"});case"bbbb":default:return X.dayPeriod(ne,{width:"wide",context:"formatting"})}},B:function(te,J,X){const re=te.getHours();let ne;switch(re>=17?ne=dayPeriodEnum.evening:re>=12?ne=dayPeriodEnum.afternoon:re>=4?ne=dayPeriodEnum.morning:ne=dayPeriodEnum.night,J){case"B":case"BB":case"BBB":return X.dayPeriod(ne,{width:"abbreviated",context:"formatting"});case"BBBBB":return X.dayPeriod(ne,{width:"narrow",context:"formatting"});case"BBBB":default:return X.dayPeriod(ne,{width:"wide",context:"formatting"})}},h:function(te,J,X){if(J==="ho"){let re=te.getHours()%12;return re===0&&(re=12),X.ordinalNumber(re,{unit:"hour"})}return lightFormatters.h(te,J)},H:function(te,J,X){return J==="Ho"?X.ordinalNumber(te.getHours(),{unit:"hour"}):lightFormatters.H(te,J)},K:function(te,J,X){const re=te.getHours()%12;return J==="Ko"?X.ordinalNumber(re,{unit:"hour"}):addLeadingZeros(re,J.length)},k:function(te,J,X){let re=te.getHours();return re===0&&(re=24),J==="ko"?X.ordinalNumber(re,{unit:"hour"}):addLeadingZeros(re,J.length)},m:function(te,J,X){return J==="mo"?X.ordinalNumber(te.getMinutes(),{unit:"minute"}):lightFormatters.m(te,J)},s:function(te,J,X){return J==="so"?X.ordinalNumber(te.getSeconds(),{unit:"second"}):lightFormatters.s(te,J)},S:function(te,J){return lightFormatters.S(te,J)},X:function(te,J,X){const re=te.getTimezoneOffset();if(re===0)return"Z";switch(J){case"X":return formatTimezoneWithOptionalMinutes(re);case"XXXX":case"XX":return formatTimezone(re);case"XXXXX":case"XXX":default:return formatTimezone(re,":")}},x:function(te,J,X){const re=te.getTimezoneOffset();switch(J){case"x":return formatTimezoneWithOptionalMinutes(re);case"xxxx":case"xx":return formatTimezone(re);case"xxxxx":case"xxx":default:return formatTimezone(re,":")}},O:function(te,J,X){const re=te.getTimezoneOffset();switch(J){case"O":case"OO":case"OOO":return"GMT"+formatTimezoneShort(re,":");case"OOOO":default:return"GMT"+formatTimezone(re,":")}},z:function(te,J,X){const re=te.getTimezoneOffset();switch(J){case"z":case"zz":case"zzz":return"GMT"+formatTimezoneShort(re,":");case"zzzz":default:return"GMT"+formatTimezone(re,":")}},t:function(te,J,X){const re=Math.trunc(te.getTime()/1e3);return addLeadingZeros(re,J.length)},T:function(te,J,X){const re=te.getTime();return addLeadingZeros(re,J.length)}};function formatTimezoneShort(te,J=""){const X=te>0?"-":"+",re=Math.abs(te),ne=Math.trunc(re/60),oe=re%60;return oe===0?X+String(ne):X+String(ne)+J+addLeadingZeros(oe,2)}function formatTimezoneWithOptionalMinutes(te,J){return te%60===0?(te>0?"-":"+")+addLeadingZeros(Math.abs(te)/60,2):formatTimezone(te,J)}function formatTimezone(te,J=""){const X=te>0?"-":"+",re=Math.abs(te),ne=addLeadingZeros(Math.trunc(re/60),2),oe=addLeadingZeros(re%60,2);return X+ne+J+oe}const dateLongFormatter=(te,J)=>{switch(te){case"P":return J.date({width:"short"});case"PP":return J.date({width:"medium"});case"PPP":return J.date({width:"long"});case"PPPP":default:return J.date({width:"full"})}},timeLongFormatter=(te,J)=>{switch(te){case"p":return J.time({width:"short"});case"pp":return J.time({width:"medium"});case"ppp":return J.time({width:"long"});case"pppp":default:return J.time({width:"full"})}},dateTimeLongFormatter=(te,J)=>{const X=te.match(/(P+)(p+)?/)||[],re=X[1],ne=X[2];if(!ne)return dateLongFormatter(te,J);let oe;switch(re){case"P":oe=J.dateTime({width:"short"});break;case"PP":oe=J.dateTime({width:"medium"});break;case"PPP":oe=J.dateTime({width:"long"});break;case"PPPP":default:oe=J.dateTime({width:"full"});break}return oe.replace("{{date}}",dateLongFormatter(re,J)).replace("{{time}}",timeLongFormatter(ne,J))},longFormatters={p:timeLongFormatter,P:dateTimeLongFormatter},dayOfYearTokenRE=/^D+$/,weekYearTokenRE=/^Y+$/,throwTokens=["D","DD","YY","YYYY"];function isProtectedDayOfYearToken(te){return dayOfYearTokenRE.test(te)}function isProtectedWeekYearToken(te){return weekYearTokenRE.test(te)}function warnOrThrowProtectedError(te,J,X){const re=message(te,J,X);if(console.warn(re),throwTokens.includes(te))throw new RangeError(re)}function message(te,J,X){const re=te[0]==="Y"?"years":"days of the month";return`Use \`${te.toLowerCase()}\` instead of \`${te}\` (in \`${J}\`) for formatting ${re} to the input \`${X}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const formattingTokensRegExp$1=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,longFormattingTokensRegExp$1=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,escapedStringRegExp$1=/^'([^]*?)'?$/,doubleQuoteRegExp$1=/''/g,unescapedLatinCharacterRegExp$1=/[a-zA-Z]/;function format(te,J,X){var pe,fe,ge,me;const re=getDefaultOptions$1(),ne=re.locale??enUS,oe=re.firstWeekContainsDate??((fe=(pe=re.locale)==null?void 0:pe.options)==null?void 0:fe.firstWeekContainsDate)??1,de=re.weekStartsOn??((me=(ge=re.locale)==null?void 0:ge.options)==null?void 0:me.weekStartsOn)??0,ce=toDate(te);if(!isValid(ce))throw new RangeError("Invalid time value");let he=J.match(longFormattingTokensRegExp$1).map(ve=>{const be=ve[0];if(be==="p"||be==="P"){const _e=longFormatters[be];return _e(ve,ne.formatLong)}return ve}).join("").match(formattingTokensRegExp$1).map(ve=>{if(ve==="''")return{isToken:!1,value:"'"};const be=ve[0];if(be==="'")return{isToken:!1,value:cleanEscapedString$1(ve)};if(formatters[be])return{isToken:!0,value:ve};if(be.match(unescapedLatinCharacterRegExp$1))throw new RangeError("Format string contains an unescaped latin alphabet character `"+be+"`");return{isToken:!1,value:ve}});ne.localize.preprocessor&&(he=ne.localize.preprocessor(ce,he));const ue={firstWeekContainsDate:oe,weekStartsOn:de,locale:ne};return he.map(ve=>{if(!ve.isToken)return ve.value;const be=ve.value;(isProtectedWeekYearToken(be)||isProtectedDayOfYearToken(be))&&warnOrThrowProtectedError(be,J,String(te));const _e=formatters[be[0]];return _e(ce,be,ne.localize,ue)}).join("")}function cleanEscapedString$1(te){const J=te.match(escapedStringRegExp$1);return J?J[1].replace(doubleQuoteRegExp$1,"'"):te}function getDay(te){return toDate(te).getDay()}function getDefaultOptions(){return Object.assign({},getDefaultOptions$1())}function getISODay(te){let X=toDate(te).getDay();return X===0&&(X=7),X}function transpose(te,J){const X=J instanceof Date?constructFrom(J,0):new J(0);return X.setFullYear(te.getFullYear(),te.getMonth(),te.getDate()),X.setHours(te.getHours(),te.getMinutes(),te.getSeconds(),te.getMilliseconds()),X}const TIMEZONE_UNIT_PRIORITY=10;class Setter{constructor(){Nt(this,"subPriority",0)}validate(J,X){return!0}}class ValueSetter extends Setter{constructor(J,X,re,ne,oe){super(),this.value=J,this.validateValue=X,this.setValue=re,this.priority=ne,oe&&(this.subPriority=oe)}validate(J,X){return this.validateValue(J,this.value,X)}set(J,X,re){return this.setValue(J,X,this.value,re)}}class DateToSystemTimezoneSetter extends Setter{constructor(){super(...arguments);Nt(this,"priority",TIMEZONE_UNIT_PRIORITY);Nt(this,"subPriority",-1)}set(X,re){return re.timestampIsSet?X:constructFrom(X,transpose(X,Date))}}class Parser{run(J,X,re,ne){const oe=this.parse(J,X,re,ne);return oe?{setter:new ValueSetter(oe.value,this.validate,this.set,this.priority,this.subPriority),rest:oe.rest}:null}validate(J,X,re){return!0}}class EraParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",140);Nt(this,"incompatibleTokens",["R","u","t","T"])}parse(X,re,ne){switch(re){case"G":case"GG":case"GGG":return ne.era(X,{width:"abbreviated"})||ne.era(X,{width:"narrow"});case"GGGGG":return ne.era(X,{width:"narrow"});case"GGGG":default:return ne.era(X,{width:"wide"})||ne.era(X,{width:"abbreviated"})||ne.era(X,{width:"narrow"})}}set(X,re,ne){return re.era=ne,X.setFullYear(ne,0,1),X.setHours(0,0,0,0),X}}const numericPatterns={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},timezonePatterns={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function mapValue(te,J){return te&&{value:J(te.value),rest:te.rest}}function parseNumericPattern(te,J){const X=J.match(te);return X?{value:parseInt(X[0],10),rest:J.slice(X[0].length)}:null}function parseTimezonePattern(te,J){const X=J.match(te);if(!X)return null;if(X[0]==="Z")return{value:0,rest:J.slice(1)};const re=X[1]==="+"?1:-1,ne=X[2]?parseInt(X[2],10):0,oe=X[3]?parseInt(X[3],10):0,de=X[5]?parseInt(X[5],10):0;return{value:re*(ne*millisecondsInHour+oe*millisecondsInMinute+de*millisecondsInSecond),rest:J.slice(X[0].length)}}function parseAnyDigitsSigned(te){return parseNumericPattern(numericPatterns.anyDigitsSigned,te)}function parseNDigits(te,J){switch(te){case 1:return parseNumericPattern(numericPatterns.singleDigit,J);case 2:return parseNumericPattern(numericPatterns.twoDigits,J);case 3:return parseNumericPattern(numericPatterns.threeDigits,J);case 4:return parseNumericPattern(numericPatterns.fourDigits,J);default:return parseNumericPattern(new RegExp("^\\d{1,"+te+"}"),J)}}function parseNDigitsSigned(te,J){switch(te){case 1:return parseNumericPattern(numericPatterns.singleDigitSigned,J);case 2:return parseNumericPattern(numericPatterns.twoDigitsSigned,J);case 3:return parseNumericPattern(numericPatterns.threeDigitsSigned,J);case 4:return parseNumericPattern(numericPatterns.fourDigitsSigned,J);default:return parseNumericPattern(new RegExp("^-?\\d{1,"+te+"}"),J)}}function dayPeriodEnumToHours(te){switch(te){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function normalizeTwoDigitYear(te,J){const X=J>0,re=X?J:1-J;let ne;if(re<=50)ne=te||100;else{const oe=re+50,de=Math.trunc(oe/100)*100,ce=te>=oe%100;ne=te+de-(ce?100:0)}return X?ne:1-ne}function isLeapYearIndex(te){return te%400===0||te%4===0&&te%100!==0}class YearParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",130);Nt(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(X,re,ne){const oe=de=>({year:de,isTwoDigitYear:re==="yy"});switch(re){case"y":return mapValue(parseNDigits(4,X),oe);case"yo":return mapValue(ne.ordinalNumber(X,{unit:"year"}),oe);default:return mapValue(parseNDigits(re.length,X),oe)}}validate(X,re){return re.isTwoDigitYear||re.year>0}set(X,re,ne){const oe=X.getFullYear();if(ne.isTwoDigitYear){const ce=normalizeTwoDigitYear(ne.year,oe);return X.setFullYear(ce,0,1),X.setHours(0,0,0,0),X}const de=!("era"in re)||re.era===1?ne.year:1-ne.year;return X.setFullYear(de,0,1),X.setHours(0,0,0,0),X}}class LocalWeekYearParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",130);Nt(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(X,re,ne){const oe=de=>({year:de,isTwoDigitYear:re==="YY"});switch(re){case"Y":return mapValue(parseNDigits(4,X),oe);case"Yo":return mapValue(ne.ordinalNumber(X,{unit:"year"}),oe);default:return mapValue(parseNDigits(re.length,X),oe)}}validate(X,re){return re.isTwoDigitYear||re.year>0}set(X,re,ne,oe){const de=getWeekYear(X,oe);if(ne.isTwoDigitYear){const he=normalizeTwoDigitYear(ne.year,de);return X.setFullYear(he,0,oe.firstWeekContainsDate),X.setHours(0,0,0,0),startOfWeek(X,oe)}const ce=!("era"in re)||re.era===1?ne.year:1-ne.year;return X.setFullYear(ce,0,oe.firstWeekContainsDate),X.setHours(0,0,0,0),startOfWeek(X,oe)}}class ISOWeekYearParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",130);Nt(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(X,re){return parseNDigitsSigned(re==="R"?4:re.length,X)}set(X,re,ne){const oe=constructFrom(X,0);return oe.setFullYear(ne,0,4),oe.setHours(0,0,0,0),startOfISOWeek(oe)}}class ExtendedYearParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",130);Nt(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(X,re){return parseNDigitsSigned(re==="u"?4:re.length,X)}set(X,re,ne){return X.setFullYear(ne,0,1),X.setHours(0,0,0,0),X}}class QuarterParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",120);Nt(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(X,re,ne){switch(re){case"Q":case"QQ":return parseNDigits(re.length,X);case"Qo":return ne.ordinalNumber(X,{unit:"quarter"});case"QQQ":return ne.quarter(X,{width:"abbreviated",context:"formatting"})||ne.quarter(X,{width:"narrow",context:"formatting"});case"QQQQQ":return ne.quarter(X,{width:"narrow",context:"formatting"});case"QQQQ":default:return ne.quarter(X,{width:"wide",context:"formatting"})||ne.quarter(X,{width:"abbreviated",context:"formatting"})||ne.quarter(X,{width:"narrow",context:"formatting"})}}validate(X,re){return re>=1&&re<=4}set(X,re,ne){return X.setMonth((ne-1)*3,1),X.setHours(0,0,0,0),X}}class StandAloneQuarterParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",120);Nt(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(X,re,ne){switch(re){case"q":case"qq":return parseNDigits(re.length,X);case"qo":return ne.ordinalNumber(X,{unit:"quarter"});case"qqq":return ne.quarter(X,{width:"abbreviated",context:"standalone"})||ne.quarter(X,{width:"narrow",context:"standalone"});case"qqqqq":return ne.quarter(X,{width:"narrow",context:"standalone"});case"qqqq":default:return ne.quarter(X,{width:"wide",context:"standalone"})||ne.quarter(X,{width:"abbreviated",context:"standalone"})||ne.quarter(X,{width:"narrow",context:"standalone"})}}validate(X,re){return re>=1&&re<=4}set(X,re,ne){return X.setMonth((ne-1)*3,1),X.setHours(0,0,0,0),X}}class MonthParser extends Parser{constructor(){super(...arguments);Nt(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);Nt(this,"priority",110)}parse(X,re,ne){const oe=de=>de-1;switch(re){case"M":return mapValue(parseNumericPattern(numericPatterns.month,X),oe);case"MM":return mapValue(parseNDigits(2,X),oe);case"Mo":return mapValue(ne.ordinalNumber(X,{unit:"month"}),oe);case"MMM":return ne.month(X,{width:"abbreviated",context:"formatting"})||ne.month(X,{width:"narrow",context:"formatting"});case"MMMMM":return ne.month(X,{width:"narrow",context:"formatting"});case"MMMM":default:return ne.month(X,{width:"wide",context:"formatting"})||ne.month(X,{width:"abbreviated",context:"formatting"})||ne.month(X,{width:"narrow",context:"formatting"})}}validate(X,re){return re>=0&&re<=11}set(X,re,ne){return X.setMonth(ne,1),X.setHours(0,0,0,0),X}}class StandAloneMonthParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",110);Nt(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(X,re,ne){const oe=de=>de-1;switch(re){case"L":return mapValue(parseNumericPattern(numericPatterns.month,X),oe);case"LL":return mapValue(parseNDigits(2,X),oe);case"Lo":return mapValue(ne.ordinalNumber(X,{unit:"month"}),oe);case"LLL":return ne.month(X,{width:"abbreviated",context:"standalone"})||ne.month(X,{width:"narrow",context:"standalone"});case"LLLLL":return ne.month(X,{width:"narrow",context:"standalone"});case"LLLL":default:return ne.month(X,{width:"wide",context:"standalone"})||ne.month(X,{width:"abbreviated",context:"standalone"})||ne.month(X,{width:"narrow",context:"standalone"})}}validate(X,re){return re>=0&&re<=11}set(X,re,ne){return X.setMonth(ne,1),X.setHours(0,0,0,0),X}}function setWeek(te,J,X){const re=toDate(te),ne=getWeek(re,X)-J;return re.setDate(re.getDate()-ne*7),re}class LocalWeekParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",100);Nt(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(X,re,ne){switch(re){case"w":return parseNumericPattern(numericPatterns.week,X);case"wo":return ne.ordinalNumber(X,{unit:"week"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=1&&re<=53}set(X,re,ne,oe){return startOfWeek(setWeek(X,ne,oe),oe)}}function setISOWeek(te,J){const X=toDate(te),re=getISOWeek(X)-J;return X.setDate(X.getDate()-re*7),X}class ISOWeekParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",100);Nt(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(X,re,ne){switch(re){case"I":return parseNumericPattern(numericPatterns.week,X);case"Io":return ne.ordinalNumber(X,{unit:"week"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=1&&re<=53}set(X,re,ne){return startOfISOWeek(setISOWeek(X,ne))}}const DAYS_IN_MONTH=[31,28,31,30,31,30,31,31,30,31,30,31],DAYS_IN_MONTH_LEAP_YEAR=[31,29,31,30,31,30,31,31,30,31,30,31];class DateParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"subPriority",1);Nt(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(X,re,ne){switch(re){case"d":return parseNumericPattern(numericPatterns.date,X);case"do":return ne.ordinalNumber(X,{unit:"date"});default:return parseNDigits(re.length,X)}}validate(X,re){const ne=X.getFullYear(),oe=isLeapYearIndex(ne),de=X.getMonth();return oe?re>=1&&re<=DAYS_IN_MONTH_LEAP_YEAR[de]:re>=1&&re<=DAYS_IN_MONTH[de]}set(X,re,ne){return X.setDate(ne),X.setHours(0,0,0,0),X}}class DayOfYearParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"subpriority",1);Nt(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(X,re,ne){switch(re){case"D":case"DD":return parseNumericPattern(numericPatterns.dayOfYear,X);case"Do":return ne.ordinalNumber(X,{unit:"date"});default:return parseNDigits(re.length,X)}}validate(X,re){const ne=X.getFullYear();return isLeapYearIndex(ne)?re>=1&&re<=366:re>=1&&re<=365}set(X,re,ne){return X.setMonth(0,ne),X.setHours(0,0,0,0),X}}function setDay(te,J,X){var fe,ge,me,ve;const re=getDefaultOptions$1(),ne=(X==null?void 0:X.weekStartsOn)??((ge=(fe=X==null?void 0:X.locale)==null?void 0:fe.options)==null?void 0:ge.weekStartsOn)??re.weekStartsOn??((ve=(me=re.locale)==null?void 0:me.options)==null?void 0:ve.weekStartsOn)??0,oe=toDate(te),de=oe.getDay(),he=(J%7+7)%7,ue=7-ne,pe=J<0||J>6?J-(de+ue)%7:(he+ue)%7-(de+ue)%7;return addDays(oe,pe)}class DayParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(X,re,ne){switch(re){case"E":case"EE":case"EEE":return ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"});case"EEEEE":return ne.day(X,{width:"narrow",context:"formatting"});case"EEEEEE":return ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"});case"EEEE":default:return ne.day(X,{width:"wide",context:"formatting"})||ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"})}}validate(X,re){return re>=0&&re<=6}set(X,re,ne,oe){return X=setDay(X,ne,oe),X.setHours(0,0,0,0),X}}class LocalDayParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(X,re,ne,oe){const de=ce=>{const he=Math.floor((ce-1)/7)*7;return(ce+oe.weekStartsOn+6)%7+he};switch(re){case"e":case"ee":return mapValue(parseNDigits(re.length,X),de);case"eo":return mapValue(ne.ordinalNumber(X,{unit:"day"}),de);case"eee":return ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"});case"eeeee":return ne.day(X,{width:"narrow",context:"formatting"});case"eeeeee":return ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"});case"eeee":default:return ne.day(X,{width:"wide",context:"formatting"})||ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"})}}validate(X,re){return re>=0&&re<=6}set(X,re,ne,oe){return X=setDay(X,ne,oe),X.setHours(0,0,0,0),X}}class StandAloneLocalDayParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(X,re,ne,oe){const de=ce=>{const he=Math.floor((ce-1)/7)*7;return(ce+oe.weekStartsOn+6)%7+he};switch(re){case"c":case"cc":return mapValue(parseNDigits(re.length,X),de);case"co":return mapValue(ne.ordinalNumber(X,{unit:"day"}),de);case"ccc":return ne.day(X,{width:"abbreviated",context:"standalone"})||ne.day(X,{width:"short",context:"standalone"})||ne.day(X,{width:"narrow",context:"standalone"});case"ccccc":return ne.day(X,{width:"narrow",context:"standalone"});case"cccccc":return ne.day(X,{width:"short",context:"standalone"})||ne.day(X,{width:"narrow",context:"standalone"});case"cccc":default:return ne.day(X,{width:"wide",context:"standalone"})||ne.day(X,{width:"abbreviated",context:"standalone"})||ne.day(X,{width:"short",context:"standalone"})||ne.day(X,{width:"narrow",context:"standalone"})}}validate(X,re){return re>=0&&re<=6}set(X,re,ne,oe){return X=setDay(X,ne,oe),X.setHours(0,0,0,0),X}}function setISODay(te,J){const X=toDate(te),re=getISODay(X),ne=J-re;return addDays(X,ne)}class ISODayParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(X,re,ne){const oe=de=>de===0?7:de;switch(re){case"i":case"ii":return parseNDigits(re.length,X);case"io":return ne.ordinalNumber(X,{unit:"day"});case"iii":return mapValue(ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"}),oe);case"iiiii":return mapValue(ne.day(X,{width:"narrow",context:"formatting"}),oe);case"iiiiii":return mapValue(ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"}),oe);case"iiii":default:return mapValue(ne.day(X,{width:"wide",context:"formatting"})||ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"}),oe)}}validate(X,re){return re>=1&&re<=7}set(X,re,ne){return X=setISODay(X,ne),X.setHours(0,0,0,0),X}}class AMPMParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",80);Nt(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(X,re,ne){switch(re){case"a":case"aa":case"aaa":return ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"aaaaa":return ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"aaaa":default:return ne.dayPeriod(X,{width:"wide",context:"formatting"})||ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"})}}set(X,re,ne){return X.setHours(dayPeriodEnumToHours(ne),0,0,0),X}}class AMPMMidnightParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",80);Nt(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(X,re,ne){switch(re){case"b":case"bb":case"bbb":return ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"bbbbb":return ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"bbbb":default:return ne.dayPeriod(X,{width:"wide",context:"formatting"})||ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"})}}set(X,re,ne){return X.setHours(dayPeriodEnumToHours(ne),0,0,0),X}}class DayPeriodParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",80);Nt(this,"incompatibleTokens",["a","b","t","T"])}parse(X,re,ne){switch(re){case"B":case"BB":case"BBB":return ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"BBBBB":return ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"BBBB":default:return ne.dayPeriod(X,{width:"wide",context:"formatting"})||ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"})}}set(X,re,ne){return X.setHours(dayPeriodEnumToHours(ne),0,0,0),X}}class Hour1to12Parser extends Parser{constructor(){super(...arguments);Nt(this,"priority",70);Nt(this,"incompatibleTokens",["H","K","k","t","T"])}parse(X,re,ne){switch(re){case"h":return parseNumericPattern(numericPatterns.hour12h,X);case"ho":return ne.ordinalNumber(X,{unit:"hour"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=1&&re<=12}set(X,re,ne){const oe=X.getHours()>=12;return oe&&ne<12?X.setHours(ne+12,0,0,0):!oe&&ne===12?X.setHours(0,0,0,0):X.setHours(ne,0,0,0),X}}class Hour0to23Parser extends Parser{constructor(){super(...arguments);Nt(this,"priority",70);Nt(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(X,re,ne){switch(re){case"H":return parseNumericPattern(numericPatterns.hour23h,X);case"Ho":return ne.ordinalNumber(X,{unit:"hour"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=0&&re<=23}set(X,re,ne){return X.setHours(ne,0,0,0),X}}class Hour0To11Parser extends Parser{constructor(){super(...arguments);Nt(this,"priority",70);Nt(this,"incompatibleTokens",["h","H","k","t","T"])}parse(X,re,ne){switch(re){case"K":return parseNumericPattern(numericPatterns.hour11h,X);case"Ko":return ne.ordinalNumber(X,{unit:"hour"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=0&&re<=11}set(X,re,ne){return X.getHours()>=12&&ne<12?X.setHours(ne+12,0,0,0):X.setHours(ne,0,0,0),X}}class Hour1To24Parser extends Parser{constructor(){super(...arguments);Nt(this,"priority",70);Nt(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(X,re,ne){switch(re){case"k":return parseNumericPattern(numericPatterns.hour24h,X);case"ko":return ne.ordinalNumber(X,{unit:"hour"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=1&&re<=24}set(X,re,ne){const oe=ne<=24?ne%24:ne;return X.setHours(oe,0,0,0),X}}class MinuteParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",60);Nt(this,"incompatibleTokens",["t","T"])}parse(X,re,ne){switch(re){case"m":return parseNumericPattern(numericPatterns.minute,X);case"mo":return ne.ordinalNumber(X,{unit:"minute"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=0&&re<=59}set(X,re,ne){return X.setMinutes(ne,0,0),X}}class SecondParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",50);Nt(this,"incompatibleTokens",["t","T"])}parse(X,re,ne){switch(re){case"s":return parseNumericPattern(numericPatterns.second,X);case"so":return ne.ordinalNumber(X,{unit:"second"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=0&&re<=59}set(X,re,ne){return X.setSeconds(ne,0),X}}class FractionOfSecondParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",30);Nt(this,"incompatibleTokens",["t","T"])}parse(X,re){const ne=oe=>Math.trunc(oe*Math.pow(10,-re.length+3));return mapValue(parseNDigits(re.length,X),ne)}set(X,re,ne){return X.setMilliseconds(ne),X}}class ISOTimezoneWithZParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",10);Nt(this,"incompatibleTokens",["t","T","x"])}parse(X,re){switch(re){case"X":return parseTimezonePattern(timezonePatterns.basicOptionalMinutes,X);case"XX":return parseTimezonePattern(timezonePatterns.basic,X);case"XXXX":return parseTimezonePattern(timezonePatterns.basicOptionalSeconds,X);case"XXXXX":return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds,X);case"XXX":default:return parseTimezonePattern(timezonePatterns.extended,X)}}set(X,re,ne){return re.timestampIsSet?X:constructFrom(X,X.getTime()-getTimezoneOffsetInMilliseconds(X)-ne)}}class ISOTimezoneParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",10);Nt(this,"incompatibleTokens",["t","T","X"])}parse(X,re){switch(re){case"x":return parseTimezonePattern(timezonePatterns.basicOptionalMinutes,X);case"xx":return parseTimezonePattern(timezonePatterns.basic,X);case"xxxx":return parseTimezonePattern(timezonePatterns.basicOptionalSeconds,X);case"xxxxx":return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds,X);case"xxx":default:return parseTimezonePattern(timezonePatterns.extended,X)}}set(X,re,ne){return re.timestampIsSet?X:constructFrom(X,X.getTime()-getTimezoneOffsetInMilliseconds(X)-ne)}}class TimestampSecondsParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",40);Nt(this,"incompatibleTokens","*")}parse(X){return parseAnyDigitsSigned(X)}set(X,re,ne){return[constructFrom(X,ne*1e3),{timestampIsSet:!0}]}}class TimestampMillisecondsParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",20);Nt(this,"incompatibleTokens","*")}parse(X){return parseAnyDigitsSigned(X)}set(X,re,ne){return[constructFrom(X,ne),{timestampIsSet:!0}]}}const parsers={G:new EraParser,y:new YearParser,Y:new LocalWeekYearParser,R:new ISOWeekYearParser,u:new ExtendedYearParser,Q:new QuarterParser,q:new StandAloneQuarterParser,M:new MonthParser,L:new StandAloneMonthParser,w:new LocalWeekParser,I:new ISOWeekParser,d:new DateParser,D:new DayOfYearParser,E:new DayParser,e:new LocalDayParser,c:new StandAloneLocalDayParser,i:new ISODayParser,a:new AMPMParser,b:new AMPMMidnightParser,B:new DayPeriodParser,h:new Hour1to12Parser,H:new Hour0to23Parser,K:new Hour0To11Parser,k:new Hour1To24Parser,m:new MinuteParser,s:new SecondParser,S:new FractionOfSecondParser,X:new ISOTimezoneWithZParser,x:new ISOTimezoneParser,t:new TimestampSecondsParser,T:new TimestampMillisecondsParser},formattingTokensRegExp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,longFormattingTokensRegExp=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,escapedStringRegExp=/^'([^]*?)'?$/,doubleQuoteRegExp=/''/g,notWhitespaceRegExp=/\S/,unescapedLatinCharacterRegExp=/[a-zA-Z]/;function parse(te,J,X,re){var be,_e,we,Se;const ne=getDefaultOptions(),oe=ne.locale??enUS,de=ne.firstWeekContainsDate??((_e=(be=ne.locale)==null?void 0:be.options)==null?void 0:_e.firstWeekContainsDate)??1,ce=ne.weekStartsOn??((Se=(we=ne.locale)==null?void 0:we.options)==null?void 0:Se.weekStartsOn)??0,he={firstWeekContainsDate:de,weekStartsOn:ce,locale:oe},ue=[new DateToSystemTimezoneSetter],pe=J.match(longFormattingTokensRegExp).map(Ce=>{const ye=Ce[0];if(ye in longFormatters){const Ae=longFormatters[ye];return Ae(Ce,oe.formatLong)}return Ce}).join("").match(formattingTokensRegExp),fe=[];for(let Ce of pe){isProtectedWeekYearToken(Ce)&&warnOrThrowProtectedError(Ce,J,te),isProtectedDayOfYearToken(Ce)&&warnOrThrowProtectedError(Ce,J,te);const ye=Ce[0],Ae=parsers[ye];if(Ae){const{incompatibleTokens:Le}=Ae;if(Array.isArray(Le)){const Me=fe.find(He=>Le.includes(He.token)||He.token===ye);if(Me)throw new RangeError(`The format string mustn't contain \`${Me.fullToken}\` and \`${Ce}\` at the same time`)}else if(Ae.incompatibleTokens==="*"&&fe.length>0)throw new RangeError(`The format string mustn't contain \`${Ce}\` and any other token at the same time`);fe.push({token:ye,fullToken:Ce});const De=Ae.run(te,Ce,oe.match,he);if(!De)return constructFrom(X,NaN);ue.push(De.setter),te=De.rest}else{if(ye.match(unescapedLatinCharacterRegExp))throw new RangeError("Format string contains an unescaped latin alphabet character `"+ye+"`");if(Ce==="''"?Ce="'":ye==="'"&&(Ce=cleanEscapedString(Ce)),te.indexOf(Ce)===0)te=te.slice(Ce.length);else return constructFrom(X,NaN)}}if(te.length>0&¬WhitespaceRegExp.test(te))return constructFrom(X,NaN);const ge=ue.map(Ce=>Ce.priority).sort((Ce,ye)=>ye-Ce).filter((Ce,ye,Ae)=>Ae.indexOf(Ce)===ye).map(Ce=>ue.filter(ye=>ye.priority===Ce).sort((ye,Ae)=>Ae.subPriority-ye.subPriority)).map(Ce=>Ce[0]);let me=toDate(X);if(isNaN(me.getTime()))return constructFrom(X,NaN);const ve={};for(const Ce of ge){if(!Ce.validate(me,he))return constructFrom(X,NaN);const ye=Ce.set(me,ve,he);Array.isArray(ye)?(me=ye[0],Object.assign(ve,ye[1])):me=ye}return constructFrom(X,me)}function cleanEscapedString(te){return te.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp,"'")}const notFound="data:image/svg+xml,%3csvg%20width='215'%20height='150'%20viewBox='0%200%20215%20150'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20opacity='0.9'%20d='M135.132%2057.43C96.9221%2047.658%2083.3815%20-29.7048%2026.9734%2012.5083C-13.0511%2042.4595%2011.4691%20115.499%2061.6878%20107.019C92.0822%20101.867%2087.3917%20101.341%20113.129%20115.244C139.231%20129.308%20167.972%20136.397%20195.855%20111.436C210.28%2098.5179%20215.939%2067.0352%20201.939%2050.7417C184.388%2030.3592%20158.485%2063.4098%20135.132%2057.43Z'%20fill='%23EFF7FF'/%3e%3cellipse%20cx='120.5'%20cy='143.5'%20rx='52.5'%20ry='3.5'%20fill='%23F5F5F5'/%3e%3cpath%20d='M121.387%2080.2184C121.995%2079.5948%20122.563%2078.953%20123.09%2078.2959L134.396%2089.3383C135.09%2090.0177%20134.851%2091.389%20133.861%2092.4024C132.872%2093.4159%20131.505%2093.6888%20130.811%2093.0094L119.505%2081.967C120.148%2081.424%20120.777%2080.8407%20121.385%2080.2171L121.387%2080.2184Z'%20fill='%231D1D1D'/%3e%3cpath%20opacity='0.6'%20d='M121.127%2079.9896C132.157%2068.6986%20131.888%2050.5485%20120.527%2039.4502C109.166%2028.3519%2091.0149%2028.5081%2079.9849%2039.799C68.955%2051.09%2069.2233%2069.2401%2080.5843%2080.3385C91.9453%2091.4368%20110.097%2091.2806%20121.127%2079.9896Z'%20fill='%238FC2F5'/%3e%3cpath%20d='M78.0382%2083.0622C90.8729%2095.6382%20111.378%2095.4578%20123.835%2082.6609C136.293%2069.8625%20135.986%2049.2932%20123.15%2036.7173C110.316%2024.1413%2089.8107%2024.3217%2077.3538%2037.1186C64.8956%2049.9169%2065.2022%2070.4862%2078.0382%2083.0622ZM80.642%2080.387C69.289%2069.264%2069.0172%2051.0692%2080.037%2039.749C91.0569%2028.4288%20109.194%2028.2694%20120.547%2039.3938C131.9%2050.5182%20132.171%2068.713%20121.152%2080.0332C110.132%2091.3534%2091.9949%2091.5128%2080.642%2080.3884V80.387Z'%20fill='%237BACFC'/%3e%3cpath%20d='M169.953%20128.522L171.714%20126.696C173.474%20124.871%20173.421%20121.964%20171.595%20120.205L135.013%2084.9265C133.187%2083.1661%20130.281%2083.2205%20128.522%2085.0451L126.761%2086.8711C125.001%2088.6957%20125.055%2091.6028%20126.88%2093.3619L163.462%20128.64C165.287%20130.401%20168.194%20130.346%20169.953%20128.522Z'%20fill='%23656565'/%3e%3cpath%20opacity='0.35'%20d='M88.8399%2071.2315C96.506%2079.2245%20101.258%2078.1642%20100.757%2082.4547C100.256%2086.7452%2091.398%2085.7448%2082.7698%2076.0396C74.1415%2066.3344%2075.0893%2054.9166%2079.8491%2055.2485C84.6089%2055.5803%2080.129%2062.1492%2088.8399%2071.2315Z'%20fill='white'/%3e%3c/svg%3e";/**
|
|
321
329
|
* @license
|
|
322
330
|
* Copyright 2018 Google LLC
|
|
323
331
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
324
|
-
*/const to=te=>te??D$1
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
*/class ScrollerShim{constructor(J){this._element=null;const X=J??window;this._node=X,J&&(this._element=J)}get element(){return this._element||document.scrollingElement||document.documentElement}get scrollTop(){return this.element.scrollTop||window.scrollY}get scrollLeft(){return this.element.scrollLeft||window.scrollX}get scrollHeight(){return this.element.scrollHeight}get scrollWidth(){return this.element.scrollWidth}get viewportHeight(){return this._element?this._element.getBoundingClientRect().height:window.innerHeight}get viewportWidth(){return this._element?this._element.getBoundingClientRect().width:window.innerWidth}get maxScrollTop(){return this.scrollHeight-this.viewportHeight}get maxScrollLeft(){return this.scrollWidth-this.viewportWidth}}class ScrollerController extends ScrollerShim{constructor(J,X){super(X),this._clients=new Set,this._retarget=null,this._end=null,this.__destination=null,this.correctingScrollError=!1,this._checkForArrival=this._checkForArrival.bind(this),this._updateManagedScrollTo=this._updateManagedScrollTo.bind(this),this.scrollTo=this.scrollTo.bind(this),this.scrollBy=this.scrollBy.bind(this);const re=this._node;this._originalScrollTo=re.scrollTo,this._originalScrollBy=re.scrollBy,this._originalScroll=re.scroll,this._attach(J)}get _destination(){return this.__destination}get scrolling(){return this._destination!==null}scrollTo(J,X){const re=typeof J=="number"&&typeof X=="number"?{left:J,top:X}:J;this._scrollTo(re)}scrollBy(J,X){const re=typeof J=="number"&&typeof X=="number"?{left:J,top:X}:J;re.top!==void 0&&(re.top+=this.scrollTop),re.left!==void 0&&(re.left+=this.scrollLeft),this._scrollTo(re)}_nativeScrollTo(J){this._originalScrollTo.bind(this._element||window)(J)}_scrollTo(J,X=null,re=null){this._end!==null&&this._end(),J.behavior==="smooth"?(this._setDestination(J),this._retarget=X,this._end=re):this._resetScrollState(),this._nativeScrollTo(J)}_setDestination(J){let{top:X,left:re}=J;return X=X===void 0?void 0:Math.max(0,Math.min(X,this.maxScrollTop)),re=re===void 0?void 0:Math.max(0,Math.min(re,this.maxScrollLeft)),this._destination!==null&&re===this._destination.left&&X===this._destination.top?!1:(this.__destination={top:X,left:re,behavior:"smooth"},!0)}_resetScrollState(){this.__destination=null,this._retarget=null,this._end=null}_updateManagedScrollTo(J){this._destination&&this._setDestination(J)&&this._nativeScrollTo(this._destination)}managedScrollTo(J,X,re){return this._scrollTo(J,X,re),this._updateManagedScrollTo}correctScrollError(J){this.correctingScrollError=!0,requestAnimationFrame(()=>requestAnimationFrame(()=>this.correctingScrollError=!1)),this._nativeScrollTo(J),this._retarget&&this._setDestination(this._retarget()),this._destination&&this._nativeScrollTo(this._destination)}_checkForArrival(){if(this._destination!==null){const{scrollTop:J,scrollLeft:X}=this;let{top:re,left:ne}=this._destination;re=Math.min(re||0,this.maxScrollTop),ne=Math.min(ne||0,this.maxScrollLeft);const oe=Math.abs(re-J),de=Math.abs(ne-X);oe<1&&de<1&&(this._end&&this._end(),this._resetScrollState())}}detach(J){return this._clients.delete(J),this._clients.size===0&&(this._node.scrollTo=this._originalScrollTo,this._node.scrollBy=this._originalScrollBy,this._node.scroll=this._originalScroll,this._node.removeEventListener("scroll",this._checkForArrival)),null}_attach(J){this._clients.add(J),this._clients.size===1&&(this._node.scrollTo=this.scrollTo,this._node.scrollBy=this.scrollBy,this._node.scroll=this.scrollTo,this._node.addEventListener("scroll",this._checkForArrival))}}/**
|
|
337
|
-
* @license
|
|
338
|
-
* Copyright 2021 Google LLC
|
|
339
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
340
|
-
*/let _ResizeObserver=typeof window<"u"?window.ResizeObserver:void 0;const virtualizerRef=Symbol("virtualizerRef"),SIZER_ATTRIBUTE="virtualizer-sizer";let DefaultLayoutConstructor;class Virtualizer{constructor(J){if(this._benchmarkStart=null,this._layout=null,this._clippingAncestors=[],this._scrollSize=null,this._scrollError=null,this._childrenPos=null,this._childMeasurements=null,this._toBeMeasured=new Map,this._rangeChanged=!0,this._itemsChanged=!0,this._visibilityChanged=!0,this._scrollerController=null,this._isScroller=!1,this._sizer=null,this._hostElementRO=null,this._childrenRO=null,this._mutationObserver=null,this._scrollEventListeners=[],this._scrollEventListenerOptions={passive:!0},this._loadListener=this._childLoaded.bind(this),this._scrollIntoViewTarget=null,this._updateScrollIntoViewCoordinates=null,this._items=[],this._first=-1,this._last=-1,this._firstVisible=-1,this._lastVisible=-1,this._scheduled=new WeakSet,this._measureCallback=null,this._measureChildOverride=null,this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null,this._layoutInitialized=null,this._connected=!1,!J)throw new Error("Virtualizer constructor requires a configuration object");if(J.hostElement)this._init(J);else throw new Error('Virtualizer configuration requires the "hostElement" property')}set items(J){Array.isArray(J)&&J!==this._items&&(this._itemsChanged=!0,this._items=J,this._schedule(this._updateLayout))}_init(J){this._isScroller=!!J.scroller,this._initHostElement(J);const X=J.layout||{};this._layoutInitialized=this._initLayout(X)}_initObservers(){this._mutationObserver=new MutationObserver(this._finishDOMUpdate.bind(this)),this._hostElementRO=new _ResizeObserver(()=>this._hostElementSizeChanged()),this._childrenRO=new _ResizeObserver(this._childrenSizeChanged.bind(this))}_initHostElement(J){const X=this._hostElement=J.hostElement;this._applyVirtualizerStyles(),X[virtualizerRef]=this}connected(){this._initObservers();const J=this._isScroller;this._clippingAncestors=getClippingAncestors(this._hostElement,J),this._scrollerController=new ScrollerController(this,this._clippingAncestors[0]),this._schedule(this._updateLayout),this._observeAndListen(),this._connected=!0}_observeAndListen(){this._mutationObserver.observe(this._hostElement,{childList:!0}),this._hostElementRO.observe(this._hostElement),this._scrollEventListeners.push(window),window.addEventListener("scroll",this,this._scrollEventListenerOptions),this._clippingAncestors.forEach(J=>{J.addEventListener("scroll",this,this._scrollEventListenerOptions),this._scrollEventListeners.push(J),this._hostElementRO.observe(J)}),this._hostElementRO.observe(this._scrollerController.element),this._children.forEach(J=>this._childrenRO.observe(J)),this._scrollEventListeners.forEach(J=>J.addEventListener("scroll",this,this._scrollEventListenerOptions))}disconnected(){var J,X,re,ne;this._scrollEventListeners.forEach(oe=>oe.removeEventListener("scroll",this,this._scrollEventListenerOptions)),this._scrollEventListeners=[],this._clippingAncestors=[],(J=this._scrollerController)==null||J.detach(this),this._scrollerController=null,(X=this._mutationObserver)==null||X.disconnect(),this._mutationObserver=null,(re=this._hostElementRO)==null||re.disconnect(),this._hostElementRO=null,(ne=this._childrenRO)==null||ne.disconnect(),this._childrenRO=null,this._rejectLayoutCompletePromise("disconnected"),this._connected=!1}_applyVirtualizerStyles(){const X=this._hostElement.style;X.display=X.display||"block",X.position=X.position||"relative",X.contain=X.contain||"size layout",this._isScroller&&(X.overflow=X.overflow||"auto",X.minHeight=X.minHeight||"150px")}_getSizer(){const J=this._hostElement;if(!this._sizer){let X=J.querySelector(`[${SIZER_ATTRIBUTE}]`);X||(X=document.createElement("div"),X.setAttribute(SIZER_ATTRIBUTE,""),J.appendChild(X)),Object.assign(X.style,{position:"absolute",margin:"-2px 0 0 0",padding:0,visibility:"hidden",fontSize:"2px"}),X.textContent=" ",X.setAttribute(SIZER_ATTRIBUTE,""),this._sizer=X}return this._sizer}async updateLayoutConfig(J){await this._layoutInitialized;const X=J.type||DefaultLayoutConstructor;if(typeof X=="function"&&this._layout instanceof X){const re={...J};return delete re.type,this._layout.config=re,!0}return!1}async _initLayout(J){let X,re;if(typeof J.type=="function"){re=J.type;const ne={...J};delete ne.type,X=ne}else X=J;re===void 0&&(DefaultLayoutConstructor=re=(await Promise.resolve().then(()=>flow)).FlowLayout),this._layout=new re(ne=>this._handleLayoutMessage(ne),X),this._layout.measureChildren&&typeof this._layout.updateItemSizes=="function"&&(typeof this._layout.measureChildren=="function"&&(this._measureChildOverride=this._layout.measureChildren),this._measureCallback=this._layout.updateItemSizes.bind(this._layout)),this._layout.listenForChildLoadEvents&&this._hostElement.addEventListener("load",this._loadListener,!0),this._schedule(this._updateLayout)}startBenchmarking(){this._benchmarkStart===null&&(this._benchmarkStart=window.performance.now())}stopBenchmarking(){if(this._benchmarkStart!==null){const J=window.performance.now(),X=J-this._benchmarkStart,ne=performance.getEntriesByName("uv-virtualizing","measure").filter(oe=>oe.startTime>=this._benchmarkStart&&oe.startTime<J).reduce((oe,de)=>oe+de.duration,0);return this._benchmarkStart=null,{timeElapsed:X,virtualizationTime:ne}}return null}_measureChildren(){const J={},X=this._children,re=this._measureChildOverride||this._measureChild;for(let ne=0;ne<X.length;ne++){const oe=X[ne],de=this._first+ne;(this._itemsChanged||this._toBeMeasured.has(oe))&&(J[de]=re.call(this,oe,this._items[de]))}this._childMeasurements=J,this._schedule(this._updateLayout),this._toBeMeasured.clear()}_measureChild(J){const{width:X,height:re}=J.getBoundingClientRect();return Object.assign({width:X,height:re},getMargins(J))}async _schedule(J){this._scheduled.has(J)||(this._scheduled.add(J),await Promise.resolve(),this._scheduled.delete(J),J.call(this))}async _updateDOM(J){this._scrollSize=J.scrollSize,this._adjustRange(J.range),this._childrenPos=J.childPositions,this._scrollError=J.scrollError||null;const{_rangeChanged:X,_itemsChanged:re}=this;this._visibilityChanged&&(this._notifyVisibility(),this._visibilityChanged=!1),(X||re)&&(this._notifyRange(),this._rangeChanged=!1),this._finishDOMUpdate()}_finishDOMUpdate(){this._connected&&(this._children.forEach(J=>this._childrenRO.observe(J)),this._checkScrollIntoViewTarget(this._childrenPos),this._positionChildren(this._childrenPos),this._sizeHostElement(this._scrollSize),this._correctScrollError(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_updateLayout(){this._layout&&this._connected&&(this._layout.items=this._items,this._updateView(),this._childMeasurements!==null&&(this._measureCallback&&this._measureCallback(this._childMeasurements),this._childMeasurements=null),this._layout.reflowIfNeeded(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_handleScrollEvent(){var J;if(this._benchmarkStart&&"mark"in window.performance){try{window.performance.measure("uv-virtualizing","uv-start","uv-end")}catch(X){console.warn("Error measuring performance data: ",X)}window.performance.mark("uv-start")}this._scrollerController.correctingScrollError===!1&&((J=this._layout)==null||J.unpin()),this._schedule(this._updateLayout)}handleEvent(J){switch(J.type){case"scroll":(J.currentTarget===window||this._clippingAncestors.includes(J.currentTarget))&&this._handleScrollEvent();break;default:console.warn("event not handled",J)}}_handleLayoutMessage(J){J.type==="stateChanged"?this._updateDOM(J):J.type==="visibilityChanged"?(this._firstVisible=J.firstVisible,this._lastVisible=J.lastVisible,this._notifyVisibility()):J.type==="unpinned"&&this._hostElement.dispatchEvent(new UnpinnedEvent)}get _children(){const J=[];let X=this._hostElement.firstElementChild;for(;X;)X.hasAttribute(SIZER_ATTRIBUTE)||J.push(X),X=X.nextElementSibling;return J}_updateView(){var ne;const J=this._hostElement,X=(ne=this._scrollerController)==null?void 0:ne.element,re=this._layout;if(J&&X&&re){let oe,de,ce,he;const ue=J.getBoundingClientRect();oe=0,de=0,ce=window.innerHeight,he=window.innerWidth;const pe=this._clippingAncestors.map(Se=>Se.getBoundingClientRect());pe.unshift(ue);for(const Se of pe)oe=Math.max(oe,Se.top),de=Math.max(de,Se.left),ce=Math.min(ce,Se.bottom),he=Math.min(he,Se.right);const fe=X.getBoundingClientRect(),ge={left:ue.left-fe.left,top:ue.top-fe.top},me={width:X.scrollWidth,height:X.scrollHeight},ve=oe-ue.top+J.scrollTop,be=de-ue.left+J.scrollLeft,_e=Math.max(0,ce-oe),we=Math.max(0,he-de);re.viewportSize={width:we,height:_e},re.viewportScroll={top:ve,left:be},re.totalScrollSize=me,re.offsetWithinScroller=ge}}_sizeHostElement(J){const re=J&&J.width!==null?Math.min(82e5,J.width):0,ne=J&&J.height!==null?Math.min(82e5,J.height):0;if(this._isScroller)this._getSizer().style.transform=`translate(${re}px, ${ne}px)`;else{const oe=this._hostElement.style;oe.minWidth=re?`${re}px`:"100%",oe.minHeight=ne?`${ne}px`:"100%"}}_positionChildren(J){J&&J.forEach(({top:X,left:re,width:ne,height:oe,xOffset:de,yOffset:ce},he)=>{const ue=this._children[he-this._first];ue&&(ue.style.position="absolute",ue.style.boxSizing="border-box",ue.style.transform=`translate(${re}px, ${X}px)`,ne!==void 0&&(ue.style.width=ne+"px"),oe!==void 0&&(ue.style.height=oe+"px"),ue.style.left=de===void 0?null:de+"px",ue.style.top=ce===void 0?null:ce+"px")})}async _adjustRange(J){const{_first:X,_last:re,_firstVisible:ne,_lastVisible:oe}=this;this._first=J.first,this._last=J.last,this._firstVisible=J.firstVisible,this._lastVisible=J.lastVisible,this._rangeChanged=this._rangeChanged||this._first!==X||this._last!==re,this._visibilityChanged=this._visibilityChanged||this._firstVisible!==ne||this._lastVisible!==oe}_correctScrollError(){if(this._scrollError){const{scrollTop:J,scrollLeft:X}=this._scrollerController,{top:re,left:ne}=this._scrollError;this._scrollError=null,this._scrollerController.correctScrollError({top:J-re,left:X-ne})}}element(J){var X;return J===1/0&&(J=this._items.length-1),((X=this._items)==null?void 0:X[J])===void 0?void 0:{scrollIntoView:(re={})=>this._scrollElementIntoView({...re,index:J})}}_scrollElementIntoView(J){if(J.index>=this._first&&J.index<=this._last)this._children[J.index-this._first].scrollIntoView(J);else if(J.index=Math.min(J.index,this._items.length-1),J.behavior==="smooth"){const X=this._layout.getScrollIntoViewCoordinates(J),{behavior:re}=J;this._updateScrollIntoViewCoordinates=this._scrollerController.managedScrollTo(Object.assign(X,{behavior:re}),()=>this._layout.getScrollIntoViewCoordinates(J),()=>this._scrollIntoViewTarget=null),this._scrollIntoViewTarget=J}else this._layout.pin=J}_checkScrollIntoViewTarget(J){const{index:X}=this._scrollIntoViewTarget||{};X&&(J!=null&&J.has(X))&&this._updateScrollIntoViewCoordinates(this._layout.getScrollIntoViewCoordinates(this._scrollIntoViewTarget))}_notifyRange(){this._hostElement.dispatchEvent(new RangeChangedEvent({first:this._first,last:this._last}))}_notifyVisibility(){this._hostElement.dispatchEvent(new VisibilityChangedEvent({first:this._firstVisible,last:this._lastVisible}))}get layoutComplete(){return this._layoutCompletePromise||(this._layoutCompletePromise=new Promise((J,X)=>{this._layoutCompleteResolver=J,this._layoutCompleteRejecter=X})),this._layoutCompletePromise}_rejectLayoutCompletePromise(J){this._layoutCompleteRejecter!==null&&this._layoutCompleteRejecter(J),this._resetLayoutCompleteState()}_scheduleLayoutComplete(){this._layoutCompletePromise&&this._pendingLayoutComplete===null&&(this._pendingLayoutComplete=requestAnimationFrame(()=>requestAnimationFrame(()=>this._resolveLayoutCompletePromise())))}_resolveLayoutCompletePromise(){this._layoutCompleteResolver!==null&&this._layoutCompleteResolver(),this._resetLayoutCompleteState()}_resetLayoutCompleteState(){this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null}_hostElementSizeChanged(){this._schedule(this._updateLayout)}_childLoaded(){}_childrenSizeChanged(J){var X;if((X=this._layout)!=null&&X.measureChildren){for(const re of J)this._toBeMeasured.set(re.target,re.contentRect);this._measureChildren()}this._scheduleLayoutComplete(),this._itemsChanged=!1,this._rangeChanged=!1}}function getMargins(te){const J=window.getComputedStyle(te);return{marginTop:getMarginValue(J.marginTop),marginRight:getMarginValue(J.marginRight),marginBottom:getMarginValue(J.marginBottom),marginLeft:getMarginValue(J.marginLeft)}}function getMarginValue(te){const J=te?parseFloat(te):NaN;return Number.isNaN(J)?0:J}function getParentElement(te){if(te.assignedSlot!==null)return te.assignedSlot;if(te.parentElement!==null)return te.parentElement;const J=te.parentNode;return J&&J.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&J.host||null}function getElementAncestors(te,J=!1){const X=[];let re=J?te:getParentElement(te);for(;re!==null;)X.push(re),re=getParentElement(re);return X}function getClippingAncestors(te,J=!1){let X=!1;return getElementAncestors(te,J).filter(re=>{if(X)return!1;const ne=getComputedStyle(re);return X=ne.position==="fixed",ne.overflow!=="visible"})}/**
|
|
341
|
-
* @license
|
|
342
|
-
* Copyright 2021 Google LLC
|
|
343
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
344
|
-
*/const defaultKeyFunction=te=>te,defaultRenderItem=(te,J)=>ke$1`${J}: ${JSON.stringify(te,null,2)}`;class VirtualizeDirective extends $t{constructor(J){if(super(J),this._virtualizer=null,this._first=0,this._last=-1,this._renderItem=(X,re)=>defaultRenderItem(X,re+this._first),this._keyFunction=(X,re)=>defaultKeyFunction(X,re+this._first),this._items=[],J.type!==t$g.CHILD)throw new Error("The virtualize directive can only be used in child expressions")}render(J){J&&this._setFunctions(J);const X=[];if(this._first>=0&&this._last>=this._first)for(let re=this._first;re<=this._last;re++)X.push(this._items[re]);return Qt(X,this._keyFunction,this._renderItem)}update(J,[X]){this._setFunctions(X);const re=this._items!==X.items;return this._items=X.items||[],this._virtualizer?this._updateVirtualizerConfig(J,X):this._initialize(J,X),re?R:this.render()}async _updateVirtualizerConfig(J,X){if(!await this._virtualizer.updateLayoutConfig(X.layout||{})){const ne=J.parentNode;this._makeVirtualizer(ne,X)}this._virtualizer.items=this._items}_setFunctions(J){const{renderItem:X,keyFunction:re}=J;X&&(this._renderItem=(ne,oe)=>X(ne,oe+this._first)),re&&(this._keyFunction=(ne,oe)=>re(ne,oe+this._first))}_makeVirtualizer(J,X){this._virtualizer&&this._virtualizer.disconnected();const{layout:re,scroller:ne,items:oe}=X;this._virtualizer=new Virtualizer({hostElement:J,layout:re,scroller:ne}),this._virtualizer.items=oe,this._virtualizer.connected()}_initialize(J,X){const re=J.parentNode;re&&re.nodeType===1&&(re.addEventListener("rangeChanged",ne=>{this._first=ne.first,this._last=ne.last,this.setValue(this.render())}),this._makeVirtualizer(re,X))}disconnected(){var J;(J=this._virtualizer)==null||J.disconnected()}reconnected(){var J;(J=this._virtualizer)==null||J.connected()}}const virtualize=e$K(VirtualizeDirective);function shouldShowRole(te){var J,X;return!((X=(J=te.professional)==null?void 0:J.speciality)!=null&&X.description)}const hasItemDivider=(te,J)=>{var re;const X=J.findIndex(ne=>ne.id===te.id);return X===-1?!1:X===J.length-1?!0:!((re=te.diagnostics)!=null&&re.length)},mergeHistoryItemsAndSubgroups=te=>{const J=te.items.map(re=>({type:"item",date:new Date(re.date),item:re})),X=te.subGroups.map(re=>({type:"subGroup",date:re.items.length?new Date(re.items[0].date):new Date(0),subGroup:re}));return[...J,...X].sort((re,ne)=>ne.date.getTime()-re.date.getTime())},template$h=te=>{var J;return te._hasUpdatedOnce?ke$1`
|
|
345
|
-
<div class="container">
|
|
346
|
-
<activity-history-full-data-error></activity-history-full-data-error>
|
|
347
|
-
<activity-history-partial-data-error></activity-history-partial-data-error>
|
|
348
|
-
${((J=te.historyGroups)==null?void 0:J.length)>0?ke$1`
|
|
349
|
-
<div class="virtualizer">
|
|
350
|
-
${virtualize({items:te.historyGroups,renderItem:(X,re)=>{var ne,oe,de,ce;return ke$1`
|
|
351
|
-
<div class="visit zIndex${te.historyGroups.length-re}" data-date=${to(((ne=X==null?void 0:X.items[0])==null?void 0:ne.date)||((de=(oe=X.subGroups[0])==null?void 0:oe.items[0])==null?void 0:de.date))}>
|
|
332
|
+
*/const to=te=>te??D$1;function shouldShowRole(te){var J,X;return!((X=(J=te.professional)==null?void 0:J.speciality)!=null&&X.description)}const hasItemDivider=(te,J)=>{var re;const X=J.findIndex(ne=>ne.id===te.id);return X===-1?!1:X===J.length-1?!0:!((re=te.diagnostics)!=null&&re.length)},mergeHistoryItemsAndSubgroups=te=>{const J=te.items.map(re=>({type:"item",date:new Date(re.date),item:re})),X=te.subGroups.map(re=>({type:"subGroup",date:re.items.length?new Date(re.items[0].date):new Date(0),subGroup:re}));return[...J,...X].sort((re,ne)=>ne.date.getTime()-re.date.getTime())},template$h=te=>{var J;return te._hasUpdatedOnce?ke$1`
|
|
333
|
+
<div class="container">
|
|
334
|
+
<activity-history-full-data-error></activity-history-full-data-error>
|
|
335
|
+
<activity-history-partial-data-error></activity-history-partial-data-error>
|
|
336
|
+
|
|
337
|
+
${((J=te.historyGroups)==null?void 0:J.length)>0?ke$1`
|
|
338
|
+
<lit-virtualizer class="virtualizer"
|
|
339
|
+
?scroller=${!0}
|
|
340
|
+
.items=${te.historyGroups}
|
|
341
|
+
.renderItem=${(X,re)=>{var ne,oe,de,ce;return ke$1`
|
|
342
|
+
<div class="visit zIndex${te.historyGroups.length-re}"
|
|
343
|
+
data-date=${to(((ne=X==null?void 0:X.items[0])==null?void 0:ne.date)||((de=(oe=X.subGroups[0])==null?void 0:oe.items[0])==null?void 0:de.date))}>
|
|
352
344
|
${visitHeaderTemplate(te,X.items[0]||((ce=X.subGroups[0])==null?void 0:ce.items[0]))}
|
|
353
345
|
<div class="visit__items">
|
|
354
346
|
${Qt(mergeHistoryItemsAndSubgroups(X),he=>he.type==="item"?he.item.id:he.subGroup.id,he=>{if(he.type==="item"){const pe=he.item;return ke$1`
|
|
@@ -359,27 +351,31 @@ Registered bindings:`,ne.forEach(function(oe){var de="Object";oe.implementationT
|
|
|
359
351
|
${pe.component}
|
|
360
352
|
</div>
|
|
361
353
|
`}const ue=he.subGroup;return ke$1`
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
</div>
|
|
372
|
-
`)}
|
|
373
|
-
</div>
|
|
354
|
+
<div class="diagnostics">
|
|
355
|
+
${diagnosticHeaderTemplate(ue.items[0])}
|
|
356
|
+
<div class="diagnostics__items">
|
|
357
|
+
${Qt(ue.items,pe=>pe.id,pe=>ke$1`
|
|
358
|
+
<div class="item"
|
|
359
|
+
?has-divider=${hasItemDivider(pe,ue.items)}>
|
|
360
|
+
${pe.component}
|
|
361
|
+
</div>
|
|
362
|
+
`)}
|
|
374
363
|
</div>
|
|
375
|
-
|
|
364
|
+
</div>
|
|
365
|
+
`})}
|
|
376
366
|
</div>
|
|
377
367
|
</div>
|
|
378
|
-
`}
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
368
|
+
`}}
|
|
369
|
+
></lit-virtualizer>
|
|
370
|
+
`:!te.isAnyCollectionLoadingWithoutAnyLoaded&&!te.isSomeCollectionLoadedAndOtherLoading?ke$1`
|
|
371
|
+
<dss-user-feedback
|
|
372
|
+
class="feedback"
|
|
373
|
+
imagesrc=${notFound}
|
|
374
|
+
title=${translate("noResults")}>
|
|
375
|
+
</dss-user-feedback>
|
|
376
|
+
`:D$1}
|
|
377
|
+
</div>
|
|
378
|
+
`:ke$1`<div class="container"></div>`},visitHeaderTemplate=(te,J)=>J?ke$1`
|
|
383
379
|
<div class="visit__header">
|
|
384
380
|
<div class="title">
|
|
385
381
|
<div class="title-date">
|
|
@@ -394,22 +390,49 @@ Registered bindings:`,ne.forEach(function(oe){var de="Object";oe.implementationT
|
|
|
394
390
|
</div>
|
|
395
391
|
`:D$1,renderProfessionalValues=(te,J)=>{if(!J.professional)return D$1;const X=shouldShowRole(J),re=[];return re.push(te.highlighted(J.professional.name)),X&&J.professional.role&&re.push(te.highlighted(J.professional.role.description)),J.up&&re.push(te.highlighted(J.up.description)),J.professional.speciality&&re.push(te.highlighted(J.professional.speciality.description)),J.service&&re.push(te.highlighted(J.service.description)),re.map((ne,oe)=>ke$1`${ne}${oe<re.length-1?" | ":""}`)},diagnosticHeaderTemplate=te=>te&&ke$1`
|
|
396
392
|
<div class="diagnostics__header">
|
|
397
|
-
|
|
398
|
-
${te.diagnostics.filter(J=>J.descripcio!=null&&J.descripcio.trim()!=="").map(J=>{var X;return ke$1`<dss-badge text=${(X=J.descripcio)==null?void 0:X.toUpperCase()} state="info" size="sm" outlined></dss-badge>`})}
|
|
393
|
+
${te.diagnostics.filter(J=>J.description!=null&&J.description.trim()!=="").map(J=>{var X;return ke$1`<dss-badge text=${(X=J.description)==null?void 0:X.toUpperCase()} state="info" size="sm" outlined></dss-badge>`})}
|
|
399
394
|
</div>
|
|
400
395
|
`;/**
|
|
401
396
|
* @license
|
|
402
397
|
* Copyright 2017 Google LLC
|
|
403
398
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
404
|
-
*/class le extends i$x{constructor(J){if(super(J),this.it=D$1,J.type!==t$g.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(J){if(J===D$1||J==null)return this._t=void 0,this.it=J;if(J===R)return J;if(typeof J!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(J===this.it)return this._t;this.it=J;const X=[J];return X.raw=X,this._t={_$litType$:this.constructor.resultType,strings:X,values:[]}}}le.directiveName="unsafeHTML",le.resultType=1;const ae=e$K(le),isAnyCollectionBusySelector=te=>te.activityHistoryCollections.busy.length>0,isAnyCollectionLoadingWithoutAnyLoaded=te=>{const J=Object.values(te.activityHistoryCollections.collections);return!(J!=null&&J.length)&&isAnyCollectionBusySelector(te)},isSomeCollectionLoadedAndOtherLoading=te=>Object.values(te.activityHistoryCollections.collections)&&isAnyCollectionBusySelector(te)
|
|
399
|
+
*/class le extends i$x{constructor(J){if(super(J),this.it=D$1,J.type!==t$g.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(J){if(J===D$1||J==null)return this._t=void 0,this.it=J;if(J===R)return J;if(typeof J!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(J===this.it)return this._t;this.it=J;const X=[J];return X.raw=X,this._t={_$litType$:this.constructor.resultType,strings:X,values:[]}}}le.directiveName="unsafeHTML",le.resultType=1;const ae=e$K(le),isAnyCollectionBusySelector=te=>te.activityHistoryCollections.busy.length>0,isAnyCollectionLoadingWithoutAnyLoaded=te=>{const J=Object.values(te.activityHistoryCollections.collections);return!(J!=null&&J.length)&&isAnyCollectionBusySelector(te)},isSomeCollectionLoadedAndOtherLoading=te=>Object.values(te.activityHistoryCollections.collections)&&isAnyCollectionBusySelector(te);/**
|
|
400
|
+
* @license
|
|
401
|
+
* Copyright 2017 Google LLC
|
|
402
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
403
|
+
*/const mt=(te,J)=>{var re;const X=te._$AN;if(X===void 0)return!1;for(const ne of X)(re=ne._$AO)==null||re.call(ne,J,!1),mt(ne,J);return!0},_t=te=>{let J,X;do{if((J=te._$AM)===void 0)break;X=J._$AN,X.delete(te),te=J}while((X==null?void 0:X.size)===0)},wt=te=>{for(let J;J=te._$AM;te=J){let X=J._$AN;if(X===void 0)J._$AN=X=new Set;else if(X.has(te))break;X.add(te),gt(J)}};function bt(te){this._$AN!==void 0?(_t(this),this._$AM=te,wt(this)):this._$AM=te}function yt(te,J=!1,X=0){const re=this._$AH,ne=this._$AN;if(ne!==void 0&&ne.size!==0)if(J)if(Array.isArray(re))for(let oe=X;oe<re.length;oe++)mt(re[oe],!1),_t(re[oe]);else re!=null&&(mt(re,!1),_t(re));else mt(this,te)}const gt=te=>{te.type==t$g.CHILD&&(te._$AP??(te._$AP=yt),te._$AQ??(te._$AQ=bt))};class $t extends i$x{constructor(){super(...arguments),this._$AN=void 0}_$AT(J,X,re){super._$AT(J,X,re),wt(this),this.isConnected=J._$AU}_$AO(J,X=!0){var re,ne;J!==this.isConnected&&(this.isConnected=J,J?(re=this.reconnected)==null||re.call(this):(ne=this.disconnected)==null||ne.call(this)),X&&(mt(this,J),_t(this))}setValue(J){if(rt(this.t))this.t._$AI(J,this);else{const X=[...this.t._$AH];X[this.i]=J,this.t._$AI(X,this,0)}}disconnected(){}reconnected(){}}/**
|
|
404
|
+
* @license
|
|
405
|
+
* Copyright 2021 Google LLC
|
|
406
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
407
|
+
*/class RangeChangedEvent extends Event{constructor(J){super(RangeChangedEvent.eventName,{bubbles:!1}),this.first=J.first,this.last=J.last}}RangeChangedEvent.eventName="rangeChanged";class VisibilityChangedEvent extends Event{constructor(J){super(VisibilityChangedEvent.eventName,{bubbles:!1}),this.first=J.first,this.last=J.last}}VisibilityChangedEvent.eventName="visibilityChanged";class UnpinnedEvent extends Event{constructor(){super(UnpinnedEvent.eventName,{bubbles:!1})}}UnpinnedEvent.eventName="unpinned";/**
|
|
408
|
+
* @license
|
|
409
|
+
* Copyright 2021 Google LLC
|
|
410
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
411
|
+
*/class ScrollerShim{constructor(J){this._element=null;const X=J??window;this._node=X,J&&(this._element=J)}get element(){return this._element||document.scrollingElement||document.documentElement}get scrollTop(){return this.element.scrollTop||window.scrollY}get scrollLeft(){return this.element.scrollLeft||window.scrollX}get scrollHeight(){return this.element.scrollHeight}get scrollWidth(){return this.element.scrollWidth}get viewportHeight(){return this._element?this._element.getBoundingClientRect().height:window.innerHeight}get viewportWidth(){return this._element?this._element.getBoundingClientRect().width:window.innerWidth}get maxScrollTop(){return this.scrollHeight-this.viewportHeight}get maxScrollLeft(){return this.scrollWidth-this.viewportWidth}}class ScrollerController extends ScrollerShim{constructor(J,X){super(X),this._clients=new Set,this._retarget=null,this._end=null,this.__destination=null,this.correctingScrollError=!1,this._checkForArrival=this._checkForArrival.bind(this),this._updateManagedScrollTo=this._updateManagedScrollTo.bind(this),this.scrollTo=this.scrollTo.bind(this),this.scrollBy=this.scrollBy.bind(this);const re=this._node;this._originalScrollTo=re.scrollTo,this._originalScrollBy=re.scrollBy,this._originalScroll=re.scroll,this._attach(J)}get _destination(){return this.__destination}get scrolling(){return this._destination!==null}scrollTo(J,X){const re=typeof J=="number"&&typeof X=="number"?{left:J,top:X}:J;this._scrollTo(re)}scrollBy(J,X){const re=typeof J=="number"&&typeof X=="number"?{left:J,top:X}:J;re.top!==void 0&&(re.top+=this.scrollTop),re.left!==void 0&&(re.left+=this.scrollLeft),this._scrollTo(re)}_nativeScrollTo(J){this._originalScrollTo.bind(this._element||window)(J)}_scrollTo(J,X=null,re=null){this._end!==null&&this._end(),J.behavior==="smooth"?(this._setDestination(J),this._retarget=X,this._end=re):this._resetScrollState(),this._nativeScrollTo(J)}_setDestination(J){let{top:X,left:re}=J;return X=X===void 0?void 0:Math.max(0,Math.min(X,this.maxScrollTop)),re=re===void 0?void 0:Math.max(0,Math.min(re,this.maxScrollLeft)),this._destination!==null&&re===this._destination.left&&X===this._destination.top?!1:(this.__destination={top:X,left:re,behavior:"smooth"},!0)}_resetScrollState(){this.__destination=null,this._retarget=null,this._end=null}_updateManagedScrollTo(J){this._destination&&this._setDestination(J)&&this._nativeScrollTo(this._destination)}managedScrollTo(J,X,re){return this._scrollTo(J,X,re),this._updateManagedScrollTo}correctScrollError(J){this.correctingScrollError=!0,requestAnimationFrame(()=>requestAnimationFrame(()=>this.correctingScrollError=!1)),this._nativeScrollTo(J),this._retarget&&this._setDestination(this._retarget()),this._destination&&this._nativeScrollTo(this._destination)}_checkForArrival(){if(this._destination!==null){const{scrollTop:J,scrollLeft:X}=this;let{top:re,left:ne}=this._destination;re=Math.min(re||0,this.maxScrollTop),ne=Math.min(ne||0,this.maxScrollLeft);const oe=Math.abs(re-J),de=Math.abs(ne-X);oe<1&&de<1&&(this._end&&this._end(),this._resetScrollState())}}detach(J){return this._clients.delete(J),this._clients.size===0&&(this._node.scrollTo=this._originalScrollTo,this._node.scrollBy=this._originalScrollBy,this._node.scroll=this._originalScroll,this._node.removeEventListener("scroll",this._checkForArrival)),null}_attach(J){this._clients.add(J),this._clients.size===1&&(this._node.scrollTo=this.scrollTo,this._node.scrollBy=this.scrollBy,this._node.scroll=this.scrollTo,this._node.addEventListener("scroll",this._checkForArrival))}}/**
|
|
412
|
+
* @license
|
|
413
|
+
* Copyright 2021 Google LLC
|
|
414
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
415
|
+
*/let _ResizeObserver=typeof window<"u"?window.ResizeObserver:void 0;const virtualizerRef=Symbol("virtualizerRef"),SIZER_ATTRIBUTE="virtualizer-sizer";let DefaultLayoutConstructor;class Virtualizer{constructor(J){if(this._benchmarkStart=null,this._layout=null,this._clippingAncestors=[],this._scrollSize=null,this._scrollError=null,this._childrenPos=null,this._childMeasurements=null,this._toBeMeasured=new Map,this._rangeChanged=!0,this._itemsChanged=!0,this._visibilityChanged=!0,this._scrollerController=null,this._isScroller=!1,this._sizer=null,this._hostElementRO=null,this._childrenRO=null,this._mutationObserver=null,this._scrollEventListeners=[],this._scrollEventListenerOptions={passive:!0},this._loadListener=this._childLoaded.bind(this),this._scrollIntoViewTarget=null,this._updateScrollIntoViewCoordinates=null,this._items=[],this._first=-1,this._last=-1,this._firstVisible=-1,this._lastVisible=-1,this._scheduled=new WeakSet,this._measureCallback=null,this._measureChildOverride=null,this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null,this._layoutInitialized=null,this._connected=!1,!J)throw new Error("Virtualizer constructor requires a configuration object");if(J.hostElement)this._init(J);else throw new Error('Virtualizer configuration requires the "hostElement" property')}set items(J){Array.isArray(J)&&J!==this._items&&(this._itemsChanged=!0,this._items=J,this._schedule(this._updateLayout))}_init(J){this._isScroller=!!J.scroller,this._initHostElement(J);const X=J.layout||{};this._layoutInitialized=this._initLayout(X)}_initObservers(){this._mutationObserver=new MutationObserver(this._finishDOMUpdate.bind(this)),this._hostElementRO=new _ResizeObserver(()=>this._hostElementSizeChanged()),this._childrenRO=new _ResizeObserver(this._childrenSizeChanged.bind(this))}_initHostElement(J){const X=this._hostElement=J.hostElement;this._applyVirtualizerStyles(),X[virtualizerRef]=this}connected(){this._initObservers();const J=this._isScroller;this._clippingAncestors=getClippingAncestors(this._hostElement,J),this._scrollerController=new ScrollerController(this,this._clippingAncestors[0]),this._schedule(this._updateLayout),this._observeAndListen(),this._connected=!0}_observeAndListen(){this._mutationObserver.observe(this._hostElement,{childList:!0}),this._hostElementRO.observe(this._hostElement),this._scrollEventListeners.push(window),window.addEventListener("scroll",this,this._scrollEventListenerOptions),this._clippingAncestors.forEach(J=>{J.addEventListener("scroll",this,this._scrollEventListenerOptions),this._scrollEventListeners.push(J),this._hostElementRO.observe(J)}),this._hostElementRO.observe(this._scrollerController.element),this._children.forEach(J=>this._childrenRO.observe(J)),this._scrollEventListeners.forEach(J=>J.addEventListener("scroll",this,this._scrollEventListenerOptions))}disconnected(){var J,X,re,ne;this._scrollEventListeners.forEach(oe=>oe.removeEventListener("scroll",this,this._scrollEventListenerOptions)),this._scrollEventListeners=[],this._clippingAncestors=[],(J=this._scrollerController)==null||J.detach(this),this._scrollerController=null,(X=this._mutationObserver)==null||X.disconnect(),this._mutationObserver=null,(re=this._hostElementRO)==null||re.disconnect(),this._hostElementRO=null,(ne=this._childrenRO)==null||ne.disconnect(),this._childrenRO=null,this._rejectLayoutCompletePromise("disconnected"),this._connected=!1}_applyVirtualizerStyles(){const X=this._hostElement.style;X.display=X.display||"block",X.position=X.position||"relative",X.contain=X.contain||"size layout",this._isScroller&&(X.overflow=X.overflow||"auto",X.minHeight=X.minHeight||"150px")}_getSizer(){const J=this._hostElement;if(!this._sizer){let X=J.querySelector(`[${SIZER_ATTRIBUTE}]`);X||(X=document.createElement("div"),X.setAttribute(SIZER_ATTRIBUTE,""),J.appendChild(X)),Object.assign(X.style,{position:"absolute",margin:"-2px 0 0 0",padding:0,visibility:"hidden",fontSize:"2px"}),X.textContent=" ",X.setAttribute(SIZER_ATTRIBUTE,""),this._sizer=X}return this._sizer}async updateLayoutConfig(J){await this._layoutInitialized;const X=J.type||DefaultLayoutConstructor;if(typeof X=="function"&&this._layout instanceof X){const re={...J};return delete re.type,this._layout.config=re,!0}return!1}async _initLayout(J){let X,re;if(typeof J.type=="function"){re=J.type;const ne={...J};delete ne.type,X=ne}else X=J;re===void 0&&(DefaultLayoutConstructor=re=(await Promise.resolve().then(()=>flow)).FlowLayout),this._layout=new re(ne=>this._handleLayoutMessage(ne),X),this._layout.measureChildren&&typeof this._layout.updateItemSizes=="function"&&(typeof this._layout.measureChildren=="function"&&(this._measureChildOverride=this._layout.measureChildren),this._measureCallback=this._layout.updateItemSizes.bind(this._layout)),this._layout.listenForChildLoadEvents&&this._hostElement.addEventListener("load",this._loadListener,!0),this._schedule(this._updateLayout)}startBenchmarking(){this._benchmarkStart===null&&(this._benchmarkStart=window.performance.now())}stopBenchmarking(){if(this._benchmarkStart!==null){const J=window.performance.now(),X=J-this._benchmarkStart,ne=performance.getEntriesByName("uv-virtualizing","measure").filter(oe=>oe.startTime>=this._benchmarkStart&&oe.startTime<J).reduce((oe,de)=>oe+de.duration,0);return this._benchmarkStart=null,{timeElapsed:X,virtualizationTime:ne}}return null}_measureChildren(){const J={},X=this._children,re=this._measureChildOverride||this._measureChild;for(let ne=0;ne<X.length;ne++){const oe=X[ne],de=this._first+ne;(this._itemsChanged||this._toBeMeasured.has(oe))&&(J[de]=re.call(this,oe,this._items[de]))}this._childMeasurements=J,this._schedule(this._updateLayout),this._toBeMeasured.clear()}_measureChild(J){const{width:X,height:re}=J.getBoundingClientRect();return Object.assign({width:X,height:re},getMargins(J))}async _schedule(J){this._scheduled.has(J)||(this._scheduled.add(J),await Promise.resolve(),this._scheduled.delete(J),J.call(this))}async _updateDOM(J){this._scrollSize=J.scrollSize,this._adjustRange(J.range),this._childrenPos=J.childPositions,this._scrollError=J.scrollError||null;const{_rangeChanged:X,_itemsChanged:re}=this;this._visibilityChanged&&(this._notifyVisibility(),this._visibilityChanged=!1),(X||re)&&(this._notifyRange(),this._rangeChanged=!1),this._finishDOMUpdate()}_finishDOMUpdate(){this._connected&&(this._children.forEach(J=>this._childrenRO.observe(J)),this._checkScrollIntoViewTarget(this._childrenPos),this._positionChildren(this._childrenPos),this._sizeHostElement(this._scrollSize),this._correctScrollError(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_updateLayout(){this._layout&&this._connected&&(this._layout.items=this._items,this._updateView(),this._childMeasurements!==null&&(this._measureCallback&&this._measureCallback(this._childMeasurements),this._childMeasurements=null),this._layout.reflowIfNeeded(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_handleScrollEvent(){var J;if(this._benchmarkStart&&"mark"in window.performance){try{window.performance.measure("uv-virtualizing","uv-start","uv-end")}catch(X){console.warn("Error measuring performance data: ",X)}window.performance.mark("uv-start")}this._scrollerController.correctingScrollError===!1&&((J=this._layout)==null||J.unpin()),this._schedule(this._updateLayout)}handleEvent(J){switch(J.type){case"scroll":(J.currentTarget===window||this._clippingAncestors.includes(J.currentTarget))&&this._handleScrollEvent();break;default:console.warn("event not handled",J)}}_handleLayoutMessage(J){J.type==="stateChanged"?this._updateDOM(J):J.type==="visibilityChanged"?(this._firstVisible=J.firstVisible,this._lastVisible=J.lastVisible,this._notifyVisibility()):J.type==="unpinned"&&this._hostElement.dispatchEvent(new UnpinnedEvent)}get _children(){const J=[];let X=this._hostElement.firstElementChild;for(;X;)X.hasAttribute(SIZER_ATTRIBUTE)||J.push(X),X=X.nextElementSibling;return J}_updateView(){var ne;const J=this._hostElement,X=(ne=this._scrollerController)==null?void 0:ne.element,re=this._layout;if(J&&X&&re){let oe,de,ce,he;const ue=J.getBoundingClientRect();oe=0,de=0,ce=window.innerHeight,he=window.innerWidth;const pe=this._clippingAncestors.map(Se=>Se.getBoundingClientRect());pe.unshift(ue);for(const Se of pe)oe=Math.max(oe,Se.top),de=Math.max(de,Se.left),ce=Math.min(ce,Se.bottom),he=Math.min(he,Se.right);const fe=X.getBoundingClientRect(),ge={left:ue.left-fe.left,top:ue.top-fe.top},me={width:X.scrollWidth,height:X.scrollHeight},ve=oe-ue.top+J.scrollTop,be=de-ue.left+J.scrollLeft,_e=Math.max(0,ce-oe),we=Math.max(0,he-de);re.viewportSize={width:we,height:_e},re.viewportScroll={top:ve,left:be},re.totalScrollSize=me,re.offsetWithinScroller=ge}}_sizeHostElement(J){const re=J&&J.width!==null?Math.min(82e5,J.width):0,ne=J&&J.height!==null?Math.min(82e5,J.height):0;if(this._isScroller)this._getSizer().style.transform=`translate(${re}px, ${ne}px)`;else{const oe=this._hostElement.style;oe.minWidth=re?`${re}px`:"100%",oe.minHeight=ne?`${ne}px`:"100%"}}_positionChildren(J){J&&J.forEach(({top:X,left:re,width:ne,height:oe,xOffset:de,yOffset:ce},he)=>{const ue=this._children[he-this._first];ue&&(ue.style.position="absolute",ue.style.boxSizing="border-box",ue.style.transform=`translate(${re}px, ${X}px)`,ne!==void 0&&(ue.style.width=ne+"px"),oe!==void 0&&(ue.style.height=oe+"px"),ue.style.left=de===void 0?null:de+"px",ue.style.top=ce===void 0?null:ce+"px")})}async _adjustRange(J){const{_first:X,_last:re,_firstVisible:ne,_lastVisible:oe}=this;this._first=J.first,this._last=J.last,this._firstVisible=J.firstVisible,this._lastVisible=J.lastVisible,this._rangeChanged=this._rangeChanged||this._first!==X||this._last!==re,this._visibilityChanged=this._visibilityChanged||this._firstVisible!==ne||this._lastVisible!==oe}_correctScrollError(){if(this._scrollError){const{scrollTop:J,scrollLeft:X}=this._scrollerController,{top:re,left:ne}=this._scrollError;this._scrollError=null,this._scrollerController.correctScrollError({top:J-re,left:X-ne})}}element(J){var X;return J===1/0&&(J=this._items.length-1),((X=this._items)==null?void 0:X[J])===void 0?void 0:{scrollIntoView:(re={})=>this._scrollElementIntoView({...re,index:J})}}_scrollElementIntoView(J){if(J.index>=this._first&&J.index<=this._last)this._children[J.index-this._first].scrollIntoView(J);else if(J.index=Math.min(J.index,this._items.length-1),J.behavior==="smooth"){const X=this._layout.getScrollIntoViewCoordinates(J),{behavior:re}=J;this._updateScrollIntoViewCoordinates=this._scrollerController.managedScrollTo(Object.assign(X,{behavior:re}),()=>this._layout.getScrollIntoViewCoordinates(J),()=>this._scrollIntoViewTarget=null),this._scrollIntoViewTarget=J}else this._layout.pin=J}_checkScrollIntoViewTarget(J){const{index:X}=this._scrollIntoViewTarget||{};X&&(J!=null&&J.has(X))&&this._updateScrollIntoViewCoordinates(this._layout.getScrollIntoViewCoordinates(this._scrollIntoViewTarget))}_notifyRange(){this._hostElement.dispatchEvent(new RangeChangedEvent({first:this._first,last:this._last}))}_notifyVisibility(){this._hostElement.dispatchEvent(new VisibilityChangedEvent({first:this._firstVisible,last:this._lastVisible}))}get layoutComplete(){return this._layoutCompletePromise||(this._layoutCompletePromise=new Promise((J,X)=>{this._layoutCompleteResolver=J,this._layoutCompleteRejecter=X})),this._layoutCompletePromise}_rejectLayoutCompletePromise(J){this._layoutCompleteRejecter!==null&&this._layoutCompleteRejecter(J),this._resetLayoutCompleteState()}_scheduleLayoutComplete(){this._layoutCompletePromise&&this._pendingLayoutComplete===null&&(this._pendingLayoutComplete=requestAnimationFrame(()=>requestAnimationFrame(()=>this._resolveLayoutCompletePromise())))}_resolveLayoutCompletePromise(){this._layoutCompleteResolver!==null&&this._layoutCompleteResolver(),this._resetLayoutCompleteState()}_resetLayoutCompleteState(){this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null}_hostElementSizeChanged(){this._schedule(this._updateLayout)}_childLoaded(){}_childrenSizeChanged(J){var X;if((X=this._layout)!=null&&X.measureChildren){for(const re of J)this._toBeMeasured.set(re.target,re.contentRect);this._measureChildren()}this._scheduleLayoutComplete(),this._itemsChanged=!1,this._rangeChanged=!1}}function getMargins(te){const J=window.getComputedStyle(te);return{marginTop:getMarginValue(J.marginTop),marginRight:getMarginValue(J.marginRight),marginBottom:getMarginValue(J.marginBottom),marginLeft:getMarginValue(J.marginLeft)}}function getMarginValue(te){const J=te?parseFloat(te):NaN;return Number.isNaN(J)?0:J}function getParentElement(te){if(te.assignedSlot!==null)return te.assignedSlot;if(te.parentElement!==null)return te.parentElement;const J=te.parentNode;return J&&J.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&J.host||null}function getElementAncestors(te,J=!1){const X=[];let re=J?te:getParentElement(te);for(;re!==null;)X.push(re),re=getParentElement(re);return X}function getClippingAncestors(te,J=!1){let X=!1;return getElementAncestors(te,J).filter(re=>{if(X)return!1;const ne=getComputedStyle(re);return X=ne.position==="fixed",ne.overflow!=="visible"})}/**
|
|
416
|
+
* @license
|
|
417
|
+
* Copyright 2021 Google LLC
|
|
418
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
419
|
+
*/const defaultKeyFunction=te=>te,defaultRenderItem=(te,J)=>ke$1`${J}: ${JSON.stringify(te,null,2)}`;class VirtualizeDirective extends $t{constructor(J){if(super(J),this._virtualizer=null,this._first=0,this._last=-1,this._renderItem=(X,re)=>defaultRenderItem(X,re+this._first),this._keyFunction=(X,re)=>defaultKeyFunction(X,re+this._first),this._items=[],J.type!==t$g.CHILD)throw new Error("The virtualize directive can only be used in child expressions")}render(J){J&&this._setFunctions(J);const X=[];if(this._first>=0&&this._last>=this._first)for(let re=this._first;re<=this._last;re++)X.push(this._items[re]);return Qt(X,this._keyFunction,this._renderItem)}update(J,[X]){this._setFunctions(X);const re=this._items!==X.items;return this._items=X.items||[],this._virtualizer?this._updateVirtualizerConfig(J,X):this._initialize(J,X),re?R:this.render()}async _updateVirtualizerConfig(J,X){if(!await this._virtualizer.updateLayoutConfig(X.layout||{})){const ne=J.parentNode;this._makeVirtualizer(ne,X)}this._virtualizer.items=this._items}_setFunctions(J){const{renderItem:X,keyFunction:re}=J;X&&(this._renderItem=(ne,oe)=>X(ne,oe+this._first)),re&&(this._keyFunction=(ne,oe)=>re(ne,oe+this._first))}_makeVirtualizer(J,X){this._virtualizer&&this._virtualizer.disconnected();const{layout:re,scroller:ne,items:oe}=X;this._virtualizer=new Virtualizer({hostElement:J,layout:re,scroller:ne}),this._virtualizer.items=oe,this._virtualizer.connected()}_initialize(J,X){const re=J.parentNode;re&&re.nodeType===1&&(re.addEventListener("rangeChanged",ne=>{this._first=ne.first,this._last=ne.last,this.setValue(this.render())}),this._makeVirtualizer(re,X))}disconnected(){var J;(J=this._virtualizer)==null||J.disconnected()}reconnected(){var J;(J=this._virtualizer)==null||J.connected()}}const virtualize=e$K(VirtualizeDirective);function __decorate(te,J,X,re){var ne=arguments.length,oe=ne<3?J:re===null?re=Object.getOwnPropertyDescriptor(J,X):re,de;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")oe=Reflect.decorate(te,J,X,re);else for(var ce=te.length-1;ce>=0;ce--)(de=te[ce])&&(oe=(ne<3?de(oe):ne>3?de(J,X,oe):de(J,X))||oe);return ne>3&&oe&&Object.defineProperty(J,X,oe),oe}typeof SuppressedError=="function"&&SuppressedError;/**
|
|
420
|
+
* @license
|
|
421
|
+
* Copyright 2021 Google LLC
|
|
422
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
423
|
+
*/class LitVirtualizer extends h$q{constructor(){super(...arguments),this.items=[],this.renderItem=defaultRenderItem,this.keyFunction=defaultKeyFunction,this.layout={},this.scroller=!1}createRenderRoot(){return this}render(){const{items:J,renderItem:X,keyFunction:re,layout:ne,scroller:oe}=this;return ke$1`${virtualize({items:J,renderItem:X,keyFunction:re,layout:ne,scroller:oe})}`}element(J){var X;return(X=this[virtualizerRef])==null?void 0:X.element(J)}get layoutComplete(){var J;return(J=this[virtualizerRef])==null?void 0:J.layoutComplete}scrollToIndex(J,X="start"){var re;(re=this.element(J))==null||re.scrollIntoView({block:X})}}__decorate([n$x({attribute:!1})],LitVirtualizer.prototype,"items",void 0),__decorate([n$x()],LitVirtualizer.prototype,"renderItem",void 0),__decorate([n$x()],LitVirtualizer.prototype,"keyFunction",void 0),__decorate([n$x({attribute:!1})],LitVirtualizer.prototype,"layout",void 0),__decorate([n$x({reflect:!0,type:Boolean})],LitVirtualizer.prototype,"scroller",void 0);/**
|
|
424
|
+
* @license
|
|
425
|
+
* Copyright 2021 Google LLC
|
|
426
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
427
|
+
*/customElements.define("lit-virtualizer",LitVirtualizer);var __defProp$o=Object.defineProperty,__getOwnPropDesc$f=Object.getOwnPropertyDescriptor,__decorateClass$o=(te,J,X,re)=>{for(var ne=re>1?void 0:re?__getOwnPropDesc$f(J,X):J,oe=te.length-1,de;oe>=0;oe--)(de=te[oe])&&(ne=(re?de(J,X,ne):de(ne))||ne);return re&&ne&&__defProp$o(J,X,ne),ne};const createZIndexStyles=te=>{let J="";for(let X=0;X<=te;X++)J+=`.zIndex${X} { z-index: ${X} !important; }
|
|
405
428
|
`;return J};let ActivityHistoryTimeline=class extends h$q{constructor(){super(...arguments),this._hasUpdatedOnce=!1}render(){var X;const te=((X=this.historyGroups)==null?void 0:X.length)??0,J=createZIndexStyles(te);return ke$1`
|
|
406
429
|
<style>
|
|
407
430
|
${r$H(J)}
|
|
408
431
|
</style>
|
|
409
432
|
${template$h(this)}
|
|
410
|
-
`}firstUpdated(te){super.firstUpdated(te),this._hasUpdatedOnce=!0}async updated(te){var J;te.has("historyGroups")&&((J=this.historyGroups)!=null&&J.length)&&await this.prepareComponents(this.historyGroups)}async prepareComponents(te){for(const J of te){J.items=await Promise.all(J.items.map(async X=>({...X,component:await X.componentFactory({item:X})})));for(const X of J.subGroups)X.items=await Promise.all(X.items.map(async re=>({...re,component:await re.componentFactory({item:re})})))}this.requestUpdate()}highlightMatch(te,J){if(!this.searchString||this.searchString.length<2)return te;const X=new RegExp(`(${J})`,"gi");return te.replace(X,'<span class="highlight">$1</span>')}highlighted(te){return te?ae(this.highlightMatch(te,this.searchString)):null}_scrollIntoDate(te){let J
|
|
433
|
+
`}firstUpdated(te){super.firstUpdated(te),this._hasUpdatedOnce=!0}async updated(te){var J;te.has("historyGroups")&&((J=this.historyGroups)!=null&&J.length)&&await this.prepareComponents(this.historyGroups)}async prepareComponents(te){for(const J of te){J.items=await Promise.all(J.items.map(async X=>({...X,component:await X.componentFactory({item:X})})));for(const X of J.subGroups)X.items=await Promise.all(X.items.map(async re=>({...re,component:await re.componentFactory({item:re})})))}this.requestUpdate()}highlightMatch(te,J){if(!this.searchString||this.searchString.length<2)return te;const X=new RegExp(`(${J})`,"gi");return te.replace(X,'<span class="highlight">$1</span>')}highlighted(te){return te?ae(this.highlightMatch(te,this.searchString)):null}_scrollIntoDate(te){let J=-1,X=Number.POSITIVE_INFINITY;(this.historyGroups??[]).forEach((re,ne)=>{var he,ue,pe,fe,ge,me;const oe=((ue=(he=re.items)==null?void 0:he[0])==null?void 0:ue.date)||((me=(ge=(fe=(pe=re.subGroups)==null?void 0:pe[0])==null?void 0:fe.items)==null?void 0:ge[0])==null?void 0:me.date);if(!oe)return;const de=new Date(oe).getTime(),ce=Math.abs(de-te);ce<X&&(X=ce,J=ne)}),J!==-1&&this._virtualizer&&this._virtualizer[virtualizerRef].element(J).scrollIntoView()}};ActivityHistoryTimeline.styles=i$A`
|
|
411
434
|
${r$H(styles$g)}
|
|
412
|
-
`,__decorateClass$o([connectedProperty(activityHistoryGroupedItems)],ActivityHistoryTimeline.prototype,"historyGroups",2),__decorateClass$o([connectedProperty(isAnyCollectionLoadingWithoutAnyLoaded)],ActivityHistoryTimeline.prototype,"isAnyCollectionLoadingWithoutAnyLoaded",2),__decorateClass$o([connectedProperty(isSomeCollectionLoadedAndOtherLoading)],ActivityHistoryTimeline.prototype,"isSomeCollectionLoadedAndOtherLoading",2),__decorateClass$o([connectedProperty(activityHistorySearchStringSelector)],ActivityHistoryTimeline.prototype,"searchString",2),ActivityHistoryTimeline=__decorateClass$o([t$j("activity-history-timeline")],ActivityHistoryTimeline);/**
|
|
435
|
+
`,__decorateClass$o([connectedProperty(activityHistoryGroupedItems)],ActivityHistoryTimeline.prototype,"historyGroups",2),__decorateClass$o([connectedProperty(isAnyCollectionLoadingWithoutAnyLoaded)],ActivityHistoryTimeline.prototype,"isAnyCollectionLoadingWithoutAnyLoaded",2),__decorateClass$o([connectedProperty(isSomeCollectionLoadedAndOtherLoading)],ActivityHistoryTimeline.prototype,"isSomeCollectionLoadedAndOtherLoading",2),__decorateClass$o([connectedProperty(activityHistorySearchStringSelector)],ActivityHistoryTimeline.prototype,"searchString",2),__decorateClass$o([e$N(".virtualizer")],ActivityHistoryTimeline.prototype,"_virtualizer",2),ActivityHistoryTimeline=__decorateClass$o([t$j("activity-history-timeline")],ActivityHistoryTimeline);/**
|
|
413
436
|
* @license
|
|
414
437
|
* Copyright 2021 Google LLC
|
|
415
438
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -6673,7 +6696,7 @@ Registered bindings:`,ne.forEach(function(oe){var de="Object";oe.implementationT
|
|
|
6673
6696
|
></dss-alert>
|
|
6674
6697
|
`:D$1}};Xi.styles=i$A`
|
|
6675
6698
|
${r$H(styles)}
|
|
6676
|
-
`;let PrimariaCharacterLimitBadge=Xi;__decorateClass([n$x({type:Number})],PrimariaCharacterLimitBadge.prototype,"characterCount"),__decorateClass([n$x({type:Number})],PrimariaCharacterLimitBadge.prototype,"characterLimit"),__decorateClass([n$x({type:String})],PrimariaCharacterLimitBadge.prototype,"label");const useSharedUI=()=>{t$j("primaria-content-switcher")(PrimariaContentSwitcher),t$j("primaria-nav-item")(PrimariaNavItem),t$j("primaria-rich-text-editor")(PrimariaRichTextEditor),t$j("primaria-nav-tree-menu")(PrimariaNavTreeMenu),t$j("primaria-character-limit-badge")(PrimariaCharacterLimitBadge)},registerLowerNavMenuViews=()=>{shellApi.regionManager.registerView(shellRegions.navigationLowerLeftMenu,{id:"configuration-center",factory:()=>{const te=new PrimariaNavItem({icon:"settings",label:"Centre de configuració",callbackFn:()=>{}});return Promise.resolve(te)}})},getPatientCip=async te=>await te.broker.send("get_patient_cip"),navigateToEcapWithoutClosingWithCip=async te=>{const J=await getPatientCip(shellApi);shellApi.ecapEventManager.publish(te,"NO_TANCAR",{CIP:J})},upperNavMenuItems=[{id:"landing",icon:"home",label:"Pàgina inici",type:"item",sortHint:"0010",callbackFn:()=>shellApi.broker.send(new ExitShell("OBRIR_PI"))},{id:"processes",icon:"account_tree",label:"Vies clíniques",type:"tree",sortHint:"0040",actionMenuItems:[{icon:"open_in_new",label:"ARES",callbackFn:()=>navigateToEcapWithoutClosingWithCip("PROCES_ATENCIO")},{icon:"open_in_new",label:"Nen sa",callbackFn:()=>navigateToEcapWithoutClosingWithCip("NEN_SA")},{icon:"open_in_new",label:"ASSIR",callbackFn:()=>{}},{icon:"open_in_new",label:"Odontologia",callbackFn:()=>navigateToEcapWithoutClosingWithCip("ODONTOLOGO")},{icon:"open_in_new",label:"Situació d'especial cura",callbackFn:()=>navigateToEcapWithoutClosingWithCip("SIT_ESPEC_CURA_DEV")},{icon:"open_in_new",label:"Valoració social",callbackFn:()=>{}}]},{id:"unique-petition",icon:"playlist_add",label:"Petitori",type:"tree",sortHint:"0050",actionMenuItems:[{icon:"open_in_new",label:"Analítiques",callbackFn:()=>navigateToEcapWithoutClosingWithCip("LABORATORI")},{icon:"open_in_new",label:"Ordres Clíniques",callbackFn:()=>navigateToEcapWithoutClosingWithCip("RESULT_OC")},{icon:"open_in_new",label:"OC Exprés",callbackFn:()=>navigateToEcapWithoutClosingWithCip("OC_EXPRES")},{icon:"open_in_new",label:"Sol·licitud de trasllat",callbackFn:()=>navigateToEcapWithoutClosingWithCip("TRANSPORT")}]},{id:"analytics-monitoring",icon:"science",label:"Seguiment analític",type:"item",sortHint:"0060",callbackFn:()=>{}},{id:"results-reports",icon:"folder_shared",label:"Documents",type:"tree",sortHint:"0070",actionMenuItems:[{icon:"open_in_new",label:"Resultats i informes",callbackFn:()=>{}},{icon:"open_in_new",label:"Documents usuari",callbackFn:()=>setTimeout(()=>{navigateToEcapWithoutClosingWithCip("CRIDA_DOCS_USU")},0)},{icon:"open_in_new",label:"Informes clínics",callbackFn:()=>{}}]},{id:"test-cabinets",icon:"list_alt",label:"Gabinets de proves",type:"item",sortHint:"0080",callbackFn:()=>{}},{id:"prescriptions",icon:"pill",label:"Prescripció",type:"tree",sortHint:"0090",actionMenuItems:[{icon:"open_in_new",label:"Prescripció",callbackFn:()=>{}},{icon:"open_in_new",label:"Ordres de tractament",callbackFn:()=>{}},{icon:"open_in_new",label:"Dispensació material sanitari",callbackFn:()=>{}},{icon:"open_in_new",label:"Prescripció social",callbackFn:()=>{}}]},{id:"vaccines",icon:"vaccines",label:"Immunitzacions",type:"item",sortHint:"0100",callbackFn:()=>{}},{id:"it",icon:"history_toggle_off",label:"Incapacitat temporal",type:"item",sortHint:"0100",callbackFn:()=>navigateToEcapWithoutClosingWithCip("REV_IT")},{id:"communication",icon:"3p",label:"Comunicació",type:"tree",sortHint:"0120",actionMenuItems:[{icon:"open_in_new",label:"SMS",callbackFn:async()=>{const te=await getPatientCip(shellApi);shellApi.ecapEventManager.publish("MISSATGES_DEV","NO_TANCAR",{CIP:te||"",TipusMissatge:"SMS"})}},{icon:"open_in_new",label:"eConsulta",callbackFn:()=>{}},{icon:"open_in_new",label:"Mail",callbackFn:()=>{}},{icon:"open_in_new",label:"Veu IP",callbackFn:()=>navigateToEcapWithoutClosingWithCip("VOIP")},{icon:"open_in_new",label:"Videoconsulta",callbackFn:()=>{}}]},{id:"visits",icon:"event",label:"Visites",type:"item",sortHint:"0130",callbackFn:()=>navigateToEcapWithoutClosingWithCip("CONSULTA_VISITES")},{id:"visor",icon:"window",label:"Visor",type:"item",sortHint:"0140",callbackFn:()=>{}}],registerUpperNavMenuViews=()=>{for(const te of upperNavMenuItems)shellApi.regionManager.registerView(shellRegions.navigationMenu,{id:te.id,sortHint:te.sortHint,factory:()=>{const J=te.type==="item"?new PrimariaNavItem({icon:te.icon,label:te.label,callbackFn:te.callbackFn}):new PrimariaNavTreeMenu({icon:te.icon,label:te.label,actionMenuItems:te.actionMenuItems});return Promise.resolve(J)}})},registerMainViews=()=>{registerPDFVisorMainView()},useInternalViews=()=>{registerMainViews(),registerUpperNavMenuViews(),registerLowerNavMenuViews()},useUI=()=>{p$h.registerAdapterFactory("primaria-content-switcher",d$v),useSharedUI(),useComponents(),useInternalViews()},initializeShell=te=>{useLocalization(shellApi),useUI(),useFeatures(shellApi);const J=new PrimariaShell;te.appendChild(J)};class n extends HTMLElement{constructor(J,X,re={}){super(),this.jsx=J,this.styles=X,this.root=this.attachShadow({mode:"open"}),this.reactRoot=null,re&&(this.props=re)}connectedCallback(){const J=document.createElement("div");J.style.minHeight="100%",J.style.width="100%";const X=document.createElement("style");X.innerText=this.styles,this.root.appendChild(J),this.root.appendChild(X),this.reactRoot=r$N.createRoot(J),this.renderReact()}disconnectedCallback(){this.reactRoot&&this.reactRoot.unmount()}renderReact(){this.reactRoot&&this.reactRoot.render(c$v.createElement(this.jsx,{...this.props}))}}customElements.define("ux-react-web-component",n);const h=(te,J)=>(X={})=>Promise.resolve(new n(te,J,X));/**
|
|
6699
|
+
`;let PrimariaCharacterLimitBadge=Xi;__decorateClass([n$x({type:Number})],PrimariaCharacterLimitBadge.prototype,"characterCount"),__decorateClass([n$x({type:Number})],PrimariaCharacterLimitBadge.prototype,"characterLimit"),__decorateClass([n$x({type:String})],PrimariaCharacterLimitBadge.prototype,"label");const useSharedUI=()=>{t$j("primaria-content-switcher")(PrimariaContentSwitcher),t$j("primaria-nav-item")(PrimariaNavItem),t$j("primaria-rich-text-editor")(PrimariaRichTextEditor),t$j("primaria-nav-tree-menu")(PrimariaNavTreeMenu),t$j("primaria-character-limit-badge")(PrimariaCharacterLimitBadge)},registerLowerNavMenuViews=()=>{shellApi.regionManager.registerView(shellRegions.navigationLowerLeftMenu,{id:"configuration-center",factory:()=>{const te=new PrimariaNavItem({icon:"settings",label:"Centre de configuració",callbackFn:()=>{}});return Promise.resolve(te)}})},getPatientCip=async te=>await te.broker.send("get_patient_cip"),navigateToEcapWithoutClosingWithCip=async te=>{const J=await getPatientCip(shellApi);shellApi.ecapEventManager.publish(te,"NO_TANCAR",{CIP:J})},upperNavMenuItems=[{id:"landing",icon:"home",label:"Pàgina inici",type:"item",sortHint:"0010",callbackFn:()=>shellApi.broker.send(new ExitShell("OBRIR_PI"))},{id:"dinamic-monitoring",icon:"poll",label:"Monitoratge dinàmic",type:"item",sortHint:"0030",callbackFn:()=>navigateToEcapWithoutClosingWithCip("SIA_DEV")},{id:"processes",icon:"account_tree",label:"Vies clíniques",type:"tree",sortHint:"0040",actionMenuItems:[{icon:"open_in_new",label:"ARES",callbackFn:()=>navigateToEcapWithoutClosingWithCip("PROCES_ATENCIO")},{icon:"open_in_new",label:"Nen sa",callbackFn:()=>navigateToEcapWithoutClosingWithCip("NEN_SA")},{icon:"open_in_new",label:"ASSIR",callbackFn:()=>{}},{icon:"open_in_new",label:"Odontologia",callbackFn:()=>navigateToEcapWithoutClosingWithCip("ODONTOLOGO")},{icon:"open_in_new",label:"Situació d'especial cura",callbackFn:()=>navigateToEcapWithoutClosingWithCip("SIT_ESPEC_CURA_DEV")},{icon:"open_in_new",label:"Valoració social",callbackFn:()=>{}}]},{id:"unique-petition",icon:"playlist_add",label:"Petitori",type:"tree",sortHint:"0050",actionMenuItems:[{icon:"open_in_new",label:"Analítiques",callbackFn:()=>navigateToEcapWithoutClosingWithCip("LABORATORI")},{icon:"open_in_new",label:"Ordres Clíniques",callbackFn:()=>navigateToEcapWithoutClosingWithCip("RESULT_OC")},{icon:"open_in_new",label:"OC Exprés",callbackFn:()=>navigateToEcapWithoutClosingWithCip("OC_EXPRES")},{icon:"open_in_new",label:"Sol·licitud de trasllat",callbackFn:()=>navigateToEcapWithoutClosingWithCip("TRANSPORT")}]},{id:"analytics-monitoring",icon:"science",label:"Seguiment analític",type:"item",sortHint:"0060",callbackFn:()=>{}},{id:"results-reports",icon:"folder_shared",label:"Documents",type:"tree",sortHint:"0070",actionMenuItems:[{icon:"open_in_new",label:"Resultats i informes",callbackFn:()=>{}},{icon:"open_in_new",label:"Documents usuari",callbackFn:()=>setTimeout(()=>{navigateToEcapWithoutClosingWithCip("CRIDA_DOCS_USU")},0)},{icon:"open_in_new",label:"Informes clínics",callbackFn:()=>{}}]},{id:"test-cabinets",icon:"list_alt",label:"Gabinets de proves",type:"item",sortHint:"0080",callbackFn:()=>{}},{id:"prescriptions",icon:"pill",label:"Prescripció",type:"tree",sortHint:"0090",actionMenuItems:[{icon:"open_in_new",label:"Prescripció",callbackFn:()=>{}},{icon:"open_in_new",label:"Ordres de tractament",callbackFn:()=>{}},{icon:"open_in_new",label:"Dispensació material sanitari",callbackFn:()=>{}},{icon:"open_in_new",label:"Prescripció social",callbackFn:()=>{}}]},{id:"vaccines",icon:"vaccines",label:"Immunitzacions",type:"item",sortHint:"0100",callbackFn:()=>{}},{id:"it",icon:"history_toggle_off",label:"Incapacitat temporal",type:"item",sortHint:"0100",callbackFn:()=>navigateToEcapWithoutClosingWithCip("REV_IT")},{id:"communication",icon:"3p",label:"Comunicació",type:"tree",sortHint:"0120",actionMenuItems:[{icon:"open_in_new",label:"SMS",callbackFn:async()=>{const te=await getPatientCip(shellApi);shellApi.ecapEventManager.publish("MISSATGES_DEV","NO_TANCAR",{CIP:te||"",TipusMissatge:"SMS"})}},{icon:"open_in_new",label:"eConsulta",callbackFn:()=>{}},{icon:"open_in_new",label:"Mail",callbackFn:()=>{}},{icon:"open_in_new",label:"Veu IP",callbackFn:()=>navigateToEcapWithoutClosingWithCip("VOIP")},{icon:"open_in_new",label:"Videoconsulta",callbackFn:()=>{}}]},{id:"visits",icon:"event",label:"Visites",type:"item",sortHint:"0130",callbackFn:()=>navigateToEcapWithoutClosingWithCip("CONSULTA_VISITES")},{id:"visor",icon:"window",label:"Visor",type:"item",sortHint:"0140",callbackFn:()=>{}}],registerUpperNavMenuViews=()=>{for(const te of upperNavMenuItems)shellApi.regionManager.registerView(shellRegions.navigationMenu,{id:te.id,sortHint:te.sortHint,factory:()=>{const J=te.type==="item"?new PrimariaNavItem({icon:te.icon,label:te.label,callbackFn:te.callbackFn}):new PrimariaNavTreeMenu({icon:te.icon,label:te.label,actionMenuItems:te.actionMenuItems});return Promise.resolve(J)}})},registerMainViews=()=>{registerPDFVisorMainView()},useInternalViews=()=>{registerMainViews(),registerUpperNavMenuViews(),registerLowerNavMenuViews()},useUI=()=>{p$h.registerAdapterFactory("primaria-content-switcher",d$v),useSharedUI(),useComponents(),useInternalViews()},initializeShell=te=>{useLocalization(shellApi),useUI(),useFeatures(shellApi);const J=new PrimariaShell;te.appendChild(J)};class n extends HTMLElement{constructor(J,X,re={}){super(),this.jsx=J,this.styles=X,this.root=this.attachShadow({mode:"open"}),this.reactRoot=null,re&&(this.props=re)}connectedCallback(){const J=document.createElement("div");J.style.minHeight="100%",J.style.width="100%";const X=document.createElement("style");X.innerText=this.styles,this.root.appendChild(J),this.root.appendChild(X),this.reactRoot=r$N.createRoot(J),this.renderReact()}disconnectedCallback(){this.reactRoot&&this.reactRoot.unmount()}renderReact(){this.reactRoot&&this.reactRoot.render(c$v.createElement(this.jsx,{...this.props}))}}customElements.define("ux-react-web-component",n);const h=(te,J)=>(X={})=>Promise.resolve(new n(te,J,X));/**
|
|
6677
6700
|
* @license
|
|
6678
6701
|
* Copyright 2021 Google LLC
|
|
6679
6702
|
* SPDX-License-Identifier: BSD-3-Clause
|