diff --git a/.github/workflows/test-instance.yml b/.github/workflows/test-instance.yml index bbe3540db9..7e78929fcf 100644 --- a/.github/workflows/test-instance.yml +++ b/.github/workflows/test-instance.yml @@ -10,6 +10,9 @@ jobs: matrix: python-version: ['3.10'] + env: + SKIP_SERVER_INSTALL: true + services: mongodb: image: mongo:6 @@ -44,7 +47,5 @@ jobs: run: | python manage.py app:initialize_data python manage.py users:create -u admin -p admin -e admin@example.com --admin - # python manage.py data:upgrade # until we decide what to do + python manage.py data:upgrade python manage.py schema:migrate - - diff --git a/superdesk/data_updates/00000_20160610-164730_content_templates.py b/superdesk/data_updates/00000_20160610-164730_content_templates.py deleted file mode 100644 index 850e348999..0000000000 --- a/superdesk/data_updates/00000_20160610-164730_content_templates.py +++ /dev/null @@ -1,65 +0,0 @@ -# -*- coding: utf-8; -*- -# This file is part of Superdesk. -# For the full copyright and license information, please see the -# AUTHORS and LICENSE files distributed with this source code, or -# at https://www.sourcefabric.org/superdesk/license -# -# Author : edouard -# Creation: 2016-06-10 11:10 - -from superdesk.commands.data_updates import BaseDataUpdate - - -class DataUpdate(BaseDataUpdate): - """ - - Data update for Pull Request #418 - - SD-3487 As a user I want to be able to use a template in several desks - https://github.com/superdesk/superdesk-core/pull/418 - - - Changes: - - 1. `template_desks` added and is a list of desks, initialized with desk `template_desk` - 2. `template_stage` renamed by `schedule_stage` - 3. `template_desk` renamed by `schedule_desk` - - """ - - resource = "content_templates" - - def forwards(self, mongodb_collection, mongodb_database): - # new `template_desks` field must contain a list of desk id - for template in mongodb_collection.find({}): - if template.get("template_desk"): - print( - mongodb_collection.update( - {"_id": template["_id"]}, {"$set": {"template_desks": [template.get("template_desk")]}} - ) - ) - # renames fields: - # - template_desk -> schedule_desk - # - template_stage -> schedule_stage - print( - mongodb_collection.update( - {}, - { - "$rename": {"template_desk": "schedule_desk", "template_stage": "schedule_stage"}, - }, - upsert=False, - multi=True, - ) - ) - - def backwards(self, mongodb_collection, mongodb_database): - print( - mongodb_collection.update( - {}, - { - "$rename": {"schedule_desk": "template_desk", "schedule_stage": "template_stage"}, - }, - upsert=False, - multi=True, - ) - ) diff --git a/superdesk/data_updates/00001_20160722-111630_users.py b/superdesk/data_updates/00001_20160722-111630_users.py deleted file mode 100644 index 03e50306d8..0000000000 --- a/superdesk/data_updates/00001_20160722-111630_users.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8; -*- -# This file is part of Superdesk. -# For the full copyright and license information, please see the -# AUTHORS and LICENSE files distributed with this source code, or -# at https://www.sourcefabric.org/superdesk/license -# -# Author : sdesk -# Creation: 2016-07-22 11:16 - -from superdesk.commands.data_updates import BaseDataUpdate -from superdesk import get_resource_service -from superdesk.resource_fields import ID_FIELD - - -class DataUpdate(BaseDataUpdate): - """Updates the user collection with invisible stages. - - Refer to https://dev.sourcefabric.org/browse/SD-5077 for more information - """ - - resource = "users" - - def forwards(self, mongodb_collection, mongodb_database): - for user in mongodb_collection.find({}): - stages = get_resource_service(self.resource).get_invisible_stages_ids(user.get(ID_FIELD)) - print(mongodb_collection.update({"_id": user.get(ID_FIELD)}, {"$set": {"invisible_stages": stages}})) - - def backwards(self, mongodb_collection, mongodb_database): - print(mongodb_collection.update({}, {"$unset": {"invisible_stages": []}}, upsert=False, multi=True)) diff --git a/superdesk/data_updates/00002_20170214-145336_vocabularies.py b/superdesk/data_updates/00002_20170214-145336_vocabularies.py deleted file mode 100644 index 28970beb38..0000000000 --- a/superdesk/data_updates/00002_20170214-145336_vocabularies.py +++ /dev/null @@ -1,35 +0,0 @@ -# -*- coding: utf-8; -*- -# This file is part of Superdesk. -# For the full copyright and license information, please see the -# AUTHORS and LICENSE files distributed with this source code, or -# at https://www.sourcefabric.org/superdesk/license -# -# Author : superdesk -# Creation: 2017-02-14 14:53 - -from superdesk.commands.data_updates import BaseDataUpdate -from superdesk import get_resource_service - - -class DataUpdate(BaseDataUpdate): - resource = "vocabularies" - product_types = { - "_id": "product_types", - "display_name": "Product Types", - "type": "unmanageable", - "items": [ - {"is_active": True, "name": "API", "qcode": "api"}, - {"is_active": True, "name": "Direct", "qcode": "direct"}, - {"is_active": True, "name": "Both", "qcode": "both"}, - ], - } - - def forwards(self, mongodb_collection, mongodb_database): - product_types = get_resource_service(self.resource).find_one(req=None, _id="product_types") - if product_types: - print("Product Types vocabulary already exists in the system.") - return - get_resource_service(self.resource).post([self.product_types]) - - def backwards(self, mongodb_collection, mongodb_database): - get_resource_service(self.resource).delete_action({"_id": "product_types"}) diff --git a/superdesk/data_updates/00003_20170814-114652_audit.py b/superdesk/data_updates/00003_20170814-114652_audit.py deleted file mode 100644 index dcd207cf89..0000000000 --- a/superdesk/data_updates/00003_20170814-114652_audit.py +++ /dev/null @@ -1,37 +0,0 @@ -# -*- coding: utf-8; -*- -# This file is part of Superdesk. -# For the full copyright and license information, please see the -# AUTHORS and LICENSE files distributed with this source code, or -# at https://www.sourcefabric.org/superdesk/license -# -# Author : superdesk -# Creation: 2017-08-14 11:47 - -from superdesk.core import get_current_app -from superdesk.commands.data_updates import BaseDataUpdate -from superdesk import get_resource_service -from superdesk.factory.app import create_index -from superdesk.audit.commands import PurgeAudit -from superdesk.resource_fields import ID_FIELD - - -class DataUpdate(BaseDataUpdate): - resource = "audit" - - def forwards(self, mongodb_collection, mongodb_database): - for audit in mongodb_collection.find({"resource": {"$in": PurgeAudit.item_resources}}): - audit_id = get_resource_service(self.resource)._extract_doc_id(audit.get("extra")) - print(mongodb_collection.update({"_id": audit.get(ID_FIELD)}, {"$set": {"audit_id": audit_id}})) - try: - create_index( - app=get_current_app(), - resource=self.resource, - name="audit_id", - list_of_keys=[("audit_id", 1)], - index_options={"background": True}, - ) - except Exception: - print("create index failed") - - def backwards(self, mongodb_collection, mongodb_database): - print(mongodb_collection.update({}, {"$unset": {"audit_id": []}}, upsert=False, multi=True)) diff --git a/superdesk/data_updates/00004_20170908-140205_users.py b/superdesk/data_updates/00004_20170908-140205_users.py deleted file mode 100644 index d607f45696..0000000000 --- a/superdesk/data_updates/00004_20170908-140205_users.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8; -*- -# This file is part of Superdesk. -# For the full copyright and license information, please see the -# AUTHORS and LICENSE files distributed with this source code, or -# at https://www.sourcefabric.org/superdesk/license -# -# Author : Jérôme -# Creation: 2017-09-08 14:02 - -from superdesk.commands.data_updates import BaseDataUpdate - - -class DataUpdate(BaseDataUpdate): - resource = "users" - - def forwards(self, mongodb_collection, mongodb_database): - # we want all existing users to be authors by default - print(mongodb_collection.update_many({"is_author": {"$exists": False}}, {"$set": {"is_author": True}})) - - def backwards(self, mongodb_collection, mongodb_database): - # author was not existing before the update, so we remove the value - print(mongodb_collection.update_many({}, {"$unset": {"is_author": ""}})) diff --git a/superdesk/data_updates/00005_20171023-152436_vocabularies.py b/superdesk/data_updates/00005_20171023-152436_vocabularies.py deleted file mode 100644 index 4d3e88d576..0000000000 --- a/superdesk/data_updates/00005_20171023-152436_vocabularies.py +++ /dev/null @@ -1,28 +0,0 @@ -# -*- coding: utf-8; -*- -# This file is part of Superdesk. -# For the full copyright and license information, please see the -# AUTHORS and LICENSE files distributed with this source code, or -# at https://www.sourcefabric.org/superdesk/license -# -# Author : Jérôme -# Creation: 2017-10-23 15:24 - -from superdesk.commands.data_updates import BaseDataUpdate - - -class DataUpdate(BaseDataUpdate): - resource = "vocabularies" - - def forwards(self, mongodb_collection, mongodb_database): - print( - mongodb_collection.update_many( - {"_id": {"$in": ["author_roles", "job_titles"]}}, {"$set": {"unique_field": "qcode"}} - ) - ) - - def backwards(self, mongodb_collection, mongodb_database): - print( - mongodb_collection.update_many( - {"_id": {"$in": ["author_roles", "job_titles"]}}, {"$unset": {"unique_field": "qcode"}} - ) - ) diff --git a/superdesk/data_updates/00005_20171110-170620_archive.py b/superdesk/data_updates/00005_20171110-170620_archive.py deleted file mode 100644 index 1c7c3582ec..0000000000 --- a/superdesk/data_updates/00005_20171110-170620_archive.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8; -*- -# This file is part of Superdesk. -# For the full copyright and license information, please see the -# AUTHORS and LICENSE files distributed with this source code, or -# at https://www.sourcefabric.org/superdesk/license -# -# Author : mugur -# Creation: 2017-11-10 17:06 - -from superdesk.commands.data_updates import BaseDataUpdate - - -class DataUpdate(BaseDataUpdate): - resource = "archive" - - def forwards(self, mongodb_collection, mongodb_database): - print("Please rebuild elastic index after upgrade") - - def backwards(self, mongodb_collection, mongodb_database): - pass diff --git a/superdesk/data_updates/00006_20171124-195408_content_types.py b/superdesk/data_updates/00006_20171124-195408_content_types.py deleted file mode 100644 index 85c1ac5da5..0000000000 --- a/superdesk/data_updates/00006_20171124-195408_content_types.py +++ /dev/null @@ -1,54 +0,0 @@ -# -*- coding: utf-8; -*- -# This file is part of Superdesk. -# For the full copyright and license information, please see the -# AUTHORS and LICENSE files distributed with this source code, or -# at https://www.sourcefabric.org/superdesk/license -# -# Author : mugur -# Creation: 2017-11-24 19:54 - -from copy import deepcopy -from superdesk.commands.data_updates import BaseDataUpdate -from superdesk.resource_fields import ID_FIELD - - -class DataUpdate(BaseDataUpdate): - replace_values_forward = { - "picture": "media", - "unorderedlist": "unordered list", - "orderedlist": "ordered list", - "anchor": "link", - "removeFormat": None, - } - replace_values_backward = { - "media": "picture", - "unordered list": "unorderedlist", - "ordered list": "orderedlist", - "link": "anchor", - } - - resource = "content_types" - - def forwards(self, mongodb_collection, mongodb_database): - self._process_content_type(mongodb_collection, self.replace_values_forward) - - def backwards(self, mongodb_collection, mongodb_database): - self._process_content_type(self.replace_values_backward) - - def _process_content_type(self, mongodb_collection, replace_values): - for content_type in mongodb_collection.find({}): - if "editor" not in content_type: - continue - original_editor = deepcopy(content_type["editor"]) - for field, description in content_type["editor"].items(): - if description and description.get("formatOptions"): - for original, new in replace_values.items(): - if original in description["formatOptions"]: - description["formatOptions"].remove(original) - if new: - description["formatOptions"].append(new) - if original_editor != content_type["editor"]: - print("update editor in content type", content_type["label"]) - mongodb_collection.update( - {"_id": content_type.get(ID_FIELD)}, {"$set": {"editor": content_type["editor"]}} - ) diff --git a/superdesk/data_updates/00007_20180321-092824_archive.dist.js b/superdesk/data_updates/00007_20180321-092824_archive.dist.js deleted file mode 100644 index 221d3ee4c3..0000000000 --- a/superdesk/data_updates/00007_20180321-092824_archive.dist.js +++ /dev/null @@ -1,33 +0,0 @@ -!function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=65)}([function(t,e,n){!function(e,n){t.exports=n()}(0,function(){"use strict";function t(t,e){e&&(t.prototype=Object.create(e.prototype)),t.prototype.constructor=t}function e(t){return i(t)?t:D(t)}function n(t){return a(t)?t:I(t)}function r(t){return u(t)?t:M(t)}function o(t){return i(t)&&!s(t)?t:A(t)}function i(t){return!(!t||!t[ln])}function a(t){return!(!t||!t[cn])}function u(t){return!(!t||!t[fn])}function s(t){return a(t)||u(t)}function l(t){return!(!t||!t[pn])}function c(t){return t.value=!1,t}function f(t){t&&(t.value=!0)}function p(){}function d(t,e){e=e||0;for(var n=Math.max(0,t.length-e),r=new Array(n),o=0;o>>0;if(""+n!==e||4294967295===n)return NaN;e=n}return e<0?h(t)+e:e}function y(){return!0}function v(t,e,n){return(0===t||void 0!==n&&t<=-n)&&(void 0===e||void 0!==n&&e>=n)}function m(t,e){return _(t,e,0)}function b(t,e){return _(t,e,e)}function _(t,e,n){return void 0===t?n:t<0?Math.max(0,e+t):void 0===e?t:Math.min(e,t)}function S(t){this.next=t}function w(t,e,n,r){var o=0===t?e:1===t?n:[e,n];return r?r.value=o:r={value:o,done:!1},r}function C(){return{value:void 0,done:!0}}function k(t){return!!O(t)}function x(t){return t&&"function"==typeof t.next}function E(t){var e=O(t);return e&&e.call(t)}function O(t){var e=t&&(wn&&t[wn]||t[Cn]);if("function"==typeof e)return e}function T(t){return t&&"number"==typeof t.length}function D(t){return null===t||void 0===t?F():i(t)?t.toSeq():z(t)}function I(t){return null===t||void 0===t?F().toKeyedSeq():i(t)?a(t)?t.toSeq():t.fromEntrySeq():B(t)}function M(t){return null===t||void 0===t?F():i(t)?a(t)?t.entrySeq():t.toIndexedSeq():U(t)}function A(t){return(null===t||void 0===t?F():i(t)?a(t)?t.entrySeq():t:U(t)).toSetSeq()}function N(t){this._array=t,this.size=t.length}function L(t){var e=Object.keys(t);this._object=t,this._keys=e,this.size=e.length}function K(t){this._iterable=t,this.size=t.length||t.size}function R(t){this._iterator=t,this._iteratorCache=[]}function P(t){return!(!t||!t[xn])}function F(){return En||(En=new N([]))}function B(t){var e=Array.isArray(t)?new N(t).fromEntrySeq():x(t)?new R(t).fromEntrySeq():k(t)?new K(t).fromEntrySeq():"object"==typeof t?new L(t):void 0;if(!e)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+t);return e}function U(t){var e=j(t);if(!e)throw new TypeError("Expected Array or iterable object of values: "+t);return e}function z(t){var e=j(t)||"object"==typeof t&&new L(t);if(!e)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+t);return e}function j(t){return T(t)?new N(t):x(t)?new R(t):k(t)?new K(t):void 0}function H(t,e,n,r){var o=t._cache;if(o){for(var i=o.length-1,a=0;a<=i;a++){var u=o[n?i-a:a];if(!1===e(u[1],r?u[0]:a,t))return a+1}return a}return t.__iterateUncached(e,n)}function V(t,e,n,r){var o=t._cache;if(o){var i=o.length-1,a=0;return new S(function(){var t=o[n?i-a:a];return a++>i?C():w(e,r?t[0]:a-1,t[1])})}return t.__iteratorUncached(e,n)}function q(t,e){return e?W(e,t,"",{"":t}):G(t)}function W(t,e,n,r){return Array.isArray(e)?t.call(r,n,M(e).map(function(n,r){return W(t,n,r,e)})):$(e)?t.call(r,n,I(e).map(function(n,r){return W(t,n,r,e)})):e}function G(t){return Array.isArray(t)?M(t).map(G).toList():$(t)?I(t).map(G).toMap():t}function $(t){return t&&(t.constructor===Object||void 0===t.constructor)}function X(t,e){if(t===e||t!==t&&e!==e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if(t=t.valueOf(),e=e.valueOf(),t===e||t!==t&&e!==e)return!0;if(!t||!e)return!1}return!("function"!=typeof t.equals||"function"!=typeof e.equals||!t.equals(e))}function J(t,e){if(t===e)return!0;if(!i(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||a(t)!==a(e)||u(t)!==u(e)||l(t)!==l(e))return!1;if(0===t.size&&0===e.size)return!0;var n=!s(t);if(l(t)){var r=t.entries();return e.every(function(t,e){var o=r.next().value;return o&&X(o[1],t)&&(n||X(o[0],e))})&&r.next().done}var o=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{o=!0;var c=t;t=e,e=c}var f=!0,p=e.__iterate(function(e,r){if(n?!t.has(e):o?!X(e,t.get(r,yn)):!X(t.get(r,yn),e))return f=!1,!1});return f&&t.size===p}function Q(t,e){if(!(this instanceof Q))return new Q(t,e);if(this._value=t,this.size=void 0===e?1/0:Math.max(0,e),0===this.size){if(On)return On;On=this}}function Y(t,e){if(!t)throw new Error(e)}function Z(t,e,n){if(!(this instanceof Z))return new Z(t,e,n);if(Y(0!==n,"Cannot step a Range by 0"),t=t||0,void 0===e&&(e=1/0),n=void 0===n?1:Math.abs(n),e>>1&1073741824|3221225471&t}function it(t){if(!1===t||null===t||void 0===t)return 0;if("function"==typeof t.valueOf&&(!1===(t=t.valueOf())||null===t||void 0===t))return 0;if(!0===t)return 1;var e=typeof t;if("number"===e){var n=0|t;for(n!==t&&(n^=4294967295*t);t>4294967295;)t/=4294967295,n^=t;return ot(n)}if("string"===e)return t.length>Rn?at(t):ut(t);if("function"==typeof t.hashCode)return t.hashCode();if("object"===e)return st(t);if("function"==typeof t.toString)return ut(t.toString());throw new Error("Value type "+e+" cannot be hashed.")}function at(t){var e=Bn[t];return void 0===e&&(e=ut(t),Fn===Pn&&(Fn=0,Bn={}),Fn++,Bn[t]=e),e}function ut(t){for(var e=0,n=0;n0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}function ct(t){Y(t!==1/0,"Cannot perform this action with an infinite size.")}function ft(t){return null===t||void 0===t?wt():pt(t)&&!l(t)?t:wt().withMutations(function(e){var r=n(t);ct(r.size),r.forEach(function(t,n){return e.set(n,t)})})}function pt(t){return!(!t||!t[Un])}function dt(t,e){this.ownerID=t,this.entries=e}function ht(t,e,n){this.ownerID=t,this.bitmap=e,this.nodes=n}function gt(t,e,n){this.ownerID=t,this.count=e,this.nodes=n}function yt(t,e,n){this.ownerID=t,this.keyHash=e,this.entries=n}function vt(t,e,n){this.ownerID=t,this.keyHash=e,this.entry=n}function mt(t,e,n){this._type=e,this._reverse=n,this._stack=t._root&&_t(t._root)}function bt(t,e){return w(t,e[0],e[1])}function _t(t,e){return{node:t,index:0,__prev:e}}function St(t,e,n,r){var o=Object.create(zn);return o.size=t,o._root=e,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function wt(){return jn||(jn=St(0))}function Ct(t,e,n){var r,o;if(t._root){var i=c(vn),a=c(mn);if(r=kt(t._root,t.__ownerID,0,void 0,e,n,i,a),!a.value)return t;o=t.size+(i.value?n===yn?-1:1:0)}else{if(n===yn)return t;o=1,r=new dt(t.__ownerID,[[e,n]])}return t.__ownerID?(t.size=o,t._root=r,t.__hash=void 0,t.__altered=!0,t):r?St(o,r):wt()}function kt(t,e,n,r,o,i,a,u){return t?t.update(e,n,r,o,i,a,u):i===yn?t:(f(u),f(a),new vt(e,r,[o,i]))}function xt(t){return t.constructor===vt||t.constructor===yt}function Et(t,e,n,r,o){if(t.keyHash===r)return new yt(e,r,[t.entry,o]);var i,a=(0===n?t.keyHash:t.keyHash>>>n)&gn,u=(0===n?r:r>>>n)&gn;return new ht(e,1<>>=1)a[u]=1&n?e[i++]:void 0;return a[r]=o,new gt(t,i+1,a)}function It(t,e,r){for(var o=[],a=0;a>1&1431655765,t=(858993459&t)+(t>>2&858993459),t=t+(t>>4)&252645135,t+=t>>8,127&(t+=t>>16)}function Rt(t,e,n,r){var o=r?t:d(t);return o[e]=n,o}function Pt(t,e,n,r){var o=t.length+1;if(r&&e+1===o)return t[e]=n,t;for(var i=new Array(o),a=0,u=0;u0&&oi?0:i-n,l=a-n;return l>hn&&(l=hn),function(){if(o===l)return Xn;var t=e?--l:o++;return r&&r[t]}}function o(t,r,o){var u,s=t&&t.array,l=o>i?0:i-o>>r,c=1+(a-o>>r);return c>hn&&(c=hn),function(){for(;;){if(u){var t=u();if(t!==Xn)return t;u=null}if(l===c)return Xn;var i=e?--c:l++;u=n(s&&s[i],r-dn,o+(i<=t.size||e<0)return t.withMutations(function(t){e<0?Xt(t,e).set(0,n):Xt(t,0,e+1).set(e,n)});e+=t._origin;var r=t._tail,o=t._root,i=c(mn);return e>=Qt(t._capacity)?r=Wt(r,t.__ownerID,0,e,n,i):o=Wt(o,t.__ownerID,t._level,e,n,i),i.value?t.__ownerID?(t._root=o,t._tail=r,t.__hash=void 0,t.__altered=!0,t):Ht(t._origin,t._capacity,t._level,o,r):t}function Wt(t,e,n,r,o,i){var a=r>>>n&gn,u=t&&a0){var l=t&&t.array[a],c=Wt(l,e,n-dn,r,o,i);return c===l?t:(s=Gt(t,e),s.array[a]=c,s)}return u&&t.array[a]===o?t:(f(i),s=Gt(t,e),void 0===o&&a===s.array.length-1?s.array.pop():s.array[a]=o,s)}function Gt(t,e){return e&&t&&e===t.ownerID?t:new zt(t?t.array.slice():[],e)}function $t(t,e){if(e>=Qt(t._capacity))return t._tail;if(e<1<0;)n=n.array[e>>>r&gn],r-=dn;return n}}function Xt(t,e,n){void 0!==e&&(e|=0),void 0!==n&&(n|=0);var r=t.__ownerID||new p,o=t._origin,i=t._capacity,a=o+e,u=void 0===n?i:n<0?i+n:o+n;if(a===o&&u===i)return t;if(a>=u)return t.clear();for(var s=t._level,l=t._root,c=0;a+c<0;)l=new zt(l&&l.array.length?[void 0,l]:[],r),s+=dn,c+=1<=1<f?new zt([],r):h;if(h&&d>f&&adn;v-=dn){var m=f>>>v&gn;y=y.array[m]=Gt(y.array[m],r)}y.array[f>>>dn&gn]=h}if(u=d)a-=d,u-=d,s=dn,l=null,g=g&&g.removeBefore(r,0,a);else if(a>o||d>>s&gn;if(b!==d>>>s&gn)break;b&&(c+=(1<o&&(l=l.removeBefore(r,s,a-c)),l&&da&&(a=l.size),i(s)||(l=l.map(function(t){return q(t)})),o.push(l)}return a>t.size&&(t=t.setSize(a)),Nt(t,e,o)}function Qt(t){return t>>dn<=hn&&a.size>=2*i.size?(o=a.filter(function(t,e){return void 0!==t&&u!==e}),r=o.toKeyedSeq().map(function(t){return t[0]}).flip().toMap(),t.__ownerID&&(r.__ownerID=o.__ownerID=t.__ownerID)):(r=i.remove(e),o=u===a.size-1?a.pop():a.set(u,void 0))}else if(s){if(n===a.get(u)[1])return t;r=i,o=a.set(u,[e,n])}else r=i.set(e,a.size),o=a.set(a.size,[e,n]);return t.__ownerID?(t.size=r.size,t._map=r,t._list=o,t.__hash=void 0,t):te(r,o)}function re(t,e){this._iter=t,this._useKeys=e,this.size=t.size}function oe(t){this._iter=t,this.size=t.size}function ie(t){this._iter=t,this.size=t.size}function ae(t){this._iter=t,this.size=t.size}function ue(t){var e=Te(t);return e._iter=t,e.size=t.size,e.flip=function(){return t},e.reverse=function(){var e=t.reverse.apply(this);return e.flip=function(){return t.reverse()},e},e.has=function(e){return t.includes(e)},e.includes=function(e){return t.has(e)},e.cacheResult=De,e.__iterateUncached=function(e,n){var r=this;return t.__iterate(function(t,n){return!1!==e(n,t,r)},n)},e.__iteratorUncached=function(e,n){if(e===Sn){var r=t.__iterator(e,n);return new S(function(){var t=r.next();if(!t.done){var e=t.value[0];t.value[0]=t.value[1],t.value[1]=e}return t})}return t.__iterator(e===_n?bn:_n,n)},e}function se(t,e,n){var r=Te(t);return r.size=t.size,r.has=function(e){return t.has(e)},r.get=function(r,o){var i=t.get(r,yn);return i===yn?o:e.call(n,i,r,t)},r.__iterateUncached=function(r,o){var i=this;return t.__iterate(function(t,o,a){return!1!==r(e.call(n,t,o,a),o,i)},o)},r.__iteratorUncached=function(r,o){var i=t.__iterator(Sn,o);return new S(function(){var o=i.next();if(o.done)return o;var a=o.value,u=a[0];return w(r,u,e.call(n,a[1],u,t),o)})},r}function le(t,e){var n=Te(t);return n._iter=t,n.size=t.size,n.reverse=function(){return t},t.flip&&(n.flip=function(){var e=ue(t);return e.reverse=function(){return t.flip()},e}),n.get=function(n,r){return t.get(e?n:-1-n,r)},n.has=function(n){return t.has(e?n:-1-n)},n.includes=function(e){return t.includes(e)},n.cacheResult=De,n.__iterate=function(e,n){var r=this;return t.__iterate(function(t,n){return e(t,n,r)},!n)},n.__iterator=function(e,n){return t.__iterator(e,!n)},n}function ce(t,e,n,r){var o=Te(t);return r&&(o.has=function(r){var o=t.get(r,yn);return o!==yn&&!!e.call(n,o,r,t)},o.get=function(r,o){var i=t.get(r,yn);return i!==yn&&e.call(n,i,r,t)?i:o}),o.__iterateUncached=function(o,i){var a=this,u=0;return t.__iterate(function(t,i,s){if(e.call(n,t,i,s))return u++,o(t,r?i:u-1,a)},i),u},o.__iteratorUncached=function(o,i){var a=t.__iterator(Sn,i),u=0;return new S(function(){for(;;){var i=a.next();if(i.done)return i;var s=i.value,l=s[0],c=s[1];if(e.call(n,c,l,t))return w(o,r?l:u++,c,i)}})},o}function fe(t,e,n){var r=ft().asMutable();return t.__iterate(function(o,i){r.update(e.call(n,o,i,t),0,function(t){return t+1})}),r.asImmutable()}function pe(t,e,n){var r=a(t),o=(l(t)?Yt():ft()).asMutable();t.__iterate(function(i,a){o.update(e.call(n,i,a,t),function(t){return t=t||[],t.push(r?[a,i]:i),t})});var i=Oe(t);return o.map(function(e){return ke(t,i(e))})}function de(t,e,n,r){var o=t.size;if(void 0!==e&&(e|=0),void 0!==n&&(n|=0),v(e,n,o))return t;var i=m(e,o),a=b(n,o);if(i!==i||a!==a)return de(t.toSeq().cacheResult(),e,n,r);var u,s=a-i;s===s&&(u=s<0?0:s);var l=Te(t);return l.size=0===u?u:t.size&&u||void 0,!r&&P(t)&&u>=0&&(l.get=function(e,n){return e=g(this,e),e>=0&&eu)return C();var t=o.next();return r||e===_n?t:e===bn?w(e,s-1,void 0,t):w(e,s-1,t.value[1],t)})},l}function he(t,e,n){var r=Te(t);return r.__iterateUncached=function(r,o){var i=this;if(o)return this.cacheResult().__iterate(r,o);var a=0;return t.__iterate(function(t,o,u){return e.call(n,t,o,u)&&++a&&r(t,o,i)}),a},r.__iteratorUncached=function(r,o){var i=this;if(o)return this.cacheResult().__iterator(r,o);var a=t.__iterator(Sn,o),u=!0;return new S(function(){if(!u)return C();var t=a.next();if(t.done)return t;var o=t.value,s=o[0],l=o[1];return e.call(n,l,s,i)?r===Sn?t:w(r,s,l,t):(u=!1,C())})},r}function ge(t,e,n,r){var o=Te(t);return o.__iterateUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterate(o,i);var u=!0,s=0;return t.__iterate(function(t,i,l){if(!u||!(u=e.call(n,t,i,l)))return s++,o(t,r?i:s-1,a)}),s},o.__iteratorUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterator(o,i);var u=t.__iterator(Sn,i),s=!0,l=0;return new S(function(){var t,i,c;do{if(t=u.next(),t.done)return r||o===_n?t:o===bn?w(o,l++,void 0,t):w(o,l++,t.value[1],t);var f=t.value;i=f[0],c=f[1],s&&(s=e.call(n,c,i,a))}while(s);return o===Sn?t:w(o,i,c,t)})},o}function ye(t,e){var r=a(t),o=[t].concat(e).map(function(t){return i(t)?r&&(t=n(t)):t=r?B(t):U(Array.isArray(t)?t:[t]),t}).filter(function(t){return 0!==t.size});if(0===o.length)return t;if(1===o.length){var s=o[0];if(s===t||r&&a(s)||u(t)&&u(s))return s}var l=new N(o);return r?l=l.toKeyedSeq():u(t)||(l=l.toSetSeq()),l=l.flatten(!0),l.size=o.reduce(function(t,e){if(void 0!==t){var n=e.size;if(void 0!==n)return t+n}},0),l}function ve(t,e,n){var r=Te(t);return r.__iterateUncached=function(r,o){function a(t,l){var c=this;t.__iterate(function(t,o){return(!e||l0}function Ce(t,n,r){var o=Te(t);return o.size=new N(r).map(function(t){return t.size}).min(),o.__iterate=function(t,e){for(var n,r=this.__iterator(_n,e),o=0;!(n=r.next()).done&&!1!==t(n.value,o++,this););return o},o.__iteratorUncached=function(t,o){var i=r.map(function(t){return t=e(t),E(o?t.reverse():t)}),a=0,u=!1;return new S(function(){var e;return u||(e=i.map(function(t){return t.next()}),u=e.some(function(t){return t.done})),u?C():w(t,a++,n.apply(null,e.map(function(t){return t.value})))})},o}function ke(t,e){return P(t)?e:t.constructor(e)}function xe(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function Ee(t){return ct(t.size),h(t)}function Oe(t){return a(t)?n:u(t)?r:o}function Te(t){return Object.create((a(t)?I:u(t)?M:A).prototype)}function De(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):D.prototype.cacheResult.call(this)}function Ie(t,e){return t>e?1:te?-1:0}function on(t){if(t.size===1/0)return 0;var e=l(t),n=a(t),r=e?1:0;return an(t.__iterate(n?e?function(t,e){r=31*r+un(it(t),it(e))|0}:function(t,e){r=r+un(it(t),it(e))|0}:e?function(t){r=31*r+it(t)|0}:function(t){r=r+it(t)|0}),r)}function an(t,e){return e=In(e,3432918353),e=In(e<<15|e>>>-15,461845907),e=In(e<<13|e>>>-13,5),e=(e+3864292196|0)^t,e=In(e^e>>>16,2246822507),e=In(e^e>>>13,3266489909),e=ot(e^e>>>16)}function un(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}var sn=Array.prototype.slice;t(n,e),t(r,e),t(o,e),e.isIterable=i,e.isKeyed=a,e.isIndexed=u,e.isAssociative=s,e.isOrdered=l,e.Keyed=n,e.Indexed=r,e.Set=o;var ln="@@__IMMUTABLE_ITERABLE__@@",cn="@@__IMMUTABLE_KEYED__@@",fn="@@__IMMUTABLE_INDEXED__@@",pn="@@__IMMUTABLE_ORDERED__@@",dn=5,hn=1<r?C():w(t,o,n[e?r-o++:o++])})},t(L,I),L.prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},L.prototype.has=function(t){return this._object.hasOwnProperty(t)},L.prototype.__iterate=function(t,e){for(var n=this._object,r=this._keys,o=r.length-1,i=0;i<=o;i++){var a=r[e?o-i:i];if(!1===t(n[a],a,this))return i+1}return i},L.prototype.__iterator=function(t,e){var n=this._object,r=this._keys,o=r.length-1,i=0;return new S(function(){var a=r[e?o-i:i];return i++>o?C():w(t,a,n[a])})},L.prototype[pn]=!0,t(K,M),K.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);var n=this._iterable,r=E(n),o=0;if(x(r))for(var i;!(i=r.next()).done&&!1!==t(i.value,o++,this););return o},K.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var n=this._iterable,r=E(n);if(!x(r))return new S(C);var o=0;return new S(function(){var e=r.next();return e.done?e:w(t,o++,e.value)})},t(R,M),R.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);for(var n=this._iterator,r=this._iteratorCache,o=0;o=r.length){var e=n.next();if(e.done)return e;r[o]=e.value}return w(t,o,r[o++])})};var En;t(Q,M),Q.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},Q.prototype.get=function(t,e){return this.has(t)?this._value:e},Q.prototype.includes=function(t){return X(this._value,t)},Q.prototype.slice=function(t,e){var n=this.size;return v(t,e,n)?this:new Q(this._value,b(e,n)-m(t,n))},Q.prototype.reverse=function(){return this},Q.prototype.indexOf=function(t){return X(this._value,t)?0:-1},Q.prototype.lastIndexOf=function(t){return X(this._value,t)?this.size:-1},Q.prototype.__iterate=function(t,e){for(var n=0;n1?" by "+this._step:"")+" ]"},Z.prototype.get=function(t,e){return this.has(t)?this._start+g(this,t)*this._step:e},Z.prototype.includes=function(t){var e=(t-this._start)/this._step;return e>=0&&e=0&&nn?C():w(t,i++,a)})},Z.prototype.equals=function(t){return t instanceof Z?this._start===t._start&&this._end===t._end&&this._step===t._step:J(this,t)};var Tn;t(tt,e),t(et,tt),t(nt,tt),t(rt,tt),tt.Keyed=et,tt.Indexed=nt,tt.Set=rt;var Dn,In="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){t|=0,e|=0;var n=65535&t,r=65535&e;return n*r+((t>>>16)*r+n*(e>>>16)<<16>>>0)|0},Mn=Object.isExtensible,An=function(){try{return Object.defineProperty({},"@",{}),!0}catch(t){return!1}}(),Nn="function"==typeof WeakMap;Nn&&(Dn=new WeakMap);var Ln=0,Kn="__immutablehash__";"function"==typeof Symbol&&(Kn=Symbol(Kn));var Rn=16,Pn=255,Fn=0,Bn={};t(ft,et),ft.prototype.toString=function(){return this.__toString("Map {","}")},ft.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},ft.prototype.set=function(t,e){return Ct(this,t,e)},ft.prototype.setIn=function(t,e){return this.updateIn(t,yn,function(){return e})},ft.prototype.remove=function(t){return Ct(this,t,yn)},ft.prototype.deleteIn=function(t){return this.updateIn(t,function(){return yn})},ft.prototype.update=function(t,e,n){return 1===arguments.length?t(this):this.updateIn([t],e,n)},ft.prototype.updateIn=function(t,e,n){n||(n=e,e=void 0);var r=Lt(this,Me(t),e,n);return r===yn?void 0:r},ft.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):wt()},ft.prototype.merge=function(){return It(this,void 0,arguments)},ft.prototype.mergeWith=function(t){return It(this,t,sn.call(arguments,1))},ft.prototype.mergeIn=function(t){var e=sn.call(arguments,1);return this.updateIn(t,wt(),function(t){return"function"==typeof t.merge?t.merge.apply(t,e):e[e.length-1]})},ft.prototype.mergeDeep=function(){return It(this,Mt,arguments)},ft.prototype.mergeDeepWith=function(t){var e=sn.call(arguments,1);return It(this,At(t),e)},ft.prototype.mergeDeepIn=function(t){var e=sn.call(arguments,1);return this.updateIn(t,wt(),function(t){return"function"==typeof t.mergeDeep?t.mergeDeep.apply(t,e):e[e.length-1]})},ft.prototype.sort=function(t){return Yt(_e(this,t))},ft.prototype.sortBy=function(t,e){return Yt(_e(this,e,t))},ft.prototype.withMutations=function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},ft.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new p)},ft.prototype.asImmutable=function(){return this.__ensureOwner()},ft.prototype.wasAltered=function(){return this.__altered},ft.prototype.__iterator=function(t,e){return new mt(this,t,e)},ft.prototype.__iterate=function(t,e){var n=this,r=0;return this._root&&this._root.iterate(function(e){return r++,t(e[1],e[0],n)},e),r},ft.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?St(this.size,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},ft.isMap=pt;var Un="@@__IMMUTABLE_MAP__@@",zn=ft.prototype;zn[Un]=!0,zn.delete=zn.remove,zn.removeIn=zn.deleteIn,dt.prototype.get=function(t,e,n,r){for(var o=this.entries,i=0,a=o.length;i=Hn)return Ot(t,s,r,o);var h=t&&t===this.ownerID,g=h?s:d(s);return p?u?l===c-1?g.pop():g[l]=g.pop():g[l]=[r,o]:g.push([r,o]),h?(this.entries=g,this):new dt(t,g)}},ht.prototype.get=function(t,e,n,r){void 0===e&&(e=it(n));var o=1<<((0===t?e:e>>>t)&gn),i=this.bitmap;return 0==(i&o)?r:this.nodes[Kt(i&o-1)].get(t+dn,e,n,r)},ht.prototype.update=function(t,e,n,r,o,i,a){void 0===n&&(n=it(r));var u=(0===e?n:n>>>e)&gn,s=1<=Vn)return Dt(t,p,l,u,h);if(c&&!h&&2===p.length&&xt(p[1^f]))return p[1^f];if(c&&h&&1===p.length&&xt(h))return h;var g=t&&t===this.ownerID,y=c?h?l:l^s:l|s,v=c?h?Rt(p,f,h,g):Ft(p,f,g):Pt(p,f,h,g);return g?(this.bitmap=y,this.nodes=v,this):new ht(t,y,v)},gt.prototype.get=function(t,e,n,r){void 0===e&&(e=it(n));var o=(0===t?e:e>>>t)&gn,i=this.nodes[o];return i?i.get(t+dn,e,n,r):r},gt.prototype.update=function(t,e,n,r,o,i,a){void 0===n&&(n=it(r));var u=(0===e?n:n>>>e)&gn,s=o===yn,l=this.nodes,c=l[u];if(s&&!c)return this;var f=kt(c,t,e+dn,n,r,o,i,a);if(f===c)return this;var p=this.count;if(c){if(!f&&--p=0&&t>>e&gn;if(r>=this.array.length)return new zt([],t);var o,i=0===r;if(e>0){var a=this.array[r];if((o=a&&a.removeBefore(t,e-dn,n))===a&&i)return this}if(i&&!o)return this;var u=Gt(this,t);if(!i)for(var s=0;s>>e&gn;if(r>=this.array.length)return this;var o;if(e>0){var i=this.array[r];if((o=i&&i.removeAfter(t,e-dn,n))===i&&r===this.array.length-1)return this}var a=Gt(this,t);return a.array.splice(r+1),o&&(a.array[r]=o),a};var $n,Xn={};t(Yt,ft),Yt.of=function(){return this(arguments)},Yt.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Yt.prototype.get=function(t,e){var n=this._map.get(t);return void 0!==n?this._list.get(n)[1]:e},Yt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):ee()},Yt.prototype.set=function(t,e){return ne(this,t,e)},Yt.prototype.remove=function(t){return ne(this,t,yn)},Yt.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Yt.prototype.__iterate=function(t,e){var n=this;return this._list.__iterate(function(e){return e&&t(e[1],e[0],n)},e)},Yt.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},Yt.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),n=this._list.__ensureOwner(t);return t?te(e,n,t,this.__hash):(this.__ownerID=t,this._map=e,this._list=n,this)},Yt.isOrderedMap=Zt,Yt.prototype[pn]=!0,Yt.prototype.delete=Yt.prototype.remove;var Jn;t(re,I),re.prototype.get=function(t,e){return this._iter.get(t,e)},re.prototype.has=function(t){return this._iter.has(t)},re.prototype.valueSeq=function(){return this._iter.valueSeq()},re.prototype.reverse=function(){var t=this,e=le(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},re.prototype.map=function(t,e){var n=this,r=se(this,t,e);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(t,e)}),r},re.prototype.__iterate=function(t,e){var n,r=this;return this._iter.__iterate(this._useKeys?function(e,n){return t(e,n,r)}:(n=e?Ee(this):0,function(o){return t(o,e?--n:n++,r)}),e)},re.prototype.__iterator=function(t,e){if(this._useKeys)return this._iter.__iterator(t,e);var n=this._iter.__iterator(_n,e),r=e?Ee(this):0;return new S(function(){var o=n.next();return o.done?o:w(t,e?--r:r++,o.value,o)})},re.prototype[pn]=!0,t(oe,M),oe.prototype.includes=function(t){return this._iter.includes(t)},oe.prototype.__iterate=function(t,e){var n=this,r=0;return this._iter.__iterate(function(e){return t(e,r++,n)},e)},oe.prototype.__iterator=function(t,e){var n=this._iter.__iterator(_n,e),r=0;return new S(function(){var e=n.next();return e.done?e:w(t,r++,e.value,e)})},t(ie,A),ie.prototype.has=function(t){return this._iter.includes(t)},ie.prototype.__iterate=function(t,e){var n=this;return this._iter.__iterate(function(e){return t(e,e,n)},e)},ie.prototype.__iterator=function(t,e){var n=this._iter.__iterator(_n,e);return new S(function(){var e=n.next();return e.done?e:w(t,e.value,e.value,e)})},t(ae,I),ae.prototype.entrySeq=function(){return this._iter.toSeq()},ae.prototype.__iterate=function(t,e){var n=this;return this._iter.__iterate(function(e){if(e){xe(e);var r=i(e);return t(r?e.get(1):e[1],r?e.get(0):e[0],n)}},e)},ae.prototype.__iterator=function(t,e){var n=this._iter.__iterator(_n,e);return new S(function(){for(;;){var e=n.next();if(e.done)return e;var r=e.value;if(r){xe(r);var o=i(r);return w(t,o?r.get(0):r[0],o?r.get(1):r[1],e)}}})},oe.prototype.cacheResult=re.prototype.cacheResult=ie.prototype.cacheResult=ae.prototype.cacheResult=De,t(Ae,et),Ae.prototype.toString=function(){return this.__toString(Le(this)+" {","}")},Ae.prototype.has=function(t){return this._defaultValues.hasOwnProperty(t)},Ae.prototype.get=function(t,e){if(!this.has(t))return e;var n=this._defaultValues[t];return this._map?this._map.get(t,n):n},Ae.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var t=this.constructor;return t._empty||(t._empty=Ne(this,wt()))},Ae.prototype.set=function(t,e){if(!this.has(t))throw new Error('Cannot set unknown key "'+t+'" on '+Le(this));var n=this._map&&this._map.set(t,e);return this.__ownerID||n===this._map?this:Ne(this,n)},Ae.prototype.remove=function(t){if(!this.has(t))return this;var e=this._map&&this._map.remove(t);return this.__ownerID||e===this._map?this:Ne(this,e)},Ae.prototype.wasAltered=function(){return this._map.wasAltered()},Ae.prototype.__iterator=function(t,e){var r=this;return n(this._defaultValues).map(function(t,e){return r.get(e)}).__iterator(t,e)},Ae.prototype.__iterate=function(t,e){var r=this;return n(this._defaultValues).map(function(t,e){return r.get(e)}).__iterate(t,e)},Ae.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map&&this._map.__ensureOwner(t);return t?Ne(this,e,t):(this.__ownerID=t,this._map=e,this)};var Qn=Ae.prototype;Qn.delete=Qn.remove,Qn.deleteIn=Qn.removeIn=zn.removeIn,Qn.merge=zn.merge,Qn.mergeWith=zn.mergeWith,Qn.mergeIn=zn.mergeIn,Qn.mergeDeep=zn.mergeDeep,Qn.mergeDeepWith=zn.mergeDeepWith,Qn.mergeDeepIn=zn.mergeDeepIn,Qn.setIn=zn.setIn,Qn.update=zn.update,Qn.updateIn=zn.updateIn,Qn.withMutations=zn.withMutations,Qn.asMutable=zn.asMutable,Qn.asImmutable=zn.asImmutable,t(Pe,rt),Pe.of=function(){return this(arguments)},Pe.fromKeys=function(t){return this(n(t).keySeq())},Pe.prototype.toString=function(){return this.__toString("Set {","}")},Pe.prototype.has=function(t){return this._map.has(t)},Pe.prototype.add=function(t){return Be(this,this._map.set(t,!0))},Pe.prototype.remove=function(t){return Be(this,this._map.remove(t))},Pe.prototype.clear=function(){return Be(this,this._map.clear())},Pe.prototype.union=function(){var t=sn.call(arguments,0);return t=t.filter(function(t){return 0!==t.size}),0===t.length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations(function(e){for(var n=0;n=0;n--)e={value:arguments[n],next:e};return this.__ownerID?(this.size=t,this._head=e,this.__hash=void 0,this.__altered=!0,this):$e(t,e)},We.prototype.pushAll=function(t){if(t=r(t),0===t.size)return this;ct(t.size);var e=this.size,n=this._head;return t.reverse().forEach(function(t){e++,n={value:t,next:n}}),this.__ownerID?(this.size=e,this._head=n,this.__hash=void 0,this.__altered=!0,this):$e(e,n)},We.prototype.pop=function(){return this.slice(1)},We.prototype.unshift=function(){return this.push.apply(this,arguments)},We.prototype.unshiftAll=function(t){return this.pushAll(t)},We.prototype.shift=function(){return this.pop.apply(this,arguments)},We.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Xe()},We.prototype.slice=function(t,e){if(v(t,e,this.size))return this;var n=m(t,this.size);if(b(e,this.size)!==this.size)return nt.prototype.slice.call(this,t,e);for(var r=this.size-n,o=this._head;n--;)o=o.next;return this.__ownerID?(this.size=r,this._head=o,this.__hash=void 0,this.__altered=!0,this):$e(r,o)},We.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?$e(this.size,this._head,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},We.prototype.__iterate=function(t,e){if(e)return this.reverse().__iterate(t);for(var n=0,r=this._head;r&&!1!==t(r.value,n++,this);)r=r.next;return n},We.prototype.__iterator=function(t,e){if(e)return this.reverse().__iterator(t);var n=0,r=this._head;return new S(function(){if(r){var e=r.value;return r=r.next,w(t,n++,e)}return C()})},We.isStack=Ge;var rr="@@__IMMUTABLE_STACK__@@",or=We.prototype;or[rr]=!0,or.withMutations=zn.withMutations,or.asMutable=zn.asMutable,or.asImmutable=zn.asImmutable,or.wasAltered=zn.wasAltered;var ir;e.Iterator=S,Je(e,{toArray:function(){ct(this.size);var t=new Array(this.size||0);return this.valueSeq().__iterate(function(e,n){t[n]=e}),t},toIndexedSeq:function(){return new oe(this)},toJS:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJS?t.toJS():t}).__toJS()},toJSON:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJSON?t.toJSON():t}).__toJS()},toKeyedSeq:function(){return new re(this,!0)},toMap:function(){return ft(this.toKeyedSeq())},toObject:function(){ct(this.size);var t={};return this.__iterate(function(e,n){t[n]=e}),t},toOrderedMap:function(){return Yt(this.toKeyedSeq())},toOrderedSet:function(){return je(a(this)?this.valueSeq():this)},toSet:function(){return Pe(a(this)?this.valueSeq():this)},toSetSeq:function(){return new ie(this)},toSeq:function(){return u(this)?this.toIndexedSeq():a(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return We(a(this)?this.valueSeq():this)},toList:function(){return Bt(a(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(t,e){return 0===this.size?t+e:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+e},concat:function(){return ke(this,ye(this,sn.call(arguments,0)))},includes:function(t){return this.some(function(e){return X(e,t)})},entries:function(){return this.__iterator(Sn)},every:function(t,e){ct(this.size);var n=!0;return this.__iterate(function(r,o,i){if(!t.call(e,r,o,i))return n=!1,!1}),n},filter:function(t,e){return ke(this,ce(this,t,e,!0))},find:function(t,e,n){var r=this.findEntry(t,e);return r?r[1]:n},findEntry:function(t,e){var n;return this.__iterate(function(r,o,i){if(t.call(e,r,o,i))return n=[o,r],!1}),n},findLastEntry:function(t,e){return this.toSeq().reverse().findEntry(t,e)},forEach:function(t,e){return ct(this.size),this.__iterate(e?t.bind(e):t)},join:function(t){ct(this.size),t=void 0!==t?""+t:",";var e="",n=!0;return this.__iterate(function(r){n?n=!1:e+=t,e+=null!==r&&void 0!==r?r.toString():""}),e},keys:function(){return this.__iterator(bn)},map:function(t,e){return ke(this,se(this,t,e))},reduce:function(t,e,n){ct(this.size);var r,o;return arguments.length<2?o=!0:r=e,this.__iterate(function(e,i,a){o?(o=!1,r=e):r=t.call(n,r,e,i,a)}),r},reduceRight:function(t,e,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return ke(this,le(this,!0))},slice:function(t,e){return ke(this,de(this,t,e,!0))},some:function(t,e){return!this.every(Ze(t),e)},sort:function(t){return ke(this,_e(this,t))},values:function(){return this.__iterator(_n)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(t,e){return h(t?this.toSeq().filter(t,e):this)},countBy:function(t,e){return fe(this,t,e)},equals:function(t){return J(this,t)},entrySeq:function(){var t=this;if(t._cache)return new N(t._cache);var e=t.toSeq().map(Ye).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter(Ze(t),e)},findLast:function(t,e,n){return this.toKeyedSeq().reverse().find(t,e,n)},first:function(){return this.find(y)},flatMap:function(t,e){return ke(this,me(this,t,e))},flatten:function(t){return ke(this,ve(this,t,!0))},fromEntrySeq:function(){return new ae(this)},get:function(t,e){return this.find(function(e,n){return X(n,t)},void 0,e)},getIn:function(t,e){for(var n,r=this,o=Me(t);!(n=o.next()).done;){var i=n.value;if((r=r&&r.get?r.get(i,yn):yn)===yn)return e}return r},groupBy:function(t,e){return pe(this,t,e)},has:function(t){return this.get(t,yn)!==yn},hasIn:function(t){return this.getIn(t,yn)!==yn},isSubset:function(t){return t="function"==typeof t.includes?t:e(t),this.every(function(e){return t.includes(e)})},isSuperset:function(t){return t="function"==typeof t.isSubset?t:e(t),t.isSubset(this)},keySeq:function(){return this.toSeq().map(Qe).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},max:function(t){return Se(this,t)},maxBy:function(t,e){return Se(this,e,t)},min:function(t){return Se(this,t?tn(t):rn)},minBy:function(t,e){return Se(this,e?tn(e):rn,t)},rest:function(){return this.slice(1)},skip:function(t){return this.slice(Math.max(0,t))},skipLast:function(t){return ke(this,this.toSeq().reverse().skip(t).reverse())},skipWhile:function(t,e){return ke(this,ge(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile(Ze(t),e)},sortBy:function(t,e){return ke(this,_e(this,e,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return ke(this,this.toSeq().reverse().take(t).reverse())},takeWhile:function(t,e){return ke(this,he(this,t,e))},takeUntil:function(t,e){return this.takeWhile(Ze(t),e)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=on(this))}});var ar=e.prototype;ar[ln]=!0,ar[kn]=ar.values,ar.__toJS=ar.toArray,ar.__toStringMapper=en,ar.inspect=ar.toSource=function(){return this.toString()},ar.chain=ar.flatMap,ar.contains=ar.includes,function(){try{Object.defineProperty(ar,"length",{get:function(){if(!e.noLengthWarning){var t;try{throw new Error}catch(e){t=e.stack}if(-1===t.indexOf("_wrapObject"))return console&&console.warn&&console.warn("iterable.length has been deprecated, use iterable.size or iterable.count(). This warning will become a silent error in a future version. "+t),this.size}}})}catch(t){}}(),Je(n,{flip:function(){return ke(this,ue(this))},findKey:function(t,e){var n=this.findEntry(t,e);return n&&n[0]},findLastKey:function(t,e){return this.toSeq().reverse().findKey(t,e)},keyOf:function(t){return this.findKey(function(e){return X(e,t)})},lastKeyOf:function(t){return this.findLastKey(function(e){return X(e,t)})},mapEntries:function(t,e){var n=this,r=0;return ke(this,this.toSeq().map(function(o,i){return t.call(e,[i,o],r++,n)}).fromEntrySeq())},mapKeys:function(t,e){var n=this;return ke(this,this.toSeq().flip().map(function(r,o){return t.call(e,r,o,n)}).flip())}});var ur=n.prototype;return ur[cn]=!0,ur[kn]=ar.entries,ur.__toJS=ar.toObject,ur.__toStringMapper=function(t,e){return JSON.stringify(e)+": "+en(t)},Je(r,{toKeyedSeq:function(){return new re(this,!1)},filter:function(t,e){return ke(this,ce(this,t,e,!1))},findIndex:function(t,e){var n=this.findEntry(t,e);return n?n[0]:-1},indexOf:function(t){var e=this.toKeyedSeq().keyOf(t);return void 0===e?-1:e},lastIndexOf:function(t){var e=this.toKeyedSeq().reverse().keyOf(t);return void 0===e?-1:e},reverse:function(){return ke(this,le(this,!1))},slice:function(t,e){return ke(this,de(this,t,e,!1))},splice:function(t,e){var n=arguments.length;if(e=Math.max(0|e,0),0===n||2===n&&!e)return this;t=m(t,t<0?this.count():this.size);var r=this.slice(0,t);return ke(this,1===n?r:r.concat(d(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var n=this.toKeyedSeq().findLastKey(t,e);return void 0===n?-1:n},first:function(){return this.get(0)},flatten:function(t){return ke(this,ve(this,t,!1))},get:function(t,e){return t=g(this,t),t<0||this.size===1/0||void 0!==this.size&&t>this.size?e:this.find(function(e,n){return n===t},void 0,e)},has:function(t){return(t=g(this,t))>=0&&(void 0!==this.size?this.size===1/0||t0?o.getInlineStyleAt(r-1):o.getLength()?o.getInlineStyleAt(0):f(t,n)}function c(t,e){var n=e.getStartKey(),r=e.getStartOffset(),o=t.getBlockForKey(n);return r0?o.getInlineStyleAt(r-1):f(t,n)}function f(t,e){var n=t.getBlockMap().reverse().skipUntil(function(t,n){return n===e}).skip(1).skipUntil(function(t,e){return t.getLength()}).first();return n?n.getInlineStyleAt(n.getLength()-1):b()}var p=n(5),d=p||function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:g;return r(this,e),o(this,t.call(this,m(n)))}return i(e,t),e.prototype.getKey=function(){return this.get("key")},e.prototype.getType=function(){return this.get("type")},e.prototype.getText=function(){return this.get("text")},e.prototype.getCharacterList=function(){return this.get("characterList")},e.prototype.getLength=function(){return this.getText().length},e.prototype.getDepth=function(){return this.get("depth")},e.prototype.getData=function(){return this.get("data")},e.prototype.getInlineStyleAt=function(t){var e=this.getCharacterList().get(t);return e?e.getStyle():h},e.prototype.getEntityAt=function(t){var e=this.getCharacterList().get(t);return e?e.getEntity():null},e.prototype.getChildKeys=function(){return this.get("children")},e.prototype.getParentKey=function(){return this.get("parent")},e.prototype.getPrevSiblingKey=function(){return this.get("prevSibling")},e.prototype.getNextSiblingKey=function(){return this.get("nextSibling")},e.prototype.findStyleRanges=function(t,e){s(this.getCharacterList(),y,t,e)},e.prototype.findEntityRanges=function(t,e){s(this.getCharacterList(),v,t,e)},e}(p(g));t.exports=b},function(t,e,n){"use strict";var r=function(t){if(null!=t)return t;throw new Error("Got unexpected null or undefined")};t.exports=r},function(t,e,n){"use strict";function r(t,e,n,r){if(t===n)return!0;if(!n.startsWith(t))return!1;var o=n.slice(t.length);return!!e&&(o=r?r(o):o,a.contains(o,e))}function o(t){return"Windows"===i.platformName?t.replace(/^\s*NT/,""):t}var i=n(100),a=n(103),u=n(104),s=n(105),l={isBrowser:function(t){return r(i.browserName,i.browserFullVersion,t)},isBrowserArchitecture:function(t){return r(i.browserArchitecture,null,t)},isDevice:function(t){return r(i.deviceName,null,t)},isEngine:function(t){return r(i.engineName,i.engineVersion,t)},isPlatform:function(t){return r(i.platformName,i.platformFullVersion,t,o)},isPlatformArchitecture:function(t){return r(i.platformArchitecture,null,t)}};t.exports=u(l,s)},function(t,e,n){"use strict";function r(){for(var t=void 0;void 0===t||o.hasOwnProperty(t)||!isNaN(+t);)t=Math.floor(Math.random()*i).toString(32);return o[t]=!0,t}var o={},i=Math.pow(2,24);t.exports=r},function(t,e,n){"use strict";var r=n(68);t.exports=r},function(t,e,n){"use strict";t.exports=n(84)},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t,e){return t.getStyle()===e.getStyle()}function u(t,e){return t.getEntity()===e.getEntity()}var s=n(4),l=n(0),c=n(19),f=l.List,p=l.Map,d=l.OrderedSet,h=l.Record,g=l.Repeat,y=d(),v={key:"",type:"unstyled",text:"",characterList:f(),depth:0,data:p()},m=h(v),b=function(t){if(!t)return t;var e=t.characterList,n=t.text;return n&&!e&&(t.characterList=f(g(s.EMPTY,n.length))),t},_=function(t){function e(n){return r(this,e),o(this,t.call(this,b(n)))}return i(e,t),e.prototype.getKey=function(){return this.get("key")},e.prototype.getType=function(){return this.get("type")},e.prototype.getText=function(){return this.get("text")},e.prototype.getCharacterList=function(){return this.get("characterList")},e.prototype.getLength=function(){return this.getText().length},e.prototype.getDepth=function(){return this.get("depth")},e.prototype.getData=function(){return this.get("data")},e.prototype.getInlineStyleAt=function(t){var e=this.getCharacterList().get(t);return e?e.getStyle():y},e.prototype.getEntityAt=function(t){var e=this.getCharacterList().get(t);return e?e.getEntity():null},e.prototype.findStyleRanges=function(t,e){c(this.getCharacterList(),a,t,e)},e.prototype.findEntityRanges=function(t,e){c(this.getCharacterList(),u,t,e)},e}(m);t.exports=_},function(t,e,n){"use strict";function r(t){return p<=t&&t<=g}function o(t,e){if(0<=e&&er||n<=0)return"";var o=0;if(e>0){for(;e>0&&o=r)return""}else if(e<0){for(o=r;e<0&&00&&u=a},e.prototype.isCollapsed=function(){return this.getAnchorKey()===this.getFocusKey()&&this.getAnchorOffset()===this.getFocusOffset()},e.prototype.getStartKey=function(){return this.getIsBackward()?this.getFocusKey():this.getAnchorKey()},e.prototype.getStartOffset=function(){return this.getIsBackward()?this.getFocusOffset():this.getAnchorOffset()},e.prototype.getEndKey=function(){return this.getIsBackward()?this.getAnchorKey():this.getFocusKey()},e.prototype.getEndOffset=function(){return this.getIsBackward()?this.getAnchorOffset():this.getFocusOffset()},e.createEmpty=function(t){return new e({anchorKey:t,anchorOffset:0,focusKey:t,focusOffset:0,isBackward:!1,hasFocus:!1})},e}(l);t.exports=c},function(t,e,n){"use strict";function r(t){return"object"==typeof t?Object.keys(t).filter(function(e){return t[e]}).map(o).join(" "):Array.prototype.map.call(arguments,o).join(" ")}function o(t){return t.replace(/\//g,"-")}t.exports=r},function(t,e,n){"use strict";var r=n(67),o=n(18),i=n(4),a=n(83),u=n(12),s=n(27),l=n(30),c=n(47),f=n(86),p=n(49),d=n(24),h=n(3),g=n(44),y=n(2),v=n(37),m=n(62),b=n(15),_=n(154),S=n(60),w=n(157),C=n(9),k=n(63),x=n(162),E={Editor:f,EditorBlock:p,EditorState:y,CompositeDecorator:a,Entity:d,EntityInstance:g,BlockMapBuilder:o,CharacterMetadata:i,ContentBlock:u,ContentState:s,SelectionState:b,AtomicBlockUtils:r,KeyBindingUtil:v,Modifier:h,RichUtils:m,DefaultDraftBlockRenderMap:l,DefaultDraftInlineStyle:c,convertFromHTML:S,convertFromRaw:w,convertToRaw:_,genKey:C,getDefaultKeyBinding:k,getVisibleSelectionRect:x};t.exports=E},function(t,e,n){"use strict";var r=n(0),o=r.OrderedMap,i={createFromArray:function(t){return o(t.map(function(t){return[t.getKey(),t]}))}};t.exports=i},function(t,e,n){"use strict";function r(t,e,n,r){if(t.size){var o=0;t.reduce(function(t,i,a){return e(t,i)||(n(t)&&r(o,a),o=a),i}),n(t.last())&&r(o,t.count())}}t.exports=r},function(t,e,n){"use strict";function r(t){return"handled"===t||!0===t}t.exports=r},function(t,e,n){"use strict";function r(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(t){console.error(t)}}r(),t.exports=n(92)},function(t,e,n){"use strict";function r(t,e,n){var r=t.getSelection(),i=t.getCurrentContent(),a=r;if(r.isCollapsed()){if("forward"===n){if(t.isSelectionAtEndOfContent())return i}else if(t.isSelectionAtStartOfContent())return i;if((a=e(t))===r)return i}return o.removeRange(i,a,n)}var o=n(3);t.exports=r},function(t,e,n){"use strict";var r=n(39),o=n(40),i=function(t,e){var n=e.getStartKey(),i=e.getStartOffset(),a=e.getEndKey(),u=e.getEndOffset(),s=o(t,e),l=s.getBlockMap(),c=l.keySeq(),f=c.indexOf(n),p=c.indexOf(a)+1;return r(l.slice(f,p).map(function(t,e){var r=t.getText(),o=t.getCharacterList();return n===a?t.merge({text:r.slice(i,u),characterList:o.slice(i,u)}):e===n?t.merge({text:r.slice(i),characterList:o.slice(i)}):e===a?t.merge({text:r.slice(0,u),characterList:o.slice(0,u)}):t}))};t.exports=i},function(t,e,n){"use strict";function r(t,e){console.warn("WARNING: "+t+' will be deprecated soon!\nPlease use "'+e+'" instead.')}var o=n(5),i=o||function(t){for(var e=1;e1||t.first().getLength()>0},e.prototype.createEntity=function(t,e,n){return c.__create(t,e,n),this},e.prototype.mergeEntityData=function(t,e){return c.__mergeData(t,e),this},e.prototype.replaceEntityData=function(t,e){return c.__replaceData(t,e),this},e.prototype.addEntity=function(t){return c.__add(t),this},e.prototype.getEntity=function(t){return c.__get(t)},e.createFromBlockArray=function(t,n){var r=Array.isArray(t)?t:t.contentBlocks,o=a.createFromArray(r),i=o.isEmpty()?new d:d.createEmpty(o.first().getKey());return new e({blockMap:o,entityMap:n||c,selectionBefore:i,selectionAfter:i})},e.createFromText=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:/\r\n?|\n/g,r=t.split(n),o=r.map(function(t){return t=g(t),new S({key:h(),text:t,type:"unstyled",characterList:y(m(u.EMPTY,t.length))})});return e.createFromBlockArray(o)},e}(w);t.exports=C},function(t,e,n){"use strict";function r(t){return t.replace(o,"")}var o=new RegExp("\r","g");t.exports=r},function(t,e,n){"use strict";function r(t){return t===c||t===f}function o(t){return r(t)||l(!1),t===c?"ltr":"rtl"}function i(t,e){return r(t)||l(!1),r(e)||l(!1),t===e?null:o(t)}function a(t){p=t}function u(){a(c)}function s(){return p||this.initGlobalDir(),p||l(!1),p}var l=n(1),c="LTR",f="RTL",p=null,d={NEUTRAL:"NEUTRAL",LTR:c,RTL:f,isStrong:r,getHTMLDir:o,getHTMLDirIfDifferent:i,setGlobalDir:a,initGlobalDir:u,getGlobalDir:s};t.exports=d},function(t,e,n){"use strict";var r=n(0),o=r.Map,i=n(11),a=n(16),u=i.createElement("ul",{className:a("public/DraftStyleDefault/ul")}),s=i.createElement("ol",{className:a("public/DraftStyleDefault/ol")}),l=i.createElement("pre",{className:a("public/DraftStyleDefault/pre")}),c=o({"header-one":{element:"h1"},"header-two":{element:"h2"},"header-three":{element:"h3"},"header-four":{element:"h4"},"header-five":{element:"h5"},"header-six":{element:"h6"},"unordered-list-item":{element:"li",wrapper:u},"ordered-list-item":{element:"li",wrapper:s},blockquote:{element:"blockquote"},atomic:{element:"figure"},"code-block":{element:"pre",wrapper:l},unstyled:{element:"div",aliasedElements:["p"]}});t.exports=c},function(t,e,n){"use strict";t.exports={BACKSPACE:8,TAB:9,RETURN:13,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,COMMA:188,PERIOD:190,A:65,Z:90,ZERO:48,NUMPAD_0:96,NUMPAD_9:105}},function(t,e,n){"use strict";function r(t,e){var n;if(e.isCollapsed()){var r=e.getAnchorKey(),i=e.getAnchorOffset();return i>0?(n=t.getBlockForKey(r).getEntityAt(i-1),n!==t.getBlockForKey(r).getEntityAt(i)?null:o(t.getEntityMap(),n)):null}var a=e.getStartKey(),u=e.getStartOffset(),s=t.getBlockForKey(a);return n=u===s.getLength()?null:s.getEntityAt(u),o(t.getEntityMap(),n)}function o(t,e){if(e){return"MUTABLE"===t.__get(e).getMutability()?e:null}return null}t.exports=r},function(t,e,n){"use strict";function r(t){if(void 0===(t=t||("undefined"!=typeof document?document:void 0)))return null;try{return t.activeElement||t.body}catch(e){return t.body}}t.exports=r},function(t,e,n){"use strict";function r(t,e){var n=i.get(t,e);return"auto"===n||"scroll"===n}var o=n(108),i={get:o,getScrollParent:function(t){if(!t)return null;for(var e=t.ownerDocument;t&&t!==e.body;){if(r(t,"overflow")||r(t,"overflowY")||r(t,"overflowX"))return t;t=t.parentNode}return e.defaultView||e.parentWindow}};t.exports=i},function(t,e,n){"use strict";function r(t){var e=o(t.ownerDocument||t.document);t.Window&&t instanceof t.Window&&(t=e);var n=i(t),r=t===e?t.ownerDocument.documentElement:t,a=t.scrollWidth-r.clientWidth,u=t.scrollHeight-r.clientHeight;return n.x=Math.max(0,Math.min(n.x,a)),n.y=Math.max(0,Math.min(n.y,u)),n}var o=n(113),i=n(114);t.exports=r},function(t,e,n){"use strict";function r(t){for(var e=t;e&&e!==document.documentElement;){var n=o(e);if(null!=n)return n;e=e.parentNode}return null}var o=n(52);t.exports=r},function(t,e,n){"use strict";var r=n(8),o=r.isPlatform("Mac OS X"),i={isCtrlKeyCommand:function(t){return!!t.ctrlKey&&!t.altKey},isOptionKeyCommand:function(t){return o&&t.altKey},hasCommandModifier:function(t){return o?!!t.metaKey&&!t.altKey:i.isCtrlKeyCommand(t)}};t.exports=i},function(t,e,n){"use strict";function r(t,e){var n=t.getSelection(),r=t.getCurrentContent(),o=n.getStartKey(),i=n.getStartOffset(),a=o,u=0;if(e>i){var s=r.getKeyBefore(o);if(null==s)a=o;else{a=s;u=r.getBlockForKey(s).getText().length}}else u=i-e;return n.merge({focusKey:a,focusOffset:u,isBackward:!0})}t.exports=r},function(t,e,n){"use strict";var r=n(6),o=n(0),i=n(9),a=o.OrderedMap,u=function(t){var e={},n=void 0;return a(t.withMutations(function(t){t.forEach(function(r,o){var a=r.getKey(),u=r.getNextSiblingKey(),s=r.getPrevSiblingKey(),l=r.getChildKeys(),c=r.getParentKey(),f=i();if(e[a]=f,u){t.get(u)?t.setIn([u,"prevSibling"],f):t.setIn([a,"nextSibling"],null)}if(s){t.get(s)?t.setIn([s,"nextSibling"],f):t.setIn([a,"prevSibling"],null)}if(c&&t.get(c)){var p=t.get(c),d=p.getChildKeys();t.setIn([c,"children"],d.set(d.indexOf(r.getKey()),f))}else t.setIn([a,"parent"],null),n&&(t.setIn([n.getKey(),"nextSibling"],f),t.setIn([a,"prevSibling"],e[n.getKey()])),n=t.get(a);l.forEach(function(e){t.get(e)?t.setIn([e,"parent"],f):t.setIn([a,"children"],r.getChildKeys().filter(function(t){return t!==e}))})})}).toArray().map(function(t){return[e[t.getKey()],t.set("key",e[t.getKey()])]}))},s=function(t){return a(t.toArray().map(function(t){var e=i();return[e,t.set("key",e)]}))},l=function(t){return t.first()instanceof r?u(t):s(t)};t.exports=l},function(t,e,n){"use strict";function r(t,e){var n=t.getBlockMap(),r=t.getEntityMap(),o={},a=e.getStartKey(),u=e.getStartOffset(),s=n.get(a),l=i(r,s,u);l!==s&&(o[a]=l);var c=e.getEndKey(),f=e.getEndOffset(),p=n.get(c);a===c&&(p=l);var d=i(r,p,f);return d!==p&&(o[c]=d),Object.keys(o).length?t.merge({blockMap:n.merge(o),selectionAfter:e}):t.set("selectionAfter",e)}function o(t,e,n){var r;return u(t,function(t,e){return t.getEntity()===e.getEntity()},function(t){return t.getEntity()===e},function(t,e){t<=n&&e>=n&&(r={start:t,end:e})}),"object"!=typeof r&&s(!1),r}function i(t,e,n){var r=e.getCharacterList(),i=n>0?r.get(n-1):void 0,u=n0&&window.scrollTo(o.x,o.y+i+10)}else{n instanceof HTMLElement||_(!1);i=n.offsetHeight+n.offsetTop-(r.offsetHeight+o.y),i>0&&p.setTop(r,p.getTop(r)+i+10)}}},e.prototype._renderChildren=function(){var t=this,e=this.props.block,n=e.getKey(),r=e.getText(),o=this.props.tree.size-1,i=w(this.props.selection,n);return this.props.tree.map(function(a,f){var p=a.get("leaves"),d=p.size-1,y=p.map(function(a,u){var p=l.encode(n,f,u),h=a.get("start"),g=a.get("end");return c.createElement(s,{key:p,offsetKey:p,block:e,start:h,selection:i?t.props.selection:null,forceSelection:t.props.forceSelection,text:r.slice(h,g),styleSet:e.getInlineStyleAt(h),customStyleMap:t.props.customStyleMap,customStyleFn:t.props.customStyleFn,isLast:f===o&&u===d})}).toArray(),v=a.get("decoratorKey");if(null==v)return y;if(!t.props.decorator)return y;var m=S(t.props.decorator),b=m.getComponentForKey(v);if(!b)return y;var _=m.getPropsForKey(v),w=l.encode(n,f,0),C=r.slice(p.first().get("start"),p.last().get("end")),k=g.getHTMLDirIfDifferent(h.getDirection(C),t.props.direction);return c.createElement(b,u({},_,{contentState:t.props.contentState,decoratedText:C,dir:k,key:w,entityKey:e.getEntityAt(a.get("start")),offsetKey:w}),y)}).toArray()},e.prototype.render=function(){var t=this.props,e=t.direction,n=t.offsetKey,r=y({"public/DraftStyleDefault/block":!0,"public/DraftStyleDefault/ltr":"LTR"===e,"public/DraftStyleDefault/rtl":"RTL"===e});return c.createElement("div",{"data-offset-key":n,className:r},this._renderChildren())},e}(c.Component);t.exports=C},function(t,e,n){"use strict";function r(t,e){return!!e&&(t===e.documentElement||t===e.body)}var o={getTop:function(t){var e=t.ownerDocument;return r(t,e)?e.body.scrollTop||e.documentElement.scrollTop:t.scrollTop},setTop:function(t,e){var n=t.ownerDocument;r(t,n)?n.body.scrollTop=n.documentElement.scrollTop=e:t.scrollTop=e},getLeft:function(t){var e=t.ownerDocument;return r(t,e)?e.body.scrollLeft||e.documentElement.scrollLeft:t.scrollLeft},setLeft:function(t,e){var n=t.ownerDocument;r(t,n)?n.body.scrollLeft=n.documentElement.scrollLeft=e:t.scrollLeft=e}};t.exports=o},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t){if("file"==t.kind)return t.getAsFile()}var i=n(118),a=n(119),u=n(14),s=new RegExp("\r\n","g"),l={"text/rtf":1,"text/html":1},c=function(){function t(e){r(this,t),this.data=e,this.types=e.types?a(e.types):[]}return t.prototype.isRichText=function(){return!(!this.getHTML()||!this.getText())||!this.isImage()&&this.types.some(function(t){return l[t]})},t.prototype.getText=function(){var t;return this.data.getData&&(this.types.length?-1!=this.types.indexOf("text/plain")&&(t=this.data.getData("text/plain")):t=this.data.getData("Text")),t?t.replace(s,"\n"):null},t.prototype.getHTML=function(){if(this.data.getData){if(!this.types.length)return this.data.getData("Text");if(-1!=this.types.indexOf("text/html"))return this.data.getData("text/html")}},t.prototype.isLink=function(){return this.types.some(function(t){return-1!=t.indexOf("Url")||-1!=t.indexOf("text/uri-list")||t.indexOf("text/x-moz-url")})},t.prototype.getLink=function(){if(this.data.getData){if(-1!=this.types.indexOf("text/x-moz-url")){return this.data.getData("text/x-moz-url").split("\n")[0]}return-1!=this.types.indexOf("text/uri-list")?this.data.getData("text/uri-list"):this.data.getData("url")}return null},t.prototype.isImage=function(){if(this.types.some(function(t){return-1!=t.indexOf("application/x-moz-file")}))return!0;for(var t=this.getFiles(),e=0;e0},t}();t.exports=c},function(t,e,n){"use strict";function r(t){if(t instanceof Element){var e=t.getAttribute("data-offset-key");if(e)return e;for(var n=0;n0&&(n=r.childNodes.length)),0===n){var c=null;if(null!=a)c=a;else{var d=o(r);c=p(l(d))}return{key:c,offset:0}}var h=r.childNodes[n-1],g=null,y=null;if(l(h)){var v=i(h);g=p(l(v)),y=u(v)}else g=p(a),y=u(h);return{key:g,offset:y}}function u(t){var e=t.textContent;return"\n"===e?0:e.length}var s=n(36),l=n(52),c=n(54),f=n(1),p=n(7);t.exports=r},function(t,e,n){"use strict";function r(t,e){var n=e?c.exec(t):s.exec(t);return n?n[0]:t}var o=n(137),i=o.getPunctuation(),a="\\s|(?![_])"+i,u="^(?:"+a+")*(?:['‘’]|(?!"+a+").)*(?:(?!"+a+").)",s=new RegExp(u),l="(?:(?!"+a+").)(?:['‘’]|(?!"+a+").)*(?:"+a+")*$",c=new RegExp(l),f={getBackward:function(t){return r(t,!0)},getForward:function(t){return r(t,!1)}};t.exports=f},function(t,e,n){"use strict";function r(t,e){var n,r=t.getSelection(),o=r.getStartKey(),i=r.getStartOffset(),a=t.getCurrentContent(),u=o;return e>a.getBlockForKey(o).getText().length-i?(u=a.getKeyAfter(o),n=0):n=i+e,r.merge({focusKey:u,focusOffset:n})}t.exports=r},function(t,e,n){"use strict";function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var o,i=a||function(t){for(var e=1;e=0?t.add("BOLD"):M.indexOf(e)>=0&&t.remove("BOLD"),"italic"===n?t.add("ITALIC"):"normal"===n&&t.remove("ITALIC"),"underline"===r&&t.add("UNDERLINE"),"line-through"===r&&t.add("STRIKETHROUGH"),"none"===r&&(t.remove("UNDERLINE"),t.remove("STRIKETHROUGH"))}).toOrderedSet()}return n},V=function(t,e,n){var r=t.text.slice(-1),o=e.text.slice(0,1);if("\r"!==r||"\r"!==o||n||(t.text=t.text.slice(0,-1),t.inlines.pop(),t.entities.pop(),t.blocks.pop()),"\r"===r){if(" "===e.text||"\n"===e.text)return t;" "!==o&&"\n"!==o||(e.text=e.text.slice(1),e.inlines.shift(),e.entities.shift())}return{text:t.text+e.text,inlines:t.inlines.concat(e.inlines),entities:t.entities.concat(e.entities),blocks:t.blocks.concat(e.blocks)}},q=function(t,e){return e.some(function(e){return-1!==t.indexOf("<"+e)})},W=function(t){t instanceof HTMLAnchorElement||_(!1);var e=t.protocol;return"http:"===e||"https:"===e||"mailto:"===e},G=function(t){var e=new Array(1);return t&&(e[0]=t),i({},P,{text:" ",inlines:[k()],entities:e})},$=function(){return i({},P,{text:"\n",inlines:[k()],entities:new Array(1)})},X=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return i({},F,t)},J=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return{text:"\r",inlines:[k()],entities:new Array(1),blocks:[X({parent:n,key:m(),type:t,depth:Math.max(0,Math.min(4,e))})]}},Q=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Object.keys(N).some(function(n){t.classList.contains(n)&&(e=N[n])}),e},Y=function t(e,n,r,o,a,u,s,l,c,p){var d=R,h=n.nodeName.toLowerCase(),g=e,v="unstyled",m=!1,b=a&&j(a,o,l),_=i({},P),S=null,C=void 0;if("#text"===h){var k=n.textContent,x=k.trim();if(o&&""===x&&n.parentElement){var O=n.parentElement.nodeName.toLowerCase();if("ol"===O||"ul"===O)return{chunk:i({},P),entityMap:e}}return""===x&&"pre"!==a?{chunk:G(c),entityMap:e}:("pre"!==a&&(k=k.replace(E," ")),R=h,{chunk:{text:k,inlines:Array(k.length).fill(r),entities:Array(k.length).fill(c),blocks:[]},entityMap:e})}if(R=h,"br"===h)return"br"!==d||a&&"unstyled"!==b?{chunk:$(),entityMap:e}:{chunk:J("unstyled",s,p),entityMap:e};if("img"===h&&n instanceof HTMLImageElement&&n.attributes.getNamedItem("src")&&n.attributes.getNamedItem("src").value){var T=n,D={};K.forEach(function(t){var e=T.getAttribute(t);e&&(D[t]=e)}),n.textContent="📷",c=f.__create("IMAGE","MUTABLE",D||{})}r=H(h,n,r),"ul"!==h&&"ol"!==h||(o&&(s+=1),o=h),!w&&"li"===h&&n instanceof HTMLElement&&(s=Q(n,s));var I=j(h,o,l),M=o&&"li"===a&&"li"===h,A=(!a||w)&&-1!==u.indexOf(h);(M||A)&&(_=J(I,s,p),C=_.blocks[0].key,a=h,m=!w),M&&(v="ul"===o?"unordered-list-item":"ordered-list-item");var N=n.firstChild;null!=N&&(h=N.nodeName.toLowerCase());for(var F=null;N;){N instanceof HTMLAnchorElement&&N.href&&W(N)?function(){var t=N,e={};L.forEach(function(n){var r=t.getAttribute(n);r&&(e[n]=r)}),e.url=new y(t.href).toString(),F=f.__create("LINK","MUTABLE",e||{})}():F=void 0;var B=t(g,N,r,o,a,u,s,l,F||c,w?C:null),U=B.chunk,z=B.entityMap;S=U,g=z,_=V(_,S,w);var q=N.nextSibling;!p&&q&&u.indexOf(h)>=0&&a&&(_=V(_,$())),q&&(h=q.nodeName.toLowerCase()),N=q}return m&&(_=V(_,J(v,s,p))),{chunk:_,entityMap:g}},Z=function(t,e,n,r){t=t.trim().replace(x,"").replace(O," ").replace(T,"").replace(D,"");var o=U(n),a=e(t);if(!a)return null;R=null;var u=q(t,o)?o:["div"],s=Y(r,a,k(),"ul",null,u,-1,n),l=s.chunk,c=s.entityMap;return 0===l.text.indexOf("\r")&&(l={text:l.text.slice(1),inlines:l.inlines.slice(1),entities:l.entities.slice(1),blocks:l.blocks}),"\r"===l.text.slice(-1)&&(l.text=l.text.slice(0,-1),l.inlines=l.inlines.slice(0,-1),l.entities=l.entities.slice(0,-1),l.blocks.pop()),0===l.blocks.length&&l.blocks.push(i({},P,{type:"unstyled",depth:0})),l.text.split("\r").length===l.blocks.length+1&&l.blocks.unshift({type:"unstyled",depth:0}),{chunk:l,entityMap:c}},tt=function(t){if(!t||!t.text||!Array.isArray(t.blocks))return null;var e={cacheRef:{},contentBlocks:[]},n=0,r=t.blocks,o=t.inlines,i=t.entities,a=w?l:s;return t.text.split("\r").reduce(function(t,e,s){e=S(e);var c=r[s],f=n+e.length,p=o.slice(n,f),d=i.slice(n,f),h=C(p.map(function(t,e){var n={style:t,entity:null};return d[e]&&(n.entity=d[e]),u.create(n)}));n=f+1;var g=c.depth,y=c.type,v=c.parent,b=c.key||m(),_=null;if(v){var w=t.cacheRef[v],k=t.contentBlocks[w];if(k.getChildKeys().isEmpty()&&k.getText()){var x=k.getCharacterList(),E=k.getText();_=m();var O=new l({key:_,text:E,characterList:x,parent:v,nextSibling:b});t.contentBlocks.push(O),k=k.withMutations(function(t){t.set("characterList",C()).set("text","").set("children",k.children.push(O.getKey()))})}t.contentBlocks[w]=k.set("children",k.children.push(b))}var T=new a({key:b,parent:v,type:y,depth:g,text:e,characterList:h,prevSibling:_||(0===s||r[s-1].parent!==v?null:r[s-1].key),nextSibling:s===r.length-1||r[s+1].parent!==v?null:r[s+1].key});return t.contentBlocks.push(T),t.cacheRef[T.key]=s,t},e).contentBlocks},et=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c,r=Z(t,e,n,f);if(null==r)return null;var o=r.chunk,i=r.entityMap;return{contentBlocks:tt(o),entityMap:i}};t.exports=et},function(t,e,n){"use strict";function r(t){var e,n=null;return!a&&document.implementation&&document.implementation.createHTMLDocument&&(e=document.implementation.createHTMLDocument("foo"),e.documentElement||i(!1),e.documentElement.innerHTML=t,n=e.getElementsByTagName("body")[0]),n}var o=n(8),i=n(1),a=o.isBrowser("IE <= 9");t.exports=r},function(t,e,n){"use strict";var r=n(3),o=n(2),i=(n(15),n(149)),a=n(7),u={currentBlockContainsLink:function(t){var e=t.getSelection(),n=t.getCurrentContent(),r=n.getEntityMap();return n.getBlockForKey(e.getAnchorKey()).getCharacterList().slice(e.getStartOffset(),e.getEndOffset()).some(function(t){var e=t.getEntity();return!!e&&"LINK"===r.__get(e).getType()})},getCurrentBlockType:function(t){var e=t.getSelection();return t.getCurrentContent().getBlockForKey(e.getStartKey()).getType()},getDataObjectForLinkURL:function(t){return{url:t.toString()}},handleKeyCommand:function(t,e){switch(e){case"bold":return u.toggleInlineStyle(t,"BOLD");case"italic":return u.toggleInlineStyle(t,"ITALIC");case"underline":return u.toggleInlineStyle(t,"UNDERLINE");case"code":return u.toggleCode(t);case"backspace":case"backspace-word":case"backspace-to-start-of-line":return u.onBackspace(t);case"delete":case"delete-word":case"delete-to-end-of-block":return u.onDelete(t);default:return null}},insertSoftNewline:function(t){var e=r.insertText(t.getCurrentContent(),t.getSelection(),"\n",t.getCurrentInlineStyle(),null),n=o.push(t,e,"insert-characters");return o.forceSelection(n,e.getSelectionAfter())},onBackspace:function(t){var e=t.getSelection();if(!e.isCollapsed()||e.getAnchorOffset()||e.getFocusOffset())return null;var n=t.getCurrentContent(),r=e.getStartKey(),i=n.getBlockBefore(r);if(i&&"atomic"===i.getType()){var a=n.getBlockMap().delete(i.getKey()),s=n.merge({blockMap:a,selectionAfter:e});if(s!==n)return o.push(t,s,"remove-range")}var l=u.tryToRemoveBlockStyle(t);return l?o.push(t,l,"change-block-type"):null},onDelete:function(t){var e=t.getSelection();if(!e.isCollapsed())return null;var n=t.getCurrentContent(),i=e.getStartKey(),a=n.getBlockForKey(i),u=a.getLength();if(e.getStartOffset()0&&a!==u)return null;var s=a.getType(),l=i.getBlockBefore(o);if("code-block"===s&&l&&"code-block"===l.getType()&&0!==l.getLength())return null;if("unstyled"!==s)return r.setBlockType(i,e,"unstyled")}return null}};t.exports=u},function(t,e,n){"use strict";function r(t){return f&&t.altKey||g(t)}function o(t){return h(t)?t.shiftKey?"redo":"undo":null}function i(t){return p&&t.shiftKey?null:r(t)?"delete-word":"delete"}function a(t){return h(t)&&f?"backspace-to-start-of-line":r(t)?"backspace-word":"backspace"}function u(t){switch(t.keyCode){case 66:return h(t)?"bold":null;case 68:return g(t)?"delete":null;case 72:return g(t)?"backspace":null;case 73:return h(t)?"italic":null;case 74:return h(t)?"code":null;case 75:return!p&&g(t)?"secondary-cut":null;case 77:case 79:return g(t)?"split-block":null;case 84:return f&&g(t)?"transpose-characters":null;case 85:return h(t)?"underline":null;case 87:return f&&g(t)?"backspace-word":null;case 89:return g(t)?p?"redo":"secondary-paste":null;case 90:return o(t)||null;case l.RETURN:return"split-block";case l.DELETE:return i(t);case l.BACKSPACE:return a(t);case l.LEFT:return d&&h(t)?"move-selection-to-start-of-block":null;case l.RIGHT:return d&&h(t)?"move-selection-to-end-of-block":null;default:return null}}var s=n(37),l=n(31),c=n(8),f=c.isPlatform("Mac OS X"),p=c.isPlatform("Windows"),d=f&&c.isBrowser("Firefox < 29"),h=s.hasCommandModifier,g=s.isCtrlKeyCommand;t.exports=u},function(t,e,n){"use strict";var r={stringify:function(t){return"_"+String(t)},unstringify:function(t){return t.slice(1)}};t.exports=r},function(t,e,n){t.exports=n(66)},function(t,e,n){"use strict";function r(t,e){var n=t.getSelection(),r=t.getCurrentContent(),o=r.getFirstBlock().getData(),i=o.remove(e),a=u.SelectionState.createEmpty(r.getFirstBlock().getKey());r=u.Modifier.setBlockData(r,a,i);var s=u.EditorState.push(t,r,"change-block-data");return u.EditorState.forceSelection(s,n)}function o(t){var e=u.EditorState.createWithContent((0,u.convertFromRaw)(t)),n=e.getCurrentContent().getFirstBlock().getData().toJS(),o=Object.keys(n).reduce(function(t,e){var o=n[e],i=null;try{i=JSON.parse(e)}catch(e){return t}if(null===i||"ANNOTATION"!==o.type)return t;var a=u.EditorState.acceptSelection(t,new u.SelectionState(i));return r((0,s.addHighlight)(a,o.type,{type:o.type,data:o}),e)},e);return(0,u.convertToRaw)((0,s.prepareHighlightsForExport)(o).getCurrentContent())}function i(t){return"object"===(void 0===t?"undefined":a(t))&&2===Object.keys(t).length&&Object.keys(t).includes("entityMap")&&Object.keys(t).includes("blocks")}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u=n(17),s=n(164),l=process.openStdin(),c="";l.on("data",function(t){c=t.toString()}),l.on("end",function(){var t=null;try{t=JSON.parse(c)}catch(t){return process.stdout.write(c)}if(Array.isArray(t)&&1===t.length&&i(t[0])){var e=o(t[0]),n=[e];return process.stdout.write(JSON.stringify(n))}return process.stdout.write(c)})},function(t,e,n){"use strict";var r=n(5),o=r||function(t){for(var e=1;e=t.start});1!=g.length&&u(!1);var y=g[0];if("IMMUTABLE"===d)return n.merge({anchorOffset:y.start,focusOffset:y.end,isBackward:!1});s||(l?f=y.end:c=y.start);var v=i.getRemovalRange(c,f,e.getText().slice(y.start,y.end),y.start,r);return n.merge({anchorOffset:v.start,focusOffset:v.end,isBackward:!1})}var i=n(73),a=n(74),u=n(1);t.exports=r},function(t,e,n){"use strict";var r={getRemovalRange:function(t,e,n,r,o){var i=n.split(" ");i=i.map(function(t,e){if("forward"===o){if(e>0)return" "+t}else if(ee;)t=t.pop(),n--;else{var r=t.slice(0,e),o=t.slice(n);t=r.concat(o).toList()}return t};t.exports=d},function(t,e,n){"use strict";var r=n(6),o=n(0),i=n(9),a=n(1),u=o.List,s=o.Map,l=function(t,e,n){if(t){var r=e.get(t);r&&e.set(t,n(r))}},c=function(t,e,n){return t.withMutations(function(t){var r=e.getKey(),o=n.getKey();l(e.getParentKey(),t,function(t){var e=t.getChildKeys(),n=e.indexOf(r)+1,i=e.toArray();return i.splice(n,0,o),t.merge({children:u(i)})}),l(e.getNextSiblingKey(),t,function(t){return t.merge({prevSibling:o})}),l(r,t,function(t){return t.merge({nextSibling:o})}),l(o,t,function(t){return t.merge({prevSibling:r})})})},f=function(t,e){e.isCollapsed()||a(!1);var n=e.getAnchorKey(),o=e.getAnchorOffset(),u=t.getBlockMap(),l=u.get(n),f=l.getText(),p=l.getCharacterList(),d=i(),h=l instanceof r,g=l.merge({text:f.slice(0,o),characterList:p.slice(0,o)}),y=g.merge({key:d,text:f.slice(o),characterList:p.slice(o),data:s()}),v=u.toSeq().takeUntil(function(t){return t===l}),m=u.toSeq().skipUntil(function(t){return t===l}).rest(),b=v.concat([[n,g],[d,y]],m).toOrderedMap();return h&&(l.getChildKeys().isEmpty()||a(!1),b=c(b,g,y)),t.merge({blockMap:b,selectionBefore:e,selectionAfter:e.merge({anchorKey:d,anchorOffset:0,focusKey:d,focusOffset:0,isBackward:!1})})};t.exports=f},function(t,e,n){"use strict";var r,o=n(0),i=n(81),a=n(7),u=o.OrderedMap,s={getDirectionMap:function(t,e){r?r.reset():r=new i;var n=t.getBlockMap(),s=n.valueSeq().map(function(t){return a(r).getDirection(t.getText())}),l=u(n.keySeq().zip(s));return null!=e&&o.is(e,l)?e:l}};t.exports=s},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=n(45),i=n(29),a=n(1),u=function(){function t(e){r(this,t),e?i.isStrong(e)||a(!1):e=i.getGlobalDir(),this._defaultDir=e,this.reset()}return t.prototype.reset=function(){this._lastDir=this._defaultDir},t.prototype.getDirection=function(t){return this._lastDir=o.getDirection(t,this._lastDir),this._lastDir},t}();t.exports=u},function(t,e,n){"use strict";var r=n(6),o=n(0),i=n(42),a=n(1),u=o.OrderedMap,s=o.List,l=function(t,e,n){if(t){var r=e.get(t);r&&e.set(t,n(r))}},c=function(t,e,n,r,o){if(!o)return t;var i="after"===r,a=e.getKey(),u=n.getKey(),c=e.getParentKey(),f=e.getNextSiblingKey(),p=e.getPrevSiblingKey(),d=n.getParentKey(),h=i?n.getNextSiblingKey():u,g=i?u:n.getPrevSiblingKey();return t.withMutations(function(t){l(c,t,function(t){var e=t.getChildKeys();return t.merge({children:e.delete(e.indexOf(a))})}),l(p,t,function(t){return t.merge({nextSibling:f})}),l(f,t,function(t){return t.merge({prevSibling:p})}),l(h,t,function(t){return t.merge({prevSibling:a})}),l(g,t,function(t){return t.merge({nextSibling:a})}),l(d,t,function(t){var e=t.getChildKeys(),n=e.indexOf(u),r=i?n+1:0!==n?n-1:0,o=e.toArray();return o.splice(r,0,a),t.merge({children:s(o)})}),l(a,t,function(t){return t.merge({nextSibling:h,prevSibling:g,parent:d})})})},f=function(t,e,n,o){"replace"===o&&a(!1);var s=n.getKey(),l=e.getKey();l===s&&a(!1);var f=t.getBlockMap(),p=e instanceof r,d=[e],h=f.delete(l);p&&(d=[],h=f.withMutations(function(t){var n=e.getNextSiblingKey(),r=i(e,t);t.toSeq().skipUntil(function(t){return t.getKey()===l}).takeWhile(function(t){var e=t.getKey(),o=e===l,i=n&&e!==n,a=!n&&t.getParentKey()&&(!r||e!==r);return!!(o||i||a)}).forEach(function(e){d.push(e),t.delete(e.getKey())})}));var g=h.toSeq().takeUntil(function(t){return t===n}),y=h.toSeq().skipUntil(function(t){return t===n}).skip(1),v=d.map(function(t){return[t.getKey(),t]}),m=u();if("before"===o){var b=t.getBlockBefore(s);b&&b.getKey()===e.getKey()&&a(!1),m=g.concat([].concat(v,[[s,n]]),y).toOrderedMap()}else if("after"===o){var _=t.getBlockAfter(s);_&&_.getKey()===l&&a(!1),m=g.concat([[s,n]].concat(v),y).toOrderedMap()}return t.merge({blockMap:c(m,e,n,o,p),selectionBefore:t.getSelectionAfter(),selectionAfter:t.getSelectionAfter().merge({anchorKey:l,focusKey:l})})};t.exports=f},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e,n){for(var r=e;rK.length&&K.push(t)}function d(t,e,n,o){var i=typeof t;"undefined"!==i&&"boolean"!==i||(t=null);var a=!1;if(null===t)a=!0;else switch(i){case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case w:case C:case k:case x:a=!0}}if(a)return n(o,t,""===e?"."+h(t,0):e),1;if(a=0,e=""===e?".":e+":",Array.isArray(t))for(var u=0;u0||null!==d;if(h&&t.restoreEditorDOM(),t.exitCurrentMode(),e){if(r.draft_handlebeforeinput_composed_text&&t.props.handleBeforeInput&&s(t.props.handleBeforeInput(e,n)))return;var g=o.replaceText(n.getCurrentContent(),n.getSelection(),e,a,d);return void t.update(i.push(n,g,"insert-characters"))}h&&t.update(i.set(n,{nativelyRenderedContent:null,forceSelection:!0}))}}};t.exports=d},function(t,e,n){"use strict";var r=n(89);t.exports=r},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a=n(5),u=a||function(t){for(var e=1;eC,N))}var z=I||s,j={className:U,"data-block":!0,"data-editor":f,"data-offset-key":L,key:O};void 0!==A&&(j=u({},j,{contentEditable:A,suppressContentEditableWarning:!0}));var H=c.createElement(F,j,c.createElement(z,K));w.push({block:H,wrapperTemplate:P,key:O,offsetKey:L}),C=P?E.getDepth():null,k=P}for(var V=[],q=0;qthis.eventPool.length&&this.eventPool.push(t)}function j(t){t.eventPool=[],t.getPooled=U,t.release=z}function H(t,e,n,r){return B.call(this,t,e,n,r)}function V(t,e,n,r){return B.call(this,t,e,n,r)}function q(t,e){switch(t){case"topKeyUp":return-1!==dr.indexOf(e.keyCode);case"topKeyDown":return 229!==e.keyCode;case"topKeyPress":case"topMouseDown":case"topBlur":return!0;default:return!1}}function W(t){return t=t.detail,"object"==typeof t&&"data"in t?t.data:null}function G(t,e){switch(t){case"topCompositionEnd":return W(e);case"topKeyPress":return 32!==e.which?null:(Cr=!0,Sr);case"topTextInput":return t=e.data,t===Sr&&Cr?null:t;default:return null}}function $(t,e){if(kr)return"topCompositionEnd"===t||!hr&&q(t,e)?(t=P(),cr._root=null,cr._startText=null,cr._fallbackText=null,kr=!1,t):null;switch(t){case"topPaste":return null;case"topKeyPress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1jr.length&&jr.push(t)}}}function Nt(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n["ms"+t]="MS"+e,n["O"+t]="o"+e.toLowerCase(),n}function Lt(t){if(Gr[t])return Gr[t];if(!Wr[t])return t;var e,n=Wr[t];for(e in n)if(n.hasOwnProperty(e)&&e in $r)return Gr[t]=n[e];return""}function Kt(t){return Object.prototype.hasOwnProperty.call(t,Yr)||(t[Yr]=Qr++,Jr[t[Yr]]={}),Jr[t[Yr]]}function Rt(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Pt(t,e){var n=Rt(t);t=0;for(var r;n;){if(3===n.nodeType){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=Rt(n)}}function Ft(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&("input"===e&&"text"===t.type||"textarea"===e||"true"===t.contentEditable)}function Bt(t,e){if(oo||null==eo||eo!==kn())return null;var n=eo;return"selectionStart"in n&&Ft(n)?n={start:n.selectionStart,end:n.selectionEnd}:window.getSelection?(n=window.getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}):n=void 0,ro&&xn(ro,n)?null:(ro=n,t=B.getPooled(to.select,no,t,e),t.type="select",t.target=eo,L(t),t)}function Ut(t,e,n,r){return B.call(this,t,e,n,r)}function zt(t,e,n,r){return B.call(this,t,e,n,r)}function jt(t,e,n,r){return B.call(this,t,e,n,r)}function Ht(t){var e=t.keyCode;return"charCode"in t?0===(t=t.charCode)&&13===e&&(t=13):t=e,32<=t||13===t?t:0}function Vt(t,e,n,r){return B.call(this,t,e,n,r)}function qt(t,e,n,r){return B.call(this,t,e,n,r)}function Wt(t,e,n,r){return B.call(this,t,e,n,r)}function Gt(t,e,n,r){return B.call(this,t,e,n,r)}function $t(t,e,n,r){return B.call(this,t,e,n,r)}function Xt(t){0>po||(t.current=fo[po],fo[po]=null,po--)}function Jt(t,e){po++,fo[po]=t.current,t.current=e}function Qt(t){return Zt(t)?yo:ho.current}function Yt(t,e){var n=t.type.contextTypes;if(!n)return Tn;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var o,i={};for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Zt(t){return 2===t.tag&&null!=t.type.childContextTypes}function te(t){Zt(t)&&(Xt(go,t),Xt(ho,t))}function ee(t,e,n){null!=ho.cursor&&r("168"),Jt(ho,e,t),Jt(go,n,t)}function ne(t,e){var n=t.stateNode,o=t.type.childContextTypes;if("function"!=typeof n.getChildContext)return e;n=n.getChildContext();for(var i in n)i in o||r("108",St(t)||"Unknown",i);return Sn({},e,n)}function re(t){if(!Zt(t))return!1;var e=t.stateNode;return e=e&&e.__reactInternalMemoizedMergedChildContext||Tn,yo=ho.current,Jt(ho,e,t),Jt(go,go.current,t),!0}function oe(t,e){var n=t.stateNode;if(n||r("169"),e){var o=ne(t,yo);n.__reactInternalMemoizedMergedChildContext=o,Xt(go,t),Xt(ho,t),Jt(ho,o,t)}else Xt(go,t);Jt(go,e,t)}function ie(t,e,n){this.tag=t,this.key=e,this.stateNode=this.type=null,this.sibling=this.child=this.return=null,this.index=0,this.memoizedState=this.updateQueue=this.memoizedProps=this.pendingProps=this.ref=null,this.internalContextTag=n,this.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.expirationTime=0,this.alternate=null}function ae(t,e,n){var r=t.alternate;return null===r?(r=new ie(t.tag,t.key,t.internalContextTag),r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.effectTag=0,r.nextEffect=null,r.firstEffect=null,r.lastEffect=null),r.expirationTime=n,r.pendingProps=e,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function ue(t,e,n){var o=void 0,i=t.type,a=t.key;return"function"==typeof i?(o=i.prototype&&i.prototype.isReactComponent?new ie(2,a,e):new ie(0,a,e),o.type=i,o.pendingProps=t.props):"string"==typeof i?(o=new ie(5,a,e),o.type=i,o.pendingProps=t.props):"object"==typeof i&&null!==i&&"number"==typeof i.tag?(o=i,o.pendingProps=t.props):r("130",null==i?i:typeof i,""),o.expirationTime=n,o}function se(t,e,n,r){return e=new ie(10,r,e),e.pendingProps=t,e.expirationTime=n,e}function le(t,e,n){return e=new ie(6,null,e),e.pendingProps=t,e.expirationTime=n,e}function ce(t,e,n){return e=new ie(7,t.key,e),e.type=t.handler,e.pendingProps=t,e.expirationTime=n,e}function fe(t,e,n){return t=new ie(9,null,e),t.expirationTime=n,t}function pe(t,e,n){return e=new ie(4,t.key,e),e.pendingProps=t.children||[],e.expirationTime=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function de(t){return function(e){try{return t(e)}catch(t){}}}function he(t){if("undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var e=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(e.isDisabled||!e.supportsFiber)return!0;try{var n=e.inject(t);vo=de(function(t){return e.onCommitFiberRoot(n,t)}),mo=de(function(t){return e.onCommitFiberUnmount(n,t)})}catch(t){}return!0}function ge(t){"function"==typeof vo&&vo(t)}function ye(t){"function"==typeof mo&&mo(t)}function ve(t){return{baseState:t,expirationTime:0,first:null,last:null,callbackList:null,hasForceUpdate:!1,isInitialized:!1}}function me(t,e){null===t.last?t.first=t.last=e:(t.last.next=e,t.last=e),(0===t.expirationTime||t.expirationTime>e.expirationTime)&&(t.expirationTime=e.expirationTime)}function be(t,e){var n=t.alternate,r=t.updateQueue;null===r&&(r=t.updateQueue=ve(null)),null!==n?null===(t=n.updateQueue)&&(t=n.updateQueue=ve(null)):t=null,t=t!==r?t:null,null===t?me(r,e):null===r.last||null===t.last?(me(r,e),me(t,e)):(me(r,e),t.last=e)}function _e(t,e,n,r){return t=t.partialState,"function"==typeof t?t.call(e,n,r):t}function Se(t,e,n,r,o,i){null!==t&&t.updateQueue===n&&(n=e.updateQueue={baseState:n.baseState,expirationTime:n.expirationTime,first:n.first,last:n.last,isInitialized:n.isInitialized,callbackList:null,hasForceUpdate:!1}),n.expirationTime=0,n.isInitialized?t=n.baseState:(t=n.baseState=e.memoizedState,n.isInitialized=!0);for(var a=!0,u=n.first,s=!1;null!==u;){var l=u.expirationTime;if(l>i){var c=n.expirationTime;(0===c||c>l)&&(n.expirationTime=l),s||(s=!0,n.baseState=t)}else s||(n.first=u.next,null===n.first&&(n.last=null)),u.isReplace?(t=_e(u,r,t,o),a=!0):(l=_e(u,r,t,o))&&(t=a?Sn({},t,l):Sn(t,l),a=!1),u.isForced&&(n.hasForceUpdate=!0),null!==u.callback&&(l=n.callbackList,null===l&&(l=n.callbackList=[]),l.push(u));u=u.next}return null!==n.callbackList?e.effectTag|=32:null!==n.first||n.hasForceUpdate||(e.updateQueue=null),s||(n.baseState=t),t}function we(t,e){var n=t.callbackList;if(null!==n)for(t.callbackList=null,t=0;tp?(d=f,f=null):d=f.sibling;var v=g(r,f,u[p],s);if(null===v){null===f&&(f=d);break}t&&f&&null===v.alternate&&e(r,f),i=a(v,i,p),null===c?l=v:c.sibling=v,c=v,f=d}if(p===u.length)return n(r,f),l;if(null===f){for(;pd?(v=p,p=null):v=p.sibling;var b=g(i,p,m.value,l);if(null===b){p||(p=v);break}t&&p&&null===b.alternate&&e(i,p),u=a(b,u,d),null===f?c=b:f.sibling=b,f=b,p=v}if(m.done)return n(i,p),c;if(null===p){for(;!m.done;d++,m=s.next())null!==(m=h(i,m.value,l))&&(u=a(m,u,d),null===f?c=m:f.sibling=m,f=m);return c}for(p=o(i,p);!m.done;d++,m=s.next())null!==(m=y(p,i,d,m.value,l))&&(t&&null!==m.alternate&&p.delete(null===m.key?d:m.key),u=a(m,u,d),null===f?c=m:f.sibling=m,f=m);return t&&p.forEach(function(t){return e(i,t)}),c}return function(t,o,a,s){"object"==typeof a&&null!==a&&a.type===ko&&null===a.key&&(a=a.props.children);var l="object"==typeof a&&null!==a;if(l)switch(a.$$typeof){case _o:t:{var c=a.key;for(l=o;null!==l;){if(l.key===c){if(10===l.tag?a.type===ko:l.type===a.type){n(t,l.sibling),o=i(l,a.type===ko?a.props.children:a.props,s),o.ref=xe(l,a),o.return=t,t=o;break t}n(t,l);break}e(t,l),l=l.sibling}a.type===ko?(o=se(a.props.children,t.internalContextTag,s,a.key),o.return=t,t=o):(s=ue(a,t.internalContextTag,s),s.ref=xe(o,a),s.return=t,t=s)}return u(t);case So:t:{for(l=a.key;null!==o;){if(o.key===l){if(7===o.tag){n(t,o.sibling),o=i(o,a,s),o.return=t,t=o;break t}n(t,o);break}e(t,o),o=o.sibling}o=ce(a,t.internalContextTag,s),o.return=t,t=o}return u(t);case wo:t:{if(null!==o){if(9===o.tag){n(t,o.sibling),o=i(o,null,s),o.type=a.value,o.return=t,t=o;break t}n(t,o)}o=fe(a,t.internalContextTag,s),o.type=a.value,o.return=t,t=o}return u(t);case Co:t:{for(l=a.key;null!==o;){if(o.key===l){if(4===o.tag&&o.stateNode.containerInfo===a.containerInfo&&o.stateNode.implementation===a.implementation){n(t,o.sibling),o=i(o,a.children||[],s),o.return=t,t=o;break t}n(t,o);break}e(t,o),o=o.sibling}o=pe(a,t.internalContextTag,s),o.return=t,t=o}return u(t)}if("string"==typeof a||"number"==typeof a)return a=""+a,null!==o&&6===o.tag?(n(t,o.sibling),o=i(o,a,s)):(n(t,o),o=le(a,t.internalContextTag,s)),o.return=t,t=o,u(t);if(Eo(a))return v(t,o,a,s);if(ke(a))return m(t,o,a,s);if(l&&Ee(t,a),void 0===a)switch(t.tag){case 2:case 1:s=t.type,r("152",s.displayName||s.name||"Component")}return n(t,o)}}function Te(t,e,n,o,i){function a(t,e,n){var r=e.expirationTime;e.child=null===t?To(e,null,n,r):Oo(e,t.child,n,r)}function u(t,e){var n=e.ref;null===n||t&&t.ref===n||(e.effectTag|=128)}function s(t,e,n,r){if(u(t,e),!n)return r&&oe(e,!1),c(t,e);n=e.stateNode,zr.current=e;var o=n.render();return e.effectTag|=1,a(t,e,o),e.memoizedState=n.state,e.memoizedProps=n.props,r&&oe(e,!0),e.child}function l(t){var e=t.stateNode;e.pendingContext?ee(t,e.pendingContext,e.pendingContext!==e.context):e.context&&ee(t,e.context,!1),y(t,e.containerInfo)}function c(t,e){if(null!==t&&e.child!==t.child&&r("153"),null!==e.child){t=e.child;var n=ae(t,t.pendingProps,t.expirationTime);for(e.child=n,n.return=e;null!==t.sibling;)t=t.sibling,n=n.sibling=ae(t,t.pendingProps,t.expirationTime),n.return=e;n.sibling=null}return e.child}function f(t,e){switch(e.tag){case 3:l(e);break;case 2:re(e);break;case 4:y(e,e.stateNode.containerInfo)}return null}var p=t.shouldSetTextContent,d=t.useSyncScheduling,h=t.shouldDeprioritizeSubtree,g=e.pushHostContext,y=e.pushHostContainer,v=n.enterHydrationState,m=n.resetHydrationState,b=n.tryToClaimNextHydratableInstance;t=Ce(o,i,function(t,e){t.memoizedProps=e},function(t,e){t.memoizedState=e});var _=t.adoptClassInstance,S=t.constructClassInstance,w=t.mountClassInstance,C=t.updateClassInstance;return{beginWork:function(t,e,n){if(0===e.expirationTime||e.expirationTime>n)return f(t,e);switch(e.tag){case 0:null!==t&&r("155");var o=e.type,i=e.pendingProps,k=Qt(e);return k=Yt(e,k),o=o(i,k),e.effectTag|=1,"object"==typeof o&&null!==o&&"function"==typeof o.render?(e.tag=2,i=re(e),_(e,o),w(e,n),e=s(t,e,!0,i)):(e.tag=1,a(t,e,o),e.memoizedProps=i,e=e.child),e;case 1:t:{if(i=e.type,n=e.pendingProps,o=e.memoizedProps,go.current)null===n&&(n=o);else if(null===n||o===n){e=c(t,e);break t}o=Qt(e),o=Yt(e,o),i=i(n,o),e.effectTag|=1,a(t,e,i),e.memoizedProps=n,e=e.child}return e;case 2:return i=re(e),o=void 0,null===t?e.stateNode?r("153"):(S(e,e.pendingProps),w(e,n),o=!0):o=C(t,e,n),s(t,e,o,i);case 3:return l(e),i=e.updateQueue,null!==i?(o=e.memoizedState,i=Se(t,e,i,null,null,n),o===i?(m(),e=c(t,e)):(o=i.element,k=e.stateNode,(null===t||null===t.child)&&k.hydrate&&v(e)?(e.effectTag|=2,e.child=To(e,null,o,n)):(m(),a(t,e,o)),e.memoizedState=i,e=e.child)):(m(),e=c(t,e)),e;case 5:g(e),null===t&&b(e),i=e.type;var x=e.memoizedProps;return o=e.pendingProps,null===o&&null===(o=x)&&r("154"),k=null!==t?t.memoizedProps:null,go.current||null!==o&&x!==o?(x=o.children,p(i,o)?x=null:k&&p(i,k)&&(e.effectTag|=16),u(t,e),2147483647!==n&&!d&&h(i,o)?(e.expirationTime=2147483647,e=null):(a(t,e,x),e.memoizedProps=o,e=e.child)):e=c(t,e),e;case 6:return null===t&&b(e),t=e.pendingProps,null===t&&(t=e.memoizedProps),e.memoizedProps=t,null;case 8:e.tag=7;case 7:return i=e.pendingProps,go.current?null===i&&null===(i=t&&t.memoizedProps)&&r("154"):null!==i&&e.memoizedProps!==i||(i=e.memoizedProps),o=i.children,e.stateNode=null===t?To(e,e.stateNode,o,n):Oo(e,e.stateNode,o,n),e.memoizedProps=i,e.stateNode;case 9:return null;case 4:t:{if(y(e,e.stateNode.containerInfo),i=e.pendingProps,go.current)null===i&&null==(i=t&&t.memoizedProps)&&r("154");else if(null===i||e.memoizedProps===i){e=c(t,e);break t}null===t?e.child=Oo(e,null,i,n):a(t,e,i),e.memoizedProps=i,e=e.child}return e;case 10:t:{if(n=e.pendingProps,go.current)null===n&&(n=e.memoizedProps);else if(null===n||e.memoizedProps===n){e=c(t,e);break t}a(t,e,n),e.memoizedProps=n,e=e.child}return e;default:r("156")}},beginFailedWork:function(t,e,n){switch(e.tag){case 2:re(e);break;case 3:l(e);break;default:r("157")}return e.effectTag|=64,null===t?e.child=null:e.child!==t.child&&(e.child=t.child),0===e.expirationTime||e.expirationTime>n?f(t,e):(e.firstEffect=null,e.lastEffect=null,e.child=null===t?To(e,null,null,n):Oo(e,t.child,null,n),2===e.tag&&(t=e.stateNode,e.memoizedProps=t.props,e.memoizedState=t.state),e.child)}}}function De(t,e,n){function o(t){t.effectTag|=4}var i=t.createInstance,a=t.createTextInstance,u=t.appendInitialChild,s=t.finalizeInitialChildren,l=t.prepareUpdate,c=t.persistence,f=e.getRootHostContainer,p=e.popHostContext,d=e.getHostContext,h=e.popHostContainer,g=n.prepareToHydrateHostInstance,y=n.prepareToHydrateHostTextInstance,v=n.popHydrationState,m=void 0,b=void 0,_=void 0;return t.mutation?(m=function(){},b=function(t,e,n){(e.updateQueue=n)&&o(e)},_=function(t,e,n,r){n!==r&&o(e)}):r(c?"235":"236"),{completeWork:function(t,e,n){var c=e.pendingProps;switch(null===c?c=e.memoizedProps:2147483647===e.expirationTime&&2147483647!==n||(e.pendingProps=null),e.tag){case 1:return null;case 2:return te(e),null;case 3:return h(e),Xt(go,e),Xt(ho,e),c=e.stateNode,c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),null!==t&&null!==t.child||(v(e),e.effectTag&=-3),m(e),null;case 5:p(e),n=f();var S=e.type;if(null!==t&&null!=e.stateNode){var w=t.memoizedProps,C=e.stateNode,k=d();C=l(C,S,w,c,n,k),b(t,e,C,S,w,c,n),t.ref!==e.ref&&(e.effectTag|=128)}else{if(!c)return null===e.stateNode&&r("166"),null;if(t=d(),v(e))g(e,n,t)&&o(e);else{t=i(S,c,n,t,e);t:for(w=e.child;null!==w;){if(5===w.tag||6===w.tag)u(t,w.stateNode);else if(4!==w.tag&&null!==w.child){w.child.return=w,w=w.child;continue}if(w===e)break;for(;null===w.sibling;){if(null===w.return||w.return===e)break t;w=w.return}w.sibling.return=w.return,w=w.sibling}s(t,S,c,n)&&o(e),e.stateNode=t}null!==e.ref&&(e.effectTag|=128)}return null;case 6:if(t&&null!=e.stateNode)_(t,e,t.memoizedProps,c);else{if("string"!=typeof c)return null===e.stateNode&&r("166"),null;t=f(),n=d(),v(e)?y(e)&&o(e):e.stateNode=a(c,t,n,e)}return null;case 7:(c=e.memoizedProps)||r("165"),e.tag=8,S=[];t:for((w=e.stateNode)&&(w.return=e);null!==w;){if(5===w.tag||6===w.tag||4===w.tag)r("247");else if(9===w.tag)S.push(w.type);else if(null!==w.child){w.child.return=w,w=w.child;continue}for(;null===w.sibling;){if(null===w.return||w.return===e)break t;w=w.return}w.sibling.return=w.return,w=w.sibling}return w=c.handler,c=w(c.props,S),e.child=Oo(e,null!==t?t.child:null,c,n),e.child;case 8:return e.tag=7,null;case 9:case 10:return null;case 4:return h(e),m(e),null;case 0:r("167");default:r("156")}}}}function Ie(t,e){function n(t){var n=t.ref;if(null!==n)try{n(null)}catch(n){e(t,n)}}function o(t){switch("function"==typeof ye&&ye(t),t.tag){case 2:n(t);var r=t.stateNode;if("function"==typeof r.componentWillUnmount)try{r.props=t.memoizedProps,r.state=t.memoizedState,r.componentWillUnmount()}catch(n){e(t,n)}break;case 5:n(t);break;case 7:i(t.stateNode);break;case 4:l&&u(t)}}function i(t){for(var e=t;;)if(o(e),null===e.child||l&&4===e.tag){if(e===t)break;for(;null===e.sibling;){if(null===e.return||e.return===t)return;e=e.return}e.sibling.return=e.return,e=e.sibling}else e.child.return=e,e=e.child}function a(t){return 5===t.tag||3===t.tag||4===t.tag}function u(t){for(var e=t,n=!1,a=void 0,u=void 0;;){if(!n){n=e.return;t:for(;;){switch(null===n&&r("160"),n.tag){case 5:a=n.stateNode,u=!1;break t;case 3:case 4:a=n.stateNode.containerInfo,u=!0;break t}n=n.return}n=!0}if(5===e.tag||6===e.tag)i(e),u?b(a,e.stateNode):m(a,e.stateNode);else if(4===e.tag?a=e.stateNode.containerInfo:o(e),null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break;for(;null===e.sibling;){if(null===e.return||e.return===t)return;e=e.return,4===e.tag&&(n=!1)}e.sibling.return=e.return,e=e.sibling}}var s=t.getPublicInstance,l=t.mutation;t=t.persistence,l||r(t?"235":"236");var c=l.commitMount,f=l.commitUpdate,p=l.resetTextContent,d=l.commitTextUpdate,h=l.appendChild,g=l.appendChildToContainer,y=l.insertBefore,v=l.insertInContainerBefore,m=l.removeChild,b=l.removeChildFromContainer;return{commitResetTextContent:function(t){p(t.stateNode)},commitPlacement:function(t){t:{for(var e=t.return;null!==e;){if(a(e)){var n=e;break t}e=e.return}r("160"),n=void 0}var o=e=void 0;switch(n.tag){case 5:e=n.stateNode,o=!1;break;case 3:case 4:e=n.stateNode.containerInfo,o=!0;break;default:r("161")}16&n.effectTag&&(p(e),n.effectTag&=-17);t:e:for(n=t;;){for(;null===n.sibling;){if(null===n.return||a(n.return)){n=null;break t}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag;){if(2&n.effectTag)continue e;if(null===n.child||4===n.tag)continue e;n.child.return=n,n=n.child}if(!(2&n.effectTag)){n=n.stateNode;break t}}for(var i=t;;){if(5===i.tag||6===i.tag)n?o?v(e,i.stateNode,n):y(e,i.stateNode,n):o?g(e,i.stateNode):h(e,i.stateNode);else if(4!==i.tag&&null!==i.child){i.child.return=i,i=i.child;continue}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}},commitDeletion:function(t){u(t),t.return=null,t.child=null,t.alternate&&(t.alternate.child=null,t.alternate.return=null)},commitWork:function(t,e){switch(e.tag){case 2:break;case 5:var n=e.stateNode;if(null!=n){var o=e.memoizedProps;t=null!==t?t.memoizedProps:o;var i=e.type,a=e.updateQueue;e.updateQueue=null,null!==a&&f(n,a,i,t,o,e)}break;case 6:null===e.stateNode&&r("162"),n=e.memoizedProps,d(e.stateNode,null!==t?t.memoizedProps:n,n);break;case 3:break;default:r("163")}},commitLifeCycles:function(t,e){switch(e.tag){case 2:var n=e.stateNode;if(4&e.effectTag)if(null===t)n.props=e.memoizedProps,n.state=e.memoizedState,n.componentDidMount();else{var o=t.memoizedProps;t=t.memoizedState,n.props=e.memoizedProps,n.state=e.memoizedState,n.componentDidUpdate(o,t)}e=e.updateQueue,null!==e&&we(e,n);break;case 3:n=e.updateQueue,null!==n&&we(n,null!==e.child?e.child.stateNode:null);break;case 5:n=e.stateNode,null===t&&4&e.effectTag&&c(n,e.type,e.memoizedProps,e);break;case 6:case 4:break;default:r("163")}},commitAttachRef:function(t){var e=t.ref;if(null!==e){var n=t.stateNode;switch(t.tag){case 5:e(s(n));break;default:e(n)}}},commitDetachRef:function(t){null!==(t=t.ref)&&t(null)}}}function Me(t){function e(t){return t===Do&&r("174"),t}var n=t.getChildHostContext,o=t.getRootHostContext,i={current:Do},a={current:Do},u={current:Do};return{getHostContext:function(){return e(i.current)},getRootHostContainer:function(){return e(u.current)},popHostContainer:function(t){Xt(i,t),Xt(a,t),Xt(u,t)},popHostContext:function(t){a.current===t&&(Xt(i,t),Xt(a,t))},pushHostContainer:function(t,e){Jt(u,e,t),e=o(e),Jt(a,t,t),Jt(i,e,t)},pushHostContext:function(t){var r=e(u.current),o=e(i.current);r=n(o,t.type,r),o!==r&&(Jt(a,t,t),Jt(i,r,t))},resetHostContainer:function(){i.current=Do,u.current=Do}}}function Ae(t){function e(t,e){var n=new ie(5,null,0);n.type="DELETED",n.stateNode=e,n.return=t,n.effectTag=8,null!==t.lastEffect?(t.lastEffect.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n}function n(t,e){switch(t.tag){case 5:return null!==(e=a(e,t.type,t.pendingProps))&&(t.stateNode=e,!0);case 6:return null!==(e=u(e,t.pendingProps))&&(t.stateNode=e,!0);default:return!1}}function o(t){for(t=t.return;null!==t&&5!==t.tag&&3!==t.tag;)t=t.return;p=t}var i=t.shouldSetTextContent;if(!(t=t.hydration))return{enterHydrationState:function(){return!1},resetHydrationState:function(){},tryToClaimNextHydratableInstance:function(){},prepareToHydrateHostInstance:function(){r("175")},prepareToHydrateHostTextInstance:function(){r("176")},popHydrationState:function(){return!1}};var a=t.canHydrateInstance,u=t.canHydrateTextInstance,s=t.getNextHydratableSibling,l=t.getFirstHydratableChild,c=t.hydrateInstance,f=t.hydrateTextInstance,p=null,d=null,h=!1;return{enterHydrationState:function(t){return d=l(t.stateNode.containerInfo),p=t,h=!0},resetHydrationState:function(){d=p=null,h=!1},tryToClaimNextHydratableInstance:function(t){if(h){var r=d;if(r){if(!n(t,r)){if(!(r=s(r))||!n(t,r))return t.effectTag|=2,h=!1,void(p=t);e(p,d)}p=t,d=l(r)}else t.effectTag|=2,h=!1,p=t}},prepareToHydrateHostInstance:function(t,e,n){return e=c(t.stateNode,t.type,t.memoizedProps,e,n,t),t.updateQueue=e,null!==e},prepareToHydrateHostTextInstance:function(t){return f(t.stateNode,t.memoizedProps,t)},popHydrationState:function(t){if(t!==p)return!1;if(!h)return o(t),h=!0,!1;var n=t.type;if(5!==t.tag||"head"!==n&&"body"!==n&&!i(n,t.memoizedProps))for(n=d;n;)e(t,n),n=s(n);return o(t),d=p?s(t.stateNode):null,!0}}}function Ne(t){function e(t){it=X=!0;var e=t.stateNode;if(e.current===t&&r("177"),e.isReadyForCommit=!1,zr.current=null,1a.expirationTime)&&(i=a.expirationTime),a=a.sibling;o.expirationTime=i}if(null!==e)return e;if(null!==n&&(null===n.firstEffect&&(n.firstEffect=t.firstEffect),null!==t.lastEffect&&(null!==n.lastEffect&&(n.lastEffect.nextEffect=t.firstEffect),n.lastEffect=t.lastEffect),1t))if(Y<=G)for(;null!==J;)J=l(J)?i(J):o(J);else for(;null!==J&&!w();)J=l(J)?i(J):o(J)}else if(!(0===Y||Y>t))if(Y<=G)for(;null!==J;)J=o(J);else for(;null!==J&&!w();)J=o(J)}function u(t,e){if(X&&r("243"),X=!0,t.isReadyForCommit=!1,t!==Q||e!==Y||null===J){for(;-1e)&&(t.expirationTime=e),null!==t.alternate&&(0===t.alternate.expirationTime||t.alternate.expirationTime>e)&&(t.alternate.expirationTime=e),null===t.return){if(3!==t.tag)break;var n=t.stateNode;!X&&n===Q&&e_t&&r("185"),null===o.nextScheduledRoot)o.remainingExpirationTime=i,null===st?(ut=st=o,o.nextScheduledRoot=o):(st=st.nextScheduledRoot=o,st.nextScheduledRoot=ut);else{var a=o.remainingExpirationTime;(0===a||ilt)return;j(ct)}var e=U()-W;lt=t,ct=z(b,{timeout:10*(t-2)-e})}function m(){var t=0,e=null;if(null!==st)for(var n=st,o=ut;null!==o;){var i=o.remainingExpirationTime;if(0===i){if((null===n||null===st)&&r("244"),o===o.nextScheduledRoot){ut=st=o.nextScheduledRoot=null;break}if(o===ut)ut=i=o.nextScheduledRoot,st.nextScheduledRoot=i,o.nextScheduledRoot=null;else{if(o===st){st=n,st.nextScheduledRoot=ut,o.nextScheduledRoot=null;break}n.nextScheduledRoot=o.nextScheduledRoot,o.nextScheduledRoot=null}o=n.nextScheduledRoot}else{if((0===t||iCt)&&(ht=!0)}function C(t){null===pt&&r("246"),pt.remainingExpirationTime=0,gt||(gt=!0,yt=t)}var k=Me(t),x=Ae(t),E=k.popHostContainer,O=k.popHostContext,T=k.resetHostContainer,D=Te(t,k,x,d,p),I=D.beginWork,M=D.beginFailedWork,A=De(t,k,x).completeWork;k=Ie(t,s);var N=k.commitResetTextContent,L=k.commitPlacement,K=k.commitDeletion,R=k.commitWork,P=k.commitLifeCycles,F=k.commitAttachRef,B=k.commitDetachRef,U=t.now,z=t.scheduleDeferredCallback,j=t.cancelDeferredCallback,H=t.useSyncScheduling,V=t.prepareForCommit,q=t.resetAfterCommit,W=U(),G=2,$=0,X=!1,J=null,Q=null,Y=0,Z=null,tt=null,et=null,nt=null,rt=null,ot=!1,it=!1,at=!1,ut=null,st=null,lt=0,ct=-1,ft=!1,pt=null,dt=0,ht=!1,gt=!1,yt=null,vt=null,mt=!1,bt=!1,_t=1e3,wt=0,Ct=1;return{computeAsyncExpiration:f,computeExpirationForFiber:p,scheduleWork:d,batchedUpdates:function(t,e){var n=mt;mt=!0;try{return t(e)}finally{(mt=n)||ft||_(1,null)}},unbatchedUpdates:function(t){if(mt&&!bt){bt=!0;try{return t()}finally{bt=!1}}return t()},flushSync:function(t){var e=mt;mt=!0;try{t:{var n=$;$=1;try{var o=t();break t}finally{$=n}o=void 0}return o}finally{mt=e,ft&&r("187"),_(1,null)}},deferredUpdates:function(t){var e=$;$=f();try{return t()}finally{$=e}}}}function Le(t){function e(t){return t=Et(t),null===t?null:t.stateNode}var n=t.getPublicInstance;t=Ne(t);var o=t.computeAsyncExpiration,i=t.computeExpirationForFiber,a=t.scheduleWork;return{createContainer:function(t,e){var n=new ie(3,null,0);return t={current:n,containerInfo:t,pendingChildren:null,remainingExpirationTime:0,isReadyForCommit:!1,finishedWork:null,context:null,pendingContext:null,hydrate:e,nextScheduledRoot:null},n.stateNode=t},updateContainer:function(t,e,n,u){var s=e.current;if(n){n=n._reactInternalFiber;var l;t:{for(2===wt(n)&&2===n.tag||r("170"),l=n;3!==l.tag;){if(Zt(l)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break t}(l=l.return)||r("171")}l=l.stateNode.context}n=Zt(n)?ne(n,l):l}else n=Tn;null===e.context?e.context=n:e.pendingContext=n,e=u,e=void 0===e?null:e,u=null!=t&&null!=t.type&&null!=t.type.prototype&&!0===t.type.prototype.unstable_isAsyncReactComponent?o():i(s),be(s,{expirationTime:u,partialState:{element:t},callback:e,isReplace:!1,isForced:!1,nextCallback:null,next:null}),a(s,u)},batchedUpdates:t.batchedUpdates,unbatchedUpdates:t.unbatchedUpdates,deferredUpdates:t.deferredUpdates,flushSync:t.flushSync,getPublicRootInstance:function(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return n(t.child.stateNode);default:return t.child.stateNode}},findHostInstance:e,findHostInstanceWithNoPortals:function(t){return t=Ot(t),null===t?null:t.stateNode},injectIntoDevTools:function(t){var n=t.findFiberByHostInstance;return he(Sn({},t,{findHostInstanceByFiber:function(t){return e(t)},findFiberByHostInstance:function(t){return n?n(t):null}}))}}}function Ke(t,e,n){var r=3n||r.hasOverloadedBooleanValue&&!1===n?Be(t,e):r.mustUseProperty?t[r.propertyName]=n:(e=r.attributeName,(o=r.attributeNamespace)?t.setAttributeNS(o,e,""+n):r.hasBooleanValue||r.hasOverloadedBooleanValue&&!0===n?t.setAttribute(e,""):t.setAttribute(e,""+n))}else Fe(t,e,i(e,n)?n:null)}function Fe(t,e,n){Re(e)&&(null==n?t.removeAttribute(e):t.setAttribute(e,""+n))}function Be(t,e){var n=a(e);n?(e=n.mutationMethod)?e(t,void 0):n.mustUseProperty?t[n.propertyName]=!n.hasBooleanValue&&"":t.removeAttribute(n.attributeName):t.removeAttribute(e)}function Ue(t,e){var n=e.value,r=e.checked;return Sn({type:void 0,step:void 0,min:void 0,max:void 0},e,{defaultChecked:void 0,defaultValue:void 0,value:null!=n?n:t._wrapperState.initialValue,checked:null!=r?r:t._wrapperState.initialChecked})}function ze(t,e){var n=e.defaultValue;t._wrapperState={initialChecked:null!=e.checked?e.checked:e.defaultChecked,initialValue:null!=e.value?e.value:n,controlled:"checkbox"===e.type||"radio"===e.type?null!=e.checked:null!=e.value}}function je(t,e){null!=(e=e.checked)&&Pe(t,"checked",e)}function He(t,e){je(t,e);var n=e.value;null!=n?0===n&&""===t.value?t.value="0":"number"===e.type?(e=parseFloat(t.value)||0,(n!=e||n==e&&t.value!=n)&&(t.value=""+n)):t.value!==""+n&&(t.value=""+n):(null==e.value&&null!=e.defaultValue&&t.defaultValue!==""+e.defaultValue&&(t.defaultValue=""+e.defaultValue),null==e.checked&&null!=e.defaultChecked&&(t.defaultChecked=!!e.defaultChecked))}function Ve(t,e){switch(e.type){case"submit":case"reset":break;case"color":case"date":case"datetime":case"datetime-local":case"month":case"time":case"week":t.value="",t.value=t.defaultValue;break;default:t.value=t.value}e=t.name,""!==e&&(t.name=""),t.defaultChecked=!t.defaultChecked,t.defaultChecked=!t.defaultChecked,""!==e&&(t.name=e)}function qe(t){var e="";return bn.Children.forEach(t,function(t){null==t||"string"!=typeof t&&"number"!=typeof t||(e+=t)}),e}function We(t,e){return t=Sn({children:void 0},e),(e=qe(e.children))&&(t.children=e),t}function Ge(t,e,n,r){if(t=t.options,e){e={};for(var o=0;o=e.length||r("93"),e=e[0]),n=""+e),null==n&&(n="")),t._wrapperState={initialValue:""+n}}function Qe(t,e){var n=e.value;null!=n&&(n=""+n,n!==t.value&&(t.value=n),null==e.defaultValue&&(t.defaultValue=n)),null!=e.defaultValue&&(t.defaultValue=e.defaultValue)}function Ye(t){var e=t.textContent;e===t._wrapperState.initialValue&&(t.value=e)}function Ze(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function tn(t,e){return null==t||"http://www.w3.org/1999/xhtml"===t?Ze(e):"http://www.w3.org/2000/svg"===t&&"foreignObject"===e?"http://www.w3.org/1999/xhtml":t}function en(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&3===n.nodeType)return void(n.nodeValue=e)}t.textContent=e}function nn(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=0===n.indexOf("--"),o=n,i=e[n];o=null==i||"boolean"==typeof i||""===i?"":r||"number"!=typeof i||0===i||Zo.hasOwnProperty(o)&&Zo[o]?(""+i).trim():i+"px","float"===n&&(n="cssFloat"),r?t.setProperty(n,o):t[n]=o}}function rn(t,e,n){e&&(ei[t]&&(null!=e.children||null!=e.dangerouslySetInnerHTML)&&r("137",t,n()),null!=e.dangerouslySetInnerHTML&&(null!=e.children&&r("60"),"object"==typeof e.dangerouslySetInnerHTML&&"__html"in e.dangerouslySetInnerHTML||r("61")),null!=e.style&&"object"!=typeof e.style&&r("62",n()))}function on(t,e){if(-1===t.indexOf("-"))return"string"==typeof e.is;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function an(t,e){t=9===t.nodeType||11===t.nodeType?t:t.ownerDocument;var n=Kt(t);e=Jn[e];for(var r=0;r<\/script>",t=t.removeChild(t.firstChild)):t="string"==typeof e.is?n.createElement(t,{is:e.is}):n.createElement(t):t=n.createElementNS(r,t),t}function sn(t,e){return(9===e.nodeType?e:e.ownerDocument).createTextNode(t)}function ln(t,e,n,r){var o=on(e,n);switch(e){case"iframe":case"object":It("topLoad","load",t);var i=n;break;case"video":case"audio":for(i in oi)oi.hasOwnProperty(i)&&It(i,oi[i],t);i=n;break;case"source":It("topError","error",t),i=n;break;case"img":case"image":It("topError","error",t),It("topLoad","load",t),i=n;break;case"form":It("topReset","reset",t),It("topSubmit","submit",t),i=n;break;case"details":It("topToggle","toggle",t),i=n;break;case"input":ze(t,n),i=Ue(t,n),It("topInvalid","invalid",t),an(r,"onChange");break;case"option":i=We(t,n);break;case"select":$e(t,n),i=Sn({},n,{value:void 0}),It("topInvalid","invalid",t),an(r,"onChange");break;case"textarea":Je(t,n),i=Xe(t,n),It("topInvalid","invalid",t),an(r,"onChange");break;default:i=n}rn(e,i,ri);var a,u=i;for(a in u)if(u.hasOwnProperty(a)){var s=u[a];"style"===a?nn(t,s,ri):"dangerouslySetInnerHTML"===a?null!=(s=s?s.__html:void 0)&&Yo(t,s):"children"===a?"string"==typeof s?("textarea"!==e||""!==s)&&en(t,s):"number"==typeof s&&en(t,""+s):"suppressContentEditableWarning"!==a&&"suppressHydrationWarning"!==a&&"autoFocus"!==a&&(Xn.hasOwnProperty(a)?null!=s&&an(r,a):o?Fe(t,a,s):null!=s&&Pe(t,a,s))}switch(e){case"input":it(t),Ve(t,n);break;case"textarea":it(t),Ye(t,n);break;case"option":null!=n.value&&t.setAttribute("value",n.value);break;case"select":t.multiple=!!n.multiple,e=n.value,null!=e?Ge(t,!!n.multiple,e,!1):null!=n.defaultValue&&Ge(t,!!n.multiple,n.defaultValue,!0);break;default:"function"==typeof i.onClick&&(t.onclick=wn)}}function cn(t,e,n,r,o){var i=null;switch(e){case"input":n=Ue(t,n),r=Ue(t,r),i=[];break;case"option":n=We(t,n),r=We(t,r),i=[];break;case"select":n=Sn({},n,{value:void 0}),r=Sn({},r,{value:void 0}),i=[];break;case"textarea":n=Xe(t,n),r=Xe(t,r),i=[];break;default:"function"!=typeof n.onClick&&"function"==typeof r.onClick&&(t.onclick=wn)}rn(e,r,ri);var a,u;t=null;for(a in n)if(!r.hasOwnProperty(a)&&n.hasOwnProperty(a)&&null!=n[a])if("style"===a)for(u in e=n[a])e.hasOwnProperty(u)&&(t||(t={}),t[u]="");else"dangerouslySetInnerHTML"!==a&&"children"!==a&&"suppressContentEditableWarning"!==a&&"suppressHydrationWarning"!==a&&"autoFocus"!==a&&(Xn.hasOwnProperty(a)?i||(i=[]):(i=i||[]).push(a,null));for(a in r){var s=r[a];if(e=null!=n?n[a]:void 0,r.hasOwnProperty(a)&&s!==e&&(null!=s||null!=e))if("style"===a)if(e){for(u in e)!e.hasOwnProperty(u)||s&&s.hasOwnProperty(u)||(t||(t={}),t[u]="");for(u in s)s.hasOwnProperty(u)&&e[u]!==s[u]&&(t||(t={}),t[u]=s[u])}else t||(i||(i=[]),i.push(a,t)),t=s;else"dangerouslySetInnerHTML"===a?(s=s?s.__html:void 0,e=e?e.__html:void 0,null!=s&&e!==s&&(i=i||[]).push(a,""+s)):"children"===a?e===s||"string"!=typeof s&&"number"!=typeof s||(i=i||[]).push(a,""+s):"suppressContentEditableWarning"!==a&&"suppressHydrationWarning"!==a&&(Xn.hasOwnProperty(a)?(null!=s&&an(o,a),i||e===s||(i=[])):(i=i||[]).push(a,s))}return t&&(i=i||[]).push("style",t),i}function fn(t,e,n,r,o){"input"===n&&"radio"===o.type&&null!=o.name&&je(t,o),on(n,r),r=on(n,o);for(var i=0;i=s.hasBooleanValue+s.hasNumericValue+s.hasOverloadedBooleanValue||r("50",u),a.hasOwnProperty(u)&&(s.attributeName=a[u]),i.hasOwnProperty(u)&&(s.attributeNamespace=i[u]),t.hasOwnProperty(u)&&(s.mutationMethod=t[u]),Mn[u]=s}}},Mn={},An=In,Nn=An.MUST_USE_PROPERTY,Ln=An.HAS_BOOLEAN_VALUE,Kn=An.HAS_NUMERIC_VALUE,Rn=An.HAS_POSITIVE_NUMERIC_VALUE,Pn=An.HAS_OVERLOADED_BOOLEAN_VALUE,Fn=An.HAS_STRING_BOOLEAN_VALUE,Bn={Properties:{allowFullScreen:Ln,async:Ln,autoFocus:Ln,autoPlay:Ln,capture:Pn,checked:Nn|Ln,cols:Rn,contentEditable:Fn,controls:Ln,default:Ln,defer:Ln,disabled:Ln,download:Pn,draggable:Fn,formNoValidate:Ln,hidden:Ln,loop:Ln,multiple:Nn|Ln,muted:Nn|Ln,noValidate:Ln,open:Ln,playsInline:Ln,readOnly:Ln,required:Ln,reversed:Ln,rows:Rn,rowSpan:Kn,scoped:Ln,seamless:Ln,selected:Nn|Ln,size:Rn,start:Kn,span:Rn,spellCheck:Fn,style:0,tabIndex:0,itemScope:Ln,acceptCharset:0,className:0,htmlFor:0,httpEquiv:0,value:Fn},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMMutationMethods:{value:function(t,e){if(null==e)return t.removeAttribute("value");"number"!==t.type||!1===t.hasAttribute("value")?t.setAttribute("value",""+e):t.validity&&!t.validity.badInput&&t.ownerDocument.activeElement!==t&&t.setAttribute("value",""+e)}}},Un=An.HAS_STRING_BOOLEAN_VALUE,zn={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},jn={Properties:{autoReverse:Un,externalResourcesRequired:Un,preserveAlpha:Un},DOMAttributeNames:{autoReverse:"autoReverse",externalResourcesRequired:"externalResourcesRequired",preserveAlpha:"preserveAlpha"},DOMAttributeNamespaces:{xlinkActuate:zn.xlink,xlinkArcrole:zn.xlink,xlinkHref:zn.xlink,xlinkRole:zn.xlink,xlinkShow:zn.xlink,xlinkTitle:zn.xlink,xlinkType:zn.xlink,xmlBase:zn.xml,xmlLang:zn.xml,xmlSpace:zn.xml}},Hn=/[\-\:]([a-z])/g;"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode x-height xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type xml:base xmlns:xlink xml:lang xml:space".split(" ").forEach(function(t){var e=t.replace(Hn,u);jn.Properties[e]=0,jn.DOMAttributeNames[e]=t}),An.injectDOMPropertyConfig(Bn),An.injectDOMPropertyConfig(jn);var Vn={_caughtError:null,_hasCaughtError:!1,_rethrowError:null,_hasRethrowError:!1,injection:{injectErrorUtils:function(t){"function"!=typeof t.invokeGuardedCallback&&r("197"),s=t.invokeGuardedCallback}},invokeGuardedCallback:function(t,e,n,r,o,i,a,u,l){s.apply(Vn,arguments)},invokeGuardedCallbackAndCatchFirstError:function(t,e,n,r,o,i,a,u,s){if(Vn.invokeGuardedCallback.apply(this,arguments),Vn.hasCaughtError()){var l=Vn.clearCaughtError();Vn._hasRethrowError||(Vn._hasRethrowError=!0,Vn._rethrowError=l)}},rethrowCaughtError:function(){return l.apply(Vn,arguments)},hasCaughtError:function(){return Vn._hasCaughtError},clearCaughtError:function(){if(Vn._hasCaughtError){var t=Vn._caughtError;return Vn._caughtError=null,Vn._hasCaughtError=!1,t}r("198")}},qn=null,Wn={},Gn=[],$n={},Xn={},Jn={},Qn=Object.freeze({plugins:Gn,eventNameDispatchConfigs:$n,registrationNameModules:Xn,registrationNameDependencies:Jn,possibleRegistrationNames:null,injectEventPluginOrder:p,injectEventPluginsByName:d}),Yn=null,Zn=null,tr=null,er=null,nr={injectEventPluginOrder:p,injectEventPluginsByName:d},rr=Object.freeze({injection:nr,getListener:_,extractEvents:S,enqueueEvents:w,processEventQueue:C}),or=Math.random().toString(36).slice(2),ir="__reactInternalInstance$"+or,ar="__reactEventHandlers$"+or,ur=Object.freeze({precacheFiberNode:function(t,e){e[ir]=t},getClosestInstanceFromNode:k,getInstanceFromNode:function(t){return t=t[ir],!t||5!==t.tag&&6!==t.tag?null:t},getNodeFromInstance:x,getFiberCurrentPropsFromNode:E,updateFiberProps:function(t,e){t[ar]=e}}),sr=Object.freeze({accumulateTwoPhaseDispatches:L,accumulateTwoPhaseDispatchesSkipTarget:function(t){y(t,M)},accumulateEnterLeaveDispatches:K,accumulateDirectDispatches:function(t){y(t,N)}}),lr=null,cr={_root:null,_startText:null,_fallbackText:null},fr="dispatchConfig _targetInst nativeEvent isDefaultPrevented isPropagationStopped _dispatchListeners _dispatchInstances".split(" "),pr={type:null,target:null,currentTarget:wn.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};Sn(B.prototype,{preventDefault:function(){this.defaultPrevented=!0;var t=this.nativeEvent;t&&(t.preventDefault?t.preventDefault():"unknown"!=typeof t.returnValue&&(t.returnValue=!1),this.isDefaultPrevented=wn.thatReturnsTrue)},stopPropagation:function(){var t=this.nativeEvent;t&&(t.stopPropagation?t.stopPropagation():"unknown"!=typeof t.cancelBubble&&(t.cancelBubble=!0),this.isPropagationStopped=wn.thatReturnsTrue)},persist:function(){this.isPersistent=wn.thatReturnsTrue},isPersistent:wn.thatReturnsFalse,destructor:function(){var t,e=this.constructor.Interface;for(t in e)this[t]=null;for(e=0;e=parseInt(vr.version(),10))}var mr,br=yr,_r=_n.canUseDOM&&(!hr||gr&&8=gr),Sr=String.fromCharCode(32),wr={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["topCompositionEnd","topKeyPress","topTextInput","topPaste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"topBlur topCompositionEnd topKeyDown topKeyPress topKeyUp topMouseDown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"topBlur topCompositionStart topKeyDown topKeyPress topKeyUp topMouseDown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"topBlur topCompositionUpdate topKeyDown topKeyPress topKeyUp topMouseDown".split(" ")}},Cr=!1,kr=!1,xr={eventTypes:wr,extractEvents:function(t,e,n,r){var o;if(hr)t:{switch(t){case"topCompositionStart":var i=wr.compositionStart;break t;case"topCompositionEnd":i=wr.compositionEnd;break t;case"topCompositionUpdate":i=wr.compositionUpdate;break t}i=void 0}else kr?q(t,n)&&(i=wr.compositionEnd):"topKeyDown"===t&&229===n.keyCode&&(i=wr.compositionStart);return i?(_r&&(kr||i!==wr.compositionStart?i===wr.compositionEnd&&kr&&(o=P()):(cr._root=r,cr._startText=F(),kr=!0)),i=H.getPooled(i,e,n,r),o?i.data=o:null!==(o=W(n))&&(i.data=o),L(i),o=i):o=null,(t=br?G(t,n):$(t,n))?(e=V.getPooled(wr.beforeInput,e,n,r),e.data=t,L(e)):e=null,[o,e]}},Er=null,Or=null,Tr=null,Dr={injectFiberControlledHostComponent:function(t){Er=t}},Ir=Object.freeze({injection:Dr,enqueueStateRestore:J,restoreStateIfNeeded:Q}),Mr=!1,Ar={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};_n.canUseDOM&&(mr=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("",""));var Nr={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"topBlur topChange topClick topFocus topInput topKeyDown topKeyUp topSelectionChange".split(" ")}},Lr=null,Kr=null,Rr=!1;_n.canUseDOM&&(Rr=nt("input")&&(!document.documentMode||9=document.documentMode,to={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"topBlur topContextMenu topFocus topKeyDown topKeyUp topMouseDown topMouseUp topSelectionChange".split(" ")}},eo=null,no=null,ro=null,oo=!1,io={eventTypes:to,extractEvents:function(t,e,n,r){var o,i=r.window===r?r.document:9===r.nodeType?r:r.ownerDocument;if(!(o=!i)){t:{i=Kt(i),o=Jn.onSelect;for(var a=0;a=jo-t){if(!(-1!==Uo&&Uo<=t))return void(zo||(zo=!0,requestAnimationFrame(Wo)));Po.didTimeout=!0}else Po.didTimeout=!1;Uo=-1,t=Fo,Fo=null,null!==t&&t(Po)}},!1);var Wo=function(t){zo=!1;var e=t-jo+Vo;ee&&(e=8),Vo=e"+e+"",e=Qo.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}}),Zo={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ti=["Webkit","ms","Moz","O"];Object.keys(Zo).forEach(function(t){ti.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Zo[e]=Zo[t]})});var ei=Sn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),ni=Jo.html,ri=wn.thatReturns(""),oi={topAbort:"abort",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topSeeked:"seeked",topSeeking:"seeking",topStalled:"stalled",topSuspend:"suspend",topTimeUpdate:"timeupdate",topVolumeChange:"volumechange",topWaiting:"waiting"},ii=Object.freeze({createElement:un,createTextNode:sn,setInitialProperties:ln,diffProperties:cn,updateProperties:fn,diffHydratedProperties:pn,diffHydratedText:dn,warnForUnmatchedText:function(){},warnForDeletedHydratableElement:function(){},warnForDeletedHydratableText:function(){},warnForInsertedHydratedElement:function(){},warnForInsertedHydratedText:function(){},restoreControlledState:function(t,e,n){switch(e){case"input":if(He(t,n),e=n.name,"radio"===n.type&&null!=e){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;er&&(o=r,r=t,t=o),o=Pt(n,t);var i=Pt(n,r);if(o&&i&&(1!==e.rangeCount||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)){var a=document.createRange();a.setStart(o.node,o.offset),e.removeAllRanges(),t>r?(e.addRange(a),e.extend(i.node,i.offset)):(a.setEnd(i.node,i.offset),e.addRange(a))}}for(e=[],t=n;t=t.parentNode;)1===t.nodeType&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(On(n),n=0;n0?2==i.length?"function"==typeof i[1]?this[i[0]]=i[1].call(this,u):this[i[0]]=i[1]:3==i.length?"function"!=typeof i[1]||i[1].exec&&i[1].test?this[i[0]]=u?u.replace(i[1],i[2]):void 0:this[i[0]]=u?i[1].call(this,u,i[2]):void 0:4==i.length&&(this[i[0]]=u?i[3].call(this,u.replace(i[1],i[2])):void 0):this[i]=u||void 0;s+=2}},str:function(t,e){for(var n in e)if("object"==typeof e[n]&&e[n].length>0){for(var r=0;r1?n.some(function(t){return E.contains(t,e)}):(t=n[0].trim(),o(t,e))}function o(t,e){var n=t.split(C);if(n.length>0&&n.length<=2||_(!1),1===n.length)return i(n[0],e);var r=n[0],o=n[1];return h(r)&&h(o)||_(!1),i(">="+r,e)&&i("<="+o,e)}function i(t,e){if(""===(t=t.trim()))return!0;var n=e.split(S),r=p(t),o=r.modifier,i=r.rangeComponents;switch(o){case"<":return a(n,i);case"<=":return u(n,i);case">=":return l(n,i);case">":return c(n,i);case"~":case"~>":return f(n,i);default:return s(n,i)}}function a(t,e){return-1===b(t,e)}function u(t,e){var n=b(t,e);return-1===n||0===n}function s(t,e){return 0===b(t,e)}function l(t,e){var n=b(t,e);return 1===n||0===n}function c(t,e){return 1===b(t,e)}function f(t,e){var n=e.slice(),r=e.slice();r.length>1&&r.pop();var o=r.length-1,i=parseInt(r[o],10);return d(i)&&(r[o]=i+1+""),l(t,n)&&a(t,r)}function p(t){var e=t.split(S),n=e[0].match(k);return n||_(!1),{modifier:n[1],rangeComponents:[n[2]].concat(e.slice(1))}}function d(t){return!isNaN(t)&&isFinite(t)}function h(t){return!p(t).modifier}function g(t,e){for(var n=t.length;ne?1:t=|~>|~|>|)?\s*(.+)/,x=/^(\d*)(.*)/,E={contains:function(t,e){return r(t.trim(),e.trim())}};t.exports=E},function(t,e,n){"use strict";function r(t,e,n){if(!t)return null;var r={};for(var i in t)o.call(t,i)&&(r[i]=e.call(n,t[i],i,t));return r}var o=Object.prototype.hasOwnProperty;t.exports=r},function(t,e,n){"use strict";function r(t){var e={};return function(n){return e.hasOwnProperty(n)||(e[n]=t.call(this,n)),e[n]}}t.exports=r},function(t,e,n){"use strict";function r(t,e){if(!t)return"[empty]";var n=o(t,e);return n.nodeType===Node.TEXT_NODE?n.textContent:(n instanceof Element||d(!1),n.outerHTML)}function o(t,e){var n=void 0!==e?e(t):[];if(t.nodeType===Node.TEXT_NODE){var r=t.textContent.length;return document.createTextNode("[text "+r+(n.length?" | "+n.join(", "):"")+"]")}var i=t.cloneNode();1===i.nodeType&&n.length&&i.setAttribute("data-labels",n.join(", "));for(var a=t.childNodes,u=0;u=u,v=c===n&&r<=p&&o>=p;if(y&&v)return i.removeAllRanges(),l(i,e,u-r,t),void s(i,e,p-r,t);if(d){if(v&&(i.removeAllRanges(),l(i,e,p-r,t)),y){var m=i.focusNode,b=i.focusOffset;i.removeAllRanges(),l(i,e,u-r,t),s(i,m,b,t)}}else y&&(i.removeAllRanges(),l(i,e,u-r,t)),v&&s(i,e,p-r,t)}}function s(t,e,n,r){var o=p();if(t.extend&&f(o,e)){n>a(e)&&c.logSelectionStateFailure({anonymizedDom:i(e),extraParams:JSON.stringify({offset:n}),selectionState:JSON.stringify(r.toJS())});var u=e===t.focusNode;try{t.extend(e,n)}catch(a){throw c.logSelectionStateFailure({anonymizedDom:i(e,function(e){var n=[];return e===o&&n.push("active element"),e===t.anchorNode&&n.push("selection anchor node"),e===t.focusNode&&n.push("selection focus node"),n}),extraParams:JSON.stringify({activeElementName:o?o.nodeName:null,nodeIsFocus:e===t.focusNode,nodeWasFocus:u,selectionRangeCount:t.rangeCount,selectionAnchorNodeName:t.anchorNode?t.anchorNode.nodeName:null,selectionAnchorOffset:t.anchorOffset,selectionFocusNodeName:t.focusNode?t.focusNode.nodeName:null,selectionFocusOffset:t.focusOffset,message:a?""+a:null,offset:n},null,2),selectionState:JSON.stringify(r.toJS(),null,2)}),a}}else{var s=t.getRangeAt(0);s.setEnd(e,n),t.addRange(s.cloneRange())}}function l(t,e,n,r){var o=document.createRange();n>a(e)&&c.logSelectionStateFailure({anonymizedDom:i(e),extraParams:JSON.stringify({offset:n}),selectionState:JSON.stringify(r.toJS())}),o.setStart(e,n),t.addRange(o)}var c=n(107),f=n(25),p=n(33),d=n(1);t.exports=u},function(t,e,n){"use strict";t.exports={logSelectionStateFailure:function(){return null}}},function(t,e,n){"use strict";function r(t){return null==t?t:String(t)}function o(t,e){var n=void 0;if(window.getComputedStyle&&(n=window.getComputedStyle(t,null)))return r(n.getPropertyValue(a(e)));if(document.defaultView&&document.defaultView.getComputedStyle){if(n=document.defaultView.getComputedStyle(t,null))return r(n.getPropertyValue(a(e)));if("display"===e)return"none"}return r(t.currentStyle?"float"===e?t.currentStyle.cssFloat||t.currentStyle.styleFloat:t.currentStyle[i(e)]:t.style&&t.style[i(e)])}var i=n(109),a=n(110);t.exports=o},function(t,e,n){"use strict";function r(t){return t.replace(o,function(t,e){return e.toUpperCase()})}var o=/-(.)/g;t.exports=r},function(t,e,n){"use strict";function r(t){return t.replace(o,"-$1").toLowerCase()}var o=/([A-Z])/g;t.exports=r},function(t,e,n){"use strict";function r(t){var e=o(t);return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}var o=n(112);t.exports=r},function(t,e,n){"use strict";function r(t){var e=t.ownerDocument.documentElement;if(!("getBoundingClientRect"in t&&o(e,t)))return{left:0,right:0,top:0,bottom:0};var n=t.getBoundingClientRect();return{left:Math.round(n.left)-e.clientLeft,right:Math.round(n.right)-e.clientLeft,top:Math.round(n.top)-e.clientTop,bottom:Math.round(n.bottom)-e.clientTop}}var o=n(25);t.exports=r},function(t,e,n){"use strict";function r(t){return t=t||document,t.scrollingElement?t.scrollingElement:o||"CSS1Compat"!==t.compatMode?t.body:t.documentElement}var o="undefined"!=typeof navigator&&navigator.userAgent.indexOf("AppleWebKit")>-1;t.exports=r},function(t,e,n){"use strict";function r(t){return t.Window&&t instanceof t.Window?{x:t.pageXOffset||t.document.documentElement.scrollLeft,y:t.pageYOffset||t.document.documentElement.scrollTop}:{x:t.scrollLeft,y:t.scrollTop}}t.exports=r},function(t,e,n){"use strict";function r(){var t=void 0;return document.documentElement&&(t=document.documentElement.clientWidth),!t&&document.body&&(t=document.body.clientWidth),t||0}function o(){var t=void 0;return document.documentElement&&(t=document.documentElement.clientHeight),!t&&document.body&&(t=document.body.clientHeight),t||0}function i(){return{width:window.innerWidth||r(),height:window.innerHeight||o()}}i.withoutScrollbars=function(){return{width:r(),height:o()}},t.exports=i},function(t,e,n){"use strict";function r(t){t||(t="");var e=void 0,n=arguments.length;if(n>1)for(var r=1;r0){if(t.props.handleDroppedFiles&&p(t.props.handleDroppedFiles(s,l)))return;return void c(l,function(e){e&&t.update(i(u,s,e))})}var f=t._internalDrag?"internal":"external";if(!t.props.handleDrop||!p(t.props.handleDrop(s,n,f)))return t._internalDrag?void t.update(o(u,s)):void t.update(i(u,s,n.getText()))}}};t.exports=h},function(t,e,n){"use strict";function r(t){return t.split("/")}var o={isImage:function(t){return"image"===r(t)[0]},isJpeg:function(t){var e=r(t);return o.isImage(t)&&("jpeg"===e[1]||"pjpeg"===e[1])}};t.exports=o},function(t,e,n){"use strict";function r(t){var e=t.length;if((Array.isArray(t)||"object"!=typeof t&&"function"!=typeof t)&&a(!1),"number"!=typeof e&&a(!1),0===e||e-1 in t||a(!1),"function"==typeof t.callee&&a(!1),t.hasOwnProperty)try{return Array.prototype.slice.call(t)}catch(t){}for(var n=Array(e),r=0;r=0;h--)if(!(null!=d&&h>0&&u.isSurrogatePair(d,h-1))){if(t.setStart(f,h),!o(s(t),n))break;a=f,c=h}if(-1===h||0===f.childNodes.length)break;f=f.childNodes[h],p=i(f)}return t.setStart(a,c),t}var u=n(13),s=n(56),l=n(1);t.exports=a},function(t,e,n){"use strict";function r(t){var e=u(t,function(t){var e=t.getSelection(),n=e.getStartOffset();if(0===n)return a(t,1);var r=e.getStartKey(),i=t.getCurrentContent(),u=i.getBlockForKey(r).getText().slice(0,n),s=o.getBackward(u);return a(t,s.length||1)},"backward");return e===t.getCurrentContent()?t:i.push(t,e,"remove-range")}var o=n(58),i=n(2),a=n(38),u=n(22);t.exports=r},function(t,e,n){"use strict";t.exports={getPunctuation:function(){return"[.,+*?$|#{}()'\\^\\-\\[\\]\\\\\\/!@%\"~=<>_:;・、。〈-】〔-〟:-?!-/[-`{-・⸮؟٪-٬؛،؍﴾﴿᠁।၊။‐-‧‰-⁞¡-±´-¸º»¿]"}}},function(t,e,n){"use strict";function r(t){var e=u(t,function(t){var e=t.getSelection(),n=e.getStartOffset(),r=e.getStartKey(),i=t.getCurrentContent(),u=i.getBlockForKey(r).getText().slice(n),s=o.getForward(u);return a(t,s.length||1)},"forward");return e===t.getCurrentContent()?t:i.push(t,e,"remove-range")}var o=n(58),i=n(2),a=n(59),u=n(22);t.exports=r},function(t,e,n){"use strict";function r(t){var e=o.splitBlock(t.getCurrentContent(),t.getSelection());return i.push(t,e,"split-block")}var o=n(3),i=n(2);t.exports=r},function(t,e,n){"use strict";function r(t){var e=t.getSelection(),n=e.getEndKey(),r=t.getCurrentContent(),i=r.getBlockForKey(n).getLength();return o.set(t,{selection:e.merge({anchorKey:n,anchorOffset:i,focusKey:n,focusOffset:i,isBackward:!1}),forceSelection:!0})}var o=n(2);t.exports=r},function(t,e,n){"use strict";function r(t){var e=t.getSelection(),n=e.getStartKey();return o.set(t,{selection:e.merge({anchorKey:n,anchorOffset:0,focusKey:n,focusOffset:0,isBackward:!1}),forceSelection:!0})}var o=n(2);t.exports=r},function(t,e,n){"use strict";function r(t){var e=u(t,function(t){var e=t.getSelection(),n=t.getCurrentContent(),r=e.getAnchorKey(),o=e.getAnchorOffset(),u=n.getBlockForKey(r).getText()[o-1];return a(t,u?i.getUTF16Length(u,0):1)},"backward");if(e===t.getCurrentContent())return t;var n=t.getSelection();return o.push(t,e.set("selectionBefore",n),n.isCollapsed()?"backspace-character":"remove-range")}var o=n(2),i=n(13),a=n(38),u=n(22);t.exports=r},function(t,e,n){"use strict";function r(t){var e=u(t,function(t){var e=t.getSelection(),n=t.getCurrentContent(),r=e.getAnchorKey(),o=e.getAnchorOffset(),u=n.getBlockForKey(r).getText()[o];return a(t,u?i.getUTF16Length(u,0):1)},"forward");if(e===t.getCurrentContent())return t;var n=t.getSelection();return o.push(t,e.set("selectionBefore",n),n.isCollapsed()?"delete-character":"remove-range")}var o=n(2),i=n(13),a=n(59),u=n(22);t.exports=r},function(t,e,n){"use strict";function r(t){var e=t.getSelection();if(!e.isCollapsed())return t;var n=e.getAnchorOffset();if(0===n)return t;var r=e.getAnchorKey(),u=t.getCurrentContent(),s=u.getBlockForKey(r),l=s.getLength();if(l<=1)return t;var c,f;n===l?(c=e.set("anchorOffset",n-1),f=e):(c=e.set("focusOffset",n+1),f=c.set("anchorOffset",n+1));var p=a(u,c),d=o.removeRange(u,c,"backward"),h=d.getSelectionAfter(),g=h.getAnchorOffset()-1,y=h.merge({anchorOffset:g,focusOffset:g}),v=o.replaceWithFragment(d,y,p),m=i.push(t,v,"insert-fragment");return i.acceptSelection(m,f)}var o=n(3),i=n(2),a=n(23);t.exports=r},function(t,e,n){"use strict";function r(t,e,n){var r=o.undo(e);if("spellcheck-change"===e.getLastChangeType()){var i=r.getCurrentContent();return void n(o.set(r,{nativelyRenderedContent:i}))}if(t.preventDefault(),!e.getNativelyRenderedContent())return void n(r);n(o.set(e,{nativelyRenderedContent:null})),setTimeout(function(){n(r)},0)}var o=n(2);t.exports=r},function(t,e,n){"use strict";function r(t,e){e.preventDefault();var n=new s(e.clipboardData);if(!n.isRichText()){var r=n.getFiles(),v=n.getText();if(r.length>0){if(t.props.handlePastedFiles&&g(t.props.handlePastedFiles(r)))return;return void h(r,function(e){if(e=e||v){var n=t._latestEditorState,r=y(e),o=u.create({style:n.getCurrentInlineStyle(),entity:d(n.getCurrentContent(),n.getSelection())}),i=p.getCurrentBlockType(n),s=c.processText(r,o,i),h=a.createFromArray(s),g=l.replaceWithFragment(n.getCurrentContent(),n.getSelection(),h);t.update(f.push(n,g,"insert-fragment"))}})}}var m=[],b=n.getText(),_=n.getHTML(),S=t._latestEditorState;if(!t.props.handlePastedText||!g(t.props.handlePastedText(b,_,S))){if(b&&(m=y(b)),!t.props.stripPastedStyles){var w=t.getClipboard();if(n.isRichText()&&w){if(-1!==_.indexOf(t.getEditorKey())||1===m.length&&1===w.size&&w.first().getText()===b)return void t.update(o(t._latestEditorState,w))}else if(w&&n.types.includes("com.apple.webarchive")&&!n.types.includes("text/html")&&i(m,w))return void t.update(o(t._latestEditorState,w));if(_){var C=c.processHTML(_,t.props.blockRenderMap);if(C){var k=C.contentBlocks,x=C.entityMap;if(k){var E=a.createFromArray(k);return void t.update(o(t._latestEditorState,E,x))}}}t.setClipboard(null)}if(m.length){var O=u.create({style:S.getCurrentInlineStyle(),entity:d(S.getCurrentContent(),S.getSelection())}),T=p.getCurrentBlockType(S),D=c.processText(m,O,T),I=a.createFromArray(D);t.update(o(t._latestEditorState,I))}}}function o(t,e,n){var r=l.replaceWithFragment(t.getCurrentContent(),t.getSelection(),e);return f.push(t,r.set("entityMap",n),"insert-fragment")}function i(t,e){return t.length===e.size&&e.valueSeq().every(function(e,n){return e.getText()===t[n]})}var a=n(18),u=n(4),s=n(51),l=n(3),c=n(147),f=n(2),p=n(62),d=n(32),h=n(53),g=n(20),y=n(150);t.exports=r},function(t,e,n){"use strict";var r=n(5),o=r||function(t){for(var e=1;e0;){var c=l.pop(),f=c.parentRef,p=f.getChildKeys(),d=p.indexOf(c.key),h=Array.isArray(c.children);if(!h){h||v(!1);break}var g=c.children.map(k),y=new a(o({},w(c,e),{parent:f.getKey(),children:b(g.map(function(t){return t.key})),prevSibling:0===d?null:p.get(d-1),nextSibling:d===p.size-1?null:p.get(d+1)}));n=n.set(y.getKey(),y),l=x(l,g,y)}return n},S())},O=function(t,e){return S(t.map(function(t){var n=new i(w(t,e));return[n.getKey(),n]}))},T=function(t,e){var n=Array.isArray(t.blocks[0].children),r=m&&!n?c.fromRawStateToRawTreeState(t).blocks:t.blocks;return m?E(r,e):O(n?c.fromRawTreeStateToRawState(t).blocks:r,e)},D=function(t){var e=t.entityMap,n={};return Object.keys(e).forEach(function(t){var r=e[t],o=r.type,i=r.mutability,a=r.data;n[t]=s.__create(o,i,a||{})}),n},I=function(t){Array.isArray(t.blocks)||v(!1);var e=D(t),n=T(t,e),r=n.isEmpty()?new p:p.createEmpty(n.first().getKey());return new u({blockMap:n,entityMap:e,selectionBefore:r,selectionAfter:r})};t.exports=I},function(t,e,n){"use strict";var r=n(5),o=r||function(t){for(var e=1;e0){var l=e[a-1];return l||i(!1),void l.children.push(s)}n.push(s)}),o({},t,{blocks:n})}};t.exports=l},function(t,e,n){"use strict";function r(t,e){var n=t.map(function(t,n){var r=e[n];return o.create({style:t,entity:r})});return a(n)}var o=n(4),i=n(0),a=i.List;t.exports=r},function(t,e,n){"use strict";function r(t,e){var n=Array(t.length).fill(null);return e&&e.forEach(function(e){for(var r=i(t,0,e.offset).length,o=r+i(t,e.offset,e.length).length,a=r;a1&&0===e[0].width){var u=e[1];n=u.top,r=u.right,i=u.bottom,a=u.left}else{var s=e[0];n=s.top,r=s.right,i=s.bottom,a=s.left}for(var l=1;l=0;s--){if(!i.get(s).hasStyle(e))break;a=s}for(var l=n.getAnchorOffset();l0}function E(t){var e=(0,A.getCustomDataFromEditor)(t,A.editor3DataKeys.MULTIPLE_HIGHLIGHTS);if(void 0===e||void 0===e.highlightsData)return t;var n=e.highlightsData,r=Object.keys(n).filter(function(t){return 0===t.indexOf(M.highlightsConfig.COMMENT.type)}).map(function(t){return n[t].data});return(0,A.setCustomDataForEditor)(t,A.editor3DataKeys.__PUBLIC_API__comments,r)}function O(t){var e=(0,A.getCustomDataFromEditor)(t,A.editor3DataKeys.MULTIPLE_HIGHLIGHTS);if(void 0===e||void 0===e.highlightsData)return t;var n=D({},e,{highlightsStyleMap:Object.keys(e.highlightsData).reduce(function(t,e){return t[e]=P[u(e)],t},{})});return(0,A.setCustomDataForEditor)(t,A.editor3DataKeys.MULTIPLE_HIGHLIGHTS,n)}function T(t){var e=(0,A.getCustomDataFromEditor)(t,A.editor3DataKeys.MULTIPLE_HIGHLIGHTS),n=D({},e);return delete n.highlightsStyleMap,(0,A.setCustomDataForEditor)(t,A.editor3DataKeys.MULTIPLE_HIGHLIGHTS,n)}Object.defineProperty(e,"__esModule",{value:!0}),e.prepareHighlightsForExport=e.initializeHighlights=e.availableHighlights=void 0;var D=Object.assign||function(t){for(var e=1;e3&&void 0!==arguments[3]&&arguments[3],o={block:null,newOffset:null},i=void 0,a=void 0;if(r?(i=e.getEndOffset()+n,a=t.getBlockForKey(e.getEndKey())):(i=e.getStartOffset()+n,a=t.getBlockForKey(e.getStartKey())),null==a)return o;for(;i<0;){if(null==(a=t.getBlockBefore(a.getKey())))return o;i=a.getLength()+i}for(;i>a.getLength();)if(i-=a.getLength(),null==(a=t.getBlockAfter(a.getKey())))return o;return{block:a,newOffset:i}};e.initializeHighlights=O,e.prepareHighlightsForExport=function(t){return E(T(t))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.highlightsConfig={COMMENT:{type:"COMMENT",draftStyleMap:{backgroundColor:"rgba(255, 235, 59, 0.2)"}},ANNOTATION:{type:"ANNOTATION",draftStyleMap:{borderBottom:"4px solid rgba(100, 205, 0, 0.6)"}},ADD_SUGGESTION:{type:"ADD_SUGGESTION",draftStyleMap:{color:"rgba(0, 180, 0, 1.0)"}},DELETE_SUGGESTION:{type:"DELETE_SUGGESTION",draftStyleMap:{color:"rgba(255, 0, 0, 1.0)",textDecoration:"line-through"}}},e.suggestionsTypes=["DELETE_SUGGESTION","ADD_SUGGESTION"]},function(t,e,n){"use strict";function r(t){return Object.keys(l).includes(t)}function o(t,e,n){if(!r(e))throw new Error("Key '"+e+"' is not defined");var o=t.getSelection(),i=t.getCurrentContent(),a=s.SelectionState.createEmpty(i.getFirstBlock().getKey());i=s.Modifier.mergeBlockData(i,a,(0,u.Map)().set(e,n));var l=s.EditorState.push(t,i,"change-inline-style");return s.EditorState.forceSelection(l,o)}function i(t,e){return t[0].blocks[0].data[e]}function a(t,e){if(!r(e))throw new Error("Key '"+e+"' is not defined");return Array.isArray(t)?i(t,e):t.getCurrentContent().getFirstBlock().getData().get(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.editor3DataKeys=void 0,e.keyValid=r,e.setCustomDataForEditor=o,e.getCustomDataFromEditor=a;var u=n(0),s=n(17),l=e.editor3DataKeys={MULTIPLE_HIGHLIGHTS:"MULTIPLE_HIGHLIGHTS",RESOLVED_COMMENTS_HISTORY:"RESOLVED_COMMENTS_HISTORY",RESOLVED_SUGGESTIONS_HISTORY:"RESOLVED_SUGGESTIONS_HISTORY",__PUBLIC_API__comments:"__PUBLIC_API__comments"}},function(t,e,n){"use strict";function r(t,e,n){var r=!1,o=!1;return t.filter(function(t){var i=t.getKey();return i===e&&(r=!0),i===n&&(o=!0),i===e||i===n||r&&!o})}function o(t,e){if(e.isCollapsed())return(0,i.List)();var n=e.getStartKey(),o=e.getEndKey();return r(t.getCurrentContent().getBlockMap(),n,o).map(function(t){var r=t.getKey();return n===o&&n===r?t.getCharacterList().slice(e.getStartOffset(),e.getEndOffset()):r===n?t.getCharacterList().slice(e.getStartOffset(),t.getLength()):r===o?t.getCharacterList().slice(0,e.getEndOffset()):t.getCharacterList()}).reduce(function(t,e){return t.concat(e)})}Object.defineProperty(e,"__esModule",{value:!0}),e.getDraftCharacterListForSelection=o;var i=n(0)},function(t,e,n){"use strict";function r(t){var e=t.getCurrentContent();return new o.SelectionState({anchorKey:e.getFirstBlock().getKey(),anchorOffset:0,focusKey:e.getLastBlock().getKey(),focusOffset:e.getLastBlock().getLength(),isBackward:!1})}Object.defineProperty(e,"__esModule",{value:!0}),e.getDraftSelectionForEntireContent=r;var o=n(17)},function(t,e,n){"use strict";function r(t,e){return t.getIsBackward()?t.merge({focusOffset:e}):t.merge({anchorOffset:e})}function o(t,e){return t.getIsBackward()?t.merge({anchorOffset:e}):t.merge({focusOffset:e})}function i(t,e,n,o){var a=e.getCurrentContent(),u=t.getStartOffset(),s=u-n;if(s>=0)return r(t,s);var l=t.getStartKey(),c=a.getBlockBefore(l);return null===c||void 0===c||o?r(t,0):i(r(t.merge({anchorKey:c.getKey()}),c.getLength()),e,n-s)}function a(t,e,n,r){var i=e.getCurrentContent(),u=t.getEndOffset(),s=t.getStartKey(),l=i.getBlockForKey(s),c=l.getLength(),f=u+n;if(f<=c)return o(t,f);var p=i.getBlockAfter(s);return null===p||void 0===p||r?o(t,c):a(o(t.merge({focusKey:p.getKey()}),0),e,n-f)}function u(t,e,n,r,o){return a(i(t,e,n,o),e,r,o)}Object.defineProperty(e,"__esModule",{value:!0}),e.expandDraftSelection=u},function(t,e,n){"use strict";function r(t,e,n){var r=t.getSelection(),i=n.reduce(function(t,n){return o.Modifier.removeInlineStyle(t,e,n)},t.getCurrentContent()),a=o.EditorState.push(t,i,"change-inline-style");return o.EditorState.forceSelection(a,r)}Object.defineProperty(e,"__esModule",{value:!0}),e.clearInlineStyles=r;var o=n(17)}]); -//# sourceMappingURL=app.bundle.cf6c8814.js.map \ No newline at end of file diff --git a/superdesk/data_updates/00007_20180321-092824_archive.py b/superdesk/data_updates/00007_20180321-092824_archive.py deleted file mode 100644 index 7049d232db..0000000000 --- a/superdesk/data_updates/00007_20180321-092824_archive.py +++ /dev/null @@ -1,43 +0,0 @@ -# -*- coding: utf-8; -*- -# This file is part of Superdesk. -# For the full copyright and license information, please see the -# AUTHORS and LICENSE files distributed with this source code, or -# at https://www.sourcefabric.org/superdesk/license -# -# Author : tomas -# Creation: 2018-03-21 09:28 - -import superdesk -import subprocess -import json -from superdesk.commands.data_updates import BaseDataUpdate -from os.path import realpath, join, dirname - -node_script_path = join(dirname(realpath(superdesk.__file__)), "data_updates", "00007_20180321-092824_archive.dist.js") - - -def get_updated_editor_state(editor_state): - try: - with subprocess.Popen(["node", node_script_path], stdin=subprocess.PIPE, stdout=subprocess.PIPE) as p: - output, err = p.communicate(bytes(json.dumps(editor_state), "utf-8")) - return json.loads(output.decode("utf-8")) - except Exception: - return editor_state - - -class DataUpdate(BaseDataUpdate): - resource = "archive" # will use multiple resources, keeping this here so validation passes - - def forwards(self, mongodb_collection, mongodb_database): - for resource in ["archive", "archive_autosave", "published"]: - collection = mongodb_database[resource] - - for item in collection.find({"editor_state": {"$exists": True}}): - print( - collection.update( - {"_id": item["_id"]}, {"$set": {"editor_state": get_updated_editor_state(item["editor_state"])}} - ) - ) - - def backwards(self, mongodb_collection, mongodb_database): - pass diff --git a/superdesk/data_updates/00007_20180321-092824_archive.src.js b/superdesk/data_updates/00007_20180321-092824_archive.src.js deleted file mode 100644 index fbef2d946c..0000000000 --- a/superdesk/data_updates/00007_20180321-092824_archive.src.js +++ /dev/null @@ -1,118 +0,0 @@ -// building: -// copy the contents to client-core index file -// change webpack config, add target: 'node', to the exported object -// run grunt build - -import {convertFromRaw, convertToRaw, EditorState, SelectionState, Modifier} from 'draft-js'; -import {addHighlight, prepareHighlightsForExport} from './core/editor3/helpers/highlights'; - -function removeCustomDataFieldFromEditor(editorState, key) { - const currentSelectionToPreserve = editorState.getSelection(); - - let contentState = editorState.getCurrentContent(); - const currentData = contentState.getFirstBlock().getData(); - const dataWithKeyRemoved = currentData.remove(key); - - const firstBlockSelection = SelectionState.createEmpty(contentState.getFirstBlock().getKey()); - - contentState = Modifier.setBlockData(contentState, firstBlockSelection, dataWithKeyRemoved); - - const editorStateWithNewDataSet = EditorState.push(editorState, contentState, 'change-block-data'); - - const editorStateWithSelectionRestored = EditorState.forceSelection( - editorStateWithNewDataSet, - currentSelectionToPreserve - ); - - return editorStateWithSelectionRestored; -} - -function convertAnnotationsToNewFormat(rawContentState) { - const initialEditorState = EditorState.createWithContent(convertFromRaw(rawContentState)); - - const firstBlockData = initialEditorState - .getCurrentContent() - .getFirstBlock() - .getData() - .toJS(); - - const editorStateWithAnnotationsConverted = Object.keys(firstBlockData).reduce((editorState, firstBlockDataKey) => { - const value = firstBlockData[firstBlockDataKey]; - var parsedDataKey = null; - - try { - parsedDataKey = JSON.parse(firstBlockDataKey); - } catch (e) { - // not an old comment or annotation - return editorState; - } - - if (parsedDataKey === null || value.type !== 'ANNOTATION') { - return editorState; - } - - // set selection from old annotation JSON - const editorWithSelection = EditorState.acceptSelection( - editorState, - new SelectionState(parsedDataKey) - ); - - const editorStateWithHighlightAdded = addHighlight(editorWithSelection, value.type, { - type: value.type, - data: value - }); - - const editorStateWithOldKeyRemoved = - removeCustomDataFieldFromEditor(editorStateWithHighlightAdded, firstBlockDataKey); - - return editorStateWithOldKeyRemoved; - }, initialEditorState); - - const exportState = convertToRaw( - prepareHighlightsForExport(editorStateWithAnnotationsConverted).getCurrentContent() - ); - - return exportState; -} - -function isDraftJsRawState(obj) { - return typeof obj === 'object' - && Object.keys(obj).length === 2 - && Object.keys(obj).includes('entityMap') - && Object.keys(obj).includes('blocks'); -} - -// pipe the result to stdout - -var stdin = process.openStdin(); - -var inputData = ''; - -stdin.on('data', (chunk) => { - inputData = chunk.toString(); -}); - -stdin.on('end', () => { - let inputDataJson = null; - - try { - inputDataJson = JSON.parse(inputData); - } catch (e) { - // return input onchanged - return process.stdout.write(inputData); - } - - if ( - Array.isArray(inputDataJson) - && inputDataJson.length === 1 - && isDraftJsRawState(inputDataJson[0]) - ) { - const result = convertAnnotationsToNewFormat(inputDataJson[0]); - const resultWrappedInArray = [result]; - - return process.stdout.write(JSON.stringify(resultWrappedInArray)); - } else { - // return input onchanged - return process.stdout.write(inputData); - } -}); \ No newline at end of file diff --git a/superdesk/data_updates/00008_20180404-165521_archive.py b/superdesk/data_updates/00008_20180404-165521_archive.py deleted file mode 100644 index 7e5652b389..0000000000 --- a/superdesk/data_updates/00008_20180404-165521_archive.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- coding: utf-8; -*- -# This file is part of Superdesk. -# For the full copyright and license information, please see the -# AUTHORS and LICENSE files distributed with this source code, or -# at https://www.sourcefabric.org/superdesk/license -# -# Author : Jérôme -# Creation: 2018-04-04 16:55 - -from superdesk.commands.data_updates import BaseDataUpdate - - -class DataUpdate(BaseDataUpdate): - resource = "archive" # will use multiple resources, keeping this here so validation passes - - def forwards(self, mongodb_collection, mongodb_database): - for resource in ["archive", "archive_autosave", "published"]: - collection = mongodb_database[resource] - - for item in collection.find({"editor_state": {"$exists": True}}): - state = item["editor_state"] - fields_meta = {"body_html": {"draftjsState": state}} - print( - collection.update( - {"_id": item["_id"]}, {"$set": {"fields_meta": fields_meta}, "$unset": {"editor_state": ""}} - ) - ) - - def backwards(self, mongodb_collection, mongodb_database): - for resource in ["archive", "archive_autosave", "published"]: - collection = mongodb_database[resource] - - for item in collection.find({"fields_meta": {"$exists": True}}): - state = item["fields_meta"]["body_html"]["draftjsState"] - print( - collection.update( - {"_id": item["_id"]}, {"$set": {"editor_state": state}, "$unset": {"fields_meta": ""}} - ) - ) diff --git a/superdesk/data_updates/00009_20180425-010702_vocabularies.py b/superdesk/data_updates/00009_20180425-010702_vocabularies.py deleted file mode 100644 index a0dd906fbc..0000000000 --- a/superdesk/data_updates/00009_20180425-010702_vocabularies.py +++ /dev/null @@ -1,28 +0,0 @@ -# -*- coding: utf-8; -*- -# This file is part of Superdesk. -# For the full copyright and license information, please see the -# AUTHORS and LICENSE files distributed with this source code, or -# at https://www.sourcefabric.org/superdesk/license -# -# Author : mugur -# Creation: 2018-04-25 01:07 - -from superdesk.resource_fields import ID_FIELD -from superdesk.commands.data_updates import BaseDataUpdate - - -class DataUpdate(BaseDataUpdate): - resource = "vocabularies" - update_fields = ["name", "qcode"] - - def forwards(self, mongodb_collection, mongodb_database): - for vocabulary in mongodb_collection.find({}): - if "schema" in vocabulary: - schema = vocabulary["schema"] - for field in self.update_fields: - if field in vocabulary["schema"] and isinstance(vocabulary["schema"], dict): - schema[field]["required"] = True - mongodb_collection.update({"_id": vocabulary.get(ID_FIELD)}, {"$set": {"schema": schema}}) - - def backwards(self, mongodb_collection, mongodb_database): - pass diff --git a/superdesk/data_updates/00010_20180510-172012_vocabularies.py b/superdesk/data_updates/00010_20180510-172012_vocabularies.py deleted file mode 100644 index 1abd04cbe8..0000000000 --- a/superdesk/data_updates/00010_20180510-172012_vocabularies.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8; -*- -# This file is part of Superdesk. -# For the full copyright and license information, please see the -# AUTHORS and LICENSE files distributed with this source code, or -# at https://www.sourcefabric.org/superdesk/license -# -# Author : Jérôme -# Creation: 2018-05-10 17:20 - -from superdesk.commands.data_updates import BaseDataUpdate - - -class DataUpdate(BaseDataUpdate): - resource = "vocabularies" - - def forwards(self, mongodb_collection, mongodb_database): - print( - mongodb_collection.update_many( - {"_id": {"$in": ["genre", "priority", "replace_words", "annotation_types"]}}, - {"$set": {"unique_field": "qcode"}}, - ) - ) - - def backwards(self, mongodb_collection, mongodb_database): - print( - mongodb_collection.update_many( - {"_id": {"$in": ["genre", "priority", "replace_words", "annotation_types"]}}, - {"$unset": {"unique_field": "qcode"}}, - ) - ) diff --git a/superdesk/data_updates/00011_20180516-175617_vocabularies.py b/superdesk/data_updates/00011_20180516-175617_vocabularies.py deleted file mode 100644 index 8743d2a93f..0000000000 --- a/superdesk/data_updates/00011_20180516-175617_vocabularies.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8; -*- -# This file is part of Superdesk. -# For the full copyright and license information, please see the -# AUTHORS and LICENSE files distributed with this source code, or -# at https://www.sourcefabric.org/superdesk/license -# -# Author : Jérôme -# Creation: 2018-05-16 17:56 - -from superdesk.commands.data_updates import BaseDataUpdate - - -class DataUpdate(BaseDataUpdate): - resource = "vocabularies" - - def forwards(self, mongodb_collection, mongodb_database): - print( - mongodb_collection.update_many( - {"unique_field": {"$exists": False}, "schema.qcode": {"$exists": True}}, - {"$set": {"unique_field": "qcode"}}, - ) - ) - - def backwards(self, mongodb_collection, mongodb_database): - pass diff --git a/superdesk/data_updates/00012_20180605-151019_vocabularies.py b/superdesk/data_updates/00012_20180605-151019_vocabularies.py deleted file mode 100644 index ebd7476d71..0000000000 --- a/superdesk/data_updates/00012_20180605-151019_vocabularies.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8; -*- -# This file is part of Superdesk. -# For the full copyright and license information, please see the -# AUTHORS and LICENSE files distributed with this source code, or -# at https://www.sourcefabric.org/superdesk/license -# -# Author : mugur -# Creation: 2018-06-05 15:10 - -from superdesk.resource_fields import ID_FIELD -from superdesk.commands.data_updates import BaseDataUpdate - - -class DataUpdate(BaseDataUpdate): - resource = "vocabularies" - - def forwards(self, mongodb_collection, mongodb_database): - for vocabulary in mongodb_collection.find({"_id": {"$in": ["priority", "urgency"]}}): - schema = vocabulary.get("schema", {}) - qcode = schema.get("qcode", {}) - qcode["type"] = "integer" - schema["qcode"] = qcode - print(mongodb_collection.update({"_id": vocabulary.get(ID_FIELD)}, {"$set": {"schema": schema}})) - - def backwards(self, mongodb_collection, mongodb_database): - pass diff --git a/superdesk/data_updates/00014_20181114-153727_archive.py b/superdesk/data_updates/00014_20181114-153727_archive.py deleted file mode 100644 index c401a703c3..0000000000 --- a/superdesk/data_updates/00014_20181114-153727_archive.py +++ /dev/null @@ -1,72 +0,0 @@ -# -*- coding: utf-8; -*- -# This file is part of Superdesk. -# For the full copyright and license information, please see the -# AUTHORS and LICENSE files distributed with this source code, or -# at https://www.sourcefabric.org/superdesk/license -# -# Author : tomas -# Creation: 2018-11-14 15:37 - -from superdesk.commands.data_updates import BaseDataUpdate - - -def get_root_nodes(tree_items): - root_nodes = [] - - for key in tree_items: - node = tree_items[key] - if node.parent is None: - root_nodes.append(node) - - return root_nodes - - -def get_ids_recursive(list_of_nodes): - ids = [] - - for node in list_of_nodes: - if len(node.children) > 0: - ids.extend(get_ids_recursive(node.children)) - - ids.append(node.id) - - return ids - - -class TreeNode: - def __init__(self, id): - self.id = id - self.parent = None - self.children = [] - - -class DataUpdate(BaseDataUpdate): - resource = "archive" - - def forwards(self, mongodb_collection, mongodb_database): - # building multiple trees - tree_items = {} - for item in mongodb_collection.find({"translated_from": {"$exists": True}}): - node_id = item["_id"] - - if node_id not in tree_items: - tree_items[node_id] = TreeNode(node_id) - - node = tree_items[node_id] - - parent_id = item["translated_from"] - - if parent_id not in tree_items: - tree_items[parent_id] = TreeNode(parent_id) - - node.parent = tree_items[parent_id] - node.parent.children.append(node) - - # processing trees - for root_node in get_root_nodes(tree_items): - ids = get_ids_recursive([root_node]) - - print(mongodb_collection.update_many({"_id": {"$in": ids}}, {"$set": {"translation_id": root_node.id}})) - - def backwards(self, mongodb_collection, mongodb_database): - raise NotImplementedError() diff --git a/superdesk/data_updates/00015_20181127-105425_archive.py b/superdesk/data_updates/00015_20181127-105425_archive.py deleted file mode 100644 index a2a81ef482..0000000000 --- a/superdesk/data_updates/00015_20181127-105425_archive.py +++ /dev/null @@ -1,94 +0,0 @@ -# -*- coding: utf-8; -*- -# This file is part of Superdesk. -# For the full copyright and license information, please see the -# AUTHORS and LICENSE files distributed with this source code, or -# at https://www.sourcefabric.org/superdesk/license -# -# Author : tomas -# Creation: 2018-11-27 10:54 - -from superdesk.commands.data_updates import BaseDataUpdate -from superdesk import get_resource_service - -# This upgrade script does the same as the previous one 00014_20181114-153727_archive.py -# except this works across multiple collections - - -def get_root_nodes(tree_items): - root_nodes = [] - - for key in tree_items: - node = tree_items[key] - if node.parent is None: - root_nodes.append(node) - - return root_nodes - - -def get_ids_recursive(list_of_nodes, resource): - # walks the tree and returns ids of items with a specified resource - - ids = [] - - for node in list_of_nodes: - if len(node.children) > 0: - ids.extend(get_ids_recursive(node.children, resource)) - - if node.resource == resource: - ids.append(node.id) - - return ids - - -class TreeNode: - def __init__(self, id): - self.id = id - self.parent = None - self.resource = None - self.children = [] - - -class DataUpdate(BaseDataUpdate): - resource = "archive" # will use multiple resources, keeping this here so validation passes - - def forwards(self, mongodb_collection, mongodb_database): - tree_items = {} - - # `translated_from` can refer to archive['_id'] or published['item_id'] - - for resource in ["archive", "published"]: - collection = mongodb_database[resource] - - # building multiple trees - for item in collection.find({"translated_from": {"$exists": True}}): - node_id = item["_id"] - - if node_id not in tree_items: - tree_items[node_id] = TreeNode(node_id) - - node = tree_items[node_id] - node.resource = resource - parent_id = item["translated_from"] - - if parent_id not in tree_items: - tree_items[parent_id] = TreeNode(parent_id) - - node.parent = tree_items[parent_id] - node.parent.children.append(node) - - # processing trees - for root_node in get_root_nodes(tree_items): - updates = {"translation_id": root_node.id} - - for resource in ["archive", "published"]: - service = get_resource_service(resource) - ids = get_ids_recursive([root_node], resource) - - for item_id in ids: - item = service.find_one(req=None, _id=item_id) - - if item is not None: - print(service.system_update(item_id, updates, item)) - - def backwards(self, mongodb_collection, mongodb_database): - raise NotImplementedError() diff --git a/superdesk/data_updates/00016_20181227-160331_archive.py b/superdesk/data_updates/00016_20181227-160331_archive.py deleted file mode 100644 index f72670a4e3..0000000000 --- a/superdesk/data_updates/00016_20181227-160331_archive.py +++ /dev/null @@ -1,36 +0,0 @@ -# -*- coding: utf-8; -*- -# This file is part of Superdesk. -# For the full copyright and license information, please see the -# AUTHORS and LICENSE files distributed with this source code, or -# at https://www.sourcefabric.org/superdesk/license -# -# Author : Gyan -# Creation: 2018-12-27 16:03 - -from superdesk.resource_fields import ID_FIELD -from superdesk.commands.data_updates import BaseDataUpdate - - -# This script replaces the whole json of related item with respective _id only -class DataUpdate(BaseDataUpdate): - resource = "archive" - - def forwards(self, mongodb_collection, mongodb_database): - # To find the related content from vocabularies - related_content = list(mongodb_database["vocabularies"].find({"field_type": "related_content"})) - - collection = mongodb_database["archive"] - - for item in collection.find({"associations": {"$ne": None}}): - for item_name, item_obj in item["associations"].items(): - if item_obj and related_content: - if item_name.split("--")[0] in [content["_id"] for content in related_content]: - related_item_id = item_obj[ID_FIELD] - - updates = {"$set": {}} - updates["$set"]["associations." + item_name] = {"_id": related_item_id} - - print(collection.update({"_id": item["_id"]}, updates)) - - def backwards(self, mongodb_collection, mongodb_database): - raise NotImplementedError() diff --git a/superdesk/data_updates/00017_20190729-102436_content_types.py b/superdesk/data_updates/00017_20190729-102436_content_types.py deleted file mode 100644 index b8e5bf6e3e..0000000000 --- a/superdesk/data_updates/00017_20190729-102436_content_types.py +++ /dev/null @@ -1,23 +0,0 @@ -# -*- coding: utf-8; -*- -# This file is part of Superdesk. -# For the full copyright and license information, please see the -# AUTHORS and LICENSE files distributed with this source code, or -# at https://www.sourcefabric.org/superdesk/license -# -# Author : petr -# Creation: 2019-07-29 10:24 - -from superdesk.commands.data_updates import BaseDataUpdate - - -class DataUpdate(BaseDataUpdate): - resource = "content_types" - - def forwards(self, mongodb_collection, mongodb_database): - filter_ = {"editor.headline.formatOptions": {"$nin": [None, []]}} - update = {"$set": {"editor.headline.formatOptions": []}} - result = mongodb_collection.update_many(filter_, update) - print("matched={} updated={}".format(result.matched_count, result.modified_count)) - - def backwards(self, mongodb_collection, mongodb_database): - pass # no need to return back to wrong value diff --git a/superdesk/data_updates/00018_20190801-145234_archive.py b/superdesk/data_updates/00018_20190801-145234_archive.py deleted file mode 100644 index 26ff2f3409..0000000000 --- a/superdesk/data_updates/00018_20190801-145234_archive.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8; -*- -# This file is part of Superdesk. -# For the full copyright and license information, please see the -# AUTHORS and LICENSE files distributed with this source code, or -# at https://www.sourcefabric.org/superdesk/license -# -# Author : petr -# Creation: 2019-08-01 14:52 - -from bson import ObjectId -from bson.errors import InvalidId -from superdesk import get_resource_service -from superdesk.commands.data_updates import BaseDataUpdate -from superdesk.vocabularies import is_related_content - - -class DataUpdate(BaseDataUpdate): - resource = "archive" - - def forwards(self, mongodb_collection, mongodb_database): - related = list(get_resource_service("vocabularies").get(req=None, lookup={"field_type": "related_content"})) - archive_service = get_resource_service("archive") - for resource in ("archive", "published"): - service = get_resource_service(resource) - for item in mongodb_database[resource].find({"type": "text", "associations": {"$gt": {}}}): - update = False - associations = {} - for key, val in item["associations"].items(): - if val and is_related_content(key, related) and len(val.keys()) > 2: - update = True - associations[key] = { - "_id": val["_id"], - "type": val.get("type", "text"), - } - elif val and val.get("_id") and len(val.keys()) == 1: - type_ = mongodb_database[resource].find_one({"_id": val["_id"]}, {"type": 1}) - if type_: - update = True - associations[key] = val - associations[key]["type"] = type_["type"] - else: - associations[key] = val - if update: - try: - _id = ObjectId(item["_id"]) - except InvalidId: - _id = item["_id"] - # must update twice, otherwise it merges the changes - service.system_update(_id, {"associations": None}, item) - service.system_update(_id, {"associations": associations}, item) - - def backwards(self, mongodb_collection, mongodb_database): - pass diff --git a/superdesk/data_updates/00019_20190924-104943_roles.py b/superdesk/data_updates/00019_20190924-104943_roles.py deleted file mode 100644 index 0804a3dc1a..0000000000 --- a/superdesk/data_updates/00019_20190924-104943_roles.py +++ /dev/null @@ -1,37 +0,0 @@ -# -*- coding: utf-8; -*- -# This file is part of Superdesk. -# For the full copyright and license information, please see the -# AUTHORS and LICENSE files distributed with this source code, or -# at https://www.sourcefabric.org/superdesk/license -# -# Author : petr -# Creation: 2019-09-24 10:49 - -from superdesk.commands.data_updates import BaseDataUpdate - - -class DataUpdate(BaseDataUpdate): - resource = "roles" - privileges = [ - "publisher_dashboard", - "planning_assignments_view", - "monitoring_view", - "spike_read", - "highlights_read", - "use_global_saved_searches", - "dashboard", - "ansa_metasearch", - "ansa_live_assistant", - "ansa_ai_news", - ] - - def forwards(self, mongodb_collection, mongodb_database): - updates = {} - for privilege in self.privileges: - updates["privileges.{}".format(privilege)] = 1 - - result = mongodb_collection.update_many({}, {"$set": updates}) - print("updated {}/{} roles".format(result.modified_count, result.matched_count)) - - def backwards(self, mongodb_collection, mongodb_database): - pass diff --git a/superdesk/data_updates/00020_20191106-180807_archive.py b/superdesk/data_updates/00020_20191106-180807_archive.py deleted file mode 100644 index add2fc56f1..0000000000 --- a/superdesk/data_updates/00020_20191106-180807_archive.py +++ /dev/null @@ -1,61 +0,0 @@ -# -*- coding: utf-8; -*- -# This file is part of Superdesk. -# For the full copyright and license information, please see the -# AUTHORS and LICENSE files distributed with this source code, or -# at https://www.sourcefabric.org/superdesk/license -# -# Author : Jérôme -# Creation: 2019-11-06 18:08 - -from superdesk.commands.data_updates import BaseDataUpdate -from superdesk import get_resource_service -from apps.archive.common import transtype_metadata -from datetime import datetime - - -class DataUpdate(BaseDataUpdate): - resource = "archive" - - def forwards(self, mongodb_collection, mongodb_database): - vocabularies_service = get_resource_service("vocabularies") - cursor = vocabularies_service.find({"field_type": "date"}) - if cursor.count() == 0: - print('No field with "date" type, there is nothing to do') - else: - for resource in ["archive", "archive_autosave", "published"]: - collection = mongodb_database[resource] - - for item in collection.find({"extra": {"$exists": True, "$ne": {}}}): - transtype_metadata(item) - print( - collection.update( - {"_id": item["_id"]}, - { - "$set": {"extra": item["extra"]}, - }, - ) - ) - - def backwards(self, mongodb_collection, mongodb_database): - vocabularies_service = get_resource_service("vocabularies") - cursor = vocabularies_service.find({"field_type": "date"}) - if cursor.count() == 0: - print('No field with "date" type, there is nothing to do') - else: - for resource in ["archive", "archive_autosave", "published"]: - collection = mongodb_database[resource] - - for item in collection.find({"extra": {"$exists": True, "$ne": {}}}): - extra = item["extra"] - for key, value in extra.items(): - if isinstance(value, datetime): - extra[key] = value.isoformat() - - print( - collection.update( - {"_id": item["_id"]}, - { - "$set": {"extra": extra}, - }, - ) - ) diff --git a/superdesk/data_updates/00021_20191210-085727_vocabularies.py b/superdesk/data_updates/00021_20191210-085727_vocabularies.py deleted file mode 100644 index 351426a583..0000000000 --- a/superdesk/data_updates/00021_20191210-085727_vocabularies.py +++ /dev/null @@ -1,105 +0,0 @@ -# -*- coding: utf-8; -*- -# This file is part of Superdesk. -# For the full copyright and license information, please see the -# AUTHORS and LICENSE files distributed with this source code, or -# at https://www.sourcefabric.org/superdesk/license -# -# Author : MarkLark86 -# Creation: 2019-12-10 08:57 - -from superdesk import get_resource_service -from superdesk.commands.data_updates import DataUpdate as _DataUpdate -import logging -from copy import deepcopy - -logger = logging.getLogger(__name__) - -COVERAGE_PROVIDERS = "coverage_providers" -CONTACT_TYPE = "contact_type" - -CVS = { - "coverage_providers": { - "schema": {"name": {"required": True, "type": "string"}, "qcode": {"required": True, "type": "string"}} - }, - "contact_type": { - "_id": "contact_type", - "unique_field": "qcode", - "type": "manageable", - "display_name": "Contact Types", - "selection_type": "do not show", - "schema": { - "name": {"required": True, "type": "string"}, - "qcode": {"required": True, "type": "string"}, - "assignable": {"required": False, "type": "bool", "label": "Assignable"}, - }, - "items": [], - }, -} - -CONTACT_TYPE_LINK = {"required": False, "type": "string", "link_vocab": "contact_type", "link_field": "qcode"} - - -class DataUpdate(_DataUpdate): - """Add 'contact_type' and update 'coverage_providers' CVs - - Refer to https://dev.sourcefabric.org/browse/SDESK-4766 for more information - """ - - resource = "vocabularies" - - def forwards(self, mongodb_collection, mongodb_database): - self._add_contact_type_to_coverage_providers(mongodb_collection) - self._add_contact_type_cv(mongodb_collection) - - def backwards(self, mongodb_collection, mongodb_database): - self._remove_contact_type_from_coverage_providers(mongodb_collection) - self._remove_contact_type_cv(mongodb_collection) - - def _add_contact_type_to_coverage_providers(self, mongodb_collection): - coverage_providers = mongodb_collection.find_one({"_id": COVERAGE_PROVIDERS}) - - if not coverage_providers: - logger.info('"{}" CV not found. Not need to continue'.format(COVERAGE_PROVIDERS)) - return - - schema = coverage_providers.get("schema") or deepcopy(CVS[COVERAGE_PROVIDERS]["schema"]) - - if not schema.get("contact_type"): - schema["contact_type"] = CONTACT_TYPE_LINK - - items = coverage_providers.get("items") or [] - for item in items: - if not item.get("contact_type"): - item["contact_type"] = "" - - mongodb_collection.update({"_id": COVERAGE_PROVIDERS}, {"$set": {"schema": schema, "items": items}}) - - def _remove_contact_type_from_coverage_providers(self, mongodb_collection): - coverage_providers = mongodb_collection.find_one({"_id": COVERAGE_PROVIDERS}) - - if not coverage_providers: - logger.info('"{}" CV not found. Not need to continue'.format(COVERAGE_PROVIDERS)) - return - - schema = coverage_providers.get("schema") or deepcopy(CVS[COVERAGE_PROVIDERS]["schema"]) - schema.pop("contact_type", None) - - items = coverage_providers.get("items") or [] - for item in items: - item.pop("contact_type", None) - - mongodb_collection.update({"_id": COVERAGE_PROVIDERS}, {"$set": {"schema": schema, "items": items}}) - - def _add_contact_type_cv(self, mongodb_collection): - if mongodb_collection.find_one({"_id": CONTACT_TYPE}): - logger.info('"{}" CV already defined. Nothing to do'.format(CONTACT_TYPE)) - return - - get_resource_service(self.resource).post([CVS[CONTACT_TYPE]]) - - def _remove_contact_type_cv(self, mongodb_collection): - if not mongodb_collection.find_one({"_id": CONTACT_TYPE}): - logger.info('"{}" CV not defined. Nothing to do'.format(CONTACT_TYPE)) - return - - get_resource_service(self.resource).delete_action({"_id": CONTACT_TYPE}) diff --git a/superdesk/data_updates/00022_20200309-121947_archive.py b/superdesk/data_updates/00022_20200309-121947_archive.py deleted file mode 100644 index 0e0c0279be..0000000000 --- a/superdesk/data_updates/00022_20200309-121947_archive.py +++ /dev/null @@ -1,43 +0,0 @@ -# -*- coding: utf-8; -*- -# This file is part of Superdesk. -# For the full copyright and license information, please see the -# AUTHORS and LICENSE files distributed with this source code, or -# at https://www.sourcefabric.org/superdesk/license -# -# Author : GyanP -# Creation: 2020-03-09 12:19 - -from bson import ObjectId -from bson.errors import InvalidId -from superdesk import get_resource_service -from superdesk.vocabularies import is_related_content -from superdesk.commands.data_updates import BaseDataUpdate - - -class DataUpdate(BaseDataUpdate): - resource = "archive" - - def forwards(self, mongodb_collection, mongodb_database): - for resource in ("archive", "published"): - service = get_resource_service(resource) - for item in mongodb_database[resource].find({"associations": {"$exists": "true", "$nin": [{}, None]}}): - update = False - associations = {} - try: - for key, val in item["associations"].items(): - associations[key] = val - if val and is_related_content(key) and val.get("order", None) is None: - update = True - order = int(key.split("--")[1]) - associations[key]["order"] = order - except AttributeError: - pass - if update: - try: - _id = ObjectId(item["_id"]) - except InvalidId: - _id = item["_id"] - service.system_update(_id, {"associations": associations}, item) - - def backwards(self, mongodb_collection, mongodb_database): - raise NotImplementedError() diff --git a/superdesk/data_updates/00023_20200513-180314_content_types.py b/superdesk/data_updates/00023_20200513-180314_content_types.py deleted file mode 100644 index 018b9a1ac7..0000000000 --- a/superdesk/data_updates/00023_20200513-180314_content_types.py +++ /dev/null @@ -1,54 +0,0 @@ -# -*- coding: utf-8; -*- -# This file is part of Superdesk. -# For the full copyright and license information, please see the -# AUTHORS and LICENSE files distributed with this source code, or -# at https://www.sourcefabric.org/superdesk/license -# -# Author : GyanP -# Creation: 2020-05-13 18:03 - -from copy import deepcopy -from superdesk.commands.data_updates import BaseDataUpdate -from superdesk.resource_fields import ID_FIELD - - -class DataUpdate(BaseDataUpdate): - resource = "content_types" - - def forwards(self, mongodb_collection, mongodb_database): - for content_type in mongodb_collection.find({}): - if "schema" not in content_type: - continue - original_schema = deepcopy(content_type["schema"]) - for field, description in content_type["schema"].items(): - if description and description.get("mandatory_in_list"): - custom_fields = description.get("mandatory_in_list").get("scheme") - if custom_fields is not None: - for custom_field, custom_value in custom_fields.items(): - # old notation - if custom_field == custom_value: - custom_fields[custom_field] = { - "required": True, - "readonly": False, - } - # new notation - elif type(custom_value) is dict: - custom_fields[custom_field] = { - "required": custom_value.get("required", False), - "readonly": custom_value.get("readonly", False), - } - # default - else: - custom_fields[custom_field] = { - "required": False, - "readonly": False, - } - - if original_schema != content_type["schema"]: - print("update schema in content type", content_type["label"]) - mongodb_collection.update( - {"_id": content_type.get(ID_FIELD)}, {"$set": {"schema": content_type["schema"]}} - ) - - def backwards(self, mongodb_collection, mongodb_database): - raise NotImplementedError() diff --git a/superdesk/data_updates/00024_20200909-142600_vocabularies.py b/superdesk/data_updates/00024_20200909-142600_vocabularies.py deleted file mode 100644 index f5e589da4a..0000000000 --- a/superdesk/data_updates/00024_20200909-142600_vocabularies.py +++ /dev/null @@ -1,23 +0,0 @@ -# -*- coding: utf-8; -*- -# This file is part of Superdesk. -# For the full copyright and license information, please see the -# AUTHORS and LICENSE files distributed with this source code, or -# at https://www.sourcefabric.org/superdesk/license -# -# Author : pablopunk -# Creation: 2020-09-09 14:08 - -from superdesk.commands.data_updates import BaseDataUpdate -from superdesk.resource_fields import ID_FIELD - - -class DataUpdate(BaseDataUpdate): - resource = "vocabularies" - - def forwards(self, mongodb_collection, mongodb_database): - for vocabulary in mongodb_collection.find({"_id": "usageterms"}): - if "schema_field" not in vocabulary: - mongodb_collection.update({"_id": vocabulary.get(ID_FIELD)}, {"$set": {"schema_field": "usageterms"}}) - - def backwards(self, mongodb_collection, mongodb_database): - pass diff --git a/superdesk/data_updates/00025_20201104-001648_content_templates.py b/superdesk/data_updates/00025_20201104-001648_content_templates.py deleted file mode 100644 index c907741a48..0000000000 --- a/superdesk/data_updates/00025_20201104-001648_content_templates.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8; -*- -# This file is part of Superdesk. -# For the full copyright and license information, please see the -# AUTHORS and LICENSE files distributed with this source code, or -# at https://www.sourcefabric.org/superdesk/license -# -# Author : administrator -# Creation: 2020-11-04 00:16 - -import pymongo.errors - -from superdesk.commands.data_updates import BaseDataUpdate - - -class DataUpdate(BaseDataUpdate): - resource = "content_templates" - - def forwards(self, mongodb_collection, mongodb_database): - try: - mongodb_collection.drop_index("user_1_template_name_1") - except pymongo.errors.OperationFailure: - pass - - def backwards(self, mongodb_collection, mongodb_database): - pass diff --git a/superdesk/data_updates/00026_20201118-160601_sequences.py b/superdesk/data_updates/00026_20201118-160601_sequences.py deleted file mode 100644 index 96f53645a0..0000000000 --- a/superdesk/data_updates/00026_20201118-160601_sequences.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8; -*- -# This file is part of Superdesk. -# For the full copyright and license information, please see the -# AUTHORS and LICENSE files distributed with this source code, or -# at https://www.sourcefabric.org/superdesk/license -# -# Author : petr -# Creation: 2020-11-18 16:06 - -from superdesk.commands.data_updates import BaseDataUpdate - - -class DataUpdate(BaseDataUpdate): - resource = "sequences" - - def forwards(self, mongodb_collection, mongodb_database): - return mongodb_collection.delete_many({"key": None}) - - def backwards(self, mongodb_collection, mongodb_database): - pass diff --git a/superdesk/data_updates/00028_20210211-020113_contacts.py b/superdesk/data_updates/00028_20210211-020113_contacts.py deleted file mode 100644 index 7803f4b989..0000000000 --- a/superdesk/data_updates/00028_20210211-020113_contacts.py +++ /dev/null @@ -1,38 +0,0 @@ -# -*- coding: utf-8; -*- -# This file is part of Superdesk. -# For the full copyright and license information, please see the -# AUTHORS and LICENSE files distributed with this source code, or -# at https://www.sourcefabric.org/superdesk/license -# -# Author : administrator -# Creation: 2021-02-10 18:44 - -from superdesk import get_resource_service -from superdesk.commands.data_updates import BaseDataUpdate -from superdesk.resource_fields import ID_FIELD - - -class DataUpdate(BaseDataUpdate): - resource = "contacts" - - def forwards(self, mongodb_collection, mongodb_database): - countries = get_resource_service("vocabularies").find_one(req=None, _id="countries") - for document in mongodb_collection.find({"country": {"$exists": True}}): - if document.get("country") and countries: - country = [t for t in countries.get("items") if t.get("name") == document["country"]] - if country: - mongodb_collection.update( - {"_id": document.get(ID_FIELD)}, - { - "$set": { - "country": { - "name": country[0].get("name"), - "qcode": country[0].get("qcode"), - "translations": country[0].get("translations"), - } - } - }, - ) - - def backwards(self, mongodb_collection, mongodb_database): - raise NotImplementedError() diff --git a/superdesk/data_updates/00029_20210305-132352_contacts.py b/superdesk/data_updates/00029_20210305-132352_contacts.py deleted file mode 100644 index 87b5d981e7..0000000000 --- a/superdesk/data_updates/00029_20210305-132352_contacts.py +++ /dev/null @@ -1,44 +0,0 @@ -# -*- coding: utf-8; -*- -# This file is part of Superdesk. -# For the full copyright and license information, please see the -# AUTHORS and LICENSE files distributed with this source code, or -# at https://www.sourcefabric.org/superdesk/license -# -# Author : rails -# Creation: 2021-03-05 13:23 - -from superdesk import get_resource_service -from superdesk.commands.data_updates import BaseDataUpdate -from superdesk.resource_fields import ID_FIELD - - -class DataUpdate(BaseDataUpdate): - resource = "contacts" - - def forwards(self, mongodb_collection, mongodb_database): - regions = get_resource_service("vocabularies").find_one(req=None, _id="regions") - for document in mongodb_collection.find({"contact_state": {"$exists": True}}): - if document.get("contact_state") and regions: - region = [t for t in regions.get("items") if t.get("name") == document["contact_state"]] - if region: - contact_state = { - "contact_state": { - "name": region[0].get("name"), - "qcode": region[0].get("qcode"), - "translations": region[0].get("translations"), - } - } - else: - contact_state = { - "contact_state": { - "name": document["contact_state"], - "qcode": document["contact_state"], - } - } - mongodb_collection.update( - {"_id": document.get(ID_FIELD)}, - {"$set": contact_state}, - ) - - def backwards(self, mongodb_collection, mongodb_database): - raise NotImplementedError() diff --git a/superdesk/data_updates/00030_20231127-142300_content_types.py b/superdesk/data_updates/00030_20231127-142300_content_types.py deleted file mode 100644 index 29532f9261..0000000000 --- a/superdesk/data_updates/00030_20231127-142300_content_types.py +++ /dev/null @@ -1,31 +0,0 @@ -# -*- coding: utf-8; -*- -# This file is part of Superdesk. -# For the full copyright and license information, please see the -# AUTHORS and LICENSE files distributed with this source code, or -# at https://www.sourcefabric.org/superdesk/license -# -# Author : Ketan -# Creation: 2023-11-27 14:23 - -from superdesk.commands.data_updates import BaseDataUpdate -from superdesk.resource_fields import ID_FIELD - - -class DataUpdate(BaseDataUpdate): - resource = "content_types" - - def forwards(self, mongodb_collection, mongodb_database): - for profile in mongodb_collection.find({}): - try: - editor = profile.get("editor", {}) - for field, properties in editor.items(): - if properties and "sdWidth" not in properties: - properties["sdWidth"] = "full" - - mongodb_collection.update({"_id": profile.get(ID_FIELD)}, {"$set": {"editor": profile["editor"]}}) - print(f"Content Profile {profile['_id']} updated successfully") - except Exception as e: - print(f"Error updating Content Profile {profile['_id']}: {str(e)}") - - def backwards(self, mongodb_collection, mongodb_database): - raise NotImplementedError() diff --git a/superdesk/data_updates/00032_20240404-123019_content_types.py b/superdesk/data_updates/00032_20240404-123019_content_types.py deleted file mode 100644 index 398a0559e7..0000000000 --- a/superdesk/data_updates/00032_20240404-123019_content_types.py +++ /dev/null @@ -1,34 +0,0 @@ -# -*- coding: utf-8; -*- -# This file is part of Superdesk. -# For the full copyright and license information, please see the -# AUTHORS and LICENSE files distributed with this source code, or -# at https://www.sourcefabric.org/superdesk/license -# -# Author : petr -# Creation: 2024-04-04 12:30 - -from superdesk.commands.data_updates import BaseDataUpdate - - -class DataUpdate(BaseDataUpdate): - resource = "content_types" - - def forwards(self, mongodb_collection, mongodb_database): - mongodb_collection.update_many( - {"type": {"$exists": False}, "_id": {"$nin": ["text", "picture", "video", "audio"]}}, - { - "$set": { - "type": "text", - }, - }, - ) - - def backwards(self, mongodb_collection, mongodb_database): - mongodb_collection.update_many( - {"type": "text"}, - { - "$unset": { - "type": 1, - }, - }, - ) diff --git a/tests/test_instance/server/requirements.txt b/tests/test_instance/server/requirements.txt index 0edc55c1be..29cc1710eb 100644 --- a/tests/test_instance/server/requirements.txt +++ b/tests/test_instance/server/requirements.txt @@ -1,4 +1,5 @@ -e ../../../. --e git+https://github.com/superdesk/superdesk-planning.git@async#egg=superdesk_planning --e git+https://github.com/superdesk/sams.git@develop#egg=sams_client&subdirectory=src/clients/python/ \ No newline at end of file +# Keep testing of instance build to Superdesk only for now +# -e git+https://github.com/superdesk/superdesk-planning.git@async#egg=superdesk_planning +# -e git+https://github.com/superdesk/sams.git@develop#egg=sams_client&subdirectory=src/clients/python/